Файловый менеджер - Редактировать - /home/digitalm/studiodentisticodigitalecm/wp-content/themes/healthy-smiles/admin/installer/installer.php
Назад
<?php namespace HealthySmilesSpace\Admin\Installer; use HealthySmilesSpace\Admin\Installer\Merlin\Class_Merlin; use HealthySmilesSpace\Admin\Installer\Importer\Importer; use HealthySmilesSpace\Admin\Installer\Plugin_Activator\Plugin_Activator; use HealthySmilesSpace\Core\Utils\API_Requests; use HealthySmilesSpace\Core\Utils\File_Manager; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } /** * Installer module. * * Main class for installer module. */ class Installer { /** * Installer module constructor. */ public function __construct() { add_action( 'after_switch_theme', array( $this, 'set_token' ) ); add_action( 'admin_init', array( $this, 'first_setup' ) ); $this->set_first_theme_version(); new Plugin_Activator(); new Importer(); $this->run_wizard(); } /** * Set first theme version. */ private function set_first_theme_version() { if ( get_option( 'cmsmasters_healthy-smiles_version', false ) ) { return; } update_option( 'cmsmasters_healthy-smiles_version', CMSMASTERS_THEME_VERSION ); } /** * Set token if theme has been activated earlier. */ public function set_token() { API_Requests::regenerate_token(); } /** * First setup actions. */ public function first_setup() { if ( 'pending' !== get_option( 'cmsmasters_healthy-smiles_first_setup', 'pending' ) ) { return; } $this->set_settings(); $this->set_defaults(); do_action( 'cmsmasters_set_backup_options', true ); do_action( 'cmsmasters_set_import_status', 'pending' ); do_action( 'cmsmasters_first_setup' ); update_option( 'cmsmasters_healthy-smiles_first_setup', 'done' ); } /** * Set settings. */ private function set_settings() { update_option( 'default_pingback_flag', 0 ); update_option( 'elementor_page_title_selector', '.cmsmasters-headline' ); update_option( 'elementor_disable_color_schemes', 'yes' ); update_option( 'elementor_disable_typography_schemes', 'yes' ); update_option( 'elementor_unfiltered_files_upload', 1 ); } /** * Set defaults. */ private function set_defaults() { $kits_path = get_parent_theme_file_path( '/theme-config/defaults/default-kits.json' ); $options_path = get_parent_theme_file_path( '/theme-config/defaults/default-theme-options.json' ); $kits = File_Manager::get_file_contents( $kits_path ); $options = File_Manager::get_file_contents( $options_path ); if ( '' !== $kits ) { $kits = json_decode( $kits, true ); update_option( 'cmsmasters_healthy-smiles_default_kits', $kits ); } if ( '' !== $options ) { $options = json_decode( $options, true ); update_option( 'cmsmasters_healthy-smiles_options', $options ); } } /** * Require Merlin Installer. */ private function run_wizard() { $config = array( 'directory' => 'admin/installer/merlin', // Location / directory where Merlin WP is placed in your theme. 'merlin_url' => 'merlin', // The wp-admin page slug where Merlin WP loads. 'parent_slug' => 'themes.php', // The wp-admin parent page slug for the admin menu item. 'capability' => 'manage_options', // The capability required for this menu to be displayed to the user. 'child_action_btn_url' => 'https://developer.wordpress.org/themes/advanced-topics/child-themes/', // URL for the 'child-action-link'. 'dev_mode' => false, // Enable development mode for testing. 'license_step' => true, // License activation step. 'license_required' => true, // Require the license activation step. 'license_help_url' => 'https://docs.cmsmasters.net/blog/how-to-find-your-envato-purchase-code/', // URL for the 'license-tooltip'. 'ready_big_button_url' => home_url( '/' ), // Link for the big button on the ready step. ); $strings = array( 'admin-menu' => esc_html__( 'Theme Setup', 'healthy-smiles' ), /* translators: 1: Title Tag 2: Theme Name 3: Closing Title Tag */ 'title%s%s%s%s' => esc_html__( '%1$s%2$s Themes ‹ Theme Setup: %3$s%4$s', 'healthy-smiles' ), 'return-to-dashboard' => esc_html__( 'Return to the dashboard', 'healthy-smiles' ), 'ignore' => '', 'btn-skip' => esc_html__( 'Skip', 'healthy-smiles' ), 'btn-next' => esc_html__( 'Next', 'healthy-smiles' ), 'btn-start' => esc_html__( 'Start', 'healthy-smiles' ), 'btn-no' => esc_html__( 'Cancel', 'healthy-smiles' ), 'btn-plugins-install' => esc_html__( 'Install', 'healthy-smiles' ), 'btn-child-install' => esc_html__( 'Install', 'healthy-smiles' ), 'btn-content-install' => esc_html__( 'Install', 'healthy-smiles' ), 'btn-import' => esc_html__( 'Import', 'healthy-smiles' ), 'btn-license-activate' => esc_html__( 'Activate', 'healthy-smiles' ), 'btn-license-skip' => esc_html__( 'Later', 'healthy-smiles' ), /* translators: Theme Name */ 'license-header%s' => esc_html__( 'Activate %s', 'healthy-smiles' ), /* translators: Theme Name */ 'license-header-success%s' => esc_html__( '%s license is Activated', 'healthy-smiles' ), /* translators: Theme Name */ 'license%s' => esc_html__( 'Enter your license key to enable remote updates and theme support.', 'healthy-smiles' ), 'license-label' => esc_html__( 'License key', 'healthy-smiles' ), 'license-success%s' => esc_html__( 'The theme is already registered, so you can go to the next step!', 'healthy-smiles' ), 'license-json-success%s' => esc_html__( 'Your license is activated!', 'healthy-smiles' ), 'license-tooltip' => esc_html__( 'Need help?', 'healthy-smiles' ), /* translators: Theme Name */ 'welcome-header%s' => esc_html__( 'Welcome to %s', 'healthy-smiles' ), 'welcome-header-success%s' => esc_html__( 'Hi. Welcome back', 'healthy-smiles' ), 'welcome%s' => esc_html__( 'This wizard will set up your theme, install plugins, and import content. It is optional & should take only a few minutes.', 'healthy-smiles' ), 'welcome-success%s' => esc_html__( 'You may have already run this theme setup wizard. If you would like to proceed anyway, click on the "Start" button below.', 'healthy-smiles' ), 'child-header' => esc_html__( 'Install Child Theme', 'healthy-smiles' ), 'child-header-success' => esc_html__( 'You\'re good to go!', 'healthy-smiles' ), 'child' => esc_html__( 'Let\'s build & activate a child theme so you may easily make theme changes.', 'healthy-smiles' ), 'child-success%s' => esc_html__( 'Your child theme has already been installed and is now activated, if it wasn\'t already.', 'healthy-smiles' ), 'child-action-link' => esc_html__( 'Learn about child themes', 'healthy-smiles' ), 'child-json-success%s' => esc_html__( 'Awesome. Your child theme has already been installed and is now activated.', 'healthy-smiles' ), 'child-json-already%s' => esc_html__( 'Awesome. Your child theme has been created and is now activated.', 'healthy-smiles' ), 'plugins-header' => esc_html__( 'Install Plugins', 'healthy-smiles' ), 'plugins-header-success' => esc_html__( 'You\'re up to speed!', 'healthy-smiles' ), 'plugins' => esc_html__( 'Let\'s install some essential WordPress plugins to get your site up to speed.', 'healthy-smiles' ), 'plugins-success%s' => esc_html__( 'The required WordPress plugins are all installed and up to date. Press "Next" to continue the setup wizard.', 'healthy-smiles' ), 'plugins-action-link' => esc_html__( 'Advanced', 'healthy-smiles' ), 'import-header' => esc_html__( 'Import Content', 'healthy-smiles' ), 'import' => esc_html__( 'Let\'s import content to your website, to help you get familiar with the theme.', 'healthy-smiles' ), 'import-action-link' => esc_html__( 'Advanced', 'healthy-smiles' ), 'ready-header' => esc_html__( 'All done. Have fun!', 'healthy-smiles' ), /* translators: Theme Author */ 'ready%s' => esc_html__( 'Your theme has been all set up. Enjoy your new theme by %s.', 'healthy-smiles' ), 'ready-action-link' => esc_html__( 'Extras', 'healthy-smiles' ), 'ready-big-button' => esc_html__( 'View your website', 'healthy-smiles' ), 'ready-link-2' => sprintf( '<a href="%1$s">%2$s</a>', admin_url( 'admin.php?page=go_theme_settings' ), esc_html__( 'Theme Settings', 'healthy-smiles' ) ), ); if ( 'cmsmasters' === wp_get_theme()->get( 'Author' ) ) { $strings['ready-link-1'] = sprintf( '<a href="%1$s" target="_blank">%2$s</a>', 'https://cmsmasters.net/', esc_html__( 'Get Theme Support', 'healthy-smiles' ) ); } new Class_Merlin( $config, $strings ); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Генерация страницы: 0.04 |
proxy
|
phpinfo
|
Настройка