Server IP : 104.21.93.192 / Your IP : 216.73.216.24 Web Server : LiteSpeed System : Linux premium900.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64 User : redwjova ( 1790) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/thread-self/root/proc/self/root/proc/self/root/home/redwjova/www/ |
Upload File : |
site-editor.php 0000644 00000027523 15044220553 0007516 0 ustar 00 <?php /** * Site Editor administration screen. * * @package WordPress * @subpackage Administration */ global $editor_styles; /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'edit_theme_options' ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>', 403 ); } /** * Maps old site editor urls to the new updated ones. * * @since 6.8.0 * @access private * * @global string $pagenow The filename of the current screen. * * @return string|false The new URL to redirect to, or false if no redirection is needed. */ function _wp_get_site_editor_redirection_url() { global $pagenow; if ( 'site-editor.php' !== $pagenow || isset( $_REQUEST['p'] ) || empty( $_SERVER['QUERY_STRING'] ) ) { return false; } // The following redirects are for the new permalinks in the site editor. if ( isset( $_REQUEST['postType'] ) && 'wp_navigation' === $_REQUEST['postType'] && ! empty( $_REQUEST['postId'] ) ) { return add_query_arg( array( 'p' => '/wp_navigation/' . $_REQUEST['postId'] ), remove_query_arg( array( 'postType', 'postId' ) ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_navigation' === $_REQUEST['postType'] && empty( $_REQUEST['postId'] ) ) { return add_query_arg( array( 'p' => '/navigation' ), remove_query_arg( 'postType' ) ); } if ( isset( $_REQUEST['path'] ) && '/wp_global_styles' === $_REQUEST['path'] ) { return add_query_arg( array( 'p' => '/styles' ), remove_query_arg( 'path' ) ); } if ( isset( $_REQUEST['postType'] ) && 'page' === $_REQUEST['postType'] && ( empty( $_REQUEST['canvas'] ) || empty( $_REQUEST['postId'] ) ) ) { return add_query_arg( array( 'p' => '/page' ), remove_query_arg( 'postType' ) ); } if ( isset( $_REQUEST['postType'] ) && 'page' === $_REQUEST['postType'] && ! empty( $_REQUEST['postId'] ) ) { return add_query_arg( array( 'p' => '/page/' . $_REQUEST['postId'] ), remove_query_arg( array( 'postType', 'postId' ) ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_template' === $_REQUEST['postType'] && ( empty( $_REQUEST['canvas'] ) || empty( $_REQUEST['postId'] ) ) ) { return add_query_arg( array( 'p' => '/template' ), remove_query_arg( 'postType' ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_template' === $_REQUEST['postType'] && ! empty( $_REQUEST['postId'] ) ) { return add_query_arg( array( 'p' => '/wp_template/' . $_REQUEST['postId'] ), remove_query_arg( array( 'postType', 'postId' ) ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_block' === $_REQUEST['postType'] && ( empty( $_REQUEST['canvas'] ) || empty( $_REQUEST['postId'] ) ) ) { return add_query_arg( array( 'p' => '/pattern' ), remove_query_arg( 'postType' ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_block' === $_REQUEST['postType'] && ! empty( $_REQUEST['postId'] ) ) { return add_query_arg( array( 'p' => '/wp_block/' . $_REQUEST['postId'] ), remove_query_arg( array( 'postType', 'postId' ) ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_template_part' === $_REQUEST['postType'] && ( empty( $_REQUEST['canvas'] ) || empty( $_REQUEST['postId'] ) ) ) { return add_query_arg( array( 'p' => '/pattern' ) ); } if ( isset( $_REQUEST['postType'] ) && 'wp_template_part' === $_REQUEST['postType'] && ! empty( $_REQUEST['postId'] ) ) { return add_query_arg( array( 'p' => '/wp_template_part/' . $_REQUEST['postId'] ), remove_query_arg( array( 'postType', 'postId' ) ) ); } // The following redirects are for backward compatibility with the old site editor URLs. if ( isset( $_REQUEST['path'] ) && '/wp_template_part/all' === $_REQUEST['path'] ) { return add_query_arg( array( 'p' => '/pattern', 'postType' => 'wp_template_part', ), remove_query_arg( 'path' ) ); } if ( isset( $_REQUEST['path'] ) && '/page' === $_REQUEST['path'] ) { return add_query_arg( array( 'p' => '/page' ), remove_query_arg( 'path' ) ); } if ( isset( $_REQUEST['path'] ) && '/wp_template' === $_REQUEST['path'] ) { return add_query_arg( array( 'p' => '/template' ), remove_query_arg( 'path' ) ); } if ( isset( $_REQUEST['path'] ) && '/patterns' === $_REQUEST['path'] ) { return add_query_arg( array( 'p' => '/pattern' ), remove_query_arg( 'path' ) ); } if ( isset( $_REQUEST['path'] ) && '/navigation' === $_REQUEST['path'] ) { return add_query_arg( array( 'p' => '/navigation' ), remove_query_arg( 'path' ) ); } return add_query_arg( array( 'p' => '/' ) ); } // Redirect to the site editor to the new URLs if needed. $redirection = _wp_get_site_editor_redirection_url(); if ( false !== $redirection ) { wp_safe_redirect( $redirection ); exit; } // Used in the HTML title tag. $title = _x( 'Editor', 'site editor title tag' ); $parent_file = 'themes.php'; // Flag that we're loading the block editor. $current_screen = get_current_screen(); $current_screen->is_block_editor( true ); // Default to is-fullscreen-mode to avoid jumps in the UI. add_filter( 'admin_body_class', static function ( $classes ) { return "$classes is-fullscreen-mode"; } ); $indexed_template_types = array(); foreach ( get_default_block_template_types() as $slug => $template_type ) { $template_type['slug'] = (string) $slug; $indexed_template_types[] = $template_type; } $context_settings = array( 'name' => 'core/edit-site' ); if ( ! empty( $_GET['postId'] ) && is_numeric( $_GET['postId'] ) ) { $context_settings['post'] = get_post( (int) $_GET['postId'] ); } elseif ( isset( $_GET['p'] ) && preg_match( '/^\/page\/(\d+)$/', $_GET['p'], $matches ) ) { $context_settings['post'] = get_post( (int) $matches[1] ); } $block_editor_context = new WP_Block_Editor_Context( $context_settings ); $custom_settings = array( 'siteUrl' => site_url(), 'postsPerPage' => get_option( 'posts_per_page' ), 'styles' => get_block_editor_theme_styles(), 'defaultTemplateTypes' => $indexed_template_types, 'defaultTemplatePartAreas' => get_allowed_block_template_part_areas(), 'supportsLayout' => wp_theme_has_theme_json(), 'supportsTemplatePartsMode' => ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ), ); // Add additional back-compat patterns registered by `current_screen` et al. $custom_settings['__experimentalAdditionalBlockPatterns'] = WP_Block_Patterns_Registry::get_instance()->get_all_registered( true ); $custom_settings['__experimentalAdditionalBlockPatternCategories'] = WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered( true ); $editor_settings = get_block_editor_settings( $custom_settings, $block_editor_context ); if ( isset( $_GET['postType'] ) && ! isset( $_GET['postId'] ) ) { $post_type = get_post_type_object( $_GET['postType'] ); if ( ! $post_type ) { wp_die( __( 'Invalid post type.' ) ); } } $active_global_styles_id = WP_Theme_JSON_Resolver::get_user_global_styles_post_id(); $active_theme = get_stylesheet(); $navigation_rest_route = rest_get_route_for_post_type_items( 'wp_navigation' ); $preload_paths = array( array( rest_get_route_for_post_type_items( 'attachment' ), 'OPTIONS' ), array( rest_get_route_for_post_type_items( 'page' ), 'OPTIONS' ), '/wp/v2/types?context=view', '/wp/v2/types/wp_template?context=edit', '/wp/v2/types/wp_template_part?context=edit', '/wp/v2/templates?context=edit&per_page=-1', '/wp/v2/template-parts?context=edit&per_page=-1', '/wp/v2/themes?context=edit&status=active', '/wp/v2/global-styles/' . $active_global_styles_id . '?context=edit', array( '/wp/v2/global-styles/' . $active_global_styles_id, 'OPTIONS' ), '/wp/v2/global-styles/themes/' . $active_theme . '?context=view', '/wp/v2/global-styles/themes/' . $active_theme . '/variations?context=view', array( $navigation_rest_route, 'OPTIONS' ), array( add_query_arg( array( 'context' => 'edit', 'per_page' => 100, 'order' => 'desc', 'orderby' => 'date', // array indices are required to avoid query being encoded and not matching in cache. 'status[0]' => 'publish', 'status[1]' => 'draft', ), $navigation_rest_route ), 'GET', ), '/wp/v2/settings', array( '/wp/v2/settings', 'OPTIONS' ), // Used by getBlockPatternCategories in useBlockEditorSettings. '/wp/v2/block-patterns/categories', // @see packages/core-data/src/entities.js '/?_fields=' . implode( ',', array( 'description', 'gmt_offset', 'home', 'name', 'site_icon', 'site_icon_url', 'site_logo', 'timezone_string', 'url', 'page_for_posts', 'page_on_front', 'show_on_front', ) ), ); if ( $block_editor_context->post ) { $route_for_post = rest_get_route_for_post( $block_editor_context->post ); if ( $route_for_post ) { $preload_paths[] = add_query_arg( 'context', 'edit', $route_for_post ); if ( 'page' === $block_editor_context->post->post_type ) { $preload_paths[] = add_query_arg( 'slug', // @see https://github.com/WordPress/gutenberg/blob/e093fefd041eb6cc4a4e7f67b92ab54fd75c8858/packages/core-data/src/private-selectors.ts#L244-L254 empty( $block_editor_context->post->post_name ) ? 'page' : 'page-' . $block_editor_context->post->post_name, '/wp/v2/templates/lookup' ); } } } else { $preload_paths[] = '/wp/v2/templates/lookup?slug=front-page'; $preload_paths[] = '/wp/v2/templates/lookup?slug=home'; } block_editor_rest_api_preload( $preload_paths, $block_editor_context ); wp_add_inline_script( 'wp-edit-site', sprintf( 'wp.domReady( function() { wp.editSite.initializeEditor( "site-editor", %s ); } );', wp_json_encode( $editor_settings ) ) ); // Preload server-registered block schemas. wp_add_inline_script( 'wp-blocks', 'wp.blocks.unstable__bootstrapServerSideBlockDefinitions(' . wp_json_encode( get_block_editor_server_block_settings() ) . ');' ); // Preload server-registered block bindings sources. $registered_sources = get_all_registered_block_bindings_sources(); if ( ! empty( $registered_sources ) ) { $filtered_sources = array(); foreach ( $registered_sources as $source ) { $filtered_sources[] = array( 'name' => $source->name, 'label' => $source->label, 'usesContext' => $source->uses_context, ); } $script = sprintf( 'for ( const source of %s ) { wp.blocks.registerBlockBindingsSource( source ); }', wp_json_encode( $filtered_sources ) ); wp_add_inline_script( 'wp-blocks', $script ); } wp_add_inline_script( 'wp-blocks', sprintf( 'wp.blocks.setCategories( %s );', wp_json_encode( isset( $editor_settings['blockCategories'] ) ? $editor_settings['blockCategories'] : array() ) ), 'after' ); wp_enqueue_script( 'wp-edit-site' ); wp_enqueue_script( 'wp-format-library' ); wp_enqueue_style( 'wp-edit-site' ); wp_enqueue_style( 'wp-format-library' ); wp_enqueue_media(); if ( current_theme_supports( 'wp-block-styles' ) && ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) ) { wp_enqueue_style( 'wp-block-library-theme' ); } /** This action is documented in wp-admin/edit-form-blocks.php */ do_action( 'enqueue_block_editor_assets' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="edit-site" id="site-editor"> <?php // JavaScript is disabled. ?> <div class="wrap hide-if-js site-editor-no-js"> <h1 class="wp-heading-inline"><?php _e( 'Edit Site' ); ?></h1> <?php /** * Filters the message displayed in the site editor interface when JavaScript is * not enabled in the browser. * * @since 6.3.0 * * @param string $message The message being displayed. * @param WP_Post $post The post being edited. */ $message = apply_filters( 'site_editor_no_javascript_message', __( 'The site editor requires JavaScript. Please enable JavaScript in your browser settings.' ), $post ); wp_admin_notice( $message, array( 'type' => 'error', 'additional_classes' => array( 'hide-if-js' ), ) ); ?> </div> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; load-styles.php 0000644 00000005663 15044220553 0007527 0 ustar 00 <?php /* * The error_reporting() function can be disabled in php.ini. On systems where that is the case, * it's best to add a dummy function to the wp-config.php file, but as this call to the function * is run prior to wp-config.php loading, it is wrapped in a function_exists() check. */ if ( function_exists( 'error_reporting' ) ) { /* * Disable error reporting. * * Set this to error_reporting( -1 ) for debugging. */ error_reporting( 0 ); } // Set ABSPATH for execution. if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', dirname( __DIR__ ) . '/' ); } define( 'WPINC', 'wp-includes' ); define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); require ABSPATH . 'wp-admin/includes/noop.php'; require ABSPATH . WPINC . '/theme.php'; require ABSPATH . WPINC . '/class-wp-theme-json-resolver.php'; require ABSPATH . WPINC . '/global-styles-and-settings.php'; require ABSPATH . WPINC . '/script-loader.php'; require ABSPATH . WPINC . '/version.php'; $protocol = $_SERVER['SERVER_PROTOCOL']; if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0', 'HTTP/3' ), true ) ) { $protocol = 'HTTP/1.0'; } $load = $_GET['load']; if ( is_array( $load ) ) { ksort( $load ); $load = implode( '', $load ); } $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load ); $load = array_unique( explode( ',', $load ) ); if ( empty( $load ) ) { header( "$protocol 400 Bad Request" ); exit; } $rtl = ( isset( $_GET['dir'] ) && 'rtl' === $_GET['dir'] ); $expires_offset = 31536000; // 1 year. $out = ''; $wp_styles = new WP_Styles(); wp_default_styles( $wp_styles ); $etag = $wp_styles->get_etag( $load ); if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $etag ) { header( "$protocol 304 Not Modified" ); exit; } foreach ( $load as $handle ) { if ( ! array_key_exists( $handle, $wp_styles->registered ) ) { continue; } $style = $wp_styles->registered[ $handle ]; if ( empty( $style->src ) ) { continue; } $path = ABSPATH . $style->src; if ( $rtl && ! empty( $style->extra['rtl'] ) ) { // All default styles have fully independent RTL files. $path = str_replace( '.min.css', '-rtl.min.css', $path ); } $content = get_file( $path ) . "\n"; // Note: str_starts_with() is not used here, as wp-includes/compat.php is not loaded in this file. if ( 0 === strpos( $style->src, '/' . WPINC . '/css/' ) ) { $content = str_replace( '../images/', '../' . WPINC . '/images/', $content ); $content = str_replace( '../js/tinymce/', '../' . WPINC . '/js/tinymce/', $content ); $content = str_replace( '../fonts/', '../' . WPINC . '/fonts/', $content ); $out .= $content; } else { $out .= str_replace( '../images/', 'images/', $content ); } } header( "Etag: $etag" ); header( 'Content-Type: text/css; charset=UTF-8' ); header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' ); header( "Cache-Control: public, max-age=$expires_offset" ); echo $out; exit; press-this.php 0000644 00000004534 15044220553 0007364 0 ustar 00 <?php /** * Press This Display and Handler. * * @package WordPress * @subpackage Press_This */ define( 'IFRAME_REQUEST', true ); /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; function wp_load_press_this() { $plugin_slug = 'press-this'; $plugin_file = 'press-this/press-this-plugin.php'; if ( ! current_user_can( 'edit_posts' ) || ! current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) { wp_die( __( 'Sorry, you are not allowed to create posts as this user.' ), __( 'You need a higher level of permission.' ), 403 ); } elseif ( is_plugin_active( $plugin_file ) ) { include WP_PLUGIN_DIR . '/press-this/class-wp-press-this-plugin.php'; $wp_press_this = new WP_Press_This_Plugin(); $wp_press_this->html(); } elseif ( current_user_can( 'activate_plugins' ) ) { if ( file_exists( WP_PLUGIN_DIR . '/' . $plugin_file ) ) { $url = wp_nonce_url( add_query_arg( array( 'action' => 'activate', 'plugin' => $plugin_file, 'from' => 'press-this', ), admin_url( 'plugins.php' ) ), 'activate-plugin_' . $plugin_file ); $action = sprintf( '<a href="%1$s" aria-label="%2$s">%2$s</a>', esc_url( $url ), __( 'Activate Press This' ) ); } else { if ( is_main_site() ) { $url = wp_nonce_url( add_query_arg( array( 'action' => 'install-plugin', 'plugin' => $plugin_slug, 'from' => 'press-this', ), self_admin_url( 'update.php' ) ), 'install-plugin_' . $plugin_slug ); $action = sprintf( '<a href="%1$s" class="install-now" data-slug="%2$s" data-name="%2$s" aria-label="%3$s">%3$s</a>', esc_url( $url ), esc_attr( $plugin_slug ), _x( 'Install Now', 'plugin' ) ); } else { $action = sprintf( /* translators: %s: URL to Press This bookmarklet on the main site. */ __( 'Press This is not installed. Please install Press This from <a href="%s">the main site</a>.' ), get_admin_url( get_current_network_id(), 'press-this.php' ) ); } } wp_die( __( 'The Press This plugin is required.' ) . '<br />' . $action, __( 'Installation Required' ), 200 ); } else { wp_die( __( 'Press This is not available. Please contact your site administrator.' ), __( 'Installation Required' ), 200 ); } } wp_load_press_this(); link-manager.php 0000644 00000010411 15044220553 0007617 0 ustar 00 <?php /** * Link Management Administration Screen. * * @package WordPress * @subpackage Administration */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_links' ) ) { wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) ); } $wp_list_table = _get_list_table( 'WP_Links_List_Table' ); // Handle bulk deletes. $doaction = $wp_list_table->current_action(); if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) { check_admin_referer( 'bulk-bookmarks' ); $redirect_to = admin_url( 'link-manager.php' ); $bulklinks = (array) $_REQUEST['linkcheck']; if ( 'delete' === $doaction ) { foreach ( $bulklinks as $link_id ) { $link_id = (int) $link_id; wp_delete_link( $link_id ); } $redirect_to = add_query_arg( 'deleted', count( $bulklinks ), $redirect_to ); } else { $screen = get_current_screen()->id; /** This action is documented in wp-admin/edit.php */ $redirect_to = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $doaction, $bulklinks ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } wp_redirect( $redirect_to ); exit; } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ); exit; } $wp_list_table->prepare_items(); // Used in the HTML title tag. $title = __( 'Links' ); $this_file = 'link-manager.php'; $parent_file = $this_file; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . sprintf( /* translators: %s: URL to Widgets screen. */ __( 'You can add links here to be displayed on your site, usually using <a href="%s">Widgets</a>. By default, links to several sites in the WordPress community are included as examples.' ), 'widgets.php' ) . '</p>' . '<p>' . __( 'Links may be separated into Link Categories; these are different than the categories used on your posts.' ) . '</p>' . '<p>' . __( 'You can customize the display of this screen using the Screen Options tab and/or the dropdown filters above the links table.' ) . '</p>', ) ); get_current_screen()->add_help_tab( array( 'id' => 'deleting-links', 'title' => __( 'Deleting Links' ), 'content' => '<p>' . __( 'If you delete a link, it will be removed permanently, as Links do not have a Trash function yet.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://codex.wordpress.org/Links_Screen">Documentation on Managing Links</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); get_current_screen()->set_screen_reader_content( array( 'heading_list' => __( 'Links list' ), ) ); require_once ABSPATH . 'wp-admin/admin-header.php'; if ( ! current_user_can( 'manage_links' ) ) { wp_die( __( 'Sorry, you are not allowed to edit the links for this site.' ) ); } ?> <div class="wrap nosubsub"> <h1 class="wp-heading-inline"> <?php echo esc_html( $title ); ?> </h1> <a href="link-add.php" class="page-title-action"><?php echo esc_html__( 'Add Link' ); ?></a> <?php if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { echo '<span class="subtitle">'; printf( /* translators: %s: Search query. */ __( 'Search results for: %s' ), '<strong>' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '</strong>' ); echo '</span>'; } ?> <hr class="wp-header-end"> <?php if ( isset( $_REQUEST['deleted'] ) ) { $deleted = (int) $_REQUEST['deleted']; /* translators: %s: Number of links. */ $deleted_message = sprintf( _n( '%s link deleted.', '%s links deleted.', $deleted ), $deleted ); wp_admin_notice( $deleted_message, array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] ); } ?> <form id="posts-filter" method="get"> <?php $wp_list_table->search_box( __( 'Search Links' ), 'link' ); ?> <?php $wp_list_table->display(); ?> <div id="ajax-response"></div> </form> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; user/index.php 0000644 00000000373 15044220553 0007345 0 ustar 00 <?php /** * User Dashboard Administration Screen * * @package WordPress * @subpackage Administration * @since 3.1.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/index.php'; user/profile.php 0000644 00000000374 15044220553 0007677 0 ustar 00 <?php /** * User Profile Administration Screen. * * @package WordPress * @subpackage Administration * @since 3.1.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/profile.php'; user/freedoms.php 0000644 00000000407 15044220553 0010040 0 ustar 00 <?php /** * User Dashboard Freedoms administration panel. * * @package WordPress * @subpackage Administration * @since 3.4.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/freedoms.php'; user/admin.php 0000644 00000001541 15044220553 0007324 0 ustar 00 <?php /** * WordPress User Administration Bootstrap * * @package WordPress * @subpackage Administration * @since 3.1.0 */ define( 'WP_USER_ADMIN', true ); require_once dirname( __DIR__ ) . '/admin.php'; if ( ! is_multisite() ) { wp_redirect( admin_url() ); exit; } $redirect_user_admin_request = ( 0 !== strcasecmp( $current_blog->domain, $current_site->domain ) || 0 !== strcasecmp( $current_blog->path, $current_site->path ) ); /** * Filters whether to redirect the request to the User Admin in Multisite. * * @since 3.2.0 * * @param bool $redirect_user_admin_request Whether the request should be redirected. */ $redirect_user_admin_request = apply_filters( 'redirect_user_admin_request', $redirect_user_admin_request ); if ( $redirect_user_admin_request ) { wp_redirect( user_admin_url() ); exit; } unset( $redirect_user_admin_request ); user/credits.php 0000644 00000000405 15044220553 0007667 0 ustar 00 <?php /** * User Dashboard Credits administration panel. * * @package WordPress * @subpackage Administration * @since 3.4.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/credits.php'; user/error_log 0000644 00000046073 15044220553 0007451 0 ustar 00 [13-Jul-2025 18:52:21 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [13-Jul-2025 18:52:21 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(127): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [13-Jul-2025 18:53:10 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [13-Jul-2025 18:53:10 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(127): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [14-Jul-2025 04:09:08 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [14-Jul-2025 04:09:08 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(127): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [14-Jul-2025 10:42:08 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [14-Jul-2025 10:42:08 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(127): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/about.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [14-Jul-2025 10:42:57 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [14-Jul-2025 10:42:57 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(127): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [14-Jul-2025 10:42:58 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [14-Jul-2025 10:42:58 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(127): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [14-Jul-2025 11:49:06 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [14-Jul-2025 11:49:06 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(127): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [14-Jul-2025 23:51:26 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [14-Jul-2025 23:51:26 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(127): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [15-Jul-2025 03:57:56 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [15-Jul-2025 03:57:56 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(127): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [16-Jul-2025 01:27:06 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [16-Jul-2025 01:27:06 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(128): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [16-Jul-2025 07:17:30 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [16-Jul-2025 07:17:30 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(128): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [17-Jul-2025 03:40:37 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [17-Jul-2025 03:40:37 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(128): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/about.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [17-Jul-2025 03:41:25 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [17-Jul-2025 03:41:25 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(128): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [17-Jul-2025 03:41:26 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [17-Jul-2025 03:41:26 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(128): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [17-Jul-2025 07:54:24 UTC] PHP Warning: require_once(/home/redwjova/public_html/wp-includes/blocks/archives.php): Failed to open stream: No such file or directory in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 [17-Jul-2025 07:54:24 UTC] PHP Fatal error: Uncaught Error: Failed opening required '/home/redwjova/public_html/wp-includes/blocks/archives.php' (include_path='.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php') in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php:5 Stack trace: #0 /home/redwjova/public_html/wp-includes/blocks/index.php(18): require() #1 /home/redwjova/public_html/wp-settings.php(369): require('/home/redwjova/...') #2 /home/redwjova/public_html/wp-config.php(128): require_once('/home/redwjova/...') #3 /home/redwjova/public_html/wp-load.php(50): require_once('/home/redwjova/...') #4 /home/redwjova/public_html/wp-admin/admin.php(35): require_once('/home/redwjova/...') #5 /home/redwjova/public_html/wp-admin/user/admin.php(12): require_once('/home/redwjova/...') #6 /home/redwjova/public_html/wp-admin/user/index.php(11): require_once('/home/redwjova/...') #7 {main} thrown in /home/redwjova/public_html/wp-includes/blocks/require-dynamic-blocks.php on line 5 user/user-edit.php 0000644 00000000372 15044220553 0010136 0 ustar 00 <?php /** * Edit user administration panel. * * @package WordPress * @subpackage Administration * @since 3.1.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/user-edit.php'; user/privacy.php 0000644 00000000405 15044220553 0007707 0 ustar 00 <?php /** * User Dashboard Privacy administration panel. * * @package WordPress * @subpackage Administration * @since 4.9.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/privacy.php'; user/menu.php 0000644 00000001477 15044220553 0007210 0 ustar 00 <?php /** * Build User Administration Menu. * * @package WordPress * @subpackage Administration * @since 3.1.0 */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } $menu[2] = array( __( 'Dashboard' ), 'exist', 'index.php', '', 'menu-top menu-top-first menu-icon-dashboard', 'menu-dashboard', 'dashicons-dashboard' ); $menu[4] = array( '', 'exist', 'separator1', '', 'wp-menu-separator' ); $menu[70] = array( __( 'Profile' ), 'exist', 'profile.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' ); $menu[99] = array( '', 'exist', 'separator-last', '', 'wp-menu-separator' ); $_wp_real_parent_file['users.php'] = 'profile.php'; $compat = array(); $submenu = array(); require_once ABSPATH . 'wp-admin/includes/menu.php'; user/contribute.php 0000644 00000000413 15044220553 0010407 0 ustar 00 <?php /** * User Dashboard Contribute administration panel. * * @package WordPress * @subpackage Administration * @since 6.6.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/contribute.php'; user/about.php 0000644 00000000401 15044220553 0007340 0 ustar 00 <?php /** * User Dashboard About administration panel. * * @package WordPress * @subpackage Administration * @since 3.4.0 */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; require ABSPATH . 'wp-admin/about.php'; post-new.php 0000644 00000005320 15044220553 0007031 0 ustar 00 <?php /** * New Post Administration Screen. * * @package WordPress * @subpackage Administration */ /** Load WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; /** * @global string $post_type Global post type. * @global WP_Post_Type $post_type_object Global post type object. * @global WP_Post $post Global post object. */ global $post_type, $post_type_object, $post; if ( ! isset( $_GET['post_type'] ) ) { $post_type = 'post'; } elseif ( in_array( $_GET['post_type'], get_post_types( array( 'show_ui' => true ) ), true ) ) { $post_type = $_GET['post_type']; } else { wp_die( __( 'Invalid post type.' ) ); } $post_type_object = get_post_type_object( $post_type ); if ( 'post' === $post_type ) { $parent_file = 'edit.php'; $submenu_file = 'post-new.php'; } elseif ( 'attachment' === $post_type ) { if ( wp_redirect( admin_url( 'media-new.php' ) ) ) { exit; } } else { $submenu_file = "post-new.php?post_type=$post_type"; if ( isset( $post_type_object ) && $post_type_object->show_in_menu && true !== $post_type_object->show_in_menu ) { $parent_file = $post_type_object->show_in_menu; // What if there isn't a post-new.php item for this post type? if ( ! isset( $_registered_pages[ get_plugin_page_hookname( "post-new.php?post_type=$post_type", $post_type_object->show_in_menu ) ] ) ) { if ( isset( $_registered_pages[ get_plugin_page_hookname( "edit.php?post_type=$post_type", $post_type_object->show_in_menu ) ] ) ) { // Fall back to edit.php for that post type, if it exists. $submenu_file = "edit.php?post_type=$post_type"; } else { // Otherwise, give up and highlight the parent. $submenu_file = $parent_file; } } } else { $parent_file = "edit.php?post_type=$post_type"; } } $title = $post_type_object->labels->add_new_item; $editing = true; if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to create posts as this user.' ) . '</p>', 403 ); } $post = get_default_post_to_edit( $post_type, true ); $post_ID = $post->ID; /** This filter is documented in wp-admin/post.php */ if ( apply_filters( 'replace_editor', false, $post ) !== true ) { if ( use_block_editor_for_post( $post ) ) { require ABSPATH . 'wp-admin/edit-form-blocks.php'; } else { wp_enqueue_script( 'autosave' ); require ABSPATH . 'wp-admin/edit-form-advanced.php'; } } else { // Flag that we're not loading the block editor. $current_screen = get_current_screen(); $current_screen->is_block_editor( false ); } require_once ABSPATH . 'wp-admin/admin-footer.php'; setup-config.php 0000644 00000042760 15044220553 0007671 0 ustar 00 <?php /** * Retrieves and creates the wp-config.php file. * * The permissions for the base directory must allow for writing files in order * for the wp-config.php to be created using this page. * * @package WordPress * @subpackage Administration */ /** * We are installing. */ define( 'WP_INSTALLING', true ); /** * We are blissfully unaware of anything. */ define( 'WP_SETUP_CONFIG', true ); /** * Disable error reporting * * Set this to error_reporting( -1 ) for debugging */ error_reporting( 0 ); if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', dirname( __DIR__ ) . '/' ); } require ABSPATH . 'wp-settings.php'; /** Load WordPress Administration Upgrade API */ require_once ABSPATH . 'wp-admin/includes/upgrade.php'; /** Load WordPress Translation Installation API */ require_once ABSPATH . 'wp-admin/includes/translation-install.php'; nocache_headers(); // Support wp-config-sample.php one level up, for the develop repo. if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) { $config_file = file( ABSPATH . 'wp-config-sample.php' ); } elseif ( file_exists( dirname( ABSPATH ) . '/wp-config-sample.php' ) ) { $config_file = file( dirname( ABSPATH ) . '/wp-config-sample.php' ); } else { wp_die( sprintf( /* translators: %s: wp-config-sample.php */ __( 'Sorry, I need a %s file to work from. Please re-upload this file to your WordPress installation.' ), '<code>wp-config-sample.php</code>' ) ); } // Check if wp-config.php has been created. if ( file_exists( ABSPATH . 'wp-config.php' ) ) { wp_die( '<p>' . sprintf( /* translators: 1: wp-config.php, 2: install.php */ __( 'The file %1$s already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href="%2$s">installing now</a>.' ), '<code>wp-config.php</code>', 'install.php' ) . '</p>', 409 ); } // Check if wp-config.php exists above the root directory but is not part of another installation. if ( @file_exists( ABSPATH . '../wp-config.php' ) && ! @file_exists( ABSPATH . '../wp-settings.php' ) ) { wp_die( '<p>' . sprintf( /* translators: 1: wp-config.php, 2: install.php */ __( 'The file %1$s already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href="%2$s">installing now</a>.' ), '<code>wp-config.php</code>', 'install.php' ) . '</p>', 409 ); } $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : -1; /** * Display setup wp-config.php file header. * * @ignore * @since 2.3.0 * * @param string|string[] $body_classes Class attribute values for the body tag. */ function setup_config_display_header( $body_classes = array() ) { $body_classes = (array) $body_classes; $body_classes[] = 'wp-core-ui'; $dir_attr = ''; if ( is_rtl() ) { $body_classes[] = 'rtl'; $dir_attr = ' dir="rtl"'; } header( 'Content-Type: text/html; charset=utf-8' ); ?> <!DOCTYPE html> <html<?php echo $dir_attr; ?>> <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 › Setup Configuration File' ); ?></title> <?php wp_admin_css( 'install', true ); ?> </head> <body class="<?php echo implode( ' ', $body_classes ); ?>"> <p id="logo"><?php _e( 'WordPress' ); ?></p> <?php } // End function setup_config_display_header(); /** * @global string $wp_local_package Locale code of the package. * @global WP_Locale $wp_locale WordPress date and time locale object. */ $language = ''; if ( ! empty( $_REQUEST['language'] ) ) { $language = preg_replace( '/[^a-zA-Z0-9_]/', '', $_REQUEST['language'] ); } elseif ( isset( $GLOBALS['wp_local_package'] ) ) { $language = $GLOBALS['wp_local_package']; } switch ( $step ) { case -1: if ( wp_can_install_language_pack() && empty( $language ) ) { $languages = wp_get_available_translations(); if ( $languages ) { setup_config_display_header( 'language-chooser' ); echo '<h1 class="screen-reader-text">Select a default language</h1>'; echo '<form id="setup" method="post" action="?step=0">'; wp_install_language_form( $languages ); echo '</form>'; break; } } // Deliberately fall through if we can't reach the translations API. case 0: if ( ! empty( $language ) ) { $loaded_language = wp_download_language_pack( $language ); if ( $loaded_language ) { load_default_textdomain( $loaded_language ); $GLOBALS['wp_locale'] = new WP_Locale(); } } setup_config_display_header(); $step_1 = 'setup-config.php?step=1'; if ( isset( $_REQUEST['noapi'] ) ) { $step_1 .= '&noapi'; } if ( ! empty( $loaded_language ) ) { $step_1 .= '&language=' . $loaded_language; } ?> <h1 class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Before getting started' ); ?> </h1> <p><?php _e( 'Welcome to WordPress. Before getting started, you will need to know the following items.' ); ?></p> <ol> <li><?php _e( 'Database name' ); ?></li> <li><?php _e( 'Database username' ); ?></li> <li><?php _e( 'Database password' ); ?></li> <li><?php _e( 'Database host' ); ?></li> <li><?php _e( 'Table prefix (if you want to run more than one WordPress in a single database)' ); ?></li> </ol> <p> <?php printf( /* translators: %s: wp-config.php */ __( 'This information is being used to create a %s file.' ), '<code>wp-config.php</code>' ); ?> <strong> <?php printf( /* translators: 1: wp-config-sample.php, 2: wp-config.php */ __( 'If for any reason this automatic file creation does not work, do not worry. All this does is fill in the database information to a configuration file. You may also simply open %1$s in a text editor, fill in your information, and save it as %2$s.' ), '<code>wp-config-sample.php</code>', '<code>wp-config.php</code>' ); ?> </strong> <?php printf( /* translators: 1: Documentation URL, 2: wp-config.php */ __( 'Need more help? <a href="%1$s">Read the support article on %2$s</a>.' ), __( 'https://developer.wordpress.org/advanced-administration/wordpress/wp-config/' ), '<code>wp-config.php</code>' ); ?> </p> <p><?php _e( 'In all likelihood, these items were supplied to you by your web host. If you do not have this information, then you will need to contact them before you can continue. If you are ready…' ); ?></p> <p class="step"><a href="<?php echo $step_1; ?>" class="button button-large"><?php _e( 'Let’s go!' ); ?></a></p> <?php break; case 1: load_default_textdomain( $language ); $GLOBALS['wp_locale'] = new WP_Locale(); setup_config_display_header(); $autofocus = wp_is_mobile() ? '' : ' autofocus'; ?> <h1 class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Set up your database connection' ); ?> </h1> <form method="post" action="setup-config.php?step=2"> <p><?php _e( 'Below you should enter your database connection details. If you are not sure about these, contact your host.' ); ?></p> <table class="form-table" role="presentation"> <tr> <th scope="row"><label for="dbname"><?php _e( 'Database Name' ); ?></label></th> <td><input name="dbname" id="dbname" type="text" aria-describedby="dbname-desc" size="25" placeholder="wordpress"<?php echo $autofocus; ?> /> <p id="dbname-desc"><?php _e( 'The name of the database you want to use with WordPress.' ); ?></p></td> </tr> <tr> <th scope="row"><label for="uname"><?php _e( 'Username' ); ?></label></th> <td><input name="uname" id="uname" type="text" aria-describedby="uname-desc" size="25" placeholder="<?php echo htmlspecialchars( _x( 'username', 'example username' ), ENT_QUOTES ); ?>" /> <p id="uname-desc"><?php _e( 'Your database username.' ); ?></p></td> </tr> <tr> <th scope="row"><label for="pwd"><?php _e( 'Password' ); ?></label></th> <td> <div class="wp-pwd"> <input name="pwd" id="pwd" type="password" class="regular-text" data-reveal="1" aria-describedby="pwd-desc" size="25" placeholder="<?php echo htmlspecialchars( _x( 'password', 'example password' ), ENT_QUOTES ); ?>" autocomplete="off" spellcheck="false" /> <button type="button" class="button pwd-toggle hide-if-no-js" data-toggle="0" data-start-masked="1" aria-label="<?php esc_attr_e( 'Show password' ); ?>"> <span class="dashicons dashicons-visibility"></span> <span class="text"><?php _e( 'Show' ); ?></span> </button> </div> <p id="pwd-desc"><?php _e( 'Your database password.' ); ?></p> </td> </tr> <tr> <th scope="row"><label for="dbhost"><?php _e( 'Database Host' ); ?></label></th> <td><input name="dbhost" id="dbhost" type="text" aria-describedby="dbhost-desc" size="25" value="localhost" /> <p id="dbhost-desc"> <?php /* translators: %s: localhost */ printf( __( 'You should be able to get this info from your web host, if %s does not work.' ), '<code>localhost</code>' ); ?> </p></td> </tr> <tr> <th scope="row"><label for="prefix"><?php _e( 'Table Prefix' ); ?></label></th> <td><input name="prefix" id="prefix" type="text" aria-describedby="prefix-desc" value="wp_" size="25" /> <p id="prefix-desc"><?php _e( 'If you want to run multiple WordPress installations in a single database, change this.' ); ?></p></td> </tr> </table> <?php if ( isset( $_GET['noapi'] ) ) { ?> <input name="noapi" type="hidden" value="1" /><?php } ?> <input type="hidden" name="language" value="<?php echo esc_attr( $language ); ?>" /> <p class="step"><input name="submit" type="submit" value="<?php echo htmlspecialchars( __( 'Submit' ), ENT_QUOTES ); ?>" class="button button-large" /></p> </form> <?php wp_print_scripts( 'password-toggle' ); break; case 2: load_default_textdomain( $language ); $GLOBALS['wp_locale'] = new WP_Locale(); $dbname = trim( wp_unslash( $_POST['dbname'] ) ); $uname = trim( wp_unslash( $_POST['uname'] ) ); $pwd = trim( wp_unslash( $_POST['pwd'] ) ); $dbhost = trim( wp_unslash( $_POST['dbhost'] ) ); $prefix = trim( wp_unslash( $_POST['prefix'] ) ); $step_1 = 'setup-config.php?step=1'; $install = 'install.php'; if ( isset( $_REQUEST['noapi'] ) ) { $step_1 .= '&noapi'; } if ( ! empty( $language ) ) { $step_1 .= '&language=' . $language; $install .= '?language=' . $language; } else { $install .= '?language=en_US'; } $tryagain_link = '</p><p class="step"><a href="' . $step_1 . '" onclick="javascript:history.go(-1);return false;" class="button button-large">' . __( 'Try Again' ) . '</a>'; if ( empty( $prefix ) ) { wp_die( __( '<strong>Error:</strong> "Table Prefix" must not be empty.' ) . $tryagain_link ); } // Validate $prefix: it can only contain letters, numbers and underscores. if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) { wp_die( __( '<strong>Error:</strong> "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link ); } // Test the DB connection. /**#@+ * * @ignore */ define( 'DB_NAME', $dbname ); define( 'DB_USER', $uname ); define( 'DB_PASSWORD', $pwd ); define( 'DB_HOST', $dbhost ); /**#@-*/ // Re-construct $wpdb with these new values. unset( $wpdb ); require_wp_db(); /* * The wpdb constructor bails when WP_SETUP_CONFIG is set, so we must * fire this manually. We'll fail here if the values are no good. */ $wpdb->db_connect(); if ( ! empty( $wpdb->error ) ) { wp_die( $wpdb->error->get_error_message() . $tryagain_link ); } $errors = $wpdb->suppress_errors(); $wpdb->query( "SELECT $prefix" ); $wpdb->suppress_errors( $errors ); if ( ! $wpdb->last_error ) { // MySQL was able to parse the prefix as a value, which we don't want. Bail. wp_die( __( '<strong>Error:</strong> "Table Prefix" is invalid.' ) ); } // Generate keys and salts using secure CSPRNG; fallback to API if enabled; further fallback to original wp_generate_password(). try { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_ []{}<>~`+=,.;:/?|'; $max = strlen( $chars ) - 1; for ( $i = 0; $i < 8; $i++ ) { $key = ''; for ( $j = 0; $j < 64; $j++ ) { $key .= substr( $chars, random_int( 0, $max ), 1 ); } $secret_keys[] = $key; } } catch ( Exception $ex ) { $no_api = isset( $_POST['noapi'] ); if ( ! $no_api ) { $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); } if ( $no_api || is_wp_error( $secret_keys ) ) { $secret_keys = array(); for ( $i = 0; $i < 8; $i++ ) { $secret_keys[] = wp_generate_password( 64, true, true ); } } else { $secret_keys = explode( "\n", wp_remote_retrieve_body( $secret_keys ) ); foreach ( $secret_keys as $k => $v ) { $secret_keys[ $k ] = substr( $v, 28, 64 ); } } } $key = 0; foreach ( $config_file as $line_num => $line ) { if ( str_starts_with( $line, '$table_prefix =' ) ) { $config_file[ $line_num ] = '$table_prefix = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n"; continue; } if ( ! preg_match( '/^define\(\s*\'([A-Z_]+)\',([ ]+)/', $line, $match ) ) { continue; } $constant = $match[1]; $padding = $match[2]; switch ( $constant ) { case 'DB_NAME': case 'DB_USER': case 'DB_PASSWORD': case 'DB_HOST': $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "' );\r\n"; break; case 'DB_CHARSET': if ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset ) ) { $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'utf8mb4' );\r\n"; } break; case 'AUTH_KEY': case 'SECURE_AUTH_KEY': case 'LOGGED_IN_KEY': case 'NONCE_KEY': case 'AUTH_SALT': case 'SECURE_AUTH_SALT': case 'LOGGED_IN_SALT': case 'NONCE_SALT': $config_file[ $line_num ] = "define( '" . $constant . "'," . $padding . "'" . $secret_keys[ $key++ ] . "' );\r\n"; break; } } unset( $line ); if ( ! is_writable( ABSPATH ) ) : setup_config_display_header(); ?> <p> <?php /* translators: %s: wp-config.php */ printf( __( 'Unable to write to %s file.' ), '<code>wp-config.php</code>' ); ?> </p> <p id="wp-config-description"> <?php /* translators: %s: wp-config.php */ printf( __( 'You can create the %s file manually and paste the following text into it.' ), '<code>wp-config.php</code>' ); $config_text = ''; foreach ( $config_file as $line ) { $config_text .= htmlentities( $line, ENT_COMPAT, 'UTF-8' ); } ?> </p> <p class="configuration-rules-label"><label for="wp-config"> <?php /* translators: %s: wp-config.php */ printf( __( 'Configuration rules for %s:' ), '<code>wp-config.php</code>' ); ?> </label></p> <textarea id="wp-config" cols="98" rows="15" class="code" readonly="readonly" aria-describedby="wp-config-description"><?php echo $config_text; ?></textarea> <p><?php _e( 'After you’ve done that, click “Run the installation”.' ); ?></p> <p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the installation' ); ?></a></p> <script> (function(){ if ( ! /iPad|iPod|iPhone/.test( navigator.userAgent ) ) { var el = document.getElementById('wp-config'); el.focus(); el.select(); } })(); </script> <?php else : /* * If this file doesn't exist, then we are using the wp-config-sample.php * file one level up, which is for the develop repo. */ if ( file_exists( ABSPATH . 'wp-config-sample.php' ) ) { $path_to_wp_config = ABSPATH . 'wp-config.php'; } else { $path_to_wp_config = dirname( ABSPATH ) . '/wp-config.php'; } $error_message = ''; $handle = fopen( $path_to_wp_config, 'w' ); /* * Why check for the absence of false instead of checking for resource with is_resource()? * To future-proof the check for when fopen returns object instead of resource, i.e. a known * change coming in PHP. */ if ( false !== $handle ) { foreach ( $config_file as $line ) { fwrite( $handle, $line ); } fclose( $handle ); } else { $wp_config_perms = fileperms( $path_to_wp_config ); if ( ! empty( $wp_config_perms ) && ! is_writable( $path_to_wp_config ) ) { $error_message = sprintf( /* translators: 1: wp-config.php, 2: Documentation URL. */ __( 'You need to make the file %1$s writable before you can save your changes. See <a href="%2$s">Changing File Permissions</a> for more information.' ), '<code>wp-config.php</code>', __( 'https://developer.wordpress.org/advanced-administration/server/file-permissions/' ) ); } else { $error_message = sprintf( /* translators: %s: wp-config.php */ __( 'Unable to write to %s file.' ), '<code>wp-config.php</code>' ); } } chmod( $path_to_wp_config, 0666 ); setup_config_display_header(); if ( false !== $handle ) : ?> <h1 class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Successful database connection' ); ?> </h1> <p><?php _e( 'All right, sparky! You’ve made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to…' ); ?></p> <p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the installation' ); ?></a></p> <?php else : printf( '<p>%s</p>', $error_message ); endif; endif; break; } // End of the steps switch. ?> <?php wp_print_scripts( 'language-chooser' ); ?> </body> </html> plugin-editor.php 0000644 00000033247 15044220553 0010050 0 ustar 00 <?php /** * Edit plugin file editor administration panel. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( is_multisite() && ! is_network_admin() ) { wp_redirect( network_admin_url( 'plugin-editor.php' ) ); exit; } if ( ! current_user_can( 'edit_plugins' ) ) { wp_die( __( 'Sorry, you are not allowed to edit plugins for this site.' ) ); } // Used in the HTML title tag. $title = __( 'Edit Plugins' ); $parent_file = 'plugins.php'; $plugins = get_plugins(); if ( empty( $plugins ) ) { require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <?php wp_admin_notice( __( 'No plugins are currently available.' ), array( 'id' => 'message', 'additional_classes' => array( 'error' ), ) ); ?> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; exit; } $file = ''; $plugin = ''; if ( isset( $_REQUEST['file'] ) ) { $file = wp_unslash( $_REQUEST['file'] ); } if ( isset( $_REQUEST['plugin'] ) ) { $plugin = wp_unslash( $_REQUEST['plugin'] ); } if ( empty( $plugin ) ) { if ( $file ) { // Locate the plugin for a given plugin file being edited. $file_dirname = dirname( $file ); foreach ( array_keys( $plugins ) as $plugin_candidate ) { if ( $plugin_candidate === $file || ( '.' !== $file_dirname && dirname( $plugin_candidate ) === $file_dirname ) ) { $plugin = $plugin_candidate; break; } } // Fallback to the file as the plugin. if ( empty( $plugin ) ) { $plugin = $file; } } else { $plugin = array_keys( $plugins ); $plugin = $plugin[0]; } } $plugin_files = get_plugin_files( $plugin ); if ( empty( $file ) ) { $file = $plugin_files[0]; } $file = validate_file_to_edit( $file, $plugin_files ); $real_file = WP_PLUGIN_DIR . '/' . $file; $plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin_files[0] ); $plugin_name = $plugin_data['Name']; // Handle fallback editing of file when JavaScript is not available. $edit_error = null; $posted_content = null; if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) { $r = wp_edit_theme_plugin_file( wp_unslash( $_POST ) ); if ( is_wp_error( $r ) ) { $edit_error = $r; if ( check_ajax_referer( 'edit-plugin_' . $file, 'nonce', false ) && isset( $_POST['newcontent'] ) ) { $posted_content = wp_unslash( $_POST['newcontent'] ); } } else { wp_redirect( add_query_arg( array( 'a' => 1, // This means "success" for some reason. 'plugin' => $plugin, 'file' => $file, ), admin_url( 'plugin-editor.php' ) ) ); exit; } } // List of allowable extensions. $editable_extensions = wp_get_plugin_file_editable_extensions( $plugin ); if ( ! is_file( $real_file ) ) { wp_die( sprintf( '<p>%s</p>', __( 'File does not exist! Please double check the name and try again.' ) ) ); } else { // Get the extension of the file. if ( preg_match( '/\.([^.]+)$/', $real_file, $matches ) ) { $ext = strtolower( $matches[1] ); // If extension is not in the acceptable list, skip it. if ( ! in_array( $ext, $editable_extensions, true ) ) { wp_die( sprintf( '<p>%s</p>', __( 'Files of this type are not editable.' ) ) ); } } } get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => '<p>' . __( 'You can use the plugin file editor to make changes to any of your plugins’ individual PHP files. Be aware that if you make changes, plugins updates will overwrite your customizations.' ) . '</p>' . '<p>' . __( 'Choose a plugin to edit from the dropdown menu and click the Select button. Click once on any file name to load it in the editor, and make your changes. Do not forget to save your changes (Update File) when you are finished.' ) . '</p>' . '<p>' . __( 'The documentation menu below the editor lists the PHP functions recognized in the plugin file. Clicking Look Up takes you to a web page about that particular function.' ) . '</p>' . '<p id="editor-keyboard-trap-help-1">' . __( 'When using a keyboard to navigate:' ) . '</p>' . '<ul>' . '<li id="editor-keyboard-trap-help-2">' . __( 'In the editing area, the Tab key enters a tab character.' ) . '</li>' . '<li id="editor-keyboard-trap-help-3">' . __( 'To move away from this area, press the Esc key followed by the Tab key.' ) . '</li>' . '<li id="editor-keyboard-trap-help-4">' . __( 'Screen reader users: when in forms mode, you may need to press the Esc key twice.' ) . '</li>' . '</ul>' . '<p>' . __( 'If you want to make changes but do not want them to be overwritten when the plugin is updated, you may be ready to think about writing your own plugin. For information on how to edit plugins, write your own from scratch, or just better understand their anatomy, check out the links below.' ) . '</p>' . ( is_network_admin() ? '<p>' . __( 'Any edits to files from this screen will be reflected on all sites in the network.' ) . '</p>' : '' ), ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/plugins/editor-screen/">Documentation on Editing Plugins</a>' ) . '</p>' . '<p>' . __( '<a href="https://developer.wordpress.org/plugins/">Documentation on Writing Plugins</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); $settings = array( 'codeEditor' => wp_enqueue_code_editor( array( 'file' => $real_file ) ), ); wp_enqueue_script( 'wp-theme-plugin-editor' ); wp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'jQuery( function( $ ) { wp.themePluginEditor.init( $( "#template" ), %s ); } )', wp_json_encode( $settings ) ) ); wp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'wp.themePluginEditor.themeOrPlugin = "plugin";' ) ); require_once ABSPATH . 'wp-admin/admin-header.php'; update_recently_edited( WP_PLUGIN_DIR . '/' . $file ); if ( ! empty( $posted_content ) ) { $content = $posted_content; } else { $content = file_get_contents( $real_file ); } if ( str_ends_with( $real_file, '.php' ) ) { $functions = wp_doc_link_parse( $content ); if ( ! empty( $functions ) ) { $docs_select = '<select name="docs-list" id="docs-list">'; $docs_select .= '<option value="">' . esc_html__( 'Function Name…' ) . '</option>'; foreach ( $functions as $function ) { $docs_select .= '<option value="' . esc_attr( $function ) . '">' . esc_html( $function ) . '()</option>'; } $docs_select .= '</select>'; } } $content = esc_textarea( $content ); ?> <div class="wrap"> <h1><?php echo esc_html( $title ); ?></h1> <?php if ( isset( $_GET['a'] ) ) : wp_admin_notice( __( 'File edited successfully.' ), array( 'additional_classes' => array( 'updated', 'is-dismissible' ), 'id' => 'message', ) ); elseif ( is_wp_error( $edit_error ) ) : $error = esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); $message = '<p>' . __( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ) . '</p> <pre>' . $error . '</pre>'; wp_admin_notice( $message, array( 'type' => 'error', 'id' => 'message', 'paragraph_wrap' => false, ) ); endif; ?> <div class="fileedit-sub"> <div class="alignleft"> <h2> <?php if ( is_plugin_active( $plugin ) ) { if ( is_writable( $real_file ) ) { /* translators: %s: Plugin name. */ printf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $plugin_name ) . '</strong>' ); } else { /* translators: %s: Plugin name. */ printf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $plugin_name ) . '</strong>' ); } } else { if ( is_writable( $real_file ) ) { /* translators: %s: Plugin name. */ printf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $plugin_name ) . '</strong>' ); } else { /* translators: %s: Plugin name. */ printf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $plugin_name ) . '</strong>' ); } } ?> </h2> <?php printf( /* translators: %s: File path. */ ' <span><strong>' . __( 'File: %s' ) . '</strong></span>', esc_html( $file ) ); ?> </div> <div class="alignright"> <form action="plugin-editor.php" method="get"> <label for="plugin" id="theme-plugin-editor-selector"><?php _e( 'Select plugin to edit:' ); ?> </label> <select name="plugin" id="plugin"> <?php foreach ( $plugins as $plugin_key => $a_plugin ) { $plugin_name = $a_plugin['Name']; if ( $plugin_key === $plugin ) { $selected = " selected='selected'"; } else { $selected = ''; } $plugin_name = esc_attr( $plugin_name ); $plugin_key = esc_attr( $plugin_key ); echo "\n\t<option value=\"$plugin_key\" $selected>$plugin_name</option>"; } ?> </select> <?php submit_button( __( 'Select' ), '', 'Submit', false ); ?> </form> </div> <br class="clear" /> </div> <div id="templateside"> <h2 id="plugin-files-label"><?php _e( 'Plugin Files' ); ?></h2> <?php $plugin_editable_files = array(); foreach ( $plugin_files as $plugin_file ) { if ( preg_match( '/\.([^.]+)$/', $plugin_file, $matches ) && in_array( $matches[1], $editable_extensions, true ) ) { $plugin_editable_files[] = $plugin_file; } } ?> <ul role="tree" aria-labelledby="plugin-files-label"> <li role="treeitem" tabindex="-1" aria-expanded="true" aria-level="1" aria-posinset="1" aria-setsize="1"> <ul role="group"> <?php wp_print_plugin_file_tree( wp_make_plugin_file_tree( $plugin_editable_files ) ); ?> </ul> </ul> </div> <form name="template" id="template" action="plugin-editor.php" method="post"> <?php wp_nonce_field( 'edit-plugin_' . $file, 'nonce' ); ?> <div> <label for="newcontent" id="theme-plugin-editor-label"><?php _e( 'Selected file content:' ); ?></label> <textarea cols="70" rows="25" name="newcontent" id="newcontent" aria-describedby="editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4"><?php echo $content; ?></textarea> <input type="hidden" name="action" value="update" /> <input type="hidden" name="file" value="<?php echo esc_attr( $file ); ?>" /> <input type="hidden" name="plugin" value="<?php echo esc_attr( $plugin ); ?>" /> </div> <?php if ( ! empty( $docs_select ) ) : ?> <div id="documentation" class="hide-if-no-js"> <label for="docs-list"><?php _e( 'Documentation:' ); ?></label> <?php echo $docs_select; ?> <input disabled id="docs-lookup" type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?>" onclick="if ( '' !== jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_user_locale() ); ?>&version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&redirect=true'); }" /> </div> <?php endif; ?> <?php if ( is_writable( $real_file ) ) : ?> <div class="editor-notices"> <?php if ( in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) ) { wp_admin_notice( __( '<strong>Warning:</strong> Making changes to active plugins is not recommended.' ), array( 'type' => 'warning', 'additional_classes' => array( 'inline', 'active-plugin-edit-warning' ), ) ); } ?> </div> <p class="submit"> <?php submit_button( __( 'Update File' ), 'primary', 'submit', false ); ?> <span class="spinner"></span> </p> <?php else : ?> <p> <?php printf( /* translators: %s: Documentation URL. */ __( 'You need to make this file writable before you can save your changes. See <a href="%s">Changing File Permissions</a> for more information.' ), __( 'https://developer.wordpress.org/advanced-administration/server/file-permissions/' ) ); ?> </p> <?php endif; ?> <?php wp_print_file_editor_templates(); ?> </form> <br class="clear" /> </div> <?php $dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ); if ( ! in_array( 'plugin_editor_notice', $dismissed_pointers, true ) ) : // Get a back URL. $referer = wp_get_referer(); $excluded_referer_basenames = array( 'plugin-editor.php', 'wp-login.php' ); $return_url = admin_url( '/' ); if ( $referer ) { $referer_path = parse_url( $referer, PHP_URL_PATH ); if ( is_string( $referer_path ) && ! in_array( basename( $referer_path ), $excluded_referer_basenames, true ) ) { $return_url = $referer; } } ?> <div id="file-editor-warning" class="notification-dialog-wrap file-editor-warning hide-if-no-js hidden"> <div class="notification-dialog-background"></div> <div class="notification-dialog"> <div class="file-editor-warning-content"> <div class="file-editor-warning-message"> <h1><?php _e( 'Heads up!' ); ?></h1> <p><?php _e( 'You appear to be making direct edits to your plugin in the WordPress dashboard. Editing plugins directly is not recommended as it may introduce incompatibilities that break your site and your changes may be lost in future updates.' ); ?></p> <p><?php _e( 'If you absolutely have to make direct edits to this plugin, use a file manager to create a copy with a new name and hang on to the original. That way, you can re-enable a functional version if something goes wrong.' ); ?></p> </div> <p> <a class="button file-editor-warning-go-back" href="<?php echo esc_url( $return_url ); ?>"><?php _e( 'Go back' ); ?></a> <button type="button" class="file-editor-warning-dismiss button button-primary"><?php _e( 'I understand' ); ?></button> </p> </div> </div> </div> <?php endif; // Editor warning notice. require_once ABSPATH . 'wp-admin/admin-footer.php'; options-head.php 0000644 00000001155 15044220553 0007651 0 ustar 00 <?php /** * WordPress Options Header. * * Displays updated message, if updated variable is part of the URL query. * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } $action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) { // For back-compat with plugins that don't use the Settings API and just set updated=1 in the redirect. add_settings_error( 'general', 'settings_updated', __( 'Settings saved.' ), 'success' ); } settings_errors(); tools.php 0000644 00000006672 15044220553 0006430 0 ustar 00 <?php /** * Tools Administration Screen. * * @package WordPress * @subpackage Administration */ if ( isset( $_GET['page'] ) && ! empty( $_POST ) ) { // Ensure POST-ing to `tools.php?page=export_personal_data` and `tools.php?page=remove_personal_data` // continues to work after creating the new files for exporting and erasing of personal data. if ( 'export_personal_data' === $_GET['page'] ) { require_once ABSPATH . 'wp-admin/export-personal-data.php'; return; } elseif ( 'remove_personal_data' === $_GET['page'] ) { require_once ABSPATH . 'wp-admin/erase-personal-data.php'; return; } } // The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php. if ( isset( $_GET['wp-privacy-policy-guide'] ) ) { require_once dirname( __DIR__ ) . '/wp-load.php'; wp_redirect( admin_url( 'options-privacy.php?tab=policyguide' ), 301 ); exit; } elseif ( isset( $_GET['page'] ) ) { // These were also moved to files in WP 5.3. if ( 'export_personal_data' === $_GET['page'] ) { require_once dirname( __DIR__ ) . '/wp-load.php'; wp_redirect( admin_url( 'export-personal-data.php' ), 301 ); exit; } elseif ( 'remove_personal_data' === $_GET['page'] ) { require_once dirname( __DIR__ ) . '/wp-load.php'; wp_redirect( admin_url( 'erase-personal-data.php' ), 301 ); exit; } } /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; // Used in the HTML title tag. $title = __( 'Tools' ); get_current_screen()->add_help_tab( array( 'id' => 'converter', 'title' => __( 'Categories and Tags Converter' ), 'content' => '<p>' . __( 'Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' . '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin & Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/tools-screen/">Documentation on Tools</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> <?php if ( current_user_can( 'import' ) ) : $cats = get_taxonomy( 'category' ); $tags = get_taxonomy( 'post_tag' ); if ( current_user_can( $cats->cap->manage_terms ) || current_user_can( $tags->cap->manage_terms ) ) : ?> <div class="card"> <h2 class="title"><?php _e( 'Categories and Tags Converter' ); ?></h2> <p> <?php printf( /* translators: %s: URL to Import screen. */ __( 'If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.' ), 'import.php' ); ?> </p> </div> <?php endif; endif; /** * Fires at the end of the Tools Administration screen. * * @since 2.8.0 */ do_action( 'tool_box' ); ?> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; ms-delete-site.php 0000644 00000010306 15044220553 0010076 0 ustar 00 <?php /** * Multisite delete site panel. * * @package WordPress * @subpackage Multisite * @since 3.0.0 */ require_once __DIR__ . '/admin.php'; if ( ! is_multisite() ) { wp_die( __( 'Multisite support is not enabled.' ) ); } if ( ! current_user_can( 'delete_site' ) ) { wp_die( __( 'Sorry, you are not allowed to delete this site.' ) ); } if ( isset( $_GET['h'] ) && '' !== $_GET['h'] && false !== get_option( 'delete_blog_hash' ) ) { if ( hash_equals( get_option( 'delete_blog_hash' ), $_GET['h'] ) ) { wpmu_delete_blog( get_current_blog_id() ); wp_die( sprintf( /* translators: %s: Network title. */ __( 'Thank you for using %s, your site has been deleted. Happy trails to you until we meet again.' ), get_network()->site_name ) ); } else { wp_die( __( 'Sorry, the link you clicked is stale. Please select another option.' ) ); } } $blog = get_site(); $user = wp_get_current_user(); // Used in the HTML title tag. $title = __( 'Delete Site' ); $parent_file = 'tools.php'; require_once ABSPATH . 'wp-admin/admin-header.php'; echo '<div class="wrap">'; echo '<h1>' . esc_html( $title ) . '</h1>'; if ( isset( $_POST['action'] ) && 'deleteblog' === $_POST['action'] && isset( $_POST['confirmdelete'] ) && '1' === $_POST['confirmdelete'] ) { check_admin_referer( 'delete-blog' ); $hash = wp_generate_password( 20, false ); update_option( 'delete_blog_hash', $hash, false ); $url_delete = esc_url( admin_url( 'ms-delete-site.php?h=' . $hash ) ); $switched_locale = switch_to_locale( get_locale() ); /* translators: Do not translate USERNAME, URL_DELETE, SITENAME, SITEURL: those are placeholders. */ $content = __( "Howdy ###USERNAME###, You recently clicked the 'Delete Site' link on your site and filled in a form on that page. If you really want to delete your site, click the link below. You will not be asked to confirm again so only click this link if you are absolutely certain: ###URL_DELETE### If you delete your site, please consider opening a new site here some time in the future! (But remember that your current site and username are gone forever.) Thank you for using the site, All at ###SITENAME### ###SITEURL###" ); /** * Filters the text for the email sent to the site admin when a request to delete a site in a Multisite network is submitted. * * @since 3.0.0 * * @param string $content The email text. */ $content = apply_filters( 'delete_site_email_content', $content ); $content = str_replace( '###USERNAME###', $user->user_login, $content ); $content = str_replace( '###URL_DELETE###', $url_delete, $content ); $content = str_replace( '###SITENAME###', get_network()->site_name, $content ); $content = str_replace( '###SITEURL###', network_home_url(), $content ); wp_mail( get_option( 'admin_email' ), sprintf( /* translators: %s: Site title. */ __( '[%s] Delete My Site' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), $content ); if ( $switched_locale ) { restore_previous_locale(); } ?> <p><?php _e( 'Thank you. Please check your email for a link to confirm your action. Your site will not be deleted until this link is clicked.' ); ?></p> <?php } else { ?> <p> <?php printf( /* translators: %s: Network title. */ __( 'If you do not want to use your %s site any more, you can delete it using the form below. When you click <strong>Delete My Site Permanently</strong> you will be sent an email with a link in it. Click on this link to delete your site.' ), get_network()->site_name ); ?> </p> <p><?php _e( 'Remember, once deleted your site cannot be restored.' ); ?></p> <form method="post" name="deletedirect"> <?php wp_nonce_field( 'delete-blog' ); ?> <input type="hidden" name="action" value="deleteblog" /> <p><input id="confirmdelete" type="checkbox" name="confirmdelete" value="1" /> <label for="confirmdelete"><strong> <?php printf( /* translators: %s: Site address. */ __( "I'm sure I want to permanently delete my site, and I am aware I can never get it back or use %s again." ), $blog->domain . $blog->path ); ?> </strong></label></p> <?php submit_button( __( 'Delete My Site Permanently' ) ); ?> </form> <?php } echo '</div>'; require_once ABSPATH . 'wp-admin/admin-footer.php'; upgrade.php 0000644 00000014515 15044220553 0006712 0 ustar 00 <?php /** * Upgrade WordPress Page. * * @package WordPress * @subpackage Administration */ /** * We are upgrading WordPress. * * @since 1.5.1 * @var bool */ define( 'WP_INSTALLING', true ); /** Load WordPress Bootstrap */ require dirname( __DIR__ ) . '/wp-load.php'; nocache_headers(); require_once ABSPATH . 'wp-admin/includes/upgrade.php'; delete_site_transient( 'update_core' ); if ( isset( $_GET['step'] ) ) { $step = $_GET['step']; } else { $step = 0; } // Do it. No output. if ( 'upgrade_db' === $step ) { wp_upgrade(); die( '0' ); } /** * @global string $wp_version The WordPress version string. * @global string $required_php_version The required PHP version string. * @global string[] $required_php_extensions The names of required PHP extensions. * @global string $required_mysql_version The required MySQL version string. * @global wpdb $wpdb WordPress database abstraction object. */ global $wp_version, $required_php_version, $required_php_extensions, $required_mysql_version, $wpdb; $step = (int) $step; $php_version = PHP_VERSION; $mysql_version = $wpdb->db_version(); $php_compat = version_compare( $php_version, $required_php_version, '>=' ); if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) { $mysql_compat = true; } else { $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ); } $missing_extensions = array(); if ( isset( $required_php_extensions ) && is_array( $required_php_extensions ) ) { foreach ( $required_php_extensions as $extension ) { if ( extension_loaded( $extension ) ) { continue; } $missing_extensions[] = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: The PHP extension name needed. */ __( 'You cannot upgrade because <a href="%1$s">WordPress %2$s</a> requires the %3$s PHP extension.' ), $version_url, $wp_version, $extension ); } } header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) ); ?> <!DOCTYPE html> <html <?php language_attributes(); ?>> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" /> <meta name="robots" content="noindex,nofollow" /> <title><?php _e( 'WordPress › Update' ); ?></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 ( (int) get_option( 'db_version' ) === $wp_db_version || ! is_blog_installed() ) : ?> <h1><?php _e( 'No Update Required' ); ?></h1> <p><?php _e( 'Your WordPress database is already up to date!' ); ?></p> <p class="step"><a class="button button-large" href="<?php echo esc_url( get_option( 'home' ) ); ?>/"><?php _e( 'Continue' ); ?></a></p> <?php elseif ( ! $php_compat || ! $mysql_compat ) : $version_url = sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ), sanitize_title( $wp_version ) ); $php_update_message = '</p><p>' . sprintf( /* translators: %s: URL to Update PHP page. */ __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); $annotation = wp_get_update_php_annotation(); if ( $annotation ) { $php_update_message .= '</p><p><em>' . $annotation . '</em>'; } if ( ! $mysql_compat && ! $php_compat ) { $message = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number. */ __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) . $php_update_message; } elseif ( ! $php_compat ) { $message = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number. */ __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_php_version, $php_version ) . $php_update_message; } elseif ( ! $mysql_compat ) { $message = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number. */ __( 'You cannot update because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_mysql_version, $mysql_version ); } echo '<p>' . $message . '</p>'; elseif ( count( $missing_extensions ) > 0 ) : echo '<p>' . implode( '</p><p>', $missing_extensions ) . '</p>'; else : switch ( $step ) : case 0: $goback = wp_get_referer(); if ( $goback ) { $goback = sanitize_url( $goback ); $goback = urlencode( $goback ); } ?> <h1><?php _e( 'Database Update Required' ); ?></h1> <p><?php _e( 'WordPress has been updated! Next and final step is to update your database to the newest version.' ); ?></p> <p><?php _e( 'The database update process may take a little while, so please be patient.' ); ?></p> <p class="step"><a class="button button-large button-primary" href="upgrade.php?step=1&backto=<?php echo $goback; ?>"><?php _e( 'Update WordPress Database' ); ?></a></p> <?php break; case 1: wp_upgrade(); $backto = ! empty( $_GET['backto'] ) ? wp_unslash( urldecode( $_GET['backto'] ) ) : __get_option( 'home' ) . '/'; $backto = esc_url( $backto ); $backto = wp_validate_redirect( $backto, __get_option( 'home' ) . '/' ); ?> <h1><?php _e( 'Update Complete' ); ?></h1> <p><?php _e( 'Your WordPress database has been successfully updated!' ); ?></p> <p class="step"><a class="button button-large" href="<?php echo $backto; ?>"><?php _e( 'Continue' ); ?></a></p> <?php break; endswitch; endif; ?> </body> </html> comment.php 0000644 00000026546 15044220553 0006734 0 ustar 00 <?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'; themes.php 0000644 00000140174 15044220553 0006551 0 ustar 00 <?php /** * Themes administration panel. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>', 403 ); } if ( current_user_can( 'switch_themes' ) && isset( $_GET['action'] ) ) { if ( 'activate' === $_GET['action'] ) { check_admin_referer( 'switch-theme_' . $_GET['stylesheet'] ); $theme = wp_get_theme( $_GET['stylesheet'] ); if ( ! $theme->exists() || ! $theme->is_allowed() ) { wp_die( '<h1>' . __( 'An error occurred.' ) . '</h1>' . '<p>' . __( 'The requested theme does not exist.' ) . '</p>', 403 ); } switch_theme( $theme->get_stylesheet() ); wp_redirect( admin_url( 'themes.php?activated=true' ) ); exit; } elseif ( 'resume' === $_GET['action'] ) { check_admin_referer( 'resume-theme_' . $_GET['stylesheet'] ); $theme = wp_get_theme( $_GET['stylesheet'] ); if ( ! current_user_can( 'resume_theme', $_GET['stylesheet'] ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to resume this theme.' ) . '</p>', 403 ); } $result = resume_theme( $theme->get_stylesheet(), self_admin_url( 'themes.php?error=resuming' ) ); if ( is_wp_error( $result ) ) { wp_die( $result ); } wp_redirect( admin_url( 'themes.php?resumed=true' ) ); exit; } elseif ( 'delete' === $_GET['action'] ) { check_admin_referer( 'delete-theme_' . $_GET['stylesheet'] ); $theme = wp_get_theme( $_GET['stylesheet'] ); if ( ! current_user_can( 'delete_themes' ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>', 403 ); } if ( ! $theme->exists() ) { wp_die( '<h1>' . __( 'An error occurred while deleting the theme.' ) . '</h1>' . '<p>' . __( 'The requested theme does not exist.' ) . '</p>', 403 ); } $active = wp_get_theme(); if ( $active->get( 'Template' ) === $_GET['stylesheet'] ) { wp_redirect( admin_url( 'themes.php?delete-active-child=true' ) ); } else { delete_theme( $_GET['stylesheet'] ); wp_redirect( admin_url( 'themes.php?deleted=true' ) ); } exit; } elseif ( 'enable-auto-update' === $_GET['action'] ) { if ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) { wp_die( __( 'Sorry, you are not allowed to enable themes automatic updates.' ) ); } check_admin_referer( 'updates' ); $all_items = wp_get_themes(); $auto_updates = (array) get_site_option( 'auto_update_themes', array() ); $auto_updates[] = $_GET['stylesheet']; $auto_updates = array_unique( $auto_updates ); // Remove themes that have been deleted since the site option was last updated. $auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) ); update_site_option( 'auto_update_themes', $auto_updates ); wp_redirect( admin_url( 'themes.php?enabled-auto-update=true' ) ); exit; } elseif ( 'disable-auto-update' === $_GET['action'] ) { if ( ! ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) ) { wp_die( __( 'Sorry, you are not allowed to disable themes automatic updates.' ) ); } check_admin_referer( 'updates' ); $all_items = wp_get_themes(); $auto_updates = (array) get_site_option( 'auto_update_themes', array() ); $auto_updates = array_diff( $auto_updates, array( $_GET['stylesheet'] ) ); // Remove themes that have been deleted since the site option was last updated. $auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) ); update_site_option( 'auto_update_themes', $auto_updates ); wp_redirect( admin_url( 'themes.php?disabled-auto-update=true' ) ); exit; } } // Used in the HTML title tag. $title = __( 'Themes' ); $parent_file = 'themes.php'; // Help tab: Overview. if ( current_user_can( 'switch_themes' ) ) { $help_overview = '<p>' . __( 'This screen is used for managing your installed themes. Aside from the default theme(s) included with your WordPress installation, themes are designed and developed by third parties.' ) . '</p>' . '<p>' . __( 'From this screen you can:' ) . '</p>' . '<ul><li>' . __( 'Hover or tap to see Activate and Live Preview buttons' ) . '</li>' . '<li>' . __( 'Click on the theme to see the theme name, version, author, description, tags, and the Delete link' ) . '</li>' . '<li>' . __( 'Click Customize for the active theme or Live Preview for any other theme to see a live preview' ) . '</li></ul>' . '<p>' . __( 'The active theme is displayed highlighted as the first theme.' ) . '</p>' . '<p>' . __( 'The search for installed themes will search for terms in their name, description, author, or tag.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>'; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help_overview, ) ); } // End if 'switch_themes'. // Help tab: Adding Themes. if ( current_user_can( 'install_themes' ) ) { if ( is_multisite() ) { $help_install = '<p>' . __( 'Installing themes on Multisite can only be done from the Network Admin section.' ) . '</p>'; } else { $help_install = '<p>' . sprintf( /* translators: %s: https://wordpress.org/themes/ */ __( 'If you would like to see more themes to choose from, click on the “Add Theme” button and you will be able to browse or search for additional themes from the <a href="%s">WordPress Theme Directory</a>. Themes in the WordPress Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they are free!' ), __( 'https://wordpress.org/themes/' ) ) . '</p>'; } get_current_screen()->add_help_tab( array( 'id' => 'adding-themes', 'title' => __( 'Adding Themes' ), 'content' => $help_install, ) ); } // End if 'install_themes'. // Help tab: Previewing and Customizing. if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { $help_customize = '<p>' . __( 'Tap or hover on any theme then click the Live Preview button to see a live preview of that theme and change theme options in a separate, full-screen view. You can also find a Live Preview button at the bottom of the theme details screen. Any installed theme can be previewed and customized in this way.' ) . '</p>' . '<p>' . __( 'The theme being previewed is fully interactive — navigate to different pages to see how the theme handles posts, archives, and other page templates. The settings may differ depending on what theme features the theme being previewed supports. To accept the new settings and activate the theme all in one step, click the Activate & Publish button above the menu.' ) . '</p>' . '<p>' . __( 'When previewing on smaller monitors, you can use the collapse icon at the bottom of the left-hand pane. This will hide the pane, giving you more room to preview your site in the new theme. To bring the pane back, click on the collapse icon again.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'customize-preview-themes', 'title' => __( 'Previewing and Customizing' ), 'content' => $help_customize, ) ); } // End if 'edit_theme_options' && 'customize'. $help_sidebar_autoupdates = ''; // Help tab: Auto-updates. if ( current_user_can( 'update_themes' ) && wp_is_auto_update_enabled_for_type( 'theme' ) ) { $help_tab_autoupdates = '<p>' . __( 'Auto-updates can be enabled or disabled for each individual theme. Themes 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>' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'plugins-themes-auto-updates', 'title' => __( 'Auto-updates' ), 'content' => $help_tab_autoupdates, ) ); $help_sidebar_autoupdates = '<p>' . __( '<a href="https://wordpress.org/documentation/article/plugins-themes-auto-updates/">Documentation on Auto-updates</a>' ) . '</p>'; } // End if 'update_themes' && 'wp_is_auto_update_enabled_for_type'. get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/work-with-themes/">Documentation on Using Themes</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/appearance-themes-screen/">Documentation on Managing Themes</a>' ) . '</p>' . $help_sidebar_autoupdates . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); if ( current_user_can( 'switch_themes' ) ) { $themes = wp_prepare_themes_for_js(); } else { $themes = wp_prepare_themes_for_js( array( wp_get_theme() ) ); } $theme = ! empty( $_REQUEST['theme'] ) ? sanitize_text_field( $_REQUEST['theme'] ) : ''; $search = ! empty( $_REQUEST['search'] ) ? sanitize_text_field( $_REQUEST['search'] ) : ''; wp_localize_script( 'theme', '_wpThemeSettings', array( 'themes' => $themes, 'settings' => array( 'canInstall' => ( ! is_multisite() && current_user_can( 'install_themes' ) ), 'installURI' => ( ! is_multisite() && current_user_can( 'install_themes' ) ) ? admin_url( 'theme-install.php' ) : null, 'confirmDelete' => __( "Are you sure you want to delete this theme?\n\nClick 'Cancel' to go back, 'OK' to confirm the delete." ), 'adminUrl' => parse_url( admin_url(), PHP_URL_PATH ), ), 'l10n' => array( 'addNew' => __( 'Add Theme' ), 'search' => __( 'Search installed themes' ), /* translators: %d: Number of themes. */ 'themesFound' => __( 'Number of Themes found: %d' ), 'noThemesFound' => __( 'No themes found. Try a different search.' ), ), ) ); add_thickbox(); wp_enqueue_script( 'theme' ); wp_enqueue_script( 'updates' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> <div class="wrap"> <h1 class="wp-heading-inline"><?php esc_html_e( 'Themes' ); ?> <span class="title-count theme-count"><?php echo ! empty( $_GET['search'] ) ? __( '…' ) : count( $themes ); ?></span> </h1> <?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?> <a href="<?php echo esc_url( admin_url( 'theme-install.php' ) ); ?>" class="hide-if-no-js page-title-action"><?php echo esc_html__( 'Add Theme' ); ?></a> <?php endif; ?> <hr class="wp-header-end"> <form class="search-form search-themes"><p class="search-box"></p></form> <?php if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) { wp_admin_notice( __( 'The active theme is broken. Reverting to the default theme.' ), array( 'id' => 'message1', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } elseif ( isset( $_GET['activated'] ) ) { if ( isset( $_GET['previewed'] ) ) { wp_admin_notice( __( 'Settings saved and theme activated.' ) . ' <a href="' . esc_url( home_url( '/' ) ) . '">' . __( 'Visit site' ) . '</a>', array( 'id' => 'message2', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } else { wp_admin_notice( __( 'New theme activated.' ) . ' <a href="' . esc_url( home_url( '/' ) ) . '">' . __( 'Visit site' ) . '</a>', array( 'id' => 'message2', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } } elseif ( isset( $_GET['deleted'] ) ) { wp_admin_notice( __( 'Theme deleted.' ), array( 'id' => 'message3', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } elseif ( isset( $_GET['delete-active-child'] ) ) { wp_admin_notice( __( 'You cannot delete a theme while it has an active child theme.' ), array( 'id' => 'message4', 'additional_classes' => array( 'error' ), ) ); } elseif ( isset( $_GET['resumed'] ) ) { wp_admin_notice( __( 'Theme resumed.' ), array( 'id' => 'message5', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } elseif ( isset( $_GET['error'] ) && 'resuming' === $_GET['error'] ) { wp_admin_notice( __( 'Theme could not be resumed because it triggered a <strong>fatal error</strong>.' ), array( 'id' => 'message6', 'additional_classes' => array( 'error' ), ) ); } elseif ( isset( $_GET['enabled-auto-update'] ) ) { wp_admin_notice( __( 'Theme will be auto-updated.' ), array( 'id' => 'message7', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } elseif ( isset( $_GET['disabled-auto-update'] ) ) { wp_admin_notice( __( 'Theme will no longer be auto-updated.' ), array( 'id' => 'message8', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } $current_theme = wp_get_theme(); if ( $current_theme->errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) { wp_admin_notice( '<strong>' . __( 'Error:' ) . '</strong> ' . $current_theme->errors()->get_error_message(), array( 'additional_classes' => array( 'error' ), ) ); } $current_theme_actions = array(); if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) { $forbidden_paths = array( 'themes.php', 'theme-editor.php', 'site-editor.php', 'edit.php?post_type=wp_navigation', ); foreach ( (array) $submenu['themes.php'] as $item ) { $class = ''; if ( in_array( $item[2], $forbidden_paths, true ) || str_starts_with( $item[2], 'customize.php' ) ) { continue; } // 0 = name, 1 = capability, 2 = file. if ( 0 === strcmp( $self, $item[2] ) && empty( $parent_file ) || $parent_file && $item[2] === $parent_file ) { $class = ' current'; } if ( ! empty( $submenu[ $item[2] ] ) ) { $submenu[ $item[2] ] = array_values( $submenu[ $item[2] ] ); // Re-index. $menu_hook = get_plugin_page_hook( $submenu[ $item[2] ][0][2], $item[2] ); if ( file_exists( WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}" ) || ! empty( $menu_hook ) ) { $current_theme_actions[] = "<a class='button$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; } else { $current_theme_actions[] = "<a class='button$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>"; } } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { $menu_file = $item[2]; if ( current_user_can( 'customize' ) ) { if ( 'custom-header' === $menu_file ) { $current_theme_actions[] = "<a class='button hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>"; } elseif ( 'custom-background' === $menu_file ) { $current_theme_actions[] = "<a class='button hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>"; } } $pos = strpos( $menu_file, '?' ); if ( false !== $pos ) { $menu_file = substr( $menu_file, 0, $pos ); } if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) { $current_theme_actions[] = "<a class='button$class' href='{$item[2]}'>{$item[0]}</a>"; } else { $current_theme_actions[] = "<a class='button$class' href='themes.php?page={$item[2]}'>{$item[0]}</a>"; } } } } $class_name = 'theme-browser'; if ( ! empty( $_GET['search'] ) ) { $class_name .= ' search-loading'; } ?> <div class="<?php echo esc_attr( $class_name ); ?>"> <div class="themes wp-clearfix"> <?php /* * This PHP is synchronized with the tmpl-theme template below! */ foreach ( $themes as $theme ) : $aria_action = $theme['id'] . '-action'; $aria_name = $theme['id'] . '-name'; $active_class = ''; if ( $theme['active'] ) { $active_class = ' active'; } ?> <div class="theme<?php echo $active_class; ?>"> <?php if ( ! empty( $theme['screenshot'][0] ) ) { ?> <div class="theme-screenshot"> <img src="<?php echo esc_url( $theme['screenshot'][0] . '?ver=' . $theme['version'] ); ?>" alt="" /> </div> <?php } else { ?> <div class="theme-screenshot blank"></div> <?php } ?> <?php if ( $theme['hasUpdate'] ) : ?> <?php if ( $theme['updateResponse']['compatibleWP'] && $theme['updateResponse']['compatiblePHP'] ) : if ( $theme['hasPackage'] ) { $new_version_available = __( 'New version available. <button class="button-link" type="button">Update now</button>' ); } else { $new_version_available = __( 'New version available.' ); } wp_admin_notice( $new_version_available, array( 'type' => 'warning', 'additional_classes' => array( 'notice-alt', 'inline', 'update-message' ), ) ); else : $theme_update_error = ''; if ( ! $theme['updateResponse']['compatibleWP'] && ! $theme['updateResponse']['compatiblePHP'] ) { $theme_update_error .= sprintf( /* translators: %s: Theme name. */ __( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ), $theme['name'] ); if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { $theme_update_error .= sprintf( /* 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>', false ); } elseif ( current_user_can( 'update_core' ) ) { $theme_update_error .= sprintf( /* 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' ) ) { $theme_update_error .= sprintf( /* 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>', false ); } } elseif ( ! $theme['updateResponse']['compatibleWP'] ) { $theme_update_error .= sprintf( /* translators: %s: Theme name. */ __( 'There is a new version of %s available, but it does not work with your version of WordPress.' ), $theme['name'] ); if ( current_user_can( 'update_core' ) ) { $theme_update_error .= sprintf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( '<a href="%s">Please update WordPress</a>.' ), self_admin_url( 'update-core.php' ) ); } } elseif ( ! $theme['updateResponse']['compatiblePHP'] ) { $theme_update_error .= sprintf( /* translators: %s: Theme name. */ __( 'There is a new version of %s available, but it does not work with your version of PHP.' ), $theme['name'] ); if ( current_user_can( 'update_php' ) ) { $theme_update_error .= sprintf( /* 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>', false ); } } wp_admin_notice( $theme_update_error, array( 'type' => 'error', 'additional_classes' => array( 'notice-alt', 'inline', 'update-message' ), ) ); endif; endif; if ( ! $theme['compatibleWP'] || ! $theme['compatiblePHP'] ) { $message = ''; if ( ! $theme['compatibleWP'] && ! $theme['compatiblePHP'] ) { $message = __( 'This theme does not work with your versions of WordPress and PHP.' ); if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { $message .= sprintf( /* 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() ) ); $message .= wp_update_php_annotation( '</p><p><em>', '</em>', false ); } elseif ( current_user_can( 'update_core' ) ) { $message .= sprintf( /* 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' ) ) { $message .= sprintf( /* translators: %s: URL to Update PHP page. */ ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); $message .= wp_update_php_annotation( '</p><p><em>', '</em>', false ); } } elseif ( ! $theme['compatibleWP'] ) { $message .= __( 'This theme does not work with your version of WordPress.' ); if ( current_user_can( 'update_core' ) ) { $message .= sprintf( /* translators: %s: URL to WordPress Updates screen. */ ' ' . __( '<a href="%s">Please update WordPress</a>.' ), self_admin_url( 'update-core.php' ) ); } } elseif ( ! $theme['compatiblePHP'] ) { $message .= __( 'This theme does not work with your version of PHP.' ); if ( current_user_can( 'update_php' ) ) { $message .= sprintf( /* translators: %s: URL to Update PHP page. */ ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); $message .= wp_update_php_annotation( '</p><p><em>', '</em>', false ); } } wp_admin_notice( $message, array( 'type' => 'error', 'additional_classes' => array( 'inline', 'notice-alt' ), ) ); } /* translators: %s: Theme name. */ $details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), $theme['name'] ); ?> <button type="button" class="more-details" id="<?php echo esc_attr( $aria_action ); ?>" aria-label="<?php echo esc_attr( $details_aria_label ); ?>" ><?php _e( 'Theme Details' ); ?></button> <div class="theme-author"> <?php /* translators: %s: Theme author name. */ printf( __( 'By %s' ), $theme['author'] ); ?> </div> <div class="theme-id-container"> <?php if ( $theme['active'] ) { ?> <h2 class="theme-name" id="<?php echo esc_attr( $aria_name ); ?>"> <span><?php _ex( 'Active:', 'theme' ); ?></span> <?php echo $theme['name']; ?> </h2> <?php } else { ?> <h2 class="theme-name" id="<?php echo esc_attr( $aria_name ); ?>"><?php echo $theme['name']; ?></h2> <?php } ?> <div class="theme-actions"> <?php if ( $theme['active'] ) { ?> <?php if ( $theme['actions']['customize'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { /* translators: %s: Theme name. */ $customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), $theme['name'] ); ?> <a class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo esc_url( $theme['actions']['customize'] ); ?>" aria-label="<?php echo esc_attr( $customize_aria_label ); ?>" ><?php _e( 'Customize' ); ?></a> <?php } ?> <?php } elseif ( $theme['compatibleWP'] && $theme['compatiblePHP'] ) { ?> <?php /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button activate" href="<?php echo esc_url( $theme['actions']['activate'] ); ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>" ><?php _e( 'Activate' ); ?></a> <?php // Only classic themes require the "customize" capability. if ( current_user_can( 'edit_theme_options' ) && ( $theme['blockTheme'] || current_user_can( 'customize' ) ) ) { /* translators: %s: Theme name. */ $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button button-primary load-customize hide-if-no-customize" href="<?php echo esc_url( $theme['actions']['customize'] ); ?>" aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" ><?php _e( 'Live Preview' ); ?></a> <?php } ?> <?php } else { ?> <?php /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a> <?php if ( ! $theme['blockTheme'] && current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { /* translators: %s: Theme name. */ $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button button-primary hide-if-no-customize disabled" aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" ><?php _e( 'Live Preview' ); ?></a> <?php } ?> <?php } ?> </div> </div> </div> <?php endforeach; ?> </div> </div> <div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div> <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> <?php // List broken themes, if any. $broken_themes = wp_get_themes( array( 'errors' => true ) ); if ( ! is_multisite() && $broken_themes ) { ?> <div class="broken-themes"> <h3><?php _e( 'Broken Themes' ); ?></h3> <p><?php _e( 'The following themes are installed but incomplete.' ); ?></p> <?php $can_resume = current_user_can( 'resume_themes' ); $can_delete = current_user_can( 'delete_themes' ); $can_install = current_user_can( 'install_themes' ); ?> <table> <tr> <th><?php _ex( 'Name', 'theme name' ); ?></th> <th><?php _e( 'Description' ); ?></th> <?php if ( $can_resume ) { ?> <td></td> <?php } ?> <?php if ( $can_delete ) { ?> <td></td> <?php } ?> <?php if ( $can_install ) { ?> <td></td> <?php } ?> </tr> <?php foreach ( $broken_themes as $broken_theme ) : ?> <tr> <td><?php echo $broken_theme->get( 'Name' ) ? $broken_theme->display( 'Name' ) : esc_html( $broken_theme->get_stylesheet() ); ?></td> <td><?php echo $broken_theme->errors()->get_error_message(); ?></td> <?php if ( $can_resume ) { if ( 'theme_paused' === $broken_theme->errors()->get_error_code() ) { $stylesheet = $broken_theme->get_stylesheet(); $resume_url = add_query_arg( array( 'action' => 'resume', 'stylesheet' => urlencode( $stylesheet ), ), admin_url( 'themes.php' ) ); $resume_url = wp_nonce_url( $resume_url, 'resume-theme_' . $stylesheet ); ?> <td><a href="<?php echo esc_url( $resume_url ); ?>" class="button resume-theme"><?php _e( 'Resume' ); ?></a></td> <?php } else { ?> <td></td> <?php } } if ( $can_delete ) { $stylesheet = $broken_theme->get_stylesheet(); $delete_url = add_query_arg( array( 'action' => 'delete', 'stylesheet' => urlencode( $stylesheet ), ), admin_url( 'themes.php' ) ); $delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet ); ?> <td><a href="<?php echo esc_url( $delete_url ); ?>" class="button delete-theme"><?php _e( 'Delete' ); ?></a></td> <?php } if ( $can_install && 'theme_no_parent' === $broken_theme->errors()->get_error_code() ) { $parent_theme_name = $broken_theme->get( 'Template' ); $parent_theme = themes_api( 'theme_information', array( 'slug' => urlencode( $parent_theme_name ) ) ); if ( ! is_wp_error( $parent_theme ) ) { $install_url = add_query_arg( array( 'action' => 'install-theme', 'theme' => urlencode( $parent_theme_name ), ), admin_url( 'update.php' ) ); $install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name ); ?> <td><a href="<?php echo esc_url( $install_url ); ?>" class="button install-theme"><?php _e( 'Install Parent Theme' ); ?></a></td> <?php } } ?> </tr> <?php endforeach; ?> </table> </div> <?php } ?> </div><!-- .wrap --> <?php /** * Returns the JavaScript template used to display the auto-update setting for a theme. * * @since 5.5.0 * * @return string The template for displaying the auto-update setting link. */ function wp_theme_auto_update_setting_template() { $notice = wp_get_admin_notice( '', array( 'type' => 'error', 'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ), ) ); $template = ' <div class="theme-autoupdate"> <# if ( data.autoupdate.supported ) { #> <# if ( data.autoupdate.forced === false ) { #> ' . __( 'Auto-updates disabled' ) . ' <# } else if ( data.autoupdate.forced ) { #> ' . __( 'Auto-updates enabled' ) . ' <# } else if ( data.autoupdate.enabled ) { #> <button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="disable"> <span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __( 'Disable auto-updates' ) . '</span> </button> <# } else { #> <button type="button" class="toggle-auto-update button-link" data-slug="{{ data.id }}" data-wp-action="enable"> <span class="dashicons dashicons-update spin hidden" aria-hidden="true"></span><span class="label">' . __( 'Enable auto-updates' ) . '</span> </button> <# } #> <# } #> <# if ( data.hasUpdate ) { #> <# if ( data.autoupdate.supported && data.autoupdate.enabled ) { #> <span class="auto-update-time"> <# } else { #> <span class="auto-update-time hidden"> <# } #> <br />' . wp_get_auto_update_message() . '</span> <# } #> ' . $notice . ' </div> '; /** * Filters the JavaScript template used to display the auto-update setting for a theme (in the overlay). * * See {@see wp_prepare_themes_for_js()} for the properties of the `data` object. * * @since 5.5.0 * * @param string $template The template for displaying the auto-update setting link. */ return apply_filters( 'theme_auto_update_setting_template', $template ); } /* * The tmpl-theme template is synchronized with PHP above! */ ?> <script id="tmpl-theme" type="text/template"> <# if ( data.screenshot[0] ) { #> <div class="theme-screenshot"> <img src="{{ data.screenshot[0] }}?ver={{ data.version }}" alt="" /> </div> <# } else { #> <div class="theme-screenshot blank"></div> <# } #> <# if ( data.hasUpdate ) { #> <# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #> <div class="update-message notice inline notice-warning notice-alt"><p> <# if ( data.hasPackage ) { #> <?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?> <# } else { #> <?php _e( 'New version available.' ); ?> <# } #> </p></div> <# } else { #> <div class="update-message notice inline notice-error notice-alt"><p> <# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #> <?php printf( /* translators: %s: Theme name. */ __( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ), '{{{ data.name }}}' ); 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.updateResponse.compatibleWP ) { #> <?php printf( /* translators: %s: Theme name. */ __( 'There is a new version of %s available, but it does not work with your version of WordPress.' ), '{{{ data.name }}}' ); 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.updateResponse.compatiblePHP ) { #> <?php printf( /* translators: %s: Theme name. */ __( 'There is a new version of %s available, but it does not work with your version of PHP.' ), '{{{ data.name }}}' ); 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> <# } #> <# } #> <# if ( ! data.compatibleWP || ! data.compatiblePHP ) { #> <div class="notice notice-error notice-alt"><p> <# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #> <?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.compatibleWP ) { #> <?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.compatiblePHP ) { #> <?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> <# } #> <?php /* translators: %s: Theme name. */ $details_aria_label = sprintf( _x( 'View Theme Details for %s', 'theme' ), '{{ data.name }}' ); ?> <button type="button" class="more-details" id="{{ data.id }}-action" aria-label="<?php echo esc_attr( $details_aria_label ); ?>" ><?php _e( 'Theme Details' ); ?></button> <div class="theme-author"> <?php /* translators: %s: Theme author name. */ printf( __( 'By %s' ), '{{{ data.author }}}' ); ?> </div> <div class="theme-id-container"> <# if ( data.active ) { #> <h2 class="theme-name" id="{{ data.id }}-name"> <span><?php _ex( 'Active:', 'theme' ); ?></span> {{{ data.name }}} </h2> <# } else { #> <h2 class="theme-name" id="{{ data.id }}-name">{{{ data.name }}}</h2> <# } #> <div class="theme-actions"> <# if ( data.active ) { #> <# if ( data.actions.customize ) { #> <?php /* translators: %s: Theme name. */ $customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}" aria-label="<?php echo esc_attr( $customize_aria_label ); ?>" ><?php _e( 'Customize' ); ?></a> <# } #> <# } else { #> <# if ( data.compatibleWP && data.compatiblePHP ) { #> <?php /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button activate" href="{{{ data.actions.activate }}}" aria-label="<?php echo esc_attr( $aria_label ); ?>" ><?php _e( 'Activate' ); ?></a> <?php /* translators: %s: Theme name. */ $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}" aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" ><?php _e( 'Live Preview' ); ?></a> <# } else { #> <?php /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a> <# if ( ! data.blockTheme ) { #> <?php /* translators: %s: Theme name. */ $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button button-primary hide-if-no-customize disabled" aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" ><?php _e( 'Live Preview' ); ?></a> <# } #> <# } #> <# } #> </div> </div> </script> <script id="tmpl-theme-single" type="text/template"> <div class="theme-backdrop"></div> <div class="theme-wrap wp-clearfix" role="document"> <div class="theme-header"> <button class="left dashicons dashicons-no"><span class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Show previous theme' ); ?> </span></button> <button class="right dashicons dashicons-no"><span class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Show next theme' ); ?> </span></button> <button class="close dashicons dashicons-no"><span class="screen-reader-text"> <?php /* translators: Hidden accessibility text. */ _e( 'Close details dialog' ); ?> </span></button> </div> <div class="theme-about wp-clearfix"> <div class="theme-screenshots"> <# if ( data.screenshot[0] ) { #> <div class="screenshot"><img src="{{ data.screenshot[0] }}?ver={{ data.version }}" alt="" /></div> <# } else { #> <div class="screenshot blank"></div> <# } #> </div> <div class="theme-info"> <# if ( data.active ) { #> <span class="current-label"><?php _e( 'Active Theme' ); ?></span> <# } #> <h2 class="theme-name">{{{ data.name }}}<span class="theme-version"> <?php /* translators: %s: Theme version. */ printf( __( 'Version: %s' ), '{{ data.version }}' ); ?> </span></h2> <p class="theme-author"> <?php /* translators: %s: Theme author link. */ printf( __( 'By %s' ), '{{{ data.authorAndUri }}}' ); ?> </p> <# if ( ! data.compatibleWP || ! data.compatiblePHP ) { #> <div class="notice notice-error notice-alt notice-large"><p> <# if ( ! data.compatibleWP && ! data.compatiblePHP ) { #> <?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.compatibleWP ) { #> <?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.compatiblePHP ) { #> <?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> <# } #> <# if ( data.hasUpdate ) { #> <# if ( data.updateResponse.compatibleWP && data.updateResponse.compatiblePHP ) { #> <div class="notice notice-warning notice-alt notice-large"> <h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3> {{{ data.update }}} </div> <# } else { #> <div class="notice notice-error notice-alt notice-large"> <h3 class="notice-title"><?php _e( 'Update Incompatible' ); ?></h3> <p> <# if ( ! data.updateResponse.compatibleWP && ! data.updateResponse.compatiblePHP ) { #> <?php printf( /* translators: %s: Theme name. */ __( 'There is a new version of %s available, but it does not work with your versions of WordPress and PHP.' ), '{{{ data.name }}}' ); 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.updateResponse.compatibleWP ) { #> <?php printf( /* translators: %s: Theme name. */ __( 'There is a new version of %s available, but it does not work with your version of WordPress.' ), '{{{ data.name }}}' ); 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.updateResponse.compatiblePHP ) { #> <?php printf( /* translators: %s: Theme name. */ __( 'There is a new version of %s available, but it does not work with your version of PHP.' ), '{{{ data.name }}}' ); 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> <# } #> <# } #> <# if ( data.actions.autoupdate ) { #> <?php echo wp_theme_auto_update_setting_template(); ?> <# } #> <p class="theme-description">{{{ data.description }}}</p> <# if ( data.parent ) { #> <p class="parent-theme"> <?php /* translators: %s: Theme name. */ printf( __( 'This is a child theme of %s.' ), '<strong>{{{ data.parent }}}</strong>' ); ?> </p> <# } #> <# if ( data.tags ) { #> <p class="theme-tags"><span><?php _e( 'Tags:' ); ?></span> {{{ data.tags }}}</p> <# } #> </div> </div> <div class="theme-actions"> <div class="active-theme"> <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}" ><?php _e( 'Customize' ); ?></a> <?php echo implode( ' ', $current_theme_actions ); ?> </div> <div class="inactive-theme"> <# if ( data.compatibleWP && data.compatiblePHP ) { #> <# if ( ! data.blockTheme ) { #> <?php /* translators: %s: Theme name. */ $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}" aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" ><?php _e( 'Live Preview' ); ?></a> <# } #> <# if ( data.actions.activate ) { #> <?php /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button activate" href="{{{ data.actions.activate }}}" aria-label="<?php echo esc_attr( $aria_label ); ?>" ><?php _e( 'Activate' ); ?></a> <# } #> <# } else { #> <# if ( ! data.blockTheme ) { #> <?php /* translators: %s: Theme name. */ $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button button-primary hide-if-no-customize disabled" aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>" ><?php _e( 'Live Preview' ); ?></a> <# } #> <# if ( data.actions.activate ) { #> <?php /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button disabled" aria-label="<?php echo esc_attr( $aria_label ); ?>" ><?php _ex( 'Cannot Activate', 'theme' ); ?></a> <# } #> <# } #> </div> <# if ( ! data.active && data.actions['delete'] ) { #> <?php /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Delete %s', 'theme' ), '{{ data.name }}' ); ?> <a class="button delete-theme" href="{{{ data.actions['delete'] }}}" aria-label="<?php echo esc_attr( $aria_label ); ?>" ><?php _e( 'Delete' ); ?></a> <# } #> </div> </div> </script> <?php wp_print_request_filesystem_credentials_modal(); wp_print_admin_notice_templates(); wp_print_update_row_templates(); wp_localize_script( 'updates', '_wpUpdatesItemCounts', array( 'totals' => wp_get_update_data(), ) ); require_once ABSPATH . 'wp-admin/admin-footer.php'; plugins.php 0000644 00000074004 15044220553 0006743 0 ustar 00 <?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'; install.php 0000644 00000043706 15044220553 0006735 0 ustar 00 <?php /** * WordPress Installer * * @package WordPress * @subpackage Administration */ // Confidence check. if ( false ) { ?> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Error: PHP is not running</title> </head> <body class="wp-core-ui"> <p id="logo"><a href="https://wordpress.org/">WordPress</a></p> <h1>Error: PHP is not running</h1> <p>WordPress requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.</p> </body> </html> <?php } /** * We are installing WordPress. * * @since 1.5.1 * @var bool */ define( 'WP_INSTALLING', true ); /** Load WordPress Bootstrap */ require_once dirname( __DIR__ ) . '/wp-load.php'; /** Load WordPress Administration Upgrade API */ require_once ABSPATH . 'wp-admin/includes/upgrade.php'; /** Load WordPress Translation Install API */ require_once ABSPATH . 'wp-admin/includes/translation-install.php'; /** Load wpdb */ require_once ABSPATH . WPINC . '/class-wpdb.php'; nocache_headers(); $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0; /** * Display installation header. * * @since 2.5.0 * * @param string $body_classes */ function display_header( $body_classes = '' ) { header( 'Content-Type: text/html; charset=utf-8' ); if ( is_rtl() ) { $body_classes .= 'rtl'; } if ( $body_classes ) { $body_classes = ' ' . $body_classes; } ?> <!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 › Installation' ); ?></title> <?php wp_admin_css( 'install', true ); ?> </head> <body class="wp-core-ui<?php echo $body_classes; ?>"> <p id="logo"><?php _e( 'WordPress' ); ?></p> <?php } // End display_header(). /** * Displays installer setup form. * * @since 2.8.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string|null $error */ function display_setup_form( $error = null ) { global $wpdb; $user_table = ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->users ) ) ) !== null ); // Ensure that sites appear in search engines by default. $blog_public = 1; if ( isset( $_POST['weblog_title'] ) ) { $blog_public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : $blog_public; } $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : ''; $user_name = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : ''; $admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : ''; if ( ! is_null( $error ) ) { ?> <h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1> <p class="message"><?php echo $error; ?></p> <?php } ?> <form id="setup" method="post" action="install.php?step=2" novalidate="novalidate"> <table class="form-table" role="presentation"> <tr> <th scope="row"><label for="weblog_title"><?php _e( 'Site Title' ); ?></label></th> <td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php echo esc_attr( $weblog_title ); ?>" /></td> </tr> <tr> <th scope="row"><label for="user_login"><?php _e( 'Username' ); ?></label></th> <td> <?php if ( $user_table ) { _e( 'User(s) already exists.' ); echo '<input name="user_name" type="hidden" value="admin" />'; } else { ?> <input name="user_name" type="text" id="user_login" size="25" aria-describedby="user-name-desc" value="<?php echo esc_attr( sanitize_user( $user_name, true ) ); ?>" /> <p id="user-name-desc"><?php _e( 'Usernames can have only alphanumeric characters, spaces, underscores, hyphens, periods, and the @ symbol.' ); ?></p> <?php } ?> </td> </tr> <?php if ( ! $user_table ) : ?> <tr class="form-field form-required user-pass1-wrap"> <th scope="row"> <label for="pass1"> <?php _e( 'Password' ); ?> </label> </th> <td> <div class="wp-pwd"> <?php $initial_password = isset( $_POST['admin_password'] ) ? stripslashes( $_POST['admin_password'] ) : wp_generate_password( 18 ); ?> <div class="password-input-wrapper"> <input type="password" name="admin_password" id="pass1" class="regular-text" autocomplete="new-password" spellcheck="false" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" aria-describedby="pass-strength-result admin-password-desc" /> <div id="pass-strength-result" aria-live="polite"></div> </div> <button type="button" class="button wp-hide-pw hide-if-no-js" data-start-masked="<?php echo (int) isset( $_POST['admin_password'] ); ?>" data-toggle="0" aria-label="<?php esc_attr_e( 'Hide password' ); ?>"> <span class="dashicons dashicons-hidden"></span> <span class="text"><?php _e( 'Hide' ); ?></span> </button> </div> <p id="admin-password-desc"><span class="description important hide-if-no-js"> <strong><?php _e( 'Important:' ); ?></strong> <?php /* translators: The non-breaking space prevents 1Password from thinking the text "log in" should trigger a password save prompt. */ ?> <?php _e( 'You will need this password to log in. Please store it in a secure location.' ); ?></span></p> </td> </tr> <tr class="form-field form-required user-pass2-wrap hide-if-js"> <th scope="row"> <label for="pass2"><?php _e( 'Repeat Password' ); ?> <span class="description"><?php _e( '(required)' ); ?></span> </label> </th> <td> <input type="password" name="admin_password2" id="pass2" autocomplete="new-password" spellcheck="false" /> </td> </tr> <tr class="pw-weak"> <th scope="row"><?php _e( 'Confirm Password' ); ?></th> <td> <label> <input type="checkbox" name="pw_weak" class="pw-checkbox" /> <?php _e( 'Confirm use of weak password' ); ?> </label> </td> </tr> <?php endif; ?> <tr> <th scope="row"><label for="admin_email"><?php _e( 'Your Email' ); ?></label></th> <td><input name="admin_email" type="email" id="admin_email" size="25" aria-describedby="admin-email-desc" value="<?php echo esc_attr( $admin_email ); ?>" /> <p id="admin-email-desc"><?php _e( 'Double-check your email address before continuing.' ); ?></p></td> </tr> <tr> <th scope="row"><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site visibility' ) : _e( 'Search engine visibility' ); ?></th> <td> <fieldset> <legend class="screen-reader-text"><span> <?php has_action( 'blog_privacy_selector' ) /* translators: Hidden accessibility text. */ ? _e( 'Site visibility' ) /* translators: Hidden accessibility text. */ : _e( 'Search engine visibility' ); ?> </span></legend> <?php if ( has_action( 'blog_privacy_selector' ) ) { ?> <input id="blog-public" type="radio" name="blog_public" value="1" <?php checked( 1, $blog_public ); ?> /> <label for="blog-public"><?php _e( 'Allow search engines to index this site' ); ?></label><br /> <input id="blog-norobots" type="radio" name="blog_public" aria-describedby="public-desc" value="0" <?php checked( 0, $blog_public ); ?> /> <label for="blog-norobots"><?php _e( 'Discourage search engines from indexing this site' ); ?></label> <p id="public-desc" class="description"><?php _e( 'Note: Discouraging search engines does not block access to your site — it is up to search engines to honor your request.' ); ?></p> <?php /** This action is documented in wp-admin/options-reading.php */ do_action( 'blog_privacy_selector' ); } else { ?> <label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" aria-describedby="privacy-desc" value="0" <?php checked( 0, $blog_public ); ?> /> <?php _e( 'Discourage search engines from indexing this site' ); ?></label> <p id="privacy-desc" class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p> <?php } ?> </fieldset> </td> </tr> </table> <p class="step"><?php submit_button( __( 'Install WordPress' ), 'large', 'Submit', false, array( 'id' => 'submit' ) ); ?></p> <input type="hidden" name="language" value="<?php echo isset( $_REQUEST['language'] ) ? esc_attr( $_REQUEST['language'] ) : ''; ?>" /> </form> <?php } // End display_setup_form(). // Let's check to make sure WP isn't already installed. if ( is_blog_installed() ) { display_header(); die( '<h1>' . __( 'Already Installed' ) . '</h1>' . '<p>' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '</p>' . '<p class="step"><a href="' . esc_url( wp_login_url() ) . '">' . __( 'Log In' ) . '</a></p>' . '</body></html>' ); } /** * @global string $wp_version The WordPress version string. * @global string $required_php_version The required PHP version string. * @global string[] $required_php_extensions The names of required PHP extensions. * @global string $required_mysql_version The required MySQL version string. * @global wpdb $wpdb WordPress database abstraction object. */ global $wp_version, $required_php_version, $required_php_extensions, $required_mysql_version, $wpdb; $php_version = PHP_VERSION; $mysql_version = $wpdb->db_version(); $php_compat = version_compare( $php_version, $required_php_version, '>=' ); $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); $version_url = sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ), sanitize_title( $wp_version ) ); $php_update_message = '</p><p>' . sprintf( /* translators: %s: URL to Update PHP page. */ __( '<a href="%s">Learn more about updating PHP</a>.' ), esc_url( wp_get_update_php_url() ) ); $annotation = wp_get_update_php_annotation(); if ( $annotation ) { $php_update_message .= '</p><p><em>' . $annotation . '</em>'; } if ( ! $mysql_compat && ! $php_compat ) { $compat = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Minimum required MySQL version number, 5: Current PHP version number, 6: Current MySQL version number. */ __( 'You cannot install because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher and MySQL version %4$s or higher. You are running PHP version %5$s and MySQL version %6$s.' ), $version_url, $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ) . $php_update_message; } elseif ( ! $php_compat ) { $compat = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required PHP version number, 4: Current PHP version number. */ __( 'You cannot install because <a href="%1$s">WordPress %2$s</a> requires PHP version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_php_version, $php_version ) . $php_update_message; } elseif ( ! $mysql_compat ) { $compat = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: Minimum required MySQL version number, 4: Current MySQL version number. */ __( 'You cannot install because <a href="%1$s">WordPress %2$s</a> requires MySQL version %3$s or higher. You are running version %4$s.' ), $version_url, $wp_version, $required_mysql_version, $mysql_version ); } if ( ! $mysql_compat || ! $php_compat ) { display_header(); die( '<h1>' . __( 'Requirements Not Met' ) . '</h1><p>' . $compat . '</p></body></html>' ); } if ( isset( $required_php_extensions ) && is_array( $required_php_extensions ) ) { $missing_extensions = array(); foreach ( $required_php_extensions as $extension ) { if ( extension_loaded( $extension ) ) { continue; } $missing_extensions[] = sprintf( /* translators: 1: URL to WordPress release notes, 2: WordPress version number, 3: The PHP extension name needed. */ __( 'You cannot install because <a href="%1$s">WordPress %2$s</a> requires the %3$s PHP extension.' ), $version_url, $wp_version, $extension ); } if ( count( $missing_extensions ) > 0 ) { display_header(); die( '<h1>' . __( 'Requirements Not Met' ) . '</h1><p>' . implode( '</p><p>', $missing_extensions ) . '</p></body></html>' ); } } if ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) { display_header(); die( '<h1>' . __( 'Configuration Error' ) . '</h1>' . '<p>' . sprintf( /* translators: %s: wp-config.php */ __( 'Your %s file has an empty database table prefix, which is not supported.' ), '<code>wp-config.php</code>' ) . '</p></body></html>' ); } // Set error message if DO_NOT_UPGRADE_GLOBAL_TABLES isn't set as it will break install. if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) { display_header(); die( '<h1>' . __( 'Configuration Error' ) . '</h1>' . '<p>' . sprintf( /* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */ __( 'The constant %s cannot be defined when installing WordPress.' ), '<code>DO_NOT_UPGRADE_GLOBAL_TABLES</code>' ) . '</p></body></html>' ); } /** * @global string $wp_local_package Locale code of the package. * @global WP_Locale $wp_locale WordPress date and time locale object. */ $language = ''; if ( ! empty( $_REQUEST['language'] ) ) { $language = sanitize_locale_name( $_REQUEST['language'] ); } elseif ( isset( $GLOBALS['wp_local_package'] ) ) { $language = $GLOBALS['wp_local_package']; } $scripts_to_print = array( 'jquery' ); switch ( $step ) { case 0: // Step 0. if ( wp_can_install_language_pack() && empty( $language ) ) { $languages = wp_get_available_translations(); if ( $languages ) { $scripts_to_print[] = 'language-chooser'; display_header( 'language-chooser' ); echo '<form id="setup" method="post" action="?step=1">'; wp_install_language_form( $languages ); echo '</form>'; break; } } // Deliberately fall through if we can't reach the translations API. case 1: // Step 1, direct link or from language chooser. if ( ! empty( $language ) ) { $loaded_language = wp_download_language_pack( $language ); if ( $loaded_language ) { load_default_textdomain( $loaded_language ); $GLOBALS['wp_locale'] = new WP_Locale(); } } $scripts_to_print[] = 'user-profile'; display_header(); ?> <h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1> <p><?php _e( 'Welcome to the famous five-minute WordPress installation process! Just fill in the information below and you’ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ); ?></p> <h2><?php _e( 'Information needed' ); ?></h2> <p><?php _e( 'Please provide the following information. Do not worry, you can always change these settings later.' ); ?></p> <?php display_setup_form(); break; case 2: if ( ! empty( $language ) && load_default_textdomain( $language ) ) { $loaded_language = $language; $GLOBALS['wp_locale'] = new WP_Locale(); } else { $loaded_language = 'en_US'; } if ( ! empty( $wpdb->error ) ) { wp_die( $wpdb->error->get_error_message() ); } $scripts_to_print[] = 'user-profile'; display_header(); // Fill in the data we gathered. $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : ''; $user_name = isset( $_POST['user_name'] ) ? trim( wp_unslash( $_POST['user_name'] ) ) : ''; $admin_password = isset( $_POST['admin_password'] ) ? wp_unslash( $_POST['admin_password'] ) : ''; $admin_password_check = isset( $_POST['admin_password2'] ) ? wp_unslash( $_POST['admin_password2'] ) : ''; $admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : ''; $public = isset( $_POST['blog_public'] ) ? (int) $_POST['blog_public'] : 1; // Check email address. $error = false; if ( empty( $user_name ) ) { // TODO: Poka-yoke. display_setup_form( __( 'Please provide a valid username.' ) ); $error = true; } elseif ( sanitize_user( $user_name, true ) !== $user_name ) { display_setup_form( __( 'The username you provided has invalid characters.' ) ); $error = true; } elseif ( $admin_password !== $admin_password_check ) { // TODO: Poka-yoke. display_setup_form( __( 'Your passwords do not match. Please try again.' ) ); $error = true; } elseif ( empty( $admin_email ) ) { // TODO: Poka-yoke. display_setup_form( __( 'You must provide an email address.' ) ); $error = true; } elseif ( ! is_email( $admin_email ) ) { // TODO: Poka-yoke. display_setup_form( __( 'Sorry, that is not a valid email address. Email addresses look like <code>[email protected]</code>.' ) ); $error = true; } if ( false === $error ) { $wpdb->show_errors(); $result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language ); ?> <h1><?php _e( 'Success!' ); ?></h1> <p><?php _e( 'WordPress has been installed. Thank you, and enjoy!' ); ?></p> <table class="form-table install-success"> <tr> <th><?php _e( 'Username' ); ?></th> <td><?php echo esc_html( sanitize_user( $user_name, true ) ); ?></td> </tr> <tr> <th><?php _e( 'Password' ); ?></th> <td> <?php if ( ! empty( $result['password'] ) && empty( $admin_password_check ) ) : ?> <code><?php echo esc_html( $result['password'] ); ?></code><br /> <?php endif; ?> <p><?php echo $result['password_message']; ?></p> </td> </tr> </table> <p class="step"><a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log In' ); ?></a></p> <?php } break; } if ( ! wp_is_mobile() ) { ?> <script type="text/javascript">var t = document.getElementById('weblog_title'); if (t){ t.focus(); }</script> <?php } wp_print_scripts( $scripts_to_print ); ?> <script type="text/javascript"> jQuery( function( $ ) { $( '.hide-if-no-js' ).removeClass( 'hide-if-no-js' ); } ); </script> </body> </html> user-new.php 0000644 00000060057 15044220553 0007032 0 ustar 00 <?php /** * New User Administration Screen. * * @package WordPress * @subpackage Administration */ /** WordPress Administration Bootstrap */ require_once __DIR__ . '/admin.php'; if ( is_multisite() ) { if ( ! current_user_can( 'create_users' ) && ! current_user_can( 'promote_users' ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>', 403 ); } } elseif ( ! current_user_can( 'create_users' ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>', 403 ); } if ( is_multisite() ) { add_filter( 'wpmu_signup_user_notification_email', 'admin_created_user_email' ); } if ( isset( $_REQUEST['action'] ) && 'adduser' === $_REQUEST['action'] ) { check_admin_referer( 'add-user', '_wpnonce_add-user' ); $user_details = null; $user_email = wp_unslash( $_REQUEST['email'] ); if ( str_contains( $user_email, '@' ) ) { $user_details = get_user_by( 'email', $user_email ); } else { if ( current_user_can( 'manage_network_users' ) ) { $user_details = get_user_by( 'login', $user_email ); } else { wp_redirect( add_query_arg( array( 'update' => 'enter_email' ), 'user-new.php' ) ); die(); } } if ( ! $user_details ) { wp_redirect( add_query_arg( array( 'update' => 'does_not_exist' ), 'user-new.php' ) ); die(); } if ( ! current_user_can( 'promote_user', $user_details->ID ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to add users to this network.' ) . '</p>', 403 ); } // Adding an existing user to this blog. $new_user_email = array(); $redirect = 'user-new.php'; $username = $user_details->user_login; $user_id = $user_details->ID; if ( array_key_exists( $blog_id, get_blogs_of_user( $user_id ) ) ) { $redirect = add_query_arg( array( 'update' => 'addexisting' ), 'user-new.php' ); } else { if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) { wp_ensure_editable_role( $_REQUEST['role'] ); $result = add_existing_user_to_blog( array( 'user_id' => $user_id, 'role' => $_REQUEST['role'], ) ); if ( ! is_wp_error( $result ) ) { $redirect = add_query_arg( array( 'update' => 'addnoconfirmation', 'user_id' => $user_id, ), 'user-new.php' ); } else { $redirect = add_query_arg( array( 'update' => 'could_not_add' ), 'user-new.php' ); } } else { $newuser_key = wp_generate_password( 20, false ); add_option( 'new_user_' . $newuser_key, array( 'user_id' => $user_id, 'email' => $user_details->user_email, 'role' => $_REQUEST['role'], ) ); $roles = get_editable_roles(); $role = $roles[ $_REQUEST['role'] ]; /** * Fires immediately after an existing user is invited to join the site, but before the notification is sent. * * @since 4.4.0 * * @param int $user_id The invited user's ID. * @param array $role Array containing role information for the invited user. * @param string $newuser_key The key of the invitation. */ do_action( 'invite_user', $user_id, $role, $newuser_key ); $switched_locale = switch_to_user_locale( $user_id ); if ( '' !== get_option( 'blogname' ) ) { $site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); } else { $site_title = parse_url( home_url(), PHP_URL_HOST ); } /* translators: 1: Site title, 2: Site URL, 3: User role, 4: Activation URL. */ $message = __( 'Hi, You\'ve been invited to join \'%1$s\' at %2$s with the role of %3$s. Please click the following link to confirm the invite: %4$s' ); $new_user_email['to'] = $user_details->user_email; $new_user_email['subject'] = sprintf( /* translators: Joining confirmation notification email subject. %s: Site title. */ __( '[%s] Joining Confirmation' ), $site_title ); $new_user_email['message'] = sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ); $new_user_email['headers'] = ''; /** * Filters the contents of the email sent when an existing user is invited to join the site. * * @since 5.6.0 * * @param array $new_user_email { * Used to build wp_mail(). * * @type string $to The email address of the invited user. * @type string $subject The subject of the email. * @type string $message The content of the email. * @type string $headers Headers. * } * @param int $user_id The invited user's ID. * @param array $role Array containing role information for the invited user. * @param string $newuser_key The key of the invitation. * */ $new_user_email = apply_filters( 'invited_user_email', $new_user_email, $user_id, $role, $newuser_key ); wp_mail( $new_user_email['to'], $new_user_email['subject'], $new_user_email['message'], $new_user_email['headers'] ); if ( $switched_locale ) { restore_previous_locale(); } $redirect = add_query_arg( array( 'update' => 'add' ), 'user-new.php' ); } } wp_redirect( $redirect ); die(); } elseif ( isset( $_REQUEST['action'] ) && 'createuser' === $_REQUEST['action'] ) { check_admin_referer( 'create-user', '_wpnonce_create-user' ); if ( ! current_user_can( 'create_users' ) ) { wp_die( '<h1>' . __( 'You need a higher level of permission.' ) . '</h1>' . '<p>' . __( 'Sorry, you are not allowed to create users.' ) . '</p>', 403 ); } if ( ! is_multisite() ) { $user_id = edit_user(); if ( is_wp_error( $user_id ) ) { $add_user_errors = $user_id; } else { if ( current_user_can( 'list_users' ) ) { $redirect = 'users.php?update=add&id=' . $user_id; } else { $redirect = add_query_arg( 'update', 'add', 'user-new.php' ); } wp_redirect( $redirect ); die(); } } else { // Adding a new user to this site. $new_user_email = wp_unslash( $_REQUEST['email'] ); $user_details = wpmu_validate_user_signup( $_REQUEST['user_login'], $new_user_email ); if ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) { $add_user_errors = $user_details['errors']; } else { /** This filter is documented in wp-includes/user.php */ $new_user_login = apply_filters( 'pre_user_login', sanitize_user( wp_unslash( $_REQUEST['user_login'] ), true ) ); if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) { add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email. add_filter( 'wpmu_welcome_user_notification', '__return_false' ); // Disable welcome email. } wp_ensure_editable_role( $_REQUEST['role'] ); wpmu_signup_user( $new_user_login, $new_user_email, array( 'add_to_blog' => get_current_blog_id(), 'new_role' => $_REQUEST['role'], ) ); if ( isset( $_POST['noconfirmation'] ) && current_user_can( 'manage_network_users' ) ) { $key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $new_user_email ) ); $new_user = wpmu_activate_signup( $key ); if ( is_wp_error( $new_user ) ) { $redirect = add_query_arg( array( 'update' => 'addnoconfirmation' ), 'user-new.php' ); } elseif ( ! is_user_member_of_blog( $new_user['user_id'] ) ) { $redirect = add_query_arg( array( 'update' => 'created_could_not_add' ), 'user-new.php' ); } else { $redirect = add_query_arg( array( 'update' => 'addnoconfirmation', 'user_id' => $new_user['user_id'], ), 'user-new.php' ); } } else { $redirect = add_query_arg( array( 'update' => 'newuserconfirmation' ), 'user-new.php' ); } wp_redirect( $redirect ); die(); } } } // Used in the HTML title tag. $title = __( 'Add User' ); $parent_file = 'users.php'; $do_both = false; if ( is_multisite() && current_user_can( 'promote_users' ) && current_user_can( 'create_users' ) ) { $do_both = true; } $help = '<p>' . __( 'To add a new user to your site, fill in the form on this screen and click the Add User button at the bottom.' ) . '</p>'; if ( is_multisite() ) { $help .= '<p>' . __( 'Because this is a multisite installation, you may add accounts that already exist on the Network by specifying a username or email, and defining a role. For more options, such as specifying a password, you have to be a Network Administrator and use the hover link under an existing user’s name to Edit the user profile under Network Admin > All Users.' ) . '</p>' . '<p>' . __( 'New users will receive an email letting them know they’ve been added as a user for your site. This email will also contain their password. Check the box if you do not want the user to receive a welcome email.' ) . '</p>'; } else { $help .= '<p>' . __( 'New users are automatically assigned a password, which they can change after logging in. You can view or edit the assigned password by clicking the Show Password button. The username cannot be changed once the user has been added.' ) . '</p>' . '<p>' . __( 'By default, new users will receive an email letting them know they’ve been added as a user for your site. This email will also contain a password reset link. Uncheck the box if you do not want to send the new user a welcome email.' ) . '</p>'; } $help .= '<p>' . __( 'Remember to click the Add User button at the bottom of this screen when you are finished.' ) . '</p>'; get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help, ) ); get_current_screen()->add_help_tab( array( 'id' => 'user-roles', 'title' => __( 'User Roles' ), 'content' => '<p>' . __( 'Here is a basic overview of the different user roles and the permissions associated with each one:' ) . '</p>' . '<ul>' . '<li>' . __( 'Subscribers can read comments/comment/receive newsletters, etc. but cannot create regular site content.' ) . '</li>' . '<li>' . __( 'Contributors can write and manage their posts but not publish posts or upload media files.' ) . '</li>' . '<li>' . __( 'Authors can publish and manage their own posts, and are able to upload files.' ) . '</li>' . '<li>' . __( 'Editors can publish posts, manage posts as well as manage other people’s posts, etc.' ) . '</li>' . '<li>' . __( 'Administrators have access to all the administration features.' ) . '</li>' . '</ul>', ) ); get_current_screen()->set_help_sidebar( '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . '<p>' . __( '<a href="https://wordpress.org/documentation/article/users-add-new-screen/">Documentation on Adding New Users</a>' ) . '</p>' . '<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' ); wp_enqueue_script( 'wp-ajax-response' ); wp_enqueue_script( 'user-profile' ); /** * Filters whether to enable user auto-complete for non-super admins in Multisite. * * @since 3.4.0 * * @param bool $enable Whether to enable auto-complete for non-super admins. Default false. */ if ( is_multisite() && current_user_can( 'promote_users' ) && ! wp_is_large_network( 'users' ) && ( current_user_can( 'manage_network_users' ) || apply_filters( 'autocomplete_users_for_site_admins', false ) ) ) { wp_enqueue_script( 'user-suggest' ); } require_once ABSPATH . 'wp-admin/admin-header.php'; if ( isset( $_GET['update'] ) ) { $messages = array(); if ( is_multisite() ) { $edit_link = ''; if ( ( isset( $_GET['user_id'] ) ) ) { $user_id_new = absint( $_GET['user_id'] ); if ( $user_id_new ) { $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_id_new ) ) ); } } switch ( $_GET['update'] ) { case 'newuserconfirmation': $messages[] = __( 'Invitation email sent to new user. A confirmation link must be clicked before their account is created.' ); break; case 'add': $messages[] = __( 'Invitation email sent to user. A confirmation link must be clicked for them to be added to your site.' ); break; case 'addnoconfirmation': $message = __( 'User has been added to your site.' ); if ( $edit_link ) { $message .= sprintf( ' <a href="%s">%s</a>', $edit_link, __( 'Edit user' ) ); } $messages[] = $message; break; case 'addexisting': $messages[] = __( 'That user is already a member of this site.' ); break; case 'could_not_add': $add_user_errors = new WP_Error( 'could_not_add', __( 'That user could not be added to this site.' ) ); break; case 'created_could_not_add': $add_user_errors = new WP_Error( 'created_could_not_add', __( 'User has been created, but could not be added to this site.' ) ); break; case 'does_not_exist': $add_user_errors = new WP_Error( 'does_not_exist', __( 'The requested user does not exist.' ) ); break; case 'enter_email': $add_user_errors = new WP_Error( 'enter_email', __( 'Please enter a valid email address.' ) ); break; } } else { if ( 'add' === $_GET['update'] ) { $messages[] = __( 'User added.' ); } } } ?> <div class="wrap"> <h1 id="add-new-user"> <?php if ( current_user_can( 'create_users' ) ) { _e( 'Add User' ); } elseif ( current_user_can( 'promote_users' ) ) { _e( 'Add Existing User' ); } ?> </h1> <?php if ( isset( $errors ) && is_wp_error( $errors ) ) : $error_message = ''; foreach ( $errors->get_error_messages() as $err ) { $error_message .= "<li>$err</li>\n"; } wp_admin_notice( '<ul>' . $error_message . '</ul>', array( 'additional_classes' => array( 'error' ), 'paragraph_wrap' => false, ) ); endif; if ( ! empty( $messages ) ) { foreach ( $messages as $msg ) { wp_admin_notice( $msg, array( 'id' => 'message', 'additional_classes' => array( 'updated' ), 'dismissible' => true, ) ); } } ?> <?php if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) : $error_message = ''; foreach ( $add_user_errors->get_error_messages() as $message ) { $error_message .= "<p>$message</p>\n"; } wp_admin_notice( $error_message, array( 'additional_classes' => array( 'error' ), 'paragraph_wrap' => false, ) ); endif; ?> <div id="ajax-response"></div> <?php if ( is_multisite() && current_user_can( 'promote_users' ) ) { if ( $do_both ) { echo '<h2 id="add-existing-user">' . __( 'Add Existing User' ) . '</h2>'; } if ( ! current_user_can( 'manage_network_users' ) ) { echo '<p>' . __( 'Enter the email address of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>'; $label = __( 'Email' ); $type = 'email'; } else { echo '<p>' . __( 'Enter the email address or username of an existing user on this network to invite them to this site. That person will be sent an email asking them to confirm the invite.' ) . '</p>'; $label = __( 'Email or Username' ); $type = 'text'; } ?> <form method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate" <?php /** * Fires inside the adduser form tag. * * @since 3.0.0 */ do_action( 'user_new_form_tag' ); ?> > <input name="action" type="hidden" value="adduser" /> <?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?> <table class="form-table" role="presentation"> <tr class="form-field form-required"> <th scope="row"><label for="adduser-email"><?php echo esc_html( $label ); ?></label></th> <td><input name="email" type="<?php echo esc_attr( $type ); ?>" id="adduser-email" class="wp-suggest-user" value="" /></td> </tr> <tr class="form-field"> <th scope="row"><label for="adduser-role"><?php _e( 'Role' ); ?></label></th> <td><select name="role" id="adduser-role"> <?php wp_dropdown_roles( get_option( 'default_role' ) ); ?> </select> </td> </tr> <?php if ( current_user_can( 'manage_network_users' ) ) { ?> <tr> <th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th> <td> <input type="checkbox" name="noconfirmation" id="adduser-noconfirmation" value="1" /> <label for="adduser-noconfirmation"><?php _e( 'Add the user without sending an email that requires their confirmation' ); ?></label> </td> </tr> <?php } ?> </table> <?php /** * Fires at the end of the new user form. * * Passes a contextual string to make both types of new user forms * uniquely targetable. Contexts are 'add-existing-user' (Multisite), * and 'add-new-user' (single site and network admin). * * @since 3.7.0 * * @param string $type A contextual string specifying which type of new user form the hook follows. */ do_action( 'user_new_form', 'add-existing-user' ); ?> <?php submit_button( __( 'Add Existing User' ), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?> </form> <?php } // End if is_multisite(). if ( current_user_can( 'create_users' ) ) { if ( $do_both ) { echo '<h2 id="create-new-user">' . __( 'Add User' ) . '</h2>'; } ?> <p><?php _e( 'Create a brand new user and add them to this site.' ); ?></p> <form method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate" <?php /** This action is documented in wp-admin/user-new.php */ do_action( 'user_new_form_tag' ); ?> > <input name="action" type="hidden" value="createuser" /> <?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?> <?php // Load up the passed data, else set to a default. $creating = isset( $_POST['createuser'] ); $new_user_login = $creating && isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : ''; $new_user_firstname = $creating && isset( $_POST['first_name'] ) ? wp_unslash( $_POST['first_name'] ) : ''; $new_user_lastname = $creating && isset( $_POST['last_name'] ) ? wp_unslash( $_POST['last_name'] ) : ''; $new_user_email = $creating && isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : ''; $new_user_uri = $creating && isset( $_POST['url'] ) ? wp_unslash( $_POST['url'] ) : ''; $new_user_role = $creating && isset( $_POST['role'] ) ? wp_unslash( $_POST['role'] ) : ''; $new_user_send_notification = $creating && ! isset( $_POST['send_user_notification'] ) ? false : true; $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unslash( $_POST['noconfirmation'] ) : ''; ?> <table class="form-table" role="presentation"> <tr class="form-field form-required"> <th scope="row"><label for="user_login"><?php _e( 'Username' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th> <td><input name="user_login" type="text" id="user_login" value="<?php echo esc_attr( $new_user_login ); ?>" aria-required="true" autocapitalize="none" autocorrect="off" autocomplete="off" maxlength="60" /></td> </tr> <tr class="form-field form-required"> <th scope="row"><label for="email"><?php _e( 'Email' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th> <td><input name="email" type="email" id="email" value="<?php echo esc_attr( $new_user_email ); ?>" /></td> </tr> <?php if ( ! is_multisite() ) { ?> <tr class="form-field"> <th scope="row"><label for="first_name"><?php _e( 'First Name' ); ?> </label></th> <td><input name="first_name" type="text" id="first_name" value="<?php echo esc_attr( $new_user_firstname ); ?>" /></td> </tr> <tr class="form-field"> <th scope="row"><label for="last_name"><?php _e( 'Last Name' ); ?> </label></th> <td><input name="last_name" type="text" id="last_name" value="<?php echo esc_attr( $new_user_lastname ); ?>" /></td> </tr> <tr class="form-field"> <th scope="row"><label for="url"><?php _e( 'Website' ); ?></label></th> <td><input name="url" type="url" id="url" class="code" value="<?php echo esc_attr( $new_user_uri ); ?>" /></td> </tr> <?php $languages = get_available_languages(); if ( $languages ) : ?> <tr class="form-field user-language-wrap"> <th scope="row"> <label for="locale"> <?php /* translators: The user language selection field label. */ ?> <?php _e( 'Language' ); ?><span class="dashicons dashicons-translation" aria-hidden="true"></span> </label> </th> <td> <?php wp_dropdown_languages( array( 'name' => 'locale', 'id' => 'locale', 'selected' => 'site-default', 'languages' => $languages, 'show_available_translations' => false, 'show_option_site_default' => true, ) ); ?> </td> </tr> <?php endif; ?> <tr class="form-field form-required user-pass1-wrap"> <th scope="row"> <label for="pass1"> <?php _e( 'Password' ); ?> <span class="description hide-if-js"><?php _e( '(required)' ); ?></span> </label> </th> <td> <input type="hidden" value=" " /><!-- #24364 workaround --> <button type="button" class="button wp-generate-pw hide-if-no-js"><?php _e( 'Generate password' ); ?></button> <div class="wp-pwd"> <?php $initial_password = wp_generate_password( 24 ); ?> <div class="password-input-wrapper"> <input type="password" name="pass1" id="pass1" class="regular-text" autocomplete="new-password" spellcheck="false" data-reveal="1" data-pw="<?php echo esc_attr( $initial_password ); ?>" 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> </div> </td> </tr> <tr class="form-field form-required user-pass2-wrap hide-if-js"> <th scope="row"><label for="pass2"><?php _e( 'Repeat Password' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th> <td> <input type="password" name="pass2" id="pass2" autocomplete="new-password" spellcheck="false" aria-describedby="pass2-desc" /> <p class="description" id="pass2-desc"><?php _e( 'Type the password again.' ); ?></p> </td> </tr> <tr class="pw-weak"> <th><?php _e( 'Confirm Password' ); ?></th> <td> <label> <input type="checkbox" name="pw_weak" class="pw-checkbox" /> <?php _e( 'Confirm use of weak password' ); ?> </label> </td> </tr> <tr> <th scope="row"><?php _e( 'Send User Notification' ); ?></th> <td> <input type="checkbox" name="send_user_notification" id="send_user_notification" value="1" <?php checked( $new_user_send_notification ); ?> /> <label for="send_user_notification"><?php _e( 'Send the new user an email about their account' ); ?></label> </td> </tr> <?php } // End if ! is_multisite(). ?> <?php if ( current_user_can( 'promote_users' ) ) { ?> <tr class="form-field"> <th scope="row"><label for="role"><?php _e( 'Role' ); ?></label></th> <td><select name="role" id="role"> <?php if ( ! $new_user_role ) { $new_user_role = get_option( 'default_role' ); } wp_dropdown_roles( $new_user_role ); ?> </select> </td> </tr> <?php } ?> <?php if ( is_multisite() && current_user_can( 'manage_network_users' ) ) { ?> <tr> <th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th> <td> <input type="checkbox" name="noconfirmation" id="noconfirmation" value="1" <?php checked( $new_user_ignore_pass ); ?> /> <label for="noconfirmation"><?php _e( 'Add the user without sending an email that requires their confirmation' ); ?></label> </td> </tr> <?php } ?> </table> <?php /** This action is documented in wp-admin/user-new.php */ do_action( 'user_new_form', 'add-new-user' ); ?> <?php submit_button( __( 'Add User' ), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?> </form> <?php } // End if current_user_can( 'create_users' ). ?> </div> <?php require_once ABSPATH . 'wp-admin/admin-footer.php'; menu-header.php 0000644 00000023513 15044220553 0007453 0 ustar 00 <?php /** * Displays Administration Menu. * * @package WordPress * @subpackage Administration */ // Don't load directly. if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } /** * The current page. * * @global string $self */ $self = preg_replace( '|^.*/wp-admin/network/|i', '', $_SERVER['PHP_SELF'] ); $self = preg_replace( '|^.*/wp-admin/|i', '', $self ); $self = preg_replace( '|^.*/plugins/|i', '', $self ); $self = preg_replace( '|^.*/mu-plugins/|i', '', $self ); /** * For when admin-header is included from within a function. * * @global array $menu * @global array $submenu * @global string $parent_file * @global string $submenu_file */ global $menu, $submenu, $parent_file, $submenu_file; /** * Filters the parent file of an admin menu sub-menu item. * * Allows plugins to move sub-menu items around. * * @since MU (3.0.0) * * @param string $parent_file The parent file. */ $parent_file = apply_filters( 'parent_file', $parent_file ); /** * Filters the file of an admin menu sub-menu item. * * @since 4.4.0 * * @param string $submenu_file The submenu file. * @param string $parent_file The submenu item's parent file. */ $submenu_file = apply_filters( 'submenu_file', $submenu_file, $parent_file ); get_admin_page_parent(); /** * Display menu. * * @access private * @since 2.7.0 * * @global string $self * @global string $parent_file * @global string $submenu_file * @global string $plugin_page * @global string $typenow The post type of the current screen. * * @param array $menu * @param array $submenu * @param bool $submenu_as_parent */ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { global $self, $parent_file, $submenu_file, $plugin_page, $typenow; $first = true; // 0 = menu_title, 1 = capability, 2 = menu_slug, 3 = page_title, 4 = classes, 5 = hookname, 6 = icon_url. foreach ( $menu as $key => $item ) { $admin_is_parent = false; $class = array(); $aria_attributes = ''; $aria_hidden = ''; $is_separator = false; if ( $first ) { $class[] = 'wp-first-item'; $first = false; } $submenu_items = array(); if ( ! empty( $submenu[ $item[2] ] ) ) { $class[] = 'wp-has-submenu'; $submenu_items = $submenu[ $item[2] ]; } if ( ( $parent_file && $item[2] === $parent_file ) || ( empty( $typenow ) && $self === $item[2] ) ) { if ( ! empty( $submenu_items ) ) { $class[] = 'wp-has-current-submenu wp-menu-open'; } else { $class[] = 'current'; $aria_attributes .= 'aria-current="page"'; } } else { $class[] = 'wp-not-current-submenu'; if ( ! empty( $submenu_items ) ) { $aria_attributes .= 'data-ariahaspopup'; } } if ( ! empty( $item[4] ) ) { $class[] = esc_attr( $item[4] ); } $class = $class ? ' class="' . implode( ' ', $class ) . '"' : ''; $id = ! empty( $item[5] ) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : ''; $img = ''; $img_style = ''; $img_class = ' dashicons-before'; if ( str_contains( $class, 'wp-menu-separator' ) ) { $is_separator = true; } /* * If the string 'none' (previously 'div') is passed instead of a URL, don't output * the default menu image so an icon can be added to div.wp-menu-image as background * with CSS. Dashicons and base64-encoded data:image/svg_xml URIs are also handled * as special cases. */ if ( ! empty( $item[6] ) ) { $img = '<img src="' . esc_url( $item[6] ) . '" alt="" />'; if ( 'none' === $item[6] || 'div' === $item[6] ) { $img = '<br />'; } elseif ( str_starts_with( $item[6], 'data:image/svg+xml;base64,' ) ) { $img = '<br />'; // The value is base64-encoded data, so esc_attr() is used here instead of esc_url(). $img_style = ' style="background-image:url(\'' . esc_attr( $item[6] ) . '\')"'; $img_class = ' svg'; } elseif ( str_starts_with( $item[6], 'dashicons-' ) ) { $img = '<br />'; $img_class = ' dashicons-before ' . sanitize_html_class( $item[6] ); } } $title = wptexturize( $item[0] ); // Hide separators from screen readers. if ( $is_separator ) { $aria_hidden = ' aria-hidden="true"'; } echo "\n\t<li$class$id$aria_hidden>"; if ( $is_separator ) { echo '<div class="separator"></div>'; } elseif ( $submenu_as_parent && ! empty( $submenu_items ) ) { $submenu_items = array_values( $submenu_items ); // Re-index. $menu_hook = get_plugin_page_hook( $submenu_items[0][2], $item[2] ); $menu_file = $submenu_items[0][2]; $pos = strpos( $menu_file, '?' ); if ( false !== $pos ) { $menu_file = substr( $menu_file, 0, $pos ); } if ( ! empty( $menu_hook ) || ( ( 'index.php' !== $submenu_items[0][2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) { $admin_is_parent = true; echo "<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes><div class='wp-menu-image$img_class'$img_style aria-hidden='true'>$img</div><div class='wp-menu-name'>$title</div></a>"; } else { echo "\n\t<a href='{$submenu_items[0][2]}'$class $aria_attributes><div class='wp-menu-image$img_class'$img_style aria-hidden='true'>$img</div><div class='wp-menu-name'>$title</div></a>"; } } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { $menu_hook = get_plugin_page_hook( $item[2], 'admin.php' ); $menu_file = $item[2]; $pos = strpos( $menu_file, '?' ); if ( false !== $pos ) { $menu_file = substr( $menu_file, 0, $pos ); } if ( ! empty( $menu_hook ) || ( ( 'index.php' !== $item[2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) { $admin_is_parent = true; echo "\n\t<a href='admin.php?page={$item[2]}'$class $aria_attributes><div class='wp-menu-image$img_class'$img_style aria-hidden='true'>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>"; } else { echo "\n\t<a href='{$item[2]}'$class $aria_attributes><div class='wp-menu-image$img_class'$img_style aria-hidden='true'>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>"; } } if ( ! empty( $submenu_items ) ) { echo "\n\t<ul class='wp-submenu wp-submenu-wrap'>"; echo "<li class='wp-submenu-head' aria-hidden='true'>{$item[0]}</li>"; $first = true; // 0 = menu_title, 1 = capability, 2 = menu_slug, 3 = page_title, 4 = classes. foreach ( $submenu_items as $sub_key => $sub_item ) { if ( ! current_user_can( $sub_item[1] ) ) { continue; } $class = array(); $aria_attributes = ''; if ( $first ) { $class[] = 'wp-first-item'; $first = false; } $menu_file = $item[2]; $pos = strpos( $menu_file, '?' ); if ( false !== $pos ) { $menu_file = substr( $menu_file, 0, $pos ); } // Handle current for post_type=post|page|foo pages, which won't match $self. $self_type = ! empty( $typenow ) ? $self . '?post_type=' . $typenow : 'nothing'; if ( isset( $submenu_file ) ) { if ( $submenu_file === $sub_item[2] ) { $class[] = 'current'; $aria_attributes .= ' aria-current="page"'; } /* * If plugin_page is set the parent must either match the current page or not physically exist. * This allows plugin pages with the same hook to exist under different parents. */ } elseif ( ( ! isset( $plugin_page ) && $self === $sub_item[2] ) || ( isset( $plugin_page ) && $plugin_page === $sub_item[2] && ( $item[2] === $self_type || $item[2] === $self || file_exists( $menu_file ) === false ) ) ) { $class[] = 'current'; $aria_attributes .= ' aria-current="page"'; } if ( ! empty( $sub_item[4] ) ) { $class[] = esc_attr( $sub_item[4] ); } $class = $class ? ' class="' . implode( ' ', $class ) . '"' : ''; $menu_hook = get_plugin_page_hook( $sub_item[2], $item[2] ); $sub_file = $sub_item[2]; $pos = strpos( $sub_file, '?' ); if ( false !== $pos ) { $sub_file = substr( $sub_file, 0, $pos ); } $title = wptexturize( $sub_item[0] ); if ( ! empty( $menu_hook ) || ( ( 'index.php' !== $sub_item[2] ) && file_exists( WP_PLUGIN_DIR . "/$sub_file" ) && ! file_exists( ABSPATH . "/wp-admin/$sub_file" ) ) ) { // If admin.php is the current page or if the parent exists as a file in the plugins or admin directory. if ( ( ! $admin_is_parent && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! is_dir( WP_PLUGIN_DIR . "/{$item[2]}" ) ) || file_exists( $menu_file ) ) { $sub_item_url = add_query_arg( array( 'page' => $sub_item[2] ), $item[2] ); } else { $sub_item_url = add_query_arg( array( 'page' => $sub_item[2] ), 'admin.php' ); } $sub_item_url = esc_url( $sub_item_url ); echo "<li$class><a href='$sub_item_url'$class$aria_attributes>$title</a></li>"; } else { echo "<li$class><a href='{$sub_item[2]}'$class$aria_attributes>$title</a></li>"; } } echo '</ul>'; } echo '</li>'; } echo '<li id="collapse-menu" class="hide-if-no-js">' . '<button type="button" id="collapse-button" aria-label="' . esc_attr__( 'Collapse Main Menu' ) . '" aria-expanded="true">' . '<span class="collapse-button-icon" aria-hidden="true"></span>' . '<span class="collapse-button-label">' . __( 'Collapse Menu' ) . '</span>' . '</button></li>'; } ?> <div id="adminmenumain" role="navigation" aria-label="<?php esc_attr_e( 'Main menu' ); ?>"> <a href="#wpbody-content" class="screen-reader-shortcut"><?php _e( 'Skip to main content' ); ?></a> <a href="#wp-toolbar" class="screen-reader-shortcut"><?php _e( 'Skip to toolbar' ); ?></a> <div id="adminmenuback"></div> <div id="adminmenuwrap"> <ul id="adminmenu"> <?php _wp_menu_output( $menu, $submenu ); /** * Fires after the admin menu has been output. * * @since 2.5.0 */ do_action( 'adminmenu' ); ?> </ul> </div> </div> link.php 0000644 00000005615 15044220553 0006221 0 ustar 00 <?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; } images/mask.png 0000644 00000003721 15044220553 0007455 0 ustar 00 �PNG IHDR e e T|-� �IDATx��]�R�:l������ ���d8�TQ��7�[7;� �}^�c��)qR��j/4����_Dw�+�\F�]�h�z��t�G;�J�:�\�F���>vp��c�n�d��`�±sV���sɵǁD��$h'�=��]�a������s'��B�fOWd ���L�e��ds(�L���G�WH�B��ר����VFa��]�W6Ev��&xM�,����8�O���1};Bc�� ����� Jv�Y�_�#�e�T�W ʴ�d�>*Q���<��Z�L̛����q�)��������'��5Y|���=���i�WOY�Xѵ؋���I���0G QW��5�ذD�8F֊��c�(X%KI�F��u�]�ڲ���x���Z&��[Qp&��NxCꚲy���I%&�J�H#��Yt�Ŗ˪'@zU%z������I�� V%��9�� ��:�'�_�2�˂����*�%C�',�"# �/�a×gYVh˴�d�*,ߐ:�Y��D�}A8�H�#��z�r���1*���k��w�Ѱ�%%~T� �) <�f��!���V@���b���x,��A}�R}&8:SI�R<