Flexible Shipping for WooCommerce - Version 4.11.1

Version Description

  • 2022-01-04 =
  • Added support for WordPress 5.9
  • Added support for WooCommerce 6.1
  • Added contextual info for USPS
  • Removed global log file capture
Download this release

Release Info

Developer wpdesk
Plugin Icon 128x128 Flexible Shipping for WooCommerce
Version 4.11.1
Comparing to
See all releases

Code changes from version 4.11.0 to 4.11.1

Files changed (28) hide show
  1. classes/class-flexible-shipping-plugin.php +1 -0
  2. flexible-shipping.php +5 -5
  3. lang/flexible-shipping.pot +42 -122
  4. readme.txt +8 -2
  5. src/WPDesk/FS/Info/Video.php +1 -1
  6. src/WPDesk/FS/TableRate/ContextualInfo/Creator.php +49 -13
  7. src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerClickedOption.php +0 -72
  8. src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerDontLikeOption.php +0 -40
  9. src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerLikeOption.php +0 -54
  10. src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesPointerBanner.php +0 -71
  11. src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesPointerBannerForNewTable.php +0 -48
  12. src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesPointerBannerForOldTable.php +0 -54
  13. src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner-for-new-table.php +0 -20
  14. src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner.php +0 -20
  15. src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-script.php +0 -73
  16. src/WPDesk/FS/TableRate/NewRulesTableDeactivationTracker.php +0 -47
  17. src/WPDesk/FS/TableRate/NewRulesTablePointer/ShippingMethodNewRuleTableSetting.php +0 -134
  18. src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php +0 -152
  19. src/WPDesk/FS/TableRate/NewRulesTablePopup/NewRulesPopupClickedOption.php +0 -47
  20. src/WPDesk/FS/TableRate/NewRulesTablePopup/NewRulesPopupClickedOptionAjaxUpdater.php +0 -65
  21. src/WPDesk/FS/TableRate/NewRulesTableTracker.php +0 -44
  22. src/WPDesk/FS/TableRate/NewRulesTableTrackerData.php +0 -109
  23. vendor/autoload.php +1 -1
  24. vendor/composer/autoload_classmap.php +0 -13
  25. vendor/composer/autoload_real.php +4 -4
  26. vendor/composer/autoload_static.php +5 -18
  27. vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/LocalCodeceptionTrait.php +1 -0
  28. vendor_prefixed/wpdesk/wp-nps/src/Nps.php +1 -1
