Skip to content

Commit

Permalink
feat: add banner support
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Nov 1, 2024
1 parent 257c341 commit 2afc4cf
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
11 changes: 11 additions & 0 deletions css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@
.post-type-feedzy_imports:not(.edit-post) .wrap div#side-sortables{
display: none;
}

.feedzy-banner {
margin: 0 auto;
display: flex;
justify-content: center;
}

.feedzy-banner:has(img) {
margin-bottom: 20px;
}

.feedzy-container{
max-width: 1224px;
margin: 0 auto;
Expand Down
7 changes: 6 additions & 1 deletion includes/admin/feedzy-rss-feeds-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ public function enqueue_styles_admin() {
);

$this->register_survey();

$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' );
Expand Down Expand Up @@ -1617,7 +1622,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
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

0 comments on commit 2afc4cf

Please sign in to comment.