| 1 |
<?php |
| 2 |
|
| 3 |
use UltimateStoreKit\Classes\Utils; |
| 4 |
use UltimateStoreKit\Admin\ModuleService; |
| 5 |
use Elementor\Tracker; |
| 6 |
use Elementor\Modules\Usage\Module; |
| 7 |
|
| 8 |
|
| 9 |
/** |
| 10 |
* Ultimate Store Kit Admin Settings Class |
| 11 |
*/ |
| 12 |
class UltimateStoreKit_Admin_Settings { |
| 13 |
public static $modules_list = null; |
| 14 |
public static $modules_names = null; |
| 15 |
|
| 16 |
public static $modules_list_only_widgets = null; |
| 17 |
public static $modules_names_only_widgets = null; |
| 18 |
|
| 19 |
public static $modules_list_only_edd_widgets = null; |
| 20 |
public static $modules_names_only_edd_widgets = null; |
| 21 |
|
| 22 |
const PAGE_ID = 'ultimate_store_kit_options'; |
| 23 |
|
| 24 |
private $settings_api; |
| 25 |
|
| 26 |
public $responseObj; |
| 27 |
public $showMessage = false; |
| 28 |
private $is_activated = false; |
| 29 |
|
| 30 |
function __construct() { |
| 31 |
$this->settings_api = new UltimateStoreKit_Settings_API; |
| 32 |
|
| 33 |
if (!defined('BDTUSK_HIDE')) { |
| 34 |
add_action('admin_init', [$this, 'admin_init']); |
| 35 |
add_action('admin_menu', [$this, 'admin_menu'], 201); |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
public static function get_url() { |
| 40 |
return admin_url('admin.php?page=' . self::PAGE_ID); |
| 41 |
} |
| 42 |
|
| 43 |
function admin_init() { |
| 44 |
|
| 45 |
//set the settings |
| 46 |
$this->settings_api->set_sections($this->get_settings_sections()); |
| 47 |
$this->settings_api->set_fields($this->ultimate_store_kit_admin_settings()); |
| 48 |
|
| 49 |
//initialize settings |
| 50 |
$this->settings_api->admin_init(); |
| 51 |
} |
| 52 |
|
| 53 |
function admin_menu() { |
| 54 |
add_menu_page( |
| 55 |
BDTUSK_TITLE . ' ' . esc_html__('Dashboard', 'ultimate-store-kit'), |
| 56 |
BDTUSK_TITLE, |
| 57 |
'manage_options', |
| 58 |
self::PAGE_ID, |
| 59 |
[$this, 'plugin_page'], |
| 60 |
$this->ultimate_store_kit_icon(), |
| 61 |
58.5 |
| 62 |
); |
| 63 |
|
| 64 |
add_submenu_page( |
| 65 |
self::PAGE_ID, |
| 66 |
BDTUSK_TITLE, |
| 67 |
esc_html__('WC Widgets', 'ultimate-store-kit'), |
| 68 |
'manage_options', |
| 69 |
self::PAGE_ID . '#ultimate_store_kit_active_modules', |
| 70 |
[$this, 'display_page'], |
| 71 |
); |
| 72 |
|
| 73 |
add_submenu_page( |
| 74 |
self::PAGE_ID, |
| 75 |
BDTUSK_TITLE, |
| 76 |
esc_html__('EDD Widgets', 'ultimate-store-kit'), |
| 77 |
'manage_options', |
| 78 |
self::PAGE_ID . '#ultimate_store_kit_edd_modules', |
| 79 |
[$this, 'display_page'], |
| 80 |
); |
| 81 |
|
| 82 |
add_submenu_page( |
| 83 |
self::PAGE_ID, |
| 84 |
BDTUSK_TITLE, |
| 85 |
esc_html__('Others Widgets', 'ultimate-store-kit'), |
| 86 |
'manage_options', |
| 87 |
self::PAGE_ID . '#ultimate_store_kit_general_modules', |
| 88 |
[$this, 'display_page'], |
| 89 |
); |
| 90 |
|
| 91 |
if (true !== _is_usk_pro_activated()) { |
| 92 |
add_submenu_page( |
| 93 |
self::PAGE_ID, |
| 94 |
BDTUSK_TITLE, |
| 95 |
esc_html__('Get Pro', 'ultimate-store-kit'), |
| 96 |
'manage_options', |
| 97 |
self::PAGE_ID . '#ultimate_store_kit_get_pro', |
| 98 |
[$this, 'display_page'] |
| 99 |
); |
| 100 |
} |
| 101 |
} |
| 102 |
|
| 103 |
function ultimate_store_kit_icon() { |
| 104 |
return 'data:image/svg+xml;base64,PCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMTAiIGhlaWdodD0iMTAyNCIgdmlld0JveD0iMCAwIDEwMTAgMTAyNCI+Cjx0aXRsZT48L3RpdGxlPgo8ZyBpZD0iaWNvbW9vbi1pZ25vcmUiPgo8L2c+CjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik05MTEuNjM4IDg3OS44NzhsLTUxLjQxNi01MDMuMzU3Yy01LjkzNS01Ni44NDMtNTMuNTk1LTEwMC43NzUtMTExLjUxNC0xMDAuNzc1LTAuMTExIDAtMC4yMjIgMC0wLjMzMiAwaC00NzIuNzQ4Yy0wLjE2MSAwLTAuMzUyLTAuMDAyLTAuNTQ1LTAuMDAyLTU4LjM2OSAwLTEwNi4yOTIgNDQuNzE3LTExMS4zODIgMTAxLjc2MWwtMC4wMzEgMC40MjktNDYuMDE3IDUwMy4zNTdjLTAuMjkzIDMuMDQzLTAuNDYgNi41OC0wLjQ2IDEwLjE1NCAwIDYyLjA5OCA1MC4zMjQgMTEyLjQ0MSAxMTIuNDEzIDExMi40NzJoNTcwLjIwMWM2Mi4xMDYtMC4xMDggMTEyLjQxMS01MC40NzggMTEyLjQxMS0xMTIuNiAwLTQuMDI5LTAuMjEyLTguMDA4LTAuNjI1LTExLjkyOGwwLjA0MiAwLjQ5ek0yMjkuNjExIDkwNS41ODVjLTAuMDE0IDAtMC4wMzMgMC0wLjA1MCAwLTcuNDU0IDAtMTMuNDk2LTYuMDQzLTEzLjQ5Ni0xMy40OTYgMC0wLjQwOCAwLjAxNy0wLjgxMSAwLjA1NC0xLjIwOGwtMC4wMDMgMC4wNTIgNDYuMDE3LTUwMy4zNTdjMC03LjA5OSA1Ljc1NS0xMi44NTQgMTIuODU0LTEyLjg1NHYwaDQ3Mi44OTRjNi45NjUgMC4wMjEgMTIuNjk3IDUuMjY1IDEzLjQ5MSAxMi4wMTlsMC4wMDcgMC4wNjQgMjEuNTk0IDIwOS4zODljLTczLjk4NCAzLjU5NC0xNDAuODE0IDMxLjU1OS0xOTMuMjggNzUuOTdsMC40NzItMC4zOTFjLTgwLjIwOCA2OC42MzktMTEzLjExNCAxNjcuMTAxLTEyNi40ODIgMjMzLjI5OHpNNzk5LjgwOCA5MDUuNTg1aC0yMzEuMzY5YzEyLjg1NC00OC45NzMgMzcuNjYxLTExMi4zNDMgODguNDM1LTE1NS41MzIgMzYuNzM0LTMwLjYyIDgzLjk4LTQ5Ljc2MyAxMzUuNjQzLTUxLjQwN2wwLjM1MS0wLjAwOSAxOS42NjYgMTkxLjM5M2MwLjEwNiAwLjYxOCAwLjE2NSAxLjMzIDAuMTY1IDIuMDU3IDAgNy4wOTktNS43NTUgMTIuODU0LTEyLjg1NCAxMi44NTQtMC4wMTQgMC0wLjAyNiAwLTAuMDQwIDBoMC4wMDJ6Ij48L3BhdGg+CjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0zNjIuNjQ5IDIzNWMwLjExNSAwLjAwMiAwLjI1IDAuMDAyIDAuMzg1IDAuMDAyIDI3LjI2MSAwIDQ5LjM1OS0yMi4wOTggNDkuMzU5LTQ5LjM1OSAwIDAgMC0wLjAwMiAwLTAuMDAydjBjMi4wMDMtNTQuNjQ3IDQ2Ljc4Ni05OC4xODYgMTAxLjczOC05OC4xODZzOTkuNzM1IDQzLjU0IDEwMS43MzMgOTguMDA0bDAuMDA1IDAuMTgyYzEuMzc4IDI2LjIyNCAyMi45NzggNDYuOTY2IDQ5LjQyMyA0Ni45NjZzNDguMDQ1LTIwLjc0MiA0OS40MTgtNDYuODQzbDAuMDA1LTAuMTIyYzAuMDQyLTEuNTEyIDAuMDY0LTMuMjkzIDAuMDY0LTUuMDc4IDAtMTEwLjgxNi04OS44MzQtMjAwLjY0OC0yMDAuNjQ4LTIwMC42NDhzLTIwMC42NDggODkuODM0LTIwMC42NDggMjAwLjY0OGMwIDEuNzg2IDAuMDIzIDMuNTY2IDAuMDY5IDUuMzRsLTAuMDA1LTAuMjYyYzAgMCAwIDAgMCAwIDAgMjcuMTcxIDIxLjk1MiA0OS4yMTMgNDkuMDg4IDQ5LjM1OWgwLjAxNHoiPjwvcGF0aD4KPC9zdmc+Cg=='; |
| 105 |
} |
| 106 |
|
| 107 |
function get_settings_sections() { |
| 108 |
$sections = [ |
| 109 |
[ |
| 110 |
'id' => 'ultimate_store_kit_active_modules', |
| 111 |
'title' => esc_html__('WC Widgets', 'ultimate-store-kit'), |
| 112 |
], |
| 113 |
[ |
| 114 |
'id' => 'ultimate_store_kit_edd_modules', |
| 115 |
'title' => esc_html__('EDD Widgets', 'ultimate-store-kit'), |
| 116 |
], |
| 117 |
[ |
| 118 |
'id' => 'ultimate_store_kit_general_modules', |
| 119 |
'title' => esc_html__('Other Widgets', 'ultimate-store-kit'), |
| 120 |
], |
| 121 |
]; |
| 122 |
return $sections; |
| 123 |
} |
| 124 |
|
| 125 |
protected function ultimate_store_kit_admin_settings() { |
| 126 |
return ModuleService::get_widget_settings(function ($settings) { |
| 127 |
$settings_fields = $settings['settings_fields']; |
| 128 |
|
| 129 |
self::$modules_list = array_merge($settings_fields['ultimate_store_kit_active_modules'], $settings_fields['ultimate_store_kit_edd_modules'], $settings_fields['ultimate_store_kit_general_modules']); |
| 130 |
self::$modules_list_only_widgets = $settings_fields['ultimate_store_kit_active_modules']; |
| 131 |
self::$modules_list_only_edd_widgets = $settings_fields['ultimate_store_kit_edd_modules']; |
| 132 |
|
| 133 |
return $settings_fields; |
| 134 |
}); |
| 135 |
} |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
/** |
| 140 |
* Get separate widgets name |
| 141 |
* |
| 142 |
* @access public |
| 143 |
* @return array |
| 144 |
* @since 6.0.0 |
| 145 |
* |
| 146 |
*/ |
| 147 |
|
| 148 |
public static function get_usk_only_widgets() { |
| 149 |
$names = self::$modules_names_only_widgets; |
| 150 |
|
| 151 |
if (null === $names) { |
| 152 |
$names = array_map( |
| 153 |
function ($item) { |
| 154 |
return isset($item['name']) ? 'usk-' . str_replace('_', '-', $item['name']) : 'none'; |
| 155 |
}, |
| 156 |
self::$modules_list_only_widgets |
| 157 |
); |
| 158 |
} |
| 159 |
|
| 160 |
return $names; |
| 161 |
} |
| 162 |
|
| 163 |
/** |
| 164 |
* Get widgets name |
| 165 |
* |
| 166 |
* @access public |
| 167 |
* @return array |
| 168 |
* @since 6.0.0 |
| 169 |
* |
| 170 |
*/ |
| 171 |
|
| 172 |
public static function get_usk_widgets_names() { |
| 173 |
$names = self::$modules_names; |
| 174 |
|
| 175 |
if (null === $names) { |
| 176 |
$names = array_map( |
| 177 |
function ($item) { |
| 178 |
return isset($item['name']) ? 'usk-' . str_replace('_', '-', $item['name']) : 'none'; |
| 179 |
}, |
| 180 |
self::$modules_list |
| 181 |
); |
| 182 |
} |
| 183 |
|
| 184 |
return $names; |
| 185 |
} |
| 186 |
/** |
| 187 |
* Get used widgets. |
| 188 |
* |
| 189 |
* @access public |
| 190 |
* @return array |
| 191 |
* @since 6.0.0 |
| 192 |
* |
| 193 |
*/ |
| 194 |
public static function get_used_widgets() { |
| 195 |
|
| 196 |
$used_widgets = array(); |
| 197 |
|
| 198 |
if (class_exists('Elementor\Modules\Usage\Module')) { |
| 199 |
|
| 200 |
$module = Module::instance(); |
| 201 |
$elements = $module->get_formatted_usage('raw'); |
| 202 |
$usk_widgets = self::get_usk_widgets_names(); |
| 203 |
|
| 204 |
if (is_array($elements) || is_object($elements)) { |
| 205 |
|
| 206 |
foreach ($elements as $post_type => $data) { |
| 207 |
foreach ($data['elements'] as $element => $count) { |
| 208 |
if (in_array($element, $usk_widgets, true)) { |
| 209 |
if (isset($used_widgets[$element])) { |
| 210 |
$used_widgets[$element] += $count; |
| 211 |
} else { |
| 212 |
$used_widgets[$element] = $count; |
| 213 |
} |
| 214 |
} |
| 215 |
} |
| 216 |
} |
| 217 |
} |
| 218 |
} |
| 219 |
|
| 220 |
return $used_widgets; |
| 221 |
} |
| 222 |
|
| 223 |
/** |
| 224 |
* Get used separate widgets. |
| 225 |
* |
| 226 |
* @access public |
| 227 |
* @return array |
| 228 |
* @since 6.0.0 |
| 229 |
* |
| 230 |
*/ |
| 231 |
|
| 232 |
public static function get_used_only_widgets() { |
| 233 |
|
| 234 |
$used_widgets = array(); |
| 235 |
|
| 236 |
if (class_exists('Elementor\Modules\Usage\Module')) { |
| 237 |
|
| 238 |
$module = Module::instance(); |
| 239 |
$elements = $module->get_formatted_usage('raw'); |
| 240 |
$usk_widgets = self::get_usk_only_widgets(); |
| 241 |
|
| 242 |
if (is_array($elements) || is_object($elements)) { |
| 243 |
|
| 244 |
foreach ($elements as $post_type => $data) { |
| 245 |
foreach ($data['elements'] as $element => $count) { |
| 246 |
if (in_array($element, $usk_widgets, true)) { |
| 247 |
if (isset($used_widgets[$element])) { |
| 248 |
$used_widgets[$element] += $count; |
| 249 |
} else { |
| 250 |
$used_widgets[$element] = $count; |
| 251 |
} |
| 252 |
} |
| 253 |
} |
| 254 |
} |
| 255 |
} |
| 256 |
} |
| 257 |
|
| 258 |
return $used_widgets; |
| 259 |
} |
| 260 |
|
| 261 |
/** |
| 262 |
* Get used only separate edd_widgets widgets. |
| 263 |
* |
| 264 |
* @access public |
| 265 |
* @return array |
| 266 |
* @since 6.0.0 |
| 267 |
* |
| 268 |
*/ |
| 269 |
|
| 270 |
public static function get_usk_only_edd_widgets_names() { |
| 271 |
$names = self::$modules_names_only_edd_widgets; |
| 272 |
|
| 273 |
if (null === $names) { |
| 274 |
$names = array_map( |
| 275 |
function ($item) { |
| 276 |
return isset($item['name']) ? 'usk-' . str_replace('_', '-', $item['name']) : 'none'; |
| 277 |
}, |
| 278 |
self::$modules_list_only_edd_widgets |
| 279 |
); |
| 280 |
} |
| 281 |
|
| 282 |
return $names; |
| 283 |
} |
| 284 |
public static function get_used_only_edd_widgets() { |
| 285 |
|
| 286 |
$used_widgets = array(); |
| 287 |
|
| 288 |
if (class_exists('Elementor\Modules\Usage\Module')) { |
| 289 |
|
| 290 |
$module = Module::instance(); |
| 291 |
$elements = $module->get_formatted_usage('raw'); |
| 292 |
$usk_widgets = self::get_usk_only_edd_widgets_names(); |
| 293 |
|
| 294 |
if (is_array($elements) || is_object($elements)) { |
| 295 |
|
| 296 |
foreach ($elements as $post_type => $data) { |
| 297 |
foreach ($data['elements'] as $element => $count) { |
| 298 |
if (in_array($element, $usk_widgets, true)) { |
| 299 |
if (isset($used_widgets[$element])) { |
| 300 |
$used_widgets[$element] += $count; |
| 301 |
} else { |
| 302 |
$used_widgets[$element] = $count; |
| 303 |
} |
| 304 |
} |
| 305 |
} |
| 306 |
} |
| 307 |
} |
| 308 |
} |
| 309 |
|
| 310 |
return $used_widgets; |
| 311 |
} |
| 312 |
|
| 313 |
/** |
| 314 |
* Get unused widgets. |
| 315 |
* |
| 316 |
* @access public |
| 317 |
* @return array |
| 318 |
* @since 6.0.0 |
| 319 |
* |
| 320 |
*/ |
| 321 |
|
| 322 |
public static function get_unused_widgets() { |
| 323 |
|
| 324 |
if (!current_user_can('install_plugins')) { |
| 325 |
die(); |
| 326 |
} |
| 327 |
|
| 328 |
$usk_widgets = self::get_usk_widgets_names(); |
| 329 |
|
| 330 |
$used_widgets = self::get_used_widgets(); |
| 331 |
|
| 332 |
$unused_widgets = array_diff($usk_widgets, array_keys($used_widgets)); |
| 333 |
|
| 334 |
return $unused_widgets; |
| 335 |
} |
| 336 |
|
| 337 |
/** |
| 338 |
* Get unused separate widgets. |
| 339 |
* |
| 340 |
* @access public |
| 341 |
* @return array |
| 342 |
* @since 6.0.0 |
| 343 |
* |
| 344 |
*/ |
| 345 |
|
| 346 |
public static function get_unused_only_widgets() { |
| 347 |
|
| 348 |
if (!current_user_can('install_plugins')) { |
| 349 |
die(); |
| 350 |
} |
| 351 |
|
| 352 |
$usk_widgets = self::get_usk_only_widgets(); |
| 353 |
|
| 354 |
$used_widgets = self::get_used_only_widgets(); |
| 355 |
|
| 356 |
$unused_widgets = array_diff($usk_widgets, array_keys($used_widgets)); |
| 357 |
|
| 358 |
return $unused_widgets; |
| 359 |
} |
| 360 |
|
| 361 |
/** |
| 362 |
* Get unused separate edd_widgets widgets. |
| 363 |
* |
| 364 |
* @access public |
| 365 |
* @return array |
| 366 |
* @since 6.0.0 |
| 367 |
* |
| 368 |
*/ |
| 369 |
|
| 370 |
public static function get_unused_only_edd_widgets() { |
| 371 |
|
| 372 |
if (!current_user_can('install_plugins')) { |
| 373 |
die(); |
| 374 |
} |
| 375 |
|
| 376 |
$usk_widgets = self::get_usk_only_edd_widgets_names(); |
| 377 |
|
| 378 |
$used_widgets = self::get_used_only_edd_widgets(); |
| 379 |
|
| 380 |
$unused_widgets = array_diff($usk_widgets, array_keys($used_widgets)); |
| 381 |
|
| 382 |
return $unused_widgets; |
| 383 |
} |
| 384 |
|
| 385 |
/** |
| 386 |
* Get Welcome Panel |
| 387 |
* |
| 388 |
* @access public |
| 389 |
* @return void |
| 390 |
*/ |
| 391 |
|
| 392 |
public function ultimate_store_kit_welcome() { |
| 393 |
$track_nw_msg = ''; |
| 394 |
if (!Tracker::is_allow_track()) { |
| 395 |
$track_nw = esc_html__('This feature is not working because the Elementor Usage Data Sharing feature is Not Enabled.', 'ultimate-store-kit'); |
| 396 |
$track_nw_msg = 'bdt-tooltip="' . $track_nw . '"'; |
| 397 |
} |
| 398 |
?> |
| 399 |
|
| 400 |
<div class="bdt-dashboard-panel" bdt-scrollspy="target: > div > div > .bdt-card; cls: bdt-animation-slide-bottom-small; delay: 300"> |
| 401 |
<div class="bdt-grid" bdt-grid bdt-height-match="target: > div > .bdt-card"> |
| 402 |
<div class="bdt-width-1-2@m bdt-width-1-4@l"> |
| 403 |
<div class="bdt-widget-status bdt-card bdt-card-body" <?php echo wp_kses_post($track_nw_msg); ?>> |
| 404 |
|
| 405 |
<?php |
| 406 |
$used_widgets = count(self::get_used_widgets()); |
| 407 |
$un_used_widgets = count(self::get_unused_widgets()); |
| 408 |
?> |
| 409 |
|
| 410 |
|
| 411 |
<div class="bdt-count-canvas-wrap bdt-flex bdt-flex-between"> |
| 412 |
<div class="bdt-count-wrap"> |
| 413 |
<h1 class="bdt-feature-title"><?php esc_html_e('All Widgets', 'ultimate-store-kit'); ?></h1> |
| 414 |
<div class="bdt-widget-count"><?php esc_html_e('Used: ', 'ultimate-store-kit'); ?> <b><?php echo esc_html($used_widgets); ?></b></div> |
| 415 |
<div class="bdt-widget-count"><?php esc_html_e('Unused: ', 'ultimate-store-kit'); ?> <b><?php echo esc_html($un_used_widgets); ?></b></div> |
| 416 |
<div class="bdt-widget-count"><?php esc_html_e('Total: ', 'ultimate-store-kit'); ?> |
| 417 |
<b><?php echo esc_html($used_widgets) + esc_html($un_used_widgets); ?></b> |
| 418 |
</div> |
| 419 |
</div> |
| 420 |
|
| 421 |
<div class="bdt-canvas-wrap"> |
| 422 |
<canvas id="bdt-db-total-status" style="height: 120px; width: 120px;" data-label="Total Widgets Status - (<?php echo esc_attr($used_widgets) + esc_attr($un_used_widgets); ?>)" data-labels="<?php echo esc_attr('Used, Unused'); ?>" data-value="<?php echo esc_attr($used_widgets) . ',' . esc_attr($un_used_widgets); ?>" data-bg="#FFD166, #fff4d9" data-bg-hover="#0673e1, #e71522"></canvas> |
| 423 |
</div> |
| 424 |
</div> |
| 425 |
|
| 426 |
</div> |
| 427 |
</div> |
| 428 |
<div class="bdt-width-1-2@m bdt-width-1-4@l"> |
| 429 |
<div class="bdt-widget-status bdt-card bdt-card-body" <?php echo wp_kses_post($track_nw_msg); ?>> |
| 430 |
|
| 431 |
<?php |
| 432 |
$used_only_widgets = count(self::get_used_only_widgets()); |
| 433 |
$unused_only_widgets = count(self::get_unused_only_widgets()); |
| 434 |
?> |
| 435 |
|
| 436 |
|
| 437 |
<div class="bdt-count-canvas-wrap bdt-flex bdt-flex-between"> |
| 438 |
<div class="bdt-count-wrap"> |
| 439 |
<h1 class="bdt-feature-title"><?php esc_html_e('WooCommerce', 'ultimate-store-kit'); ?></h1> |
| 440 |
<div class="bdt-widget-count"><?php esc_html_e('Used: ', 'ultimate-store-kit'); ?><b><?php echo esc_html($used_only_widgets); ?></b></div> |
| 441 |
<div class="bdt-widget-count"><?php esc_html_e('Unused: ', 'ultimate-store-kit'); ?><b><?php echo esc_html($unused_only_widgets); ?></b></div> |
| 442 |
<div class="bdt-widget-count"><?php esc_html_e('Total: ', 'ultimate-store-kit'); ?> |
| 443 |
<b><?php echo esc_html($used_only_widgets) + esc_html($unused_only_widgets); ?></b> |
| 444 |
</div> |
| 445 |
</div> |
| 446 |
|
| 447 |
<div class="bdt-canvas-wrap"> |
| 448 |
<canvas id="bdt-db-only-widget-status" style="height: 120px; width: 120px;" data-label="WooCommerce Widgets Status - (<?php echo esc_attr($used_only_widgets) + esc_attr($unused_only_widgets); ?>)" data-labels="<?php echo esc_attr('Used, Unused'); ?>" data-value="<?php echo esc_attr($used_only_widgets) . ',' . esc_attr($unused_only_widgets); ?>" data-bg="#EF476F, #ffcdd9" data-bg-hover="#0673e1, #e71522"></canvas> |
| 449 |
</div> |
| 450 |
</div> |
| 451 |
|
| 452 |
</div> |
| 453 |
</div> |
| 454 |
<div class="bdt-width-1-2@m bdt-width-1-4@l"> |
| 455 |
<div class="bdt-widget-status bdt-card bdt-card-body" <?php echo wp_kses_post($track_nw_msg); ?>> |
| 456 |
|
| 457 |
<?php |
| 458 |
$used_only_edd_widgets = count(self::get_used_only_edd_widgets()); |
| 459 |
$unused_only_edd_widgets = count(self::get_unused_only_edd_widgets()); |
| 460 |
?> |
| 461 |
|
| 462 |
|
| 463 |
<div class="bdt-count-canvas-wrap bdt-flex bdt-flex-between"> |
| 464 |
<div class="bdt-count-wrap"> |
| 465 |
<h1 class="bdt-feature-title"><?php esc_html_e('EDD', 'ultimate-store-kit'); ?></h1> |
| 466 |
<div class="bdt-widget-count"><?php esc_html_e('Used: ', 'ultimate-store-kit'); ?><b><?php echo esc_html($used_only_edd_widgets); ?></b></div> |
| 467 |
<div class="bdt-widget-count"><?php esc_html_e('Unused: ', 'ultimate-store-kit'); ?><b><?php echo esc_html($unused_only_edd_widgets); ?></b></div> |
| 468 |
<div class="bdt-widget-count"><?php esc_html_e('Total: ', 'ultimate-store-kit'); ?><b><?php echo esc_html($used_only_edd_widgets) + esc_html($unused_only_edd_widgets); ?></b> |
| 469 |
</div> |
| 470 |
</div> |
| 471 |
|
| 472 |
<div class="bdt-canvas-wrap"> |
| 473 |
<canvas id="bdt-db-only-edd_widgets-status" style="height: 120px; width: 120px;" data-label="EDD Widgets Status - (<?php echo esc_attr($used_only_edd_widgets) + esc_attr($unused_only_edd_widgets); ?>)" data-labels="<?php echo esc_attr('Used, Unused'); ?>" data-value="<?php echo esc_attr($used_only_edd_widgets) . ',' . esc_attr($unused_only_edd_widgets); ?>" data-bg="#06D6A0, #B6FFEC" data-bg-hover="#0673e1, #e71522"></canvas> |
| 474 |
</div> |
| 475 |
</div> |
| 476 |
|
| 477 |
</div> |
| 478 |
</div> |
| 479 |
|
| 480 |
<div class="bdt-width-1-2@m bdt-width-1-4@l"> |
| 481 |
<div class="bdt-widget-status bdt-card bdt-card-body" <?php echo wp_kses_post($track_nw_msg); ?>> |
| 482 |
|
| 483 |
<div class="bdt-count-canvas-wrap bdt-flex bdt-flex-between"> |
| 484 |
<div class="bdt-count-wrap"> |
| 485 |
<h1 class="bdt-feature-title"><?php esc_html_e('Active', 'ultimate-store-kit'); ?></h1> |
| 486 |
<div class="bdt-widget-count"><?php esc_html_e('WooCommerce: ', 'ultimate-store-kit'); ?><b id="bdt-total-widgets-status-core"></b></div> |
| 487 |
<div class="bdt-widget-count"><?php esc_html_e('EDD: ', 'ultimate-store-kit'); ?><b id="bdt-total-widgets-status-3rd"></b></div> |
| 488 |
<div class="bdt-widget-count"><?php esc_html_e('Total: ', 'ultimate-store-kit'); ?><b id="bdt-total-widgets-status-heading"></b></div> |
| 489 |
</div> |
| 490 |
|
| 491 |
<div class="bdt-canvas-wrap"> |
| 492 |
<canvas id="bdt-total-widgets-status" style="height: 120px; width: 120px;" data-label="Total Active Widgets Status" data-labels="<?php echo esc_attr('WooCommerce, EDD'); ?>" data-bg="#0680d6, #B0EBFF" data-bg-hover="#0673e1, #B0EBFF"> |
| 493 |
</canvas> |
| 494 |
</div> |
| 495 |
</div> |
| 496 |
|
| 497 |
</div> |
| 498 |
</div> |
| 499 |
</div> |
| 500 |
<div class="bdt-grid" bdt-grid bdt-height-match="target: > div > .bdt-card"> |
| 501 |
<div class="bdt-width-1-3@m bdt-support-section"> |
| 502 |
<div class="bdt-support-content bdt-card bdt-card-body"> |
| 503 |
<?php |
| 504 |
echo '<h1 class="bdt-feature-title">' . esc_html__('Support And Feedback', 'ultimate-store-kit') . '</h1>'; |
| 505 |
echo '<p>' . esc_html__('Feeling like to consult with an expert? Take live Chat support immediately from', 'ultimate-store-kit') . ' <a href="https://storekit.pro/" target="_blank" rel="">UltimteStoreKit</a>. ' . esc_html__('We are always ready to help you 24/7.', 'ultimate-store-kit') . '</p>'; |
| 506 |
echo '<p><strong>' . esc_html__('Or if you’re facing technical issues with our plugin, then please create a support ticket', 'ultimate-store-kit') . '</strong></p>'; |
| 507 |
echo '<a class="bdt-button bdt-btn-blue bdt-margin-small-top bdt-margin-small-right" target="_blank" rel="" href="https://bdthemes.com/all-knowledge-base-of-ultimate-store-kit/">' . esc_html__('Knowledge Base', 'ultimate-store-kit') . '</a>'; |
| 508 |
echo '<a class="bdt-button bdt-btn-grey bdt-margin-small-top" target="_blank" href="https://bdthemes.com/support/">' . esc_html__('Get Support', 'ultimate-store-kit') . '</a>'; |
| 509 |
?> |
| 510 |
</div> |
| 511 |
</div> |
| 512 |
|
| 513 |
<div class="bdt-width-2-3@m"> |
| 514 |
<div class="bdt-card bdt-card-body bdt-system-requirement"> |
| 515 |
<h1 class="bdt-feature-title bdt-margin-small-bottom"><?php esc_html_e('System Requirement', 'ultimate-store-kit'); ?></h1> |
| 516 |
<?php $this->ultimate_store_kit_system_requirement(); ?> |
| 517 |
</div> |
| 518 |
</div> |
| 519 |
</div> |
| 520 |
<div class="bdt-grid" bdt-grid bdt-height-match="target: > div > .bdt-card"> |
| 521 |
<div class="bdt-width-1-2@m bdt-support-section"> |
| 522 |
<div class="bdt-card bdt-card-body bdt-feedback-bg"> |
| 523 |
<?php |
| 524 |
echo '<h1 class="bdt-feature-title">' . esc_html__('Feedback', 'ultimate-store-kit') . '</h1>'; |
| 525 |
echo '<p>' . esc_html__('We are always looking for feedback from our users. If you have any suggestions or feedback, please let us know.', 'ultimate-store-kit') . '</p>'; |
| 526 |
echo '<a class="bdt-button bdt-btn-grey bdt-margin-small-top" target="_blank" rel="" href="https://feedback.bdthemes.com/b/6vr2250l/feature-requests/">' . esc_html__('Request Feature', 'ultimate-store-kit') . '</a>'; |
| 527 |
?> |
| 528 |
</div> |
| 529 |
</div> |
| 530 |
|
| 531 |
<div class="bdt-width-1-2@m"> |
| 532 |
<div class="bdt-card bdt-card-body bdt-tryaddon-bg"> |
| 533 |
<?php |
| 534 |
echo '<h1 class="bdt-feature-title">' . esc_html__('Try Our Others Plugins', 'ultimate-store-kit') . '</h1>'; |
| 535 |
echo '<p style="max-width: 520px;">' . esc_html__('Element Pack, Prime Slider, Ultimate Post Kit, Pixel Gallery & Live Copy Paste addons for Elementor is the best slider, blogs and eCommerce plugin for WordPress. Also, try our new plugin ZoloBlocks for Gutenberg.', 'ultimate-store-kit') . '</p>'; |
| 536 |
echo '<div class="bdt-others-plugins-link">'; |
| 537 |
echo '<a class="bdt-button bdt-btn-ep bdt-margin-small-right" target="_blank" href="https://wordpress.org/plugins/bdthemes-element-pack-lite/" bdt-tooltip="'. esc_html__('Element Pack Lite provides more than 50+ essential elements for everyday applications to simplify the whole web building process. It\'s Free! Download it.', 'ultimate-store-kit') .'">'. esc_html__('Element pack', 'ultimate-store-kit') .'</a>'; |
| 538 |
echo '<a class="bdt-button bdt-btn-ps bdt-margin-small-right" target="_blank" rel="" href="https://wordpress.org/plugins/bdthemes-prime-slider-lite/" bdt-tooltip="'. esc_html__('The revolutionary slider builder addon for Elementor with next-gen superb interface. It\'s Free! Download it.', 'ultimate-store-kit') .'">'. esc_html__('Prime Slider', 'ultimate-store-kit') .'</a>'; |
| 539 |
echo '<a class="bdt-button bdt-btn-zb bdt-margin-small-right" target="_blank" rel="" href="https://wordpress.org/plugins/zoloblocks/" bdt-tooltip="'. esc_html__('ZoloBlocks is a collection of creative Gutenberg blocks for WordPress. It\'s Free! Download it.', 'ultimate-store-kit') .'">'. esc_html__('ZoloBlocks', 'ultimate-store-kit') .'</a>'; |
| 540 |
echo '<br>'; |
| 541 |
echo '<a class="bdt-button bdt-btn-upk bdt-margin-small-right" target="_blank" rel="" href="https://wordpress.org/plugins/ultimate-post-kit/" bdt-tooltip="'. esc_html__('Best blogging addon for building quality blogging website with fine-tuned features and widgets. It\'s Free! Download it.', 'ultimate-store-kit') .'">'. esc_html__('Ultimate Post Kit', 'ultimate-store-kit') .'</a>'; |
| 542 |
echo '<a class="bdt-button bdt-btn-pg bdt-margin-small-right" target="_blank" href="https://wordpress.org/plugins/pixel-gallery/" bdt-tooltip="'. esc_html__('Pixel Gallery provides more than 30+ essential elements for everyday applications to simplify the whole web building process. It\'s Free! Download it.', 'ultimate-store-kit') .'">'. esc_html__('Pixel Gallery', 'ultimate-store-kit') .'</a>'; |
| 543 |
echo '<a class="bdt-button bdt-btn-live-copy bdt-margin-small-right" target="_blank" rel="" href="https://wordpress.org/plugins/live-copy-paste/" bdt-tooltip="'. esc_html__('Superfast cross-domain copy-paste mechanism for WordPress websites with true UI copy experience. It\'s Free! Download it.', 'ultimate-store-kit') .'">'. esc_html__('Live Copy Paste', 'ultimate-store-kit') .'</a>'; |
| 544 |
echo '</div>'; |
| 545 |
?> |
| 546 |
</div> |
| 547 |
</div> |
| 548 |
</div> |
| 549 |
</div> |
| 550 |
|
| 551 |
|
| 552 |
<?php |
| 553 |
} |
| 554 |
|
| 555 |
/** |
| 556 |
* Get Pro |
| 557 |
* |
| 558 |
* @access public |
| 559 |
* @return void |
| 560 |
*/ |
| 561 |
|
| 562 |
function ultimate_store_kit_get_pro() { |
| 563 |
?> |
| 564 |
<div class="bdt-dashboard-panel" bdt-scrollspy="target: > div > div > .bdt-card; cls: bdt-animation-slide-bottom-small; delay: 300"> |
| 565 |
|
| 566 |
<div class="bdt-grid" bdt-grid bdt-height-match="target: > div > .bdt-card" style="max-width: 800px; margin-left: auto; margin-right: auto;"> |
| 567 |
<div class="bdt-width-1-1@m bdt-comparision bdt-text-center"> |
| 568 |
<?php |
| 569 |
echo '<h1 class="bdt-text-bold">' . esc_html__('WHY GO WITH PRO?', 'ultimate-store-kit') . '</h1>'; |
| 570 |
echo '<h2>' . esc_html__('Just Compare With Ultimate Store Kit Free Vs Pro', 'ultimate-store-kit') . '</h2>'; |
| 571 |
?> |
| 572 |
<div> |
| 573 |
|
| 574 |
<ul class="bdt-list bdt-list-divider bdt-text-left bdt-text-normal" style="font-size: 16px;"> |
| 575 |
|
| 576 |
|
| 577 |
<li class="bdt-text-bold"> |
| 578 |
<div class="bdt-grid"> |
| 579 |
<?php |
| 580 |
echo '<div class="bdt-width-expand@m">' . esc_html__('Features', 'ultimate-store-kit') . '</div>'; |
| 581 |
echo '<div class="bdt-width-auto@m">' . esc_html__('Free', 'ultimate-store-kit') . '</div>'; |
| 582 |
echo '<div class="bdt-width-auto@m">' . esc_html__('Pro', 'ultimate-store-kit') . '</div>'; |
| 583 |
?> |
| 584 |
</div> |
| 585 |
</li> |
| 586 |
<li class=""> |
| 587 |
<div class="bdt-grid"> |
| 588 |
<div class="bdt-width-expand@m"><span bdt-tooltip="pos: top-left; title: Lite have 35+ Widgets but Pro have 100+ core widgets"><?php esc_html_e('Core Widgets', 'ultimate-store-kit'); ?></span></div> |
| 589 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 590 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 591 |
</div> |
| 592 |
</li> |
| 593 |
<li class=""> |
| 594 |
<div class="bdt-grid"> |
| 595 |
<?php echo '<div class="bdt-width-expand@m">' . esc_html__('Theme Compatibility', 'ultimate-store-kit') . '</div>'; ?> |
| 596 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 597 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 598 |
</div> |
| 599 |
</li> |
| 600 |
<li class=""> |
| 601 |
<div class="bdt-grid"> |
| 602 |
<?php echo '<div class="bdt-width-expand@m">' . esc_html__('Dynamic Content & Custom Fields Capabilities', 'ultimate-store-kit') . '</div>'; ?> |
| 603 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 604 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 605 |
</div> |
| 606 |
</li> |
| 607 |
<li class=""> |
| 608 |
<div class="bdt-grid"> |
| 609 |
<?php echo '<div class="bdt-width-expand@m">' . esc_html__('Proper Documentation', 'ultimate-store-kit') . '</div>'; ?> |
| 610 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 611 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 612 |
</div> |
| 613 |
</li> |
| 614 |
<li class=""> |
| 615 |
<div class="bdt-grid"> |
| 616 |
<?php echo '<div class="bdt-width-expand@m">' . esc_html__('Updates & Support', 'ultimate-store-kit') . '</div>'; ?> |
| 617 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 618 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 619 |
</div> |
| 620 |
</li> |
| 621 |
<li class=""> |
| 622 |
<div class="bdt-grid"> |
| 623 |
<?php echo '<div class="bdt-width-expand@m">' . esc_html__('Rooten Theme Pro Features', 'ultimate-store-kit') . '</div>'; ?> |
| 624 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-no"></span></div> |
| 625 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 626 |
</div> |
| 627 |
</li> |
| 628 |
<li class=""> |
| 629 |
<div class="bdt-grid"> |
| 630 |
<div class="bdt-width-expand@m"><?php echo esc_html__('Priority Support', 'ultimate-store-kit'); ?></div> |
| 631 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-no"></span></div> |
| 632 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 633 |
</div> |
| 634 |
</li> |
| 635 |
<li class=""> |
| 636 |
<div class="bdt-grid"> |
| 637 |
<div class="bdt-width-expand@m"><?php echo esc_html__('Ready Made Blocks', 'ultimate-store-kit'); ?></div> |
| 638 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 639 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 640 |
</div> |
| 641 |
</li> |
| 642 |
<li class=""> |
| 643 |
<div class="bdt-grid"> |
| 644 |
<div class="bdt-width-expand@m"><?php echo esc_html__('Ready Made Pages', 'ultimate-store-kit'); ?></div> |
| 645 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 646 |
<div class="bdt-width-auto@m"><span class="dashicons dashicons-yes"></span></div> |
| 647 |
</div> |
| 648 |
</li> |
| 649 |
</ul> |
| 650 |
|
| 651 |
|
| 652 |
<div class="bdt-dashboard-divider"></div> |
| 653 |
|
| 654 |
|
| 655 |
<div class="bdt-more-features"> |
| 656 |
<ul class="bdt-list bdt-list-divider bdt-text-left" style="font-size: 16px;"> |
| 657 |
<li> |
| 658 |
<div class="bdt-grid"> |
| 659 |
<div class="bdt-width-1-3@m"> |
| 660 |
<span class="dashicons dashicons-heart"></span><?php esc_html_e(' Incredibly Advanced', 'ultimate-store-kit'); ?> |
| 661 |
</div> |
| 662 |
<div class="bdt-width-1-3@m"> |
| 663 |
<span class="dashicons dashicons-heart"></span><?php esc_html_e(' Refund or Cancel Anytime', 'ultimate-store-kit'); ?> |
| 664 |
</div> |
| 665 |
<div class="bdt-width-1-3@m"> |
| 666 |
<span class="dashicons dashicons-heart"></span><?php esc_html_e(' Dynamic Content', 'ultimate-store-kit'); ?> |
| 667 |
</div> |
| 668 |
</div> |
| 669 |
</li> |
| 670 |
|
| 671 |
<li> |
| 672 |
<div class="bdt-grid"> |
| 673 |
<div class="bdt-width-1-3@m"> |
| 674 |
<span class="dashicons dashicons-heart"></span><?php esc_html_e(' Super-Flexible Widgets', 'ultimate-store-kit'); ?> |
| 675 |
</div> |
| 676 |
<div class="bdt-width-1-3@m"> |
| 677 |
<span class="dashicons dashicons-heart"></span><?php esc_html_e(' 24/7 Premium Support', 'ultimate-store-kit'); ?> |
| 678 |
</div> |
| 679 |
<div class="bdt-width-1-3@m"> |
| 680 |
<span class="dashicons dashicons-heart"></span><?php esc_html_e(' Third Party Plugins', 'ultimate-store-kit'); ?> |
| 681 |
</div> |
| 682 |
</div> |
| 683 |
</li> |
| 684 |
|
| 685 |
<li> |
| 686 |
<div class="bdt-grid"> |
| 687 |
<div class="bdt-width-1-3@m"> |
| 688 |
<span class="dashicons dashicons-heart"></span><?php esc_html_e(' Special Discount!', 'ultimate-store-kit'); ?> |
| 689 |
</div> |
| 690 |
<div class="bdt-width-1-3@m"> |
| 691 |
<span class="dashicons dashicons-heart"></span><?php esc_html_e(' Custom Field Integration', 'ultimate-store-kit'); ?> |
| 692 |
</div> |
| 693 |
<div class="bdt-width-1-3@m"> |
| 694 |
<span class="dashicons dashicons-heart"></span><?php esc_html_e(' With Live Chat Support', 'ultimate-store-kit'); ?> |
| 695 |
</div> |
| 696 |
</div> |
| 697 |
</li> |
| 698 |
|
| 699 |
<li> |
| 700 |
<div class="bdt-grid"> |
| 701 |
<div class="bdt-width-1-3@m"> |
| 702 |
<span class="dashicons dashicons-heart"></span><?php esc_html_e(' Trusted Payment Methods', 'ultimate-store-kit'); ?> |
| 703 |
</div> |
| 704 |
<div class="bdt-width-1-3@m"> |
| 705 |
<span class="dashicons dashicons-heart"></span><?php esc_html_e(' Interactive Effects', 'ultimate-store-kit'); ?> |
| 706 |
</div> |
| 707 |
<div class="bdt-width-1-3@m"> |
| 708 |
<span class="dashicons dashicons-heart"></span><?php esc_html_e(' Video Tutorial', 'ultimate-store-kit'); ?> |
| 709 |
</div> |
| 710 |
</div> |
| 711 |
</li> |
| 712 |
</ul> |
| 713 |
|
| 714 |
<!-- <div class="bdt-dashboard-divider"></div> --> |
| 715 |
|
| 716 |
<?php if (true !== _is_usk_pro_activated()) : ?> |
| 717 |
<div class="bdt-purchase-button"> |
| 718 |
<a href="https://storekit.pro/pricing" target="_blank"><?php esc_html_e('Purchase Now', 'ultimate-store-kit'); ?></a> |
| 719 |
</div> |
| 720 |
<?php endif; ?> |
| 721 |
|
| 722 |
</div> |
| 723 |
|
| 724 |
</div> |
| 725 |
</div> |
| 726 |
</div> |
| 727 |
|
| 728 |
</div> |
| 729 |
<?php |
| 730 |
} |
| 731 |
|
| 732 |
|
| 733 |
function ultimate_store_kit_system_requirement() { |
| 734 |
$php_version = phpversion(); |
| 735 |
$max_execution_time = ini_get('max_execution_time'); |
| 736 |
$memory_limit = ini_get('memory_limit'); |
| 737 |
$post_limit = ini_get('post_max_size'); |
| 738 |
$uploads = wp_upload_dir(); |
| 739 |
$upload_path = $uploads['basedir']; |
| 740 |
$yes_icon = '<i class="dashicons-before dashicons-yes"></i>'; |
| 741 |
$no_icon = '<i class="dashicons-before dashicons-no-alt"></i>'; |
| 742 |
$icon_validation = [ |
| 743 |
'i' => [ |
| 744 |
'class' => [] |
| 745 |
] |
| 746 |
]; |
| 747 |
|
| 748 |
$environment = Utils::get_environment_info(); |
| 749 |
|
| 750 |
?> |
| 751 |
<ul class="check-system-status bdt-grid bdt-child-width-1-2@m bdt-grid-small "> |
| 752 |
<li> |
| 753 |
<div> |
| 754 |
|
| 755 |
<span class="label1"><?php esc_html_e('PHP Version:', 'ultimate-store-kit'); ?> </span> |
| 756 |
|
| 757 |
<?php |
| 758 |
if (version_compare($php_version, '7.0.0', '<')) { |
| 759 |
printf('<span class="invalid">%1$s</span>', wp_kses($no_icon, $icon_validation)); |
| 760 |
printf('<span class="label2">Currently: %1$s (Min: 7.0 Recommended)</span>', esc_html($php_version)); |
| 761 |
} else { |
| 762 |
printf('<span class="valid">%1$s</span>', wp_kses($yes_icon, $icon_validation)); |
| 763 |
printf('<span class="label2">Currently: %1$s</span>', esc_html($php_version)); |
| 764 |
} |
| 765 |
?> |
| 766 |
</div> |
| 767 |
</li> |
| 768 |
|
| 769 |
<li> |
| 770 |
<div> |
| 771 |
<span class="label1"><?php esc_html_e('Maximum execution time:', 'ultimate-store-kit'); ?> </span> |
| 772 |
|
| 773 |
<?php |
| 774 |
if ($max_execution_time < '90') { |
| 775 |
printf('<span class="invalid">%1$s</span>', wp_kses($no_icon, $icon_validation)); |
| 776 |
printf('<span class="label2">Currently: %1$s ( Min: 90 Recommended)</span>', esc_html($max_execution_time)); |
| 777 |
} else { |
| 778 |
printf('<span class="valid">%1$s</span>', wp_kses($yes_icon, $icon_validation)); |
| 779 |
printf('<span class="label2">Currently: %1$s</span>', esc_html($max_execution_time)); |
| 780 |
} |
| 781 |
?> |
| 782 |
</div> |
| 783 |
</li> |
| 784 |
<li> |
| 785 |
<div> |
| 786 |
<span class="label1"><?php esc_html_e('Memory Limit:', 'ultimate-store-kit'); ?> </span> |
| 787 |
|
| 788 |
<?php |
| 789 |
if (intval($memory_limit) < '256') { |
| 790 |
printf('<span class="invalid">%1$s</span>', wp_kses($no_icon, $icon_validation)); |
| 791 |
printf('<span class="label2">Currently: %1$s (Min: 256M Recommended)</span>', esc_html($memory_limit)); |
| 792 |
} else { |
| 793 |
printf('<span class="valid">%1$s</span>', wp_kses($yes_icon, $icon_validation)); |
| 794 |
printf('<span class="label2">Currently: %1$s</span>', esc_html($memory_limit)); |
| 795 |
} |
| 796 |
?> |
| 797 |
</div> |
| 798 |
</li> |
| 799 |
|
| 800 |
<li> |
| 801 |
<div> |
| 802 |
<span class="label1"><?php esc_html_e('Max Post Limit:', 'ultimate-store-kit'); ?> </span> |
| 803 |
|
| 804 |
<?php |
| 805 |
if (intval($post_limit) < '32') { |
| 806 |
printf('<span class="invalid">%1$s</span>', wp_kses($no_icon, $icon_validation)); |
| 807 |
printf('<span class="label2">Currently: %1$s (Min: 32M Recommended)</span>', esc_html($post_limit)); |
| 808 |
} else { |
| 809 |
printf('<span class="valid">%1$s</span>', wp_kses($yes_icon, $icon_validation)); |
| 810 |
printf('<span class="label2">Currently: %1$s</span>', esc_html($post_limit)); |
| 811 |
} |
| 812 |
?> |
| 813 |
</div> |
| 814 |
</li> |
| 815 |
|
| 816 |
<li> |
| 817 |
<div> |
| 818 |
<span class="label1"><?php esc_html_e('Uploads folder writable:', 'ultimate-store-kit'); ?></span> |
| 819 |
|
| 820 |
<?php |
| 821 |
if (!is_writable($upload_path)) { |
| 822 |
printf('<span class="invalid">%1$s</span>', wp_kses($no_icon, $icon_validation)); |
| 823 |
} else { |
| 824 |
printf('<span class="valid">%1$s</span>', wp_kses($yes_icon, $icon_validation)); |
| 825 |
} |
| 826 |
?> |
| 827 |
</div> |
| 828 |
</li> |
| 829 |
|
| 830 |
<li> |
| 831 |
<div> |
| 832 |
<span class="label1"><?php esc_html_e('MultiSite: ', 'ultimate-store-kit'); ?></span> |
| 833 |
|
| 834 |
<?php |
| 835 |
if ($environment['wp_multisite']) { |
| 836 |
printf('<span class="valid">%1$s</span>', wp_kses($yes_icon, $icon_validation)); |
| 837 |
echo '<span class="label2">MultiSite</span>'; |
| 838 |
} else { |
| 839 |
printf('<span class="invalid">%1$s</span>', wp_kses($no_icon, $icon_validation)); |
| 840 |
echo '<span class="label2">No MultiSite </span>'; |
| 841 |
} |
| 842 |
?> |
| 843 |
</div> |
| 844 |
</li> |
| 845 |
|
| 846 |
<li> |
| 847 |
<div> |
| 848 |
<span class="label1"><?php esc_html_e('GZip Enabled:', 'ultimate-store-kit'); ?></span> |
| 849 |
|
| 850 |
<?php |
| 851 |
if ($environment['gzip_enabled']) { |
| 852 |
printf('<span class="valid">%1$s</span>', wp_kses($yes_icon, $icon_validation)); |
| 853 |
} else { |
| 854 |
printf('<span class="invalid">%1$s</span>', wp_kses($no_icon, $icon_validation)); |
| 855 |
} |
| 856 |
?> |
| 857 |
</div> |
| 858 |
</li> |
| 859 |
|
| 860 |
<li> |
| 861 |
<div> |
| 862 |
<span class="label1"><?php esc_html_e('Debug Mode: ', 'ultimate-store-kit'); ?></span> |
| 863 |
<?php |
| 864 |
if ($environment['wp_debug_mode']) { |
| 865 |
printf('<span class="invalid">%1$s</span>', wp_kses($no_icon, $icon_validation)); |
| 866 |
echo '<span class="label2">Currently Turned On</span>'; |
| 867 |
} else { |
| 868 |
printf('<span class="valid">%1$s</span>', wp_kses($yes_icon, $icon_validation)); |
| 869 |
echo '<span class="label2">Currently Turned Off</span>'; |
| 870 |
} |
| 871 |
?> |
| 872 |
</div> |
| 873 |
</li> |
| 874 |
|
| 875 |
</ul> |
| 876 |
|
| 877 |
<div class="bdt-admin-alert"> |
| 878 |
<strong><?php esc_html_e('Note:', 'ultimate-store-kit'); ?></strong> <?php esc_html_e('If you have multiple addons like'); ?> <b><?php esc_html_e('Ultimate Store Kit', 'ultimate-store-kit'); ?></b> |
| 879 |
<?php esc_html_e('so you need some more requirement some |
| 880 |
cases so make sure you added more memory for others addon too.', 'ultimate-store-kit'); ?> |
| 881 |
</div> |
| 882 |
<?php |
| 883 |
} |
| 884 |
|
| 885 |
function plugin_page() { |
| 886 |
|
| 887 |
echo '<div class="wrap ultimate-store-kit-dashboard">'; |
| 888 |
printf('<h1>%1$s '.esc_html__('Settings', 'ultimate-store-kit').'</h1>', esc_html(BDTUSK_TITLE)); |
| 889 |
|
| 890 |
$this->settings_api->show_navigation(); |
| 891 |
|
| 892 |
?> |
| 893 |
|
| 894 |
<div class="bdt-switcher bdt-tab-container bdt-container-xlarge" style="touch-action: pan-y pinch-zoom;"> |
| 895 |
<!-- <div class="bdt-switcher"> --> |
| 896 |
<div id="ultimate_store_kit_welcome_page" class="bdt-option-page group"> |
| 897 |
<?php $this->ultimate_store_kit_welcome(); ?> |
| 898 |
</div> |
| 899 |
|
| 900 |
<?php |
| 901 |
$this->settings_api->show_forms(); |
| 902 |
?> |
| 903 |
|
| 904 |
<?php if (_is_usk_pro_activated() !== true) : ?> |
| 905 |
<div id="ultimate_store_kit_get_pro" class="bdt-option-page group"> |
| 906 |
<?php $this->ultimate_store_kit_get_pro(); ?> |
| 907 |
</div> |
| 908 |
<?php endif; ?> |
| 909 |
|
| 910 |
<div id="ultimate_store_kit_license_settings_page" class="bdt-option-page group"> |
| 911 |
|
| 912 |
<?php |
| 913 |
if (_is_usk_pro_activated() == true) { |
| 914 |
apply_filters('usk_license_page', ''); |
| 915 |
} |
| 916 |
|
| 917 |
?> |
| 918 |
|
| 919 |
<?php if (!defined('BDTUSK_WL')) { |
| 920 |
$this->footer_info(); |
| 921 |
} ?> |
| 922 |
</div> |
| 923 |
|
| 924 |
</div> |
| 925 |
|
| 926 |
</div> |
| 927 |
|
| 928 |
<?php if (!defined('BDTUSK_WL')) { |
| 929 |
//$this->footer_info(); |
| 930 |
} ?> |
| 931 |
|
| 932 |
<?php |
| 933 |
|
| 934 |
$this->script(); |
| 935 |
|
| 936 |
?> |
| 937 |
|
| 938 |
<?php |
| 939 |
} |
| 940 |
|
| 941 |
/** |
| 942 |
* Tabbable JavaScript codes & Initiate Color Picker |
| 943 |
* |
| 944 |
* This code uses localstorage for displaying active tabs |
| 945 |
*/ |
| 946 |
/** |
| 947 |
* Tabbable JavaScript codes & Initiate Color Picker |
| 948 |
* |
| 949 |
* This code uses localstorage for displaying active tabs |
| 950 |
*/ |
| 951 |
function script() { |
| 952 |
?> |
| 953 |
<script> |
| 954 |
jQuery(document).ready(function() { |
| 955 |
jQuery('.bdt-no-result').removeClass('bdt-animation-shake'); |
| 956 |
}); |
| 957 |
|
| 958 |
function filterSearch(e) { |
| 959 |
var parentID = '#' + jQuery(e).data('id'); |
| 960 |
var search = jQuery(parentID).find('.bdt-search-input').val().toLowerCase(); |
| 961 |
|
| 962 |
jQuery(".bdt-options .usk-option-item").filter(function() { |
| 963 |
jQuery(this).toggle(jQuery(this).attr('data-widget-name').toLowerCase().indexOf(search) > -1) |
| 964 |
}); |
| 965 |
|
| 966 |
if (!search) { |
| 967 |
jQuery(parentID).find('.bdt-search-input').attr('bdt-filter-control', ""); |
| 968 |
jQuery(parentID).find('.bdt-widget-all').trigger('click'); |
| 969 |
} else { |
| 970 |
jQuery(parentID).find('.bdt-search-input').attr('bdt-filter-control', "filter: [data-widget-name*='" + search + "']"); |
| 971 |
jQuery(parentID).find('.bdt-search-input').removeClass('bdt-active'); // Thanks to Bar-Rabbas |
| 972 |
jQuery(parentID).find('.bdt-search-input').trigger('click'); |
| 973 |
} |
| 974 |
} |
| 975 |
|
| 976 |
jQuery('.bdt-options-parent').each(function(e, item) { |
| 977 |
var eachItem = '#' + jQuery(item).attr('id'); |
| 978 |
jQuery(eachItem).on("beforeFilter", function() { |
| 979 |
jQuery(eachItem).find('.bdt-no-result').removeClass('bdt-animation-shake'); |
| 980 |
}); |
| 981 |
|
| 982 |
jQuery(eachItem).on("afterFilter", function() { |
| 983 |
|
| 984 |
var isElementVisible = false; |
| 985 |
var i = 0; |
| 986 |
|
| 987 |
if (jQuery(eachItem).closest(".usk-options-parent").eq(i).is(":visible")) {} else { |
| 988 |
isElementVisible = true; |
| 989 |
} |
| 990 |
|
| 991 |
while (!isElementVisible && i < jQuery(eachItem).find(".bdt-option-item").length) { |
| 992 |
if (jQuery(eachItem).find(".bdt-option-item").eq(i).is(":visible")) { |
| 993 |
isElementVisible = true; |
| 994 |
} |
| 995 |
i++; |
| 996 |
} |
| 997 |
|
| 998 |
if (isElementVisible === false) { |
| 999 |
jQuery(eachItem).find('.bdt-no-result').addClass('bdt-animation-shake'); |
| 1000 |
} |
| 1001 |
}); |
| 1002 |
|
| 1003 |
|
| 1004 |
}); |
| 1005 |
|
| 1006 |
|
| 1007 |
jQuery('.bdt-widget-filter-nav li a').on('click', function(e) { |
| 1008 |
jQuery(this).closest('.bdt-widget-filter-wrapper').find('.bdt-search-input').val(''); |
| 1009 |
jQuery(this).closest('.bdt-widget-filter-wrapper').find('.bdt-search-input').val('').attr('bdt-filter-control', ''); |
| 1010 |
}); |
| 1011 |
|
| 1012 |
|
| 1013 |
jQuery(document).ready(function($) { |
| 1014 |
'use strict'; |
| 1015 |
|
| 1016 |
function hashHandler() { |
| 1017 |
var $tab = jQuery('.ultimate-store-kit-dashboard .bdt-tab'); |
| 1018 |
if (window.location.hash) { |
| 1019 |
var hash = window.location.hash.substring(1); |
| 1020 |
bdtUIkit.tab($tab).show(jQuery('#bdt-' + hash).data('tab-index')); |
| 1021 |
} |
| 1022 |
} |
| 1023 |
|
| 1024 |
jQuery(window).on('load', function() { |
| 1025 |
hashHandler(); |
| 1026 |
}); |
| 1027 |
|
| 1028 |
window.addEventListener("hashchange", hashHandler, true); |
| 1029 |
|
| 1030 |
jQuery('.toplevel_page_ultimate_store_kit_options > ul > li > a ').on('click', function(event) { |
| 1031 |
jQuery(this).parent().siblings().removeClass('current'); |
| 1032 |
jQuery(this).parent().addClass('current'); |
| 1033 |
}); |
| 1034 |
|
| 1035 |
jQuery('#ultimate_store_kit_active_modules_page a.bdt-active-all-widget').click(function(e) { |
| 1036 |
e.preventDefault(); |
| 1037 |
jQuery('#ultimate_store_kit_active_modules_page .usk-option-item:not(.usk-pro-inactive) .checkbox:visible').not("[disabled]").each(function() { |
| 1038 |
jQuery(this).attr('checked', 'checked').prop("checked", true); |
| 1039 |
}); |
| 1040 |
|
| 1041 |
jQuery(this).addClass('bdt-active'); |
| 1042 |
jQuery('a.bdt-deactive-all-widget').removeClass('bdt-active'); |
| 1043 |
}); |
| 1044 |
|
| 1045 |
jQuery('#ultimate_store_kit_active_modules_page a.bdt-deactive-all-widget').click(function(e) { |
| 1046 |
e.preventDefault(); |
| 1047 |
jQuery('#ultimate_store_kit_active_modules_page .usk-option-item:not(.usk-pro-inactive) .checkbox:visible').not("[disabled]").each(function() { |
| 1048 |
jQuery(this).removeAttr('checked'); |
| 1049 |
}); |
| 1050 |
|
| 1051 |
jQuery(this).addClass('bdt-active'); |
| 1052 |
jQuery('a.bdt-active-all-widget').removeClass('bdt-active'); |
| 1053 |
}); |
| 1054 |
|
| 1055 |
jQuery('#ultimate_store_kit_edd_modules_page a.bdt-active-all-widget').click(function() { |
| 1056 |
|
| 1057 |
jQuery('#ultimate_store_kit_edd_modules_page .checkbox:visible').not("[disabled]").each(function() { |
| 1058 |
jQuery(this).attr('checked', 'checked').prop("checked", true); |
| 1059 |
}); |
| 1060 |
|
| 1061 |
jQuery(this).addClass('bdt-active'); |
| 1062 |
jQuery('a.bdt-deactive-all-widget').removeClass('bdt-active'); |
| 1063 |
}); |
| 1064 |
|
| 1065 |
jQuery('#ultimate_store_kit_edd_modules_page a.bdt-deactive-all-widget').click(function() { |
| 1066 |
|
| 1067 |
jQuery('#ultimate_store_kit_edd_modules_page .checkbox:visible').not("[disabled]").each(function() { |
| 1068 |
jQuery(this).removeAttr('checked'); |
| 1069 |
}); |
| 1070 |
|
| 1071 |
jQuery(this).addClass('bdt-active'); |
| 1072 |
jQuery('a.bdt-active-all-widget').removeClass('bdt-active'); |
| 1073 |
}); |
| 1074 |
|
| 1075 |
/** |
| 1076 |
* Others Widget |
| 1077 |
*/ |
| 1078 |
jQuery('#ultimate_store_kit_general_modules_page a.bdt-active-all-widget').click(function() { |
| 1079 |
|
| 1080 |
jQuery('#ultimate_store_kit_general_modules_page .checkbox:visible').not("[disabled]").each(function() { |
| 1081 |
jQuery(this).attr('checked', 'checked').prop("checked", true); |
| 1082 |
}); |
| 1083 |
|
| 1084 |
jQuery(this).addClass('bdt-active'); |
| 1085 |
jQuery('a.bdt-deactive-all-widget').removeClass('bdt-active'); |
| 1086 |
}); |
| 1087 |
|
| 1088 |
jQuery('#ultimate_store_kit_general_modules_page a.bdt-deactive-all-widget').click(function() { |
| 1089 |
|
| 1090 |
jQuery('#ultimate_store_kit_general_modules_page .checkbox:visible').not("[disabled]").each(function() { |
| 1091 |
jQuery(this).removeAttr('checked'); |
| 1092 |
}); |
| 1093 |
|
| 1094 |
jQuery(this).addClass('bdt-active'); |
| 1095 |
jQuery('a.bdt-active-all-widget').removeClass('bdt-active'); |
| 1096 |
}); |
| 1097 |
|
| 1098 |
|
| 1099 |
jQuery('form.settings-save').submit(function(event) { |
| 1100 |
event.preventDefault(); |
| 1101 |
|
| 1102 |
bdtUIkit.notification({ |
| 1103 |
message: '<div bdt-spinner></div> <?php esc_html_e('Please wait, Saving settings...', 'ultimate-store-kit') ?>', |
| 1104 |
timeout: false |
| 1105 |
}); |
| 1106 |
|
| 1107 |
jQuery(this).ajaxSubmit({ |
| 1108 |
success: function() { |
| 1109 |
bdtUIkit.notification.closeAll(); |
| 1110 |
bdtUIkit.notification({ |
| 1111 |
message: '<span class="dashicons dashicons-yes"></span> <?php esc_html_e('Settings Saved Successfully.', 'ultimate-store-kit') ?>', |
| 1112 |
status: 'primary' |
| 1113 |
}); |
| 1114 |
}, |
| 1115 |
error: function(data) { |
| 1116 |
bdtUIkit.notification.closeAll(); |
| 1117 |
bdtUIkit.notification({ |
| 1118 |
message: '<span bdt-icon=\'icon: warning\'></span> <?php esc_html_e('Unknown error, make sure access is correct!', 'ultimate-store-kit') ?>', |
| 1119 |
status: 'warning' |
| 1120 |
}); |
| 1121 |
} |
| 1122 |
}); |
| 1123 |
|
| 1124 |
return false; |
| 1125 |
}); |
| 1126 |
|
| 1127 |
jQuery('#ultimate_store_kit_active_modules_page .usk-pro-inactive .checkbox').each(function() { |
| 1128 |
jQuery(this).removeAttr('checked'); |
| 1129 |
jQuery(this).attr("disabled", true); |
| 1130 |
}); |
| 1131 |
jQuery('#ultimate_store_kit_edd_modules_page .usk-pro-inactive .checkbox').each(function() { |
| 1132 |
jQuery(this).removeAttr('checked'); |
| 1133 |
jQuery(this).attr("disabled", true); |
| 1134 |
}); |
| 1135 |
jQuery('#ultimate_store_kit_general_modules_page .usk-pro-inactive .checkbox').each(function() { |
| 1136 |
jQuery(this).removeAttr('checked'); |
| 1137 |
jQuery(this).attr("disabled", true); |
| 1138 |
}); |
| 1139 |
|
| 1140 |
|
| 1141 |
}); |
| 1142 |
</script> |
| 1143 |
<?php |
| 1144 |
} |
| 1145 |
|
| 1146 |
function footer_info() { |
| 1147 |
?> |
| 1148 |
<div class="ultimate-store-kit-footer-info"> |
| 1149 |
<p><?php esc_html_e('Ultimate Store Kit Addon made with love by', 'ultimate-store-kit'); ?> <a target="_blank" href="https://bdthemes.com"><?php esc_html_e('BdThemes', 'ultimate-store-kit'); ?></a> <?php esc_html_e('Team.', 'ultimate-store-kit'); ?> <br><?php esc_html_e('All |
| 1150 |
rights reserved by BdThemes.', 'ultimate-store-kit'); ?></p> |
| 1151 |
</div> |
| 1152 |
<?php |
| 1153 |
} |
| 1154 |
|
| 1155 |
/** |
| 1156 |
* Get all the pages |
| 1157 |
* |
| 1158 |
* @return array page names with key value pairs |
| 1159 |
*/ |
| 1160 |
function get_pages() { |
| 1161 |
$pages = get_pages(); |
| 1162 |
$pages_options = []; |
| 1163 |
if ($pages) { |
| 1164 |
foreach ($pages as $page) { |
| 1165 |
$pages_options[$page->ID] = $page->post_title; |
| 1166 |
} |
| 1167 |
} |
| 1168 |
|
| 1169 |
return $pages_options; |
| 1170 |
} |
| 1171 |
} |
| 1172 |
|
| 1173 |
new UltimateStoreKit_Admin_Settings(); |