DefaultFreeExtensions.php
22 KB
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
<?php
/**
* Gets a list of fallback methods if remote fetching is disabled.
*/
namespace Automattic\WooCommerce\Internal\Admin\RemoteFreeExtensions;
use Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions\DefaultPaymentGateways;
defined( 'ABSPATH' ) || exit;
/**
* Default Free Extensions
*/
class DefaultFreeExtensions {
/**
* Get default specs.
*
* @return array Default specs.
*/
public static function get_all() {
$bundles = [
[
'key' => 'obw/basics',
'title' => __( 'Get the basics', 'woocommerce' ),
'plugins' => [
self::get_plugin( 'woocommerce-payments' ),
self::get_plugin( 'woocommerce-services:shipping' ),
self::get_plugin( 'woocommerce-services:tax' ),
self::get_plugin( 'jetpack' ),
],
],
[
'key' => 'obw/grow',
'title' => __( 'Grow your store', 'woocommerce' ),
'plugins' => [
self::get_plugin( 'mailpoet' ),
self::get_plugin( 'codistoconnect' ),
self::get_plugin( 'google-listings-and-ads' ),
self::get_plugin( 'pinterest-for-woocommerce' ),
self::get_plugin( 'facebook-for-woocommerce' ),
self::get_plugin( 'tiktok-for-business:alt' ),
],
],
[
'key' => 'task-list/reach',
'title' => __( 'Reach out to customers', 'woocommerce' ),
'plugins' => [
self::get_plugin( 'mailpoet:alt' ),
self::get_plugin( 'mailchimp-for-woocommerce' ),
self::get_plugin( 'creative-mail-by-constant-contact' ),
],
],
[
'key' => 'task-list/grow',
'title' => __( 'Grow your store', 'woocommerce' ),
'plugins' => [
self::get_plugin( 'google-listings-and-ads:alt' ),
self::get_plugin( 'tiktok-for-business' ),
self::get_plugin( 'pinterest-for-woocommerce:alt' ),
self::get_plugin( 'facebook-for-woocommerce:alt' ),
self::get_plugin( 'codistoconnect:alt' ),
],
],
];
$bundles = wp_json_encode( $bundles );
return json_decode( $bundles );
}
/**
* Get the plugin arguments by slug.
*
* @param string $slug Slug.
* @return array
*/
public static function get_plugin( $slug ) {
$plugins = array(
'google-listings-and-ads' => [
'name' => __( 'Google Listings & Ads', 'woocommerce' ),
'description' => sprintf(
/* translators: 1: opening product link tag. 2: closing link tag */
__( 'Drive sales with %1$sGoogle Listings and Ads%2$s', 'woocommerce' ),
'<a href="https://woocommerce.com/products/google-listings-and-ads" target="_blank">',
'</a>'
),
'image_url' => plugins_url( '/assets/images/onboarding/google.svg', WC_PLUGIN_FILE ),
'manage_url' => 'admin.php?page=wc-admin&path=%2Fgoogle%2Fstart',
'is_built_by_wc' => true,
'is_visible' => [
[
'type' => 'not',
'operand' => [
[
'type' => 'plugins_activated',
'plugins' => [ 'google-listings-and-ads' ],
],
],
],
],
],
'google-listings-and-ads:alt' => [
'name' => __( 'Google Listings & Ads', 'woocommerce' ),
'description' => __( 'Reach more shoppers and drive sales for your store. Integrate with Google to list your products for free and launch paid ad campaigns.', 'woocommerce' ),
'image_url' => plugins_url( '/assets/images/onboarding/google.svg', WC_PLUGIN_FILE ),
'manage_url' => 'admin.php?page=wc-admin&path=%2Fgoogle%2Fstart',
'is_built_by_wc' => true,
],
'facebook-for-woocommerce' => [
'name' => __( 'Facebook for WooCommerce', 'woocommerce' ),
'description' => __( 'List products and create ads on Facebook and Instagram with <a href="https://woocommerce.com/products/facebook/">Facebook for WooCommerce</a>', 'woocommerce' ),
'image_url' => plugins_url( '/assets/images/onboarding/facebook.png', WC_PLUGIN_FILE ),
'manage_url' => 'admin.php?page=wc-facebook',
'is_built_by_wc' => false,
],
'facebook-for-woocommerce:alt' => [
'name' => __( 'Facebook for WooCommerce', 'woocommerce' ),
'description' => __( 'List products and create ads on Facebook and Instagram.', 'woocommerce' ),
'image_url' => plugins_url( '/assets/images/onboarding/facebook.png', WC_PLUGIN_FILE ),
'manage_url' => 'admin.php?page=wc-facebook',
'is_built_by_wc' => false,
],
'pinterest-for-woocommerce' => [
'name' => __( 'Pinterest for WooCommerce', 'woocommerce' ),
'description' => __( 'Get your products in front of Pinners searching for ideas and things to buy.', 'woocommerce' ),
'image_url' => plugins_url( '/assets/images/onboarding/pinterest.png', WC_PLUGIN_FILE ),
'manage_url' => 'admin.php?page=wc-admin&path=%2Fpinterest%2Flanding',
'is_built_by_wc' => true,
],
'pinterest-for-woocommerce:alt' => [
'name' => __( 'Pinterest for WooCommerce', 'woocommerce' ),
'description' => __( 'Get your products in front of Pinterest users searching for ideas and things to buy. Get started with Pinterest and make your entire product catalog browsable.', 'woocommerce' ),
'image_url' => plugins_url( '/assets/images/onboarding/pinterest.png', WC_PLUGIN_FILE ),
'manage_url' => 'admin.php?page=wc-admin&path=%2Fpinterest%2Flanding',
'is_built_by_wc' => true,
],
'mailpoet' => [
'name' => __( 'MailPoet', 'woocommerce' ),
'description' => __( 'Create and send purchase follow-up emails, newsletters, and promotional campaigns straight from your dashboard.', 'woocommerce' ),
'image_url' => plugins_url( '/assets/images/onboarding/mailpoet.png', WC_PLUGIN_FILE ),
'manage_url' => 'admin.php?page=mailpoet-newsletters',
'is_built_by_wc' => true,
],
'mailchimp-for-woocommerce' => [
'name' => __( 'Mailchimp', 'woocommerce' ),
'description' => __( 'Send targeted campaigns, recover abandoned carts and much more with Mailchimp.', 'woocommerce' ),
'image_url' => plugins_url( '/assets/images/onboarding/mailchimp-for-woocommerce.png', WC_PLUGIN_FILE ),
'manage_url' => 'admin.php?page=mailchimp-woocommerce',
'is_built_by_wc' => false,
],
'creative-mail-by-constant-contact' => [
'name' => __( 'Creative Mail for WooCommerce', 'woocommerce' ),
'description' => __( 'Create on-brand store campaigns, fast email promotions and customer retargeting with Creative Mail.', 'woocommerce' ),
'image_url' => plugins_url( '/assets/images/onboarding/creative-mail-by-constant-contact.png', WC_PLUGIN_FILE ),
'manage_url' => 'admin.php?page=creativemail',
'is_built_by_wc' => false,
],
'codistoconnect' => [
'name' => __( 'Codisto for WooCommerce', 'woocommerce' ),
'description' => sprintf(
/* translators: 1: opening product link tag. 2: closing link tag */
__( 'Sell on Amazon, eBay, Walmart and more directly from WooCommerce with %1$sCodisto%2$s', 'woocommerce' ),
'<a href="https://woocommerce.com/pt-br/products/amazon-ebay-integration/?quid=c247a85321c9e93e7c3c6f1eb072e6e5" target="_blank">',
'</a>'
),
'image_url' => plugins_url( '/assets/images/onboarding/codistoconnect.png', WC_PLUGIN_FILE ),
'manage_url' => 'admin.php?page=codisto-settings',
'is_built_by_wc' => true,
],
'codistoconnect:alt' => [
'name' => __( 'Codisto for WooCommerce', 'woocommerce' ),
'description' => __( 'Sell on Amazon, eBay, Walmart and more directly from WooCommerce.', 'woocommerce' ),
'image_url' => plugins_url( '/assets/images/onboarding/codistoconnect.png', WC_PLUGIN_FILE ),
'manage_url' => 'admin.php?page=codisto-settings',
'is_built_by_wc' => true,
],
'woocommerce-payments' => [
'description' => sprintf(
/* translators: 1: opening product link tag. 2: closing link tag */
__( 'Accept credit cards and other popular payment methods with %1$sWooCommerce Payments%2$s', 'woocommerce' ),
'<a href="https://woocommerce.com/products/woocommerce-payments" target="_blank">',
'</a>'
),
'is_visible' => [
[
'type' => 'or',
'operands' => [
[
'type' => 'base_location_country',
'value' => 'US',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'PR',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'AU',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'CA',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'DE',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'ES',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'FR',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'GB',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'IE',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'IT',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'NZ',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'AT',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'BE',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'NL',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'PL',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'PT',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'CH',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'HK',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'SG',
'operation' => '=',
],
],
],
DefaultPaymentGateways::get_rules_for_cbd( false ),
],
'is_built_by_wc' => true,
],
'woocommerce-services:shipping' => [
'description' => sprintf(
/* translators: 1: opening product link tag. 2: closing link tag */
__( 'Print shipping labels with %1$sWooCommerce Shipping%2$s', 'woocommerce' ),
'<a href="https://woocommerce.com/products/shipping" target="_blank">',
'</a>'
),
'is_visible' => [
[
'type' => 'base_location_country',
'value' => 'US',
'operation' => '=',
],
[
'type' => 'not',
'operand' => [
[
'type' => 'plugins_activated',
'plugins' => [ 'woocommerce-services' ],
],
],
],
[
'type' => 'or',
'operands' => [
[
[
'type' => 'option',
'transformers' => [
[
'use' => 'dot_notation',
'arguments' => [
'path' => 'product_types',
],
],
[
'use' => 'count',
],
],
'option_name' => 'woocommerce_onboarding_profile',
'value' => 1,
'default' => array(),
'operation' => '!=',
],
],
[
[
'type' => 'option',
'transformers' => [
[
'use' => 'dot_notation',
'arguments' => [
'path' => 'product_types.0',
],
],
],
'option_name' => 'woocommerce_onboarding_profile',
'value' => 'downloads',
'default' => '',
'operation' => '!=',
],
],
],
],
],
'is_built_by_wc' => true,
],
'woocommerce-services:tax' => [
'description' => sprintf(
/* translators: 1: opening product link tag. 2: closing link tag */
__( 'Get automated sales tax with %1$sWooCommerce Tax%2$s', 'woocommerce' ),
'<a href="https://woocommerce.com/products/tax" target="_blank">',
'</a>'
),
'is_visible' => [
[
'type' => 'or',
'operands' => [
[
'type' => 'base_location_country',
'value' => 'US',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'FR',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'GB',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'DE',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'CA',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'AU',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'GR',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'BE',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'PT',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'DK',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'SE',
'operation' => '=',
],
],
],
[
'type' => 'not',
'operand' => [
[
'type' => 'plugins_activated',
'plugins' => [ 'woocommerce-services' ],
],
],
],
],
'is_built_by_wc' => true,
],
'jetpack' => [
'description' => sprintf(
/* translators: 1: opening product link tag. 2: closing link tag */
__( 'Enhance speed and security with %1$sJetpack%2$s', 'woocommerce' ),
'<a href="https://woocommerce.com/products/jetpack" target="_blank">',
'</a>'
),
'is_visible' => [
[
'type' => 'not',
'operand' => [
[
'type' => 'plugins_activated',
'plugins' => [ 'jetpack' ],
],
],
],
],
'is_built_by_wc' => false,
],
'mailpoet' => [
'name' => __( 'MailPoet', 'woocommerce' ),
'description' => sprintf(
/* translators: 1: opening product link tag. 2: closing link tag */
__( 'Level up your email marketing with %1$sMailPoet%2$s', 'woocommerce' ),
'<a href="https://woocommerce.com/products/mailpoet" target="_blank">',
'</a>'
),
'manage_url' => 'admin.php?page=mailpoet-newsletters',
'is_visible' => [
[
'type' => 'not',
'operand' => [
[
'type' => 'plugins_activated',
'plugins' => [ 'mailpoet' ],
],
],
],
],
'is_built_by_wc' => true,
],
'mailpoet:alt' => [
'name' => __( 'MailPoet', 'woocommerce' ),
'description' => __( 'Create and send purchase follow-up emails, newsletters, and promotional campaigns straight from your dashboard.', 'woocommerce' ),
'image_url' => plugins_url( '/assets/images/onboarding/mailpoet.png', WC_PLUGIN_FILE ),
'manage_url' => 'admin.php?page=mailpoet-newsletters',
'is_built_by_wc' => true,
],
'tiktok-for-business' => [
'name' => __( 'TikTok for WooCommerce', 'woocommerce' ),
'image_url' => plugins_url( '/assets/images/onboarding/tiktok.svg', WC_PLUGIN_FILE ),
'description' =>
__( 'Grow your online sales by promoting your products on TikTok to over one billion monthly active users around the world.', 'woocommerce' ),
'manage_url' => 'admin.php?page=tiktok',
'is_visible' => [
[
'type' => 'or',
'operands' => [
[
'type' => 'base_location_country',
'value' => 'US',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'CA',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'MX',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'AT',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'BE',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'CZ',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'DK',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'FI',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'FR',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'DE',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'GR',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'HU',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'IE',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'IT',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'NL',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'PL',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'PT',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'RO',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'ES',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'SE',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'GB',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'CH',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'NO',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'AU',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'NZ',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'SG',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'MY',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'PH',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'ID',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'VN',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'TH',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'KR',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'IL',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'AE',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'RU',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'UA',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'TR',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'SA',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'BR',
'operation' => '=',
],
[
'type' => 'base_location_country',
'value' => 'JP',
'operation' => '=',
],
],
],
],
'is_built_by_wc' => false,
],
'tiktok-for-business:alt' => [
'name' => __( 'TikTok for WooCommerce', 'woocommerce' ),
'image_url' => plugins_url( '/assets/images/onboarding/tiktok.svg', WC_PLUGIN_FILE ),
'description' => sprintf(
/* translators: 1: opening product link tag. 2: closing link tag */
__( 'Create ad campaigns and reach one billion global users with %1$sTikTok for WooCommerce%2$s', 'woocommerce' ),
'<a href="https://woocommerce.com/products/tiktok-for-woocommerce" target="_blank">',
'</a>'
),
'manage_url' => 'admin.php?page=tiktok',
'is_built_by_wc' => false,
'is_visible' => false,
],
);
$plugin = $plugins[ $slug ];
$plugin['key'] = $slug;
return $plugin;
}
}