IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 406 | 406 | return $return; |
| 407 | 407 | |
| 408 | 408 | // When in cron (background updates) don't deactivate the plugin, as we require a browser to reactivate it |
| 409 | | if ( defined( 'DOING_CRON' ) && DOING_CRON ) |
| | 409 | if ( wp_doing_cron() ) |
| 410 | 410 | return $return; |
| 411 | 411 | |
| 412 | 412 | $plugin = isset($plugin['plugin']) ? $plugin['plugin'] : ''; |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 663 | 663 | * A disk that has zero free bytes has bigger problems. |
| 664 | 664 | * Require we have enough space to unzip the file and copy its contents, with a 10% buffer. |
| 665 | 665 | */ |
| 666 | | if ( defined( 'DOING_CRON' ) && DOING_CRON ) { |
| | 666 | if ( wp_doing_cron() ) { |
| 667 | 667 | $available_space = @disk_free_space( WP_CONTENT_DIR ); |
| 668 | 668 | if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) |
| 669 | 669 | return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) ); |
| … |
… |
|
| 769 | 769 | * A disk that has zero free bytes has bigger problems. |
| 770 | 770 | * Require we have enough space to unzip the file and copy its contents, with a 10% buffer. |
| 771 | 771 | */ |
| 772 | | if ( defined( 'DOING_CRON' ) && DOING_CRON ) { |
| | 772 | if ( wp_doing_cron() ) { |
| 773 | 773 | $available_space = @disk_free_space( WP_CONTENT_DIR ); |
| 774 | 774 | if ( $available_space && ( $uncompressed_size * 2.1 ) > $available_space ) |
| 775 | 775 | return new WP_Error( 'disk_full_unzip_file', __( 'Could not copy files. You may have run out of disk space.' ), compact( 'uncompressed_size', 'available_space' ) ); |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 108 | 108 | if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) |
| 109 | 109 | $url = set_url_scheme( $url, 'https' ); |
| 110 | 110 | |
| | 111 | $doing_cron = wp_doing_cron(); |
| | 112 | |
| 111 | 113 | $options = array( |
| 112 | | 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3 ), |
| | 114 | 'timeout' => $doing_cron ? 30 : 3, |
| 113 | 115 | 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ), |
| 114 | 116 | 'headers' => array( |
| 115 | 117 | 'wp_install' => $wp_install, |
| … |
… |
|
| 177 | 179 | } |
| 178 | 180 | |
| 179 | 181 | // Trigger background updates if running non-interactively, and we weren't called from the update handler. |
| 180 | | if ( defined( 'DOING_CRON' ) && DOING_CRON && ! doing_action( 'wp_maybe_auto_update' ) ) { |
| | 182 | if ( $doing_cron && ! doing_action( 'wp_maybe_auto_update' ) ) { |
| 181 | 183 | do_action( 'wp_maybe_auto_update' ); |
| 182 | 184 | } |
| 183 | 185 | } |
| … |
… |
|
| 217 | 219 | $new_option = new stdClass; |
| 218 | 220 | $new_option->last_checked = time(); |
| 219 | 221 | |
| | 222 | $doing_cron = wp_doing_cron(); |
| | 223 | |
| 220 | 224 | // Check for update on a different schedule, depending on the page. |
| 221 | 225 | switch ( current_filter() ) { |
| 222 | 226 | case 'upgrader_process_complete' : |
| … |
… |
|
| 230 | 234 | $timeout = HOUR_IN_SECONDS; |
| 231 | 235 | break; |
| 232 | 236 | default : |
| 233 | | if ( defined( 'DOING_CRON' ) && DOING_CRON ) { |
| | 237 | if ( $doing_cron ) { |
| 234 | 238 | $timeout = 0; |
| 235 | 239 | } else { |
| 236 | 240 | $timeout = 12 * HOUR_IN_SECONDS; |
| … |
… |
|
| 282 | 286 | $locales = apply_filters( 'plugins_update_check_locales', $locales ); |
| 283 | 287 | $locales = array_unique( $locales ); |
| 284 | 288 | |
| 285 | | if ( defined( 'DOING_CRON' ) && DOING_CRON ) { |
| | 289 | if ( $doing_cron ) { |
| 286 | 290 | $timeout = 30; |
| 287 | 291 | } else { |
| 288 | 292 | // Three seconds, plus one extra second for every 10 plugins |
| … |
… |
|
| 400 | 404 | ); |
| 401 | 405 | } |
| 402 | 406 | |
| | 407 | $doing_cron = wp_doing_cron(); |
| | 408 | |
| 403 | 409 | // Check for update on a different schedule, depending on the page. |
| 404 | 410 | switch ( current_filter() ) { |
| 405 | 411 | case 'upgrader_process_complete' : |
| … |
… |
|
| 413 | 419 | $timeout = HOUR_IN_SECONDS; |
| 414 | 420 | break; |
| 415 | 421 | default : |
| 416 | | if ( defined( 'DOING_CRON' ) && DOING_CRON ) { |
| 417 | | $timeout = 0; |
| 418 | | } else { |
| 419 | | $timeout = 12 * HOUR_IN_SECONDS; |
| 420 | | } |
| | 422 | $timeout = $doing_cron ? 0 : 12 * HOUR_IN_SECONDS; |
| 421 | 423 | } |
| 422 | 424 | |
| 423 | 425 | $time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time() - $last_update->last_checked ); |
| … |
… |
|
| 463 | 465 | $locales = apply_filters( 'themes_update_check_locales', $locales ); |
| 464 | 466 | $locales = array_unique( $locales ); |
| 465 | 467 | |
| 466 | | if ( defined( 'DOING_CRON' ) && DOING_CRON ) { |
| | 468 | if ( $doing_cron ) { |
| 467 | 469 | $timeout = 30; |
| 468 | 470 | } else { |
| 469 | 471 | // Three seconds, plus one extra second for every 10 themes |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 1059 | 1059 | return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX ); |
| 1060 | 1060 | } |
| 1061 | 1061 | |
| | 1062 | /** |
| | 1063 | * Determines whether the current request is doing a CRON task. |
| | 1064 | * |
| | 1065 | * @since 4.8.0 |
| | 1066 | * |
| | 1067 | * @return bool True if we are doing a CRON task, false otherwise. |
| | 1068 | */ |
| | 1069 | function wp_doing_cron() { |
| | 1070 | /** |
| | 1071 | * Filters whether the current request is doing a CRON task. |
| | 1072 | * |
| | 1073 | * @since 4.8.0 |
| | 1074 | * |
| | 1075 | * @param bool $wp_doing_cron Whether the current request is doing a CRON task. |
| | 1076 | */ |
| | 1077 | return apply_filters( 'wp_doing_cron', defined( 'DOING_CRON' ) && DOING_CRON ); |
| | 1078 | } |
| | 1079 | |
| 1062 | 1080 | /** |
| 1063 | 1081 | * Check whether variable is a WordPress Error. |
| 1064 | 1082 | * |
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 107 | 107 | $url = set_url_scheme( $url, 'https' ); |
| 108 | 108 | |
| 109 | 109 | $options = array( |
| 110 | | 'timeout' => ( ( defined('DOING_CRON') && DOING_CRON ) ? 30 : 3 ), |
| | 110 | 'timeout' => wp_doing_cron() ? 30 : 3, |
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | 113 | $response = wp_remote_get( $url, $options ); |