Ticket #4009: 4009.diff
File 4009.diff, 7.5 KB (added by , 6 years ago) |
---|
-
api.wordpress.org/public_html/core/serve-happy/1.0/config.php
4 4 // The latest branch of PHP which WordPress.org recommends. 5 5 define( 'RECOMMENDED_PHP', '7.2' ); 6 6 7 // The oldest branch of PHP which WordPress core still works with. 8 define( 'MINIMUM_PHP', '5.2.4' ); 9 7 10 // The lowest branch of PHP which is actively supported. 8 11 define( 'SUPPORTED_PHP', '7.0' ); 9 12 -
api.wordpress.org/public_html/core/serve-happy/1.0/include.php
26 26 27 27 return array( 28 28 'recommended_version' => RECOMMENDED_PHP, 29 'minimum_version' => MINIMUM_PHP, 29 30 'is_supported' => version_compare( $php_version, SUPPORTED_PHP, '>=' ), 30 31 'is_secure' => version_compare( $php_version, SECURE_PHP, '>=' ), 31 32 'is_acceptable' => version_compare( $php_version, ACCEPTABLE_PHP, '>=' ), -
wordpress.org/public_html/wp-content/themes/pub/wporg-main/functions.php
247 247 * Include the Privacy request functions. 248 248 */ 249 249 require_once __DIR__ . '/inc/privacy-functions.php'; 250 251 /** 252 * Include the functions for retrieving version numbers. 253 */ 254 require_once __DIR__ . '/inc/versions.php'; -
wordpress.org/public_html/wp-content/themes/pub/wporg-main/inc/versions.php
1 <?php 2 /** 3 * Functions for retrieving version numbers 4 * 5 * @package WordPressdotorg\MainTheme 6 */ 7 8 namespace WordPressdotorg\MainTheme; 9 10 /** 11 * Gets the PHP version that WordPress recommends. 12 * 13 * @return string PHP version number. 14 */ 15 function get_recommended_php_version() { 16 $response = query_servehappy_api(); 17 18 // On failure, return a hard-coded result. 19 if ( ! $response || empty( $response['recommended_version'] ) ) { 20 return '7.2'; 21 } 22 23 return $response['recommended_version']; 24 } 25 26 /** 27 * Gets the minimum PHP version that WordPress supports. 28 * 29 * @return string PHP version number. 30 */ 31 function get_minimum_php_version() { 32 $response = query_servehappy_api(); 33 34 // On failure, return a hard-coded result. 35 if ( ! $response || empty( $response['minimum_version'] ) ) { 36 return '5.2.4'; 37 } 38 39 return $response['minimum_version']; 40 } 41 42 /** 43 * Queries the Servehappy API on wordpress.org to retrieve general PHP version information. 44 * 45 * @return array|false $response Array of PHP version data. False on failure. 46 */ 47 function query_servehappy_api() { 48 $version = phpversion(); 49 $key = md5( $version ); 50 51 $response = get_site_transient( 'wporg_main_servehappy' ); 52 if ( false === $response ) { 53 $url = 'http://api.wordpress.org/core/serve-happy/1.0/'; 54 if ( wp_http_supports( array( 'ssl' ) ) ) { 55 $url = set_url_scheme( $url, 'https' ); 56 } 57 58 // The API requires passing a PHP version, so we just pass something arbitrary. 59 $url = add_query_arg( 'php_version', '5.2', $url ); 60 61 $response = wp_remote_get( $url ); 62 63 if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { 64 return false; 65 } 66 67 /** 68 * Response should be an array with: 69 * 'recommended_version' - string - The PHP version recommended by WordPress. 70 * 'minimum_version' - string - The minimum PHP version supported by WordPress. 71 * 'is_supported' - boolean - Whether the PHP version is actively supported. 72 * 'is_secure' - boolean - Whether the PHP version receives security updates. 73 * 'is_acceptable' - boolean - Whether the PHP version is still acceptable for WordPress. 74 */ 75 $response = json_decode( wp_remote_retrieve_body( $response ), true ); 76 77 if ( ! is_array( $response ) ) { 78 return false; 79 } 80 81 set_site_transient( 'wporg_main_servehappy', $response, WEEK_IN_SECONDS ); 82 } 83 84 return $response; 85 } -
wordpress.org/public_html/wp-content/themes/pub/wporg-main/page-about-requirements.php
43 43 <li> 44 44 <?php 45 45 /* translators: 1: URL to PHP; 2: PHP Version */ 46 printf( wp_kses_post( __( '<a href="%1$s">PHP</a> version %2$s or greater.', 'wporg' ) ), esc_url( 'http://www.php.net/' ), '7.2');46 printf( wp_kses_post( __( '<a href="%1$s">PHP</a> version %2$s or greater.', 'wporg' ) ), esc_url( 'http://www.php.net/' ), get_recommended_php_version() ); 47 47 ?> 48 48 </li> 49 49 <li> … … 72 72 printf( 73 73 /* translators: 1: PHP Version including; 2: MySQL Version */ 74 74 wp_kses_post( __( 'Note: If you are in a legacy environment where you only have older PHP or MySQL versions, WordPress also works with PHP %1$s+ and MySQL %2$s+, but these versions have reached official End Of Life and as such <strong>may expose your site to security vulnerabilities</strong>.', 'wporg' ) ), 75 '5.2.4',75 get_minimum_php_version(), 76 76 '5.0' 77 77 ); 78 78 ?> … … 89 89 <li> 90 90 <?php 91 91 /* translators: PHP Version */ 92 printf( esc_html__( 'PHP %s or greater', 'wporg' ), '7.2');92 printf( esc_html__( 'PHP %s or greater', 'wporg' ), get_recommended_php_version() ); 93 93 ?> 94 94 </li> 95 95 <li> -
wordpress.org/public_html/wp-content/themes/pub/wporg-main/page-download.php
146 146 <p> 147 147 <?php 148 148 printf( 149 /* translators: 1: URL to PHP website; 2: URL to MySQL website; 3: URL to MariaDB website*/150 wp_kses_post( __( 'We recommend servers running version 7.2 or greater of <a href="%1$s">PHP</a> and <a href="%2$s">MySQL</a> version 5.6 <em>OR</em> <a href="%3$s">MariaDB</a> version 10.0or greater.', 'wporg' ) ),149 /* translators: 1: URL to PHP website; 2: PHP version; 3: URL to MySQL website; 4: MySQL version; 5: URL to MariaDB website; 6: MariaDB version */ 150 wp_kses_post( __( 'We recommend servers running version %2$s or greater of <a href="%1$s">PHP</a> and <a href="%3$s">MySQL</a> version %4$s <em>OR</em> <a href="%5$s">MariaDB</a> version %6$s or greater.', 'wporg' ) ), 151 151 esc_url( 'http://www.php.net/' ), 152 get_recommended_php_version(), 152 153 esc_url( 'https://www.mysql.com/' ), 153 esc_url( 'https://mariadb.org/' ) 154 '5.6', 155 esc_url( 'https://mariadb.org/' ), 156 '10.0' 154 157 ); 155 158 ?> 156 159 <br>