Printful Integration for WooCommerce - Version 2.1.2

Version Description

Improved theme support for personalized products and other minor bug fixes

Download this release

Release Info

Developer printful
Plugin Icon 128x128 Printful Integration for WooCommerce
Version 2.1.2
Comparing to
See all releases

Code changes from version 2.1.1 to 2.1.2

i18n/languages/printful.pot CHANGED
@@ -1,7 +1,8 @@
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
- "POT-Creation-Date: 2018-04-26 13:49+0300\n"
5
  "PO-Revision-Date: 2018-04-26 13:50+0300\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
@@ -9,64 +10,80 @@ msgstr ""
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 2.0.7\n"
13
  "X-Poedit-Basepath: ../..\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
  "X-Poedit-KeywordsList: __;_e;_n;_x;_ex;_nx;esc_attr__;esc_attr_e;esc_attr_x;"
16
  "esc_html__;esc_html_e;esc_html_x;_n_noop;_nx_noop;translate_nooped_plural\n"
17
  "X-Poedit-SearchPath-0: .\n"
18
 
19
- #: includes/class-printful-admin-dashboard.php:130
20
  msgid "Loading your stats..."
21
  msgstr ""
22
 
23
- #: includes/class-printful-admin-dashboard.php:136
24
  msgid "Loading your orders..."
25
  msgstr ""
26
 
27
- #: includes/class-printful-admin-settings.php:14
 
 
 
 
28
  msgid "Printful store API key"
29
  msgstr ""
30
 
31
- #: includes/class-printful-admin-settings.php:17
32
  msgid "Your store's Printful API key. Create it in the Prinful dashboard"
33
  msgstr ""
34
 
35
- #: includes/class-printful-admin-settings.php:21
36
  msgid "Calculate sales tax"
37
  msgstr ""
38
 
39
- #: includes/class-printful-admin-settings.php:23
40
- msgid "Calculated for all products shipped to North Carolina and California"
41
- msgstr ""
42
-
43
- #: includes/class-printful-admin-settings.php:27
44
  msgid "Disable SSL"
45
  msgstr ""
46
 
47
- #: includes/class-printful-admin-settings.php:29
48
  msgid ""
49
  "Use HTTP instead of HTTPS to connect to the Printful API (may be required if "
50
  "the plugin does not work for some hosting configurations)"
51
  msgstr ""
52
 
53
- #: includes/class-printful-admin-settings.php:120
54
- msgid "Carriers & Services"
 
55
  msgstr ""
56
 
57
- #: includes/class-printful-admin-settings.php:121
58
- msgid ""
59
- "You can specify here which shipping carriers are available for this store.\n"
60
- "\n"
61
- "\t\t\t Uncheck the ones you want to disable. If you leave “Flat rate” "
62
- "checked it means that any order where flat rate was selected can still ship "
63
- "with any carrier and service."
 
 
 
 
 
 
 
64
  msgstr ""
65
 
66
- #: includes/class-printful-admin-settings.php:127
67
  msgid "You need to be connected to Printful API to edit carrier settings!"
68
  msgstr ""
69
 
 
 
 
 
 
 
 
 
70
  #: includes/class-printful-admin-status.php:22
71
  msgid "Connection to Printful API"
72
  msgstr ""
@@ -112,8 +129,7 @@ msgstr ""
112
 
113
  #: includes/class-printful-admin-status.php:43
114
  msgid ""
115
- "Your site needs to enbable WooCommerce API so that Printful can connect to "
116
- "it."
117
  msgstr ""
118
 
119
  #: includes/class-printful-admin-status.php:47
@@ -142,9 +158,11 @@ msgstr ""
142
 
143
  #: includes/class-printful-admin-status.php:58
144
  msgid ""
145
- "Some hosts have unnecessarily intrusive security checks in place that "
146
- "prevent WooCommerce API authentication from working (mod_security rule "
147
- "#1234234). If this check fails, you will not be able authorize Printful app."
 
 
148
  msgstr ""
149
 
150
  #: includes/class-printful-admin-status.php:62
@@ -158,42 +176,53 @@ msgid ""
158
  msgstr ""
159
 
160
  #: includes/class-printful-admin-status.php:67
161
- msgid "Recent store sync errors"
162
  msgstr ""
163
 
164
  #: includes/class-printful-admin-status.php:68
165
  msgid ""
 
 
 
 
 
 
 
 
 
 
 
166
  "Printful will connect to your store's API regularly and sync your latest "
167
  "products, orders etc. If there have been any recent issues with sync, this "
168
  "check will fail."
169
  msgstr ""
170
 
171
- #: includes/class-printful-admin-status.php:72
172
  msgid "Write permissions"
173
  msgstr ""
174
 
175
- #: includes/class-printful-admin-status.php:73
176
  msgid ""
177
  "Make the uploads directory writable. This is required for mockup generator "
178
  "product push to work correctly. Contact your hosting provider if you need "
179
  "help with this."
180
  msgstr ""
181
 
182
- #: includes/class-printful-admin-status.php:77
183
  msgid "PHP memory limit"
184
  msgstr ""
185
 
186
- #: includes/class-printful-admin-status.php:78
187
  msgid ""
