Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
@@ -339,15 +339,31 @@ if ( $action ) {
|
||||
?>
|
||||
<?php if ( 1 === $plugins_to_delete ) : ?>
|
||||
<h1><?php _e( 'Delete Plugin' ); ?></h1>
|
||||
<?php if ( $have_non_network_plugins && is_network_admin() ) : ?>
|
||||
<div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'This plugin may be active on other sites in the network.' ); ?></p></div>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
if ( $have_non_network_plugins && is_network_admin() ) :
|
||||
$maybe_active_plugin = '<strong>' . __( 'Caution:' ) . '</strong> ' . __( 'This plugin may be active on other sites in the network.' );
|
||||
wp_admin_notice(
|
||||
$maybe_active_plugin,
|
||||
array(
|
||||
'additional_classes' => array( 'error' ),
|
||||
)
|
||||
);
|
||||
endif;
|
||||
?>
|
||||
<p><?php _e( 'You are about to remove the following plugin:' ); ?></p>
|
||||
<?php else : ?>
|
||||
<h1><?php _e( 'Delete Plugins' ); ?></h1>
|
||||
<?php if ( $have_non_network_plugins && is_network_admin() ) : ?>
|
||||
<div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'These plugins may be active on other sites in the network.' ); ?></p></div>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
if ( $have_non_network_plugins && is_network_admin() ) :
|
||||
$maybe_active_plugins = '<strong>' . __( 'Caution:' ) . '</strong> ' . __( 'These plugins may be active on other sites in the network.' );
|
||||
wp_admin_notice(
|
||||
$maybe_active_plugins,
|
||||
array(
|
||||
'additional_classes' => array( 'error' ),
|
||||
)
|
||||
);
|
||||
endif;
|
||||
?>
|
||||
<p><?php _e( 'You are about to remove the following plugins:' ); ?></p>
|
||||
<?php endif; ?>
|
||||
<ul class="ul-disc">
|
||||
@@ -495,7 +511,7 @@ if ( $action ) {
|
||||
|
||||
// Return early if all selected plugins already have auto-updates enabled or disabled.
|
||||
// Must use non-strict comparison, so that array order is not treated as significant.
|
||||
if ( $new_auto_updates == $auto_updates ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
|
||||
if ( $new_auto_updates == $auto_updates ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual
|
||||
wp_redirect( $redirect );
|
||||
exit;
|
||||
}
|
||||
@@ -547,7 +563,7 @@ get_current_screen()->add_help_tab(
|
||||
'<p>' . __( 'The search for installed plugins will search for terms in their name, description, or author.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
|
||||
'<p>' . sprintf(
|
||||
/* translators: %s: WordPress Plugin Directory URL. */
|
||||
__( 'If you would like to see more plugins to choose from, click on the “Add New” button and you will be able to browse or search for additional plugins from the <a href="%s">WordPress Plugin Directory</a>. Plugins in the WordPress Plugin Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they’re free!' ),
|
||||
__( 'If you would like to see more plugins to choose from, click on the “Add New Plugin” button and you will be able to browse or search for additional plugins from the <a href="%s">WordPress Plugin Directory</a>. Plugins in the WordPress Plugin Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they’re free!' ),
|
||||
__( 'https://wordpress.org/plugins/' )
|
||||
) . '</p>',
|
||||
)
|
||||
@@ -607,18 +623,29 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
$invalid = validate_active_plugins();
|
||||
if ( ! empty( $invalid ) ) {
|
||||
foreach ( $invalid as $plugin_file => $error ) {
|
||||
echo '<div id="message" class="error"><p>';
|
||||
printf(
|
||||
$deactivated_message = sprintf(
|
||||
/* translators: 1: Plugin file, 2: Error message. */
|
||||
__( 'The plugin %1$s has been deactivated due to an error: %2$s' ),
|
||||
'<code>' . esc_html( $plugin_file ) . '</code>',
|
||||
esc_html( $error->get_error_message() )
|
||||
);
|
||||
echo '</p></div>';
|
||||
wp_admin_notice(
|
||||
$deactivated_message,
|
||||
array(
|
||||
'id' => 'message',
|
||||
'additional_classes' => array( 'error' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $_GET['error'] ) ) :
|
||||
// Used by wp_admin_notice() updated notices.
|
||||
$updated_notice_args = array(
|
||||
'id' => 'message',
|
||||
'additional_classes' => array( 'updated' ),
|
||||
'dismissible' => true,
|
||||
);
|
||||
if ( isset( $_GET['error'] ) ) {
|
||||
|
||||
if ( isset( $_GET['main'] ) ) {
|
||||
$errmsg = __( 'You cannot delete a plugin while it is active on the main site.' );
|
||||
@@ -639,10 +666,6 @@ if ( isset( $_GET['error'] ) ) :
|
||||
$errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' );
|
||||
}
|
||||
|
||||
?>
|
||||
<div id="message" class="error"><p><?php echo $errmsg; ?></p>
|
||||
<?php
|
||||
|
||||
if ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] )
|
||||
&& isset( $_GET['_error_nonce'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin )
|
||||
) {
|
||||
@@ -655,66 +678,66 @@ if ( isset( $_GET['error'] ) ) :
|
||||
admin_url( 'plugins.php' )
|
||||
);
|
||||
|
||||
?>
|
||||
<iframe style="border:0" width="100%" height="70px" src="<?php echo esc_url( $iframe_url ); ?>"></iframe>
|
||||
<?php
|
||||
$errmsg .= '<iframe style="border:0" width="100%" height="70px" src="' . esc_url( $iframe_url ) . '"></iframe>';
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
elseif ( isset( $_GET['deleted'] ) ) :
|
||||
wp_admin_notice(
|
||||
$errmsg,
|
||||
array(
|
||||
'id' => 'message',
|
||||
'additional_classes' => array( 'error' ),
|
||||
)
|
||||
);
|
||||
|
||||
} elseif ( isset( $_GET['deleted'] ) ) {
|
||||
$delete_result = get_transient( 'plugins_delete_result_' . $user_ID );
|
||||
// Delete it once we're done.
|
||||
delete_transient( 'plugins_delete_result_' . $user_ID );
|
||||
|
||||
if ( is_wp_error( $delete_result ) ) :
|
||||
?>
|
||||
<div id="message" class="error notice is-dismissible">
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: Error message. */
|
||||
__( 'Plugin could not be deleted due to an error: %s' ),
|
||||
esc_html( $delete_result->get_error_message() )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div id="message" class="updated notice is-dismissible">
|
||||
<p>
|
||||
<?php
|
||||
if ( 1 === (int) $_GET['deleted'] ) {
|
||||
_e( 'The selected plugin has been deleted.' );
|
||||
} else {
|
||||
_e( 'The selected plugins have been deleted.' );
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php elseif ( isset( $_GET['activate'] ) ) : ?>
|
||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin activated.' ); ?></p></div>
|
||||
<?php elseif ( isset( $_GET['activate-multi'] ) ) : ?>
|
||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins activated.' ); ?></p></div>
|
||||
<?php elseif ( isset( $_GET['deactivate'] ) ) : ?>
|
||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin deactivated.' ); ?></p></div>
|
||||
<?php elseif ( isset( $_GET['deactivate-multi'] ) ) : ?>
|
||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins deactivated.' ); ?></p></div>
|
||||
<?php elseif ( 'update-selected' === $action ) : ?>
|
||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'All selected plugins are up to date.' ); ?></p></div>
|
||||
<?php elseif ( isset( $_GET['resume'] ) ) : ?>
|
||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin resumed.' ); ?></p></div>
|
||||
<?php elseif ( isset( $_GET['enabled-auto-update'] ) ) : ?>
|
||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin will be auto-updated.' ); ?></p></div>
|
||||
<?php elseif ( isset( $_GET['disabled-auto-update'] ) ) : ?>
|
||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin will no longer be auto-updated.' ); ?></p></div>
|
||||
<?php elseif ( isset( $_GET['enabled-auto-update-multi'] ) ) : ?>
|
||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins will be auto-updated.' ); ?></p></div>
|
||||
<?php elseif ( isset( $_GET['disabled-auto-update-multi'] ) ) : ?>
|
||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins will no longer be auto-updated.' ); ?></p></div>
|
||||
<?php endif; ?>
|
||||
if ( is_wp_error( $delete_result ) ) {
|
||||
$plugin_not_deleted_message = sprintf(
|
||||
/* translators: %s: Error message. */
|
||||
__( 'Plugin could not be deleted due to an error: %s' ),
|
||||
esc_html( $delete_result->get_error_message() )
|
||||
);
|
||||
wp_admin_notice(
|
||||
$plugin_not_deleted_message,
|
||||
array(
|
||||
'id' => 'message',
|
||||
'additional_classes' => array( 'error' ),
|
||||
'dismissible' => true,
|
||||
)
|
||||
);
|
||||
} else {
|
||||
if ( 1 === (int) $_GET['deleted'] ) {
|
||||
$plugins_deleted_message = __( 'The selected plugin has been deleted.' );
|
||||
} else {
|
||||
$plugins_deleted_message = __( 'The selected plugins have been deleted.' );
|
||||
}
|
||||
wp_admin_notice( $plugins_deleted_message, $updated_notice_args );
|
||||
}
|
||||
} elseif ( isset( $_GET['activate'] ) ) {
|
||||
wp_admin_notice( __( 'Plugin activated.' ), $updated_notice_args );
|
||||
} elseif ( isset( $_GET['activate-multi'] ) ) {
|
||||
wp_admin_notice( __( 'Selected plugins activated.' ), $updated_notice_args );
|
||||
} elseif ( isset( $_GET['deactivate'] ) ) {
|
||||
wp_admin_notice( __( 'Plugin deactivated.' ), $updated_notice_args );
|
||||
} elseif ( isset( $_GET['deactivate-multi'] ) ) {
|
||||
wp_admin_notice( __( 'Selected plugins deactivated.' ), $updated_notice_args );
|
||||
} elseif ( 'update-selected' === $action ) {
|
||||
wp_admin_notice( __( 'All selected plugins are up to date.' ), $updated_notice_args );
|
||||
} elseif ( isset( $_GET['resume'] ) ) {
|
||||
wp_admin_notice( __( 'Plugin resumed.' ), $updated_notice_args );
|
||||
} elseif ( isset( $_GET['enabled-auto-update'] ) ) {
|
||||
wp_admin_notice( __( 'Plugin will be auto-updated.' ), $updated_notice_args );
|
||||
} elseif ( isset( $_GET['disabled-auto-update'] ) ) {
|
||||
wp_admin_notice( __( 'Plugin will no longer be auto-updated.' ), $updated_notice_args );
|
||||
} elseif ( isset( $_GET['enabled-auto-update-multi'] ) ) {
|
||||
wp_admin_notice( __( 'Selected plugins will be auto-updated.' ), $updated_notice_args );
|
||||
} elseif ( isset( $_GET['disabled-auto-update-multi'] ) ) {
|
||||
wp_admin_notice( __( 'Selected plugins will no longer be auto-updated.' ), $updated_notice_args );
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1 class="wp-heading-inline">
|
||||
@@ -726,7 +749,7 @@ echo esc_html( $title );
|
||||
<?php
|
||||
if ( ( ! is_multisite() || is_network_admin() ) && current_user_can( 'install_plugins' ) ) {
|
||||
?>
|
||||
<a href="<?php echo esc_url( self_admin_url( 'plugin-install.php' ) ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'plugin' ); ?></a>
|
||||
<a href="<?php echo esc_url( self_admin_url( 'plugin-install.php' ) ); ?>" class="page-title-action"><?php echo esc_html__( 'Add New Plugin' ); ?></a>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user