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
13 changes: 8 additions & 5 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/design-library/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

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

Expand Down
5 changes: 3 additions & 2 deletions src/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ),
Expand Down
10 changes: 8 additions & 2 deletions src/pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
}

Expand Down Expand Up @@ -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();
}
}
}
}
25 changes: 13 additions & 12 deletions src/welcome/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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() ) {
Expand All @@ -119,14 +119,14 @@ public static function print_tabs() {
<span><?php _e( 'Settings', STACKABLE_I18N ) ?></span>
</a>

<?php if ( $display_account_tab && sugb_fs()->get_user() ) { ?>
<?php if ( $display_account_tab && STACKABLE_BUILD !== 'free' && sugb_fs()->get_user() ) { ?>
<a class="s-tab <?php echo $screen->base === 'settings_page_stackable-account' ? 's-active' : '' ?>"
href="<?php echo $account_url ?>">
<span><?php _e( 'Account', STACKABLE_I18N ) ?></span>
</a>
<?php } ?>

<?php if ( sugb_fs()->has_affiliate_program() ) { ?>
<?php if ( STACKABLE_BUILD !== 'free' && sugb_fs()->has_affiliate_program() ) { ?>
<a class="s-tab <?php echo $screen->base === 'settings_page_stackable-affiliation' ? 's-active' : '' ?>"
href="<?php echo admin_url( 'options-general.php?page=stackable-affiliation' ) ?>">
<span><?php _e( 'Affiliation', STACKABLE_I18N ) ?></span>
Expand Down Expand Up @@ -165,7 +165,7 @@ public static function print_header( $title = '', $image = 'logo' ) {
}

public static function print_premium_button() { ?>
<?php if ( ! sugb_fs()->can_use_premium_code() ) : ?>
<?php if ( STACKABLE_BUILD === 'free' || ! sugb_fs()->can_use_premium_code() ) : ?>
<a href="https://wpstackable.com/premium/?utm_source=wp-settings-tabs&utm_campaign=gopremium&utm_medium=wp-dashboard" class="s-button s-premium-button" title="<?php esc_attr_e( 'Unlock my Premium Features', STACKABLE_I18N ) ?>" target="_new">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="16" height="16" style="vertical-align: middle; fill: currentColor"><path d="M321.7 0c19.1 0 32.9 18.3 27.6 36.6L295.8 224l85.2 0c19.3 0 34.9 15.6 34.9 34.9c0 10.3-4.5 20-12.3 26.6L144.9 505.2c-5.2 4.4-11.8 6.8-18.6 6.8c-19.1 0-32.9-18.3-27.6-36.6L152.2 288l-86.4 0C47.1 288 32 272.9 32 254.3c0-9.9 4.3-19.2 11.8-25.6L303.1 6.9C308.3 2.4 314.9 0 321.7 0zM285.6 85L104.4 240l79.6 0c7.5 0 14.6 3.5 19.2 9.5s6 13.8 3.9 21L162.3 427.5 345.5 272 264 272c-7.5 0-14.6-3.5-19.2-9.5s-6-13.8-3.9-21L285.6 85z"/></svg>
<?php esc_attr_e( 'Unlock my Premium Features', STACKABLE_I18N ) ?>
Expand Down Expand Up @@ -196,7 +196,7 @@ public function stackable_settings_content() {
<?php do_action( 'stackable_settings_page_mid' ); ?>
</div>
<!-- <div class="s-side">
<?php if ( ! sugb_fs()->can_use_premium_code() ) : ?>
<?php if ( STACKABLE_BUILD === 'free' || ! sugb_fs()->can_use_premium_code() ) : ?>
<aside class="s-box s-premium-box">
<h3><?php _e( '🚀 Stackable Premium', STACKABLE_I18N ) ?></h3>
<p><?php _e( 'If you are ready for even more, upgrade to Premium and get:', STACKABLE_I18N ) ?></p>
Expand Down Expand Up @@ -292,7 +292,7 @@ public function add_settings_link( $links ) {
}

// Go Premium link.
if ( ! sugb_fs()->is_whitelabeled() && ! sugb_fs()->can_use_premium_code() ) {
if ( STACKABLE_BUILD === 'free' ) {
$premium_link = sprintf( '<a href="%s" target="_blank" style="color: #93003c; text-shadow: 1px 1px 1px #eee; font-weight: bold;">%s</a>',
'https://wpstackable.com/premium/?utm_source=wp-plugins&utm_campaign=gopremium&utm_medium=wp-dashboard',
__( 'Go Premium', STACKABLE_I18N )
Expand Down Expand Up @@ -320,9 +320,10 @@ public static function start_redirect_to_welcome_page( $network_wide ) {
* Redirect to the welcome screen if our marker exists.
*/
public function redirect_to_welcome_page() {

if ( get_option( 'stackable_redirect_to_welcome' ) &&
current_user_can( 'manage_options' ) &&
! sugb_fs()->is_activation_mode()
( STACKABLE_BUILD === 'free' || ! sugb_fs()->is_activation_mode() )
) {
// Never go here again.
delete_option( 'stackable_redirect_to_welcome' );
Expand Down
Loading