classes/class-flexible-shipping-plugin.php CHANGED
@@ -175,6 +175,7 @@ class Flexible_Shipping_Plugin extends AbstractPlugin implements HookableCollect
175
  private function init_logger() {
176
  $logger_settings = new WPDesk_Flexible_Shipping_Logger_Settings();
177
  if ( $logger_settings->is_enabled() ) {
 
178
  return $this->logger = ( new WPDeskLoggerFactory() )->createWPDeskLogger( $logger_settings->get_logger_channel_name() );
179
  }
180
 
175
  private function init_logger() {
176
  $logger_settings = new WPDesk_Flexible_Shipping_Logger_Settings();
177
  if ( $logger_settings->is_enabled() ) {
178
+ add_filter( 'wpdesk_is_wp_log_capture_permitted', '__return_false' );
179
  return $this->logger = ( new WPDeskLoggerFactory() )->createWPDeskLogger( $logger_settings->get_logger_channel_name() );
180
  }
181
 
flexible-shipping.php CHANGED
@@ -3,15 +3,15 @@
3
  * Plugin Name: Flexible Shipping
4
  * Plugin URI: https://wordpress.org/plugins/flexible-shipping/
5
  * Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
6
- * Version: 4.11.0
7
  * Author: WP Desk
8
  * Author URI: https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author
9
  * Text Domain: flexible-shipping
10
  * Domain Path: /lang/
11
  * Requires at least: 5.2
12
- * Tested up to: 5.8
13
- * WC requires at least: 5.6
14
- * WC tested up to: 6.0
15
  * Requires PHP: 7.0
16
  *
17
  * Copyright 2017 WP Desk Ltd.
@@ -38,7 +38,7 @@ if ( ! defined( 'ABSPATH' ) ) {
38
  } // Exit if accessed directly
39
 
40
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
41
- $plugin_version = '4.11.0';
42
 
43
  $plugin_name = 'Flexible Shipping';
44
  $product_id = 'Flexible Shipping';
3
  * Plugin Name: Flexible Shipping
4
  * Plugin URI: https://wordpress.org/plugins/flexible-shipping/
5
  * Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
6
+ * Version: 4.11.1
7
  * Author: WP Desk
8
  * Author URI: https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author
9
  * Text Domain: flexible-shipping
10
  * Domain Path: /lang/
11
  * Requires at least: 5.2
12
+ * Tested up to: 5.9
13
+ * WC requires at least: 5.7
14
+ * WC tested up to: 6.1
15
  * Requires PHP: 7.0
16
  *
17
  * Copyright 2017 WP Desk Ltd.
38
  } // Exit if accessed directly
39
 
40
  /* THIS VARIABLE CAN BE CHANGED AUTOMATICALLY */
41
+ $plugin_version = '4.11.1';
42
 
43
  $plugin_name = 'Flexible Shipping';
44
  $product_id = 'Flexible Shipping';
lang/flexible-shipping.pot CHANGED
@@ -1,15 +1,15 @@
1
- # Copyright (C) 2021 WP Desk
2
  # This file is distributed under the same license as the Flexible Shipping plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Flexible Shipping 4.11.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flexible-shipping\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2021-12-06T14:44:33+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: flexible-shipping\n"
@@ -44,77 +44,77 @@ msgstr ""
44
  msgid "https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author"
45
  msgstr ""
46
 
47
- #: classes/class-flexible-shipping-plugin.php:319
48
  msgid "Hey, we are curious how would you grade your first impression on Flexible Shipping so far?"
49
  msgstr ""
50
 
51
- #: classes/class-flexible-shipping-plugin.php:320
52
  msgid "Wow, it's awesome!"
53
  msgstr ""
54
 
55
- #: classes/class-flexible-shipping-plugin.php:321
56
  msgid "Really poor"
57
  msgstr ""
58
 
59
- #: classes/class-flexible-shipping-plugin.php:324
60
  msgid "By using the 'Send feedback' button I hereby agree and consent to the terms of %1$sPrivacy Policy%2$s."
61
  msgstr ""
62
 
63
- #: classes/class-flexible-shipping-plugin.php:330
64
  msgid "More calculation conditions"
65
  msgstr ""
66
 
67
- #: classes/class-flexible-shipping-plugin.php:330
68
  msgid "What exactly should the conditions you need be based on?"
69
  msgstr ""
70
 
71
- #: classes/class-flexible-shipping-plugin.php:331
72
  msgid "More detailed documentation"
73
  msgstr ""
74
 
75
- #: classes/class-flexible-shipping-plugin.php:332
76
  msgid "Easier contact with support"
77
  msgstr ""
78
 
79
- #: classes/class-flexible-shipping-plugin.php:333
80
  msgid "More user-friendly interface"
81
  msgstr ""
82
 
83
- #: classes/class-flexible-shipping-plugin.php:334
84
  msgid "Less complicated settings"
85
  msgstr ""
86
 
87
- #: classes/class-flexible-shipping-plugin.php:335
88
  msgid "Too soon to say"
89
  msgstr ""
90
 
91
- #: classes/class-flexible-shipping-plugin.php:336
92
  #: classes/views/deactivation_thickbox.php:106
93
  msgid "Other"
94
  msgstr ""
95
 
96
- #: classes/class-flexible-shipping-plugin.php:336
97
  msgid "Please tell us what exactly can we do to improve our plugin?"
98
  msgstr ""
99
 
100
  #. Translators: link.
101
- #: classes/class-flexible-shipping-plugin.php:781
102
  msgid "How can We make Flexible Shipping better for you? %1$sJust write to us.%2$s"
103
  msgstr ""
104
 
105
- #: classes/class-flexible-shipping-plugin.php:862
106
  msgid "Settings"
107
  msgstr ""
108
 
109
- #: classes/class-flexible-shipping-plugin.php:866
110
  msgid "Docs"
111
  msgstr ""
112
 
113
- #: classes/class-flexible-shipping-plugin.php:867
114
  msgid "Support"
115
  msgstr ""
116
 
117
- #: classes/class-flexible-shipping-plugin.php:873
118
  msgid "Upgrade"
119
  msgstr ""
120
 
@@ -876,71 +876,76 @@ msgid "Proceed to adding the rules"
876
  msgstr ""
877
 
878
  #. Translators: link.
879
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:137
880
  msgid "Want to show your customers the DHL Express live rates? %1$sCheck our DHL Express plugin →%2$s"
881
  msgstr ""
882
 
883
  #. Translators: link.
884
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:161
885
  msgid "Want to show your customers the FedEx live rates? %1$sCheck our FedEx plugin →%2$s"
886
  msgstr ""
887
 
888
  #. Translators: link.
889
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:185
890
  msgid "Sending your products with UPS? Create the shipments and generate shipping labels directly from your shop using our %1$sUPS Labels →%2$s"
891
  msgstr ""
892
 
893
  #. Translators: link.
894
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:206
 
 
 
 
 
895
  msgid "Sending your products via DPD? Create the shipments and generate shipping labels directly from your shop using our %1$sDPD integration →%2$s"
896
  msgstr ""
897
 
898
  #. Translators: link.
899
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:227
900
  msgid "Sending your products via Poczta Polska? Create the shipments and generate shipping labels directly from your shop using our %1$sPoczta Polska eNadawca integration →%2$s"
901
  msgstr ""
902
 
903
  #. Translators: link.
904
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:248
905
  msgid "Sending your products via DHL? Create the shipments and generate shipping labels directly from your shop using our %1$sDHL integration →%2$s"
906
  msgstr ""
907
 
908
  #. Translators: link.
909
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:269
910
  msgid "Sending your products via Orlen Paczka? Create the shipments and generate shipping labels directly from your shop using our %1$sOrlen Paczka integration →%2$s"
911
  msgstr ""
912
 
913
  #. Translators: link.
914
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:290
915
  msgid "Sending your products via InPost? Create the shipments and generate shipping labels directly from your shop using our %1$sInPost integration →%2$s"
916
  msgstr ""
917
 
918
  #. Translators: link.
919
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:311
920
  msgid "Sending your products via DPD UK? Create the shipments and generate shipping labels directly from your shop using our %1$sDPD UK integration →%2$s"
921
  msgstr ""
922
 
923
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:342
924
  msgid "Check our further shipping integrations with DPD, DHL, InPost, eNadawca and Orlen Paczka."
925
  msgstr ""
926
 
927
  #. Translators: link.
928
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:345
929
  msgid "%1$sAdd integrations%2$s"
930
  msgstr ""
931
 
932
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:350
933
  msgid "Check our further shipping integration with DPD UK and FedEx / UPS live rates plugins."
934
  msgstr ""
935
 
936
  #. Translators: link.
937
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:353
938
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:361
939
  msgid "%1$sAdd integration%2$s"
940
  msgstr ""
941
 
942
- #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:358
943
- msgid "Check our further shipping integration with FedEx / UPS live rates plugins."
944
  msgstr ""
945
 
946
  #. Translators: zones.
@@ -1021,91 +1026,6 @@ msgstr ""
1021
  msgid "Error while creating shipping class: %1$s, %2$s"
1022
  msgstr ""
1023
 
1024
- #: src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner-for-new-table.php:11
1025
- msgid "The new table interface has been activated"
1026
- msgstr ""
1027
-
1028
- #: src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner-for-new-table.php:12
1029
- msgid "We are very curious about your opinion on the new table design. With the buttons below you can choose which interface you want to use from now on."
1030
- msgstr ""
1031
-
1032
- #: src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner-for-new-table.php:14
1033
- msgid "I like it and want to use the new interface"
1034
- msgstr ""
1035
-
1036
- #: src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner-for-new-table.php:15
1037
- msgid "I don't like it, keep using the old one"
1038
- msgstr ""
1039
-
1040
- #: src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner.php:11
1041
- msgid "Hey, we are changing for you! Let us introduce you a completely new table interface!"
1042
- msgstr ""
1043
-
1044
- #: src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner.php:12
1045
- msgid "We are constantly developing our plugin to make it more intuitive, user-friendly and approachable at the same time. Therefore, we have designed a completely new table interface which will make it easier to create your own rules and configure the whole shipping."
1046
- msgstr ""
1047
-
1048
- #: src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner.php:13
1049
- msgid "Can we count on you?"
1050
- msgstr ""
1051
-
1052
- #: src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner.php:13
1053
- msgid "Your opinion is very important to us and will help us to adapt Flexible Shipping plugin to your needs even better."
1054
- msgstr ""
1055
-
1056
- #: src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner.php:15
1057
- msgid "Check the new interface"
1058
- msgstr ""
1059
-
1060
- #: src/WPDesk/FS/TableRate/NewRulesTablePointer/ShippingMethodNewRuleTableSetting.php:47
1061
- msgid "Enable New Table Interface"
1062
- msgstr ""
1063
-
1064
- #: src/WPDesk/FS/TableRate/NewRulesTablePointer/ShippingMethodNewRuleTableSetting.php:48
1065
- msgid "Rules table"
1066
- msgstr ""
1067
-
1068
- #. Translators: html tags.
1069
- #: src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php:94
1070
- msgid "We are introducing a completely %1$snew table interface!%2$s"
1071
- msgstr ""
1072
-
1073
- #: src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php:96
1074
- msgid "What's new?"
1075
- msgstr ""
1076
-
1077
- #: src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php:97
1078
- msgid "Give it a try!"
1079
- msgstr ""
1080
-
1081
- #: src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php:100
1082
- msgid "Keep the old version"
1083
- msgstr ""
1084
-
1085
- #: src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php:104
1086
- msgid "Intuitive and clean design"
1087
- msgstr ""
1088
-
1089
- #: src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php:105
1090
- msgid "Everything kept as simple as possible. All the options just where you need them."
1091
- msgstr ""
1092
-
1093
- #: src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php:109
1094
- msgid "Easier configuration"
1095
- msgstr ""
1096
-
1097
- #: src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php:110
1098
- msgid "No more confusing setup. Make the shipping fit your needs within a few clicks."
1099
- msgstr ""
1100
-
1101
- #: src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php:114
1102
- msgid "Just set and go!"
1103
- msgstr ""
1104
-
1105
- #: src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php:115
1106
- msgid "Turn the plugin on, define the shipping cost calculation rules and let it do the rest!"
1107
- msgstr ""
1108
-
1109
  #: src/WPDesk/FS/TableRate/Order/ItemMeta.php:63
1110
  msgid "Description"
1111
  msgstr ""
1
+ # Copyright (C) 2022 WP Desk
2
  # This file is distributed under the same license as the Flexible Shipping plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Flexible Shipping 4.11.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/flexible-shipping\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2022-01-04T10:34:17+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: flexible-shipping\n"
44
  msgid "https://flexibleshipping.com/?utm_source=fs&utm_medium=link&utm_campaign=plugin-list-author"
45
  msgstr ""
46
 
47
+ #: classes/class-flexible-shipping-plugin.php:320
48
  msgid "Hey, we are curious how would you grade your first impression on Flexible Shipping so far?"
49
  msgstr ""
50
 
51
+ #: classes/class-flexible-shipping-plugin.php:321
52
  msgid "Wow, it's awesome!"
53
  msgstr ""
54
 
55
+ #: classes/class-flexible-shipping-plugin.php:322
56
  msgid "Really poor"
57
  msgstr ""
58
 
59
+ #: classes/class-flexible-shipping-plugin.php:325
60
  msgid "By using the 'Send feedback' button I hereby agree and consent to the terms of %1$sPrivacy Policy%2$s."
61
  msgstr ""
62
 
63
+ #: classes/class-flexible-shipping-plugin.php:331
64
  msgid "More calculation conditions"
65
  msgstr ""
66
 
67
+ #: classes/class-flexible-shipping-plugin.php:331
68
  msgid "What exactly should the conditions you need be based on?"
69
  msgstr ""
70
 
71
+ #: classes/class-flexible-shipping-plugin.php:332
72
  msgid "More detailed documentation"
73
  msgstr ""
74
 
75
+ #: classes/class-flexible-shipping-plugin.php:333
76
  msgid "Easier contact with support"
77
  msgstr ""
78
 
79
+ #: classes/class-flexible-shipping-plugin.php:334
80
  msgid "More user-friendly interface"
81
  msgstr ""
82
 
83
+ #: classes/class-flexible-shipping-plugin.php:335
84
  msgid "Less complicated settings"
85
  msgstr ""
86
 
87
+ #: classes/class-flexible-shipping-plugin.php:336
88
  msgid "Too soon to say"
89
  msgstr ""
90
 
91
+ #: classes/class-flexible-shipping-plugin.php:337
92
  #: classes/views/deactivation_thickbox.php:106
93
  msgid "Other"
94
  msgstr ""
95
 
96
+ #: classes/class-flexible-shipping-plugin.php:337
97
  msgid "Please tell us what exactly can we do to improve our plugin?"
98
  msgstr ""
99
 
100
  #. Translators: link.
101
+ #: classes/class-flexible-shipping-plugin.php:782
102
  msgid "How can We make Flexible Shipping better for you? %1$sJust write to us.%2$s"
103
  msgstr ""
104
 
105
+ #: classes/class-flexible-shipping-plugin.php:863
106
  msgid "Settings"
107
  msgstr ""
108
 
109
+ #: classes/class-flexible-shipping-plugin.php:867
110
  msgid "Docs"
111
  msgstr ""
112
 
113
+ #: classes/class-flexible-shipping-plugin.php:868
114
  msgid "Support"
115
  msgstr ""
116
 
117
+ #: classes/class-flexible-shipping-plugin.php:874
118
  msgid "Upgrade"
119
  msgstr ""
120
 
876
  msgstr ""
877
 
878
  #. Translators: link.
879
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:150
880
  msgid "Want to show your customers the DHL Express live rates? %1$sCheck our DHL Express plugin →%2$s"
881
  msgstr ""
882
 
883
  #. Translators: link.
884
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:174
885
  msgid "Want to show your customers the FedEx live rates? %1$sCheck our FedEx plugin →%2$s"
886
  msgstr ""
887
 
888
  #. Translators: link.
889
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:198
890
  msgid "Sending your products with UPS? Create the shipments and generate shipping labels directly from your shop using our %1$sUPS Labels →%2$s"
891
  msgstr ""
892
 
893
  #. Translators: link.
894
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:221
895
+ msgid "Want to show your customers the USPS live rates? %1$sCheck our USPS plugin →%2$s"
896
+ msgstr ""
897
+
898
+ #. Translators: link.
899
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:242
900
  msgid "Sending your products via DPD? Create the shipments and generate shipping labels directly from your shop using our %1$sDPD integration →%2$s"
901
  msgstr ""
902
 
903
  #. Translators: link.
904
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:263
905
  msgid "Sending your products via Poczta Polska? Create the shipments and generate shipping labels directly from your shop using our %1$sPoczta Polska eNadawca integration →%2$s"
906
  msgstr ""
907
 
908
  #. Translators: link.
909
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:284
910
  msgid "Sending your products via DHL? Create the shipments and generate shipping labels directly from your shop using our %1$sDHL integration →%2$s"
911
  msgstr ""
912
 
913
  #. Translators: link.
914
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:305
915
  msgid "Sending your products via Orlen Paczka? Create the shipments and generate shipping labels directly from your shop using our %1$sOrlen Paczka integration →%2$s"
916
  msgstr ""
917
 
918
  #. Translators: link.
919
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:326
920
  msgid "Sending your products via InPost? Create the shipments and generate shipping labels directly from your shop using our %1$sInPost integration →%2$s"
921
  msgstr ""
922
 
923
  #. Translators: link.
924
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:347
925
  msgid "Sending your products via DPD UK? Create the shipments and generate shipping labels directly from your shop using our %1$sDPD UK integration →%2$s"
926
  msgstr ""
927
 
928
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:378
929
  msgid "Check our further shipping integrations with DPD, DHL, InPost, eNadawca and Orlen Paczka."
930
  msgstr ""
931
 
932
  #. Translators: link.
933
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:381
934
  msgid "%1$sAdd integrations%2$s"
935
  msgstr ""
936
 
937
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:386
938
  msgid "Check our further shipping integration with DPD UK and FedEx / UPS live rates plugins."
939
  msgstr ""
940
 
941
  #. Translators: link.
942
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:389
943
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:397
944
  msgid "%1$sAdd integration%2$s"
945
  msgstr ""
946
 
947
+ #: src/WPDesk/FS/TableRate/ContextualInfo/Creator.php:394
948
+ msgid "Check our further shipping integration with FedEx / UPS / USPS live rates plugins."
949
  msgstr ""
950
 
951
  #. Translators: zones.
1026
  msgid "Error while creating shipping class: %1$s, %2$s"
1027
  msgstr ""
1028
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1029
  #: src/WPDesk/FS/TableRate/Order/ItemMeta.php:63
1030
  msgid "Description"
1031
  msgstr ""
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: wpdesk,dyszczo,grola,piotrpo,marcinkolanko,mateuszgbiorczyk,sebast
3
  Donate link: https://flexibleshipping.com/products/flexible-shipping-pro-woocommerce/?utm_source=wordpress&utm_medium=link&utm_campaign=wordpress
4
  Tags: table rate, table rate shipping, conditional shipping, free shipping, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes, shipping, free shipping, advanced shipping
5
  Requires at least: 4.5
6
- Tested up to: 5.8
7
- Stable tag: 4.11.0
8
  Requires PHP: 7.0
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -200,6 +200,12 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
200
 
201
  == Changelog ==
202
 
 
 
 
 
 
 
203
  = 4.11.0 - 2021-12-06 =
204
  * Added FS methods duplication
205
 
3
  Donate link: https://flexibleshipping.com/products/flexible-shipping-pro-woocommerce/?utm_source=wordpress&utm_medium=link&utm_campaign=wordpress
4
  Tags: table rate, table rate shipping, conditional shipping, free shipping, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes, shipping, free shipping, advanced shipping
5
  Requires at least: 4.5
6
+ Tested up to: 5.9
7
+ Stable tag: 4.11.1
8
  Requires PHP: 7.0
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
200
 
201
  == Changelog ==
202
 
203
+ = 4.11.1 - 2022-01-04 =
204
+ * Added support for WordPress 5.9
205
+ * Added support for WooCommerce 6.1
206
+ * Added contextual info for USPS
207
+ * Removed global log file capture
208
+
209
  = 4.11.0 - 2021-12-06 =
210
  * Added FS methods duplication
211
 
src/WPDesk/FS/Info/Video.php CHANGED
@@ -22,7 +22,7 @@ class Video extends Metabox {
22
  * @return string
23
  */
24
  private function get_body_content() {
25
- $youtube_url = 'https://www.youtube.com/embed/qsFvYoiNDgU';
26
 
27
  return '<p style="text-align:center;"><iframe width="688" height="387" src="' . esc_url( $youtube_url ) . '?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></p>';
28
  }
22
  * @return string
23
  */
24
  private function get_body_content() {
25
+ $youtube_url = 'https://www.youtube.com/embed/ov1Ff-_A268';
26
 
27
  return '<p style="text-align:center;"><iframe width="688" height="387" src="' . esc_url( $youtube_url ) . '?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></p>';
28
  }
src/WPDesk/FS/TableRate/ContextualInfo/Creator.php CHANGED
@@ -7,16 +7,18 @@
7
 
8
  namespace WPDesk\FS\TableRate\ContextualInfo;
9
 
 
10
  use FSVendor\WPDesk\PluginBuilder\Plugin\HookableCollection;
 
11
 
12
  /**
13
  * Can create contextual info.
14
  */
15
  class Creator implements HookableCollection {
16
 
17
- use \FSVendor\WPDesk\PluginBuilder\Plugin\HookableParent;
18
 
19
- const METHOD_TITLE_ELEMENT = 'woocommerce_flexible_shipping_method_title';
20
  const METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS = 'woocommerce_flexible_shipping_method_title,woocommerce_flexible_shipping_method_description';
21
 
22
  /**
@@ -82,6 +84,10 @@ class Creator implements HookableCollection {
82
  $phrases_in = [ 'air', 'dpd' ];
83
  $this->create_dpd_uk_contextual_info( $phrases_in );
84
  $other_phrases_not_in = $this->merge_phrases( $other_phrases_not_in, $phrases_in );
 
 
 
 
85
  }
86
 
87
  $this->create_default_contextual_info( $other_phrases_not_in );
@@ -105,6 +111,13 @@ class Creator implements HookableCollection {
105
  return 'PL' === $this->base_location_country;
106
  }
107
 
 
 
 
 
 
 
 
108
  /**
109
  * @return bool
110
  */
@@ -128,7 +141,7 @@ class Creator implements HookableCollection {
128
  private function create_dhl_express_contextual_info( array $phrases_in ) {
129
  if ( ! defined( 'FLEXIBLE_SHIPPING_DHL_EXPRESS_VERSION' ) && ! defined( 'FLEXIBLE_SHIPPING_DHL_EXPRESS_PRO_VERSION' ) ) {
130
  $this->add_hookable(
131
- new \Flexible_Shipping_Contextual_Info(
132
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
133
  'dhl_express',
134
  $phrases_in,
@@ -152,7 +165,7 @@ class Creator implements HookableCollection {
152
  ? 'https://www.wpdesk.pl/sklep/fedex-woocommerce/?utm_source=flexible-shipping-method-fedex&utm_medium=button&utm_campaign=flexible-shipping-integrations'
153
  : 'https://flexibleshipping.com/products/flexible-shipping-fedex-pro/?utm_source=flexible-shipping-method-fedex&utm_medium=button&utm_campaign=flexible-shipping-integrations';
154
  $this->add_hookable(
155
- new \Flexible_Shipping_Contextual_Info(
156
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
157
  'fedex',
158
  $phrases_in,
@@ -176,7 +189,7 @@ class Creator implements HookableCollection {
176
  ? 'https://www.wpdesk.pl/sklep/ups-woocommerce-etykiety-nadawcze-i-sledzenie-przesylek/?utm_source=flexible-shipping-method-ups&utm_medium=button&utm_campaign=flexible-shipping-integrations'
177
  : 'https://flexibleshipping.com/products/flexible-shipping-ups-labels/?utm_source=flexible-shipping-method-ups&utm_medium=button&utm_campaign=flexible-shipping-integrations';
178
  $this->add_hookable(
179
- new \Flexible_Shipping_Contextual_Info(
180
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
181
  'ups',
182
  $phrases_in,
@@ -191,13 +204,36 @@ class Creator implements HookableCollection {
191
  }
192
  }
193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  /**
195
  * @param array $phrases_in .
196
  */
197
  private function create_dpd_contextual_info( array $phrases_in ) {
198
  if ( ! defined( 'WOOCOMMERCE_DPD_VERSION' ) ) {
199
  $this->add_hookable(
200
- new \Flexible_Shipping_Contextual_Info(
201
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
202
  'dpd',
203
  $phrases_in,
@@ -218,7 +254,7 @@ class Creator implements HookableCollection {
218
  private function create_enadawca_contextual_info( array $phrases_in ) {
219
  if ( ! defined( 'WOOCOMMERCE_ENADAWCA_VERSION' ) ) {
220
  $this->add_hookable(
221
- new \Flexible_Shipping_Contextual_Info(
222
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
223
  'enadawca',
224
  $phrases_in,
@@ -239,7 +275,7 @@ class Creator implements HookableCollection {
239
  private function create_dhl_contextual_info( array $phrases_in ) {
240
  if ( ! defined( 'WOOCOMMERCE_DHL_VERSION' ) ) {
241
  $this->add_hookable(
242
- new \Flexible_Shipping_Contextual_Info(
243
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
244
  'dhl',
245
  $phrases_in,
@@ -260,7 +296,7 @@ class Creator implements HookableCollection {
260
  private function create_pwr_contextual_info( array $phrases_in ) {
261
  if ( ! defined( 'WOOCOMMERCE_PACZKA_W_RUCHU_VERSION' ) ) {
262
  $this->add_hookable(
263
- new \Flexible_Shipping_Contextual_Info(
264
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
265
  'pwr',
266
  $phrases_in,
@@ -281,7 +317,7 @@ class Creator implements HookableCollection {
281
  private function create_inpost_contextual_info( array $phrases_in ) {
282
  if ( ! defined( 'WOOCOMMERCE_PACZKOMATY_INPOST_VERSION' ) ) {
283
  $this->add_hookable(
284
- new \Flexible_Shipping_Contextual_Info(
285
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
286
  'inpost',
287
  $phrases_in,
@@ -302,7 +338,7 @@ class Creator implements HookableCollection {
302
  private function create_dpd_uk_contextual_info( array $phrases_in ) {
303
  if ( ! defined( 'WOOCOMMERCE_DPD_UK_VERSION' ) ) {
304
  $this->add_hookable(
305
- new \Flexible_Shipping_Contextual_Info(
306
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
307
  'inpost',
308
  $phrases_in,
@@ -324,7 +360,7 @@ class Creator implements HookableCollection {
324
  */
325
  private function create_default_contextual_info( array $phrases_not_in ) {
326
  $this->add_hookable(
327
- new \Flexible_Shipping_Contextual_Info(
328
  self::METHOD_TITLE_ELEMENT,
329
  'other',
330
  [],
@@ -355,7 +391,7 @@ class Creator implements HookableCollection {
355
  ' &rarr;</a>'
356
  );
357
  } else {
358
- return __( 'Check our further shipping integration with FedEx / UPS live rates plugins.', 'flexible-shipping' ) . '&nbsp;&nbsp;' .
359
  sprintf(
360
  // Translators: link.
361
  __( '%1$sAdd integration%2$s', 'flexible-shipping' ),
7
 
8
  namespace WPDesk\FS\TableRate\ContextualInfo;
9
 
10
+ use Flexible_Shipping_Contextual_Info;
11
  use FSVendor\WPDesk\PluginBuilder\Plugin\HookableCollection;
12
+ use FSVendor\WPDesk\PluginBuilder\Plugin\HookableParent;
13
 
14
  /**
15
  * Can create contextual info.
16
  */
17
  class Creator implements HookableCollection {
18
 
19
+ use HookableParent;
20
 
21
+ const METHOD_TITLE_ELEMENT = 'woocommerce_flexible_shipping_method_title';
22
  const METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS = 'woocommerce_flexible_shipping_method_title,woocommerce_flexible_shipping_method_description';
23
 
24
  /**
84
  $phrases_in = [ 'air', 'dpd' ];
85
  $this->create_dpd_uk_contextual_info( $phrases_in );
86
  $other_phrases_not_in = $this->merge_phrases( $other_phrases_not_in, $phrases_in );
87
+ } elseif ( $this->is_base_location_country_us() ) {
88
+ $phrases_in = [ 'usps' ];
89
+ $this->create_usps_contextual_info( $phrases_in );
90
+ $other_phrases_not_in = $this->merge_phrases( $other_phrases_not_in, $phrases_in );
91
  }
92
 
93
  $this->create_default_contextual_info( $other_phrases_not_in );
111
  return 'PL' === $this->base_location_country;
112
  }
113
 
114
+ /**
115
+ * @return bool
116
+ */
117
+ private function is_base_location_country_us() {
118
+ return stripos( $this->base_location_country, 'US' ) !== false;
119
+ }
120
+
121
  /**
122
  * @return bool
123
  */
141
  private function create_dhl_express_contextual_info( array $phrases_in ) {
142
  if ( ! defined( 'FLEXIBLE_SHIPPING_DHL_EXPRESS_VERSION' ) && ! defined( 'FLEXIBLE_SHIPPING_DHL_EXPRESS_PRO_VERSION' ) ) {
143
  $this->add_hookable(
144
+ new Flexible_Shipping_Contextual_Info(
145
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
146
  'dhl_express',
147
  $phrases_in,
165
  ? 'https://www.wpdesk.pl/sklep/fedex-woocommerce/?utm_source=flexible-shipping-method-fedex&utm_medium=button&utm_campaign=flexible-shipping-integrations'
166
  : 'https://flexibleshipping.com/products/flexible-shipping-fedex-pro/?utm_source=flexible-shipping-method-fedex&utm_medium=button&utm_campaign=flexible-shipping-integrations';
167
  $this->add_hookable(
168
+ new Flexible_Shipping_Contextual_Info(
169
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
170
  'fedex',
171
  $phrases_in,
189
  ? 'https://www.wpdesk.pl/sklep/ups-woocommerce-etykiety-nadawcze-i-sledzenie-przesylek/?utm_source=flexible-shipping-method-ups&utm_medium=button&utm_campaign=flexible-shipping-integrations'
190
  : 'https://flexibleshipping.com/products/flexible-shipping-ups-labels/?utm_source=flexible-shipping-method-ups&utm_medium=button&utm_campaign=flexible-shipping-integrations';
191
  $this->add_hookable(
192
+ new Flexible_Shipping_Contextual_Info(
193
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
194
  'ups',
195
  $phrases_in,
204
  }
205
  }
206
 
207
+ /**
208
+ * @param array $phrases_in .
209
+ */
210
+ private function create_usps_contextual_info( array $phrases_in ) {
211
+ if ( ! defined( 'FLEXIBLE_SHIPPING_USPS_PRO_VERSION' ) ) {
212
+ $target_url = 'https://flexibleshipping.com/products/usps-woocommerce-live-rates-pro/?utm_source=usps-pro&utm_medium=button&utm_campaign=flexible-shipping-integrations';
213
+
214
+ $this->add_hookable(
215
+ new Flexible_Shipping_Contextual_Info(
216
+ self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
217
+ 'usps',
218
+ $phrases_in,
219
+ sprintf(
220
+ // Translators: link.
221
+ __( 'Want to show your customers the USPS live rates? %1$sCheck our USPS plugin →%2$s', 'flexible-shipping' ),
222
+ '<a class="button button-primary" href="' . esc_url( $target_url ) . '" target="_blank">',
223
+ '</a>'
224
+ )
225
+ )
226
+ );
227
+ }
228
+ }
229
+
230
  /**
231
  * @param array $phrases_in .
232
  */
233
  private function create_dpd_contextual_info( array $phrases_in ) {
234
  if ( ! defined( 'WOOCOMMERCE_DPD_VERSION' ) ) {
235
  $this->add_hookable(
236
+ new Flexible_Shipping_Contextual_Info(
237
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
238
  'dpd',
239
  $phrases_in,
254
  private function create_enadawca_contextual_info( array $phrases_in ) {
255
  if ( ! defined( 'WOOCOMMERCE_ENADAWCA_VERSION' ) ) {
256
  $this->add_hookable(
257
+ new Flexible_Shipping_Contextual_Info(
258
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
259
  'enadawca',
260
  $phrases_in,
275
  private function create_dhl_contextual_info( array $phrases_in ) {
276
  if ( ! defined( 'WOOCOMMERCE_DHL_VERSION' ) ) {
277
  $this->add_hookable(
278
+ new Flexible_Shipping_Contextual_Info(
279
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
280
  'dhl',
281
  $phrases_in,
296
  private function create_pwr_contextual_info( array $phrases_in ) {
297
  if ( ! defined( 'WOOCOMMERCE_PACZKA_W_RUCHU_VERSION' ) ) {
298
  $this->add_hookable(
299
+ new Flexible_Shipping_Contextual_Info(
300
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
301
  'pwr',
302
  $phrases_in,
317
  private function create_inpost_contextual_info( array $phrases_in ) {
318
  if ( ! defined( 'WOOCOMMERCE_PACZKOMATY_INPOST_VERSION' ) ) {
319
  $this->add_hookable(
320
+ new Flexible_Shipping_Contextual_Info(
321
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
322
  'inpost',
323
  $phrases_in,
338
  private function create_dpd_uk_contextual_info( array $phrases_in ) {
339
  if ( ! defined( 'WOOCOMMERCE_DPD_UK_VERSION' ) ) {
340
  $this->add_hookable(
341
+ new Flexible_Shipping_Contextual_Info(
342
  self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS,
343
  'inpost',
344
  $phrases_in,
360
  */
361
  private function create_default_contextual_info( array $phrases_not_in ) {
362
  $this->add_hookable(
363
+ new Flexible_Shipping_Contextual_Info(
364
  self::METHOD_TITLE_ELEMENT,
365
  'other',
366
  [],
391
  ' &rarr;</a>'
392
  );
393
  } else {
394
+ return __( 'Check our further shipping integration with FedEx / UPS / USPS live rates plugins.', 'flexible-shipping' ) . '&nbsp;&nbsp;' .
395
  sprintf(
396
  // Translators: link.
397
  __( '%1$sAdd integration%2$s', 'flexible-shipping' ),
src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerClickedOption.php DELETED
@@ -1,72 +0,0 @@
1
- <?php
2
- /**
3
- * Rules banner clicked option.
4
- *
5
- * @package WPDesk\FS\TableRate\NewRulesTableBanner
6
- */
7
-
8
- namespace WPDesk\FS\TableRate\NewRulesTableBanner;
9
-
10
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
- use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
12
-
13
- /**
14
- * Can update option when banner is clicked.
15
- */
16
- class RulesBannerClickedOption implements Hookable {
17
-
18
- const OPTION_NAME = 'flexible_shipping_new_rules_banner_clicked';
19
-
20
- /**
21
- * Hooks.
22
- */
23
- public function hooks() {
24
- if ( current_user_can( 'manage_woocommerce' )
25
- && $this->has_parameter_value_in_get( 'page', 'wc-settings' )
26
- && $this->has_parameter_value_in_get( 'tab', 'shipping' )
27
- && $this->is_parameter_present_in_get( 'instance_id' )
28
- && $this->is_parameter_present_in_get( 'method_id' )
29
- && $this->is_parameter_present_in_get( 'new_rules_table' )
30
- ) {
31
- add_action( 'admin_init', array( $this, 'set_option' ) );
32
- }
33
- }
34
-
35
- /**
36
- * @param string $parameter .
37
- *
38
- * @return bool
39
- */
40
- private function is_parameter_present_in_get( $parameter ) {
41
- return isset( $_GET[ $parameter ] );
42
- }
43
-
44
- /**
45
- * @param string $parameter .
46
- * @param string $parameter_value .
47
- *
48
- * @return bool
49
- */
50
- private function has_parameter_value_in_get( $parameter, $parameter_value ) {
51
- return isset( $_GET[ $parameter ] ) && $_GET[ $parameter ] === $parameter_value;
52
- }
53
-
54
- /**
55
- * Set option.
56
- *
57
- * @internal
58
- */
59
- public function set_option() {
60
- update_option( self::OPTION_NAME, '1' );
61
- }
62
-
63
- /**
64
- * Checks if option is set.
65
- *
66
- * @return bool Option status.
67
- */
68
- public static function is_option_set() {
69
- return 1 === intval( get_option( self::OPTION_NAME, '0' ) );
70
- }
71
-
72
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerDontLikeOption.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * Rules banner dont like option.
4
- *
5
- * @package WPDesk\FS\TableRate\NewRulesTableBanner
6
- */
7
-
8
- namespace WPDesk\FS\TableRate\NewRulesTableBanner;
9
-
10
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
- use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
12
-
13
- /**
14
- * Can update option when dont like is clicked.
15
- */
16
- class RulesBannerDontLikeOption extends RulesBannerLikeOption {
17
-
18
- const OPTION_NAME = 'flexible_shipping_new_rules_dont_like';
19
-
20
- const AJAX_ACTION = 'flexible_shipping_new_rules_dont_like';
21
-
22
- /**
23
- * Handle AJAX request.
24
- *
25
- * @internal
26
- */
27
- public function handle_ajax_request() {
28
- check_ajax_referer( static::AJAX_ACTION, self::NONCE_PARAMETER );
29
- $this->update_shipping_method_settings();
30
- update_option( static::OPTION_NAME, '1' );
31
- }
32
-
33
- /**
34
- * Update shipping method settings.
35
- */
36
- private function update_shipping_method_settings() {
37
- ShippingMethodNewRuleTableSetting::disable_option();
38
- }
39
-
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerLikeOption.php DELETED
@@ -1,54 +0,0 @@
1
- <?php
2
- /**
3
- * Rules banner like option.
4
- *
5
- * @package WPDesk\FS\TableRate\NewRulesTableBanner
6
- */
7
-
8
- namespace WPDesk\FS\TableRate\NewRulesTableBanner;
9
-
10
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
- use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
12
-
13
- /**
14
- * Can update option when banner like is clicked.
15
- */
16
- class RulesBannerLikeOption implements Hookable {
17
-
18
- const OPTION_NAME = 'flexible_shipping_new_rules_like';
19
-
20
- const AJAX_ACTION = 'flexible_shipping_new_rules_like';
21
-
22
- const NONCE_PARAMETER = 'security';
23
-
24
- const SHIPPING_METHOD_SETTINGS_OPTION = 'woocommerce_flexible_shipping_info_settings';
25
-
26
- const PRIORITY_FIRST = 1;
27
-
28
- /**
29
- * Hooks.
30
- */
31
- public function hooks() {
32
- add_action( 'wp_ajax_' . static::AJAX_ACTION, array( $this, 'handle_ajax_request' ) );
33
- }
34
-
35
- /**
36
- * Handle AJAX request.
37
- *
38
- * @internal
39
- */
40
- public function handle_ajax_request() {
41
- check_ajax_referer( static::AJAX_ACTION, self::NONCE_PARAMETER );
42
- update_option( static::OPTION_NAME, '1' );
43
- }
44
-
45
- /**
46
- * Checks if pointer is active.
47
- *
48
- * @return bool Option status.
49
- */
50
- public static function is_option_set() {
51
- return 1 === intval( get_option( static::OPTION_NAME, '0' ) );
52
- }
53
-
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesPointerBanner.php DELETED
@@ -1,71 +0,0 @@
1
- <?php
2
- /**
3
- * Rules pointer banner.
4
- *
5
- * @package WPDesk\FS\TableRate\NewRulesTableBanner
6
- */
7
-
8
- namespace WPDesk\FS\TableRate\NewRulesTableBanner;
9
-
10
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
- use FSVendor\WPDesk\Pointer\PointerConditions;
12
- use FSVendor\WPDesk\Pointer\PointerMessage;
13
- use FSVendor\WPDesk\Pointer\PointerPosition;
14
- use FSVendor\WPDesk\Pointer\PointersScripts;
15
- use FSVendor\WPDesk\View\Renderer\SimplePhpRenderer;
16
- use FSVendor\WPDesk\View\Resolver\DirResolver;
17
- use WPDesk\FS\Helpers\ShippingMethod;
18
-
19
- /**
20
- * Can display new rules pointer banner.
21
- */
22
- abstract class RulesPointerBanner implements Hookable {
23
-
24
- const NEW_RULES_TABLE_PARAMETER = 'new_rules_table';
25
-
26
- const TRIGGER = 'new-rules-table-feedback';
27
-
28
- /**
29
- * Hooks.
30
- */
31
- public function hooks() {
32
- add_action( 'flexible_shipping_method_script', array( $this, 'add_new_rules_banner_script' ) );
33
- }
34
-
35
- /**
36
- * Should show banner?
37
- *
38
- * @return bool
39
- */
40
- abstract protected function should_show_banner();
41
-
42
- /**
43
- * Get banner file.
44
- *
45
- * @return string
46
- */
47
- abstract protected function get_banner_file();
48
-
49
- /**
50
- * Add pointer messages if it should be visible.
51
- *
52
- * @internal
53
- */
54
- public function add_new_rules_banner_script() {
55
- if ( ! $this->should_show_banner() ) {
56
- return;
57
- }
58
-
59
- $this->add_script();
60
- }
61
-
62
- /**
63
- * Creates pointer message.
64
- */
65
- private function add_script() {
66
- $banner_file = $this->get_banner_file();
67
- $trigger = self::TRIGGER;
68
- include __DIR__ . '/views/html-new-rules-table-script.php';
69
- }
70
-
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesPointerBannerForNewTable.php DELETED
@@ -1,48 +0,0 @@
1
- <?php
2
- /**
3
- * Rules pointer banner for new rules table.
4
- *
5
- * @package WPDesk\FS\TableRate\NewRulesTableBanner
6
- */
7
-
8
- namespace WPDesk\FS\TableRate\NewRulesTableBanner;
9
-
10
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
- use FSVendor\WPDesk\Pointer\PointerConditions;
12
- use FSVendor\WPDesk\Pointer\PointerMessage;
13
- use FSVendor\WPDesk\Pointer\PointerPosition;
14
- use FSVendor\WPDesk\Pointer\PointersScripts;
15
- use FSVendor\WPDesk\View\Renderer\SimplePhpRenderer;
16
- use FSVendor\WPDesk\View\Resolver\DirResolver;
17
- use WPDesk\FS\Helpers\ShippingMethod;
18
- use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
19
-
20
- /**
21
- * Can display new rules pointer banner on new rules table.
22
- */
23
- class RulesPointerBannerForNewTable extends RulesPointerBanner {
24
-
25
- /**
26
- * @return string
27
- */
28
- protected function get_banner_file() {
29
- return __DIR__ . '/views/html-new-rules-table-banner-for-new-table.php';
30
- }
31
-
32
- /**
33
- * Should show pointer.
34
- */
35
- protected function should_show_banner() {
36
- $new_rule_table_setting = new ShippingMethodNewRuleTableSetting();
37
- if ( $new_rule_table_setting->is_enabled() && ! RulesBannerLikeOption::is_option_set() && ! RulesBannerDontLikeOption::is_option_set()
38
- && ! wpdesk_is_plugin_active( 'flexible-shipping-pro/flexible-shipping-pro.php' )
39
- && ! wpdesk_is_plugin_active( 'flexible-shipping-locations/flexible-shipping-locations.php' )
40
- ) {
41
- return true;
42
- }
43
-
44
- return false;
45
- }
46
-
47
-
48
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesPointerBannerForOldTable.php DELETED
@@ -1,54 +0,0 @@
1
- <?php
2
- /**
3
- * Rules pointer banner.
4
- *
5
- * @package WPDesk\FS\TableRate\NewRulesTableBanner
6
- */
7
-
8
- namespace WPDesk\FS\TableRate\NewRulesTableBanner;
9
-
10
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
- use FSVendor\WPDesk\Pointer\PointerConditions;
12
- use FSVendor\WPDesk\Pointer\PointerMessage;
13
- use FSVendor\WPDesk\Pointer\PointerPosition;
14
- use FSVendor\WPDesk\Pointer\PointersScripts;
15
- use FSVendor\WPDesk\View\Renderer\SimplePhpRenderer;
16
- use FSVendor\WPDesk\View\Resolver\DirResolver;
17
- use WPDesk\FS\Helpers\ShippingMethod;
18
- use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
19
-
20
- /**
21
- * Can display new rules pointer banner.
22
- */
23
- class RulesPointerBannerForOldTable extends RulesPointerBanner {
24
-
25
- /**
26
- * @return string
27
- */
28
- protected function get_banner_file() {
29
- return __DIR__ . '/views/html-new-rules-table-banner.php';
30
- }
31
-
32
- /**
33
- * Should show pointer.
34
- *
35
- * @return bool
36
- */
37
- protected function should_show_banner() {
38
- $new_rule_table_setting = new ShippingMethodNewRuleTableSetting();
39
- if ( ! isset( $_GET['method_id'] )
40
- || $new_rule_table_setting->is_enabled()
41
- || RulesBannerLikeOption::is_option_set()
42
- || RulesBannerDontLikeOption::is_option_set()
43
- || ! ( new \FSVendor\WPDesk_Tracker_Persistence_Consent() )->is_active()
44
- || wpdesk_is_plugin_active( 'flexible-shipping-pro/flexible-shipping-pro.php' )
45
- || ! ShippingMethod::check_if_method_exists_in_zones( 'flexible_shipping' )
46
- || isset( $_GET[ self::NEW_RULES_TABLE_PARAMETER ] )
47
- ) {
48
- return false;
49
- }
50
-
51
- return true;
52
- }
53
-
54
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner-for-new-table.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- /**
3
- * @package WPDesk\FS\TableRate\NewRulesTableBanner
4
- */
5
-
6
- ?><tr valign="top">
7
- <td colspan="2" style="padding:0;">
8
- <p>
9
- <table id="fs_new_rules_table_banner_for_new_table" class="widefat">
10
- <thead><tr><td>
11
- <h2><span style = "margin-right: 12px; color: #007cba;" class = "dashicons dashicons-admin-appearance"></span><?php echo esc_html( __( 'The new table interface has been activated', 'flexible-shipping' ) ); ?></h2>
12
- <p><?php echo esc_html( __( 'We are very curious about your opinion on the new table design. With the buttons below you can choose which interface you want to use from now on.', 'flexible-shipping' ) ); ?></p>
13
- <br />
14
- <button class="button button-primary i-like-it" ><span style = "margin-right: 8px; color: #fff; margin-top: 3px;" class = "dashicons dashicons-thumbs-up"></span> <?php echo esc_html( __( 'I like it and want to use the new interface', 'flexible-shipping' ) ); ?></button>
15
- <button class="button i-dont-like-it"><span style = "margin-right: 8px; color: # 007cba; margin-top: 4px; " class = "dashicons dashicons-thumbs-down"> </span> <?php echo esc_html( __( 'I don\'t like it, keep using the old one', 'flexible-shipping' ) ); ?></button>
16
- </td></tr></thead>
17
- </table>
18
- </p><br/>
19
- </td>
20
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-banner.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- /**
3
- * @package WPDesk\FS\TableRate\NewRulesTableBanner
4
- */
5
-
6
- ?><tr valign="top">
7
- <td colspan="2" style="padding:0;">
8
- <p>
9
- <table id="fs_new_rules_table_banner" class="widefat">
10
- <thead><tr><td>
11
- <h2><span style="margin-right: 12px;color: #007cba;" class="dashicons dashicons-admin-appearance"></span><?php echo esc_html( __( 'Hey, we are changing for you! Let us introduce you a completely new table interface!', 'flexible-shipping' ) ); ?></h2>
12
- <p><?php echo esc_html( __( 'We are constantly developing our plugin to make it more intuitive, user-friendly and approachable at the same time. Therefore, we have designed a completely new table interface which will make it easier to create your own rules and configure the whole shipping.', 'flexible-shipping' ) ); ?></p>
13
- <p><strong><?php echo esc_html( __( 'Can we count on you?', 'flexible-shipping' ) ); ?></strong> <?php echo esc_html( __( 'Your opinion is very important to us and will help us to adapt Flexible Shipping plugin to your needs even better.', 'flexible-shipping' ) ); ?></p>
14
- <br />
15
- <button class="button button-primary show-new-rules-table"><?php echo esc_html( __( 'Check the new interface', 'flexible-shipping' ) ); ?></button>
16
- </td></tr></thead>
17
- </table>
18
- </p><br/>
19
- </td>
20
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTableBanner/views/html-new-rules-table-script.php DELETED
@@ -1,73 +0,0 @@
1
- <?php
2
- /**
3
- * @var string $banner_file
4
- * @var string $trigger
5
- *
6
- * @package WPDesk\FS\TableRate\NewRulesTableBanner
7
- */
8
-
9
- ?><script type="text/javascript">
10
- jQuery(document).ready(function () {
11
-
12
- var trigger = '<?php echo esc_attr( $trigger ); ?>';
13
-
14
- jQuery(".flexible_shipping_method_rules:first").after(<?php
15
- ob_start();
16
- include $banner_file;
17
- $banner = ob_get_clean();
18
- echo json_encode( $banner );
19
- ?>
20
- );
21
-
22
- if (jQuery('#fs_new_rules_table_banner_for_new_table').length) {
23
- jQuery("body,html").animate(
24
- {
25
- scrollTop: jQuery("#fs_new_rules_table_banner_for_new_table").offset().top
26
- },
27
- 800 //speed
28
- );
29
- }
30
-
31
- jQuery(document).on('click', '#fs_new_rules_table_banner button.show-new-rules-table', function (e) {
32
- e.preventDefault();
33
- window.open('<?php echo admin_url( 'admin.php?page=wc-settings&tab=shipping&instance_id=' . sanitize_key( $_GET['instance_id'] ) . '&method_id=' . isset( $_GET['method_id'] ) ? sanitize_key( $_GET['method_id'] ) : '' . '&action=edit&' . \WPDesk\FS\TableRate\NewRulesTableBanner\RulesPointerBannerForOldTable::NEW_RULES_TABLE_PARAMETER . '=1' ); ?>');
34
- });
35
-
36
- jQuery(document).on('click', '#fs_new_rules_table_banner_for_new_table button.i-like-it', function (e) {
37
- e.preventDefault();
38
- jQuery(this).attr('disabled', 'disabled');
39
- jQuery('#fs_new_rules_table_banner_for_new_table button.i-dont-like-it').attr('disabled', 'disabled');
40
-
41
- jQuery.ajax({
42
- url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
43
- type: 'POST',
44
- data: {
45
- action: '<?php echo \WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerLikeOption::AJAX_ACTION; ?>',
46
- security: '<?php echo wp_create_nonce( \WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerLikeOption::AJAX_ACTION ); ?>'
47
- },
48
- success: function (response) {
49
- jQuery('#fs_new_rules_table_banner_for_new_table').closest('tr').remove();
50
- }
51
- });
52
- });
53
-
54
- jQuery(document).on('click', '#fs_new_rules_table_banner_for_new_table button.i-dont-like-it', function (e) {
55
- e.preventDefault();
56
- jQuery(this).attr('disabled', 'disabled');
57
- jQuery('#fs_new_rules_table_banner_for_new_table button.i-like-it').attr('disabled', 'disabled');
58
-
59
- jQuery.ajax({
60
- url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
61
- type: 'POST',
62
- data: {
63
- action: '<?php echo \WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerDontLikeOption::AJAX_ACTION; ?>',
64
- security: '<?php echo wp_create_nonce( \WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerDontLikeOption::AJAX_ACTION ); ?>'
65
- },
66
- success: function (response) {
67
- window.location.reload();
68
- }
69
- });
70
- });
71
-
72
- });
73
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTableDeactivationTracker.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- /**
3
- * Decativation tracker data.
4
- *
5
- * @package WPDesk\FS\TableRate
6
- */
7
-
8
- namespace WPDesk\FS\TableRate;
9
-
10
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
- use WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerClickedOption;
12
- use WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerDontLikeOption;
13
- use WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerLikeOption;
14
- use WPDesk\FS\TableRate\NewRulesTablePointer\RulesPointerOption;
15
- use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
16
-
17
- /**
18
- * Can add new rates table data to deactivation tracker data.
19
- */
20
- class NewRulesTableDeactivationTracker implements Hookable {
21
-
22
- const ADDITIONAL_DATA = 'additional_data';
23
-
24
- /**
25
- * Hooks.
26
- */
27
- public function hooks() {
28
- add_filter( 'wpdesk_tracker_deactivation_data', array( $this, 'append_new_rules_table_data_to_deactivation_tracker' ) );
29
- }
30
-
31
- /**
32
- * Set new rules table data to data array.
33
- *
34
- * @param array $data Data.
35
- *
36
- * @return array
37
- */
38
- public function append_new_rules_table_data_to_deactivation_tracker( array $data ) {
39
- if ( empty( $data[ self::ADDITIONAL_DATA ] ) || ! is_array( $data[ self::ADDITIONAL_DATA ] ) ) {
40
- $data[ self::ADDITIONAL_DATA ] = array();
41
- }
42
- $data[ self::ADDITIONAL_DATA ]['fs_new_rules_table_v4'] = ( new NewRulesTableTrackerData() )->get_data();
43
-
44
- return $data;
45
- }
46
-
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTablePointer/ShippingMethodNewRuleTableSetting.php DELETED
@@ -1,134 +0,0 @@
1
- <?php
2
- /**
3
- * Shipping method settings option.
4
- *
5
- * @package WPDesk\FS\TableRate\NewRulesTablePointer
6
- */
7
-
8
- namespace WPDesk\FS\TableRate\NewRulesTablePointer;
9
-
10
- use WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerClickedOption;
11
-
12
- /**
13
- * Can add option to shipping method settings.
14
- */
15
- class ShippingMethodNewRuleTableSetting {
16
-
17
- const TRIGGER = 'new-rules-table';
18
-
19
- const SETTINGS_OPTION = 'enable_new_rules_table';
20
-
21
- const SHIPPING_METHOD_SETTINGS_OPTION = 'woocommerce_flexible_shipping_info_settings';
22
-
23
- const OPTION_NEW_RULES_DISABLED = 'flexible_shipping_new_rules_was_disabled';
24
-
25
- const VALUE_NO = 'no';
26
- const VALUE_YES = 'yes';
27
-
28
- /**
29
- * @return bool
30
- */
31
- private function should_add_field_to_settings() {
32
- return ! wpdesk_is_plugin_active( 'flexible-shipping-pro/flexible-shipping-pro.php' )
33
- && ! wpdesk_is_plugin_active( 'flexible-shipping-locations/flexible-shipping-locations.php' );
34
- }
35
-
36
- /**
37
- * Add fields to settings.
38
- *
39
- * @param array $settings Settings.
40
- *
41
- * @return array
42
- */
43
- public function add_fields_to_settings( array $settings ) {
44
- if ( $this->should_add_field_to_settings() ) {
45
- $settings[ self::SETTINGS_OPTION ] = array(
46
- 'type' => 'checkbox',
47
- 'label' => __( 'Enable New Table Interface', 'flexible-shipping' ),
48
- 'title' => __( 'Rules table', 'flexible-shipping' ),
49
- );
50
- }
51
- return $settings;
52
- }
53
-
54
- /**
55
- * Is new rules table enabled?
56
- *
57
- * @return bool
58
- */
59
- public function is_enabled() {
60
- $settings = get_option( self::SHIPPING_METHOD_SETTINGS_OPTION, array() );
61
- return isset( $settings[ self::SETTINGS_OPTION ] ) && self::VALUE_YES === $settings[ self::SETTINGS_OPTION ];
62
- }
63
-
64
- /**
65
- * Adds action to watch option update.
66
- */
67
- public function watch_settings_change() {
68
- add_action( 'update_option_' . self::SHIPPING_METHOD_SETTINGS_OPTION, array( $this, 'update_option_if_settings_changed' ), 10, 3 );
69
- }
70
-
71
- /**
72
- * .
73
- *
74
- * @param array $old_value .
75
- * @param array $new_value .
76
- * @param string $option .
77
- */
78
- public function update_option_if_settings_changed( $old_value, $new_value, $option ) {
79
- $old_option_value = self::VALUE_NO;
80
- $new_option_value = self::VALUE_NO;
81
- if ( is_array( $old_value ) && is_array( $new_value ) ) {
82
- if ( isset( $old_value[ self::SETTINGS_OPTION ] ) ) {
83
- $old_option_value = $old_value[ self::SETTINGS_OPTION ];
84
- }
85
- if ( isset( $new_value[ self::SETTINGS_OPTION ] ) ) {
86
- $new_option_value = $new_value[ self::SETTINGS_OPTION ];
87
- }
88
- }
89
- if ( self::VALUE_YES === $old_option_value && self::VALUE_NO === $new_option_value ) {
90
- update_option( self::OPTION_NEW_RULES_DISABLED, '1' );
91
- }
92
- }
93
-
94
- /**
95
- * Display settings JavaScript.
96
- */
97
- public function settings_script() {
98
- return;
99
- if ( ! RulesPointerOption::is_option_set() ) {
100
- return;
101
- }
102
-
103
- $trigger = self::TRIGGER;
104
- include __DIR__ . '/views/html-flexible-shipping-settings-script.php';
105
- }
106
-
107
- /**
108
- * Checks if pointer was turned off.
109
- *
110
- * @return bool Option status.
111
- */
112
- public static function was_option_disabled() {
113
- return 1 === intval( get_option( self::OPTION_NEW_RULES_DISABLED, '0' ) );
114
- }
115
-
116
- /**
117
- * Enable option.
118
- */
119
- public static function enable_option() {
120
- $shipping_method_settings = get_option( self::SHIPPING_METHOD_SETTINGS_OPTION, array() );
121
- $shipping_method_settings[ self::SETTINGS_OPTION ] = 'yes';
122
- update_option( self::SHIPPING_METHOD_SETTINGS_OPTION, $shipping_method_settings );
123
- }
124
-
125
- /**
126
- * Enable option.
127
- */
128
- public static function disable_option() {
129
- $shipping_method_settings = get_option( self::SHIPPING_METHOD_SETTINGS_OPTION, array() );
130
- $shipping_method_settings[ self::SETTINGS_OPTION ] = 'no';
131
- update_option( self::SHIPPING_METHOD_SETTINGS_OPTION, $shipping_method_settings );
132
- }
133
-
134
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php DELETED
@@ -1,152 +0,0 @@
1
- <?php
2
- /**
3
- * Class Assets
4
- *
5
- * @package WPDesk\FS\TableRate\NewRulesTablePopup
6
- */
7
-
8
- namespace WPDesk\FS\TableRate\NewRulesTablePopup;
9
-
10
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
- use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
12
-
13
- /**
14
- * Can enqueue assets for new rules table popup.
15
- */
16
- class Assets implements Hookable {
17
-
18
- /**
19
- * @var string
20
- */
21
- private $assets_url;
22
-
23
- /**
24
- * @var string
25
- */
26
- private $scripts_version;
27
-
28
- /**
29
- * @var ShippingMethodNewRuleTableSetting
30
- */
31
- private $new_rule_table_setting;
32
-
33
- /**
34
- * @var NewRulesPopupClickedOption
35
- */
36
- private $option_clicked;
37
-
38
- /**
39
- * Assets constructor.
40
- *
41
- * @param string $assets_url .
42
- * @param string $scripts_version .
43
- * @param ShippingMethodNewRuleTableSetting $new_rule_table_setting .
44
- * @param NewRulesPopupClickedOption $option_clicked .
45
- */
46
- public function __construct(
47
- $assets_url,
48
- $scripts_version,
49
- ShippingMethodNewRuleTableSetting $new_rule_table_setting,
50
- NewRulesPopupClickedOption $option_clicked
51
- ) {
52
- $this->assets_url = $assets_url;
53
- $this->scripts_version = $scripts_version;
54
- $this->new_rule_table_setting = $new_rule_table_setting;
55
- $this->option_clicked = $option_clicked;
56
- }
57
-
58
- /**
59
- * Hooks.
60
- */
61
- public function hooks() {
62
- if ( ! wpdesk_is_plugin_active( 'flexible-shipping-pro/flexible-shipping-pro.php' )
63
- && ! wpdesk_is_plugin_active( 'flexible-shipping-locations/flexible-shipping-locations.php' )
64
- && ! $this->new_rule_table_setting->is_enabled()
65
- && ! $this->option_clicked->get_option_value()
66
- && ( new \FSVendor\WPDesk_Tracker_Persistence_Consent() )->is_active()
67
- ) {
68
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
69
- }
70
- }
71
-
72
- /**
73
- * Enqueue scripts.
74
- */
75
- public function enqueue_scripts() {
76
- if ( $this->is_flexible_shipping_method_settings_page() ) {
77
- $handle = 'fs-nrt-popup';
78
- wp_register_script(
79
- $handle,
80
- trailingslashit( $this->assets_url ) . 'js/new-rules-table-popup.js',
81
- array(),
82
- $this->scripts_version
83
- );
84
- wp_localize_script(
85
- $handle,
86
- 'fs_new_rules_table_popup_properties',
87
- array(
88
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
89
- 'nonce' => wp_create_nonce( NewRulesPopupClickedOptionAjaxUpdater::NONCE_ACTION ),
90
- 'assets_url' => untrailingslashit( $this->assets_url ),
91
- 'ajax_action_ok' => NewRulesPopupClickedOptionAjaxUpdater::AJAX_ACTION_OK,
92
- 'ajax_action_cancel' => NewRulesPopupClickedOptionAjaxUpdater::AJAX_ACTION_CANCEL,
93
- // Translators: html tags.
94
- 'title' => sprintf( __( 'We are introducing a completely %1$snew table interface!%2$s', 'flexible-shipping' ), '<span>', '</span>' ),
95
- 'logo_img' => 'logo-fs@2x.png',
96
- 'whats_new' => __( 'What\'s new?', 'flexible-shipping' ),
97
- 'ok_button' => __( 'Give it a try!', 'flexible-shipping' ),
98
- 'ok_button_url' => admin_url( 'admin.php?page=wc-settings&tab=shipping&instance_id=' . sanitize_key( isset( $_GET['instance_id'] ) ? $_GET['instance_id'] : '' ) . '&method_id=' . sanitize_key( isset( $_GET['method_id'] ) ? $_GET['method_id'] : '' ) . '&action=edit&' . NewRulesPopupClickedOption::OPTION_NAME . '=1' ),
99
- // phpcs:ignore
100
- 'cancel_button' => __( 'Keep the old version', 'flexible-shipping' ),
101
- 'sections' => array(
102
- array(
103
- 'image' => 'design@2x.png',
104
- 'heading' => __( 'Intuitive and clean design', 'flexible-shipping' ),
105
- 'text' => __( 'Everything kept as simple as possible. All the options just where you need them.', 'flexible-shipping' ),
106
- ),
107
- array(
108
- 'image' => 'configuration@2x.png',
109
- 'heading' => __( 'Easier configuration', 'flexible-shipping' ),
110
- 'text' => __( 'No more confusing setup. Make the shipping fit your needs within a few clicks.', 'flexible-shipping' ),
111
- ),
112
- array(
113
- 'image' => 'delivery@2x.png',
114
- 'heading' => __( 'Just set and go!', 'flexible-shipping' ),
115
- 'text' => __( 'Turn the plugin on, define the shipping cost calculation rules and let it do the rest!', 'flexible-shipping' ),
116
- ),
117
- ),
118
- )
119
- );
120
- wp_enqueue_script( $handle );
121
-
122
- wp_enqueue_style(
123
- $handle,
124
- trailingslashit( $this->assets_url ) . 'css/new-rules-table-popup.css',
125
- array(),
126
- $this->scripts_version
127
- );
128
- }
129
- }
130
-
131
- /**
132
- * @return bool
133
- */
134
- private function is_flexible_shipping_method_settings_page() {
135
- if ( isset( $_GET['method_id'] ) && isset( $_GET['instance_id'] ) ) { // phpcs:ignore
136
- $instance_id = sanitize_text_field( $_GET['instance_id'] ); // phpcs:ignore
137
- try {
138
- $shipping_method = \WC_Shipping_Zones::get_shipping_method( $instance_id );
139
- if ( $shipping_method && $shipping_method instanceof \WPDesk_Flexible_Shipping ) {
140
-
141
- return true;
142
- }
143
- } catch ( Exception $e ) {
144
-
145
- return false;
146
- }
147
- }
148
-
149
- return false;
150
- }
151
-
152
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTablePopup/NewRulesPopupClickedOption.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- /**
3
- * Popup clicked option.
4
- *
5
- * @package WPDesk\FS\TableRate\NewRulesTableBanner
6
- */
7
-
8
- namespace WPDesk\FS\TableRate\NewRulesTablePopup;
9
-
10
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
- use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
12
-
13
- /**
14
- * Can update option when popup is clicked.
15
- */
16
- class NewRulesPopupClickedOption {
17
-
18
- const OPTION_NAME = 'flexible_shipping_new_rules_popup_clicked';
19
-
20
- /**
21
- * Update option.
22
- *
23
- * @param string $option_value .
24
- */
25
- public function update_option( $option_value ) {
26
- update_option( self::OPTION_NAME, $option_value );
27
- }
28
-
29
- /**
30
- * Get option value.
31
- *
32
- * @return string|false
33
- */
34
- public function get_option_value() {
35
- return get_option( self::OPTION_NAME );
36
- }
37
-
38
- /**
39
- * Checks if option is set.
40
- *
41
- * @return bool Option status.
42
- */
43
- public static function is_option_set() {
44
- return false !== get_option( self::OPTION_NAME, false );
45
- }
46
-
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTablePopup/NewRulesPopupClickedOptionAjaxUpdater.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
- /**
3
- * Popup clicked option AJAX updater.
4
- *
5
- * @package WPDesk\FS\TableRate\NewRulesTableBanner
6
- */
7
-
8
- namespace WPDesk\FS\TableRate\NewRulesTablePopup;
9
-
10
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
- use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
12
-
13
- /**
14
- * Can update option when popup is clicked.
15
- */
16
- class NewRulesPopupClickedOptionAjaxUpdater implements Hookable {
17
-
18
- const NONCE_ACTION = 'flexible_shipping_nrt_popup_clicked';
19
- const AJAX_ACTION_OK = 'flexible_shipping_nrt_popup_ok_clicked';
20
- const AJAX_ACTION_CANCEL = 'flexible_shipping_nrt_popup_cancel_clicked';
21
-
22
- /**
23
- * @var NewRulesPopupClickedOption
24
- */
25
- private $option;
26
-
27
- /**
28
- * NewRulesPopupClickedOptionAjaxUpdater constructor.
29
- *
30
- * @param NewRulesPopupClickedOption $option .
31
- */
32
- public function __construct( NewRulesPopupClickedOption $option ) {
33
- $this->option = $option;
34
- }
35
-
36
- /**
37
- * Hooks.
38
- */
39
- public function hooks() {
40
- add_action( 'wp_ajax_' . self::AJAX_ACTION_OK, array( $this, 'handle_ajax_action_ok' ) );
41
- add_action( 'wp_ajax_' . self::AJAX_ACTION_CANCEL, array( $this, 'handle_ajax_action_cancel' ) );
42
- }
43
-
44
- /**
45
- * Handle AJAX action OK.
46
- *
47
- * @internal
48
- */
49
- public function handle_ajax_action_ok() {
50
- check_ajax_referer( self::NONCE_ACTION, 'nonce' );
51
- $this->option->update_option( 'ok' );
52
- ShippingMethodNewRuleTableSetting::enable_option();
53
- }
54
-
55
- /**
56
- * Handle AJAX action OK.
57
- *
58
- * @internal
59
- */
60
- public function handle_ajax_action_cancel() {
61
- check_ajax_referer( self::NONCE_ACTION, 'nonce' );
62
- $this->option->update_option( 'cancel' );
63
- }
64
-
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTableTracker.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- /**
3
- * Tracker data.
4
- *
5
- * @package WPDesk\FS\TableRate
6
- */
7
-
8
- namespace WPDesk\FS\TableRate;
9
-
10
- use FSVendor\WPDesk\PluginBuilder\Plugin\Hookable;
11
- use WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerClickedOption;
12
- use WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerDontLikeOption;
13
- use WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerLikeOption;
14
- use WPDesk\FS\TableRate\NewRulesTablePointer\RulesPointerOption;
15
- use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
16
-
17
- /**
18
- * Can add new rates table data to tracked data.
19
- */
20
- class NewRulesTableTracker implements Hookable {
21
-
22
- const PRIORITY_AFTER_FS_TRACKER = 12;
23
-
24
- /**
25
- * Hooks.
26
- */
27
- public function hooks() {
28
- add_filter( 'wpdesk_tracker_data', array( $this, 'append_new_rules_table_data_to_tracker' ), self::PRIORITY_AFTER_FS_TRACKER );
29
- }
30
-
31
- /**
32
- * Adds data to the tracker about New Table Interface.
33
- *
34
- * @param array $data Original data sent to tracker.
35
- *
36
- * @return array Updated $data array.
37
- */
38
- public function append_new_rules_table_data_to_tracker( $data ) {
39
- $data['flexible_shipping']['new_rules_table_v4'] = ( new NewRulesTableTrackerData() )->get_data();
40
-
41
- return $data;
42
- }
43
-
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/WPDesk/FS/TableRate/NewRulesTableTrackerData.php DELETED
@@ -1,109 +0,0 @@
1
- <?php
2
- /**
3
- * New Rules Table tracker data.
4
- *
5
- * @package WPDesk\FS\TableRate
6
- */
7
-
8
- namespace WPDesk\FS\TableRate;
9
-
10
- use WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerClickedOption;
11
- use WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerDontLikeOption;
12
- use WPDesk\FS\TableRate\NewRulesTableBanner\RulesBannerLikeOption;
13
- use WPDesk\FS\TableRate\NewRulesTablePointer\ShippingMethodNewRuleTableSetting;
14
- use WPDesk\FS\TableRate\NewRulesTablePopup\NewRulesPopupClickedOption;
15
-
16
- /**
17
- * Class NewRulesTableTrackerData
18
- */
19
- class NewRulesTableTrackerData {
20
-
21
- const NEW_USERS_AFTER_THIS_DATE = '2020-12-01 01:00:00';
22
-
23
- /**
24
- * If this a old user? If so then FS should work like always.
25
- *
26
- * @return bool
27
- */
28
- private function is_new_installation() {
29
- return strtotime( self::NEW_USERS_AFTER_THIS_DATE ) < $this->activation_date_according_to_wpdesk_helper();
30
- }
31
-
32
- /**
33
- * Activation date according to wpdesk helper.
34
- *
35
- * @return int Activation date timestamp.
36
- */
37
- private function activation_date_according_to_wpdesk_helper() {
38
- $option_name = 'plugin_activation_flexible-shipping/flexible-shipping.php';
39
- $activation_date = get_option( $option_name, current_time( 'mysql' ) );
40
-
41
- if ( ! $activation_date ) {
42
- return time();
43
- }
44
-
45
- return strtotime( $activation_date );
46
- }
47
-
48
- /**
49
- * Checks if new tables are activated.
50
- *
51
- * @return string Status "yes" for true or "no" for false.
52
- */
53
- private function get_new_rules_table_enabled() {
54
- $shipping_method_settings = get_option( ShippingMethodNewRuleTableSetting::SHIPPING_METHOD_SETTINGS_OPTION, array() );
55
- if ( isset( $shipping_method_settings[ ShippingMethodNewRuleTableSetting::SETTINGS_OPTION ] ) ) {
56
- return $shipping_method_settings[ ShippingMethodNewRuleTableSetting::SETTINGS_OPTION ];
57
- }
58
- return 'no';
59
- }
60
-
61
- /**
62
- * @return array
63
- */
64
- public function get_data() {
65
- $new_rules_table_data = array();
66
-
67
- $new_rules_table_data['new_installation'] = $this->is_new_installation() ? 'yes' : 'no';
68
- $new_rules_table_data['table_enabled'] = $this->get_new_rules_table_enabled();
69
- $new_rules_table_data['popup_clicked'] = $this->get_popup_clicked();
70
- $new_rules_table_data['like_clicked'] = RulesBannerLikeOption::is_option_set() ? 'yes' : 'no';
71
- $new_rules_table_data['dont_like_clicked'] = RulesBannerDontLikeOption::is_option_set() ? 'yes' : 'no';
72
- $new_rules_table_data['was_disabled'] = ShippingMethodNewRuleTableSetting::was_option_disabled() ? 'yes' : 'no';
73
-
74
- $user_feedback = get_option( UserFeedback::USER_FEEDBACK_OPTION );
75
-
76
- if ( is_array( $user_feedback ) ) {
77
- $new_rules_table_data = $this->append_user_feedback_data( $new_rules_table_data, $user_feedback );
78
- }
79
- return $new_rules_table_data;
80
- }
81
-
82
- /**
83
- * @return string
84
- */
85
- private function get_popup_clicked() {
86
- $popup_clicked_option = new NewRulesPopupClickedOption();
87
- return $popup_clicked_option->get_option_value() ? $popup_clicked_option->get_option_value() : 'no';
88
- }
89
-
90
- /**
91
- * Adds info about New Table Interface to user feedback.
92
- *
93
- * @param array $data Stats about New Table Interface.
94
- * @param array $user_feedback User feedback.
95
- *
96
- * @return array Updated $data array.
97
- */
98
- private function append_user_feedback_data( $data, $user_feedback ) {
99
- if ( isset( $user_feedback['selected_option'] ) ) {
100
- $data['feedback_option'] = $user_feedback['selected_option'];
101
- }
102
- if ( isset( $user_feedback['additional_info'] ) ) {
103
- $data['feedback_additional_info'] = $user_feedback['additional_info'];
104
- }
105
-
106
- return $data;
107
- }
108
-
109
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit5ebba595540d7b02f0f8003854939e3c::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit7221295640eab9ae78a49a20e9292138::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -493,19 +493,6 @@ return array(
493
  'WPDesk\\FS\\TableRate\\ImporterExporter\\Importer\\ImporterFactory' => $baseDir . '/src/WPDesk/FS/TableRate/ImporterExporter/Importer/ImporterFactory.php',
494
  'WPDesk\\FS\\TableRate\\ImporterExporter\\Importer\\JSON' => $baseDir . '/src/WPDesk/FS/TableRate/ImporterExporter/Importer/JSON.php',
495
  'WPDesk\\FS\\TableRate\\ImporterExporter\\ShippingClassTrait' => $baseDir . '/src/WPDesk/FS/TableRate/ImporterExporter/ShippingClassTrait.php',
496
- 'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesBannerClickedOption' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerClickedOption.php',
497
- 'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesBannerDontLikeOption' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerDontLikeOption.php',
498
- 'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesBannerLikeOption' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerLikeOption.php',
499
- 'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesPointerBanner' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesPointerBanner.php',
500
- 'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesPointerBannerForNewTable' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesPointerBannerForNewTable.php',
501
- 'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesPointerBannerForOldTable' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesPointerBannerForOldTable.php',
502
- 'WPDesk\\FS\\TableRate\\NewRulesTableDeactivationTracker' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTableDeactivationTracker.php',
503
- 'WPDesk\\FS\\TableRate\\NewRulesTablePointer\\ShippingMethodNewRuleTableSetting' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTablePointer/ShippingMethodNewRuleTableSetting.php',
504
- 'WPDesk\\FS\\TableRate\\NewRulesTablePopup\\Assets' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php',
505
- 'WPDesk\\FS\\TableRate\\NewRulesTablePopup\\NewRulesPopupClickedOption' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTablePopup/NewRulesPopupClickedOption.php',
506
- 'WPDesk\\FS\\TableRate\\NewRulesTablePopup\\NewRulesPopupClickedOptionAjaxUpdater' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTablePopup/NewRulesPopupClickedOptionAjaxUpdater.php',
507
- 'WPDesk\\FS\\TableRate\\NewRulesTableTracker' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTableTracker.php',
508
- 'WPDesk\\FS\\TableRate\\NewRulesTableTrackerData' => $baseDir . '/src/WPDesk/FS/TableRate/NewRulesTableTrackerData.php',
509
  'WPDesk\\FS\\TableRate\\Order\\ItemMeta' => $baseDir . '/src/WPDesk/FS/TableRate/Order/ItemMeta.php',
510
  'WPDesk\\FS\\TableRate\\Rates\\FlexibleShippingRates' => $baseDir . '/src/WPDesk/FS/TableRate/Rates/FlexibleShippingRates.php',
511
  'WPDesk\\FS\\TableRate\\Rule\\Condition\\AbstractCondition' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/AbstractCondition.php',
493
  'WPDesk\\FS\\TableRate\\ImporterExporter\\Importer\\ImporterFactory' => $baseDir . '/src/WPDesk/FS/TableRate/ImporterExporter/Importer/ImporterFactory.php',
494
  'WPDesk\\FS\\TableRate\\ImporterExporter\\Importer\\JSON' => $baseDir . '/src/WPDesk/FS/TableRate/ImporterExporter/Importer/JSON.php',
495
  'WPDesk\\FS\\TableRate\\ImporterExporter\\ShippingClassTrait' => $baseDir . '/src/WPDesk/FS/TableRate/ImporterExporter/ShippingClassTrait.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
496
  'WPDesk\\FS\\TableRate\\Order\\ItemMeta' => $baseDir . '/src/WPDesk/FS/TableRate/Order/ItemMeta.php',
497
  'WPDesk\\FS\\TableRate\\Rates\\FlexibleShippingRates' => $baseDir . '/src/WPDesk/FS/TableRate/Rates/FlexibleShippingRates.php',
498
  'WPDesk\\FS\\TableRate\\Rule\\Condition\\AbstractCondition' => $baseDir . '/src/WPDesk/FS/TableRate/Rule/Condition/AbstractCondition.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit5ebba595540d7b02f0f8003854939e3c
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit5ebba595540d7b02f0f8003854939e3c
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit5ebba595540d7b02f0f8003854939e3c', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit5ebba595540d7b02f0f8003854939e3c', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit5ebba595540d7b02f0f8003854939e3c::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit7221295640eab9ae78a49a20e9292138
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit7221295640eab9ae78a49a20e9292138', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit7221295640eab9ae78a49a20e9292138', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit7221295640eab9ae78a49a20e9292138::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit5ebba595540d7b02f0f8003854939e3c
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'P' =>
@@ -512,19 +512,6 @@ class ComposerStaticInit5ebba595540d7b02f0f8003854939e3c
512
  'WPDesk\\FS\\TableRate\\ImporterExporter\\Importer\\ImporterFactory' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ImporterExporter/Importer/ImporterFactory.php',
513
  'WPDesk\\FS\\TableRate\\ImporterExporter\\Importer\\JSON' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ImporterExporter/Importer/JSON.php',
514
  'WPDesk\\FS\\TableRate\\ImporterExporter\\ShippingClassTrait' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ImporterExporter/ShippingClassTrait.php',
515
- 'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesBannerClickedOption' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerClickedOption.php',
516
- 'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesBannerDontLikeOption' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerDontLikeOption.php',
517
- 'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesBannerLikeOption' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesBannerLikeOption.php',
518
- 'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesPointerBanner' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesPointerBanner.php',
519
- 'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesPointerBannerForNewTable' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesPointerBannerForNewTable.php',
520
- 'WPDesk\\FS\\TableRate\\NewRulesTableBanner\\RulesPointerBannerForOldTable' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTableBanner/RulesPointerBannerForOldTable.php',
521
- 'WPDesk\\FS\\TableRate\\NewRulesTableDeactivationTracker' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTableDeactivationTracker.php',
522
- 'WPDesk\\FS\\TableRate\\NewRulesTablePointer\\ShippingMethodNewRuleTableSetting' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTablePointer/ShippingMethodNewRuleTableSetting.php',
523
- 'WPDesk\\FS\\TableRate\\NewRulesTablePopup\\Assets' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTablePopup/Assets.php',
524
- 'WPDesk\\FS\\TableRate\\NewRulesTablePopup\\NewRulesPopupClickedOption' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTablePopup/NewRulesPopupClickedOption.php',
525
- 'WPDesk\\FS\\TableRate\\NewRulesTablePopup\\NewRulesPopupClickedOptionAjaxUpdater' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTablePopup/NewRulesPopupClickedOptionAjaxUpdater.php',
526
- 'WPDesk\\FS\\TableRate\\NewRulesTableTracker' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTableTracker.php',
527
- 'WPDesk\\FS\\TableRate\\NewRulesTableTrackerData' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/NewRulesTableTrackerData.php',
528
  'WPDesk\\FS\\TableRate\\Order\\ItemMeta' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Order/ItemMeta.php',
529
  'WPDesk\\FS\\TableRate\\Rates\\FlexibleShippingRates' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rates/FlexibleShippingRates.php',
530
  'WPDesk\\FS\\TableRate\\Rule\\Condition\\AbstractCondition' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/AbstractCondition.php',
@@ -613,10 +600,10 @@ class ComposerStaticInit5ebba595540d7b02f0f8003854939e3c
613
  public static function getInitializer(ClassLoader $loader)
614
  {
615
  return \Closure::bind(function () use ($loader) {
616
- $loader->prefixLengthsPsr4 = ComposerStaticInit5ebba595540d7b02f0f8003854939e3c::$prefixLengthsPsr4;
617
- $loader->prefixDirsPsr4 = ComposerStaticInit5ebba595540d7b02f0f8003854939e3c::$prefixDirsPsr4;
618
- $loader->fallbackDirsPsr4 = ComposerStaticInit5ebba595540d7b02f0f8003854939e3c::$fallbackDirsPsr4;
619
- $loader->classMap = ComposerStaticInit5ebba595540d7b02f0f8003854939e3c::$classMap;
620
 
621
  }, null, ClassLoader::class);
622
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit7221295640eab9ae78a49a20e9292138
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'P' =>
512
  'WPDesk\\FS\\TableRate\\ImporterExporter\\Importer\\ImporterFactory' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ImporterExporter/Importer/ImporterFactory.php',
513
  'WPDesk\\FS\\TableRate\\ImporterExporter\\Importer\\JSON' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ImporterExporter/Importer/JSON.php',
514
  'WPDesk\\FS\\TableRate\\ImporterExporter\\ShippingClassTrait' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/ImporterExporter/ShippingClassTrait.php',
 
 
 
 
 
 
 
 
 
 
 
 
 
515
  'WPDesk\\FS\\TableRate\\Order\\ItemMeta' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Order/ItemMeta.php',
516
  'WPDesk\\FS\\TableRate\\Rates\\FlexibleShippingRates' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rates/FlexibleShippingRates.php',
517
  'WPDesk\\FS\\TableRate\\Rule\\Condition\\AbstractCondition' => __DIR__ . '/../..' . '/src/WPDesk/FS/TableRate/Rule/Condition/AbstractCondition.php',
600
  public static function getInitializer(ClassLoader $loader)
601
  {
602
  return \Closure::bind(function () use ($loader) {
603
+ $loader->prefixLengthsPsr4 = ComposerStaticInit7221295640eab9ae78a49a20e9292138::$prefixLengthsPsr4;
604
+ $loader->prefixDirsPsr4 = ComposerStaticInit7221295640eab9ae78a49a20e9292138::$prefixDirsPsr4;
605
+ $loader->fallbackDirsPsr4 = ComposerStaticInit7221295640eab9ae78a49a20e9292138::$fallbackDirsPsr4;
606
+ $loader->classMap = ComposerStaticInit7221295640eab9ae78a49a20e9292138::$classMap;
607
 
608
  }, null, ClassLoader::class);
609
  }
vendor_prefixed/wpdesk/wp-codeception/src/WPDesk/Composer/Commands/LocalCodeceptionTrait.php CHANGED
@@ -33,6 +33,7 @@ trait LocalCodeceptionTrait
33
  $this->executeWpCliAndOutput('config set WP_SITEURL http://' . $configuration->getWptestsIp(), $output, $apache_document_root);
34
  $this->executeWpCliAndOutput('config set WP_AUTO_UPDATE_CORE false --raw', $output, $apache_document_root);
35
  $this->executeWpCliAndOutput('config set AUTOMATIC_UPDATER_DISABLED false --raw', $output, $apache_document_root);
 
36
  }
37
  /**
38
  * @param OutputInterface $output
33
  $this->executeWpCliAndOutput('config set WP_SITEURL http://' . $configuration->getWptestsIp(), $output, $apache_document_root);
34
  $this->executeWpCliAndOutput('config set WP_AUTO_UPDATE_CORE false --raw', $output, $apache_document_root);
35
  $this->executeWpCliAndOutput('config set AUTOMATIC_UPDATER_DISABLED false --raw', $output, $apache_document_root);
36
+ $this->executeWpCliAndOutput('rewrite structure \'/%postname%/\'', $output, $apache_document_root);
37
  }
38
  /**
39
  * @param OutputInterface $output
vendor_prefixed/wpdesk/wp-nps/src/Nps.php CHANGED
@@ -122,7 +122,7 @@ class Nps implements \FSVendor\WPDesk\PluginBuilder\Plugin\HookableCollection
122
  $this->best_label = \__('Extremely likely', 'flexible-shipping');
123
  $this->question = \__('How likely are you to recommend our plugin to your friends?', 'flexible-shipping');
124
  $this->feedback_question = \__('What could we do to improve it?', 'flexible-shipping');
125
- $this->disclaimer = \__('By using the \'Send feedback\' button I hereby agree and consent to the terms of <a target="_blank" href="https://wpdesk.net/terms/privacy/">Privacy Policy</a>.', 'flexible-shipping');
126
  $this->send_button = \__('Send feedback', 'flexible-shipping');
127
  $this->send_button_sending = \__('Sending feedback', 'flexible-shipping');
128
  $this->thank_you_message = \__('Thank you!', 'flexible-shipping');
122
  $this->best_label = \__('Extremely likely', 'flexible-shipping');
123
  $this->question = \__('How likely are you to recommend our plugin to your friends?', 'flexible-shipping');
124
  $this->feedback_question = \__('What could we do to improve it?', 'flexible-shipping');
125
+ $this->disclaimer = \sprintf(\__('By using the \'Send feedback\' button I hereby agree and consent to the terms of %1$sPrivacy Policy%2$s.', 'flexible-shipping'), '<a target="_blank" href="https://flexibleshipping.com/terms/privacy/">', '</a>');
126
  $this->send_button = \__('Send feedback', 'flexible-shipping');
127
  $this->send_button_sending = \__('Sending feedback', 'flexible-shipping');
128
  $this->thank_you_message = \__('Thank you!', 'flexible-shipping');