PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.5.1
JetFormBuilder — Dynamic Blocks Form Builder v3.6.5.1
3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / vendor / woocommerce / action-scheduler / classes / ActionScheduler_Compatibility.php
jetformbuilder / vendor / woocommerce / action-scheduler / classes Last commit date
WP_CLI 1 month ago abstracts 1 month ago actions 1 year ago data-stores 1 month ago migration 1 year ago schedules 1 year ago schema 1 month ago ActionScheduler_ActionClaim.php 1 year ago ActionScheduler_ActionFactory.php 1 year ago ActionScheduler_AdminView.php 1 year ago ActionScheduler_AsyncRequest_QueueRunner.php 1 year ago ActionScheduler_Compatibility.php 1 year ago ActionScheduler_DataController.php 1 month ago ActionScheduler_DateTime.php 1 year ago ActionScheduler_Exception.php 2 years ago ActionScheduler_FatalErrorMonitor.php 1 year ago ActionScheduler_InvalidActionException.php 1 year ago ActionScheduler_ListTable.php 1 year ago ActionScheduler_LogEntry.php 1 year ago ActionScheduler_NullLogEntry.php 1 year ago ActionScheduler_OptionLock.php 1 year ago ActionScheduler_QueueCleaner.php 1 year ago ActionScheduler_QueueRunner.php 1 year ago ActionScheduler_RecurringActionScheduler.php 1 month ago ActionScheduler_SystemInformation.php 1 year ago ActionScheduler_Versions.php 1 year ago ActionScheduler_WPCommentCleaner.php 1 year ago ActionScheduler_wcSystemStatus.php 1 month ago
ActionScheduler_Compatibility.php
112 lines
1 <?php
2
3 /**
4 * Class ActionScheduler_Compatibility
5 */
6 class ActionScheduler_Compatibility {
7 /**
8 * Converts a shorthand byte value to an integer byte value.
9 *
10 * Wrapper for wp_convert_hr_to_bytes(), moved to load.php in WordPress 4.6 from media.php
11 *
12 * @link https://secure.php.net/manual/en/function.ini-get.php
13 * @link https://secure.php.net/manual/en/faq.using.php#faq.using.shorthandbytes
14 *
15 * @param string $value A (PHP ini) byte value, either shorthand or ordinary.
16 * @return int An integer byte value.
17 */
18 public static function convert_hr_to_bytes( $value ) {
19 if ( function_exists( 'wp_convert_hr_to_bytes' ) ) {
20 return wp_convert_hr_to_bytes( $value );
21 }
22
23 $value = strtolower( trim( $value ) );
24 $bytes = (int) $value;
25
26 if ( false !== strpos( $value, 'g' ) ) {
27 $bytes *= GB_IN_BYTES;
28 } elseif ( false !== strpos( $value, 'm' ) ) {
29 $bytes *= MB_IN_BYTES;
30 } elseif ( false !== strpos( $value, 'k' ) ) {
31 $bytes *= KB_IN_BYTES;
32 }
33
34 // Deal with large (float) values which run into the maximum integer size.
35 return min( $bytes, PHP_INT_MAX );
36 }
37
38 /**
39 * Attempts to raise the PHP memory limit for memory intensive processes.
40 *
41 * Only allows raising the existing limit and prevents lowering it.
42 *
43 * Wrapper for wp_raise_memory_limit(), added in WordPress v4.6.0
44 *
45 * @return bool|int|string The limit that was set or false on failure.
46 */
47 public static function raise_memory_limit() {
48 if ( function_exists( 'wp_raise_memory_limit' ) ) {
49 return wp_raise_memory_limit( 'admin' );
50 }
51
52 $current_limit = @ini_get( 'memory_limit' ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
53 $current_limit_int = self::convert_hr_to_bytes( $current_limit );
54
55 if ( -1 === $current_limit_int ) {
56 return false;
57 }
58
59 $wp_max_limit = WP_MAX_MEMORY_LIMIT;
60 $wp_max_limit_int = self::convert_hr_to_bytes( $wp_max_limit );
61 $filtered_limit = apply_filters( 'admin_memory_limit', $wp_max_limit );
62 $filtered_limit_int = self::convert_hr_to_bytes( $filtered_limit );
63
64 // phpcs:disable WordPress.PHP.IniSet.memory_limit_Blacklisted
65 // phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged
66
67 if ( -1 === $filtered_limit_int || ( $filtered_limit_int > $wp_max_limit_int && $filtered_limit_int > $current_limit_int ) ) {
68 if ( false !== @ini_set( 'memory_limit', $filtered_limit ) ) {
69 return $filtered_limit;
70 } else {
71 return false;
72 }
73 } elseif ( -1 === $wp_max_limit_int || $wp_max_limit_int > $current_limit_int ) {
74 if ( false !== @ini_set( 'memory_limit', $wp_max_limit ) ) {
75 return $wp_max_limit;
76 } else {
77 return false;
78 }
79 }
80
81 // phpcs:enable
82
83 return false;
84 }
85
86 /**
87 * Attempts to raise the PHP timeout for time intensive processes.
88 *
89 * Only allows raising the existing limit and prevents lowering it. Wrapper for wc_set_time_limit(), when available.
90 *
91 * @param int $limit The time limit in seconds.
92 */
93 public static function raise_time_limit( $limit = 0 ) {
94 $limit = (int) $limit;
95 $max_execution_time = (int) ini_get( 'max_execution_time' );
96
97 // If the max execution time is already set to zero (unlimited), there is no reason to make a further change.
98 if ( 0 === $max_execution_time ) {
99 return;
100 }
101
102 // Whichever of $max_execution_time or $limit is higher is the amount by which we raise the time limit.
103 $raise_by = 0 === $limit || $limit > $max_execution_time ? $limit : $max_execution_time;
104
105 if ( function_exists( 'wc_set_time_limit' ) ) {
106 wc_set_time_limit( $raise_by );
107 } elseif ( function_exists( 'set_time_limit' ) && false === strpos( ini_get( 'disable_functions' ), 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) { // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.safe_modeDeprecatedRemoved
108 @set_time_limit( $raise_by ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
109 }
110 }
111 }
112