diff --git a/.phan/stubs/wpcom-stubs.php b/.phan/stubs/wpcom-stubs.php index 8072ce49e258d..f5eb9a8718173 100644 --- a/.phan/stubs/wpcom-stubs.php +++ b/.phan/stubs/wpcom-stubs.php @@ -4,7 +4,7 @@ * `bin/teamcity-builds/jetpack-stubs/stub-defs.php` and regenerate the stubs * by triggering the Jetpack Staging → Update WPCOM Stubs job in TeamCity. * - * Stubs automatically generated from WordPress.com commit e060d49d53909b256abff72b5ffe22152e96eadd. + * Stubs automatically generated from WordPress.com commit 753696f231e5c160460266a6f63e5b87cdcbea50. */ namespace { @@ -321,8 +321,11 @@ public static function get_product_list($_blog_id, $type = \null, ?bool $is_edit { } } - class Memberships_Store_Sandbox extends \Store_Sandbox + class Memberships_Store_Sandbox { + public function init($force = \false) + { + } /** * @return Memberships_Store_Sandbox */ diff --git a/projects/js-packages/components/changelog/add-loading-placeholder-while-waiting-price b/projects/js-packages/components/changelog/add-loading-placeholder-while-waiting-price new file mode 100644 index 0000000000000..2c20cf7b4be4d --- /dev/null +++ b/projects/js-packages/components/changelog/add-loading-placeholder-while-waiting-price @@ -0,0 +1,4 @@ +Significance: minor +Type: changed + +Jetpack Backup: Add a LoadingPlaceholder while waiting for Jetpack Backup price diff --git a/projects/js-packages/components/components/pricing-card/index.tsx b/projects/js-packages/components/components/pricing-card/index.tsx index 8a9a9dbbeb2b1..781e4d8370857 100644 --- a/projects/js-packages/components/components/pricing-card/index.tsx +++ b/projects/js-packages/components/components/pricing-card/index.tsx @@ -1,4 +1,5 @@ import { getCurrencyObject } from '@automattic/format-currency'; +import { LoadingPlaceholder } from '@automattic/jetpack-components'; import { Button } from '@wordpress/components'; import { sprintf, __ } from '@wordpress/i18n'; import TermsOfService from '../terms-of-service'; @@ -54,7 +55,7 @@ const PricingCard: React.FC< PricingCardProps > = ( { ) }

{ props.title }

- { props.priceBefore !== props.priceAfter && ( + { props.priceBefore !== props.priceAfter && props.priceAfter > 0 ? (
{ currencyObjectBefore.symbol } @@ -70,21 +71,27 @@ const PricingCard: React.FC< PricingCardProps > = ( { ) }
+ ) : ( + + ) } + { props.priceAfter > 0 && ( + <> +
+ + { currencyObjectAfter.symbol } + + + { currencyObjectAfter.integer } + + { showPriceDecimals( currencyObjectAfter ) && ( + + { currencyObjectAfter.fraction } + + ) } +
+ { priceDetails } + ) } -
- - { currencyObjectAfter.symbol } - - - { currencyObjectAfter.integer } - - { showPriceDecimals( currencyObjectAfter ) && ( - - { currencyObjectAfter.fraction } - - ) } -
- { priceDetails }
{ props.children && ( diff --git a/projects/packages/forms/changelog/fix-contact-form-tiny-mce-editor-min-error b/projects/packages/forms/changelog/fix-contact-form-tiny-mce-editor-min-error new file mode 100644 index 0000000000000..164a8824ea0e6 --- /dev/null +++ b/projects/packages/forms/changelog/fix-contact-form-tiny-mce-editor-min-error @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Contact Form: Prevent an editor error when using the Classic Editor and contact forms are enabled diff --git a/projects/packages/forms/package.json b/projects/packages/forms/package.json index 6023dc4307bc9..a33a846ed2c5a 100644 --- a/projects/packages/forms/package.json +++ b/projects/packages/forms/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-forms", - "version": "0.31.0", + "version": "0.31.1-alpha", "description": "Jetpack Forms", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/forms/#readme", "bugs": { diff --git a/projects/packages/forms/src/class-jetpack-forms.php b/projects/packages/forms/src/class-jetpack-forms.php index 592d131be3934..8cf2a62f00784 100644 --- a/projects/packages/forms/src/class-jetpack-forms.php +++ b/projects/packages/forms/src/class-jetpack-forms.php @@ -15,7 +15,7 @@ */ class Jetpack_Forms { - const PACKAGE_VERSION = '0.31.0'; + const PACKAGE_VERSION = '0.31.1-alpha'; /** * Load the contact form module. diff --git a/projects/packages/forms/src/contact-form/class-editor-view.php b/projects/packages/forms/src/contact-form/class-editor-view.php index 8e1c561e65034..c0f80cf21f4f2 100644 --- a/projects/packages/forms/src/contact-form/class-editor-view.php +++ b/projects/packages/forms/src/contact-form/class-editor-view.php @@ -60,7 +60,7 @@ public static function grunion_media_button() { */ public static function mce_external_plugins( $plugin_array ) { $plugin_array['grunion_form'] = Assets::get_file_url_for_environment( - 'jetpack_vendor/automattic/jetpack-forms/dist/contact-form/js/tinymce-plugin-form-button.min.js', + 'jetpack_vendor/automattic/jetpack-forms/dist/contact-form/js/tinymce-plugin-form-button.js', 'jetpack_vendor/automattic/jetpack-forms/dist/contact-form/js/tinymce-plugin-form-button.js' ); return $plugin_array; diff --git a/projects/packages/jetpack-mu-wpcom/changelog/fix-untangling-themes-single-theme-broken-action b/projects/packages/jetpack-mu-wpcom/changelog/fix-untangling-themes-single-theme-broken-action new file mode 100644 index 0000000000000..c4060e6a278ff --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/fix-untangling-themes-single-theme-broken-action @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Themes: Fixed an issue that was showing a broken Theme Showcase action in the active theme details diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-themes/js/theme-actions.js b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-themes/js/theme-actions.js index e0a7cd84f518a..41709c96f9299 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-themes/js/theme-actions.js +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-themes/js/theme-actions.js @@ -1,32 +1,24 @@ const wpcomThemesRemoveWpcomActions = () => { const themeOverlay = document.querySelector( '.theme-overlay' ); - if ( ! themeOverlay ) { + const themeBrowser = document.querySelector( '.theme-browser' ); + if ( ! themeOverlay || ! themeBrowser ) { return; } const observer = new MutationObserver( mutations => { for ( const mutation of mutations ) { for ( const node of mutation.addedNodes ) { - // If this is not an overlay for the active theme, bail and check the next node. - if ( - ! node.classList.contains( 'theme-overlay' ) || - ! node.classList.contains( 'active' ) - ) { - continue; - } - const themeActions = node.querySelector( '.theme-actions .active-theme' ); for ( const action of themeActions?.children ?? [] ) { if ( action.getAttribute( 'href' )?.includes( 'https://wordpress.com' ) ) { themeActions.removeChild( action ); } } - return; } } } ); - observer.observe( themeOverlay, { childList: true } ); + observer.observe( themeBrowser, { childList: true } ); }; document.addEventListener( 'DOMContentLoaded', wpcomThemesRemoveWpcomActions ); diff --git a/projects/packages/scheduled-updates/changelog/add-guarding-non-exist-plugins b/projects/packages/scheduled-updates/changelog/add-guarding-non-exist-plugins new file mode 100644 index 0000000000000..2f25b66dec8bb --- /dev/null +++ b/projects/packages/scheduled-updates/changelog/add-guarding-non-exist-plugins @@ -0,0 +1,4 @@ +Significance: minor +Type: changed + +Scheduled Updates: Verify plugins when creating a schedule diff --git a/projects/packages/scheduled-updates/composer.json b/projects/packages/scheduled-updates/composer.json index 1684236d6b6bc..73cfd8febb3bf 100644 --- a/projects/packages/scheduled-updates/composer.json +++ b/projects/packages/scheduled-updates/composer.json @@ -53,7 +53,7 @@ }, "autotagger": true, "branch-alias": { - "dev-trunk": "0.11.x-dev" + "dev-trunk": "0.12.x-dev" }, "textdomain": "jetpack-scheduled-updates", "version-constants": { diff --git a/projects/packages/scheduled-updates/src/class-scheduled-updates.php b/projects/packages/scheduled-updates/src/class-scheduled-updates.php index c8e58ec6c1b67..6bc39317f47aa 100644 --- a/projects/packages/scheduled-updates/src/class-scheduled-updates.php +++ b/projects/packages/scheduled-updates/src/class-scheduled-updates.php @@ -20,7 +20,7 @@ class Scheduled_Updates { * * @var string */ - const PACKAGE_VERSION = '0.11.1-alpha'; + const PACKAGE_VERSION = '0.12.0-alpha'; /** * The cron event hook for the scheduled plugins update. @@ -70,6 +70,8 @@ public static function init() { add_action( 'jetpack_scheduled_update_deleted', array( Scheduled_Updates_Health_Paths::class, 'clear' ) ); add_action( 'jetpack_scheduled_update_deleted', array( Scheduled_Updates_Logs::class, 'delete_logs_schedule_id' ), 10, 3 ); + add_filter( 'jetpack_scheduled_update_verify_plugins', array( __CLASS__, 'verify_plugins' ) ); + // Update cron sync option after options update. $callback = array( __CLASS__, 'update_option_cron' ); @@ -359,10 +361,7 @@ public static function add_is_managed_extension_field() { * @return bool */ 'get_callback' => function ( $data ) { - $folder = WP_PLUGIN_DIR . '/' . strtok( $data['plugin'], '/' ); - $target = is_link( $folder ) ? realpath( $folder ) : false; - - return $target && 0 === strpos( $target, '/wordpress/' ); + return self::is_plugin_managed( $data['plugin'] ); }, 'schema' => array( 'description' => 'Whether the plugin is managed by the host.', @@ -436,4 +435,57 @@ public static function deleted_plugin( $plugin_file, $deleted ) { public static function generate_schedule_id( $args ) { return md5( serialize( $args ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize } + + /** + * Check if a plugin is installed. + * + * @param string $plugin The plugin to check. + * @return bool + */ + public static function is_plugin_installed( $plugin ) { + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + $installed_plugins = get_plugins(); + return array_key_exists( $plugin, $installed_plugins ); + } + + /** + * Check if a plugin is managed by the host. + * + * @param string $plugin The plugin to check. + * @return bool + */ + public static function is_plugin_managed( $plugin ) { + $folder = WP_PLUGIN_DIR . '/' . strtok( $plugin, '/' ); + $target = is_link( $folder ) ? realpath( $folder ) : false; + return $target && 0 === strpos( $target, '/wordpress/' ); + } + + /** + * Verify that the plugins are installed. + * + * @param array $plugins List of plugins to update. + * @return bool|\WP_Error + */ + public static function verify_plugins( $plugins ) { + $request_plugins_not_installed_or_managed = true; + + foreach ( $plugins as $plugin ) { + if ( self::is_plugin_installed( $plugin ) && ! self::is_plugin_managed( $plugin ) ) { + $request_plugins_not_installed_or_managed = false; + break; + } + } + + if ( $request_plugins_not_installed_or_managed ) { + return new \WP_Error( + 'rest_forbidden', + __( 'None of the specified plugins are installed or all of them are managed.', 'jetpack-scheduled-updates' ), + array( 'status' => 403 ) + ); + } + + return true; + } } diff --git a/projects/packages/scheduled-updates/src/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-update-schedules.php b/projects/packages/scheduled-updates/src/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-update-schedules.php index bf7877cbb93a9..021f30c3e871d 100644 --- a/projects/packages/scheduled-updates/src/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-update-schedules.php +++ b/projects/packages/scheduled-updates/src/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-update-schedules.php @@ -175,6 +175,12 @@ public function create_item( $request ) { return $result; } + $verified_plugins = apply_filters( 'jetpack_scheduled_update_verify_plugins', $request['plugins'] ); + + if ( is_wp_error( $verified_plugins ) ) { + return $verified_plugins; + } + $schedule = $request['schedule']; $plugins = $request['plugins']; usort( $plugins, 'strnatcasecmp' ); @@ -266,6 +272,12 @@ public function update_item( $request ) { return $result; } + $verified_plugins = apply_filters( 'jetpack_scheduled_update_verify_plugins', $request['plugins'] ); + + if ( is_wp_error( $verified_plugins ) ) { + return $verified_plugins; + } + $deleted = $this->delete_item( $request ); if ( is_wp_error( $deleted ) ) { return $deleted; diff --git a/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-health-paths-test.php b/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-health-paths-test.php index 6cdd0ef70c8e5..66428d064d058 100644 --- a/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-health-paths-test.php +++ b/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-health-paths-test.php @@ -46,6 +46,7 @@ public function set_up() { ) ); wp_set_current_user( $this->admin_id ); + add_filter( 'jetpack_scheduled_update_verify_plugins', '__return_true', 11 ); Scheduled_Updates::init(); } @@ -58,7 +59,7 @@ public function set_up() { public function tear_down() { wp_delete_user( $this->admin_id ); delete_option( Scheduled_Updates_Health_Paths::OPTION_NAME ); - + remove_filter( 'jetpack_scheduled_update_verify_plugins', '__return_true', 11 ); parent::tear_down_wordbless(); } diff --git a/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-logs-test.php b/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-logs-test.php index e8b8c984042f4..b907c50f9c031 100644 --- a/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-logs-test.php +++ b/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-logs-test.php @@ -59,6 +59,7 @@ protected function set_up() { ) ); wp_set_current_user( $this->admin_id ); + add_filter( 'jetpack_scheduled_update_verify_plugins', '__return_true', 11 ); } /** @@ -68,7 +69,7 @@ protected function set_up() { */ protected function tear_down() { delete_option( Scheduled_Updates_Logs::OPTION_NAME ); - + remove_filter( 'jetpack_scheduled_update_verify_plugins', '__return_true', 11 ); parent::tear_down_wordbless(); } diff --git a/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-test.php b/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-test.php index 94988b0114526..a1648fb94a7ab 100644 --- a/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-test.php +++ b/projects/packages/scheduled-updates/tests/php/class-scheduled-updates-test.php @@ -669,4 +669,125 @@ private function populate_file_with_plugin_header( $plugin_file, $plugin_name ) */" ); } + + /** + * Test when all requested plugins are not installed. + * + * @covers ::verify_plugins + */ + public function test_verify_plugins_not_installed() { + $plugins = array( 'not-installed-plugin-1/not-installed-plugin-1.php', 'not-installed-plugin-2/not-installed-plugin-2.php' ); + + $request = new \WP_REST_Request( 'POST', '/wpcom/v2/update-schedules' ); + $request->set_body_params( + array( + 'plugins' => $plugins, + 'schedule' => array( + 'timestamp' => strtotime( 'next Monday 8:00' ), + 'interval' => 'weekly', + 'health_check_paths' => array(), + ), + ) + ); + + wp_set_current_user( $this->admin_id ); + $result = rest_do_request( $request ); + + $this->assertSame( 403, $result->get_status() ); + $this->assertSame( 'None of the specified plugins are installed or all of them are managed.', $result->get_data()['message'] ); + } + + /** + * Test when all requested plugins are managed. + * + * @covers ::verify_plugins + */ + public function test_verify_plugins_all_managed() { + $plugins = array( 'managed-plugin-1/managed-plugin-1.php', 'managed-plugin-2/managed-plugin-2.php' ); + + foreach ( $plugins as $plugin ) { + $plugin_name = explode( '/', $plugin )[0]; + $plugin_file = "$plugin_name/$plugin_name.php"; + $target_dir = "$this->plugin_dir/wordpress"; + $this->wp_filesystem->mkdir( $target_dir ); + $this->wp_filesystem->mkdir( "$target_dir/$plugin_name" ); + $this->populate_file_with_plugin_header( "$target_dir/$plugin_file", $plugin_name ); + symlink( "$target_dir/$plugin_name", "$this->plugin_dir/$plugin_name" ); + } + + // Tweak realpath so that it returns `/wordpress/...`. + $realpath = $this->getFunctionMock( __NAMESPACE__, 'realpath' ); + $realpath->expects( $this->exactly( count( $plugins ) ) )->willReturnCallback( + function ( $path ) { + return str_replace( $this->plugin_dir, '/wordpress/plugins', $path ); + } + ); + + $request = new \WP_REST_Request( 'POST', '/wpcom/v2/update-schedules' ); + $request->set_body_params( + array( + 'plugins' => $plugins, + 'schedule' => array( + 'timestamp' => strtotime( 'next Monday 8:00' ), + 'interval' => 'weekly', + 'health_check_paths' => array(), + ), + ) + ); + + wp_set_current_user( $this->admin_id ); + $result = rest_do_request( $request ); + + $this->assertSame( 403, $result->get_status() ); + $this->assertSame( 'None of the specified plugins are installed or all of them are managed.', $result->get_data()['message'] ); + } + + /** + * Test when one requested plugin is installed and not managed, and another is installed but managed. + * + * @covers ::verify_plugins + */ + public function test_verify_plugins_installed_mixed() { + $plugins = array( 'managed-plugin/managed-plugin.php', 'installed-plugin/installed-plugin.php' ); + + // Create a managed plugin. + $managed_plugin_name = 'managed-plugin'; + $managed_plugin_file = "$managed_plugin_name/$managed_plugin_name.php"; + $target_dir = "$this->plugin_dir/wordpress"; + $this->wp_filesystem->mkdir( $target_dir ); + $this->wp_filesystem->mkdir( "$target_dir/$managed_plugin_name" ); + $this->populate_file_with_plugin_header( "$target_dir/$managed_plugin_file", $managed_plugin_name ); + symlink( "$target_dir/$managed_plugin_name", "$this->plugin_dir/$managed_plugin_name" ); + + // Tweak realpath so that it returns `/wordpress/...` for the managed plugin. + $realpath = $this->getFunctionMock( __NAMESPACE__, 'realpath' ); + $realpath->expects( $this->once() )->willReturnCallback( + function ( $path ) { + return str_replace( $this->plugin_dir, '/wordpress/plugins', $path ); + } + ); + + // Create an installed plugin that is not managed. + $installed_plugin_name = 'installed-plugin'; + $installed_plugin_file = "$installed_plugin_name/$installed_plugin_name.php"; + $this->wp_filesystem->mkdir( "$this->plugin_dir/$installed_plugin_name" ); + $this->populate_file_with_plugin_header( "$this->plugin_dir/$installed_plugin_file", $installed_plugin_name ); + + $request = new \WP_REST_Request( 'POST', '/wpcom/v2/update-schedules' ); + $request->set_body_params( + array( + 'plugins' => $plugins, + 'schedule' => array( + 'timestamp' => strtotime( 'next Monday 8:00' ), + 'interval' => 'weekly', + 'health_check_paths' => array(), + ), + ) + ); + + wp_set_current_user( $this->admin_id ); + $result = rest_do_request( $request ); + + $this->assertSame( 200, $result->get_status() ); + } } diff --git a/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-active-test.php b/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-active-test.php index 6f8123a912e70..bc779eac5ed8d 100644 --- a/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-active-test.php +++ b/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-active-test.php @@ -67,6 +67,7 @@ public function set_up() { ); wp_set_current_user( $this->admin_id ); + add_filter( 'jetpack_scheduled_update_verify_plugins', '__return_true', 11 ); Scheduled_Updates::init(); } @@ -80,6 +81,7 @@ public function tear_down() { wp_delete_user( $this->admin_id ); delete_option( Scheduled_Updates_Active::OPTION_NAME ); delete_option( Scheduled_Updates::PLUGIN_CRON_HOOK ); + remove_filter( 'jetpack_scheduled_update_verify_plugins', '__return_true', 11 ); parent::tear_down_wordbless(); } diff --git a/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-logs-test.php b/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-logs-test.php index 22441f52e6798..b22e1b1a2c400 100644 --- a/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-logs-test.php +++ b/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-logs-test.php @@ -35,10 +35,22 @@ public function set_up() { ) ); wp_set_current_user( 0 ); + add_filter( 'jetpack_scheduled_update_verify_plugins', '__return_true', 11 ); Scheduled_Updates::init(); } + /** + * Clean up after test + * + * @after + */ + public function tear_down() { + wp_delete_user( $this->admin_id ); + remove_filter( 'jetpack_scheduled_update_verify_plugins', '__return_true', 11 ); + parent::tear_down_wordbless(); + } + /** * Test adding a log entry for a non-existent schedule. * diff --git a/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-test.php b/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-test.php index 4d0a245c3daab..250e41f46c952 100644 --- a/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-test.php +++ b/projects/packages/scheduled-updates/tests/php/class-wpcom-rest-api-v2-endpoint-update-schedules-test.php @@ -49,6 +49,7 @@ public function set_up() { ) ); wp_set_current_user( 0 ); + add_filter( 'jetpack_scheduled_update_verify_plugins', '__return_true', 11 ); Scheduled_Updates::init(); } @@ -65,6 +66,7 @@ public function tear_down() { wp_clear_scheduled_hook( Scheduled_Updates::PLUGIN_CRON_HOOK ); delete_option( 'jetpack_scheduled_update_statuses' ); delete_option( Scheduled_Updates::PLUGIN_CRON_HOOK ); + remove_filter( 'jetpack_scheduled_update_verify_plugins', '__return_true', 11 ); } /** diff --git a/projects/packages/videopress/changelog/fix-video-shortcode-preloadcontent-sanitize b/projects/packages/videopress/changelog/fix-video-shortcode-preloadcontent-sanitize new file mode 100644 index 0000000000000..fcd2617502ed1 --- /dev/null +++ b/projects/packages/videopress/changelog/fix-video-shortcode-preloadcontent-sanitize @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Sanitize the preload value for video shortcodes and blocks diff --git a/projects/packages/videopress/package.json b/projects/packages/videopress/package.json index 4cc11a10a0db8..91b16119ce604 100644 --- a/projects/packages/videopress/package.json +++ b/projects/packages/videopress/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-videopress", - "version": "0.23.19", + "version": "0.23.20-alpha", "description": "VideoPress package", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/videopress/#readme", "bugs": { diff --git a/projects/packages/videopress/src/class-block-editor-content.php b/projects/packages/videopress/src/class-block-editor-content.php index e29c738fb8028..5e529b748d296 100644 --- a/projects/packages/videopress/src/class-block-editor-content.php +++ b/projects/packages/videopress/src/class-block-editor-content.php @@ -86,10 +86,14 @@ public static function videopress_embed_shortcode( $atts ) { } } - if ( isset( $atts['preload'] ) ) { + if ( isset( $atts['preload'] ) && videopress_is_valid_preload( $atts['preload'] ) ) { $atts['preloadcontent'] = $atts['preload']; } + if ( isset( $atts['preloadcontent'] ) && ! videopress_is_valid_preload( $atts['preloadcontent'] ) ) { + unset( $atts['preloadcontent'] ); + } + $atts = shortcode_atts( $defaults, $atts, 'videopress' ); $base_url = 'https://videopress.com/embed/' . $guid; diff --git a/projects/packages/videopress/src/class-package-version.php b/projects/packages/videopress/src/class-package-version.php index 53e53f4b4ff7b..0c240218936f6 100644 --- a/projects/packages/videopress/src/class-package-version.php +++ b/projects/packages/videopress/src/class-package-version.php @@ -11,7 +11,7 @@ * The Package_Version class. */ class Package_Version { - const PACKAGE_VERSION = '0.23.19'; + const PACKAGE_VERSION = '0.23.20-alpha'; const PACKAGE_SLUG = 'videopress'; diff --git a/projects/packages/videopress/src/utility-functions.php b/projects/packages/videopress/src/utility-functions.php index e49521dd3df9c..ffe2148d48a9c 100644 --- a/projects/packages/videopress/src/utility-functions.php +++ b/projects/packages/videopress/src/utility-functions.php @@ -30,6 +30,16 @@ function videopress_is_valid_guid( $guid ) { return false; } +/** + * Validates user-supplied video preload setting. + * + * @param mixed $value the preload value to validate. + * @return bool + */ +function videopress_is_valid_preload( $value ) { + return in_array( strtolower( $value ), array( 'auto', 'metadata', 'none' ), true ); +} + /** * Get details about a specific video by GUID: * diff --git a/projects/plugins/boost/app/admin/class-admin.php b/projects/plugins/boost/app/admin/class-admin.php index 63b0863aa9024..f39d4ef1f4d23 100644 --- a/projects/plugins/boost/app/admin/class-admin.php +++ b/projects/plugins/boost/app/admin/class-admin.php @@ -13,7 +13,9 @@ use Automattic\Jetpack_Boost\Lib\Analytics; use Automattic\Jetpack_Boost\Lib\Environment_Change_Detector; use Automattic\Jetpack_Boost\Lib\Premium_Features; +use Automattic\Jetpack_Boost\Modules\Modules_Index; use Automattic\Jetpack_Boost\Modules\Modules_Setup; +use Automattic\Jetpack_Boost\Modules\Optimizations\Critical_CSS\Critical_CSS; class Admin { /** @@ -84,12 +86,32 @@ public function enqueue_styles() { public function enqueue_scripts() { $internal_path = apply_filters( 'jetpack_boost_asset_internal_path', 'app/assets/dist/' ); + $critical_css_gen_handle = 'jetpack-boost-critical-css-gen'; + + wp_register_script( + $critical_css_gen_handle, + plugins_url( $internal_path . 'critical-css-gen.js', JETPACK_BOOST_PATH ), + array(), + JETPACK_BOOST_VERSION, + true + ); + $admin_js_handle = 'jetpack-boost-admin'; + $admin_js_dependencies = array( + 'wp-i18n', + 'wp-components', + ); + + // Enqueue the critical CSS generator script if Critical CSS is available. + if ( ( new Modules_Index() )->is_module_available( Critical_CSS::get_slug() ) ) { + $admin_js_dependencies[] = $critical_css_gen_handle; + } + wp_register_script( $admin_js_handle, plugins_url( $internal_path . 'jetpack-boost.js', JETPACK_BOOST_PATH ), - array( 'wp-i18n', 'wp-components' ), + $admin_js_dependencies, JETPACK_BOOST_VERSION, true ); diff --git a/projects/plugins/boost/app/assets/src/js/features/critical-css/lib/generate-critical-css.ts b/projects/plugins/boost/app/assets/src/js/features/critical-css/lib/generate-critical-css.ts index 44ed8a245ae97..34a17856fea2b 100644 --- a/projects/plugins/boost/app/assets/src/js/features/critical-css/lib/generate-critical-css.ts +++ b/projects/plugins/boost/app/assets/src/js/features/critical-css/lib/generate-critical-css.ts @@ -3,7 +3,6 @@ import { recordBoostEvent, TracksEventProperties } from '$lib/utils/analytics'; import { castToNumber } from '$lib/utils/cast-to-number'; import { logPreCriticalCSSGeneration } from '$lib/utils/console'; import { isSameOrigin } from '$lib/utils/is-same-origin'; -import { loadCriticalCssLibrary } from '$lib/utils/load-critical-css-library'; import { prepareAdminAjaxRequest } from '$lib/utils/make-admin-ajax-request'; import { standardizeError } from '$lib/utils/standardize-error'; import { SuccessTargetError } from 'jetpack-boost-critical-css-gen'; @@ -89,9 +88,6 @@ async function generateCriticalCss( signal: AbortSignal ) { try { - // Load Critical CSS gen library if not already loaded. - await loadCriticalCssLibrary(); - // Prepare GET parameters to include with each request. const requestGetParameters = { 'jb-generate-critical-css': Date.now().toString(), diff --git a/projects/plugins/boost/app/assets/src/js/lib/utils/load-critical-css-library.ts b/projects/plugins/boost/app/assets/src/js/lib/utils/load-critical-css-library.ts deleted file mode 100644 index f8a74cf21cf8e..0000000000000 --- a/projects/plugins/boost/app/assets/src/js/lib/utils/load-critical-css-library.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { __, sprintf } from '@wordpress/i18n'; - -let loadLibraryPromise: Promise< void >; - -/** - * Ensure the Critical CSS generator library is loaded. - */ -export async function loadCriticalCssLibrary(): Promise< void > { - if ( loadLibraryPromise ) { - return loadLibraryPromise; - } - - loadLibraryPromise = new Promise< void >( ( resolve, reject ) => { - const scriptUrl = `${ Jetpack_Boost.assetPath }/critical-css-gen.js?ver=${ Jetpack_Boost.version }`; - const scriptTag = document.createElement( 'script' ); - scriptTag.src = scriptUrl; - - scriptTag.addEventListener( 'error', () => - reject( - new Error( - sprintf( - /* translators: %s refers to Critical CSS Gen library script url. */ - __( 'Failed to load Critical CSS library at %s', 'jetpack-boost' ), - scriptUrl - ) - ) - ) - ); - const timeout = setTimeout( () => { - reject( - new Error( - sprintf( - /* translators: %s refers to Critical CSS Gen library script url. */ - __( 'Timeout while loading Critical CSS library at %s', 'jetpack-boost' ), - scriptUrl - ) - ) - ); - }, 60000 ); - - scriptTag.addEventListener( 'load', () => { - clearTimeout( timeout ); - resolve(); - } ); - - document.body.appendChild( scriptTag ); - } ); - - return loadLibraryPromise; -} diff --git a/projects/plugins/boost/app/assets/src/js/pages/index/index.tsx b/projects/plugins/boost/app/assets/src/js/pages/index/index.tsx index 6ec4f8833a77c..d18c8bbcb3004 100644 --- a/projects/plugins/boost/app/assets/src/js/pages/index/index.tsx +++ b/projects/plugins/boost/app/assets/src/js/pages/index/index.tsx @@ -159,12 +159,7 @@ const Index = () => { - { __( 'Cache Site Pages', 'jetpack-boost' ) } - Beta - - } + title={ __( 'Cache Site Pages', 'jetpack-boost' ) } onBeforeToggle={ status => { setIsPageCacheSettingUp( status ); if ( status === false ) { diff --git a/projects/plugins/boost/app/lib/Status.php b/projects/plugins/boost/app/lib/Status.php index 87d34e7faaf91..da0624b2f40bd 100644 --- a/projects/plugins/boost/app/lib/Status.php +++ b/projects/plugins/boost/app/lib/Status.php @@ -43,6 +43,11 @@ public function is_enabled() { return $modules_state[ $this->slug ]['active']; } + public function is_available() { + $modules_state = jetpack_boost_ds_get( 'modules_state' ); + return $modules_state[ $this->slug ]['available']; + } + /** * Called when the module is toggled. * diff --git a/projects/plugins/boost/app/modules/Module.php b/projects/plugins/boost/app/modules/Module.php index b7768fc3d6a61..41d9c8ffeb174 100644 --- a/projects/plugins/boost/app/modules/Module.php +++ b/projects/plugins/boost/app/modules/Module.php @@ -26,6 +26,10 @@ public function is_enabled() { return $this->status->is_enabled(); } + public function is_available() { + return $this->status->is_available(); + } + /** * Check if the module is active and ready to serve optimized output. */ diff --git a/projects/plugins/boost/app/modules/Modules_Index.php b/projects/plugins/boost/app/modules/Modules_Index.php index 018634287f700..e34259dbc05d3 100644 --- a/projects/plugins/boost/app/modules/Modules_Index.php +++ b/projects/plugins/boost/app/modules/Modules_Index.php @@ -105,6 +105,18 @@ public function is_module_enabled( $slug ) { return $module->is_enabled(); } + public function is_module_available( $slug ) { + $available_modules = $this->available_modules(); + + if ( ! array_key_exists( $slug, $available_modules ) ) { + return false; + } + + $module = $available_modules[ $slug ]; + + return $module->is_available(); + } + /** * Get the lists of modules explicitly disabled from the 'jb-disable-modules' query string. * The parameter is a comma separated value list of module slug. diff --git a/projects/plugins/boost/changelog/fix-critical-css-gen-scope-issues b/projects/plugins/boost/changelog/fix-critical-css-gen-scope-issues new file mode 100644 index 0000000000000..6167a435cadb7 --- /dev/null +++ b/projects/plugins/boost/changelog/fix-critical-css-gen-scope-issues @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Critical CSS: Update the way generation library is loaded. diff --git a/projects/plugins/boost/changelog/update-boost-remove-beta-cache-tag b/projects/plugins/boost/changelog/update-boost-remove-beta-cache-tag new file mode 100644 index 0000000000000..22e85518253d4 --- /dev/null +++ b/projects/plugins/boost/changelog/update-boost-remove-beta-cache-tag @@ -0,0 +1,4 @@ +Significance: patch +Type: changed + +Boost: remove Beta tag from Cache module diff --git a/projects/plugins/jetpack/CHANGELOG.md b/projects/plugins/jetpack/CHANGELOG.md index c3cedb291c0b9..a6b0b6274abe9 100644 --- a/projects/plugins/jetpack/CHANGELOG.md +++ b/projects/plugins/jetpack/CHANGELOG.md @@ -4,182 +4,131 @@ ## 13.4-beta - 2024-05-06 ### Enhancements -- Paid Content Block: Swap out the login flow. [#37178] -- Subscriptions: Manage subscribers in Jetpack Cloud instead of WP.com. [#37155] -- Subscription widget: Remove "follow" term from confirmation message [#37135] +- Jetpack AI: Add an AI Featured Image Generator. [#36709] [#36806] [#36812] [#36822] [#36831] [#36863] [#36865] [#36868] [#36899] [#36926] [#36963] [#36965] [#37086] [#37166] [#37209] [#37219] +- Newsletters: Manage subscribers in Jetpack Cloud. [#37155] +- Newsletters: Add a "Reply-to" setting for newsletter emails. [#37011] +- Newsletters: Add filters for controlling the Subscribe Modal load time and the edit capability for the Newsletter Block Meta. [#36909] [#36374] +- Paid Content Block: Use a login flow matching the Subscribe Block. [#37178] - WordAds: Ensure that ads.txt works on subdirectory websites. [#36887] ### Improved compatibility -- Theme tools: Devicepx functionality is deprecated. [#37116] -- Theme tools: Site-logo functionality is deprecated in favour of core supported custom-logo. [#37109] +- General: WordPress 6.4 is now the minimum required version. [#37047] [#37049] +- Theme Tools: Site-logo and devicepx are deprecated. Use WordPress Core's custom-logo or logo block instead. [#37116] [#37109] +- WordPress.com Toolbar: Avoid fatal errors when using other menu management plugins while the WordPress.com Toolbar feature is active. [#36783] ### Bug fixes -- Sidebar: Fix showing the double arrow on active menu when RTL [#37204] - -### Other changes -- Add a method to find all plans that are valid for a given newsletter tier. [#37084] -- Added feature flag for social admin UI. [#37134] -- Add error handling on Title Optimization. [#37195] -- Add handler for the migration_source_site_domain option. [#37100] -- Add tracks and new entries for title optimization. [#37180] -- AI Assistant: Add undo functionality and fix input with iframe. [#37200] -- AI Assistant: Fix AI Control positioning on inline extension. [#37145] -- AI Assistant: Link toolbar actions to requests on inline extensions. [#37168] -- AI Featured Image: Add entry point on the media source dropdown menu. [#37166] -- AI Featured Image: Allow users to write prompts for the image generation. [#37086] -- AI Featured Image: Change upgrade prompt layout and fix UI issues. [#37219] -- AI Featured Image: Start tracking error messages. [#37209] -- Contact Form: Removing code and renaming relevant references to ensure we use the package version of the contact form. [#37157] -- Janitorial: Deprecate methods in Jetpack class in favor of methods from the Connection package. [#36989] -- Jetpack Sync: Add Woocommerce event remove_order_items to Jetpack Sync. [#33748] -- SSO: Deprecate in-plugin methods in favor of methods from the Connection package. [#36924] -- Subscriptions: Add back missing HTML for paywall in emails. [#37117] -- Subscriptions: Disable Paid Newsletter settings section when user is not connected to WP.com. [#37149] -- Subscriptions: Fix registering block hooks for REST API calls. [#37123] -- Subscriptions: Fix Subscribed button alignment. [#37066] -- Subscriptions: Move the Newsletter module main toggle to separate section in Newsletter settings. [#37152] -- Sync AI plugin content across settings and jetpack sidebar. [#37220] -- Updated package dependencies. [#37147] [#37148] -- Update interface of Usage Counter on Jetpack Plugin. [#37216] -- WordPress.com REST API: Exposed is_deleted attribute with sites API response. [#37142] - -## 13.4-a.9 - 2024-04-29 -### Enhancements -- Newsletter: Add subscrition 'reply to' behaviour. [#37011] +- Google Fonts: Avoid theme fonts overriding the default fonts so fonts with a specific font weight that are not supported by the provided theme can be rendered correctly. [#37050] +- Secure Sign-On: Disable the WordPress.com invitation setup on Multisite. [#36690] +- Sidebar: Fix double arrows being shown on active menu items in RTL mode. [#37204] +- Theme Tools: Fix deprecation notices in the color management library. [#36789] +- VideoPress: Fix an XSS vulnerability in VideoPress shortcodes. ### Other changes -- Add aceptance for title optimization. [#37078] -- Add cancel action for title optimization. [#37080] -- Adds a jp_memberships_is_sandboxed item for sync. [#37088] +- AI Assistant: Add acceptance for title optimization. [#37078] +- AI Assistant: Add cancel action for title optimization. [#37080] +- AI Assistant: Add error handling on Title Optimization. [#37195] - AI Assistant: Add inline extensions feature flag. [#37082] - AI Assistant: Add partial heading inline extension. [#37087] -- API Docs: Fix example request for media add and update endpoints. [#37072] -- Block Editor: Update button props to match latest changes in WordPress 6.5. [#36318] -- CloudFlare Analytics: deprecate feature and move to mu-wpcom. [#37061] -- Ensure that the paid subscriber cache is unique to the parameters it consumes. [#36925] -- Janitorial: Use wp_admin_notice function introduced in WP 6.4 to display notices. [#37051] -- Subscriptions: Hide subscriber count for already subscribed users. [#37073] -- Subscriptions: The in_site_migration_flow show be a string to allow us to redirect to various flows. [#37099] -- Subscriptions: Track "Set up" button clicks. [#37053] -- Untangling: Fix sidebar upsells on Default color scheme to follow Core's. [#37064] -- WordPress.com Block Editor: Avoid relying on the Jetpack class. [#37074] - -## 13.4-a.7 - 2024-04-25 -### Improved compatibility -- General: Update WordPress version requirements to WordPress 6.4 and remove compatibility code for lower versions. [#37047] [#37049] - -### Bug fixes -- Google Fonts: Avoid theme fonts overriding the default fonts so fonts with a specific font weight that are not supported by the provided theme can be rendered correctly. [#37050] - -### Other changes -- Add migration_source_site_domain to the list of available site options to update and retrieve. This will be used as part of the Site Migration on-boarding flow. [#37060] -- Add title optimization as beta [#37001] -- Add title optimization jetpack sidebar entry [#37002] -- Add title optimization modal content [#37003] -- Add update_plugins capability to the /sites/%s endpoint. [#36280] -- AI Assistant: Separate toolbar dropdown logic and UI [#37016] -- AI Assistant: Update AIControl imports [#36967] -- Cookie Consent: localize default text [#37012] -- Enhanced Distribution: remove deprecated module file. [#37032] -- Masterbar: Specific styles for sidebar upsells are now maintained in separate files for each color scheme [#37022] -- Subscriptions: Add "Paid newsletter" section to the Newsletter settings [#36975] -- Subscriptions: Link "Subscribed" button to individual subscription page [#37021] - -## 13.4-a.5 - 2024-04-22 -### Enhancements -- Subscription: Add a filter to Allow Newsletter Block Meta Capability to be Changed. [#36909] - -### Other changes -- Add scheduled updates sync option. [#36877] -- Add in_site_migration_flow to the list of available site options to update and retrieve. This will be used as part of the Site Migration on-boarding flow. [#36974] -- Adds the ability to filter users in the WPCOM_JSON_API_List_Users_Endpoint endpoint by capability. [#36893] -- Add the userConnectionUrl to initial state to use in Social sidebar. [#36976] +- AI Assistant: Add title optimization as beta [#37001] +- AI Assistant: Add title optimization Jetpack sidebar entry. [#37002] +- AI Assistant: Add title optimization modal content. [#37003] +- AI Assistant: Add tracks and new entries for title optimization. [#37180] +- AI Assistant: Add undo functionality and fix input with iframe. [#37200] - AI Assistant: Extract Markdown and HTML conversions to AI Client. [#36906] -- AI Featured Image: move tool from beta to production, to make it available to everyone. [#36965] -- AI Featured Image: remove scrollbar on smaller screens. [#36963] -- Block Scaffolding: update API version in template [#36955] -- Carousel: Ensure that disabling the feature on WordPress.com Simple brings back Core's Lightbox back. [#36914] -- CLI: Make `wp jetpack publicize` work again. [#36988] -- Donations Block: Fix non localized strings. [#36951] -- Enabled SIG even if publicize is disabled. [#36911] -- Fix phpdoc types, and update phan config and baseline for wpcom stubs. No change to functionality. [#36988] -- Google Docs Embed: Fix non localized strings. [#36993] -- Jetpack Google Fonts: Add filter to conditionally skip loading. [#36980] -- Monetize: Move menu item under Jetpack menu for all Classic interface users. [#36995] -- Remove unnecessary react imports. [#36904] -- REST API: Correctly report Publicize when applicable in `/jetpack/v4/site/benefits` endpoint. [#36988] -- Sitemaps: Ensured that the last modification date from the jetpack_page_sitemap_other_urls filter is considered for the last modification date of the generated sitemap. [#36991] -- Subscriptions: Add Subscriber Login block navigation placement setting to Dotcom Site Settings API. [#37000] -- Subscriptions Block: Only check newsletter plans when inside WP Admin. [#36928] -- Tiled Gallery: Fix round corners style. [#36952] -- Tiled Gallery Block: Don't use image CDN on private WordPress.com simple sites. [#36876] -- Update blocks to use API version 3. [#36858] [#36859] [#36864] -- Update UX of featured image usage counter. [#36926] - -## 13.4-a.3 - 2024-04-15 -### Improved compatibility -- WordPress.com Toolbar: Avoid fatal errors when using other menu management plugins and the WordPress.com Toolbar feature. [#36783] - -### Other changes -- Add the 'All Sites' menu. [#36632] -- Add 'Carrousel' in 'Featured Image'. [#36834] -- Add upgrade prompt in 'Featured Image'. [#36806] -- Admin Menu: Moved "Theme Showcase" menu registration to jetpack-mu-wpcom package. [#36851] +- AI Assistant: Fix AI Control positioning on inline extension. [#37145] +- AI Assistant: Link toolbar actions to requests on inline extensions. [#37168] - AI Assistant: Remove AI Playground. [#36808] +- AI Assistant: Remove old deadcode from image modal. [#36683] - AI Assistant: Rename useSuggestionsFromOpenAI to useAIAssistant and deduplicate suggestion logic. [#36869] -- AI Featured Image: Fix bug on automatic transition to featured image panel. [#36863] -- AI Featured Image: Include link to provide feedback on the footer of the modal. [#36831] -- AI Featured Image: Incorporate i3 updates on style and UI. [#36868] -- AI Featured Image: Update copy and UI alignments. [#36812] -- A minor performance improvement on memberships. [#36821] -- Auto-save image from featured image feature. [#36822] -- Avoid showing featured image upgrade prompt on generating. [#36899] -- Business Hours: Fix time formatting in preview mode. [#36786] -- Business Hours Block: Refactor Edit component to a function. [#36785] -- Dontains Form block: Show Stripe nudge if not connected. [#36841] -- Fix auto scroll on iframe editor. [#36726] -- Fixed SIG not visible in Jetpack sidebar. [#36895] -- Improve performance of memberships checks. [#36798] -- Make the representation of the end date consistent in membership subscription abbreviation. [#36838] -- Map Block: Refactor Edit component to function. [#36795] -- Post endpoint: Return a 404 if a post is being trashed but does not exist. [#36768] -- Simple Payments Block: Refactor Edit component to a function. [#36809] -- Slideshow Block: Refactor Edit component to a function. [#36805] -- Tiled Gallery Block: Refactor Edit component to a function. [#36804] -- Update blocks to use API version 3. [#36827] [#36852] [#36854] -- Updated social previews package. [#36874] -- Update Testimonials CPT priority so it always appears below Portfolio Projects. [#36866] -- Update UX on Featured Image. [#36865] - -## 13.4-a.1 - 2024-04-08 -### Enhancements -- Newsletters: Add a filter that enables the user to control the timing at which the Subscribe Modal loads. [#36374] - -### Bug fixes -- Secure Sign-On: Disable the WordPress.com invitation setup on Multisite. [#36690] -- Theme Tools: Fix deprecation notices in the color management library. [#36789] - -### Other changes -- Add error handling in image generation. [#36709] - AI Assistant: Scroll to bottom of current block as suggestions keep coming. [#36569] +- AI Assistant: Separate toolbar dropdown logic and UI. [#37016] +- AI Assistant: Update AIControl imports. [#36967] - AI Featured Image: Add request counter to UI. [#36744] +- API Docs: Fix example request for media add and update endpoints. [#37072] +- Block Editor: Avoid relying on the Jetpack class. [#37074] +- Block Editor: Fix auto scroll on iframe editor. [#36726] +- Block Editor: Update button props to match latest changes in WordPress 6.5. [#36318] +- Block Editor: Update blocks to use API version 3. [#36701] [#36742] [#36827] [#36852] [#36854] [#36858] [#36859] [#36864] +- Block Scaffolding: Update API version in template. [#36955] - Blocks: Move localizable strings out of the metadata attributes field. [#36724] +- Business Hours Block: Refactor Edit component and fix time formatting in preview mode. [#36785] [#36786] +- CLI: Make `wp jetpack publicize` work again. [#36988] - Carousel: Add extra isset check to avoid warnings. [#36681] -- Create /wpcom/v2/admin-color endpoint that returns admin color scheme. [#36749] +- Carousel: Ensure that disabling the feature on WordPress.com Simple brings back Core's Lightbox back. [#36914] +- CloudFlare Analytics: deprecate feature and move to mu-wpcom. [#37061] +- Contact Form: Removing code and renaming relevant references to ensure we use the package version of the contact form. [#37157] +- Cookie Consent: Localize default text. [#37012] +- Donations Block: Fix non-localized strings. [#36951] +- Donations Block: Show Stripe nudge if not connected. [#36841] +- Enhanced Distribution: Remove deprecated module file. [#37032] - Eventbrite Block: Refactor Edit component to function. [#36739] -- Fix translation issues for default attributes. [#36695] -- Jetpack AI Assistant: Remove old deadcode from image modal. [#36683] +- Featured Image: Add 'Carousel' to 'Featured Image'. [#36834] +- Google Docs Embed: Fix non localized strings. [#36993] +- Google Fonts: Add filter to conditionally skip loading. [#36980] +- I18n: Fix translation issues for default attributes. [#36695] +- Janitorial: Deprecate methods in Jetpack class in favor of methods from the Connection package. [#36989] +- Janitorial: Remove unnecessary react imports. [#36904] +- Janitorial: Update interface of Usage Counter on Jetpack Plugin. [#37216] +- Janitorial: Use wp_admin_notice function introduced in WP 6.4 to display notices. [#37051] - MailChimp Block: Refactor Edit component to function. [#36746] +- Map Block: Refactor Edit component to function. [#36795] - Markdown Block: Refactor Edit component to function. [#36758] -- PHP 8.1: Fix error trying to run preg_split on array. [#36699] +- Memberships: A minor performance improvement on memberships. [#36821] +- Memberships: Adds a jp_memberships_is_sandboxed item for sync. [#37088] +- Memberships: Improve performance of memberships checks. [#36798] +- Memberships: Make the representation of the end date consistent in membership subscription abbreviation. [#36838] +- Monetize: Move menu item under Jetpack menu for all Classic interface users. [#36995] +- Navigation: Add the 'All Sites' menu. [#36632] +- Navigation: Fix sidebar upsells on Default color scheme to follow Core's. [#37064] +- Navigation: Fixed SIG not visible in Jetpack sidebar. [#36895] +- Navigation: Moved "Theme Showcase" menu registration to jetpack-mu-wpcom package. [#36851] +- Navigation: Specific styles for sidebar upsells are now maintained in separate files for each color scheme. [#37022] +- Navigation: Sync AI plugin content across settings and jetpack sidebar. [#37220] +- Newsletters: Add "Paid newsletter" section to the Newsletter settings [#36975] +- Newsletters: Add Subscriber Login block navigation placement setting to Dotcom Site Settings API. [#37000] +- Newsletters: Add Subscriber Login block navigation placement setting to Sync and Dotcom API. [#36737] +- Newsletters: Add a method to find all plans that are valid for a given newsletter tier. [#37084] +- Newsletters: Add back missing HTML for paywall in emails. [#37117] +- Newsletters: Disable Paid Newsletter settings section when user is not connected to WP.com. [#37149] +- Newsletters: Ensure that the paid subscriber cache is unique to the parameters it consumes. [#36925] +- Newsletters: Fix Subscribed button alignment. [#37066] +- Newsletters: Fix registering block hooks for REST API calls. [#37123] +- Newsletters: Hide subscriber count for already subscribed users. [#37073] +- Newsletters: Link "Subscribed" button to individual subscription page [#37021] +- Newsletters: Move the Newsletter module main toggle to separate section in Newsletter settings. [#37152] +- Newsletters: Only check newsletter plans when inside WP Admin. [#36928] +- Newsletters: The in_site_migration_flow show be a string to allow us to redirect to various flows. [#37099] +- Newsletters: Track "Set up" button clicks. [#37053] +- PHP 8.1: Fix an error trying to run preg_split on array. [#36699] +- Post endpoint: Return a 404 if a post is being trashed but does not exist. [#36768] +- Publicize: Enable SIG even if publicize is disabled. [#36911] +- REST API: Add update_plugins capability to the /sites/%s endpoint. [#36280] +- REST API: Add the ability to filter users in the WPCOM_JSON_API_List_Users_Endpoint endpoint by capability. [#36893] +- REST API: Correctly report Publicize when applicable in `/jetpack/v4/site/benefits` endpoint. [#36988] +- REST API: Create /wpcom/v2/admin-color endpoint that returns admin color scheme. [#36749] +- REST API: Exposed is_deleted attribute with sites API response. [#37142] - Repeat Visitor Block: Refactor Edit component to function. [#36762] +- SSO: Deprecate in-plugin methods in favor of methods from the Connection package. [#36924] +- Scheduled Updates: Add scheduled updates sync option. [#36877] - Sharing block: Make sharing options translatable. [#36642] -- Simplified social network selection for post sharing. [#36734] -- Subscriptions: Add Subscriber Login block navigation placement setting to Sync and Dotcom API. [#36737] +- Simple Payments Block: Refactor Edit component to a function. [#36809] +- Site Migration: Add handler for the migration_source_site_domain option. [#37100] +- Site Migration: Add in_site_migration_flow to the list of available site options to update and retrieve. This will be used as part of the Site Migration on-boarding flow. [#36974] +- Site Migration: Add migration_source_site_domain to the list of available site options to update and retrieve. This will be used as part of the Site Migration on-boarding flow. [#37060] +- Sitemaps: Ensured that the last modification date from the jetpack_page_sitemap_other_urls filter is considered for the last modification date of the generated sitemap. [#36991] +- Slideshow Block: Refactor Edit component to a function. [#36805] +- Social: Add the userConnectionUrl to initial state to use in Social sidebar. [#36976] +- Social: Added feature flag for social admin UI. [#37134] +- Social: Simplified social network selection for post sharing. [#36734] - Subscription Site: Release the Subscriber Login navigation placement toggle. [#36717] +- Subscription Widget: Remove "follow" term from confirmation message. [#37135] +- Sync: Add Woocommerce event remove_order_items to Jetpack Sync. [#33748] +- Testimonials: Update Testimonials CPT priority so it always appears below Portfolio Projects. [#36866] - Theme tools: Use integer casting method that doesn't cause deprecation notices. [#36680] -- Update blocks to use API version 3. [#36701] [#36742] -- Updated package dependencies. [#36760] [#36761] [#36775] [#36788] +- Tiled Gallery Block: Don't use image CDN on private WordPress.com simple sites. [#36876] +- Tiled Gallery Block: Refactor Edit component to a function. [#36804] +- Tiled Gallery: Fix round corners style. [#36952] +- Updated package dependencies. [#36760] [#36761] [#36775] [#36788] [#37147] [#37148] [#36874] ## 13.3.1 - 2024-04-10 diff --git a/projects/plugins/jetpack/changelog/fix-tiled-gallery-view b/projects/plugins/jetpack/changelog/fix-tiled-gallery-view new file mode 100644 index 0000000000000..0a6ac808feec9 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-tiled-gallery-view @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Tiled Gallery: fix view rendering issues diff --git a/projects/plugins/jetpack/changelog/fix-video-shortcode-preloadcontent-sanitize b/projects/plugins/jetpack/changelog/fix-video-shortcode-preloadcontent-sanitize new file mode 100644 index 0000000000000..b6a31a0c61cc1 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-video-shortcode-preloadcontent-sanitize @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Sanitize the preload value for video shortcodes and blocks diff --git a/projects/plugins/jetpack/changelog/update-custom-css-to-mu-wpcom b/projects/plugins/jetpack/changelog/update-custom-css-to-mu-wpcom new file mode 100644 index 0000000000000..62f0fea11c748 --- /dev/null +++ b/projects/plugins/jetpack/changelog/update-custom-css-to-mu-wpcom @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Custom CSS: add deprecation warning in codebase diff --git a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/index.js b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/index.js index cff9ea3576b07..9eecc68dce84d 100644 --- a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/index.js +++ b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/index.js @@ -2,5 +2,6 @@ import * as deprecatedV1 from './v1'; import * as deprecatedV2 from './v2'; import * as deprecatedV3 from './v3'; import * as deprecatedV4 from './v4'; +import * as deprecatedV5 from './v5'; -export default [ deprecatedV4, deprecatedV3, deprecatedV2, deprecatedV1 ]; +export default [ deprecatedV5, deprecatedV4, deprecatedV3, deprecatedV2, deprecatedV1 ]; diff --git a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v5/attributes.js b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v5/attributes.js new file mode 100644 index 0000000000000..9fcaa14119685 --- /dev/null +++ b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v5/attributes.js @@ -0,0 +1,77 @@ +export default { + align: { + type: 'string', + default: 'center', + }, + className: { + type: 'string', + default: 'is-style-rectangular', + }, + columns: { + type: 'number', + }, + columnWidths: { + type: 'array', + default: [], + }, + ids: { + type: 'array', + default: [], + }, + imageFilter: { + type: 'string', + }, + images: { + type: 'array', + default: [], + source: 'query', + selector: '.tiled-gallery__item', + query: { + alt: { + attribute: 'alt', + default: '', + selector: 'img', + source: 'attribute', + }, + height: { + attribute: 'data-height', + type: 'number', + selector: 'img', + source: 'attribute', + }, + id: { + attribute: 'data-id', + selector: 'img', + source: 'attribute', + }, + link: { + attribute: 'data-link', + selector: 'img', + source: 'attribute', + }, + url: { + attribute: 'data-url', + selector: 'img', + source: 'attribute', + }, + width: { + attribute: 'data-width', + selector: 'img', + source: 'attribute', + type: 'number', + }, + }, + }, + imageCrop: { + type: 'boolean', + default: true, + }, + linkTo: { + default: 'none', + type: 'string', + }, + roundedCorners: { + type: 'integer', + default: 0, + }, +}; diff --git a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v5/index.js b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v5/index.js new file mode 100644 index 0000000000000..177863fd1b579 --- /dev/null +++ b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v5/index.js @@ -0,0 +1,3 @@ +export { default as attributes } from './attributes'; +export { default as supports } from './supports'; +export { default as save } from './save'; diff --git a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v5/save.js b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v5/save.js new file mode 100644 index 0000000000000..4ec303c60169a --- /dev/null +++ b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v5/save.js @@ -0,0 +1,40 @@ +import { useBlockProps } from '@wordpress/block-editor'; +import { getActiveStyleName } from '../../../../shared/block-styles'; +import { LAYOUT_STYLES } from '../../constants'; +import { defaultColumnsNumber } from '../../edit'; +import Layout from '../../layout'; + +export default function TiledGallerySave( { attributes } ) { + const { imageFilter, images } = attributes; + const blockProps = useBlockProps.save(); + + if ( ! images.length ) { + return null; + } + + const { + align, + className, + columns = defaultColumnsNumber( attributes ), + linkTo, + roundedCorners, + columnWidths, + } = attributes; + + return ( +
+ +
+ ); +} diff --git a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v5/supports.js b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v5/supports.js new file mode 100644 index 0000000000000..449296258d0bf --- /dev/null +++ b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/deprecated/v5/supports.js @@ -0,0 +1,14 @@ +export default { + align: [ 'center', 'wide', 'full' ], + color: { + gradients: true, + text: false, + }, + customClassName: false, + html: false, + spacing: { + margin: true, + padding: true, + }, + __experimentalHideChildBlockControls: true, +}; diff --git a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/save.js b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/save.js index a777e0acee248..1de3b7a6afe6f 100644 --- a/projects/plugins/jetpack/extensions/blocks/tiled-gallery/save.js +++ b/projects/plugins/jetpack/extensions/blocks/tiled-gallery/save.js @@ -1,4 +1,5 @@ import { useBlockProps } from '@wordpress/block-editor'; +import classNames from 'classnames'; import { getActiveStyleName } from '../../shared/block-styles'; import { LAYOUT_STYLES } from './constants'; import { defaultColumnsNumber } from './edit'; @@ -22,10 +23,9 @@ export default function TiledGallerySave( { attributes } ) { } = attributes; return ( -
+
video->poster_frame_uri ); $html = "