| @@ -4,10 +4,12 @@ | ||
| 4 | 4 | |
| 5 | 5 | use YayMail\Utils\SingletonTrait; |
| 6 | 6 | use YayMail\Notices\Ajax; |
| 7 | 7 | use YayMail\SupportedPlugins; |
| 8 | + | |
| 8 | 9 | use YayMail\Utils\Logger; |
| 9 | 10 | |
| 11 | + | |
| 10 | 12 | /** |
| 11 | 13 | * |
| 12 | 14 | * @method static NoticeMain get_instance() |
| 13 | 15 | */ |
| @@ -28,11 +30,8 @@ | ||
| 28 | 30 | $this->init_hooks(); |
| 29 | 31 | } |
| 30 | 32 | |
| 31 | 33 | protected function init_hooks() { |
| 32 | - if ( ! function_exists( 'YayMail\init' ) ) { | |
| 33 | - return; | |
| 34 | - } | |
| 35 | 34 | // Show recommendation notice |
| 36 | 35 | if ( time() >= (int) get_option( 'yaymail_next_recommendation_suggest_addons_notice_time' ) ) { |
| 37 | 36 | add_action( 'admin_notices', [ $this, 'render_suggest_addons_notice' ] ); |
| 38 | 37 | } |
| @@ -42,9 +41,9 @@ | ||
| 42 | 41 | } |
| 43 | 42 | |
| 44 | 43 | if ( is_admin() ) { |
| 45 | 44 | if ( time() >= (int) get_option( 'yaymail_next_recommendation_notice_time' ) || time() >= (int) get_option( 'yaymail_next_recommendation_suggest_addons_notice_time' ) || time() >= (int) get_option( 'yaymail_next_recommendation_upgrade_notice_time' ) ) { |
| 46 | - wp_enqueue_script( 'yaymail-notice', YAYMAIL_PLUGIN_URL . 'assets/scripts/notice.js', [ 'jquery' ], yaymail_version(), false ); | |
| 45 | + wp_enqueue_script( 'yaymail-notice', YAYMAIL_PLUGIN_URL . 'assets/scripts/notice.js', [ 'jquery' ], YAYMAIL_VERSION, false ); | |
| 47 | 46 | } |
| 48 | 47 | |
| 49 | 48 | wp_localize_script( |
| 50 | 49 | 'yaymail-notice', |
| @@ -78,15 +77,14 @@ | ||
| 78 | 77 | } |
| 79 | 78 | $plugin_data = $plugins[ $key ]; |
| 80 | 79 | $is_yaycommerce_author = isset( $plugin_data['Author'] ) && strpos( $plugin_data['Author'], 'YayCommerce' ) !== false; |
| 81 | 80 | |
| 82 | - $is_email_builder = strpos( $key, 'email-builder' ) !== false; | |
| 83 | 81 | return $is_yaycommerce_author && ( |
| 84 | 82 | strpos( $key, 'yaymail-addon' ) !== false || |
| 85 | 83 | strpos( $key, 'email-customizer' ) !== false || |
| 86 | 84 | strpos( $key, 'yaymail-premium-addon' ) !== false || |
| 87 | 85 | strpos( $key, 'yaymail-conditional-logic' ) !== false |
| 88 | - ) && ! $is_email_builder; | |
| 86 | + ); | |
| 89 | 87 | }, |
| 90 | 88 | ARRAY_FILTER_USE_KEY |
| 91 | 89 | ); |
| 92 | 90 | |