PK ^[ maint/index.phpnu �[��� PK ^[#�/ػ � maint/repair.phpnu �[��� <?php
/**
* Database Repair and Optimization Script.
*
* @package WordPress
* @subpackage Database
*/
define( 'WP_REPAIRING', true );
require_once dirname( __DIR__, 2 ) . '/wp-load.php';
header( 'Content-Type: text/html; charset=utf-8' );
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="noindex,nofollow" />
<title><?php _e( 'WordPress › Database Repair' ); ?></title>
<?php wp_admin_css( 'install', true ); ?>
</head>
<body class="wp-core-ui">
<p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>"><?php _e( 'WordPress' ); ?></a></p>
<?php
if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) {
echo '<h1 class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'Allow automatic database repair' ) .
'</h1>';
echo '<p>';
printf(
/* translators: %s: wp-config.php */
__( 'To allow use of this page to automatically repair database problems, please add the following line to your %s file. Once this line is added to your config, reload this page.' ),
'<code>wp-config.php</code>'
);
echo "</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>";
$default_keys = array_unique(
array(
'put your unique phrase here',
/*
* translators: This string should only be translated if wp-config-sample.php is localized.
* You can check the localized release package or
* https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php
*/
__( 'put your unique phrase here' ),
)
);
$missing_key = false;
$duplicated_keys = array();
foreach ( array( 'AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT', 'LOGGED_IN_SALT', 'NONCE_SALT' ) as $key ) {
if ( defined( $key ) ) {
// Check for unique values of each key.
$duplicated_keys[ constant( $key ) ] = isset( $duplicated_keys[ constant( $key ) ] );
} else {
// If a constant is not defined, it's missing.
$missing_key = true;
}
}
// If at least one key uses a default value, consider it duplicated.
foreach ( $default_keys as $default_key ) {
if ( isset( $duplicated_keys[ $default_key ] ) ) {
$duplicated_keys[ $default_key ] = true;
}
}
// Weed out all unique, non-default values.
$duplicated_keys = array_filter( $duplicated_keys );
if ( $duplicated_keys || $missing_key ) {
echo '<h2 class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'Check secret keys' ) .
'</h2>';
/* translators: 1: wp-config.php, 2: Secret key service URL. */
echo '<p>' . sprintf( __( 'While you are editing your %1$s file, take a moment to make sure you have all 8 keys and that they are unique. You can generate these using the <a href="%2$s">WordPress.org secret key service</a>.' ), '<code>wp-config.php</code>', 'https://api.wordpress.org/secret-key/1.1/salt/' ) . '</p>';
}
} elseif ( isset( $_GET['repair'] ) ) {
echo '<h1 class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'Database repair results' ) .
'</h1>';
$optimize = '2' === $_GET['repair'];
$okay = true;
$problems = array();
$tables = $wpdb->tables();
/**
* Filters additional database tables to repair.
*
* @since 3.0.0
*
* @param string[] $tables Array of prefixed table names to be repaired.
*/
$tables = array_merge( $tables, (array) apply_filters( 'tables_to_repair', array() ) );
// Loop over the tables, checking and repairing as needed.
foreach ( $tables as $table ) {
$check = $wpdb->get_row( "CHECK TABLE $table" );
echo '<p>';
if ( 'OK' === $check->Msg_text ) {
/* translators: %s: Table name. */
printf( __( 'The %s table is okay.' ), "<code>$table</code>" );
} else {
/* translators: 1: Table name, 2: Error message. */
printf( __( 'The %1$s table is not okay. It is reporting the following error: %2$s. WordPress will attempt to repair this table…' ), "<code>$table</code>", "<code>$check->Msg_text</code>" );
$repair = $wpdb->get_row( "REPAIR TABLE $table" );
echo '<br /> ';
if ( 'OK' === $repair->Msg_text ) {
/* translators: %s: Table name. */
printf( __( 'Successfully repaired the %s table.' ), "<code>$table</code>" );
} else {
/* translators: 1: Table name, 2: Error message. */
printf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$repair->Msg_text</code>" ) . '<br />';
$problems[ $table ] = $repair->Msg_text;
$okay = false;
}
}
if ( $okay && $optimize ) {
$analyze = $wpdb->get_row( "ANALYZE TABLE $table" );
echo '<br /> ';
if ( 'Table is already up to date' === $analyze->Msg_text ) {
/* translators: %s: Table name. */
printf( __( 'The %s table is already optimized.' ), "<code>$table</code>" );
} else {
$optimize = $wpdb->get_row( "OPTIMIZE TABLE $table" );
echo '<br /> ';
if ( 'OK' === $optimize->Msg_text || 'Table is already up to date' === $optimize->Msg_text ) {
/* translators: %s: Table name. */
printf( __( 'Successfully optimized the %s table.' ), "<code>$table</code>" );
} else {
/* translators: 1: Table name. 2: Error message. */
printf( __( 'Failed to optimize the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$optimize->Msg_text</code>" );
}
}
}
echo '</p>';
}
if ( $problems ) {
printf(
/* translators: %s: URL to "Fixing WordPress" forum. */
'<p>' . __( 'Some database problems could not be repaired. Please copy-and-paste the following list of errors to the <a href="%s">WordPress support forums</a> to get additional assistance.' ) . '</p>',
__( 'https://wordpress.org/support/forum/how-to-and-troubleshooting' )
);
$problem_output = '';
foreach ( $problems as $table => $problem ) {
$problem_output .= "$table: $problem\n";
}
echo '<p><textarea name="errors" id="errors" rows="20" cols="60">' . esc_textarea( $problem_output ) . '</textarea></p>';
} else {
echo '<p>' . __( 'Repairs complete. Please remove the following line from wp-config.php to prevent this page from being used by unauthorized users.' ) . "</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>";
}
} else {
echo '<h1 class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'WordPress database repair' ) .
'</h1>';
if ( isset( $_GET['referrer'] ) && 'is_blog_installed' === $_GET['referrer'] ) {
echo '<p>' . __( 'One or more database tables are unavailable. To allow WordPress to attempt to repair these tables, press the “Repair Database” button. Repairing can take a while, so please be patient.' ) . '</p>';
} else {
echo '<p>' . __( 'WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.' ) . '</p>';
}
?>
<p class="step"><a class="button button-large" href="repair.php?repair=1"><?php _e( 'Repair Database' ); ?></a></p>
<p><?php _e( 'WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.' ); ?></p>
<p class="step"><a class="button button-large" href="repair.php?repair=2"><?php _e( 'Repair and Optimize Database' ); ?></a></p>
<?php
}
?>
</body>
</html>
PK ^[ maint/800731/index.phpnu �[��� PK ^[ maint/800731/.htaccessnu �[��� PK ^[tB�
OV OV options-general.phpnu �[��� <?php
/**
* General settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
/** WordPress Translation Installation API */
require_once ABSPATH . 'wp-admin/includes/translation-install.php';
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
}
// Used in the HTML title tag.
$title = __( 'General Settings' );
$parent_file = 'options-general.php';
/* translators: Date and time format for exact current time, mainly about timezones, see https://www.php.net/manual/datetime.format.php */
$timezone_format = _x( 'Y-m-d H:i:s', 'timezone date format' );
add_action( 'admin_head', 'options_general_add_js' );
$options_help = '<p>' . __( 'The fields on this screen determine some of the basics of your site setup.' ) . '</p>' .
'<p>' . __( 'Most themes show the site title at the top of every page, in the title bar of the browser, and as the identifying name for syndicated feeds. Many themes also show the tagline.' ) . '</p>';
if ( ! is_multisite() ) {
$options_help .= '<p>' . __( 'Two terms you will want to know are the WordPress URL and the site URL. The WordPress URL is where the core WordPress installation files are, and the site URL is the address a visitor uses in the browser to go to your site.' ) . '</p>' .
'<p>' . sprintf(
/* translators: %s: Documentation URL. */
__( 'Though the terms refer to two different concepts, in practice, they can be the same address or different. For example, you can have the core WordPress installation files in the root directory (<code>https://example.com</code>), in which case the two URLs would be the same. Or the <a href="%s">WordPress files can be in a subdirectory</a> (<code>https://example.com/wordpress</code>). In that case, the WordPress URL and the site URL would be different.' ),
__( 'https://developer.wordpress.org/advanced-administration/server/wordpress-in-directory/' )
) . '</p>' .
'<p>' . sprintf(
/* translators: 1: http://, 2: https:// */
__( 'Both WordPress URL and site URL can start with either %1$s or %2$s. A URL starting with %2$s requires an SSL certificate, so be sure that you have one before changing to %2$s. With %2$s, a padlock will appear next to the address in the browser address bar. Both %2$s and the padlock signal that your site meets some basic security requirements, which can build trust with your visitors and with search engines.' ),
'<code>http://</code>',
'<code>https://</code>'
) . '</p>' .
'<p>' . __( 'If you want site visitors to be able to register themselves, check the membership box. If you want the site administrator to register every new user, leave the box unchecked. In either case, you can set a default user role for all new users.' ) . '</p>';
}
$options_help .= '<p>' . __( 'You can set the language, and WordPress will automatically download and install the translation files (available if your filesystem is writable).' ) . '</p>' .
'<p>' . __( 'UTC means Coordinated Universal Time.' ) . '</p>' .
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>';
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' => $options_help,
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-general-screen/">Documentation on General Settings</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
<form method="post" action="options.php" novalidate="novalidate">
<?php settings_fields( 'general' ); ?>
<table class="form-table" role="presentation">
<tr>
<th scope="row"><label for="blogname"><?php _e( 'Site Title' ); ?></label></th>
<td><input name="blogname" type="text" id="blogname" value="<?php form_option( 'blogname' ); ?>" class="regular-text" /></td>
</tr>
<?php
if ( ! is_multisite() ) {
/* translators: Site tagline. */
$sample_tagline = __( 'Just another WordPress site' );
} else {
/* translators: %s: Network title. */
$sample_tagline = sprintf( __( 'Just another %s site' ), get_network()->site_name );
}
$tagline_description = sprintf(
/* translators: %s: Site tagline example. */
__( 'In a few words, explain what this site is about. Example: “%s.”' ),
$sample_tagline
);
?>
<tr>
<th scope="row"><label for="blogdescription"><?php _e( 'Tagline' ); ?></label></th>
<td><input name="blogdescription" type="text" id="blogdescription" aria-describedby="tagline-description" value="<?php form_option( 'blogdescription' ); ?>" class="regular-text" />
<p class="description" id="tagline-description"><?php echo $tagline_description; ?></p></td>
</tr>
<?php if ( current_user_can( 'upload_files' ) ) : ?>
<tr class="hide-if-no-js site-icon-section">
<th scope="row"><?php _e( 'Site Icon' ); ?></th>
<td>
<?php
wp_enqueue_media();
wp_enqueue_script( 'site-icon' );
$classes_for_upload_button = 'upload-button button-add-media button-add-site-icon';
$classes_for_update_button = 'button';
$classes_for_wrapper = '';
if ( has_site_icon() ) {
$classes_for_wrapper .= ' has-site-icon';
$classes_for_button = $classes_for_update_button;
$classes_for_button_on_change = $classes_for_upload_button;
} else {
$classes_for_wrapper .= ' hidden';
$classes_for_button = $classes_for_upload_button;
$classes_for_button_on_change = $classes_for_update_button;
}
// Handle alt text for site icon on page load.
$site_icon_id = (int) get_option( 'site_icon' );
$app_icon_alt_value = '';
$browser_icon_alt_value = '';
$site_icon_url = get_site_icon_url();
if ( $site_icon_id ) {
$img_alt = get_post_meta( $site_icon_id, '_wp_attachment_image_alt', true );
$filename = wp_basename( $site_icon_url );
$app_icon_alt_value = sprintf(
/* translators: %s: The selected image filename. */
__( 'App icon preview: The current image has no alternative text. The file name is: %s' ),
$filename
);
$browser_icon_alt_value = sprintf(
/* translators: %s: The selected image filename. */
__( 'Browser icon preview: The current image has no alternative text. The file name is: %s' ),
$filename
);
if ( $img_alt ) {
$app_icon_alt_value = sprintf(
/* translators: %s: The selected image alt text. */
__( 'App icon preview: Current image: %s' ),
$img_alt
);
$browser_icon_alt_value = sprintf(
/* translators: %s: The selected image alt text. */
__( 'Browser icon preview: Current image: %s' ),
$img_alt
);
}
}
?>
<style>
:root {
--site-icon-url: url( '<?php echo esc_url( $site_icon_url ); ?>' );
}
</style>
<div id="site-icon-preview" class="site-icon-preview settings <?php echo esc_attr( $classes_for_wrapper ); ?>">
<div class="direction-wrap">
<img id="app-icon-preview" src="<?php echo esc_url( $site_icon_url ); ?>" class="app-icon-preview" alt="<?php echo esc_attr( $app_icon_alt_value ); ?>" />
<div class="site-icon-preview-browser">
<svg role="img" aria-hidden="true" fill="none" xmlns="http://www.w3.org/2000/svg" class="browser-buttons"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 20a6 6 0 1 1 12 0 6 6 0 0 1-12 0Zm18 0a6 6 0 1 1 12 0 6 6 0 0 1-12 0Zm24-6a6 6 0 1 0 0 12 6 6 0 0 0 0-12Z" /></svg>
<div class="site-icon-preview-tab">
<img id="browser-icon-preview" src="<?php echo esc_url( $site_icon_url ); ?>" class="browser-icon-preview" alt="<?php echo esc_attr( $browser_icon_alt_value ); ?>" />
<div class="site-icon-preview-site-title" id="site-icon-preview-site-title" aria-hidden="true"><?php bloginfo( 'name' ); ?></div>
<svg role="img" aria-hidden="true" fill="none" xmlns="http://www.w3.org/2000/svg" class="close-button">
<path d="M12 13.0607L15.7123 16.773L16.773 15.7123L13.0607 12L16.773 8.28772L15.7123 7.22706L12 10.9394L8.28771 7.22705L7.22705 8.28771L10.9394 12L7.22706 15.7123L8.28772 16.773L12 13.0607Z" />
</svg>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" name="site_icon" id="site_icon_hidden_field" value="<?php form_option( 'site_icon' ); ?>" />
<div class="site-icon-action-buttons">
<button type="button"
id="choose-from-library-button"
class="<?php echo esc_attr( $classes_for_button ); ?>"
data-alt-classes="<?php echo esc_attr( $classes_for_button_on_change ); ?>"
data-size="512"
data-choose-text="<?php esc_attr_e( 'Choose a Site Icon' ); ?>"
data-update-text="<?php esc_attr_e( 'Change Site Icon' ); ?>"
data-update="<?php esc_attr_e( 'Set as Site Icon' ); ?>"
data-state="<?php echo esc_attr( has_site_icon() ); ?>"
>
<?php if ( has_site_icon() ) : ?>
<?php _e( 'Change Site Icon' ); ?>
<?php else : ?>
<?php _e( 'Choose a Site Icon' ); ?>
<?php endif; ?>
</button>
<button
id="js-remove-site-icon"
type="button"
<?php echo has_site_icon() ? 'class="button button-secondary reset remove-site-icon"' : 'class="button button-secondary reset hidden"'; ?>
>
<?php _e( 'Remove Site Icon' ); ?>
</button>
</div>
<p class="description">
<?php
printf(
/* translators: 1: pixel value for icon size. 2: pixel value for icon size. */
__( 'The Site Icon is what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. It should be square and at least <code>%1$s by %2$s</code> pixels.' ),
512,
512
);
?>
</p>
</td>
</tr>
<?php
endif;
/* End Site Icon */
if ( ! is_multisite() ) {
$wp_site_url_class = '';
$wp_home_class = '';
if ( defined( 'WP_SITEURL' ) ) {
$wp_site_url_class = ' disabled';
}
if ( defined( 'WP_HOME' ) ) {
$wp_home_class = ' disabled';
}
?>
<tr>
<th scope="row"><label for="siteurl"><?php _e( 'WordPress Address (URL)' ); ?></label></th>
<td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php echo $wp_site_url_class; ?>" /></td>
</tr>
<tr>
<th scope="row"><label for="home"><?php _e( 'Site Address (URL)' ); ?></label></th>
<td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php echo $wp_home_class; ?>" />
<?php if ( ! defined( 'WP_HOME' ) ) : ?>
<p class="description" id="home-description">
<?php
printf(
/* translators: %s: Documentation URL. */
__( 'Enter the same address here unless you <a href="%s">want your site home page to be different from your WordPress installation directory</a>.' ),
__( 'https://developer.wordpress.org/advanced-administration/server/wordpress-in-directory/' )
);
?>
</p>
<?php endif; ?>
</td>
</tr>
<?php } ?>
<tr>
<th scope="row"><label for="new_admin_email"><?php _e( 'Administration Email Address' ); ?></label></th>
<td><input name="new_admin_email" type="email" id="new_admin_email" aria-describedby="new-admin-email-description" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" />
<p class="description" id="new-admin-email-description"><?php _e( 'This address is used for admin purposes. If you change this, an email will be sent to your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?></p>
<?php
$new_admin_email = get_option( 'new_admin_email' );
if ( $new_admin_email && get_option( 'admin_email' ) !== $new_admin_email ) {
$pending_admin_email_message = sprintf(
/* translators: %s: New admin email. */
__( 'There is a pending change of the admin email to %s.' ),
'<code>' . esc_html( $new_admin_email ) . '</code>'
);
$pending_admin_email_message .= sprintf(
' <a href="%1$s">%2$s</a>',
esc_url( wp_nonce_url( admin_url( 'options.php?dismiss=new_admin_email' ), 'dismiss-' . get_current_blog_id() . '-new_admin_email' ) ),
__( 'Cancel' )
);
wp_admin_notice(
$pending_admin_email_message,
array(
'additional_classes' => array( 'updated', 'inline' ),
)
);
}
?>
</td>
</tr>
<?php if ( ! is_multisite() ) { ?>
<tr>
<th scope="row"><?php _e( 'Membership' ); ?></th>
<td> <fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Membership' );
?>
</span></legend><label for="users_can_register">
<input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked( '1', get_option( 'users_can_register' ) ); ?> />
<?php _e( 'Anyone can register' ); ?></label>
</fieldset></td>
</tr>
<tr>
<th scope="row"><label for="default_role"><?php _e( 'New User Default Role' ); ?></label></th>
<td>
<select name="default_role" id="default_role"><?php wp_dropdown_roles( get_option( 'default_role' ) ); ?></select>
</td>
</tr>
<?php
}
$languages = get_available_languages();
$translations = wp_get_available_translations();
if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array( WPLANG, $languages, true ) ) {
$languages[] = WPLANG;
}
if ( ! empty( $languages ) || ! empty( $translations ) ) {
?>
<tr>
<th scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?><span class="dashicons dashicons-translation" aria-hidden="true"></span></label></th>
<td>
<?php
$locale = get_locale();
if ( ! in_array( $locale, $languages, true ) ) {
$locale = '';
}
wp_dropdown_languages(
array(
'name' => 'WPLANG',
'id' => 'WPLANG',
'selected' => $locale,
'languages' => $languages,
'translations' => $translations,
'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),
)
);
// Add note about deprecated WPLANG constant.
if ( defined( 'WPLANG' ) && ( '' !== WPLANG ) && WPLANG !== $locale ) {
_deprecated_argument(
'define()',
'4.0.0',
/* translators: 1: WPLANG, 2: wp-config.php */
sprintf( __( 'The %1$s constant in your %2$s file is no longer needed.' ), 'WPLANG', 'wp-config.php' )
);
}
?>
</td>
</tr>
<?php
}
?>
<tr>
<?php
$current_offset = get_option( 'gmt_offset' );
$tzstring = get_option( 'timezone_string' );
$check_zone_info = true;
// Remove old Etc mappings. Fallback to gmt_offset.
if ( str_contains( $tzstring, 'Etc/GMT' ) ) {
$tzstring = '';
}
if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists.
$check_zone_info = false;
if ( 0 === (int) $current_offset ) {
$tzstring = 'UTC+0';
} elseif ( $current_offset < 0 ) {
$tzstring = 'UTC' . $current_offset;
} else {
$tzstring = 'UTC+' . $current_offset;
}
}
?>
<th scope="row"><label for="timezone_string"><?php _e( 'Timezone' ); ?></label></th>
<td>
<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">
<?php echo wp_timezone_choice( $tzstring, get_user_locale() ); ?>
</select>
<p class="description" id="timezone-description">
<?php
printf(
/* translators: %s: UTC abbreviation */
__( 'Choose either a city in the same timezone as you or a %s (Coordinated Universal Time) time offset.' ),
'<abbr>UTC</abbr>'
);
?>
</p>
<p class="timezone-info">
<span id="utc-time">
<?php
printf(
/* translators: %s: UTC time. */
__( 'Universal time is %s.' ),
'<code>' . date_i18n( $timezone_format, false, true ) . '</code>'
);
?>
</span>
<?php if ( get_option( 'timezone_string' ) || ! empty( $current_offset ) ) : ?>
<span id="local-time">
<?php
printf(
/* translators: %s: Local time. */
__( 'Local time is %s.' ),
'<code>' . date_i18n( $timezone_format ) . '</code>'
);
?>
</span>
<?php endif; ?>
</p>
<?php if ( $check_zone_info && $tzstring ) : ?>
<p class="timezone-info">
<span>
<?php
$now = new DateTime( 'now', new DateTimeZone( $tzstring ) );
$dst = (bool) $now->format( 'I' );
if ( $dst ) {
_e( 'This timezone is currently in daylight saving time.' );
} else {
_e( 'This timezone is currently in standard time.' );
}
?>
<br />
<?php
if ( in_array( $tzstring, timezone_identifiers_list( DateTimeZone::ALL_WITH_BC ), true ) ) {
$transitions = timezone_transitions_get( timezone_open( $tzstring ), time() );
// 0 index is the state at current time, 1 index is the next transition, if any.
if ( ! empty( $transitions[1] ) ) {
echo ' ';
$message = $transitions[1]['isdst'] ?
/* translators: %s: Date and time. */
__( 'Daylight saving time begins on: %s.' ) :
/* translators: %s: Date and time. */
__( 'Standard time begins on: %s.' );
printf(
$message,
'<code>' . wp_date( __( 'F j, Y' ) . ' ' . __( 'g:i a' ), $transitions[1]['ts'] ) . '</code>'
);
} else {
_e( 'This timezone does not observe daylight saving time.' );
}
}
?>
</span>
</p>
<?php endif; ?>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Date Format' ); ?></th>
<td>
<fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Date Format' );
?>
</span></legend>
<?php
/**
* Filters the default date formats.
*
* @since 2.7.0
* @since 4.0.0 Replaced the `Y/m/d` format with `Y-m-d` (ISO date standard YYYY-MM-DD).
* @since 6.8.0 Added the `d.m.Y` format.
*
* @param string[] $default_date_formats Array of default date formats.
*/
$date_formats = array_unique( apply_filters( 'date_formats', array( __( 'F j, Y' ), 'Y-m-d', 'm/d/Y', 'd/m/Y', 'd.m.Y' ) ) );
$custom = true;
foreach ( $date_formats as $format ) {
echo "\t<label><input type='radio' name='date_format' value='" . esc_attr( $format ) . "'";
if ( get_option( 'date_format' ) === $format ) { // checked() uses "==" rather than "===".
echo " checked='checked'";
$custom = false;
}
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
}
echo '<label><input type="radio" name="date_format" id="date_format_custom_radio" value="\c\u\s\t\o\m"';
checked( $custom );
echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' .
/* translators: Hidden accessibility text. */
__( 'enter a custom date format in the following field' ) .
'</span></span></label>' .
'<label for="date_format_custom" class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'Custom date format:' ) .
'</label>' .
'<input type="text" name="date_format_custom" id="date_format_custom" value="' . esc_attr( get_option( 'date_format' ) ) . '" class="small-text" />' .
'<br />' .
'<p><strong>' . __( 'Preview:' ) . '</strong> <span class="example">' . date_i18n( get_option( 'date_format' ) ) . '</span>' .
"<span class='spinner'></span>\n" . '</p>';
?>
</fieldset>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Time Format' ); ?></th>
<td>
<fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Time Format' );
?>
</span></legend>
<?php
/**
* Filters the default time formats.
*
* @since 2.7.0
*
* @param string[] $default_time_formats Array of default time formats.
*/
$time_formats = array_unique( apply_filters( 'time_formats', array( __( 'g:i a' ), 'g:i A', 'H:i' ) ) );
$custom = true;
foreach ( $time_formats as $format ) {
echo "\t<label><input type='radio' name='time_format' value='" . esc_attr( $format ) . "'";
if ( get_option( 'time_format' ) === $format ) { // checked() uses "==" rather than "===".
echo " checked='checked'";
$custom = false;
}
echo ' /> <span class="date-time-text format-i18n">' . date_i18n( $format ) . '</span><code>' . esc_html( $format ) . "</code></label><br />\n";
}
echo '<label><input type="radio" name="time_format" id="time_format_custom_radio" value="\c\u\s\t\o\m"';
checked( $custom );
echo '/> <span class="date-time-text date-time-custom-text">' . __( 'Custom:' ) . '<span class="screen-reader-text"> ' .
/* translators: Hidden accessibility text. */
__( 'enter a custom time format in the following field' ) .
'</span></span></label>' .
'<label for="time_format_custom" class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'Custom time format:' ) .
'</label>' .
'<input type="text" name="time_format_custom" id="time_format_custom" value="' . esc_attr( get_option( 'time_format' ) ) . '" class="small-text" />' .
'<br />' .
'<p><strong>' . __( 'Preview:' ) . '</strong> <span class="example">' . date_i18n( get_option( 'time_format' ) ) . '</span>' .
"<span class='spinner'></span>\n" . '</p>';
echo "\t<p class='date-time-doc'>" . __( '<a href="https://wordpress.org/documentation/article/customize-date-and-time-format/">Documentation on date and time formatting</a>.' ) . "</p>\n";
?>
</fieldset>
</td>
</tr>
<tr>
<th scope="row"><label for="start_of_week"><?php _e( 'Week Starts On' ); ?></label></th>
<td><select name="start_of_week" id="start_of_week">
<?php
/**
* @global WP_Locale $wp_locale WordPress date and time locale object.
*/
global $wp_locale;
for ( $day_index = 0; $day_index <= 6; $day_index++ ) :
$selected = ( (int) get_option( 'start_of_week' ) === $day_index ) ? 'selected="selected"' : '';
echo "\n\t<option value='" . esc_attr( $day_index ) . "' $selected>" . $wp_locale->get_weekday( $day_index ) . '</option>';
endfor;
?>
</select></td>
</tr>
<?php do_settings_fields( 'general', 'default' ); ?>
</table>
<?php do_settings_sections( 'general' ); ?>
<?php submit_button(); ?>
</form>
</div>
<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>
PK ^[~R�RT T media-upload.phpnu �[��� <?php
/**
* Manage media uploaded file.
*
* There are many filters in here for media. Plugins can extend functionality
* by hooking into the filters.
*
* @package WordPress
* @subpackage Administration
*/
if ( ! isset( $_GET['inline'] ) ) {
define( 'IFRAME_REQUEST', true );
}
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'upload_files' ) ) {
wp_die( __( 'Sorry, you are not allowed to upload files.' ), 403 );
}
wp_enqueue_script( 'plupload-handlers' );
wp_enqueue_script( 'image-edit' );
wp_enqueue_script( 'set-post-thumbnail' );
wp_enqueue_style( 'imgareaselect' );
wp_enqueue_script( 'media-gallery' );
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
// IDs should be integers.
$ID = isset( $ID ) ? (int) $ID : 0; // phpcs:ignore WordPress.NamingConventions.ValidVariableName
$post_id = isset( $post_id ) ? (int) $post_id : 0;
// Require an ID for the edit screen.
if ( isset( $action ) && 'edit' === $action && ! $ID ) { // phpcs:ignore WordPress.NamingConventions.ValidVariableName
wp_die(
'<h1>' . __( 'An error occurred during the upload process.' ) . '</h1>' .
'<p>' . __( 'Invalid item ID. You can view all media items in the <a href="upload.php">Media Library</a>.' ) . '</p>',
403
);
}
if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post', $_REQUEST['post_id'] ) ) {
wp_die(
'<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' .
'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
403
);
}
// Upload type: image, video, file, ...?
if ( isset( $_GET['type'] ) ) {
$type = (string) $_GET['type'];
} else {
/**
* Filters the default media upload type in the legacy (pre-3.5.0) media popup.
*
* @since 2.5.0
*
* @param string $type The default media upload type. Possible values include
* 'image', 'audio', 'video', 'file', etc. Default 'file'.
*/
$type = apply_filters( 'media_upload_default_type', 'file' );
}
// Tab: gallery, library, or type-specific.
if ( isset( $_GET['tab'] ) ) {
$tab = (string) $_GET['tab'];
} else {
/**
* Filters the default tab in the legacy (pre-3.5.0) media popup.
*
* @since 2.5.0
*
* @param string $tab The default media popup tab. Default 'type' (From Computer).
*/
$tab = apply_filters( 'media_upload_default_tab', 'type' );
}
$body_id = 'media-upload';
// Let the action code decide how to handle the request.
if ( 'type' === $tab || 'type_url' === $tab || ! array_key_exists( $tab, media_upload_tabs() ) ) {
/**
* Fires inside specific upload-type views in the legacy (pre-3.5.0)
* media popup based on the current tab.
*
* The dynamic portion of the hook name, `$type`, refers to the specific
* media upload type.
*
* The hook only fires if the current `$tab` is 'type' (From Computer),
* 'type_url' (From URL), or, if the tab does not exist (i.e., has not
* been registered via the {@see 'media_upload_tabs'} filter.
*
* Possible hook names include:
*
* - `media_upload_audio`
* - `media_upload_file`
* - `media_upload_image`
* - `media_upload_video`
*
* @since 2.5.0
*/
do_action( "media_upload_{$type}" );
} else {
/**
* Fires inside limited and specific upload-tab views in the legacy
* (pre-3.5.0) media popup.
*
* The dynamic portion of the hook name, `$tab`, refers to the specific
* media upload tab. Possible values include 'library' (Media Library),
* or any custom tab registered via the {@see 'media_upload_tabs'} filter.
*
* @since 2.5.0
*/
do_action( "media_upload_{$tab}" );
}
PK ^[�Q�v] v] theme-install.phpnu �[��� <?php
/**
* Install theme administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
require ABSPATH . 'wp-admin/includes/theme-install.php';
$tab = ! empty( $_REQUEST['tab'] ) ? sanitize_text_field( $_REQUEST['tab'] ) : '';
if ( ! current_user_can( 'install_themes' ) ) {
wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
}
if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'theme-install.php' ) );
exit;
}
// Used in the HTML title tag.
$title = __( 'Add Themes' );
$parent_file = 'themes.php';
if ( ! is_network_admin() ) {
$submenu_file = 'themes.php';
}
$installed_themes = search_theme_directories();
if ( false === $installed_themes ) {
$installed_themes = array();
}
foreach ( $installed_themes as $theme_slug => $theme_data ) {
// Ignore child themes.
if ( str_contains( $theme_slug, '/' ) ) {
unset( $installed_themes[ $theme_slug ] );
}
}
wp_localize_script(
'theme',
'_wpThemeSettings',
array(
'themes' => false,
'settings' => array(
'isInstall' => true,
'canInstall' => current_user_can( 'install_themes' ),
'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null,
'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ),
),
'l10n' => array(
'addNew' => __( 'Add Theme' ),
'search' => __( 'Search Themes' ),
'upload' => __( 'Upload Theme' ),
'back' => __( 'Back' ),
'error' => sprintf(
/* translators: %s: Support forums URL. */
__( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ),
__( 'https://wordpress.org/support/forums/' )
),
'tryAgain' => __( 'Try Again' ),
/* translators: %d: Number of themes. */
'themesFound' => __( 'Number of Themes found: %d' ),
'noThemesFound' => __( 'No themes found. Try a different search.' ),
'collapseSidebar' => __( 'Collapse Sidebar' ),
'expandSidebar' => __( 'Expand Sidebar' ),
/* translators: Hidden accessibility text. */
'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ),
),
'installedThemes' => array_keys( $installed_themes ),
'activeTheme' => get_stylesheet(),
)
);
wp_enqueue_script( 'theme' );
wp_enqueue_script( 'updates' );
if ( $tab ) {
/**
* Fires before each of the tabs are rendered on the Install Themes page.
*
* The dynamic portion of the hook name, `$tab`, refers to the current
* theme installation tab.
*
* Possible hook names include:
*
* - `install_themes_pre_block-themes`
* - `install_themes_pre_dashboard`
* - `install_themes_pre_featured`
* - `install_themes_pre_new`
* - `install_themes_pre_search`
* - `install_themes_pre_updated`
* - `install_themes_pre_upload`
*
* @since 2.8.0
* @since 6.1.0 Added the `install_themes_pre_block-themes` hook name.
*/
do_action( "install_themes_pre_{$tab}" );
}
$help_overview =
'<p>' . sprintf(
/* translators: %s: Theme Directory URL. */
__( 'You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s">WordPress Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.' ),
__( 'https://wordpress.org/themes/' )
) . '</p>' .
'<p>' . __( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
'<p>' . __( 'Alternately, you can browse the themes that are Popular or Latest. When you find a theme you like, you can preview it or install it.' ) . '</p>' .
'<p>' . sprintf(
/* translators: %s: /wp-content/themes */
__( 'You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme’s folder via FTP into your %s directory.' ),
'<code>/wp-content/themes</code>'
) . '</p>';
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' => $help_overview,
)
);
$help_installing =
'<p>' . __( 'Once you have generated a list of themes, you can preview and install any of them. Click on the thumbnail of the theme you are interested in previewing. It will open up in a full-screen Preview page to give you a better idea of how that theme will look.' ) . '</p>' .
'<p>' . __( 'To install the theme so you can preview it with your site’s content and customize its theme options, click the "Install" button at the top of the left-hand pane. The theme files will be downloaded to your website automatically. When this is complete, the theme is now available for activation, which you can do by clicking the "Activate" link, or by navigating to your Manage Themes screen and clicking the "Live Preview" link under any installed theme’s thumbnail image.' ) . '</p>';
get_current_screen()->add_help_tab(
array(
'id' => 'installing',
'title' => __( 'Previewing and Installing' ),
'content' => $help_installing,
)
);
// Help tab: Block themes.
$help_block_themes =
'<p>' . __( 'A block theme is a theme that uses blocks for all parts of a site including navigation menus, header, content, and site footer. These themes are built for the features that allow you to edit and customize all parts of your site.' ) . '</p>' .
'<p>' . __( 'With a block theme, you can place and edit blocks without affecting your content by customizing or creating new templates.' ) . '</p>';
get_current_screen()->add_help_tab(
array(
'id' => 'block_themes',
'title' => __( 'Block themes' ),
'content' => $help_block_themes,
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/appearance-themes-screen/#install-themes">Documentation on Adding New Themes</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/block-themes/">Documentation on Block Themes</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
<?php
/**
* Filters the tabs shown on the Add Themes screen.
*
* This filter is for backward compatibility only, for the suppression of the upload tab.
*
* @since 2.8.0
*
* @param string[] $tabs Associative array of the tabs shown on the Add Themes screen. Default is 'upload'.
*/
$tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );
if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) {
echo ' <button type="button" class="upload-view-toggle page-title-action hide-if-no-js" aria-expanded="false">' . __( 'Upload Theme' ) . '</button>';
}
?>
<hr class="wp-header-end">
<?php
wp_admin_notice(
__( 'The Theme Installer screen requires JavaScript.' ),
array(
'additional_classes' => array( 'error', 'hide-if-js' ),
)
);
?>
<div class="upload-theme">
<?php install_themes_upload(); ?>
</div>
<h2 class="screen-reader-text hide-if-no-js">
<?php
/* translators: Hidden accessibility text. */
_e( 'Filter themes list' );
?>
</h2>
<div class="wp-filter hide-if-no-js">
<div class="filter-count">
<span class="count theme-count"></span>
</div>
<ul class="filter-links">
<li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
<li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
<li><a href="#" data-sort="block-themes"><?php _ex( 'Block Themes', 'themes' ); ?></a></li>
<li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li>
</ul>
<button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button>
<form class="search-form"><p class="search-box"></p></form>
<div class="favorites-form">
<?php
$action = 'save_wporg_username_' . get_current_user_id();
if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( wp_unslash( $_GET['_wpnonce'] ), $action ) ) {
$user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
} else {
$user = get_user_option( 'wporg_favorites' );
}
?>
<p class="install-help"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p>
<p class="favorites-username">
<label for="wporg-username-input"><?php _e( 'Your WordPress.org username:' ); ?></label>
<input type="hidden" id="wporg-username-nonce" name="_wpnonce" value="<?php echo esc_attr( wp_create_nonce( $action ) ); ?>" />
<input type="search" id="wporg-username-input" value="<?php echo esc_attr( $user ); ?>" />
<input type="button" class="button favorites-form-submit" value="<?php esc_attr_e( 'Get Favorites' ); ?>" />
</p>
</div>
<div class="filter-drawer">
<div class="buttons">
<button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
<button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
</div>
<?php
// Use the core list, rather than the .org API, due to inconsistencies
// and to ensure tags are translated.
$feature_list = get_theme_feature_list( false );
foreach ( $feature_list as $feature_group => $features ) {
echo '<fieldset class="filter-group">';
echo '<legend>' . esc_html( $feature_group ) . '</legend>';
echo '<div class="filter-group-feature">';
foreach ( $features as $feature => $feature_name ) {
$feature = esc_attr( $feature );
echo '<input type="checkbox" id="filter-id-' . $feature . '" value="' . $feature . '" /> ';
echo '<label for="filter-id-' . $feature . '">' . esc_html( $feature_name ) . '</label>';
}
echo '</div>';
echo '</fieldset>';
}
?>
<div class="buttons">
<button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button>
<button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button>
</div>
<div class="filtered-by">
<span><?php _e( 'Filtering by:' ); ?></span>
<div class="tags"></div>
<button type="button" class="button-link edit-filters"><?php _e( 'Edit Filters' ); ?></button>
</div>
</div>
</div>
<h2 class="screen-reader-text hide-if-no-js">
<?php
/* translators: Hidden accessibility text. */
_e( 'Themes list' );
?>
</h2>
<div class="theme-browser content-filterable"></div>
<div class="theme-install-overlay wp-full-overlay expanded"></div>
<p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
<span class="spinner"></span>
<?php
if ( $tab ) {
/**
* Fires at the top of each of the tabs on the Install Themes page.
*
* The dynamic portion of the hook name, `$tab`, refers to the current
* theme installation tab.
*
* Possible hook names include:
*
* - `install_themes_block-themes`
* - `install_themes_dashboard`
* - `install_themes_featured`
* - `install_themes_new`
* - `install_themes_search`
* - `install_themes_updated`
* - `install_themes_upload`
*
* @since 2.8.0
* @since 6.1.0 Added the `install_themes_block-themes` hook name.
*
* @param int $paged Number of the current page of results being viewed.
*/
do_action( "install_themes_{$tab}", $paged );
}
?>
</div>
<script id="tmpl-theme" type="text/template">
<# if ( data.screenshot_url ) { #>
<div class="theme-screenshot">
<img src="{{ data.screenshot_url }}?ver={{ data.version }}" alt="" />
</div>
<# } else { #>
<div class="theme-screenshot blank"></div>
<# } #>
<# if ( data.installed ) { #>
<?php
wp_admin_notice(
_x( 'Installed', 'theme' ),
array(
'type' => 'success',
'additional_classes' => array( 'notice-alt' ),
)
);
?>
<# } #>
<# if ( ! data.compatible_wp || ! data.compatible_php ) { #>
<div class="notice notice-error notice-alt"><p>
<# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
<?php
_e( 'This theme does not work with your versions of WordPress and PHP.' );
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
self_admin_url( 'update-core.php' )
);
} elseif ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '</p><p><em>', '</em>' );
}
?>
<# } else if ( ! data.compatible_wp ) { #>
<?php
_e( 'This theme does not work with your version of WordPress.' );
if ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
self_admin_url( 'update-core.php' )
);
}
?>
<# } else if ( ! data.compatible_php ) { #>
<?php
_e( 'This theme does not work with your version of PHP.' );
if ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '</p><p><em>', '</em>' );
}
?>
<# } #>
</p></div>
<# } #>
<span class="more-details"><?php _ex( 'Details & Preview', 'theme' ); ?></span>
<div class="theme-author">
<?php
/* translators: %s: Theme author name. */
printf( __( 'By %s' ), '{{ data.author }}' );
?>
</div>
<div class="theme-id-container">
<h3 class="theme-name">{{ data.name }}</h3>
<div class="theme-actions">
<# if ( data.installed ) { #>
<# if ( data.compatible_wp && data.compatible_php ) { #>
<?php
/* translators: %s: Theme name. */
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
?>
<# if ( data.activate_url ) { #>
<# if ( ! data.active ) { #>
<a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
<# } else { #>
<button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
<# } #>
<# } #>
<# if ( data.customize_url ) { #>
<# if ( ! data.active ) { #>
<# if ( ! data.block_theme ) { #>
<a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Live Preview' ); ?></a>
<# } #>
<# } else { #>
<a class="button load-customize" href="{{ data.customize_url }}"><?php _e( 'Customize' ); ?></a>
<# } #>
<# } else { #>
<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
<# } #>
<# } else { #>
<?php
/* translators: %s: Theme name. */
$aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
?>
<# if ( data.activate_url ) { #>
<a class="button button-primary disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
<# } #>
<# if ( data.customize_url ) { #>
<a class="button disabled"><?php _e( 'Live Preview' ); ?></a>
<# } else { #>
<button class="button disabled"><?php _e( 'Preview' ); ?></button>
<# } #>
<# } #>
<# } else { #>
<# if ( data.compatible_wp && data.compatible_php ) { #>
<?php
/* translators: %s: Theme name. */
$aria_label = sprintf( _x( 'Install %s', 'theme' ), '{{ data.name }}' );
?>
<a class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}" href="{{ data.install_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Install' ); ?></a>
<button class="button preview install-theme-preview"><?php _e( 'Preview' ); ?></button>
<# } else { #>
<?php
/* translators: %s: Theme name. */
$aria_label = sprintf( _x( 'Cannot Install %s', 'theme' ), '{{ data.name }}' );
?>
<a class="button button-primary disabled" data-name="{{ data.name }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _ex( 'Cannot Install', 'theme' ); ?></a>
<button class="button disabled"><?php _e( 'Preview' ); ?></button>
<# } #>
<# } #>
</div>
</div>
</script>
<script id="tmpl-theme-preview" type="text/template">
<div class="wp-full-overlay-sidebar">
<div class="wp-full-overlay-header">
<button class="close-full-overlay"><span class="screen-reader-text">
<?php
/* translators: Hidden accessibility text. */
_e( 'Close' );
?>
</span></button>
<button class="previous-theme"><span class="screen-reader-text">
<?php
/* translators: Hidden accessibility text. */
_e( 'Previous theme' );
?>
</span></button>
<button class="next-theme"><span class="screen-reader-text">
<?php
/* translators: Hidden accessibility text. */
_e( 'Next theme' );
?>
</span></button>
<# if ( data.installed ) { #>
<# if ( data.compatible_wp && data.compatible_php ) { #>
<?php
/* translators: %s: Theme name. */
$aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
?>
<# if ( ! data.active ) { #>
<a class="button button-primary activate" href="{{ data.activate_url }}" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
<# } else { #>
<button class="button button-primary disabled"><?php _ex( 'Activated', 'theme' ); ?></button>
<# } #>
<# } else { #>
<a class="button button-primary disabled" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
<# } #>
<# } else { #>
<# if ( data.compatible_wp && data.compatible_php ) { #>
<a href="{{ data.install_url }}" class="button button-primary theme-install" data-name="{{ data.name }}" data-slug="{{ data.id }}"><?php _e( 'Install' ); ?></a>
<# } else { #>
<a class="button button-primary disabled" ><?php _ex( 'Cannot Install', 'theme' ); ?></a>
<# } #>
<# } #>
</div>
<div class="wp-full-overlay-sidebar-content">
<div class="install-theme-info">
<h3 class="theme-name">{{ data.name }}</h3>
<span class="theme-by">
<?php
/* translators: %s: Theme author name. */
printf( __( 'By %s' ), '{{ data.author }}' );
?>
</span>
<div class="theme-screenshot">
<img class="theme-screenshot" src="{{ data.screenshot_url }}?ver={{ data.version }}" alt="" />
</div>
<div class="theme-details">
<# if ( data.rating ) { #>
<div class="theme-rating">
{{{ data.stars }}}
<a class="num-ratings" href="{{ data.reviews_url }}">
<?php
/* translators: %s: Number of ratings. */
printf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
?>
</a>
</div>
<# } else { #>
<span class="no-rating"><?php _e( 'This theme has not been rated yet.' ); ?></span>
<# } #>
<div class="theme-version">
<?php
/* translators: %s: Theme version. */
printf( __( 'Version: %s' ), '{{ data.version }}' );
?>
</div>
<# if ( ! data.compatible_wp || ! data.compatible_php ) { #>
<div class="notice notice-error notice-alt notice-large"><p>
<# if ( ! data.compatible_wp && ! data.compatible_php ) { #>
<?php
_e( 'This theme does not work with your versions of WordPress and PHP.' );
if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
printf(
/* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
self_admin_url( 'update-core.php' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '</p><p><em>', '</em>' );
} elseif ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
self_admin_url( 'update-core.php' )
);
} elseif ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '</p><p><em>', '</em>' );
}
?>
<# } else if ( ! data.compatible_wp ) { #>
<?php
_e( 'This theme does not work with your version of WordPress.' );
if ( current_user_can( 'update_core' ) ) {
printf(
/* translators: %s: URL to WordPress Updates screen. */
' ' . __( '<a href="%s">Please update WordPress</a>.' ),
self_admin_url( 'update-core.php' )
);
}
?>
<# } else if ( ! data.compatible_php ) { #>
<?php
_e( 'This theme does not work with your version of PHP.' );
if ( current_user_can( 'update_php' ) ) {
printf(
/* translators: %s: URL to Update PHP page. */
' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
esc_url( wp_get_update_php_url() )
);
wp_update_php_annotation( '</p><p><em>', '</em>' );
}
?>
<# } #>
</p></div>
<# } #>
<div class="theme-description">{{{ data.description }}}</div>
</div>
</div>
</div>
<div class="wp-full-overlay-footer">
<button type="button" class="collapse-sidebar button" aria-expanded="true" aria-label="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
<span class="collapse-sidebar-arrow"></span>
<span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
</button>
</div>
</div>
<div class="wp-full-overlay-main">
<iframe src="{{ data.preview_url }}" title="<?php esc_attr_e( 'Preview' ); ?>"></iframe>
</div>
</script>
<?php
wp_print_request_filesystem_credentials_modal();
wp_print_admin_notice_templates();
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK ^[W6@r admin-footer.phpnu �[��� <?php
/**
* WordPress Administration Template Footer
*
* @package WordPress
* @subpackage Administration
*/
// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
/**
* @global string $hook_suffix
*/
global $hook_suffix;
?>
<div class="clear"></div></div><!-- wpbody-content -->
<div class="clear"></div></div><!-- wpbody -->
<div class="clear"></div></div><!-- wpcontent -->
<div id="wpfooter" role="contentinfo">
<?php
/**
* Fires after the opening tag for the admin footer.
*
* @since 2.5.0
*/
do_action( 'in_admin_footer' );
?>
<p id="footer-left" class="alignleft">
<?php
$text = sprintf(
/* translators: %s: https://wordpress.org/ */
__( 'Thank you for creating with <a href="%s">WordPress</a>.' ),
esc_url( __( 'https://wordpress.org/' ) )
);
/**
* Filters the "Thank you" text displayed in the admin footer.
*
* @since 2.8.0
*
* @param string $text The content that will be printed.
*/
echo apply_filters( 'admin_footer_text', '<span id="footer-thankyou">' . $text . '</span>' );
?>
</p>
<p id="footer-upgrade" class="alignright">
<?php
/**
* Filters the version/update text displayed in the admin footer.
*
* WordPress prints the current version and update information,
* using core_update_footer() at priority 10.
*
* @since 2.3.0
*
* @see core_update_footer()
*
* @param string $content The content that will be printed.
*/
echo apply_filters( 'update_footer', '' );
?>
</p>
<div class="clear"></div>
</div>
<?php
/**
* Prints scripts or data before the default footer scripts.
*
* @since 1.2.0
*
* @param string $data The data to print.
*/
do_action( 'admin_footer', '' );
/**
* Prints scripts and data queued for the footer.
*
* The dynamic portion of the hook name, `$hook_suffix`,
* refers to the global hook suffix of the current page.
*
* @since 4.6.0
*/
do_action( "admin_print_footer_scripts-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
/**
* Prints any scripts and data queued for the footer.
*
* @since 2.8.0
*/
do_action( 'admin_print_footer_scripts' );
/**
* Prints scripts or data after the default footer scripts.
*
* The dynamic portion of the hook name, `$hook_suffix`,
* refers to the global hook suffix of the current page.
*
* @since 2.8.0
*/
do_action( "admin_footer-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
// get_site_option() won't exist when auto upgrading from <= 2.7.
if ( function_exists( 'get_site_option' )
&& false === get_site_option( 'can_compress_scripts' )
) {
compression_test();
}
?>
<div class="clear"></div></div><!-- wpwrap -->
<script type="text/javascript">if(typeof wpOnload==='function')wpOnload();</script>
</body>
</html>
PK ^[H�S�� �
media-new.phpnu �[��� <?php
/**
* Manage media uploaded file.
*
* There are many filters in here for media. Plugins can extend functionality
* by hooking into the filters.
*
* @package WordPress
* @subpackage Administration
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'upload_files' ) ) {
wp_die( __( 'Sorry, you are not allowed to upload files.' ) );
}
wp_enqueue_script( 'plupload-handlers' );
$post_id = 0;
if ( isset( $_REQUEST['post_id'] ) ) {
$post_id = absint( $_REQUEST['post_id'] );
if ( ! get_post( $post_id ) || ! current_user_can( 'edit_post', $post_id ) ) {
$post_id = 0;
}
}
if ( $_POST ) {
if ( isset( $_POST['html-upload'] ) && ! empty( $_FILES ) ) {
check_admin_referer( 'media-form' );
// Upload File button was clicked.
$upload_id = media_handle_upload( 'async-upload', $post_id );
if ( is_wp_error( $upload_id ) ) {
wp_die( $upload_id );
}
}
wp_redirect( admin_url( 'upload.php' ) );
exit;
}
// Used in the HTML title tag.
$title = __( 'Upload New Media' );
$parent_file = 'upload.php';
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . __( 'You can upload media files here without creating a post first. This allows you to upload files to use with posts and pages later and/or to get a web link for a particular file that you can share. There are three options for uploading files:' ) . '</p>' .
'<ul>' .
'<li>' . __( '<strong>Drag and drop</strong> your files into the area below. Multiple files are allowed.' ) . '</li>' .
'<li>' . __( 'Clicking <strong>Select Files</strong> opens a navigation window showing you files in your operating system. Selecting <strong>Open</strong> after clicking on the file you want activates a progress bar on the uploader screen.' ) . '</li>' .
'<li>' . __( 'Revert to the <strong>Browser Uploader</strong> by clicking the link below the drag and drop box.' ) . '</li>' .
'</ul>',
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/media-add-new-screen/">Documentation on Uploading Media Files</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
require_once ABSPATH . 'wp-admin/admin-header.php';
$form_class = 'media-upload-form type-form validate';
if ( get_user_setting( 'uploader' ) || isset( $_GET['browser-uploader'] ) ) {
$form_class .= ' html-uploader';
}
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( admin_url( 'media-new.php' ) ); ?>" class="<?php echo esc_attr( $form_class ); ?>" id="file-form">
<?php media_upload_form(); ?>
<script type="text/javascript">
var post_id = <?php echo absint( $post_id ); ?>, shortform = 3;
</script>
<input type="hidden" name="post_id" id="post_id" value="<?php echo absint( $post_id ); ?>" />
<?php wp_nonce_field( 'media-form' ); ?>
<div id="media-items" class="hide-if-no-js"></div>
</form>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK ^[��n�(� (�
user-edit.phpnu �[��� <?php
/**
* Edit user administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
/** WordPress Translation Installation API */
require_once ABSPATH . 'wp-admin/includes/translation-install.php';
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
$user_id = ! empty( $_REQUEST['user_id'] ) ? absint( $_REQUEST['user_id'] ) : 0;
$wp_http_referer = ! empty( $_REQUEST['wp_http_referer'] ) ? sanitize_url( $_REQUEST['wp_http_referer'] ) : '';
$current_user = wp_get_current_user();
if ( ! defined( 'IS_PROFILE_PAGE' ) ) {
define( 'IS_PROFILE_PAGE', ( $user_id === $current_user->ID ) );
}
if ( ! $user_id && IS_PROFILE_PAGE ) {
$user_id = $current_user->ID;
} elseif ( ! $user_id && ! IS_PROFILE_PAGE ) {
wp_die( __( 'Invalid user ID.' ) );
} elseif ( ! get_userdata( $user_id ) ) {
wp_die( __( 'Invalid user ID.' ) );
}
wp_enqueue_script( 'user-profile' );
if ( wp_is_application_passwords_available_for_user( $user_id ) ) {
wp_enqueue_script( 'application-passwords' );
}
if ( IS_PROFILE_PAGE ) {
// Used in the HTML title tag.
$title = __( 'Profile' );
} else {
// Used in the HTML title tag.
/* translators: %s: User's display name. */
$title = __( 'Edit User %s' );
}
if ( current_user_can( 'edit_users' ) && ! IS_PROFILE_PAGE ) {
$submenu_file = 'users.php';
} else {
$submenu_file = 'profile.php';
}
if ( current_user_can( 'edit_users' ) && ! is_user_admin() ) {
$parent_file = 'users.php';
} else {
$parent_file = 'profile.php';
}
$profile_help = '<p>' . __( 'Your profile contains information about you (your “account”) as well as some personal options related to using WordPress.' ) . '</p>' .
'<p>' . __( 'You can change your password, turn on keyboard shortcuts, change the color scheme of your WordPress administration screens, and turn off the WYSIWYG (Visual) editor, among other things. You can hide the Toolbar (formerly called the Admin Bar) from the front end of your site, however it cannot be disabled on the admin screens.' ) . '</p>' .
'<p>' . __( 'You can select the language you wish to use while using the WordPress administration screen without affecting the language site visitors see.' ) . '</p>' .
'<p>' . __( 'Your username cannot be changed, but you can use other fields to enter your real name or a nickname, and change which name to display on your posts.' ) . '</p>' .
'<p>' . __( 'You can log out of other devices, such as your phone or a public computer, by clicking the Log Out Everywhere Else button.' ) . '</p>' .
'<p>' . __( 'Required fields are indicated; the rest are optional. Profile information will only be displayed if your theme is set up to do so.' ) . '</p>' .
'<p>' . __( 'Remember to click the Update Profile button when you are finished.' ) . '</p>';
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' => $profile_help,
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/users-your-profile-screen/">Documentation on User Profiles</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
$wp_http_referer = remove_query_arg( array( 'update', 'delete_count', 'user_id' ), $wp_http_referer );
$user_can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' );
/**
* Filters whether to allow administrators on Multisite to edit every user.
*
* Enabling the user editing form via this filter also hinges on the user holding
* the 'manage_network_users' cap, and the logged-in user not matching the user
* profile open for editing.
*
* The filter was introduced to replace the EDIT_ANY_USER constant.
*
* @since 3.0.0
*
* @param bool $allow Whether to allow editing of any user. Default true.
*/
if ( is_multisite()
&& ! current_user_can( 'manage_network_users' )
&& $user_id !== $current_user->ID
&& ! apply_filters( 'enable_edit_any_user_configuration', true )
) {
wp_die( __( 'Sorry, you are not allowed to edit this user.' ) );
}
// Execute confirmed email change. See send_confirmation_on_profile_email().
if ( IS_PROFILE_PAGE && isset( $_GET['newuseremail'] ) && $current_user->ID ) {
$new_email = get_user_meta( $current_user->ID, '_new_email', true );
if ( $new_email && hash_equals( $new_email['hash'], $_GET['newuseremail'] ) ) {
$user = new stdClass();
$user->ID = $current_user->ID;
$user->user_email = esc_html( trim( $new_email['newemail'] ) );
if ( is_multisite() && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $current_user->user_login ) ) ) {
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $user->user_email, $current_user->user_login ) );
}
wp_update_user( $user );
delete_user_meta( $current_user->ID, '_new_email' );
wp_redirect( add_query_arg( array( 'updated' => 'true' ), self_admin_url( 'profile.php' ) ) );
die();
} else {
wp_redirect( add_query_arg( array( 'error' => 'new-email' ), self_admin_url( 'profile.php' ) ) );
}
} elseif ( IS_PROFILE_PAGE && ! empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' === $_GET['dismiss'] ) {
check_admin_referer( 'dismiss-' . $current_user->ID . '_new_email' );
delete_user_meta( $current_user->ID, '_new_email' );
wp_redirect( add_query_arg( array( 'updated' => 'true' ), self_admin_url( 'profile.php' ) ) );
die();
}
switch ( $action ) {
case 'update':
check_admin_referer( 'update-user_' . $user_id );
if ( ! current_user_can( 'edit_user', $user_id ) ) {
wp_die( __( 'Sorry, you are not allowed to edit this user.' ) );
}
if ( IS_PROFILE_PAGE ) {
/**
* Fires before the page loads on the 'Profile' editing screen.
*
* The action only fires if the current user is editing their own profile.
*
* @since 2.0.0
*
* @param int $user_id The user ID.
*/
do_action( 'personal_options_update', $user_id );
} else {
/**
* Fires before the page loads on the 'Edit User' screen.
*
* @since 2.7.0
*
* @param int $user_id The user ID.
*/
do_action( 'edit_user_profile_update', $user_id );
}
// Update the email address in signups, if present.
if ( is_multisite() ) {
$user = get_userdata( $user_id );
if ( $user->user_login && isset( $_POST['email'] ) && is_email( $_POST['email'] ) && $wpdb->get_var( $wpdb->prepare( "SELECT user_login FROM {$wpdb->signups} WHERE user_login = %s", $user->user_login ) ) ) {
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->signups} SET user_email = %s WHERE user_login = %s", $_POST['email'], $user_login ) );
}
}
// Update the user.
$errors = edit_user( $user_id );
// Grant or revoke super admin status if requested.
if ( is_multisite() && is_network_admin()
&& ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' )
&& ! isset( $super_admins ) && empty( $_POST['super_admin'] ) === is_super_admin( $user_id )
) {
empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id );
}
if ( ! is_wp_error( $errors ) ) {
$redirect = add_query_arg( 'updated', true, get_edit_user_link( $user_id ) );
if ( $wp_http_referer ) {
$redirect = add_query_arg( 'wp_http_referer', urlencode( $wp_http_referer ), $redirect );
}
wp_redirect( $redirect );
exit;
}
// Intentional fall-through to display $errors.
default:
$profile_user = get_user_to_edit( $user_id );
if ( ! current_user_can( 'edit_user', $user_id ) ) {
wp_die( __( 'Sorry, you are not allowed to edit this user.' ) );
}
$title = sprintf( $title, $profile_user->display_name );
$sessions = WP_Session_Tokens::get_instance( $profile_user->ID );
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<?php
if ( ! IS_PROFILE_PAGE && is_super_admin( $profile_user->ID ) && current_user_can( 'manage_network_options' ) ) :
$message = '<strong>' . __( 'Important:' ) . '</strong> ' . __( 'This user has super admin privileges.' );
wp_admin_notice(
$message,
array(
'type' => 'info',
)
);
endif;
if ( isset( $_GET['updated'] ) ) :
if ( IS_PROFILE_PAGE ) :
$message = '<p><strong>' . __( 'Profile updated.' ) . '</strong></p>';
else :
$message = '<p><strong>' . __( 'User updated.' ) . '</strong></p>';
endif;
if ( $wp_http_referer && ! str_contains( $wp_http_referer, 'user-new.php' ) && ! IS_PROFILE_PAGE ) :
$message .= sprintf(
'<p><a href="%1$s">%2$s</a></p>',
esc_url( wp_validate_redirect( sanitize_url( $wp_http_referer ), self_admin_url( 'users.php' ) ) ),
__( '← Go to Users' )
);
endif;
wp_admin_notice(
$message,
array(
'id' => 'message',
'dismissible' => true,
'additional_classes' => array( 'updated' ),
'paragraph_wrap' => false,
)
);
endif;
if ( isset( $_GET['error'] ) ) :
$message = '';
if ( 'new-email' === $_GET['error'] ) :
$message = __( 'Error while saving the new email address. Please try again.' );
endif;
wp_admin_notice(
$message,
array(
'type' => 'error',
)
);
endif;
if ( isset( $errors ) && is_wp_error( $errors ) ) {
wp_admin_notice(
implode( "</p>\n<p>", $errors->get_error_messages() ),
array(
'additional_classes' => array( 'error' ),
)
);
}
?>
<div class="wrap" id="profile-page">
<h1 class="wp-heading-inline">
<?php echo esc_html( $title ); ?>
</h1>
<?php if ( ! IS_PROFILE_PAGE ) : ?>
<?php if ( current_user_can( 'create_users' ) ) : ?>
<a href="user-new.php" class="page-title-action"><?php echo esc_html__( 'Add User' ); ?></a>
<?php elseif ( is_multisite() && current_user_can( 'promote_users' ) ) : ?>
<a href="user-new.php" class="page-title-action"><?php echo esc_html__( 'Add Existing User' ); ?></a>
<?php endif; ?>
<?php endif; ?>
<hr class="wp-header-end">
<form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post" novalidate="novalidate"
<?php
/**
* Fires inside the your-profile form tag on the user editing screen.
*
* @since 3.0.0
*/
do_action( 'user_edit_form_tag' );
?>
>
<?php wp_nonce_field( 'update-user_' . $user_id ); ?>
<?php if ( $wp_http_referer ) : ?>
<input type="hidden" name="wp_http_referer" value="<?php echo esc_url( $wp_http_referer ); ?>" />
<?php endif; ?>
<p>
<input type="hidden" name="from" value="profile" />
<input type="hidden" name="checkuser_id" value="<?php echo get_current_user_id(); ?>" />
</p>
<h2><?php _e( 'Personal Options' ); ?></h2>
<table class="form-table" role="presentation">
<?php if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) && 'false' === $profile_user->rich_editing ) : ?>
<tr class="user-rich-editing-wrap">
<th scope="row"><?php _e( 'Visual Editor' ); ?></th>
<td>
<label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php checked( 'false', $profile_user->rich_editing ); ?> />
<?php _e( 'Disable the visual editor when writing' ); ?>
</label>
</td>
</tr>
<?php endif; ?>
<?php
$show_syntax_highlighting_preference = (
// For Custom HTML widget and Additional CSS in Customizer.
user_can( $profile_user, 'edit_theme_options' )
||
// Edit plugins.
user_can( $profile_user, 'edit_plugins' )
||
// Edit themes.
user_can( $profile_user, 'edit_themes' )
);
?>
<?php if ( $show_syntax_highlighting_preference ) : ?>
<tr class="user-syntax-highlighting-wrap">
<th scope="row"><?php _e( 'Syntax Highlighting' ); ?></th>
<td>
<label for="syntax_highlighting"><input name="syntax_highlighting" type="checkbox" id="syntax_highlighting" value="false" <?php checked( 'false', $profile_user->syntax_highlighting ); ?> />
<?php _e( 'Disable syntax highlighting when editing code' ); ?>
</label>
</td>
</tr>
<?php endif; ?>
<?php if ( count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>
<tr class="user-admin-color-wrap">
<th scope="row"><?php _e( 'Admin Color Scheme' ); ?></th>
<td>
<?php
/**
* Fires in the 'Admin Color Scheme' section of the user editing screen.
*
* The section is only enabled if a callback is hooked to the action,
* and if there is more than one defined color scheme for the admin.
*
* @since 3.0.0
* @since 3.8.1 Added `$user_id` parameter.
*
* @param int $user_id The user ID.
*/
do_action( 'admin_color_scheme_picker', $user_id );
?>
</td>
</tr>
<?php endif; // End if count ( $_wp_admin_css_colors ) > 1 ?>
<?php if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) : ?>
<tr class="user-comment-shortcuts-wrap">
<th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
<td>
<label for="comment_shortcuts">
<input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php checked( 'true', $profile_user->comment_shortcuts ); ?> />
<?php _e( 'Enable keyboard shortcuts for comment moderation.' ); ?>
</label>
<?php _e( '<a href="https://wordpress.org/documentation/article/keyboard-shortcuts-classic-editor/#keyboard-shortcuts-for-comments">Documentation on Keyboard Shortcuts</a>' ); ?>
</td>
</tr>
<?php endif; ?>
<tr class="show-admin-bar user-admin-bar-front-wrap">
<th scope="row"><?php _e( 'Toolbar' ); ?></th>
<td>
<label for="admin_bar_front">
<input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1"<?php checked( _get_admin_bar_pref( 'front', $profile_user->ID ) ); ?> />
<?php _e( 'Show Toolbar when viewing site' ); ?>
</label><br />
</td>
</tr>
<?php
$languages = get_available_languages();
$can_install_translations = current_user_can( 'install_languages' ) && wp_can_install_language_pack();
?>
<?php if ( $languages || $can_install_translations ) : ?>
<tr class="user-language-wrap">
<th scope="row">
<?php /* translators: The user language selection field label. */ ?>
<label for="locale"><?php _e( 'Language' ); ?><span class="dashicons dashicons-translation" aria-hidden="true"></span></label>
</th>
<td>
<?php
$user_locale = $profile_user->locale;
if ( 'en_US' === $user_locale ) {
$user_locale = '';
} elseif ( '' === $user_locale || ! in_array( $user_locale, $languages, true ) ) {
$user_locale = 'site-default';
}
wp_dropdown_languages(
array(
'name' => 'locale',
'id' => 'locale',
'selected' => $user_locale,
'languages' => $languages,
'show_available_translations' => $can_install_translations,
'show_option_site_default' => true,
)
);
?>
</td>
</tr>
<?php endif; ?>
<?php
/**
* Fires at the end of the 'Personal Options' settings table on the user editing screen.
*
* @since 2.7.0
*
* @param WP_User $profile_user The current WP_User object.
*/
do_action( 'personal_options', $profile_user );
?>
</table>
<?php
if ( IS_PROFILE_PAGE ) {
/**
* Fires after the 'Personal Options' settings table on the 'Profile' editing screen.
*
* The action only fires if the current user is editing their own profile.
*
* @since 2.0.0
*
* @param WP_User $profile_user The current WP_User object.
*/
do_action( 'profile_personal_options', $profile_user );
}
?>
<h2><?php _e( 'Name' ); ?></h2>
<table class="form-table" role="presentation">
<tr class="user-user-login-wrap">
<th><label for="user_login"><?php _e( 'Username' ); ?></label></th>
<td><input type="text" name="user_login" id="user_login" value="<?php echo esc_attr( $profile_user->user_login ); ?>" readonly="readonly" class="regular-text" /> <span class="description"><?php _e( 'Usernames cannot be changed.' ); ?></span></td>
</tr>
<?php if ( ! IS_PROFILE_PAGE && ! is_network_admin() && current_user_can( 'promote_user', $profile_user->ID ) ) : ?>
<tr class="user-role-wrap">
<th><label for="role"><?php _e( 'Role' ); ?></label></th>
<td>
<select name="role" id="role">
<?php
// Compare user role against currently editable roles.
$user_roles = array_intersect( array_values( $profile_user->roles ), array_keys( get_editable_roles() ) );
$user_role = reset( $user_roles );
// Print the full list of roles with the primary one selected.
wp_dropdown_roles( $user_role );
// Print the 'no role' option. Make it selected if the user has no role yet.
if ( $user_role ) {
echo '<option value="">' . __( '— No role for this site —' ) . '</option>';
} else {
echo '<option value="" selected="selected">' . __( '— No role for this site —' ) . '</option>';
}
?>
</select>
</td>
</tr>
<?php endif; // End if ! IS_PROFILE_PAGE. ?>
<?php if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && ! isset( $super_admins ) ) : ?>
<tr class="user-super-admin-wrap">
<th><?php _e( 'Super Admin' ); ?></th>
<td>
<?php if ( 0 !== strcasecmp( $profile_user->user_email, get_site_option( 'admin_email' ) ) || ! is_super_admin( $profile_user->ID ) ) : ?>
<p><label><input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( $profile_user->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.' ); ?></label></p>
<?php else : ?>
<p><?php _e( 'Super admin privileges cannot be removed because this user has the network admin email.' ); ?></p>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
<tr class="user-first-name-wrap">
<th><label for="first_name"><?php _e( 'First Name' ); ?></label></th>
<td><input type="text" name="first_name" id="first_name" value="<?php echo esc_attr( $profile_user->first_name ); ?>" class="regular-text" /></td>
</tr>
<tr class="user-last-name-wrap">
<th><label for="last_name"><?php _e( 'Last Name' ); ?></label></th>
<td><input type="text" name="last_name" id="last_name" value="<?php echo esc_attr( $profile_user->last_name ); ?>" class="regular-text" /></td>
</tr>
<tr class="user-nickname-wrap">
<th><label for="nickname"><?php _e( 'Nickname' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
<td><input type="text" name="nickname" id="nickname" value="<?php echo esc_attr( $profile_user->nickname ); ?>" class="regular-text" /></td>
</tr>
<tr class="user-display-name-wrap">
<th>
<label for="display_name"><?php _e( 'Display name publicly as' ); ?></label>
</th>
<td>
<select name="display_name" id="display_name">
<?php
$public_display = array();
$public_display['display_nickname'] = $profile_user->nickname;
$public_display['display_username'] = $profile_user->user_login;
if ( ! empty( $profile_user->first_name ) ) {
$public_display['display_firstname'] = $profile_user->first_name;
}
if ( ! empty( $profile_user->last_name ) ) {
$public_display['display_lastname'] = $profile_user->last_name;
}
if ( ! empty( $profile_user->first_name ) && ! empty( $profile_user->last_name ) ) {
$public_display['display_firstlast'] = $profile_user->first_name . ' ' . $profile_user->last_name;
$public_display['display_lastfirst'] = $profile_user->last_name . ' ' . $profile_user->first_name;
}
if ( ! in_array( $profile_user->display_name, $public_display, true ) ) { // Only add this if it isn't duplicated elsewhere.
$public_display = array( 'display_displayname' => $profile_user->display_name ) + $public_display;
}
$public_display = array_map( 'trim', $public_display );
$public_display = array_unique( $public_display );
?>
<?php foreach ( $public_display as $id => $item ) : ?>
<option <?php selected( $profile_user->display_name, $item ); ?>><?php echo $item; ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
</table>
<h2><?php _e( 'Contact Info' ); ?></h2>
<table class="form-table" role="presentation">
<tr class="user-email-wrap">
<th><label for="email"><?php _e( 'Email' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
<td>
<?php if ( $profile_user->ID === $current_user->ID ) : ?>
<input type="email" name="email" id="email" aria-describedby="email-description" value="<?php echo esc_attr( $profile_user->user_email ); ?>" class="regular-text ltr" />
<p class="description" id="email-description">
<?php _e( 'If you change this, an email will be sent at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?>
</p>
<?php else : ?>
<input type="email" name="email" id="email" value="<?php echo esc_attr( $profile_user->user_email ); ?>" class="regular-text ltr" />
<?php endif; ?>
<?php
$new_email = get_user_meta( $current_user->ID, '_new_email', true );
if ( $new_email && $new_email['newemail'] !== $current_user->user_email && $profile_user->ID === $current_user->ID ) :
$pending_change_message = sprintf(
/* translators: %s: New email. */
__( 'There is a pending change of your email to %s.' ),
'<code>' . esc_html( $new_email['newemail'] ) . '</code>'
);
$pending_change_message .= sprintf(
' <a href="%1$s">%2$s</a>',
esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ),
__( 'Cancel' )
);
wp_admin_notice(
$pending_change_message,
array(
'additional_classes' => array( 'updated', 'inline' ),
)
);
endif;
?>
</td>
</tr>
<tr class="user-url-wrap">
<th><label for="url"><?php _e( 'Website' ); ?></label></th>
<td><input type="url" name="url" id="url" value="<?php echo esc_attr( $profile_user->user_url ); ?>" class="regular-text code" /></td>
</tr>
<?php foreach ( wp_get_user_contact_methods( $profile_user ) as $name => $desc ) : ?>
<tr class="user-<?php echo $name; ?>-wrap">
<th>
<label for="<?php echo $name; ?>">
<?php
/**
* Filters a user contactmethod label.
*
* The dynamic portion of the hook name, `$name`, refers to
* each of the keys in the contact methods array.
*
* @since 2.9.0
*
* @param string $desc The translatable label for the contact method.
*/
echo apply_filters( "user_{$name}_label", $desc );
?>
</label>
</th>
<td>
<input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr( $profile_user->$name ); ?>" class="regular-text" />
</td>
</tr>
<?php endforeach; ?>
</table>
<h2><?php IS_PROFILE_PAGE ? _e( 'About Yourself' ) : _e( 'About the user' ); ?></h2>
<table class="form-table" role="presentation">
<tr class="user-description-wrap">
<th><label for="description"><?php _e( 'Biographical Info' ); ?></label></th>
<td><textarea name="description" id="description" rows="5" cols="30"><?php echo $profile_user->description; // textarea_escaped ?></textarea>
<p class="description"><?php _e( 'Share a little biographical information to fill out your profile. This may be shown publicly.' ); ?></p></td>
</tr>
<?php if ( get_option( 'show_avatars' ) ) : ?>
<tr class="user-profile-picture">
<th><?php _e( 'Profile Picture' ); ?></th>
<td>
<?php echo get_avatar( $user_id ); ?>
<p class="description">
<?php
if ( IS_PROFILE_PAGE ) {
$description = sprintf(
/* translators: %s: Gravatar URL. */
__( '<a href="%s">You can change your profile picture on Gravatar</a>.' ),
/* translators: The localized Gravatar URL. */
__( 'https://gravatar.com/' )
);
} else {
$description = '';
}
/**
* Filters the user profile picture description displayed under the Gravatar.
*
* @since 4.4.0
* @since 4.7.0 Added the `$profile_user` parameter.
*
* @param string $description The description that will be printed.
* @param WP_User $profile_user The current WP_User object.
*/
echo apply_filters( 'user_profile_picture_description', $description, $profile_user );
?>
</p>
</td>
</tr>
<?php endif; ?>
<?php
/**
* Filters the display of the password fields.
*
* @since 1.5.1
* @since 2.8.0 Added the `$profile_user` parameter.
* @since 4.4.0 Now evaluated only in user-edit.php.
*
* @param bool $show Whether to show the password fields. Default true.
* @param WP_User $profile_user User object for the current user to edit.
*/
$show_password_fields = apply_filters( 'show_password_fields', true, $profile_user );
?>
<?php if ( $show_password_fields ) : ?>
</table>
<h2><?php _e( 'Account Management' ); ?></h2>
<table class="form-table" role="presentation">
<tr id="password" class="user-pass1-wrap">
<th><label for="pass1"><?php _e( 'New Password' ); ?></label></th>
<td>
<input type="hidden" value=" " /><!-- #24364 workaround -->
<button type="button" class="button wp-generate-pw hide-if-no-js" aria-expanded="false"><?php _e( 'Set New Password' ); ?></button>
<div class="wp-pwd hide-if-js">
<div class="password-input-wrapper">
<input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="new-password" spellcheck="false" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" aria-describedby="pass-strength-result" />
<div style="display:none" id="pass-strength-result" aria-live="polite"></div>
</div>
<button type="button" class="button wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>">
<span class="dashicons dashicons-hidden" aria-hidden="true"></span>
<span class="text"><?php _e( 'Hide' ); ?></span>
</button>
<button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>">
<span class="dashicons dashicons-no" aria-hidden="true"></span>
<span class="text"><?php _e( 'Cancel' ); ?></span>
</button>
</div>
</td>
</tr>
<tr class="user-pass2-wrap hide-if-js">
<th scope="row"><label for="pass2"><?php _e( 'Repeat New Password' ); ?></label></th>
<td>
<input type="password" name="pass2" id="pass2" class="regular-text" value="" autocomplete="new-password" spellcheck="false" aria-describedby="pass2-desc" />
<?php if ( IS_PROFILE_PAGE ) : ?>
<p class="description" id="pass2-desc"><?php _e( 'Type your new password again.' ); ?></p>
<?php else : ?>
<p class="description" id="pass2-desc"><?php _e( 'Type the new password again.' ); ?></p>
<?php endif; ?>
</td>
</tr>
<tr class="pw-weak">
<th><?php _e( 'Confirm Password' ); ?></th>
<td>
<label>
<input type="checkbox" name="pw_weak" class="pw-checkbox" />
<span id="pw-weak-text-label"><?php _e( 'Confirm use of weak password' ); ?></span>
</label>
</td>
</tr>
<?php endif; // End Show Password Fields. ?>
<?php // Allow admins to send reset password link. ?>
<?php if ( ! IS_PROFILE_PAGE && true === wp_is_password_reset_allowed_for_user( $profile_user ) ) : ?>
<tr class="user-generate-reset-link-wrap hide-if-no-js">
<th><?php _e( 'Password Reset' ); ?></th>
<td>
<div class="generate-reset-link">
<button type="button" class="button button-secondary" id="generate-reset-link">
<?php _e( 'Send Reset Link' ); ?>
</button>
</div>
<p class="description">
<?php
printf(
/* translators: %s: User's display name. */
__( 'Send %s a link to reset their password. This will not change their password, nor will it force a change.' ),
esc_html( $profile_user->display_name )
);
?>
</p>
</td>
</tr>
<?php endif; ?>
<?php if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) : ?>
<tr class="user-sessions-wrap hide-if-no-js">
<th><?php _e( 'Sessions' ); ?></th>
<td aria-live="assertive">
<div class="destroy-sessions"><button type="button" disabled class="button"><?php _e( 'Log Out Everywhere Else' ); ?></button></div>
<p class="description">
<?php _e( 'You are only logged in at this location.' ); ?>
</p>
</td>
</tr>
<?php elseif ( IS_PROFILE_PAGE && count( $sessions->get_all() ) > 1 ) : ?>
<tr class="user-sessions-wrap hide-if-no-js">
<th><?php _e( 'Sessions' ); ?></th>
<td aria-live="assertive">
<div class="destroy-sessions"><button type="button" class="button" id="destroy-sessions"><?php _e( 'Log Out Everywhere Else' ); ?></button></div>
<p class="description">
<?php _e( 'Did you lose your phone or leave your account logged in at a public computer? You can log out everywhere else, and stay logged in here.' ); ?>
</p>
</td>
</tr>
<?php elseif ( ! IS_PROFILE_PAGE && $sessions->get_all() ) : ?>
<tr class="user-sessions-wrap hide-if-no-js">
<th><?php _e( 'Sessions' ); ?></th>
<td>
<p><button type="button" class="button" id="destroy-sessions"><?php _e( 'Log Out Everywhere' ); ?></button></p>
<p class="description">
<?php
/* translators: %s: User's display name. */
printf( __( 'Log %s out of all locations.' ), $profile_user->display_name );
?>
</p>
</td>
</tr>
<?php endif; ?>
</table>
<?php if ( wp_is_application_passwords_available_for_user( $user_id ) || ! wp_is_application_passwords_supported() ) : ?>
<div class="application-passwords hide-if-no-js" id="application-passwords-section">
<h2><?php _e( 'Application Passwords' ); ?></h2>
<p><?php _e( 'Application passwords allow authentication via non-interactive systems, such as XML-RPC or the REST API, without providing your actual password. Application passwords can be easily revoked. They cannot be used for traditional logins to your website.' ); ?></p>
<?php if ( wp_is_application_passwords_available_for_user( $user_id ) ) : ?>
<?php
if ( is_multisite() ) :
$blogs = get_blogs_of_user( $user_id, true );
$blogs_count = count( $blogs );
if ( $blogs_count > 1 ) :
?>
<p>
<?php
/* translators: 1: URL to my-sites.php, 2: Number of sites the user has. */
$message = _n(
'Application passwords grant access to <a href="%1$s">the %2$s site in this installation that you have permissions on</a>.',
'Application passwords grant access to <a href="%1$s">all %2$s sites in this installation that you have permissions on</a>.',
$blogs_count
);
if ( is_super_admin( $user_id ) ) {
/* translators: 1: URL to my-sites.php, 2: Number of sites the user has. */
$message = _n(
'Application passwords grant access to <a href="%1$s">the %2$s site on the network as you have Super Admin rights</a>.',
'Application passwords grant access to <a href="%1$s">all %2$s sites on the network as you have Super Admin rights</a>.',
$blogs_count
);
}
printf(
$message,
admin_url( 'my-sites.php' ),
number_format_i18n( $blogs_count )
);
?>
</p>
<?php
endif;
endif;
?>
<?php if ( ! wp_is_site_protected_by_basic_auth( 'front' ) ) : ?>
<div class="create-application-password form-wrap">
<div class="form-field">
<label for="new_application_password_name"><?php _e( 'New Application Password Name' ); ?></label>
<input type="text" size="30" id="new_application_password_name" name="new_application_password_name" class="input" aria-required="true" aria-describedby="new_application_password_name_desc" spellcheck="false" />
<p class="description" id="new_application_password_name_desc"><?php _e( 'Required to create an Application Password, but not to update the user.' ); ?></p>
</div>
<?php
/**
* Fires in the create Application Passwords form.
*
* @since 5.6.0
*
* @param WP_User $profile_user The current WP_User object.
*/
do_action( 'wp_create_application_password_form', $profile_user );
?>
<button type="button" name="do_new_application_password" id="do_new_application_password" class="button button-secondary"><?php _e( 'Add Application Password' ); ?></button>
</div>
<?php
else :
wp_admin_notice(
__( 'Your website appears to use Basic Authentication, which is not currently compatible with Application Passwords.' ),
array(
'type' => 'error',
'additional_classes' => array( 'inline' ),
)
);
endif;
?>
<div class="application-passwords-list-table-wrapper">
<?php
$application_passwords_list_table = _get_list_table( 'WP_Application_Passwords_List_Table', array( 'screen' => 'application-passwords-user' ) );
$application_passwords_list_table->prepare_items();
$application_passwords_list_table->display();
?>
</div>
<?php elseif ( ! wp_is_application_passwords_supported() ) : ?>
<p><?php _e( 'The application password feature requires HTTPS, which is not enabled on this site.' ); ?></p>
<p>
<?php
printf(
/* translators: %s: Documentation URL. */
__( 'If this is a development website, you can <a href="%s">set the environment type accordingly</a> to enable application passwords.' ),
__( 'https://developer.wordpress.org/apis/wp-config-php/#wp-environment-type' )
);
?>
</p>
<?php endif; ?>
</div>
<?php endif; // End Application Passwords. ?>
<?php
if ( IS_PROFILE_PAGE ) {
/**
* Fires after the 'About Yourself' settings table on the 'Profile' editing screen.
*
* The action only fires if the current user is editing their own profile.
*
* @since 2.0.0
*
* @param WP_User $profile_user The current WP_User object.
*/
do_action( 'show_user_profile', $profile_user );
} else {
/**
* Fires after the 'About the User' settings table on the 'Edit User' screen.
*
* @since 2.0.0
*
* @param WP_User $profile_user The current WP_User object.
*/
do_action( 'edit_user_profile', $profile_user );
}
?>
<?php
/**
* Filters whether to display additional capabilities for the user.
*
* The 'Additional Capabilities' section will only be enabled if
* the number of the user's capabilities exceeds their number of
* roles.
*
* @since 2.8.0
*
* @param bool $enable Whether to display the capabilities. Default true.
* @param WP_User $profile_user The current WP_User object.
*/
$display_additional_caps = apply_filters( 'additional_capabilities_display', true, $profile_user );
?>
<?php if ( count( $profile_user->caps ) > count( $profile_user->roles ) && ( true === $display_additional_caps ) ) : ?>
<h2><?php _e( 'Additional Capabilities' ); ?></h2>
<table class="form-table" role="presentation">
<tr class="user-capabilities-wrap">
<th scope="row"><?php _e( 'Capabilities' ); ?></th>
<td>
<?php
$output = '';
foreach ( $profile_user->caps as $cap => $value ) {
if ( ! $wp_roles->is_role( $cap ) ) {
if ( '' !== $output ) {
$output .= ', ';
}
if ( $value ) {
$output .= $cap;
} else {
/* translators: %s: Capability name. */
$output .= sprintf( __( 'Denied: %s' ), $cap );
}
}
}
echo $output;
?>
</td>
</tr>
</table>
<?php endif; // End Display Additional Capabilities. ?>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr( $user_id ); ?>" />
<?php submit_button( IS_PROFILE_PAGE ? __( 'Update Profile' ) : __( 'Update User' ) ); ?>
</form>
</div>
<?php
break;
}
?>
<script type="text/javascript">
if (window.location.hash == '#password') {
document.getElementById('pass1').focus();
}
</script>
<script type="text/javascript">
jQuery( function( $ ) {
var languageSelect = $( '#locale' );
$( 'form' ).on( 'submit', function() {
/*
* Don't show a spinner for English and installed languages,
* as there is nothing to download.
*/
if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
$( '#submit', this ).after( '<span class="spinner language-install-spinner is-active" />' );
}
});
} );
</script>
<?php if ( isset( $application_passwords_list_table ) ) : ?>
<script type="text/html" id="tmpl-new-application-password">
<div class="notice notice-success is-dismissible new-application-password-notice" role="alert">
<p class="application-password-display">
<label for="new-application-password-value">
<?php
printf(
/* translators: %s: Application name. */
__( 'Your new password for %s is:' ),
'<strong>{{ data.name }}</strong>'
);
?>
</label>
<input id="new-application-password-value" type="text" class="code" readonly="readonly" value="{{ data.password }}" />
<button type="button" class="button copy-button" data-clipboard-text="{{ data.password }}"><?php _e( 'Copy' ); ?></button>
<span class="success hidden" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
</p>
<p><?php _e( 'Be sure to save this in a safe location. You will not be able to retrieve it.' ); ?></p>
<button type="button" class="notice-dismiss">
<span class="screen-reader-text">
<?php
/* translators: Hidden accessibility text. */
_e( 'Dismiss this notice.' );
?>
</span>
</button>
</div>
</script>
<script type="text/html" id="tmpl-application-password-row">
<?php $application_passwords_list_table->print_js_template_row(); ?>
</script>
<?php endif; ?>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK ^[�U�� � plugin-install.phpnu �[��� <?php
/**
* Install plugin administration panel.
*
* @package WordPress
* @subpackage Administration
*/
// TODO: Route this page via a specific iframe handler instead of the do_action below.
if ( ! defined( 'IFRAME_REQUEST' ) && isset( $_GET['tab'] ) && ( 'plugin-information' === $_GET['tab'] ) ) {
define( 'IFRAME_REQUEST', true );
}
/**
* WordPress Administration Bootstrap.
*/
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'install_plugins' ) ) {
wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
}
if ( is_multisite() && ! is_network_admin() ) {
wp_redirect( network_admin_url( 'plugin-install.php' ) );
exit;
}
$wp_list_table = _get_list_table( 'WP_Plugin_Install_List_Table' );
$pagenum = $wp_list_table->get_pagenum();
if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) {
$location = remove_query_arg( '_wp_http_referer', wp_unslash( $_SERVER['REQUEST_URI'] ) );
if ( ! empty( $_REQUEST['paged'] ) ) {
$location = add_query_arg( 'paged', (int) $_REQUEST['paged'], $location );
}
wp_redirect( $location );
exit;
}
$wp_list_table->prepare_items();
$total_pages = $wp_list_table->get_pagination_arg( 'total_pages' );
if ( $pagenum > $total_pages && $total_pages > 0 ) {
wp_redirect( add_query_arg( 'paged', $total_pages ) );
exit;
}
// Used in the HTML title tag.
$title = __( 'Add Plugins' );
$parent_file = 'plugins.php';
wp_enqueue_script( 'plugin-install' );
if ( 'plugin-information' !== $tab ) {
add_thickbox();
}
$body_id = $tab;
wp_enqueue_script( 'updates' );
/**
* Fires before each tab on the Install Plugins screen is loaded.
*
* The dynamic portion of the hook name, `$tab`, allows for targeting
* individual tabs.
*
* Possible hook names include:
*
* - `install_plugins_pre_beta`
* - `install_plugins_pre_favorites`
* - `install_plugins_pre_featured`
* - `install_plugins_pre_plugin-information`
* - `install_plugins_pre_popular`
* - `install_plugins_pre_recommended`
* - `install_plugins_pre_search`
* - `install_plugins_pre_upload`
*
* @since 2.7.0
*/
do_action( "install_plugins_pre_{$tab}" );
/*
* Call the pre upload action on every non-upload plugin installation screen
* because the form is always displayed on these screens.
*/
if ( 'upload' !== $tab ) {
/** This action is documented in wp-admin/plugin-install.php */
do_action( 'install_plugins_pre_upload' );
}
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . sprintf(
/* translators: %s: https://wordpress.org/plugins/ */
__( 'Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s">WordPress Plugin Directory</a> are compatible with the license WordPress uses.' ),
__( 'https://wordpress.org/plugins/' )
) . '</p>' .
'<p>' . __( 'You can find new plugins to install by searching or browsing the directory right here in your own Plugins section.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>',
)
);
get_current_screen()->add_help_tab(
array(
'id' => 'adding-plugins',
'title' => __( 'Adding Plugins' ),
'content' =>
'<p>' . __( 'If you know what you are looking for, Search is your best bet. The Search screen has options to search the WordPress Plugin Directory for a particular Term, Author, or Tag. You can also search the directory by selecting popular tags. Tags in larger type mean more plugins have been labeled with that tag.' ) . '</p>' .
'<p>' . __( 'If you just want to get an idea of what’s available, you can browse Featured and Popular plugins by using the links above the plugins list. These sections rotate regularly.' ) . '</p>' .
'<p>' . __( 'You can also browse a user’s favorite plugins, by using the Favorites link above the plugins list and entering their WordPress.org username.' ) . '</p>' .
'<p>' . __( 'If you want to install a plugin that you’ve downloaded elsewhere, click the Upload Plugin button above the plugins list. You will be prompted to upload the .zip package, and once uploaded, you can activate the new plugin.' ) . '</p>',
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/plugins-add-new-screen/">Documentation on Installing Plugins</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
get_current_screen()->set_screen_reader_content(
array(
'heading_views' => __( 'Filter plugins list' ),
'heading_pagination' => __( 'Plugins list navigation' ),
'heading_list' => __( 'Plugins list' ),
)
);
/**
* WordPress Administration Template Header.
*/
require_once ABSPATH . 'wp-admin/admin-header.php';
WP_Plugin_Dependencies::initialize();
WP_Plugin_Dependencies::display_admin_notice_for_unmet_dependencies();
WP_Plugin_Dependencies::display_admin_notice_for_circular_dependencies();
?>
<div class="wrap <?php echo esc_attr( "plugin-install-tab-$tab" ); ?>">
<h1 class="wp-heading-inline">
<?php
echo esc_html( $title );
?>
</h1>
<?php
if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_plugins' ) ) {
printf(
' <a href="%s" class="upload-view-toggle page-title-action"><span class="upload">%s</span><span class="browse">%s</span></a>',
( 'upload' === $tab ) ? self_admin_url( 'plugin-install.php' ) : self_admin_url( 'plugin-install.php?tab=upload' ),
__( 'Upload Plugin' ),
__( 'Browse Plugins' )
);
}
?>
<hr class="wp-header-end">
<?php
/*
* Output the upload plugin form on every non-upload plugin installation screen, so it can be
* displayed via JavaScript rather then opening up the devoted upload plugin page.
*/
if ( 'upload' !== $tab ) {
?>
<div class="upload-plugin-wrap">
<?php
/** This action is documented in wp-admin/plugin-install.php */
do_action( 'install_plugins_upload' );
?>
</div>
<?php
$wp_list_table->views();
}
/**
* Fires after the plugins list table in each tab of the Install Plugins screen.
*
* The dynamic portion of the hook name, `$tab`, allows for targeting
* individual tabs.
*
* Possible hook names include:
*
* - `install_plugins_beta`
* - `install_plugins_favorites`
* - `install_plugins_featured`
* - `install_plugins_plugin-information`
* - `install_plugins_popular`
* - `install_plugins_recommended`
* - `install_plugins_search`
* - `install_plugins_upload`
*
* @since 2.7.0
*
* @param int $paged The current page number of the plugins list table.
*/
do_action( "install_plugins_{$tab}", $paged );
?>
<span class="spinner"></span>
</div>
<?php
wp_print_request_filesystem_credentials_modal();
wp_print_admin_notice_templates();
/**
* WordPress Administration Template Footer.
*/
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK ^[��a� � ms-options.phpnu �[��� <?php
/**
* Multisite network settings administration panel.
*
* @package WordPress
* @subpackage Multisite
* @since 3.0.0
*/
require_once __DIR__ . '/admin.php';
wp_redirect( network_admin_url( 'settings.php' ) );
exit;
PK ^[dN_ _ contribute.phpnu �[��� <?php
/**
* Contribute administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
// Used in the HTML title tag.
$title = __( 'Get Involved' );
list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap about__container">
<div class="about__header">
<div class="about__header-title">
<h1>
<?php _e( 'Get Involved' ); ?>
</h1>
</div>
<div class="about__header-text">
<?php _e( 'Be the future of WordPress' ); ?>
</div>
</div>
<nav class="about__header-navigation nav-tab-wrapper wp-clearfix" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
<a href="about.php" class="nav-tab"><?php _e( 'What’s New' ); ?></a>
<a href="credits.php" class="nav-tab"><?php _e( 'Credits' ); ?></a>
<a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
<a href="privacy.php" class="nav-tab"><?php _e( 'Privacy' ); ?></a>
<a href="contribute.php" class="nav-tab nav-tab-active" aria-current="page"><?php _e( 'Get Involved' ); ?></a>
</nav>
<div class="about__section has-2-columns is-wider-right">
<div class="column">
<img src="<?php echo esc_url( admin_url( 'images/contribute-main.svg?ver=6.5' ) ); ?>" alt="" width="290" height="290" />
</div>
<div class="column is-vertically-aligned-center">
<p><?php _e( 'Do you use WordPress for work, for personal projects, or even just for fun? You can help shape the long-term success of the open source project that powers millions of websites around the world.' ); ?></p>
<p><?php _e( 'Join the diverse WordPress contributor community and connect with other people who are passionate about maintaining a free and open web.' ); ?></p>
<ul>
<li><?php _e( 'Be part of a global open source community.' ); ?></li>
<li><?php _e( 'Apply your skills or learn new ones.' ); ?></li>
<li><?php _e( 'Grow your network and make friends.' ); ?></li>
</ul>
</div>
</div>
<div class="about__section has-2-columns is-wider-left">
<div class="column is-vertically-aligned-center">
<h2 class="is-smaller-heading"><?php _e( 'No-code contribution' ); ?></h2>
<p><?php _e( 'WordPress may thrive on technical contributions, but you don’t have to code to contribute. Here are some of the ways you can make an impact without writing a single line of code:' ); ?></p>
<ul>
<li><?php _e( '<strong>Share</strong> your knowledge in the WordPress support forums.' ); ?></li>
<li><?php _e( '<strong>Write</strong> or improve documentation for WordPress.' ); ?></li>
<li><?php _e( '<strong>Translate</strong> WordPress into your local language.' ); ?></li>
<li><?php _e( '<strong>Create</strong> and improve WordPress educational materials.' ); ?></li>
<li><?php _e( '<strong>Promote</strong> the WordPress project to your community.' ); ?></li>
<li><?php _e( '<strong>Curate</strong> submissions or take photos for the Photo Directory.' ); ?></li>
<li><?php _e( '<strong>Organize</strong> or participate in local Meetups and WordCamps.' ); ?></li>
<li><?php _e( '<strong>Lend</strong> your creative imagination to the WordPress UI design.' ); ?></li>
<li><?php _e( '<strong>Edit</strong> videos and add captions to WordPress.tv.' ); ?></li>
<li><?php _e( '<strong>Explore</strong> ways to reduce the environmental impact of websites.' ); ?></li>
</ul>
</div>
<div class="column">
<img src="<?php echo esc_url( admin_url( 'images/contribute-no-code.svg?ver=6.5' ) ); ?>" alt="" width="290" height="290" />
</div>
</div>
<div class="about__section has-2-columns is-wider-right">
<div class="column">
<img src="<?php echo esc_url( admin_url( 'images/contribute-code.svg?ver=6.5' ) ); ?>" alt="" width="290" height="290" />
</div>
<div class="column is-vertically-aligned-center">
<h2 class="is-smaller-heading"><?php _e( 'Code-based contribution' ); ?></h2>
<p><?php _e( 'If you do code, or want to learn how, you can contribute technically in numerous ways:' ); ?></p>
<ul>
<li><?php _e( '<strong>Find</strong> and report bugs in the WordPress core software.' ); ?></li>
<li><?php _e( '<strong>Test</strong> new releases and proposed features for the Block Editor.' ); ?></li>
<li><?php _e( '<strong>Write</strong> and submit patches to fix bugs or help build new features.' ); ?></li>
<li><?php _e( '<strong>Contribute</strong> to the code, improve the UX, and test the WordPress app.' ); ?></li>
</ul>
<p><?php _e( 'WordPress embraces new technologies, while being committed to backward compatibility. The WordPress project uses the following languages and libraries:' ); ?></p>
<ul>
<li><?php _e( 'WordPress Core and Block Editor: HTML, CSS, PHP, SQL, JavaScript, and React.' ); ?></li>
<li><?php _e( 'WordPress app: Kotlin, Java, Swift, Objective-C, Vue, Python, and TypeScript.' ); ?></li>
</ul>
</div>
</div>
<div class="about__section is-feature has-subtle-background-color">
<div class="column">
<h2><?php _e( 'Shape the future of the web with WordPress' ); ?></h2>
<p><?php _e( 'Finding the area that aligns with your skills and interests is the first step toward meaningful contribution. With more than 20 Make WordPress teams working on different parts of the open source WordPress project, there’s a place for everyone, no matter what your skill set is.' ); ?></p>
<p><a href="<?php echo esc_url( __( 'https://make.wordpress.org/contribute/' ) ); ?>"><?php _e( 'Find your team →' ); ?></a></p>
</div>
</div>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK ^[�f- f- comment.phpnu �[��� <?php
/**
* Comment Management Screen
*
* @package WordPress
* @subpackage Administration
*/
/** Load WordPress Bootstrap */
require_once __DIR__ . '/admin.php';
$parent_file = 'edit-comments.php';
$submenu_file = 'edit-comments.php';
/**
* @global string $action
*/
global $action;
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
if ( isset( $_POST['deletecomment'] ) ) {
$action = 'deletecomment';
}
if ( 'cdc' === $action ) {
$action = 'delete';
} elseif ( 'mac' === $action ) {
$action = 'approve';
}
if ( isset( $_GET['dt'] ) ) {
if ( 'spam' === $_GET['dt'] ) {
$action = 'spam';
} elseif ( 'trash' === $_GET['dt'] ) {
$action = 'trash';
}
}
if ( isset( $_REQUEST['c'] ) ) {
$comment_id = absint( $_REQUEST['c'] );
$comment = get_comment( $comment_id );
// Prevent actions on a comment associated with a trashed post.
if ( $comment && 'trash' === get_post_status( $comment->comment_post_ID ) ) {
wp_die(
__( 'You cannot edit this comment because the associated post is in the Trash. Please restore the post first, then try again.' )
);
}
} else {
$comment = null;
}
switch ( $action ) {
case 'editcomment':
// Used in the HTML title tag.
$title = __( 'Edit Comment' );
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . __( 'You can edit the information left in a comment if needed. This is often useful when you notice that a commenter has made a typographical error.' ) . '</p>' .
'<p>' . __( 'You can also moderate the comment from this screen using the Status box, where you can also change the timestamp of the comment.' ) . '</p>',
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/comments-screen/">Documentation on Comments</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
wp_enqueue_script( 'comment' );
require_once ABSPATH . 'wp-admin/admin-header.php';
if ( ! $comment ) {
comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'javascript:history.go(-1)' ) );
}
if ( ! current_user_can( 'edit_comment', $comment_id ) ) {
comment_footer_die( __( 'Sorry, you are not allowed to edit this comment.' ) );
}
if ( 'trash' === $comment->comment_approved ) {
comment_footer_die( __( 'This comment is in the Trash. Please move it out of the Trash if you want to edit it.' ) );
}
$comment = get_comment_to_edit( $comment_id );
require ABSPATH . 'wp-admin/edit-form-comment.php';
break;
case 'delete':
case 'approve':
case 'trash':
case 'spam':
// Used in the HTML title tag.
$title = __( 'Moderate Comment' );
if ( ! $comment ) {
wp_redirect( admin_url( 'edit-comments.php?error=1' ) );
die();
}
if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {
wp_redirect( admin_url( 'edit-comments.php?error=2' ) );
die();
}
// No need to re-approve/re-trash/re-spam a comment.
if ( str_replace( '1', 'approve', $comment->comment_approved ) === $action ) {
wp_redirect( admin_url( 'edit-comments.php?same=' . $comment_id ) );
die();
}
require_once ABSPATH . 'wp-admin/admin-header.php';
$formaction = $action . 'comment';
$nonce_action = ( 'approve' === $action ) ? 'approve-comment_' : 'delete-comment_';
$nonce_action .= $comment_id;
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
<?php
switch ( $action ) {
case 'spam':
$caution_msg = __( 'You are about to mark the following comment as spam:' );
$button = _x( 'Mark as spam', 'comment' );
break;
case 'trash':
$caution_msg = __( 'You are about to move the following comment to the Trash:' );
$button = __( 'Move to Trash' );
break;
case 'delete':
$caution_msg = __( 'You are about to delete the following comment:' );
$button = __( 'Permanently delete comment' );
break;
default:
$caution_msg = __( 'You are about to approve the following comment:' );
$button = __( 'Approve comment' );
break;
}
if ( '0' !== $comment->comment_approved ) { // If not unapproved.
$message = '';
switch ( $comment->comment_approved ) {
case '1':
$message = __( 'This comment is currently approved.' );
break;
case 'spam':
$message = __( 'This comment is currently marked as spam.' );
break;
case 'trash':
$message = __( 'This comment is currently in the Trash.' );
break;
}
if ( $message ) {
wp_admin_notice(
$message,
array(
'type' => 'info',
'id' => 'message',
)
);
}
}
wp_admin_notice(
'<strong>' . __( 'Caution:' ) . '</strong> ' . $caution_msg,
array(
'type' => 'warning',
'id' => 'message',
)
);
?>
<table class="form-table comment-ays">
<tr>
<th scope="row"><?php _e( 'Author' ); ?></th>
<td><?php comment_author( $comment ); ?></td>
</tr>
<?php if ( get_comment_author_email( $comment ) ) { ?>
<tr>
<th scope="row"><?php _e( 'Email' ); ?></th>
<td><?php comment_author_email( $comment ); ?></td>
</tr>
<?php } ?>
<?php if ( get_comment_author_url( $comment ) ) { ?>
<tr>
<th scope="row"><?php _e( 'URL' ); ?></th>
<td><a href="<?php comment_author_url( $comment ); ?>"><?php comment_author_url( $comment ); ?></a></td>
</tr>
<?php } ?>
<tr>
<th scope="row"><?php /* translators: Column name or table row header. */ _e( 'In response to' ); ?></th>
<td>
<?php
$post_id = $comment->comment_post_ID;
if ( current_user_can( 'edit_post', $post_id ) ) {
$post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
$post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
} else {
$post_link = esc_html( get_the_title( $post_id ) );
}
echo $post_link;
if ( $comment->comment_parent ) {
$parent = get_comment( $comment->comment_parent );
$parent_link = esc_url( get_comment_link( $parent ) );
$name = get_comment_author( $parent );
printf(
/* translators: %s: Comment link. */
' | ' . __( 'In reply to %s.' ),
'<a href="' . $parent_link . '">' . $name . '</a>'
);
}
?>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Submitted on' ); ?></th>
<td>
<?php
$submitted = sprintf(
/* translators: 1: Comment date, 2: Comment time. */
__( '%1$s at %2$s' ),
/* translators: Comment date format. See https://www.php.net/manual/datetime.format.php */
get_comment_date( __( 'Y/m/d' ), $comment ),
/* translators: Comment time format. See https://www.php.net/manual/datetime.format.php */
get_comment_date( __( 'g:i a' ), $comment )
);
if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {
echo '<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . $submitted . '</a>';
} else {
echo $submitted;
}
?>
</td>
</tr>
<tr>
<th scope="row"><?php /* translators: Field name in comment form. */ _ex( 'Comment', 'noun' ); ?></th>
<td class="comment-content">
<?php comment_text( $comment ); ?>
<p class="edit-comment">
<a href="<?php echo esc_url( admin_url( "comment.php?action=editcomment&c={$comment->comment_ID}" ) ); ?>"><?php esc_html_e( 'Edit' ); ?></a>
</p>
</td>
</tr>
</table>
<form action="comment.php" method="get" class="comment-ays-submit">
<p>
<?php submit_button( $button, 'primary', 'submit', false ); ?>
<a href="<?php echo esc_url( admin_url( 'edit-comments.php' ) ); ?>" class="button-cancel"><?php esc_html_e( 'Cancel' ); ?></a>
</p>
<?php wp_nonce_field( $nonce_action ); ?>
<input type="hidden" name="action" value="<?php echo esc_attr( $formaction ); ?>" />
<input type="hidden" name="c" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
<input type="hidden" name="noredir" value="1" />
</form>
</div>
<?php
break;
case 'deletecomment':
case 'trashcomment':
case 'untrashcomment':
case 'spamcomment':
case 'unspamcomment':
case 'approvecomment':
case 'unapprovecomment':
$comment_id = absint( $_REQUEST['c'] );
if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) {
check_admin_referer( 'approve-comment_' . $comment_id );
} else {
check_admin_referer( 'delete-comment_' . $comment_id );
}
$noredir = isset( $_REQUEST['noredir'] );
$comment = get_comment( $comment_id );
if ( ! $comment ) {
comment_footer_die( __( 'Invalid comment ID.' ) . sprintf( ' <a href="%s">' . __( 'Go back' ) . '</a>.', 'edit-comments.php' ) );
}
if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) {
comment_footer_die( __( 'Sorry, you are not allowed to edit comments on this post.' ) );
}
if ( wp_get_referer() && ! $noredir && ! str_contains( wp_get_referer(), 'comment.php' ) ) {
$redir = wp_get_referer();
} elseif ( wp_get_original_referer() && ! $noredir ) {
$redir = wp_get_original_referer();
} elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) {
$redir = admin_url( 'edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
} else {
$redir = admin_url( 'edit-comments.php' );
}
$redir = remove_query_arg( array( 'spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids', 'approved', 'unapproved' ), $redir );
switch ( $action ) {
case 'deletecomment':
wp_delete_comment( $comment );
$redir = add_query_arg( array( 'deleted' => '1' ), $redir );
break;
case 'trashcomment':
wp_trash_comment( $comment );
$redir = add_query_arg(
array(
'trashed' => '1',
'ids' => $comment_id,
),
$redir
);
break;
case 'untrashcomment':
wp_untrash_comment( $comment );
$redir = add_query_arg( array( 'untrashed' => '1' ), $redir );
break;
case 'spamcomment':
wp_spam_comment( $comment );
$redir = add_query_arg(
array(
'spammed' => '1',
'ids' => $comment_id,
),
$redir
);
break;
case 'unspamcomment':
wp_unspam_comment( $comment );
$redir = add_query_arg( array( 'unspammed' => '1' ), $redir );
break;
case 'approvecomment':
wp_set_comment_status( $comment, 'approve' );
$redir = add_query_arg( array( 'approved' => 1 ), $redir );
break;
case 'unapprovecomment':
wp_set_comment_status( $comment, 'hold' );
$redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
break;
}
wp_redirect( $redir );
die;
case 'editedcomment':
$comment_id = absint( $_POST['comment_ID'] );
$comment_post_id = absint( $_POST['comment_post_ID'] );
check_admin_referer( 'update-comment_' . $comment_id );
$updated = edit_comment();
if ( is_wp_error( $updated ) ) {
wp_die( $updated->get_error_message() );
}
$location = ( empty( $_POST['referredby'] ) ? "edit-comments.php?p=$comment_post_id" : $_POST['referredby'] ) . '#comment-' . $comment_id;
/**
* Filters the URI the user is redirected to after editing a comment in the admin.
*
* @since 2.1.0
*
* @param string $location The URI the user will be redirected to.
* @param int $comment_id The ID of the comment being edited.
*/
$location = apply_filters( 'comment_edit_redirect', $location, $comment_id );
wp_redirect( $location );
exit;
default:
wp_die( __( 'Unknown action.' ) );
} // End switch.
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK ^[����= �= options-discussion.phpnu �[��� <?php
/**
* Discussion settings administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
}
// Used in the HTML title tag.
$title = __( 'Discussion Settings' );
$parent_file = 'options-general.php';
add_action( 'admin_print_footer_scripts', 'options_discussion_add_js' );
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' => '<p>' . __( 'This screen provides many options for controlling the management and display of comments and links to your posts/pages. So many, in fact, they will not all fit here! :) Use the documentation links to get information on what each discussion setting does.' ) . '</p>' .
'<p>' . __( 'You must click the Save Changes button at the bottom of the screen for new settings to take effect.' ) . '</p>',
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/settings-discussion-screen/">Documentation on Discussion Settings</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
<form method="post" action="options.php">
<?php settings_fields( 'discussion' ); ?>
<table class="form-table indent-children" role="presentation">
<tr>
<th scope="row"><?php _e( 'Default post settings' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Default post settings' );
?>
</span></legend>
<label for="default_pingback_flag">
<input name="default_pingback_flag" type="checkbox" id="default_pingback_flag" value="1" <?php checked( '1', get_option( 'default_pingback_flag' ) ); ?> />
<?php _e( 'Attempt to notify any blogs linked to from the post' ); ?></label>
<br />
<label for="default_ping_status">
<input name="default_ping_status" type="checkbox" id="default_ping_status" value="open" <?php checked( 'open', get_option( 'default_ping_status' ) ); ?> />
<?php _e( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new posts' ); ?></label>
<br />
<label for="default_comment_status">
<input name="default_comment_status" type="checkbox" id="default_comment_status" value="open" <?php checked( 'open', get_option( 'default_comment_status' ) ); ?> />
<?php _e( 'Allow people to submit comments on new posts' ); ?></label>
<br />
<p class="description"><?php _e( 'Individual posts may override these settings. Changes here will only be applied to new posts.' ); ?></p>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Other comment settings' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Other comment settings' );
?>
</span></legend>
<label for="require_name_email"><input type="checkbox" name="require_name_email" id="require_name_email" value="1" <?php checked( '1', get_option( 'require_name_email' ) ); ?> /> <?php _e( 'Comment author must fill out name and email' ); ?></label>
<br />
<label for="comment_registration">
<input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked( '1', get_option( 'comment_registration' ) ); ?> />
<?php _e( 'Users must be registered and logged in to comment' ); ?>
<?php
if ( ! get_option( 'users_can_register' ) && is_multisite() ) {
echo ' ' . __( '(Signup has been disabled. Only members of this site can comment.)' );
}
?>
</label>
<br />
<input name="close_comments_for_old_posts" type="checkbox" id="close_comments_for_old_posts" value="1" <?php checked( '1', get_option( 'close_comments_for_old_posts' ) ); ?> /> <label for="close_comments_for_old_posts"><?php _e( 'Automatically close comments on old posts' ); ?></label>
<ul>
<li>
<label for="close_comments_days_old"><?php _e( 'Close comments when post is how many days old' ); ?></label>
<input name="close_comments_days_old" type="number" step="1" min="0" id="close_comments_days_old" value="<?php echo esc_attr( get_option( 'close_comments_days_old' ) ); ?>" class="small-text" />
</li>
</ul>
<input name="show_comments_cookies_opt_in" type="checkbox" id="show_comments_cookies_opt_in" value="1" <?php checked( '1', get_option( 'show_comments_cookies_opt_in' ) ); ?> />
<label for="show_comments_cookies_opt_in"><?php _e( 'Show comments cookies opt-in checkbox, allowing comment author cookies to be set' ); ?></label>
<br />
<input name="thread_comments" type="checkbox" id="thread_comments" value="1" <?php checked( '1', get_option( 'thread_comments' ) ); ?> />
<label for="thread_comments"><?php _e( 'Enable threaded (nested) comments' ); ?></label>
<?php
/**
* Filters the maximum depth of threaded/nested comments.
*
* @since 2.7.0
*
* @param int $max_depth The maximum depth of threaded comments. Default 10.
*/
$maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 );
$thread_comments_depth = '<select name="thread_comments_depth" id="thread_comments_depth">';
for ( $i = 2; $i <= $maxdeep; $i++ ) {
$thread_comments_depth .= "<option value='" . esc_attr( $i ) . "'";
if ( (int) get_option( 'thread_comments_depth' ) === $i ) {
$thread_comments_depth .= " selected='selected'";
}
$thread_comments_depth .= ">$i</option>";
}
$thread_comments_depth .= '</select>';
?>
<ul>
<li>
<label for="thread_comments_depth"><?php _e( 'Number of levels for threaded (nested) comments' ); ?></label>
<?php echo $thread_comments_depth; ?>
</li>
</ul>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Comment Pagination' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Comment Pagination' );
?>
</span></legend>
<input name="page_comments" type="checkbox" id="page_comments" value="1" <?php checked( '1', get_option( 'page_comments' ) ); ?> />
<label for="page_comments"><?php _e( 'Break comments into pages' ); ?></label>
<ul>
<li>
<label for="comments_per_page"><?php _e( 'Top level comments per page' ); ?></label>
<input name="comments_per_page" type="number" step="1" min="0" id="comments_per_page" value="<?php echo esc_attr( get_option( 'comments_per_page' ) ); ?>" class="small-text" />
</li>
<li>
<label for="default_comments_page"><?php _e( 'Comments page to display by default' ); ?></label>
<select name="default_comments_page" id="default_comments_page">
<option value="newest" <?php selected( 'newest', get_option( 'default_comments_page' ) ); ?>><?php _e( 'last page' ); ?></option>
<option value="oldest" <?php selected( 'oldest', get_option( 'default_comments_page' ) ); ?>><?php _e( 'first page' ); ?></option>
</select>
</li>
<li>
<label for="comment_order"><?php _e( 'Comments to display at the top of each page' ); ?></label>
<select name="comment_order" id="comment_order">
<option value="asc" <?php selected( 'asc', get_option( 'comment_order' ) ); ?>><?php _e( 'older' ); ?></option>
<option value="desc" <?php selected( 'desc', get_option( 'comment_order' ) ); ?>><?php _e( 'newer' ); ?></option>
</select>
</li>
</ul>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Email me whenever' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Email me whenever' );
?>
</span></legend>
<label for="comments_notify">
<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked( '1', get_option( 'comments_notify' ) ); ?> />
<?php _e( 'Anyone posts a comment' ); ?> </label>
<br />
<label for="moderation_notify">
<input name="moderation_notify" type="checkbox" id="moderation_notify" value="1" <?php checked( '1', get_option( 'moderation_notify' ) ); ?> />
<?php _e( 'A comment is held for moderation' ); ?> </label>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Before a comment appears' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Before a comment appears' );
?>
</span></legend>
<label for="comment_moderation">
<input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked( '1', get_option( 'comment_moderation' ) ); ?> />
<?php _e( 'Comment must be manually approved' ); ?> </label>
<br />
<label for="comment_previously_approved"><input type="checkbox" name="comment_previously_approved" id="comment_previously_approved" value="1" <?php checked( '1', get_option( 'comment_previously_approved' ) ); ?> /> <?php _e( 'Comment author must have a previously approved comment' ); ?></label>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Comment Moderation' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Comment Moderation' );
?>
</span></legend>
<p><label for="comment_max_links">
<?php
printf(
/* translators: %s: Number of links. */
__( 'Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)' ),
'<input name="comment_max_links" type="number" step="1" min="0" id="comment_max_links" value="' . esc_attr( get_option( 'comment_max_links' ) ) . '" class="small-text" />'
);
?>
</label></p>
<p><label for="moderation_keys"><?php _e( 'When a comment contains any of these words in its content, author name, URL, email, IP address, or browser’s user agent string, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP address per line. It will match inside words, so “press” will match “WordPress”.' ); ?></label></p>
<p>
<textarea name="moderation_keys" rows="10" cols="50" id="moderation_keys" class="large-text code"><?php echo esc_textarea( get_option( 'moderation_keys' ) ); ?></textarea>
</p>
</fieldset></td>
</tr>
<tr>
<th scope="row"><?php _e( 'Disallowed Comment Keys' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Disallowed Comment Keys' );
?>
</span></legend>
<p><label for="disallowed_keys"><?php _e( 'When a comment contains any of these words in its content, author name, URL, email, IP address, or browser’s user agent string, it will be put in the Trash. One word or IP address per line. It will match inside words, so “press” will match “WordPress”.' ); ?></label></p>
<p>
<textarea name="disallowed_keys" rows="10" cols="50" id="disallowed_keys" class="large-text code"><?php echo esc_textarea( get_option( 'disallowed_keys' ) ); ?></textarea>
</p>
</fieldset></td>
</tr>
<?php do_settings_fields( 'discussion', 'default' ); ?>
</table>
<h2 class="title"><?php _e( 'Avatars' ); ?></h2>
<p><?php _e( 'An avatar is an image that can be associated with a user across multiple websites. In this area, you can choose to display avatars of users who interact with the site.' ); ?></p>
<?php
// The above would be a good place to link to the documentation on the Gravatar functions, for putting it in themes. Anything like that?
$show_avatars = get_option( 'show_avatars' );
$show_avatars_class = '';
if ( ! $show_avatars ) {
$show_avatars_class = ' hide-if-js';
}
?>
<table class="form-table" role="presentation">
<tr>
<th scope="row"><?php _e( 'Avatar Display' ); ?></th>
<td>
<label for="show_avatars">
<input type="checkbox" id="show_avatars" name="show_avatars" value="1" <?php checked( $show_avatars, 1 ); ?> />
<?php _e( 'Show Avatars' ); ?>
</label>
</td>
</tr>
<tr class="avatar-settings<?php echo $show_avatars_class; ?>">
<th scope="row"><?php _e( 'Maximum Rating' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Maximum Rating' );
?>
</span></legend>
<?php
$ratings = array(
/* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
'G' => __( 'G — Suitable for all audiences' ),
/* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
'PG' => __( 'PG — Possibly offensive, usually for audiences 13 and above' ),
/* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
'R' => __( 'R — Intended for adult audiences above 17' ),
/* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
'X' => __( 'X — Even more mature than above' ),
);
foreach ( $ratings as $key => $rating ) :
$selected = ( get_option( 'avatar_rating' ) === $key ) ? 'checked="checked"' : '';
echo "\n\t<label><input type='radio' name='avatar_rating' value='" . esc_attr( $key ) . "' $selected/> $rating</label><br />";
endforeach;
?>
</fieldset></td>
</tr>
<tr class="avatar-settings<?php echo $show_avatars_class; ?>">
<th scope="row"><?php _e( 'Default Avatar' ); ?></th>
<td class="defaultavatarpicker"><fieldset><legend class="screen-reader-text"><span>
<?php
/* translators: Hidden accessibility text. */
_e( 'Default Avatar' );
?>
</span></legend>
<p>
<?php _e( 'For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their email address.' ); ?><br />
</p>
<?php
$avatar_defaults = array(
'mystery' => __( 'Mystery Person' ),
'blank' => __( 'Blank' ),
'gravatar_default' => __( 'Gravatar Logo' ),
'identicon' => __( 'Identicon (Generated)' ),
'wavatar' => __( 'Wavatar (Generated)' ),
'monsterid' => __( 'MonsterID (Generated)' ),
'retro' => __( 'Retro (Generated)' ),
'robohash' => __( 'RoboHash (Generated)' ),
);
/**
* Filters the default avatars.
*
* Avatars are stored in key/value pairs, where the key is option value,
* and the name is the displayed avatar name.
*
* @since 2.6.0
*
* @param string[] $avatar_defaults Associative array of default avatars.
*/
$avatar_defaults = apply_filters( 'avatar_defaults', $avatar_defaults );
$default = get_option( 'avatar_default', 'mystery' );
$avatar_list = '';
// Force avatars on to display these choices.
add_filter( 'pre_option_show_avatars', '__return_true', 100 );
foreach ( $avatar_defaults as $default_key => $default_name ) {
$selected = ( $default === $default_key ) ? 'checked="checked" ' : '';
$avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr( $default_key ) . "' {$selected}/> ";
$avatar_list .= get_avatar( $user_email, 32, $default_key, '', array( 'force_default' => true ) );
$avatar_list .= ' ' . $default_name . '</label>';
$avatar_list .= '<br />';
}
remove_filter( 'pre_option_show_avatars', '__return_true', 100 );
/**
* Filters the HTML output of the default avatar list.
*
* @since 2.6.0
*
* @param string $avatar_list HTML markup of the avatar list.
*/
echo apply_filters( 'default_avatar_select', $avatar_list );
?>
</fieldset></td>
</tr>
<?php do_settings_fields( 'discussion', 'avatars' ); ?>
</table>
<?php do_settings_sections( 'discussion' ); ?>
<?php submit_button(); ?>
</form>
</div>
<?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ?>
PK ^[ޣQx x plugins.phpnu �[��� <?php
/**
* Plugins administration panel.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
if ( ! current_user_can( 'activate_plugins' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage plugins for this site.' ) );
}
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
$pagenum = $wp_list_table->get_pagenum();
$action = $wp_list_table->current_action();
$plugin = isset( $_REQUEST['plugin'] ) ? wp_unslash( $_REQUEST['plugin'] ) : '';
$s = isset( $_REQUEST['s'] ) ? urlencode( wp_unslash( $_REQUEST['s'] ) ) : '';
// Clean up request URI from temporary args for screen options/paging uri's to work as expected.
$query_args_to_remove = array(
'error',
'deleted',
'activate',
'activate-multi',
'deactivate',
'deactivate-multi',
'enabled-auto-update',
'disabled-auto-update',
'enabled-auto-update-multi',
'disabled-auto-update-multi',
'_error_nonce',
);
$_SERVER['REQUEST_URI'] = remove_query_arg( $query_args_to_remove, $_SERVER['REQUEST_URI'] );
wp_enqueue_script( 'updates' );
WP_Plugin_Dependencies::initialize();
if ( $action ) {
switch ( $action ) {
case 'activate':
if ( ! current_user_can( 'activate_plugin', $plugin ) ) {
wp_die( __( 'Sorry, you are not allowed to activate this plugin.' ) );
}
if ( is_multisite() && ! is_network_admin() && is_network_only_plugin( $plugin ) ) {
wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) );
exit;
}
check_admin_referer( 'activate-plugin_' . $plugin );
$result = activate_plugin( $plugin, self_admin_url( 'plugins.php?error=true&plugin=' . urlencode( $plugin ) ), is_network_admin() );
if ( is_wp_error( $result ) ) {
if ( 'unexpected_output' === $result->get_error_code() ) {
$redirect = self_admin_url( 'plugins.php?error=true&charsout=' . strlen( $result->get_error_data() ) . '&plugin=' . urlencode( $plugin ) . "&plugin_status=$status&paged=$page&s=$s" );
wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) );
exit;
} else {
wp_die( $result );
}
}
if ( ! is_network_admin() ) {
$recent = (array) get_option( 'recently_activated' );
unset( $recent[ $plugin ] );
update_option( 'recently_activated', $recent, false );
} else {
$recent = (array) get_site_option( 'recently_activated' );
unset( $recent[ $plugin ] );
update_site_option( 'recently_activated', $recent );
}
if ( isset( $_GET['from'] ) && 'import' === $_GET['from'] ) {
// Overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix.
wp_redirect( self_admin_url( 'import.php?import=' . str_replace( '-importer', '', dirname( $plugin ) ) ) );
} elseif ( isset( $_GET['from'] ) && 'press-this' === $_GET['from'] ) {
wp_redirect( self_admin_url( 'press-this.php' ) );
} else {
// Overrides the ?error=true one above.
wp_redirect( self_admin_url( "plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s" ) );
}
exit;
case 'activate-selected':
if ( ! current_user_can( 'activate_plugins' ) ) {
wp_die( __( 'Sorry, you are not allowed to activate plugins for this site.' ) );
}
check_admin_referer( 'bulk-plugins' );
$plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
if ( is_network_admin() ) {
foreach ( $plugins as $i => $plugin ) {
// Only activate plugins which are not already network activated.
if ( is_plugin_active_for_network( $plugin ) ) {
unset( $plugins[ $i ] );
}
}
} else {
foreach ( $plugins as $i => $plugin ) {
// Only activate plugins which are not already active and are not network-only when on Multisite.
if ( is_plugin_active( $plugin ) || ( is_multisite() && is_network_only_plugin( $plugin ) ) ) {
unset( $plugins[ $i ] );
}
// Only activate plugins which the user can activate.
if ( ! current_user_can( 'activate_plugin', $plugin ) ) {
unset( $plugins[ $i ] );
}
}
}
if ( empty( $plugins ) ) {
wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) );
exit;
}
activate_plugins( $plugins, self_admin_url( 'plugins.php?error=true' ), is_network_admin() );
if ( ! is_network_admin() ) {
$recent = (array) get_option( 'recently_activated' );
} else {
$recent = (array) get_site_option( 'recently_activated' );
}
foreach ( $plugins as $plugin ) {
unset( $recent[ $plugin ] );
}
if ( ! is_network_admin() ) {
update_option( 'recently_activated', $recent, false );
} else {
update_site_option( 'recently_activated', $recent );
}
wp_redirect( self_admin_url( "plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s" ) );
exit;
case 'update-selected':
check_admin_referer( 'bulk-plugins' );
if ( isset( $_GET['plugins'] ) ) {
$plugins = explode( ',', wp_unslash( $_GET['plugins'] ) );
} elseif ( isset( $_POST['checked'] ) ) {
$plugins = (array) wp_unslash( $_POST['checked'] );
} else {
$plugins = array();
}
// Used in the HTML title tag.
$title = __( 'Update Plugins' );
$parent_file = 'plugins.php';
wp_enqueue_script( 'updates' );
require_once ABSPATH . 'wp-admin/admin-header.php';
echo '<div class="wrap">';
echo '<h1>' . esc_html( $title ) . '</h1>';
$url = self_admin_url( 'update.php?action=update-selected&plugins=' . urlencode( implode( ',', $plugins ) ) );
$url = wp_nonce_url( $url, 'bulk-update-plugins' );
echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>";
echo '</div>';
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit;
case 'error_scrape':
if ( ! current_user_can( 'activate_plugin', $plugin ) ) {
wp_die( __( 'Sorry, you are not allowed to activate this plugin.' ) );
}
check_admin_referer( 'plugin-activation-error_' . $plugin );
$valid = validate_plugin( $plugin );
if ( is_wp_error( $valid ) ) {
wp_die( $valid );
}
if ( ! WP_DEBUG ) {
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
}
ini_set( 'display_errors', true ); // Ensure that fatal errors are displayed.
// Go back to "sandbox" scope so we get the same errors as before.
plugin_sandbox_scrape( $plugin );
/** This action is documented in wp-admin/includes/plugin.php */
do_action( "activate_{$plugin}" );
exit;
case 'deactivate':
if ( ! current_user_can( 'deactivate_plugin', $plugin ) ) {
wp_die( __( 'Sorry, you are not allowed to deactivate this plugin.' ) );
}
check_admin_referer( 'deactivate-plugin_' . $plugin );
if ( ! is_network_admin() && is_plugin_active_for_network( $plugin ) ) {
wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) );
exit;
}
deactivate_plugins( $plugin, false, is_network_admin() );
if ( ! is_network_admin() ) {
update_option( 'recently_activated', array( $plugin => time() ) + (array) get_option( 'recently_activated' ), false );
} else {
update_site_option( 'recently_activated', array( $plugin => time() ) + (array) get_site_option( 'recently_activated' ) );
}
if ( headers_sent() ) {
echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) . "' />";
} else {
wp_redirect( self_admin_url( "plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) );
}
exit;
case 'deactivate-selected':
if ( ! current_user_can( 'deactivate_plugins' ) ) {
wp_die( __( 'Sorry, you are not allowed to deactivate plugins for this site.' ) );
}
check_admin_referer( 'bulk-plugins' );
$plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
// Do not deactivate plugins which are already deactivated.
if ( is_network_admin() ) {
$plugins = array_filter( $plugins, 'is_plugin_active_for_network' );
} else {
$plugins = array_filter( $plugins, 'is_plugin_active' );
$plugins = array_diff( $plugins, array_filter( $plugins, 'is_plugin_active_for_network' ) );
foreach ( $plugins as $i => $plugin ) {
// Only deactivate plugins which the user can deactivate.
if ( ! current_user_can( 'deactivate_plugin', $plugin ) ) {
unset( $plugins[ $i ] );
}
}
}
if ( empty( $plugins ) ) {
wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) );
exit;
}
deactivate_plugins( $plugins, false, is_network_admin() );
$deactivated = array();
foreach ( $plugins as $plugin ) {
$deactivated[ $plugin ] = time();
}
if ( ! is_network_admin() ) {
update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ), false );
} else {
update_site_option( 'recently_activated', $deactivated + (array) get_site_option( 'recently_activated' ) );
}
wp_redirect( self_admin_url( "plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s" ) );
exit;
case 'delete-selected':
if ( ! current_user_can( 'delete_plugins' ) ) {
wp_die( __( 'Sorry, you are not allowed to delete plugins for this site.' ) );
}
check_admin_referer( 'bulk-plugins' );
// $_POST = from the plugin form; $_GET = from the FTP details screen.
$plugins = isset( $_REQUEST['checked'] ) ? (array) wp_unslash( $_REQUEST['checked'] ) : array();
if ( empty( $plugins ) ) {
wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) );
exit;
}
$plugins = array_filter( $plugins, 'is_plugin_inactive' ); // Do not allow to delete activated plugins.
if ( empty( $plugins ) ) {
wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s" ) );
exit;
}
// Bail on all if any paths are invalid.
// validate_file() returns truthy for invalid files.
$invalid_plugin_files = array_filter( $plugins, 'validate_file' );
if ( $invalid_plugin_files ) {
wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) );
exit;
}
require ABSPATH . 'wp-admin/update.php';
$parent_file = 'plugins.php';
if ( ! isset( $_REQUEST['verify-delete'] ) ) {
wp_enqueue_script( 'jquery' );
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap">
<?php
$plugin_info = array();
$have_non_network_plugins = false;
foreach ( (array) $plugins as $plugin ) {
$plugin_slug = dirname( $plugin );
if ( '.' === $plugin_slug ) {
$data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
if ( $data ) {
$plugin_info[ $plugin ] = $data;
$plugin_info[ $plugin ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
if ( ! $plugin_info[ $plugin ]['Network'] ) {
$have_non_network_plugins = true;
}
}
} else {
// Get plugins list from that folder.
$folder_plugins = get_plugins( '/' . $plugin_slug );
if ( $folder_plugins ) {
foreach ( $folder_plugins as $plugin_file => $data ) {
$plugin_info[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $data );
$plugin_info[ $plugin_file ]['is_uninstallable'] = is_uninstallable_plugin( $plugin );
if ( ! $plugin_info[ $plugin_file ]['Network'] ) {
$have_non_network_plugins = true;
}
}
}
}
}
$plugins_to_delete = count( $plugin_info );
?>
<?php if ( 1 === $plugins_to_delete ) : ?>
<h1><?php _e( 'Delete Plugin' ); ?></h1>
<?php
if ( $have_non_network_plugins && is_network_admin() ) :
$maybe_active_plugin = '<strong>' . __( 'Caution:' ) . '</strong> ' . __( 'This plugin may be active on other sites in the network.' );
wp_admin_notice(
$maybe_active_plugin,
array(
'additional_classes' => array( 'error' ),
)
);
endif;
?>
<p><?php _e( 'You are about to remove the following plugin:' ); ?></p>
<?php else : ?>
<h1><?php _e( 'Delete Plugins' ); ?></h1>
<?php
if ( $have_non_network_plugins && is_network_admin() ) :
$maybe_active_plugins = '<strong>' . __( 'Caution:' ) . '</strong> ' . __( 'These plugins may be active on other sites in the network.' );
wp_admin_notice(
$maybe_active_plugins,
array(
'additional_classes' => array( 'error' ),
)
);
endif;
?>
<p><?php _e( 'You are about to remove the following plugins:' ); ?></p>
<?php endif; ?>
<ul class="ul-disc">
<?php
$data_to_delete = false;
foreach ( $plugin_info as $plugin ) {
if ( $plugin['is_uninstallable'] ) {
/* translators: 1: Plugin name, 2: Plugin author. */
echo '<li>', sprintf( __( '%1$s by %2$s (will also <strong>delete its data</strong>)' ), '<strong>' . $plugin['Name'] . '</strong>', '<em>' . $plugin['AuthorName'] . '</em>' ), '</li>';
$data_to_delete = true;
} else {
/* translators: 1: Plugin name, 2: Plugin author. */
echo '<li>', sprintf( _x( '%1$s by %2$s', 'plugin' ), '<strong>' . $plugin['Name'] . '</strong>', '<em>' . $plugin['AuthorName'] ) . '</em>', '</li>';
}
}
?>
</ul>
<p>
<?php
if ( $data_to_delete ) {
_e( 'Are you sure you want to delete these files and data?' );
} else {
_e( 'Are you sure you want to delete these files?' );
}
?>
</p>
<form method="post" action="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>" style="display:inline;">
<input type="hidden" name="verify-delete" value="1" />
<input type="hidden" name="action" value="delete-selected" />
<?php
foreach ( (array) $plugins as $plugin ) {
echo '<input type="hidden" name="checked[]" value="' . esc_attr( $plugin ) . '" />';
}
?>
<?php wp_nonce_field( 'bulk-plugins' ); ?>
<?php submit_button( $data_to_delete ? __( 'Yes, delete these files and data' ) : __( 'Yes, delete these files' ), '', 'submit', false ); ?>
</form>
<?php
$referer = wp_get_referer();
?>
<form method="post" action="<?php echo $referer ? esc_url( $referer ) : ''; ?>" style="display:inline;">
<?php submit_button( __( 'No, return me to the plugin list' ), '', 'submit', false ); ?>
</form>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';
exit;
} else {
$plugins_to_delete = count( $plugins );
} // End if verify-delete.
$delete_result = delete_plugins( $plugins );
// Store the result in an option rather than a URL param due to object type & length.
// Cannot use transient/cache, as that could get flushed if any plugin flushes data on uninstall/delete.
update_option( 'plugins_delete_result_' . $user_ID, $delete_result, false );
wp_redirect( self_admin_url( "plugins.php?deleted=$plugins_to_delete&plugin_status=$status&paged=$page&s=$s" ) );
exit;
case 'clear-recent-list':
if ( ! is_network_admin() ) {
update_option( 'recently_activated', array(), false );
} else {
update_site_option( 'recently_activated', array() );
}
break;
case 'resume':
if ( is_multisite() ) {
return;
}
if ( ! current_user_can( 'resume_plugin', $plugin ) ) {
wp_die( __( 'Sorry, you are not allowed to resume this plugin.' ) );
}
check_admin_referer( 'resume-plugin_' . $plugin );
$result = resume_plugin( $plugin, self_admin_url( "plugins.php?error=resuming&plugin_status=$status&paged=$page&s=$s" ) );
if ( is_wp_error( $result ) ) {
wp_die( $result );
}
wp_redirect( self_admin_url( "plugins.php?resume=true&plugin_status=$status&paged=$page&s=$s" ) );
exit;
case 'enable-auto-update':
case 'disable-auto-update':
case 'enable-auto-update-selected':
case 'disable-auto-update-selected':
if ( ! current_user_can( 'update_plugins' ) || ! wp_is_auto_update_enabled_for_type( 'plugin' ) ) {
wp_die( __( 'Sorry, you are not allowed to manage plugins automatic updates.' ) );
}
if ( is_multisite() && ! is_network_admin() ) {
wp_die( __( 'Please connect to your network admin to manage plugins automatic updates.' ) );
}
$redirect = self_admin_url( "plugins.php?plugin_status={$status}&paged={$page}&s={$s}" );
if ( 'enable-auto-update' === $action || 'disable-auto-update' === $action ) {
if ( empty( $plugin ) ) {
wp_redirect( $redirect );
exit;
}
check_admin_referer( 'updates' );
} else {
if ( empty( $_POST['checked'] ) ) {
wp_redirect( $redirect );
exit;
}
check_admin_referer( 'bulk-plugins' );
}
$auto_updates = (array) get_site_option( 'auto_update_plugins', array() );
if ( 'enable-auto-update' === $action ) {
$auto_updates[] = $plugin;
$auto_updates = array_unique( $auto_updates );
$redirect = add_query_arg( array( 'enabled-auto-update' => 'true' ), $redirect );
} elseif ( 'disable-auto-update' === $action ) {
$auto_updates = array_diff( $auto_updates, array( $plugin ) );
$redirect = add_query_arg( array( 'disabled-auto-update' => 'true' ), $redirect );
} else {
$plugins = (array) wp_unslash( $_POST['checked'] );
if ( 'enable-auto-update-selected' === $action ) {
$new_auto_updates = array_merge( $auto_updates, $plugins );
$new_auto_updates = array_unique( $new_auto_updates );
$query_args = array( 'enabled-auto-update-multi' => 'true' );
} else {
$new_auto_updates = array_diff( $auto_updates, $plugins );
$query_args = array( 'disabled-auto-update-multi' => 'true' );
}
// Return early if all selected plugins already have auto-updates enabled or disabled.
// Must use non-strict comparison, so that array order is not treated as significant.
if ( $new_auto_updates == $auto_updates ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual
wp_redirect( $redirect );
exit;
}
$auto_updates = $new_auto_updates;
$redirect = add_query_arg( $query_args, $redirect );
}
/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */
$all_items = apply_filters( 'all_plugins', get_plugins() );
// Remove plugins that don't exist or have been deleted since the option was last updated.
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) );
update_site_option( 'auto_update_plugins', $auto_updates );
wp_redirect( $redirect );
exit;
default:
if ( isset( $_POST['checked'] ) ) {
check_admin_referer( 'bulk-plugins' );
$screen = get_current_screen()->id;
$sendback = wp_get_referer();
$plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array();
/** This action is documented in wp-admin/edit.php */
$sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $action, $plugins ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
wp_safe_redirect( $sendback );
exit;
}
break;
}
}
$wp_list_table->prepare_items();
wp_enqueue_script( 'plugin-install' );
add_thickbox();
add_screen_option( 'per_page', array( 'default' => 999 ) );
get_current_screen()->add_help_tab(
array(
'id' => 'overview',
'title' => __( 'Overview' ),
'content' =>
'<p>' . __( 'Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.' ) . '</p>' .
'<p>' . __( 'The search for installed plugins will search for terms in their name, description, or author.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
'<p>' . sprintf(
/* translators: %s: WordPress Plugin Directory URL. */
__( 'If you would like to see more plugins to choose from, click on the “Add Plugin” button and you will be able to browse or search for additional plugins from the <a href="%s">WordPress Plugin Directory</a>. Plugins in the WordPress Plugin Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they are free!' ),
__( 'https://wordpress.org/plugins/' )
) . '</p>',
)
);
get_current_screen()->add_help_tab(
array(
'id' => 'compatibility-problems',
'title' => __( 'Troubleshooting' ),
'content' =>
'<p>' . __( 'Most of the time, plugins play nicely with the core of WordPress and with other plugins. Sometimes, though, a plugin’s code will get in the way of another plugin, causing compatibility issues. If your site starts doing strange things, this may be the problem. Try deactivating all your plugins and re-activating them in various combinations until you isolate which one(s) caused the issue.' ) . '</p>' .
'<p>' . sprintf(
/* translators: %s: WP_PLUGIN_DIR constant value. */
__( 'If something goes wrong with a plugin and you cannot use WordPress, delete or rename that file in the %s directory and it will be automatically deactivated.' ),
'<code>' . WP_PLUGIN_DIR . '</code>'
) . '</p>',
)
);
$help_sidebar_autoupdates = '';
if ( current_user_can( 'update_plugins' ) && wp_is_auto_update_enabled_for_type( 'plugin' ) ) {
get_current_screen()->add_help_tab(
array(
'id' => 'plugins-themes-auto-updates',
'title' => __( 'Auto-updates' ),
'content' =>
'<p>' . __( 'Auto-updates can be enabled or disabled for each individual plugin. Plugins with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '</p>' .
'<p>' . __( 'Auto-updates are only available for plugins recognized by WordPress.org, or that include a compatible update system.' ) . '</p>' .
'<p>' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '</p>',
)
);
$help_sidebar_autoupdates = '<p>' . __( '<a href="https://wordpress.org/documentation/article/plugins-themes-auto-updates/">Documentation on Auto-updates</a>' ) . '</p>';
}
if ( current_user_can( 'install_plugins' ) ) {
get_current_screen()->add_help_tab(
array(
'id' => 'plugins-dependencies',
'title' => __( 'Dependencies' ),
'content' =>
'<p>' . __( 'Plugin Dependencies aims to make the process of installing and activating add-ons (dependents) and the plugins they rely on (dependencies) consistent and easy.' ) . '</p>' .
'<p>' . __( 'If a required plugin is deleted, a notice will be displayed on the Plugin administration screen informing the user that there is some missing dependencies to install and/or activate. Additionally, each plugin whose dependencies are not met will have an error notice on their plugin row.' ) . '</p>' .
'<p>' . __( 'If a dependent plugin is missing some dependencies, its activation button will be disabled until the required dependencies are activated.' ) . '</p>',
)
);
}
get_current_screen()->set_help_sidebar(
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://wordpress.org/documentation/article/manage-plugins/">Documentation on Managing Plugins</a>' ) . '</p>' .
$help_sidebar_autoupdates .
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>'
);
get_current_screen()->set_screen_reader_content(
array(
'heading_views' => __( 'Filter plugins list' ),
'heading_pagination' => __( 'Plugins list navigation' ),
'heading_list' => __( 'Plugins list' ),
)
);
// Used in the HTML title tag.
$title = __( 'Plugins' );
$parent_file = 'plugins.php';
require_once ABSPATH . 'wp-admin/admin-header.php';
$invalid = validate_active_plugins();
if ( ! empty( $invalid ) ) {
foreach ( $invalid as $plugin_file => $error ) {
$deactivated_message = sprintf(
/* translators: 1: Plugin file, 2: Error message. */
__( 'The plugin %1$s has been deactivated due to an error: %2$s' ),
'<code>' . esc_html( $plugin_file ) . '</code>',
esc_html( $error->get_error_message() )
);
wp_admin_notice(
$deactivated_message,
array(
'id' => 'message',
'additional_classes' => array( 'error' ),
)
);
}
}
// Used by wp_admin_notice() updated notices.
$updated_notice_args = array(
'id' => 'message',
'additional_classes' => array( 'updated' ),
'dismissible' => true,
);
if ( isset( $_GET['error'] ) ) {
if ( isset( $_GET['main'] ) ) {
$errmsg = __( 'You cannot delete a plugin while it is active on the main site.' );
} elseif ( isset( $_GET['charsout'] ) ) {
$errmsg = sprintf(
/* translators: %d: Number of characters. */
_n(
'The plugin generated %d character of <strong>unexpected output</strong> during activation.',
'The plugin generated %d characters of <strong>unexpected output</strong> during activation.',
$_GET['charsout']
),
$_GET['charsout']
);
$errmsg .= ' ' . __( 'If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' );
} elseif ( 'resuming' === $_GET['error'] ) {
$errmsg = __( 'Plugin could not be resumed because it triggered a <strong>fatal error</strong>.' );
} else {
$errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' );
}
if ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] )
&& isset( $_GET['_error_nonce'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin )
) {
$iframe_url = add_query_arg(
array(
'action' => 'error_scrape',
'plugin' => urlencode( $plugin ),
'_wpnonce' => urlencode( $_GET['_error_nonce'] ),
),
admin_url( 'plugins.php' )
);
$errmsg .= '<iframe style="border:0" width="100%" height="70px" src="' . esc_url( $iframe_url ) . '"></iframe>';
}
wp_admin_notice(
$errmsg,
array(
'id' => 'message',
'additional_classes' => array( 'error' ),
)
);
} elseif ( isset( $_GET['deleted'] ) ) {
$delete_result = get_option( 'plugins_delete_result_' . $user_ID );
// Delete it once we're done.
delete_option( 'plugins_delete_result_' . $user_ID );
if ( is_wp_error( $delete_result ) ) {
$plugin_not_deleted_message = sprintf(
/* translators: %s: Error message. */
__( 'Plugin could not be deleted due to an error: %s' ),
esc_html( $delete_result->get_error_message() )
);
wp_admin_notice(
$plugin_not_deleted_message,
array(
'id' => 'message',
'additional_classes' => array( 'error' ),
'dismissible' => true,
)
);
} else {
if ( 1 === (int) $_GET['deleted'] ) {
$plugins_deleted_message = __( 'The selected plugin has been deleted.' );
} else {
$plugins_deleted_message = __( 'The selected plugins have been deleted.' );
}
wp_admin_notice( $plugins_deleted_message, $updated_notice_args );
}
} elseif ( isset( $_GET['activate'] ) ) {
wp_admin_notice( __( 'Plugin activated.' ), $updated_notice_args );
} elseif ( isset( $_GET['activate-multi'] ) ) {
wp_admin_notice( __( 'Selected plugins activated.' ), $updated_notice_args );
} elseif ( isset( $_GET['deactivate'] ) ) {
wp_admin_notice( __( 'Plugin deactivated.' ), $updated_notice_args );
} elseif ( isset( $_GET['deactivate-multi'] ) ) {
wp_admin_notice( __( 'Selected plugins deactivated.' ), $updated_notice_args );
} elseif ( 'update-selected' === $action ) {
wp_admin_notice( __( 'All selected plugins are up to date.' ), $updated_notice_args );
} elseif ( isset( $_GET['resume'] ) ) {
wp_admin_notice( __( 'Plugin resumed.' ), $updated_notice_args );
} elseif ( isset( $_GET['enabled-auto-update'] ) ) {
wp_admin_notice( __( 'Plugin will be auto-updated.' ), $updated_notice_args );
} elseif ( isset( $_GET['disabled-auto-update'] ) ) {
wp_admin_notice( __( 'Plugin will no longer be auto-updated.' ), $updated_notice_args );
} elseif ( isset( $_GET['enabled-auto-update-multi'] ) ) {
wp_admin_notice( __( 'Selected plugins will be auto-updated.' ), $updated_notice_args );
} elseif ( isset( $_GET['disabled-auto-update-multi'] ) ) {
wp_admin_notice( __( 'Selected plugins will no longer be auto-updated.' ), $updated_notice_args );
}
?>
<?php WP_Plugin_Dependencies::display_admin_notice_for_unmet_dependencies(); ?>
<?php WP_Plugin_Dependencies::display_admin_notice_for_circular_dependencies(); ?>
<div class="wrap">
<h1 class="wp-heading-inline">
<?php
echo esc_html( $title );
?>
</h1>
<?php
if ( ( ! is_multisite() || is_network_admin() ) && current_user_can( 'install_plugins' ) ) {
?>
<a href="<?php echo esc_url( self_admin_url( 'plugin-install.php' ) ); ?>" class="page-title-action"><?php echo esc_html__( 'Add Plugin' ); ?></a>
<?php
}
if ( strlen( $s ) ) {
echo '<span class="subtitle">';
printf(
/* translators: %s: Search query. */
__( 'Search results for: %s' ),
'<strong>' . esc_html( urldecode( $s ) ) . '</strong>'
);
echo '</span>';
}
?>
<hr class="wp-header-end">
<?php
/**
* Fires before the plugins list table is rendered.
*
* This hook also fires before the plugins list table is rendered in the Network Admin.
*
* Please note: The 'active' portion of the hook name does not refer to whether the current
* view is for active plugins, but rather all plugins actively-installed.
*
* @since 3.0.0
*
* @param array[] $plugins_all An array of arrays containing information on all installed plugins.
*/
do_action( 'pre_current_active_plugins', $plugins['all'] );
?>
<?php $wp_list_table->views(); ?>
<form class="search-form search-plugins" method="get">
<?php $wp_list_table->search_box( __( 'Search installed plugins' ), 'plugin' ); ?>
</form>
<form method="post" id="bulk-action-form">
<input type="hidden" name="plugin_status" value="<?php echo esc_attr( $status ); ?>" />
<input type="hidden" name="paged" value="<?php echo esc_attr( $page ); ?>" />
<?php $wp_list_table->display(); ?>
</form>
<span class="spinner"></span>
</div>
<?php
wp_print_request_filesystem_credentials_modal();
wp_print_admin_notice_templates();
wp_print_update_row_templates();
require_once ABSPATH . 'wp-admin/admin-footer.php';
PK ^[���� � link.phpnu �[��� <?php
/**
* Manage link administration actions.
*
* This page is accessed by the link management pages and handles the forms and
* Ajax processes for link actions.
*
* @package WordPress
* @subpackage Administration
*/
/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';
$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
$cat_id = ! empty( $_REQUEST['cat_id'] ) ? absint( $_REQUEST['cat_id'] ) : 0;
$link_id = ! empty( $_REQUEST['link_id'] ) ? absint( $_REQUEST['link_id'] ) : 0;
if ( ! current_user_can( 'manage_links' ) ) {
wp_link_manager_disabled_message();
}
if ( ! empty( $_POST['deletebookmarks'] ) ) {
$action = 'deletebookmarks';
}
if ( ! empty( $_POST['move'] ) ) {
$action = 'move';
}
if ( ! empty( $_POST['linkcheck'] ) ) {
$linkcheck = $_POST['linkcheck'];
}
$this_file = admin_url( 'link-manager.php' );
switch ( $action ) {
case 'deletebookmarks':
check_admin_referer( 'bulk-bookmarks' );
// For each link id (in $linkcheck[]) change category to selected value.
if ( count( $linkcheck ) === 0 ) {
wp_redirect( $this_file );
exit;
}
$deleted = 0;
foreach ( $linkcheck as $link_id ) {
$link_id = (int) $link_id;
if ( wp_delete_link( $link_id ) ) {
++$deleted;
}
}
wp_redirect( "$this_file?deleted=$deleted" );
exit;
case 'move':
check_admin_referer( 'bulk-bookmarks' );
// For each link id (in $linkcheck[]) change category to selected value.
if ( count( $linkcheck ) === 0 ) {
wp_redirect( $this_file );
exit;
}
$all_links = implode( ',', $linkcheck );
/*
* Should now have an array of links we can change:
* $q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)");
*/
wp_redirect( $this_file );
exit;
case 'add':
check_admin_referer( 'add-bookmark' );
$redir = wp_get_referer();
if ( add_link() ) {
$redir = add_query_arg( 'added', 'true', $redir );
}
wp_redirect( $redir );
exit;
case 'save':
$link_id = (int) $_POST['link_id'];
check_admin_referer( 'update-bookmark_' . $link_id );
edit_link( $link_id );
wp_redirect( $this_file );
exit;
case 'delete':
$link_id = (int) $_GET['link_id'];
check_admin_referer( 'delete-bookmark_' . $link_id );
wp_delete_link( $link_id );
wp_redirect( $this_file );
exit;
case 'edit':
wp_enqueue_script( 'link' );
wp_enqueue_script( 'xfn' );
if ( wp_is_mobile() ) {
wp_enqueue_script( 'jquery-touch-punch' );
}
$parent_file = 'link-manager.php';
$submenu_file = 'link-manager.php';
// Used in the HTML title tag.
$title = __( 'Edit Link' );
$link_id = (int) $_GET['link_id'];
$link = get_link_to_edit( $link_id );
if ( ! $link ) {
wp_die( __( 'Link not found.' ) );
}
require ABSPATH . 'wp-admin/edit-link-form.php';
require_once ABSPATH . 'wp-admin/admin-footer.php';
break;
default:
break;
}
PK ^[�$��% % 6 includes/class-wp-application-passwords-list-table.phpnu �[��� <?php
/**
* List Table API: WP_Application_Passwords_List_Table class
*
* @package WordPress
* @subpackage Administration
* @since 5.6.0
*/
/**
* Class for displaying the list of application password items.
*
* @since 5.6.0
*
* @see WP_List_Table
*/
class WP_Application_Passwords_List_Table extends WP_List_Table {
/**
* Gets the list of columns.
*
* @since 5.6.0
*
* @return string[] Array of column titles keyed by their column name.
*/
public function get_columns() {
return array(
'name' => __( 'Name' ),
'created' => __( 'Created' ),
'last_used' => __( 'Last Used' ),
'last_ip' => __( 'Last IP' ),
'revoke' => __( 'Revoke' ),
);
}
/**
* Prepares the list of items for displaying.
*
* @since 5.6.0
*
* @global int $user_id User ID.
*/
public function prepare_items() {
global $user_id;
$this->items = array_reverse( WP_Application_Passwords::get_user_application_passwords( $user_id ) );
}
/**
* Handles the name column output.
*
* @since 5.6.0
*
* @param array $item The current application password item.
*/
public function column_name( $item ) {
echo esc_html( $item['name'] );
}
/**
* Handles the created column output.
*
* @since 5.6.0
*
* @param array $item The current application password item.
*/
public function column_created( $item ) {
if ( empty( $item['created'] ) ) {
echo '—';
} else {
echo date_i18n( __( 'F j, Y' ), $item['created'] );
}
}
/**
* Handles the last used column output.
*
* @since 5.6.0
*
* @param array $item The current application password item.
*/
public function column_last_used( $item ) {
if ( empty( $item['last_used'] ) ) {
echo '—';
} else {
echo date_i18n( __( 'F j, Y' ), $item['last_used'] );
}
}
/**
* Handles the last ip column output.
*
* @since 5.6.0
*
* @param array $item The current application password item.
*/
public function column_last_ip( $item ) {
if ( empty( $item['last_ip'] ) ) {
echo '—';
} else {
echo $item['last_ip'];
}
}
/**
* Handles the revoke column output.
*
* @since 5.6.0
*
* @param array $item The current application password item.
*/
public function column_revoke( $item ) {
$name = 'revoke-application-password-' . $item['uuid'];
printf(
'<button type="button" name="%1$s" id="%1$s" class="button delete" aria-label="%2$s">%3$s</button>',
esc_attr( $name ),
/* translators: %s: the application password's given name. */
esc_attr( sprintf( __( 'Revoke "%s"' ), $item['name'] ) ),
__( 'Revoke' )
);
}
/**
* Generates content for a single row of the table
*
* @since 5.6.0
*
* @param array $item The current item.
* @param string $column_name The current column name.
*/
protected function column_default( $item, $column_name ) {
/**
* Fires for each custom column in the Application Passwords list table.
*
* Custom columns are registered using the {@see 'manage_application-passwords-user_columns'} filter.
*
* @since 5.6.0
*
* @param string $column_name Name of the custom column.
* @param array $item The application password item.
*/
do_action( "manage_{$this->screen->id}_custom_column", $column_name, $item );
}
/**
* Generates custom table navigation to prevent conflicting nonces.
*
* @since 5.6.0
*
* @param string $which The location of the bulk actions: Either 'top' or 'bottom'.
*/
protected function display_tablenav( $which ) {
?>
<div class="tablenav <?php echo esc_attr( $which ); ?>">
<?php if ( 'bottom' === $which ) : ?>
<div class="alignright">
<button type="button" name="revoke-all-application-passwords" id="revoke-all-application-passwords" class="button delete"><?php _e( 'Revoke all application passwords' ); ?></button>
</div>
<?php endif; ?>
<div class="alignleft actions bulkactions">
<?php $this->bulk_actions( $which ); ?>
</div>
<?php
$this->extra_tablenav( $which );
$this->pagination( $which );
?>
<br class="clear" />
</div>
<?php
}
/**
* Generates content for a single row of the table.
*
* @since 5.6.0
*
* @param array $item The current item.
*/
public function single_row( $item ) {
echo '<tr data-uuid="' . esc_attr( $item['uuid'] ) . '">';
$this->single_row_columns( $item );
echo '</tr>';
}
/**
* Gets the name of the default primary column.
*
* @since 5.6.0
*
* @return string Name of the default primary column, in this case, 'name'.
*/
protected function get_default_primary_column_name() {
return 'name';
}
/**
* Prints the JavaScript template for the new row item.
*
* @since 5.6.0
*/
public function print_js_template_row() {
list( $columns, $hidden, , $primary ) = $this->get_column_info();
echo '<tr data-uuid="{{ data.uuid }}">';
foreach ( $columns as $column_name => $display_name ) {
$is_primary = $primary === $column_name;
$classes = "{$column_name} column-{$column_name}";
if ( $is_primary ) {
$classes .= ' has-row-actions column-primary';
}
if ( in_array( $column_name, $hidden, true ) ) {
$classes .= ' hidden';
}
printf( '<td class="%s" data-colname="%s">', esc_attr( $classes ), esc_attr( wp_strip_all_tags( $display_name ) ) );
switch ( $column_name ) {
case 'name':
echo '{{ data.name }}';
break;
case 'created':
// JSON encoding automatically doubles backslashes to ensure they don't get lost when printing the inline JS.
echo '<# print( wp.date.dateI18n( ' . wp_json_encode( __( 'F j, Y' ) ) . ', data.created ) ) #>';
break;
case 'last_used':
echo '<# print( data.last_used !== null ? wp.date.dateI18n( ' . wp_json_encode( __( 'F j, Y' ) ) . ", data.last_used ) : '—' ) #>";
break;
case 'last_ip':
echo "{{ data.last_ip || '—' }}";
break;
case 'revoke':
printf(
'<button type="button" class="button delete" aria-label="%1$s">%2$s</button>',
/* translators: %s: the application password's given name. */
esc_attr( sprintf( __( 'Revoke "%s"' ), '{{ data.name }}' ) ),
esc_html__( 'Revoke' )
);
break;
default:
/**
* Fires in the JavaScript row template for each custom column in the Application Passwords list table.
*
* Custom columns are registered using the {@see 'manage_application-passwords-user_columns'} filter.
*
* @since 5.6.0
*
* @param string $column_name Name of the custom column.
*/
do_action( "manage_{$this->screen->id}_custom_column_js_template", $column_name );
break;
}
if ( $is_primary ) {
echo '<button type="button" class="toggle-row"><span class="screen-reader-text">' .
/* translators: Hidden accessibility text. */
__( 'Show more details' ) .
'</span></button>';
}
echo '</td>';
}
echo '</tr>';
}
}
PK ^[ �]�=Z =Z ' |