Linux web205 5.14.0-446.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 3 16:10:18 UTC 2024 x86_64
Apache
Server IP : 86.110.243.205 & Your IP : 3.133.133.110
Domains :
Cant Read [ /etc/named.conf ]
User : jp029900
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Lock Shell
Lock File++
Readme
/
home /
jp029900 /
www_root /
wp-includes /
Delete
Unzip
Name
Size
Permission
Date
Action
ID3
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
IXR
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
PHPMailer
[ DIR ]
drwxr-xr-x
2021-01-03 21:11
Requests
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
SimplePie
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
Text
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
assets
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
block-patterns
[ DIR ]
drwxr-xr-x
2021-01-03 21:11
block-supports
[ DIR ]
drwxr-xr-x
2021-01-03 21:11
blocks
[ DIR ]
drwxr-xr-x
2021-07-19 13:45
certificates
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
css
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
customize
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
fonts
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
images
[ DIR ]
drwxr-xr-x
2020-06-23 06:14
js
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
pomo
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
random_compat
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
rest-api
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
sitemaps
[ DIR ]
drwxr-xr-x
2021-01-03 21:11
sodium_compat
[ DIR ]
drwxr-xr-x
2021-01-03 21:11
theme-compat
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
widgets
[ DIR ]
drwxr-xr-x
2020-06-22 14:07
admin-bar.php
32.6
KB
-rw-r--r--
2023-06-10 09:07
atomlib.php
11.67
KB
-rwxr-xr-x
2021-01-03 21:11
author-template.php
16.62
KB
-rwxr-xr-x
2021-07-19 13:45
block-patterns.php
1.42
KB
-rwxr-xr-x
2021-01-03 21:11
blocks.php
28.44
KB
-rwxr-xr-x
2023-05-17 05:50
bookmark-template.php
12.42
KB
-rwxr-xr-x
2021-07-19 13:45
bookmark.php
14.79
KB
-rwxr-xr-x
2022-08-31 02:18
cache-compat.php
1.02
KB
-rwxr-xr-x
2021-01-03 21:11
cache.php
9.29
KB
-rwxr-xr-x
2021-07-19 13:45
canonical.php
32.31
KB
-rwxr-xr-x
2021-07-19 13:45
capabilities.php
34.94
KB
-rwxr-xr-x
2021-07-19 13:45
category-template.php
54.26
KB
-rwxr-xr-x
2021-07-19 13:45
category.php
12.41
KB
-rwxr-xr-x
2021-01-03 21:11
class-IXR.php
2.48
KB
-rwxr-xr-x
2020-06-22 14:07
class-feed.php
529
B
-rwxr-xr-x
2020-06-22 14:07
class-http.php
38.78
KB
-rwxr-xr-x
2021-07-19 13:45
class-json.php
42.42
KB
-rwxr-xr-x
2021-01-03 21:11
class-oembed.php
407
B
-rwxr-xr-x
2020-06-22 14:07
class-phpass.php
7.15
KB
-rwxr-xr-x
2020-06-22 14:07
class-phpmailer.php
664
B
-rwxr-xr-x
2021-01-03 21:11
class-pop3.php
20.35
KB
-rwxr-xr-x
2021-01-03 21:11
class-requests.php
29.14
KB
-rwxr-xr-x
2021-01-03 21:11
class-simplepie.php
94.01
KB
-rwxr-xr-x
2021-01-03 21:11
class-smtp.php
457
B
-rwxr-xr-x
2021-07-19 13:45
class-snoopy.php
36.83
KB
-rwxr-xr-x
2021-01-03 21:11
class-walker-category-dropdown.php
2.08
KB
-rwxr-xr-x
2021-01-03 21:11
class-walker-category.php
7.71
KB
-rwxr-xr-x
2021-01-03 21:11
class-walker-comment.php
13.41
KB
-rwxr-xr-x
2021-01-03 21:11
class-walker-nav-menu.php
8.44
KB
-rwxr-xr-x
2021-01-03 21:11
class-walker-page-dropdown.php
2.25
KB
-rwxr-xr-x
2020-06-22 14:07
class-walker-page.php
6.88
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-admin-bar.php
16.59
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-ajax-response.php
5.12
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-application-passwords.php
10.38
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-block-list.php
4.37
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-block-parser.php
14.86
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-block-pattern-categories-registry.php
4.11
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-block-patterns-registry.php
4.4
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-block-styles-registry.php
4.61
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-block-supports.php
5.15
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-block-type-registry.php
4.58
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-block-type.php
8.41
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-block.php
6.61
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-comment-query.php
44.42
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-comment.php
9.1
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-customize-control.php
24.93
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-customize-manager.php
196.48
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-customize-nav-menus.php
55.44
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-customize-panel.php
10.16
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-customize-section.php
10.72
KB
-rwxr-xr-x
2020-06-22 14:07
class-wp-customize-setting.php
29.07
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-customize-widgets.php
65.44
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-date-query.php
34.47
KB
-rwxr-xr-x
2022-10-18 07:22
class-wp-dependency.php
2.45
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-editor.php
68.9
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-embed.php
15.42
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-error.php
7.13
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-fatal-error-handler.php
7.36
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-feed-cache-transient.php
2.5
KB
-rwxr-xr-x
2020-06-22 14:07
class-wp-feed-cache.php
970
B
-rwxr-xr-x
2021-01-03 21:11
class-wp-hook.php
14.74
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-http-cookie.php
7.02
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-http-curl.php
12.06
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-http-encoding.php
6.5
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-http-ixr-client.php
3.39
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-http-proxy.php
5.73
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-http-requests-hooks.php
1.93
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-http-requests-response.php
4.24
KB
-rwxr-xr-x
2020-06-22 14:07
class-wp-http-response.php
2.88
KB
-rwxr-xr-x
2020-06-22 14:07
class-wp-http-streams.php
15.74
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-image-editor-gd.php
14.28
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-image-editor-imagick.php
25.86
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-image-editor.php
13.84
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-list-util.php
6.46
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-locale-switcher.php
4.9
KB
-rwxr-xr-x
2020-06-22 14:07
class-wp-locale.php
13.65
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-matchesmapregex.php
1.76
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-meta-query.php
27.22
KB
-rwxr-xr-x
2022-01-07 02:00
class-wp-metadata-lazyloader.php
5.23
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-network-query.php
18.72
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-network.php
12.09
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-object-cache.php
13.23
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-oembed-controller.php
6.63
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-oembed.php
29.61
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-paused-extensions-storage.php
4.81
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-post-type.php
20.33
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-post.php
6.27
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-query.php
132.78
KB
-rwxr-xr-x
2022-10-18 07:22
class-wp-recovery-mode-cookie-service.php
6.31
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-recovery-mode-email-service.php
10.41
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-recovery-mode-key-service.php
4.17
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-recovery-mode-link-service.php
3.32
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-recovery-mode.php
11.11
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-rewrite.php
61.37
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-role.php
2.44
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-roles.php
8.23
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-session-tokens.php
7.25
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-simplepie-file.php
3.18
KB
-rwxr-xr-x
2021-02-04 02:45
class-wp-simplepie-sanitize-kses.php
1.73
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-site-query.php
28.62
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-site.php
7.25
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-tax-query.php
18.98
KB
-rwxr-xr-x
2022-01-07 02:00
class-wp-taxonomy.php
13.03
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-term-query.php
36.39
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-term.php
5.15
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-text-diff-renderer-inline.php
716
B
-rwxr-xr-x
2020-06-22 14:07
class-wp-text-diff-renderer-table.php
16.4
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-theme.php
49.57
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-user-meta-session-tokens.php
2.92
KB
-rwxr-xr-x
2020-06-22 14:07
class-wp-user-query.php
30.6
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-user-request.php
2.14
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-user.php
21.62
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-walker.php
12.42
KB
-rwxr-xr-x
2021-01-03 21:11
class-wp-widget-factory.php
2.56
KB
-rwxr-xr-x
2020-06-22 14:07
class-wp-widget.php
17.48
KB
-rwxr-xr-x
2021-07-19 13:45
class-wp-xmlrpc-server.php
207.93
KB
-rwxr-xr-x
2021-09-09 04:42
class-wp.php
24.5
KB
-rwxr-xr-x
2021-07-19 13:45
class.wp-dependencies.php
12.57
KB
-rwxr-xr-x
2021-01-03 21:11
class.wp-scripts.php
18.49
KB
-rwxr-xr-x
2021-07-19 13:45
class.wp-styles.php
10.62
KB
-rwxr-xr-x
2021-01-03 21:11
comment-template.php
92.55
KB
-rwxr-xr-x
2021-07-19 13:45
comment.php
123.24
KB
-rwxr-xr-x
2022-10-18 07:22
compat.php
11.46
KB
-rwxr-xr-x
2021-01-03 21:11
cron.php
39.69
KB
-rwxr-xr-x
2021-07-19 13:45
date.php
406
B
-rwxr-xr-x
2020-06-22 14:07
default-constants.php
10.02
KB
-rwxr-xr-x
2021-01-03 21:11
default-filters.php
27.66
KB
-rwxr-xr-x
2021-07-19 13:45
default-widgets.php
2.07
KB
-rwxr-xr-x
2020-06-22 14:07
deprecated.php
121.72
KB
-rwxr-xr-x
2022-10-18 07:22
embed-template.php
341
B
-rwxr-xr-x
2020-06-22 14:07
embed.php
47.01
KB
-rwxr-xr-x
2023-05-17 05:50
error-protection.php
4.02
KB
-rwxr-xr-x
2021-01-03 21:11
feed-atom-comments.php
5.32
KB
-rwxr-xr-x
2020-06-22 14:07
feed-atom.php
3.03
KB
-rwxr-xr-x
2020-06-22 14:07
feed-rdf.php
2.61
KB
-rwxr-xr-x
2020-06-22 14:07
feed-rss.php
1.16
KB
-rwxr-xr-x
2020-06-22 14:07
feed-rss2-comments.php
3.97
KB
-rwxr-xr-x
2021-01-03 21:11
feed-rss2.php
3.71
KB
-rwxr-xr-x
2020-06-22 14:07
feed.php
22.43
KB
-rwxr-xr-x
2021-01-03 21:11
formatting.php
304.18
KB
-rwxr-xr-x
2023-05-17 05:50
functions.php
235.52
KB
-rwxr-xr-x
2022-10-18 07:22
functions.wp-scripts.php
13.11
KB
-rwxr-xr-x
2021-07-19 13:45
functions.wp-styles.php
8.11
KB
-rwxr-xr-x
2021-01-03 21:11
general-template.php
153.32
KB
-rwxr-xr-x
2021-07-19 13:45
http.php
21.86
KB
-rwxr-xr-x
2021-01-03 21:11
https-detection.php
6.71
KB
-rwxr-xr-x
2021-07-19 13:45
https-migration.php
4.62
KB
-rwxr-xr-x
2021-07-19 13:45
kses.php
61.96
KB
-rwxr-xr-x
2021-07-19 13:45
l10n.php
55.42
KB
-rwxr-xr-x
2023-05-17 05:50
link-template.php
143.44
KB
-rwxr-xr-x
2021-07-19 13:45
load.php
48.12
KB
-rwxr-xr-x
2021-07-19 13:45
locale.php
162
B
-rwxr-xr-x
2020-06-22 14:07
media-template.php
59
KB
-rwxr-xr-x
2022-10-18 07:22
media.php
168.74
KB
-rwxr-xr-x
2023-05-17 05:50
meta.php
58.2
KB
-rwxr-xr-x
2021-07-19 13:45
momi.php
5.51
KB
-rw-r--r--
2024-02-19 18:18
ms-blogs.php
24.58
KB
-rwxr-xr-x
2021-01-03 21:11
ms-default-constants.php
4.6
KB
-rwxr-xr-x
2021-01-03 21:11
ms-default-filters.php
6.34
KB
-rwxr-xr-x
2021-01-03 21:11
ms-deprecated.php
20.63
KB
-rwxr-xr-x
2021-07-19 13:45
ms-files.php
2.58
KB
-rwxr-xr-x
2020-06-22 14:07
ms-functions.php
91.7
KB
-rwxr-xr-x
2021-07-19 13:45
ms-load.php
19.32
KB
-rwxr-xr-x
2021-01-03 21:11
ms-network.php
3.58
KB
-rwxr-xr-x
2021-01-03 21:11
ms-settings.php
4.03
KB
-rwxr-xr-x
2021-01-03 21:11
ms-site.php
42.49
KB
-rwxr-xr-x
2021-07-19 13:45
nav-menu-template.php
22.75
KB
-rwxr-xr-x
2021-07-19 13:45
nav-menu.php
41.11
KB
-rwxr-xr-x
2021-07-19 13:45
option.php
72.82
KB
-rwxr-xr-x
2021-07-19 13:45
pluggable-deprecated.php
6.12
KB
-rwxr-xr-x
2020-06-22 14:07
pluggable.php
101.12
KB
-rwxr-xr-x
2022-10-18 07:22
plugin.php
31.73
KB
-rwxr-xr-x
2021-07-19 13:45
post-formats.php
6.91
KB
-rwxr-xr-x
2021-07-19 13:45
post-template.php
63.27
KB
-rwxr-xr-x
2022-08-31 02:18
post-thumbnail-template.php
9.13
KB
-rwxr-xr-x
2021-07-19 13:45
post.php
253.48
KB
-rwxr-xr-x
2022-10-18 07:22
query.php
34.95
KB
-rwxr-xr-x
2021-07-19 13:45
registration-functions.php
200
B
-rwxr-xr-x
2021-01-03 21:11
registration.php
200
B
-rwxr-xr-x
2021-01-03 21:11
rest-api.php
90.78
KB
-rwxr-xr-x
2021-07-19 13:45
revision.php
21.51
KB
-rwxr-xr-x
2021-01-03 21:11
rewrite.php
18.76
KB
-rwxr-xr-x
2021-07-19 13:45
robots-template.php
5.05
KB
-rwxr-xr-x
2021-07-19 13:45
rss-functions.php
255
B
-rwxr-xr-x
2021-01-03 21:11
rss.php
22.44
KB
-rwxr-xr-x
2021-07-19 13:45
script-loader.php
95.91
KB
-rwxr-xr-x
2022-03-11 02:25
session.php
258
B
-rwxr-xr-x
2020-06-22 14:07
shortcodes.php
20.95
KB
-rwxr-xr-x
2021-07-19 13:45
sitemaps.php
3.16
KB
-rwxr-xr-x
2021-01-03 21:11
spl-autoload-compat.php
441
B
-rwxr-xr-x
2021-01-03 21:11
taxonomy.php
162
KB
-rwxr-xr-x
2021-07-19 13:45
template-loader.php
2.94
KB
-rwxr-xr-x
2021-01-03 21:11
template.php
21.02
KB
-rwxr-xr-x
2021-01-03 21:11
theme.php
122.14
KB
-rwxr-xr-x
2021-07-19 13:45
update.php
25.83
KB
-rwxr-xr-x
2021-07-19 13:45
user.php
144.05
KB
-rwxr-xr-x
2021-07-19 13:45
vars.php
5.68
KB
-rwxr-xr-x
2021-01-03 21:11
version.php
766
B
-rwxr-xr-x
2023-05-17 05:50
widgets.php
59.02
KB
-rwxr-xr-x
2022-10-18 07:22
wlwmanifest.xml
1.02
KB
-rwxr-xr-x
2020-06-22 14:07
wp-db.php
103.61
KB
-rwxr-xr-x
2021-07-19 13:45
wp-diff.php
647
B
-rwxr-xr-x
2020-06-22 14:07
Save
Rename
<?php /** * Error Protection API: WP_Recovery_Mode class * * @package WordPress * @since 5.2.0 */ /** * Core class used to implement Recovery Mode. * * @since 5.2.0 */ class WP_Recovery_Mode { const EXIT_ACTION = 'exit_recovery_mode'; /** * Service to handle cookies. * * @since 5.2.0 * @var WP_Recovery_Mode_Cookie_Service */ private $cookie_service; /** * Service to generate a recovery mode key. * * @since 5.2.0 * @var WP_Recovery_Mode_Key_Service */ private $key_service; /** * Service to generate and validate recovery mode links. * * @since 5.2.0 * @var WP_Recovery_Mode_Link_Service */ private $link_service; /** * Service to handle sending an email with a recovery mode link. * * @since 5.2.0 * @var WP_Recovery_Mode_Email_Service */ private $email_service; /** * Is recovery mode initialized. * * @since 5.2.0 * @var bool */ private $is_initialized = false; /** * Is recovery mode active in this session. * * @since 5.2.0 * @var bool */ private $is_active = false; /** * Get an ID representing the current recovery mode session. * * @since 5.2.0 * @var string */ private $session_id = ''; /** * WP_Recovery_Mode constructor. * * @since 5.2.0 */ public function __construct() { $this->cookie_service = new WP_Recovery_Mode_Cookie_Service(); $this->key_service = new WP_Recovery_Mode_Key_Service(); $this->link_service = new WP_Recovery_Mode_Link_Service( $this->cookie_service, $this->key_service ); $this->email_service = new WP_Recovery_Mode_Email_Service( $this->link_service ); } /** * Initialize recovery mode for the current request. * * @since 5.2.0 */ public function initialize() { $this->is_initialized = true; add_action( 'wp_logout', array( $this, 'exit_recovery_mode' ) ); add_action( 'login_form_' . self::EXIT_ACTION, array( $this, 'handle_exit_recovery_mode' ) ); add_action( 'recovery_mode_clean_expired_keys', array( $this, 'clean_expired_keys' ) ); if ( ! wp_next_scheduled( 'recovery_mode_clean_expired_keys' ) && ! wp_installing() ) { wp_schedule_event( time(), 'daily', 'recovery_mode_clean_expired_keys' ); } if ( defined( 'WP_RECOVERY_MODE_SESSION_ID' ) ) { $this->is_active = true; $this->session_id = WP_RECOVERY_MODE_SESSION_ID; return; } if ( $this->cookie_service->is_cookie_set() ) { $this->handle_cookie(); return; } $this->link_service->handle_begin_link( $this->get_link_ttl() ); } /** * Checks whether recovery mode is active. * * This will not change after recovery mode has been initialized. {@see WP_Recovery_Mode::run()}. * * @since 5.2.0 * * @return bool True if recovery mode is active, false otherwise. */ public function is_active() { return $this->is_active; } /** * Gets the recovery mode session ID. * * @since 5.2.0 * * @return string The session ID if recovery mode is active, empty string otherwise. */ public function get_session_id() { return $this->session_id; } /** * Checks whether recovery mode has been initialized. * * Recovery mode should not be used until this point. Initialization happens immediately before loading plugins. * * @since 5.2.0 * * @return bool */ public function is_initialized() { return $this->is_initialized; } /** * Handles a fatal error occurring. * * The calling API should immediately die() after calling this function. * * @since 5.2.0 * * @param array $error Error details from {@see error_get_last()} * @return true|WP_Error True if the error was handled and headers have already been sent. * Or the request will exit to try and catch multiple errors at once. * WP_Error if an error occurred preventing it from being handled. */ public function handle_error( array $error ) { $extension = $this->get_extension_for_error( $error ); if ( ! $extension || $this->is_network_plugin( $extension ) ) { return new WP_Error( 'invalid_source', __( 'Error not caused by a plugin or theme.' ) ); } if ( ! $this->is_active() ) { if ( ! is_protected_endpoint() ) { return new WP_Error( 'non_protected_endpoint', __( 'Error occurred on a non-protected endpoint.' ) ); } if ( ! function_exists( 'wp_generate_password' ) ) { require_once ABSPATH . WPINC . '/pluggable.php'; } return $this->email_service->maybe_send_recovery_mode_email( $this->get_email_rate_limit(), $error, $extension ); } if ( ! $this->store_error( $error ) ) { return new WP_Error( 'storage_error', __( 'Failed to store the error.' ) ); } if ( headers_sent() ) { return true; } $this->redirect_protected(); } /** * Ends the current recovery mode session. * * @since 5.2.0 * * @return bool True on success, false on failure. */ public function exit_recovery_mode() { if ( ! $this->is_active() ) { return false; } $this->email_service->clear_rate_limit(); $this->cookie_service->clear_cookie(); wp_paused_plugins()->delete_all(); wp_paused_themes()->delete_all(); return true; } /** * Handles a request to exit Recovery Mode. * * @since 5.2.0 */ public function handle_exit_recovery_mode() { $redirect_to = wp_get_referer(); // Safety check in case referrer returns false. if ( ! $redirect_to ) { $redirect_to = is_user_logged_in() ? admin_url() : home_url(); } if ( ! $this->is_active() ) { wp_safe_redirect( $redirect_to ); die; } if ( ! isset( $_GET['action'] ) || self::EXIT_ACTION !== $_GET['action'] ) { return; } if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], self::EXIT_ACTION ) ) { wp_die( __( 'Exit recovery mode link expired.' ), 403 ); } if ( ! $this->exit_recovery_mode() ) { wp_die( __( 'Failed to exit recovery mode. Please try again later.' ) ); } wp_safe_redirect( $redirect_to ); die; } /** * Cleans any recovery mode keys that have expired according to the link TTL. * * Executes on a daily cron schedule. * * @since 5.2.0 */ public function clean_expired_keys() { $this->key_service->clean_expired_keys( $this->get_link_ttl() ); } /** * Handles checking for the recovery mode cookie and validating it. * * @since 5.2.0 */ protected function handle_cookie() { $validated = $this->cookie_service->validate_cookie(); if ( is_wp_error( $validated ) ) { $this->cookie_service->clear_cookie(); $validated->add_data( array( 'status' => 403 ) ); wp_die( $validated ); } $session_id = $this->cookie_service->get_session_id_from_cookie(); if ( is_wp_error( $session_id ) ) { $this->cookie_service->clear_cookie(); $session_id->add_data( array( 'status' => 403 ) ); wp_die( $session_id ); } $this->is_active = true; $this->session_id = $session_id; } /** * Gets the rate limit between sending new recovery mode email links. * * @since 5.2.0 * * @return int Rate limit in seconds. */ protected function get_email_rate_limit() { /** * Filters the rate limit between sending new recovery mode email links. * * @since 5.2.0 * * @param int $rate_limit Time to wait in seconds. Defaults to 1 day. */ return apply_filters( 'recovery_mode_email_rate_limit', DAY_IN_SECONDS ); } /** * Gets the number of seconds the recovery mode link is valid for. * * @since 5.2.0 * * @return int Interval in seconds. */ protected function get_link_ttl() { $rate_limit = $this->get_email_rate_limit(); $valid_for = $rate_limit; /** * Filters the amount of time the recovery mode email link is valid for. * * The ttl must be at least as long as the email rate limit. * * @since 5.2.0 * * @param int $valid_for The number of seconds the link is valid for. */ $valid_for = apply_filters( 'recovery_mode_email_link_ttl', $valid_for ); return max( $valid_for, $rate_limit ); } /** * Gets the extension that the error occurred in. * * @since 5.2.0 * * @global array $wp_theme_directories * * @param array $error Error that was triggered. * @return array|false { * Extension details. * * @type string $slug The extension slug. This is the plugin or theme's directory. * @type string $type The extension type. Either 'plugin' or 'theme'. * } */ protected function get_extension_for_error( $error ) { global $wp_theme_directories; if ( ! isset( $error['file'] ) ) { return false; } if ( ! defined( 'WP_PLUGIN_DIR' ) ) { return false; } $error_file = wp_normalize_path( $error['file'] ); $wp_plugin_dir = wp_normalize_path( WP_PLUGIN_DIR ); if ( 0 === strpos( $error_file, $wp_plugin_dir ) ) { $path = str_replace( $wp_plugin_dir . '/', '', $error_file ); $parts = explode( '/', $path ); return array( 'type' => 'plugin', 'slug' => $parts[0], ); } if ( empty( $wp_theme_directories ) ) { return false; } foreach ( $wp_theme_directories as $theme_directory ) { $theme_directory = wp_normalize_path( $theme_directory ); if ( 0 === strpos( $error_file, $theme_directory ) ) { $path = str_replace( $theme_directory . '/', '', $error_file ); $parts = explode( '/', $path ); return array( 'type' => 'theme', 'slug' => $parts[0], ); } } return false; } /** * Checks whether the given extension a network activated plugin. * * @since 5.2.0 * * @param array $extension Extension data. * @return bool True if network plugin, false otherwise. */ protected function is_network_plugin( $extension ) { if ( 'plugin' !== $extension['type'] ) { return false; } if ( ! is_multisite() ) { return false; } $network_plugins = wp_get_active_network_plugins(); foreach ( $network_plugins as $plugin ) { if ( 0 === strpos( $plugin, $extension['slug'] . '/' ) ) { return true; } } return false; } /** * Stores the given error so that the extension causing it is paused. * * @since 5.2.0 * * @param array $error Error that was triggered. * @return bool True if the error was stored successfully, false otherwise. */ protected function store_error( $error ) { $extension = $this->get_extension_for_error( $error ); if ( ! $extension ) { return false; } switch ( $extension['type'] ) { case 'plugin': return wp_paused_plugins()->set( $extension['slug'], $error ); case 'theme': return wp_paused_themes()->set( $extension['slug'], $error ); default: return false; } } /** * Redirects the current request to allow recovering multiple errors in one go. * * The redirection will only happen when on a protected endpoint. * * It must be ensured that this method is only called when an error actually occurred and will not occur on the * next request again. Otherwise it will create a redirect loop. * * @since 5.2.0 */ protected function redirect_protected() { // Pluggable is usually loaded after plugins, so we manually include it here for redirection functionality. if ( ! function_exists( 'wp_safe_redirect' ) ) { require_once ABSPATH . WPINC . '/pluggable.php'; } $scheme = is_ssl() ? 'https://' : 'http://'; $url = "{$scheme}{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; wp_safe_redirect( $url ); exit; } }