From 8e0fc1d1fdb76ce27b36791631eccd5360472d97 Mon Sep 17 00:00:00 2001 From: ClassyBot Date: Tue, 30 May 2023 00:02:58 +0000 Subject: [PATCH] Nightly build 2.0.0+nightly.20230529 --- wp-admin/includes/class-wp-debug-data.php | 16 +-- wp-admin/includes/class-wp-site-health.php | 88 +++--------- wp-admin/includes/meta-boxes.php | 3 +- wp-admin/install.php | 6 +- wp-includes/class-wp-theme.php | 13 +- wp-includes/deprecated.php | 150 --------------------- wp-includes/script-loader.php | 2 +- wp-includes/version.php | 2 +- 8 files changed, 42 insertions(+), 238 deletions(-) diff --git a/wp-admin/includes/class-wp-debug-data.php b/wp-admin/includes/class-wp-debug-data.php index 011e2bb4..02244d5e 100644 --- a/wp-admin/includes/class-wp-debug-data.php +++ b/wp-admin/includes/class-wp-debug-data.php @@ -46,7 +46,7 @@ public static function debug_data() { $blog_public = get_option( 'blog_public' ); $default_comment_status = get_option( 'default_comment_status' ); $environment_type = wp_get_environment_type(); - $core_version = get_bloginfo( 'version' ); + $core_version = classicpress_version() . ' (WP-' . get_bloginfo( 'version' ) . ')'; $core_updates = get_core_updates(); $core_update_needed = ''; @@ -70,7 +70,7 @@ public static function debug_data() { 'version' => array( 'label' => __( 'Version' ), 'value' => $core_version . $core_update_needed, - 'debug' => $core_version, + 'debug' => '**' . __( 'ClassicPress' ) . '** ' . $core_version, ), 'site_language' => array( 'label' => __( 'Site Language' ), @@ -346,7 +346,7 @@ public static function debug_data() { 'label' => __( 'Filesystem Permissions' ), 'description' => __( 'Shows whether ClassicPress is able to write to the directories it needs access to.' ), 'fields' => array( - 'wordpress' => array( + 'root' => array( 'label' => __( 'The main ClassicPress directory' ), 'value' => ( $is_writable_abspath ? __( 'Writable' ) : __( 'Not writable' ) ), 'debug' => ( $is_writable_abspath ? 'writable' : 'not writable' ), @@ -411,11 +411,11 @@ public static function debug_data() { $loading = __( 'Loading…' ); $info['wp-paths-sizes']['fields'] = array( - 'wordpress_path' => array( + 'classicpress_path' => array( 'label' => __( 'ClassicPress directory location' ), 'value' => untrailingslashit( ABSPATH ), ), - 'wordpress_size' => array( + 'classicpress_size' => array( 'label' => __( 'ClassicPress directory size' ), 'value' => $loading, 'debug' => 'loading...', @@ -1592,14 +1592,14 @@ public static function get_sizes() { // Go through the various installation directories and calculate their sizes. // No trailing slashes. $paths = array( - 'wordpress_size' => untrailingslashit( ABSPATH ), + 'classicpress_size' => untrailingslashit( ABSPATH ), 'themes_size' => get_theme_root(), 'plugins_size' => WP_PLUGIN_DIR, 'uploads_size' => $upload_dir['basedir'], ); $exclude = $paths; - unset( $exclude['wordpress_size'] ); + unset( $exclude['classicpress_size'] ); $exclude = array_values( $exclude ); $size_total = 0; @@ -1614,7 +1614,7 @@ public static function get_sizes() { ); if ( microtime( true ) - WP_START_TIMESTAMP < $max_execution_time ) { - if ( 'wordpress_size' === $name ) { + if ( 'classicpress_size' === $name ) { $dir_size = recurse_dirsize( $path, $exclude, $max_execution_time ); } else { $dir_size = recurse_dirsize( $path, null, $max_execution_time ); diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php index 178edd6b..59008289 100644 --- a/wp-admin/includes/class-wp-site-health.php +++ b/wp-admin/includes/class-wp-site-health.php @@ -724,12 +724,12 @@ public function get_test_theme_version() { * @return array The test results. */ public function get_test_php_version() { - $response = wp_check_php_version(); + global $required_php_version; $result = array( 'label' => sprintf( /* translators: %s: The current PHP version. */ - __( 'Your site is running the current version of PHP (%s)' ), + __( 'Your site is running PHP version (%s)' ), PHP_VERSION ), 'status' => 'good', @@ -742,7 +742,7 @@ public function get_test_php_version() { sprintf( /* translators: %s: The minimum recommended PHP version. */ __( 'PHP is one of the programming languages used to build ClassicPress. Newer versions of PHP receive regular security updates and may increase your site’s performance. The minimum recommended version of PHP is %s.' ), - $response ? $response['recommended_version'] : '' + $required_php_version ) ), 'actions' => sprintf( @@ -756,73 +756,19 @@ public function get_test_php_version() { ); // PHP is up to date. - if ( ! $response || version_compare( PHP_VERSION, $response['recommended_version'], '>=' ) ) { + if ( version_compare( PHP_VERSION, $required_php_version, '>=' ) ) { return $result; - } - - // The PHP version is older than the recommended version, but still receiving active support. - if ( $response['is_supported'] ) { - $result['label'] = sprintf( - /* translators: %s: The server PHP version. */ - __( 'Your site is running on an older version of PHP (%s)' ), - PHP_VERSION - ); - $result['status'] = 'recommended'; - - return $result; - } - - // The PHP version is still receiving security fixes, but is lower than - // the expected minimum version that will be required by ClassicPress in the near future. - if ( $response['is_secure'] && $response['is_lower_than_future_minimum'] ) { - // The `is_secure` array key name doesn't actually imply this is a secure version of PHP. It only means it receives security updates. - - $result['label'] = sprintf( - /* translators: %s: The server PHP version. */ - __( 'Your site is running on an outdated version of PHP (%s), which soon will not be supported by ClassicPress.' ), - PHP_VERSION - ); - - $result['status'] = 'critical'; - $result['badge']['label'] = __( 'Requirements' ); - - return $result; - } - - // The PHP version is only receiving security fixes. - if ( $response['is_secure'] ) { + } else { + // The PHP version is older than the recommended version. $result['label'] = sprintf( /* translators: %s: The server PHP version. */ - __( 'Your site is running on an older version of PHP (%s), which should be updated' ), + __( 'Your site is running on an older and unsupported version of PHP (%s), which should be updated' ), PHP_VERSION ); - $result['status'] = 'recommended'; + $result['status'] = 'critical'; return $result; } - - // No more security updates for the PHP version, and lower than the expected minimum version required by ClassicPress. - if ( $response['is_lower_than_future_minimum'] ) { - $message = sprintf( - /* translators: %s: The server PHP version. */ - __( 'Your site is running on an outdated version of PHP (%s), which does not receive security updates and soon will not be supported by ClassicPress.' ), - PHP_VERSION - ); - } else { - // No more security updates for the PHP version, must be updated. - $message = sprintf( - /* translators: %s: The server PHP version. */ - __( 'Your site is running on an outdated version of PHP (%s), which does not receive security updates. It should be updated.' ), - PHP_VERSION - ); - } - - $result['label'] = $message; - $result['status'] = 'critical'; - - $result['badge']['label'] = __( 'Security' ); - - return $result; } /** @@ -887,7 +833,7 @@ public function get_test_php_extensions() { __( 'PHP modules perform most of the tasks on the server that make your site run. Any changes to these must be made by your server administrator.' ), sprintf( /* translators: 1: Link to the hosting group page about recommended PHP modules. 2: Additional link attributes. 3: Accessibility text. */ - __( 'The ClassicPress Hosting Team maintains a list of those modules, both recommended and required, in the team handbook%3$s.' ), + __( 'ClassicPress maintains a list of those modules, both recommended and required, in the server requirements%3$s.' ), /* translators: Localized team handbook, if one exists. */ esc_url( __( 'https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions' ) ), 'target="_blank" rel="noopener"', @@ -1413,7 +1359,7 @@ public function get_test_utf8mb4_support() { */ public function get_test_dotorg_communication() { $result = array( - 'label' => __( 'Can communicate with WordPress.org' ), + 'label' => __( 'Can communicate with ClassicPress.net' ), 'status' => '', 'badge' => array( 'label' => __( 'Security' ), @@ -1428,7 +1374,7 @@ public function get_test_dotorg_communication() { ); $wp_dotorg = wp_remote_get( - 'https://api.wordpress.org', + 'https://api-v1.classicpress.net', array( 'timeout' => 10, ) @@ -1438,7 +1384,7 @@ public function get_test_dotorg_communication() { } else { $result['status'] = 'critical'; - $result['label'] = __( 'Could not reach WordPress.org' ); + $result['label'] = __( 'Could not reach ClassicPress.net' ); $result['description'] .= sprintf( '

%s

', @@ -1448,8 +1394,8 @@ public function get_test_dotorg_communication() { __( 'Error' ), sprintf( /* translators: 1: The IP address WordPress.org resolves to. 2: The error returned by the lookup. */ - __( 'Your site is unable to reach WordPress.org at %1$s, and returned the error: %2$s' ), - gethostbyname( 'api.wordpress.org' ), + __( 'Your site is unable to reach ClassicPress.net at %1$s, and returned the error: %2$s' ), + gethostbyname( 'api-v1.classicpress.net' ), $wp_dotorg->get_error_message() ) ) @@ -2532,9 +2478,9 @@ public function get_test_persistent_object_cache() { public static function get_tests() { $tests = array( 'direct' => array( - 'wordpress_version' => array( + 'classicpress_version' => array( 'label' => __( 'ClassicPress Version' ), - 'test' => 'wordpress_version', + 'test' => 'classicpress_version', ), 'plugin_version' => array( 'label' => __( 'Plugin Versions' ), @@ -2600,7 +2546,7 @@ public static function get_tests() { ), 'async' => array( 'dotorg_communication' => array( - 'label' => __( 'Communication with WordPress.org' ), + 'label' => __( 'Communication with ClassicPress.net' ), 'test' => rest_url( 'wp-site-health/v1/tests/dotorg-communication' ), 'has_rest' => true, 'async_direct_test' => array( WP_Site_Health::get_instance(), 'get_test_dotorg_communication' ), diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index d2d36798..97ab6298 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -1646,8 +1646,7 @@ function register_and_do_post_meta_boxes( $post ) { 'normal', 'core', array( - '__back_compat_meta_box' => ! (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ), - '__block_editor_compatible_meta_box' => true, + '__back_compat_meta_box' => ! (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ), ) ); } diff --git a/wp-admin/install.php b/wp-admin/install.php index 4a4fedbb..17afed1f 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -70,11 +70,11 @@ function display_header( $body_classes = '' ) { - <?php _e( 'WordPress › Installation' ); ?> + <?php _e( 'ClassicPress › Installation' ); ?> - + -

'submit' ) ); ?>

+

'submit' ) ); ?>

'Text Domain', 'DomainPath' => 'Domain Path', 'RequiresWP' => 'Requires at least', + 'RequiresCP' => 'Requires CP', 'RequiresPHP' => 'Requires PHP', 'UpdateURI' => 'Update URI', ); @@ -293,6 +295,10 @@ public function __construct( $theme_dir, $theme_root, $_child = null ) { return; } else { $this->headers = get_file_data( $this->theme_root . '/' . $theme_file, self::$file_headers, 'theme' ); + // If no Update URI is defined and Requires CP is set fall back to ClassicPress directory URL. + if ( ! $this->headers['UpdateURI'] && filter_var( $this->headers['RequiresCP'], FILTER_VALIDATE_FLOAT ) !== false ) { + $this->headers['UpdateURI'] = 'https://directory.classicpress.net/wp-json/wp/v2/themes?byslug=' . preg_replace( '/[^a-zA-Z0-9_\-]/', '', $this->stylesheet ); + } // Default themes always trump their pretenders. // Properly identify default themes that are inside a directory within wp-content/themes. $default_theme_slug = array_search( $this->headers['Name'], self::$default_themes, true ); @@ -831,10 +837,12 @@ public function display( $header, $markup = true, $translate = true ) { * @since 3.4.0 * @since 5.4.0 Added support for `Requires at least` and `Requires PHP` headers. * @since 6.1.0 Added support for `Update URI` header. + * @since CP-2.0.0 Added support for `Requires CP` header. + * * * @param string $header Theme header. Accepts 'Name', 'Description', 'Author', 'Version', - * 'ThemeURI', 'AuthorURI', 'Status', 'Tags', 'RequiresWP', 'RequiresPHP', - * 'UpdateURI'. + * 'ThemeURI', 'AuthorURI', 'Status', 'Tags', 'RequiresWP', + * 'RequiresCP', 'RequiresPHP', 'UpdateURI'. * @param string $value Value to sanitize. * @return string|array An array for Tags header, string otherwise. */ @@ -884,6 +892,7 @@ private function sanitize_header( $header, $value ) { case 'Version': case 'RequiresWP': case 'RequiresPHP': + case 'RequiresCP': case 'UpdateURI': $value = strip_tags( $value ); break; diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 0813aeff..a5737570 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -4200,25 +4200,6 @@ function wp_sensitive_page_meta() { wp_strict_cross_origin_referrer(); } -/** - * Render inner blocks from the `core/columns` block for generating an excerpt. - * - * @since 5.2.0 - * @access private - * @deprecated 5.8.0 Use _excerpt_render_inner_blocks() introduced in 5.8.0. - * - * @see _excerpt_render_inner_blocks() - * - * @param array $columns The parsed columns block. - * @param array $allowed_blocks The list of allowed inner blocks. - * @return string The rendered inner blocks. - */ -function _excerpt_render_inner_columns_blocks( $columns, $allowed_blocks ) { - _deprecated_function( __FUNCTION__, '5.8.0', '_excerpt_render_inner_blocks()' ); - - return _excerpt_render_inner_blocks( $columns, $allowed_blocks ); -} - /** * Renders the duotone filter SVG and returns the CSS filter property to * reference the rendered SVG. @@ -4237,83 +4218,6 @@ function wp_render_duotone_filter_preset( $preset ) { return wp_get_duotone_filter_property( $preset ); } -/** - * Checks whether serialization of the current block's border properties should occur. - * - * @since 5.8.0 - * @access private - * @deprecated 6.0.0 Use wp_should_skip_block_supports_serialization() introduced in 6.0.0. - * - * @see wp_should_skip_block_supports_serialization() - * - * @param WP_Block_Type $block_type Block type. - * @return bool Whether serialization of the current block's border properties - * should occur. - */ -function wp_skip_border_serialization( $block_type ) { - _deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' ); - - $border_support = _wp_array_get( $block_type->supports, array( '__experimentalBorder' ), false ); - - return is_array( $border_support ) && - array_key_exists( '__experimentalSkipSerialization', $border_support ) && - $border_support['__experimentalSkipSerialization']; -} - -/** - * Checks whether serialization of the current block's dimensions properties should occur. - * - * @since 5.9.0 - * @access private - * @deprecated 6.0.0 Use wp_should_skip_block_supports_serialization() introduced in 6.0.0. - * - * @see wp_should_skip_block_supports_serialization() - * - * @param WP_Block_type $block_type Block type. - * @return bool Whether to serialize spacing support styles & classes. - */ -function wp_skip_dimensions_serialization( $block_type ) { - _deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' ); - - $dimensions_support = _wp_array_get( $block_type->supports, array( '__experimentalDimensions' ), false ); - - return is_array( $dimensions_support ) && - array_key_exists( '__experimentalSkipSerialization', $dimensions_support ) && - $dimensions_support['__experimentalSkipSerialization']; -} - -/** - * Checks whether serialization of the current block's spacing properties should occur. - * - * @since 5.9.0 - * @access private - * @deprecated 6.0.0 Use wp_should_skip_block_supports_serialization() introduced in 6.0.0. - * - * @see wp_should_skip_block_supports_serialization() - * - * @param WP_Block_Type $block_type Block type. - * @return bool Whether to serialize spacing support styles & classes. - */ -function wp_skip_spacing_serialization( $block_type ) { - _deprecated_function( __FUNCTION__, '6.0.0', 'wp_should_skip_block_supports_serialization()' ); - - $spacing_support = _wp_array_get( $block_type->supports, array( 'spacing' ), false ); - - return is_array( $spacing_support ) && - array_key_exists( '__experimentalSkipSerialization', $spacing_support ) && - $spacing_support['__experimentalSkipSerialization']; -} - -/** - * Inject the block editor assets that need to be loaded into the editor's iframe as an inline script. - * - * @since 5.8.0 - * @deprecated 6.0.0 - */ -function wp_add_iframed_editor_assets_html() { - _deprecated_function( __FUNCTION__, '6.0.0' ); -} - /** * Retrieves thumbnail for an attachment. * Note that this works only for the (very) old image metadata style where 'thumb' was set, @@ -4445,60 +4349,6 @@ function _get_path_to_translation_from_lang_dir( $domain ) { return false; } -/** - * Allows multiple block styles. - * - * @since 5.9.0 - * @deprecated 6.1.0 - * - * @param array $metadata Metadata for registering a block type. - * @return array Metadata for registering a block type. - */ - function _wp_multiple_block_styles( $metadata ) { - _deprecated_function( __FUNCTION__, '6.1.0' ); - return $metadata; -} - -/** - * Generates an inline style for a typography feature e.g. text decoration, - * text transform, and font style. - * - * @since 5.8.0 - * @access private - * @deprecated 6.1.0 Use wp_style_engine_get_styles() introduced in 6.1.0. - * - * @see wp_style_engine_get_styles() - * - * @param array $attributes Block's attributes. - * @param string $feature Key for the feature within the typography styles. - * @param string $css_property Slug for the CSS property the inline style sets. - * @return string CSS inline style. - */ -function wp_typography_get_css_variable_inline_style( $attributes, $feature, $css_property ) { - _deprecated_function( __FUNCTION__, '6.1.0', 'wp_style_engine_get_styles()' ); - - // Retrieve current attribute value or skip if not found. - $style_value = _wp_array_get( $attributes, array( 'style', 'typography', $feature ), false ); - if ( ! $style_value ) { - return; - } - - // If we don't have a preset CSS variable, we'll assume it's a regular CSS value. - if ( strpos( $style_value, "var:preset|{$css_property}|" ) === false ) { - return sprintf( '%s:%s;', $css_property, $style_value ); - } - - /* - * We have a preset CSS variable as the style. - * Get the style value from the string and return CSS style. - */ - $index_to_splice = strrpos( $style_value, '|' ) + 1; - $slug = substr( $style_value, $index_to_splice ); - - // Return the actual CSS inline style e.g. `text-decoration:var(--wp--preset--text-decoration--underline);`. - return sprintf( '%s:var(--wp--preset--%s--%s);', $css_property, $css_property, $slug ); -} - /** * Determines whether global terms are enabled. * diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 8a5ecb38..ea19eb37 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -53,7 +53,7 @@ function classicpress_asset_version( $type = 'script', $handle = null ) { static $default_version; if ( empty( $default_version ) ) { - $default_version = 'cp_bbed288e'; + $default_version = 'cp_9acd255b'; } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index ebd26939..515d6af7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -27,7 +27,7 @@ * * @global string $cp_version */ -$cp_version = '2.0.0+nightly.20230528'; +$cp_version = '2.0.0+nightly.20230529'; /** * The WordPress version string.