PluginProbe
Hostinger Tools / 2.1.1
Hostinger Tools v2.1.1
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 All 108 releases
hostinger / includes / admin / onboarding / class-hostinger-onboarding.php

class-hostinger-onboarding.php in Hostinger Tools 2.1.1, at includes/admin/onboarding/class-hostinger-onboarding.php

89 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 class Hostinger_Onboarding {
8 private function load_steps(): array {
9 $steps = array();
10 $path = HOSTINGER_ABSPATH . 'includes/admin/onboarding/steps/';
11 $website_type = Hostinger_Settings::get_setting( 'survey.website.type' );
12 $helper = new Hostinger_Helper();
13
14 require_once $path . 'abstract-hostinger-onboarding-step.php';
15
16 if ( get_theme_support( 'custom-logo' ) ) {
17 require_once $path . 'class-hostinger-onboarding-logo-step.php';
18 $steps[] = new Hostinger_Onboarding_Logo_Step();
19 }
20
21 require_once $path . 'class-hostinger-onboarding-logo-step.php';
22 require_once $path . 'class-hostinger-onboarding-image-step.php';
23 require_once $path . 'class-hostinger-onboarding-heading.php';
24 require_once $path . 'class-hostinger-onboarding-add-page.php';
25 require_once $path . 'class-hostinger-onboarding-connect-domain.php';
26
27 if ( $website_type === Hostinger_Settings::WEBSITE_TYPE_BLOG ) {
28 require_once $path . 'class-hostinger-onboarding-add-post.php';
29 $steps[] = new Hostinger_Onboarding_Add_Post();
30 } else {
31 require_once $path . 'class-hostinger-onboarding-description.php';
32 $steps[] = new Hostinger_Onboarding_Description();
33 }
34
35 $steps[] = new Hostinger_Onboarding_Image_Step();
36 $steps[] = new Hostinger_Onboarding_Heading();
37 $steps[] = new Hostinger_Onboarding_Add_Page();
38
39 if ( Hostinger_Helper::is_plugin_active( 'hostinger-affiliate-plugin' ) ) {
40 require_once $path . 'class-hostinger-onboarding-connect-affiliate-settings.php';
41 $steps[] = new Hostinger_Onboarding_Connect_Affiliate_Settings();
42 }
43
44 if ( class_exists( 'WooCommerce' ) ) {
45 require_once $path . 'class-hostinger-onboarding-setup-store.php';
46 $steps[] = new Hostinger_Onboarding_Setup_Store();
47 }
48
49 $steps[] = new Hostinger_Onboarding_Connect_Domain_Step();
50
51 return $steps;
52 }
53
54 public function get_steps(): array {
55 return $this->load_steps();
56 }
57
58 public function maintenance_mode_enabled(): bool {
59 $published = get_option( 'hostinger_maintenance_mode' );
60
61 return (bool) $published;
62 }
63
64 public function get_content(): array {
65 if ( ! $this->maintenance_mode_enabled() ) {
66 return array(
67 'title' => __( 'Website is published', 'hostinger' ),
68 'description' => __( 'You can access this guide material any time when updating your website', 'hostinger' ),
69 'btn' => array(
70 'text' => __( 'Preview website', 'hostinger' ),
71 'class' => 'hsr-btn hsr-primary-btn hsr-publish-btn',
72 'url' => home_url(),
73 ),
74 );
75 }
76
77 return array(
78 'title' => __( 'Set up your website', 'hostinger' ),
79 'description' => __( 'Follow our guided checklist to setup your website', 'hostinger' ),
80 'btn_text' => __( 'Publish website', 'hostinger' ),
81 'btn' => array(
82 'text' => __( 'Publish website', 'hostinger' ),
83 'class' => 'hsr-btn hsr-primary-btn hsr-publish-btn',
84 'url' => '#',
85 ),
86 );
87 }
88 }
89