Skip to content

Commit aee62be

Browse files
release: fixes
- Fixed JavaScript exception and PHP deprecation errors appearing in the console - Updated dependencies
2 parents 04704c9 + 17a9119 commit aee62be

File tree

7 files changed

+57
-12
lines changed

7 files changed

+57
-12
lines changed

css/settings.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,28 @@
113113
.post-type-feedzy_imports:not(.edit-post) .wrap div#side-sortables{
114114
display: none;
115115
}
116+
117+
.feedzy-banner:has(.tsdk-banner-cta) {
118+
margin: 0 auto;
119+
display: flex;
120+
justify-content: center;
121+
margin-bottom: 20px;
122+
}
123+
124+
.feedzy-banner .tsdk-banner-urgency-text {
125+
padding: 5px;
126+
}
127+
128+
.feedzy-banner-dashboard:has(.tsdk-banner-cta) {
129+
margin: 20px 0;
130+
131+
/* Remove the properties added by .notice */
132+
background: transparent;
133+
border: unset;
134+
box-shadow: unset;
135+
padding: unset;
136+
}
137+
116138
.feedzy-container{
117139
max-width: 1224px;
118140
margin: 0 auto;

img/black-friday-banner.png

-27.3 KB
Binary file not shown.

img/black-friday.jpg

89.9 KB
Loading

includes/admin/feedzy-rss-feeds-admin.php

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

includes/admin/feedzy-rss-feeds-options.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ public static function instance() {
4848
* Init the default values of the options class.
4949
*/
5050
public function init() {
51-
self::$instance->options = get_option( Feedzy_Rss_Feeds::get_plugin_name() );
51+
self::$instance->options = get_option( Feedzy_Rss_Feeds::get_plugin_name(), array() );
52+
if ( ! is_array( self::$instance->options ) ) {
53+
self::$instance->options = array();
54+
}
5255
}
5356

5457
/**

includes/feedzy-rss-feeds.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,6 @@ function () {
295295
}
296296
);
297297
}
298-
299-
if ( ! feedzy_is_pro() ) {
300-
$offer = new Feedzy_Rss_Feeds_Limited_Offers();
301-
$offer->load_banner();
302-
}
303-
304298
}
305299

306300
/**

includes/layouts/settings.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88

99
$help_btn_url = 'https://docs.themeisle.com/category/712-feedzy';
1010

11-
$offer = new Feedzy_Rss_Feeds_Limited_Offers();
12-
$offer_data = feedzy_is_pro() ? array() : $offer->get_localized_data();
13-
1411
if ( 'headers' === $active_tab ) {
1512
$help_btn_url = 'https://docs.themeisle.com/article/713-how-to-change-user-agent-in-feedzy';
1613
} elseif ( 'proxy' === $active_tab ) {
@@ -30,6 +27,9 @@
3027
<?php if ( $this->error ) { ?>
3128
<div class="fz-snackbar-notice error"><p><?php echo wp_kses_post( $this->error ); ?></p></div>
3229
<?php } ?>
30+
31+
<div id="tsdk_banner" class="feedzy-banner"></div>
32+
3333
<div class="feedzy-container">
3434
<?php if ( ! empty( $offer_data['active'] ) ) { ?>
3535
<div class="feedzy-sale">

0 commit comments

Comments
 (0)