188
  "Set PHP allocated memory limit to at least 128mb. Contact your hosting "
189
  "provider if you need help with this."
190
  msgstr ""
191
 
192
- #: includes/class-printful-admin-status.php:82
193
  msgid "PHP script time limit"
194
  msgstr ""
195
 
196
- #: includes/class-printful-admin-status.php:83
197
  msgid ""
198
  "Set PHP script execution time limit to at least 30 seconds. This is required "
199
  "to successfully push products with many variants. Contact your hosting "
@@ -216,7 +245,7 @@ msgstr ""
216
 
217
  #: includes/class-printful-admin-status.php:99
218
  msgid ""
219
- "If you are using WP SpamShield, you might experiance problems connecting to "
220
  "Printful and pushing products."
221
  msgstr ""
222
 
@@ -228,7 +257,7 @@ msgstr ""
228
  msgid "Print Aura plugin is known to cause issues so it needs to be removed."
229
  msgstr ""
230
 
231
- #: includes/class-printful-admin-status.php:144
232
  msgid "Testing your store (this may take up to 30 seconds)..."
233
  msgstr ""
234
 
@@ -240,69 +269,93 @@ msgstr ""
240
  msgid "##### Printful Checklist #####\n"
241
  msgstr ""
242
 
243
- #: includes/class-printful-admin.php:71 includes/class-printful-admin.php:112
244
  msgid "Dashboard"
245
  msgstr ""
246
 
247
- #: includes/class-printful-admin.php:106
248
  msgid "Settings"
249
  msgstr ""
250
 
251
- #: includes/class-printful-admin.php:107 includes/templates/order-table.php:12
252
  #: includes/templates/order-table.php:58 includes/templates/status-table.php:21
253
  #: includes/templates/status-table.php:49
254
  msgid "Status"
255
  msgstr ""
256
 
257
- #: includes/class-printful-admin.php:108
258
  msgid "Support"
259
  msgstr ""
260
 
261
- #: includes/class-printful-admin.php:114 includes/templates/connect.php:29
262
  msgid "Connect"
263
  msgstr ""
264
 
265
- #: includes/class-printful-admin.php:142
266
  msgid " issue"
267
  msgstr ""
268
 
269
- #: includes/class-printful-api-resource.php:35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  msgid "No size chart was provided"
271
  msgstr ""
272
 
273
- #: includes/class-printful-api-resource.php:41
274
  msgid "The product ID is invalid"
275
  msgstr ""
276
 
277
- #: includes/class-printful-api-resource.php:47
278
  msgid "The product is not found"
279
  msgstr ""
280
 
281
- #: includes/class-printful-api-resource.php:53
282
  msgid "You do not have permission to edit the size chart"
283
  msgstr ""
284
 
285
- #: includes/class-printful-shipping.php:49
286
- msgid "Enable/Disable"
 
 
 
 
287
  msgstr ""
288
 
289
  #: includes/class-printful-shipping.php:51
 
 
 
 
290
  msgid "Enable this shipping method"
291
  msgstr ""
292
 
293
- #: includes/class-printful-shipping.php:55
294
  msgid "Disable Woocommerce rates"
295
  msgstr ""
296
 
297
- #: includes/class-printful-shipping.php:57
298
  msgid "Disable standard Woocommerce rates for products fulfilled by Printful"
299
  msgstr ""
300
 
301
- #: includes/class-printful-shipping.php:61
302
  msgid "Show Printful warnings"
303
  msgstr ""
304
 
305
- #: includes/class-printful-shipping.php:63
306
  msgid "Display Printful status messages if rate API request fails"
307
  msgstr ""
308
 
@@ -310,11 +363,15 @@ msgstr ""
310
  msgid "Size chart"
311
  msgstr ""
312
 
313
- #: includes/class-printful-size-chart-tab.php:39
314
- #: includes/class-printful-size-chart-tab.php:53
315
  msgid "Size Chart"
316
  msgstr ""
317
 
 
 
 
 
318
  #: includes/templates/connect.php:5
319
  msgid "Connect to Printful"
320
  msgstr ""
@@ -390,18 +447,14 @@ msgstr ""
390
  msgid "Notifications"
391
  msgstr ""
392
 
393
- #: includes/templates/setting-submit.php:2
394
  msgid "Save changes"
395
  msgstr ""
396
 
397
- #: includes/templates/setting-submit.php:9
398
  msgid "Saved successfully"
399
  msgstr ""
400
 
401
- #: includes/templates/setting-submit.php:13
402
- msgid "Saving settings failed"
403
- msgstr ""
404
-
405
  #: includes/templates/shipping-notification.php:2
406
  msgid "Printful Shipping"
407
  msgstr ""
@@ -435,11 +488,17 @@ msgstr ""
435
  msgid "PROFIT"
436
  msgstr ""
437
 
438
- #: includes/templates/status-report.php:2
439
  msgid "Copy the box content below and add it to your support message"
440
  msgstr ""
441
 
442
- #: includes/templates/status-report.php:4
 
 
 
 
 
 
443
  msgid "Copy"
444
  msgstr ""
445
 
