Fix WPCS violations automatically using phpcbf

This commit is contained in:
Rodrigo Primo 2019-03-13 16:54:47 -03:00
parent dca1f3d4d7
commit 5e6ae9bfb6
5 changed files with 26 additions and 21 deletions

View File

@ -47,7 +47,7 @@ class WC_Beta_Tester_Admin_Assets {
'wc-beta-tester-version-picker', 'wc-beta-tester-version-picker',
'wc_beta_tester_version_picker_params', 'wc_beta_tester_version_picker_params',
array( array(
'i18n_pick_version' => __( 'Please pick a WooCommerce version.', 'woocommerce-beta-tester' ), 'i18n_pick_version' => __( 'Please pick a WooCommerce version.', 'woocommerce-beta-tester' ),
) )
); );

View File

@ -156,7 +156,7 @@ Copy and paste the system status report from **WooCommerce > System Status** in
$ssr = get_transient( $transient_name ); $ssr = get_transient( $transient_name );
if ( false === $ssr ) { if ( false === $ssr ) {
if( ! did_action( 'rest_api_init' ) ) { if ( ! did_action( 'rest_api_init' ) ) {
WC()->api->rest_api_includes(); WC()->api->rest_api_includes();
} }
@ -255,11 +255,13 @@ Copy and paste the system status report from **WooCommerce > System Status** in
} }
// Add the beta tester root node. // Add the beta tester root node.
$wp_admin_bar->add_node( array( $wp_admin_bar->add_node(
'parent' => 0, array(
'id' => 'wc-beta-tester', 'parent' => 0,
'title' => __( 'WC Beta Tester', 'woocommerce-beta-tester' ), 'id' => 'wc-beta-tester',
) ); 'title' => __( 'WC Beta Tester', 'woocommerce-beta-tester' ),
)
);
$settings = WC_Beta_Tester::get_settings(); $settings = WC_Beta_Tester::get_settings();
switch ( $settings->channel ) { switch ( $settings->channel ) {

View File

@ -43,17 +43,19 @@ class WC_Beta_Tester_Plugin_Upgrader extends Plugin_Upgrader {
add_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ), 10, 2 ); add_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ), 10, 2 );
add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 ); add_filter( 'upgrader_clear_destination', array( $this, 'delete_old_plugin' ), 10, 4 );
$this->run( array( $this->run(
'package' => $download_url, array(
'destination' => WP_PLUGIN_DIR, 'package' => $download_url,
'clear_destination' => true, 'destination' => WP_PLUGIN_DIR,
'clear_working' => true, 'clear_destination' => true,
'hook_extra' => array( 'clear_working' => true,
'plugin' => $plugin, 'hook_extra' => array(
'type' => 'plugin', 'plugin' => $plugin,
'action' => 'update', 'type' => 'plugin',
), 'action' => 'update',
) ); ),
)
);
// Cleanup our hooks, in case something else does a upgrade on this connection. // Cleanup our hooks, in case something else does a upgrade on this connection.
remove_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ) ); remove_filter( 'upgrader_pre_install', array( $this, 'deactivate_plugin_before_upgrade' ) );

View File

@ -75,11 +75,11 @@ class WC_Beta_Tester_Settings {
public function version_select_html( $args ) { public function version_select_html( $args ) {
$settings = WC_Beta_Tester::get_settings(); $settings = WC_Beta_Tester::get_settings();
$channels = array( $channels = array(
'beta' => array( 'beta' => array(
'name' => __( 'Beta Releases', 'woocommerce-beta-tester' ), 'name' => __( 'Beta Releases', 'woocommerce-beta-tester' ),
'description' => __( 'Beta releases contain experimental functionality for testing purposes only. This channel will also include RC and stable releases if more current.', 'woocommerce-beta-tester' ), 'description' => __( 'Beta releases contain experimental functionality for testing purposes only. This channel will also include RC and stable releases if more current.', 'woocommerce-beta-tester' ),
), ),
'rc' => array( 'rc' => array(
'name' => __( 'Release Candidates', 'woocommerce-beta-tester' ), 'name' => __( 'Release Candidates', 'woocommerce-beta-tester' ),
'description' => __( 'Release candidates are released to ensure any critical problems have not gone undetected. This channel will also include stable releases if more current.', 'woocommerce-beta-tester' ), 'description' => __( 'Release candidates are released to ensure any critical problems have not gone undetected. This channel will also include stable releases if more current.', 'woocommerce-beta-tester' ),
), ),

View File

@ -102,7 +102,8 @@ class WC_Beta_Tester_Version_Picker {
* @return void * @return void
*/ */
public function add_to_menus() { public function add_to_menus() {
add_submenu_page( 'plugins.php', add_submenu_page(
'plugins.php',
__( 'WooCommerce Version Switch', 'woocommerce-beta-tester' ), __( 'WooCommerce Version Switch', 'woocommerce-beta-tester' ),
__( 'WooCommerce Version Switch', 'woocommerce-beta-tester' ), __( 'WooCommerce Version Switch', 'woocommerce-beta-tester' ),
'install_plugins', 'install_plugins',