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
2 changes: 1 addition & 1 deletion assets/js/pricing/freemius-pricing.js

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions includes/class-freemius.php
Original file line number Diff line number Diff line change
Expand Up @@ -6558,10 +6558,7 @@ private function maybe_schedule_sync_cron() {
$next_schedule = $this->next_sync_cron();

// The event is properly scheduled, so no need to reschedule it.
if (
is_numeric( $next_schedule ) &&
$next_schedule > time()
) {
if ( is_numeric( $next_schedule ) ) {
return;
}

Expand Down Expand Up @@ -7098,7 +7095,6 @@ private function add_sticky_optin_admin_notice() {
*/
function _enqueue_connect_essentials() {
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'json2' );

fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.js' );
fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
Expand Down Expand Up @@ -17436,7 +17432,7 @@ function setup_network_account(
FS_User_Lock::instance()->unlock();
}

if ( 1 < count( $installs ) ) {
if ( 1 < count( $installs ) || fs_is_network_admin() ) {
// Only network level opt-in can have more than one install.
$is_network_level_opt_in = true;
}
Expand Down
28 changes: 24 additions & 4 deletions includes/class-fs-plugin-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,32 @@ function pre_set_site_transient_update_plugins_filter( $transient_data ) {
return $transient_data;
}

// Alias.
$basename = $this->_fs->premium_plugin_basename();

global $wp_current_filter;

if ( ! empty( $wp_current_filter ) && in_array( 'upgrader_process_complete', $wp_current_filter ) ) {
/**
* During bulk updates, avoid re-injecting update data for the plugin itself once it has already been updated.
*
* If the custom package is re-added to the transient after the plugin update, WordPress may detect the package again and incorrectly report "The plugin is at the latest version" for a pending update, since the custom package version matches the currently installed version.
*
* Behavior differs depending on how the bulk update is triggered. Please refer to the inline comments for each flow below for details.
*/
if (
! empty( $wp_current_filter ) && (
/**
* update-core.php and other upgrader pages:
* The `upgrader_process_complete` action fires only once after all updates have finished. In this case, it is the current action (`$wp_current_filter[0]`), while `self::$_upgrade_basename` may contain any plugin basename.
*/
'upgrader_process_complete' === $wp_current_filter[0] ||
/**
* AJAX bulk updates (e.g., from the Plugins page):
* The `upgrader_process_complete` action fires multiple times — once for each plugin after it finishes updating. In this flow, it is not the current action (`$wp_current_filter[0]`) because it is triggered from another action. Instead, we compare `self::$_upgrade_basename` with the basename of the plugin currently being updated, since the `upgrader_process_complete` action runs separately for each plugin.
*/
( in_array( 'upgrader_process_complete', $wp_current_filter ) && self::$_upgrade_basename === $basename )
)
) {
return $transient_data;
}

Expand All @@ -566,9 +589,6 @@ function pre_set_site_transient_update_plugins_filter( $transient_data ) {
}
}

// Alias.
$basename = $this->_fs->premium_plugin_basename();

if ( is_object( $this->_update_details ) ) {
if ( isset( $transient_data->no_update ) ) {
unset( $transient_data->no_update[ $basename ] );
Expand Down
3 changes: 3 additions & 0 deletions includes/fs-essential-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
* @since 1.1.5
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

if ( ! function_exists( 'fs_normalize_path' ) ) {
if ( function_exists( 'wp_normalize_path' ) ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/managers/class-fs-contact-form-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function get_standalone_link( Freemius $fs ) {
$query_params = $this->get_query_params( $fs );

$query_params['is_standalone'] = 'true';
$query_params['parent_url'] = admin_url( add_query_arg( null, null ) );
$query_params['parent_url'] = admin_url( add_query_arg( '', '' ) );

return WP_FS__ADDRESS . '/contact/?' . http_build_query( $query_params );
}
Expand Down
3 changes: 3 additions & 0 deletions includes/managers/class-fs-debug-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* @package Freemius
* @since 2.6.2
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

class FS_DebugManager {

Expand Down
2 changes: 1 addition & 1 deletion start.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @var string
*/
$this_sdk_version = '2.13.0';
$this_sdk_version = '2.13.1';

#region SDK Selection Logic --------------------------------------------------------------------

Expand Down
22 changes: 17 additions & 5 deletions templates/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@
$available_license_paid_plan = is_object( $available_license ) ?
$fs->_get_plan_by_id( $available_license->plan_id ) :
null;

$is_dev_mode = ( defined( 'WP_FS__DEV_MODE' ) && WP_FS__DEV_MODE );
?>
<div class="wrap fs-section">
<?php if ( ! $has_tabs && ! $fs->apply_filters( 'hide_account_tabs', false ) ) : ?>
Expand Down Expand Up @@ -787,7 +789,7 @@ class="fs-tag fs-<?php echo $fs->can_use_premium_code() ? 'success' : 'warn' ?>"
<th><?php echo esc_html( $plan_text ) ?></th>
<th><?php fs_esc_html_echo_x_inline( 'License', 'as software license', 'license', $slug ) ?></th>
<th></th>
<?php if ( defined( 'WP_FS__DEV_MODE' ) && WP_FS__DEV_MODE ) : ?>
<?php if ( $is_dev_mode ) : ?>
<th></th>
<?php endif ?>
</tr>
Expand Down Expand Up @@ -853,10 +855,20 @@ class="fs-tag fs-<?php echo $fs->can_use_premium_code() ? 'success' : 'warn' ?>"
'is_whitelabeled' => ( $is_whitelabeled && ! $is_data_debug_mode )
);

fs_require_template(
'account/partials/addon.php',
$addon_view_params
);
if ( ! empty($addon_view_params['addon_info'] ) ) {
fs_require_template(
'account/partials/addon.php',
$addon_view_params
);
} else {
// If we are here it means there is an activation of an unreleased add-on and yet the SDK is not in development mode.
echo '<tr>';
echo '<td style="text-align: right;">' . esc_html( $addon_id ) . '</td>';
echo '<td colspan="' . ( $is_dev_mode ? 6 : 5 ) . '" style="text-align: left;">';
echo 'The add-on you have activated is no longer <a href="https://freemius.com/help/documentation/wordpress/selling-add-ons-extensions/#preparing-the-add-on-for-sale" rel="noreferrer noopener" target="_blank">listed</a> by the product owner, or the SDK is not running in <a href="https://freemius.com/help/documentation/wordpress-sdk/testing/" rel="noreferrer noopener" target="_blank">test mode</a>. Please <a href="' . esc_url( $fs->contact_url() ) . '">contact support</a> if you need further assistance.';
echo '</td>';
echo '</tr>';
}

$odd = ! $odd;
} ?>
Expand Down
4 changes: 3 additions & 1 deletion templates/checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
* @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
* @since 2.9.0
*/

if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* @var array $VARS
* @var Freemius $fs
Expand Down
1 change: 0 additions & 1 deletion templates/checkout/frame.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
}

wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'json2' );
fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.js' );
fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
fs_enqueue_local_script( 'fs-form', 'jquery.form.js', array( 'jquery' ) );
Expand Down
1 change: 0 additions & 1 deletion templates/checkout/process-redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
$fs_checkout->verify_checkout_redirect_nonce( $fs );

wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'json2' );
fs_enqueue_local_script( 'fs-form', 'jquery.form.js', array( 'jquery' ) );

$action = fs_request_get( '_fs_checkout_action' );
Expand Down
1 change: 0 additions & 1 deletion templates/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
}

wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'json2' );
fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.js' );
fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
fs_enqueue_local_style( 'fs_checkout', '/admin/common.css' );
Expand Down
10 changes: 9 additions & 1 deletion templates/debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ function stopCountdownManually() {
'key' => 'WP_FS__DIR',
'val' => WP_FS__DIR,
),
array(
'key' => 'DISABLE_WP_CRON',
'val' => defined( 'DISABLE_WP_CRON' ) ? ( DISABLE_WP_CRON ? 'true' : 'false' ) : 'Not defined',
),
array(
'key' => 'wp_using_ext_object_cache()',
'val' => wp_using_ext_object_cache() ? 'true' : 'false',
Expand All @@ -282,7 +286,11 @@ function stopCountdownManually() {
echo ' class="alternate"';
} ?>>
<td><?php echo $p['key'] ?></td>
<td><?php echo $p['val'] ?></td>
<td><?php echo $p['val'] ?><?php
if ( 'DISABLE_WP_CRON' === $p['key'] && 'true' === $p['val'] ) {
echo '<p><small><strong>Freemius SDK’s sync cron jobs will not run unless an alternative server-side cron is set up.</strong></small></p>';
}
?></td>
</tr>
<?php $alternate = ! $alternate ?>
<?php endforeach ?>
Expand Down
1 change: 0 additions & 1 deletion templates/pricing.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
}

wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'json2' );
fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.js' );
fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' );
fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
Expand Down
Loading