Make WordPress Core

Ticket #46292: 46292.diff

File 46292.diff, 1.8 KB (added by costdev, 2 years ago)

Move set_time_limit() to before the lock is created, or before the package is downloaded. Also change 300 to 5 * MINUTES_IN_SECONDS for consistency elsewhere in Core.

  • src/wp-admin/includes/class-core-upgrader.php

    diff --git a/src/wp-admin/includes/class-core-upgrader.php b/src/wp-admin/includes/class-core-upgrader.php
    index f6b6dfaed1..33090308fb 100644
    a b class Core_Upgrader extends WP_Upgrader { 
    115115                        $to_download = 'full';
    116116                }
    117117
     118                set_time_limit( 5 * MINUTE_IN_SECONDS );
     119
    118120                // Lock to prevent multiple Core Updates occurring.
    119121                $lock = WP_Upgrader::create_lock( 'core_updater', 15 * MINUTE_IN_SECONDS );
    120122                if ( ! $lock ) {
  • src/wp-admin/includes/class-wp-upgrader.php

    diff --git a/src/wp-admin/includes/class-wp-upgrader.php b/src/wp-admin/includes/class-wp-upgrader.php
    index 88c6d5d604..15ca240980 100644
    a b class WP_Upgrader { 
    470470                $destination       = $args['destination'];
    471471                $clear_destination = $args['clear_destination'];
    472472
    473                 set_time_limit( 300 );
    474 
    475473                if ( empty( $source ) || empty( $destination ) ) {
    476474                        return new WP_Error( 'bad_request', $this->strings['bad_request'] );
    477475                }
    class WP_Upgrader { 
    754752                        return $res;
    755753                }
    756754
     755                set_time_limit( 5 * MINUTE_IN_SECONDS );
     756
    757757                /*
    758758                 * Download the package. Note: If the package is the full path
    759759                 * to an existing local file, it will be returned untouched.
  • src/wp-admin/includes/update-core.php

    diff --git a/src/wp-admin/includes/update-core.php b/src/wp-admin/includes/update-core.php
    index c240fb0ee6..579e1828f0 100644
    a b $_new_bundled_files = array( 
    962962function update_core( $from, $to ) {
    963963        global $wp_filesystem, $_old_files, $_new_bundled_files, $wpdb;
    964964
    965         set_time_limit( 300 );
    966 
    967965        /**
    968966         * Filters feedback messages displayed during the core update process.
    969967         *