AfterShip – WooCommerce Tracking - Version 1.13.0

Version Description

  • Enhancement - Added New Admin Menu
  • Enhancement - Enhancement - Updated Settings Page Design
  • Enhancement - Compatible with WooCommerce OAuth Authentication
Download this release

Release Info

Developer aftership
Plugin Icon 128x128 AfterShip – WooCommerce Tracking
Version 1.13.0
Comparing to
See all releases

Code changes from version 1.12.15 to 1.13.0

.huskyrc ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ {
2
+ "hooks": {
3
+ "pre-commit": "./vendor/bin/phpcbf ./"
4
+ }
5
+ }
aftership-woocommerce-tracking.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: AfterShip Tracking - All-In-One WooCommerce Order Tracking (Free plan available)
4
  * Plugin URI: http://aftership.com/
5
  * Description: Track orders in one place. shipment tracking, automated notifications, order lookup, branded tracking page, delivery day prediction
6
- * Version: 1.12.15
7
  * Author: AfterShip
8
  * Author URI: http://aftership.com
9
  *
@@ -20,7 +20,9 @@ if ( ! defined( 'ABSPATH' ) ) {
20
 
21
  require_once( 'woo-includes/woo-functions.php' );
22
 
23
- define( 'AFTERSHIP_VERSION', '1.12.15' );
 
 
24
 
25
  if ( is_woocommerce_active() ) {
26
 
@@ -117,7 +119,7 @@ if ( is_woocommerce_active() ) {
117
  $this->plugin_dir = untrailingslashit( plugin_dir_path( __FILE__ ) );
118
  $this->plugin_url = untrailingslashit( plugin_dir_url( __FILE__ ) );
119
 
120
- $this->options = get_option( 'aftership_option_name' );
121
  $this->couriers = json_decode( file_get_contents( $this->plugin_dir . '/assets/js/couriers.json' ), true );
122
  $this->selected_couriers = $this->get_selected_couriers();
123
  $this->use_track_button = isset( $this->options['use_track_button'] ) ? $this->options['use_track_button'] : $this->use_track_button;
@@ -126,10 +128,28 @@ if ( is_woocommerce_active() ) {
126
  // Include required files.
127
  $this->includes();
128
 
 
 
 
 
 
129
  add_action( 'admin_print_styles', array( $this->actions, 'admin_styles' ) );
 
 
 
 
130
  add_action( 'add_meta_boxes', array( $this->actions, 'add_meta_box' ) );
131
  add_action( 'woocommerce_process_shop_order_meta', array( $this->actions, 'save_meta_box' ), 0, 2 );
 
 
 
132
  add_action( 'plugins_loaded', array( $this->actions, 'load_plugin_textdomain' ) );
 
 
 
 
 
 
133
 
134
  // View Order Page.
135
  add_action( 'woocommerce_view_order', array( $this->actions, 'display_tracking_info' ) );
@@ -155,8 +175,139 @@ if ( is_woocommerce_active() ) {
155
  add_action( 'edit_user_profile', array( $this->actions, 'add_api_key_field' ) );
156
  add_action( 'personal_options_update', array( $this->actions, 'generate_api_key' ) );
157
  add_action( 'edit_user_profile_update', array( $this->actions, 'generate_api_key' ) );
 
 
 
 
 
 
 
 
158
 
159
  register_activation_hook( __FILE__, array( $this, 'install' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  }
161
 
162
  /**
@@ -175,6 +326,8 @@ if ( is_woocommerce_active() ) {
175
  if ( is_object( $wp_roles ) ) {
176
  $wp_roles->add_cap( 'administrator', 'manage_aftership' );
177
  }
 
 
178
  }
179
 
180
 
@@ -184,7 +337,7 @@ if ( is_woocommerce_active() ) {
184
  * @return array
185
  */
186
  public function get_selected_couriers() {
187
- $slugs = explode( ',', $this->options['couriers'] );
188
  $selected_couriers = array();
189
  foreach ( $this->couriers as $courier ) {
190
  if ( in_array( $courier['slug'], $slugs, true ) ) {
@@ -205,6 +358,7 @@ if ( is_woocommerce_active() ) {
205
  require( $this->plugin_dir . '/includes/api/class-aftership-api.php' );
206
  $this->api = new AfterShip_API();
207
  require_once( $this->plugin_dir . '/includes/class-aftership-settings.php' );
 
208
  }
209
 
210
  /**
3
  * Plugin Name: AfterShip Tracking - All-In-One WooCommerce Order Tracking (Free plan available)
4
  * Plugin URI: http://aftership.com/
5
  * Description: Track orders in one place. shipment tracking, automated notifications, order lookup, branded tracking page, delivery day prediction
6
+ * Version: 1.13.0
7
  * Author: AfterShip
8
  * Author URI: http://aftership.com
9
  *
20
 
21
  require_once( 'woo-includes/woo-functions.php' );
22
 
23
+ define( 'AFTERSHIP_VERSION', '1.13.0' );
24
+ define( 'AFTERSHIP_PATH', dirname( __FILE__ ) );
25
+ define( 'AFTERSHIP_ASSETS_URL', plugins_url() . '/' . basename( AFTERSHIP_PATH ) );
26
 
27
  if ( is_woocommerce_active() ) {
28
 
119
  $this->plugin_dir = untrailingslashit( plugin_dir_path( __FILE__ ) );
120
  $this->plugin_url = untrailingslashit( plugin_dir_url( __FILE__ ) );
121
 
122
+ $this->options = get_option( 'aftership_option_name' ) ? get_option( 'aftership_option_name' ) : array();
123
  $this->couriers = json_decode( file_get_contents( $this->plugin_dir . '/assets/js/couriers.json' ), true );
124
  $this->selected_couriers = $this->get_selected_couriers();
125
  $this->use_track_button = isset( $this->options['use_track_button'] ) ? $this->options['use_track_button'] : $this->use_track_button;
128
  // Include required files.
129
  $this->includes();
130
 
131
+ // Check if woocommerce active.
132
+ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) {
133
+ add_filter( 'woocommerce_rest_api_get_rest_namespaces', array( $this, 'add_rest_api' ) );
134
+ }
135
+
136
  add_action( 'admin_print_styles', array( $this->actions, 'admin_styles' ) );
137
+ add_action( 'admin_enqueue_scripts', array( $this, 'automizely_aftership_add_admin_css' ) );
138
+ // Remove other plugins notice message for setting and landing page
139
+ add_action( 'admin_enqueue_scripts', array( $this, 'as_admin_remove_notice_style' ) );
140
+
141
  add_action( 'add_meta_boxes', array( $this->actions, 'add_meta_box' ) );
142
  add_action( 'woocommerce_process_shop_order_meta', array( $this->actions, 'save_meta_box' ), 0, 2 );
143
+ // register admin pages for the plugin
144
+ add_action( 'admin_menu', array( $this, 'automizely_aftership_admin_menu' ) );
145
+ add_action( 'admin_menu', array( $this, 'automizely_aftership_connect_page' ) );
146
  add_action( 'plugins_loaded', array( $this->actions, 'load_plugin_textdomain' ) );
147
+ /**
148
+ * Admin Initialization calls registration
149
+ * We need this to send user to plugin's Admin page on activation
150
+ */
151
+ add_action( 'admin_init', array( $this, 'automizely_aftership_plugin_active' ) );
152
+ add_action( 'admin_footer', array( $this, 'deactivate_modal' ) );
153
 
154
  // View Order Page.
155
  add_action( 'woocommerce_view_order', array( $this->actions, 'display_tracking_info' ) );
175
  add_action( 'edit_user_profile', array( $this->actions, 'add_api_key_field' ) );
176
  add_action( 'personal_options_update', array( $this->actions, 'generate_api_key' ) );
177
  add_action( 'edit_user_profile_update', array( $this->actions, 'generate_api_key' ) );
178
+ add_action( 'admin_notices', array( $this->actions, 'show_notices' ) );
179
+
180
+ add_filter( 'rest_shop_order_collection_params', array( $this->actions, 'add_collection_params' ), 10, 1 );
181
+ add_filter( 'rest_shop_coupon_collection_params', array( $this->actions, 'add_collection_params' ), 10, 1 );
182
+ add_filter( 'rest_product_collection_params', array( $this->actions, 'add_collection_params' ), 10, 1 );
183
+ add_filter( 'woocommerce_rest_orders_prepare_object_query', array( $this->actions, 'add_query' ), 10, 2 );
184
+ add_filter( 'woocommerce_rest_product_object_query', array( $this->actions, 'add_query' ), 10, 2 );
185
+ add_filter( 'woocommerce_rest_shop_coupon_object_query', array( $this->actions, 'add_query' ), 10, 2 );
186
 
187
  register_activation_hook( __FILE__, array( $this, 'install' ) );
188
+ register_deactivation_hook( __FILE__, array( $this, 'deactivation' ) );
189
+ register_uninstall_hook( __FILE__, array( $this, 'deactivation' ) );
190
+ set_transient( 'wc-aftership-plugin' . AFTERSHIP_VERSION, 'alive', 7 * 24 * 3600 );
191
+ }
192
+
193
+ /**
194
+ * Description: Will add the landing page into the Menu System of WordPress
195
+ * Parameters: None
196
+ */
197
+ public function automizely_aftership_admin_menu() {
198
+ add_menu_page(
199
+ 'AfterShip',
200
+ 'AfterShip',
201
+ 'manage_options',
202
+ 'aftership-setting-admin',
203
+ array( $this, 'aftership_setting_page' ),
204
+ AFTERSHIP_ASSETS_URL . '/assets/images/favicon-aftership.svg'
205
+ );
206
+ }
207
+
208
+ /**
209
+ * Description: Will add the landing page into the Menu System of WordPress
210
+ * Parameters: None
211
+ */
212
+ public function automizely_aftership_connect_page() {
213
+ add_menu_page(
214
+ 'AfterShip Connect',
215
+ 'AfterShip Connect',
216
+ 'manage_options',
217
+ 'automizely-aftership-index',
218
+ array( $this, 'automizely_aftership_index' )
219
+ );
220
+ remove_menu_page( 'automizely-aftership-index' );
221
+ }
222
+
223
+ /**
224
+ * Description: Called via admin_init action in Constructor
225
+ * Will redirect to the plugin page if the automizely_aftership_plugin_actived is setup.
226
+ * Return: void
227
+ **/
228
+ function automizely_aftership_plugin_active() {
229
+ if ( get_option( 'automizely_aftership_plugin_actived', false ) ) {
230
+ delete_option( 'automizely_aftership_plugin_actived' );
231
+ exit( wp_redirect( 'admin.php?page=automizely-aftership-index' ) );
232
+ }
233
+ }
234
+
235
+ /**
236
+ * Description: Will add the backend CSS required for the display of automizely-marketing settings page.
237
+ * Parameters: hook | Not used.
238
+ */
239
+ public function automizely_aftership_add_admin_css() {
240
+ wp_register_style( 'automizely-aftership-admin', plugins_url( 'assets/css/index.css', __FILE__ ), array(), '1.1' );
241
+ wp_enqueue_style( 'automizely-aftership-admin' );
242
+ wp_register_style( 'automizely-aftership-admin', plugins_url( 'assets/css/normalize.css', __FILE__ ), array(), '1.0' );
243
+ wp_enqueue_style( 'automizely-aftership-admin' );
244
+ }
245
+
246
+ /**
247
+ * Remove other plugins notice message for setting and landing page
248
+ */
249
+ public function as_admin_remove_notice_style() {
250
+ $page_screen = get_current_screen()->id;
251
+ $screen_remove_notice = array(
252
+ 'toplevel_page_automizely-aftership-index',
253
+ 'toplevel_page_aftership-setting-admin',
254
+ );
255
+
256
+ if ( current_user_can( 'manage_options' ) && in_array( $page_screen, $screen_remove_notice ) ) {
257
+ echo '<style>.update-nag, .updated, .notice, #wpfooter, .error, .is-dismissible { display: none; }</style>';
258
+ }
259
+ }
260
+
261
+ /**
262
+ * Description:
263
+ * Parameters: None
264
+ */
265
+ public function automizely_aftership_index() {
266
+ if ( isset( $this->options['connected'] ) && $this->options['connected'] === true ) {
267
+ exit( wp_redirect( 'admin.php?page=aftership-setting-admin' ) );
268
+ }
269
+ include_once AFTERSHIP_PATH . '/views/automizely_aftership_on_boarding_view.php';
270
+ }
271
+
272
+ /**
273
+ * Options page callback
274
+ */
275
+ public function aftership_setting_page() {
276
+ include AFTERSHIP_PATH . '/views/automizely_aftership_setting_view.php';
277
+ }
278
+
279
+ public function deactivate_modal() {
280
+ if ( current_user_can( 'manage_options' ) ) {
281
+ global $pagenow;
282
+
283
+ if ( 'plugins.php' !== $pagenow ) {
284
+ return;
285
+ }
286
+ }
287
+ }
288
+
289
+ /**
290
+ * Remove settings when plugin deactivation.
291
+ **/
292
+ function deactivation() {
293
+ $this->options['connected'] = false;
294
+ update_option( 'aftership_option_name', $this->options );
295
+
296
+ // Revoke AfterShip plugin REST oauth key when user Deactivation | Delete plugin
297
+ call_user_func( array( $this->actions, 'revoke_aftership_key' ) );
298
+
299
+ delete_option( 'automizely_aftership_plugin_actived' );
300
+ }
301
+
302
+ /**
303
+ * Register REST API endpoints
304
+ *
305
+ * @param array $controllers REST Controllers.
306
+ * @return array
307
+ */
308
+ function add_rest_api( $controllers ) {
309
+ $controllers['wc/aftership/v1']['settings'] = 'AM_REST_Settings_Controller';
310
+ return $controllers;
311
  }
312
 
313
  /**
326
  if ( is_object( $wp_roles ) ) {
327
  $wp_roles->add_cap( 'administrator', 'manage_aftership' );
328
  }
329
+
330
+ add_option( 'automizely_aftership_plugin_actived', true );
331
  }
332
 
333
 
337
  * @return array
338
  */
339
  public function get_selected_couriers() {
340
+ $slugs = explode( ',', ( isset( $this->options['couriers'] ) ? $this->options['couriers'] : '' ) );
341
  $selected_couriers = array();
342
  foreach ( $this->couriers as $courier ) {
343
  if ( in_array( $courier['slug'], $slugs, true ) ) {
358
  require( $this->plugin_dir . '/includes/api/class-aftership-api.php' );
359
  $this->api = new AfterShip_API();
360
  require_once( $this->plugin_dir . '/includes/class-aftership-settings.php' );
361
+ require_once( $this->plugin_dir . '/includes/api/aftership/v1/class-am-rest-settings-controller.php' );
362
  }
363
 
364
  /**
assets/css/IBMPlexSans-Regular.ttf ADDED
Binary file
assets/css/index.css ADDED
@@ -0,0 +1,189 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .auto-as-index-container {
2
+ font-family: SF Pro Text;
3
+ text-align: center;
4
+ margin-left: -20px;
5
+ }
6
+ .auto-as-index-header {
7
+ text-align: center;
8
+ background-color: #ffeecf;
9
+ padding-top: 72px;
10
+ padding-bottom: 72px;
11
+ background-image: url(../images/wordpress-banner.png);
12
+ background-size: 100%;
13
+ position: relative;
14
+ }
15
+ .auto-as-index-logo {
16
+ position: absolute;
17
+ top: 20px;
18
+ left: 30px;
19
+ }
20
+ .auto-as-index-header-title {
21
+ font-size: 36px;
22
+ line-height: 44px;
23
+ font-weight: 700;
24
+ margin-bottom: 20px;
25
+ }
26
+ .auto-as-index-header-desc {
27
+ font-size: 26px;
28
+ line-height: 40px;
29
+ margin-top: 20px;
30
+ max-width: 860px;
31
+ margin: 0 auto;
32
+ }
33
+
34
+ .auto-as-index-header-button {
35
+ color: #ffffff;
36
+ background-color: #ffa300;
37
+ width: 248px;
38
+ height: 72px;
39
+ line-height: 72px;
40
+ font-size: 26px;
41
+ font-weight: 700px;
42
+ border: none;
43
+ border-radius: 8px;
44
+ margin: 28px auto 0;
45
+ cursor: pointer;
46
+ }
47
+ .auto-as-index-header-button:active {
48
+ opacity: 0.85;
49
+ }
50
+
51
+ .auto-as-admin-container {
52
+ font-family: SF Pro Text;
53
+ margin-left: -20px;
54
+ }
55
+ .auto-as-admin-container * {
56
+ box-sizing: border-box;
57
+ }
58
+ .auto-as-admin-header {
59
+ text-align: center;
60
+ background-color: #ffeecf;
61
+ padding-top: 72px;
62
+ padding-bottom: 72px;
63
+ background-image: url(https://assets.aftership.com/img/wordpress-banner.png);
64
+ background-size: 100%;
65
+ position: relative;
66
+ }
67
+ .auto-as-admin-logo {
68
+ position: absolute;
69
+ top: 20px;
70
+ left: 30px;
71
+ }
72
+ .auto-as-admin-logo img {
73
+ width: 105px;
74
+ height: 32px;
75
+ }
76
+ .auto-as-admin-header-title {
77
+ font-size: 36px;
78
+ line-height: 44px;
79
+ font-weight: 700;
80
+ margin-bottom: 20px;
81
+ }
82
+ .auto-as-admin-header-desc {
83
+ font-size: 26px;
84
+ line-height: 40px;
85
+ margin-top: 20px;
86
+ max-width: 860px;
87
+ margin: 0 auto;
88
+ }
89
+ .auto-as-admin-header-button {
90
+ color: #ffffff;
91
+ background-color: #ffa300;
92
+ width: 248px;
93
+ height: 72px;
94
+ line-height: 72px;
95
+ font-size: 26px;
96
+ font-weight: 700px;
97
+ border: none;
98
+ border-radius: 8px;
99
+ margin: 28px auto 0;
100
+ cursor: pointer;
101
+ }
102
+ .auto-as-admin-header-button:active {
103
+ opacity: 0.85;
104
+ }
105
+
106
+ .auto-as-admin-recommand {
107
+ max-width: 860px;
108
+ margin: auto;
109
+ text-align: left;
110
+ font-size: 14px;
111
+ }
112
+ .auto-as-admin-recommand-title {
113
+ font-size: 26px;
114
+ line-height: 32px;
115
+ margin-bottom: 28px;
116
+ }
117
+ .auto-as-admin-recommand-list {
118
+ display: flex;
119
+ justify-content: space-between;
120
+ }
121
+ .auto-as-admin-recommand-list a {
122
+ text-decoration: none;
123
+ color: inherit;
124
+ }
125
+ .auto-as-admin-recommand-list-item {
126
+ display: flex;
127
+ }
128
+ .auto-as-admin-recommand-list-item-detail {
129
+ width: 190px;
130
+ margin-left: 20px;
131
+ display: flex;
132
+ line-height: 20px;
133
+ flex-direction: column;
134
+ justify-content: space-between;
135
+ }
136
+ .auto-as-admin-checkbox-title,
137
+ .auto-as-admin-input-title,
138
+ .auto-as-admin-select-title{
139
+ margin-bottom: 10px;
140
+ }
141
+ .auto-as-admin-container .wrap #aftership_couriers_select_chosen .chosen-choices{
142
+ width: 860px !important;
143
+ height: 40px !important;
144
+ line-height: 40px !important;
145
+ padding-left: 16px !important;
146
+ border-radius: 5px !important;
147
+ }
148
+ .auto-as-admin-container .wrap #aftership_couriers_select_chosen .chosen-choices .search-choice{
149
+ margin: 9px 5px 9px 0 !important;
150
+ }
151
+ .auto-as-admin-input-content{
152
+ width: 860px !important;
153
+ height: 40px !important;
154
+ padding-left: 16px !important;
155
+ border: 1px solid #aaa !important;
156
+ }
157
+ .auto-as-admin-container .wrap{
158
+ max-width:860px;
159
+ margin: 0 auto;
160
+ margin-top: 30px;
161
+ }
162
+ .auto-as-admin-container .wrap::after{
163
+ content: '';
164
+ display: block;
165
+ clear: both;
166
+ }
167
+ .auto-as-admin-container #submit{
168
+ float: right;
169
+ background: orange;
170
+ padding: 6px 15px;
171
+ border-radius: 5px;
172
+ border: none;
173
+ }
174
+ .auto-as-admin-link{
175
+ max-width: 860px;
176
+ margin: auto;
177
+ height: 80px;
178
+ line-height: 80px;
179
+ }
180
+ .auto-as-admin-link-content{
181
+ float: right;
182
+ font-size: 14px;
183
+ }
184
+ .auto-as-admin-text-bold{
185
+ font-weight: bold;
186
+ }
187
+ .auto-as-admin-container .wrap .form-table th{
188
+ display: none;
189
+ }
assets/css/normalize.css ADDED
@@ -0,0 +1,351 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
2
+
3
+ /* Document
4
+ ========================================================================== */
5
+
6
+ /**
7
+ * 1. Correct the line height in all browsers.
8
+ * 2. Prevent adjustments of font size after orientation changes in iOS.
9
+ */
10
+
11
+ html {
12
+ line-height: 1.15; /* 1 */
13
+ -webkit-text-size-adjust: 100%; /* 2 */
14
+ }
15
+
16
+ /* Sections
17
+ ========================================================================== */
18
+
19
+ /**
20
+ * Remove the margin in all browsers.
21
+ */
22
+
23
+ body {
24
+ margin: 0;
25
+ }
26
+
27
+ /**
28
+ * Render the `main` element consistently in IE.
29
+ */
30
+
31
+ main {
32
+ display: block;
33
+ }
34
+
35
+ /**
36
+ * Correct the font size and margin on `h1` elements within `section` and
37
+ * `article` contexts in Chrome, Firefox, and Safari.
38
+ */
39
+
40
+ h1 {
41
+ font-size: 2em;
42
+ margin: 0.67em 0;
43
+ }
44
+
45
+ /* Grouping content
46
+ ========================================================================== */
47
+
48
+ /**
49
+ * 1. Add the correct box sizing in Firefox.
50
+ * 2. Show the overflow in Edge and IE.
51
+ */
52
+
53
+ hr {
54
+ box-sizing: content-box; /* 1 */
55
+ height: 0; /* 1 */
56
+ overflow: visible; /* 2 */
57
+ }
58
+
59
+ /**
60
+ * 1. Correct the inheritance and scaling of font size in all browsers.
61
+ * 2. Correct the odd `em` font sizing in all browsers.
62
+ */
63
+
64
+ pre {
65
+ font-family: monospace, monospace; /* 1 */
66
+ font-size: 1em; /* 2 */
67
+ }
68
+
69
+ /* Text-level semantics
70
+ ========================================================================== */
71
+
72
+ /**
73
+ * Remove the gray background on active links in IE 10.
74
+ */
75
+
76
+ a {
77
+ background-color: transparent;
78
+ }
79
+
80
+ /**
81
+ * 1. Remove the bottom border in Chrome 57-
82
+ * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
83
+ */
84
+
85
+ abbr[title] {
86
+ border-bottom: none; /* 1 */
87
+ text-decoration: underline; /* 2 */
88
+ text-decoration: underline dotted; /* 2 */
89
+ }
90
+
91
+ /**
92
+ * Add the correct font weight in Chrome, Edge, and Safari.
93
+ */
94
+
95
+ b,
96
+ strong {
97
+ font-weight: bolder;
98
+ }
99
+
100
+ /**
101
+ * 1. Correct the inheritance and scaling of font size in all browsers.
102
+ * 2. Correct the odd `em` font sizing in all browsers.
103
+ */
104
+
105
+ code,
106
+ kbd,
107
+ samp {
108
+ font-family: monospace, monospace; /* 1 */
109
+ font-size: 1em; /* 2 */
110
+ }
111
+
112
+ /**
113
+ * Add the correct font size in all browsers.
114
+ */
115
+
116
+ small {
117
+ font-size: 80%;
118
+ }
119
+
120
+ /**
121
+ * Prevent `sub` and `sup` elements from affecting the line height in
122
+ * all browsers.
123
+ */
124
+
125
+ sub,
126
+ sup {
127
+ font-size: 75%;
128
+ line-height: 0;
129
+ position: relative;
130
+ vertical-align: baseline;
131
+ }
132
+
133
+ sub {
134
+ bottom: -0.25em;
135
+ }
136
+
137
+ sup {
138
+ top: -0.5em;
139
+ }
140
+
141
+ /* Embedded content
142
+ ========================================================================== */
143
+
144
+ /**
145
+ * Remove the border on images inside links in IE 10.
146
+ */
147
+
148
+ img {
149
+ border-style: none;
150
+ }
151
+
152
+ /* Forms
153
+ ========================================================================== */
154
+
155
+ /**
156
+ * 1. Change the font styles in all browsers.
157
+ * 2. Remove the margin in Firefox and Safari.
158
+ */
159
+
160
+ button,
161
+ input,
162
+ optgroup,
163
+ select,
164
+ textarea {
165
+ font-family: inherit; /* 1 */
166
+ font-size: 100%; /* 1 */
167
+ line-height: 1.15; /* 1 */
168
+ margin: 0; /* 2 */
169
+ }
170
+
171
+ /**
172
+ * Show the overflow in IE.
173
+ * 1. Show the overflow in Edge.
174
+ */
175
+
176
+ button,
177
+ input {
178
+ /* 1 */
179
+ overflow: visible;
180
+ }
181
+
182
+ /**
183
+ * Remove the inheritance of text transform in Edge, Firefox, and IE.
184
+ * 1. Remove the inheritance of text transform in Firefox.
185
+ */
186
+
187
+ button,
188
+ select {
189
+ /* 1 */
190
+ text-transform: none;
191
+ }
192
+
193
+ /**
194
+ * Correct the inability to style clickable types in iOS and Safari.
195
+ */
196
+
197
+ button,
198
+ [type="button"],
199
+ [type="reset"],
200
+ [type="submit"] {
201
+ -webkit-appearance: button;
202
+ }
203
+
204
+ /**
205
+ * Remove the inner border and padding in Firefox.
206
+ */
207
+
208
+ button::-moz-focus-inner,
209
+ [type="button"]::-moz-focus-inner,
210
+ [type="reset"]::-moz-focus-inner,
211
+ [type="submit"]::-moz-focus-inner {
212
+ border-style: none;
213
+ padding: 0;
214
+ }
215
+
216
+ /**
217
+ * Restore the focus styles unset by the previous rule.
218
+ */
219
+
220
+ button:-moz-focusring,
221
+ [type="button"]:-moz-focusring,
222
+ [type="reset"]:-moz-focusring,
223
+ [type="submit"]:-moz-focusring {
224
+ outline: 1px dotted ButtonText;
225
+ }
226
+
227
+ /**
228
+ * Correct the padding in Firefox.
229
+ */
230
+
231
+ fieldset {
232
+ padding: 0.35em 0.75em 0.625em;
233
+ }
234
+
235
+ /**
236
+ * 1. Correct the text wrapping in Edge and IE.
237
+ * 2. Correct the color inheritance from `fieldset` elements in IE.
238
+ * 3. Remove the padding so developers are not caught out when they zero out
239
+ * `fieldset` elements in all browsers.
240
+ */
241
+
242
+ legend {
243
+ box-sizing: border-box; /* 1 */
244
+ color: inherit; /* 2 */
245
+ display: table; /* 1 */
246
+ max-width: 100%; /* 1 */
247
+ padding: 0; /* 3 */
248
+ white-space: normal; /* 1 */
249
+ }
250
+
251
+ /**
252
+ * Add the correct vertical alignment in Chrome, Firefox, and Opera.
253
+ */
254
+
255
+ progress {
256
+ vertical-align: baseline;
257
+ }
258
+
259
+ /**
260
+ * Remove the default vertical scrollbar in IE 10+.
261
+ */
262
+
263
+ textarea {
264
+ overflow: auto;
265
+ }
266
+
267
+ /**
268
+ * 1. Add the correct box sizing in IE 10.
269
+ * 2. Remove the padding in IE 10.
270
+ */
271
+
272
+ [type="checkbox"],
273
+ [type="radio"] {
274
+ box-sizing: border-box; /* 1 */
275
+ padding: 0; /* 2 */
276
+ }
277
+
278
+ /**
279
+ * Correct the cursor style of increment and decrement buttons in Chrome.
280
+ */
281
+
282
+ [type="number"]::-webkit-inner-spin-button,
283
+ [type="number"]::-webkit-outer-spin-button {
284
+ height: auto;
285
+ }
286
+
287
+ /**
288
+ * 1. Correct the odd appearance in Chrome and Safari.
289
+ * 2. Correct the outline style in Safari.
290
+ */
291
+
292
+ [type="search"] {
293
+ -webkit-appearance: textfield; /* 1 */
294
+ outline-offset: -2px; /* 2 */
295
+ }
296
+
297
+ /**
298
+ * Remove the inner padding in Chrome and Safari on macOS.
299
+ */
300
+
301
+ [type="search"]::-webkit-search-decoration {
302
+ -webkit-appearance: none;
303
+ }
304
+
305
+ /**
306
+ * 1. Correct the inability to style clickable types in iOS and Safari.
307
+ * 2. Change font properties to `inherit` in Safari.
308
+ */
309
+
310
+ ::-webkit-file-upload-button {
311
+ -webkit-appearance: button; /* 1 */
312
+ font: inherit; /* 2 */
313
+ }
314
+
315
+ /* Interactive
316
+ ========================================================================== */
317
+
318
+ /*
319
+ * Add the correct display in Edge, IE 10+, and Firefox.
320
+ */
321
+
322
+ details {
323
+ display: block;
324
+ }
325
+
326
+ /*
327
+ * Add the correct display in all browsers.
328
+ */
329
+
330
+ summary {
331
+ display: list-item;
332
+ }
333
+
334
+ /* Misc
335
+ ========================================================================== */
336
+
337
+ /**
338
+ * Add the correct display in IE 10+.
339
+ */
340
+
341
+ template {
342
+ display: none;
343
+ }
344
+
345
+ /**
346
+ * Add the correct display in IE 10.
347
+ */
348
+
349
+ [hidden] {
350
+ display: none;
351
+ }
assets/images/dropshipping-product.svg ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="64" height="64" rx="8" fill="white"/>
3
+ <path d="M18 36.3C18 34.6198 18 33.7798 18.327 33.138C18.6146 32.5735 19.0735 32.1146 19.638 31.827C20.2798 31.5 21.1198 31.5 22.8 31.5H41.2C42.8802 31.5 43.7202 31.5 44.362 31.827C44.9265 32.1146 45.3854 32.5735 45.673 33.138C46 33.7798 46 34.6198 46 36.3V48.7C46 50.3802 46 51.2202 45.673 51.862C45.3854 52.4265 44.9265 52.8854 44.362 53.173C43.7202 53.5 42.8802 53.5 41.2 53.5H22.8C21.1198 53.5 20.2798 53.5 19.638 53.173C19.0735 52.8854 18.6146 52.4265 18.327 51.862C18 51.2202 18 50.3802 18 48.7V36.3Z" fill="#F81466"/>
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M26.625 39.875C27.3154 39.875 27.875 40.4346 27.875 41.125C27.875 43.4032 29.7218 45.25 32 45.25C34.2782 45.25 36.125 43.4032 36.125 41.125C36.125 40.4346 36.6846 39.875 37.375 39.875C38.0654 39.875 38.625 40.4346 38.625 41.125C38.625 44.7839 35.6589 47.75 32 47.75C28.3411 47.75 25.375 44.7839 25.375 41.125C25.375 40.4346 25.9346 39.875 26.625 39.875Z" fill="white"/>
5
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M53.9752 26.2833C54.1644 26.3982 54.4053 26.2355 54.3585 26.019C52.1318 15.7181 42.9672 8 31.9999 8C21.0327 8 11.8681 15.7181 9.6414 26.019C9.59462 26.2355 9.83544 26.3982 10.0247 26.2833C12.15 24.993 14.6445 24.25 17.3124 24.25C19.3708 24.25 21.3258 24.6922 23.0877 25.4868C23.1728 25.5252 23.2721 25.5141 23.3466 25.4578C25.7017 23.6795 28.6339 22.625 31.8124 22.625C35.0536 22.625 38.0387 23.7215 40.417 25.5639C40.493 25.6228 40.5957 25.634 40.6826 25.5929C42.5036 24.7317 44.5393 24.25 46.6874 24.25C49.3554 24.25 51.8499 24.993 53.9752 26.2833Z" fill="#F81466"/>
6
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M54.2631 26.2527L43.1222 35.8881L41.4868 33.9972L52.6277 24.3618L54.2631 26.2527Z" fill="#F81466"/>
7
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M22.5131 33.9973L11.3722 24.3619L9.73682 26.2528L20.8777 35.8882L22.5131 33.9973Z" fill="#F81466"/>
8
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M41.2432 23.1015C41.8775 23.374 42.1708 24.1091 41.8983 24.7434L36.152 38.1184C35.8795 38.7527 35.1444 39.0459 34.5101 38.7734C33.8758 38.5009 33.5826 37.7658 33.8551 37.1315L39.6013 23.7565C39.8738 23.1222 40.6089 22.829 41.2432 23.1015ZM22.7564 23.1015C23.3907 22.829 24.1258 23.1222 24.3983 23.7565L30.1446 37.1315C30.4171 37.7658 30.1238 38.5009 29.4895 38.7734C28.8552 39.0459 28.1201 38.7527 27.8476 38.1184L22.1013 24.7434C21.8288 24.1091 22.1221 23.374 22.7564 23.1015Z" fill="#F81466"/>
9
+ </svg>
assets/images/favicon-aftership.svg ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>aftership_img_logo</title>
4
+ <g id="aftership_img_logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="aftership_glyph_whitebg" transform="translate(1.000000, 0.000000)">
6
+ <path d="M9,0 C13.9481102,0 18,3.88572157 18,8.70824305 C18,12.7675529 15.131247,16.1674419 11.2589704,17.139107 L9,19.9839025 L6.74102959,17.139107 C2.86847961,16.1674419 0,12.7675529 0,8.70824305 C0,3.88572157 4.01607649,0 9,0" id="Combined-Shape" fill="#FFA622"></path>
7
+ <path d="M3.95215403,7.05341324 C3.9899827,7.05341324 4.02745998,7.06067209 4.06255302,7.07479606 L7.69093866,8.53512021 C8.13237189,8.71278479 8.4215423,9.1408801 8.4215423,9.61672461 L8.4215423,13.0354235 C8.4215423,13.1987258 8.28915962,13.3311085 8.1258573,13.3311085 C8.08802863,13.3311085 8.05055136,13.3238497 8.01545831,13.3097257 L4.38707267,11.8494016 C3.94563944,11.671737 3.65646903,11.2436417 3.65646903,10.7677972 L3.65646903,7.34909824 C3.65646903,7.18579592 3.78885172,7.05341324 3.95215403,7.05341324 Z M14.0499079,7.05341324 C14.2132102,7.05341324 14.3455929,7.18579592 14.3455929,7.34909824 L14.3455929,7.34909824 L14.3455929,10.7677972 C14.3455929,11.2436417 14.0564225,11.671737 13.6149893,11.8494016 L13.6149893,11.8494016 L9.98660365,13.3097257 C9.95151061,13.3238497 9.91403334,13.3311085 9.87620467,13.3311085 C9.71290235,13.3311085 9.58051967,13.1987258 9.58051967,13.0354235 L9.58051967,13.0354235 L9.58051967,9.61672461 C9.58051967,9.1408801 9.86969008,8.71278479 10.3111233,8.53512021 L10.3111233,8.53512021 L13.9395089,7.07479606 C13.974602,7.06067209 14.0120793,7.05341324 14.0499079,7.05341324 Z M9.52004711,3.92735725 L13.5222596,5.53186573 C13.6601851,5.58716083 13.7271703,5.74379711 13.6718752,5.88172267 C13.6444647,5.95009427 13.5902211,6.004238 13.5217991,6.03152247 L9.51766796,7.6282399 C9.18705269,7.76007853 8.8184617,7.76007853 8.48784642,7.6282399 L4.4837153,6.03152247 C4.34568806,5.97648169 4.27841424,5.81996914 4.33345502,5.68194189 C4.36073949,5.61351989 4.41488322,5.55927627 4.48325482,5.53186573 L8.48546727,3.92735725 C8.81748326,3.79425026 9.18803113,3.79425026 9.52004711,3.92735725 Z" id="形状结合" fill="#FFFFFF"></path>
8
+ </g>
9
+ </g>
10
+ </svg>
assets/images/marketing-product.svg ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="64" height="64" rx="8" fill="white"/>
3
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M56 32C56 21.6447 47.6053 13.25 37.25 13.25C32.7739 13.25 28.6641 14.8185 25.4403 17.4358L14.7879 24.8135C13.8362 25.4726 12.711 25.8305 11.6579 26.3112C9.49981 27.2961 8 29.4729 8 32C8 34.5381 9.51293 36.7229 11.6862 37.7016C12.7218 38.168 13.8241 38.5223 14.7558 39.172L26.2494 47.1871C26.2496 47.1872 26.25 47.1871 26.25 47.1867C26.25 47.1864 26.2504 47.1862 26.2506 47.1864C29.3403 49.4281 33.1408 50.75 37.25 50.75C47.6053 50.75 56 42.3553 56 32Z" fill="#F81466"/>
4
+ <path d="M52 32C52 23.8538 45.3962 17.25 37.25 17.25C29.1038 17.25 22.5 23.8538 22.5 32C22.5 40.1462 29.1038 46.75 37.25 46.75C45.3962 46.75 52 40.1462 52 32Z" fill="white"/>
5
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M31.125 30.75C31.8154 30.75 32.375 31.3096 32.375 32C32.375 34.8995 34.7255 37.25 37.625 37.25C40.5245 37.25 42.875 34.8995 42.875 32C42.875 31.3096 43.4346 30.75 44.125 30.75C44.8154 30.75 45.375 31.3096 45.375 32C45.375 36.2802 41.9052 39.75 37.625 39.75C33.3448 39.75 29.875 36.2802 29.875 32C29.875 31.3096 30.4346 30.75 31.125 30.75Z" fill="#F81466"/>
6
+ <path d="M18 46.75C18 44.5409 16.2091 42.75 14 42.75C11.7909 42.75 10 44.5409 10 46.75C10 48.9591 11.7909 50.75 14 50.75C16.2091 50.75 18 48.9591 18 46.75Z" fill="#F81466"/>
7
+ </svg>
assets/images/postmen-product.svg ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="64" height="64" rx="8" fill="white"/>
3
+ <path d="M30.0755 10.0157C31.2664 9.3281 32.7336 9.3281 33.9245 10.0157L50.0755 19.3411C51.2664 20.0287 52 21.2994 52 22.6746V41.3254C52 42.7006 51.2664 43.9713 50.0755 44.6589L33.9245 53.9843C32.7336 54.6719 31.2664 54.6719 30.0755 53.9843L13.9245 44.6589C12.7336 43.9713 12 42.7006 12 41.3254V22.6746C12 21.2994 12.7336 20.0287 13.9245 19.3411L30.0755 10.0157Z" fill="#1868F5"/>
4
+ <path d="M40.9263 25.74L33.0001 30.3175C32.696 30.493 32.3511 30.5854 32.0001 30.5854C31.649 30.5854 31.3041 30.493 31.0001 30.3175L23.0738 25.74C22.9981 25.696 22.9352 25.6329 22.8914 25.557C22.8477 25.4811 22.8247 25.3951 22.8247 25.3075C22.8247 25.2199 22.8477 25.1338 22.8914 25.0579C22.9352 24.982 22.9981 24.9189 23.0738 24.875L31.0001 20.2987C31.3041 20.1232 31.649 20.0308 32.0001 20.0308C32.3511 20.0308 32.696 20.1232 33.0001 20.2987L40.9263 24.875C41.0021 24.9189 41.065 24.982 41.1087 25.0579C41.1524 25.1338 41.1754 25.2199 41.1754 25.3075C41.1754 25.3951 41.1524 25.4811 41.1087 25.557C41.065 25.6329 41.0021 25.696 40.9263 25.74Z" fill="white"/>
5
+ <path d="M30.5 34.6488V43.3925C30.5001 43.4804 30.4771 43.5667 30.4333 43.6428C30.3895 43.7189 30.3264 43.7821 30.2503 43.8261C30.1743 43.8701 30.088 43.8932 30.0002 43.8933C29.9124 43.8933 29.8261 43.8702 29.75 43.8263L22 39.3513C21.6968 39.1762 21.4449 38.9247 21.2694 38.6217C21.0939 38.3188 21.001 37.9751 21 37.625V28.875C20.9999 28.7872 21.0229 28.7009 21.0667 28.6247C21.1105 28.5486 21.1736 28.4854 21.2497 28.4414C21.3257 28.3975 21.412 28.3743 21.4998 28.3743C21.5876 28.3742 21.6739 28.3973 21.75 28.4413L29.5 32.9163C29.8041 33.0918 30.0566 33.3444 30.2322 33.6485C30.4077 33.9526 30.5001 34.2976 30.5 34.6488Z" fill="white"/>
6
+ <path d="M43 28.875V37.625C43.0001 37.9762 42.9077 38.3211 42.7322 38.6253C42.5566 38.9294 42.3041 39.1819 42 39.3575L34.25 43.8325C34.1739 43.8764 34.0876 43.8995 33.9998 43.8995C33.912 43.8995 33.8257 43.8763 33.7497 43.8323C33.6736 43.7884 33.6105 43.7251 33.5667 43.649C33.5229 43.5729 33.4999 43.4866 33.5 43.3988V34.6488C33.4999 34.2976 33.5923 33.9526 33.7678 33.6485C33.9434 33.3444 34.1959 33.0918 34.5 32.9163L42.25 28.4413C42.3261 28.3973 42.4124 28.3742 42.5002 28.3743C42.588 28.3743 42.6743 28.3975 42.7503 28.4414C42.8264 28.4854 42.8895 28.5486 42.9333 28.6247C42.9771 28.7009 43.0001 28.7872 43 28.875Z" fill="white"/>
7
+ </svg>
assets/images/tracking-page.png ADDED
Binary file
assets/images/wordpress-aftership-logo.svg ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <svg width="105" height="32" viewBox="0 0 105 32" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0)">
3
+ <g clip-path="url(#clip1)">
4
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.314 21.0383H11.3573V22.6358H14.2183V9.33706H11.3573V10.9778H11.314C10.577 9.8552 9.05984 8.99164 7.06581 8.99164C2.73096 8.99164 0 12.7049 0 15.9865C0 19.4407 2.55756 23.0244 6.93576 23.0244C8.7564 23.0244 10.4036 22.2472 11.314 21.0383ZM11.4873 15.9807C11.4873 18.3555 9.53665 20.2985 7.28252 20.2985C4.9417 20.2985 3.03436 18.3555 3.03436 15.9807C3.03436 13.6059 4.9417 11.6629 7.28252 11.6629C9.53665 11.6629 11.4873 13.6059 11.4873 15.9807Z" fill="black"/>
5
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M18.0744 12.1124H16.2104V9.43536H18.0744V7.19011C18.0744 4.72897 19.5916 2.35419 23.0595 2.35419C23.7531 2.35419 24.6634 2.48372 25.2703 2.69961L24.0999 5.29028C23.7097 5.11757 23.363 5.03122 22.8428 5.03122C21.6724 5.03122 20.9788 5.98113 20.9788 6.97422V9.39218H23.8398V12.0692H20.9788V22.691H18.1178V12.1124H18.0744Z" fill="black"/>
6
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M26.9007 12.0244H25.2534V9.34737H26.9007V5.375H29.7617V9.34737H31.799V12.0244H29.7617V22.6462H26.9007V12.0244Z" fill="black"/>
7
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M40.1112 23.0244C42.4954 23.0244 44.7062 21.8154 46.31 19.786L43.8825 18.4044C42.8855 19.7429 41.5851 20.4769 40.0245 20.4769C38.0305 20.4769 36.1231 19.0088 35.9497 16.9795H47.047V16.4614C47.047 11.28 42.8855 8.99158 40.1112 8.99158C35.4296 8.99158 32.7419 12.4458 32.7419 15.9864C32.7419 19.527 35.4296 23.0244 40.1112 23.0244ZM39.6445 11.4901C41.4652 11.4901 42.9824 12.5695 43.5893 14.5989H35.8732C36.35 12.6127 37.8239 11.4901 39.6445 11.4901Z" fill="black"/>
8
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M49.2294 9.26211H51.917V10.7302H51.9603C52.4372 9.65071 53.4342 8.91669 54.6046 8.91669C55.2548 8.91669 55.775 9.0894 56.1652 9.34847L55.1248 12.1982C54.8647 11.9823 54.3445 11.8096 54.0411 11.8096C53.0007 11.8096 52.047 12.5868 52.047 13.839V22.6473H49.186V9.26211H49.2294Z" fill="black"/>
9
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M58.2757 18.6562C59.316 19.7356 60.9633 20.5992 62.4805 20.5992C64.1277 20.5992 65.1247 19.6492 65.1247 18.9152C65.1247 18.0517 64.4312 17.5767 63.3908 17.3608L61.7435 17.0586C57.9722 16.3677 56.9319 15.1587 56.9319 13.2589C56.9319 11.0137 58.8392 8.89795 62.177 8.89795C64.041 8.89795 65.6449 9.45926 67.4656 10.7546L65.8183 12.784C64.4312 11.6182 63.1741 11.3159 62.2204 11.3159C60.9633 11.3159 59.7495 11.9204 59.7495 12.9998C59.7495 13.7771 60.3997 14.2088 61.4835 14.3815L64.3878 14.9429C66.772 15.3746 67.9424 16.4973 67.9424 18.4834C67.9424 20.4264 66.3385 22.9739 62.2637 22.9739C60.0096 22.9739 58.0589 22.1967 56.2383 20.6423L58.2757 18.6562Z" fill="black"/>
10
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M69.6343 5.375H72.4953V11.0313H72.5386C73.3189 9.77914 74.7928 9.00194 76.6134 9.00194C79.4311 9.00194 81.8153 11.3335 81.8153 14.6582V22.6893H78.9543V15.2627C78.9543 12.8448 77.6972 11.8517 75.7898 11.8517C73.9258 11.8517 72.4953 13.0175 72.4953 15.2196V22.6893H69.6343V5.375V5.375Z" fill="black"/>
11
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M87.3311 6.43773C87.3311 5.57417 86.5942 4.84015 85.7272 4.84015C84.8169 4.84015 84.1233 5.531 84.1233 6.43773C84.1233 7.30129 84.8602 8.03531 85.7272 8.03531C86.5942 8.03531 87.3311 7.30129 87.3311 6.43773ZM87.1714 9.36619H84.3105V22.665H87.1714V9.36619Z" fill="black"/>
12
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M92.7486 10.9287H92.7052V9.33117H89.8442V27.25H92.7052V20.9892H92.7486C93.4855 22.1118 95.0027 22.9754 96.9967 22.9754C101.332 22.9754 104.063 19.2621 104.063 15.9806C104.063 12.5263 101.505 8.94257 97.1268 8.94257C95.3062 8.94257 93.789 9.67659 92.7486 10.9287ZM92.5751 15.9806C92.5751 13.6058 94.5258 11.6628 96.7799 11.6628C99.1207 11.6628 101.028 13.6058 101.028 15.9806C101.028 18.3554 99.1207 20.2984 96.7799 20.2984C94.5258 20.2984 92.5751 18.3554 92.5751 15.9806Z" fill="black"/>
13
+ </g>
14
+ </g>
15
+ <defs>
16
+ <clipPath id="clip0">
17
+ <rect width="105" height="32" fill="white"/>
18
+ </clipPath>
19
+ <clipPath id="clip1">
20
+ <rect width="104.083" height="32" fill="white"/>
21
+ </clipPath>
22
+ </defs>
23
+ </svg>
assets/images/wordpress-banner.png ADDED
Binary file
includes/api/aftership/v1/class-am-rest-settings-controller.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists( 'AM_REST_Settings_Controller' ) ) {
4
+
5
+ include AFTERSHIP_PATH . '/includes/api/class-am-rest-controller.php';
6
+
7
+ /**
8
+ * Class AM_REST_Settings_Controller
9
+ */
10
+ class AM_REST_Settings_Controller extends AM_REST_Controller {
11
+
12
+
13
+ /**
14
+ * API endpoint always wc/aftership/v1.
15
+ *
16
+ * @var string
17
+ */
18
+ protected $namespace = 'wc/aftership/v1';
19
+ /**
20
+ * API resource is settings.
21
+ *
22
+ * @var string
23
+ */
24
+ protected $rest_base = 'settings';
25
+
26
+ /**
27
+ * AfterShip option name.
28
+ *
29
+ * @var string
30
+ */
31
+ private $option_name = 'aftership_option_name';
32
+
33
+ /**
34
+ * AM_REST_Settings_Controller constructor.
35
+ */
36
+ public function __construct() {}
37
+
38
+ /**
39
+ * GET AfterShip Settings
40
+ *
41
+ * @param WP_REST_Request $request Request object.
42
+ * @return array
43
+ */
44
+ public function get_settings( WP_REST_Request $request ) {
45
+ $settings = get_option( $this->option_name );
46
+ $settings['version'] = AFTERSHIP_VERSION;
47
+ return array( 'settings' => $settings );
48
+ }
49
+
50
+ /**
51
+ * Normalize custom domain.
52
+ *
53
+ * @param string $url input url.
54
+ * @return string
55
+ */
56
+ public function normalize_custom_domain( $url ) {
57
+ if ( filter_var( $url, FILTER_VALIDATE_URL ) === false ) {
58
+ return $url;
59
+
60
+ }
61
+ $domain = parse_url( $url, PHP_URL_HOST );
62
+ return $domain;
63
+ }
64
+
65
+ /**
66
+ * Seek option value by key
67
+ *
68
+ * @param array $options Options array.
69
+ * @param string $key String key.
70
+ * @return string
71
+ */
72
+ public function seek_option_value( $options, $key ) {
73
+ return isset( $options[ $key ] ) ? $options[ $key ] : '';
74
+ }
75
+
76
+ /**
77
+ * Create or update settings
78
+ *
79
+ * @param WP_REST_Request $data Request object.
80
+ * @return array
81
+ */
82
+ public function create_or_update_settings( WP_REST_Request $data ) {
83
+ $options = get_option( $this->option_name );
84
+ $options['version'] = AFTERSHIP_VERSION;
85
+
86
+ if ( isset( $data['custom_domain'] ) && $data['custom_domain'] ) {
87
+ if ( 'track.aftership.com' === $this->seek_option_value( $options, 'custom_domain' ) || '' === $this->seek_option_value( $options, 'custom_domain' ) ) {
88
+ $options['custom_domain'] = $this->normalize_custom_domain( $data['custom_domain'] );
89
+ }
90
+ }
91
+
92
+ if ( isset( $data['couriers'] ) && $data['couriers'] ) {
93
+ if ( '' === $this->seek_option_value( $options, 'couriers' ) ) {
94
+ $options['couriers'] = $data['couriers'];
95
+ }
96
+ }
97
+ if ( isset( $data['connected'] ) && in_array( $data['connected'], array( true, false ), true ) ) {
98
+ $options['connected'] = $data['connected'];
99
+ }
100
+
101
+ if ( isset( $data['use_track_button'] ) && in_array( $data['use_track_button'], array( true, false ), true ) ) {
102
+ if ( '' === $this->seek_option_value( $options, 'use_track_button' ) ) {
103
+ $options['use_track_button'] = $data['use_track_button'];
104
+ }
105
+ }
106
+ update_option( $this->option_name, $options );
107
+ return array( 'settings' => $options );
108
+ }
109
+
110
+ /**
111
+ * Register router.
112
+ */
113
+ public function register_routes() {
114
+ register_rest_route(
115
+ $this->namespace,
116
+ '/' . $this->rest_base,
117
+ array(
118
+ array(
119
+ 'methods' => WP_REST_Server::READABLE,
120
+ 'callback' => array( $this, 'get_settings' ),
121
+ 'permission_callback' => array( $this, 'get_items_permissions_check' ),
122
+ 'args' => array(),
123
+ ),
124
+ array(
125
+ 'methods' => WP_REST_Server::CREATABLE,
126
+ 'callback' => array( $this, 'create_or_update_settings' ),
127
+ 'permission_callback' => array( $this, 'create_item_permissions_check' ),
128
+ 'args' => array(),
129
+ ),
130
+ )
131
+ );
132
+ }
133
+ }
134
+ }
includes/api/class-am-rest-controller.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! class_exists( 'AM_REST_Controller' ) ) {
4
+
5
+ class AM_REST_Controller extends WP_REST_Controller {
6
+
7
+ public function filter_consumer_key( $option ) {
8
+ $script_tag = $option;
9
+ if ( isset( $script_tag['consumer_key'] ) ) {
10
+ unset( $script_tag['consumer_key'] );
11
+ }
12
+ return $script_tag;
13
+ }
14
+
15
+ public function get_consumer_key() {
16
+ $consumer_key = $this->get_consumer_key_from_basic_authentication();
17
+
18
+ if ( $consumer_key ) {
19
+ return $consumer_key;
20
+ }
21
+
22
+ return $this->get_consumer_key_from_oauth_authentication();
23
+ }
24
+
25
+ private function get_consumer_key_from_basic_authentication() {
26
+ $consumer_key = '';
27
+ $consumer_secret = '';
28
+
29
+ // If the $_GET parameters are present, use those first.
30
+ if ( ! empty( $_GET['consumer_key'] ) && ! empty( $_GET['consumer_secret'] ) ) { // WPCS: CSRF ok.
31
+ $consumer_key = $_GET['consumer_key']; // WPCS: CSRF ok, sanitization ok.
32
+ $consumer_secret = $_GET['consumer_secret']; // WPCS: CSRF ok, sanitization ok.
33
+ }
34
+
35
+ // If the above is not present, we will do full basic auth.
36
+ if ( ! $consumer_key && ! empty( $_SERVER['PHP_AUTH_USER'] ) && ! empty( $_SERVER['PHP_AUTH_PW'] ) ) {
37
+ $consumer_key = $_SERVER['PHP_AUTH_USER']; // WPCS: CSRF ok, sanitization ok.
38
+ $consumer_secret = $_SERVER['PHP_AUTH_PW']; // WPCS: CSRF ok, sanitization ok.
39
+ }
40
+
41
+ // Stop if don't have any key.
42
+ if ( ! $consumer_key || ! $consumer_secret ) {
43
+ return false;
44
+ }
45
+
46
+ return $consumer_key;
47
+ }
48
+
49
+ private function get_consumer_key_from_oauth_authentication() {
50
+ $params = array_merge( $_GET, $_POST ); // WPCS: CSRF ok.
51
+ $params = wp_unslash( $params );
52
+ $header = $this->get_authorization_header();
53
+
54
+ if ( ! empty( $header ) ) {
55
+ // Trim leading spaces.
56
+ $header = trim( $header );
57
+ $header_params = $this->parse_header( $header );
58
+
59
+ if ( ! empty( $header_params ) ) {
60
+ $params = array_merge( $params, $header_params );
61
+ }
62
+ }
63
+
64
+ return isset( $params['oauth_consumer_key'] ) ? $params['oauth_consumer_key'] : null;
65
+ }
66
+
67
+ private function get_authorization_header() {
68
+ if ( ! empty( $_SERVER['HTTP_AUTHORIZATION'] ) ) {
69
+ return wp_unslash( $_SERVER['HTTP_AUTHORIZATION'] ); // WPCS: sanitization ok.
70
+ }
71
+
72
+ if ( function_exists( 'getallheaders' ) ) {
73
+ $headers = getallheaders();
74
+ // Check for the authoization header case-insensitively.
75
+ foreach ( $headers as $key => $value ) {
76
+ if ( 'authorization' === strtolower( $key ) ) {
77
+ return $value;
78
+ }
79
+ }
80
+ }
81
+
82
+ return '';
83
+ }
84
+
85
+ private function parse_header( $header ) {
86
+ if ( 'OAuth ' !== substr( $header, 0, 6 ) ) {
87
+ return array();
88
+ }
89
+
90
+ // From OAuth PHP library, used under MIT license.
91
+ $params = array();
92
+ if ( preg_match_all( '/(oauth_[a-z_-]*)=(:?"([^"]*)"|([^,]*))/', $header, $matches ) ) {
93
+ foreach ( $matches[1] as $i => $h ) {
94
+ $params[ $h ] = urldecode( empty( $matches[3][ $i ] ) ? $matches[4][ $i ] : $matches[3][ $i ] );
95
+ }
96
+ if ( isset( $params['realm'] ) ) {
97
+ unset( $params['realm'] );
98
+ }
99
+ }
100
+
101
+ return $params;
102
+ }
103
+
104
+ /**
105
+ * Check whether a given request has permission to read tax classes.
106
+ *
107
+ * @param WP_REST_Request $request Full details about the request.
108
+ * @return WP_Error|boolean
109
+ */
110
+ public function get_items_permissions_check( $request ) {
111
+ if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) {
112
+ return new WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
113
+ }
114
+
115
+ return true;
116
+ }
117
+
118
+ /**
119
+ * Check if a given request has access create tax classes.
120
+ *
121
+ * @param WP_REST_Request $request Full details about the request.
122
+ *
123
+ * @return bool|WP_Error
124
+ */
125
+ public function create_item_permissions_check( $request ) {
126
+ if ( ! wc_rest_check_manager_permissions( 'settings', 'create' ) ) {
127
+ return new WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to create resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
128
+ }
129
+
130
+ return true;
131
+ }
132
+
133
+ /**
134
+ * Check if a given request has access delete a tax.
135
+ *
136
+ * @param WP_REST_Request $request Full details about the request.
137
+ *
138
+ * @return bool|WP_Error
139
+ */
140
+ public function delete_item_permissions_check( $request ) {
141
+ if ( ! wc_rest_check_manager_permissions( 'settings', 'delete' ) ) {
142
+ return new WP_Error( 'woocommerce_rest_cannot_delete', __( 'Sorry, you are not allowed to delete this resource.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) );
143
+ }
144
+
145
+ return true;
146
+ }
147
+ }
148
+ }
includes/api/v4/class-aftership-api-settings.php CHANGED
@@ -84,6 +84,11 @@ class AfterShip_API_V4_Settings extends AfterShip_API_Resource {
84
  }
85
  }
86
 
 
 
 
 
 
87
  if ( isset( $data['use_track_button'] ) && in_array( $data['use_track_button'], array( true, false ), true ) ) {
88
  if ( '' === $use_tracking_button ) {
89
  $options['use_track_button'] = $data['use_track_button'];
84
  }
85
  }
86
 
87
+ // Notice: true -> '1', false -> ''
88
+ if ( isset( $data['connected'] ) && in_array( $data['connected'], array( '1', '' ) ) && in_array( boolval( $data['connected'] ), array( true, false ), true ) ) {
89
+ $options['connected'] = boolval( $data['connected'] );
90
+ }
91
+
92
  if ( isset( $data['use_track_button'] ) && in_array( $data['use_track_button'], array( true, false ), true ) ) {
93
  if ( '' === $use_tracking_button ) {
94
  $options['use_track_button'] = $data['use_track_button'];
includes/class-aftership-actions.php CHANGED
@@ -196,7 +196,7 @@ class AfterShip_Actions {
196
  echo '<option value="' . esc_attr( sanitize_title( $courier['slug'] ) ) . '">' . esc_html( $courier['name'] ) . '</option>';
197
  }
198
  echo '</select>';
199
- echo '<a class="link-to-setting" href="options-general.php?page=aftership-setting-admin">Update carrier list</a>';
200
  echo '</p>';
201
 
202
  $options = array();
@@ -887,4 +887,100 @@ class AfterShip_Actions {
887
  }
888
  }
889
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
890
  }
196
  echo '<option value="' . esc_attr( sanitize_title( $courier['slug'] ) ) . '">' . esc_html( $courier['name'] ) . '</option>';
197
  }
198
  echo '</select>';
199
+ echo '<a class="link-to-setting" href="admin.php?page=aftership-setting-admin">Update carrier list</a>';
200
  echo '</p>';
201
 
202
  $options = array();
887
  }
888
  }
889
  }
890
+
891
+ /**
892
+ * Add 'modified_after' and 'modified_before' for data query
893
+ *
894
+ * @param array $args
895
+ * @param WP_REST_Request $request
896
+ * @return array
897
+ */
898
+ function add_query( array $args, $request ) {
899
+ $modified_after = $request->get_param( 'modified_after' );
900
+ $modified_before = $request->get_param( 'modified_before' );
901
+ if ( ! $modified_after || ! $modified_before ) {
902
+ return $args;
903
+ };
904
+ $args['date_query'][] = array(
905
+ 'column' => 'post_modified',
906
+ 'after' => $modified_after,
907
+ 'before' => $modified_before,
908
+ );
909
+ return $args;
910
+ }
911
+
912
+ /**
913
+ * Add 'modified' to orderby enum
914
+ *
915
+ * @param array $params
916
+ */
917
+ public function add_collection_params( $params ) {
918
+ $enums = $params['orderby']['enum'];
919
+ if ( ! in_array( 'modified', $enums ) ) {
920
+ $params['orderby']['enum'][] = 'modified';
921
+ }
922
+ return $params;
923
+ }
924
+
925
+ /**
926
+ * Revoke AfterShip plugin REST oauth key when user Deactivation | Delete plugin
927
+ */
928
+ public function revoke_aftership_key() {
929
+ try {
930
+ global $wpdb;
931
+ // AfterShip Oauth key
932
+ $key_permission = 'read_write';
933
+ $key_description_prefix = 'AfterShip - API Read/Write';
934
+
935
+ $key = $wpdb->get_row(
936
+ $wpdb->prepare(
937
+ "SELECT key_id, user_id, description, permissions, truncated_key, last_access
938
+ FROM {$wpdb->prefix}woocommerce_api_keys
939
+ WHERE permissions = %s
940
+ AND INSTR(description, %s) > 0
941
+ ORDER BY key_id DESC LIMIT 1",
942
+ $key_permission,
943
+ $key_description_prefix
944
+ ),
945
+ ARRAY_A
946
+ );
947
+
948
+ if ( ! is_null( $key ) && $key['key_id'] ) {
949
+ $wpdb->delete( $wpdb->prefix . 'woocommerce_api_keys', array( 'key_id' => $key['key_id'] ), array( '%d' ) );
950
+ }
951
+ } catch ( Exception $e ) {
952
+ return false;
953
+ }
954
+ }
955
+
956
+ /**
957
+ * Add connection notice if customer not connected
958
+ */
959
+ public function show_notices() {
960
+ $screen = get_current_screen()->id;
961
+ $aftership_options = $GLOBALS['AfterShip']->options;
962
+
963
+ $pages_with_tip = array(
964
+ 'dashboard',
965
+ 'update-core',
966
+ 'plugins',
967
+ 'plugin-install',
968
+ 'shop_order',
969
+ 'edit-shop_order',
970
+ );
971
+ if ( ! in_array( $screen, $pages_with_tip ) ) {
972
+ return;
973
+ }
974
+
975
+ $aftership_plugin_is_actived = is_plugin_active( 'aftership-woocommerce-tracking/aftership-woocommerce-tracking.php' );
976
+ $unconnect_aftership = ! ( isset( $aftership_options['connected'] ) && $aftership_options['connected'] === true );
977
+ ?>
978
+ <?php if ( $aftership_plugin_is_actived && $unconnect_aftership ) : ?>
979
+ <div class="updated notice is-dismissible">
980
+ <p>[AfterShip] Connect your Woocommerce store to provide the best post-purchase experience to drive customer loyalty and additional sales. <a href="admin.php?page=automizely-aftership-index"> Let's get started >> </a></p>
981
+ </div>
982
+ <?php endif; ?>
983
+
984
+ <?php
985
+ }
986
  }
includes/class-aftership-settings.php CHANGED
@@ -28,11 +28,17 @@ class AfterShip_Settings {
28
  */
29
  private $dom_id_couriers = 'aftership_couriers';
30
 
 
 
 
 
 
 
 
31
  /**
32
  * Start up
33
  */
34
  public function __construct() {
35
- add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );
36
  add_action( 'admin_init', array( $this, 'page_init' ) );
37
  add_action( 'admin_print_styles', array( $this, 'admin_styles' ) );
38
  add_action( 'admin_print_scripts', array( &$this, 'library_scripts' ) );
@@ -58,46 +64,12 @@ class AfterShip_Settings {
58
  wp_enqueue_script( 'aftership_script_setting', $plugin_url . '/assets/js/setting.js', array(), AFTERSHIP_VERSION );
59
  }
60
 
61
- /**
62
- * Add options page
63
- */
64
- public function add_plugin_page() {
65
- // This page will be under "Settings".
66
- add_options_page(
67
- 'AfterShip Settings Admin',
68
- 'AfterShip',
69
- 'manage_options',
70
- 'aftership-setting-admin',
71
- array( $this, 'create_admin_page' )
72
- );
73
- }
74
-
75
- /**
76
- * Options page callback
77
- */
78
- public function create_admin_page() {
79
- // Set class property.
80
- $this->options = get_option( 'aftership_option_name' );
81
- ?>
82
- <div class="wrap">
83
- <h2>AfterShip Settings</h2>
84
-
85
- <form method="post" action="options.php">
86
- <?php
87
- // This prints out all hidden setting fields.
88
- settings_fields( 'aftership_option_group' );
89
- do_settings_sections( 'aftership-setting-admin' );
90
- submit_button();
91
- ?>
92
- </form>
93
- </div>
94
- <?php
95
- }
96
-
97
  /**
98
  * Register and add settings
99
  */
100
  public function page_init() {
 
 
101
  register_setting(
102
  'aftership_option_group',
103
  'aftership_option_name',
@@ -113,7 +85,7 @@ class AfterShip_Settings {
113
 
114
  add_settings_field(
115
  $this->dom_id_couriers,
116
- 'Couriers',
117
  array( $this, 'couriers_callback' ),
118
  'aftership-setting-admin',
119
  'aftership_setting_section_id'
@@ -121,7 +93,7 @@ class AfterShip_Settings {
121
 
122
  add_settings_field(
123
  'use_track_button',
124
- 'Display Track Button at Order History Page',
125
  array( $this, 'track_button_callback' ),
126
  'aftership-setting-admin',
127
  'aftership_setting_section_id'
@@ -129,7 +101,7 @@ class AfterShip_Settings {
129
 
130
  add_settings_field(
131
  'custom_domain',
132
- 'Display Tracking Information at Custom Domain',
133
  array( $this, 'custom_domain_callback' ),
134
  'aftership-setting-admin',
135
  'aftership_setting_section_id'
@@ -157,6 +129,10 @@ class AfterShip_Settings {
157
  $new_input['use_track_button'] = true;
158
  }
159
 
 
 
 
 
160
  return $new_input;
161
  }
162
 
@@ -191,10 +167,13 @@ class AfterShip_Settings {
191
  if ( isset( $this->options['couriers'] ) ) {
192
  $couriers = explode( ',', $this->options['couriers'] );
193
  }
 
194
  echo '<select data-placeholder="Please select couriers" id="' . $this->dom_id_courier_select . '" multiple style="width:100%">';
195
  echo '</select>';
196
  echo '<input type="hidden" id="' . $this->dom_id_couriers . '" name="aftership_option_name[couriers]" value="' . implode( ',', $couriers ) . '"/>';
197
-
 
 
198
  }
199
 
200
  /**
@@ -202,7 +181,7 @@ class AfterShip_Settings {
202
  */
203
  public function custom_domain_callback() {
204
  printf(
205
- '<input type="text" id="custom_domain" name="aftership_option_name[custom_domain]" value="%s" style="width:100%%">',
206
  isset( $this->options['custom_domain'] ) ? $this->normalize_custom_domain( $this->options['custom_domain'] ) : 'track.aftership.com'
207
  );
208
  }
@@ -212,7 +191,7 @@ class AfterShip_Settings {
212
  */
213
  public function track_button_callback() {
214
  printf(
215
- '<label><input type="checkbox" id="use_track_button" name="aftership_option_name[use_track_button]" %s>Use Track Button</label>',
216
  ( isset( $this->options['use_track_button'] ) && true === $this->options['use_track_button'] ) ? 'checked="checked"' : ''
217
  );
218
  }
28
  */
29
  private $dom_id_couriers = 'aftership_couriers';
30
 
31
+ /**
32
+ * DOM id for hidden aftership connected.
33
+ *
34
+ * @var string $dom_aftership_connected
35
+ */
36
+ private $dom_aftership_connected = 'aftership_connected';
37
+
38
  /**
39
  * Start up
40
  */
41
  public function __construct() {
 
42
  add_action( 'admin_init', array( $this, 'page_init' ) );
43
  add_action( 'admin_print_styles', array( $this, 'admin_styles' ) );
44
  add_action( 'admin_print_scripts', array( &$this, 'library_scripts' ) );
64
  wp_enqueue_script( 'aftership_script_setting', $plugin_url . '/assets/js/setting.js', array(), AFTERSHIP_VERSION );
65
  }
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  /**
68
  * Register and add settings
69
  */
70
  public function page_init() {
71
+ $this->options = get_option( 'aftership_option_name' );
72
+
73
  register_setting(
74
  'aftership_option_group',
75
  'aftership_option_name',
85
 
86
  add_settings_field(
87
  $this->dom_id_couriers,
88
+ '',
89
  array( $this, 'couriers_callback' ),
90
  'aftership-setting-admin',
91
  'aftership_setting_section_id'
93
 
94
  add_settings_field(
95
  'use_track_button',
96
+ '',
97
  array( $this, 'track_button_callback' ),
98
  'aftership-setting-admin',
99
  'aftership_setting_section_id'
101
 
102
  add_settings_field(
103
  'custom_domain',
104
+ '',
105
  array( $this, 'custom_domain_callback' ),
106
  'aftership-setting-admin',
107
  'aftership_setting_section_id'
129
  $new_input['use_track_button'] = true;
130
  }
131
 
132
+ if ( isset( $input['connected'] ) ) {
133
+ $new_input['connected'] = boolval( $input['connected'] );
134
+ }
135
+
136
  return $new_input;
137
  }
138
 
167
  if ( isset( $this->options['couriers'] ) ) {
168
  $couriers = explode( ',', $this->options['couriers'] );
169
  }
170
+ echo '<div class="auto-as-admin-select-title">Courier</div>';
171
  echo '<select data-placeholder="Please select couriers" id="' . $this->dom_id_courier_select . '" multiple style="width:100%">';
172
  echo '</select>';
173
  echo '<input type="hidden" id="' . $this->dom_id_couriers . '" name="aftership_option_name[couriers]" value="' . implode( ',', $couriers ) . '"/>';
174
+ if ( isset( $this->options['connected'] ) ) {
175
+ echo '<input type="hidden" id="' . $this->dom_aftership_connected . '" name="aftership_option_name[connected]" value="' . $this->options['connected'] . '" />';
176
+ }
177
  }
178
 
179
  /**
181
  */
182
  public function custom_domain_callback() {
183
  printf(
184
+ '<div class="auto-as-admin-input-title">Display Tracking Information at Custom Domain</div><input type="text" class="auto-as-admin-input-content" id="custom_domain" name="aftership_option_name[custom_domain]" value="%s" style="width:100%%">',
185
  isset( $this->options['custom_domain'] ) ? $this->normalize_custom_domain( $this->options['custom_domain'] ) : 'track.aftership.com'
186
  );
187
  }
191
  */
192
  public function track_button_callback() {
193
  printf(
194
+ '<div class="auto-as-admin-checkbox-title">Display Track Button at Order History Page</div><label><input type="checkbox" id="use_track_button" name="aftership_option_name[use_track_button]" %s>Use Track Button</label>',
195
  ( isset( $this->options['use_track_button'] ) && true === $this->options['use_track_button'] ) ? 'checked="checked"' : ''
196
  );
197
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.aftership.com/
4
  Tags: woocommerce shipping,woocommerce tracking,shipment tracking,order tracking, woocommerce,track order,dhl,ups,usps,fedex,shipping,tracking,order
5
  Requires at least: 2.9
6
  Tested up to: 5.7
7
- Stable tag: 1.12.15
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -71,17 +71,24 @@ ADSOne • Australia Post • Bonds Couriers • CourierPost • Couriers Please
71
 
72
  == Installation ==
73
 
74
- 1. [Sign up AfterShip account for FREE](https://secure.aftership.com/signup)
75
- 2. Under the `Apps` tab, select WooCommerce.
76
- 3. To get the `API Key` go to your WordPress admin and [Download AfterShip plugin](http://downloads.wordpress.org/plugin/aftership-woocommerce-tracking.zip), then install and activate it.
77
- 4. In the Wordpress admin, go to `Settings` and select the `AfterShip` plugin. Check `Use Track Button` (for displaying tracking info on the order history page) and add your custom branded tracking page domain.
78
- 5. Check `Use Track Button` (for displaying tracking info on the order history page) and add your custom branded tracking page domain.
79
- 6. Now go to the `User Profile` settings to generate AfterShip’s Wordpress API Key.
80
- 7. Copy the API Key generated and head back to your AfterShip account.
81
- 8. Input `Store URL` and `API Key` and click on `Connect`.
82
-
83
- *** This plugin requires at least PHP 5.2.4
84
- *** This plugin requires at least WooCommerce 2.1
 
 
 
 
 
 
 
85
 
86
  ###Further Reading
87
 
@@ -129,6 +136,11 @@ Tailor a dynamic branded tracking page. Upload promotional banner, logo, and fav
129
 
130
  == Changelog ==
131
 
 
 
 
 
 
132
  = 1.12.15 =
133
  * Update Courier list.
134
  * Add _aftership_tracking_number for Compatible
4
  Tags: woocommerce shipping,woocommerce tracking,shipment tracking,order tracking, woocommerce,track order,dhl,ups,usps,fedex,shipping,tracking,order
5
  Requires at least: 2.9
6
  Tested up to: 5.7
7
+ Stable tag: 1.13.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
71
 
72
  == Installation ==
73
 
74
+ We get two methods on how to connect WooCommerce to AfterShip
75
+ Install from WordPress Admin:
76
+ 1. Log in to your WooCommerce store
77
+ 2. Install the AfterShip plugin from your WordPress Admin
78
+ 3. Activate the plugin
79
+ 4. Click the "Connection Now" button on the plugin landing page
80
+ 5. [Log in to your AfterShip account](https://secure.aftership.com/signup), follow the WooCommerce OAuth flow, then click "Approve" button
81
+ 6. To check if your WordPress store is properly connected to AfterShip, go to Organization settings > Store connections > Search for your WordPress store
82
+ 7. In the WordPress admin, go to Settings and select the AfterShip plugin.
83
+ 8. Check Use Track Button (for displaying tracking info on the order history page) and add your custom branded tracking page domain.
84
+
85
+ Install from Aftership Organization Admin:
86
+ 1. Log in to your AfterShip account
87
+ 2. From the Organization admin > Go to Apps > AfterShip > WooCommerce
88
+ 3. Enter your Store URL > Click on Install app, then follow setups in "Install from WordPress Admin Section"
89
+
90
+ *** This plugin requires at least WooCommerce version 3.0.0 or above
91
+ *** This plugin requires at least WordPress version 4.4 or above
92
 
93
  ###Further Reading
94
 
136
 
137
  == Changelog ==
138
 
139
+ = 1.13.0 =
140
+ * Enhancement - Added New Admin Menu
141
+ * Enhancement - Enhancement - Updated Settings Page Design
142
+ * Enhancement - Compatible with WooCommerce OAuth Authentication
143
+
144
  = 1.12.15 =
145
  * Update Courier list.
146
  * Add _aftership_tracking_number for Compatible
views/automizely_aftership_on_boarding_view.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Prevent direct file access
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ if ( ! current_user_can( 'manage_options' ) ) {
8
+ wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
9
+ }
10
+
11
+ $server_protocol = (int) $_SERVER['SERVER_PORT'] == 80 ? 'http://' : 'https://';
12
+
13
+ $store_url = $server_protocol . $_SERVER['HTTP_HOST'];
14
+
15
+ $query = array(
16
+ 'shop' => $store_url,
17
+ 'utm_source' => 'wordpress_plugin',
18
+ 'utm_medium' => 'landingpage',
19
+ );
20
+
21
+ $debug = isset( $_GET['debug'] ) ? $_GET['debug'] : 'no';
22
+
23
+ $go_to_dashboard_url = 'https://accounts.aftership.com/oauth-session?callbackUrl=' . urlencode( 'https://accounts.aftership.com/oauth/woocommerce-automizely-aftership?signature=' . base64_encode( json_encode( $query ) ) );
24
+
25
+ if ( $debug === 'yes' ) {
26
+ $go_to_dashboard_url = 'https://accounts.aftership.io/oauth-session?callbackUrl=' . urlencode( 'https://accounts.aftership.io/oauth/woocommerce-automizely-aftership?signature=' . base64_encode( json_encode( $query ) ) );
27
+ }
28
+
29
+ ?>
30
+
31
+ <!-- Main wrapper -->
32
+ <div class="auto-as-index-container">
33
+ <div class="auto-as-index-header">
34
+ <div class="auto-as-index-logo">
35
+ <img
36
+ src="<?php echo AFTERSHIP_ASSETS_URL . '/assets/images/wordpress-aftership-logo.svg'; ?>"
37
+ alt=""
38
+ />
39
+ </div>
40
+ <div class="auto-as-index-header-title">Connect with AfterShip</div>
41
+ <div class="auto-as-index-header-desc">
42
+ Track your WooCommerce orders and get delivery updates from 800+
43
+ carriers like UPS, USPS, FedEx, and DHL all in one place.
44
+ </div>
45
+ <button class="auto-as-index-header-button" onclick="window.open('<?php echo $go_to_dashboard_url; ?>')">
46
+ Connect now
47
+ </button>
48
+ </div>
49
+ <div class="auto-as-index-content">
50
+ <img
51
+ style="
52
+ width: 766px;
53
+ height: 486px;
54
+ display: block;
55
+ margin: 80px auto 0px;
56
+ "
57
+ src="<?php echo AFTERSHIP_ASSETS_URL . '/assets/images/tracking-page.png'; ?>"
58
+ alt=""
59
+ />
60
+ </div>
61
+ </div>
views/automizely_aftership_setting_view.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Prevent direct file access
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
6
+
7
+ if ( ! current_user_can( 'manage_options' ) ) {
8
+ wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
9
+ }
10
+
11
+ $this->options = get_option( 'aftership_option_name' );
12
+ $is_display_connect = $this->options['connected'] && $this->options['connected'] === true;
13
+
14
+ $server_protocol = (int) $_SERVER['SERVER_PORT'] == 80 ? 'http://' : 'https://';
15
+
16
+ $store_url = $server_protocol . $_SERVER['HTTP_HOST'];
17
+
18
+ $query = array(
19
+ 'shop' => $store_url,
20
+ 'utm_source' => 'wordpress_plugin',
21
+ 'utm_medium' => 'landingpage',
22
+ );
23
+
24
+ $debug = isset( $_GET['debug'] ) ? $_GET['debug'] : 'no';
25
+
26
+ $go_to_dashboard_url = 'https://accounts.aftership.com/oauth-session?callbackUrl=' . urlencode( 'https://accounts.aftership.com/oauth/woocommerce-automizely-aftership?signature=' . base64_encode( json_encode( $query ) ) );
27
+
28
+ if ( $debug === 'yes' ) {
29
+ $go_to_dashboard_url = 'https://accounts.aftership.io/oauth-session?callbackUrl=' . urlencode( 'https://accounts.aftership.io/oauth/woocommerce-automizely-aftership?signature=' . base64_encode( json_encode( $query ) ) );
30
+ }
31
+
32
+ ?>
33
+
34
+ <!-- Main wrapper -->
35
+ <div class="auto-as-admin-container">
36
+ <div class="auto-as-admin-header" style="<?php echo $is_display_connect ? 'display:none;' : ''; ?>">
37
+ <div class="auto-as-admin-logo">
38
+ <img
39
+ src="https://assets.aftership.com/img/wordpress-aftership-logo.svg"
40
+ alt=""
41
+ />
42
+ </div>
43
+ <div class="auto-as-admin-header-title">Connect with AfterShip</div>
44
+ <div class="auto-as-admin-header-desc">
45
+ Track your WooCommerce orders and get delivery updates from 800+
46
+ carriers like UPS, USPS, FedEx, and DHL all in one place.
47
+ </div>
48
+ <button class="auto-as-admin-header-button" onclick="window.open('<?php echo $go_to_dashboard_url; ?>')">
49
+ Connect now
50
+ </button>
51
+ </div>
52
+
53
+ <div class="wrap">
54
+ <h2>Settings</h2>
55
+
56
+ <form method="post" action="options.php">
57
+ <?php
58
+ // This prints out all hidden setting fields.
59
+ settings_fields( 'aftership_option_group' );
60
+ do_settings_sections( 'aftership-setting-admin' );
61
+ submit_button();
62
+ ?>
63
+ </form>
64
+ <script>
65
+ </script>
66
+ </div>
67
+ <div class="auto-as-admin-link">
68
+ <div class="auto-as-admin-link-content">
69
+ <span class="auto-as-admin-text-bold">Loving AfterShip? Rate us on the </span><a href="https://wordpress.org/plugins/aftership-woocommerce-tracking/#reviews">WordPress Plugin Directory</a>
70
+ </div>
71
+ </div>
72
+ <div class="auto-as-admin-recommand">
73
+ <div class="auto-as-admin-recommand-title">Recommand for you</div>
74
+ <div class="auto-as-admin-recommand-list">
75
+ <!-- postmen -->
76
+ <a href="/wp-admin/plugin-install.php?tab=plugin-information&plugin=postmen-woo-shipping" target="_blank">
77
+ <div class="auto-as-admin-recommand-list-item">
78
+ <img style="width: 64px; height: 64px" src="https://assets.aftership.com/img/postmen-product.svg" alt="" />
79
+ <div class="auto-as-admin-recommand-list-item-detail">
80
+ <span>
81
+ <strong>Postmen </strong>
82
+ </span>
83
+ <span>
84
+ Delight customers with the best returns experience
85
+ </span>
86
+ </div>
87
+ </div>
88
+ </a>
89
+
90
+ <!-- marketing -->
91
+ <a href="/wp-admin/plugin-install.php?tab=plugin-information&plugin=automizely-marketing" target="_blank">
92
+ <div class="auto-as-admin-recommand-list-item">
93
+ <img
94
+ style="width: 64px; height: 64px"
95
+ src="https://assets.aftership.com/img/marketing-product.svg"
96
+ alt=""
97
+ />
98
+ <div class="auto-as-admin-recommand-list-item-detail">
99
+ <span>
100
+ <strong>Marketing</strong>
101
+ </span>
102
+ <span>
103
+ Delight customers with the best returns experience
104
+ </span>
105
+ </div>
106
+ </div>
107
+ </a>
108
+
109
+ <!-- dropshipping -->
110
+ <a href="/wp-admin/plugin-install.php?tab=plugin-information&plugin=automizely-dropshipping" target="_blank">
111
+ <div class="auto-as-admin-recommand-list-item">
112
+ <img
113
+ style="width: 64px; height: 64px"
114
+ src="https://assets.aftership.com/img/dropshipping-product.svg"
115
+ alt=""
116
+ />
117
+ <div class="auto-as-admin-recommand-list-item-detail">
118
+ <span>
119
+ <strong>Dropshipping</strong>
120
+ </span>
121
+ <span>Easy, Fast, and Reliable Dropshipping</span>
122
+ </div>
123
+ </div>
124
+ </a>
125
+ </div>
126
+ </div>
127
+ </div>