1
+ #, fuzzy
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: \n"
5
+ "POT-Creation-Date: 2019-05-28 12:28+0300\n"
6
  "PO-Revision-Date: 2018-04-26 13:50+0300\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 2.2.3\n"
14
  "X-Poedit-Basepath: ../..\n"
15
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
  "X-Poedit-KeywordsList: __;_e;_n;_x;_ex;_nx;esc_attr__;esc_attr_e;esc_attr_x;"
17
  "esc_html__;esc_html_e;esc_html_x;_n_noop;_nx_noop;translate_nooped_plural\n"
18
  "X-Poedit-SearchPath-0: .\n"
19
 
20
+ #: includes/class-printful-admin-dashboard.php:124
21
  msgid "Loading your stats..."
22
  msgstr ""
23
 
24
+ #: includes/class-printful-admin-dashboard.php:130
25
  msgid "Loading your orders..."
26
  msgstr ""
27
 
28
+ #: includes/class-printful-admin-settings.php:24
29
+ msgid "states where Printful applies sales tax"
30
+ msgstr ""
31
+
32
+ #: includes/class-printful-admin-settings.php:29
33
  msgid "Printful store API key"
34
  msgstr ""
35
 
36
+ #: includes/class-printful-admin-settings.php:32
37
  msgid "Your store's Printful API key. Create it in the Prinful dashboard"
38
  msgstr ""
39
 
40
+ #: includes/class-printful-admin-settings.php:36
41
  msgid "Calculate sales tax"
42
  msgstr ""
43
 
44
+ #: includes/class-printful-admin-settings.php:45
 
 
 
 
45
  msgid "Disable SSL"
46
  msgstr ""
47
 
48
+ #: includes/class-printful-admin-settings.php:47
49
  msgid ""
50
  "Use HTTP instead of HTTPS to connect to the Printful API (may be required if "
51
  "the plugin does not work for some hosting configurations)"
52
  msgstr ""
53
 
54
+ #: includes/class-printful-admin-settings.php:51
55
+ #: includes/class-printful-admin-settings.php:53
56
+ msgid "Personalization button text"
57
  msgstr ""
58
 
59
+ #: includes/class-printful-admin-settings.php:57
60
+ msgid "Personalization button color"
61
+ msgstr ""
62
+
63
+ #: includes/class-printful-admin-settings.php:59
64
+ msgid "Personalization button background color"
65
+ msgstr ""
66
+
67
+ #: includes/class-printful-admin-settings.php:154
68
+ msgid "flat rates"
69
+ msgstr ""
70
+
71
+ #: includes/class-printful-admin-settings.php:158
72
+ msgid "Shipping Methods"
73
  msgstr ""
74
 
75
+ #: includes/class-printful-admin-settings.php:171
76
  msgid "You need to be connected to Printful API to edit carrier settings!"
77
  msgstr ""
78
 
79
+ #: includes/class-printful-admin-settings.php:310
80
+ msgid "International from USA"
81
+ msgstr ""
82
+
83
+ #: includes/class-printful-admin-settings.php:316
84
+ msgid "International from EU"
85
+ msgstr ""
86
+
87
  #: includes/class-printful-admin-status.php:22
88
  msgid "Connection to Printful API"
89
  msgstr ""
129
 
130
  #: includes/class-printful-admin-status.php:43
131
  msgid ""
132
+ "Your site needs to enable WooCommerce API so that Printful can connect to it."
 
133
  msgstr ""
134
 
135
  #: includes/class-printful-admin-status.php:47
158
 
159
  #: includes/class-printful-admin-status.php:58
160
  msgid ""
161
+ "Printful needs access to WooCommerce API authorize page. This sometimes may "
162
+ "get blocked due to hosts having unnecessarily intrusive security checks in "
163
+ "place that prevent WooCommerce API authentication from working (for example "
164
+ "mod_security rule #1234234). If this check fails, you will not be able "
165
+ "authorize Printful app."
166
  msgstr ""
167
 
168
  #: includes/class-printful-admin-status.php:62
176
  msgstr ""
177
 
178
  #: includes/class-printful-admin-status.php:67
179
+ msgid "WordPress site url"
180
  msgstr ""
181
 
182
  #: includes/class-printful-admin-status.php:68
183
  msgid ""
184
+ "If your currently setup WordPress site URL is redirected to another URL the "
185
+ "integration might not work correctly. Typically this happens with incorrect "
186
+ "http to https redirects. Go to Settings > General to fix this."
187
+ msgstr ""
188
+
189
+ #: includes/class-printful-admin-status.php:72
190
+ msgid "Recent store sync errors"
191
+ msgstr ""
192
+
193
+ #: includes/class-printful-admin-status.php:73
194
+ msgid ""
195
  "Printful will connect to your store's API regularly and sync your latest "
196
  "products, orders etc. If there have been any recent issues with sync, this "
197
  "check will fail."
198
  msgstr ""
199
 
200
+ #: includes/class-printful-admin-status.php:77
201
  msgid "Write permissions"
202
  msgstr ""
203
 
204
+ #: includes/class-printful-admin-status.php:78
205
  msgid ""
206
  "Make the uploads directory writable. This is required for mockup generator "
207
  "product push to work correctly. Contact your hosting provider if you need "
208
  "help with this."
