Make WordPress Core

Ticket #62132: 63132-strawman.patch

File 63132-strawman.patch, 4.9 KB (added by desmith, 2 months ago)
  • wp-admin/includes/network.php

    diff --git a/wp-admin/includes/network.php b/wp-admin/includes/network.php
    index fb3d8d2786..8a58657bd0 100644
    a b define( 'BLOG_ID_CURRENT_SITE', 1 ); 
    554554
    555555                if ( ! empty( $keys_salts ) ) {
    556556                        $keys_salts_str = '';
    557                         $from_api       = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
     557                        $from_api       = wp_remote_get( WP_UPDATE_API_BASE . '/secret-key/1.1/salt/' );
    558558                        if ( is_wp_error( $from_api ) ) {
    559559                                foreach ( $keys_salts as $c => $v ) {
    560560                                        $keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );";
  • wp-admin/includes/plugin-install.php

    diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php
    index 04287736bc..3b8204ade4 100644
    a b function plugins_api( $action, $args = array() ) { 
    146146
    147147        if ( false === $res ) {
    148148
    149                 $url = 'http://api.wordpress.org/plugins/info/1.2/';
     149                $url = WP_UPDATE_API_BASE . '/plugins/info/1.2/';
    150150                $url = add_query_arg(
    151151                        array(
    152152                                'action'  => $action,
  • wp-admin/includes/theme.php

    diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php
    index 8fc9c00f14..3caf1edf40 100644
    a b function themes_api( $action, $args = array() ) { 
    542542        $res = apply_filters( 'themes_api', false, $action, $args );
    543543
    544544        if ( ! $res ) {
    545                 $url = 'http://api.wordpress.org/themes/info/1.2/';
     545                $url = WP_UPDATE_API_BASE . '/themes/info/1.2/';
    546546                $url = add_query_arg(
    547547                        array(
    548548                                'action'  => $action,
  • wp-admin/includes/update.php

    diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php
    index 629c1be1cc..137968130a 100644
    a b function find_core_auto_update() { 
    129129 * @return array|false An array of checksums on success, false on failure.
    130130 */
    131131function get_core_checksums( $version, $locale ) {
    132         $http_url = 'http://api.wordpress.org/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), '', '&' );
     132        $http_url = WP_UPDATE_API_BASE . '/core/checksums/1.0/?' . http_build_query( compact( 'version', 'locale' ), '', '&' );
    133133        $url      = $http_url;
    134134
    135135        $ssl = wp_http_supports( array( 'ssl' ) );
  • wp-includes/default-constants.php

    diff --git a/wp-includes/default-constants.php b/wp-includes/default-constants.php
    index acfc878fb7..ba0041cdf9 100644
    a b function wp_initial_constants() { 
    114114                define( 'WP_CACHE', false );
    115115        }
    116116
     117        if ( ! defined( 'WP_UPDATE_API_BASE' ) ) {
     118                define( 'WP_UPDATE_API_BASE', 'https://api.wordpress.org' );
     119        }
     120
    117121        /*
    118122         * Add define( 'SCRIPT_DEBUG', true ); to wp-config.php to enable loading of non-minified,
    119123         * non-concatenated scripts and stylesheets.
  • wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php

    diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-pattern-directory-controller.php
    index 3345ea0aa1..109a98192d 100644
    a b class WP_REST_Pattern_Directory_Controller extends WP_REST_Controller { 
    114114                $raw_patterns = get_site_transient( $transient_key );
    115115
    116116                if ( ! $raw_patterns ) {
    117                         $api_url = 'http://api.wordpress.org/patterns/1.0/?' . build_query( $query_args );
     117                        $api_url = WP_UPDATE_API_BASE . '/patterns/1.0/?' . build_query( $query_args );
    118118                        if ( wp_http_supports( array( 'ssl' ) ) ) {
    119119                                $api_url = set_url_scheme( $api_url, 'https' );
    120120                        }
  • wp-includes/update.php

    diff --git a/wp-includes/update.php b/wp-includes/update.php
    index 572f7ee4c6..0df19447fd 100644
    a b function wp_version_check( $extra_stats = array(), $force_check = false ) { 
    181181                $query['channel'] = WP_AUTO_UPDATE_CORE;
    182182        }
    183183
    184         $url      = 'http://api.wordpress.org/core/version-check/1.7/?' . http_build_query( $query, '', '&' );
     184        $url      = WP_UPDATE_API_BASE . '/core/version-check/1.7/?' . http_build_query( $query, '', '&' );
    185185        $http_url = $url;
    186186        $ssl      = wp_http_supports( array( 'ssl' ) );
    187187
    function wp_update_plugins( $extra_stats = array() ) { 
    429429                $options['body']['update_stats'] = wp_json_encode( $extra_stats );
    430430        }
    431431
    432         $url      = 'http://api.wordpress.org/plugins/update-check/1.1/';
     432        $url      = WP_UPDATE_API_BASE . '/plugins/update-check/1.1/';
    433433        $http_url = $url;
    434434        $ssl      = wp_http_supports( array( 'ssl' ) );
    435435
    function wp_update_themes( $extra_stats = array() ) { 
    708708                $options['body']['update_stats'] = wp_json_encode( $extra_stats );
    709709        }
    710710
    711         $url      = 'http://api.wordpress.org/themes/update-check/1.1/';
     711        $url      = WP_UPDATE_API_BASE . '/themes/update-check/1.1/';
    712712        $http_url = $url;
    713713        $ssl      = wp_http_supports( array( 'ssl' ) );
    714714