Skip to content

Commit 70efdcb

Browse files
committed
freemius/wordpress-sdk update
1 parent b75251f commit 70efdcb

12 files changed

+167
-146
lines changed

composer.lock

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/composer/installed.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -344,17 +344,17 @@
344344
},
345345
{
346346
"name": "freemius/wordpress-sdk",
347-
"version": "2.7.0",
348-
"version_normalized": "2.7.0.0",
347+
"version": "2.7.1",
348+
"version_normalized": "2.7.1.0",
349349
"source": {
350350
"type": "git",
351351
"url": "https://github.com/Freemius/wordpress-sdk.git",
352-
"reference": "9fc7bd56b1d8f5b1c880eb32a0c2186ac7617d45"
352+
"reference": "2dc1a3bdace10d057eac9740e327e7cb359970a0"
353353
},
354354
"dist": {
355355
"type": "zip",
356-
"url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/9fc7bd56b1d8f5b1c880eb32a0c2186ac7617d45",
357-
"reference": "9fc7bd56b1d8f5b1c880eb32a0c2186ac7617d45",
356+
"url": "https://api.github.com/repos/Freemius/wordpress-sdk/zipball/2dc1a3bdace10d057eac9740e327e7cb359970a0",
357+
"reference": "2dc1a3bdace10d057eac9740e327e7cb359970a0",
358358
"shasum": ""
359359
},
360360
"require": {
@@ -369,7 +369,7 @@
369369
"szepeviktor/phpstan-wordpress": "^1.3",
370370
"wp-coding-standards/wpcs": "^2.3"
371371
},
372-
"time": "2024-04-07T06:58:42+00:00",
372+
"time": "2024-04-22T10:26:28+00:00",
373373
"type": "library",
374374
"installation-source": "dist",
375375
"notification-url": "https://packagist.org/downloads/",
@@ -389,7 +389,7 @@
389389
],
390390
"support": {
391391
"issues": "https://github.com/Freemius/wordpress-sdk/issues",
392-
"source": "https://github.com/Freemius/wordpress-sdk/tree/2.7.0"
392+
"source": "https://github.com/Freemius/wordpress-sdk/tree/2.7.1"
393393
},
394394
"install-path": "../freemius/wordpress-sdk"
395395
},