209
  msgstr ""
210
 
211
+ #: includes/class-printful-admin-status.php:82
212
  msgid "PHP memory limit"
213
  msgstr ""
214
 
215
+ #: includes/class-printful-admin-status.php:83
216
  msgid ""
217
  "Set PHP allocated memory limit to at least 128mb. Contact your hosting "
218
  "provider if you need help with this."
219
  msgstr ""
220
 
221
+ #: includes/class-printful-admin-status.php:87
222
  msgid "PHP script time limit"
223
  msgstr ""
224
 
225
+ #: includes/class-printful-admin-status.php:88
226
  msgid ""
227
  "Set PHP script execution time limit to at least 30 seconds. This is required "
228
  "to successfully push products with many variants. Contact your hosting "
245
 
246
  #: includes/class-printful-admin-status.php:99
247
  msgid ""
248
+ "If you are using WP SpamShield, you might experience problems connecting to "
249
  "Printful and pushing products."
250
  msgstr ""
251
 
257
  msgid "Print Aura plugin is known to cause issues so it needs to be removed."
258
  msgstr ""
259
 
260
+ #: includes/class-printful-admin-status.php:146
261
  msgid "Testing your store (this may take up to 30 seconds)..."
262
  msgstr ""
263
 
269
  msgid "##### Printful Checklist #####\n"
270
  msgstr ""
271
 
272
+ #: includes/class-printful-admin.php:75 includes/class-printful-admin.php:117
273
  msgid "Dashboard"
274
  msgstr ""
275
 
276
+ #: includes/class-printful-admin.php:111
277
  msgid "Settings"
278
  msgstr ""
279
 
280
+ #: includes/class-printful-admin.php:112 includes/templates/order-table.php:12
281
  #: includes/templates/order-table.php:58 includes/templates/status-table.php:21
282
  #: includes/templates/status-table.php:49
283
  msgid "Status"
284
  msgstr ""
285
 
286
+ #: includes/class-printful-admin.php:113
287
  msgid "Support"
288
  msgstr ""
289
 
290
+ #: includes/class-printful-admin.php:119 includes/templates/connect.php:29
291
  msgid "Connect"
292
  msgstr ""
293
 
294
+ #: includes/class-printful-admin.php:147
295
  msgid " issue"
296
  msgstr ""
297
 
298
+ #: includes/class-printful-rest-api-controller.php:36
299
+ msgid "Printful access key"
300
+ msgstr ""
301
+
302
+ #: includes/class-printful-rest-api-controller.php:41
303
+ msgid "Store Identifier"
304
+ msgstr ""
305
+
306
+ #: includes/class-printful-rest-api-controller.php:55
307
+ msgid "Unique identifier for the resource."
308
+ msgstr ""
309
+
310
+ #: includes/class-printful-rest-api-controller.php:61
311
+ msgid "Printful size guide"
312
+ msgstr ""
313
+
314
+ #: includes/class-printful-rest-api-controller.php:122
315
  msgid "No size chart was provided"
316
  msgstr ""
317
 
318
+ #: includes/class-printful-rest-api-controller.php:128
319
  msgid "The product ID is invalid"
320
  msgstr ""
321
 
322
+ #: includes/class-printful-rest-api-controller.php:134
323
  msgid "The product is not found"
324
  msgstr ""
325
 
326
+ #: includes/class-printful-rest-api-controller.php:140
327
  msgid "You do not have permission to edit the size chart"
328
  msgstr ""
329
 
330
+ #: includes/class-printful-rest-api-controller.php:209
331
+ msgid "Sorry, you cannot list resources."
332
+ msgstr ""
333
+
334
+ #: includes/class-printful-rest-api-controller.php:226
335
+ msgid "Sorry, you are not allowed to edit this resource."
336
  msgstr ""
337
 
338
  #: includes/class-printful-shipping.php:51
339
+ msgid "Enable/Disable"
340
+ msgstr ""
341
+
342
+ #: includes/class-printful-shipping.php:53
343
  msgid "Enable this shipping method"
344
  msgstr ""
345
 
346
+ #: includes/class-printful-shipping.php:57
347
  msgid "Disable Woocommerce rates"
348
  msgstr ""
349
 
350
+ #: includes/class-printful-shipping.php:59
351
  msgid "Disable standard Woocommerce rates for products fulfilled by Printful"
352
  msgstr ""
353
 
354
+ #: includes/class-printful-shipping.php:63
355
  msgid "Show Printful warnings"
356
  msgstr ""
357
 
358
+ #: includes/class-printful-shipping.php:65
359
  msgid "Display Printful status messages if rate API request fails"
360
  msgstr ""
361
 
363
  msgid "Size chart"
364
  msgstr ""
365
 
366
+ #: includes/class-printful-size-chart-tab.php:38
367
+ #: includes/class-printful-size-chart-tab.php:51
368
  msgid "Size Chart"
369
  msgstr ""
370
 
371
+ #: includes/class-printful-taxes.php:160
372
+ msgid "Sales Tax"
373
+ msgstr ""
374
+
375
  #: includes/templates/connect.php:5
376
  msgid "Connect to Printful"
377
  msgstr ""
447
  msgid "Notifications"
