PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.9.4
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.9.4
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | vendor/codeinwp/themeisle-sdk/src/Modules/Dashboard_widget.php +6 -41 4.0.33.9.4 View file →
@@ -11,9 +11,8 @@
11 11
12 12 namespace ThemeisleSDK\Modules;
13 13
14 14 use ThemeisleSDK\Common\Abstract_Module;
15 -use ThemeisleSDK\Loader;
16 15 use ThemeisleSDK\Product;
17 16
18 17 // Exit if accessed directly.
19 18 if ( ! defined( 'ABSPATH' ) ) {
@@ -76,14 +75,13 @@
76 75 if ( apply_filters( 'themeisle_sdk_hide_dashboard_widget', false ) ) {
77 76 return;
78 77 }
79 78 $this->product = $product;
80 - $this->dashboard_name = apply_filters( 'themeisle_sdk_dashboard_widget_name', Loader::$labels['dashboard_widget']['title'] );
79 + $this->dashboard_name = apply_filters( 'themeisle_sdk_dashboard_widget_name', 'WordPress Guides/Tutorials' );
81 80 $this->feeds = apply_filters(
82 81 'themeisle_sdk_dashboard_widget_feeds',
83 82 [
84 83 'https://themeisle.com/blog/feed',
85 - 'https://wpshout.com/feed',
86 84 ]
87 85 );
88 86 add_action( 'wp_dashboard_setup', array( &$this, 'add_widget' ) );
89 87 add_action( 'wp_network_dashboard_setup', array( &$this, 'add_widget' ) );
@@ -279,9 +277,9 @@
279 277 }
280 278 ?>
281 279 <div class="ti-dw-footer">
282 280 <span class="ti-dw-recommend-item ">
283 - <span class="ti-dw-recommend"><?php echo esc_attr( apply_filters( 'themeisle_sdk_dashboard_popular_label', sprintf( Loader::$labels['dashboard_widget']['popular'], ucwords( $type ) ) ) ); ?>
281 + <span class="ti-dw-recommend"><?php echo esc_attr( apply_filters( 'themeisle_sdk_dashboard_popular_label', sprintf( 'Popular %s', ucwords( $type ) ) ) ); ?>
284 282 : </span>
285 283 <?php
286 284 echo esc_attr(
287 285 trim(
@@ -298,11 +296,11 @@
298 296 )
299 297 );
300 298 ?>
301 299 (<a class="thickbox open-plugin-details-modal"
302 - href="<?php echo esc_url( $url . '&TB_iframe=true&width=600&height=500' ); ?>"><?php echo esc_attr( apply_filters( 'themeisle_sdk_dashboard_install_label', Loader::$labels['dashboard_widget']['install'] ) ); ?></a>)
300 + href="<?php echo esc_url( $url . '&TB_iframe=true&width=600&height=500' ); ?>"><?php echo esc_attr( apply_filters( 'themeisle_sdk_dashboard_install_label', 'Install' ) ); ?></a>)
303 301 </span>
304 - <span class="ti-dw-powered-by"><span><?php echo esc_attr( apply_filters( 'themeisle_sdk_dashboard_widget_powered_by', sprintf( Loader::$labels['dashboard_widget']['powered'], $this->product->get_friendly_name() ) ) ); ?></span></span>
302 + <span class="ti-dw-powered-by"><span><?php echo esc_attr( apply_filters( 'themeisle_sdk_dashboard_widget_powered_by', sprintf( 'Powered by %s', $this->product->get_friendly_name() ) ) ); ?></span></span>
305 303 </div>
306 304
307 305 <?php
308 306
@@ -312,39 +310,10 @@
312 310 * Setup feed items.
313 311 */
314 312 private function setup_feeds() {
315 313 if ( false === ( $items_normalized = get_transient( 'themeisle_sdk_feed_items' ) ) ) { //phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure
316 - // Do not force the feed for the items in the sdk feeds list.
317 - // this prevents showing notices if another plugin will force all SimplePie feeds to load, instead it will
318 - // use the regular SimplePie validation and abort early if the feed is not valid.
319 - $sdk_feeds = $this->feeds;
320 - add_action(
321 - 'wp_feed_options',
322 - function ( $feed, $url ) use ( $sdk_feeds ) {
323 - if ( defined( 'TI_SDK_PHPUNIT' ) && true === TI_SDK_PHPUNIT ) {
324 - return;
325 - }
326 -
327 - if ( ! is_string( $url ) && in_array( $url, $sdk_feeds, true ) ) {
328 - $feed->force_feed( false );
329 -
330 - return;
331 - }
332 - if ( is_array( $url ) ) {
333 - foreach ( $url as $feed_url ) {
334 - if ( in_array( $feed_url, $sdk_feeds, true ) ) {
335 - $feed->force_feed( false );
336 -
337 - return;
338 - }
339 - }
340 - }
341 - },
342 - PHP_INT_MAX,
343 - 2
344 - );
345 314 // Load SimplePie Instance.
346 - $feed = fetch_feed( $sdk_feeds );
315 + $feed = fetch_feed( $this->feeds );
347 316 // TODO report error when is an error loading the feed.
348 317 if ( is_wp_error( $feed ) ) {
349 318 return;
350 319 }
@@ -349,13 +318,9 @@
349 318 return;
350 319 }
351 320
352 321 $items = $feed->get_items( 0, 5 );
353 - $items = is_array( $items ) ? $items : [];
354 -
355 - $items_normalized = [];
356 -
357 - foreach ( $items as $item ) {
322 + foreach ( (array) $items as $item ) {
358 323 $items_normalized[] = array(
359 324 'title' => $item->get_title(),
360 325 'date' => $item->get_date( 'U' ),
361 326 'link' => $item->get_permalink(),