C:\xampp\htdocs\landing\wp-content\plugins\js_composer\include\helpers\helpers_factory.php


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
<?php
if ( ! defined'ABSPATH' ) ) {
    die( 
'-1' );
}

/**
 * WPBakery WPBakery Page Builder Main manager.
 *
 * @package WPBakeryPageBuilder
 * @since   4.2
 */
if ( ! function_exists'vc_manager' ) ) {
    
/**
     * WPBakery Page Builder manager.
     * @return Vc_Manager
     * @since 4.2
     */
    
function vc_manager() {
        return 
Vc_Manager::getInstance();
    }
}
if ( ! 
function_exists'visual_composer' ) ) {
    
/**
     * WPBakery Page Builder instance.
     * @return Vc_Base
     * @since 4.2
     */
    
function visual_composer() {
        return 
vc_manager()->vc();
    }
}
if ( ! 
function_exists'vc_mapper' ) ) {
    
/**
     * Shorthand for Vc Mapper.
     * @return Vc_Mapper
     * @since 4.2
     */
    
function vc_mapper() {
        return 
vc_manager()->mapper();
    }
}
if ( ! 
function_exists'vc_settings' ) ) {
    
/**
     * Shorthand for WPBakery Page Builder settings.
     * @return Vc_Settings
     * @since 4.2
     */
    
function vc_settings() {
        return 
vc_manager()->settings();
    }
}
if ( ! 
function_exists'vc_license' ) ) {
    
/**
     * Get License manager
     * @return Vc_License
     * @since 4.2
     */
    
function vc_license() {
        return 
vc_manager()->license();
    }
}
if ( ! 
function_exists'vc_automapper' ) ) {
    
/**
     * @return Vc_Automapper
     * @since 4.2
     */
    
function vc_automapper() {
        return 
vc_manager()->automapper();
    }
}
if ( ! 
function_exists'vc_frontend_editor' ) ) {
    
/**
     * Shorthand for VC frontend editor
     * @return Vc_Frontend_Editor
     * @since 4.2
     */
    
function vc_frontend_editor() {
        return 
vc_manager()->frontendEditor();
    }
}
if ( ! 
function_exists'vc_backend_editor' ) ) {
    
/**
     * Shorthand for VC frontend editor
     * @return Vc_Backend_Editor
     * @since 4.2
     */
    
function vc_backend_editor() {
        return 
vc_manager()->backendEditor();
    }
}
if ( ! 
function_exists'vc_updater' ) ) {
    
/**
     * @return Vc_Updater
     * @since 4.2
     */
    
function vc_updater() {
        return 
vc_manager()->updater();
    }
}
if ( ! 
function_exists'vc_is_network_plugin' ) ) {
    
/**
     * Vc is network plugin or not.
     * @return bool
     * @since 4.2
     */
    
function vc_is_network_plugin() {
        return 
vc_manager()->isNetworkPlugin();
    }
}
if ( ! 
function_exists'vc_path_dir' ) ) {
    
/**
     * Get file/directory path in Vc.
     *
     * @param string $name - path name
     * @param string $file
     *
     * @return string
     * @since 4.2
     */
    
function vc_path_dir$name$file '' ) {
        return 
vc_manager()->path$name$file );
    }
}
if ( ! 
function_exists'vc_asset_url' ) ) {
    
/**
     * Get full url for assets.
     *
     * @param string $file
     *
     * @return string
     * @since 4.2
     */
    
function vc_asset_url$file ) {
        return 
vc_manager()->assetUrl$file );
    }
}
if ( ! 
function_exists'vc_upload_dir' ) ) {
    
/**
     * Temporary files upload dir;
     * @return string
     * @since 4.2
     */
    
function vc_upload_dir() {
        return 
vc_manager()->uploadDir();
    }
}
if ( ! 
function_exists'vc_template' ) ) {
    
/**
     * @param $file
     *
     * @return string
     * @since 4.2
     */
    
function vc_template$file ) {
        return 
vc_path_dir'TEMPLATES_DIR'$file );
    }
}
if ( ! 
function_exists'vc_post_param' ) ) {
    
/**
     * Get param value from $_POST if exists.
     *
     * @param $param
     * @param $default
     *
     * @param bool $check
     * @return null|string - null for undefined param.
     * @since 4.2
     */
    
function vc_post_param$param$default null$check false ) {
        if ( 
'admin' === $check ) {
            
check_admin_referer();
        } elseif ( 
'ajax' === $check ) {
            
check_ajax_referer();
        }

        return isset( 
$_POST$param ] ) ? $_POST$param ] : $default;
    }
}
if ( ! 
function_exists'vc_get_param' ) ) {
    
/**
     * Get param value from $_GET if exists.
     *
     * @param string $param
     * @param $default
     *
     * @param bool $check
     * @return null|string - null for undefined param.
     * @since 4.2
     */
    
function vc_get_param$param$default null$check false ) {
        if ( 
'admin' === $check ) {
            
check_admin_referer();
        } elseif ( 
'ajax' === $check ) {
            
check_ajax_referer();
        }

        
// @codingStandardsIgnoreLine
        
return isset( $_GET$param ] ) ? $_GET$param ] : $default;
    }
}
if ( ! 
function_exists'vc_request_param' ) ) {
    
/**
     * Get param value from $_REQUEST if exists.
     *
     * @param $param
     * @param $default
     *
     * @param bool $check
     * @return null|string - null for undefined param.
     * @since 4.4
     */
    
function vc_request_param$param$default null$check false ) {
        if ( 
'admin' === $check ) {
            
check_admin_referer();
        } elseif ( 
'ajax' === $check ) {
            
check_ajax_referer();
        }

        
// @codingStandardsIgnoreLine
        
return isset( $_REQUEST$param ] ) ? $_REQUEST$param ] : $default;
    }
}
if ( ! 
function_exists'vc_is_frontend_editor' ) ) {
    
/**
     * @return bool
     * @since 4.2
     */
    
function vc_is_frontend_editor() {
        return 
'admin_frontend_editor' === vc_mode();
    }
}
if ( ! 
function_exists'vc_is_page_editable' ) ) {
    
/**
     * @return bool
     * @since 4.2
     */
    
function vc_is_page_editable() {
        return 
'page_editable' === vc_mode();
    }
}
if ( ! 
function_exists'vc_action' ) ) {
    
/**
     * Get VC special action param.
     * @return string|null
     * @since 4.2
     */
    
function vc_action() {
        
$vc_action wp_strip_all_tagsvc_request_param'vc_action' ) );

        return 
