PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.0.1
Defender Security – Malware Scanner, Login Security & Firewall v6.0.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 6.0.1, at src/routes.php

154 lines 4.9 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 'check_xml_rpc' => 'check_xml_rpc',
48 ),
49 'ip_lockout' => array(
50 'update_settings' => 'save_settings',
51 'download_geo_db' => 'download_geo_db',
52 'import_ips' => 'import_ips',
53 'get_listed_ips' => 'get_listed_ips',
54 'query_locked_ips' => 'query_locked_ips',
55 'ip_action' => 'ip_action',
56 'export_ips' => 'export_ips',
57 'empty_logs' => 'empty_logs',
58 'toggle_lockout_modules' => 'toggle_lockout_modules',
59 'import_ua' => 'import_ua',
60 'export_ua' => 'export_ua',
61 'empty_lockouts' => 'empty_lockouts',
62 'verify_blocked_user' => array( 'verify_blocked_user', true ),
63 'send_again' => array( 'send_again', true ),
64 'agf_unlock_user' => array( 'agf_unlock_user', true ),
65 ),
66 'global_ip_lockout' => array(
67 'refresh_global_ip_list' => 'refresh_global_ip_list',
68 'redirect_hub_connection' => 'redirect_hub_connection',
69 ),
70 'scan' => array(
71 'start' => 'start',
72 'cancel' => 'cancel',
73 'process' => array( 'process', true ),
74 'status' => 'status',
75 'item_action' => 'item_action',
76 'update_settings' => 'save_settings',
77 'bulk_action' => 'bulk_action',
78 ),
79 'notification' => array(
80 'get_users' => 'get_users',
81 'save_notification' => 'save_notification',
82 'unscubscribe' => 'unsubscribe',
83 'subscribe' => 'subscribe',
84 'save_frequency' => 'save_frequency',
85 'save_subscriber' => 'save_subscriber',
86 'save_configs' => 'save_configs',
87 'save_bulk_configs' => 'save_bulk_configs',
88 'bulk_deactivate' => 'bulk_deactivate',
89 'validate_email' => 'validate_email',
90 ),
91 'dashboard' => array(
92 'hide_new_features' => 'hide_new_features',
93 'activate_global_ip' => 'activate_global_ip',
94 'remove_global_ip_notice_reminder' => 'remove_global_ip_notice_reminder',
95 'activate_session_protection' => 'activate_session_protection',
96 ),
97 'settings' => array(
98 'update_settings' => 'save_settings',
99 'reset_settings' => 'reset_settings',
100 ),
101 'onboard' => array(
102 'activating' => 'activating',
103 'skip' => 'skip',
104 'antibot_reminder' => 'antibot_reminder',
105 ),
106 'tracking' => array(
107 'close_track_modal' => 'close_track_modal',
108 'save_track_modal' => 'save_track_modal',
109 ),
110 'hub_connector' => array(
111 'activate_dashboard_plugin' => 'activate_dashboard_plugin',
112 ),
113 'rate' => array(
114 'postpone_notice' => 'postpone_notice',
115 'refuse_notice' => 'refuse_notice',
116 'handle_notice' => 'handle_notice',
117 ),
118 'blocklist_monitor' => array(
119 'blacklist_status' => 'blacklist_status',
120 'toggle_blacklist_status' => 'toggle_blacklist_status',
121 ),
122 'activity_log' => array(
123 'add_notification' => 'add_notification',
124 'fetch_notifications' => 'fetch_notifications',
125 ),
126 'quarantine' => array(
127 'restore_file' => 'restore_file',
128 'quarantine_collection' => 'quarantine_collection',
129 'delete_file' => 'delete_file',
130 ),
131 );
132 foreach ( $routes as $module => $info ) {
133 $controller = Array_Cache::get( $module );
134 if ( null === $controller ) {
135 continue;
136 }
137 foreach ( $info as $name => $func ) {
138 $nopriv = false;
139 if ( is_array( $func ) ) {
140 [ $func, $nopriv ] = $func;
141 }
142 Route::register_route(
143 $name,
144 $module,
145 $name,
146 array( $controller, $func ),
147 $nopriv
148 );
149 }
150 }
151 }
152
153 defender_init_routes();
154