Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-automatic-updater.php

    r45932 r47122  
    142142        }
    143143
    144         // Only relax the filesystem checks when the update doesn't include new files
     144        // Only relax the filesystem checks when the update doesn't include new files.
    145145        $allow_relaxed_file_ownership = false;
    146146        if ( 'core' == $type && isset( $item->new_files ) && ! $item->new_files ) {
     
    284284            case 'plugin':
    285285                $upgrader = new Plugin_Upgrader( $skin );
    286                 $context  = WP_PLUGIN_DIR; // We don't support custom Plugin directories, or updates for WPMU_PLUGIN_DIR
     286                $context  = WP_PLUGIN_DIR; // We don't support custom Plugin directories, or updates for WPMU_PLUGIN_DIR.
    287287                break;
    288288            case 'theme':
     
    358358                // Only available for core updates.
    359359                'attempt_rollback'             => true,
    360                 // Allow relaxed file ownership in some scenarios
     360                // Allow relaxed file ownership in some scenarios.
    361361                'allow_relaxed_file_ownership' => $allow_relaxed_file_ownership,
    362362            )
     
    410410        }
    411411
    412         // Don't automatically run these thins, as we'll handle it ourselves
     412        // Don't automatically run these things, as we'll handle it ourselves.
    413413        remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
    414414        remove_action( 'upgrader_process_complete', 'wp_version_check' );
     
    416416        remove_action( 'upgrader_process_complete', 'wp_update_themes' );
    417417
    418         // Next, Plugins
    419         wp_update_plugins(); // Check for Plugin updates
     418        // Next, plugins.
     419        wp_update_plugins(); // Check for plugin updates.
    420420        $plugin_updates = get_site_transient( 'update_plugins' );
    421421        if ( $plugin_updates && ! empty( $plugin_updates->response ) ) {
     
    423423                $this->update( 'plugin', $plugin );
    424424            }
    425             // Force refresh of plugin update information
     425            // Force refresh of plugin update information.
    426426            wp_clean_plugins_cache();
    427427        }
    428428
    429         // Next, those themes we all love
    430         wp_update_themes();  // Check for Theme updates
     429        // Next, those themes we all love.
     430        wp_update_themes();  // Check for theme updates.
    431431        $theme_updates = get_site_transient( 'update_themes' );
    432432        if ( $theme_updates && ! empty( $theme_updates->response ) ) {
     
    434434                $this->update( 'theme', (object) $theme );
    435435            }
    436             // Force refresh of theme update information
     436            // Force refresh of theme update information.
    437437            wp_clean_themes_cache();
    438438        }
    439439
    440         // Next, Process any core update
    441         wp_version_check(); // Check for Core updates
     440        // Next, process any core update.
     441        wp_version_check(); // Check for core updates.
    442442        $core_update = find_core_auto_update();
    443443
     
    446446        }
    447447
    448         // Clean up, and check for any pending translations
    449         // (Core_Upgrader checks for core updates)
     448        // Clean up, and check for any pending translations.
     449        // (Core_Upgrader checks for core updates.)
    450450        $theme_stats = array();
    451451        if ( isset( $this->update_results['theme'] ) ) {
     
    454454            }
    455455        }
    456         wp_update_themes( $theme_stats );  // Check for Theme updates
     456        wp_update_themes( $theme_stats ); // Check for theme updates.
    457457
    458458        $plugin_stats = array();
     
    462462            }
    463463        }
    464         wp_update_plugins( $plugin_stats ); // Check for Plugin updates
    465 
    466         // Finally, Process any new translations
     464        wp_update_plugins( $plugin_stats ); // Check for plugin updates.
     465
     466        // Finally, process any new translations.
    467467        $language_updates = wp_get_translation_updates();
    468468        if ( $language_updates ) {
     
    471471            }
    472472
    473             // Clear existing caches
     473            // Clear existing caches.
    474474            wp_clean_update_cache();
    475475
    476             wp_version_check();  // check for Core updates
    477             wp_update_themes();  // Check for Theme updates
    478             wp_update_plugins(); // Check for Plugin updates
     476            wp_version_check();  // Check for core updates.
     477            wp_update_themes();  // Check for theme updates.
     478            wp_update_plugins(); // Check for plugin updates.
    479479        }
    480480
     
    627627
    628628        $next_user_core_update = get_preferred_from_update_core();
    629         // If the update transient is empty, use the update we just performed
     629        // If the update transient is empty, use the update we just performed.
    630630        if ( ! $next_user_core_update ) {
    631631            $next_user_core_update = $core_update;
     
    861861        $body[] = sprintf( __( 'WordPress site: %s' ), network_home_url( '/' ) );
    862862
    863         // Core
     863        // Core.
    864864        if ( isset( $this->update_results['core'] ) ) {
    865865            $result = $this->update_results['core'][0];
     
    875875        }
    876876
    877         // Plugins, Themes, Translations
     877        // Plugins, Themes, Translations.
    878878        foreach ( array( 'plugin', 'theme', 'translation' ) as $type ) {
    879879            if ( ! isset( $this->update_results[ $type ] ) ) {
     
    895895            }
    896896            if ( $success_items != $this->update_results[ $type ] ) {
    897                 // Failed updates
     897                // Failed updates.
    898898                $messages = array(
    899899                    'plugin'      => __( 'The following plugins failed to update:' ),
Note: See TracChangeset for help on using the changeset viewer.