Skip to content

Commit 46b43de

Browse files
authored
Fix: Removed freemius sdk from the free build (#3568)
* fix: removed Freemius SDK from the free build * removed freemius as contributor --------- Co-authored-by: [email protected] <>
1 parent 13c84d3 commit 46b43de

File tree

6 files changed

+35
-24
lines changed

6 files changed

+35
-24
lines changed

plugin.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
* Author: Gambit Technologies, Inc
77
* Author URI: http://gambit.ph
88
* Text Domain: stackable-ultimate-gutenberg-blocks
9-
* Version: 3.17.1
9+
* Version: 3.17.2
1010
*
1111
* @package Stackable
12+
* @fs_premium_only /freemius.php, /freemius/
1213
*/
1314

1415
// Exit if accessed directly.
@@ -24,7 +25,7 @@
2425

2526
defined( 'STACKABLE_SHOW_PRO_NOTICES' ) || define( 'STACKABLE_SHOW_PRO_NOTICES', true );
2627
defined( 'STACKABLE_BUILD' ) || define( 'STACKABLE_BUILD', 'free' );
27-
defined( 'STACKABLE_VERSION' ) || define( 'STACKABLE_VERSION', '3.17.1' );
28+
defined( 'STACKABLE_VERSION' ) || define( 'STACKABLE_VERSION', '3.17.2' );
2829
defined( 'STACKABLE_FILE' ) || define( 'STACKABLE_FILE', __FILE__ );
2930
defined( 'STACKABLE_I18N' ) || define( 'STACKABLE_I18N', 'stackable-ultimate-gutenberg-blocks' ); // Plugin slug.
3031
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() {
210211
* Freemius.
211212
* This needs to be first.
212213
*/
213-
require_once( plugin_dir_path( __FILE__ ) . 'freemius.php' );
214+
if ( STACKABLE_BUILD !== 'free' ) {
215+
require_once( plugin_dir_path( __FILE__ ) . 'freemius.php' );
216+
}
214217

215218
/**
216219
* Block Initializer.
@@ -275,8 +278,8 @@ function is_frontend() {
275278
require_once( plugin_dir_path( __FILE__ ) . 'src/welcome/notification-rate.php' );
276279
}
277280

278-
if ( sugb_fs()->is__premium_only() ) {
279-
if ( STACKABLE_BUILD === 'premium' ) {
281+
if ( STACKABLE_BUILD === 'premium' ) {
282+
if ( sugb_fs()->is__premium_only() ) {
280283
/**
281284
* Premium initialize code.
282285
*/

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
=== Stackable - Page Builder Gutenberg Blocks ===
2-
Contributors: bfintal, gambitph, freemius
2+
Contributors: bfintal, gambitph
33
Tags: blocks, gutenberg, gutenberg blocks, page builder, WordPress blocks
44
Requires at least: 6.5.5
55
Tested up to: 6.8.2

src/design-library/init.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ public function get_premium_designs( $content ) {
365365

366366
$premium_designs = array();
367367
foreach ( $library as $design_id => $design ) {
368-
if ( $design[ 'plan' ] === 'premium' && sugb_fs()->can_use_premium_code() && STACKABLE_BUILD === 'premium' ) {
368+
if ( $design[ 'plan' ] === 'premium' && STACKABLE_BUILD === 'premium' && sugb_fs()->can_use_premium_code() ) {
369369
continue;
370370
}
371371

@@ -465,7 +465,7 @@ public function register_design_pattern() {
465465
}
466466

467467
foreach ( $library as $design_id => $design ) {
468-
if ( $design[ 'plan' ] === 'premium' && ( ! sugb_fs()->can_use_premium_code() || STACKABLE_BUILD === 'free' ) ) {
468+
if ( $design[ 'plan' ] === 'premium' && ( STACKABLE_BUILD === 'free' || ! sugb_fs()->can_use_premium_code() ) ) {
469469
continue;
470470
}
471471

src/init.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,9 @@ public function register_block_editor_assets() {
361361
'isPro' => STACKABLE_BUILD === 'premium' && sugb_fs()->can_use_premium_code(),
362362
'showProNotice' => stackable_should_show_pro_notices(),
363363
'pricingURL' => 'https://wpstackable.com/premium/?utm_source=wp-settings&utm_campaign=gopremium&utm_medium=wp-dashboard',
364-
'planName' => sugb_fs()->is_plan( 'starter', true ) ? 'starter' :
365-
( sugb_fs()->is_plan( 'professional', true ) ? 'professional' : 'business' ),
364+
'planName' => STACKABLE_BUILD === 'free' ? '' :
365+
( sugb_fs()->is_plan( 'starter', true ) ? 'starter' :
366+
( sugb_fs()->is_plan( 'professional', true ) ? 'professional' : 'business' ) ),
366367

367368
// Icons.
368369
'fontAwesomeSearchProIcons' => apply_filters( 'stackable_search_fontawesome_pro_icons', false ),

src/pro.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function stackable_register_show_pro_notice_option() {
6565
* @return Boolean
6666
*/
6767
function stackable_should_show_pro_notices() {
68-
return STACKABLE_SHOW_PRO_NOTICES && stackable_show_pro_notices_option() && ( ! sugb_fs()->can_use_premium_code() || STACKABLE_BUILD === 'free' );
68+
return STACKABLE_SHOW_PRO_NOTICES && stackable_show_pro_notices_option() && ( STACKABLE_BUILD === 'free' || ! sugb_fs()->can_use_premium_code() );
6969
}
7070
}
7171

@@ -137,7 +137,13 @@ public function show_notification() {
137137
}
138138
}
139139

140-
if ( STACKABLE_SHOW_PRO_NOTICES && ! sugb_fs()->can_use_premium_code() ) {
140+
if ( STACKABLE_SHOW_PRO_NOTICES || STACKABLE_BUILD === 'free' ) {
141141
new Stackable_Go_Premium_Notification();
142+
} else {
143+
if ( sugb_fs()->is__premium_only() ) {
144+
if ( ! sugb_fs()->can_use_premium_code() ) {
145+
new Stackable_Go_Premium_Notification();
146+
}
147+
}
142148
}
143149
}

src/welcome/index.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ public function enqueue_dashboard_script( $hook ) {
7777
'welcomeSrcUrl' => untrailingslashit( plugins_url( '/', __FILE__ ) ),
7878
'i18n' => STACKABLE_I18N,
7979
'cdnUrl' => STACKABLE_DESIGN_LIBRARY_URL,
80-
'isPro' => sugb_fs()->can_use_premium_code() && STACKABLE_BUILD !== 'free',
80+
'isPro' => STACKABLE_BUILD !== 'free' && sugb_fs()->can_use_premium_code(),
8181
'showProNotice' => stackable_should_show_pro_notices(),
8282
'pricingURL' => 'https://wpstackable.com/premium/?utm_source=wp-settings&utm_campaign=gopremium&utm_medium=wp-dashboard',
83-
'contactURL' => ! sugb_fs()->is_whitelabeled() ? sugb_fs()->contact_url( 'technical_support' ) : '',
84-
'planName' => sugb_fs()->get_plan_name(),
85-
'showProNoticesOption' => STACKABLE_SHOW_PRO_NOTICES && ( ! sugb_fs()->can_use_premium_code() || STACKABLE_BUILD === 'free' ),
83+
'contactURL' => STACKABLE_BUILD === 'free' ? '' : ( ! sugb_fs()->is_whitelabeled() ? sugb_fs()->contact_url( 'technical_support' ) : '' ),
84+
'planName' => STACKABLE_BUILD === 'free' ? '' : sugb_fs()->get_plan_name(),
85+
'showProNoticesOption' => STACKABLE_SHOW_PRO_NOTICES && ( STACKABLE_BUILD === 'free' || ! sugb_fs()->can_use_premium_code() ),
8686
'nonceNews' => stackable_get_news_feed_nonce(),
8787
) );
8888
wp_localize_script( 'stackable-welcome', 'stackable', $args );
@@ -94,11 +94,11 @@ public static function print_tabs() {
9494

9595
$display_account_tab = true;
9696
$display_contact_tab = true;
97-
$account_url = sugb_fs()->get_account_url();
97+
$account_url = STACKABLE_BUILD === 'free' ? '' : sugb_fs()->get_account_url();
9898
$contact_url = admin_url( 'options-general.php?page=stackable-contact' );
9999

100100
// If network activated and in multisite, the accounts page is in a different URL.
101-
if ( is_multisite() && sugb_fs()->is_network_active() ) {
101+
if ( is_multisite() && STACKABLE_BUILD !== 'free' && sugb_fs()->is_network_active() ) {
102102
$account_url = str_replace( 'options-general.php', 'admin.php', $account_url );
103103
$contact_url = admin_url( 'network/admin.php?page=stackable-contact' );
104104
if ( ! is_main_site() ) {
@@ -119,14 +119,14 @@ public static function print_tabs() {
119119
<span><?php _e( 'Settings', STACKABLE_I18N ) ?></span>
120120
</a>
121121

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

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

167167
public static function print_premium_button() { ?>
168-
<?php if ( ! sugb_fs()->can_use_premium_code() ) : ?>
168+
<?php if ( STACKABLE_BUILD === 'free' || ! sugb_fs()->can_use_premium_code() ) : ?>
169169
<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">
170170
<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>
171171
<?php esc_attr_e( 'Unlock my Premium Features', STACKABLE_I18N ) ?>
@@ -196,7 +196,7 @@ public function stackable_settings_content() {
196196
<?php do_action( 'stackable_settings_page_mid' ); ?>
197197
</div>
198198
<!-- <div class="s-side">
199-
<?php if ( ! sugb_fs()->can_use_premium_code() ) : ?>
199+
<?php if ( STACKABLE_BUILD === 'free' || ! sugb_fs()->can_use_premium_code() ) : ?>
200200
<aside class="s-box s-premium-box">
201201
<h3><?php _e( '🚀 Stackable Premium', STACKABLE_I18N ) ?></h3>
202202
<p><?php _e( 'If you are ready for even more, upgrade to Premium and get:', STACKABLE_I18N ) ?></p>
@@ -292,7 +292,7 @@ public function add_settings_link( $links ) {
292292
}
293293

294294
// Go Premium link.
295-
if ( ! sugb_fs()->is_whitelabeled() && ! sugb_fs()->can_use_premium_code() ) {
295+
if ( STACKABLE_BUILD === 'free' ) {
296296
$premium_link = sprintf( '<a href="%s" target="_blank" style="color: #93003c; text-shadow: 1px 1px 1px #eee; font-weight: bold;">%s</a>',
297297
'https://wpstackable.com/premium/?utm_source=wp-plugins&utm_campaign=gopremium&utm_medium=wp-dashboard',
298298
__( 'Go Premium', STACKABLE_I18N )
@@ -320,9 +320,10 @@ public static function start_redirect_to_welcome_page( $network_wide ) {
320320
* Redirect to the welcome screen if our marker exists.
321321
*/
322322
public function redirect_to_welcome_page() {
323+
323324
if ( get_option( 'stackable_redirect_to_welcome' ) &&
324325
current_user_can( 'manage_options' ) &&
325-
! sugb_fs()->is_activation_mode()
326+
( STACKABLE_BUILD === 'free' || ! sugb_fs()->is_activation_mode() )
326327
) {
327328
// Never go here again.
328329
delete_option( 'stackable_redirect_to_welcome' );

0 commit comments

Comments
 (0)