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