$vc_action;
    }
}
if ( ! 
function_exists'vc_is_inline' ) ) {
    
/**
     * Get is inline or not.
     * @return bool
     * @since 4.2
     */
    
function vc_is_inline() {
        global 
$vc_is_inline;
        if ( 
is_null$vc_is_inline ) ) {
            
$vc_is_inline = ( current_user_can'edit_posts' ) || current_user_can'edit_pages' ) ) && 'vc_inline' === vc_action() || ! is_nullvc_request_param'vc_inline' ) ) || 'true' === vc_request_param'vc_editable' );
        }

        return 
$vc_is_inline;
    }
}
if ( ! 
function_exists'vc_is_frontend_ajax' ) ) {
    
/**
     * @return bool
     * @since 4.2
     */
    
function vc_is_frontend_ajax() {
        return 
'true' === vc_post_param'vc_inline' ) || vc_get_param'vc_inline' );
    }
}
/**
 * @depreacted since 4.8 ( use vc_is_frontend_editor )
 * @return bool
 * @since 4.2
 */
function vc_is_editor() {
    return 
vc_is_frontend_editor();
}

/**
 * @param $value
 * @param bool $encode
 *
 * @return string
 * @since 4.2
 */
function vc_value_from_safe$value$encode false ) {
    
// @codingStandardsIgnoreLine
    
$value preg_match'/^#E\-8_/'$value ) ? rawurldecodebase64_decodepreg_replace'/^#E\-8_/'''$value ) ) ) : $value;
    if ( 
$encode ) {
        
$value htmlentities$valueENT_COMPAT'UTF-8' );
    }

    return 
$value;
}

/**
 * @param bool $disable
 * @since 4.2
 *
 */
function vc_disable_automapper$disable true ) {
    
vc_automapper()->setDisabled$disable );
}

/**
 * @return bool
 * @since 4.2
 */
function vc_automapper_is_disabled() {
    return 
vc_automapper()->disabled();
}

/**
 * @param $param
 * @param $value
 *
 * @return mixed|string
 * @since 4.2
 */
function vc_get_dropdown_option$param$value ) {
    if ( 
'' === $value && is_array$param['value'] ) ) {
        
$value array_shift$param['value'] );
    }
    if ( 
is_array$value ) ) {
        
reset$value );
        
$value = isset( $value['value'] ) ? $value['value'] : current$value );
    }
    
$value preg_replace'/\s/''_'$value );

    return ( 
'' !== $value $value '' );
}

/**
 * @param $prefix
 * @param $color
 *
 * @return string
 * @since 4.2
 */
