├── .htaccess
├── index.php
├── license.txt
├── readme.html
├── wp-activate.php
├── wp-blog-header.php
├── wp-comments-post.php
├── wp-config-sample.php
├── wp-config.php
├── wp-cron.php
├── wp-links-opml.php
├── wp-load.php
├── wp-login.php
├── wp-mail.php
├── wp-settings.php
├── wp-signup.php
├── wp-trackback.php
└── xmlrpc.php
/.htaccess:
--------------------------------------------------------------------------------
1 |
2 | # BEGIN WordPress
3 | # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
4 | # dynamically generated, and should only be modified via WordPress filters.
5 | # Any changes to the directives between these markers will be overwritten.
6 |
7 | RewriteEngine On
8 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
9 | RewriteBase /wordpress-5.9.3/wordpress/
10 | RewriteRule ^index\.php$ - [L]
11 | RewriteCond %{REQUEST_FILENAME} !-f
12 | RewriteCond %{REQUEST_FILENAME} !-d
13 | RewriteRule . /wordpress-5.9.3/wordpress/index.php [L]
14 |
15 |
16 | # END WordPress
--------------------------------------------------------------------------------
/index.php:
--------------------------------------------------------------------------------
1 |
332 | Copyright (C)
333 |
334 | This program is free software; you can redistribute it and/or modify
335 | it under the terms of the GNU General Public License as published by
336 | the Free Software Foundation; either version 2 of the License, or
337 | (at your option) any later version.
338 |
339 | This program is distributed in the hope that it will be useful,
340 | but WITHOUT ANY WARRANTY; without even the implied warranty of
341 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
342 | GNU General Public License for more details.
343 |
344 | You should have received a copy of the GNU General Public License along
345 | with this program; if not, write to the Free Software Foundation, Inc.,
346 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
347 |
348 | Also add information on how to contact you by electronic and paper mail.
349 |
350 | If the program is interactive, make it output a short notice like this
351 | when it starts in an interactive mode:
352 |
353 | Gnomovision version 69, Copyright (C) year name of author
354 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
355 | This is free software, and you are welcome to redistribute it
356 | under certain conditions; type `show c' for details.
357 |
358 | The hypothetical commands `show w' and `show c' should show the appropriate
359 | parts of the General Public License. Of course, the commands you use may
360 | be called something other than `show w' and `show c'; they could even be
361 | mouse-clicks or menu items--whatever suits your program.
362 |
363 | You should also get your employer (if you work as a programmer) or your
364 | school, if any, to sign a "copyright disclaimer" for the program, if
365 | necessary. Here is a sample; alter the names:
366 |
367 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
368 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
369 |
370 | , 1 April 1989
371 | Ty Coon, President of Vice
372 |
373 | This General Public License does not permit incorporating your program into
374 | proprietary programs. If your program is a subroutine library, you may
375 | consider it more useful to permit linking proprietary applications with the
376 | library. If this is what you want to do, use the GNU Lesser General
377 | Public License instead of this License.
378 |
379 | WRITTEN OFFER
380 |
381 | The source code for any program binaries or compressed scripts that are
382 | included with WordPress can be freely obtained at the following URL:
383 |
384 | https://wordpress.org/download/source/
385 |
--------------------------------------------------------------------------------
/readme.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | WordPress › ReadMe
7 |
8 |
9 |
10 |
11 |
12 |
13 | Semantic Personal Publishing Platform
14 |
15 | First Things First
16 | Welcome. WordPress is a very special project to me. Every developer and contributor adds something unique to the mix, and together we create something beautiful that I’m proud to be a part of. Thousands of hours have gone into WordPress, and we’re dedicated to making it better every day. Thank you for making it part of your world.
17 | — Matt Mullenweg
18 |
19 | Installation: Famous 5-minute install
20 |
21 | Unzip the package in an empty directory and upload everything.
22 | Open wp-admin/install.php in your browser. It will take you through the process to set up a wp-config.php
file with your database connection details.
23 |
24 | If for some reason this doesn’t work, don’t worry. It doesn’t work on all web hosts. Open up wp-config-sample.php
with a text editor like WordPad or similar and fill in your database connection details.
25 | Save the file as wp-config.php
and upload it.
26 | Open wp-admin/install.php in your browser.
27 |
28 |
29 | Once the configuration file is set up, the installer will set up the tables needed for your site. If there is an error, double check your wp-config.php
file, and try again. If it fails again, please go to the WordPress support forums with as much data as you can gather.
30 | If you did not enter a password, note the password given to you. If you did not provide a username, it will be admin
.
31 | The installer should then send you to the login page . Sign in with the username and password you chose during the installation. If a password was generated for you, you can then click on “Profile” to change the password.
32 |
33 |
34 | Updating
35 | Using the Automatic Updater
36 |
37 | Open wp-admin/update-core.php in your browser and follow the instructions.
38 | You wanted more, perhaps? That’s it!
39 |
40 |
41 | Updating Manually
42 |
43 | Before you update anything, make sure you have backup copies of any files you may have modified such as index.php
.
44 | Delete your old WordPress files, saving ones you’ve modified.
45 | Upload the new files.
46 | Point your browser to /wp-admin/upgrade.php .
47 |
48 |
49 | Migrating from other systems
50 | WordPress can import from a number of systems . First you need to get WordPress installed and working as described above, before using our import tools .
51 |
52 | System Requirements
53 |
54 | PHP version 5.6.20 or greater.
55 | MySQL version 5.0 or greater.
56 |
57 |
58 | Recommendations
59 |
66 |
67 | Online Resources
68 | If you have any questions that aren’t addressed in this document, please take advantage of WordPress’ numerous online resources:
69 |
70 | The WordPress Codex
71 | The Codex is the encyclopedia of all things WordPress. It is the most comprehensive source of information for WordPress available.
72 | The WordPress Blog
73 | This is where you’ll find the latest updates and news related to WordPress. Recent WordPress news appears in your administrative dashboard by default.
74 | WordPress Planet
75 | The WordPress Planet is a news aggregator that brings together posts from WordPress blogs around the web.
76 | WordPress Support Forums
77 | If you’ve looked everywhere and still can’t find an answer, the support forums are very active and have a large community ready to help. To help them help you be sure to use a descriptive thread title and describe your question in as much detail as possible.
78 | WordPress IRC (Internet Relay Chat) Channel
79 | There is an online chat channel that is used for discussion among people who use WordPress and occasionally support topics. The above wiki page should point you in the right direction. (irc.libera.chat #wordpress )
80 |
81 |
82 | Final Notes
83 |
84 | If you have any suggestions, ideas, or comments, or if you (gasp!) found a bug, join us in the Support Forums .
85 | WordPress has a robust plugin API (Application Programming Interface) that makes extending the code easy. If you are a developer interested in utilizing this, see the Plugin Developer Handbook . You shouldn’t modify any of the core code.
86 |
87 |
88 | Share the Love
89 | WordPress has no multi-million dollar marketing campaign or celebrity sponsors, but we do have something even better—you. If you enjoy WordPress please consider telling a friend, setting it up for someone less knowledgeable than yourself, or writing the author of a media article that overlooks us.
90 |
91 | WordPress is the official continuation of b2/cafélog , which came from Michel V. The work has been continued by the WordPress developers . If you would like to support WordPress, please consider donating .
92 |
93 | License
94 | WordPress is free software, and is released under the terms of the GPL (GNU General Public License) version 2 or (at your option) any later version. See license.txt .
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/wp-activate.php:
--------------------------------------------------------------------------------
1 | get_error_code() ) ) {
56 | status_header( 404 );
57 | } elseif ( is_wp_error( $result ) ) {
58 | $error_code = $result->get_error_code();
59 |
60 | if ( ! in_array( $error_code, $valid_error_codes, true ) ) {
61 | status_header( 400 );
62 | }
63 | }
64 |
65 | nocache_headers();
66 |
67 | if ( is_object( $wp_object_cache ) ) {
68 | $wp_object_cache->cache_enabled = false;
69 | }
70 |
71 | // Fix for page title.
72 | $wp_query->is_404 = false;
73 |
74 | /**
75 | * Fires before the Site Activation page is loaded.
76 | *
77 | * @since 3.0.0
78 | */
79 | do_action( 'activate_header' );
80 |
81 | /**
82 | * Adds an action hook specific to this page.
83 | *
84 | * Fires on {@see 'wp_head'}.
85 | *
86 | * @since MU (3.0.0)
87 | */
88 | function do_activate_header() {
89 | /**
90 | * Fires before the Site Activation page is loaded.
91 | *
92 | * Fires on the {@see 'wp_head'} action.
93 | *
94 | * @since 3.0.0
95 | */
96 | do_action( 'activate_wp_head' );
97 | }
98 | add_action( 'wp_head', 'do_activate_header' );
99 |
100 | /**
101 | * Loads styles specific to this page.
102 | *
103 | * @since MU (3.0.0)
104 | */
105 | function wpmu_activate_stylesheet() {
106 | ?>
107 |
114 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
139 |
140 | get_error_code(), $valid_error_codes, true ) ) {
143 | $signup = $result->get_error_data();
144 | ?>
145 |
146 | ';
148 | if ( '' === $signup->domain . $signup->path ) {
149 | printf(
150 | /* translators: 1: Login URL, 2: Username, 3: User email address, 4: Lost password URL. */
151 | __( 'Your account has been activated. You may now
log in to the site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can
reset your password .' ),
152 | network_site_url( $blog_details->path . 'wp-login.php', 'login' ),
153 | $signup->user_login,
154 | $signup->user_email,
155 | wp_lostpassword_url()
156 | );
157 | } else {
158 | printf(
159 | /* translators: 1: Site URL, 2: Username, 3: User email address, 4: Lost password URL. */
160 | __( 'Your site at %1$s is active. You may now log in to your site using your chosen username of “%2$s”. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can
reset your password .' ),
161 | sprintf( '
%1$s%2$s ', $signup->domain, $blog_details->path ),
162 | $signup->user_login,
163 | $signup->user_email,
164 | wp_lostpassword_url()
165 | );
166 | }
167 | echo '';
168 | } elseif ( null === $result || is_wp_error( $result ) ) {
169 | ?>
170 |
171 |
172 |
get_error_message(); ?>
173 |
174 |
179 |
180 |
181 |
182 |
user_login; ?>
183 |
184 |
185 |
186 |
192 |
193 | View your site or Log in ' ), $url, esc_url( $login_url ) );
196 | ?>
197 |
198 |
199 |
200 | Log in or go back to the homepage .' ),
204 | network_site_url( $blog_details->path . 'wp-login.php', 'login' ),
205 | network_home_url( $blog_details->path )
206 | );
207 | ?>
208 |
209 |
214 |
215 |
216 |
220 | get_error_data();
28 | if ( ! empty( $data ) ) {
29 | wp_die(
30 | '' . $comment->get_error_message() . '
',
31 | __( 'Comment Submission Failure' ),
32 | array(
33 | 'response' => $data,
34 | 'back_link' => true,
35 | )
36 | );
37 | } else {
38 | exit;
39 | }
40 | }
41 |
42 | $user = wp_get_current_user();
43 | $cookies_consent = ( isset( $_POST['wp-comment-cookies-consent'] ) );
44 |
45 | /**
46 | * Perform other actions when comment cookies are set.
47 | *
48 | * @since 3.4.0
49 | * @since 4.9.6 The `$cookies_consent` parameter was added.
50 | *
51 | * @param WP_Comment $comment Comment object.
52 | * @param WP_User $user Comment author's user object. The user may not exist.
53 | * @param bool $cookies_consent Comment author's consent to store cookies.
54 | */
55 | do_action( 'set_comment_cookies', $comment, $user, $cookies_consent );
56 |
57 | $location = empty( $_POST['redirect_to'] ) ? get_comment_link( $comment ) : $_POST['redirect_to'] . '#comment-' . $comment->comment_ID;
58 |
59 | // If user didn't consent to cookies, add specific query arguments to display the awaiting moderation message.
60 | if ( ! $cookies_consent && 'unapproved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_author_email ) ) {
61 | $location = add_query_arg(
62 | array(
63 | 'unapproved' => $comment->comment_ID,
64 | 'moderation-hash' => wp_hash( $comment->comment_date_gmt ),
65 | ),
66 | $location
67 | );
68 | }
69 |
70 | /**
71 | * Filters the location URI to send the commenter after posting.
72 | *
73 | * @since 2.0.5
74 | *
75 | * @param string $location The 'redirect_to' URI sent via $_POST.
76 | * @param WP_Comment $comment Comment object.
77 | */
78 | $location = apply_filters( 'comment_post_redirect', $location, $comment );
79 |
80 | wp_safe_redirect( $location );
81 | exit;
82 |
--------------------------------------------------------------------------------
/wp-config-sample.php:
--------------------------------------------------------------------------------
1 | ,#+h@ivCv#ZfJ5p*{Dw[k`n{(Wc' );
52 | define( 'SECURE_AUTH_KEY', '?L|1i0? !)|k5CAd(g,mj9!j(o4VM3dE#X}$FE$Q.u.Y{!t/HeECJ-RlFsphJC`]' );
53 | define( 'LOGGED_IN_KEY', '$I0vy0IrK2&yBXkkY#Uwx%SI:s,S8>|^_;Rsn~U.aq@uzm,+>ti,CgDHKDk}p:^]' );
54 | define( 'NONCE_KEY', 'E .lgtzhD{D(u_A@Wz?=vk3/,1tg5j4S' );
55 | define( 'AUTH_SALT', '7KZP8N{`atv/`?|:,)y9cgVG;&-;g,W`G.V#oN%fv%8V moe4utb;>AxrEl[cLlu}SbpQlAoqq8s9RU[G' );
58 | define( 'NONCE_SALT', '!0SzhBCn7xo(7)1FtBZkIOFmk?lUgAtKvIUw>M&zT|%Z%n5Agw~j2Ku`2,]hoL,p' );
59 |
60 | /**#@-*/
61 |
62 | /**
63 | * WordPress database table prefix.
64 | *
65 | * You can have multiple installations in one database if you give each
66 | * a unique prefix. Only numbers, letters, and underscores please!
67 | */
68 | $table_prefix = 'wp_';
69 |
70 | /**
71 | * For developers: WordPress debugging mode.
72 | *
73 | * Change this to true to enable the display of notices during development.
74 | * It is strongly recommended that plugin and theme developers use WP_DEBUG
75 | * in their development environments.
76 | *
77 | * For information on other constants that can be used for debugging,
78 | * visit the documentation.
79 | *
80 | * @link https://wordpress.org/support/article/debugging-in-wordpress/
81 | */
82 | define( 'WP_DEBUG', true );
83 |
84 | /* Add any custom values between this line and the "stop editing" line. */
85 |
86 |
87 |
88 | /* That's all, stop editing! Happy publishing. */
89 |
90 | /** Absolute path to the WordPress directory. */
91 | if ( ! defined( 'ABSPATH' ) ) {
92 | define( 'ABSPATH', __DIR__ . '/' );
93 | }
94 |
95 | /** Sets up WordPress vars and included files. */
96 | require_once ABSPATH . 'wp-settings.php';
97 |
--------------------------------------------------------------------------------
/wp-cron.php:
--------------------------------------------------------------------------------
1 | =' ) ) {
23 | if ( ! headers_sent() ) {
24 | header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
25 | header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
26 | }
27 |
28 | fastcgi_finish_request();
29 | }
30 |
31 | if ( ! empty( $_POST ) || defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) {
32 | die();
33 | }
34 |
35 | /**
36 | * Tell WordPress we are doing the cron task.
37 | *
38 | * @var bool
39 | */
40 | define( 'DOING_CRON', true );
41 |
42 | if ( ! defined( 'ABSPATH' ) ) {
43 | /** Set up WordPress environment */
44 | require_once __DIR__ . '/wp-load.php';
45 | }
46 |
47 | /**
48 | * Retrieves the cron lock.
49 | *
50 | * Returns the uncached `doing_cron` transient.
51 | *
52 | * @ignore
53 | * @since 3.3.0
54 | *
55 | * @global wpdb $wpdb WordPress database abstraction object.
56 | *
57 | * @return string|false Value of the `doing_cron` transient, 0|false otherwise.
58 | */
59 | function _get_cron_lock() {
60 | global $wpdb;
61 |
62 | $value = 0;
63 | if ( wp_using_ext_object_cache() ) {
64 | /*
65 | * Skip local cache and force re-fetch of doing_cron transient
66 | * in case another process updated the cache.
67 | */
68 | $value = wp_cache_get( 'doing_cron', 'transient', true );
69 | } else {
70 | $row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", '_transient_doing_cron' ) );
71 | if ( is_object( $row ) ) {
72 | $value = $row->option_value;
73 | }
74 | }
75 |
76 | return $value;
77 | }
78 |
79 | $crons = wp_get_ready_cron_jobs();
80 | if ( empty( $crons ) ) {
81 | die();
82 | }
83 |
84 | $gmt_time = microtime( true );
85 |
86 | // The cron lock: a unix timestamp from when the cron was spawned.
87 | $doing_cron_transient = get_transient( 'doing_cron' );
88 |
89 | // Use global $doing_wp_cron lock, otherwise use the GET lock. If no lock, try to grab a new lock.
90 | if ( empty( $doing_wp_cron ) ) {
91 | if ( empty( $_GET['doing_wp_cron'] ) ) {
92 | // Called from external script/job. Try setting a lock.
93 | if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) ) {
94 | return;
95 | }
96 | $doing_wp_cron = sprintf( '%.22F', microtime( true ) );
97 | $doing_cron_transient = $doing_wp_cron;
98 | set_transient( 'doing_cron', $doing_wp_cron );
99 | } else {
100 | $doing_wp_cron = $_GET['doing_wp_cron'];
101 | }
102 | }
103 |
104 | /*
105 | * The cron lock (a unix timestamp set when the cron was spawned),
106 | * must match $doing_wp_cron (the "key").
107 | */
108 | if ( $doing_cron_transient !== $doing_wp_cron ) {
109 | return;
110 | }
111 |
112 | foreach ( $crons as $timestamp => $cronhooks ) {
113 | if ( $timestamp > $gmt_time ) {
114 | break;
115 | }
116 |
117 | foreach ( $cronhooks as $hook => $keys ) {
118 |
119 | foreach ( $keys as $k => $v ) {
120 |
121 | $schedule = $v['schedule'];
122 |
123 | if ( $schedule ) {
124 | wp_reschedule_event( $timestamp, $schedule, $hook, $v['args'] );
125 | }
126 |
127 | wp_unschedule_event( $timestamp, $hook, $v['args'] );
128 |
129 | /**
130 | * Fires scheduled events.
131 | *
132 | * @ignore
133 | * @since 2.1.0
134 | *
135 | * @param string $hook Name of the hook that was scheduled to be fired.
136 | * @param array $args The arguments to be passed to the hook.
137 | */
138 | do_action_ref_array( $hook, $v['args'] );
139 |
140 | // If the hook ran too long and another cron process stole the lock, quit.
141 | if ( _get_cron_lock() !== $doing_wp_cron ) {
142 | return;
143 | }
144 | }
145 | }
146 | }
147 |
148 | if ( _get_cron_lock() === $doing_wp_cron ) {
149 | delete_transient( 'doing_cron' );
150 | }
151 |
152 | die();
153 |
--------------------------------------------------------------------------------
/wp-links-opml.php:
--------------------------------------------------------------------------------
1 | \n";
27 | ?>
28 |
29 |
30 |
31 |
35 |
36 | GMT
37 |
45 |
46 |
47 | 'link_category',
52 | 'hierarchical' => 0,
53 | )
54 | );
55 | } else {
56 | $cats = get_categories(
57 | array(
58 | 'taxonomy' => 'link_category',
59 | 'hierarchical' => 0,
60 | 'include' => $link_cat,
61 | )
62 | );
63 | }
64 |
65 | foreach ( (array) $cats as $cat ) :
66 | /** This filter is documented in wp-includes/bookmark-template.php */
67 | $catname = apply_filters( 'link_category', $cat->name );
68 |
69 | ?>
70 |
71 | $cat->term_id ) );
73 | foreach ( (array) $bookmarks as $bookmark ) :
74 | /**
75 | * Filters the OPML outline link title text.
76 | *
77 | * @since 2.2.0
78 | *
79 | * @param string $title The OPML outline title text.
80 | */
81 | $title = apply_filters( 'link_title', $bookmark->link_name );
82 | ?>
83 |
89 |
92 |
93 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/wp-load.php:
--------------------------------------------------------------------------------
1 | ' . sprintf(
89 | /* translators: %s: wp-config.php */
90 | __( "There doesn't seem to be a %s file. I need this before we can get started." ),
91 | 'wp-config.php
'
92 | ) . '
';
93 | $die .= '' . sprintf(
94 | /* translators: %s: Documentation URL. */
95 | __( "Need more help? We got it ." ),
96 | __( 'https://wordpress.org/support/article/editing-wp-config-php/' )
97 | ) . '
';
98 | $die .= '' . sprintf(
99 | /* translators: %s: wp-config.php */
100 | __( "You can create a %s file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file." ),
101 | 'wp-config.php
'
102 | ) . '
';
103 | $die .= '' . __( 'Create a Configuration File' ) . '
';
104 |
105 | wp_die( $die, __( 'WordPress › Error' ) );
106 | }
107 |
--------------------------------------------------------------------------------
/wp-login.php:
--------------------------------------------------------------------------------
1 | ` element.
37 | * Default 'Log In'.
38 | * @param string $message Optional. Message to display in header. Default empty.
39 | * @param WP_Error $wp_error Optional. The error to pass. Default is a WP_Error instance.
40 | */
41 | function login_header( $title = 'Log In', $message = '', $wp_error = null ) {
42 | global $error, $interim_login, $action;
43 |
44 | // Don't index any of these forms.
45 | add_filter( 'wp_robots', 'wp_robots_sensitive_page' );
46 | add_action( 'login_head', 'wp_strict_cross_origin_referrer' );
47 |
48 | add_action( 'login_head', 'wp_login_viewport_meta' );
49 |
50 | if ( ! is_wp_error( $wp_error ) ) {
51 | $wp_error = new WP_Error();
52 | }
53 |
54 | // Shake it!
55 | $shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password', 'retrieve_password_email_failure' );
56 | /**
57 | * Filters the error codes array for shaking the login form.
58 | *
59 | * @since 3.0.0
60 | *
61 | * @param string[] $shake_error_codes Error codes that shake the login form.
62 | */
63 | $shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes );
64 |
65 | if ( $shake_error_codes && $wp_error->has_errors() && in_array( $wp_error->get_error_code(), $shake_error_codes, true ) ) {
66 | add_action( 'login_footer', 'wp_shake_js', 12 );
67 | }
68 |
69 | $login_title = get_bloginfo( 'name', 'display' );
70 |
71 | /* translators: Login screen title. 1: Login screen name, 2: Network or site name. */
72 | $login_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $login_title );
73 |
74 | if ( wp_is_recovery_mode() ) {
75 | /* translators: %s: Login screen title. */
76 | $login_title = sprintf( __( 'Recovery Mode — %s' ), $login_title );
77 | }
78 |
79 | /**
80 | * Filters the title tag content for login page.
81 | *
82 | * @since 4.9.0
83 | *
84 | * @param string $login_title The page title, with extra context added.
85 | * @param string $title The original page title.
86 | */
87 | $login_title = apply_filters( 'login_title', $login_title, $title );
88 |
89 | ?>
90 | >
91 |
92 |
93 |
94 | get_error_code() ) {
104 | ?>
105 |
106 |
173 |
174 |
194 |
195 |
196 |
199 |
208 |
209 |
210 | add( 'error', $error );
227 | unset( $error );
228 | }
229 |
230 | if ( $wp_error->has_errors() ) {
231 | $errors = '';
232 | $messages = '';
233 |
234 | foreach ( $wp_error->get_error_codes() as $code ) {
235 | $severity = $wp_error->get_error_data( $code );
236 | foreach ( $wp_error->get_error_messages( $code ) as $error_message ) {
237 | if ( 'message' === $severity ) {
238 | $messages .= ' ' . $error_message . "
\n";
239 | } else {
240 | $errors .= ' ' . $error_message . "
\n";
241 | }
242 | }
243 | }
244 |
245 | if ( ! empty( $errors ) ) {
246 | /**
247 | * Filters the error messages displayed above the login form.
248 | *
249 | * @since 2.1.0
250 | *
251 | * @param string $errors Login error message.
252 | */
253 | echo '
' . apply_filters( 'login_errors', $errors ) . "
\n";
254 | }
255 |
256 | if ( ! empty( $messages ) ) {
257 | /**
258 | * Filters instructional messages displayed above the login form.
259 | *
260 | * @since 2.5.0
261 | *
262 | * @param string $messages Login messages.
263 | */
264 | echo '
' . apply_filters( 'login_messages', $messages ) . "
\n";
265 | }
266 | }
267 | } // End of login_header().
268 |
269 | /**
270 | * Outputs the footer for the login page.
271 | *
272 | * @since 3.1.0
273 | *
274 | * @global bool|string $interim_login Whether interim login modal is being displayed. String 'success'
275 | * upon successful login.
276 | *
277 | * @param string $input_id Which input to auto-focus.
278 | */
279 | function login_footer( $input_id = '' ) {
280 | global $interim_login;
281 |
282 | // Don't allow interim logins to navigate away from the page.
283 | if ( ! $interim_login ) {
284 | ?>
285 |
286 | %s',
289 | esc_url( home_url( '/' ) ),
290 | sprintf(
291 | /* translators: %s: Site title. */
292 | _x( '← Go to %s', 'site' ),
293 | get_bloginfo( 'title', 'display' )
294 | )
295 | );
296 | /**
297 | * Filter the "Go to site" link displayed in the login page footer.
298 | *
299 | * @since 5.7.0
300 | *
301 | * @param string $link HTML link to the home URL of the current site.
302 | */
303 | echo apply_filters( 'login_site_html_link', $html_link );
304 | ?>
305 |
306 | ', '
' );
309 | }
310 |
311 | ?>
312 | . ?>
313 |
314 |
330 |
331 |
373 |
374 |
375 |
376 |
380 |
384 |
395 |
396 |
397 |
398 |
408 |
411 |
421 |
422 | 0 ) {
576 | update_option( 'admin_email_lifespan', time() + $remind_interval );
577 | }
578 |
579 | $redirect_to = add_query_arg( 'admin_email_remind_later', 1, $redirect_to );
580 | wp_safe_redirect( $redirect_to );
581 | exit;
582 | }
583 |
584 | if ( ! empty( $_POST['correct-admin-email'] ) ) {
585 | if ( ! check_admin_referer( 'confirm_admin_email', 'confirm_admin_email_nonce' ) ) {
586 | wp_safe_redirect( wp_login_url() );
587 | exit;
588 | }
589 |
590 | /**
591 | * Filters the interval for redirecting the user to the admin email confirmation screen.
592 | *
593 | * If `0` (zero) is returned, the user will not be redirected.
594 | *
595 | * @since 5.3.0
596 | *
597 | * @param int $interval Interval time (in seconds). Default is 6 months.
598 | */
599 | $admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS );
600 |
601 | if ( $admin_email_check_interval > 0 ) {
602 | update_option( 'admin_email_lifespan', time() + $admin_email_check_interval );
603 | }
604 |
605 | wp_safe_redirect( $redirect_to );
606 | exit;
607 | }
608 |
609 | login_header( __( 'Confirm your administration email' ), '', $errors );
610 |
611 | /**
612 | * Fires before the admin email confirm form.
613 | *
614 | * @since 5.3.0
615 | *
616 | * @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid
617 | * credentials. Note that the error object may not contain any errors.
618 | */
619 | do_action( 'admin_email_confirm', $errors );
620 |
621 | ?>
622 |
623 |
704 |
705 | HashPassword( wp_unslash( $_POST['post_password'] ) ), $expire, COOKIEPATH, COOKIE_DOMAIN, $secure );
739 |
740 | wp_safe_redirect( wp_get_referer() );
741 | exit;
742 |
743 | case 'logout':
744 | check_admin_referer( 'log-out' );
745 |
746 | $user = wp_get_current_user();
747 |
748 | wp_logout();
749 |
750 | if ( ! empty( $_REQUEST['redirect_to'] ) ) {
751 | $redirect_to = $_REQUEST['redirect_to'];
752 | $requested_redirect_to = $redirect_to;
753 | } else {
754 | $redirect_to = add_query_arg(
755 | array(
756 | 'loggedout' => 'true',
757 | 'wp_lang' => get_user_locale( $user ),
758 | ),
759 | wp_login_url()
760 | );
761 |
762 | $requested_redirect_to = '';
763 | }
764 |
765 | /**
766 | * Filters the log out redirect URL.
767 | *
768 | * @since 4.2.0
769 | *
770 | * @param string $redirect_to The redirect destination URL.
771 | * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter.
772 | * @param WP_User $user The WP_User object for the user that's logging out.
773 | */
774 | $redirect_to = apply_filters( 'logout_redirect', $redirect_to, $requested_redirect_to, $user );
775 |
776 | wp_safe_redirect( $redirect_to );
777 | exit;
778 |
779 | case 'lostpassword':
780 | case 'retrievepassword':
781 | if ( $http_post ) {
782 | $errors = retrieve_password();
783 |
784 | if ( ! is_wp_error( $errors ) ) {
785 | $redirect_to = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : 'wp-login.php?checkemail=confirm';
786 | wp_safe_redirect( $redirect_to );
787 | exit;
788 | }
789 | }
790 |
791 | if ( isset( $_GET['error'] ) ) {
792 | if ( 'invalidkey' === $_GET['error'] ) {
793 | $errors->add( 'invalidkey', __( 'Error : Your password reset link appears to be invalid. Please request a new link below.' ) );
794 | } elseif ( 'expiredkey' === $_GET['error'] ) {
795 | $errors->add( 'expiredkey', __( 'Error : Your password reset link has expired. Please request a new link below.' ) );
796 | }
797 | }
798 |
799 | $lostpassword_redirect = ! empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
800 | /**
801 | * Filters the URL redirected to after submitting the lostpassword/retrievepassword form.
802 | *
803 | * @since 3.0.0
804 | *
805 | * @param string $lostpassword_redirect The redirect destination URL.
806 | */
807 | $redirect_to = apply_filters( 'lostpassword_redirect', $lostpassword_redirect );
808 |
809 | /**
810 | * Fires before the lost password form.
811 | *
812 | * @since 1.5.1
813 | * @since 5.1.0 Added the `$errors` parameter.
814 | *
815 | * @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid
816 | * credentials. Note that the error object may not contain any errors.
817 | */
818 | do_action( 'lost_password', $errors );
819 |
820 | login_header( __( 'Lost Password' ), '' . __( 'Please enter your username or email address. You will receive an email message with instructions on how to reset your password.' ) . '
', $errors );
821 |
822 | $user_login = '';
823 |
824 | if ( isset( $_POST['user_login'] ) && is_string( $_POST['user_login'] ) ) {
825 | $user_login = wp_unslash( $_POST['user_login'] );
826 | }
827 |
828 | ?>
829 |
830 |
850 |
851 |
852 |
853 | %s', esc_url( wp_registration_url() ), __( 'Register' ) );
857 |
858 | echo esc_html( $login_link_separator );
859 |
860 | /** This filter is documented in wp-includes/general-template.php */
861 | echo apply_filters( 'register', $registration_url );
862 | }
863 |
864 | ?>
865 |
866 | get_error_code() === 'expired_key' ) {
900 | wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=expiredkey' ) );
901 | } else {
902 | wp_redirect( site_url( 'wp-login.php?action=lostpassword&error=invalidkey' ) );
903 | }
904 |
905 | exit;
906 | }
907 |
908 | $errors = new WP_Error();
909 |
910 | if ( isset( $_POST['pass1'] ) && $_POST['pass1'] !== $_POST['pass2'] ) {
911 | $errors->add( 'password_reset_mismatch', __( 'Error : The passwords do not match.' ) );
912 | }
913 |
914 | /**
915 | * Fires before the password reset procedure is validated.
916 | *
917 | * @since 3.5.0
918 | *
919 | * @param WP_Error $errors WP Error object.
920 | * @param WP_User|WP_Error $user WP_User object if the login and reset key match. WP_Error object otherwise.
921 | */
922 | do_action( 'validate_password_reset', $errors, $user );
923 |
924 | if ( ( ! $errors->has_errors() ) && isset( $_POST['pass1'] ) && ! empty( $_POST['pass1'] ) ) {
925 | reset_password( $user, $_POST['pass1'] );
926 | setcookie( $rp_cookie, ' ', time() - YEAR_IN_SECONDS, $rp_path, COOKIE_DOMAIN, is_ssl(), true );
927 | login_header( __( 'Password Reset' ), '' . __( 'Your password has been reset.' ) . ' ' . __( 'Log in' ) . '
' );
928 | login_footer();
929 | exit;
930 | }
931 |
932 | wp_enqueue_script( 'utils' );
933 | wp_enqueue_script( 'user-profile' );
934 |
935 | login_header( __( 'Reset Password' ), '' . __( 'Enter your new password below or generate one.' ) . '
', $errors );
936 |
937 | ?>
938 |
986 |
987 |
988 |
989 | %s', esc_url( wp_registration_url() ), __( 'Register' ) );
993 |
994 | echo esc_html( $login_link_separator );
995 |
996 | /** This filter is documented in wp-includes/general-template.php */
997 | echo apply_filters( 'register', $registration_url );
998 | }
999 |
1000 | ?>
1001 |
1002 | ' . __( 'Register For This Site' ) . '', $errors );
1061 |
1062 | ?>
1063 |
1091 |
1092 |
1093 |
1094 |
1095 |
1096 |
1097 | add(
1108 | 'confirm',
1109 | sprintf(
1110 | /* translators: %s: Link to the login page. */
1111 | __( 'Check your email for the confirmation link, then visit the login page .' ),
1112 | wp_login_url()
1113 | ),
1114 | 'message'
1115 | );
1116 | } elseif ( 'registered' === $_GET['checkemail'] ) {
1117 | $errors->add(
1118 | 'registered',
1119 | sprintf(
1120 | /* translators: %s: Link to the login page. */
1121 | __( 'Registration complete. Please check your email, then visit the login page .' ),
1122 | wp_login_url()
1123 | ),
1124 | 'message'
1125 | );
1126 | }
1127 |
1128 | /** This action is documented in wp-login.php */
1129 | $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );
1130 |
1131 | login_header( __( 'Check your email' ), '', $errors );
1132 | login_footer();
1133 | break;
1134 |
1135 | case 'confirmaction':
1136 | if ( ! isset( $_GET['request_id'] ) ) {
1137 | wp_die( __( 'Missing request ID.' ) );
1138 | }
1139 |
1140 | if ( ! isset( $_GET['confirm_key'] ) ) {
1141 | wp_die( __( 'Missing confirm key.' ) );
1142 | }
1143 |
1144 | $request_id = (int) $_GET['request_id'];
1145 | $key = sanitize_text_field( wp_unslash( $_GET['confirm_key'] ) );
1146 | $result = wp_validate_user_request_key( $request_id, $key );
1147 |
1148 | if ( is_wp_error( $result ) ) {
1149 | wp_die( $result );
1150 | }
1151 |
1152 | /**
1153 | * Fires an action hook when the account action has been confirmed by the user.
1154 | *
1155 | * Using this you can assume the user has agreed to perform the action by
1156 | * clicking on the link in the confirmation email.
1157 | *
1158 | * After firing this action hook the page will redirect to wp-login a callback
1159 | * redirects or exits first.
1160 | *
1161 | * @since 4.9.6
1162 | *
1163 | * @param int $request_id Request ID.
1164 | */
1165 | do_action( 'user_request_action_confirmed', $request_id );
1166 |
1167 | $message = _wp_privacy_account_request_confirmed_message( $request_id );
1168 |
1169 | login_header( __( 'User action confirmed.' ), $message );
1170 | login_footer();
1171 | exit;
1172 |
1173 | case 'login':
1174 | default:
1175 | $secure_cookie = '';
1176 | $customize_login = isset( $_REQUEST['customize-login'] );
1177 |
1178 | if ( $customize_login ) {
1179 | wp_enqueue_script( 'customize-base' );
1180 | }
1181 |
1182 | // If the user wants SSL but the session is not SSL, force a secure cookie.
1183 | if ( ! empty( $_POST['log'] ) && ! force_ssl_admin() ) {
1184 | $user_name = sanitize_user( wp_unslash( $_POST['log'] ) );
1185 | $user = get_user_by( 'login', $user_name );
1186 |
1187 | if ( ! $user && strpos( $user_name, '@' ) ) {
1188 | $user = get_user_by( 'email', $user_name );
1189 | }
1190 |
1191 | if ( $user ) {
1192 | if ( get_user_option( 'use_ssl', $user->ID ) ) {
1193 | $secure_cookie = true;
1194 | force_ssl_admin( true );
1195 | }
1196 | }
1197 | }
1198 |
1199 | if ( isset( $_REQUEST['redirect_to'] ) ) {
1200 | $redirect_to = $_REQUEST['redirect_to'];
1201 | // Redirect to HTTPS if user wants SSL.
1202 | if ( $secure_cookie && false !== strpos( $redirect_to, 'wp-admin' ) ) {
1203 | $redirect_to = preg_replace( '|^http://|', 'https://', $redirect_to );
1204 | }
1205 | } else {
1206 | $redirect_to = admin_url();
1207 | }
1208 |
1209 | $reauth = empty( $_REQUEST['reauth'] ) ? false : true;
1210 |
1211 | $user = wp_signon( array(), $secure_cookie );
1212 |
1213 | if ( empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
1214 | if ( headers_sent() ) {
1215 | $user = new WP_Error(
1216 | 'test_cookie',
1217 | sprintf(
1218 | /* translators: 1: Browser cookie documentation URL, 2: Support forums URL. */
1219 | __( 'Error : Cookies are blocked due to unexpected output. For help, please see this documentation or try the support forums .' ),
1220 | __( 'https://wordpress.org/support/article/cookies/' ),
1221 | __( 'https://wordpress.org/support/forums/' )
1222 | )
1223 | );
1224 | } elseif ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[ TEST_COOKIE ] ) ) {
1225 | // If cookies are disabled, we can't log in even with a valid user and password.
1226 | $user = new WP_Error(
1227 | 'test_cookie',
1228 | sprintf(
1229 | /* translators: %s: Browser cookie documentation URL. */
1230 | __( 'Error : Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.' ),
1231 | __( 'https://wordpress.org/support/article/cookies/#enable-cookies-in-your-browser' )
1232 | )
1233 | );
1234 | }
1235 | }
1236 |
1237 | $requested_redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
1238 | /**
1239 | * Filters the login redirect URL.
1240 | *
1241 | * @since 3.0.0
1242 | *
1243 | * @param string $redirect_to The redirect destination URL.
1244 | * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter.
1245 | * @param WP_User|WP_Error $user WP_User object if login was successful, WP_Error object otherwise.
1246 | */
1247 | $redirect_to = apply_filters( 'login_redirect', $redirect_to, $requested_redirect_to, $user );
1248 |
1249 | if ( ! is_wp_error( $user ) && ! $reauth ) {
1250 | if ( $interim_login ) {
1251 | $message = '' . __( 'You have logged in successfully.' ) . '
';
1252 | $interim_login = 'success';
1253 | login_header( '', $message );
1254 |
1255 | ?>
1256 |
1257 |
1264 |
1265 |
1269 |