PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 2.3.0
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v2.3.0
2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 1.8.1 All 42 releases
sellkit / includes / block-editor / class.php

class.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 2.3.0, at includes/block-editor/class.php

702 lines 18.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Sellkit\Blocks;
3
4 defined( 'ABSPATH' ) || die();
5
6 /**
7 * SellKit Blocks class.
8 *
9 * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
10 * @SuppressWarnings(PHPMD.NPathComplexity)
11 * @since 2.3.0
12 */
13 class Sellkit_Blocks {
14
15 /**
16 * Class instance.
17 *
18 * @since 2.3.0
19 * @var Sellkit_Blocks
20 */
21 private static $instance = null;
22
23 /**
24 * Blocks.
25 *
26 * @since 2.3.0
27 * @var array
28 */
29 public $blocks = [];
30
31 /**
32 * Inner Blocks.
33 *
34 * @since 2.3.0
35 * @var array
36 */
37 public $inner_blocks = [];
38
39 /**
40 * Valid Blocks.
41 *
42 * @since 2.3.0
43 * @var array
44 */
45 public $valid_blocks = [];
46
47 /**
48 * Current post ID.
49 *
50 * @since 2.3.0
51 * @var null|integer
52 */
53 public $post_id = null;
54
55 /**
56 * Date localization.
57 *
58 * @since 2.3.0
59 * @var string
60 */
61 public $date_localization = '';
62
63 /**
64 * Get a class instance.
65 *
66 * @since 2.3.0
67 *
68 * @return Sellkit_Blocks Class
69 */
70 public static function get_instance() {
71 if ( is_null( self::$instance ) ) {
72 self::$instance = new self();
73 }
74
75 return self::$instance;
76 }
77
78 /**
79 * Class constructor.
80 *
81 * @since 2.3.0
82 */
83 public function __construct() {
84 add_action( 'init', [ $this, 'load_block_editor' ] );
85 add_action( 'template_redirect', [ $this, 'load_block_frontend' ] );
86 add_action( 'enqueue_block_editor_assets', [ $this, 'register_blocks' ] );
87 add_filter( 'block_categories_all', [ $this, 'add_sellkit_category' ] );
88
89 $this->register_helpers();
90 }
91
92 /**
93 * Register blocks helper class.
94 *
95 * @since 2.3.0
96 */
97 private function register_helpers() {
98 $blocks = $this->get_blocks();
99
100 if ( empty( $blocks ) ) {
101 return;
102 }
103
104 foreach ( $blocks as $block ) {
105 $block_data = explode( '/', $block );
106 $block_name = $block_data[1];
107
108 $class_path = 'block-editor/' . $block . '/helper';
109
110 sellkit()->load_files( [
111 $class_path,
112 ] );
113
114 $class_name = str_replace( '-', ' ', $block_name );
115 $class_name = str_replace( ' ', '_', ucwords( $class_name ) );
116 $class_name = "Sellkit\Blocks\Helpers\\{$class_name}\\Helper";
117
118 if ( class_exists( $class_name ) ) {
119 new $class_name();
120 }
121 }
122 }
123
124 /**
125 * Add sellkit block category.
126 *
127 * @param array $categories Blocks categoris list.
128 * @since 2.3.0
129 */
130 public function add_sellkit_category( $categories ) {
131 return array_merge(
132 $categories,
133 [
134 [
135 'slug' => 'sellkit-blocks',
136 'title' => esc_html__( 'sellkit', 'sellkit' ),
137 'icon' => '',
138 ],
139 ]
140 );
141 }
142
143 /**
144 * Get sellkit valid block list.
145 *
146 * @since 2.3.0
147 * @return array
148 */
149 private function get_blocks() {
150 if ( ! empty( $this->valid_blocks ) ) {
151 return $this->valid_blocks;
152 }
153
154 $blocks = apply_filters( 'sellkit_blocks_list', [
155 'blocks/accept-reject-button',
156 'blocks/checkout',
157 'blocks/order-cart-details',
158 'blocks/optin',
159 ] );
160
161 if ( class_exists( 'Sellkit_Pro' ) ) {
162 array_push( $blocks, 'blocks/smart-coupon' );
163 }
164
165 $this->valid_blocks = $blocks;
166
167 return $blocks;
168 }
169
170 /**
171 * Register sellkit block.
172 *
173 * @since 2.3.0
174 */
175 public function register_blocks() {
176 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
177
178 wp_enqueue_style( 'wp-block-library' );
179
180 $this->load_flatpicker();
181
182 wp_enqueue_script(
183 'sellkit-blocks-script',
184 sellkit()->plugin_url() . 'assets/dist/blocks/sellkit-blocks.js',
185 [ 'react', 'wp-blocks', 'lodash', 'wp-components', 'wp-editor', 'sellkit-flatpickr' ],
186 sellkit()->version(),
187 true
188 );
189
190 wp_localize_script(
191 'sellkit-blocks-script',
192 'sellkitBlocks',
193 $this->get_localize_data()
194 );
195
196 foreach ( $this->blocks as $index => $block ) {
197 if ( ! $block->is_active() ) {
198 continue;
199 }
200
201 $block_data = explode( '/', $index );
202 $block_name = $block_data[1];
203
204 $deps = [ 'sellkit-blocks-script' ];
205
206 if ( method_exists( $block, 'has_inner_blocks' ) ) {
207 wp_enqueue_script(
208 "sellkit-inner-blocks-{$block_name}-script",
209 sellkit()->plugin_url() . "assets/dist/blocks/{$block_name}/inner-blocks.js",
210 [ 'wp-blocks', 'wp-element', 'wp-editor' ],
211 sellkit()->version(),
212 true
213 );
214
215 $deps[] = "sellkit-inner-blocks-{$block_name}-script";
216 }
217
218 wp_enqueue_script(
219 "sellkit-block-{$block_name}-script",
220 sellkit()->plugin_url() . "assets/dist/blocks/{$block_name}.js",
221 $deps,
222 sellkit()->version(),
223 true
224 );
225 }
226 }
227
228 /**
229 * Load blocks codes.
230 *
231 * @since 2.3.0
232 */
233 public function load_block_editor() {
234 global $pagenow;
235
236 sellkit()->load_files( [
237 'contact-segmentation/class',
238 'contact-segmentation/conditions',
239 ] );
240
241 if ( ! empty( $this->blocks ) || ! is_admin() || 'post.php' !== $pagenow && 'post-new.php' !== $pagenow ) {
242 return;
243 }
244
245 $this->post_id = sellkit_htmlspecialchars( INPUT_GET, 'post' );
246
247 if ( empty( $this->post_id ) ) {
248 if ( ! class_exists( 'Sellkit_Pro' ) ) {
249 return;
250 }
251
252 add_filter( 'sellkit_blocks_list', function() {
253 return [ 'blocks/smart-coupon' ];
254 } );
255 }
256
257 $blocks = $this->get_blocks();
258
259 foreach ( $blocks as $block ) {
260 $block_data = explode( '/', $block );
261 $block_name = $block_data[1];
262
263 if ( isset( $this->blocks[ $block ] ) ) {
264 continue;
265 }
266
267 $class_name = str_replace( '-', ' ', $block_name );
268 $class_name = str_replace( ' ', '_', ucwords( $class_name ) );
269 $class_name = "Sellkit\blocks\Render\\{$class_name}";
270 $class_path = 'block-editor/' . $block . '/index';
271
272 sellkit()->load_files( [
273 $class_path,
274 ] );
275
276 $new_class = new $class_name( $this->post_id );
277
278 $this->register_inner_blocks_by_parent( $new_class );
279
280 $this->blocks[ $block ] = $new_class;
281 $new_class->register_block_meta();
282 }
283 }
284
285 /**
286 * Load blocks on frontend.
287 *
288 * @since 2.3.0
289 */
290 public function load_block_frontend() {
291 global $post;
292
293 if ( empty( $post->post_content ) ) {
294 return;
295 }
296
297 $this->post_id = $post->ID;
298
299 $blocks = $this->get_blocks();
300
301 if ( empty( $blocks ) ) {
302 return;
303 }
304
305 foreach ( $blocks as $block ) {
306 $block_data = explode( '/', $block );
307 $block_name = $block_data[1];
308
309 if ( ! has_block( 'sellkit-blocks/' . $block_name ) ) {
310 continue;
311 }
312
313 if ( isset( $this->blocks[ $block ] ) ) {
314 continue;
315 }
316
317 $class_name = str_replace( '-', ' ', $block_name );
318 $class_name = str_replace( ' ', '_', ucwords( $class_name ) );
319 $class_name = "Sellkit\blocks\Render\\{$class_name}";
320 $class_path = 'block-editor/' . $block . '/index';
321
322 sellkit()->load_files( [
323 $class_path,
324 ] );
325
326 $new_class = new $class_name( $this->post_id );
327
328 $this->register_inner_blocks_by_parent( $new_class );
329
330 $this->blocks[ $block ] = $new_class;
331
332 if ( ! \WP_Block_Type_Registry::get_instance()->is_registered( "sellkit-blocks/{$block_name}" ) ) {
333 $new_class->register_block_meta();
334 }
335 }
336 }
337
338 /**
339 * Load flatpicker scripts.
340 *
341 * @since 2.3.0
342 */
343 public function load_flatpicker() {
344 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
345
346 wp_enqueue_script( 'sellkit-flatpickr',
347 sellkit()->plugin_url() . 'assets/lib/flatpickr/flatpickr' . $suffix . '.js',
348 [ 'jquery' ],
349 '4.1.4',
350 true
351 );
352
353 if ( 'default' !== $this->date_localization() ) {
354 wp_enqueue_script( 'sellkit-flatpickr-localize',
355 sellkit()->plugin_url() . 'assets/lib/flatpickr-locale/' . $this->date_localization . '.js',
356 [ 'sellkit-flatpickr' ],
357 '4.1.4',
358 true
359 );
360 }
361
362 wp_enqueue_style(
363 'sellkit-flatpickr-css',
364 sellkit()->plugin_url() . 'assets/lib/flatpickr/flatpickr' . $suffix . '.css',
365 [],
366 sellkit()->version()
367 );
368
369 wp_enqueue_style(
370 'sellkit-intl-tel-input',
371 sellkit()->plugin_url() . 'assets/dist/css/intl-tel-input' . $suffix . '.css',
372 [],
373 sellkit()->version()
374 );
375 }
376
377 /**
378 * Load google map script.
379 *
380 * @param string $api_key Google map api key.
381 * @since 2.3.0
382 */
383 public function load_google_map( $api_key ) {
384 wp_enqueue_script(
385 'sellkit_google_places_api',
386 "https://maps.googleapis.com/maps/api/js?key={$api_key}&libraries=places",
387 [],
388 '1.0.0',
389 false
390 );
391 }
392
393 /**
394 * Load scripts in frontend.
395 *
396 * @param string $block_name Current block name.
397 * @param string $script_file Script file name.
398 * @param array $deps Script dependecies.
399 * @param array $localize_data Localized data.
400 * @since 2.3.0
401 */
402 public static function load_scripts( $block_name, $script_file = '', $deps = [], $localize_data = [] ) {
403 if ( ! has_block( 'sellkit-blocks/' . $block_name ) ) {
404 return;
405 }
406
407 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
408
409 wp_enqueue_style(
410 'sellkit-intl-tel-input',
411 sellkit()->plugin_url() . 'assets/dist/css/intl-tel-input' . $suffix . '.css',
412 [],
413 sellkit()->version()
414 );
415
416 wp_enqueue_script(
417 'sellkit-blocks-script',
418 sellkit()->plugin_url() . 'assets/dist/blocks/sellkit-blocks.js',
419 [ 'react', 'wp-blocks', 'lodash', 'wp-components', 'wp-editor' ],
420 sellkit()->version(),
421 true
422 );
423
424 $file = empty( $script_file ) ? $block_name : $script_file;
425
426 $dependencies = [ 'sellkit-blocks-script', 'funnel-frontend' ];
427
428 if ( ! empty( $deps ) ) {
429 $dependencies = $deps;
430 }
431
432 wp_enqueue_script(
433 "sellkit-block-{$file}-script",
434 sellkit()->plugin_url() . "assets/dist/blocks/{$file}.js",
435 $dependencies,
436 sellkit()->version(),
437 true
438 );
439
440 if ( ! empty( $localize_data ) ) {
441 wp_localize_script(
442 "sellkit-block-{$file}-script",
443 'sellkitBlocks',
444 $localize_data
445 );
446 }
447 }
448
449 /**
450 * Register inner blocks by parent.
451 *
452 * @param Object $parent_class Parent class name.
453 * @since 2.3.0
454 * @return void
455 */
456 private function register_inner_blocks_by_parent( $parent_class ) {
457 if ( ! method_exists( $parent_class, 'has_inner_blocks' ) ) {
458 return;
459 }
460
461 $inner_blocks = $parent_class->get_inner_block();
462
463 sellkit()->load_files( $inner_blocks );
464
465 foreach ( $inner_blocks as $key => $value ) {
466 if ( isset( $this->inner_blocks[ "blocks/{$key}" ] ) ) {
467 continue;
468 }
469
470 $inner_block_class = 'Sellkit\Blocks\Inner_Block\\' . str_replace( '-', '_', ucwords( $key ) );
471
472 if ( ! class_exists( $inner_block_class ) ) {
473 continue;
474 }
475
476 $inner_block_instance = new $inner_block_class( $this->post_id );
477
478 $this->inner_blocks[ "blocks/{$key}" ] = $inner_block_instance;
479
480 if ( ! \WP_Block_Type_Registry::get_instance()->is_registered( "sellkit-inner-blocks/{$key}" ) ) {
481 $inner_block_instance->register_block_meta();
482 }
483 }
484 }
485
486 /**
487 * Get date localize data.
488 *
489 * @since 2.3.0
490 * @return string
491 */
492 private function date_localization() {
493 if ( ! empty( $this->date_localization ) ) {
494 return $this->date_localization;
495 }
496
497 $wp_locale = get_locale();
498
499 $locales = [
500 'af' => '', // 'Afrikaans'
501 'ar' => 'ar', // 'Arabic'
502 'ary' => 'ar', // 'Moroccan Arabic'
503 'as' => '', // 'Assamese'
504 'azb' => 'az', // 'South Azerbaijani'
505 'az' => 'az', // 'Azerbaijani'
506 'bel' => 'be', // 'Belarusian'
507 'bg_BG' => 'bg', // 'Bulgarian'
508 'bn_BD' => 'bn', // 'Bengali (Bangladesh)'
509 'bo' => '', // 'Tibetan'
510 'bs_BA' => 'bs', // 'Bosnian'
511 'ca' => 'cat', // 'Catalan'
512 'ceb' => '', // 'Cebuano'
513 'cs_CZ' => 'cs', // 'Czech'
514 'cy' => 'cy', // 'Welsh'
515 'da_DK' => 'da', // 'Danish'
516 'de_CH_informal' => 'de', // 'German (Switzerland, Informal)'
517 'de_CH' => 'de', // 'German (Switzerland)'
518 'de_DE' => 'de', // 'German'
519 'de_DE_formal' => 'de', // 'German (Formal)'
520 'de_AT' => 'de', // 'German (Austria)'
521 'dzo' => '', // 'Dzongkha'
522 'el' => 'gr', // 'Greek'
523 'en_GB' => 'en', // 'English (UK)'
524 'en_AU' => 'en', // 'English (Australia)'
525 'en_CA' => 'en', // 'English (Canada)'
526 'en_ZA' => 'en', // 'English (South Africa)'
527 'en_NZ' => 'en', // 'English (New Zealand)'
528 'eo' => 'eo', // 'Esperanto'
529 'es_CL' => 'es', // 'Spanish (Chile)'
530 'es_ES' => 'es', // 'Spanish (Spain)'
531 'es_MX' => 'es', // 'Spanish (Mexico)'
532 'es_GT' => 'es', // 'Spanish (Guatemala)'
533 'es_CR' => 'es', // 'Spanish (Costa Rica)'
534 'es_CO' => 'es', // 'Spanish (Colombia)'
535 'es_PE' => 'es', // 'Spanish (Peru)'
536 'es_VE' => 'es', // 'Spanish (Venezuela)'
537 'es_AR' => 'es', // 'Spanish (Argentina)'
538 'et' => 'et', // 'Estonian'
539 'eu' => 'es', // 'Basque'
540 'fa_IR' => 'fa', // 'Persian'
541 'fi' => 'fi', // 'Finnish'
542 'fr_CA' => 'fr', // 'French (Canada)'
543 'fr_FR' => 'fr', // 'French (France)'
544 'fr_BE' => 'fr', // 'French (Belgium)'
545 'fur' => '', // 'Friulian'
546 'gd' => 'ga', // 'Scottish Gaelic'
547 'gl_ES' => 'es', // 'Galician'
548 'gu' => '', // 'Gujarati'
549 'haz' => '', // 'Hazaragi'
550 'he_IL' => 'he', // 'Hebrew'
551 'hi_IN' => 'hi', // 'Hindi'
552 'hr' => 'hr', // 'Croatian'
553 'hsb' => '', // 'Upper Sorbian'
554 'hu_HU' => 'hu', // 'Hungarian'
555 'hy' => '', // 'Armenian'
556 'id_ID' => 'id', // 'Indonesian'
557 'is_IS' => 'is', // 'Icelandic'
558 'it_IT' => 'it', // 'Italian'
559 'ja' => 'ja', // 'Japanese'
560 'jv_ID' => '', // 'Javanese'
561 'ka_GE' => 'ka', // 'Georgian'
562 'kab' => '', // 'Kabyle'
563 'kk' => 'kz', // 'Kazakh'
564 'km' => 'km', // 'Khmer'
565 'kn' => '', // 'Kannada'
566 'ko_KR' => 'ko', // 'Korean'
567 'ckb' => '', // 'Kurdish (Sorani)'
568 'lo' => '', // 'Lao'
569 'lt_LT' => 'lt', // 'Lithuanian'
570 'lv' => 'lv', // 'Latvian'
571 'mk_MK' => 'mk', // 'Macedonian'
572 'ml_IN' => '', // 'Malayalam'
573 'mn' => 'mn', // 'Mongolian'
574 'mr' => '', // 'Marathi'
575 'ms_MY' => 'ms', // 'Malay'
576 'my_MM' => 'my', // 'Myanmar (Burmese)'
577 'nb_NO' => 'no', // 'Norwegian (Bokmål)'
578 'ne_NP' => '', // 'Nepali'
579 'nl_NL' => 'nl', // 'Dutch'
580 'nl_NL_formal' => 'nl', // 'Dutch (Formal)'
581 'nl_BE' => 'nl', // 'Dutch (Belgium)'
582 'nn_NO' => 'no', // 'Norwegian (Nynorsk)'
583 'oci' => '', // 'Occitan'
584 'pa_IN' => 'pa', // 'Punjabi'
585 'pl_PL' => 'pl', // 'Polish'
586 'ps' => '', // 'Pashto'
587 'pt_BR' => 'pt', // 'Portuguese (Brazil)'
588 'pt_AO' => 'pt', // 'Portuguese (Angola)'
589 'pt_PT' => 'pt', // 'Portuguese (Portugal)'
590 'pt_PT_ao90' => 'pt', // 'Portuguese (Portugal, AO90)'
591 'rhg' => '', // 'Rohingya'
592 'ro_RO' => 'ro', // 'Romanian'
593 'ru_RU' => 'ru', // 'Russian'
594 'sah' => '', // 'Sakha'
595 'si_LK' => 'si', // 'Sinhala'
596 'sk_SK' => 'sk', // 'Slovak'
597 'skr' => '', // 'Saraiki'
598 'sl_SI' => 'sl', // 'Slovenian'
599 'sq' => 'sq', // 'Albanian'
600 'sr_RS' => 'sr', // 'Serbian'
601 'sv_SE' => 'sv', // 'Swedish'
602 'sw' => '', // 'Swahili'
603 'szl' => '', // 'Silesian'
604 'ta_IN' => '', // 'Tamil'
605 'te' => '', // 'Telugu'
606 'th' => 'th', // 'Thai'
607 'tl' => '', // 'Tagalog'
608 'tr_TR' => 'tr', // 'Turkish'
609 'tt_RU' => '', // 'Tatar'
610 'tah' => '', // 'Tahitian'
611 'ug_CN' => '', // 'Uighur'
612 'uk' => 'uk', // 'Ukrainian'
613 'ur' => '', // 'Urdu'
614 'uz_UZ' => '', // 'Uzbek'
615 'vi' => 'vn', // 'Vietnamese'
616 'zh_HK' => 'zh', // 'Chinese (Hong Kong)'
617 'zh_TW' => 'zh-tw', // 'Chinese (Taiwan)'
618 'zh_CN' => 'zh', // 'Chinese (China)'
619 ];
620
621 $result = array_key_exists( $wp_locale, $locales ) ? $locales[ $wp_locale ] : 'default';
622
623 if ( 'en' === $result || '' === $result ) {
624 $result = 'default';
625 }
626
627 $this->date_localization = $result;
628
629 return $result;
630 }
631
632 /**
633 * Get localize data.
634 *
635 * @since 2.3.0
636 * @return array
637 */
638 public function get_localize_data() {
639 $upload_dir = wp_upload_dir();
640
641 return [
642 'wc' => [
643 'placeholder' => wc_placeholder_img_src(),
644 ],
645 'optin' => [
646 'types' => [
647 'text' => esc_html__( 'Text', 'sellkit' ),
648 'number' => esc_html__( 'Number', 'sellkit' ),
649 'email' => esc_html__( 'Email', 'sellkit' ),
650 'tel' => esc_html__( 'Tel', 'sellkit' ),
651 'textarea' => esc_html__( 'Textarea', 'sellkit' ),
652 'date' => esc_html__( 'Date', 'sellkit' ),
653 'time' => esc_html__( 'Time', 'sellkit' ),
654 'checkbox' => esc_html__( 'Checkbox', 'sellkit' ),
655 'radio' => esc_html__( 'Radio', 'sellkit' ),
656 'select' => esc_html__( 'Select', 'sellkit' ),
657 'address' => esc_html__( 'Address', 'sellkit' ),
658 'acceptance' => esc_html__( 'Acceptance', 'sellkit' ),
659 'hidden' => esc_html__( 'Hidden', 'sellkit' ),
660 ],
661 'telTypes' => [
662 'all' => esc_html__( 'All', 'sellkit' ),
663 '0' => esc_html__( 'Fixed Line', 'sellkit' ),
664 '1' => esc_html__( 'Mobile', 'sellkit' ),
665 '2' => esc_html__( 'Fixed Line or Mobile', 'sellkit' ),
666 '3' => esc_html__( 'Toll Free', 'sellkit' ),
667 '4' => esc_html__( 'Premium Rate', 'sellkit' ),
668 '5' => esc_html__( 'Shared Cost', 'sellkit' ),
669 '6' => esc_html__( 'VOIP', 'sellkit' ),
670 '7' => esc_html__( 'Personal Number', 'sellkit' ),
671 '8' => esc_html__( 'Pager', 'sellkit' ),
672 '9' => esc_html__( 'UAN', 'sellkit' ),
673 '10' => esc_html__( 'Voicemail', 'sellkit' ),
674 ],
675 'dateLocalization' => $this->date_localization(),
676 'crm' => [
677 'activeCampaign' => [
678 'key' => sellkit_get_option( 'activecampaign_api_key', '' ),
679 'url' => sellkit_get_option( 'activecampaign_api_url', '' ),
680 ],
681 'convertKit' => sellkit_get_option( 'convertkit_api_key', '' ),
682 'drip' => sellkit_get_option( 'drip_api_key', '' ),
683 'getResponse' => sellkit_get_option( 'getresponse_api_key', '' ),
684 'mailchimp' => sellkit_get_option( 'mailchimp_api_key', '' ),
685 'mailerlite' => sellkit_get_option( 'mailerlite_api_key', '' ),
686 ]
687 ],
688 'settings' => [
689 'url' => admin_url() . 'admin.php?page=sellkit-settings#/',
690 'admin' => admin_url(),
691 ],
692 'wpUploadData' => [
693 'baseUrl' => $upload_dir['baseurl'],
694 'baseDir' => $upload_dir['basedir'],
695 ],
696 ];
697 }
698
699 }
700
701 Sellkit_Blocks::get_instance();
702