Check plugin properties exist

This commit is contained in:
Mike Jolley 2018-05-25 12:07:12 +01:00
parent fc24e2f440
commit d0d87b5e39
1 changed files with 4 additions and 0 deletions

View File

@ -1931,6 +1931,10 @@ add_filter( 'extra_plugin_headers', 'wc_enable_wc_plugin_headers' );
* @return bool
*/
function wc_prevent_dangerous_auto_updates( $should_update, $plugin ) {
if ( ! isset( $plugin->plugin, $plugin->new_version ) ) {
return $should_update;
}
if ( 'woocommerce/woocommerce.php' !== $plugin->plugin ) {
return $should_update;
}