PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.2.4
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.2.4
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 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.1 3.1.10 All 111 releases
← All changes | includes/Utils/Helper.php +24 -1 3.2.33.2.4 View file →
@@ -298,9 +298,9 @@
298 298 public static function fsi_should_exit() {
299 299 if (defined('TEMPLATELY_START_TIME') && ini_get('max_execution_time')) {
300 300 $max_time = ini_get('max_execution_time');
301 301 $elapsed = microtime(true) - TEMPLATELY_START_TIME;
302 - $delay = max(5, $max_time / 20);
302 + $delay = max(5, $max_time * 20 / 100);
303 303
304 304 // Check if elapsed time is close to max execution time
305 305 if ($max_time - $elapsed <= $delay) {
306 306 return ['max_time' => $max_time, 'elapsed' => $elapsed, 'delay' => $delay];
@@ -325,5 +325,28 @@
325 325 }
326 326 }
327 327 return false;
328 328 }
329 +
330 + /**
331 + * Undocumented function
332 + *
333 + * @param [type] $args
334 + * @param [type] $defaults
335 + * @return array
336 + */
337 + public static function recursive_wp_parse_args( $args, $defaults ) {
338 + $args = (array) $args;
339 + $defaults = (array) $defaults;
340 + $r = $defaults;
341 + foreach ( $args as $key => $value ) {
342 + if ( is_array( $value ) && isset( $r[ $key ] ) ) {
343 + $r[ $key ] = self::recursive_wp_parse_args( $value, $r[ $key ] );
344 + }
345 + else {
346 + $r[$key] = $value;
347 + }
348 + }
349 + return $r;
350 + }
351 +
329 352 }