448
  msgstr ""
449
 
450
+ #: includes/templates/setting-submit.php:7
451
  msgid "Save changes"
452
  msgstr ""
453
 
454
+ #: includes/templates/setting-submit.php:14
455
  msgid "Saved successfully"
456
  msgstr ""
457
 
 
 
 
 
458
  #: includes/templates/shipping-notification.php:2
459
  msgid "Printful Shipping"
460
  msgstr ""
488
  msgid "PROFIT"
489
  msgstr ""
490
 
491
+ #: includes/templates/status-report.php:3
492
  msgid "Copy the box content below and add it to your support message"
493
  msgstr ""
494
 
495
+ #: includes/templates/status-report.php:5
496
+ msgid ""
497
+ "Note: this status report may not include an error log. Contact your hosting "
498
+ "provider if you need help with acquiring error logs."
499
+ msgstr ""
500
+
501
+ #: includes/templates/status-report.php:8
502
  msgid "Copy"
503
  msgstr ""
504
 
includes/class-printful-admin-dashboard.php CHANGED
@@ -53,7 +53,6 @@ class Printful_Admin_Dashboard {
53
  $status = Printful_Admin_Status::instance();
54
  $issues = array();
55
 
56
- $api_enabled = $status->run_single_test( 'check_WC_API_enabled' );
57
  $permalinks_set = $status->run_single_test( 'check_permalinks' );
58
 
59
  if ( $permalinks_set == Printful_Admin_Status::PF_STATUS_FAIL ) {
@@ -62,12 +61,6 @@ class Printful_Admin_Dashboard {
62
  $issues[] = sprintf( $message, $settings_url );
63
  }
64
 
65
- if ( $api_enabled == Printful_Admin_Status::PF_STATUS_FAIL ) {
66
- $message = 'Your site needs to enable WooCommerce API so that Printful can connect to it. Go to <a href="%s">API settings</a> and enable it.';
67
- $settings_url = admin_url( 'admin.php?page=wc-settings&tab=api' );
68
- $issues[] = sprintf( $message, $settings_url );
69
- }
70
-
71
  if ( strpos( get_site_url(), 'localhost' ) ) {
72
  $issues[] = 'You can\'t connect to Printful from localhost. Printful needs to be able reach your site to establish a connection.';
73
  }
53
  $status = Printful_Admin_Status::instance();
54
  $issues = array();
55
 
 
56
  $permalinks_set = $status->run_single_test( 'check_permalinks' );
57
 
58
  if ( $permalinks_set == Printful_Admin_Status::PF_STATUS_FAIL ) {
61
  $issues[] = sprintf( $message, $settings_url );
62
  }
63
 
 
 
 
 
 
 
64
  if ( strpos( get_site_url(), 'localhost' ) ) {
65
  $issues[] = 'You can\'t connect to Printful from localhost. Printful needs to be able reach your site to establish a connection.';
66
  }
includes/class-printful-admin-status.php CHANGED
@@ -38,11 +38,6 @@ class Printful_Admin_Status {
38
  'description' => __( 'WordPress should always be updated to the latest version. Updates can be installed from your WordPress admin dashboard.', 'printful' ),
39
  'method' => 'check_WP_version',
40
  ),
41
- array(
42
- 'name' => __( 'WooCommerce API enabled', 'printful' ),
43
- 'description' => __( 'Your site needs to enbable WooCommerce API so that Printful can connect to it.', 'printful' ),
44
- 'method' => 'check_WC_API_enabled',
45
- ),
46
  array(
47
  'name' => __( 'WooCommerce Webhooks', 'printful' ),
48
  'description' => __( 'Printful requires WooCommerce webhooks to be set up to quickly capture you incoming orders, products updates etc.', 'printful' ),
@@ -63,6 +58,11 @@ class Printful_Admin_Status {
63
  'description' => __( 'WordPress needs to be able to connect to Printful server to call webhooks. If this check fails, contact your hosting support.', 'printful' ),
64
  'method' => 'check_remote_requests',
65
  ),
 
 
 
 
 
66
  array(
67
  'name' => __( 'Recent store sync errors', 'printful' ),
68
  'description' => __( 'Printful will connect to your store\'s API regularly and sync your latest products, orders etc. If there have been any recent issues with sync, this check will fail.', 'printful' ),
@@ -132,8 +132,7 @@ class Printful_Admin_Status {
132
  * Render the view
133
  */
134
  public function render() {
135
-
136
- Printful_Admin::load_template( 'header', array( 'tabs' => Printful_Admin::get_tabs() ) );
137
 
138
  $checklist = self::get_checklist( true );
139
  if ( $checklist ) {
@@ -454,20 +453,6 @@ class Printful_Admin_Status {
454
  return self::PF_STATUS_OK;
455
  }
456
 
457
- /**
458
- * @return int
459
- */
460
- private function check_WC_API_enabled() {
461
-
462
- $enabled = get_option( 'woocommerce_api_enabled', false );
463
-
464
- if ( $enabled == 'yes' ) {
465
- return self::PF_STATUS_OK;
466
- }
467
-
468
- return self::PF_STATUS_FAIL;
469
- }
470
-
471
  /**
472
  * @return int
473
  */
@@ -564,4 +549,23 @@ class Printful_Admin_Status {
564
 
565
  return self::PF_STATUS_FAIL;
566
  }
567
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  'description' => __( 'WordPress should always be updated to the latest version. Updates can be installed from your WordPress admin dashboard.', 'printful' ),
39
  'method' => 'check_WP_version',
40
  ),
 
 
 
 
 
41
  array(
42
  'name' => __( 'WooCommerce Webhooks', 'printful' ),
43
  'description' => __( 'Printful requires WooCommerce webhooks to be set up to quickly capture you incoming orders, products updates etc.', 'printful' ),
58
  'description' => __( 'WordPress needs to be able to connect to Printful server to call webhooks. If this check fails, contact your hosting support.', 'printful' ),
59
  'method' => 'check_remote_requests',
60
  ),
61
+ array(
62
+ 'name' => __( 'WordPress Site URL', 'printful' ),
63
+ 'description' => __( 'If your currently setup WordPress site URL is redirected to another URL the integration might not work correctly. Typically this happens with incorrect http to https redirects. Go to Settings > General to fix this.' , 'printful' ),
64
+ 'method' => 'check_site_url_redirect',
65
+ ),
66
  array(
67
  'name' => __( 'Recent store sync errors', 'printful' ),
68
  'description' => __( 'Printful will connect to your store\'s API regularly and sync your latest products, orders etc. If there have been any recent issues with sync, this check will fail.', 'printful' ),
132
  * Render the view
133
  */
134
  public function render() {
135
+ Printful_Admin::load_template( 'header', array( 'tabs' => Printful_Admin::get_tabs() ) );
 
136
 
137
  $checklist = self::get_checklist( true );
138
  if ( $checklist ) {
453
  return self::PF_STATUS_OK;
454
  }
455
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
456
  /**
457
  * @return int
458
  */
549
 
550
  return self::PF_STATUS_FAIL;
551
  }
552
+
553
+ /**
554
+ * @return int
555
+ */
556
+ private function check_site_url_redirect()
557
+ {
558
+ $head = wp_remote_head(get_option( 'siteurl' ), array('redirection' => 0));
559
+ /** @var WP_HTTP_Requests_Response $response */
560
+ $response = $head['http_response'];
561
+ if ($response->get_status() == 200) {
562
+ return self::PF_STATUS_OK;
563
+ }
564
+
565
+ if (in_array($response->get_status(), array(301, 302, 303, 307))) {
566
+ return self::PF_STATUS_FAIL;
567
+ }
568
+
569
+ return self::PF_STATUS_WARNING;
570
+ }
571
+ }
includes/class-printful-customizer.php CHANGED
@@ -19,11 +19,26 @@ class Printful_Customizer {
19
  add_filter( 'woocommerce_add_cart_item_data', array( $this, 'save_customizer_hash_data_to_cart' ), 10, 1 );
20
  add_filter( 'woocommerce_cart_item_thumbnail', array( $this, 'change_woocommerce_cart_item_thumbnail' ), 20, 2 );
21
  // add property to order
22
- add_action('woocommerce_add_order_item_meta', array( $this, 'save_customizer_hash_order_meta' ), 10, 2 );
 
23
  // hide hash from meta data provided to user
24
  add_filter( 'woocommerce_order_item_get_formatted_meta_data', array( $this, 'hide_hash_from_meta_data'), 10, 1 );
25
  add_action( 'wp_ajax_printful_customized_thumb', array( $this, 'printful_customized_thumb' ) );
26
  add_action( 'wp_ajax_nopriv_printful_customized_thumb', array( $this, 'printful_customized_thumb' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  }
28
 
29
  /**
19
  add_filter( 'woocommerce_add_cart_item_data', array( $this, 'save_customizer_hash_data_to_cart' ), 10, 1 );
20
  add_filter( 'woocommerce_cart_item_thumbnail', array( $this, 'change_woocommerce_cart_item_thumbnail' ), 20, 2 );
21
  // add property to order
22
+ add_action('woocommerce_new_order_item', array( $this, 'save_customizer_hash_order_meta' ), 10, 2 );
23
+
24
  // hide hash from meta data provided to user
25
  add_filter( 'woocommerce_order_item_get_formatted_meta_data', array( $this, 'hide_hash_from_meta_data'), 10, 1 );
26
  add_action( 'wp_ajax_printful_customized_thumb', array( $this, 'printful_customized_thumb' ) );
27
  add_action( 'wp_ajax_nopriv_printful_customized_thumb', array( $this, 'printful_customized_thumb' ) );
28
+
29
+ add_action( 'wp_enqueue_scripts', array( $this, 'load_customizer_scripts' ));
30
+ }
31
+
32
+ /**
33
+ * Load customizer scripts for cart and product page
34
+ */
35
+ public function load_customizer_scripts() {
36
+ global $post;
37
+
38
+ $is_customized_product = $post && get_post_meta( $post->ID, 'pf_customizable', true );
39
+ if ($is_customized_product || is_cart()) {
40
+ wp_enqueue_script( 'printful-product-customizer', plugins_url( '../assets/js/product-customizer.js', __FILE__ ) );
41
+ }
42
  }
43
 
44
  /**
includes/class-printful-rest-api-controller.php CHANGED
@@ -28,6 +28,7 @@ class Printful_REST_API_Controller extends WC_REST_Controller
28
  'methods' => WP_REST_Server::EDITABLE,
29
  'callback' => array( $this, 'set_printful_access' ),
30
  'permission_callback' => array( $this, 'get_items_permissions_check' ),
 
31
  'args' => array(
32
  'accessKey' => array(
33
  'required' => false,
@@ -48,6 +49,7 @@ class Printful_REST_API_Controller extends WC_REST_Controller
48
  'methods' => WP_REST_Server::EDITABLE,
49
  'callback' => array( $this, 'post_size_guide' ),
50
  'permission_callback' => array( $this, 'update_item_permissions_check' ),
 
51
  'args' => array(
52
  'product_id' => array(
53
  'description' => __( 'Unique identifier for the resource.', 'printful' ),
@@ -67,6 +69,7 @@ class Printful_REST_API_Controller extends WC_REST_Controller
67
  'methods' => WP_REST_Server::READABLE,
68
  'permission_callback' => array( $this, 'get_items_permissions_check' ),
69
  'callback' => array( $this, 'get_version' ),
 
70
  )
71
  ) );
72
 
@@ -75,6 +78,7 @@ class Printful_REST_API_Controller extends WC_REST_Controller
75
  'methods' => WP_REST_Server::READABLE,
76
  'permission_callback' => array( $this, 'get_items_permissions_check' ),
77
  'callback' => array( $this, 'get_store_data' ),
 
78
  )
79
  ) );
80
  }
28
  'methods' => WP_REST_Server::EDITABLE,
29
  'callback' => array( $this, 'set_printful_access' ),
30
  'permission_callback' => array( $this, 'get_items_permissions_check' ),
31
+ 'show_in_index' => false,
32
  'args' => array(
33
  'accessKey' => array(
34
  'required' => false,
49
  'methods' => WP_REST_Server::EDITABLE,
50
  'callback' => array( $this, 'post_size_guide' ),
51
  'permission_callback' => array( $this, 'update_item_permissions_check' ),
52
+ 'show_in_index' => false,
53
  'args' => array(
54
  'product_id' => array(
55
  'description' => __( 'Unique identifier for the resource.', 'printful' ),
69
  'methods' => WP_REST_Server::READABLE,
70
  'permission_callback' => array( $this, 'get_items_permissions_check' ),
71
  'callback' => array( $this, 'get_version' ),
72
+ 'show_in_index' => false,
73
  )
74
  ) );
75
 
78
  'methods' => WP_REST_Server::READABLE,
79
  'permission_callback' => array( $this, 'get_items_permissions_check' ),
80
  'callback' => array( $this, 'get_store_data' ),
81
+ 'show_in_index' => true,
82
  )
83
  ) );
84
  }
includes/class-printful-shipping.php CHANGED
@@ -233,6 +233,7 @@ class Printful_Shipping extends WC_Shipping_Method
233
  ),
234
  'items' => array(),
235
  'currency' => get_woocommerce_currency(),
 
236
  );
237
 
238
 
233
  ),
234
  'items' => array(),
235
  'currency' => get_woocommerce_currency(),
236
+ 'locale' => get_locale()
237
  );
238
 
239
 
includes/class-printful-template.php CHANGED
@@ -32,8 +32,6 @@ class Printful_Template {
32
  global $post;
33
 
34
  if ( $post && get_post_meta( $post->ID, 'pf_customizable', true ) ) {
35
- // bind script that's responsible for manipulation with personalization
36
- wp_enqueue_script( 'printful-product-customizer', plugins_url( '../assets/js/product-customizer.js', __FILE__ ) );
37
  // load template for personalization button
38
  Printful_Admin::load_template( 'personalize-button', array(
39
  'site_url' => get_site_url(),
32
  global $post;
33
 
34
  if ( $post && get_post_meta( $post->ID, 'pf_customizable', true ) ) {
 
 
35
  // load template for personalization button
36
  Printful_Admin::load_template( 'personalize-button', array(
37
  'site_url' => get_site_url(),
includes/templates/setting-group.php CHANGED
@@ -26,7 +26,6 @@
26
  <tr valign="top">
27
 
28
  <th scope="row" class="titledesc">
29
- <span class="woocommerce-help-tip"></span>
30
  <label for="<?php echo esc_attr($key); ?>"><?php echo esc_html($setting['title']); ?></label>
31
  </th>
32
 
26
  <tr valign="top">
27
 
28
  <th scope="row" class="titledesc">
 
29
  <label for="<?php echo esc_attr($key); ?>"><?php echo esc_html($setting['title']); ?></label>
30
  </th>
31
 
printful-shipping.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Printful Integration for WooCommerce
4
  Plugin URI: https://wordpress.org/plugins/printful-shipping-for-woocommerce/
5
  Description: Calculate correct shipping and tax rates for your Printful-Woocommerce integration.
6
- Version: 2.1.1
7
  Author: Printful
8
  Author URI: http://www.printful.com
9
  License: GPL2 http://www.gnu.org/licenses/gpl-2.0.html
@@ -20,7 +20,7 @@ if ( ! defined( 'PF_PLUGIN_FILE' ) ) {
20
 
21
  class Printful_Base {
22
 
23
- const VERSION = '2.1.1';
24
  const PF_HOST = 'https://www.printful.com/';
25
  const PF_API_HOST = 'https://api.printful.com/';
26
 
@@ -44,12 +44,6 @@ class Printful_Base {
44
  return;
45
  }
46
 
47
- //Register API endpoint
48
- add_filter('woocommerce_api_classes', array($this, 'add_api_resource'));
49
-
50
- //Add settings to WooCommerce Index response (legacy - v2)
51
- add_filter('woocommerce_api_index', array($this, 'add_extra_info_to_api_index'));
52
-
53
  //load required classes
54
  require_once 'includes/class-printful-integration.php';
55
  require_once 'includes/class-printful-carriers.php';
@@ -94,29 +88,6 @@ class Printful_Base {
94
  load_plugin_textdomain( 'printful', false, plugin_basename( dirname( PF_PLUGIN_FILE ) ) . '/i18n/languages' );
95
  }
96
 
97
- /**
98
- * Added API endpoints
99
- * @param $endpoints
100
- * @return array
101
- */
102
- public function add_api_resource($endpoints) {
103
- require_once 'includes/class-printful-api-resource.php';
104
- $endpoints[] = 'Printful_API_Resource';
105
-
106
- return $endpoints;
107
- }
108
-
109
- /**
110
- * @param $available
111
- * Include plugin version in WC API Index
112
- * @return mixed
113
- */
114
- public static function add_extra_info_to_api_index($available) {
115
- $available['printful_plugin_version'] = self::VERSION;
116
- $available['locale'] = get_locale();
117
-
118
- return $available;
119
- }
120
 
121
  /**
122
  * @return string
@@ -155,7 +126,7 @@ class Printful_Base {
155
  }
156
 
157
  // Init REST API routes.
158
- add_action( 'rest_api_init', array( $this, 'register_rest_routes' ));
159
  }
160
 
161
  public function register_rest_routes()
3
  Plugin Name: Printful Integration for WooCommerce
4
  Plugin URI: https://wordpress.org/plugins/printful-shipping-for-woocommerce/
5
  Description: Calculate correct shipping and tax rates for your Printful-Woocommerce integration.
6
+ Version: 2.1.2
7
  Author: Printful
8
  Author URI: http://www.printful.com
9
  License: GPL2 http://www.gnu.org/licenses/gpl-2.0.html
20
 
21
  class Printful_Base {
22
 
23
+ const VERSION = '2.1.2';
24
  const PF_HOST = 'https://www.printful.com/';
25
  const PF_API_HOST = 'https://api.printful.com/';
26
 
44
  return;
45
  }
46
 
 
 
 
 
 
 
47
  //load required classes
48
  require_once 'includes/class-printful-integration.php';
49
  require_once 'includes/class-printful-carriers.php';
88
  load_plugin_textdomain( 'printful', false, plugin_basename( dirname( PF_PLUGIN_FILE ) ) . '/i18n/languages' );
89
  }
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
  /**
93
  * @return string
126
  }
127
 
128
  // Init REST API routes.
129
+ add_action( 'rest_api_init', array( $this, 'register_rest_routes' ), 20);
130
  }
131
 
132
  public function register_rest_routes()
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Printful Integration for WooCommerce ===
2
  Contributors: girts_u, kievins, kberzins
3
  Tags: woocommerce, printful, drop shipping, shipping, shipping rates, fulfillment, printing, fedex, carriers, checkout, t-shirts
4
- Requires at least: 3.8
5
  Tested up to: 5.1
6
- Stable tag: 2.1.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -62,6 +62,9 @@ Go to https://www.printful.com/dashboard/store , select your WooCommerce store,
62
 
63
  == Upgrade Notice ==
64
 
 
 
 
65
  = 2.1.1 =
66
  Improved support for WooCommerce 3.6 and other minor bug fixes
67
 
@@ -142,6 +145,9 @@ First release
142
 
143
  == Changelog ==
144
 
 
 
 
145
  = 2.1.1 =
146
  * Improved support for WooCommerce 3.6 and other minor bug fixes
147
 
1
  === Printful Integration for WooCommerce ===
2
  Contributors: girts_u, kievins, kberzins
3
  Tags: woocommerce, printful, drop shipping, shipping, shipping rates, fulfillment, printing, fedex, carriers, checkout, t-shirts
4
+ Requires at least: 4.4
5
  Tested up to: 5.1
6
+ Stable tag: 2.1.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
62
 
63
  == Upgrade Notice ==
64
 
65
+ = 2.1.2 =
66
+ Improved theme support for personalized products and other minor bug fixes
67
+
68
  = 2.1.1 =
69
  Improved support for WooCommerce 3.6 and other minor bug fixes
70
 
145
 
146
  == Changelog ==
147
 
148
+ = 2.1.2 =
149
+ * Improved theme support for personalized products and other minor bug fixes
150
+
151
  = 2.1.1 =
152
  * Improved support for WooCommerce 3.6 and other minor bug fixes
153