diff --git a/plugin.php b/plugin.php index ca5bf4e027..e36a40daf3 100644 --- a/plugin.php +++ b/plugin.php @@ -6,9 +6,10 @@ * Author: Gambit Technologies, Inc * Author URI: http://gambit.ph * Text Domain: stackable-ultimate-gutenberg-blocks - * Version: 3.17.1 + * Version: 3.17.2 * * @package Stackable + * @fs_premium_only /freemius.php, /freemius/ */ // Exit if accessed directly. @@ -24,7 +25,7 @@ defined( 'STACKABLE_SHOW_PRO_NOTICES' ) || define( 'STACKABLE_SHOW_PRO_NOTICES', true ); defined( 'STACKABLE_BUILD' ) || define( 'STACKABLE_BUILD', 'free' ); -defined( 'STACKABLE_VERSION' ) || define( 'STACKABLE_VERSION', '3.17.1' ); +defined( 'STACKABLE_VERSION' ) || define( 'STACKABLE_VERSION', '3.17.2' ); defined( 'STACKABLE_FILE' ) || define( 'STACKABLE_FILE', __FILE__ ); defined( 'STACKABLE_I18N' ) || define( 'STACKABLE_I18N', 'stackable-ultimate-gutenberg-blocks' ); // Plugin slug. defined( 'STACKABLE_DESIGN_LIBRARY_URL' ) || define( 'STACKABLE_DESIGN_LIBRARY_URL', 'https://storage.googleapis.com/stackable-plugin-assets' ); // Design Library CDN URL @@ -210,7 +211,9 @@ function is_frontend() { * Freemius. * This needs to be first. */ -require_once( plugin_dir_path( __FILE__ ) . 'freemius.php' ); +if ( STACKABLE_BUILD !== 'free' ) { + require_once( plugin_dir_path( __FILE__ ) . 'freemius.php' ); +} /** * Block Initializer. @@ -275,8 +278,8 @@ function is_frontend() { require_once( plugin_dir_path( __FILE__ ) . 'src/welcome/notification-rate.php' ); } -if ( sugb_fs()->is__premium_only() ) { - if ( STACKABLE_BUILD === 'premium' ) { +if ( STACKABLE_BUILD === 'premium' ) { + if ( sugb_fs()->is__premium_only() ) { /** * Premium initialize code. */ diff --git a/readme.txt b/readme.txt index c203502b07..9787efc45a 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ === Stackable - Page Builder Gutenberg Blocks === -Contributors: bfintal, gambitph, freemius +Contributors: bfintal, gambitph Tags: blocks, gutenberg, gutenberg blocks, page builder, WordPress blocks Requires at least: 6.5.5 Tested up to: 6.8.2 diff --git a/src/design-library/init.php b/src/design-library/init.php index 8538a8c99b..8559710187 100644 --- a/src/design-library/init.php +++ b/src/design-library/init.php @@ -365,7 +365,7 @@ public function get_premium_designs( $content ) { $premium_designs = array(); foreach ( $library as $design_id => $design ) { - if ( $design[ 'plan' ] === 'premium' && sugb_fs()->can_use_premium_code() && STACKABLE_BUILD === 'premium' ) { + if ( $design[ 'plan' ] === 'premium' && STACKABLE_BUILD === 'premium' && sugb_fs()->can_use_premium_code() ) { continue; } @@ -465,7 +465,7 @@ public function register_design_pattern() { } foreach ( $library as $design_id => $design ) { - if ( $design[ 'plan' ] === 'premium' && ( ! sugb_fs()->can_use_premium_code() || STACKABLE_BUILD === 'free' ) ) { + if ( $design[ 'plan' ] === 'premium' && ( STACKABLE_BUILD === 'free' || ! sugb_fs()->can_use_premium_code() ) ) { continue; } diff --git a/src/init.php b/src/init.php index a01bb0850a..1915fb0326 100644 --- a/src/init.php +++ b/src/init.php @@ -361,8 +361,9 @@ public function register_block_editor_assets() { 'isPro' => STACKABLE_BUILD === 'premium' && sugb_fs()->can_use_premium_code(), 'showProNotice' => stackable_should_show_pro_notices(), 'pricingURL' => 'https://wpstackable.com/premium/?utm_source=wp-settings&utm_campaign=gopremium&utm_medium=wp-dashboard', - 'planName' => sugb_fs()->is_plan( 'starter', true ) ? 'starter' : - ( sugb_fs()->is_plan( 'professional', true ) ? 'professional' : 'business' ), + 'planName' => STACKABLE_BUILD === 'free' ? '' : + ( sugb_fs()->is_plan( 'starter', true ) ? 'starter' : + ( sugb_fs()->is_plan( 'professional', true ) ? 'professional' : 'business' ) ), // Icons. 'fontAwesomeSearchProIcons' => apply_filters( 'stackable_search_fontawesome_pro_icons', false ), diff --git a/src/pro.php b/src/pro.php index 40638beca7..53319db5f9 100644 --- a/src/pro.php +++ b/src/pro.php @@ -65,7 +65,7 @@ function stackable_register_show_pro_notice_option() { * @return Boolean */ function stackable_should_show_pro_notices() { - return STACKABLE_SHOW_PRO_NOTICES && stackable_show_pro_notices_option() && ( ! sugb_fs()->can_use_premium_code() || STACKABLE_BUILD === 'free' ); + return STACKABLE_SHOW_PRO_NOTICES && stackable_show_pro_notices_option() && ( STACKABLE_BUILD === 'free' || ! sugb_fs()->can_use_premium_code() ); } } @@ -137,7 +137,13 @@ public function show_notification() { } } - if ( STACKABLE_SHOW_PRO_NOTICES && ! sugb_fs()->can_use_premium_code() ) { + if ( STACKABLE_SHOW_PRO_NOTICES || STACKABLE_BUILD === 'free' ) { new Stackable_Go_Premium_Notification(); + } else { + if ( sugb_fs()->is__premium_only() ) { + if ( ! sugb_fs()->can_use_premium_code() ) { + new Stackable_Go_Premium_Notification(); + } + } } } diff --git a/src/welcome/index.php b/src/welcome/index.php index 7098a39e10..459a73e8b3 100644 --- a/src/welcome/index.php +++ b/src/welcome/index.php @@ -77,12 +77,12 @@ public function enqueue_dashboard_script( $hook ) { 'welcomeSrcUrl' => untrailingslashit( plugins_url( '/', __FILE__ ) ), 'i18n' => STACKABLE_I18N, 'cdnUrl' => STACKABLE_DESIGN_LIBRARY_URL, - 'isPro' => sugb_fs()->can_use_premium_code() && STACKABLE_BUILD !== 'free', + 'isPro' => STACKABLE_BUILD !== 'free' && sugb_fs()->can_use_premium_code(), 'showProNotice' => stackable_should_show_pro_notices(), 'pricingURL' => 'https://wpstackable.com/premium/?utm_source=wp-settings&utm_campaign=gopremium&utm_medium=wp-dashboard', - 'contactURL' => ! sugb_fs()->is_whitelabeled() ? sugb_fs()->contact_url( 'technical_support' ) : '', - 'planName' => sugb_fs()->get_plan_name(), - 'showProNoticesOption' => STACKABLE_SHOW_PRO_NOTICES && ( ! sugb_fs()->can_use_premium_code() || STACKABLE_BUILD === 'free' ), + 'contactURL' => STACKABLE_BUILD === 'free' ? '' : ( ! sugb_fs()->is_whitelabeled() ? sugb_fs()->contact_url( 'technical_support' ) : '' ), + 'planName' => STACKABLE_BUILD === 'free' ? '' : sugb_fs()->get_plan_name(), + 'showProNoticesOption' => STACKABLE_SHOW_PRO_NOTICES && ( STACKABLE_BUILD === 'free' || ! sugb_fs()->can_use_premium_code() ), 'nonceNews' => stackable_get_news_feed_nonce(), ) ); wp_localize_script( 'stackable-welcome', 'stackable', $args ); @@ -94,11 +94,11 @@ public static function print_tabs() { $display_account_tab = true; $display_contact_tab = true; - $account_url = sugb_fs()->get_account_url(); + $account_url = STACKABLE_BUILD === 'free' ? '' : sugb_fs()->get_account_url(); $contact_url = admin_url( 'options-general.php?page=stackable-contact' ); // If network activated and in multisite, the accounts page is in a different URL. - if ( is_multisite() && sugb_fs()->is_network_active() ) { + if ( is_multisite() && STACKABLE_BUILD !== 'free' && sugb_fs()->is_network_active() ) { $account_url = str_replace( 'options-general.php', 'admin.php', $account_url ); $contact_url = admin_url( 'network/admin.php?page=stackable-contact' ); if ( ! is_main_site() ) { @@ -119,14 +119,14 @@ public static function print_tabs() { - get_user() ) { ?> + get_user() ) { ?> - has_affiliate_program() ) { ?> + has_affiliate_program() ) { ?> @@ -165,7 +165,7 @@ public static function print_header( $title = '', $image = 'logo' ) { } public static function print_premium_button() { ?> - can_use_premium_code() ) : ?> + can_use_premium_code() ) : ?> @@ -196,7 +196,7 @@ public function stackable_settings_content() {