Escape outputs

This commit is contained in:
Brian Miyaji
2021-11-13 20:42:08 +09:00
parent 051d3e3055
commit 23ba2446b1
190 changed files with 2837 additions and 2837 deletions

View File

@@ -331,13 +331,13 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
// Load class strings.
$this->strings = array(
'page_title' => __( 'Install Required Plugins', 'tgmpa' ),
'menu_title' => __( 'Install Plugins', 'tgmpa' ),
'page_title' => esc_attr__( 'Install Required Plugins', 'tgmpa' ),
'menu_title' => esc_attr__( 'Install Plugins', 'tgmpa' ),
/* translators: %s: plugin name. */
'installing' => __( 'Installing Plugin: %s', 'tgmpa' ),
'installing' => esc_attr__( 'Installing Plugin: %s', 'tgmpa' ),
/* translators: %s: plugin name. */
'updating' => __( 'Updating Plugin: %s', 'tgmpa' ),
'oops' => __( 'Something went wrong with the plugin API.', 'tgmpa' ),
'updating' => esc_attr__( 'Updating Plugin: %s', 'tgmpa' ),
'oops' => esc_attr__( 'Something went wrong with the plugin API.', 'tgmpa' ),
'notice_can_install_required' => _n_noop(
/* translators: 1: plugin name(s). */
'This theme requires the following plugin: %1$s.',
@@ -389,19 +389,19 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) {
'Begin activating plugins',
'tgmpa'
),
'return' => __( 'Return to Required Plugins Installer', 'tgmpa' ),
'dashboard' => __( 'Return to the Dashboard', 'tgmpa' ),
'plugin_activated' => __( 'Plugin activated successfully.', 'tgmpa' ),
'activated_successfully' => __( 'The following plugin was activated successfully:', 'tgmpa' ),
'return' => esc_attr__( 'Return to Required Plugins Installer', 'tgmpa' ),
'dashboard' => esc_attr__( 'Return to the Dashboard', 'tgmpa' ),
'plugin_activated' => esc_attr__( 'Plugin activated successfully.', 'tgmpa' ),
'activated_successfully' => esc_attr__( 'The following plugin was activated successfully:', 'tgmpa' ),
/* translators: 1: plugin name. */
'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'tgmpa' ),
'plugin_already_active' => esc_attr__( 'No action taken. Plugin %1$s was already active.', 'tgmpa' ),
/* translators: 1: plugin name. */
'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'tgmpa' ),
'plugin_needs_higher_version' => esc_attr__( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'tgmpa' ),
/* translators: 1: dashboard link. */
'complete' => __( 'All plugins installed and activated successfully. %1$s', 'tgmpa' ),
'dismiss' => __( 'Dismiss this notice', 'tgmpa' ),
'notice_cannot_install_activate' => __( 'There are one or more required or recommended plugins to install, update or activate.', 'tgmpa' ),
'contact_admin' => __( 'Please contact the administrator of this site for help.', 'tgmpa' ),
'complete' => esc_attr__( 'All plugins installed and activated successfully. %1$s', 'tgmpa' ),
'dismiss' => esc_attr__( 'Dismiss this notice', 'tgmpa' ),
'notice_cannot_install_activate' => esc_attr__( 'There are one or more required or recommended plugins to install, update or activate.', 'tgmpa' ),
'contact_admin' => esc_attr__( 'Please contact the administrator of this site for help.', 'tgmpa' ),
);
do_action( 'tgmpa_register' );
@@ -2383,10 +2383,10 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
*/
protected function get_plugin_advise_type_text( $required ) {
if ( true === $required ) {
return __( 'Required', 'tgmpa' );
return esc_attr__( 'Required', 'tgmpa' );
}
return __( 'Recommended', 'tgmpa' );
return esc_attr__( 'Recommended', 'tgmpa' );
}
/**
@@ -2402,13 +2402,13 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
switch ( $type ) {
case 'repo':
$string = __( 'WordPress Repository', 'tgmpa' );
$string = esc_attr__( 'WordPress Repository', 'tgmpa' );
break;
case 'external':
$string = __( 'External Source', 'tgmpa' );
$string = esc_attr__( 'External Source', 'tgmpa' );
break;
case 'bundled':
$string = __( 'Pre-Packaged', 'tgmpa' );
$string = esc_attr__( 'Pre-Packaged', 'tgmpa' );
break;
}
@@ -2425,25 +2425,25 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
*/
protected function get_plugin_status_text( $slug ) {
if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) {
return __( 'Not Installed', 'tgmpa' );
return esc_attr__( 'Not Installed', 'tgmpa' );
}
if ( ! $this->tgmpa->is_plugin_active( $slug ) ) {
$install_status = __( 'Installed But Not Activated', 'tgmpa' );
$install_status = esc_attr__( 'Installed But Not Activated', 'tgmpa' );
} else {
$install_status = __( 'Active', 'tgmpa' );
$install_status = esc_attr__( 'Active', 'tgmpa' );
}
$update_status = '';
if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) {
$update_status = __( 'Required Update not Available', 'tgmpa' );
$update_status = esc_attr__( 'Required Update not Available', 'tgmpa' );
} elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) {
$update_status = __( 'Requires Update', 'tgmpa' );
$update_status = esc_attr__( 'Requires Update', 'tgmpa' );
} elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) {
$update_status = __( 'Update recommended', 'tgmpa' );
$update_status = esc_attr__( 'Update recommended', 'tgmpa' );
}
if ( '' === $update_status ) {
@@ -2600,7 +2600,7 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
}
$output[] = sprintf(
'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Installed version:', 'tgmpa' ) . '</p>',
'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . esc_attr__( 'Installed version:', 'tgmpa' ) . '</p>',
$color,
$installed
);
@@ -2608,7 +2608,7 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
if ( ! empty( $item['minimum_version'] ) ) {
$output[] = sprintf(
'<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>' . __( 'Minimum required version:', 'tgmpa' ) . '</p>',
'<p><span style="min-width: 32px; text-align: right; float: right;">%1$s</span>' . esc_attr__( 'Minimum required version:', 'tgmpa' ) . '</p>',
$item['minimum_version']
);
}
@@ -2620,7 +2620,7 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
}
$output[] = sprintf(
'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . __( 'Available version:', 'tgmpa' ) . '</p>',
'<p><span style="min-width: 32px; text-align: right; float: right;%1$s">%2$s</span>' . esc_attr__( 'Available version:', 'tgmpa' ) . '</p>',
$color,
$item['available_version']
);
@@ -2657,14 +2657,14 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
public function get_columns() {
$columns = array(
'cb' => '<input type="checkbox" />',
'plugin' => __( 'Plugin', 'tgmpa' ),
'source' => __( 'Source', 'tgmpa' ),
'type' => __( 'Type', 'tgmpa' ),
'plugin' => esc_attr__( 'Plugin', 'tgmpa' ),
'source' => esc_attr__( 'Source', 'tgmpa' ),
'type' => esc_attr__( 'Type', 'tgmpa' ),
);
if ( 'all' === $this->view_context || 'update' === $this->view_context ) {
$columns['version'] = __( 'Version', 'tgmpa' );
$columns['status'] = __( 'Status', 'tgmpa' );
$columns['version'] = esc_attr__( 'Version', 'tgmpa' );
$columns['status'] = esc_attr__( 'Status', 'tgmpa' );
}
return apply_filters( 'tgmpa_table_columns', $columns );
@@ -2713,18 +2713,18 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
// Display the 'Install' action link if the plugin is not yet available.
if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) {
/* translators: %2$s: plugin name in screen reader markup */
$actions['install'] = __( 'Install %2$s', 'tgmpa' );
$actions['install'] = esc_attr__( 'Install %2$s', 'tgmpa' );
} else {
// Display the 'Update' action link if an update is available and WP complies with plugin minimum.
if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) {
/* translators: %2$s: plugin name in screen reader markup */
$actions['update'] = __( 'Update %2$s', 'tgmpa' );
$actions['update'] = esc_attr__( 'Update %2$s', 'tgmpa' );
}
// Display the 'Activate' action link, but only if the plugin meets the minimum version.
if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) {
/* translators: %2$s: plugin name in screen reader markup */
$actions['activate'] = __( 'Activate %2$s', 'tgmpa' );
$actions['activate'] = esc_attr__( 'Activate %2$s', 'tgmpa' );
}
}
@@ -2827,16 +2827,16 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) {
if ( current_user_can( 'install_plugins' ) ) {
$actions['tgmpa-bulk-install'] = __( 'Install', 'tgmpa' );
$actions['tgmpa-bulk-install'] = esc_attr__( 'Install', 'tgmpa' );
}
}
if ( 'install' !== $this->view_context ) {
if ( current_user_can( 'update_plugins' ) ) {
$actions['tgmpa-bulk-update'] = __( 'Update', 'tgmpa' );
$actions['tgmpa-bulk-update'] = esc_attr__( 'Update', 'tgmpa' );
}
if ( current_user_can( 'activate_plugins' ) ) {
$actions['tgmpa-bulk-activate'] = __( 'Activate', 'tgmpa' );
$actions['tgmpa-bulk-activate'] = esc_attr__( 'Activate', 'tgmpa' );
}
}
@@ -2867,9 +2867,9 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
// Did user actually select any plugins to install/update ?
if ( empty( $_POST['plugin'] ) ) {
if ( 'install' === $install_type ) {
$message = __( 'No plugins were selected to be installed. No action taken.', 'tgmpa' );
$message = esc_attr__( 'No plugins were selected to be installed. No action taken.', 'tgmpa' );
} else {
$message = __( 'No plugins were selected to be updated. No action taken.', 'tgmpa' );
$message = esc_attr__( 'No plugins were selected to be updated. No action taken.', 'tgmpa' );
}
echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
@@ -2910,9 +2910,9 @@ if ( ! class_exists( 'TGMPA_List_Table' ) ) {
// No need to proceed further if we have no plugins to handle.
if ( empty( $plugins_to_install ) ) {
if ( 'install' === $install_type ) {
$message = __( 'No plugins are available to be installed at this time.', 'tgmpa' );
$message = esc_attr__( 'No plugins are available to be installed at this time.', 'tgmpa' );
} else {
$message = __( 'No plugins are available to be updated at this time.', 'tgmpa' );
$message = esc_attr__( 'No plugins are available to be updated at this time.', 'tgmpa' );
}
echo '<div id="message" class="error"><p>', esc_html( $message ), '</p></div>';
@@ -3268,8 +3268,8 @@ if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) {
* @since 2.2.0
*/
public function activate_strings() {
$this->strings['activation_failed'] = __( 'Plugin activation failed.', 'tgmpa' );
$this->strings['activation_success'] = __( 'Plugin activated successfully.', 'tgmpa' );
$this->strings['activation_failed'] = esc_attr__( 'Plugin activation failed.', 'tgmpa' );
$this->strings['activation_success'] = esc_attr__( 'Plugin activated successfully.', 'tgmpa' );
}
/**
@@ -3612,29 +3612,29 @@ if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) {
if ( 'update' === $this->options['install_type'] ) {
parent::add_strings();
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
$this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
$this->upgrader->strings['skin_before_update_header'] = esc_attr__( 'Updating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
} else {
/* translators: 1: plugin name, 2: error message. */
$this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'tgmpa' );
$this->upgrader->strings['skin_update_failed_error'] = esc_attr__( 'An error occurred while installing %1$s: <strong>%2$s</strong>.', 'tgmpa' );
/* translators: 1: plugin name. */
$this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'tgmpa' );
$this->upgrader->strings['skin_update_failed'] = esc_attr__( 'The installation of %1$s failed.', 'tgmpa' );
if ( $this->tgmpa->is_automatic ) {
// Automatic activation strings.
$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' );
$this->upgrader->strings['skin_upgrade_start'] = esc_attr__( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' );
/* translators: 1: plugin name. */
$this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'tgmpa' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'tgmpa' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'tgmpa' ) . '</span>.</a>';
$this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'tgmpa' );
$this->upgrader->strings['skin_update_successful'] = esc_attr__( '%1$s installed and activated successfully.', 'tgmpa' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'tgmpa' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'tgmpa' ) . '</span>.</a>';
$this->upgrader->strings['skin_upgrade_end'] = esc_attr__( 'All installations and activations have been completed.', 'tgmpa' );
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
$this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
$this->upgrader->strings['skin_before_update_header'] = esc_attr__( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
} else {
// Default installation strings.
$this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' );
$this->upgrader->strings['skin_upgrade_start'] = esc_attr__( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' );
/* translators: 1: plugin name. */
$this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'tgmpa' ) . ' <a href="#" class="hide-if-no-js" onclick="%2$s"><span>' . esc_html__( 'Show Details', 'tgmpa' ) . '</span><span class="hidden">' . esc_html__( 'Hide Details', 'tgmpa' ) . '</span>.</a>';
$this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'tgmpa' );
$this->upgrader->strings['skin_upgrade_end'] = esc_attr__( 'All installations have been completed.', 'tgmpa' );
/* translators: 1: plugin name, 2: action number 3: total number of actions. */
$this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
$this->upgrader->strings['skin_before_update_header'] = esc_attr__( 'Installing Plugin %1$s (%2$d/%3$d)', 'tgmpa' );
}
}
}