7
7
* Allows plugins to use their own update API.
8
8
*
9
9
* @author Easy Digital Downloads
10
- * @version 1.6.15
10
+ * @version 1.6.16
11
11
*/
12
12
class Pngx__Admin__EDD_Plugin_Updater {
13
13
@@ -44,6 +44,15 @@ public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
44
44
45
45
$ edd_plugin_data [ $ this ->slug ] = $ this ->api_data ;
46
46
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
+
47
56
// Set up hooks.
48
57
$ this ->init ();
49
58
@@ -112,7 +121,7 @@ public function check_update( $_transient_data ) {
112
121
113
122
}
114
123
115
- $ _transient_data ->last_checked = current_time ( ' timestamp ' );
124
+ $ _transient_data ->last_checked = time ( );
116
125
$ _transient_data ->checked [ $ this ->name ] = $ this ->version ;
117
126
118
127
}
@@ -171,7 +180,7 @@ public function show_update_notification( $file, $plugin ) {
171
180
172
181
}
173
182
174
- $ update_cache ->last_checked = current_time ( ' timestamp ' );
183
+ $ update_cache ->last_checked = time ( );
175
184
$ update_cache ->checked [ $ this ->name ] = $ this ->version ;
176
185
177
186
set_site_transient ( 'update_plugins ' , $ update_cache );
@@ -455,7 +464,7 @@ public function get_cached_version_info( $cache_key = '' ) {
455
464
456
465
$ cache = get_option ( $ cache_key );
457
466
458
- if ( empty ( $ cache ['timeout ' ] ) || current_time ( ' timestamp ' ) > $ cache ['timeout ' ] ) {
467
+ if ( empty ( $ cache ['timeout ' ] ) || time ( ) > $ cache ['timeout ' ] ) {
459
468
return false ; // Cache is expired
460
469
}
461
470
@@ -470,7 +479,7 @@ public function set_version_info_cache( $value = '', $cache_key = '' ) {
470
479
}
471
480
472
481
$ data = array (
473
- 'timeout ' => strtotime ( '+3 hours ' , current_time ( ' timestamp ' ) ),
482
+ 'timeout ' => strtotime ( '+3 hours ' , time ( ) ),
474
483
'value ' => json_encode ( $ value )
475
484
);
476
485
0 commit comments