From c15703438ee3c0626fa16437e0da42d8bac0778c Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 08:22:43 -0700 Subject: [PATCH 01/29] Remove Phan suppression now that PHPDoc is correct in supported WP versions --- projects/plugins/wpcomsh/endpoints/rest-api-export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/plugins/wpcomsh/endpoints/rest-api-export.php b/projects/plugins/wpcomsh/endpoints/rest-api-export.php index 316dbfbda7657..1fef9f4234e85 100644 --- a/projects/plugins/wpcomsh/endpoints/rest-api-export.php +++ b/projects/plugins/wpcomsh/endpoints/rest-api-export.php @@ -55,7 +55,7 @@ function wpcomsh_rest_api_export( $request = null ) { // Create a placeholder file in upload directory to stream exported content to. $timestamp = time(); $filename = "$export_name-$timestamp.xml"; - // @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal @phan-suppress-current-line UnusedSuppression -- Phpdoc fixed in WP 6.6, but then we need a suppression for the WP 6.5 compat run. @todo Remove this line when we drop WP 6.5. + $upload = wp_upload_bits( $filename, null, '', null ); // Disable uploading of WXR file type. From 01bb8aec960fec32b3d4fb06a9253e6f327f3da4 Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 08:35:43 -0700 Subject: [PATCH 02/29] Remove WP 6.5 polyfill (see #38428) --- projects/packages/assets/src/class-assets.php | 6 ------ .../packages/assets/tests/php/test-assets.php | 15 ++++----------- projects/packages/assets/webpack.config.js | 19 ------------------- 3 files changed, 4 insertions(+), 36 deletions(-) diff --git a/projects/packages/assets/src/class-assets.php b/projects/packages/assets/src/class-assets.php index 3177ab69573b6..71725eec465af 100644 --- a/projects/packages/assets/src/class-assets.php +++ b/projects/packages/assets/src/class-assets.php @@ -537,12 +537,6 @@ public static function wp_default_scripts_hook( $wp_scripts ) { $wp_scripts->add( 'wp-jp-i18n-state', false, array( 'wp-deprecated', $handle ) ); $wp_scripts->add_inline_script( 'wp-jp-i18n-state', 'wp.deprecated( "wp-jp-i18n-state", { alternative: "wp-jp-i18n-loader" } );' ); $wp_scripts->add_inline_script( 'wp-jp-i18n-state', 'wp.jpI18nState = wp.jpI18nLoader.state;' ); - - // Register the React JSX runtime script - used as a polyfill until we can update JSX transforms. See https://github.com/Automattic/jetpack/issues/38424. - // @todo Remove this when we drop support for WordPress 6.5, as well as the script inclusion in test_wp_default_scripts_hook. - $jsx_url = self::normalize_path( plugins_url( '../build/react-jsx-runtime.js', __FILE__ ) ); - $wp_scripts->add( 'react-jsx-runtime', $jsx_url, array( 'react' ), '18.3.1', true ); - $wp_scripts->add_data( 'react-jsx-runtime', 'group', 1 ); } // endregion . diff --git a/projects/packages/assets/tests/php/test-assets.php b/projects/packages/assets/tests/php/test-assets.php index a05ef64ad4b2a..a0a396272c85c 100644 --- a/projects/packages/assets/tests/php/test-assets.php +++ b/projects/packages/assets/tests/php/test-assets.php @@ -755,8 +755,7 @@ function ( $value ) use ( $value_sets, $i ) { return $funcs; }; - // @todo: Remove `react-jsx-runtime` from the list of dependencies once we drop support for WordPress 6.5 and remove the dependency from wp_default_scripts_hook. - $mock->expects( $this->exactly( 3 ) )->method( 'add' ) + $mock->expects( $this->exactly( 2 ) )->method( 'add' ) ->with( ...$with_consecutive( array( @@ -767,12 +766,7 @@ function ( $value ) use ( $value_sets, $i ) { ), array( 'wp-i18n' ), ), - array( 'wp-jp-i18n-state', false, array( 'wp-deprecated', 'wp-jp-i18n-loader' ) ), - array( - 'react-jsx-runtime', - 'http://www.example.com/wp-content/plugins/jetpack/packages/assets/build/react-jsx-runtime.js', - array( 'react' ), - ) + array( 'wp-jp-i18n-state', false, array( 'wp-deprecated', 'wp-jp-i18n-loader' ) ) ) ); $mock->expects( $this->exactly( 3 ) )->method( 'add_inline_script' ) @@ -783,11 +777,10 @@ function ( $value ) use ( $value_sets, $i ) { array( 'wp-jp-i18n-state', 'wp.jpI18nState = wp.jpI18nLoader.state;' ) ) ); - $mock->expects( $this->exactly( 2 ) )->method( 'add_data' ) + $mock->expects( $this->once() )->method( 'add_data' ) ->with( ...$with_consecutive( - array( 'wp-jp-i18n-loader', 'group', 1 ), - array( 'react-jsx-runtime', 'group', 1 ) + array( 'wp-jp-i18n-loader', 'group', 1 ) ) ); diff --git a/projects/packages/assets/webpack.config.js b/projects/packages/assets/webpack.config.js index 8a40e14b66367..8c2e9cb4d37e6 100644 --- a/projects/packages/assets/webpack.config.js +++ b/projects/packages/assets/webpack.config.js @@ -61,23 +61,4 @@ module.exports = [ } ), ], }, - { - entry: { - 'react-jsx-runtime': { - import: 'react/jsx-runtime', - }, - }, - output: { - ...jetpackWebpackConfig.output, - path: path.resolve( './build' ), - filename: 'react-jsx-runtime.js', - library: { - name: 'ReactJSXRuntime', - type: 'window', - }, - }, - externals: { - react: 'React', - }, - }, ]; From 6e6eab821b966699a1aff5b125afbc27bbb760e6 Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 08:49:30 -0700 Subject: [PATCH 03/29] Remove is_callable check for wp_trigger_error() --- .../src/class-latest-autoloader-guard.php | 24 +++---------------- .../autoloader/src/class-php-autoloader.php | 8 +------ 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/projects/packages/autoloader/src/class-latest-autoloader-guard.php b/projects/packages/autoloader/src/class-latest-autoloader-guard.php index 3b2a96693eca2..285fe739a40a3 100644 --- a/projects/packages/autoloader/src/class-latest-autoloader-guard.php +++ b/projects/packages/autoloader/src/class-latest-autoloader-guard.php @@ -131,13 +131,7 @@ public function check_for_conflicting_autoloaders() { foreach ( $composer_autoloader->getClassMap() as $classname => $path ) { if ( $jetpack_autoloader_loader->find_class_file( $classname ) ) { $msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the classes we handle (e.g. $classname => $path). This may cause strange and confusing problems."; - // @todo Remove the is_callable check once we drop support for WP 6.5. - if ( is_callable( 'wp_trigger_error' ) ) { - wp_trigger_error( '', $msg ); - } else { - // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error - trigger_error( $msg ); - } + wp_trigger_error( '', $msg ); continue 2; } } @@ -145,13 +139,7 @@ public function check_for_conflicting_autoloaders() { if ( isset( $prefixes[ $prefix ] ) ) { $path = array_pop( $paths ); $msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the namespaces we handle (e.g. $prefix => $path). This may cause strange and confusing problems."; - // @todo Remove the is_callable check once we drop support for WP 6.5. - if ( is_callable( 'wp_trigger_error' ) ) { - wp_trigger_error( '', $msg ); - } else { - // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error - trigger_error( $msg ); - } + wp_trigger_error( '', $msg ); continue 2; } } @@ -159,13 +147,7 @@ public function check_for_conflicting_autoloaders() { if ( isset( $prefixes[ $prefix ] ) ) { $path = array_pop( $paths ); $msg = "A Composer autoloader is registered with a higher priority than the Jetpack Autoloader and would also handle some of the namespaces we handle (e.g. $prefix => $path). This may cause strange and confusing problems."; - // @todo Remove the is_callable check once we drop support for WP 6.5. - if ( is_callable( 'wp_trigger_error' ) ) { - wp_trigger_error( '', $msg ); - } else { - // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error - trigger_error( $msg ); - } + wp_trigger_error( '', $msg ); continue 2; } } diff --git a/projects/packages/autoloader/src/class-php-autoloader.php b/projects/packages/autoloader/src/class-php-autoloader.php index 519e8a1f4c808..f8765a4425f42 100644 --- a/projects/packages/autoloader/src/class-php-autoloader.php +++ b/projects/packages/autoloader/src/class-php-autoloader.php @@ -88,13 +88,7 @@ public static function load_class( $class_name ) { ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_wp_debug_backtrace_summary -- This is a debug log message. $msg = "Jetpack Autoloader: Autoloading `$class_name` before the plugins_loaded hook may cause strange and confusing problems. " . wp_debug_backtrace_summary( '', 1 ); - // @todo Remove the is_callable check once we drop support for WP 6.5. - if ( is_callable( 'wp_trigger_error' ) ) { - wp_trigger_error( '', $msg ); - } else { - // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error - trigger_error( $msg ); - } + wp_trigger_error( '', $msg ); } require $file; From d7458f0120e9c36a8de047c582ff3cb3b5aabc64 Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:03:24 -0700 Subject: [PATCH 04/29] =?UTF-8?q?setMethods=20=E2=86=92=20onlyMethods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tests/php/test-class-atomic-additional-css-manager.php | 3 +-- .../tests/php/test-class-wpcom-additional-css-manager.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/projects/packages/masterbar/tests/php/test-class-atomic-additional-css-manager.php b/projects/packages/masterbar/tests/php/test-class-atomic-additional-css-manager.php index 649cf18ca6d26..942f870af979d 100644 --- a/projects/packages/masterbar/tests/php/test-class-atomic-additional-css-manager.php +++ b/projects/packages/masterbar/tests/php/test-class-atomic-additional-css-manager.php @@ -49,10 +49,9 @@ public function tear_down() { * Check if the nudge contains the proper url and message copy. */ public function test_it_generates_proper_url_and_nudge() { - // @phan-suppress-next-line PhanDeprecatedFunction -- Keep using setMethods until we drop PHP 7.0 support. $manager = $this->getMockBuilder( Atomic_Additional_CSS_Manager::class ) ->setConstructorArgs( array( 'foo.com' ) ) - ->setMethods( array( 'get_plan_name' ) ) + ->onlyMethods( array( 'get_plan_name' ) ) ->getMock(); $manager->method( 'get_plan_name' )->willReturn( 'Business' ); diff --git a/projects/packages/masterbar/tests/php/test-class-wpcom-additional-css-manager.php b/projects/packages/masterbar/tests/php/test-class-wpcom-additional-css-manager.php index 1ab2d052aa939..aed46f5d28b06 100644 --- a/projects/packages/masterbar/tests/php/test-class-wpcom-additional-css-manager.php +++ b/projects/packages/masterbar/tests/php/test-class-wpcom-additional-css-manager.php @@ -40,10 +40,9 @@ public function set_up() { * Check if the manager constructs the proper url and copy message. */ public function test_it_generates_proper_url_and_nudge() { - // @phan-suppress-next-line PhanDeprecatedFunction -- Keep using setMethods until we drop PHP 7.0 support. $manager = $this->getMockBuilder( WPCOM_Additional_CSS_Manager::class ) ->setConstructorArgs( array( 'foo.com' ) ) - ->setMethods( array( 'get_plan' ) ) + ->onlyMethods( array( 'get_plan' ) ) ->getMock(); $manager->method( 'get_plan' )->willReturn( From 3240990ea8e4ff5c8cbfd06955f72cf9b78bee55 Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:07:22 -0700 Subject: [PATCH 05/29] =?UTF-8?q?static=20=E2=86=92=20const=20property?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- projects/plugins/beta/src/class-plugin.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/projects/plugins/beta/src/class-plugin.php b/projects/plugins/beta/src/class-plugin.php index 94e72e7ff06bc..86eeaf7fd821a 100644 --- a/projects/plugins/beta/src/class-plugin.php +++ b/projects/plugins/beta/src/class-plugin.php @@ -21,10 +21,9 @@ class Plugin { /** * Regex for the loader added to a mu-plugin loader. * - * @todo When we drop support for PHP <7.1.0, make this a private const. * @var string */ - private static $mu_loader_regex = '#^<\?php\s+/\* Load Jetpack Beta dev version: \*/\s+return require\s*(?:\(\s*)?__DIR__\s*.\s*(?:\x27[^\x27]*\x27|"[^"]*")(?:\s*\))?\s*;#'; + private const MU_LOADER_REGEX = '#^<\?php\s+/\* Load Jetpack Beta dev version: \*/\s+return require\s*(?:\(\s*)?__DIR__\s*.\s*(?:\x27[^\x27]*\x27|"[^"]*")(?:\s*\))?\s*;#'; /** * Class instances. @@ -483,7 +482,7 @@ public function is_active( $which ) { // If the loader snippet is present, dev is active. If not, assume stable is active (or there wouldn't be a loader). // That assumption ignores things like how the usual wpcomsh-loader.php checks for IS_ATOMIC, but there's not much we can do about that and it's unlikely to matter anyway. // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Not a remote URL. - return ( (bool) preg_match( self::$mu_loader_regex, (string) file_get_contents( $file ) ) ) === ( $which === 'dev' ); + return ( (bool) preg_match( self::MU_LOADER_REGEX, (string) file_get_contents( $file ) ) ) === ( $which === 'dev' ); } /** @@ -592,7 +591,7 @@ private function update_mu_plugin_loader( $which ) { } // Strip our loader snippet, then re-add it if necessary. - $new_contents = preg_replace( self::$mu_loader_regex, 'dev_plugin_path() ) ) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export -- Used for escaping, not output. $new_contents = 'dev_plugin_file()}", true ) . ';' . substr( $new_contents, 5 ); From 4f834228c61ea2bfae26523fdbcc9fc22f33eb70 Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:14:24 -0700 Subject: [PATCH 06/29] Add type hinting --- projects/plugins/jetpack/_inc/lib/class.media-summary.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/projects/plugins/jetpack/_inc/lib/class.media-summary.php b/projects/plugins/jetpack/_inc/lib/class.media-summary.php index 9ac367694e22b..b27ec92b50cff 100644 --- a/projects/plugins/jetpack/_inc/lib/class.media-summary.php +++ b/projects/plugins/jetpack/_inc/lib/class.media-summary.php @@ -34,8 +34,7 @@ class Jetpack_Media_Summary { * * @return array|mixed|void */ - public static function get( $post_id, $blog_id = 0, $args = array() ) { - // @todo: Use type hinting in the line above when at PHP 7.0+. + public static function get( int $post_id, int $blog_id = 0, array $args = array() ) { $post_id = (int) $post_id; $blog_id = (int) $blog_id; From 0674faf18586c7038fc1b84cc9b6d04aa3a685ce Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:22:50 -0700 Subject: [PATCH 07/29] Throw exception instead of triggering deprecation notice --- projects/packages/changelogger/lib/ChangelogEntry.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/projects/packages/changelogger/lib/ChangelogEntry.php b/projects/packages/changelogger/lib/ChangelogEntry.php index 04e0fbe69d16e..6680c80898be6 100644 --- a/projects/packages/changelogger/lib/ChangelogEntry.php +++ b/projects/packages/changelogger/lib/ChangelogEntry.php @@ -268,15 +268,14 @@ public function appendChange( ChangeEntry $change ) { /** * Get the changes grouped by subheading. * - * @param string|null $subheading Subheading to retrieve. @deprecated since 4.2.0. Do `->getChangesBySubheading()[ $subheading ]` instead. + * @param string|null $subheading Subheading to retrieve. @deprecated since 4.2.0, throws an error since $$next-version$$. Do `->getChangesBySubheading()[ $subheading ]` instead. * @return array Change entries by subheading. - * Returns just the `ChangeEntry[]` if the deprecated `$subheading` parameter is used. + * @throws \InvalidArgumentException If the deprecated `$subheading` parameter is used. */ public function getChangesBySubheading( $subheading = null ) { if ( $subheading !== null ) { - // @todo Sometime for a major version bump, have this throw instead. Then remove it for a major bump after that. - // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error - trigger_error( 'Passing a value for $subheading is deprecated. Do `->getChangesBySubheading()[ $subheading ]` instead.', E_USER_DEPRECATED ); + // @todo Remove this next major version bump. + throw new \InvalidArgumentException( 'Passing a value for $subheading is deprecated. Do `->getChangesBySubheading()[ $subheading ]` instead.' ); } $ret = array(); From 3bdaac9338bfa680074a234e05c45879496d9d50 Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:37:32 -0700 Subject: [PATCH 08/29] Remove now-unneeded CSS --- .../src/features/wpcom-blocks/event-countdown/editor.scss | 7 ------- 1 file changed, 7 deletions(-) diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-blocks/event-countdown/editor.scss b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-blocks/event-countdown/editor.scss index d5ba3e54a9a62..67d9cee322ff9 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-blocks/event-countdown/editor.scss +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-blocks/event-countdown/editor.scss @@ -22,10 +22,3 @@ width: 100%; } } - -// Fix so datetime picker doesn't have horizontal scrollbar. -// This is a global fix, unscoped, and not very nice. -// @todo: It won't be necessary once https://github.com/WordPress/gutenberg/pull/18235/files gets merged. -.components-datetime { - padding: 8px; -} From 7842f7df275faff040a29023fc6e34cbd7bef10b Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:37:40 -0700 Subject: [PATCH 09/29] Updated comment --- projects/packages/status/src/class-status.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/projects/packages/status/src/class-status.php b/projects/packages/status/src/class-status.php index 472157f2407c9..83c5c22f1fc7d 100644 --- a/projects/packages/status/src/class-status.php +++ b/projects/packages/status/src/class-status.php @@ -45,8 +45,7 @@ public function is_offline_mode() { /** * Filters Jetpack's offline mode. * - * @see https://jetpack.com/support/development-mode/ - * @todo Update documentation ^^. + * @see https://jetpack.com/support/offline-mode/ * * @since 1.3.0 * From 69aed20ea4ef829462f077d23c5d55c2f7bb0b68 Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 09:49:04 -0700 Subject: [PATCH 10/29] Add future todo --- projects/packages/changelogger/lib/ChangelogEntry.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/packages/changelogger/lib/ChangelogEntry.php b/projects/packages/changelogger/lib/ChangelogEntry.php index 6680c80898be6..ea0c6d7d7ee3e 100644 --- a/projects/packages/changelogger/lib/ChangelogEntry.php +++ b/projects/packages/changelogger/lib/ChangelogEntry.php @@ -292,6 +292,8 @@ public function getChangesBySubheading( $subheading = null ) { * Return data for serializing to JSON. * * @return array + * + * @todo Once we drop support for PHP <7.4, we should remove the attribute and add a `mixed` return type to match JsonSerializable. */ #[\ReturnTypeWillChange] public function jsonSerialize() { From 565292bd3c474a6fe35acb0e7b708820567e517f Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:24:54 -0700 Subject: [PATCH 11/29] Remove fallbacks --- .../crm/src/js/components/automations-admin/view.tsx | 7 +------ .../crm/src/js/components/onboarding-wizard/view.jsx | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/projects/plugins/crm/src/js/components/automations-admin/view.tsx b/projects/plugins/crm/src/js/components/automations-admin/view.tsx index 6866ba5995fdf..11eabb7390ce0 100644 --- a/projects/plugins/crm/src/js/components/automations-admin/view.tsx +++ b/projects/plugins/crm/src/js/components/automations-admin/view.tsx @@ -16,7 +16,6 @@ const render = () => { return; } - // @todo: Remove fallback when we drop support for WP 6.1 const component = ( @@ -27,11 +26,7 @@ const render = () => { ); - if ( WPElement.createRoot ) { - WPElement.createRoot( container ).render( component ); - } else { - WPElement.render( component, container ); - } + WPElement.createRoot( container ).render( component ); }; render(); diff --git a/projects/plugins/crm/src/js/components/onboarding-wizard/view.jsx b/projects/plugins/crm/src/js/components/onboarding-wizard/view.jsx index 574873f9d8b12..2e26ae56229ec 100644 --- a/projects/plugins/crm/src/js/components/onboarding-wizard/view.jsx +++ b/projects/plugins/crm/src/js/components/onboarding-wizard/view.jsx @@ -12,18 +12,13 @@ function render() { return; } - // @todo: Remove fallback when we drop support for WP 6.1 const component = ( ); - if ( WPElement.createRoot ) { - WPElement.createRoot( container ).render( component ); - } else { - WPElement.render( component, container ); - } + WPElement.createRoot( container ).render( component ); } render(); From 1ed885cd123e6fcf77041c8ed2d1deba03f4c682 Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:32:48 -0700 Subject: [PATCH 12/29] Add changelogs --- .../assets/changelog/remove-pre_wp6.6_and_php7.2_code | 5 +++++ .../autoloader/changelog/remove-pre_wp6.6_and_php7.2_code | 5 +++++ .../changelogger/changelog/remove-pre_wp6.6_and_php7.2_code | 5 +++++ .../changelog/remove-pre_wp6.6_and_php7.2_code | 5 +++++ .../masterbar/changelog/remove-pre_wp6.6_and_php7.2_code | 5 +++++ .../status/changelog/remove-pre_wp6.6_and_php7.2_code | 5 +++++ .../plugins/beta/changelog/remove-pre_wp6.6_and_php7.2_code | 5 +++++ .../plugins/crm/changelog/remove-pre_wp6.6_and_php7.2_code | 5 +++++ .../jetpack/changelog/remove-pre_wp6.6_and_php7.2_code | 5 +++++ .../wpcomsh/changelog/remove-pre_wp6.6_and_php7.2_code | 5 +++++ 10 files changed, 50 insertions(+) create mode 100644 projects/packages/assets/changelog/remove-pre_wp6.6_and_php7.2_code create mode 100644 projects/packages/autoloader/changelog/remove-pre_wp6.6_and_php7.2_code create mode 100644 projects/packages/changelogger/changelog/remove-pre_wp6.6_and_php7.2_code create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/remove-pre_wp6.6_and_php7.2_code create mode 100644 projects/packages/masterbar/changelog/remove-pre_wp6.6_and_php7.2_code create mode 100644 projects/packages/status/changelog/remove-pre_wp6.6_and_php7.2_code create mode 100644 projects/plugins/beta/changelog/remove-pre_wp6.6_and_php7.2_code create mode 100644 projects/plugins/crm/changelog/remove-pre_wp6.6_and_php7.2_code create mode 100644 projects/plugins/jetpack/changelog/remove-pre_wp6.6_and_php7.2_code create mode 100644 projects/plugins/wpcomsh/changelog/remove-pre_wp6.6_and_php7.2_code diff --git a/projects/packages/assets/changelog/remove-pre_wp6.6_and_php7.2_code b/projects/packages/assets/changelog/remove-pre_wp6.6_and_php7.2_code new file mode 100644 index 0000000000000..8bc7df4543fb6 --- /dev/null +++ b/projects/packages/assets/changelog/remove-pre_wp6.6_and_php7.2_code @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Additional cleanup of old PHP + WP version support. + + diff --git a/projects/packages/autoloader/changelog/remove-pre_wp6.6_and_php7.2_code b/projects/packages/autoloader/changelog/remove-pre_wp6.6_and_php7.2_code new file mode 100644 index 0000000000000..8bc7df4543fb6 --- /dev/null +++ b/projects/packages/autoloader/changelog/remove-pre_wp6.6_and_php7.2_code @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Additional cleanup of old PHP + WP version support. + + diff --git a/projects/packages/changelogger/changelog/remove-pre_wp6.6_and_php7.2_code b/projects/packages/changelogger/changelog/remove-pre_wp6.6_and_php7.2_code new file mode 100644 index 0000000000000..8bc7df4543fb6 --- /dev/null +++ b/projects/packages/changelogger/changelog/remove-pre_wp6.6_and_php7.2_code @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Additional cleanup of old PHP + WP version support. + + diff --git a/projects/packages/jetpack-mu-wpcom/changelog/remove-pre_wp6.6_and_php7.2_code b/projects/packages/jetpack-mu-wpcom/changelog/remove-pre_wp6.6_and_php7.2_code new file mode 100644 index 0000000000000..8bc7df4543fb6 --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/remove-pre_wp6.6_and_php7.2_code @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Additional cleanup of old PHP + WP version support. + + diff --git a/projects/packages/masterbar/changelog/remove-pre_wp6.6_and_php7.2_code b/projects/packages/masterbar/changelog/remove-pre_wp6.6_and_php7.2_code new file mode 100644 index 0000000000000..8bc7df4543fb6 --- /dev/null +++ b/projects/packages/masterbar/changelog/remove-pre_wp6.6_and_php7.2_code @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Additional cleanup of old PHP + WP version support. + + diff --git a/projects/packages/status/changelog/remove-pre_wp6.6_and_php7.2_code b/projects/packages/status/changelog/remove-pre_wp6.6_and_php7.2_code new file mode 100644 index 0000000000000..8bc7df4543fb6 --- /dev/null +++ b/projects/packages/status/changelog/remove-pre_wp6.6_and_php7.2_code @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Additional cleanup of old PHP + WP version support. + + diff --git a/projects/plugins/beta/changelog/remove-pre_wp6.6_and_php7.2_code b/projects/plugins/beta/changelog/remove-pre_wp6.6_and_php7.2_code new file mode 100644 index 0000000000000..8bc7df4543fb6 --- /dev/null +++ b/projects/plugins/beta/changelog/remove-pre_wp6.6_and_php7.2_code @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Additional cleanup of old PHP + WP version support. + + diff --git a/projects/plugins/crm/changelog/remove-pre_wp6.6_and_php7.2_code b/projects/plugins/crm/changelog/remove-pre_wp6.6_and_php7.2_code new file mode 100644 index 0000000000000..8bc7df4543fb6 --- /dev/null +++ b/projects/plugins/crm/changelog/remove-pre_wp6.6_and_php7.2_code @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Additional cleanup of old PHP + WP version support. + + diff --git a/projects/plugins/jetpack/changelog/remove-pre_wp6.6_and_php7.2_code b/projects/plugins/jetpack/changelog/remove-pre_wp6.6_and_php7.2_code new file mode 100644 index 0000000000000..1d53d8cb4c941 --- /dev/null +++ b/projects/plugins/jetpack/changelog/remove-pre_wp6.6_and_php7.2_code @@ -0,0 +1,5 @@ +Significance: patch +Type: other +Comment: Additional cleanup of old PHP + WP version support. + + diff --git a/projects/plugins/wpcomsh/changelog/remove-pre_wp6.6_and_php7.2_code b/projects/plugins/wpcomsh/changelog/remove-pre_wp6.6_and_php7.2_code new file mode 100644 index 0000000000000..8bc7df4543fb6 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/remove-pre_wp6.6_and_php7.2_code @@ -0,0 +1,5 @@ +Significance: patch +Type: removed +Comment: Additional cleanup of old PHP + WP version support. + + From 460e14b6508e85ee50217fecb6a2a8987fc756f1 Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:47:21 -0700 Subject: [PATCH 13/29] Remove composer downgrade logic --- .github/actions/tool-setup/action.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/actions/tool-setup/action.yml b/.github/actions/tool-setup/action.yml index e2d0d453f6887..21436e1f4616b 100644 --- a/.github/actions/tool-setup/action.yml +++ b/.github/actions/tool-setup/action.yml @@ -21,11 +21,6 @@ runs: # Read tool versions . .github/versions.sh - if [[ "${INPUT_PHP:-$PHP_VERSION}" == 7.[01] ]]; then - printf "Downgrading composer for PHP %s\n\n" "${INPUT_PHP:-$PHP_VERSION}" - COMPOSER_VERSION=2.2.24 - fi - printf "\n\e[1mSelected tool versions\e[0m\n" echo " PHP: ${INPUT_PHP:-$PHP_VERSION}" echo "php-version=${INPUT_PHP:-$PHP_VERSION}" >> "$GITHUB_OUTPUT" From 17b7094bd62b977bccf4aff48d1341b663d39c46 Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:52:42 -0700 Subject: [PATCH 14/29] CRM requires PHP 7.4 already --- .../crm/includes/class-oauth-handler.php | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/projects/plugins/crm/includes/class-oauth-handler.php b/projects/plugins/crm/includes/class-oauth-handler.php index ecaded4030f61..50282373b9005 100644 --- a/projects/plugins/crm/includes/class-oauth-handler.php +++ b/projects/plugins/crm/includes/class-oauth-handler.php @@ -3,7 +3,7 @@ * Jetpack CRM * https://jetpackcrm.com * - * OAuth connection handler. Requires PHP 7.3+ + * OAuth connection handler. * */ namespace Automattic\JetpackCRM; @@ -18,7 +18,7 @@ class Oauth_Handler { /* - * Enabled (we disable oauth here if less than PHP <7.3 (req version)) + * Enabled. */ private $enabled = true; @@ -60,24 +60,11 @@ class Oauth_Handler { * Init */ public function __construct() { + // Add our action to the stack + add_filter( 'jpcrm_listener_actions', array( $this, 'add_listener_action' ), 1 ); - global $zbs; - - // require PHP 7.3 - if ( $zbs->has_min_php_version( '7.3' ) ) { - - // Add our action to the stack - add_filter( 'jpcrm_listener_actions', array( $this, 'add_listener_action' ), 1 ); - - // set action for endpoint listener to fire, so we can catch oauth requests (if any) - add_action( 'jpcrm_listener_oauth', array( $this, 'catch_oauth_request'), 10 ); - - } else { - - $this->enabled = false; - - } - + // set action for endpoint listener to fire, so we can catch oauth requests (if any) + add_action( 'jpcrm_listener_oauth', array( $this, 'catch_oauth_request' ), 10 ); } From 5fd572037f6860bffb4557d873390f3d384fee83 Mon Sep 17 00:00:00 2001 From: tbradsha <32492176+tbradsha@users.noreply.github.com> Date: Thu, 14 Nov 2024 15:03:44 -0700 Subject: [PATCH 15/29] Super Cache has previously required WP 6.5 --- projects/plugins/super-cache/wp-cache.php | 24 ++++++----------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/projects/plugins/super-cache/wp-cache.php b/projects/plugins/super-cache/wp-cache.php index 41bfc5ff46f0b..97347ef8bd543 100644 --- a/projects/plugins/super-cache/wp-cache.php +++ b/projects/plugins/super-cache/wp-cache.php @@ -276,13 +276,7 @@ function wpsupercache_activate() { register_activation_hook( __FILE__, 'wpsupercache_activate' ); function wpsupercache_site_admin() { - global $wp_version; - - if ( version_compare( $wp_version, '4.8', '>=' ) ) { - return current_user_can( 'setup_network' ); - } - - return is_super_admin(); + return current_user_can( 'setup_network' ); } function wp_cache_add_pages() { @@ -2011,7 +2005,7 @@ function wp_cache_remove_index() { } function wp_cache_index_notice() { - global $wp_version, $cache_path; + global $cache_path; if ( false == wpsupercache_site_admin() ) return false; @@ -2036,16 +2030,10 @@ function wp_cache_index_notice() { echo "

"; _e( 'If you just installed WP Super Cache for the first time, you can dismiss this message. Otherwise, you should probably refresh the login cookies of all logged in WordPress users here by clicking the logout link below.', 'wp-super-cache' ); echo "

"; - if ( -1 == version_compare( $wp_version, '4.0' ) ) { - echo '

' . __( 'Your site is using a very old version of WordPress. When you update to the latest version everyone will be logged out and cookie information updated.', 'wp-super-cache' ) . '

'; - } else { - echo '

' . __( 'The logout link will log out all WordPress users on this site except you. Your authentication cookie will be updated, but you will not be logged out.', 'wp-super-cache' ) . '

'; - } - echo "" . __( 'Dismiss', 'wp-super-cache' ) . ""; - if ( 1 == version_compare( $wp_version, '4.0' ) ) { - echo " | " . __( 'Logout', 'wp-super-cache' ) . ""; - } - echo ""; + echo '

' . esc_html__( 'The logout link will log out all WordPress users on this site except you. Your authentication cookie will be updated, but you will not be logged out.', 'wp-super-cache' ) . '

'; + echo '' . esc_html__( 'Dismiss', 'wp-super-cache' ) . ''; + echo ' | ' . esc_html__( 'Logout', 'wp-super-cache' ) . ''; + echo ''; ?>