Clean up spaces, tabs, indentation, and bracket formatting

This commit is contained in:
Brian Miyaji
2021-11-10 15:41:40 +09:00
parent e58beb1201
commit 3dff686a00
285 changed files with 29638 additions and 24147 deletions

View File

@@ -745,7 +745,7 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
*/
public function install_plugins_page() {
// Store new instance of plugin table in object.
$plugin_table = new TGMPA_List_Table;
$plugin_table = new TGMPA_List_Table();
// Return early if processing a plugin installation action.
if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) {
@@ -947,14 +947,14 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
$repo_updates = get_site_transient( 'update_plugins' );
if ( ! is_object( $repo_updates ) ) {
$repo_updates = new stdClass;
$repo_updates = new stdClass();
}
foreach ( $plugins as $slug => $plugin ) {
$file_path = $plugin['file_path'];
if ( empty( $repo_updates->response[ $file_path ] ) ) {
$repo_updates->response[ $file_path ] = new stdClass;
$repo_updates->response[ $file_path ] = new stdClass();
}
// We only really need to set package, but let's do all we can in case WP changes something.
@@ -1024,10 +1024,24 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) {
return trailingslashit( $to_path );
} else {
return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
return new WP_Error(
'rename_failed',
esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ),
array(
'found' => $subdir_name,
'expected' => $desired_slug,
)
);
}
} elseif ( empty( $subdir_name ) ) {
return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
return new WP_Error(
'packaged_wrong',
esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ),
array(
'found' => $subdir_name,
'expected' => $desired_slug,
)
);
}
}
@@ -1648,7 +1662,13 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
}
$response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) );
$response = plugins_api(
'plugin_information',
array(
'slug' => $slug,
'fields' => array( 'sections' => false ),
)
);
$api[ $slug ] = false;
@@ -3407,12 +3427,16 @@ if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) {
* @type array $packages Array of plugin, theme, or core packages to update.
* }
*/
do_action( 'upgrader_process_complete', $this, array(
'action' => 'install', // [TGMPA + ] adjusted.
'type' => 'plugin',
'bulk' => true,
'plugins' => $plugins,
) );
do_action(
'upgrader_process_complete',
$this,
array(
'action' => 'install', // [TGMPA + ] adjusted.
'type' => 'plugin',
'bulk' => true,
'plugins' => $plugins,
)
);
$this->skin->bulk_footer();