diff --git a/css/settings.css b/css/settings.css index d52896b6a..d5988f4fc 100644 --- a/css/settings.css +++ b/css/settings.css @@ -113,6 +113,28 @@ .post-type-feedzy_imports:not(.edit-post) .wrap div#side-sortables{ display: none; } + +.feedzy-banner:has(.tsdk-banner-cta) { + margin: 0 auto; + display: flex; + justify-content: center; + margin-bottom: 20px; +} + +.feedzy-banner .tsdk-banner-urgency-text { + padding: 5px; +} + +.feedzy-banner-dashboard:has(.tsdk-banner-cta) { + margin: 20px 0; + + /* Remove the properties added by .notice */ + background: transparent; + border: unset; + box-shadow: unset; + padding: unset; +} + .feedzy-container{ max-width: 1224px; margin: 0 auto; diff --git a/img/black-friday-banner.png b/img/black-friday-banner.png deleted file mode 100644 index 44936dc3a..000000000 Binary files a/img/black-friday-banner.png and /dev/null differ diff --git a/img/black-friday.jpg b/img/black-friday.jpg new file mode 100644 index 000000000..06aee832e Binary files /dev/null and b/img/black-friday.jpg differ diff --git a/includes/admin/feedzy-rss-feeds-admin.php b/includes/admin/feedzy-rss-feeds-admin.php index 0066a6f5f..40e90092d 100644 --- a/includes/admin/feedzy-rss-feeds-admin.php +++ b/includes/admin/feedzy-rss-feeds-admin.php @@ -130,6 +130,7 @@ public function enqueue_styles_admin() { if ( 'feedzy_imports' === $screen->post_type && 'edit' === $screen->base ) { $this->register_survey(); + $this->add_banner_anchor(); } if ( 'feedzy_categories' === $screen->post_type ) { @@ -158,6 +159,7 @@ public function enqueue_styles_admin() { ); $this->register_survey(); + $this->add_banner_anchor(); } if ( 'feedzy_page_feedzy-settings' === $screen->base ) { @@ -181,6 +183,17 @@ public function enqueue_styles_admin() { $this->register_survey(); } + if ( + 'feedzy_page_feedzy-settings' === $screen->base || + 'feedzy_categories' === $screen->post_type || + ( 'feedzy_imports' === $screen->post_type && 'edit' === $screen->base ) + ) { + $license_data = get_option( 'feedzy_rss_feeds_pro_license_data', array() ); + if ( self::plan_category( $license_data ) <= 1 ) { + do_action( 'themeisle_sdk_load_banner', 'feedzy' ); + } + } + $upsell_screens = array( 'feedzy-rss_page_feedzy-settings', 'feedzy-rss_page_feedzy-admin-menu-pro-upsell' ); if ( 'feedzy_imports' === $screen->post_type && 'edit' !== $screen->base ) { @@ -211,7 +224,8 @@ public function enqueue_styles_admin() { return; } - if ( 'feedzy_page_feedzy-support' === $screen->base || ( 'edit' !== $screen->base && 'feedzy_imports' === $screen->post_type ) ) { + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( 'feedzy_page_feedzy-support' === $screen->base && ( isset( $_GET['tab'] ) && 'improve' === $_GET['tab'] ) || ( 'edit' !== $screen->base && 'feedzy_imports' === $screen->post_type ) ) { $this->register_survey(); @@ -1617,7 +1631,7 @@ public function api_license_status() { * @param object $license_data The license data. * @return int */ - private static function plan_category( $license_data ) { + public static function plan_category( $license_data ) { if ( ! isset( $license_data->plan ) || ! is_numeric( $license_data->plan ) ) { return 0; // Free @@ -1712,5 +1726,17 @@ public function register_survey() { do_action( 'themeisle_sdk_dependency_enqueue_script', 'survey' ); wp_enqueue_script( $this->plugin_name . '_survey', FEEDZY_ABSURL . 'js/survey.js', array( $survey_handler ), $this->version, true ); wp_localize_script( $this->plugin_name . '_survey', 'feedzySurveyData', $this->get_survery_metadata() ); + + } + + /** + * Add banner anchor for promotions. + */ + public function add_banner_anchor() { + add_action( + 'admin_notices', function() { + echo '
'; + }, 999 + ); } } diff --git a/includes/admin/feedzy-rss-feeds-options.php b/includes/admin/feedzy-rss-feeds-options.php index 588683ca0..6a9df769c 100644 --- a/includes/admin/feedzy-rss-feeds-options.php +++ b/includes/admin/feedzy-rss-feeds-options.php @@ -48,7 +48,10 @@ public static function instance() { * Init the default values of the options class. */ public function init() { - self::$instance->options = get_option( Feedzy_Rss_Feeds::get_plugin_name() ); + self::$instance->options = get_option( Feedzy_Rss_Feeds::get_plugin_name(), array() ); + if ( ! is_array( self::$instance->options ) ) { + self::$instance->options = array(); + } } /** diff --git a/includes/feedzy-rss-feeds.php b/includes/feedzy-rss-feeds.php index e5e812b35..529d1ec9f 100644 --- a/includes/feedzy-rss-feeds.php +++ b/includes/feedzy-rss-feeds.php @@ -295,12 +295,6 @@ function () { } ); } - - if ( ! feedzy_is_pro() ) { - $offer = new Feedzy_Rss_Feeds_Limited_Offers(); - $offer->load_banner(); - } - } /** diff --git a/includes/layouts/settings.php b/includes/layouts/settings.php index 351c7b934..480491fa8 100644 --- a/includes/layouts/settings.php +++ b/includes/layouts/settings.php @@ -8,9 +8,6 @@ $help_btn_url = 'https://docs.themeisle.com/category/712-feedzy'; - $offer = new Feedzy_Rss_Feeds_Limited_Offers(); - $offer_data = feedzy_is_pro() ? array() : $offer->get_localized_data(); - if ( 'headers' === $active_tab ) { $help_btn_url = 'https://docs.themeisle.com/article/713-how-to-change-user-agent-in-feedzy'; } elseif ( 'proxy' === $active_tab ) { @@ -30,6 +27,9 @@ error ) { ?> + + +