Skip to content

Commit 7daa073

Browse files
fix updatered not working in Coupon Creator 2.5.
1 parent f1151da commit 7daa073

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/Pngx/Admin/EDD_Plugin_Updater.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Allows plugins to use their own update API.
88
*
99
* @author Easy Digital Downloads
10-
* @version 1.6.15
10+
* @version 1.6.16
1111
*/
1212
class Pngx__Admin__EDD_Plugin_Updater {
1313

@@ -44,6 +44,15 @@ public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
4444

4545
$edd_plugin_data[ $this->slug ] = $this->api_data;
4646

47+
/**
48+
* Fires after the $edd_plugin_data is setup.
49+
*
50+
* @since x.x.x
51+
*
52+
* @param array $edd_plugin_data Array of EDD SL plugin data.
53+
*/
54+
do_action( 'post_edd_sl_plugin_updater_setup', $edd_plugin_data );
55+
4756
// Set up hooks.
4857
$this->init();
4958

@@ -112,7 +121,7 @@ public function check_update( $_transient_data ) {
112121

113122
}
114123

115-
$_transient_data->last_checked = current_time( 'timestamp' );
124+
$_transient_data->last_checked = time();
116125
$_transient_data->checked[ $this->name ] = $this->version;
117126

118127
}
@@ -171,7 +180,7 @@ public function show_update_notification( $file, $plugin ) {
171180

172181
}
173182

174-
$update_cache->last_checked = current_time( 'timestamp' );
183+
$update_cache->last_checked = time();
175184
$update_cache->checked[ $this->name ] = $this->version;
176185

177186
set_site_transient( 'update_plugins', $update_cache );
@@ -455,7 +464,7 @@ public function get_cached_version_info( $cache_key = '' ) {
455464

456465
$cache = get_option( $cache_key );
457466

458-
if( empty( $cache['timeout'] ) || current_time( 'timestamp' ) > $cache['timeout'] ) {
467+
if( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
459468
return false; // Cache is expired
460469
}
461470

@@ -470,7 +479,7 @@ public function set_version_info_cache( $value = '', $cache_key = '' ) {
470479
}
471480

472481
$data = array(
473-
'timeout' => strtotime( '+3 hours', current_time( 'timestamp' ) ),
482+
'timeout' => strtotime( '+3 hours', time() ),
474483
'value' => json_encode( $value )
475484
);
476485

0 commit comments

Comments
 (0)