/var/www/vhosts/ihelp.ro/ajutam.ro/wp-includes
NameSizeModeActions
abilities-api/-0755rm
assets/-0755rm
block-bindings/-0755rm
block-patterns/-0755rm
block-supports/-0755rm
blocks/-0755rm
certificates/-0755rm
css/-0755rm
customize/-0755rm
fonts/-0755rm
html-api/-0755rm
ID3/-0755rm
images/-0755rm
interactivity-api/-0755rm
IXR/-0755rm
js/-0755rm
l10n/-0755rm
php-compat/-0755rm
PHPMailer/-0755rm
pomo/-0755rm
Requests/-0755rm
rest-api/-0755rm
SimplePie/-0755rm
sitemaps/-0755rm
sodium_compat/-0755rm
style-engine/-0755rm
Text/-0755rm
theme-compat/-0755rm
widgets/-0755rm
abilities-api.php243690644editdlrm
abilities.php79830644editdlrm
admin-bar.php369660644editdlrm
atomlib.php121810644editdlrm
author-template.php193910644editdlrm
block-bindings.php75260644editdlrm
block-editor.php292820644editdlrm
block-i18n.json3160644editdlrm
block-patterns.php132130644editdlrm
block-template-utils.php624840644editdlrm
block-template.php153590644editdlrm
blocks.php1147390644editdlrm
bookmark-template.php127680644editdlrm
bookmark.php154270644editdlrm
cache-compat.php100780644editdlrm
cache.php134860644editdlrm
canonical.php346280644editdlrm
capabilities.php436520644editdlrm
category-template.php570450644editdlrm
category.php128290644editdlrm
class-avif-info.php296150644editdlrm
class-feed.php5390644editdlrm
class-http.php3670644editdlrm
class-IXR.php26160644editdlrm
class-json.php436760644editdlrm
class-oembed.php4010644editdlrm
class-phpass.php67710644editdlrm
class-phpmailer.php6640644editdlrm
class-pop3.php211210644editdlrm
class-requests.php22370644editdlrm
class-simplepie.php4530644editdlrm
class-smtp.php4570644editdlrm
class-snoopy.php377150644editdlrm
class-walker-category-dropdown.php24690644editdlrm
class-walker-category.php84770644editdlrm
class-walker-comment.php142210644editdlrm
class-walker-nav-menu.php120440644editdlrm
class-walker-page-dropdown.php27100644editdlrm
class-walker-page.php76120644editdlrm
class-wp-admin-bar.php178740644editdlrm
class-wp-ajax-response.php52660644editdlrm
class-wp-application-passwords.php170990644editdlrm
class-wp-block-bindings-registry.php84820644editdlrm
class-wp-block-bindings-source.php29920644editdlrm
class-wp-block-editor-context.php13500644editdlrm
class-wp-block-list.php47130644editdlrm
class-wp-block-metadata-registry.php118950644editdlrm
class-wp-block-parser-block.php25550644editdlrm
class-wp-block-parser-frame.php20170644editdlrm
class-wp-block-parser.php115160644editdlrm
class-wp-block-pattern-categories-registry.php54500644editdlrm
class-wp-block-patterns-registry.php112530644editdlrm
class-wp-block-processor.php699590644editdlrm
class-wp-block-styles-registry.php64970644editdlrm
class-wp-block-supports.php56260644editdlrm
class-wp-block-template.php20330644editdlrm
class-wp-block-templates-registry.php71930644editdlrm
class-wp-block-type-registry.php50300644editdlrm
class-wp-block-type.php172650644editdlrm
class-wp-block.php248120644editdlrm
class-wp-classic-to-block-menu-converter.php40700644editdlrm
class-wp-comment-query.php488040644editdlrm
class-wp-comment.php94370644editdlrm
class-wp-customize-control.php261190644editdlrm
class-wp-customize-manager.php2031390644editdlrm
class-wp-customize-nav-menus.php580130644editdlrm
class-wp-customize-panel.php107100644editdlrm
class-wp-customize-section.php112090644editdlrm
class-wp-customize-setting.php299620644editdlrm
class-wp-customize-widgets.php726070644editdlrm
class-wp-date-query.php361470644editdlrm
class-wp-dependencies.php170040644editdlrm
class-wp-dependency.php26330644editdlrm
class-wp-duotone.php407830644editdlrm
class-wp-editor.php723350644editdlrm
class-wp-embed.php159310644editdlrm
class-wp-error.php75020644editdlrm
class-wp-exception.php2530644editdlrm
class-wp-fatal-error-handler.php81500644editdlrm
class-wp-feed-cache-transient.php33040644editdlrm
class-wp-feed-cache.php9690644editdlrm
class-wp-hook.php166740644editdlrm
class-wp-http-cookie.php73890644editdlrm
class-wp-http-curl.php132610644editdlrm
class-wp-http-encoding.php66890644editdlrm
class-wp-http-ixr-client.php35060644editdlrm
class-wp-http-proxy.php59800644editdlrm
class-wp-http-requests-hooks.php20220644editdlrm
class-wp-http-requests-response.php44000644editdlrm
class-wp-http-response.php29770644editdlrm
class-wp-http-streams.php168590644editdlrm
class-wp-http.php415700644editdlrm
class-wp-image-editor-gd.php207050644editdlrm
class-wp-image-editor-imagick.php434150644editdlrm
class-wp-image-editor.php174150644editdlrm
class-wp-list-util.php74430644editdlrm
class-wp-locale-switcher.php67760644editdlrm
class-wp-locale.php168830644editdlrm
class-wp-matchesmapregex.php18280644editdlrm
class-wp-meta-query.php305330644editdlrm
class-wp-metadata-lazyloader.php68330644editdlrm
class-wp-navigation-fallback.php91930644editdlrm
class-wp-network-query.php198870644editdlrm
class-wp-network.php122960644editdlrm
class-wp-object-cache.php175240644editdlrm
class-wp-oembed-controller.php69050644editdlrm
class-wp-oembed.php316700644editdlrm
class-wp-paused-extensions-storage.php51110644editdlrm
class-wp-phpmailer.php43480644editdlrm
class-wp-plugin-dependencies.php253150644editdlrm
class-wp-post-type.php306800644editdlrm
class-wp-post.php64910644editdlrm
class-wp-query.php1639750644editdlrm
class-wp-recovery-mode-cookie-service.php68770644editdlrm
class-wp-recovery-mode-email-service.php111830644editdlrm
class-wp-recovery-mode-key-service.php48840644editdlrm
class-wp-recovery-mode-link-service.php34630644editdlrm
class-wp-recovery-mode.php114530644editdlrm
class-wp-rewrite.php636870644editdlrm
class-wp-role.php25230644editdlrm
class-wp-roles.php93940644editdlrm
class-wp-script-modules.php329510644editdlrm
class-wp-scripts.php348640644editdlrm
class-wp-session-tokens.php73190644editdlrm
class-wp-simplepie-file.php35520644editdlrm
class-wp-simplepie-sanitize-kses.php19100644editdlrm
class-wp-site-query.php316550644editdlrm
class-wp-site.php74670644editdlrm
class-wp-speculation-rules.php75270644editdlrm
class-wp-styles.php128430644editdlrm
class-wp-tax-query.php195770644editdlrm
class-wp-taxonomy.php185590644editdlrm
class-wp-term-query.php409530644editdlrm
class-wp-term.php52980644editdlrm
class-wp-text-diff-renderer-inline.php9790644editdlrm
class-wp-text-diff-renderer-table.php188800644editdlrm
class-wp-textdomain-registry.php104810644editdlrm
class-wp-theme-json-data.php18090644editdlrm
class-wp-theme-json-resolver.php357380644editdlrm
class-wp-theme-json-schema.php73670644editdlrm
class-wp-theme-json.php1643470644editdlrm
class-wp-theme.php658100644editdlrm
class-wp-token-map.php286180644editdlrm
class-wp-url-pattern-prefixer.php48020644editdlrm
class-wp-user-meta-session-tokens.php30110644editdlrm
class-wp-user-query.php441660644editdlrm
class-wp-user-request.php23050644editdlrm
class-wp-user.php230440644editdlrm
class-wp-walker.php133220644editdlrm
class-wp-widget-factory.php33470644editdlrm
class-wp-widget.php184290644editdlrm
class-wp-xmlrpc-server.php2154470644editdlrm
class-wp.php264810644editdlrm
class-wpdb.php1186270644editdlrm
class.wp-dependencies.php3730644editdlrm
class.wp-scripts.php3430644editdlrm
class.wp-styles.php3380644editdlrm
comment-template.php1031450644editdlrm
comment.php1340690644editdlrm
compat-utf8.php195540644editdlrm
compat.php178300644editdlrm
cron.php429880644editdlrm
date.php4000644editdlrm
default-constants.php113650644editdlrm
default-filters.php379100644editdlrm
default-widgets.php22950644editdlrm
deprecated.php1926440644editdlrm
embed-template.php3380644editdlrm
embed.php389110644editdlrm
error-protection.php41210644editdlrm
feed-atom-comments.php55040644editdlrm
feed-atom.php31210644editdlrm
feed-rdf.php26680644editdlrm
feed-rss.php11890644editdlrm
feed-rss2-comments.php41360644editdlrm
feed-rss2.php37990644editdlrm
feed.php251890644editdlrm
fonts.php97900644editdlrm
formatting.php3547410644editdlrm
functions.php2886000644editdlrm
functions.wp-scripts.php153110644editdlrm
functions.wp-styles.php86410644editdlrm
general-template.php1730040644editdlrm
global-styles-and-settings.php212040644editdlrm
http.php276500644editdlrm
https-detection.php58570644editdlrm
https-migration.php47410644editdlrm
kses.php838490644editdlrm
l10n.php687970644editdlrm
link-template.php1601170644editdlrm
load.php565100644editdlrm
locale.php1620644editdlrm
media-template.php631970644editdlrm
media.php2212470644editdlrm
meta.php665560644editdlrm
ms-blogs.php258450644editdlrm
ms-default-constants.php49210644editdlrm
ms-default-filters.php66360644editdlrm
ms-deprecated.php217590644editdlrm
ms-files.php28570644editdlrm
ms-functions.php918420644editdlrm
ms-load.php198870644editdlrm
ms-network.php37820644editdlrm
ms-settings.php42040644editdlrm
ms-site.php417170644editdlrm
nav-menu-template.php259900644editdlrm
nav-menu.php443470644editdlrm
option.php1050350644editdlrm
pluggable-deprecated.php63240644editdlrm
pluggable.php1274570644editdlrm
plugin.php365010644editdlrm
post-formats.php71020644editdlrm
post-template.php686480644editdlrm
post-thumbnail-template.php108790644editdlrm
post.php2960720644editdlrm
query.php370950644editdlrm
registration-functions.php2000644editdlrm
registration.php2000644editdlrm
rest-api.php1009840644editdlrm
revision.php307410644editdlrm
rewrite.php194900644editdlrm
robots-template.php51850644editdlrm
rss-functions.php2550644editdlrm
rss.php232030644editdlrm
script-loader.php1583440644editdlrm
script-modules.php99110644editdlrm
session.php2580644editdlrm
shortcodes.php240500644editdlrm
sitemaps.php32380644editdlrm
speculative-loading.php86000644editdlrm
spl-autoload-compat.php4410644editdlrm
style-engine.php75630644editdlrm
taxonomy.php1770580644editdlrm
template-canvas.php5440644editdlrm
template-loader.php42670644editdlrm
template.php368340644editdlrm
theme-i18n.json17300644editdlrm
theme-previews.php29100644editdlrm
theme-templates.php62380644editdlrm
theme.json89210644editdlrm
theme.php1350080644editdlrm
update.php383530644editdlrm
user.php1787100644editdlrm
utf8.php72600644editdlrm
vars.php65620644editdlrm
version.php11060644editdlrm
widgets.php711290644editdlrm
wp-db.php4450644editdlrm
wp-diff.php7990644editdlrm
Edit: /var/www/vhosts/ihelp.ro/ajutam.ro/wp-includes/class-wp-application-passwords.php (17099B)
400 ) ); } $new_password = wp_generate_password( static::PW_LENGTH, false ); $hashed_password = self::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 * @since 6.8.0 The hashed password value now uses wp_fast_hash() instead of phpass. * * @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 generated application password in plain text. * @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 application 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. * * @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_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 * @since 6.8.0 The actual password should now be hashed using wp_fast_hash(). * * @param int $user_id User ID. * @param string $uuid The password's UUID. * @param array $update { * Information about the application password to update. * * @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. * } * @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 * @since 6.8.0 The password is now hashed using wp_fast_hash() instead of phpass. * Existing passwords may still be hashed using phpass. * * @param int $user_id The user ID. * @param array $item { * The updated application password details. * * @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. * } * @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 { * The list of application 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. * } * } * @return int|bool User meta ID if the key didn't exist (ie. this is the first time that an application password * has been saved for the user), true on successful update, false on failure or if the value passed * is the same as the one that is already in the database. */ 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( #[\SensitiveParameter] $raw_password ) { $raw_password = preg_replace( '/[^a-z\d]/i', '', $raw_password ); return trim( chunk_split( $raw_password, 4, ' ' ) ); } /** * Hashes a plaintext application password. * * @since 6.8.0 * * @param string $password Plaintext password. * @return string Hashed password. */ public static function hash_password( #[\SensitiveParameter] string $password ): string { return wp_fast_hash( $password ); } /** * Checks a plaintext application password against a hashed password. * * @since 6.8.0 * * @param string $password Plaintext password. * @param string $hash Hash of the password to check against. * @return bool Whether the password matches the hashed password. */ public static function check_password( #[\SensitiveParameter] string $password, string $hash ): bool { if ( ! str_starts_with( $hash, '$generic$' ) ) { /* * If the hash doesn't start with `$generic$`, it is a hash created with `wp_hash_password()`. * This is the case for application passwords created before 6.8.0. */ return wp_check_password( $password, $hash ); } return wp_verify_fast_hash( $password, $hash ); } }