| 1 |
<?php |
| 2 |
/* |
| 3 |
* Master Addons : Welcome Screen by Jewel Theme |
| 4 |
*/ |
| 5 |
|
| 6 |
if (!defined('ABSPATH')) { |
| 7 |
exit; // Exit if accessed directly |
| 8 |
} |
| 9 |
|
| 10 |
// Check if PRO version is active and set constants accordingly |
| 11 |
if (\MasterAddons\Inc\Classes\Helper::jltma_premium() && defined('JLTMA_PRO') && defined('JLTMA_PRO_VER') && defined('JLTMA_PRO_PATH')) { |
| 12 |
$jltma_prefix = JLTMA_PRO; |
| 13 |
$jltma_ver = JLTMA_PRO_VER; |
| 14 |
$jltma_path = JLTMA_PRO_PATH; |
| 15 |
} else { |
| 16 |
$jltma_prefix = JLTMA; |
| 17 |
$jltma_ver = JLTMA_VER; |
| 18 |
$jltma_path = JLTMA_PATH; |
| 19 |
} |
| 20 |
// JLTMA_IMAGE_DIR stays the same for both versions |
| 21 |
$jltma_image_dir = JLTMA_IMAGE_DIR; |
| 22 |
|
| 23 |
$jltma_white_label_setting = \MasterAddons\Inc\Classes\Utils::get_options('jltma_white_label_settings') ?? []; |
| 24 |
if ( empty($jltma_white_label_setting) ) { |
| 25 |
$jltma_white_label_setting = apply_filters('jltma_white_label_default_options', array()); |
| 26 |
} |
| 27 |
|
| 28 |
$jltma_hide_welcome = \MasterAddons\Inc\Classes\Utils::check_options($jltma_white_label_setting['jltma_wl_plugin_tab_welcome'] ?? false); |
| 29 |
$jltma_hide_addons = \MasterAddons\Inc\Classes\Utils::check_options($jltma_white_label_setting['jltma_wl_plugin_tab_addons'] ?? false); |
| 30 |
$jltma_hide_extensions = \MasterAddons\Inc\Classes\Utils::check_options($jltma_white_label_setting['jltma_wl_plugin_tab_extensions'] ?? false); |
| 31 |
$jltma_hide_icons_library = \MasterAddons\Inc\Classes\Utils::check_options($jltma_white_label_setting['jltma_wl_plugin_tab_icons_library'] ?? false); |
| 32 |
$jltma_hide_api = \MasterAddons\Inc\Classes\Utils::check_options($jltma_white_label_setting['jltma_wl_plugin_tab_api'] ?? false); |
| 33 |
$jltma_hide_performance = \MasterAddons\Inc\Classes\Utils::check_options($jltma_white_label_setting['jltma_wl_plugin_tab_performance'] ?? false); |
| 34 |
$jltma_hide_white_label = \MasterAddons\Inc\Classes\Utils::check_options($jltma_white_label_setting['jltma_wl_plugin_tab_white_label'] ?? false); |
| 35 |
$jltma_hide_version = \MasterAddons\Inc\Classes\Utils::check_options($jltma_white_label_setting['jltma_wl_plugin_tab_version'] ?? false); |
| 36 |
// $jltma_hide_changelogs = \MasterAddons\Inc\Classes\Utils::check_options($jltma_white_label_setting['jltma_wl_plugin_tab_changelogs'] ?? false); |
| 37 |
$jltma_hide_system_info = \MasterAddons\Inc\Classes\Utils::check_options($jltma_white_label_setting['jltma_wl_plugin_tab_system_info'] ?? false); |
| 38 |
|
| 39 |
// Image Optimizer tab - only show if premium and extension is enabled |
| 40 |
$jltma_hide_optimize = true; // Default hidden |
| 41 |
$is_premium = \MasterAddons\Inc\Classes\Helper::jltma_premium(); |
| 42 |
// Allow local dev to see Pro features |
| 43 |
if (defined('WP_DEBUG') && WP_DEBUG && (strpos(home_url() ?? '', '.local') !== false || strpos(home_url() ?? '', 'localhost') !== false)) { |
| 44 |
$is_premium = true; |
| 45 |
} |
| 46 |
if ($is_premium) { |
| 47 |
$extension_settings = \MasterAddons\Inc\Admin\Settings\Settings::get_extensions(); |
| 48 |
if (!empty($extension_settings['image-optimizer'])) { |
| 49 |
$jltma_hide_optimize = \MasterAddons\Inc\Classes\Utils::check_options($jltma_white_label_setting['jltma_wl_plugin_tab_optimize'] ?? false); |
| 50 |
} |
| 51 |
} |
| 52 |
?> |
| 53 |
<div class="jltma-master-addons-admin"> |
| 54 |
<div class="jltma-master-addons-wrap"> |
| 55 |
|
| 56 |
<header class="jltma-master-addons-header is-flex"> |
| 57 |
<a class="jltma-master-addons-panel-logo" href="https://master-addons.com/?utm_source=dashboard&utm_medium=settings_header&utm_id=admin_dashboard" target="_blank"> |
| 58 |
<?php |
| 59 |
$jltma_logo_image = apply_filters('master_addons/white_label/menu_logo', $jltma_image_dir . 'logo.svg'); |
| 60 |
?> |
| 61 |
<img src="<?php echo esc_url($jltma_logo_image ); ?>" /> |
| 62 |
</a> |
| 63 |
|
| 64 |
<h1 class="jltma-master-addons-title"> |
| 65 |
<?php if (!empty($jltma_white_label_setting['jltma_wl_plugin_menu_label'])) { |
| 66 |
/* translators: 1: plugin name, 2: plugin version */ |
| 67 |
printf( esc_html__('%1$s v %2$s', 'master-addons'), esc_html( $jltma_white_label_setting['jltma_wl_plugin_menu_label'] ), esc_html( $jltma_ver ) ); |
| 68 |
} else { |
| 69 |
/* translators: 1: plugin name, 2: plugin version */ |
| 70 |
printf( esc_html__('%1$s v %2$s', 'master-addons'), esc_html( $jltma_prefix ), esc_html( $jltma_ver ) ); |
| 71 |
} |
| 72 |
?> |
| 73 |
</h1> |
| 74 |
|
| 75 |
<div class="jltma-master-addons-header-text"></div> |
| 76 |
</header> |
| 77 |
|
| 78 |
<?php require_once $jltma_path . 'inc/admin/welcome/navigation.php'; ?> |
| 79 |
|
| 80 |
<div class="jltma-master-addons-tab-contents"> |
| 81 |
<?php |
| 82 |
if (isset($jltma_hide_welcome) && !$jltma_hide_welcome) { |
| 83 |
require $jltma_path . 'inc/admin/welcome/supports.php'; |
| 84 |
} |
| 85 |
|
| 86 |
if (isset($jltma_hide_addons) && !$jltma_hide_addons) { |
| 87 |
require $jltma_path . 'inc/admin/welcome/addons.php'; |
| 88 |
} |
| 89 |
|
| 90 |
if (isset($jltma_hide_extensions) && !$jltma_hide_extensions) { |
| 91 |
require $jltma_path . 'inc/admin/welcome/extensions.php'; |
| 92 |
} |
| 93 |
|
| 94 |
if (isset($jltma_hide_icons_library) && !$jltma_hide_icons_library) { |
| 95 |
require $jltma_path . 'inc/admin/welcome/icons-library.php'; |
| 96 |
} |
| 97 |
|
| 98 |
if (isset($jltma_hide_optimize) && !$jltma_hide_optimize) { |
| 99 |
require $jltma_path . 'inc/admin/welcome/optimize.php'; |
| 100 |
} |
| 101 |
|
| 102 |
if (isset($jltma_hide_api) && !$jltma_hide_api) { |
| 103 |
require $jltma_path . 'inc/admin/welcome/api-keys.php'; |
| 104 |
} |
| 105 |
|
| 106 |
if (isset($jltma_hide_performance) && !$jltma_hide_performance) { |
| 107 |
require $jltma_path . 'inc/admin/welcome/performance.php'; |
| 108 |
} |
| 109 |
|
| 110 |
if (isset($jltma_hide_version) && !$jltma_hide_version) { |
| 111 |
require $jltma_path . 'inc/admin/welcome/version-control.php'; |
| 112 |
} |
| 113 |
|
| 114 |
// if (isset($jltma_hide_changelogs) && !$jltma_hide_changelogs) { |
| 115 |
// require $jltma_path . 'inc/admin/welcome/changelogs.php'; |
| 116 |
// } |
| 117 |
|
| 118 |
if (isset($jltma_hide_white_label) && !$jltma_hide_white_label) { |
| 119 |
require $jltma_path . 'inc/admin/welcome/white-label.php'; |
| 120 |
} |
| 121 |
|
| 122 |
if (isset($jltma_hide_system_info) && !$jltma_hide_system_info) { |
| 123 |
require $jltma_path . 'inc/admin/welcome/system-info.php'; |
| 124 |
} |
| 125 |
?> |
| 126 |
</div> |
| 127 |
|
| 128 |
</div> |
| 129 |
</div> |
| 130 |
|