function vc_get_css_color$prefix$color ) {
    
$rgb_color preg_match'/rgba/'$color ) ? preg_replace( array(
        
'/\s+/',
        
'/^rgba\((\d+)\,(\d+)\,(\d+)\,([\d\.]+)\)$/',
    ), array(
        
'',
        
'rgb($1,$2,$3)',
    ), 
$color ) : $color;
    
$string $prefix ':' $rgb_color ';';
    if ( 
$rgb_color !== $color ) {
        
$string .= $prefix ':' $color ';';
    }

    return 
$string;
}

/**
 * @param $param_value
 * @param string $prefix
 *
 * @return string
 * @since 4.2
 */
function vc_shortcode_custom_css_class$param_value$prefix '' ) {
    
$css_class preg_match'/\s*\.([^\{]+)\s*\{\s*([^\}]+)\s*\}\s*/'$param_value ) ? $prefix preg_replace'/\s*\.([^\{]+)\s*\{\s*([^\}]+)\s*\}\s*/''$1'$param_value ) : '';

    return 
$css_class;
}

/**
 * @param $subject
 * @param $property
 * @param bool|false $strict
 *
 * @return bool
 * @since 4.9
 */
function vc_shortcode_custom_css_has_property$subject$property$strict false ) {
    
$styles = array();
    
$pattern '/\{([^\}]*?)\}/i';
    
preg_match$pattern$subject$styles );
    if ( 
array_key_exists1$styles ) ) {
        
$styles explode';'$styles[1] );
    }
    
$new_styles = array();
    foreach ( 
$styles as $val ) {
        
$val explode':'$val );
        if ( 
is_array$property ) ) {
            foreach ( 
$property as $prop ) {
                
$pos strpos$val[0], $prop );
                
$full = ( $strict ) ? ( === $pos && strlen$val[0] ) === strlen$prop ) ) : true;
                if ( 
false !== $pos && $full ) {
                    
$new_styles[] = $val;
                }
            }
        } else {
            
$pos strpos$val[0], $property );
            
$full = ( $strict ) ? ( === $pos && strlen$val[0] ) === strlen$property ) ) : true;
            if ( 
false !== $pos && $full ) {
                
$new_styles[] = $val;
            }
        }
    }

    return ! empty( 
$new_styles );
}

/**
 * Plugin name for VC.
 *
 * @return string
 * @since 4.2
 */
function vc_plugin_name() {
    return 
vc_manager()->pluginName();
}

/**
 * @param $filename
 *
 * @return bool|mixed|string
 * @since 4.4.3 used in vc_base when getting an custom css output
 *
 */
function vc_file_get_contents$filename ) {
    global 
$wp_filesystem;
    if ( empty( 
$wp_filesystem ) ) {
        require_once 
ABSPATH '/wp-admin/includes/file.php';
        
WP_Filesystemfalsefalsetrue );
    }
    
/** @var WP_Filesystem_Base $wp_filesystem */
    
$output '';
    if ( 
is_object$wp_filesystem ) ) {
        
$output $wp_filesystem->get_contents$filename );
    }

    if ( ! 
$output ) {
        
// @codingStandardsIgnoreLine
        
$output file_get_contents$filename );
    }

    return 
$output;
}

/**
 * HowTo: vc_role_access()->who('administrator')->with('editor')->can('frontend_editor');
 * @return Vc_Role_Access;
 * @since 4.8
 */
function vc_role_access() {
    return 
vc_manager()->getRoleAccess();
}

/**
 * Get access manager for current user.
 * HowTo: vc_user_access()->->with('editor')->can('frontend_editor');
 * @return Vc_Current_User_Access;
 * @since 4.8
 */
function vc_user_access() {
    return 
vc_manager()->getCurrentUserAccess();
}

/**
 * @return array
 * @throws \Exception
 */
function vc_user_roles_get_all() {
    require_once 
vc_path_dir'SETTINGS_DIR''class-vc-roles.php' );
    
$vc_roles = new Vc_Roles();
    
$capabilities = array();
    foreach ( 
$vc_roles->getParts() as $part ) {
        
$partObj vc_user_access()->part$part );
        
$capabilities$part ] = array(
            
'state' => (is_multisite() && is_super_admin()) ? true $partObj->getState(),
            
'state_key' => $partObj->getStateKey(),
            
'capabilities' => $partObj->getAllCaps(),
        );
    }

    return 
$capabilities;
}

/**
 * @param $data
 *
 * @return string
 */
function vc_generate_nonce$data$from_esi false ) {
    if ( ! 
$from_esi && ! vc_is_frontend_editor() ) {
        if ( 
method_exists'LiteSpeed_Cache_API''esi_enabled' ) && LiteSpeed_Cache_API::esi_enabled() ) {
            if ( 
method_exists'LiteSpeed_Cache_API''v' ) && LiteSpeed_Cache_API::v'1.3' ) ) {
                
$params = array( 'data' => $data );

                return 
LiteSpeed_Cache_API::esi_url'js_composer''WPBakery Page Builder'$params'default'true );// The last parameter is to remove ESI comment wrapper
            
}
        }
    }

    return 
