@@ -130,6 +130,7 @@ public function enqueue_styles_admin() {
130130
131131 if ( 'feedzy_imports ' === $ screen ->post_type && 'edit ' === $ screen ->base ) {
132132 $ this ->register_survey ();
133+ $ this ->add_banner_anchor ();
133134 }
134135
135136 if ( 'feedzy_categories ' === $ screen ->post_type ) {
@@ -158,6 +159,7 @@ public function enqueue_styles_admin() {
158159 );
159160
160161 $ this ->register_survey ();
162+ $ this ->add_banner_anchor ();
161163 }
162164
163165 if ( 'feedzy_page_feedzy-settings ' === $ screen ->base ) {
@@ -181,6 +183,17 @@ public function enqueue_styles_admin() {
181183 $ this ->register_survey ();
182184 }
183185
186+ if (
187+ 'feedzy_page_feedzy-settings ' === $ screen ->base ||
188+ 'feedzy_categories ' === $ screen ->post_type ||
189+ ( 'feedzy_imports ' === $ screen ->post_type && 'edit ' === $ screen ->base )
190+ ) {
191+ $ license_data = get_option ( 'feedzy_rss_feeds_pro_license_data ' , array () );
192+ if ( self ::plan_category ( $ license_data ) <= 1 ) {
193+ do_action ( 'themeisle_sdk_load_banner ' , 'feedzy ' );
194+ }
195+ }
196+
184197 $ upsell_screens = array ( 'feedzy-rss_page_feedzy-settings ' , 'feedzy-rss_page_feedzy-admin-menu-pro-upsell ' );
185198 if ( 'feedzy_imports ' === $ screen ->post_type && 'edit ' !== $ screen ->base ) {
186199
@@ -211,7 +224,8 @@ public function enqueue_styles_admin() {
211224 return ;
212225 }
213226
214- if ( 'feedzy_page_feedzy-support ' === $ screen ->base || ( 'edit ' !== $ screen ->base && 'feedzy_imports ' === $ screen ->post_type ) ) {
227+ // phpcs:ignore WordPress.Security.NonceVerification.Recommended
228+ if ( 'feedzy_page_feedzy-support ' === $ screen ->base && ( isset ( $ _GET ['tab ' ] ) && 'improve ' === $ _GET ['tab ' ] ) || ( 'edit ' !== $ screen ->base && 'feedzy_imports ' === $ screen ->post_type ) ) {
215229
216230 $ this ->register_survey ();
217231
@@ -1617,7 +1631,7 @@ public function api_license_status() {
16171631 * @param object $license_data The license data.
16181632 * @return int
16191633 */
1620- private static function plan_category ( $ license_data ) {
1634+ public static function plan_category ( $ license_data ) {
16211635
16221636 if ( ! isset ( $ license_data ->plan ) || ! is_numeric ( $ license_data ->plan ) ) {
16231637 return 0 ; // Free
@@ -1712,5 +1726,17 @@ public function register_survey() {
17121726 do_action ( 'themeisle_sdk_dependency_enqueue_script ' , 'survey ' );
17131727 wp_enqueue_script ( $ this ->plugin_name . '_survey ' , FEEDZY_ABSURL . 'js/survey.js ' , array ( $ survey_handler ), $ this ->version , true );
17141728 wp_localize_script ( $ this ->plugin_name . '_survey ' , 'feedzySurveyData ' , $ this ->get_survery_metadata () );
1729+
1730+ }
1731+
1732+ /**
1733+ * Add banner anchor for promotions.
1734+ */
1735+ public function add_banner_anchor () {
1736+ add_action (
1737+ 'admin_notices ' , function () {
1738+ echo '<div id="tsdk_banner" class="notice feedzy-banner-dashboard"></div> ' ;
1739+ }, 999
1740+ );
17151741 }
17161742}
0 commit comments