| @@ -21,17 +21,19 @@ | ||
| 21 | 21 | require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-helper.php'; |
| 22 | 22 | require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-errors.php'; |
| 23 | 23 | require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-settings.php'; |
| 24 | 24 | require_once HOSTINGER_ABSPATH . 'includes/requests/class-hostinger-requests-client.php'; |
| 25 | - require_once HOSTINGER_ABSPATH . 'includes/amplitude/class-hostinger-amplitude-actions.php'; | |
| 26 | - require_once HOSTINGER_ABSPATH . 'includes/amplitude/class-hostinger-amplitude.php'; | |
| 27 | - require_once HOSTINGER_ABSPATH . 'includes/surveys/class-hostinger-surveys-questions.php'; | |
| 28 | - require_once HOSTINGER_ABSPATH . 'includes/surveys/class-hostinger-surveys.php'; | |
| 25 | + | |
| 26 | + if ( ! empty( Hostinger_Helper::get_api_token() ) ) { | |
| 27 | + require_once HOSTINGER_ABSPATH . 'includes/amplitude/class-hostinger-amplitude-actions.php'; | |
| 28 | + require_once HOSTINGER_ABSPATH . 'includes/amplitude/class-hostinger-amplitude.php'; | |
| 29 | + } | |
| 30 | + | |
| 29 | 31 | $this->load_onboarding_dependencies(); |
| 32 | + $this->load_public_dependencies(); | |
| 30 | 33 | |
| 31 | 34 | if ( is_admin() ) { |
| 32 | 35 | $this->load_admin_dependencies(); |
| 33 | - $this->define_admin_hooks(); | |
| 34 | 36 | } |
| 35 | 37 | |
| 36 | 38 | if ( defined( 'WP_CLI' ) && WP_CLI ) { |
| 37 | 39 | require_once HOSTINGER_ABSPATH . 'includes/class-hostinger-cli.php'; |
| @@ -52,22 +54,16 @@ | ||
| 52 | 54 | } |
| 53 | 55 | |
| 54 | 56 | private function load_admin_dependencies(): void { |
| 55 | 57 | require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-assets.php'; |
| 58 | + require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-hooks.php'; | |
| 56 | 59 | require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-menu.php'; |
| 57 | - require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-affiliates.php'; | |
| 58 | 60 | require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-ajax.php'; |
| 59 | 61 | require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-redirect.php'; |
| 60 | 62 | } |
| 61 | 63 | |
| 62 | - private function define_admin_hooks(): void { | |
| 63 | - $hostinger_affiliate = new Hostinger_Affiliates(); | |
| 64 | - | |
| 65 | - $this->loader->add_filter( 'astra_get_pro_url', $hostinger_affiliate, 'astra_pro_affiliate_link', 10, 2 ); | |
| 66 | - $this->loader->add_filter( 'optinmonster_sas_id', $hostinger_affiliate, 'affiliate_monsterinsights' ); | |
| 67 | - $this->loader->add_filter( 'monsterinsights_shareasale_id', $hostinger_affiliate, 'affiliate_monsterinsights' ); | |
| 68 | - $this->loader->add_filter( 'wpforms_upgrade_link', $hostinger_affiliate, 'wpforms_upgrade_link' ); | |
| 69 | - $this->loader->add_filter( 'aioseo_upgrade_link', $hostinger_affiliate, 'aioseo_upgrade_link' ); | |
| 64 | + private function load_public_dependencies(): void { | |
| 65 | + require_once HOSTINGER_ABSPATH . 'includes/public/class-hostinger-public-assets.php'; | |
| 70 | 66 | } |
| 71 | 67 | |
| 72 | 68 | private function load_onboarding_dependencies(): void { |
| 73 | 69 | require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-actions.php'; |
| @@ -72,9 +68,9 @@ | ||
| 72 | 68 | private function load_onboarding_dependencies(): void { |
| 73 | 69 | require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-actions.php'; |
| 74 | 70 | require_once HOSTINGER_ABSPATH . 'includes/admin/onboarding/class-hostinger-onboarding-settings.php'; |
| 75 | 71 | |
| 76 | - if( ! Hostinger_Onboarding_Settings::all_steps_completed() ) { | |
| 72 | + if ( ! Hostinger_Onboarding_Settings::all_steps_completed() ) { | |
| 77 | 73 | require_once HOSTINGER_ABSPATH . 'includes/admin/onboarding/class-hostinger-autocomplete-steps.php'; |
| 78 | 74 | } |
| 79 | 75 | } |
| 80 | 76 | } |