PluginProbe
Force Refresh / 2.9.1
Force Refresh v2.9.1
3.2.1 3.2.0 3.1.2 3.1.1 3.1.0 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.2.0 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.11.0 2.11.1 2.12.0 All 54 releases
force-refresh / includes / actions / inc.options.php

inc.options.php in Force Refresh 2.9.1, at includes/actions/inc.options.php

33 lines 770 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * All of our package actions to register.
4 *
5 * @package ForceRefresh
6 */
7
8 namespace JordanLeven\Plugins\ForceRefresh;
9
10 define( 'DEBUG_MODE_ACTIVE_IN_HOURS', 48 );
11
12 /**
13 * Function to get whether or not debug mode is currently enabled.
14 *
15 * @return bool True if debug mode is enabled
16 */
17 function get_option_debug_mode(): bool {
18 $debug_active_date = (string) get_option(
19 WP_FORCE_REFRESH_OPTION_DEBUG_ACTIVE_DATE,
20 ''
21 );
22
23 if ( ! $debug_active_date ) {
24 return false;
25 }
26
27 $time_current = strtotime( current_time( 'mysql' ) );
28 $time_debug = strtotime( $debug_active_date );
29
30 $difference_in_hours = abs( $time_current - $time_debug ) / 3600;
31 return $difference_in_hours < DEBUG_MODE_ACTIVE_IN_HOURS;
32 }
33