| @@ -21,13 +21,16 @@ | ||
| 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 | 36 | } |
| @@ -56,13 +59,17 @@ | ||
| 56 | 59 | require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-ajax.php'; |
| 57 | 60 | require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-redirect.php'; |
| 58 | 61 | } |
| 59 | 62 | |
| 63 | + private function load_public_dependencies(): void { | |
| 64 | + require_once HOSTINGER_ABSPATH . 'includes/public/class-hostinger-public-assets.php'; | |
| 65 | + } | |
| 66 | + | |
| 60 | 67 | private function load_onboarding_dependencies(): void { |
| 61 | 68 | require_once HOSTINGER_ABSPATH . 'includes/admin/class-hostinger-admin-actions.php'; |
| 62 | 69 | require_once HOSTINGER_ABSPATH . 'includes/admin/onboarding/class-hostinger-onboarding-settings.php'; |
| 63 | 70 | |
| 64 | - if( ! Hostinger_Onboarding_Settings::all_steps_completed() ) { | |
| 71 | + if ( ! Hostinger_Onboarding_Settings::all_steps_completed() ) { | |
| 65 | 72 | require_once HOSTINGER_ABSPATH . 'includes/admin/onboarding/class-hostinger-autocomplete-steps.php'; |
| 66 | 73 | } |
| 67 | 74 | } |
| 68 | 75 | } |