diff --git a/wp-admin/js/theme.js b/wp-admin/js/theme.js
index d5618c4028..9b3db9a2c8 100644
--- a/wp-admin/js/theme.js
+++ b/wp-admin/js/theme.js
@@ -799,7 +799,7 @@ themes.view.Details = wp.Backbone.View.extend({
_this.model.set( { autoupdate: 'enable' === data.state } );
$( document ).off( 'wp-auto-update-setting-changed', callback );
}
- }
+ };
// Triggered in updates.js
$( document ).on( 'wp-auto-update-setting-changed', callback );
diff --git a/wp-admin/js/updates.js b/wp-admin/js/updates.js
index 222809500a..994e99d8e4 100644
--- a/wp-admin/js/updates.js
+++ b/wp-admin/js/updates.js
@@ -12,7 +12,6 @@
* @param {object} wp WP object.
* @param {object} settings WP Updates settings.
* @param {string} settings.ajax_nonce AJAX nonce.
- * @param {object} settings.l10n Translation strings.
* @param {object=} settings.plugins Base names of plugins in their different states.
* @param {Array} settings.plugins.all Base names of all plugins.
* @param {Array} settings.plugins.active Base names of active plugins.
@@ -27,7 +26,10 @@
* @param {number} settings.totals.count Holds the amount of available updates.
*/
(function( $, wp, settings ) {
- var $document = $( document );
+ var $document = $( document ),
+ __ = wp.i18n.__,
+ _x = wp.i18n._x,
+ sprintf = wp.i18n.sprintf;
wp = wp || {};
@@ -49,15 +51,6 @@
*/
wp.updates.ajaxNonce = settings.ajax_nonce;
- /**
- * Localized strings.
- *
- * @since 4.2.0
- *
- * @type {object}
- */
- wp.updates.l10n = settings.l10n;
-
/**
* Current search term.
*
@@ -381,23 +374,31 @@
if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
$updateRow = $( 'tr[data-plugin="' + args.plugin + '"]' );
$message = $updateRow.find( '.update-message' ).removeClass( 'notice-error' ).addClass( 'updating-message notice-warning' ).find( 'p' );
- message = wp.updates.l10n.pluginUpdatingLabel.replace( '%s', $updateRow.find( '.plugin-title strong' ).text() );
+ message = sprintf(
+ /* translators: %s: Plugin name and version. */
+ _x( 'Updating %s...', 'plugin' ),
+ $updateRow.find( '.plugin-title strong' ).text()
+ );
} else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
$card = $( '.plugin-card-' + args.slug );
$message = $card.find( '.update-now' ).addClass( 'updating-message' );
- message = wp.updates.l10n.pluginUpdatingLabel.replace( '%s', $message.data( 'name' ) );
+ message = sprintf(
+ /* translators: %s: Plugin name and version. */
+ _x( 'Updating %s...', 'plugin' ),
+ $message.data( 'name' )
+ );
// Remove previous error messages, if any.
$card.removeClass( 'plugin-card-update-failed' ).find( '.notice.notice-error' ).remove();
}
- if ( $message.html() !== wp.updates.l10n.updating ) {
+ if ( $message.html() !== __( 'Updating...' ) ) {
$message.data( 'originaltext', $message.html() );
}
$message
.attr( 'aria-label', message )
- .text( wp.updates.l10n.updating );
+ .text( __( 'Updating...' ) );
$document.trigger( 'wp-plugin-updating', args );
@@ -442,10 +443,17 @@
}
$updateMessage
- .attr( 'aria-label', wp.updates.l10n.pluginUpdatedLabel.replace( '%s', response.pluginName ) )
- .text( wp.updates.l10n.pluginUpdated );
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Plugin name and version. */
+ _x( '%s updated!', 'plugin' ),
+ response.pluginName
+ )
+ )
+ .text( _x( 'Updated!', 'plugin' ) );
- wp.a11y.speak( wp.updates.l10n.updatedMsg, 'polite' );
+ wp.a11y.speak( __( 'Update completed successfully.' ), 'polite' );
wp.updates.decrementCount( 'plugin' );
@@ -476,7 +484,11 @@
return;
}
- errorMessage = wp.updates.l10n.updateFailed.replace( '%s', response.errorMessage );
+ errorMessage = sprintf(
+ /* translators: %s: Error string for a failed update. */
+ __( 'Update Failed: %s' ),
+ response.errorMessage
+ );
if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
if ( response.plugin ) {
@@ -488,7 +500,14 @@
if ( response.pluginName ) {
$message.find( 'p' )
- .attr( 'aria-label', wp.updates.l10n.pluginUpdateFailedLabel.replace( '%s', response.pluginName ) );
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Plugin name and version. */
+ _x( '%s update failed', 'plugin' ),
+ response.pluginName
+ )
+ );
} else {
$message.find( 'p' ).removeAttr( 'aria-label' );
}
@@ -501,11 +520,19 @@
} ) );
$card.find( '.update-now' )
- .text( wp.updates.l10n.updateFailedShort ).removeClass( 'updating-message' );
+ .text( __( 'Update Failed!' ) )
+ .removeClass( 'updating-message' );
if ( response.pluginName ) {
$card.find( '.update-now' )
- .attr( 'aria-label', wp.updates.l10n.pluginUpdateFailedLabel.replace( '%s', response.pluginName ) );
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Plugin name and version. */
+ _x( '%s update failed', 'plugin' ),
+ response.pluginName
+ )
+ );
} else {
$card.find( '.update-now' ).removeAttr( 'aria-label' );
}
@@ -520,7 +547,7 @@
$card.find( '.update-now' )
.attr( 'aria-label', false )
- .text( wp.updates.l10n.updateNow );
+ .text( __( 'Update Now' ) );
}, 200 );
} );
}
@@ -555,16 +582,23 @@
$message = $( '[data-slug="' + args.slug + '"]' );
}
- if ( $message.html() !== wp.updates.l10n.installing ) {
+ if ( $message.html() !== __( 'Installing...' ) ) {
$message.data( 'originaltext', $message.html() );
}
$message
.addClass( 'updating-message' )
- .attr( 'aria-label', wp.updates.l10n.pluginInstallingLabel.replace( '%s', $message.data( 'name' ) ) )
- .text( wp.updates.l10n.installing );
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Plugin name and version. */
+ _x( 'Installing %s...', 'plugin' ),
+ $message.data( 'name' )
+ )
+ )
+ .text( __( 'Installing...' ) );
- wp.a11y.speak( wp.updates.l10n.installingMsg, 'polite' );
+ wp.a11y.speak( __( 'Installing... please wait.' ), 'polite' );
// Remove previous error messages, if any.
$card.removeClass( 'plugin-card-install-failed' ).find( '.notice.notice-error' ).remove();
@@ -590,10 +624,17 @@
$message
.removeClass( 'updating-message' )
.addClass( 'updated-message installed button-disabled' )
- .attr( 'aria-label', wp.updates.l10n.pluginInstalledLabel.replace( '%s', response.pluginName ) )
- .text( wp.updates.l10n.pluginInstalled );
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Plugin name and version. */
+ _x( '%s installed!', 'plugin' ),
+ response.pluginName
+ )
+ )
+ .text( _x( 'Installed!', 'plugin' ) );
- wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' );
+ wp.a11y.speak( __( 'Installation completed successfully.' ), 'polite' );
$document.trigger( 'wp-plugin-install-success', response );
@@ -601,10 +642,33 @@
setTimeout( function() {
// Transform the 'Install' button into an 'Activate' button.
- $message.removeClass( 'install-now installed button-disabled updated-message' ).addClass( 'activate-now button-primary' )
- .attr( 'href', response.activateUrl )
- .attr( 'aria-label', wp.updates.l10n.activatePluginLabel.replace( '%s', response.pluginName ) )
- .text( wp.updates.l10n.activatePlugin );
+ $message.removeClass( 'install-now installed button-disabled updated-message' )
+ .addClass( 'activate-now button-primary' )
+ .attr( 'href', response.activateUrl );
+
+ if ( 'plugins-network' === pagenow ) {
+ $message
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Plugin name. */
+ _x( 'Network Activate %s', 'plugin' ),
+ response.pluginName
+ )
+ )
+ .text( __( 'Network Activate' ) );
+ } else {
+ $message
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Plugin name. */
+ _x( 'Activate %s', 'plugin' ),
+ response.pluginName
+ )
+ )
+ .text( __( 'Activate' ) );
+ }
}, 1000 );
}
};
@@ -633,7 +697,11 @@
return;
}
- errorMessage = wp.updates.l10n.installFailed.replace( '%s', response.errorMessage );
+ errorMessage = sprintf(
+ /* translators: %s: Error string for a failed installation. */
+ __( 'Installation failed: %s' ),
+ response.errorMessage
+ );
$card
.addClass( 'plugin-card-update-failed' )
@@ -651,8 +719,15 @@
$button
.removeClass( 'updating-message' ).addClass( 'button-disabled' )
- .attr( 'aria-label', wp.updates.l10n.pluginInstallFailedLabel.replace( '%s', $button.data( 'name' ) ) )
- .text( wp.updates.l10n.installFailedShort );
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Plugin name and version. */
+ _x( '%s installation failed', 'plugin' ),
+ $button.data( 'name' )
+ )
+ )
+ .text( __( 'Installation Failed!' ) );
wp.a11y.speak( errorMessage, 'assertive' );
@@ -673,7 +748,11 @@
wp.updates.addAdminNotice( {
id: 'install-success',
className: 'notice-success is-dismissible',
- message: wp.updates.l10n.importerInstalledMsg.replace( '%s', response.activateUrl + '&from=import' )
+ message: sprintf(
+ /* translators: %s: Activation URL. */
+ __( 'Importer installed successfully. Run importer' ),
+ response.activateUrl + '&from=import'
+ )
} );
$( '[data-slug="' + response.slug + '"]' )
@@ -681,11 +760,15 @@
.addClass( 'activate-now' )
.attr({
'href': response.activateUrl + '&from=import',
- 'aria-label': wp.updates.l10n.activateImporterLabel.replace( '%s', response.pluginName )
+ 'aria-label':sprintf(
+ /* translators: %s: Importer name. */
+ __( 'Run %s' ),
+ response.pluginName
+ )
})
- .text( wp.updates.l10n.activateImporter );
+ .text( __( 'Run Importer' ) );
- wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' );
+ wp.a11y.speak( __( 'Installation completed successfully.' ), 'polite' );
$document.trigger( 'wp-importer-install-success', response );
};
@@ -702,7 +785,11 @@
* @param {string} response.errorMessage The error that occurred.
*/
wp.updates.installImporterError = function( response ) {
- var errorMessage = wp.updates.l10n.installFailed.replace( '%s', response.errorMessage ),
+ var errorMessage = sprintf(
+ /* translators: %s: Error string for a failed installation. */
+ __( 'Installation failed: %s' ),
+ response.errorMessage
+ ),
$installLink = $( '[data-slug="' + response.slug + '"]' ),
pluginName = $installLink.data( 'name' );
@@ -722,8 +809,15 @@
$installLink
.removeClass( 'updating-message' )
- .text( wp.updates.l10n.installNow )
- .attr( 'aria-label', wp.updates.l10n.pluginInstallNowLabel.replace( '%s', pluginName ) );
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Plugin name. */
+ _x( 'Install %s now', 'plugin' ),
+ pluginName
+ )
+ )
+ .text( __( 'Install Now' ) );
wp.a11y.speak( errorMessage, 'assertive' );
@@ -751,13 +845,13 @@
error: wp.updates.deletePluginError
}, args );
- if ( $link.html() !== wp.updates.l10n.deleting ) {
+ if ( $link.html() !== __( 'Deleting...' ) ) {
$link
.data( 'originaltext', $link.html() )
- .text( wp.updates.l10n.deleting );
+ .text( __( 'Deleting...' ) );
}
- wp.a11y.speak( wp.updates.l10n.deleting, 'polite' );
+ wp.a11y.speak( __( 'Deleting...' ), 'polite' );
$document.trigger( 'wp-plugin-deleting', args );
@@ -847,12 +941,12 @@
$views.find( '.all' ).remove();
if ( ! $form.find( 'tr.no-items' ).length ) {
- $form.find( '#the-list' ).append( '
| ' + wp.updates.l10n.noPlugins + ' |
' );
+ $form.find( '#the-list' ).append( '| ' + __( 'You do not appear to have any plugins available at this time.' ) + ' |
' );
}
}
} );
- wp.a11y.speak( wp.updates.l10n.pluginDeleted, 'polite' );
+ wp.a11y.speak( _x( 'Deleted!', 'plugin' ), 'polite' );
$document.trigger( 'wp-plugin-delete-success', response );
};
@@ -957,12 +1051,12 @@
$notice = $notice.addClass( 'updating-message' ).find( 'p' );
}
- if ( $notice.html() !== wp.updates.l10n.updating ) {
+ if ( $notice.html() !== __( 'Updating...' ) ) {
$notice.data( 'originaltext', $notice.html() );
}
- wp.a11y.speak( wp.updates.l10n.updatingMsg, 'polite' );
- $notice.text( wp.updates.l10n.updating );
+ wp.a11y.speak( __( 'Updating... please wait.' ), 'polite' );
+ $notice.text( __( 'Updating...' ) );
$document.trigger( 'wp-theme-updating', args );
@@ -986,7 +1080,7 @@
$theme = $( '[data-slug="' + response.slug + '"]' ),
updatedMessage = {
className: 'updated-message notice-success notice-alt',
- message: wp.updates.l10n.themeUpdated
+ message: _x( 'Updated!', 'theme' )
},
$notice, newText;
@@ -1023,7 +1117,7 @@
}
wp.updates.addAdminNotice( _.extend( { selector: $notice }, updatedMessage ) );
- wp.a11y.speak( wp.updates.l10n.updatedMsg, 'polite' );
+ wp.a11y.speak( __( 'Update completed successfully.' ), 'polite' );
wp.updates.decrementCount( 'theme' );
@@ -1047,7 +1141,11 @@
*/
wp.updates.updateThemeError = function( response ) {
var $theme = $( '[data-slug="' + response.slug + '"]' ),
- errorMessage = wp.updates.l10n.updateFailed.replace( '%s', response.errorMessage ),
+ errorMessage = sprintf(
+ /* translators: %s: Error string for a failed update. */
+ __( 'Update Failed: %s' ),
+ response.errorMessage
+ ),
$notice;
if ( ! wp.updates.isValidResponse( response, 'update' ) ) {
@@ -1103,14 +1201,22 @@
$message.addClass( 'updating-message' );
$message.parents( '.theme' ).addClass( 'focus' );
- if ( $message.html() !== wp.updates.l10n.installing ) {
+ if ( $message.html() !== __( 'Installing...' ) ) {
$message.data( 'originaltext', $message.html() );
}
$message
- .text( wp.updates.l10n.installing )
- .attr( 'aria-label', wp.updates.l10n.themeInstallingLabel.replace( '%s', $message.data( 'name' ) ) );
- wp.a11y.speak( wp.updates.l10n.installingMsg, 'polite' );
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Theme name and version. */
+ _x( 'Installing %s...', 'theme' ),
+ $message.data( 'name' )
+ )
+ )
+ .text( __( 'Installing...' ) );
+
+ wp.a11y.speak( __( 'Installing... please wait.' ), 'polite' );
// Remove previous error messages, if any.
$( '.install-theme-info, [data-slug="' + args.slug + '"]' ).removeClass( 'theme-install-failed' ).find( '.notice.notice-error' ).remove();
@@ -1139,10 +1245,17 @@
$message = $card.find( '.button-primary' )
.removeClass( 'updating-message' )
.addClass( 'updated-message disabled' )
- .attr( 'aria-label', wp.updates.l10n.themeInstalledLabel.replace( '%s', response.themeName ) )
- .text( wp.updates.l10n.themeInstalled );
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Theme name and version. */
+ _x( '%s installed!', 'theme' ),
+ response.themeName
+ )
+ )
+ .text( _x( 'Installed!', 'theme' ) );
- wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' );
+ wp.a11y.speak( __( 'Installation completed successfully.' ), 'polite' );
setTimeout( function() {
@@ -1152,9 +1265,31 @@
$message
.attr( 'href', response.activateUrl )
.removeClass( 'theme-install updated-message disabled' )
- .addClass( 'activate' )
- .attr( 'aria-label', wp.updates.l10n.activateThemeLabel.replace( '%s', response.themeName ) )
- .text( wp.updates.l10n.activateTheme );
+ .addClass( 'activate' );
+
+ if ( 'themes-network' === pagenow ) {
+ $message
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Theme name. */
+ _x( 'Network Activate %s', 'theme' ),
+ response.themeName
+ )
+ )
+ .text( __( 'Network Enable' ) );
+ } else {
+ $message
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Theme name. */
+ _x( 'Activate %s', 'theme' ),
+ response.themeName
+ )
+ )
+ .text( __( 'Activate' ) );
+ }
}
if ( response.customizeUrl ) {
@@ -1164,7 +1299,7 @@
return $( '' )
.attr( 'href', response.customizeUrl )
.addClass( 'button load-customize' )
- .text( wp.updates.l10n.livePreview );
+ .text( __( 'Live Preview' ) );
} );
}
}, 1000 );
@@ -1182,7 +1317,11 @@
*/
wp.updates.installThemeError = function( response ) {
var $card, $button,
- errorMessage = wp.updates.l10n.installFailed.replace( '%s', response.errorMessage ),
+ errorMessage = sprintf(
+ /* translators: %s: Error string for a failed installation. */
+ __( 'Installation failed: %s' ),
+ response.errorMessage
+ ),
$message = wp.updates.adminNotice( {
className: 'update-message notice-error notice-alt',
message: errorMessage
@@ -1217,8 +1356,15 @@
$button
.removeClass( 'updating-message' )
- .attr( 'aria-label', wp.updates.l10n.themeInstallFailedLabel.replace( '%s', $button.data( 'name' ) ) )
- .text( wp.updates.l10n.installFailedShort );
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Theme name and version. */
+ _x( '%s installation failed', 'theme' ),
+ $button.data( 'name' )
+ )
+ )
+ .text( __( 'Installation Failed!' ) );
wp.a11y.speak( errorMessage, 'assertive' );
@@ -1251,13 +1397,13 @@
error: wp.updates.deleteThemeError
}, args );
- if ( $button && $button.html() !== wp.updates.l10n.deleting ) {
+ if ( $button && $button.html() !== __( 'Deleting...' ) ) {
$button
.data( 'originaltext', $button.html() )
- .text( wp.updates.l10n.deleting );
+ .text( __( 'Deleting...' ) );
}
- wp.a11y.speak( wp.updates.l10n.deleting, 'polite' );
+ wp.a11y.speak( __( 'Deleting...' ), 'polite' );
// Remove previous error messages, if any.
$( '.theme-info .update-message' ).remove();
@@ -1320,7 +1466,7 @@
} );
}
- wp.a11y.speak( wp.updates.l10n.themeDeleted, 'polite' );
+ wp.a11y.speak( _x( 'Deleted!', 'theme' ), 'polite' );
$document.trigger( 'wp-theme-delete-success', response );
};
@@ -1340,7 +1486,11 @@
$button = $( '.theme-actions .delete-theme' ),
updateRow = wp.template( 'item-update-row' ),
$updateRow = $themeRow.siblings( '#' + response.slug + '-update' ),
- errorMessage = wp.updates.l10n.deleteFailed.replace( '%s', response.errorMessage ),
+ errorMessage = sprintf(
+ /* translators: %s: Error string for a failed deletion. */
+ __( 'Deletion failed: %s' ),
+ response.errorMessage
+ ),
$message = wp.updates.adminNotice( {
className: 'update-message notice-error notice-alt',
message: errorMessage
@@ -1631,8 +1781,8 @@
* 'update' or 'install'.
*/
wp.updates.isValidResponse = function( response, action ) {
- var error = wp.updates.l10n.unknownError,
- errorMessage;
+ var error = __( 'Something went wrong.' ),
+ errorMessage;
// Make sure the response is a valid data object and not a Promise object.
if ( _.isObject( response ) && ! _.isFunction( response.always ) ) {
@@ -1640,11 +1790,11 @@
}
if ( _.isString( response ) && '-1' === response ) {
- error = wp.updates.l10n.nonceError;
+ error = __( 'An error has occurred. Please reload the page and try again.' );
} else if ( _.isString( response ) ) {
error = response;
} else if ( 'undefined' !== typeof response.readyState && 0 === response.readyState ) {
- error = wp.updates.l10n.connectionError;
+ error = __( 'Connection lost or the server is busy. Please try again later.' );
} else if ( _.isString( response.responseText ) && '' !== response.responseText ) {
error = response.responseText;
} else if ( _.isString( response.statusText ) ) {
@@ -1653,15 +1803,18 @@
switch ( action ) {
case 'update':
- errorMessage = wp.updates.l10n.updateFailed;
+ /* translators: %s: Error string for a failed update. */
+ errorMessage = __( 'Update Failed: %s' );
break;
case 'install':
- errorMessage = wp.updates.l10n.installFailed;
+ /* translators: %s: Error string for a failed installation. */
+ errorMessage = __( 'Installation failed: %s' );
break;
case 'delete':
- errorMessage = wp.updates.l10n.deleteFailed;
+ /* translators: %s: Error string for a failed deletion. */
+ errorMessage = __( 'Deletion failed: %s' );
break;
}
@@ -1685,7 +1838,7 @@
.removeClass( 'updating-message' )
.removeAttr( 'aria-label' )
.prop( 'disabled', true )
- .text( wp.updates.l10n.updateFailedShort );
+ .text( __( 'Update Failed!' ) );
$( '.updating-message:not(.button):not(.thickbox)' )
.removeClass( 'updating-message notice-warning' )
@@ -1709,7 +1862,7 @@
*/
wp.updates.beforeunload = function() {
if ( wp.updates.ajaxLocked ) {
- return wp.updates.l10n.beforeunload;
+ return __( 'Updates may not complete if you navigate away from this page.' );
}
};
@@ -1822,14 +1975,28 @@
if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
if ( 'update-plugin' === job.action ) {
- $message.attr( 'aria-label', wp.updates.l10n.pluginUpdateNowLabel.replace( '%s', $message.data( 'name' ) ) );
+ $message.attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Plugin name and version. */
+ _x( 'Update %s now', 'plugin' ),
+ $message.data( 'name' )
+ )
+ );
} else if ( 'install-plugin' === job.action ) {
- $message.attr( 'aria-label', wp.updates.l10n.pluginInstallNowLabel.replace( '%s', $message.data( 'name' ) ) );
+ $message.attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Plugin name. */
+ _x( 'Install %s now', 'plugin' ),
+ $message.data( 'name' )
+ )
+ );
}
}
}
- wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
+ wp.a11y.speak( __( 'Update canceled.' ), 'polite' );
} );
/**
@@ -1905,9 +2072,9 @@
$message
.removeClass( 'updating-message' )
- .text( wp.updates.l10n.installNow );
+ .text( __( 'Install Now' ) );
- wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
+ wp.a11y.speak( __( 'Update canceled.' ), 'polite' );
} );
}
@@ -1940,10 +2107,17 @@
$button
.removeClass( 'updating-message' )
- .text( wp.updates.l10n.installNow )
- .attr( 'aria-label', wp.updates.l10n.pluginInstallNowLabel.replace( '%s', pluginName ) );
+ .attr(
+ 'aria-label',
+ sprintf(
+ /* translators: %s: Plugin name. */
+ _x( 'Install %s now', 'plugin' ),
+ pluginName
+ )
+ )
+ .text( __( 'Install Now' ) );
- wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
+ wp.a11y.speak( __( 'Update canceled.' ), 'polite' );
} );
}
@@ -1963,11 +2137,16 @@
* @param {Event} event Event interface.
*/
$bulkActionForm.on( 'click', '[data-plugin] a.delete', function( event ) {
- var $pluginRow = $( event.target ).parents( 'tr' );
+ var $pluginRow = $( event.target ).parents( 'tr' ),
+ confirmMessage = sprintf(
+ /* translators: %s: Plugin name. */
+ __( 'Are you sure you want to delete %s and its data?' ),
+ $pluginRow.find( '.plugin-title strong' ).text()
+ );
event.preventDefault();
- if ( ! window.confirm( wp.updates.l10n.aysDeleteUninstall.replace( '%s', $pluginRow.find( '.plugin-title strong' ).text() ) ) ) {
+ if ( ! window.confirm( confirmMessage ) ) {
return;
}
@@ -2014,11 +2193,16 @@
* @param {Event} event Event interface.
*/
$document.on( 'click', '.themes-php.network-admin a.delete', function( event ) {
- var $themeRow = $( event.target ).parents( 'tr' );
+ var $themeRow = $( event.target ).parents( 'tr' ),
+ confirmMessage = sprintf(
+ /* translators: %s: Theme name. */
+ __( 'Are you sure you want to delete %s?' ),
+ $themeRow.find( '.theme-title strong' ).text()
+ );
event.preventDefault();
- if ( ! window.confirm( wp.updates.l10n.aysDelete.replace( '%s', $themeRow.find( '.theme-title strong' ).text() ) ) ) {
+ if ( ! window.confirm( confirmMessage ) ) {
return;
}
@@ -2069,7 +2253,7 @@
return wp.updates.addAdminNotice( {
id: 'no-items-selected',
className: 'notice-error is-dismissible',
- message: wp.updates.l10n.noItemsSelected
+ message: __( 'Please select at least one item to perform this action on.' )
} );
}
@@ -2080,7 +2264,11 @@
break;
case 'delete-selected':
- if ( ! window.confirm( 'plugin' === type ? wp.updates.l10n.aysBulkDelete : wp.updates.l10n.aysBulkDeleteThemes ) ) {
+ var confirmMessage = 'plugin' === type ?
+ __( 'Are you sure you want to delete the selected plugins and their data?' ) :
+ __( 'Caution: These themes may be active on other sites in the network. Are you sure you want to proceed?' );
+
+ if ( ! window.confirm( confirmMessage ) ) {
event.preventDefault();
return;
}
@@ -2217,7 +2405,7 @@
.append( $( '', {
'class': 'current',
'href': searchLocation,
- 'text': wp.updates.l10n.searchResultsLabel
+ 'text': __( 'Search Results' )
} ) );
$( '.wp-filter .filter-links .current' )
@@ -2240,9 +2428,15 @@
delete wp.updates.searchRequest;
if ( 0 === response.count ) {
- wp.a11y.speak( wp.updates.l10n.noPluginsFound );
+ wp.a11y.speak( __( 'You do not appear to have any plugins available at this time.' ) );
} else {
- wp.a11y.speak( wp.updates.l10n.pluginsFound.replace( '%d', response.count ) );
+ wp.a11y.speak(
+ sprintf(
+ /* translators: %s: Number of plugins. */
+ __( 'Number of plugins found: %d' ),
+ response.count
+ )
+ );
}
} );
}, 1000 ) );
@@ -2298,7 +2492,12 @@
wp.updates.searchRequest = wp.ajax.post( 'search-plugins', data ).done( function( response ) {
// Can we just ditch this whole subtitle business?
- var $subTitle = $( '' ).addClass( 'subtitle' ).html( wp.updates.l10n.searchResults.replace( '%s', _.escape( data.s ) ) ),
+ var $subTitle = $( '' ).addClass( 'subtitle' ).html(
+ sprintf(
+ /* translators: %s: Search query. */
+ __( 'Search results for “%s”' ),
+ _.escape( data.s )
+ ) ),
$oldSubTitle = $( '.wrap .subtitle' );
if ( ! data.s.length ) {
@@ -2315,9 +2514,15 @@
delete wp.updates.searchRequest;
if ( 0 === response.count ) {
- wp.a11y.speak( wp.updates.l10n.noPluginsFound );
+ wp.a11y.speak( __( 'No plugins found. Try a different search.' ) );
} else {
- wp.a11y.speak( wp.updates.l10n.pluginsFound.replace( '%d', response.count ) );
+ wp.a11y.speak(
+ sprintf(
+ /* translators: %s: Number of plugins. */
+ __( 'Number of plugins found: %d' ),
+ response.count
+ )
+ );
}
} );
}, 500 ) );
@@ -2518,9 +2723,9 @@
// Show loading status.
if ( 'enable' === action ) {
- $label.text( wp.updates.l10n.autoUpdatesEnabling );
+ $label.text( __( 'Enabling...' ) );
} else {
- $label.text( wp.updates.l10n.autoUpdatesDisabling );
+ $label.text( __( 'Disabling...' ) );
}
$anchor.find( '.dashicons-update' ).removeClass( 'hidden' );
@@ -2544,7 +2749,7 @@
if ( response.data && response.data.error ) {
errorMessage = response.data.error;
} else {
- errorMessage = wp.updates.l10n.autoUpdatesError;
+ errorMessage = __( 'The request could not be completed.' );
}
$parent.find( '.notice.error' ).removeClass( 'hidden' ).find( 'p' ).text( errorMessage );
@@ -2585,9 +2790,9 @@
href: href
} );
- $label.text( wp.updates.l10n.autoUpdatesDisable );
+ $label.text( __( 'Disable auto-updates' ) );
$parent.find( '.auto-update-time' ).removeClass( 'hidden' );
- wp.a11y.speak( wp.updates.l10n.autoUpdatesEnabled, 'polite' );
+ wp.a11y.speak( __( 'Enable auto-updates' ), 'polite' );
} else {
href = href.replace( 'action=disable-auto-update', 'action=enable-auto-update' );
$anchor.attr( {
@@ -2595,16 +2800,20 @@
href: href
} );
- $label.text( wp.updates.l10n.autoUpdatesEnable );
+ $label.text( __( 'Enable auto-updates' ) );
$parent.find( '.auto-update-time' ).addClass( 'hidden' );
- wp.a11y.speak( wp.updates.l10n.autoUpdatesDisabled, 'polite' );
+ wp.a11y.speak( __( 'Auto-updates disabled' ), 'polite' );
}
$document.trigger( 'wp-auto-update-setting-changed', { state: action, type: type, asset: asset } );
} )
.fail( function() {
- $parent.find( '.notice.error' ).removeClass( 'hidden' ).find( 'p' ).text( wp.updates.l10n.autoUpdatesError );
- wp.a11y.speak( wp.updates.l10n.autoUpdatesError, 'polite' );
+ $parent.find( '.notice.error' )
+ .removeClass( 'hidden' )
+ .find( 'p' )
+ .text( __( 'The request could not be completed.' ) );
+
+ wp.a11y.speak( __( 'The request could not be completed.' ), 'polite' );
} )
.always( function() {
$anchor.removeAttr( 'data-doing-ajax' ).find( '.dashicons-update' ).addClass( 'hidden' );
diff --git a/wp-admin/js/updates.min.js b/wp-admin/js/updates.min.js
index e0d051a67c..771e2f15c7 100644
--- a/wp-admin/js/updates.min.js
+++ b/wp-admin/js/updates.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-!function(g,m,h){var f=g(document);(m=m||{}).updates={},m.updates.ajaxNonce=h.ajax_nonce,m.updates.l10n=h.l10n,m.updates.searchTerm="",m.updates.shouldRequestFilesystemCredentials=!1,m.updates.filesystemCredentials={ftp:{host:"",username:"",password:"",connectionType:""},ssh:{publicKey:"",privateKey:""},fsNonce:"",available:!1},m.updates.ajaxLocked=!1,m.updates.adminNotice=m.template("wp-updates-admin-notice"),m.updates.queue=[],m.updates.$elToReturnFocusToFromCredentialsModal=void 0,m.updates.addAdminNotice=function(e){var t,a=g(e.selector),s=g(".wp-header-end");delete e.selector,t=m.updates.adminNotice(e),a.length||(a=g("#"+e.id)),a.length?a.replaceWith(t):s.length?s.after(t):"customize"===pagenow?g(".customize-themes-notifications").append(t):g(".wrap").find("> h1").after(t),f.trigger("wp-updates-notice-added")},m.updates.ajax=function(e,t){var a={};return m.updates.ajaxLocked?(m.updates.queue.push({action:e,data:t}),g.Deferred()):(m.updates.ajaxLocked=!0,t.success&&(a.success=t.success,delete t.success),t.error&&(a.error=t.error,delete t.error),a.data=_.extend(t,{action:e,_ajax_nonce:m.updates.ajaxNonce,_fs_nonce:m.updates.filesystemCredentials.fsNonce,username:m.updates.filesystemCredentials.ftp.username,password:m.updates.filesystemCredentials.ftp.password,hostname:m.updates.filesystemCredentials.ftp.hostname,connection_type:m.updates.filesystemCredentials.ftp.connectionType,public_key:m.updates.filesystemCredentials.ssh.publicKey,private_key:m.updates.filesystemCredentials.ssh.privateKey}),m.ajax.send(a).always(m.updates.ajaxAlways))},m.updates.ajaxAlways=function(e){e.errorCode&&"unable_to_connect_to_filesystem"===e.errorCode||(m.updates.ajaxLocked=!1,m.updates.queueChecker()),void 0!==e.debug&&window.console&&window.console.log&&_.map(e.debug,function(e){window.console.log(m.sanitize.stripTagsAndEncodeText(e))})},m.updates.refreshCount=function(){var e,t=g("#wp-admin-bar-updates"),a=g('a[href="update-core.php"] .update-plugins'),s=g('a[href="plugins.php"] .update-plugins'),n=g('a[href="themes.php"] .update-plugins');t.find(".ab-item").removeAttr("title"),t.find(".ab-label").text(h.totals.counts.total),0===h.totals.counts.total&&t.find(".ab-label").parents("li").remove(),a.each(function(e,t){t.className=t.className.replace(/count-\d+/,"count-"+h.totals.counts.total)}),0'+t+"
"),a.on("click",".notice.is-dismissible .notice-dismiss",function(){setTimeout(function(){a.removeClass("plugin-card-update-failed").find(".column-name a").focus()},200)}),s.removeClass("updating-message").addClass("button-disabled").attr("aria-label",m.updates.l10n.pluginInstallFailedLabel.replace("%s",s.data("name"))).text(m.updates.l10n.installFailedShort),m.a11y.speak(t,"assertive"),f.trigger("wp-plugin-install-error",e)))},m.updates.installImporterSuccess=function(e){m.updates.addAdminNotice({id:"install-success",className:"notice-success is-dismissible",message:m.updates.l10n.importerInstalledMsg.replace("%s",e.activateUrl+"&from=import")}),g('[data-slug="'+e.slug+'"]').removeClass("install-now updating-message").addClass("activate-now").attr({href:e.activateUrl+"&from=import","aria-label":m.updates.l10n.activateImporterLabel.replace("%s",e.pluginName)}).text(m.updates.l10n.activateImporter),m.a11y.speak(m.updates.l10n.installedMsg,"polite"),f.trigger("wp-importer-install-success",e)},m.updates.installImporterError=function(e){var t=m.updates.l10n.installFailed.replace("%s",e.errorMessage),a=g('[data-slug="'+e.slug+'"]'),s=a.data("name");m.updates.isValidResponse(e,"install")&&(m.updates.maybeHandleCredentialError(e,"install-plugin")||(m.updates.addAdminNotice({id:e.errorCode,className:"notice-error is-dismissible",message:t}),a.removeClass("updating-message").text(m.updates.l10n.installNow).attr("aria-label",m.updates.l10n.pluginInstallNowLabel.replace("%s",s)),m.a11y.speak(t,"assertive"),f.trigger("wp-importer-install-error",e)))},m.updates.deletePlugin=function(e){var t=g('[data-plugin="'+e.plugin+'"]').find(".row-actions a.delete");return e=_.extend({success:m.updates.deletePluginSuccess,error:m.updates.deletePluginError},e),t.html()!==m.updates.l10n.deleting&&t.data("originaltext",t.html()).text(m.updates.l10n.deleting),m.a11y.speak(m.updates.l10n.deleting,"polite"),f.trigger("wp-plugin-deleting",e),m.updates.ajax("delete-plugin",e)},m.updates.deletePluginSuccess=function(i){g('[data-plugin="'+i.plugin+'"]').css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var e=g("#bulk-action-form"),t=g(".subsubsub"),a=g(this),s=e.find("thead th:not(.hidden), thead td").length,n=m.template("item-deleted-row"),l=h.plugins;a.hasClass("plugin-update-tr")||a.after(n({slug:i.slug,plugin:i.plugin,colspan:s,name:i.pluginName})),a.remove(),-1!==_.indexOf(l.upgrade,i.plugin)&&(l.upgrade=_.without(l.upgrade,i.plugin),m.updates.decrementCount("plugin")),-1!==_.indexOf(l.inactive,i.plugin)&&(l.inactive=_.without(l.inactive,i.plugin),l.inactive.length?t.find(".inactive .count").text("("+l.inactive.length+")"):t.find(".inactive").remove()),-1!==_.indexOf(l.active,i.plugin)&&(l.active=_.without(l.active,i.plugin),l.active.length?t.find(".active .count").text("("+l.active.length+")"):t.find(".active").remove()),-1!==_.indexOf(l.recently_activated,i.plugin)&&(l.recently_activated=_.without(l.recently_activated,i.plugin),l.recently_activated.length?t.find(".recently_activated .count").text("("+l.recently_activated.length+")"):t.find(".recently_activated").remove()),l.all=_.without(l.all,i.plugin),l.all.length?t.find(".all .count").text("("+l.all.length+")"):(e.find(".tablenav").css({visibility:"hidden"}),t.find(".all").remove(),e.find("tr.no-items").length||e.find("#the-list").append('| '+m.updates.l10n.noPlugins+" |
"))}),m.a11y.speak(m.updates.l10n.pluginDeleted,"polite"),f.trigger("wp-plugin-delete-success",i)},m.updates.deletePluginError=function(e){var t,a,s=m.template("item-update-row"),n=m.updates.adminNotice({className:"update-message notice-error notice-alt",message:e.errorMessage});a=e.plugin?(t=g('tr.inactive[data-plugin="'+e.plugin+'"]')).siblings('[data-plugin="'+e.plugin+'"]'):(t=g('tr.inactive[data-slug="'+e.slug+'"]')).siblings('[data-slug="'+e.slug+'"]'),m.updates.isValidResponse(e,"delete")&&(m.updates.maybeHandleCredentialError(e,"delete-plugin")||(a.length?(a.find(".notice-error").remove(),a.find(".plugin-update").append(n)):t.addClass("update").after(s({slug:e.slug,plugin:e.plugin||e.slug,colspan:g("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:n})),f.trigger("wp-plugin-delete-error",e)))},m.updates.updateTheme=function(e){var t;return e=_.extend({success:m.updates.updateThemeSuccess,error:m.updates.updateThemeError},e),(t="themes-network"===pagenow?g('[data-slug="'+e.slug+'"]').find(".update-message").removeClass("notice-error").addClass("updating-message notice-warning").find("p"):"customize"===pagenow?((t=g('[data-slug="'+e.slug+'"].notice').removeClass("notice-large")).find("h3").remove(),(t=t.add(g("#customize-control-installed_theme_"+e.slug).find(".update-message"))).addClass("updating-message").find("p")):((t=g("#update-theme").closest(".notice").removeClass("notice-large")).find("h3").remove(),(t=t.add(g('[data-slug="'+e.slug+'"]').find(".update-message"))).addClass("updating-message").find("p"))).html()!==m.updates.l10n.updating&&t.data("originaltext",t.html()),m.a11y.speak(m.updates.l10n.updatingMsg,"polite"),t.text(m.updates.l10n.updating),f.trigger("wp-theme-updating",e),m.updates.ajax("update-theme",e)},m.updates.updateThemeSuccess=function(e){var t,a,s=g("body.modal-open").length,n=g('[data-slug="'+e.slug+'"]'),l={className:"updated-message notice-success notice-alt",message:m.updates.l10n.themeUpdated};"customize"===pagenow?((n=g(".updating-message").siblings(".theme-name")).length&&(a=n.html().replace(e.oldVersion,e.newVersion),n.html(a)),t=g(".theme-info .notice").add(m.customize.control("installed_theme_"+e.slug).container.find(".theme").find(".update-message"))):"themes-network"===pagenow?(t=n.find(".update-message"),a=n.find(".theme-version-author-uri").html().replace(e.oldVersion,e.newVersion),n.find(".theme-version-author-uri").html(a),n.find(".auto-update-time").empty()):(t=g(".theme-info .notice").add(n.find(".update-message")),s?(g(".load-customize:visible").focus(),g(".theme-info .theme-autoupdate").find(".auto-update-time").empty()):n.find(".load-customize").focus()),m.updates.addAdminNotice(_.extend({selector:t},l)),m.a11y.speak(m.updates.l10n.updatedMsg,"polite"),m.updates.decrementCount("theme"),f.trigger("wp-theme-update-success",e),s&&"customize"!==pagenow&&g(".theme-info .theme-author").after(m.updates.adminNotice(l))},m.updates.updateThemeError=function(e){var t,a=g('[data-slug="'+e.slug+'"]'),s=m.updates.l10n.updateFailed.replace("%s",e.errorMessage);m.updates.isValidResponse(e,"update")&&(m.updates.maybeHandleCredentialError(e,"update-theme")||("customize"===pagenow&&(a=m.customize.control("installed_theme_"+e.slug).container.find(".theme")),"themes-network"===pagenow?t=a.find(".update-message "):(t=g(".theme-info .notice").add(a.find(".notice")),g("body.modal-open").length?g(".load-customize:visible").focus():a.find(".load-customize").focus()),m.updates.addAdminNotice({selector:t,className:"update-message notice-error notice-alt is-dismissible",message:s}),m.a11y.speak(s,"polite"),f.trigger("wp-theme-update-error",e)))},m.updates.installTheme=function(e){var t=g('.theme-install[data-slug="'+e.slug+'"]');return e=_.extend({success:m.updates.installThemeSuccess,error:m.updates.installThemeError},e),t.addClass("updating-message"),t.parents(".theme").addClass("focus"),t.html()!==m.updates.l10n.installing&&t.data("originaltext",t.html()),t.text(m.updates.l10n.installing).attr("aria-label",m.updates.l10n.themeInstallingLabel.replace("%s",t.data("name"))),m.a11y.speak(m.updates.l10n.installingMsg,"polite"),g('.install-theme-info, [data-slug="'+e.slug+'"]').removeClass("theme-install-failed").find(".notice.notice-error").remove(),f.trigger("wp-theme-installing",e),m.updates.ajax("install-theme",e)},m.updates.installThemeSuccess=function(e){var t,a=g(".wp-full-overlay-header, [data-slug="+e.slug+"]");f.trigger("wp-theme-install-success",e),t=a.find(".button-primary").removeClass("updating-message").addClass("updated-message disabled").attr("aria-label",m.updates.l10n.themeInstalledLabel.replace("%s",e.themeName)).text(m.updates.l10n.themeInstalled),m.a11y.speak(m.updates.l10n.installedMsg,"polite"),setTimeout(function(){e.activateUrl&&t.attr("href",e.activateUrl).removeClass("theme-install updated-message disabled").addClass("activate").attr("aria-label",m.updates.l10n.activateThemeLabel.replace("%s",e.themeName)).text(m.updates.l10n.activateTheme),e.customizeUrl&&t.siblings(".preview").replaceWith(function(){return g("").attr("href",e.customizeUrl).addClass("button load-customize").text(m.updates.l10n.livePreview)})},1e3)},m.updates.installThemeError=function(e){var t,a=m.updates.l10n.installFailed.replace("%s",e.errorMessage),s=m.updates.adminNotice({className:"update-message notice-error notice-alt",message:a});m.updates.isValidResponse(e,"install")&&(m.updates.maybeHandleCredentialError(e,"install-theme")||("customize"===pagenow?(f.find("body").hasClass("modal-open")?(t=g('.theme-install[data-slug="'+e.slug+'"]'),g(".theme-overlay .theme-info").prepend(s)):(t=g('.theme-install[data-slug="'+e.slug+'"]')).closest(".theme").addClass("theme-install-failed").append(s),m.customize.notifications.remove("theme_installing")):f.find("body").hasClass("full-overlay-active")?(t=g('.theme-install[data-slug="'+e.slug+'"]'),g(".install-theme-info").prepend(s)):t=g('[data-slug="'+e.slug+'"]').removeClass("focus").addClass("theme-install-failed").append(s).find(".theme-install"),t.removeClass("updating-message").attr("aria-label",m.updates.l10n.themeInstallFailedLabel.replace("%s",t.data("name"))).text(m.updates.l10n.installFailedShort),m.a11y.speak(a,"assertive"),f.trigger("wp-theme-install-error",e)))},m.updates.deleteTheme=function(e){var t;return"themes"===pagenow?t=g(".theme-actions .delete-theme"):"themes-network"===pagenow&&(t=g('[data-slug="'+e.slug+'"]').find(".row-actions a.delete")),e=_.extend({success:m.updates.deleteThemeSuccess,error:m.updates.deleteThemeError},e),t&&t.html()!==m.updates.l10n.deleting&&t.data("originaltext",t.html()).text(m.updates.l10n.deleting),m.a11y.speak(m.updates.l10n.deleting,"polite"),g(".theme-info .update-message").remove(),f.trigger("wp-theme-deleting",e),m.updates.ajax("delete-theme",e)},m.updates.deleteThemeSuccess=function(n){var e=g('[data-slug="'+n.slug+'"]');"themes-network"===pagenow&&e.css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var e=g(".subsubsub"),t=g(this),a=h.themes,s=m.template("item-deleted-row");t.hasClass("plugin-update-tr")||t.after(s({slug:n.slug,colspan:g("#bulk-action-form").find("thead th:not(.hidden), thead td").length,name:t.find(".theme-title strong").text()})),t.remove(),t.hasClass("update")&&(a.upgrade--,m.updates.decrementCount("theme")),t.hasClass("inactive")&&(a.disabled--,a.disabled?e.find(".disabled .count").text("("+a.disabled+")"):e.find(".disabled").remove()),e.find(".all .count").text("("+--a.all+")")}),m.a11y.speak(m.updates.l10n.themeDeleted,"polite"),f.trigger("wp-theme-delete-success",n)},m.updates.deleteThemeError=function(e){var t=g('tr.inactive[data-slug="'+e.slug+'"]'),a=g(".theme-actions .delete-theme"),s=m.template("item-update-row"),n=t.siblings("#"+e.slug+"-update"),l=m.updates.l10n.deleteFailed.replace("%s",e.errorMessage),i=m.updates.adminNotice({className:"update-message notice-error notice-alt",message:l});m.updates.maybeHandleCredentialError(e,"delete-theme")||("themes-network"===pagenow?n.length?(n.find(".notice-error").remove(),n.find(".plugin-update").append(i)):t.addClass("update").after(s({slug:e.slug,colspan:g("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:i})):g(".theme-info .theme-description").before(i),a.html(a.data("originaltext")),m.a11y.speak(l,"assertive"),f.trigger("wp-theme-delete-error",e))},m.updates._addCallbacks=function(e,t){return"import"===pagenow&&"install-plugin"===t&&(e.success=m.updates.installImporterSuccess,e.error=m.updates.installImporterError),e},m.updates.queueChecker=function(){var e;if(!m.updates.ajaxLocked&&m.updates.queue.length)switch((e=m.updates.queue.shift()).action){case"install-plugin":m.updates.installPlugin(e.data);break;case"update-plugin":m.updates.updatePlugin(e.data);break;case"delete-plugin":m.updates.deletePlugin(e.data);break;case"install-theme":m.updates.installTheme(e.data);break;case"update-theme":m.updates.updateTheme(e.data);break;case"delete-theme":m.updates.deleteTheme(e.data)}},m.updates.requestFilesystemCredentials=function(e){!1===m.updates.filesystemCredentials.available&&(e&&!m.updates.$elToReturnFocusToFromCredentialsModal&&(m.updates.$elToReturnFocusToFromCredentialsModal=g(e.target)),m.updates.ajaxLocked=!0,m.updates.requestForCredentialsModalOpen())},m.updates.maybeRequestFilesystemCredentials=function(e){m.updates.shouldRequestFilesystemCredentials&&!m.updates.ajaxLocked&&m.updates.requestFilesystemCredentials(e)},m.updates.keydown=function(e){27===e.keyCode?m.updates.requestForCredentialsModalCancel():9===e.keyCode&&("upgrade"!==e.target.id||e.shiftKey?"hostname"===e.target.id&&e.shiftKey&&(g("#upgrade").focus(),e.preventDefault()):(g("#hostname").focus(),e.preventDefault()))},m.updates.requestForCredentialsModalOpen=function(){var e=g("#request-filesystem-credentials-dialog");g("body").addClass("modal-open"),e.show(),e.find("input:enabled:first").focus(),e.on("keydown",m.updates.keydown)},m.updates.requestForCredentialsModalClose=function(){g("#request-filesystem-credentials-dialog").hide(),g("body").removeClass("modal-open"),m.updates.$elToReturnFocusToFromCredentialsModal&&m.updates.$elToReturnFocusToFromCredentialsModal.focus()},m.updates.requestForCredentialsModalCancel=function(){(m.updates.ajaxLocked||m.updates.queue.length)&&(_.each(m.updates.queue,function(e){f.trigger("credential-modal-cancel",e)}),m.updates.ajaxLocked=!1,m.updates.queue=[],m.updates.requestForCredentialsModalClose())},m.updates.showErrorInCredentialsForm=function(e){var t=g("#request-filesystem-credentials-form");t.find(".notice").remove(),t.find("#request-filesystem-credentials-title").after('")},m.updates.credentialError=function(e,t){e=m.updates._addCallbacks(e,t),m.updates.queue.unshift({action:t,data:e}),m.updates.filesystemCredentials.available=!1,m.updates.showErrorInCredentialsForm(e.errorMessage),m.updates.requestFilesystemCredentials()},m.updates.maybeHandleCredentialError=function(e,t){return!(!m.updates.shouldRequestFilesystemCredentials||!e.errorCode||"unable_to_connect_to_filesystem"!==e.errorCode)&&(m.updates.credentialError(e,t),!0)},m.updates.isValidResponse=function(e,t){var a,s=m.updates.l10n.unknownError;if(_.isObject(e)&&!_.isFunction(e.always))return!0;switch(_.isString(e)&&"-1"===e?s=m.updates.l10n.nonceError:_.isString(e)?s=e:void 0!==e.readyState&&0===e.readyState?s=m.updates.l10n.connectionError:_.isString(e.responseText)&&""!==e.responseText?s=e.responseText:_.isString(e.statusText)&&(s=e.statusText),t){case"update":a=m.updates.l10n.updateFailed;break;case"install":a=m.updates.l10n.installFailed;break;case"delete":a=m.updates.l10n.deleteFailed}return s=s.replace(/<[\/a-z][^<>]*>/gi,""),a=a.replace("%s",s),m.updates.addAdminNotice({id:"unknown_error",className:"notice-error is-dismissible",message:_.escape(a)}),m.updates.ajaxLocked=!1,m.updates.queue=[],g(".button.updating-message").removeClass("updating-message").removeAttr("aria-label").prop("disabled",!0).text(m.updates.l10n.updateFailedShort),g(".updating-message:not(.button):not(.thickbox)").removeClass("updating-message notice-warning").addClass("notice-error").find("p").removeAttr("aria-label").text(a),m.a11y.speak(a,"assertive"),!1},m.updates.beforeunload=function(){if(m.updates.ajaxLocked)return m.updates.l10n.beforeunload},g(function(){var l=g("#plugin-filter"),r=g("#bulk-action-form"),e=g("#request-filesystem-credentials-form"),t=g("#request-filesystem-credentials-dialog"),a=g(".plugins-php .wp-filter-search"),s=g(".plugin-install-php .wp-filter-search");(h=_.extend(h,window._wpUpdatesItemCounts||{})).totals&&m.updates.refreshCount(),m.updates.shouldRequestFilesystemCredentials=0").html(a.find("p").data("originaltext"))),a.removeClass("updating-message").html(s),"plugin-install"!==pagenow&&"plugin-install-network"!==pagenow||("update-plugin"===t.action?a.attr("aria-label",m.updates.l10n.pluginUpdateNowLabel.replace("%s",a.data("name"))):"install-plugin"===t.action&&a.attr("aria-label",m.updates.l10n.pluginInstallNowLabel.replace("%s",a.data("name"))))),m.a11y.speak(m.updates.l10n.updateCancel,"polite")}),r.on("click","[data-plugin] .update-link",function(e){var t=g(e.target),a=t.parents("tr");e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(m.updates.maybeRequestFilesystemCredentials(e),m.updates.$elToReturnFocusToFromCredentialsModal=a.find(".check-column input"),m.updates.updatePlugin({plugin:a.data("plugin"),slug:a.data("slug")}))}),l.on("click",".update-now",function(e){var t=g(e.target);e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(m.updates.maybeRequestFilesystemCredentials(e),m.updates.updatePlugin({plugin:t.data("plugin"),slug:t.data("slug")}))}),l.on("click",".install-now",function(e){var t=g(e.target);e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(m.updates.shouldRequestFilesystemCredentials&&!m.updates.ajaxLocked&&(m.updates.requestFilesystemCredentials(e),f.on("credential-modal-cancel",function(){g(".install-now.updating-message").removeClass("updating-message").text(m.updates.l10n.installNow),m.a11y.speak(m.updates.l10n.updateCancel,"polite")})),m.updates.installPlugin({slug:t.data("slug")}))}),f.on("click",".importer-item .install-now",function(e){var t=g(e.target),a=g(this).data("name");e.preventDefault(),t.hasClass("updating-message")||(m.updates.shouldRequestFilesystemCredentials&&!m.updates.ajaxLocked&&(m.updates.requestFilesystemCredentials(e),f.on("credential-modal-cancel",function(){t.removeClass("updating-message").text(m.updates.l10n.installNow).attr("aria-label",m.updates.l10n.pluginInstallNowLabel.replace("%s",a)),m.a11y.speak(m.updates.l10n.updateCancel,"polite")})),m.updates.installPlugin({slug:t.data("slug"),pagenow:pagenow,success:m.updates.installImporterSuccess,error:m.updates.installImporterError}))}),r.on("click","[data-plugin] a.delete",function(e){var t=g(e.target).parents("tr");e.preventDefault(),window.confirm(m.updates.l10n.aysDeleteUninstall.replace("%s",t.find(".plugin-title strong").text()))&&(m.updates.maybeRequestFilesystemCredentials(e),m.updates.deletePlugin({plugin:t.data("plugin"),slug:t.data("slug")}))}),f.on("click",".themes-php.network-admin .update-link",function(e){var t=g(e.target),a=t.parents("tr");e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(m.updates.maybeRequestFilesystemCredentials(e),m.updates.$elToReturnFocusToFromCredentialsModal=a.find(".check-column input"),m.updates.updateTheme({slug:a.data("slug")}))}),f.on("click",".themes-php.network-admin a.delete",function(e){var t=g(e.target).parents("tr");e.preventDefault(),window.confirm(m.updates.l10n.aysDelete.replace("%s",t.find(".theme-title strong").text()))&&(m.updates.maybeRequestFilesystemCredentials(e),m.updates.deleteTheme({slug:t.data("slug")}))}),r.on("click",'[type="submit"]:not([name="clear-recent-list"])',function(e){var t,n,l=g(e.target).siblings("select").val(),a=r.find('input[name="checked[]"]:checked'),i=0,d=0,u=[];switch(pagenow){case"plugins":case"plugins-network":t="plugin";break;case"themes-network":t="theme";break;default:return}if(!a.length)return e.preventDefault(),g("html, body").animate({scrollTop:0}),m.updates.addAdminNotice({id:"no-items-selected",className:"notice-error is-dismissible",message:m.updates.l10n.noItemsSelected});switch(l){case"update-selected":n=l.replace("selected",t);break;case"delete-selected":if(!window.confirm("plugin"===t?m.updates.l10n.aysBulkDelete:m.updates.l10n.aysBulkDeleteThemes))return void e.preventDefault();n=l.replace("selected",t);break;default:return}m.updates.maybeRequestFilesystemCredentials(e),e.preventDefault(),r.find('.manage-column [type="checkbox"]').prop("checked",!1),f.trigger("wp-"+t+"-bulk-"+l,a),a.each(function(e,t){var a=g(t),s=a.parents("tr");"update-selected"!==l||s.hasClass("update")&&!s.find("notice-error").length?m.updates.queue.push({action:n,data:{plugin:s.data("plugin"),slug:s.data("slug")}}):a.prop("checked",!1)}),f.on("wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error",function(e,t){var a,s,n=g('[data-slug="'+t.slug+'"]');"wp-"+t.update+"-update-success"===e.type?i++:(s=t.pluginName?t.pluginName:n.find(".column-primary strong").text(),d++,u.push(s+": "+t.errorMessage)),n.find('input[name="checked[]"]:checked').prop("checked",!1),m.updates.adminNotice=m.template("wp-bulk-updates-admin-notice"),m.updates.addAdminNotice({id:"bulk-action-notice",className:"bulk-action-notice",successes:i,errors:d,errorMessages:u,type:t.update}),a=g("#bulk-action-notice").on("click","button",function(){g(this).toggleClass("bulk-action-errors-collapsed").attr("aria-expanded",!g(this).hasClass("bulk-action-errors-collapsed")),a.find(".bulk-action-errors").toggleClass("hidden")}),0').append(g("",{class:"current",href:s,text:m.updates.l10n.searchResultsLabel})),g(".wp-filter .filter-links .current").removeClass("current").parents(".filter-links").prepend(n),l.prev("p").remove(),g(".plugins-popular-tags-wrapper").remove()),void 0!==m.updates.searchRequest&&m.updates.searchRequest.abort(),g("body").addClass("loading-content"),m.updates.searchRequest=m.ajax.post("search-install-plugins",a).done(function(e){g("body").removeClass("loading-content"),l.append(e.items),delete m.updates.searchRequest,0===e.count?m.a11y.speak(m.updates.l10n.noPluginsFound):m.a11y.speak(m.updates.l10n.pluginsFound.replace("%d",e.count))}))},1e3)),a.length&&a.attr("aria-describedby","live-search-desc"),a.on("keyup input",_.debounce(function(e){var t,s={_ajax_nonce:m.updates.ajaxNonce,s:e.target.value,pagenow:pagenow,plugin_status:"all"};"keyup"===e.type&&27===e.which&&(e.target.value=""),m.updates.searchTerm!==s.s&&(m.updates.searchTerm=s.s,t=_.object(_.compact(_.map(location.search.slice(1).split("&"),function(e){if(e)return e.split("=")}))),s.plugin_status=t.plugin_status||"all",window.history&&window.history.replaceState&&window.history.replaceState(null,"",location.href.split("?")[0]+"?s="+s.s+"&plugin_status="+s.plugin_status),void 0!==m.updates.searchRequest&&m.updates.searchRequest.abort(),r.empty(),g("body").addClass("loading-content"),g(".subsubsub .current").removeClass("current"),m.updates.searchRequest=m.ajax.post("search-plugins",s).done(function(e){var t=g("").addClass("subtitle").html(m.updates.l10n.searchResults.replace("%s",_.escape(s.s))),a=g(".wrap .subtitle");s.s.length?a.length?a.replaceWith(t):g(".wp-header-end").before(t):(a.remove(),g(".subsubsub ."+s.plugin_status+" a").addClass("current")),g("body").removeClass("loading-content"),r.append(e.items),delete m.updates.searchRequest,0===e.count?m.a11y.speak(m.updates.l10n.noPluginsFound):m.a11y.speak(m.updates.l10n.pluginsFound.replace("%d",e.count))}))},500)),f.on("submit",".search-plugins",function(e){e.preventDefault(),g("input.wp-filter-search").trigger("input")}),f.on("click",".try-again",function(e){e.preventDefault(),s.trigger("input")}),g("#typeselector").on("change",function(){var e=g('input[name="s"]');e.val().length&&e.trigger("input","typechange")}),g("#plugin_update_from_iframe").on("click",function(e){var t,a=window.parent===window?null:window.parent;g.support.postMessage=!!window.postMessage,!1!==g.support.postMessage&&null!==a&&-1===window.parent.location.pathname.indexOf("update-core.php")&&(e.preventDefault(),t={action:"update-plugin",data:{plugin:g(this).data("plugin"),slug:g(this).data("slug")}},a.postMessage(JSON.stringify(t),window.location.origin))}),g("#plugin_install_from_iframe").on("click",function(e){var t,a=window.parent===window?null:window.parent;g.support.postMessage=!!window.postMessage,!1!==g.support.postMessage&&null!==a&&-1===window.parent.location.pathname.indexOf("index.php")&&(e.preventDefault(),t={action:"install-plugin",data:{slug:g(this).data("slug")}},a.postMessage(JSON.stringify(t),window.location.origin))}),g(window).on("message",function(e){var t,a=e.originalEvent,s=document.location.protocol+"//"+document.location.host;if(a.origin===s){try{t=g.parseJSON(a.data)}catch(e){return}if(t&&void 0!==t.action)switch(t.action){case"decrementUpdateCount":m.updates.decrementCount(t.upgradeType);break;case"install-plugin":case"update-plugin":window.tb_remove(),t.data=m.updates._addCallbacks(t.data,t.action),m.updates.queue.push(t),m.updates.queueChecker()}}}),g(window).on("beforeunload",m.updates.beforeunload),f.on("click",".column-auto-updates a.toggle-auto-update, .theme-overlay a.toggle-auto-update",function(e){var t,d,u,r,o=g(this),p=o.attr("data-wp-action"),c=o.find(".label");if(r="themes"!==pagenow?o.closest(".column-auto-updates"):o.closest(".theme-autoupdate"),e.preventDefault(),"yes"!==o.attr("data-doing-ajax")){switch(o.attr("data-doing-ajax","yes"),pagenow){case"plugins":case"plugins-network":u="plugin",d=o.closest("tr").attr("data-plugin");break;case"themes-network":u="theme",d=o.closest("tr").attr("data-slug");break;case"themes":u="theme",d=o.attr("data-slug")}r.find(".notice.error").addClass("hidden"),"enable"===p?c.text(m.updates.l10n.autoUpdatesEnabling):c.text(m.updates.l10n.autoUpdatesDisabling),o.find(".dashicons-update").removeClass("hidden"),t={action:"toggle-auto-updates",_ajax_nonce:h.ajax_nonce,state:p,type:u,asset:d},g.post(window.ajaxurl,t).done(function(e){var t,a,s,n,l,i=o.attr("href");if(!e.success)return l=e.data&&e.data.error?e.data.error:m.updates.l10n.autoUpdatesError,r.find(".notice.error").removeClass("hidden").find("p").text(l),void m.a11y.speak(l,"polite");if("themes"!==pagenow){switch(t=g(".auto-update-enabled span"),a=g(".auto-update-disabled span"),s=parseInt(t.text().replace(/[^\d]+/g,""),10)||0,n=parseInt(a.text().replace(/[^\d]+/g,""),10)||0,p){case"enable":++s,--n;break;case"disable":--s,++n}s=Math.max(0,s),n=Math.max(0,n),t.text("("+s+")"),a.text("("+n+")")}"enable"===p?(i=i.replace("action=enable-auto-update","action=disable-auto-update"),o.attr({"data-wp-action":"disable",href:i}),c.text(m.updates.l10n.autoUpdatesDisable),r.find(".auto-update-time").removeClass("hidden"),m.a11y.speak(m.updates.l10n.autoUpdatesEnabled,"polite")):(i=i.replace("action=disable-auto-update","action=enable-auto-update"),o.attr({"data-wp-action":"enable",href:i}),c.text(m.updates.l10n.autoUpdatesEnable),r.find(".auto-update-time").addClass("hidden"),m.a11y.speak(m.updates.l10n.autoUpdatesDisabled,"polite")),f.trigger("wp-auto-update-setting-changed",{state:p,type:u,asset:d})}).fail(function(){r.find(".notice.error").removeClass("hidden").find("p").text(m.updates.l10n.autoUpdatesError),m.a11y.speak(m.updates.l10n.autoUpdatesError,"polite")}).always(function(){o.removeAttr("data-doing-ajax").find(".dashicons-update").addClass("hidden")})}})})}(jQuery,window.wp,window._wpUpdatesSettings);
\ No newline at end of file
+!function(g,m,h){var f=g(document),w=m.i18n.__,d=m.i18n._x,u=m.i18n.sprintf;(m=m||{}).updates={},m.updates.ajaxNonce=h.ajax_nonce,m.updates.searchTerm="",m.updates.shouldRequestFilesystemCredentials=!1,m.updates.filesystemCredentials={ftp:{host:"",username:"",password:"",connectionType:""},ssh:{publicKey:"",privateKey:""},fsNonce:"",available:!1},m.updates.ajaxLocked=!1,m.updates.adminNotice=m.template("wp-updates-admin-notice"),m.updates.queue=[],m.updates.$elToReturnFocusToFromCredentialsModal=void 0,m.updates.addAdminNotice=function(e){var t,a=g(e.selector),s=g(".wp-header-end");delete e.selector,t=m.updates.adminNotice(e),a.length||(a=g("#"+e.id)),a.length?a.replaceWith(t):s.length?s.after(t):"customize"===pagenow?g(".customize-themes-notifications").append(t):g(".wrap").find("> h1").after(t),f.trigger("wp-updates-notice-added")},m.updates.ajax=function(e,t){var a={};return m.updates.ajaxLocked?(m.updates.queue.push({action:e,data:t}),g.Deferred()):(m.updates.ajaxLocked=!0,t.success&&(a.success=t.success,delete t.success),t.error&&(a.error=t.error,delete t.error),a.data=_.extend(t,{action:e,_ajax_nonce:m.updates.ajaxNonce,_fs_nonce:m.updates.filesystemCredentials.fsNonce,username:m.updates.filesystemCredentials.ftp.username,password:m.updates.filesystemCredentials.ftp.password,hostname:m.updates.filesystemCredentials.ftp.hostname,connection_type:m.updates.filesystemCredentials.ftp.connectionType,public_key:m.updates.filesystemCredentials.ssh.publicKey,private_key:m.updates.filesystemCredentials.ssh.privateKey}),m.ajax.send(a).always(m.updates.ajaxAlways))},m.updates.ajaxAlways=function(e){e.errorCode&&"unable_to_connect_to_filesystem"===e.errorCode||(m.updates.ajaxLocked=!1,m.updates.queueChecker()),void 0!==e.debug&&window.console&&window.console.log&&_.map(e.debug,function(e){window.console.log(m.sanitize.stripTagsAndEncodeText(e))})},m.updates.refreshCount=function(){var e,t=g("#wp-admin-bar-updates"),a=g('a[href="update-core.php"] .update-plugins'),s=g('a[href="plugins.php"] .update-plugins'),n=g('a[href="themes.php"] .update-plugins');t.find(".ab-item").removeAttr("title"),t.find(".ab-label").text(h.totals.counts.total),0===h.totals.counts.total&&t.find(".ab-label").parents("li").remove(),a.each(function(e,t){t.className=t.className.replace(/count-\d+/,"count-"+h.totals.counts.total)}),0'+t+"
"),a.on("click",".notice.is-dismissible .notice-dismiss",function(){setTimeout(function(){a.removeClass("plugin-card-update-failed").find(".column-name a").focus()},200)}),s.removeClass("updating-message").addClass("button-disabled").attr("aria-label",u(d("%s installation failed","plugin"),s.data("name"))).text(w("Installation Failed!")),m.a11y.speak(t,"assertive"),f.trigger("wp-plugin-install-error",e)))},m.updates.installImporterSuccess=function(e){m.updates.addAdminNotice({id:"install-success",className:"notice-success is-dismissible",message:u(w('Importer installed successfully. Run importer'),e.activateUrl+"&from=import")}),g('[data-slug="'+e.slug+'"]').removeClass("install-now updating-message").addClass("activate-now").attr({href:e.activateUrl+"&from=import","aria-label":u(w("Run %s"),e.pluginName)}).text(w("Run Importer")),m.a11y.speak(w("Installation completed successfully."),"polite"),f.trigger("wp-importer-install-success",e)},m.updates.installImporterError=function(e){var t=u(w("Installation failed: %s"),e.errorMessage),a=g('[data-slug="'+e.slug+'"]'),s=a.data("name");m.updates.isValidResponse(e,"install")&&(m.updates.maybeHandleCredentialError(e,"install-plugin")||(m.updates.addAdminNotice({id:e.errorCode,className:"notice-error is-dismissible",message:t}),a.removeClass("updating-message").attr("aria-label",u(d("Install %s now","plugin"),s)).text(w("Install Now")),m.a11y.speak(t,"assertive"),f.trigger("wp-importer-install-error",e)))},m.updates.deletePlugin=function(e){var t=g('[data-plugin="'+e.plugin+'"]').find(".row-actions a.delete");return e=_.extend({success:m.updates.deletePluginSuccess,error:m.updates.deletePluginError},e),t.html()!==w("Deleting...")&&t.data("originaltext",t.html()).text(w("Deleting...")),m.a11y.speak(w("Deleting..."),"polite"),f.trigger("wp-plugin-deleting",e),m.updates.ajax("delete-plugin",e)},m.updates.deletePluginSuccess=function(l){g('[data-plugin="'+l.plugin+'"]').css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var e=g("#bulk-action-form"),t=g(".subsubsub"),a=g(this),s=e.find("thead th:not(.hidden), thead td").length,n=m.template("item-deleted-row"),i=h.plugins;a.hasClass("plugin-update-tr")||a.after(n({slug:l.slug,plugin:l.plugin,colspan:s,name:l.pluginName})),a.remove(),-1!==_.indexOf(i.upgrade,l.plugin)&&(i.upgrade=_.without(i.upgrade,l.plugin),m.updates.decrementCount("plugin")),-1!==_.indexOf(i.inactive,l.plugin)&&(i.inactive=_.without(i.inactive,l.plugin),i.inactive.length?t.find(".inactive .count").text("("+i.inactive.length+")"):t.find(".inactive").remove()),-1!==_.indexOf(i.active,l.plugin)&&(i.active=_.without(i.active,l.plugin),i.active.length?t.find(".active .count").text("("+i.active.length+")"):t.find(".active").remove()),-1!==_.indexOf(i.recently_activated,l.plugin)&&(i.recently_activated=_.without(i.recently_activated,l.plugin),i.recently_activated.length?t.find(".recently_activated .count").text("("+i.recently_activated.length+")"):t.find(".recently_activated").remove()),i.all=_.without(i.all,l.plugin),i.all.length?t.find(".all .count").text("("+i.all.length+")"):(e.find(".tablenav").css({visibility:"hidden"}),t.find(".all").remove(),e.find("tr.no-items").length||e.find("#the-list").append('| '+w("You do not appear to have any plugins available at this time.")+" |
"))}),m.a11y.speak(d("Deleted!","plugin"),"polite"),f.trigger("wp-plugin-delete-success",l)},m.updates.deletePluginError=function(e){var t,a,s=m.template("item-update-row"),n=m.updates.adminNotice({className:"update-message notice-error notice-alt",message:e.errorMessage});a=e.plugin?(t=g('tr.inactive[data-plugin="'+e.plugin+'"]')).siblings('[data-plugin="'+e.plugin+'"]'):(t=g('tr.inactive[data-slug="'+e.slug+'"]')).siblings('[data-slug="'+e.slug+'"]'),m.updates.isValidResponse(e,"delete")&&(m.updates.maybeHandleCredentialError(e,"delete-plugin")||(a.length?(a.find(".notice-error").remove(),a.find(".plugin-update").append(n)):t.addClass("update").after(s({slug:e.slug,plugin:e.plugin||e.slug,colspan:g("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:n})),f.trigger("wp-plugin-delete-error",e)))},m.updates.updateTheme=function(e){var t;return e=_.extend({success:m.updates.updateThemeSuccess,error:m.updates.updateThemeError},e),(t="themes-network"===pagenow?g('[data-slug="'+e.slug+'"]').find(".update-message").removeClass("notice-error").addClass("updating-message notice-warning").find("p"):"customize"===pagenow?((t=g('[data-slug="'+e.slug+'"].notice').removeClass("notice-large")).find("h3").remove(),(t=t.add(g("#customize-control-installed_theme_"+e.slug).find(".update-message"))).addClass("updating-message").find("p")):((t=g("#update-theme").closest(".notice").removeClass("notice-large")).find("h3").remove(),(t=t.add(g('[data-slug="'+e.slug+'"]').find(".update-message"))).addClass("updating-message").find("p"))).html()!==w("Updating...")&&t.data("originaltext",t.html()),m.a11y.speak(w("Updating... please wait."),"polite"),t.text(w("Updating...")),f.trigger("wp-theme-updating",e),m.updates.ajax("update-theme",e)},m.updates.updateThemeSuccess=function(e){var t,a,s=g("body.modal-open").length,n=g('[data-slug="'+e.slug+'"]'),i={className:"updated-message notice-success notice-alt",message:d("Updated!","theme")};"customize"===pagenow?((n=g(".updating-message").siblings(".theme-name")).length&&(a=n.html().replace(e.oldVersion,e.newVersion),n.html(a)),t=g(".theme-info .notice").add(m.customize.control("installed_theme_"+e.slug).container.find(".theme").find(".update-message"))):"themes-network"===pagenow?(t=n.find(".update-message"),a=n.find(".theme-version-author-uri").html().replace(e.oldVersion,e.newVersion),n.find(".theme-version-author-uri").html(a),n.find(".auto-update-time").empty()):(t=g(".theme-info .notice").add(n.find(".update-message")),s?(g(".load-customize:visible").focus(),g(".theme-info .theme-autoupdate").find(".auto-update-time").empty()):n.find(".load-customize").focus()),m.updates.addAdminNotice(_.extend({selector:t},i)),m.a11y.speak(w("Update completed successfully."),"polite"),m.updates.decrementCount("theme"),f.trigger("wp-theme-update-success",e),s&&"customize"!==pagenow&&g(".theme-info .theme-author").after(m.updates.adminNotice(i))},m.updates.updateThemeError=function(e){var t,a=g('[data-slug="'+e.slug+'"]'),s=u(w("Update Failed: %s"),e.errorMessage);m.updates.isValidResponse(e,"update")&&(m.updates.maybeHandleCredentialError(e,"update-theme")||("customize"===pagenow&&(a=m.customize.control("installed_theme_"+e.slug).container.find(".theme")),"themes-network"===pagenow?t=a.find(".update-message "):(t=g(".theme-info .notice").add(a.find(".notice")),g("body.modal-open").length?g(".load-customize:visible").focus():a.find(".load-customize").focus()),m.updates.addAdminNotice({selector:t,className:"update-message notice-error notice-alt is-dismissible",message:s}),m.a11y.speak(s,"polite"),f.trigger("wp-theme-update-error",e)))},m.updates.installTheme=function(e){var t=g('.theme-install[data-slug="'+e.slug+'"]');return e=_.extend({success:m.updates.installThemeSuccess,error:m.updates.installThemeError},e),t.addClass("updating-message"),t.parents(".theme").addClass("focus"),t.html()!==w("Installing...")&&t.data("originaltext",t.html()),t.attr("aria-label",u(d("Installing %s...","theme"),t.data("name"))).text(w("Installing...")),m.a11y.speak(w("Installing... please wait."),"polite"),g('.install-theme-info, [data-slug="'+e.slug+'"]').removeClass("theme-install-failed").find(".notice.notice-error").remove(),f.trigger("wp-theme-installing",e),m.updates.ajax("install-theme",e)},m.updates.installThemeSuccess=function(e){var t,a=g(".wp-full-overlay-header, [data-slug="+e.slug+"]");f.trigger("wp-theme-install-success",e),t=a.find(".button-primary").removeClass("updating-message").addClass("updated-message disabled").attr("aria-label",u(d("%s installed!","theme"),e.themeName)).text(d("Installed!","theme")),m.a11y.speak(w("Installation completed successfully."),"polite"),setTimeout(function(){e.activateUrl&&(t.attr("href",e.activateUrl).removeClass("theme-install updated-message disabled").addClass("activate"),"themes-network"===pagenow?t.attr("aria-label",u(d("Network Activate %s","theme"),e.themeName)).text(w("Network Enable")):t.attr("aria-label",u(d("Activate %s","theme"),e.themeName)).text(w("Activate"))),e.customizeUrl&&t.siblings(".preview").replaceWith(function(){return g("").attr("href",e.customizeUrl).addClass("button load-customize").text(w("Live Preview"))})},1e3)},m.updates.installThemeError=function(e){var t,a=u(w("Installation failed: %s"),e.errorMessage),s=m.updates.adminNotice({className:"update-message notice-error notice-alt",message:a});m.updates.isValidResponse(e,"install")&&(m.updates.maybeHandleCredentialError(e,"install-theme")||("customize"===pagenow?(f.find("body").hasClass("modal-open")?(t=g('.theme-install[data-slug="'+e.slug+'"]'),g(".theme-overlay .theme-info").prepend(s)):(t=g('.theme-install[data-slug="'+e.slug+'"]')).closest(".theme").addClass("theme-install-failed").append(s),m.customize.notifications.remove("theme_installing")):f.find("body").hasClass("full-overlay-active")?(t=g('.theme-install[data-slug="'+e.slug+'"]'),g(".install-theme-info").prepend(s)):t=g('[data-slug="'+e.slug+'"]').removeClass("focus").addClass("theme-install-failed").append(s).find(".theme-install"),t.removeClass("updating-message").attr("aria-label",u(d("%s installation failed","theme"),t.data("name"))).text(w("Installation Failed!")),m.a11y.speak(a,"assertive"),f.trigger("wp-theme-install-error",e)))},m.updates.deleteTheme=function(e){var t;return"themes"===pagenow?t=g(".theme-actions .delete-theme"):"themes-network"===pagenow&&(t=g('[data-slug="'+e.slug+'"]').find(".row-actions a.delete")),e=_.extend({success:m.updates.deleteThemeSuccess,error:m.updates.deleteThemeError},e),t&&t.html()!==w("Deleting...")&&t.data("originaltext",t.html()).text(w("Deleting...")),m.a11y.speak(w("Deleting..."),"polite"),g(".theme-info .update-message").remove(),f.trigger("wp-theme-deleting",e),m.updates.ajax("delete-theme",e)},m.updates.deleteThemeSuccess=function(n){var e=g('[data-slug="'+n.slug+'"]');"themes-network"===pagenow&&e.css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var e=g(".subsubsub"),t=g(this),a=h.themes,s=m.template("item-deleted-row");t.hasClass("plugin-update-tr")||t.after(s({slug:n.slug,colspan:g("#bulk-action-form").find("thead th:not(.hidden), thead td").length,name:t.find(".theme-title strong").text()})),t.remove(),t.hasClass("update")&&(a.upgrade--,m.updates.decrementCount("theme")),t.hasClass("inactive")&&(a.disabled--,a.disabled?e.find(".disabled .count").text("("+a.disabled+")"):e.find(".disabled").remove()),e.find(".all .count").text("("+--a.all+")")}),m.a11y.speak(d("Deleted!","theme"),"polite"),f.trigger("wp-theme-delete-success",n)},m.updates.deleteThemeError=function(e){var t=g('tr.inactive[data-slug="'+e.slug+'"]'),a=g(".theme-actions .delete-theme"),s=m.template("item-update-row"),n=t.siblings("#"+e.slug+"-update"),i=u(w("Deletion failed: %s"),e.errorMessage),l=m.updates.adminNotice({className:"update-message notice-error notice-alt",message:i});m.updates.maybeHandleCredentialError(e,"delete-theme")||("themes-network"===pagenow?n.length?(n.find(".notice-error").remove(),n.find(".plugin-update").append(l)):t.addClass("update").after(s({slug:e.slug,colspan:g("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:l})):g(".theme-info .theme-description").before(l),a.html(a.data("originaltext")),m.a11y.speak(i,"assertive"),f.trigger("wp-theme-delete-error",e))},m.updates._addCallbacks=function(e,t){return"import"===pagenow&&"install-plugin"===t&&(e.success=m.updates.installImporterSuccess,e.error=m.updates.installImporterError),e},m.updates.queueChecker=function(){var e;if(!m.updates.ajaxLocked&&m.updates.queue.length)switch((e=m.updates.queue.shift()).action){case"install-plugin":m.updates.installPlugin(e.data);break;case"update-plugin":m.updates.updatePlugin(e.data);break;case"delete-plugin":m.updates.deletePlugin(e.data);break;case"install-theme":m.updates.installTheme(e.data);break;case"update-theme":m.updates.updateTheme(e.data);break;case"delete-theme":m.updates.deleteTheme(e.data)}},m.updates.requestFilesystemCredentials=function(e){!1===m.updates.filesystemCredentials.available&&(e&&!m.updates.$elToReturnFocusToFromCredentialsModal&&(m.updates.$elToReturnFocusToFromCredentialsModal=g(e.target)),m.updates.ajaxLocked=!0,m.updates.requestForCredentialsModalOpen())},m.updates.maybeRequestFilesystemCredentials=function(e){m.updates.shouldRequestFilesystemCredentials&&!m.updates.ajaxLocked&&m.updates.requestFilesystemCredentials(e)},m.updates.keydown=function(e){27===e.keyCode?m.updates.requestForCredentialsModalCancel():9===e.keyCode&&("upgrade"!==e.target.id||e.shiftKey?"hostname"===e.target.id&&e.shiftKey&&(g("#upgrade").focus(),e.preventDefault()):(g("#hostname").focus(),e.preventDefault()))},m.updates.requestForCredentialsModalOpen=function(){var e=g("#request-filesystem-credentials-dialog");g("body").addClass("modal-open"),e.show(),e.find("input:enabled:first").focus(),e.on("keydown",m.updates.keydown)},m.updates.requestForCredentialsModalClose=function(){g("#request-filesystem-credentials-dialog").hide(),g("body").removeClass("modal-open"),m.updates.$elToReturnFocusToFromCredentialsModal&&m.updates.$elToReturnFocusToFromCredentialsModal.focus()},m.updates.requestForCredentialsModalCancel=function(){(m.updates.ajaxLocked||m.updates.queue.length)&&(_.each(m.updates.queue,function(e){f.trigger("credential-modal-cancel",e)}),m.updates.ajaxLocked=!1,m.updates.queue=[],m.updates.requestForCredentialsModalClose())},m.updates.showErrorInCredentialsForm=function(e){var t=g("#request-filesystem-credentials-form");t.find(".notice").remove(),t.find("#request-filesystem-credentials-title").after('")},m.updates.credentialError=function(e,t){e=m.updates._addCallbacks(e,t),m.updates.queue.unshift({action:t,data:e}),m.updates.filesystemCredentials.available=!1,m.updates.showErrorInCredentialsForm(e.errorMessage),m.updates.requestFilesystemCredentials()},m.updates.maybeHandleCredentialError=function(e,t){return!(!m.updates.shouldRequestFilesystemCredentials||!e.errorCode||"unable_to_connect_to_filesystem"!==e.errorCode)&&(m.updates.credentialError(e,t),!0)},m.updates.isValidResponse=function(e,t){var a,s=w("Something went wrong.");if(_.isObject(e)&&!_.isFunction(e.always))return!0;switch(_.isString(e)&&"-1"===e?s=w("An error has occurred. Please reload the page and try again."):_.isString(e)?s=e:void 0!==e.readyState&&0===e.readyState?s=w("Connection lost or the server is busy. Please try again later."):_.isString(e.responseText)&&""!==e.responseText?s=e.responseText:_.isString(e.statusText)&&(s=e.statusText),t){case"update":a=w("Update Failed: %s");break;case"install":a=w("Installation failed: %s");break;case"delete":a=w("Deletion failed: %s")}return s=s.replace(/<[\/a-z][^<>]*>/gi,""),a=a.replace("%s",s),m.updates.addAdminNotice({id:"unknown_error",className:"notice-error is-dismissible",message:_.escape(a)}),m.updates.ajaxLocked=!1,m.updates.queue=[],g(".button.updating-message").removeClass("updating-message").removeAttr("aria-label").prop("disabled",!0).text(w("Update Failed!")),g(".updating-message:not(.button):not(.thickbox)").removeClass("updating-message notice-warning").addClass("notice-error").find("p").removeAttr("aria-label").text(a),m.a11y.speak(a,"assertive"),!1},m.updates.beforeunload=function(){if(m.updates.ajaxLocked)return w("Updates may not complete if you navigate away from this page.")},g(function(){var i=g("#plugin-filter"),o=g("#bulk-action-form"),e=g("#request-filesystem-credentials-form"),t=g("#request-filesystem-credentials-dialog"),a=g(".plugins-php .wp-filter-search"),s=g(".plugin-install-php .wp-filter-search");(h=_.extend(h,window._wpUpdatesItemCounts||{})).totals&&m.updates.refreshCount(),m.updates.shouldRequestFilesystemCredentials=0").html(a.find("p").data("originaltext"))),a.removeClass("updating-message").html(s),"plugin-install"!==pagenow&&"plugin-install-network"!==pagenow||("update-plugin"===t.action?a.attr("aria-label",u(d("Update %s now","plugin"),a.data("name"))):"install-plugin"===t.action&&a.attr("aria-label",u(d("Install %s now","plugin"),a.data("name"))))),m.a11y.speak(w("Update canceled."),"polite")}),o.on("click","[data-plugin] .update-link",function(e){var t=g(e.target),a=t.parents("tr");e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(m.updates.maybeRequestFilesystemCredentials(e),m.updates.$elToReturnFocusToFromCredentialsModal=a.find(".check-column input"),m.updates.updatePlugin({plugin:a.data("plugin"),slug:a.data("slug")}))}),i.on("click",".update-now",function(e){var t=g(e.target);e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(m.updates.maybeRequestFilesystemCredentials(e),m.updates.updatePlugin({plugin:t.data("plugin"),slug:t.data("slug")}))}),i.on("click",".install-now",function(e){var t=g(e.target);e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(m.updates.shouldRequestFilesystemCredentials&&!m.updates.ajaxLocked&&(m.updates.requestFilesystemCredentials(e),f.on("credential-modal-cancel",function(){g(".install-now.updating-message").removeClass("updating-message").text(w("Install Now")),m.a11y.speak(w("Update canceled."),"polite")})),m.updates.installPlugin({slug:t.data("slug")}))}),f.on("click",".importer-item .install-now",function(e){var t=g(e.target),a=g(this).data("name");e.preventDefault(),t.hasClass("updating-message")||(m.updates.shouldRequestFilesystemCredentials&&!m.updates.ajaxLocked&&(m.updates.requestFilesystemCredentials(e),f.on("credential-modal-cancel",function(){t.removeClass("updating-message").attr("aria-label",u(d("Install %s now","plugin"),a)).text(w("Install Now")),m.a11y.speak(w("Update canceled."),"polite")})),m.updates.installPlugin({slug:t.data("slug"),pagenow:pagenow,success:m.updates.installImporterSuccess,error:m.updates.installImporterError}))}),o.on("click","[data-plugin] a.delete",function(e){var t=g(e.target).parents("tr"),a=u(w("Are you sure you want to delete %s and its data?"),t.find(".plugin-title strong").text());e.preventDefault(),window.confirm(a)&&(m.updates.maybeRequestFilesystemCredentials(e),m.updates.deletePlugin({plugin:t.data("plugin"),slug:t.data("slug")}))}),f.on("click",".themes-php.network-admin .update-link",function(e){var t=g(e.target),a=t.parents("tr");e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(m.updates.maybeRequestFilesystemCredentials(e),m.updates.$elToReturnFocusToFromCredentialsModal=a.find(".check-column input"),m.updates.updateTheme({slug:a.data("slug")}))}),f.on("click",".themes-php.network-admin a.delete",function(e){var t=g(e.target).parents("tr"),a=u(w("Are you sure you want to delete %s?"),t.find(".theme-title strong").text());e.preventDefault(),window.confirm(a)&&(m.updates.maybeRequestFilesystemCredentials(e),m.updates.deleteTheme({slug:t.data("slug")}))}),o.on("click",'[type="submit"]:not([name="clear-recent-list"])',function(e){var t,n,i=g(e.target).siblings("select").val(),a=o.find('input[name="checked[]"]:checked'),l=0,d=0,u=[];switch(pagenow){case"plugins":case"plugins-network":t="plugin";break;case"themes-network":t="theme";break;default:return}if(!a.length)return e.preventDefault(),g("html, body").animate({scrollTop:0}),m.updates.addAdminNotice({id:"no-items-selected",className:"notice-error is-dismissible",message:w("Please select at least one item to perform this action on.")});switch(i){case"update-selected":n=i.replace("selected",t);break;case"delete-selected":var s=w("plugin"===t?"Are you sure you want to delete the selected plugins and their data?":"Caution: These themes may be active on other sites in the network. Are you sure you want to proceed?");if(!window.confirm(s))return void e.preventDefault();n=i.replace("selected",t);break;default:return}m.updates.maybeRequestFilesystemCredentials(e),e.preventDefault(),o.find('.manage-column [type="checkbox"]').prop("checked",!1),f.trigger("wp-"+t+"-bulk-"+i,a),a.each(function(e,t){var a=g(t),s=a.parents("tr");"update-selected"!==i||s.hasClass("update")&&!s.find("notice-error").length?m.updates.queue.push({action:n,data:{plugin:s.data("plugin"),slug:s.data("slug")}}):a.prop("checked",!1)}),f.on("wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error",function(e,t){var a,s,n=g('[data-slug="'+t.slug+'"]');"wp-"+t.update+"-update-success"===e.type?l++:(s=t.pluginName?t.pluginName:n.find(".column-primary strong").text(),d++,u.push(s+": "+t.errorMessage)),n.find('input[name="checked[]"]:checked').prop("checked",!1),m.updates.adminNotice=m.template("wp-bulk-updates-admin-notice"),m.updates.addAdminNotice({id:"bulk-action-notice",className:"bulk-action-notice",successes:l,errors:d,errorMessages:u,type:t.update}),a=g("#bulk-action-notice").on("click","button",function(){g(this).toggleClass("bulk-action-errors-collapsed").attr("aria-expanded",!g(this).hasClass("bulk-action-errors-collapsed")),a.find(".bulk-action-errors").toggleClass("hidden")}),0').append(g("",{class:"current",href:s,text:w("Search Results")})),g(".wp-filter .filter-links .current").removeClass("current").parents(".filter-links").prepend(n),i.prev("p").remove(),g(".plugins-popular-tags-wrapper").remove()),void 0!==m.updates.searchRequest&&m.updates.searchRequest.abort(),g("body").addClass("loading-content"),m.updates.searchRequest=m.ajax.post("search-install-plugins",a).done(function(e){g("body").removeClass("loading-content"),i.append(e.items),delete m.updates.searchRequest,0===e.count?m.a11y.speak(w("You do not appear to have any plugins available at this time.")):m.a11y.speak(u(w("Number of plugins found: %d"),e.count))}))},1e3)),a.length&&a.attr("aria-describedby","live-search-desc"),a.on("keyup input",_.debounce(function(e){var t,s={_ajax_nonce:m.updates.ajaxNonce,s:e.target.value,pagenow:pagenow,plugin_status:"all"};"keyup"===e.type&&27===e.which&&(e.target.value=""),m.updates.searchTerm!==s.s&&(m.updates.searchTerm=s.s,t=_.object(_.compact(_.map(location.search.slice(1).split("&"),function(e){if(e)return e.split("=")}))),s.plugin_status=t.plugin_status||"all",window.history&&window.history.replaceState&&window.history.replaceState(null,"",location.href.split("?")[0]+"?s="+s.s+"&plugin_status="+s.plugin_status),void 0!==m.updates.searchRequest&&m.updates.searchRequest.abort(),o.empty(),g("body").addClass("loading-content"),g(".subsubsub .current").removeClass("current"),m.updates.searchRequest=m.ajax.post("search-plugins",s).done(function(e){var t=g("").addClass("subtitle").html(u(w("Search results for “%s”"),_.escape(s.s))),a=g(".wrap .subtitle");s.s.length?a.length?a.replaceWith(t):g(".wp-header-end").before(t):(a.remove(),g(".subsubsub ."+s.plugin_status+" a").addClass("current")),g("body").removeClass("loading-content"),o.append(e.items),delete m.updates.searchRequest,0===e.count?m.a11y.speak(w("No plugins found. Try a different search.")):m.a11y.speak(u(w("Number of plugins found: %d"),e.count))}))},500)),f.on("submit",".search-plugins",function(e){e.preventDefault(),g("input.wp-filter-search").trigger("input")}),f.on("click",".try-again",function(e){e.preventDefault(),s.trigger("input")}),g("#typeselector").on("change",function(){var e=g('input[name="s"]');e.val().length&&e.trigger("input","typechange")}),g("#plugin_update_from_iframe").on("click",function(e){var t,a=window.parent===window?null:window.parent;g.support.postMessage=!!window.postMessage,!1!==g.support.postMessage&&null!==a&&-1===window.parent.location.pathname.indexOf("update-core.php")&&(e.preventDefault(),t={action:"update-plugin",data:{plugin:g(this).data("plugin"),slug:g(this).data("slug")}},a.postMessage(JSON.stringify(t),window.location.origin))}),g("#plugin_install_from_iframe").on("click",function(e){var t,a=window.parent===window?null:window.parent;g.support.postMessage=!!window.postMessage,!1!==g.support.postMessage&&null!==a&&-1===window.parent.location.pathname.indexOf("index.php")&&(e.preventDefault(),t={action:"install-plugin",data:{slug:g(this).data("slug")}},a.postMessage(JSON.stringify(t),window.location.origin))}),g(window).on("message",function(e){var t,a=e.originalEvent,s=document.location.protocol+"//"+document.location.host;if(a.origin===s){try{t=g.parseJSON(a.data)}catch(e){return}if(t&&void 0!==t.action)switch(t.action){case"decrementUpdateCount":m.updates.decrementCount(t.upgradeType);break;case"install-plugin":case"update-plugin":window.tb_remove(),t.data=m.updates._addCallbacks(t.data,t.action),m.updates.queue.push(t),m.updates.queueChecker()}}}),g(window).on("beforeunload",m.updates.beforeunload),f.on("click",".column-auto-updates a.toggle-auto-update, .theme-overlay a.toggle-auto-update",function(e){var t,d,u,o,r=g(this),p=r.attr("data-wp-action"),c=r.find(".label");if(o="themes"!==pagenow?r.closest(".column-auto-updates"):r.closest(".theme-autoupdate"),e.preventDefault(),"yes"!==r.attr("data-doing-ajax")){switch(r.attr("data-doing-ajax","yes"),pagenow){case"plugins":case"plugins-network":u="plugin",d=r.closest("tr").attr("data-plugin");break;case"themes-network":u="theme",d=r.closest("tr").attr("data-slug");break;case"themes":u="theme",d=r.attr("data-slug")}o.find(".notice.error").addClass("hidden"),"enable"===p?c.text(w("Enabling...")):c.text(w("Disabling...")),r.find(".dashicons-update").removeClass("hidden"),t={action:"toggle-auto-updates",_ajax_nonce:h.ajax_nonce,state:p,type:u,asset:d},g.post(window.ajaxurl,t).done(function(e){var t,a,s,n,i,l=r.attr("href");if(!e.success)return i=e.data&&e.data.error?e.data.error:w("The request could not be completed."),o.find(".notice.error").removeClass("hidden").find("p").text(i),void m.a11y.speak(i,"polite");if("themes"!==pagenow){switch(t=g(".auto-update-enabled span"),a=g(".auto-update-disabled span"),s=parseInt(t.text().replace(/[^\d]+/g,""),10)||0,n=parseInt(a.text().replace(/[^\d]+/g,""),10)||0,p){case"enable":++s,--n;break;case"disable":--s,++n}s=Math.max(0,s),n=Math.max(0,n),t.text("("+s+")"),a.text("("+n+")")}"enable"===p?(l=l.replace("action=enable-auto-update","action=disable-auto-update"),r.attr({"data-wp-action":"disable",href:l}),c.text(w("Disable auto-updates")),o.find(".auto-update-time").removeClass("hidden"),m.a11y.speak(w("Enable auto-updates"),"polite")):(l=l.replace("action=disable-auto-update","action=enable-auto-update"),r.attr({"data-wp-action":"enable",href:l}),c.text(w("Enable auto-updates")),o.find(".auto-update-time").addClass("hidden"),m.a11y.speak(w("Auto-updates disabled"),"polite")),f.trigger("wp-auto-update-setting-changed",{state:p,type:u,asset:d})}).fail(function(){o.find(".notice.error").removeClass("hidden").find("p").text(w("The request could not be completed.")),m.a11y.speak(w("The request could not be completed."),"polite")}).always(function(){r.removeAttr("data-doing-ajax").find(".dashicons-update").addClass("hidden")})}})})}(jQuery,window.wp,window._wpUpdatesSettings);
\ No newline at end of file
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
index e765a03163..8745ea42f6 100644
--- a/wp-includes/script-loader.php
+++ b/wp-includes/script-loader.php
@@ -1434,100 +1434,12 @@ function wp_default_scripts( $scripts ) {
);
$scripts->add( 'updates', "/wp-admin/js/updates$suffix.js", array( 'jquery', 'wp-util', 'wp-a11y', 'wp-sanitize' ), false, 1 );
+ $scripts->set_translations( 'updates' );
did_action( 'init' ) && $scripts->localize(
'updates',
'_wpUpdatesSettings',
array(
'ajax_nonce' => wp_create_nonce( 'updates' ),
- 'l10n' => array(
- /* translators: %s: Search query. */
- 'searchResults' => __( 'Search results for “%s”' ),
- 'searchResultsLabel' => __( 'Search Results' ),
- 'noPlugins' => __( 'You do not appear to have any plugins available at this time.' ),
- 'noItemsSelected' => __( 'Please select at least one item to perform this action on.' ),
- 'updating' => __( 'Updating...' ), // No ellipsis.
- 'pluginUpdated' => _x( 'Updated!', 'plugin' ),
- 'themeUpdated' => _x( 'Updated!', 'theme' ),
- 'update' => __( 'Update' ),
- 'updateNow' => __( 'Update Now' ),
- /* translators: %s: Plugin name and version. */
- 'pluginUpdateNowLabel' => _x( 'Update %s now', 'plugin' ),
- 'updateFailedShort' => __( 'Update Failed!' ),
- /* translators: %s: Error string for a failed update. */
- 'updateFailed' => __( 'Update Failed: %s' ),
- /* translators: %s: Plugin name and version. */
- 'pluginUpdatingLabel' => _x( 'Updating %s...', 'plugin' ), // No ellipsis.
- /* translators: %s: Plugin name and version. */
- 'pluginUpdatedLabel' => _x( '%s updated!', 'plugin' ),
- /* translators: %s: Plugin name and version. */
- 'pluginUpdateFailedLabel' => _x( '%s update failed', 'plugin' ),
- /* translators: Accessibility text. */
- 'updatingMsg' => __( 'Updating... please wait.' ), // No ellipsis.
- /* translators: Accessibility text. */
- 'updatedMsg' => __( 'Update completed successfully.' ),
- /* translators: Accessibility text. */
- 'updateCancel' => __( 'Update canceled.' ),
- 'beforeunload' => __( 'Updates may not complete if you navigate away from this page.' ),
- 'installNow' => __( 'Install Now' ),
- /* translators: %s: Plugin name. */
- 'pluginInstallNowLabel' => _x( 'Install %s now', 'plugin' ),
- 'installing' => __( 'Installing...' ),
- 'pluginInstalled' => _x( 'Installed!', 'plugin' ),
- 'themeInstalled' => _x( 'Installed!', 'theme' ),
- 'installFailedShort' => __( 'Installation Failed!' ),
- /* translators: %s: Error string for a failed installation. */
- 'installFailed' => __( 'Installation failed: %s' ),
- /* translators: %s: Plugin name and version. */
- 'pluginInstallingLabel' => _x( 'Installing %s...', 'plugin' ), // No ellipsis.
- /* translators: %s: Theme name and version. */
- 'themeInstallingLabel' => _x( 'Installing %s...', 'theme' ), // No ellipsis.
- /* translators: %s: Plugin name and version. */
- 'pluginInstalledLabel' => _x( '%s installed!', 'plugin' ),
- /* translators: %s: Theme name and version. */
- 'themeInstalledLabel' => _x( '%s installed!', 'theme' ),
- /* translators: %s: Plugin name and version. */
- 'pluginInstallFailedLabel' => _x( '%s installation failed', 'plugin' ),
- /* translators: %s: Theme name and version. */
- 'themeInstallFailedLabel' => _x( '%s installation failed', 'theme' ),
- 'installingMsg' => __( 'Installing... please wait.' ),
- 'installedMsg' => __( 'Installation completed successfully.' ),
- /* translators: %s: Activation URL. */
- 'importerInstalledMsg' => __( 'Importer installed successfully. Run importer' ),
- /* translators: %s: Theme name. */
- 'aysDelete' => __( 'Are you sure you want to delete %s?' ),
- /* translators: %s: Plugin name. */
- 'aysDeleteUninstall' => __( 'Are you sure you want to delete %s and its data?' ),
- 'aysBulkDelete' => __( 'Are you sure you want to delete the selected plugins and their data?' ),
- 'aysBulkDeleteThemes' => __( 'Caution: These themes may be active on other sites in the network. Are you sure you want to proceed?' ),
- 'deleting' => __( 'Deleting...' ),
- /* translators: %s: Error string for a failed deletion. */
- 'deleteFailed' => __( 'Deletion failed: %s' ),
- 'pluginDeleted' => _x( 'Deleted!', 'plugin' ),
- 'themeDeleted' => _x( 'Deleted!', 'theme' ),
- 'livePreview' => __( 'Live Preview' ),
- 'activatePlugin' => is_network_admin() ? __( 'Network Activate' ) : __( 'Activate' ),
- 'activateTheme' => is_network_admin() ? __( 'Network Enable' ) : __( 'Activate' ),
- /* translators: %s: Plugin name. */
- 'activatePluginLabel' => is_network_admin() ? _x( 'Network Activate %s', 'plugin' ) : _x( 'Activate %s', 'plugin' ),
- /* translators: %s: Theme name. */
- 'activateThemeLabel' => is_network_admin() ? _x( 'Network Activate %s', 'theme' ) : _x( 'Activate %s', 'theme' ),
- 'activateImporter' => __( 'Run Importer' ),
- /* translators: %s: Importer name. */
- 'activateImporterLabel' => __( 'Run %s' ),
- 'unknownError' => __( 'Something went wrong.' ),
- 'connectionError' => __( 'Connection lost or the server is busy. Please try again later.' ),
- 'nonceError' => __( 'An error has occurred. Please reload the page and try again.' ),
- /* translators: %s: Number of plugins. */
- 'pluginsFound' => __( 'Number of plugins found: %d' ),
- 'noPluginsFound' => __( 'No plugins found. Try a different search.' ),
- 'autoUpdatesEnable' => __( 'Enable auto-updates' ),
- 'autoUpdatesEnabling' => __( 'Enabling...' ),
- 'autoUpdatesEnabled' => __( 'Auto-updates enabled' ),
- 'autoUpdatesDisable' => __( 'Disable auto-updates' ),
- 'autoUpdatesDisabling' => __( 'Disabling...' ),
- 'autoUpdatesDisabled' => __( 'Auto-updates disabled' ),
- 'autoUpdatesError' => __( 'The request could not be completed.' ),
- ),
)
);
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 3adafa2bcc..7a53ae446a 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
-$wp_version = '5.5-alpha-47883';
+$wp_version = '5.5-alpha-47884';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.