Deprecate major plugin notices.
This commit is contained in:
parent
2123b6369e
commit
d2d20314ab
|
@ -99,9 +99,11 @@ class WC_Plugin_Updates {
|
||||||
/**
|
/**
|
||||||
* Get the inline warning notice for major version updates.
|
* Get the inline warning notice for major version updates.
|
||||||
*
|
*
|
||||||
|
* @deprecated 4.9.2
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function get_extensions_inline_warning_major() {
|
protected function get_extensions_inline_warning_major() {
|
||||||
|
wc_deprecated_function( 'WC_Plugin_Updates::get_extensions_inline_warning_major', '4.9.2', '' );
|
||||||
$upgrade_type = 'major';
|
$upgrade_type = 'major';
|
||||||
$plugins = $this->major_untested_plugins;
|
$plugins = $this->major_untested_plugins;
|
||||||
$version_parts = explode( '.', $this->new_version );
|
$version_parts = explode( '.', $this->new_version );
|
||||||
|
@ -122,9 +124,11 @@ class WC_Plugin_Updates {
|
||||||
/**
|
/**
|
||||||
* Get the warning notice for the modal window.
|
* Get the warning notice for the modal window.
|
||||||
*
|
*
|
||||||
|
* @deprecated 4.9.2
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function get_extensions_modal_warning() {
|
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 );
|
$version_parts = explode( '.', $this->new_version );
|
||||||
$new_version = $version_parts[0] . '.0';
|
$new_version = $version_parts[0] . '.0';
|
||||||
$plugins = $this->major_untested_plugins;
|
$plugins = $this->major_untested_plugins;
|
||||||
|
|
|
@ -42,14 +42,8 @@ class WC_Plugins_Screen_Updates extends WC_Plugin_Updates {
|
||||||
* @param stdClass $response Plugin update response.
|
* @param stdClass $response Plugin update response.
|
||||||
*/
|
*/
|
||||||
public function in_plugin_update_message( $args, $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->new_version = $response->new_version;
|
||||||
$this->upgrade_notice = $this->get_upgrade_notice( $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' ) );
|
$current_version_parts = explode( '.', Constants::get_constant( 'WC_VERSION' ) );
|
||||||
$new_version_parts = explode( '.', $this->new_version );
|
$new_version_parts = explode( '.', $this->new_version );
|
||||||
|
@ -59,15 +53,6 @@ class WC_Plugins_Screen_Updates extends WC_Plugin_Updates {
|
||||||
return;
|
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 ? '</p>' . wp_kses_post( $this->upgrade_notice ) . '<p class="dummy">' : '' ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
|
echo apply_filters( 'woocommerce_in_plugin_update_message', $this->upgrade_notice ? '</p>' . wp_kses_post( $this->upgrade_notice ) . '<p class="dummy">' : '' ); // 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.
|
* JS for the modal window on the plugins screen.
|
||||||
|
*
|
||||||
|
* @deprecated 4.9.2
|
||||||
*/
|
*/
|
||||||
public function plugin_screen_modal_js() {
|
public function plugin_screen_modal_js() {
|
||||||
|
wc_deprecated_function( 'WC_Plugins_Screen_Updates::plugin_screen_modal_js', '4.9.2', '' );
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
( function( $ ) {
|
( function( $ ) {
|
||||||
|
|
|
@ -28,8 +28,11 @@ class WC_Updates_Screen_Updates extends WC_Plugin_Updates {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a warning message on the upgrades screen if the user tries to upgrade and has untested plugins.
|
* Show a warning message on the upgrades screen if the user tries to upgrade and has untested plugins.
|
||||||
|
*
|
||||||
|
* @deprecated 4.9.2
|
||||||
*/
|
*/
|
||||||
public function update_screen_modal() {
|
public function update_screen_modal() {
|
||||||
|
wc_deprecated_function( 'WC_Updates_Screen_Updates::update_screen_modal', '4.9.2', '' );
|
||||||
$updateable_plugins = get_plugin_updates();
|
$updateable_plugins = get_plugin_updates();
|
||||||
if ( empty( $updateable_plugins['woocommerce/woocommerce.php'] )
|
if ( empty( $updateable_plugins['woocommerce/woocommerce.php'] )
|
||||||
|| empty( $updateable_plugins['woocommerce/woocommerce.php']->update )
|
|| empty( $updateable_plugins['woocommerce/woocommerce.php']->update )
|
||||||
|
@ -39,17 +42,15 @@ class WC_Updates_Screen_Updates extends WC_Plugin_Updates {
|
||||||
|
|
||||||
$this->new_version = wc_clean( $updateable_plugins['woocommerce/woocommerce.php']->update->new_version );
|
$this->new_version = wc_clean( $updateable_plugins['woocommerce/woocommerce.php']->update->new_version );
|
||||||
$this->major_untested_plugins = $this->get_untested_plugins( $this->new_version, 'major' );
|
$this->major_untested_plugins = $this->get_untested_plugins( $this->new_version, 'major' );
|
||||||
|
|
||||||
if ( ! empty( $this->major_untested_plugins ) ) {
|
|
||||||
echo $this->get_extensions_modal_warning(); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped
|
|
||||||
$this->update_screen_modal_js();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JS for the modal window on the updates screen.
|
* JS for the modal window on the updates screen.
|
||||||
|
*
|
||||||
|
* @deprecated 4.9.2
|
||||||
*/
|
*/
|
||||||
protected function update_screen_modal_js() {
|
protected function update_screen_modal_js() {
|
||||||
|
wc_deprecated_function( 'WC_Updates_Screen_Updates::update_screen_modal_js', '4.9.2', '' );
|
||||||
?>
|
?>
|
||||||
<script>
|
<script>
|
||||||
( function( $ ) {
|
( function( $ ) {
|
||||||
|
|
Loading…
Reference in New Issue