| @@ -40,9 +40,8 @@ | ||
| 40 | 40 | |
| 41 | 41 | /** PHPCS:disable Generic.CodeAnalysis.UnusedFunctionParameter.Found */ |
| 42 | 42 | public function get_settings( \WP_REST_Request $request ): \WP_REST_Response { |
| 43 | 43 | global $wp_version; |
| 44 | - $plugin_settings = $this->plugin_settings->get_plugin_settings(); | |
| 45 | 44 | |
| 46 | 45 | $data = array( |
| 47 | 46 | 'newest_wp_version' => $this->get_latest_wordpress_version(), |
| 48 | 47 | 'current_wp_version' => $wp_version, |
| @@ -48,20 +47,19 @@ | ||
| 48 | 47 | 'current_wp_version' => $wp_version, |
| 49 | 48 | 'php_version' => phpversion(), |
| 50 | 49 | 'newest_php_version' => '8.2', // Will be refactored. |
| 51 | 50 | 'is_eligible_www_redirect' => $this->is_eligible_www_redirect(), |
| 52 | - 'optin_mcp' => $plugin_settings->get_optin_mcp(), | |
| 53 | 51 | ); |
| 54 | 52 | |
| 55 | 53 | $hostinger_plugin_settings = get_option( HOSTINGER_PLUGIN_SETTINGS_OPTION, array() ); |
| 56 | 54 | |
| 57 | - if ( empty( $plugin_settings->get_bypass_code() ) ) { | |
| 55 | + if ( empty( $this->plugin_settings->get_plugin_settings()->get_bypass_code() ) ) { | |
| 58 | 56 | if ( empty( $hostinger_plugin_settings['bypass_code'] ) ) { |
| 59 | 57 | $hostinger_plugin_settings['bypass_code'] = Helper::generate_bypass_code( 16 ); |
| 60 | 58 | } |
| 61 | 59 | } |
| 62 | 60 | |
| 63 | - $plugin_settings = $plugin_settings->to_array(); | |
| 61 | + $plugin_settings = $this->plugin_settings->get_plugin_settings()->to_array(); | |
| 64 | 62 | |
| 65 | 63 | $response = array( |
| 66 | 64 | 'data' => array_merge( $data, $plugin_settings ), |
| 67 | 65 | ); |
| @@ -139,10 +137,8 @@ | ||
| 139 | 137 | |
| 140 | 138 | if ( has_action( 'litespeed_purge_all' ) ) { |
| 141 | 139 | do_action( 'litespeed_purge_all' ); |
| 142 | 140 | } |
| 143 | - | |
| 144 | - do_action( 'hostinger_tools_settings_saved', $new_settings ); | |
| 145 | 141 | |
| 146 | 142 | return $response; |
| 147 | 143 | } |
| 148 | 144 | /** PHPCS:enable */ |