PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 5.3.1
Defender Security – Malware Scanner, Login Security & Firewall v5.3.1
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / src / routes.php

routes.php in Defender Security – Malware Scanner, Login Security & Firewall 5.3.1, at src/routes.php

165 lines 5.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * This file contains the routes for the plugin.
4 *
5 * @package WP_Defender
6 */
7
8 use Calotes\Helper\Route;
9 use Calotes\Helper\Array_Cache;
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 die;
13 }
14
15 /**
16 * Initializes the routes for the plugin.
17 *
18 * @return void
19 */
20 function defender_init_routes() {
21 $routes = array(
22 'mask_login' => array(
23 'update_settings' => 'save_settings',
24 'get_posts' => 'get_posts',
25 ),
26 'security_headers' => array(
27 'update_settings' => 'save_settings',
28 ),
29 'two_fa' => array(
30 'update_settings' => 'save_settings',
31 'send_test_email' => 'send_test_email',
32 'verify_otp_for_enabling' => 'verify_otp_for_enabling',
33 'disable_totp' => 'disable_totp',
34 'send_backup_code' => array( 'send_backup_code', true ),
35 'generate_backup_codes' => 'generate_backup_codes',
36 ),
37 'security_tweaks' => array(
38 'process' => 'process',
39 'ignore' => 'ignore',
40 'revert' => 'revert',
41 'restore' => 'restore',
42 'recheck' => 'recheck',
43 'bulk_action' => 'bulk_action',
44 'update_security_reminder' => 'update_security_reminder',
45 'update_autogenerate_flag' => 'update_autogenerate_flag',
46 'update_enabled_user_enums' => 'update_enabled_user_enums',
47 'handle_notice' => 'handle_notice',
48 'refuse_notice' => 'refuse_notice',
49 'check_xml_rpc' => 'check_xml_rpc',
50 ),
51 'ip_lockout' => array(
52 'update_settings' => 'save_settings',
53 'download_geo_db' => 'download_geo_db',
54 'import_ips' => 'import_ips',
55 'get_listed_ips' => 'get_listed_ips',
56 'query_locked_ips' => 'query_locked_ips',
57 'ip_action' => 'ip_action',
58 'export_ips' => 'export_ips',
59 'empty_logs' => 'empty_logs',
60 'dashboard_activation' => 'dashboard_activation',
61 'import_ua' => 'import_ua',
62 'export_ua' => 'export_ua',
63 'empty_lockouts' => 'empty_lockouts',
64 'verify_blocked_user' => array( 'verify_blocked_user', true ),
65 'send_again' => array( 'send_again', true ),
66 'agf_unlock_user' => array( 'agf_unlock_user', true ),
67 ),
68 'global_ip_lockout' => array(
69 'refresh_global_ip_list' => 'refresh_global_ip_list',
70 'redirect_hub_connection' => 'redirect_hub_connection',
71 ),
72 'scan' => array(
73 'start' => 'start',
74 'cancel' => 'cancel',
75 'process' => array( 'process', true ),
76 'status' => 'status',
77 'item_action' => 'item_action',
78 'update_settings' => 'save_settings',
79 'bulk_action' => 'bulk_action',
80 'handle_notice' => 'handle_notice',
81 'postpone_notice' => 'postpone_notice',
82 'refuse_notice' => 'refuse_notice',
83 ),
84 'audit' => array(
85 'update_settings' => 'save_settings',
86 'pull_logs' => 'pull_logs',
87 'summary' => 'summary',
88 'export_as_csv' => 'export_as_csv',
89 ),
90 'notification' => array(
91 'get_users' => 'get_users',
92 'save_notification' => 'save_notification',
93 'unscubscribe' => 'unsubscribe',
94 'subscribe' => 'subscribe',
95 'save_frequency' => 'save_frequency',
96 'save_subscriber' => 'save_subscriber',
97 'save_configs' => 'save_configs',
98 'save_bulk_configs' => 'save_bulk_configs',
99 'bulk_deactivate' => 'bulk_deactivate',
100 'validate_email' => 'validate_email',
101 ),
102 'dashboard' => array(
103 'hide_new_features' => 'hide_new_features',
104 'activate_global_ip' => 'activate_global_ip',
105 'remove_global_ip_notice_reminder' => 'remove_global_ip_notice_reminder',
106 'activate_session_protection' => 'activate_session_protection',
107 ),
108 'settings' => array(
109 'update_settings' => 'save_settings',
110 'reset_settings' => 'reset_settings',
111 ),
112 'waf' => array(
113 'recheck' => 'recheck',
114 ),
115 'onboard' => array(
116 'activating' => 'activating',
117 'skip' => 'skip',
118 'antibot_reminder' => 'antibot_reminder',
119 ),
120 'tutorial' => array(
121 'hide' => 'hide',
122 ),
123 'blocklist_monitor' => array(
124 'blacklist_status' => 'blacklist_status',
125 'toggle_blacklist_status' => 'toggle_blacklist_status',
126 ),
127 'tracking' => array(
128 'close_track_modal' => 'close_track_modal',
129 'save_track_modal' => 'save_track_modal',
130 ),
131 'hub_connector' => array(
132 'activate_dashboard_plugin' => 'activate_dashboard_plugin',
133 ),
134 );
135
136 if ( class_exists( 'WP_Defender\Controller\Quarantine' ) ) {
137 $routes['quarantine'] = array(
138 'restore_file' => 'restore_file',
139 'quarantine_collection' => 'quarantine_collection',
140 'delete_file' => 'delete_file',
141 );
142 }
143
144 foreach ( $routes as $module => $info ) {
145 foreach ( $info as $name => $func ) {
146 $nopriv = false;
147 if ( is_array( $func ) ) {
148 [ $func, $nopriv ] = $func;
149 }
150 Route::register_route(
151 $name,
152 $module,
153 $name,
154 array(
155 Array_Cache::get( $module ),
156 $func,
157 ),
158 $nopriv
159 );
160 }
161 }
162 }
163
164 defender_init_routes();
165