PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 4.0.8
Visualizer – Tables & Charts Manager with Built-in AI Generator v4.0.8
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/Promotions.php +23 -2 4.0.34.0.8 View file →
@@ -119,8 +119,15 @@
119 119 */
120 120 private $loaded_promo;
121 121
122 122 /**
123 + * Whether promotions were processed for the current screen.
124 + *
125 + * @var bool
126 + */
127 + private $available_promotions_loaded = false;
128 +
129 + /**
123 130 * Woo promotions.
124 131 *
125 132 * @var array
126 133 */
@@ -208,9 +215,9 @@
208 215 add_filter( 'option_visualizer-activated', array( $this, 'suppress_visualizer_onboarding_in_editor' ) );
209 216 add_filter( 'themeisle_sdk_ran_promos', '__return_true' );
210 217
211 218 if ( get_option( $this->option_neve, false ) !== true ) {
212 - add_action( 'wp_ajax_themeisle_sdk_dismiss_notice', 'ThemeisleSDK\Modules\Notification::regular_dismiss' );
219 + add_action( 'wp_ajax_themeisle_sdk_dismiss_notice', 'ThemeisleSDK\Modules\Notification::dismiss' );
213 220 }
214 221 }
215 222
216 223
@@ -412,9 +419,14 @@
412 419 /**
413 420 * Load available promotions.
414 421 */
415 422 public function load_available() {
416 - $this->promotions = $this->filter_by_screen_and_merge();
423 + if ( $this->available_promotions_loaded ) {
424 + return;
425 + }
426 +
427 + $this->available_promotions_loaded = true;
428 + $this->promotions = $this->filter_by_screen_and_merge();
417 429 if ( empty( $this->promotions ) ) {
418 430 return;
419 431 }
420 432
@@ -828,9 +840,18 @@
828 840 $product_install_time = (int) $this->product->get_install_time();
829 841 $is_older = time() > ( $product_install_time + ( 3 * DAY_IN_SECONDS ) );
830 842 $is_newer = time() < ( $product_install_time + ( 6 * HOUR_IN_SECONDS ) );
831 843 foreach ( $this->promotions as $slug => $promos ) {
844 + if ( ! is_array( $promos ) ) {
845 + continue;
846 + }
847 +
832 848 foreach ( $promos as $key => $data ) {
849 + if ( ! is_array( $data ) || ! array_key_exists( 'screen', $data ) ) {
850 + unset( $this->promotions[ $slug ][ $key ] );
851 +
852 + continue;
853 + }
833 854
834 855 $data = wp_parse_args(
835 856 $data,
836 857 [