Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../public_h.../wp-inclu...
File: pluggable.php
* Filters the list of recipients for comment moderation emails.
[2000] Fix | Delete
*
[2001] Fix | Delete
* @since 3.7.0
[2002] Fix | Delete
*
[2003] Fix | Delete
* @param string[] $emails List of email addresses to notify for comment moderation.
[2004] Fix | Delete
* @param int $comment_id Comment ID.
[2005] Fix | Delete
*/
[2006] Fix | Delete
$emails = apply_filters( 'comment_moderation_recipients', $emails, $comment_id );
[2007] Fix | Delete
[2008] Fix | Delete
/**
[2009] Fix | Delete
* Filters the comment moderation email text.
[2010] Fix | Delete
*
[2011] Fix | Delete
* @since 1.5.2
[2012] Fix | Delete
*
[2013] Fix | Delete
* @param string $notify_message Text of the comment moderation email.
[2014] Fix | Delete
* @param int $comment_id Comment ID.
[2015] Fix | Delete
*/
[2016] Fix | Delete
$notify_message = apply_filters( 'comment_moderation_text', $notify_message, $comment_id );
[2017] Fix | Delete
[2018] Fix | Delete
/**
[2019] Fix | Delete
* Filters the comment moderation email subject.
[2020] Fix | Delete
*
[2021] Fix | Delete
* @since 1.5.2
[2022] Fix | Delete
*
[2023] Fix | Delete
* @param string $subject Subject of the comment moderation email.
[2024] Fix | Delete
* @param int $comment_id Comment ID.
[2025] Fix | Delete
*/
[2026] Fix | Delete
$subject = apply_filters( 'comment_moderation_subject', $subject, $comment_id );
[2027] Fix | Delete
[2028] Fix | Delete
/**
[2029] Fix | Delete
* Filters the comment moderation email headers.
[2030] Fix | Delete
*
[2031] Fix | Delete
* @since 2.8.0
[2032] Fix | Delete
*
[2033] Fix | Delete
* @param string $message_headers Headers for the comment moderation email.
[2034] Fix | Delete
* @param int $comment_id Comment ID.
[2035] Fix | Delete
*/
[2036] Fix | Delete
$message_headers = apply_filters( 'comment_moderation_headers', $message_headers, $comment_id );
[2037] Fix | Delete
[2038] Fix | Delete
foreach ( $emails as $email ) {
[2039] Fix | Delete
wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
[2040] Fix | Delete
}
[2041] Fix | Delete
[2042] Fix | Delete
if ( $switched_locale ) {
[2043] Fix | Delete
restore_previous_locale();
[2044] Fix | Delete
}
[2045] Fix | Delete
[2046] Fix | Delete
return true;
[2047] Fix | Delete
}
[2048] Fix | Delete
endif;
[2049] Fix | Delete
[2050] Fix | Delete
if ( ! function_exists( 'wp_password_change_notification' ) ) :
[2051] Fix | Delete
/**
[2052] Fix | Delete
* Notifies the blog admin of a user changing password, normally via email.
[2053] Fix | Delete
*
[2054] Fix | Delete
* @since 2.7.0
[2055] Fix | Delete
*
[2056] Fix | Delete
* @param WP_User $user User object.
[2057] Fix | Delete
*/
[2058] Fix | Delete
function wp_password_change_notification( $user ) {
[2059] Fix | Delete
/*
[2060] Fix | Delete
* Send a copy of password change notification to the admin,
[2061] Fix | Delete
* but check to see if it's the admin whose password we're changing, and skip this.
[2062] Fix | Delete
*/
[2063] Fix | Delete
if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) {
[2064] Fix | Delete
/* translators: %s: User name. */
[2065] Fix | Delete
$message = sprintf( __( 'Password changed for user: %s' ), $user->user_login ) . "\r\n";
[2066] Fix | Delete
/*
[2067] Fix | Delete
* The blogname option is escaped with esc_html() on the way into the database in sanitize_option().
[2068] Fix | Delete
* We want to reverse this for the plain text arena of emails.
[2069] Fix | Delete
*/
[2070] Fix | Delete
$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
[2071] Fix | Delete
[2072] Fix | Delete
$wp_password_change_notification_email = array(
[2073] Fix | Delete
'to' => get_option( 'admin_email' ),
[2074] Fix | Delete
/* translators: Password change notification email subject. %s: Site title. */
[2075] Fix | Delete
'subject' => __( '[%s] Password Changed' ),
[2076] Fix | Delete
'message' => $message,
[2077] Fix | Delete
'headers' => '',
[2078] Fix | Delete
);
[2079] Fix | Delete
[2080] Fix | Delete
/**
[2081] Fix | Delete
* Filters the contents of the password change notification email sent to the site admin.
[2082] Fix | Delete
*
[2083] Fix | Delete
* @since 4.9.0
[2084] Fix | Delete
*
[2085] Fix | Delete
* @param array $wp_password_change_notification_email {
[2086] Fix | Delete
* Used to build wp_mail().
[2087] Fix | Delete
*
[2088] Fix | Delete
* @type string $to The intended recipient - site admin email address.
[2089] Fix | Delete
* @type string $subject The subject of the email.
[2090] Fix | Delete
* @type string $message The body of the email.
[2091] Fix | Delete
* @type string $headers The headers of the email.
[2092] Fix | Delete
* }
[2093] Fix | Delete
* @param WP_User $user User object for user whose password was changed.
[2094] Fix | Delete
* @param string $blogname The site title.
[2095] Fix | Delete
*/
[2096] Fix | Delete
$wp_password_change_notification_email = apply_filters( 'wp_password_change_notification_email', $wp_password_change_notification_email, $user, $blogname );
[2097] Fix | Delete
[2098] Fix | Delete
wp_mail(
[2099] Fix | Delete
$wp_password_change_notification_email['to'],
[2100] Fix | Delete
wp_specialchars_decode( sprintf( $wp_password_change_notification_email['subject'], $blogname ) ),
[2101] Fix | Delete
$wp_password_change_notification_email['message'],
[2102] Fix | Delete
$wp_password_change_notification_email['headers']
[2103] Fix | Delete
);
[2104] Fix | Delete
}
[2105] Fix | Delete
}
[2106] Fix | Delete
endif;
[2107] Fix | Delete
[2108] Fix | Delete
if ( ! function_exists( 'wp_new_user_notification' ) ) :
[2109] Fix | Delete
/**
[2110] Fix | Delete
* Emails login credentials to a newly-registered user.
[2111] Fix | Delete
*
[2112] Fix | Delete
* A new user registration notification is also sent to admin email.
[2113] Fix | Delete
*
[2114] Fix | Delete
* @since 2.0.0
[2115] Fix | Delete
* @since 4.3.0 The `$plaintext_pass` parameter was changed to `$notify`.
[2116] Fix | Delete
* @since 4.3.1 The `$plaintext_pass` parameter was deprecated. `$notify` added as a third parameter.
[2117] Fix | Delete
* @since 4.6.0 The `$notify` parameter accepts 'user' for sending notification only to the user created.
[2118] Fix | Delete
*
[2119] Fix | Delete
* @param int $user_id User ID.
[2120] Fix | Delete
* @param null $deprecated Not used (argument deprecated).
[2121] Fix | Delete
* @param string $notify Optional. Type of notification that should happen. Accepts 'admin' or an empty
[2122] Fix | Delete
* string (admin only), 'user', or 'both' (admin and user). Default empty.
[2123] Fix | Delete
*/
[2124] Fix | Delete
function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) {
[2125] Fix | Delete
if ( null !== $deprecated ) {
[2126] Fix | Delete
_deprecated_argument( __FUNCTION__, '4.3.1' );
[2127] Fix | Delete
}
[2128] Fix | Delete
[2129] Fix | Delete
// Accepts only 'user', 'admin' , 'both' or default '' as $notify.
[2130] Fix | Delete
if ( ! in_array( $notify, array( 'user', 'admin', 'both', '' ), true ) ) {
[2131] Fix | Delete
return;
[2132] Fix | Delete
}
[2133] Fix | Delete
[2134] Fix | Delete
$user = get_userdata( $user_id );
[2135] Fix | Delete
[2136] Fix | Delete
/*
[2137] Fix | Delete
* The blogname option is escaped with esc_html() on the way into the database in sanitize_option().
[2138] Fix | Delete
* We want to reverse this for the plain text arena of emails.
[2139] Fix | Delete
*/
[2140] Fix | Delete
$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
[2141] Fix | Delete
[2142] Fix | Delete
/**
[2143] Fix | Delete
* Filters whether the admin is notified of a new user registration.
[2144] Fix | Delete
*
[2145] Fix | Delete
* @since 6.1.0
[2146] Fix | Delete
*
[2147] Fix | Delete
* @param bool $send Whether to send the email. Default true.
[2148] Fix | Delete
* @param WP_User $user User object for new user.
[2149] Fix | Delete
*/
[2150] Fix | Delete
$send_notification_to_admin = apply_filters( 'wp_send_new_user_notification_to_admin', true, $user );
[2151] Fix | Delete
[2152] Fix | Delete
if ( 'user' !== $notify && true === $send_notification_to_admin ) {
[2153] Fix | Delete
$switched_locale = switch_to_locale( get_locale() );
[2154] Fix | Delete
[2155] Fix | Delete
/* translators: %s: Site title. */
[2156] Fix | Delete
$message = sprintf( __( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n";
[2157] Fix | Delete
/* translators: %s: User login. */
[2158] Fix | Delete
$message .= sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
[2159] Fix | Delete
/* translators: %s: User email address. */
[2160] Fix | Delete
$message .= sprintf( __( 'Email: %s' ), $user->user_email ) . "\r\n";
[2161] Fix | Delete
[2162] Fix | Delete
$wp_new_user_notification_email_admin = array(
[2163] Fix | Delete
'to' => get_option( 'admin_email' ),
[2164] Fix | Delete
/* translators: New user registration notification email subject. %s: Site title. */
[2165] Fix | Delete
'subject' => __( '[%s] New User Registration' ),
[2166] Fix | Delete
'message' => $message,
[2167] Fix | Delete
'headers' => '',
[2168] Fix | Delete
);
[2169] Fix | Delete
[2170] Fix | Delete
/**
[2171] Fix | Delete
* Filters the contents of the new user notification email sent to the site admin.
[2172] Fix | Delete
*
[2173] Fix | Delete
* @since 4.9.0
[2174] Fix | Delete
*
[2175] Fix | Delete
* @param array $wp_new_user_notification_email_admin {
[2176] Fix | Delete
* Used to build wp_mail().
[2177] Fix | Delete
*
[2178] Fix | Delete
* @type string $to The intended recipient - site admin email address.
[2179] Fix | Delete
* @type string $subject The subject of the email.
[2180] Fix | Delete
* @type string $message The body of the email.
[2181] Fix | Delete
* @type string $headers The headers of the email.
[2182] Fix | Delete
* }
[2183] Fix | Delete
* @param WP_User $user User object for new user.
[2184] Fix | Delete
* @param string $blogname The site title.
[2185] Fix | Delete
*/
[2186] Fix | Delete
$wp_new_user_notification_email_admin = apply_filters( 'wp_new_user_notification_email_admin', $wp_new_user_notification_email_admin, $user, $blogname );
[2187] Fix | Delete
[2188] Fix | Delete
wp_mail(
[2189] Fix | Delete
$wp_new_user_notification_email_admin['to'],
[2190] Fix | Delete
wp_specialchars_decode( sprintf( $wp_new_user_notification_email_admin['subject'], $blogname ) ),
[2191] Fix | Delete
$wp_new_user_notification_email_admin['message'],
[2192] Fix | Delete
$wp_new_user_notification_email_admin['headers']
[2193] Fix | Delete
);
[2194] Fix | Delete
[2195] Fix | Delete
if ( $switched_locale ) {
[2196] Fix | Delete
restore_previous_locale();
[2197] Fix | Delete
}
[2198] Fix | Delete
}
[2199] Fix | Delete
[2200] Fix | Delete
/**
[2201] Fix | Delete
* Filters whether the user is notified of their new user registration.
[2202] Fix | Delete
*
[2203] Fix | Delete
* @since 6.1.0
[2204] Fix | Delete
*
[2205] Fix | Delete
* @param bool $send Whether to send the email. Default true.
[2206] Fix | Delete
* @param WP_User $user User object for new user.
[2207] Fix | Delete
*/
[2208] Fix | Delete
$send_notification_to_user = apply_filters( 'wp_send_new_user_notification_to_user', true, $user );
[2209] Fix | Delete
[2210] Fix | Delete
// `$deprecated` was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notification.
[2211] Fix | Delete
if ( 'admin' === $notify || true !== $send_notification_to_user || ( empty( $deprecated ) && empty( $notify ) ) ) {
[2212] Fix | Delete
return;
[2213] Fix | Delete
}
[2214] Fix | Delete
[2215] Fix | Delete
$key = get_password_reset_key( $user );
[2216] Fix | Delete
if ( is_wp_error( $key ) ) {
[2217] Fix | Delete
return;
[2218] Fix | Delete
}
[2219] Fix | Delete
[2220] Fix | Delete
$switched_locale = switch_to_user_locale( $user_id );
[2221] Fix | Delete
[2222] Fix | Delete
/* translators: %s: User login. */
[2223] Fix | Delete
$message = sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
[2224] Fix | Delete
$message .= __( 'To set your password, visit the following address:' ) . "\r\n\r\n";
[2225] Fix | Delete
$message .= network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user->user_login ), 'login' ) . "\r\n\r\n";
[2226] Fix | Delete
[2227] Fix | Delete
$message .= wp_login_url() . "\r\n";
[2228] Fix | Delete
[2229] Fix | Delete
$wp_new_user_notification_email = array(
[2230] Fix | Delete
'to' => $user->user_email,
[2231] Fix | Delete
/* translators: Login details notification email subject. %s: Site title. */
[2232] Fix | Delete
'subject' => __( '[%s] Login Details' ),
[2233] Fix | Delete
'message' => $message,
[2234] Fix | Delete
'headers' => '',
[2235] Fix | Delete
);
[2236] Fix | Delete
[2237] Fix | Delete
/**
[2238] Fix | Delete
* Filters the contents of the new user notification email sent to the new user.
[2239] Fix | Delete
*
[2240] Fix | Delete
* @since 4.9.0
[2241] Fix | Delete
*
[2242] Fix | Delete
* @param array $wp_new_user_notification_email {
[2243] Fix | Delete
* Used to build wp_mail().
[2244] Fix | Delete
*
[2245] Fix | Delete
* @type string $to The intended recipient - New user email address.
[2246] Fix | Delete
* @type string $subject The subject of the email.
[2247] Fix | Delete
* @type string $message The body of the email.
[2248] Fix | Delete
* @type string $headers The headers of the email.
[2249] Fix | Delete
* }
[2250] Fix | Delete
* @param WP_User $user User object for new user.
[2251] Fix | Delete
* @param string $blogname The site title.
[2252] Fix | Delete
*/
[2253] Fix | Delete
$wp_new_user_notification_email = apply_filters( 'wp_new_user_notification_email', $wp_new_user_notification_email, $user, $blogname );
[2254] Fix | Delete
[2255] Fix | Delete
wp_mail(
[2256] Fix | Delete
$wp_new_user_notification_email['to'],
[2257] Fix | Delete
wp_specialchars_decode( sprintf( $wp_new_user_notification_email['subject'], $blogname ) ),
[2258] Fix | Delete
$wp_new_user_notification_email['message'],
[2259] Fix | Delete
$wp_new_user_notification_email['headers']
[2260] Fix | Delete
);
[2261] Fix | Delete
[2262] Fix | Delete
if ( $switched_locale ) {
[2263] Fix | Delete
restore_previous_locale();
[2264] Fix | Delete
}
[2265] Fix | Delete
}
[2266] Fix | Delete
endif;
[2267] Fix | Delete
[2268] Fix | Delete
if ( ! function_exists( 'wp_nonce_tick' ) ) :
[2269] Fix | Delete
/**
[2270] Fix | Delete
* Returns the time-dependent variable for nonce creation.
[2271] Fix | Delete
*
[2272] Fix | Delete
* A nonce has a lifespan of two ticks. Nonces in their second tick may be
[2273] Fix | Delete
* updated, e.g. by autosave.
[2274] Fix | Delete
*
[2275] Fix | Delete
* @since 2.5.0
[2276] Fix | Delete
* @since 6.1.0 Added `$action` argument.
[2277] Fix | Delete
*
[2278] Fix | Delete
* @param string|int $action Optional. The nonce action. Default -1.
[2279] Fix | Delete
* @return float Float value rounded up to the next highest integer.
[2280] Fix | Delete
*/
[2281] Fix | Delete
function wp_nonce_tick( $action = -1 ) {
[2282] Fix | Delete
/**
[2283] Fix | Delete
* Filters the lifespan of nonces in seconds.
[2284] Fix | Delete
*
[2285] Fix | Delete
* @since 2.5.0
[2286] Fix | Delete
* @since 6.1.0 Added `$action` argument to allow for more targeted filters.
[2287] Fix | Delete
*
[2288] Fix | Delete
* @param int $lifespan Lifespan of nonces in seconds. Default 86,400 seconds, or one day.
[2289] Fix | Delete
* @param string|int $action The nonce action, or -1 if none was provided.
[2290] Fix | Delete
*/
[2291] Fix | Delete
$nonce_life = apply_filters( 'nonce_life', DAY_IN_SECONDS, $action );
[2292] Fix | Delete
[2293] Fix | Delete
return ceil( time() / ( $nonce_life / 2 ) );
[2294] Fix | Delete
}
[2295] Fix | Delete
endif;
[2296] Fix | Delete
[2297] Fix | Delete
if ( ! function_exists( 'wp_verify_nonce' ) ) :
[2298] Fix | Delete
/**
[2299] Fix | Delete
* Verifies that a correct security nonce was used with time limit.
[2300] Fix | Delete
*
[2301] Fix | Delete
* A nonce is valid for 24 hours (by default).
[2302] Fix | Delete
*
[2303] Fix | Delete
* @since 2.0.3
[2304] Fix | Delete
*
[2305] Fix | Delete
* @param string $nonce Nonce value that was used for verification, usually via a form field.
[2306] Fix | Delete
* @param string|int $action Should give context to what is taking place and be the same when nonce was created.
[2307] Fix | Delete
* @return int|false 1 if the nonce is valid and generated between 0-12 hours ago,
[2308] Fix | Delete
* 2 if the nonce is valid and generated between 12-24 hours ago.
[2309] Fix | Delete
* False if the nonce is invalid.
[2310] Fix | Delete
*/
[2311] Fix | Delete
function wp_verify_nonce( $nonce, $action = -1 ) {
[2312] Fix | Delete
$nonce = (string) $nonce;
[2313] Fix | Delete
$user = wp_get_current_user();
[2314] Fix | Delete
$uid = (int) $user->ID;
[2315] Fix | Delete
if ( ! $uid ) {
[2316] Fix | Delete
/**
[2317] Fix | Delete
* Filters whether the user who generated the nonce is logged out.
[2318] Fix | Delete
*
[2319] Fix | Delete
* @since 3.5.0
[2320] Fix | Delete
*
[2321] Fix | Delete
* @param int $uid ID of the nonce-owning user.
[2322] Fix | Delete
* @param string|int $action The nonce action, or -1 if none was provided.
[2323] Fix | Delete
*/
[2324] Fix | Delete
$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
[2325] Fix | Delete
}
[2326] Fix | Delete
[2327] Fix | Delete
if ( empty( $nonce ) ) {
[2328] Fix | Delete
return false;
[2329] Fix | Delete
}
[2330] Fix | Delete
[2331] Fix | Delete
$token = wp_get_session_token();
[2332] Fix | Delete
$i = wp_nonce_tick( $action );
[2333] Fix | Delete
[2334] Fix | Delete
// Nonce generated 0-12 hours ago.
[2335] Fix | Delete
$expected = substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
[2336] Fix | Delete
if ( hash_equals( $expected, $nonce ) ) {
[2337] Fix | Delete
return 1;
[2338] Fix | Delete
}
[2339] Fix | Delete
[2340] Fix | Delete
// Nonce generated 12-24 hours ago.
[2341] Fix | Delete
$expected = substr( wp_hash( ( $i - 1 ) . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
[2342] Fix | Delete
if ( hash_equals( $expected, $nonce ) ) {
[2343] Fix | Delete
return 2;
[2344] Fix | Delete
}
[2345] Fix | Delete
[2346] Fix | Delete
/**
[2347] Fix | Delete
* Fires when nonce verification fails.
[2348] Fix | Delete
*
[2349] Fix | Delete
* @since 4.4.0
[2350] Fix | Delete
*
[2351] Fix | Delete
* @param string $nonce The invalid nonce.
[2352] Fix | Delete
* @param string|int $action The nonce action.
[2353] Fix | Delete
* @param WP_User $user The current user object.
[2354] Fix | Delete
* @param string $token The user's session token.
[2355] Fix | Delete
*/
[2356] Fix | Delete
do_action( 'wp_verify_nonce_failed', $nonce, $action, $user, $token );
[2357] Fix | Delete
[2358] Fix | Delete
// Invalid nonce.
[2359] Fix | Delete
return false;
[2360] Fix | Delete
}
[2361] Fix | Delete
endif;
[2362] Fix | Delete
[2363] Fix | Delete
if ( ! function_exists( 'wp_create_nonce' ) ) :
[2364] Fix | Delete
/**
[2365] Fix | Delete
* Creates a cryptographic token tied to a specific action, user, user session,
[2366] Fix | Delete
* and window of time.
[2367] Fix | Delete
*
[2368] Fix | Delete
* @since 2.0.3
[2369] Fix | Delete
* @since 4.0.0 Session tokens were integrated with nonce creation.
[2370] Fix | Delete
*
[2371] Fix | Delete
* @param string|int $action Scalar value to add context to the nonce.
[2372] Fix | Delete
* @return string The token.
[2373] Fix | Delete
*/
[2374] Fix | Delete
function wp_create_nonce( $action = -1 ) {
[2375] Fix | Delete
$user = wp_get_current_user();
[2376] Fix | Delete
$uid = (int) $user->ID;
[2377] Fix | Delete
if ( ! $uid ) {
[2378] Fix | Delete
/** This filter is documented in wp-includes/pluggable.php */
[2379] Fix | Delete
$uid = apply_filters( 'nonce_user_logged_out', $uid, $action );
[2380] Fix | Delete
}
[2381] Fix | Delete
[2382] Fix | Delete
$token = wp_get_session_token();
[2383] Fix | Delete
$i = wp_nonce_tick( $action );
[2384] Fix | Delete
[2385] Fix | Delete
return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 );
[2386] Fix | Delete
}
[2387] Fix | Delete
endif;
[2388] Fix | Delete
[2389] Fix | Delete
if ( ! function_exists( 'wp_salt' ) ) :
[2390] Fix | Delete
/**
[2391] Fix | Delete
* Returns a salt to add to hashes.
[2392] Fix | Delete
*
[2393] Fix | Delete
* Salts are created using secret keys. Secret keys are located in two places:
[2394] Fix | Delete
* in the database and in the wp-config.php file. The secret key in the database
[2395] Fix | Delete
* is randomly generated and will be appended to the secret keys in wp-config.php.
[2396] Fix | Delete
*
[2397] Fix | Delete
* The secret keys in wp-config.php should be updated to strong, random keys to maximize
[2398] Fix | Delete
* security. Below is an example of how the secret key constants are defined.
[2399] Fix | Delete
* Do not paste this example directly into wp-config.php. Instead, have a
[2400] Fix | Delete
* {@link https://api.wordpress.org/secret-key/1.1/salt/ secret key created} just
[2401] Fix | Delete
* for you.
[2402] Fix | Delete
*
[2403] Fix | Delete
* define('AUTH_KEY', ' Xakm<o xQy rw4EMsLKM-?!T+,PFF})H4lzcW57AF0U@N@< >M%G4Yt>f`z]MON');
[2404] Fix | Delete
* define('SECURE_AUTH_KEY', 'LzJ}op]mr|6+![P}Ak:uNdJCJZd>(Hx.-Mh#Tz)pCIU#uGEnfFz|f ;;eU%/U^O~');
[2405] Fix | Delete
* define('LOGGED_IN_KEY', '|i|Ux`9<p-h$aFf(qnT:sDO:D1P^wZ$$/Ra@miTJi9G;ddp_<q}6H1)o|a +&JCM');
[2406] Fix | Delete
* define('NONCE_KEY', '%:R{[P|,s.KuMltH5}cI;/k<Gx~j!f0I)m_sIyu+&NJZ)-iO>z7X>QYR0Z_XnZ@|');
[2407] Fix | Delete
* define('AUTH_SALT', 'eZyT)-Naw]F8CwA*VaW#q*|.)g@o}||wf~@C-YSt}(dh_r6EbI#A,y|nU2{B#JBW');
[2408] Fix | Delete
* define('SECURE_AUTH_SALT', '!=oLUTXh,QW=H `}`L|9/^4-3 STz},T(w}W<I`.JjPi)<Bmf1v,HpGe}T1:Xt7n');
[2409] Fix | Delete
* define('LOGGED_IN_SALT', '+XSqHc;@Q*K_b|Z?NC[3H!!EONbh.n<+=uKR:>*c(u`g~EJBf#8u#R{mUEZrozmm');
[2410] Fix | Delete
* define('NONCE_SALT', 'h`GXHhD>SLWVfg1(1(N{;.V!MoE(SfbA_ksP@&`+AycHcAV$+?@3q+rxV{%^VyKT');
[2411] Fix | Delete
*
[2412] Fix | Delete
* Salting passwords helps against tools which has stored hashed values of
[2413] Fix | Delete
* common dictionary strings. The added values makes it harder to crack.
[2414] Fix | Delete
*
[2415] Fix | Delete
* @since 2.5.0
[2416] Fix | Delete
*
[2417] Fix | Delete
* @link https://api.wordpress.org/secret-key/1.1/salt/ Create secrets for wp-config.php
[2418] Fix | Delete
*
[2419] Fix | Delete
* @param string $scheme Authentication scheme (auth, secure_auth, logged_in, nonce).
[2420] Fix | Delete
* @return string Salt value
[2421] Fix | Delete
*/
[2422] Fix | Delete
function wp_salt( $scheme = 'auth' ) {
[2423] Fix | Delete
static $cached_salts = array();
[2424] Fix | Delete
if ( isset( $cached_salts[ $scheme ] ) ) {
[2425] Fix | Delete
/**
[2426] Fix | Delete
* Filters the WordPress salt.
[2427] Fix | Delete
*
[2428] Fix | Delete
* @since 2.5.0
[2429] Fix | Delete
*
[2430] Fix | Delete
* @param string $cached_salt Cached salt for the given scheme.
[2431] Fix | Delete
* @param string $scheme Authentication scheme. Values include 'auth',
[2432] Fix | Delete
* 'secure_auth', 'logged_in', and 'nonce'.
[2433] Fix | Delete
*/
[2434] Fix | Delete
return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );
[2435] Fix | Delete
}
[2436] Fix | Delete
[2437] Fix | Delete
static $duplicated_keys;
[2438] Fix | Delete
if ( null === $duplicated_keys ) {
[2439] Fix | Delete
$duplicated_keys = array(
[2440] Fix | Delete
'put your unique phrase here' => true,
[2441] Fix | Delete
);
[2442] Fix | Delete
[2443] Fix | Delete
/*
[2444] Fix | Delete
* translators: This string should only be translated if wp-config-sample.php is localized.
[2445] Fix | Delete
* You can check the localized release package or
[2446] Fix | Delete
* https://i18n.svn.wordpress.org/<locale code>/branches/<wp version>/dist/wp-config-sample.php
[2447] Fix | Delete
*/
[2448] Fix | Delete
$duplicated_keys[ __( 'put your unique phrase here' ) ] = true;
[2449] Fix | Delete
[2450] Fix | Delete
foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) {
[2451] Fix | Delete
foreach ( array( 'KEY', 'SALT' ) as $second ) {
[2452] Fix | Delete
if ( ! defined( "{$first}_{$second}" ) ) {
[2453] Fix | Delete
continue;
[2454] Fix | Delete
}
[2455] Fix | Delete
$value = constant( "{$first}_{$second}" );
[2456] Fix | Delete
$duplicated_keys[ $value ] = isset( $duplicated_keys[ $value ] );
[2457] Fix | Delete
}
[2458] Fix | Delete
}
[2459] Fix | Delete
}
[2460] Fix | Delete
[2461] Fix | Delete
$values = array(
[2462] Fix | Delete
'key' => '',
[2463] Fix | Delete
'salt' => '',
[2464] Fix | Delete
);
[2465] Fix | Delete
if ( defined( 'SECRET_KEY' ) && SECRET_KEY && empty( $duplicated_keys[ SECRET_KEY ] ) ) {
[2466] Fix | Delete
$values['key'] = SECRET_KEY;
[2467] Fix | Delete
}
[2468] Fix | Delete
if ( 'auth' === $scheme && defined( 'SECRET_SALT' ) && SECRET_SALT && empty( $duplicated_keys[ SECRET_SALT ] ) ) {
[2469] Fix | Delete
$values['salt'] = SECRET_SALT;
[2470] Fix | Delete
}
[2471] Fix | Delete
[2472] Fix | Delete
if ( in_array( $scheme, array( 'auth', 'secure_auth', 'logged_in', 'nonce' ), true ) ) {
[2473] Fix | Delete
foreach ( array( 'key', 'salt' ) as $type ) {
[2474] Fix | Delete
$const = strtoupper( "{$scheme}_{$type}" );
[2475] Fix | Delete
if ( defined( $const ) && constant( $const ) && empty( $duplicated_keys[ constant( $const ) ] ) ) {
[2476] Fix | Delete
$values[ $type ] = constant( $const );
[2477] Fix | Delete
} elseif ( ! $values[ $type ] ) {
[2478] Fix | Delete
$values[ $type ] = get_site_option( "{$scheme}_{$type}" );
[2479] Fix | Delete
if ( ! $values[ $type ] ) {
[2480] Fix | Delete
$values[ $type ] = wp_generate_password( 64, true, true );
[2481] Fix | Delete
update_site_option( "{$scheme}_{$type}", $values[ $type ] );
[2482] Fix | Delete
}
[2483] Fix | Delete
}
[2484] Fix | Delete
}
[2485] Fix | Delete
} else {
[2486] Fix | Delete
if ( ! $values['key'] ) {
[2487] Fix | Delete
$values['key'] = get_site_option( 'secret_key' );
[2488] Fix | Delete
if ( ! $values['key'] ) {
[2489] Fix | Delete
$values['key'] = wp_generate_password( 64, true, true );
[2490] Fix | Delete
update_site_option( 'secret_key', $values['key'] );
[2491] Fix | Delete
}
[2492] Fix | Delete
}
[2493] Fix | Delete
$values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] );
[2494] Fix | Delete
}
[2495] Fix | Delete
[2496] Fix | Delete
$cached_salts[ $scheme ] = $values['key'] . $values['salt'];
[2497] Fix | Delete
[2498] Fix | Delete
/** This filter is documented in wp-includes/pluggable.php */
[2499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function