Skip to content

Commit

Permalink
Plugins are activated before language packages are installed
Browse files Browse the repository at this point in the history
  • Loading branch information
umeshsinghin committed Dec 10, 2024
1 parent e6a16ac commit d596eea
Showing 1 changed file with 15 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,20 +361,6 @@ public function create_item( $request ) {
);
}

if ( 'inactive' !== $request['status'] ) {
$can_change_status = $this->plugin_status_permission_check( $file, $request['status'], 'inactive' );

if ( is_wp_error( $can_change_status ) ) {
return $can_change_status;
}

$changed_status = $this->handle_plugin_status( $file, $request['status'], 'inactive' );

if ( is_wp_error( $changed_status ) ) {
return $changed_status;
}
}

// Install translations.
$installed_locales = array_values( get_available_languages() );
/** This filter is documented in wp-includes/update.php */
Expand All @@ -401,6 +387,21 @@ static function ( $pack ) use ( $installed_locales ) {
$lp_upgrader->bulk_upgrade( $language_packs );
}

// Now handle plugin activation.
if ( 'inactive' !== $request['status'] ) {
$can_change_status = $this->plugin_status_permission_check( $file, $request['status'], 'inactive' );

if ( is_wp_error( $can_change_status ) ) {
return $can_change_status;
}

$changed_status = $this->handle_plugin_status( $file, $request['status'], 'inactive' );

if ( is_wp_error( $changed_status ) ) {
return $changed_status;
}
}

$path = WP_PLUGIN_DIR . '/' . $file;
$data = get_plugin_data( $path, false, false );
$data['_file'] = $file;
Expand Down

0 comments on commit d596eea

Please sign in to comment.