File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 79
79
define ( 'FICTIONEER_AUTHOR_KEYWORD_SEARCH_LIMIT ' , 100 );
80
80
}
81
81
82
+ // Integer: Update check timeout
83
+ if ( ! defined ( 'FICTIONEER_UPDATE_CHECK_TIMEOUT ' ) ) {
84
+ define ( 'FICTIONEER_UPDATE_CHECK_TIMEOUT ' , 3600 );
85
+ }
86
+
82
87
/*
83
88
* Booleans
84
89
*/
Original file line number Diff line number Diff line change @@ -912,8 +912,8 @@ function fictioneer_check_for_updates() {
912
912
$ latest_version = get_option ( 'fictioneer_latest_version ' , FICTIONEER_RELEASE_TAG );
913
913
$ is_updates_page = $ pagenow == 'update-core.php ' ;
914
914
915
- // Only call API every 30 minutes , otherwise check database
916
- if ( ! empty ( $ latest_version ) && time () < $ last_check + 1800 && ! $ is_updates_page ) {
915
+ // Only call API every n seconds , otherwise check database
916
+ if ( ! empty ( $ latest_version ) && time () < $ last_check + FICTIONEER_UPDATE_CHECK_TIMEOUT && ! $ is_updates_page ) {
917
917
return version_compare ( $ latest_version , FICTIONEER_RELEASE_TAG , '> ' );
918
918
}
919
919
@@ -961,8 +961,8 @@ function fictioneer_admin_update_notice() {
961
961
// Abort if...
962
962
if ( ! current_user_can ( 'manage_options ' ) ) return ;
963
963
964
- // Show only once every 30 minutes
965
- if ( $ last_notice + 1800 > time () && ! $ is_updates_page ) return ;
964
+ // Show only once every n seconds
965
+ if ( $ last_notice + FICTIONEER_UPDATE_CHECK_TIMEOUT > time () && ! $ is_updates_page ) return ;
966
966
967
967
// Update?
968
968
if ( ! fictioneer_check_for_updates () ) return ;
You can’t perform that action at this time.
0 commit comments