| @@ -49,9 +49,8 @@ | ||
| 49 | 49 | $this->model = wd_di()->get( \WP_Defender\Model\Setting\Password_Protection::class ); |
| 50 | 50 | $this->service = wd_di()->get( \WP_Defender\Component\Password_Protection::class ); |
| 51 | 51 | $default_values = $this->model->get_default_values(); |
| 52 | 52 | $this->default_msg = $default_values['message']; |
| 53 | - add_filter( 'wp_defender_advanced_tools_data', array( $this, 'script_data' ) ); | |
| 54 | 53 | $this->register_routes(); |
| 55 | 54 | if ( $this->model->is_active() ) { |
| 56 | 55 | // Update site url on sub-site when MaskLogin is disabled. |
| 57 | 56 | if ( |
| @@ -213,21 +212,8 @@ | ||
| 213 | 212 | return new \WP_Defender\Model\Setting\Password_Protection(); |
| 214 | 213 | } |
| 215 | 214 | |
| 216 | 215 | /** |
| 217 | - * Provide data to the frontend via localized script. | |
| 218 | - * | |
| 219 | - * @param array $data Data collection is ready to passed. | |
| 220 | - * | |
| 221 | - * @return array Modified data array with added this controller data. | |
| 222 | - */ | |
| 223 | - public function script_data( array $data ): array { | |
| 224 | - $data['password_protection'] = $this->data_frontend(); | |
| 225 | - | |
| 226 | - return $data; | |
| 227 | - } | |
| 228 | - | |
| 229 | - /** | |
| 230 | 216 | * Save settings. |
| 231 | 217 | * |
| 232 | 218 | * @param Request $request The request object containing new settings data. |
| 233 | 219 | * |
| @@ -390,16 +376,15 @@ | ||
| 390 | 376 | ); |
| 391 | 377 | } |
| 392 | 378 | |
| 393 | 379 | /** |
| 394 | - * Generates configuration strings based on the provided configuration and whether the product is a pro version. | |
| 380 | + * Generates configuration strings based on the provided configuration. | |
| 395 | 381 | * |
| 396 | 382 | * @param mixed $config The configuration data. |
| 397 | - * @param bool $is_pro Indicates if the product is a pro version. | |
| 398 | 383 | * |
| 399 | 384 | * @return array Returns an array of configuration strings. |
| 400 | 385 | */ |
| 401 | - public function config_strings( $config, bool $is_pro ): array { | |
| 386 | + public function config_strings( $config ): array { | |
| 402 | 387 | $is_enabled = isset( $config['enabled'] ) ? (bool) $config['enabled'] : false; |
| 403 | 388 | if ( |
| 404 | 389 | ! $is_enabled || |
| 405 | 390 | ! isset( $config['user_roles'] ) || |