Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Binary file removed img/black-friday-banner.png
Binary file not shown.
Binary file added img/black-friday.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 28 additions & 2 deletions includes/admin/feedzy-rss-feeds-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -158,6 +159,7 @@ public function enqueue_styles_admin() {
);

$this->register_survey();
$this->add_banner_anchor();
}

if ( 'feedzy_page_feedzy-settings' === $screen->base ) {
Expand All @@ -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 ) {

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 '<div id="tsdk_banner" class="notice feedzy-banner-dashboard"></div>';
}, 999
);
}
}
5 changes: 4 additions & 1 deletion includes/admin/feedzy-rss-feeds-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

/**
Expand Down
6 changes: 0 additions & 6 deletions includes/feedzy-rss-feeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,6 @@ function () {
}
);
}

if ( ! feedzy_is_pro() ) {
$offer = new Feedzy_Rss_Feeds_Limited_Offers();
$offer->load_banner();
}

}

/**
Expand Down
6 changes: 3 additions & 3 deletions includes/layouts/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand All @@ -30,6 +27,9 @@
<?php if ( $this->error ) { ?>
<div class="fz-snackbar-notice error"><p><?php echo wp_kses_post( $this->error ); ?></p></div>
<?php } ?>

<div id="tsdk_banner" class="feedzy-banner"></div>

<div class="feedzy-container">
<?php if ( ! empty( $offer_data['active'] ) ) { ?>
<div class="feedzy-sale">
Expand Down
Loading