From d2d20314ab1143c957bd20a719c2ebfc8e48e6c8 Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Fri, 22 Jan 2021 11:58:40 +0100 Subject: [PATCH] Deprecate major plugin notices. --- .../plugin-updates/class-wc-plugin-updates.php | 4 ++++ .../class-wc-plugins-screen-updates.php | 18 +++--------------- .../class-wc-updates-screen-updates.php | 11 ++++++----- 3 files changed, 13 insertions(+), 20 deletions(-) diff --git a/includes/admin/plugin-updates/class-wc-plugin-updates.php b/includes/admin/plugin-updates/class-wc-plugin-updates.php index bb8c40af460..4a534134354 100644 --- a/includes/admin/plugin-updates/class-wc-plugin-updates.php +++ b/includes/admin/plugin-updates/class-wc-plugin-updates.php @@ -99,9 +99,11 @@ class WC_Plugin_Updates { /** * Get the inline warning notice for major version updates. * + * @deprecated 4.9.2 * @return string */ protected function get_extensions_inline_warning_major() { + wc_deprecated_function( 'WC_Plugin_Updates::get_extensions_inline_warning_major', '4.9.2', '' ); $upgrade_type = 'major'; $plugins = $this->major_untested_plugins; $version_parts = explode( '.', $this->new_version ); @@ -122,9 +124,11 @@ class WC_Plugin_Updates { /** * Get the warning notice for the modal window. * + * @deprecated 4.9.2 * @return string */ protected function get_extensions_modal_warning() { + wc_deprecated_function( 'WC_Plugin_Updates::get_extensions_modal_warning', '4.9.2', '' ); $version_parts = explode( '.', $this->new_version ); $new_version = $version_parts[0] . '.0'; $plugins = $this->major_untested_plugins; diff --git a/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php b/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php index 5920fb52616..2a9f8ae46f9 100644 --- a/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php +++ b/includes/admin/plugin-updates/class-wc-plugins-screen-updates.php @@ -42,14 +42,8 @@ class WC_Plugins_Screen_Updates extends WC_Plugin_Updates { * @param stdClass $response Plugin update response. */ public function in_plugin_update_message( $args, $response ) { - $version_type = Constants::get_constant( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' ); - if ( ! is_string( $version_type ) ) { - $version_type = 'none'; - } - $this->new_version = $response->new_version; $this->upgrade_notice = $this->get_upgrade_notice( $response->new_version ); - $this->major_untested_plugins = $this->get_untested_plugins( $response->new_version, $version_type ); $current_version_parts = explode( '.', Constants::get_constant( 'WC_VERSION' ) ); $new_version_parts = explode( '.', $this->new_version ); @@ -59,15 +53,6 @@ class WC_Plugins_Screen_Updates extends WC_Plugin_Updates { return; } - if ( ! empty( $this->major_untested_plugins ) ) { - $this->upgrade_notice .= $this->get_extensions_inline_warning_major(); - } - - if ( ! empty( $this->major_untested_plugins ) ) { - $this->upgrade_notice .= $this->get_extensions_modal_warning(); - add_action( 'admin_print_footer_scripts', array( $this, 'plugin_screen_modal_js' ) ); - } - echo apply_filters( 'woocommerce_in_plugin_update_message', $this->upgrade_notice ? '

' . wp_kses_post( $this->upgrade_notice ) . '

' : '' ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped } @@ -136,8 +121,11 @@ class WC_Plugins_Screen_Updates extends WC_Plugin_Updates { /** * JS for the modal window on the plugins screen. + * + * @deprecated 4.9.2 */ public function plugin_screen_modal_js() { + wc_deprecated_function( 'WC_Plugins_Screen_Updates::plugin_screen_modal_js', '4.9.2', '' ); ?>