| @@ -11,8 +11,9 @@ | ||
| 11 | 11 | use WP_Defender\Traits\IP; |
| 12 | 12 | use Calotes\Component\Request; |
| 13 | 13 | use Calotes\Component\Response; |
| 14 | 14 | use WP_Defender\Traits\Setting; |
| 15 | +use WP_Defender\Model\Lockout_Log; | |
| 15 | 16 | use WP_Defender\Component\Blacklist_Lockout; |
| 16 | 17 | use WP_Defender\Component\Config\Config_Hub_Helper; |
| 17 | 18 | use WP_Defender\Model\Setting\Login_Lockout as Model_Login_Lockout; |
| 18 | 19 | |
| @@ -117,9 +118,8 @@ | ||
| 117 | 118 | public function enqueue_assets() { |
| 118 | 119 | if ( ! $this->is_page_active() ) { |
| 119 | 120 | return; |
| 120 | 121 | } |
| 121 | - wp_localize_script( 'def-iplockout', 'login_lockout', $this->data_frontend() ); | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
| 125 | 125 | * Provides data for the frontend. |
| @@ -130,10 +130,11 @@ | ||
| 130 | 130 | return array_merge( |
| 131 | 131 | array( |
| 132 | 132 | 'model' => $this->model->export(), |
| 133 | 133 | 'misc' => array( |
| 134 | - 'host' => defender_get_hostname(), | |
| 135 | - 'module_name' => Model_Login_Lockout::get_module_name(), | |
| 134 | + 'host' => defender_get_hostname(), | |
| 135 | + 'module_name' => Model_Login_Lockout::get_module_name(), | |
| 136 | + 'lockouts_24h' => (int) Lockout_Log::count( strtotime( '-24 hours' ), time(), Lockout_Log::AUTH_LOCK ), | |
| 136 | 137 | ), |
| 137 | 138 | ), |
| 138 | 139 | $this->dump_routes_and_nonces() |
| 139 | 140 | ); |