PluginProbe
Parse.ly / 3.14.1
Parse.ly v3.14.1
3.24.1 3.24.0 3.23.7 3.23.6 3.23.5 3.23.4 3.23.3 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.17.0 3.18.0 3.18.1 3.19.0 3.19.1 3.19.2 3.19.3 3.2.0 3.2.1 3.20.0 3.20.1 3.20.2 3.20.3 All 105 releases
← All changes | src/UI/class-recommended-widget.php +5 -4 3.18.03.14.1 View file →
@@ -11,11 +11,12 @@
11 11
12 12 namespace Parsely\UI;
13 13
14 14 use Parsely\Parsely;
15 -use Parsely\Utils\Utils;
16 15 use WP_Widget;
17 16
17 +use function Parsely\Utils\get_asset_info;
18 +
18 19 use const Parsely\PARSELY_FILE;
19 20
20 21 /**
21 22 * Provides a widget with Parse.ly recommended articles.
@@ -91,9 +92,9 @@
91 92 * @param int $return_limit Number of records to retrieve; defaults to "10".
92 93 * @return string API URL.
93 94 */
94 95 private function get_api_url( string $site_id, ?int $published_within, ?string $sort, int $return_limit ): string {
95 - $related_api_endpoint = $this->parsely->get_content_api()->get_endpoint( '/related' );
96 + $related_api_endpoint = Parsely::PUBLIC_API_BASE_URL . '/related';
96 97
97 98 $query_args = array(
98 99 'apikey' => $site_id,
99 100 'sort' => $sort,
@@ -103,9 +104,9 @@
103 104 if ( null !== $published_within && 0 !== $published_within ) {
104 105 $query_args['pub_date_start'] = $published_within . 'd';
105 106 }
106 107
107 - return $related_api_endpoint->get_endpoint_url( $query_args );
108 + return add_query_arg( $query_args, $related_api_endpoint );
108 109 }
109 110
110 111 /**
111 112 * This is the widget function.
@@ -152,9 +153,9 @@
152 153 ></div>
153 154
154 155 <?php
155 156
156 - $recommended_widget_script_asset = Utils::get_asset_info( 'build/recommended-widget.asset.php' );
157 + $recommended_widget_script_asset = get_asset_info( 'build/recommended-widget.asset.php' );
157 158
158 159 wp_register_script(
159 160 'wp-parsely-recommended-widget',
160 161 plugin_dir_url( PARSELY_FILE ) . 'build/recommended-widget.js',