| @@ -25,10 +25,19 @@ | ||
| 25 | 25 | /** |
| 26 | 26 | * TrustedLogin init. |
| 27 | 27 | */ |
| 28 | 28 | public function init() { |
| 29 | - $this->hooks(); | |
| 29 | + add_action( 'admin_menu', [ $this, 'admin_menu' ] ); | |
| 30 | + add_action( 'init', [ $this, 'initiate_trustedlogin' ] ); | |
| 31 | + } | |
| 30 | 32 | |
| 33 | + /** | |
| 34 | + * Hooks. | |
| 35 | + * | |
| 36 | + * @return void | |
| 37 | + */ | |
| 38 | + public function initiate_trustedlogin() { | |
| 39 | + | |
| 31 | 40 | $config = [ |
| 32 | 41 | 'auth' => [ |
| 33 | 42 | 'api_key' => 'f97f5be6e02d1565', |
| 34 | 43 | 'license_key' => $this->container->get( 'license' )->get_license_key(), |
| @@ -82,16 +91,11 @@ | ||
| 82 | 91 | } |
| 83 | 92 | } |
| 84 | 93 | |
| 85 | 94 | /** |
| 86 | - * Hooks. | |
| 87 | - */ | |
| 88 | - public function hooks() { | |
| 89 | - add_action( 'admin_menu', [ $this, 'admin_menu' ] ); | |
| 90 | - } | |
| 91 | - | |
| 92 | - /** | |
| 93 | 95 | * Admin menu. |
| 96 | + * | |
| 97 | + * @return void | |
| 94 | 98 | */ |
| 95 | 99 | public function admin_menu() { |
| 96 | 100 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 97 | 101 | if ( ! isset( $_GET['page'] ) || 'grant-content-control-access' !== $_GET['page'] ) { |