Merge pull request #28840 from woocommerce/update/remove-untrusted-plugin-notice

Deactivate untested plugin's notices
This commit is contained in:
Claudio Sanches 2021-01-18 19:56:56 -03:00 committed by GitHub
commit e6251955f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 6 deletions

View File

@ -377,7 +377,7 @@ class WC_Admin_Status {
private static function output_plugins_info( $plugins, $untested_plugins ) {
$wc_version = Constants::get_constant( 'WC_VERSION' );
if ( 'major' === WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE ) {
if ( 'major' === Constants::get_constant( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' ) ) {
// Since we're only testing against major, we don't need to show minor and patch version.
$wc_version = $wc_version[0] . '.0';
}

View File

@ -150,10 +150,15 @@ class WC_Plugin_Updates {
* with the $new_version.
*
* @param string $new_version WooCommerce version to test against.
* @param string $release 'major' or 'minor'.
* @param string $release 'major', 'minor', or 'none'.
* @return array of plugin info arrays
*/
public function get_untested_plugins( $new_version, $release ) {
// Since 5.0 all versions are backwards compatible.
if ( 'none' === $release ) {
return array();
}
$extensions = array_merge( $this->get_plugins_with_header( self::VERSION_TESTED_HEADER ), $this->get_plugins_for_woocommerce() );
$untested = array();
$new_version_parts = explode( '.', $new_version );

View File

@ -42,9 +42,14 @@ 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, 'major' );
$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 );

View File

@ -18,7 +18,7 @@ $untested_plugins_msg = sprintf(
?>
<div id="wc_untested_extensions_modal">
<div class="wc_untested_extensions_modal--content">
<h1><?php esc_html_e( "This is a major update, are you sure you're ready?", 'woocommerce' ); ?></h1>
<h1><?php esc_html_e( "Are you sure you're ready?", 'woocommerce' ); ?></h1>
<div class="wc_plugin_upgrade_notice extensions_warning">
<p><?php echo esc_html( $untested_plugins_msg ); ?></p>
@ -41,7 +41,7 @@ $untested_plugins_msg = sprintf(
</table>
</div>
<p><?php esc_html_e( 'As this is a major update, we strongly recommend creating a backup of your site before updating.', 'woocommerce' ); ?> <a href="https://woocommerce.com/2017/05/create-use-backups-woocommerce/" target="_blank"><?php esc_html_e( 'Learn more', 'woocommerce' ); ?></a></p>
<p><?php esc_html_e( 'We strongly recommend creating a backup of your site before updating.', 'woocommerce' ); ?> <a href="https://woocommerce.com/2017/05/create-use-backups-woocommerce/" target="_blank"><?php esc_html_e( 'Learn more', 'woocommerce' ); ?></a></p>
<?php if ( current_user_can( 'update_plugins' ) ) : ?>
<div class="actions">

View File

@ -11,7 +11,8 @@ global $wpdb;
if ( ! defined( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE' ) ) {
// Define if we're checking against major or minor versions.
define( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE', 'major' );
// Since 5.0 all versions are backwards compatible, so there's no more check.
define( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE', 'none' );
}
$report = wc()->api->get_endpoint_data( '/wc/v3/system_status' );