1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
|
<?php // BSF CORE commom functions if(!function_exists('bsf_get_option')) { function bsf_get_option($request = false) { $bsf_options = get_option('bsf_options'); if(!$request) return $bsf_options; else return (isset($bsf_options[$request])) ? $bsf_options[$request] : false; } } if(!function_exists('bsf_update_option')) { function bsf_update_option($request, $value) { $bsf_options = get_option('bsf_options'); $bsf_options[$request] = $value; return update_option('bsf_options', $bsf_options); } } add_action( 'wp_ajax_bsf_dismiss_notice', 'bsf_dismiss_notice'); if(!function_exists('bsf_dismiss_notice')) { function bsf_dismiss_notice() { check_ajax_referer( 'bsf-dismiss-notice-nonce', 'security' ); $notice = $_POST['notice']; $x = bsf_update_option($notice, true); echo ($x) ? true : false; die(); } }
add_action('admin_init', 'bsf_core_check',10); if(!function_exists('bsf_core_check')) { function bsf_core_check() { if(!defined('BSF_CORE')) { if(!bsf_get_option('hide-bsf-core-notice')) add_action( 'admin_notices', 'bsf_core_admin_notice' ); } } }
if(!function_exists('bsf_core_admin_notice')) { function bsf_core_admin_notice() { ?> <script type="text/javascript"> (function($){ $(document).ready(function(){ $(document).on( "click", ".bsf-notice", function() { var bsf_notice_name = $(this).attr("data-bsf-notice"); $.ajax({ url: ajaxurl, method: 'POST', data: { action: "bsf_dismiss_notice", security: "<?php echo wp_create_nonce( 'bsf-dismiss-notice-nonce' ); ?>", notice: bsf_notice_name }, success: function(response) { console.log(response); } }) }) }); })(jQuery); </script> <div class="bsf-notice update-nag notice is-dismissible" data-bsf-notice="hide-bsf-core-notice"> <p><?php _e( 'License registration and extensions are not part of plugin/theme anymore. Kindly download and install "BSF CORE" plugin to manage your licenses and extensins.', 'bsf' ); ?></p> </div> <?php } }
if(isset($_GET['hide-bsf-core-notice']) && $_GET['hide-bsf-core-notice'] === 're-enable') { $x = bsf_update_option('hide-bsf-core-notice', false); }
// end of common functions
if(!class_exists('Ultimate_Admin_Area')){ class Ultimate_Admin_Area{ function __construct(){ /* add admin menu */ add_action( 'admin_menu', array($this,'register_brainstorm_menu'),99);
add_action( 'admin_enqueue_scripts', array($this, 'bsf_admin_scripts_updater'), 1); add_action( 'wp_ajax_update_ultimate_options', array($this,'update_settings')); add_action( 'wp_ajax_update_ultimate_debug_options', array($this,'update_debug_settings')); add_action( 'wp_ajax_update_ultimate_modules', array($this,'update_modules')); add_action( 'wp_ajax_update_css_options', array($this,'update_css_options')); add_action( 'wp_ajax_update_dev_notes', array($this,'update_dev_notes')); add_filter( 'update_footer', array($this, 'debug_link'),999); }
function debug_link($text) { $screen = get_current_screen(); $array = array( 'ultimate_page_ultimate-scripts-and-styles', 'ultimate_page_ultimate-smoothscroll', 'ultimate_page_ultimate-dashboard', 'toplevel_page_about-ultimate', 'ultimate_page_ultimate-product-license', 'settings_page_ultimate-product-license', 'admin_page_ultimate-debug-settings', 'settings_page_ultimate-product-license-network' );
if( ! in_array( $screen->id, $array ) ) { return $text; }
$author_extend = '';
$link = ''; $debug_url = admin_url( 'admin.php?page=ultimate-debug-settings' ); $license_link = bsf_registration_page_url( "&activation_method=license-key$author_extend", '6892199' );
if( isset( $_GET['author'] ) ){ $author_extend = '&author'; $license_link = add_query_arg( 'author', '', $license_link ); }
$link .= '<a href="' . $debug_url . ' ">Ultimate Addons debug settings</a>'; //$link .= ' | <a href="' . $license_link . ' ">Activate license using purchase key</a>';
return $link; }
function bsf_admin_scripts_updater($hook){ if(defined('OPN_VERSION')) { echo "<style> @font-face { font-family: 'opn'; src:url('".plugins_url( 'fonts/opn.eot', __FILE__ )."'); src:url('".plugins_url( 'fonts/opn.eot', __FILE__ )."') format('embedded-opentype'), url('".plugins_url( 'fonts/opn.woff', __FILE__ )."') format('woff'), url('".plugins_url( 'fonts/opn.ttf', __FILE__ )."') format('truetype'), url('".plugins_url( 'fonts/opn.svg', __FILE__ )."') format('svg'); font-weight: normal; font-style: normal; } .toplevel_page_opn-settings > div.wp-menu-image:before { content: \"\\e600\" !important; font-family: 'opn' !important; } </style>"; } echo " <style> @font-face { font-family: 'ultimate'; src:url('".plugins_url( 'fonts/ultimate.eot', __FILE__ )."'); src:url('".plugins_url( 'fonts/ultimate.eot', __FILE__ )."') format('embedded-opentype'), url('".plugins_url( 'fonts/ultimate.woff', __FILE__ )."') format('woff'), url('".plugins_url( 'fonts/ultimate.ttf', __FILE__ )."') format('truetype'), url('".plugins_url( 'fonts/ultimate.svg', __FILE__ )."') format('svg'); font-weight: normal; font-style: normal; } .toplevel_page_about-ultimate > div.wp-menu-image:before { content: \"\\e600\" !important; font-family: 'ultimate' !important; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-size:24px; } .toplevel_page_about-ultimate a[href=\"admin.php?page=font-icon-Manager\"] { display: none !important; } .toplevel_page_about-ultimate a[href=\"admin.php?page=ultimate-font-manager\"] { display: none !important; } </style> "; if($hook == "post.php" || $hook == "post-new.php" || $hook == 'ultimate_page_about-ultimate' || $hook == 'visual-composer_page_vc-roles' || $hook == 'toplevel_page_about-ultimate' || $hook == 'ultimate_page_ultimate-dashboard' || $hook == 'ultimate_page_ultimate-smoothscroll' || $hook == 'ultimate_page_ultimate-scripts-and-styles' || $hook == 'ultimate_page_ultimate-product-license' || $hook == 'admin_page_ultimate-debug-settings' || $hook == 'ultimate_page_bsf-google-maps' || $hook == 'settings_page_ultimate-product-license' ){
$css_ext = '.min.css'; if ( is_rtl() ) { $css_ext = '.min-rtl.css'; }
$bsf_dev_mode = bsf_get_option('dev_mode');
wp_register_style("ultimate-admin-style", UAVC_URL."admin/css/style.css");
wp_register_style("ultimate-chosen-style", UAVC_URL.'admin/vc_extend/css/chosen.css'); wp_register_script("ultimate-chosen-script", UAVC_URL."admin/vc_extend/js/chosen.js");
wp_register_script("ultimate-vc-backend-script", UAVC_URL."admin/js/ultimate-vc-backend.min.js",array('jquery'),ULTIMATE_VERSION,true); wp_register_style("ultimate-vc-backend-style", UAVC_URL.'admin/css/ultimate-vc-backend' . $css_ext);
if($bsf_dev_mode === 'enable') { wp_enqueue_style('ultimate-admin-style'); } else { wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script('ultimate-vc-backend-script'); wp_enqueue_style('ultimate-vc-backend-style'); } }
wp_localize_script( 'jquery', 'uavc', array( 'add_zipped_font' => wp_create_nonce( 'smile-add-zipped-fonts-nonce' ), 'remove_zipped_font' => wp_create_nonce( 'smile-remove-zipped-fonts-nonce' ), 'get_font_variants' => wp_create_nonce( 'uavc-get-font-variants-nonce' ), 'ult_get_attachment_url' => wp_create_nonce( 'uavc-get-attachment-url-nonce' ), ) ); }/* end admin_scripts */
function register_brainstorm_menu(){
if ( is_multisite() && ! current_user_can( 'manage_network_options' ) ) { return; } else { $role = 'manage_network_options'; }
if ( ! current_user_can( 'manage_options' ) ) { return; } else { $role = 'manage_options'; }
global $submenu;
if(defined('BSF_MENU_POS')) $required_place = BSF_MENU_POS; else $required_place = 200;
if(function_exists('bsf_get_free_menu_position')) $place = bsf_get_free_menu_position($required_place,1); else $place = null;
$page = add_menu_page( 'Ultimate', 'Ultimate', $role, 'about-ultimate', array($this,'load_about'), '', $place );
add_submenu_page( "about-ultimate", __("Elements","ultimate_vc"), __("Elements","ultimate_vc"), $role, "ultimate-dashboard", array($this,'load_modules') );
add_submenu_page( "about-ultimate", __("Smooth Scroll","ultimate_vc"), __("Smooth Scroll","ultimate_vc"), $role, "ultimate-smoothscroll", array($this,'load_smoothscroll') );
add_submenu_page( "about-ultimate", __("Scripts & Styles","ultimate_vc"), __("Scripts & Styles","ultimate_vc"), $role, "ultimate-scripts-and-styles", array($this,'load_scripts_styles') );
if ( ! is_multisite() ) {
add_submenu_page( "about-ultimate", __("Product License","ultimate_vc"), __("Product License","ultimate_vc"), $role, "ultimate-product-license", array($this,'product_license') ); }
add_submenu_page( "NOATTACH", __("Debug","ultimate_vc"), __("Debug","ultimate_vc"), $role, "ultimate-debug-settings", array($this,'load_debug_settings') );
// Add sub-menu for OPN if OPN in installed - {One Page Navigator}. if( defined('OPN_VERSION') ){ if(defined('BSF_MENU_POS')) $required_place = BSF_MENU_POS; else $required_place = 200;
if(function_exists('bsf_get_free_menu_position')) $place = bsf_get_free_menu_position($required_place,1); else $place = null;
$page = add_menu_page( 'OPN', 'OPN', 'administrator', 'opn-settings', array($this,'load_opn'), 'dashicons-admin-generic', $place ); }
// section wise menu global $bsf_section_menu; $section_menu = array( 'menu' => 'ultimate-resources', 'is_down_arrow' => true ); $bsf_section_menu[] = $section_menu;
$icon_manager_page = add_submenu_page( "about-ultimate", __("Icon Manager","ultimate_vc"), __("Icon Manager","ultimate_vc"), $role, "bsf-font-icon-manager", array($this, 'ultimate_icon_manager_menu') );
$AIO_Icon_Manager = new AIO_Icon_Manager; add_action( 'admin_print_scripts-' . $icon_manager_page, array($AIO_Icon_Manager,'admin_scripts'));
$Ultimate_Google_Font_Manager = new Ultimate_Google_Font_Manager; $google_font_manager_page = add_submenu_page( "about-ultimate", __("Google Font Manager","ultimate_vc"), __("Google Fonts","ultimate_vc"), $role, "bsf-google-font-manager", array($Ultimate_Google_Font_Manager,'ultimate_font_manager_dashboard') ); add_action( 'admin_print_scripts-' . $google_font_manager_page, array($Ultimate_Google_Font_Manager,'admin_google_font_scripts'));
$google_font_manager_page = add_submenu_page( "about-ultimate", __("Google Maps","ultimate_vc"), __("Google Maps","ultimate_vc"), $role, "bsf-google-maps", array($this,'ultimate_google_maps_dashboard') );
// must be at end of all sub menu
$submenu['about-ultimate'][0][0] = __("About","ultimate_vc"); } function load_opn(){ if(class_exists('OPN_Navigator')) { $OPN_Navigator = new OPN_Navigator; $OPN_Navigator->opn_settings(); } } function ultimate_icon_manager_menu(){ $AIO_Icon_Manager = new AIO_Icon_Manager; $AIO_Icon_Manager->icon_manager_dashboard(); } function load_modules(){ require_once(plugin_dir_path(__FILE__).'/modules.php'); }
function load_dashboard(){ require_once(plugin_dir_path(__FILE__).'/dashboard.php'); }
function load_about() { require_once(plugin_dir_path(__FILE__).'/about.php'); }
function load_smoothscroll() { require_once(plugin_dir_path(__FILE__).'/smooth-scroll-setting.php'); }
function load_scripts_styles() { require_once(plugin_dir_path(__FILE__).'/script-styles.php'); }
function product_license() { require_once(plugin_dir_path(__FILE__).'/product-license.php'); }
function load_debug_settings() { require_once(plugin_dir_path(__FILE__).'/debug.php'); }
function ultimate_resources() { $connects = false; require_once(plugin_dir_path(__FILE__).'/resources.php'); }
function ultimate_google_maps_dashboard() { require_once(plugin_dir_path(__FILE__).'/map-settings.php'); }
function update_modules(){
check_ajax_referer( 'ultimate-modules-setting', 'security' );
if(isset($_POST['ultimate_row'])){ $ultimate_row = sanitize_text_field( $_POST['ultimate_row'] ); } else { $ultimate_row = 'disable'; } $result1 = update_option( 'ultimate_row', $ultimate_row );
$ultimate_modules = array(); if(isset($_POST['ultimate_modules'])){ $ultimate_modules = array_map( 'sanitize_text_field', $_POST['ultimate_modules'] ); } $result2 = update_option( 'ultimate_modules', $ultimate_modules );
if($result1 || $result2 ){ echo 'success'; } else { echo 'failed'; } die(); }
function can_access_admin() { $bsf_ultimate_roles = bsf_get_option('ultimate_roles'); if($bsf_ultimate_roles == false || empty($bsf_ultimate_roles)) { $bsf_ultimate_roles = array( 'administrator' ); }
if(!in_array('administrator', $bsf_ultimate_roles)) array_push($bsf_ultimate_roles, 'administrator');
$user = wp_get_current_user(); $user_role = $user->roles[0];
if(in_array($user_role, $bsf_ultimate_roles)) { return $user_role; } return false; }
function update_debug_settings() { check_ajax_referer( 'ultimate-debug-settings', 'security' );
if( isset( $_POST['ultimate_video_fixer'] ) ){ $ultimate_video_fixer = sanitize_text_field( $_POST['ultimate_video_fixer'] ); } else { $ultimate_video_fixer = 'disable'; } $result1 = update_option('ultimate_video_fixer',$ultimate_video_fixer);
if(isset($_POST['ultimate_ajax_theme'])){ $ultimate_ajax_theme = sanitize_text_field( $_POST['ultimate_ajax_theme'] ); } else { $ultimate_ajax_theme = 'disable'; } $result2 = update_option('ultimate_ajax_theme',$ultimate_ajax_theme);
if(isset($_POST['ultimate_custom_vc_row'])){ $ultimate_custom_vc_row = sanitize_text_field( $_POST['ultimate_custom_vc_row'] ); } else { $ultimate_custom_vc_row = ''; } $result3 = update_option('ultimate_custom_vc_row',$ultimate_custom_vc_row);
if(isset($_POST['ultimate_theme_support'])){ $ultimate_theme_support = sanitize_text_field( $_POST['ultimate_theme_support'] ); } else { $ultimate_theme_support = 'disable'; } $result4 = update_option('ultimate_theme_support',$ultimate_theme_support);
if(isset($_POST['ultimate_rtl_support'])){ $ultimate_rtl_support = sanitize_text_field( $_POST['ultimate_rtl_support'] ); } else { $ultimate_rtl_support = 'disable'; } $result5 = update_option('ultimate_rtl_support',$ultimate_rtl_support);
if(isset($_POST['ultimate_modal_fixer'])){ $ultimate_modal_fixer = sanitize_text_field( $_POST['ultimate_modal_fixer'] ); } else { $ultimate_modal_fixer = 'disable'; } $result6 = update_option( 'ultimate_modal_fixer', $ultimate_modal_fixer );
$result7 = $result8 = false;
$bsf_options_array = array( 'dev_mode', 'ultimate_global_scripts', 'ultimate_roles', 'ultimate_modal_menu' ); $check_update_option_7 = $check_update_option_8 = false;
if(isset($_POST['bsf_options'])){ $bsf_options_keys = array_keys($_POST['bsf_options']);
$bsf_options_array = array_diff($bsf_options_array, $bsf_options_keys); foreach ( $_POST['bsf_options'] as $key => $value ) { $key = sanitize_text_field( $key ); if( is_array($value) ) { $value = array_map( 'sanitize_text_field', $value ); } else { $value = sanitize_text_field( $value ); }
$result7 = bsf_update_option( $key, $value ); if( $result7 ) $check_update_option_7 = true; } }
foreach ( $bsf_options_array as $key => $key_value ) { $key_value = sanitize_text_field( $key_value ); $result8 = bsf_update_option( $key_value, '' ); if( $result8 ) $check_update_option_8 = true; $result8 = true; }
if(isset($_POST['ultimate_smooth_scroll_compatible'])){ $ultimate_smooth_scroll_compatible = sanitize_text_field( $_POST['ultimate_smooth_scroll_compatible'] ); } else { $ultimate_smooth_scroll_compatible = 'disable'; } $result9 = update_option('ultimate_smooth_scroll_compatible',$ultimate_smooth_scroll_compatible);
if(isset($_POST['ultimate_animation'])){ $ultimate_animation = sanitize_text_field( $_POST['ultimate_animation'] ); } else { $ultimate_animation = 'disable'; } $result10 = update_option('ultimate_animation',$ultimate_animation);
if($result1 || $result2 || $result3 || $result4 || $result5 || $result6 || $result7 || $result8 || $result9 || $result10){ echo 'success'; } else { echo 'failed'; }
die(); }
function update_settings(){
check_ajax_referer( 'smooth-scroll-setting', 'security' );
if( isset( $_POST['ultimate_smooth_scroll'] ) ) { $ultimate_smooth_scroll = sanitize_text_field( $_POST['ultimate_smooth_scroll'] ); } else { $ultimate_smooth_scroll = 'disable'; } $result1 = update_option('ultimate_smooth_scroll',$ultimate_smooth_scroll);
if(isset($_POST['ultimate_smooth_scroll_options'])){ $ultimate_smooth_scroll_options['step'] = ( '' != $_POST['ultimate_smooth_scroll_options']['step'] ) ? ( int ) $_POST['ultimate_smooth_scroll_options']['step'] : ''; $ultimate_smooth_scroll_options['speed'] = ( '' != $_POST['ultimate_smooth_scroll_options']['speed'] ) ? ( int ) $_POST['ultimate_smooth_scroll_options']['speed'] : ''; } else { $ultimate_smooth_scroll_options = ''; } $result2 = update_option('ultimate_smooth_scroll_options',$ultimate_smooth_scroll_options);
if($result1 || $result2){ echo 'success'; } else { echo 'failed'; } die(); }
function update_css_options(){
check_ajax_referer( 'css-settings-setting', 'security' );
if(isset($_POST['ultimate_css'])){ $ultimate_css = sanitize_text_field( $_POST['ultimate_css'] ); } else { $ultimate_css = 'disable'; } $result1 = update_option('ultimate_css',$ultimate_css); if(isset($_POST['ultimate_js'])){ $ultimate_js = sanitize_text_field( $_POST['ultimate_js'] ); } else { $ultimate_js = 'disable'; } $result2 = update_option('ultimate_js',$ultimate_js); if($result1 || $result2){ echo 'success'; } else { echo 'failed'; } die(); }
/* * Display admin notices for plugin activation */ function display_notice(){ global $hook_suffix; $status = "not-activated"; $ultimate_keys = get_option('ultimate_keys'); $username = $ultimate_keys['envato_username']; $api_key = $ultimate_keys['envato_api_key']; $purchase_code = $ultimate_keys['ultimate_purchase_code']; $user_email = (isset($ultimate_keys['ultimate_user_email'])) ? $ultimate_keys['ultimate_user_email'] : '';
$activation_check = get_option('ultimate_license_activation');
if(false === ( get_transient( 'ultimate_license_activation' ) )){ if(!empty($activation_check)){ $get_activation_data = check_license_activation($purchase_code, $username, $user_email); $activation_check_temp = json_decode($get_activation_data); $val = array( 'response' => $activation_check_temp->response, 'status' => $activation_check_temp->status, 'code' => $activation_check_temp->code ); $val = array_map( 'sanitize_text_field', $val ); update_option('ultimate_license_activation', $val); delete_transient( 'ultimate_license_activation' ); set_transient( "ultimate_license_activation", true, 60*60*12); } }
$activation_check = get_option('ultimate_license_activation'); $ultimate_constants = get_option('ultimate_constants'); $builtin = get_option('ultimate_updater');
if($activation_check !== ''){ $status = isset($activation_check['status']) ? $activation_check['status'] : "not-activated"; $code = $activation_check['code']; }
if($status == "Deactivated" || $status == "not-activated" || $status == "not-verified"){ if ( $hook_suffix == 'plugins.php' ){ if( $builtin === 'disabled' || $ultimate_constants['ULTIMATE_NO_PLUGIN_PAGE_NOTICE'] === true || (is_multisite() == true && is_main_site() == false)) $hide_notice = true; else $hide_notice = false; $reg_link = (is_multisite()) ? network_admin_url('index.php?page=bsf-dashboard') : admin_url('index.php?page=bsf-dashboard');
if(!$hide_notice) : ?> <div class="updated" style="padding: 0; margin: 0; border: none; background: none;"> <style type="text/css"> .ult_activate{min-width:825px;background: #FFF;border:1px solid #0096A3;padding:5px;margin:15px 0;border-radius:3px;-webkit-border-radius:3px;position:relative;overflow:hidden} .ult_activate .ult_a{position:absolute;top:5px;right:10px;font-size:48px;} .ult_activate .ult_button{font-weight:bold;border:1px solid #029DD6;border-top:1px solid #06B9FD;font-size:15px;text-align:center;padding:9px 0 8px 0;color:#FFF;background:#029DD6;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px} .ult_activate .ult_button:hover{text-decoration:none !important;border:1px solid #029DD6;border-bottom:1px solid #00A8EF;font-size:15px;text-align:center;padding:9px 0 8px 0;color:#F0F8FB;background:#0079B1;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px} .ult_activate .ult_button_border{border:1px solid #0096A3;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px;background:#029DD6;} .ult_activate .ult_button_container{cursor:pointer;display:inline-block; padding:5px;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px;width:215px} .ult_activate .ult_description{position:absolute;top:8px;left:230px;margin-left:25px;color:#0096A3;font-size:15px;z-index:1000} .ult_activate .ult_description strong{color:#0096A3;font-weight:normal} </style> <div class="ult_activate"> <div class="ult_a"><img style="width:1em;" src="<?php echo UAVC_URL."img/logo-icon.png"; ?>" alt=""></div> <?php
?> <div class="ult_button_container" onclick="document.location='<?php echo $reg_link; ?>'"> <div class="ult_button_border"> <div class="ult_button"><span class="dashicons-before dashicons-admin-network" style="padding-right: 6px;"></span><?php __('Activate your license', 'ultimate_vc');?></div> </div> </div> <div class="ult_description"><h3 style="margin:0;padding: 2px 0px;"><strong><?php _e('Almost done!','ultimate_vc'); ?></strong></h3><p style="margin: 0;"><?php _e('Please activate your copy of the Ultimate Addons for WPBakery Page Builder to receive automatic updates & get premium support','ultimate_vc'); ?></p></div> </div> </div> <?php endif; } else if($hook_suffix == 'post-new.php' || $hook_suffix == 'edit.php' || $hook_suffix == 'post.php'){ if( $builtin === 'disabled' || $ultimate_constants['ULTIMATE_NO_EDIT_PAGE_NOTICE'] === true || (is_multisite() == true && is_main_site() == false)) $hide_notice = true; else $hide_notice = false; if(!$hide_notice) : ?>
<div class="updated fade">
<p><?php echo _e('Howdy! Please','ultimate_vc').' <a href="'.$reg_link.'">'.__('activate your copy','ultimate_vc').' </a> '.__('of the Ultimate Addons for WPBakery Page Builder to receive automatic updates & get premium support.','ultimate_vc');?> <span style="float: right; padding: 0px 4px; cursor: pointer;" class="uavc-activation-notice">X</span> </p> </div> <script type="text/javascript"> jQuery(".uavc-activation-notice").click(function(){ jQuery(this).parents(".updated").fadeOut(800); }); </script>
<?php endif; } } }
} new Ultimate_Admin_Area; }
// Generate 32 characters function ult_generate_rand_id(){ $validCharacters = 'abcdefghijklmnopqrstuvwxyz0123456789'; $myKeeper = ''; $length = 32; for ($n = 1; $n < $length; $n++) { $whichCharacter = rand(0, strlen($validCharacters)-1); $myKeeper .= $validCharacters{$whichCharacter}; } return $myKeeper; } // Alternative function for wp_remote_get function ultimate_remote_get($path){
if(function_exists('curl_init')){ // create curl resource $ch = curl_init();
// set url curl_setopt($ch, CURLOPT_URL, $path);
//return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string $output = curl_exec($ch);
// close curl resource to free up system resources curl_close($ch);
if($output !== "") return $output; else return false; } else { return false; } }
// hooks to add bsf-core stylesheet add_filter('bsf_core_style_screens', 'ultimate_bsf_core_style_hooks'); function ultimate_bsf_core_style_hooks($hooks) { $array = array( 'ultimate_page_ultimate-resources', 'ultimate_page_about-ultimate', 'toplevel_page_about-ultimate', 'ultimate_page_ultimate-dashboard', 'ultimate_page_ultimate-smoothscroll', 'ultimate_page_ultimate-scripts-and-styles', 'admin_page_ultimate-debug-settings', 'ultimate_page_bsf-google-maps', 'ultimate_page_ultimate-product-license', 'settings_page_ultimate-product-license' ); foreach ($array as $hook) { array_push($hooks, $hook); } return $hooks; } // hooks to add frosty script add_filter('bsf_core_frosty_screens', 'ultimate_bsf_core_frosty_hooks'); function ultimate_bsf_core_frosty_hooks($hooks) { $array = array( 'ultimate_page_ultimate-smoothscroll', ); foreach ($array as $hook) { array_push($hooks, $hook); } return $hooks; }
function UAVC_product_license_redirect_to_modal_popup($url, $original_url, $_context){ if ($url == 'admin.php?page=ultimate-product-license'){ remove_filter('clean_url', 'UAVC_product_license_redirect_to_modal_popup', 10); return bsf_registration_page_url( false, '6892199' ); } return $url; } if (is_admin()){ add_filter('clean_url', 'UAVC_product_license_redirect_to_modal_popup', 10, 3); }
|