wp_create_nonceis_array$data ) ? ( 'vc-nonce-' implode'|'$data ) ) : ( 'vc-nonce-' $data ) );
}

/**
 * @param $params
 *
 * @return string
 */
function vc_hook_esi$params ) {
    
$data $params['data'];
    echo 
vc_generate_nonce$datatrue );
    exit;
}

/**
 * @param $nonce
 * @param $data
 *
 * @return bool
 */
function vc_verify_nonce$nonce$data ) {
    return (bool) 
wp_verify_nonce$nonce, ( is_array$data ) ? ( 'vc-nonce-' implode'|'$data ) ) : ( 'vc-nonce-' $data ) ) );
}

/**
 * @param $nonce
 *
 * @return bool
 */
function vc_verify_admin_nonce$nonce '' ) {
    return (bool) 
vc_verify_nonce( ! empty( $nonce ) ? $nonce vc_request_param'_vcnonce' ), 'vc-admin-nonce' );
}

/**
 * @param $nonce
 *
 * @return bool
 */
function vc_verify_public_nonce$nonce '' ) {
    return (bool) 
vc_verify_nonce( ( ! empty( $nonce ) ? $nonce vc_request_param'_vcnonce' ) ), 'vc-public-nonce' );
}

/**
 * @param $type
 * @return bool|mixed|void
 * @throws \Exception
 */
function vc_check_post_type$type '' ) {
    if ( empty( 
$type ) ) {
        
$type get_post_type();
    }
    
$valid apply_filters'vc_check_post_type_validation'null$type );
    if ( 
is_null$valid ) ) {
        if ( 
is_multisite() && is_super_admin() ) {
            return 
true;
        }
        
$state vc_user_access()->part'post_types' )->getState();
        if ( 
null === $state ) {
            return 
in_array$typevc_default_editor_post_types(), true );
        } elseif ( 
true === $state && ! in_array$typevc_default_editor_post_types(), true ) ) {
            
$valid false;
        } else {
            
$valid vc_user_access()->part'post_types' )->can$type )->get();
        }
    }

    return 
$valid;
}

/**
 * @param $shortcode
 * @return bool|mixed|void
 */
function vc_user_access_check_shortcode_edit$shortcode ) {
    
$do_check apply_filters'vc_user_access_check-shortcode_edit'null$shortcode );
    if ( 
is_multisite() && is_super_admin() ) {
        return 
true;
    }
    if ( 
is_null$do_check ) ) {
        
$state_check vc_user_access()->part'shortcodes' )->checkStateAnytrue'edit'null )->get();
        if ( 
$state_check ) {
            return 
true;
        } else {
            return 
vc_user_access()->part'shortcodes' )->canAny$shortcode '_all'$shortcode '_edit' )->get();
        }
    } else {
        return 
$do_check;
    }
}

/**
 * @param $shortcode
 * @return bool|mixed|void
 * @throws \Exception
 */
function vc_user_access_check_shortcode_all$shortcode ) {
    
$do_check apply_filters'vc_user_access_check-shortcode_all'null$shortcode );
    if ( 
is_multisite() && is_super_admin() ) {
        return 
true;
    }
    if ( 
is_null$do_check ) ) {
        return 
vc_user_access()->part'shortcodes' )->checkStateAnytrue'custom'null )->can$shortcode '_all' )->get();
    } else {
        return 
$do_check;
    }
}

/**
 * htmlspecialchars_decode_deep
 * Call the htmlspecialchars_decode to a gived multilevel array
 *
 * @param mixed $value The value to be stripped.
 *
 * @return mixed Stripped value.
 * @since 4.8
 *
 */
function vc_htmlspecialchars_decode_deep$value ) {
    if ( 
is_array$value ) ) {
        
$value array_map'vc_htmlspecialchars_decode_deep'$value );
    } elseif ( 
is_object$value ) ) {
        
$vars get_object_vars$value );
        foreach ( 
$vars as $key => $data ) {
            
$value->{$key} = vc_htmlspecialchars_decode_deep$data );
        }
    } elseif ( 
is_string$value ) ) {
        
$value htmlspecialchars_decode$value );
    }

    return 
$value;
}

/**
 * @param $str
 * @return mixed
 */
function vc_str_remove_protocol$str ) {
    return 
str_replace( array(
        
'https://',
        
'http://',
    ), 
'//'$str );
}
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586