Version Description
Fixed various minor issues
Download this release
Release Info
Developer | printful |
Plugin | Printful Integration for WooCommerce |
Version | 2.0.1 |
Comparing to | |
See all releases |
Code changes from version 2.0 to 2.0.1
- assets/css/status.css +3 -0
- assets/js/connect.js +9 -0
- includes/class-printful-admin-dashboard.php +4 -0
- includes/class-printful-admin-status.php +39 -16
- includes/class-printful-admin-support.php +4 -4
- includes/class-printful-api-resource.php +9 -1
- includes/class-printful-client.php +3 -4
- includes/class-printful-integration.php +7 -1
- includes/class-printful-request-log.php +5 -0
- includes/class-printful-shipping.php +0 -0
- includes/templates/connect.php +1 -1
- printful-shipping.php +17 -3
- readme.txt +13 -20
assets/css/status.css
CHANGED
@@ -15,4 +15,7 @@
|
|
15 |
}
|
16 |
.printful-status .col-desc {
|
17 |
width: 57%;
|
|
|
|
|
|
|
18 |
}
|
15 |
}
|
16 |
.printful-status .col-desc {
|
17 |
width: 57%;
|
18 |
+
}
|
19 |
+
.printful-status tbody tr:first-child td {
|
20 |
+
font-weight: bold;
|
21 |
}
|
assets/js/connect.js
CHANGED
@@ -16,8 +16,17 @@ var Printful_Connect;
|
|
16 |
jQuery('.printful-connect-button').click(function () {
|
17 |
jQuery(this).hide();
|
18 |
jQuery(this).siblings('.loader').removeClass('hidden');
|
|
|
|
|
|
|
|
|
19 |
});
|
20 |
},
|
|
|
|
|
|
|
|
|
|
|
21 |
listen_status: function () {
|
22 |
this.interval = setInterval(this.get_status.bind(this), 10000); //check status every 10 secs
|
23 |
},
|
16 |
jQuery('.printful-connect-button').click(function () {
|
17 |
jQuery(this).hide();
|
18 |
jQuery(this).siblings('.loader').removeClass('hidden');
|
19 |
+
|
20 |
+
setTimeout(function() {
|
21 |
+
Printful_Connect.hide_loader();
|
22 |
+
}, 60000); //hide the loader after a minute, assume failure
|
23 |
});
|
24 |
},
|
25 |
+
hide_loader: function() {
|
26 |
+
var button = jQuery('.printful-connect-button');
|
27 |
+
button.show();
|
28 |
+
button.siblings('.loader').addClass('hidden');
|
29 |
+
},
|
30 |
listen_status: function () {
|
31 |
this.interval = setInterval(this.get_status.bind(this), 10000); //check status every 10 secs
|
32 |
},
|
includes/class-printful-admin-dashboard.php
CHANGED
@@ -67,6 +67,10 @@ class Printful_Admin_Dashboard {
|
|
67 |
$issues[] = sprintf( $message, $settings_url );
|
68 |
}
|
69 |
|
|
|
|
|
|
|
|
|
70 |
Printful_Admin::load_template( 'header', array( 'tabs' => Printful_Admin::get_tabs() ) );
|
71 |
|
72 |
Printful_Admin::load_template( 'connect', array(
|
67 |
$issues[] = sprintf( $message, $settings_url );
|
68 |
}
|
69 |
|
70 |
+
if ( strpos( get_site_url(), 'localhost' ) ) {
|
71 |
+
$issues[] = 'You can\'t connect to Printful from localhost. Printful needs to be able reach your site to establish a connection.';
|
72 |
+
}
|
73 |
+
|
74 |
Printful_Admin::load_template( 'header', array( 'tabs' => Printful_Admin::get_tabs() ) );
|
75 |
|
76 |
Printful_Admin::load_template( 'connect', array(
|
includes/class-printful-admin-status.php
CHANGED
@@ -16,6 +16,16 @@ class Printful_Admin_Status {
|
|
16 |
|
17 |
public static $_instance;
|
18 |
public static $checklist_items = array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
array(
|
20 |
'name' => 'WordPress Permalinks',
|
21 |
'description' => 'WooCommerce API will not work unless your permalinks in Settings > Permalinks are set up correctly. Make sure you that they are NOT set to "plain".',
|
@@ -28,12 +38,12 @@ class Printful_Admin_Status {
|
|
28 |
),
|
29 |
array(
|
30 |
'name' => 'WooCommerce API enabled',
|
31 |
-
'description' => 'Your site needs to enbable WooCommerce API so that Printful can connect to it',
|
32 |
'method' => 'check_WC_API_enabled',
|
33 |
),
|
34 |
array(
|
35 |
'name' => 'WooCommerce Webhooks',
|
36 |
-
'description' => 'Printful requires WooCommerce webhooks to quickly capture you incoming orders, products updates etc.',
|
37 |
'method' => 'check_PF_webhooks',
|
38 |
),
|
39 |
array(
|
@@ -51,16 +61,6 @@ class Printful_Admin_Status {
|
|
51 |
'description' => 'WordPress needs to be able to connect to Printful server to call webhooks. If this check fails, contact your hosting support.',
|
52 |
'method' => 'check_remote_requests',
|
53 |
),
|
54 |
-
array(
|
55 |
-
'name' => 'Printful API key is set',
|
56 |
-
'description' => 'Your store needs access to Printful API to use most of it\'s features like shipping rates, tax rates and other settings.',
|
57 |
-
'method' => 'check_PF_API_key',
|
58 |
-
),
|
59 |
-
array(
|
60 |
-
'name' => 'Connection to Printful API',
|
61 |
-
'description' => 'Is your store successfully connected to Printful API',
|
62 |
-
'method' => 'check_PF_API_connect',
|
63 |
-
),
|
64 |
array(
|
65 |
'name' => 'Recent store sync errors',
|
66 |
'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.',
|
@@ -92,9 +92,15 @@ class Printful_Admin_Status {
|
|
92 |
'method' => 'check_W3_db_cache',
|
93 |
'silent' => true,
|
94 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
array(
|
96 |
'name' => 'Remove Print Aura plugin',
|
97 |
-
'description' => 'Print Aura plugin is known to cause issues so it needs to be removed',
|
98 |
'method' => 'check_printaura_plugin',
|
99 |
'silent' => true,
|
100 |
),
|
@@ -469,6 +475,18 @@ class Printful_Admin_Status {
|
|
469 |
return self::PF_STATUS_FAIL;
|
470 |
}
|
471 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
472 |
/**
|
473 |
* @return int
|
474 |
*/
|
@@ -492,7 +510,7 @@ class Printful_Admin_Status {
|
|
492 |
$http_args['headers']['X-WC-Webhook-Topic'] = self::PF_REMOTE_REQUEST_TOPIC;
|
493 |
|
494 |
// Webhook away!
|
495 |
-
$response = wp_safe_remote_request( Printful_Base::
|
496 |
|
497 |
if ( is_wp_error( $response ) ) {
|
498 |
return self::PF_STATUS_FAIL;
|
@@ -506,7 +524,7 @@ class Printful_Admin_Status {
|
|
506 |
*/
|
507 |
private function check_WC_auth_url_access() {
|
508 |
|
509 |
-
$url = home_url( '/' ) . 'wc-auth/v1/authorize?app_name=Printful&scope=read_write&user_id=1&return_url=https%3A%2F%2Fwww.printful.com%2Fdashboard%2Fwoocommerce%2Freturn&callback_url=https%3A%2F%
|
510 |
$http_args = array(
|
511 |
'timeout' => 60,
|
512 |
'method' => 'GET',
|
@@ -514,7 +532,12 @@ class Printful_Admin_Status {
|
|
514 |
);
|
515 |
|
516 |
$response = wp_safe_remote_get( $url, $http_args );
|
517 |
-
|
|
|
|
|
|
|
|
|
|
|
518 |
|
519 |
if ( $code == 200 ) {
|
520 |
return self::PF_STATUS_OK;
|
16 |
|
17 |
public static $_instance;
|
18 |
public static $checklist_items = array(
|
19 |
+
array(
|
20 |
+
'name' => 'Connection to Printful API',
|
21 |
+
'description' => 'Is your store successfully connected to Printful API?',
|
22 |
+
'method' => 'check_PF_API_connect',
|
23 |
+
),
|
24 |
+
array(
|
25 |
+
'name' => 'Printful API key is set',
|
26 |
+
'description' => 'Your store needs access to Printful API to use most of it\'s features like shipping rates, tax rates and other settings.',
|
27 |
+
'method' => 'check_PF_API_key',
|
28 |
+
),
|
29 |
array(
|
30 |
'name' => 'WordPress Permalinks',
|
31 |
'description' => 'WooCommerce API will not work unless your permalinks in Settings > Permalinks are set up correctly. Make sure you that they are NOT set to "plain".',
|
38 |
),
|
39 |
array(
|
40 |
'name' => 'WooCommerce API enabled',
|
41 |
+
'description' => 'Your site needs to enbable WooCommerce API so that Printful can connect to it.',
|
42 |
'method' => 'check_WC_API_enabled',
|
43 |
),
|
44 |
array(
|
45 |
'name' => 'WooCommerce Webhooks',
|
46 |
+
'description' => 'Printful requires WooCommerce webhooks to be set up to quickly capture you incoming orders, products updates etc.',
|
47 |
'method' => 'check_PF_webhooks',
|
48 |
),
|
49 |
array(
|
61 |
'description' => 'WordPress needs to be able to connect to Printful server to call webhooks. If this check fails, contact your hosting support.',
|
62 |
'method' => 'check_remote_requests',
|
63 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
array(
|
65 |
'name' => 'Recent store sync errors',
|
66 |
'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.',
|
92 |
'method' => 'check_W3_db_cache',
|
93 |
'silent' => true,
|
94 |
),
|
95 |
+
array(
|
96 |
+
'name' => 'WP SpamShield',
|
97 |
+
'description' => 'If you are using WP SpamShield, you might experiance problems connecting to Printful and pushing products.',
|
98 |
+
'method' => 'check_wp_spamshield',
|
99 |
+
'silent' => true,
|
100 |
+
),
|
101 |
array(
|
102 |
'name' => 'Remove Print Aura plugin',
|
103 |
+
'description' => 'Print Aura plugin is known to cause issues so it needs to be removed.',
|
104 |
'method' => 'check_printaura_plugin',
|
105 |
'silent' => true,
|
106 |
),
|
475 |
return self::PF_STATUS_FAIL;
|
476 |
}
|
477 |
|
478 |
+
/**
|
479 |
+
* @return int
|
480 |
+
*/
|
481 |
+
private function check_wp_spamshield() {
|
482 |
+
|
483 |
+
if ( ! is_plugin_active( 'wp-spamshield/wp-spamshield.php' ) ) {
|
484 |
+
return self::PF_STATUS_OK;
|
485 |
+
}
|
486 |
+
|
487 |
+
return self::PF_STATUS_FAIL;
|
488 |
+
}
|
489 |
+
|
490 |
/**
|
491 |
* @return int
|
492 |
*/
|
510 |
$http_args['headers']['X-WC-Webhook-Topic'] = self::PF_REMOTE_REQUEST_TOPIC;
|
511 |
|
512 |
// Webhook away!
|
513 |
+
$response = wp_safe_remote_request( Printful_Base::get_printful_api_host() . self::PF_REMOTE_REQUEST_URL, $http_args );
|
514 |
|
515 |
if ( is_wp_error( $response ) ) {
|
516 |
return self::PF_STATUS_FAIL;
|
524 |
*/
|
525 |
private function check_WC_auth_url_access() {
|
526 |
|
527 |
+
$url = home_url( '/' ) . 'wc-auth/v1/authorize?app_name=Printful&scope=read_write&user_id=1&return_url=https%3A%2F%2Fwww.printful.com%2Fdashboard%2Fwoocommerce%2Freturn&callback_url=https%3A%2F%2Fapi.printful.com%2Fwebhook%2Fwoocommerce-auth-callback';
|
528 |
$http_args = array(
|
529 |
'timeout' => 60,
|
530 |
'method' => 'GET',
|
532 |
);
|
533 |
|
534 |
$response = wp_safe_remote_get( $url, $http_args );
|
535 |
+
|
536 |
+
if ( is_wp_error( $response ) ) {
|
537 |
+
return self::PF_STATUS_FAIL;
|
538 |
+
}
|
539 |
+
|
540 |
+
$code = $response['response']['code'];
|
541 |
|
542 |
if ( $code == 200 ) {
|
543 |
return self::PF_STATUS_OK;
|
includes/class-printful-admin-support.php
CHANGED
@@ -68,31 +68,29 @@ class Printful_Admin_Support {
|
|
68 |
echo "##### Printful Checklist #####\n";
|
69 |
$checklist = Printful_Admin_Status::get_checklist();
|
70 |
foreach ( $checklist['items'] as $item ) {
|
71 |
-
|
72 |
$status = 'OK';
|
73 |
if($item['status'] == Printful_Admin_Status::PF_STATUS_WARNING) {
|
74 |
$status = 'WARNING';
|
75 |
} else if($item['status'] == Printful_Admin_Status::PF_STATUS_FAIL) {
|
76 |
$status = 'FAIL';
|
77 |
}
|
|
|
78 |
echo str_pad( esc_html($item['name']), 30 ) . "=> " . esc_html($status) . "\n";
|
79 |
}
|
80 |
|
81 |
echo "\n\n##### Printful Last Sync's #####\n";
|
82 |
$syncReport = $this->get_sync_report();
|
83 |
if ( ! empty( $syncReport ) ) {
|
84 |
-
|
85 |
echo str_pad( 'Date', 30 );
|
86 |
echo str_pad( 'Request', 30 );
|
87 |
echo str_pad( 'Message', 30 );
|
88 |
echo "\n";
|
89 |
|
90 |
foreach ( $syncReport as $sr ) {
|
91 |
-
|
92 |
echo str_pad( esc_html($sr['date']) . ';', 30 );
|
93 |
echo str_pad( esc_html($sr['path']) . ';', 30 );
|
94 |
echo str_pad( esc_html($sr['message']) . ';', 30 );
|
95 |
-
|
96 |
echo "\n";
|
97 |
}
|
98 |
}
|
@@ -106,6 +104,7 @@ class Printful_Admin_Support {
|
|
106 |
echo "\n\n##### Active Plugins #####\n";
|
107 |
foreach ( $system_status->get_active_plugins() as $plugin ) {
|
108 |
if ( ! empty( $plugin['name'] ) ) {
|
|
|
109 |
echo esc_html( $plugin['name'] ) . " (" . $plugin['version'] . ")\n";
|
110 |
}
|
111 |
}
|
@@ -203,6 +202,7 @@ class Printful_Admin_Support {
|
|
203 |
|
204 |
foreach ( $data as $key => $item ) {
|
205 |
if ( is_string( $item ) ) {
|
|
|
206 |
echo str_pad( $key, 30 ) . "=> " . $item . "\n";
|
207 |
}
|
208 |
}
|
68 |
echo "##### Printful Checklist #####\n";
|
69 |
$checklist = Printful_Admin_Status::get_checklist();
|
70 |
foreach ( $checklist['items'] as $item ) {
|
|
|
71 |
$status = 'OK';
|
72 |
if($item['status'] == Printful_Admin_Status::PF_STATUS_WARNING) {
|
73 |
$status = 'WARNING';
|
74 |
} else if($item['status'] == Printful_Admin_Status::PF_STATUS_FAIL) {
|
75 |
$status = 'FAIL';
|
76 |
}
|
77 |
+
echo "* ";
|
78 |
echo str_pad( esc_html($item['name']), 30 ) . "=> " . esc_html($status) . "\n";
|
79 |
}
|
80 |
|
81 |
echo "\n\n##### Printful Last Sync's #####\n";
|
82 |
$syncReport = $this->get_sync_report();
|
83 |
if ( ! empty( $syncReport ) ) {
|
|
|
84 |
echo str_pad( 'Date', 30 );
|
85 |
echo str_pad( 'Request', 30 );
|
86 |
echo str_pad( 'Message', 30 );
|
87 |
echo "\n";
|
88 |
|
89 |
foreach ( $syncReport as $sr ) {
|
90 |
+
echo "* ";
|
91 |
echo str_pad( esc_html($sr['date']) . ';', 30 );
|
92 |
echo str_pad( esc_html($sr['path']) . ';', 30 );
|
93 |
echo str_pad( esc_html($sr['message']) . ';', 30 );
|
|
|
94 |
echo "\n";
|
95 |
}
|
96 |
}
|
104 |
echo "\n\n##### Active Plugins #####\n";
|
105 |
foreach ( $system_status->get_active_plugins() as $plugin ) {
|
106 |
if ( ! empty( $plugin['name'] ) ) {
|
107 |
+
echo "* ";
|
108 |
echo esc_html( $plugin['name'] ) . " (" . $plugin['version'] . ")\n";
|
109 |
}
|
110 |
}
|
202 |
|
203 |
foreach ( $data as $key => $item ) {
|
204 |
if ( is_string( $item ) ) {
|
205 |
+
echo "* ";
|
206 |
echo str_pad( $key, 30 ) . "=> " . $item . "\n";
|
207 |
}
|
208 |
}
|
includes/class-printful-api-resource.php
CHANGED
@@ -79,7 +79,15 @@ class Printful_API_Resource extends WC_API_Resource {
|
|
79 |
$checklist['overall_status'] = ( $checklist['overall_status'] ? 'OK' : 'FAIL' );
|
80 |
|
81 |
foreach ( $checklist['items'] as $key => $item ) {
|
82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
$checklist['items'][ $key ] = $item;
|
84 |
}
|
85 |
|
79 |
$checklist['overall_status'] = ( $checklist['overall_status'] ? 'OK' : 'FAIL' );
|
80 |
|
81 |
foreach ( $checklist['items'] as $key => $item ) {
|
82 |
+
|
83 |
+
if ( $item['status'] == Printful_Admin_Status::PF_STATUS_OK ) {
|
84 |
+
$item['status'] = 'OK';
|
85 |
+
} elseif ( $item['status'] == Printful_Admin_Status::PF_STATUS_WARNING ) {
|
86 |
+
$item['status'] = 'WARNING';
|
87 |
+
} else {
|
88 |
+
$item['status'] = 'FAIL';
|
89 |
+
}
|
90 |
+
|
91 |
$checklist['items'][ $key ] = $item;
|
92 |
}
|
93 |
|
includes/class-printful-client.php
CHANGED
@@ -10,7 +10,7 @@ class Printful_Client {
|
|
10 |
private $lastResponseRaw;
|
11 |
private $lastResponse;
|
12 |
private $userAgent = 'Printful WooCommerce Plugin';
|
13 |
-
private $apiUrl
|
14 |
|
15 |
/**
|
16 |
* @param string $key Printful Store API key
|
@@ -36,9 +36,8 @@ class Printful_Client {
|
|
36 |
$this->apiUrl = str_replace( 'https://', 'http://', $this->apiUrl );
|
37 |
}
|
38 |
|
39 |
-
|
40 |
-
|
41 |
-
}
|
42 |
}
|
43 |
|
44 |
/**
|
10 |
private $lastResponseRaw;
|
11 |
private $lastResponse;
|
12 |
private $userAgent = 'Printful WooCommerce Plugin';
|
13 |
+
private $apiUrl;
|
14 |
|
15 |
/**
|
16 |
* @param string $key Printful Store API key
|
36 |
$this->apiUrl = str_replace( 'https://', 'http://', $this->apiUrl );
|
37 |
}
|
38 |
|
39 |
+
//setup api host
|
40 |
+
$this->apiUrl = Printful_Base::get_printful_api_host();
|
|
|
41 |
}
|
42 |
|
43 |
/**
|
includes/class-printful-integration.php
CHANGED
@@ -71,10 +71,16 @@ class Printful_Integration
|
|
71 |
//attempt to connect to printful to verify the API key
|
72 |
try {
|
73 |
$storeData = $client->get( 'store' );
|
74 |
-
if ( ! empty( $storeData ) ) {
|
75 |
$response = true;
|
76 |
$this->clear_connect_error();
|
77 |
set_transient( self::PF_API_CONNECT_STATUS, array( 'status' => 1 ) ); //no expiry
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
} catch ( Exception $e ) {
|
80 |
|
71 |
//attempt to connect to printful to verify the API key
|
72 |
try {
|
73 |
$storeData = $client->get( 'store' );
|
74 |
+
if ( ! empty( $storeData ) && $storeData['type'] == 'woocommerce') {
|
75 |
$response = true;
|
76 |
$this->clear_connect_error();
|
77 |
set_transient( self::PF_API_CONNECT_STATUS, array( 'status' => 1 ) ); //no expiry
|
78 |
+
} elseif ( $storeData['type'] != 'woocommerce' ) {
|
79 |
+
$message = 'Invalid API key. This API key belongs to a ' . ucfirst( $storeData['type'] ) . ' store. WooCommerce store must used to connect with Printful. Enter the correct key in <a href="%s">Settings</a>.';
|
80 |
+
$settings_url = admin_url( 'admin.php?page=printful-dashboard&tab=settings' );
|
81 |
+
$printful_url = Printful_Base::get_printful_host() . 'dashboard/';
|
82 |
+
$this->set_connect_error( sprintf( $message, $settings_url, $printful_url ) );
|
83 |
+
set_transient( self::PF_API_CONNECT_STATUS, array( 'status' => 0 ), MINUTE_IN_SECONDS ); //try again in 1 minute
|
84 |
}
|
85 |
} catch ( Exception $e ) {
|
86 |
|
includes/class-printful-request-log.php
CHANGED
@@ -87,9 +87,14 @@ class Printful_Request_log {
|
|
87 |
* @param $request
|
88 |
* @param $result
|
89 |
* @param string $context
|
|
|
90 |
*/
|
91 |
private function save_to_wc_log( $request, $result, $context) {
|
92 |
|
|
|
|
|
|
|
|
|
93 |
$logger = wc_get_logger();
|
94 |
$context = array( 'source' => $context );
|
95 |
$log_item = array(
|
87 |
* @param $request
|
88 |
* @param $result
|
89 |
* @param string $context
|
90 |
+
* @return bool
|
91 |
*/
|
92 |
private function save_to_wc_log( $request, $result, $context) {
|
93 |
|
94 |
+
if ( ! function_exists( 'wc_get_logger' ) ) {
|
95 |
+
return false;
|
96 |
+
}
|
97 |
+
|
98 |
$logger = wc_get_logger();
|
99 |
$context = array( 'source' => $context );
|
100 |
$log_item = array(
|
includes/class-printful-shipping.php
CHANGED
File without changes
|
includes/templates/connect.php
CHANGED
@@ -23,7 +23,7 @@
|
|
23 |
$url = '#';
|
24 |
} else {
|
25 |
?><p class="connect-description">You're almost done! Just 2 more steps to have your WooCommerce store connected to Printful for automatic order fulfillment.</p><?php
|
26 |
-
$url = Printful_Base::get_printful_host() . 'dashboard/woocommerce/plugin-connect?website=' . urlencode( trailingslashit(
|
27 |
}
|
28 |
|
29 |
echo '<a href="' . esc_url($url) . '" class="button button-primary printful-connect-button ' . ( ! empty( $issues ) ? 'disabled' : '' ) . '" target="_blank">Connect</a>';
|
23 |
$url = '#';
|
24 |
} else {
|
25 |
?><p class="connect-description">You're almost done! Just 2 more steps to have your WooCommerce store connected to Printful for automatic order fulfillment.</p><?php
|
26 |
+
$url = Printful_Base::get_printful_host() . 'dashboard/woocommerce/plugin-connect?website=' . urlencode( trailingslashit( get_home_url() ) ) . '&key=' . urlencode( $consumer_key ) . '&returnUrl=' . urlencode( get_admin_url( null,'admin.php?page=' . Printful_Admin::MENU_SLUG_DASHBOARD ) );
|
27 |
}
|
28 |
|
29 |
echo '<a href="' . esc_url($url) . '" class="button button-primary printful-connect-button ' . ( ! empty( $issues ) ? 'disabled' : '' ) . '" target="_blank">Connect</a>';
|
printful-shipping.php
CHANGED
@@ -3,18 +3,21 @@
|
|
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.0
|
7 |
Author: Printful
|
8 |
Author URI: http://www.printful.com
|
9 |
License: GPL2 http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
-
|
|
|
|
|
11 |
|
12 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
13 |
|
14 |
class Printful_Base {
|
15 |
|
16 |
-
const VERSION = '2.0';
|
17 |
const PF_HOST = 'https://www.printful.com/';
|
|
|
18 |
|
19 |
/**
|
20 |
* Construct the plugin.
|
@@ -109,6 +112,17 @@ class Printful_Base {
|
|
109 |
return self::PF_HOST;
|
110 |
}
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
}
|
113 |
|
114 |
new Printful_Base(); //let's go
|
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.0.1
|
7 |
Author: Printful
|
8 |
Author URI: http://www.printful.com
|
9 |
License: GPL2 http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
+
WC requires at least: 3.0.0
|
11 |
+
WC tested up to: 3.2.0
|
12 |
+
*/
|
13 |
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
class Printful_Base {
|
17 |
|
18 |
+
const VERSION = '2.0.1';
|
19 |
const PF_HOST = 'https://www.printful.com/';
|
20 |
+
const PF_API_HOST = 'https://api.printful.com/';
|
21 |
|
22 |
/**
|
23 |
* Construct the plugin.
|
112 |
return self::PF_HOST;
|
113 |
}
|
114 |
|
115 |
+
/**
|
116 |
+
* @return string
|
117 |
+
*/
|
118 |
+
public static function get_printful_api_host() {
|
119 |
+
if ( defined( 'PF_DEV_API_HOST' ) ) {
|
120 |
+
return PF_DEV_API_HOST;
|
121 |
+
}
|
122 |
+
|
123 |
+
return self::PF_API_HOST;
|
124 |
+
}
|
125 |
+
|
126 |
}
|
127 |
|
128 |
new Printful_Base(); //let's go
|
readme.txt
CHANGED
@@ -3,24 +3,18 @@ Contributors: girts_u, kievins
|
|
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: 4.8
|
6 |
-
Stable tag: 2.0
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
-
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
This plugin will also automatically calculate taxes where it is required for Printful so that your originally intended profit margin stays intact.
|
17 |
-
|
18 |
-
= Known Limitations =
|
19 |
-
|
20 |
-
* Works with WooCommmerce 2.1 and up
|
21 |
|
22 |
== Installation ==
|
23 |
-
1. Upload 'printful-shipping' to the '/wp-content/plugins/' directory
|
24 |
1. Activate the plugin through the 'Plugins' menu in WordPress
|
25 |
1. Click the "Connect" button or add your Printful API key manually to Printful->Settings tab
|
26 |
1. Enable shipping rate calculation in WooCommerce->Settings->Shipping->Printful Shipping tab
|
@@ -44,17 +38,11 @@ Go to https://www.printful.com/dashboard/store , select your WooCommerce store,
|
|
44 |
|
45 |
== Upgrade Notice ==
|
46 |
|
|
|
|
|
|
|
47 |
= 2.0 =
|
48 |
New major plugin version
|
49 |
-
* All new Printful dashboard
|
50 |
-
* Connect to Printful with a single click
|
51 |
-
* View your Printful profits and latest Printful product orders in WordPress admin
|
52 |
-
* Edit your shipping carriers from Printful dashboard
|
53 |
-
* Improved sales tax compatibility with existing tax rates
|
54 |
-
* New status page - see if your integration is running smoothly
|
55 |
-
* New support page - all info about finding help in one place
|
56 |
-
* Size chart tab - when pushing products from Printful, the size chart will be placed in a separate tab
|
57 |
-
* Improved logging of API requests coming to and from Printful
|
58 |
|
59 |
= 1.2.8 =
|
60 |
Fixed bug that caused tax rates to become invisible on checkout since WC 3.0
|
@@ -103,8 +91,13 @@ First release
|
|
103 |
|
104 |
== Changelog ==
|
105 |
|
|
|
|
|
|
|
|
|
|
|
106 |
= 2.0 =
|
107 |
-
New major plugin version
|
108 |
* All new Printful dashboard
|
109 |
* Connect to Printful with a single click
|
110 |
* View your Printful profits and latest Printful product orders in WordPress admin
|
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: 4.8
|
6 |
+
Stable tag: 2.0.1
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
+
See order statistics, automate tax settings and enable live shipping rates for your customers.
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
+
See your order, revenue and profit statistics on WooCommerce Printful's dashboard, automate tax settings and enable live shipping rates from carriers like FedEx on your WooCommerce checkout page. These rates are identical to the list you get when you submit an order manually and are specific to the shipping address your customer provides when checking out.
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
== Installation ==
|
17 |
+
1. Upload 'printful-shipping-for-woocommerce' to the '/wp-content/plugins/' directory
|
18 |
1. Activate the plugin through the 'Plugins' menu in WordPress
|
19 |
1. Click the "Connect" button or add your Printful API key manually to Printful->Settings tab
|
20 |
1. Enable shipping rate calculation in WooCommerce->Settings->Shipping->Printful Shipping tab
|
38 |
|
39 |
== Upgrade Notice ==
|
40 |
|
41 |
+
= 2.0.1 =
|
42 |
+
Fixed various minor issues
|
43 |
+
|
44 |
= 2.0 =
|
45 |
New major plugin version
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
= 1.2.8 =
|
48 |
Fixed bug that caused tax rates to become invisible on checkout since WC 3.0
|
91 |
|
92 |
== Changelog ==
|
93 |
|
94 |
+
= 2.0.1 =
|
95 |
+
* Improved Printful connection status detection
|
96 |
+
* Improvements for system report
|
97 |
+
* Show warning if attempting to connect from localhost
|
98 |
+
|
99 |
= 2.0 =
|
100 |
+
* New major plugin version
|
101 |
* All new Printful dashboard
|
102 |
* Connect to Printful with a single click
|
103 |
* View your Printful profits and latest Printful product orders in WordPress admin
|