vendor/composer/installed.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'name' => 'afragen/git-updater',
44
'pretty_version' => 'dev-develop',
55
'version' => 'dev-develop',
6-
'reference' => '17316a1ff8ee71f36761b76110d565e9ee6fb31c',
6+
'reference' => 'b75251fb24dfef87c20b0590dc8100f0f987e711',
77
'type' => 'wordpress-plugin',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -13,7 +13,7 @@
1313
'afragen/git-updater' => array(
1414
'pretty_version' => 'dev-develop',
1515
'version' => 'dev-develop',
16-
'reference' => '17316a1ff8ee71f36761b76110d565e9ee6fb31c',
16+
'reference' => 'b75251fb24dfef87c20b0590dc8100f0f987e711',
1717
'type' => 'wordpress-plugin',
1818
'install_path' => __DIR__ . '/../../',
1919
'aliases' => array(),
@@ -78,9 +78,9 @@
7878
'dev_requirement' => false,
7979
),
8080
'freemius/wordpress-sdk' => array(
81-
'pretty_version' => '2.7.0',
82-
'version' => '2.7.0.0',
83-
'reference' => '9fc7bd56b1d8f5b1c880eb32a0c2186ac7617d45',
81+
'pretty_version' => '2.7.1',
82+
'version' => '2.7.1.0',
83+
'reference' => '2dc1a3bdace10d057eac9740e327e7cb359970a0',
8484
'type' => 'library',
8585
'install_path' => __DIR__ . '/../freemius/wordpress-sdk',
8686
'aliases' => array(),

vendor/freemius/wordpress-sdk/includes/class-freemius.php

+18-2
Original file line numberDiff line numberDiff line change
@@ -20815,7 +20815,7 @@ private function _fetch_newer_version( $plugin_id = false, $flush = true, $expir
2081520815
*
2081620816
* @return bool|FS_Plugin_Tag
2081720817
*/
20818-
function get_update( $plugin_id = false, $flush = true, $expiration = WP_FS__TIME_24_HOURS_IN_SEC, $newer_than = false ) {
20818+
function get_update( $plugin_id = false, $flush = true, $expiration = FS_Plugin_Updater::UPDATES_CHECK_CACHE_EXPIRATION, $newer_than = false ) {
2081920819
$this->_logger->entrance();
2082020820

2082120821
if ( ! is_numeric( $plugin_id ) ) {
@@ -21347,7 +21347,9 @@ private function _sync_plugin_license(
2134721347
/**
2134821348
* Sync licenses. Pass the site's license ID so that the foreign licenses will be fetched if the license
2134921349
* associated with that ID is not included in the user's licenses collection.
21350+
* Save previous value to manage remote license renewals.
2135021351
*/
21352+
$was_license_expired_before_sync = $this->_license->is_expired();
2135121353
$this->_sync_licenses(
2135221354
$site->license_id,
2135321355
( $is_context_single_site ?
@@ -21481,6 +21483,14 @@ private function _sync_plugin_license(
2148121483
$plan_change = 'expired';
2148221484
}
2148321485
}
21486+
} else if ( $was_license_expired_before_sync ) {
21487+
/**
21488+
* If license was expired but it is not anymore.
21489+
*
21490+
*
21491+
* @author Daniele Alessandra (@danielealessandra)
21492+
*/
21493+
$plan_change = 'extended';
2148421494
}
2148521495
}
2148621496

@@ -21558,6 +21568,12 @@ private function _sync_plugin_license(
2155821568
'license_expired',
2155921569
) );
2156021570
break;
21571+
case 'extended':
21572+
$this->_admin_notices->remove_sticky( array(
21573+
'trial_expired',
21574+
'license_expired',
21575+
) );
21576+
break;
2156121577
case 'changed':
2156221578
$this->_admin_notices->add_sticky(
2156321579
sprintf(
@@ -22468,7 +22484,7 @@ private function check_updates(
2246822484
$background = false,
2246922485
$plugin_id = false,
2247022486
$flush = true,
22471-
$expiration = WP_FS__TIME_24_HOURS_IN_SEC,
22487+
$expiration = FS_Plugin_Updater::UPDATES_CHECK_CACHE_EXPIRATION,
2247222488
$newer_than = false
2247322489
) {
2247422490
$this->_logger->entrance();

vendor/freemius/wordpress-sdk/includes/class-fs-api.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,12 @@ function get( $path = '/', $flush = false, $expiration = WP_FS__TIME_24_HOURS_IN
318318
$flush = true;
319319
}
320320

321-
$cached_result = self::$_cache->get( $cache_key );
321+
$has_valid_cache = self::$_cache->has_valid( $cache_key, $expiration );
322+
$cached_result = $has_valid_cache ?
323+
self::$_cache->get( $cache_key ) :
324+
null;
322325

323-
if ( $flush || ! self::$_cache->has_valid( $cache_key, $expiration ) ) {
326+
if ( $flush || is_null( $cached_result ) ) {
324327
$result = $this->call( $path );
325328

326329
if ( ! is_object( $result ) || isset( $result->error ) ) {

vendor/freemius/wordpress-sdk/includes/class-fs-plugin-updater.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class FS_Plugin_Updater {
3737

3838
private static $_upgrade_basename = null;
3939

40+
const UPDATES_CHECK_CACHE_EXPIRATION = ( WP_FS__TIME_24_HOURS_IN_SEC / 24 );
41+
4042
#--------------------------------------------------------------------------------
4143
#region Singleton
4244
#--------------------------------------------------------------------------------
@@ -530,7 +532,7 @@ function pre_set_site_transient_update_plugins_filter( $transient_data ) {
530532
$new_version = $this->_fs->get_update(
531533
false,
532534
fs_request_get_bool( 'force-check' ),
533-
WP_FS__TIME_24_HOURS_IN_SEC / 24,
535+
FS_Plugin_Updater::UPDATES_CHECK_CACHE_EXPIRATION,
534536
$current_plugin_version
535537
);
536538

@@ -1188,7 +1190,7 @@ private static function get_tested_wp_version( $tested_up_to ) {
11881190
* @return object
11891191
*/
11901192
private function get_latest_download_details( $addon_id = false, $newer_than = false, $fetch_readme = true ) {
1191-
return $this->_fs->_fetch_latest_version( $addon_id, true, WP_FS__TIME_24_HOURS_IN_SEC, $newer_than, $fetch_readme );
1193+
return $this->_fs->_fetch_latest_version( $addon_id, true, FS_Plugin_Updater::UPDATES_CHECK_CACHE_EXPIRATION, $newer_than, $fetch_readme );
11921194
}
11931195

11941196
/**

vendor/freemius/wordpress-sdk/includes/fs-plugin-info-dialog.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ function _get_addon_info_filter( $data, $action = '', $args = null ) {
238238
$latest = $this->_fs->_fetch_latest_version(
239239
$selected_addon->id,
240240
true,
241-
WP_FS__TIME_24_HOURS_IN_SEC,
241+
FS_Plugin_Updater::UPDATES_CHECK_CACHE_EXPIRATION,
242242
$current_addon_version
243243
);
244244

Binary file not shown.

0 commit comments

Comments
 (0)