*/ use AdvancedAds\Utilities\WordPress; if ( ! defined( 'NOTICE_TYPES' ) ) { define( 'NOTICE_TYPES', [ 'info' => 'info', 'subscribe' => 'subscribe', 'error' => 'plugin_error', 'promo' => 'promo', ] ); } // These add-on names correspond to the names in the class of constants from ADDONS_NON_COMPATIBLE_VERSIONS. $manual_addons = [ 'advanced-ads-page-peel' => [ 'title' => 'Advanced Ads Page Peel', 'zip' => esc_url( 'https://wpadvancedads.com/wp-content/uploads/advanced-ads-page-peel.zip' ), 'link' => esc_url( 'https://wpadvancedads.com/manual/how-to-install-an-add-on/?utm_source=advanced-ads&utm_medium=link&utm_campaign=notice-update-pagepeel-a220' ), ], 'advanced-ads-browser-language' => [ 'title' => 'Advanced Ads Browser Language Visitor Condition', 'zip' => esc_url( 'https://wpadvancedads.com/wp-content/uploads/advanced-ads-browser-language.zip' ), 'link' => esc_url( 'https://wpadvancedads.com/manual/how-to-install-an-add-on/?utm_source=advanced-ads&utm_medium=link&utm_campaign=notice-update-browserlang-a220' ), ], 'slider-ads' => [ 'title' => 'Advanced Ads Ad Slider', 'zip' => esc_url( 'https://wpadvancedads.com/wp-content/uploads/advanced-ads-slider.zip' ), 'link' => esc_url( 'https://wpadvancedads.com/manual/how-to-install-an-add-on/?utm_source=advanced-ads&utm_medium=link&utm_campaign=notice-update-adslider-a220' ), ], ]; $advanced_ads_admin_notices = [ // email tutorial. 'nl_first_steps' => [ 'type' => NOTICE_TYPES['subscribe'], 'text' => __( 'Thank you for activating Advanced Ads. Would you like to receive the first steps via email?', 'advanced-ads' ), 'confirm_text' => __( 'Yes, send it', 'advanced-ads' ), 'global' => true, ], // free add-ons. 'nl_free_addons' => [ 'type' => NOTICE_TYPES['subscribe'], 'text' => __( 'Hey, welcome to Advanced Ads! Join our newsletter and snag 2 free add-ons plus our email intro course. It’s the perfect way to get started smoothly!', 'advanced-ads' ), 'confirm_text' => __( 'Subscribe me now', 'advanced-ads' ), 'global' => false, ], // adsense newsletter group. 'nl_adsense' => [ 'type' => NOTICE_TYPES['subscribe'], 'text' => __( 'Learn more about how and how much you can earn with AdSense and Advanced Ads from my dedicated newsletter.', 'advanced-ads' ), 'global' => true, ], // missing license codes. 'license_invalid' => [ 'type' => NOTICE_TYPES['error'], 'text' => __( 'One or more license keys for Advanced Ads add-ons are invalid or missing.', 'advanced-ads' ) . ' ' /* translators: %s is a target URL. */ . sprintf( __( 'Please add valid license keys here.', 'advanced-ads' ), get_admin_url( null, 'admin.php?page=advanced-ads-settings#top#licenses' ) ), ], // please review. 'review' => [ 'type' => NOTICE_TYPES['info'], // 'text' => 'Thomas' 'text' => '
' . WordPress::get_count_ads() . '
' . '
' . '

' . __( '… ads created using Advanced Ads.', 'advanced-ads' ) . '

' . '

' . __( 'Do you find the plugin useful and would like to thank us for updates, fixing bugs and improving your ad setup?', 'advanced-ads' ) . '

' . '

' . /* translators: this belongs to our message asking the user for a review. You can find a nice equivalent in your own language. */ __( 'When you give 5-stars, an actual person does a little happy dance!', 'advanced-ads' ) . '

' . '

' . ' ' . __( 'Sure, I appreciate your work', 'advanced-ads' ) . '' . '    ' . __( 'Yes, but help me first to solve a problem, please', 'advanced-ads' ) . '' . '

', 'global' => false, ], // Black Friday 2023 promotion. 'bfcm23' => [ 'type' => NOTICE_TYPES['promo'], 'text' => sprintf( /* translators: %1$s is the markup for the discount value, %2$s starts a button link, %3$s closes the button link. */ __( 'Save %1$s on all products with our Black Friday / Cyber Monday offer! %2$sGet this deal%3$s', 'advanced-ads' ), '30%', '', '' ), 'global' => true, ], 'monetize_wizard' => [ 'type' => NOTICE_TYPES['info'], 'text' => sprintf( wp_kses_post( /* translators: %s: URL to the Advanced Ads onboarding wizard. */ __( 'Quickly set up Advanced Ads and monetize your website with just a few clicks. Launch the wizard', 'advanced-ads' ) ), admin_url( 'admin.php?page=advanced-ads-onboarding' ) ), ], ]; // Add specific notifications for plugins that are incompatible with Advanced Ads 2.0. foreach ( \AdvancedAds\Constants::ADDONS_NON_COMPATIBLE_VERSIONS as $version => $addon ) { if ( isset( $manual_addons[ $addon ] ) ) { $advanced_ads_admin_notices[ $addon . '_upgrade' ] = [ 'type' => NOTICE_TYPES['info'], 'text' => sprintf( wp_kses( /* translators: %1$s: URL to the plugin file, %2$s: URL to the guide */ __( 'Your automatically deactivated version of %1$s needs to be updated manually. Please download the newest plugin file and follow our guide on How to install an add-on.', 'advanced-ads' ), [ 'strong' => [], 'a' => [ 'href' => [], 'target' => [], ], ] ), $manual_addons[ $addon ]['title'], $manual_addons[ $addon ]['zip'], $manual_addons[ $addon ]['link'], ), 'global' => true, ]; } else { $advanced_ads_admin_notices[ $addon . '_upgrade' ] = [ 'type' => NOTICE_TYPES['info'], 'text' => sprintf( wp_kses( /* translators: %1$s: URL to the plugin file, %2$s: URL to the guide */ __( 'Your version of %1$s is incompatible with Advanced Ads %2$s and has been deactivated. Please update the plugin to the latest version.', 'advanced-ads' ), [ 'strong' => [], ] ), ucwords( str_replace( '-', ' ', $addon ) ), ADVADS_VERSION, ), 'global' => true, ]; } } $advanced_ads_admin_notices = apply_filters( 'advanced-ads-notices', $advanced_ads_admin_notices );