Flexible Shipping for WooCommerce - Version 3.1.6

Version Description

  • 2019-02-07 =
  • Added filter for deactivation data in tracker
Download this release

Release Info

Developer jablonowski
Plugin Icon 128x128 Flexible Shipping for WooCommerce
Version 3.1.6
Comparing to
See all releases

Code changes from version 3.1.5 to 3.1.6

Files changed (43) hide show
  1. ab-tests.php +32 -0
  2. classes/abtests/ab-message-test/class-ab-variant-both-messages.php +10 -0
  3. classes/abtests/ab-message-test/class-ab-variant-connect-no-tracker.php +10 -0
  4. classes/abtests/ab-message-test/class-ab-variant-no-connect-tracker.php +9 -0
  5. classes/abtests/ab-message-test/class-ab-variant-no-messages.php +10 -0
  6. classes/abtests/ab-message-test/class-ab-variant-old.php +5 -0
  7. classes/abtests/class-ab-message-test.php +112 -0
  8. classes/abtests/class-ab-plugin-activation.php +47 -0
  9. classes/abtests/class-ab-tracker-deactivation-data.php +47 -0
  10. classes/abtests/class-tracker-button.php +79 -0
  11. classes/class-flexible-shipping-plugin.php +30 -3
  12. classes/saas/class-saas-settings.php +13 -1
  13. classes/saas/class-saas-shipping-services-manager.php +18 -3
  14. classes/saas/class-saas-user-registration.php +19 -2
  15. classes/saas/views/html-shipping-method-info-description.php +9 -3
  16. classes/tracker.php +5 -1
  17. flexible-shipping.php +6 -3
  18. inc/wpdesk-tracker/class-wpdesk-tracker.php +1 -1
  19. plugin-create.php +0 -1
  20. readme.txt +4 -2
  21. vendor/autoload.php +1 -1
  22. vendor/composer/autoload_classmap.php +18 -0
  23. vendor/composer/autoload_psr4.php +2 -0
  24. vendor/composer/autoload_real.php +7 -7
  25. vendor/composer/autoload_static.php +32 -4
  26. vendor/composer/installed.json +81 -0
  27. vendor/wpdesk/wp-abtesting/CHANGELOG.md +3 -0
  28. vendor/wpdesk/wp-abtesting/LICENSE.md +21 -0
  29. vendor/wpdesk/wp-abtesting/README.md +45 -0
  30. vendor/wpdesk/wp-abtesting/composer.json +31 -0
  31. vendor/wpdesk/wp-abtesting/src/ABTest.php +17 -0
  32. vendor/wpdesk/wp-abtesting/src/ABTest/EqualGroupsRandomABTest.php +111 -0
  33. vendor/wpdesk/wp-abtesting/src/ABVariant.php +26 -0
  34. vendor/wpdesk/wp-abtesting/src/ABVariant/BasicABVariant.php +29 -0
  35. vendor/wpdesk/wp-persistence/CHANGELOG.md +3 -0
  36. vendor/wpdesk/wp-persistence/LICENSE.md +21 -0
  37. vendor/wpdesk/wp-persistence/README.md +45 -0
  38. vendor/wpdesk/wp-persistence/composer.json +30 -0
  39. vendor/wpdesk/wp-persistence/src/ElementNotExistsException.php +12 -0
  40. vendor/wpdesk/wp-persistence/src/MemoryContainer.php +37 -0
  41. vendor/wpdesk/wp-persistence/src/PersistentContainer.php +19 -0
  42. vendor/wpdesk/wp-persistence/src/Wordpress/WordpressOptionsContainer.php +56 -0
  43. vendor/wpdesk/wp-persistence/src/Wordpress/WordpressTransientContainer.php +59 -0
ab-tests.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ } // Exit if accessed directly
6
+
7
+ require_once __DIR__ . '/vendor/wpdesk/wp-persistence/src/PersistentContainer.php';
8
+ require_once __DIR__ . '/vendor/wpdesk/wp-persistence/src/ElementNotExistsException.php';
9
+ require_once __DIR__ . '/vendor/wpdesk/wp-persistence/src/Wordpress/WordpressOptionsContainer.php';
10
+
11
+ require_once __DIR__ . '/vendor/wpdesk/wp-abtesting/src/ABTest.php';
12
+ require_once __DIR__ . '/vendor/wpdesk/wp-abtesting/src/ABVariant.php';
13
+
14
+ require_once __DIR__ . '/vendor/wpdesk/wp-abtesting/src/ABVariant/BasicABVariant.php';
15
+ require_once __DIR__ . '/vendor/wpdesk/wp-abtesting/src/ABTest/EqualGroupsRandomABTest.php';
16
+
17
+ require_once __DIR__ . '/classes/abtests/ab-message-test/class-ab-variant-both-messages.php';
18
+ require_once __DIR__ . '/classes/abtests/ab-message-test/class-ab-variant-connect-no-tracker.php';
19
+ require_once __DIR__ . '/classes/abtests/ab-message-test/class-ab-variant-no-connect-tracker.php';
20
+ require_once __DIR__ . '/classes/abtests/ab-message-test/class-ab-variant-no-messages.php';
21
+ require_once __DIR__ . '/classes/abtests/ab-message-test/class-ab-variant-old.php';
22
+
23
+ require_once __DIR__ . '/classes/abtests/class-ab-message-test.php';
24
+ require_once __DIR__ . '/classes/abtests/class-ab-plugin-activation.php';
25
+ require_once __DIR__ . '/classes/abtests/class-tracker-button.php';
26
+
27
+ $activationAB = new WPDesk_Flexible_Shipping_AB_PluginActivation( ( new WPDesk_Flexible_Shipping_AB_MessageTest() )->get_variant() );
28
+ $activationAB->hooks();
29
+
30
+
31
+ $trackerButton = new WPDesk_Flexible_Shipping_Tracker_Button();
32
+ $trackerButton->hooks();
classes/abtests/ab-message-test/class-ab-variant-both-messages.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use WPDesk\ABTesting\ABVariant\BasicABVariant;
4
+
5
+ class WPDesk_Flexible_Shipping_AB_Variant_Both_Messages extends BasicABVariant {
6
+ public function is_on( $functionality ) {
7
+ return true;
8
+ }
9
+
10
+ }
classes/abtests/ab-message-test/class-ab-variant-connect-no-tracker.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use WPDesk\ABTesting\ABVariant\BasicABVariant;
4
+
5
+ class WPDesk_Flexible_Shipping_AB_Variant_Connect_NO_Tracker extends BasicABVariant {
6
+ public function is_on( $functionality ) {
7
+ return $functionality === WPDesk_Flexible_Shipping_AB_MessageTest::MESSAGE_CONNECT;
8
+ }
9
+
10
+ }
classes/abtests/ab-message-test/class-ab-variant-no-connect-tracker.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use WPDesk\ABTesting\ABVariant\BasicABVariant;
4
+
5
+ class WPDesk_Flexible_Shipping_AB_Variant_No_Connect_Tracker extends BasicABVariant {
6
+ public function is_on( $functionality ) {
7
+ return $functionality === WPDesk_Flexible_Shipping_AB_MessageTest::MESSAGE_ACTIVATION_TRACKER;
8
+ }
9
+ }
classes/abtests/ab-message-test/class-ab-variant-no-messages.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use WPDesk\ABTesting\ABVariant\BasicABVariant;
4
+
5
+ class WPDesk_Flexible_Shipping_AB_Variant_No_Messages extends BasicABVariant {
6
+ public function is_on( $functionality ) {
7
+ return false;
8
+ }
9
+
10
+ }
classes/abtests/ab-message-test/class-ab-variant-old.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ class WPDesk_Flexible_Shipping_AB_Variant_Old extends WPDesk_Flexible_Shipping_AB_Variant_Both_Messages {
5
+ }
classes/abtests/class-ab-message-test.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use WPDesk\ABTesting\ABTest\EqualGroupsRandomABTest;
4
+ use WPDesk\ABTesting\ABVariant;
5
+ use WPDesk\Persistence\PersistentContainer;
6
+ use WPDesk\Persistence\Wordpress\WordpressOptionsContainer;
7
+
8
+ /**
9
+ * AB Test https://docs.google.com/document/d/1JA49dgOqJ1SawEdL506tWdW6zgD30cXDpFZhJ7r_SNo/edit?usp=sharing
10
+ *
11
+ * We've created 5 groups/variants. 4 like in the description and one for the old users.
12
+ */
13
+ class WPDesk_Flexible_Shipping_AB_MessageTest extends EqualGroupsRandomABTest {
14
+ const GROUP_COUNT = 4;
15
+ const TEST_NAME = 'message-test';
16
+
17
+ const VARIANT_ID_FOR_OLD_INSTALLATION = 0;
18
+
19
+ const VARIANT_ID_FOR_BOTH_MESSAGES_VISIBLE = 1;
20
+ const VARIANT_ID_FOR_CONNECT_NO_TRACKER = 2;
21
+ const VARIANT_ID_FOR_NO_CONNECT_TRACKER = 3;
22
+ const VARIANT_ID_FOR_NO_MESSAGES = 4;
23
+
24
+ const MESSAGE_ACTIVATION_TRACKER = 'msg_tracker';
25
+ const MESSAGE_CONNECT = 'msg_connect';
26
+
27
+ const NEW_USER_AFTER_THIS_DATE = '2019-02-07 00:00:00';
28
+
29
+ const COOKIE_NAME_FOR_OVERRIDE_OLD_ACTIVATION = 'marta_message_ab';
30
+
31
+ /** @var PersistentContainer */
32
+ private $container;
33
+
34
+ public function __construct() {
35
+ $container = new WordpressOptionsContainer();
36
+ $this->container = $container;
37
+
38
+ parent::__construct( self::GROUP_COUNT, self::TEST_NAME, $container );
39
+
40
+ $this->ovverride_id_for_old_user( $container );
41
+ }
42
+
43
+ /**
44
+ * Clears info about variant and draws again
45
+ */
46
+ public function reset() {
47
+ parent::reset();
48
+ $this->ovverride_id_for_old_user( $this->container );
49
+ }
50
+
51
+ /**
52
+ * If old user then should have static group
53
+ *
54
+ * @param PersistentContainer $container
55
+ *
56
+ * @return void
57
+ */
58
+ private function ovverride_id_for_old_user( PersistentContainer $container ) {
59
+ if ( $this->current_variant_id !== self::VARIANT_ID_FOR_OLD_INSTALLATION && $this->is_old_installation() ) {
60
+ $this->current_variant_id = self::VARIANT_ID_FOR_OLD_INSTALLATION;
61
+ $container->set( $this->get_container_key(), self::VARIANT_ID_FOR_OLD_INSTALLATION );
62
+ }
63
+ }
64
+
65
+ /**
66
+ * If this a old user? If so then FS should work like always.
67
+ *
68
+ * @return bool
69
+ */
70
+ private function is_old_installation() {
71
+ if ( isset( $_COOKIE[ self::COOKIE_NAME_FOR_OVERRIDE_OLD_ACTIVATION ] ) ) {
72
+ return (bool) $_COOKIE[ self::COOKIE_NAME_FOR_OVERRIDE_OLD_ACTIVATION ];
73
+ }
74
+
75
+ return strtotime( self::NEW_USER_AFTER_THIS_DATE ) > $this->activation_date_according_to_wpdesk_helper();
76
+ }
77
+
78
+ /**
79
+ * @return int timestamp
80
+ */
81
+ private function activation_date_according_to_wpdesk_helper() {
82
+ $option_name = 'plugin_activation_flexible-shipping/flexible-shipping.php';
83
+ $activation_date = get_option( $option_name, current_time( 'mysql' ) );
84
+
85
+ if ( ! $activation_date ) {
86
+ return time();
87
+ }
88
+
89
+ return strtotime( $activation_date );
90
+ }
91
+
92
+ /**
93
+ * @return ABVariant
94
+ */
95
+ public function get_variant() {
96
+ switch ( $this->current_variant_id ) {
97
+ case self::VARIANT_ID_FOR_BOTH_MESSAGES_VISIBLE:
98
+ return new WPDesk_Flexible_Shipping_AB_Variant_Both_Messages( $this->current_variant_id );
99
+ case self::VARIANT_ID_FOR_CONNECT_NO_TRACKER:
100
+ return new WPDesk_Flexible_Shipping_AB_Variant_Connect_NO_Tracker( $this->current_variant_id );
101
+ case self::VARIANT_ID_FOR_NO_CONNECT_TRACKER:
102
+ return new WPDesk_Flexible_Shipping_AB_Variant_No_Connect_Tracker( $this->current_variant_id );
103
+ case self::VARIANT_ID_FOR_NO_MESSAGES:
104
+ return new WPDesk_Flexible_Shipping_AB_Variant_No_Messages( $this->current_variant_id );
105
+ case self::VARIANT_ID_FOR_OLD_INSTALLATION:
106
+ return new WPDesk_Flexible_Shipping_AB_Variant_Old( $this->current_variant_id );
107
+
108
+ default:
109
+ return new WPDesk_Flexible_Shipping_AB_Variant_Old( $this->current_variant_id );
110
+ }
111
+ }
112
+ }
classes/abtests/class-ab-plugin-activation.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use WPDesk\ABTesting\ABVariant;
4
+
5
+ /**
6
+ * AB Test https://docs.google.com/document/d/1JA49dgOqJ1SawEdL506tWdW6zgD30cXDpFZhJ7r_SNo/edit?usp=sharing
7
+ *
8
+ * Class to disable tracker for AB test variant
9
+ */
10
+ class WPDesk_Flexible_Shipping_AB_PluginActivation {
11
+
12
+ /**
13
+ * @var WPDesk_Flexible_Shipping_AB_MessageTest
14
+ */
15
+ private $variant;
16
+
17
+ /**
18
+ * WPDesk_Flexible_Shipping_AB_PluginActivation constructor.
19
+ *
20
+ * @param $variant
21
+ */
22
+ public function __construct( ABVariant $variant ) {
23
+ $this->variant = $variant;
24
+ }
25
+
26
+ /**
27
+ * Fires hooks
28
+ *
29
+ * @return void
30
+ */
31
+ public function hooks() {
32
+ add_filter( 'wpdesk_tracker_hide_activation_message', array( $this, 'disable_tracker_ask_on_ab_variant' ) );
33
+ }
34
+
35
+ /**
36
+ * Disable OR enable filter for current variant
37
+ *
38
+ * @param $disabled
39
+ *
40
+ * @return bool
41
+ */
42
+ public function disable_tracker_ask_on_ab_variant( $disabled ) {
43
+ return !$this->variant->is_on( WPDesk_Flexible_Shipping_AB_MessageTest::MESSAGE_ACTIVATION_TRACKER );
44
+ }
45
+
46
+
47
+ }
classes/abtests/class-ab-tracker-deactivation-data.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use WPDesk\ABTesting\ABVariant;
4
+
5
+ /**
6
+ * AB Test https://docs.google.com/document/d/1JA49dgOqJ1SawEdL506tWdW6zgD30cXDpFZhJ7r_SNo/edit?usp=sharing
7
+ *
8
+ * Class by which we can push some data to the deactivation filter
9
+ */
10
+ class WPDesk_Flexible_Shipping_AB_Tracker_Deactivation_Data implements \WPDesk\PluginBuilder\Plugin\Hookable {
11
+
12
+ /**
13
+ * @var ABVariant
14
+ */
15
+ protected $variant;
16
+
17
+ /**
18
+ * WPDesk_Flexible_Shipping_AB_Tracker_Deactivation_Data constructor.
19
+ *
20
+ * @param ABVariant $variant
21
+ */
22
+ public function __construct( ABVariant $variant ) {
23
+ $this->variant = $variant;
24
+ }
25
+
26
+ /**
27
+ * Fires hooks
28
+ *
29
+ * @return void
30
+ */
31
+ public function hooks() {
32
+ add_filter( 'wpdesk_tracker_deactivation_data', array( $this, 'append_variant_id_to_data' ) );
33
+ }
34
+
35
+ /**
36
+ * Set variant ID to data array
37
+ *
38
+ * @param array $data
39
+ *
40
+ * @return array
41
+ */
42
+ public function append_variant_id_to_data( array $data ) {
43
+ $data['variant_id'] = $this->variant->get_variant_id();
44
+ return $data;
45
+ }
46
+
47
+ }
classes/abtests/class-tracker-button.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class to tracking agree button
4
+ *
5
+ */
6
+ class WPDesk_Flexible_Shipping_Tracker_Button {
7
+
8
+ /**
9
+ * @var string
10
+ */
11
+ const OPTION_NAME = 'fs_button_tracking';
12
+
13
+ /**
14
+ * @var string
15
+ */
16
+ const WC_SETTINGS_PAGE_ID = 'woocommerce_page_wc-settings';
17
+
18
+ /**
19
+ * @var string
20
+ */
21
+ const OPTION_VALUE_ACTIVATE_PAGE = 'plugin_activate';
22
+
23
+ /**
24
+ * @var string
25
+ */
26
+ const OPTION_VALUE_WC_SETTINGS_PAGE = 'woocommerce_settings';
27
+
28
+ /**
29
+ * Fires hooks
30
+ */
31
+ public function hooks() {
32
+ add_action( 'admin_footer', array( $this, 'add_button_tracker_js' ) );
33
+ add_action( 'wp_ajax_save_button_tracker', array( $this, 'wp_ajax_save_button_tracker' ) );
34
+ }
35
+
36
+ /**
37
+ * Get tracked button type
38
+ *
39
+ * @return string|null
40
+ */
41
+ static function get_button_pagetype() {
42
+ $value = get_option( self::OPTION_NAME, null );
43
+ return $value;
44
+ }
45
+
46
+ /**
47
+ * Saves to which button the user clicked
48
+ */
49
+ public function wp_ajax_save_button_tracker() {
50
+ if( $_POST['pagetype'] === self::WC_SETTINGS_PAGE_ID ) {
51
+ update_option( self::OPTION_NAME, self::OPTION_VALUE_WC_SETTINGS_PAGE );
52
+ } else {
53
+ update_option( self::OPTION_NAME, self::OPTION_VALUE_ACTIVATE_PAGE );
54
+ }
55
+ wp_send_json_success( array( 'page' => $_POST['pagetype'] ) );
56
+ }
57
+
58
+ public function add_button_tracker_js() {
59
+ $screen = get_current_screen();
60
+ if( $screen->id === self::WC_SETTINGS_PAGE_ID || $screen->id === 'admin_page_wpdesk_tracker' ):
61
+ ?>
62
+ <script>
63
+ jQuery(function($) {
64
+ $( '#wpdesk_tracker_allow_button, #wpdesk_tracker_allow_button_notice' ).click( function () {
65
+ $.ajax( ajaxurl,
66
+ {
67
+ type: 'POST',
68
+ data: {
69
+ action: 'save_button_tracker',
70
+ pagetype: pagenow,
71
+ }
72
+ } );
73
+ } );
74
+ });
75
+ </script>
76
+ <?php endif;
77
+ }
78
+
79
+ }
classes/class-flexible-shipping-plugin.php CHANGED
@@ -8,6 +8,11 @@ class Flexible_Shipping_Plugin
8
  use \WPDesk\PluginBuilder\Plugin\HookableParent;
9
  use \WPDesk\PluginBuilder\Plugin\TemplateLoad;
10
 
 
 
 
 
 
11
  /**
12
  * @var string
13
  */
@@ -51,6 +56,13 @@ class Flexible_Shipping_Plugin
51
  */
52
  private $logger;
53
 
 
 
 
 
 
 
 
54
  /**
55
  * Flexible_Invoices_Reports_Plugin constructor.
56
  *
@@ -84,14 +96,19 @@ class Flexible_Shipping_Plugin
84
 
85
  $this->admin_notices = new WPDesk_Flexible_Shipping_Admin_Notices( $this );
86
 
87
- $this->add_hookable( new WPDesk_Flexible_Shipping_Add_Shipping() );
 
 
 
 
 
88
 
89
  $connection = new WPDesk_Flexible_Shipping_SaaS_Connection( $this->logger, $this->saas_platform_links );
90
  $this->add_hookable( $connection );
91
 
92
- $this->add_hookable( new WPDesk_Flexible_Shipping_SaaS_User_Registration( $connection, $this->saas_platform_links ) );
93
 
94
- $services_manager = new WPDesk_Flexible_Shipping_SaaS_Services_Manager( $connection, $this->saas_platform_links, $this->logger );
95
  $this->add_hookable( $services_manager );
96
 
97
  if ( $services_manager->is_require_uk_states() ) {
@@ -180,6 +197,8 @@ class Flexible_Shipping_Plugin
180
 
181
  add_action( 'admin_init', array( $this, 'session_init' ) );
182
 
 
 
183
  add_action( 'woocommerce_after_shipping_rate', array( $this, 'woocommerce_after_shipping_rate' ), 10, 2 );
184
 
185
  add_action( 'flexible_shipping_method_rate_id', array( $this, 'flexible_shipping_method_rate_id' ), 9999999,
@@ -362,6 +381,14 @@ class Flexible_Shipping_Plugin
362
  array(), $this->scripts_version );
363
  }
364
 
 
 
 
 
 
 
 
 
365
  /**
366
  * @param array $links
367
  *
8
  use \WPDesk\PluginBuilder\Plugin\HookableParent;
9
  use \WPDesk\PluginBuilder\Plugin\TemplateLoad;
10
 
11
+ /*
12
+ * Plugin file
13
+ */
14
+ const PLUGIN_FILE = 'flexible-shipping/flexible-shipping.php';
15
+
16
  /**
17
  * @var string
18
  */
56
  */
57
  private $logger;
58
 
59
+ /**
60
+ * Selected variant for AB message testing.
61
+ *
62
+ * @var ABVariant
63
+ */
64
+ private $variant;
65
+
66
  /**
67
  * Flexible_Invoices_Reports_Plugin constructor.
68
  *
96
 
97
  $this->admin_notices = new WPDesk_Flexible_Shipping_Admin_Notices( $this );
98
 
99
+ $abtesting = new WPDesk_Flexible_Shipping_AB_MessageTest();
100
+ $this->variant = $abtesting->get_variant();
101
+
102
+ $this->add_hookable( new WPDesk_Flexible_Shipping_AB_Tracker_Deactivation_Data( $this->variant ) );
103
+
104
+ $this->add_hookable( new WPDesk_Flexible_Shipping_Add_Shipping( ) );
105
 
106
  $connection = new WPDesk_Flexible_Shipping_SaaS_Connection( $this->logger, $this->saas_platform_links );
107
  $this->add_hookable( $connection );
108
 
109
+ $this->add_hookable( new WPDesk_Flexible_Shipping_SaaS_User_Registration( $connection, $this->saas_platform_links, $this->variant ) );
110
 
111
+ $services_manager = new WPDesk_Flexible_Shipping_SaaS_Services_Manager( $connection, $this->saas_platform_links, $this->logger, $this->variant );
112
  $this->add_hookable( $services_manager );
113
 
114
  if ( $services_manager->is_require_uk_states() ) {
197
 
198
  add_action( 'admin_init', array( $this, 'session_init' ) );
199
 
200
+ add_action( 'admin_head', array( $this, 'admin_inline_css_for_ab_test' ) );
201
+
202
  add_action( 'woocommerce_after_shipping_rate', array( $this, 'woocommerce_after_shipping_rate' ), 10, 2 );
203
 
204
  add_action( 'flexible_shipping_method_rate_id', array( $this, 'flexible_shipping_method_rate_id' ), 9999999,
381
  array(), $this->scripts_version );
382
  }
383
 
384
+ public function admin_inline_css_for_ab_test() {
385
+ if( !$this->variant->is_on( WPDesk_Flexible_Shipping_AB_MessageTest::MESSAGE_CONNECT ) ) {
386
+ ?>
387
+ <style>.fs-page-wrap { display: none; }</style>
388
+ <?php
389
+ }
390
+ }
391
+
392
  /**
393
  * @param array $links
394
  *
classes/saas/class-saas-settings.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  /**
4
  * Class WPDesk_Flexible_Shipping_SaaS_Settings
5
  */
@@ -57,6 +59,13 @@ class WPDesk_Flexible_Shipping_SaaS_Settings extends WC_Shipping_Method implemen
57
  */
58
  private $new_courier_settings_section;
59
 
 
 
 
 
 
 
 
60
  /**
61
  * WPDesk_Flexible_Shipping_Connect constructor.
62
  *
@@ -69,12 +78,14 @@ class WPDesk_Flexible_Shipping_SaaS_Settings extends WC_Shipping_Method implemen
69
  $instance_id = 0,
70
  $saas_connection = null,
71
  WPDesk_Flexible_Shipping_SaaS_Platform_Links $saas_platform_links = null,
72
- $shipping_methods_manager = null
 
73
  ) {
74
  parent::__construct( $instance_id );
75
  $this->id = self::METHOD_ID;
76
  $this->enabled = 'no';
77
  $this->method_title = __( 'Flexible Shipping', 'flexible-shipping' );
 
78
 
79
  $this->supports = array(
80
  'settings',
@@ -353,6 +364,7 @@ class WPDesk_Flexible_Shipping_SaaS_Settings extends WC_Shipping_Method implemen
353
  include 'views/html-settings-connect-script.php';
354
  include 'views/html-shipping-method-info-description.php';
355
  $html .= ob_get_clean();
 
356
  if ( $echo ) {
357
  echo $html;
358
  } else {
1
  <?php
2
 
3
+ use WPDesk\ABTesting\ABVariant;
4
+
5
  /**
6
  * Class WPDesk_Flexible_Shipping_SaaS_Settings
7
  */
59
  */
60
  private $new_courier_settings_section;
61
 
62
+ /**
63
+ * Selected variant for AB message testing.
64
+ *
65
+ * @var ABVariant
66
+ */
67
+ private $variant;
68
+
69
  /**
70
  * WPDesk_Flexible_Shipping_Connect constructor.
71
  *
78
  $instance_id = 0,
79
  $saas_connection = null,
80
  WPDesk_Flexible_Shipping_SaaS_Platform_Links $saas_platform_links = null,
81
+ $shipping_methods_manager = null,
82
+ ABVariant $variant
83
  ) {
84
  parent::__construct( $instance_id );
85
  $this->id = self::METHOD_ID;
86
  $this->enabled = 'no';
87
  $this->method_title = __( 'Flexible Shipping', 'flexible-shipping' );
88
+ $this->variant = $variant;
89
 
90
  $this->supports = array(
91
  'settings',
364
  include 'views/html-settings-connect-script.php';
365
  include 'views/html-shipping-method-info-description.php';
366
  $html .= ob_get_clean();
367
+
368
  if ( $echo ) {
369
  echo $html;
370
  } else {
classes/saas/class-saas-shipping-services-manager.php CHANGED
@@ -1,8 +1,10 @@
1
  <?php
2
-
3
  /**
4
  * Class WPDesk_Flexible_Shipping_Shipping_Methods_Manager
5
  */
 
 
 
6
  class WPDesk_Flexible_Shipping_SaaS_Services_Manager
7
  implements \WPDesk\PluginBuilder\Plugin\HookablePluginDependant
8
  {
@@ -69,6 +71,13 @@ class WPDesk_Flexible_Shipping_SaaS_Services_Manager
69
  */
70
  private $logger;
71
 
 
 
 
 
 
 
 
72
  /**
73
  * WPDesk_Flexible_Shipping_Services constructor.
74
  *
@@ -79,8 +88,12 @@ class WPDesk_Flexible_Shipping_SaaS_Services_Manager
79
  public function __construct(
80
  WPDesk_Flexible_Shipping_SaaS_Connection $saas_connection,
81
  WPDesk_Flexible_Shipping_SaaS_Platform_Links $saas_platform_links,
82
- \Psr\Log\LoggerInterface $logger = null
 
83
  ) {
 
 
 
84
  $this->saas_connection = $saas_connection;
85
  if ( null !== $logger ) {
86
  $this->logger = $logger;
@@ -366,7 +379,9 @@ class WPDesk_Flexible_Shipping_SaaS_Services_Manager
366
  $this->shipping_method_connect = new WPDesk_Flexible_Shipping_SaaS_Settings(
367
  0,
368
  $this->saas_connection,
369
- $this->saas_platform_links
 
 
370
  );
371
  $this->shipping_method_connect->set_shipping_methods_manager( $this );
372
  }
1
  <?php
 
2
  /**
3
  * Class WPDesk_Flexible_Shipping_Shipping_Methods_Manager
4
  */
5
+
6
+ use WPDesk\ABTesting\ABVariant;
7
+
8
  class WPDesk_Flexible_Shipping_SaaS_Services_Manager
9
  implements \WPDesk\PluginBuilder\Plugin\HookablePluginDependant
10
  {
71
  */
72
  private $logger;
73
 
74
+ /**
75
+ * Selected variant for AB message testing.
76
+ *
77
+ * @var ABVariant
78
+ */
79
+ private $variant;
80
+
81
  /**
82
  * WPDesk_Flexible_Shipping_Services constructor.
83
  *
88
  public function __construct(
89
  WPDesk_Flexible_Shipping_SaaS_Connection $saas_connection,
90
  WPDesk_Flexible_Shipping_SaaS_Platform_Links $saas_platform_links,
91
+ \Psr\Log\LoggerInterface $logger = null,
92
+ ABVariant $variant_id
93
  ) {
94
+
95
+ $this->variant_id = $variant_id;
96
+
97
  $this->saas_connection = $saas_connection;
98
  if ( null !== $logger ) {
99
  $this->logger = $logger;
379
  $this->shipping_method_connect = new WPDesk_Flexible_Shipping_SaaS_Settings(
380
  0,
381
  $this->saas_connection,
382
+ $this->saas_platform_links,
383
+ null,
384
+ $this->variant_id
385
  );
386
  $this->shipping_method_connect->set_shipping_methods_manager( $this );
387
  }
classes/saas/class-saas-user-registration.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  if ( ! defined( 'ABSPATH' ) ) {
4
  exit;
5
  } // Exit if accessed directly
@@ -60,18 +62,29 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping_SaaS_User_Registration' ) ) {
60
  */
61
  private $saas_platform_links;
62
 
 
 
 
 
 
 
 
63
  /**
64
  * WPDesk_Flexible_Shipping_Services constructor.
65
  *
66
  * @param WPDesk_Flexible_Shipping_SaaS_Connection $saas_connection Connection.
67
  * @param WPDesk_Flexible_Shipping_SaaS_Platform_Links $saas_platform_links Links.
 
68
  */
69
  public function __construct(
70
  WPDesk_Flexible_Shipping_SaaS_Connection $saas_connection,
71
- WPDesk_Flexible_Shipping_SaaS_Platform_Links $saas_platform_links
 
72
  ) {
73
  $this->saas_connection = $saas_connection;
74
  $this->saas_platform_links = $saas_platform_links;
 
 
75
  if ( ! $this->saas_connection->is_connected() && ! $this->is_on_setings_page() ) {
76
  $this->add_hookable( new WPDesk_Flexible_Shipping_SaaS_Registration_Second_Notice( self::FS_CONNECT_FIRST_NOTICE_NAME ) );
77
  }
@@ -113,7 +126,11 @@ if ( ! class_exists( 'WPDesk_Flexible_Shipping_SaaS_User_Registration' ) ) {
113
  public function hooks() {
114
  add_filter( 'removable_query_args', [ $this, 'add_email_parameters_to_removable_query_args' ] );
115
  add_action( 'admin_init', [ $this, 'register_user_and_add_notice' ] );
116
- add_action( 'admin_init', [ $this, 'register_form_notice' ], self::PRIORITY_AFTER_DEFAULT );
 
 
 
 
117
  add_action( 'admin_init', [ $this, 'create_registration_notices' ] );
118
  add_action( 'admin_menu', [ $this, 'add_registration_page' ] );
119
  $this->hooks_on_hookable_objects();
1
  <?php
2
 
3
+ use WPDesk\ABTesting\ABVariant;
4
+
5
  if ( ! defined( 'ABSPATH' ) ) {
6
  exit;
7
  } // Exit if accessed directly
62
  */
63
  private $saas_platform_links;
64
 
65
+ /**
66
+ * Selected variant for AB message testing.
67
+ *
68
+ * @var ABVariant
69
+ */
70
+ private $variant;
71
+
72
  /**
73
  * WPDesk_Flexible_Shipping_Services constructor.
74
  *
75
  * @param WPDesk_Flexible_Shipping_SaaS_Connection $saas_connection Connection.
76
  * @param WPDesk_Flexible_Shipping_SaaS_Platform_Links $saas_platform_links Links.
77
+ * @param ABVariant $variant .
78
  */
79
  public function __construct(
80
  WPDesk_Flexible_Shipping_SaaS_Connection $saas_connection,
81
+ WPDesk_Flexible_Shipping_SaaS_Platform_Links $saas_platform_links,
82
+ ABVariant $variant
83
  ) {
84
  $this->saas_connection = $saas_connection;
85
  $this->saas_platform_links = $saas_platform_links;
86
+ $this->variant = $variant;
87
+
88
  if ( ! $this->saas_connection->is_connected() && ! $this->is_on_setings_page() ) {
89
  $this->add_hookable( new WPDesk_Flexible_Shipping_SaaS_Registration_Second_Notice( self::FS_CONNECT_FIRST_NOTICE_NAME ) );
90
  }
126
  public function hooks() {
127
  add_filter( 'removable_query_args', [ $this, 'add_email_parameters_to_removable_query_args' ] );
128
  add_action( 'admin_init', [ $this, 'register_user_and_add_notice' ] );
129
+
130
+ if( $this->variant->is_on( WPDesk_Flexible_Shipping_AB_MessageTest::MESSAGE_CONNECT ) ) {
131
+ add_action( 'admin_init', [ $this, 'register_form_notice' ], self::PRIORITY_AFTER_DEFAULT );
132
+ }
133
+
134
  add_action( 'admin_init', [ $this, 'create_registration_notices' ] );
135
  add_action( 'admin_menu', [ $this, 'add_registration_page' ] );
136
  $this->hooks_on_hookable_objects();
classes/saas/views/html-shipping-method-info-description.php CHANGED
@@ -24,8 +24,7 @@
24
  include( 'html-boxes-content.php' );
25
  }
26
  ?>
27
-
28
- <div class="fs-box">
29
  <h3 class="wc-settings-sub-title">Flexible Shipping Table Rate</h3>
30
 
31
  <ol>
@@ -64,7 +63,14 @@
64
  jQuery(document).ready(function() {
65
  //jQuery('.woocommerce-save-button').hide();
66
  jQuery('#mainform p.submit').appendTo( jQuery('.fs-box.fs-services') );
67
- })
 
 
 
 
 
 
 
68
  </script>
69
 
70
  </div><!-- Closes .fs-page-wrap -->
24
  include( 'html-boxes-content.php' );
25
  }
26
  ?>
27
+ <div class="fs-box" id="flexible-shipping-table-rate">
 
28
  <h3 class="wc-settings-sub-title">Flexible Shipping Table Rate</h3>
29
 
30
  <ol>
63
  jQuery(document).ready(function() {
64
  //jQuery('.woocommerce-save-button').hide();
65
  jQuery('#mainform p.submit').appendTo( jQuery('.fs-box.fs-services') );
66
+ });
67
+ <?php if( !$this->variant->is_on( WPDesk_Flexible_Shipping_AB_MessageTest::MESSAGE_CONNECT ) ): ?>
68
+ jQuery(document).ready(function() {
69
+ var fs_wrap = jQuery('.fs-page-wrap');
70
+ jQuery('#flexible-shipping-table-rate').prependTo( fs_wrap );
71
+ fs_wrap.fadeIn();
72
+ });
73
+ <?php endif; ?>
74
  </script>
75
 
76
  </div><!-- Closes .fs-page-wrap -->
classes/tracker.php CHANGED
@@ -166,6 +166,10 @@ class WPDesk_Flexible_Shipping_Tracker {
166
  $data['flexible_shipping']['avg_rules'] = $data['flexible_shipping']['avg_rules'] / $data['flexible_shipping']['total_shipping_methods'];
167
  }
168
 
 
 
 
 
169
  return $data;
170
  }
171
 
@@ -246,7 +250,7 @@ class WPDesk_Flexible_Shipping_Tracker {
246
  if ( '0' === $options['wpdesk_tracker_agree'] && '0' === $wpdesk_tracker_skip_plugin ) {
247
  update_option( 'wpdesk_tracker_notice', '1' );
248
  update_option( 'wpdesk_tracker_skip_flexible_shipping', '1' );
249
- if ( ! apply_filters( 'wpdesk_tracker_do_not_ask', false ) ) {
250
  wp_safe_redirect( admin_url( 'admin.php?page=wpdesk_tracker&plugin=flexible-shipping/flexible-shipping.php' ) );
251
  exit;
252
  }
166
  $data['flexible_shipping']['avg_rules'] = $data['flexible_shipping']['avg_rules'] / $data['flexible_shipping']['total_shipping_methods'];
167
  }
168
 
169
+ $button = WPDesk_Flexible_Shipping_Tracker_Button::get_button_pagetype();
170
+ if( $button ) {
171
+ $data['flexible_shipping']['button_tracking_pagetype'] = $button;
172
+ }
173
  return $data;
174
  }
175
 
250
  if ( '0' === $options['wpdesk_tracker_agree'] && '0' === $wpdesk_tracker_skip_plugin ) {
251
  update_option( 'wpdesk_tracker_notice', '1' );
252
  update_option( 'wpdesk_tracker_skip_flexible_shipping', '1' );
253
+ if ( ! apply_filters( 'wpdesk_tracker_do_not_ask', false ) && ! apply_filters( 'wpdesk_tracker_hide_activation_message', false ) ) {
254
  wp_safe_redirect( admin_url( 'admin.php?page=wpdesk_tracker&plugin=flexible-shipping/flexible-shipping.php' ) );
255
  exit;
256
  }
flexible-shipping.php CHANGED
@@ -3,7 +3,7 @@
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: 3.1.5
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
@@ -43,8 +43,9 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
43
 
44
 
45
  /* THESE TWO VARIABLES CAN BE CHANGED AUTOMATICALLY */
46
- $plugin_version = '3.1.5';
47
- $plugin_release_timestamp = '2018-11-28';
 
48
 
49
  $plugin_name = 'Flexible Shipping';
50
  $plugin_class_name = 'Flexible_Shipping_Plugin';
@@ -79,6 +80,8 @@ if ( $requirements_checker->are_requirements_met() ) {
79
 
80
  require_once dirname( __FILE__ ) . '/plugin-load.php';
81
 
 
 
82
  } else {
83
  $requirements_checker->disable_plugin_render_notice();
84
  }
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: 3.1.6
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
43
 
44
 
45
  /* THESE TWO VARIABLES CAN BE CHANGED AUTOMATICALLY */
46
+
47
+ $plugin_version = '3.1.6';
48
+ $plugin_release_timestamp = '2019-02-06';
49
 
50
  $plugin_name = 'Flexible Shipping';
51
  $plugin_class_name = 'Flexible_Shipping_Plugin';
80
 
81
  require_once dirname( __FILE__ ) . '/plugin-load.php';
82
 
83
+ require_once __DIR__ . '/ab-tests.php';
84
+
85
  } else {
86
  $requirements_checker->disable_plugin_render_notice();
87
  }
inc/wpdesk-tracker/class-wpdesk-tracker.php CHANGED
@@ -394,7 +394,7 @@ if ( ! class_exists( 'WPDesk_Tracker' ) ) {
394
  $params['additional_info'] = $_REQUEST['additional_info'];
395
  }
396
 
397
- $this->send_payload_to_wpdesk( $params );
398
  }
399
 
400
  /**
394
  $params['additional_info'] = $_REQUEST['additional_info'];
395
  }
396
 
397
+ $this->send_payload_to_wpdesk( apply_filters( 'wpdesk_tracker_deactivation_data', $params ) );
398
  }
399
 
400
  /**
plugin-create.php CHANGED
@@ -37,7 +37,6 @@ require_once( __DIR__ . '/classes/manifest/functions.php' );
37
 
38
  if ( !function_exists( 'wpdesk_is_plugin_active' ) ) {
39
  function wpdesk_is_plugin_active( $plugin_file ) {
40
-
41
  $active_plugins = (array) get_option( 'active_plugins', array() );
42
 
43
  if ( is_multisite() ) {
37
 
38
  if ( !function_exists( 'wpdesk_is_plugin_active' ) ) {
39
  function wpdesk_is_plugin_active( $plugin_file ) {
 
40
  $active_plugins = (array) get_option( 'active_plugins', array() );
41
 
42
  if ( is_multisite() ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://flexibleshipping.com/table-rate/
4
  Tags: table rate, table rate 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
5
  Requires at least: 4.5
6
  Tested up to: 5.0.3
7
- Stable tag: 3.1.5
8
  Requires PHP: 5.6
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -175,12 +175,14 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
175
 
176
  == Changelog ==
177
 
 
 
 
178
  = 3.1.5 - 2019-02-04 =
179
  * Fixed parameters order in notice constructor
180
  * Fixed default shipment method in cart/checkout
181
 
182
  = 3.1.4 - 2019-01-28 =
183
-
184
  * Fixed fatal when free shipment
185
  * Fixed issue for shipment with no costs
186
 
4
  Tags: table rate, table rate 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
5
  Requires at least: 4.5
6
  Tested up to: 5.0.3
7
+ Stable tag: 3.1.6
8
  Requires PHP: 5.6
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
175
 
176
  == Changelog ==
177
 
178
+ = 3.1.6 - 2019-02-07 =
179
+ * Added filter for deactivation data in tracker
180
+
181
  = 3.1.5 - 2019-02-04 =
182
  * Fixed parameters order in notice constructor
183
  * Fixed default shipment method in cart/checkout
184
 
185
  = 3.1.4 - 2019-01-28 =
 
186
  * Fixed fatal when free shipment
187
  * Fixed issue for shipment with no costs
188
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit807a2cc88a434c4f0cc2747b964dd5bb::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit87e9e7f70ae0673cfec948c8ccfad672::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -249,6 +249,10 @@ return array(
249
  'S214_Plugin_Updater' => $vendorDir . '/wpdesk/wp-settings/source/modules/licensing/S214_Plugin_Updater.php',
250
  'S214_Settings' => $vendorDir . '/wpdesk/wp-settings/source/class.s214-settings.php',
251
  'S214_Sysinfo' => $vendorDir . '/wpdesk/wp-settings/source/modules/sysinfo/class.s214-sysinfo.php',
 
 
 
 
252
  'WPDesk\\Logger\\BasicLoggerFactory' => $vendorDir . '/wpdesk/wp-logs/src/BasicLoggerFactory.php',
253
  'WPDesk\\Logger\\LoggerFacade' => $vendorDir . '/wpdesk/wp-logs/src/LoggerFacade.php',
254
  'WPDesk\\Logger\\LoggerFactory' => $vendorDir . '/wpdesk/wp-logs/src/LoggerFactory.php',
@@ -268,6 +272,11 @@ return array(
268
  'WPDesk\\Notice\\Factory' => $vendorDir . '/wpdesk/wp-notice/src/WPDesk/Notice/Factory.php',
269
  'WPDesk\\Notice\\Notice' => $vendorDir . '/wpdesk/wp-notice/src/WPDesk/Notice/Notice.php',
270
  'WPDesk\\Notice\\PermanentDismissibleNotice' => $vendorDir . '/wpdesk/wp-notice/src/WPDesk/Notice/PermanentDismissibleNotice.php',
 
 
 
 
 
271
  'WPDesk\\PluginBuilder\\BuildDirector\\LegacyBuildDirector' => $vendorDir . '/wpdesk/wp-builder/src/BuildDirector/LegacyBuildDirector.php',
272
  'WPDesk\\PluginBuilder\\Builder\\AbstractBuilder' => $vendorDir . '/wpdesk/wp-builder/src/Builder/AbstractBuilder.php',
273
  'WPDesk\\PluginBuilder\\Builder\\InfoBuilder' => $vendorDir . '/wpdesk/wp-builder/src/Builder/InfoBuilder.php',
@@ -414,6 +423,14 @@ return array(
414
  'WPDesk\\View\\Resolver\\Resolver' => $vendorDir . '/wpdesk/wp-view/src/Resolver/Resolver.php',
415
  'WPDesk\\View\\Resolver\\WPThemeResolver' => $vendorDir . '/wpdesk/wp-view/src/Resolver/WPThemeResolver.php',
416
  'WPDesk_Flexible_Shipping' => $baseDir . '/classes/shipping-method.php',
 
 
 
 
 
 
 
 
417
  'WPDesk_Flexible_Shipping_Add_Shipping' => $baseDir . '/classes/class-order-add-shipping.php',
418
  'WPDesk_Flexible_Shipping_Admin_Notices' => $baseDir . '/classes/admin-notices.php',
419
  'WPDesk_Flexible_Shipping_Bulk_Actions' => $baseDir . '/classes/bulk-actions.php',
@@ -482,6 +499,7 @@ return array(
482
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Dimension' => $baseDir . '/classes/class-shortcode-unit-dimension.php',
483
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Weight' => $baseDir . '/classes/class-shortcode-unit-weight.php',
484
  'WPDesk_Flexible_Shipping_Tracker' => $baseDir . '/classes/tracker.php',
 
485
  'WPDesk_Flexible_Shipping_UK_States' => $baseDir . '/classes/class-uk-states.php',
486
  'WPDesk_Flexible_Shipping_WooCommerce_Context_Logger' => $baseDir . '/classes/logger/class-woocommerce-context-logger.php',
487
  'WPDesk_S214_Settings' => $vendorDir . '/wpdesk/wp-settings/source/class.wpdesk-s214-settings.php',
249
  'S214_Plugin_Updater' => $vendorDir . '/wpdesk/wp-settings/source/modules/licensing/S214_Plugin_Updater.php',
250
  'S214_Settings' => $vendorDir . '/wpdesk/wp-settings/source/class.s214-settings.php',
251
  'S214_Sysinfo' => $vendorDir . '/wpdesk/wp-settings/source/modules/sysinfo/class.s214-sysinfo.php',
252
+ 'WPDesk\\ABTesting\\ABTest' => $vendorDir . '/wpdesk/wp-abtesting/src/ABTest.php',
253
+ 'WPDesk\\ABTesting\\ABTest\\EqualGroupsRandomABTest' => $vendorDir . '/wpdesk/wp-abtesting/src/ABTest/EqualGroupsRandomABTest.php',
254
+ 'WPDesk\\ABTesting\\ABVariant' => $vendorDir . '/wpdesk/wp-abtesting/src/ABVariant.php',
255
+ 'WPDesk\\ABTesting\\ABVariant\\BasicABVariant' => $vendorDir . '/wpdesk/wp-abtesting/src/ABVariant/BasicABVariant.php',
256
  'WPDesk\\Logger\\BasicLoggerFactory' => $vendorDir . '/wpdesk/wp-logs/src/BasicLoggerFactory.php',
257
  'WPDesk\\Logger\\LoggerFacade' => $vendorDir . '/wpdesk/wp-logs/src/LoggerFacade.php',
258
  'WPDesk\\Logger\\LoggerFactory' => $vendorDir . '/wpdesk/wp-logs/src/LoggerFactory.php',
272
  'WPDesk\\Notice\\Factory' => $vendorDir . '/wpdesk/wp-notice/src/WPDesk/Notice/Factory.php',
273
  'WPDesk\\Notice\\Notice' => $vendorDir . '/wpdesk/wp-notice/src/WPDesk/Notice/Notice.php',
274
  'WPDesk\\Notice\\PermanentDismissibleNotice' => $vendorDir . '/wpdesk/wp-notice/src/WPDesk/Notice/PermanentDismissibleNotice.php',
275
+ 'WPDesk\\Persistence\\ElementNotExistsException' => $vendorDir . '/wpdesk/wp-persistence/src/ElementNotExistsException.php',
276
+ 'WPDesk\\Persistence\\MemoryContainer' => $vendorDir . '/wpdesk/wp-persistence/src/MemoryContainer.php',
277
+ 'WPDesk\\Persistence\\PersistentContainer' => $vendorDir . '/wpdesk/wp-persistence/src/PersistentContainer.php',
278
+ 'WPDesk\\Persistence\\Wordpress\\WordpressOptionsContainer' => $vendorDir . '/wpdesk/wp-persistence/src/Wordpress/WordpressOptionsContainer.php',
279
+ 'WPDesk\\Persistence\\Wordpress\\WordpressTransientContainer' => $vendorDir . '/wpdesk/wp-persistence/src/Wordpress/WordpressTransientContainer.php',
280
  'WPDesk\\PluginBuilder\\BuildDirector\\LegacyBuildDirector' => $vendorDir . '/wpdesk/wp-builder/src/BuildDirector/LegacyBuildDirector.php',
281
  'WPDesk\\PluginBuilder\\Builder\\AbstractBuilder' => $vendorDir . '/wpdesk/wp-builder/src/Builder/AbstractBuilder.php',
282
  'WPDesk\\PluginBuilder\\Builder\\InfoBuilder' => $vendorDir . '/wpdesk/wp-builder/src/Builder/InfoBuilder.php',
423
  'WPDesk\\View\\Resolver\\Resolver' => $vendorDir . '/wpdesk/wp-view/src/Resolver/Resolver.php',
424
  'WPDesk\\View\\Resolver\\WPThemeResolver' => $vendorDir . '/wpdesk/wp-view/src/Resolver/WPThemeResolver.php',
425
  'WPDesk_Flexible_Shipping' => $baseDir . '/classes/shipping-method.php',
426
+ 'WPDesk_Flexible_Shipping_AB_MessageTest' => $baseDir . '/classes/abtests/class-ab-message-test.php',
427
+ 'WPDesk_Flexible_Shipping_AB_PluginActivation' => $baseDir . '/classes/abtests/class-ab-plugin-activation.php',
428
+ 'WPDesk_Flexible_Shipping_AB_Tracker_Deactivation_Data' => $baseDir . '/classes/abtests/class-ab-tracker-deactivation-data.php',
429
+ 'WPDesk_Flexible_Shipping_AB_Variant_Both_Messages' => $baseDir . '/classes/abtests/ab-message-test/class-ab-variant-both-messages.php',
430
+ 'WPDesk_Flexible_Shipping_AB_Variant_Connect_NO_Tracker' => $baseDir . '/classes/abtests/ab-message-test/class-ab-variant-connect-no-tracker.php',
431
+ 'WPDesk_Flexible_Shipping_AB_Variant_No_Connect_Tracker' => $baseDir . '/classes/abtests/ab-message-test/class-ab-variant-no-connect-tracker.php',
432
+ 'WPDesk_Flexible_Shipping_AB_Variant_No_Messages' => $baseDir . '/classes/abtests/ab-message-test/class-ab-variant-no-messages.php',
433
+ 'WPDesk_Flexible_Shipping_AB_Variant_Old' => $baseDir . '/classes/abtests/ab-message-test/class-ab-variant-old.php',
434
  'WPDesk_Flexible_Shipping_Add_Shipping' => $baseDir . '/classes/class-order-add-shipping.php',
435
  'WPDesk_Flexible_Shipping_Admin_Notices' => $baseDir . '/classes/admin-notices.php',
436
  'WPDesk_Flexible_Shipping_Bulk_Actions' => $baseDir . '/classes/bulk-actions.php',
499
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Dimension' => $baseDir . '/classes/class-shortcode-unit-dimension.php',
500
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Weight' => $baseDir . '/classes/class-shortcode-unit-weight.php',
501
  'WPDesk_Flexible_Shipping_Tracker' => $baseDir . '/classes/tracker.php',
502
+ 'WPDesk_Flexible_Shipping_Tracker_Button' => $baseDir . '/classes/abtests/class-tracker-button.php',
503
  'WPDesk_Flexible_Shipping_UK_States' => $baseDir . '/classes/class-uk-states.php',
504
  'WPDesk_Flexible_Shipping_WooCommerce_Context_Logger' => $baseDir . '/classes/logger/class-woocommerce-context-logger.php',
505
  'WPDesk_S214_Settings' => $vendorDir . '/wpdesk/wp-settings/source/class.wpdesk-s214-settings.php',
vendor/composer/autoload_psr4.php CHANGED
@@ -9,9 +9,11 @@ return array(
9
  'WPDesk\\View\\' => array($vendorDir . '/wpdesk/wp-view/src'),
10
  'WPDesk\\SaasPlatformClient\\' => array($vendorDir . '/wpdesk/wp-saas-platform-client/src'),
11
  'WPDesk\\PluginBuilder\\' => array($vendorDir . '/wpdesk/wp-builder/src'),
 
12
  'WPDesk\\Notice\\' => array($vendorDir . '/wpdesk/wp-notice/src/WPDesk/Notice'),
13
  'WPDesk\\Mutex\\' => array($vendorDir . '/wpdesk/wp-mutex/src/WPDesk/Mutex'),
14
  'WPDesk\\Logger\\' => array($vendorDir . '/wpdesk/wp-logs/src'),
 
15
  'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
16
  'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
17
  'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
9
  'WPDesk\\View\\' => array($vendorDir . '/wpdesk/wp-view/src'),
10
  'WPDesk\\SaasPlatformClient\\' => array($vendorDir . '/wpdesk/wp-saas-platform-client/src'),
11
  'WPDesk\\PluginBuilder\\' => array($vendorDir . '/wpdesk/wp-builder/src'),
12
+ 'WPDesk\\Persistence\\' => array($vendorDir . '/wpdesk/wp-persistence/src'),
13
  'WPDesk\\Notice\\' => array($vendorDir . '/wpdesk/wp-notice/src/WPDesk/Notice'),
14
  'WPDesk\\Mutex\\' => array($vendorDir . '/wpdesk/wp-mutex/src/WPDesk/Mutex'),
15
  'WPDesk\\Logger\\' => array($vendorDir . '/wpdesk/wp-logs/src'),
16
+ 'WPDesk\\ABTesting\\' => array($vendorDir . '/wpdesk/wp-abtesting/src'),
17
  'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
18
  'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
19
  'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit807a2cc88a434c4f0cc2747b964dd5bb
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit807a2cc88a434c4f0cc2747b964dd5bb
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit807a2cc88a434c4f0cc2747b964dd5bb', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit807a2cc88a434c4f0cc2747b964dd5bb', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit807a2cc88a434c4f0cc2747b964dd5bb
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequire807a2cc88a434c4f0cc2747b964dd5bb($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequire807a2cc88a434c4f0cc2747b964dd5bb($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit87e9e7f70ae0673cfec948c8ccfad672
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit87e9e7f70ae0673cfec948c8ccfad672', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit87e9e7f70ae0673cfec948c8ccfad672', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequire87e9e7f70ae0673cfec948c8ccfad672($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequire87e9e7f70ae0673cfec948c8ccfad672($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb
8
  {
9
  public static $files = array (
10
  '46ae4ad8c3479aabff48f598a0e4b93f' => __DIR__ . '/..' . '/wpdesk/wp-mutex/src/WPDesk/functions.php',
@@ -17,9 +17,11 @@ class ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb
17
  'WPDesk\\View\\' => 12,
18
  'WPDesk\\SaasPlatformClient\\' => 26,
19
  'WPDesk\\PluginBuilder\\' => 21,
 
20
  'WPDesk\\Notice\\' => 14,
21
  'WPDesk\\Mutex\\' => 13,
22
  'WPDesk\\Logger\\' => 14,
 
23
  ),
24
  'P' =>
25
  array (
@@ -50,6 +52,10 @@ class ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb
50
  array (
51
  0 => __DIR__ . '/..' . '/wpdesk/wp-builder/src',
52
  ),
 
 
 
 
53
  'WPDesk\\Notice\\' =>
54
  array (
55
  0 => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/Notice',
@@ -62,6 +68,10 @@ class ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb
62
  array (
63
  0 => __DIR__ . '/..' . '/wpdesk/wp-logs/src',
64
  ),
 
 
 
 
65
  'Psr\\SimpleCache\\' =>
66
  array (
67
  0 => __DIR__ . '/..' . '/psr/simple-cache/src',
@@ -328,6 +338,10 @@ class ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb
328
  'S214_Plugin_Updater' => __DIR__ . '/..' . '/wpdesk/wp-settings/source/modules/licensing/S214_Plugin_Updater.php',
329
  'S214_Settings' => __DIR__ . '/..' . '/wpdesk/wp-settings/source/class.s214-settings.php',
330
  'S214_Sysinfo' => __DIR__ . '/..' . '/wpdesk/wp-settings/source/modules/sysinfo/class.s214-sysinfo.php',
 
 
 
 
331
  'WPDesk\\Logger\\BasicLoggerFactory' => __DIR__ . '/..' . '/wpdesk/wp-logs/src/BasicLoggerFactory.php',
332
  'WPDesk\\Logger\\LoggerFacade' => __DIR__ . '/..' . '/wpdesk/wp-logs/src/LoggerFacade.php',
333
  'WPDesk\\Logger\\LoggerFactory' => __DIR__ . '/..' . '/wpdesk/wp-logs/src/LoggerFactory.php',
@@ -347,6 +361,11 @@ class ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb
347
  'WPDesk\\Notice\\Factory' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/Notice/Factory.php',
348
  'WPDesk\\Notice\\Notice' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/Notice/Notice.php',
349
  'WPDesk\\Notice\\PermanentDismissibleNotice' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/Notice/PermanentDismissibleNotice.php',
 
 
 
 
 
350
  'WPDesk\\PluginBuilder\\BuildDirector\\LegacyBuildDirector' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/BuildDirector/LegacyBuildDirector.php',
351
  'WPDesk\\PluginBuilder\\Builder\\AbstractBuilder' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Builder/AbstractBuilder.php',
352
  'WPDesk\\PluginBuilder\\Builder\\InfoBuilder' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Builder/InfoBuilder.php',
@@ -493,6 +512,14 @@ class ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb
493
  'WPDesk\\View\\Resolver\\Resolver' => __DIR__ . '/..' . '/wpdesk/wp-view/src/Resolver/Resolver.php',
494
  'WPDesk\\View\\Resolver\\WPThemeResolver' => __DIR__ . '/..' . '/wpdesk/wp-view/src/Resolver/WPThemeResolver.php',
495
  'WPDesk_Flexible_Shipping' => __DIR__ . '/../..' . '/classes/shipping-method.php',
 
 
 
 
 
 
 
 
496
  'WPDesk_Flexible_Shipping_Add_Shipping' => __DIR__ . '/../..' . '/classes/class-order-add-shipping.php',
497
  'WPDesk_Flexible_Shipping_Admin_Notices' => __DIR__ . '/../..' . '/classes/admin-notices.php',
498
  'WPDesk_Flexible_Shipping_Bulk_Actions' => __DIR__ . '/../..' . '/classes/bulk-actions.php',
@@ -561,6 +588,7 @@ class ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb
561
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Dimension' => __DIR__ . '/../..' . '/classes/class-shortcode-unit-dimension.php',
562
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Weight' => __DIR__ . '/../..' . '/classes/class-shortcode-unit-weight.php',
563
  'WPDesk_Flexible_Shipping_Tracker' => __DIR__ . '/../..' . '/classes/tracker.php',
 
564
  'WPDesk_Flexible_Shipping_UK_States' => __DIR__ . '/../..' . '/classes/class-uk-states.php',
565
  'WPDesk_Flexible_Shipping_WooCommerce_Context_Logger' => __DIR__ . '/../..' . '/classes/logger/class-woocommerce-context-logger.php',
566
  'WPDesk_S214_Settings' => __DIR__ . '/..' . '/wpdesk/wp-settings/source/class.wpdesk-s214-settings.php',
@@ -598,9 +626,9 @@ class ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb
598
  public static function getInitializer(ClassLoader $loader)
599
  {
600
  return \Closure::bind(function () use ($loader) {
601
- $loader->prefixLengthsPsr4 = ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb::$prefixLengthsPsr4;
602
- $loader->prefixDirsPsr4 = ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb::$prefixDirsPsr4;
603
- $loader->classMap = ComposerStaticInit807a2cc88a434c4f0cc2747b964dd5bb::$classMap;
604
 
605
  }, null, ClassLoader::class);
606
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672
8
  {
9
  public static $files = array (
10
  '46ae4ad8c3479aabff48f598a0e4b93f' => __DIR__ . '/..' . '/wpdesk/wp-mutex/src/WPDesk/functions.php',
17
  'WPDesk\\View\\' => 12,
18
  'WPDesk\\SaasPlatformClient\\' => 26,
19
  'WPDesk\\PluginBuilder\\' => 21,
20
+ 'WPDesk\\Persistence\\' => 19,
21
  'WPDesk\\Notice\\' => 14,
22
  'WPDesk\\Mutex\\' => 13,
23
  'WPDesk\\Logger\\' => 14,
24
+ 'WPDesk\\ABTesting\\' => 17,
25
  ),
26
  'P' =>
27
  array (
52
  array (
53
  0 => __DIR__ . '/..' . '/wpdesk/wp-builder/src',
54
  ),
55
+ 'WPDesk\\Persistence\\' =>
56
+ array (
57
+ 0 => __DIR__ . '/..' . '/wpdesk/wp-persistence/src',
58
+ ),
59
  'WPDesk\\Notice\\' =>
60
  array (
61
  0 => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/Notice',
68
  array (
69
  0 => __DIR__ . '/..' . '/wpdesk/wp-logs/src',
70
  ),
71
+ 'WPDesk\\ABTesting\\' =>
72
+ array (
73
+ 0 => __DIR__ . '/..' . '/wpdesk/wp-abtesting/src',
74
+ ),
75
  'Psr\\SimpleCache\\' =>
76
  array (
77
  0 => __DIR__ . '/..' . '/psr/simple-cache/src',
338
  'S214_Plugin_Updater' => __DIR__ . '/..' . '/wpdesk/wp-settings/source/modules/licensing/S214_Plugin_Updater.php',
339
  'S214_Settings' => __DIR__ . '/..' . '/wpdesk/wp-settings/source/class.s214-settings.php',
340
  'S214_Sysinfo' => __DIR__ . '/..' . '/wpdesk/wp-settings/source/modules/sysinfo/class.s214-sysinfo.php',
341
+ 'WPDesk\\ABTesting\\ABTest' => __DIR__ . '/..' . '/wpdesk/wp-abtesting/src/ABTest.php',
342
+ 'WPDesk\\ABTesting\\ABTest\\EqualGroupsRandomABTest' => __DIR__ . '/..' . '/wpdesk/wp-abtesting/src/ABTest/EqualGroupsRandomABTest.php',
343
+ 'WPDesk\\ABTesting\\ABVariant' => __DIR__ . '/..' . '/wpdesk/wp-abtesting/src/ABVariant.php',
344
+ 'WPDesk\\ABTesting\\ABVariant\\BasicABVariant' => __DIR__ . '/..' . '/wpdesk/wp-abtesting/src/ABVariant/BasicABVariant.php',
345
  'WPDesk\\Logger\\BasicLoggerFactory' => __DIR__ . '/..' . '/wpdesk/wp-logs/src/BasicLoggerFactory.php',
346
  'WPDesk\\Logger\\LoggerFacade' => __DIR__ . '/..' . '/wpdesk/wp-logs/src/LoggerFacade.php',
347
  'WPDesk\\Logger\\LoggerFactory' => __DIR__ . '/..' . '/wpdesk/wp-logs/src/LoggerFactory.php',
361
  'WPDesk\\Notice\\Factory' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/Notice/Factory.php',
362
  'WPDesk\\Notice\\Notice' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/Notice/Notice.php',
363
  'WPDesk\\Notice\\PermanentDismissibleNotice' => __DIR__ . '/..' . '/wpdesk/wp-notice/src/WPDesk/Notice/PermanentDismissibleNotice.php',
364
+ 'WPDesk\\Persistence\\ElementNotExistsException' => __DIR__ . '/..' . '/wpdesk/wp-persistence/src/ElementNotExistsException.php',
365
+ 'WPDesk\\Persistence\\MemoryContainer' => __DIR__ . '/..' . '/wpdesk/wp-persistence/src/MemoryContainer.php',
366
+ 'WPDesk\\Persistence\\PersistentContainer' => __DIR__ . '/..' . '/wpdesk/wp-persistence/src/PersistentContainer.php',
367
+ 'WPDesk\\Persistence\\Wordpress\\WordpressOptionsContainer' => __DIR__ . '/..' . '/wpdesk/wp-persistence/src/Wordpress/WordpressOptionsContainer.php',
368
+ 'WPDesk\\Persistence\\Wordpress\\WordpressTransientContainer' => __DIR__ . '/..' . '/wpdesk/wp-persistence/src/Wordpress/WordpressTransientContainer.php',
369
  'WPDesk\\PluginBuilder\\BuildDirector\\LegacyBuildDirector' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/BuildDirector/LegacyBuildDirector.php',
370
  'WPDesk\\PluginBuilder\\Builder\\AbstractBuilder' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Builder/AbstractBuilder.php',
371
  'WPDesk\\PluginBuilder\\Builder\\InfoBuilder' => __DIR__ . '/..' . '/wpdesk/wp-builder/src/Builder/InfoBuilder.php',
512
  'WPDesk\\View\\Resolver\\Resolver' => __DIR__ . '/..' . '/wpdesk/wp-view/src/Resolver/Resolver.php',
513
  'WPDesk\\View\\Resolver\\WPThemeResolver' => __DIR__ . '/..' . '/wpdesk/wp-view/src/Resolver/WPThemeResolver.php',
514
  'WPDesk_Flexible_Shipping' => __DIR__ . '/../..' . '/classes/shipping-method.php',
515
+ 'WPDesk_Flexible_Shipping_AB_MessageTest' => __DIR__ . '/../..' . '/classes/abtests/class-ab-message-test.php',
516
+ 'WPDesk_Flexible_Shipping_AB_PluginActivation' => __DIR__ . '/../..' . '/classes/abtests/class-ab-plugin-activation.php',
517
+ 'WPDesk_Flexible_Shipping_AB_Tracker_Deactivation_Data' => __DIR__ . '/../..' . '/classes/abtests/class-ab-tracker-deactivation-data.php',
518
+ 'WPDesk_Flexible_Shipping_AB_Variant_Both_Messages' => __DIR__ . '/../..' . '/classes/abtests/ab-message-test/class-ab-variant-both-messages.php',
519
+ 'WPDesk_Flexible_Shipping_AB_Variant_Connect_NO_Tracker' => __DIR__ . '/../..' . '/classes/abtests/ab-message-test/class-ab-variant-connect-no-tracker.php',
520
+ 'WPDesk_Flexible_Shipping_AB_Variant_No_Connect_Tracker' => __DIR__ . '/../..' . '/classes/abtests/ab-message-test/class-ab-variant-no-connect-tracker.php',
521
+ 'WPDesk_Flexible_Shipping_AB_Variant_No_Messages' => __DIR__ . '/../..' . '/classes/abtests/ab-message-test/class-ab-variant-no-messages.php',
522
+ 'WPDesk_Flexible_Shipping_AB_Variant_Old' => __DIR__ . '/../..' . '/classes/abtests/ab-message-test/class-ab-variant-old.php',
523
  'WPDesk_Flexible_Shipping_Add_Shipping' => __DIR__ . '/../..' . '/classes/class-order-add-shipping.php',
524
  'WPDesk_Flexible_Shipping_Admin_Notices' => __DIR__ . '/../..' . '/classes/admin-notices.php',
525
  'WPDesk_Flexible_Shipping_Bulk_Actions' => __DIR__ . '/../..' . '/classes/bulk-actions.php',
588
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Dimension' => __DIR__ . '/../..' . '/classes/class-shortcode-unit-dimension.php',
589
  'WPDesk_Flexible_Shipping_Shorcode_Unit_Weight' => __DIR__ . '/../..' . '/classes/class-shortcode-unit-weight.php',
590
  'WPDesk_Flexible_Shipping_Tracker' => __DIR__ . '/../..' . '/classes/tracker.php',
591
+ 'WPDesk_Flexible_Shipping_Tracker_Button' => __DIR__ . '/../..' . '/classes/abtests/class-tracker-button.php',
592
  'WPDesk_Flexible_Shipping_UK_States' => __DIR__ . '/../..' . '/classes/class-uk-states.php',
593
  'WPDesk_Flexible_Shipping_WooCommerce_Context_Logger' => __DIR__ . '/../..' . '/classes/logger/class-woocommerce-context-logger.php',
594
  'WPDesk_S214_Settings' => __DIR__ . '/..' . '/wpdesk/wp-settings/source/class.wpdesk-s214-settings.php',
626
  public static function getInitializer(ClassLoader $loader)
627
  {
628
  return \Closure::bind(function () use ($loader) {
629
+ $loader->prefixLengthsPsr4 = ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672::$prefixLengthsPsr4;
630
+ $loader->prefixDirsPsr4 = ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672::$prefixDirsPsr4;
631
+ $loader->classMap = ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672::$classMap;
632
 
633
  }, null, ClassLoader::class);
634
  }
vendor/composer/installed.json CHANGED
@@ -383,6 +383,47 @@
383
  "simple-cache"
384
  ]
385
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  {
387
  "name": "wpdesk/wp-autoloader",
388
  "version": "1.1",
@@ -660,6 +701,46 @@
660
  "wordpress"
661
  ]
662
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
663
  {
664
  "name": "wpdesk/wp-saas-platform-client",
665
  "version": "1.7.1",
383
  "simple-cache"
384
  ]
385
  },
386
+ {
387
+ "name": "wpdesk/wp-abtesting",
388
+ "version": "1.1.0",
389
+ "version_normalized": "1.1.0.0",
390
+ "source": {
391
+ "type": "git",
392
+ "url": "https://gitlab.com/wpdesk/wp-abtesting.git",
393
+ "reference": "4bc7cbc78cf6e7ed6c370a1215a5e93b38caee32"
394
+ },
395
+ "dist": {
396
+ "type": "zip",
397
+ "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-abtesting/repository/archive.zip?sha=4bc7cbc78cf6e7ed6c370a1215a5e93b38caee32",
398
+ "reference": "4bc7cbc78cf6e7ed6c370a1215a5e93b38caee32",
399
+ "shasum": ""
400
+ },
401
+ "require": {
402
+ "php": ">=5.6",
403
+ "wpdesk/wp-persistence": "^1.0"
404
+ },
405
+ "require-dev": {
406
+ "phpunit/phpunit": "^5",
407
+ "squizlabs/php_codesniffer": "^3.0.2",
408
+ "wimg/php-compatibility": "^8",
409
+ "wp-coding-standards/wpcs": "^0.14.1"
410
+ },
411
+ "time": "2019-02-05T07:56:25+00:00",
412
+ "type": "library",
413
+ "installation-source": "dist",
414
+ "autoload": {
415
+ "psr-4": {
416
+ "WPDesk\\ABTesting\\": "src/"
417
+ }
418
+ },
419
+ "notification-url": "https://packagist.org/downloads/",
420
+ "authors": [
421
+ {
422
+ "name": "Krzysiek",
423
+ "email": "krzysiek@wpdesk.pl"
424
+ }
425
+ ]
426
+ },
427
  {
428
  "name": "wpdesk/wp-autoloader",
429
  "version": "1.1",
701
  "wordpress"
702
  ]
703
  },
704
+ {
705
+ "name": "wpdesk/wp-persistence",
706
+ "version": "1.0",
707
+ "version_normalized": "1.0.0.0",
708
+ "source": {
709
+ "type": "git",
710
+ "url": "https://gitlab.com/wpdesk/wp-persistence.git",
711
+ "reference": "d667f0da177826826f4c604dbada6831d03b6a60"
712
+ },
713
+ "dist": {
714
+ "type": "zip",
715
+ "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-persistence/repository/archive.zip?sha=d667f0da177826826f4c604dbada6831d03b6a60",
716
+ "reference": "d667f0da177826826f4c604dbada6831d03b6a60",
717
+ "shasum": ""
718
+ },
719
+ "require": {
720
+ "php": ">=5.6"
721
+ },
722
+ "require-dev": {
723
+ "phpunit/phpunit": "^5",
724
+ "squizlabs/php_codesniffer": "^3.0.2",
725
+ "wimg/php-compatibility": "^8",
726
+ "wp-coding-standards/wpcs": "^0.14.1"
727
+ },
728
+ "time": "2019-02-01T09:01:34+00:00",
729
+ "type": "library",
730
+ "installation-source": "dist",
731
+ "autoload": {
732
+ "psr-4": {
733
+ "WPDesk\\Persistence\\": "src/"
734
+ }
735
+ },
736
+ "notification-url": "https://packagist.org/downloads/",
737
+ "authors": [
738
+ {
739
+ "name": "Krzysiek",
740
+ "email": "krzysiek@wpdesk.pl"
741
+ }
742
+ ]
743
+ },
744
  {
745
  "name": "wpdesk/wp-saas-platform-client",
746
  "version": "1.7.1",
vendor/wpdesk/wp-abtesting/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ ## [1.0.0] - 2019-02-04
2
+ ### Added
3
+ - first stable version
vendor/wpdesk/wp-abtesting/LICENSE.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2018 wpdesk
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
vendor/wpdesk/wp-abtesting/README.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [![pipeline status](https://gitlab.com/wpdesk/wp-abtesting/badges/master/pipeline.svg)](https://gitlab.com/wpdesk/wp-abtesting/pipelines)
2
+ [![coverage report](https://gitlab.com/wpdesk/wp-abtesting/badges/master/coverage.svg)](https://gitlab.com/wpdesk/wp-abtesting/commits/master)
3
+ [![Latest Stable Version](https://poser.pugx.org/wpdesk/wp-abtesting/v/stable)](https://packagist.org/packages/wpdesk/wp-abtesting)
4
+ [![Total Downloads](https://poser.pugx.org/wpdesk/wp-abtesting/downloads)](https://packagist.org/packages/wpdesk/wp-abtesting)
5
+ [![Latest Unstable Version](https://poser.pugx.org/wpdesk/wp-abtesting/v/unstable)](https://packagist.org/packages/wpdesk/wp-abtesting)
6
+ [![License](https://poser.pugx.org/wpdesk/wp-abtesting/license)](https://packagist.org/packages/wpdesk/wp-abtesting)
7
+
8
+ WordPress Library to facilitate AB Testing
9
+ ===================================================
10
+
11
+
12
+ ## Requirements
13
+
14
+ PHP 5.6 or later.
15
+
16
+ ## Composer
17
+
18
+ You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:
19
+
20
+ ```bash
21
+ composer require wpdesk/wp-abtesting
22
+ ```
23
+
24
+ To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):
25
+
26
+ ```php
27
+ require_once 'vendor/autoload.php';
28
+ ```
29
+
30
+ ## Compatiblity between plugins
31
+
32
+ To ensure that always the latest and valid version of composer libraries are loaded in WP env you should use a solution
33
+ that ensure support between plugins and at least decreases the change that something would break. At the moment we recommend
34
+ using wpdesk/wp-autoloader.
35
+
36
+
37
+ ## Manual instalation
38
+
39
+ If you do not wish to use Composer and wpdesk/wp-autoloader, you probably should stop using any existing library as it breaks compatibility between plugins.
40
+
41
+ ## Getting Started
42
+
43
+ ## Project documentation
44
+
45
+ PHPDoc: https://wpdesk.gitlab.io/wp-abtesting/index.html
vendor/wpdesk/wp-abtesting/composer.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "wpdesk/wp-abtesting",
3
+ "authors": [
4
+ {
5
+ "name": "Krzysiek",
6
+ "email": "krzysiek@wpdesk.pl"
7
+ }
8
+ ],
9
+ "require": {
10
+ "php": ">=5.6",
11
+ "wpdesk/wp-persistence": "^1.0"
12
+ },
13
+ "require-dev": {
14
+ "phpunit/phpunit": "^5",
15
+ "wp-coding-standards/wpcs": "^0.14.1",
16
+ "squizlabs/php_codesniffer": "^3.0.2",
17
+ "wimg/php-compatibility": "^8"
18
+ },
19
+ "autoload": {
20
+ "psr-4": {"WPDesk\\ABTesting\\": "src/"}
21
+ },
22
+ "autoload-dev": {
23
+ "psr-4": {"WPDesk\\ABTesting\\Tests\\Unit\\": "tests/unit/"}
24
+ },
25
+ "scripts": {
26
+ "phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
27
+ "phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
28
+ "phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
29
+ "phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage"
30
+ }
31
+ }
vendor/wpdesk/wp-abtesting/src/ABTest.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\ABTesting;
4
+
5
+ /**
6
+ * Test should know what variant should be used and that is all.
7
+ *
8
+ * @package WPDesk\ABTesting
9
+ */
10
+ interface ABTest {
11
+ /**
12
+ * Return info about what variant of AB test should be used.
13
+ *
14
+ * @return ABVariant
15
+ */
16
+ public function get_variant();
17
+ }
vendor/wpdesk/wp-abtesting/src/ABTest/EqualGroupsRandomABTest.php ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\ABTesting\ABTest;
4
+
5
+
6
+ use WPDesk\ABTesting\ABTest;
7
+ use WPDesk\Persistence\ElementNotExistsException;
8
+ use WPDesk\Persistence\PersistentContainer;
9
+
10
+ /**
11
+ * Base class for AB tests with equal groups generated by random number generator
12
+ *
13
+ * @package WPDesk\ABTesting\ABTest
14
+ */
15
+ abstract class EqualGroupsRandomABTest implements ABTest {
16
+ const CONTAINER_VALUE_PREFIX = 'ab_test';
17
+
18
+ /**
19
+ * Used to save info about generated variant
20
+ *
21
+ * @var PersistentContainer
22
+ */
23
+ private $container;
24
+
25
+ /**
26
+ * How many groups/variants are in the whole test
27
+ *
28
+ * @var int
29
+ */
30
+ private $variant_count;
31
+
32
+ /**
33
+ * Some unique test name for persitence pusposes and for higher readability
34
+ *
35
+ * @var string
36
+ */
37
+ private $test_name;
38
+
39
+ /**
40
+ * Derived classes can use this value to know what variant id is generated
41
+ *
42
+ * @var int
43
+ */
44
+ protected $current_variant_id;
45
+
46
+ /**
47
+ * @param int $variant_count Number of equal size groups to generate.
48
+ * @param string $test_name Specific test name. Should be unique. Used to persist.
49
+ * @param PersistentContainer $container Container to persist data.
50
+ */
51
+ public function __construct( $variant_count, $test_name, PersistentContainer $container ) {
52
+ assert( is_int( $variant_count ) && $variant_count > 0, '$variant_count makes no sense' );
53
+
54
+ $this->variant_count = $variant_count;
55
+ $this->test_name = $test_name;
56
+ $this->container = $container;
57
+
58
+ $this->initialize_variant_id();
59
+ }
60
+
61
+ /**
62
+ * Clears info about variant and draws again
63
+ */
64
+ public function reset() {
65
+ $this->container->set( $this->get_container_key(), null );
66
+ $this->initialize_variant_id();
67
+ }
68
+
69
+ /**
70
+ * @return void
71
+ */
72
+ private function initialize_variant_id() {
73
+ $variant_id = $this->get_variant_id_from_container();
74
+ if ( $variant_id === null ) {
75
+ $variant_id = $this->generate_variant_id();
76
+ $this->container->set( $this->get_container_key(), $variant_id );
77
+ }
78
+ $this->current_variant_id = $variant_id;
79
+ }
80
+
81
+ /**
82
+ * Returns variant id if exists.
83
+ *
84
+ * @return int|null Returns null if not exists.
85
+ */
86
+ private function get_variant_id_from_container() {
87
+ try {
88
+ $variant_id = $this->container->get( $this->get_container_key() );
89
+
90
+ return (int) $variant_id;
91
+ } catch ( ElementNotExistsException $e ) {
92
+ return null;
93
+ }
94
+ }
95
+
96
+ /**
97
+ * Key for where variant id should be saved in the persistence container
98
+ *
99
+ * @return string
100
+ */
101
+ protected function get_container_key() {
102
+ return implode( '_', [ self::CONTAINER_VALUE_PREFIX, $this->test_name, 'variant_id' ] );
103
+ }
104
+
105
+ /**
106
+ * @return int
107
+ */
108
+ private function generate_variant_id() {
109
+ return mt_rand( 1, $this->variant_count );
110
+ }
111
+ }
vendor/wpdesk/wp-abtesting/src/ABVariant.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\ABTesting;
4
+
5
+ /**
6
+ * Specific variant should know what functionalities should be on/off.
7
+ *
8
+ * @package WPDesk\ABTesting
9
+ */
10
+ interface ABVariant {
11
+ /**
12
+ * Checks if a variant does have a given functionality working.
13
+ *
14
+ * @param string $functionality
15
+ *
16
+ * @return bool
17
+ */
18
+ public function is_on( $functionality );
19
+
20
+ /**
21
+ * Returns the variant id (can be numeric). For example for standard AB testing it would be A or B.
22
+ *
23
+ * @return string
24
+ */
25
+ public function get_variant_id();
26
+ }
vendor/wpdesk/wp-abtesting/src/ABVariant/BasicABVariant.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\ABTesting\ABVariant;
4
+
5
+
6
+ use WPDesk\ABTesting\ABVariant;
7
+
8
+ /**
9
+ * Base class for variants. Nothing special.
10
+ *
11
+ * @package WPDesk\ABTesting\ABVariant
12
+ */
13
+ abstract class BasicABVariant implements ABVariant {
14
+ /** @var string */
15
+ private $variant_id;
16
+
17
+ /**
18
+ * @param string $variant_id
19
+ */
20
+ public function __construct( $variant_id ) {
21
+ $this->variant_id = (string) $variant_id;
22
+ }
23
+
24
+ abstract public function is_on( $functionality );
25
+
26
+ public function get_variant_id() {
27
+ return $this->variant_id;
28
+ }
29
+ }
vendor/wpdesk/wp-persistence/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ ## [1.0.0] - 2019-02-04
2
+ ### Added
3
+ - first stable version
vendor/wpdesk/wp-persistence/LICENSE.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ MIT License
2
+
3
+ Copyright (c) 2018 wpdesk
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
vendor/wpdesk/wp-persistence/README.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [![pipeline status](https://gitlab.com/wpdesk/wp-persistence/badges/master/pipeline.svg)](https://gitlab.com/wpdesk/wp-persistence/pipelines)
2
+ [![coverage report](https://gitlab.com/wpdesk/wp-persistence/badges/master/coverage.svg)](https://gitlab.com/wpdesk/wp-persistence/commits/master)
3
+ [![Latest Stable Version](https://poser.pugx.org/wpdesk/wp-persistence/v/stable)](https://packagist.org/packages/wpdesk/wp-persistence)
4
+ [![Total Downloads](https://poser.pugx.org/wpdesk/wp-persistence/downloads)](https://packagist.org/packages/wpdesk/wp-persistence)
5
+ [![Latest Unstable Version](https://poser.pugx.org/wpdesk/wp-persistence/v/unstable)](https://packagist.org/packages/wpdesk/wp-persistence)
6
+ [![License](https://poser.pugx.org/wpdesk/wp-persistence/license)](https://packagist.org/packages/wpdesk/wp-persistence)
7
+
8
+ WordPress Library to facilitate access to various persistence possibilities
9
+ ===================================================
10
+
11
+
12
+ ## Requirements
13
+
14
+ PHP 5.6 or later.
15
+
16
+ ## Composer
17
+
18
+ You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:
19
+
20
+ ```bash
21
+ composer require wpdesk/wp-persistence
22
+ ```
23
+
24
+ To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):
25
+
26
+ ```php
27
+ require_once 'vendor/autoload.php';
28
+ ```
29
+
30
+ ## Compatiblity between plugins
31
+
32
+ To ensure that always the latest and valid version of composer libraries are loaded in WP env you should use a solution
33
+ that ensure support between plugins and at least decreases the change that something would break. At the moment we recommend
34
+ using wpdesk/wp-autoloader.
35
+
36
+
37
+ ## Manual instalation
38
+
39
+ If you do not wish to use Composer and wpdesk/wp-autoloader, you probably should stop using any existing library as it breaks compatibility between plugins.
40
+
41
+ ## Getting Started
42
+
43
+ ## Project documentation
44
+
45
+ PHPDoc: https://wpdesk.gitlab.io/wp-persistence/index.html
vendor/wpdesk/wp-persistence/composer.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "wpdesk/wp-persistence",
3
+ "authors": [
4
+ {
5
+ "name": "Krzysiek",
6
+ "email": "krzysiek@wpdesk.pl"
7
+ }
8
+ ],
9
+ "require": {
10
+ "php": ">=5.6"
11
+ },
12
+ "require-dev": {
13
+ "phpunit/phpunit": "^5",
14
+ "wp-coding-standards/wpcs": "^0.14.1",
15
+ "squizlabs/php_codesniffer": "^3.0.2",
16
+ "wimg/php-compatibility": "^8"
17
+ },
18
+ "autoload": {
19
+ "psr-4": {"WPDesk\\Persistence\\": "src/"}
20
+ },
21
+ "autoload-dev": {
22
+ "psr-4": {"WPDesk\\Persistence\\Tests\\Integration\\": "tests/integration/"}
23
+ },
24
+ "scripts": {
25
+ "phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
26
+ "phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
27
+ "phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
28
+ "phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage"
29
+ }
30
+ }
vendor/wpdesk/wp-persistence/src/ElementNotExistsException.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\Persistence;
4
+
5
+ /**
6
+ * Class ElementNotExistsException
7
+ *
8
+ * @package WPDesk\Persistence
9
+ */
10
+ class ElementNotExistsException extends \RuntimeException
11
+ {
12
+ }
vendor/wpdesk/wp-persistence/src/MemoryContainer.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\Persistence;
4
+
5
+ /**
6
+ * Class MemoryContainer
7
+ * @package WPDesk\Persistence
8
+ */
9
+ class MemoryContainer implements PersistentContainer
10
+ {
11
+ private $array;
12
+
13
+ /**
14
+ * Persist value for key
15
+ *
16
+ * @param string $key
17
+ * @param mixed $value
18
+ */
19
+ public function set($key, $value)
20
+ {
21
+ $this->array[$key] = $value;
22
+ }
23
+
24
+ /**
25
+ * Get persistent value for key
26
+ *
27
+ * @param string $key
28
+ * @return mixed
29
+ */
30
+ public function get($key)
31
+ {
32
+ if (!isset($this->array[$key])) {
33
+ throw new ElementNotExistsException(sprintf('Element %s not exists!', $key));
34
+ }
35
+ return $this->array[$key];
36
+ }
37
+ }
vendor/wpdesk/wp-persistence/src/PersistentContainer.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\Persistence;
4
+
5
+ interface PersistentContainer
6
+ {
7
+ /**
8
+ * @param string $key
9
+ * @param mixed $value
10
+ * @return void
11
+ */
12
+ public function set($key, $value);
13
+
14
+ /**
15
+ * @param string $key
16
+ * @return mixed
17
+ */
18
+ public function get($key);
19
+ }
vendor/wpdesk/wp-persistence/src/Wordpress/WordpressOptionsContainer.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\Persistence\Wordpress;
4
+
5
+ use WPDesk\Persistence\ElementNotExistsException;
6
+ use WPDesk\Persistence\PersistentContainer;
7
+
8
+ /**
9
+ * Class WordpressOptionsContainer
10
+ * @package WPDesk\Persistence\Wordpress
11
+ */
12
+ class WordpressOptionsContainer implements PersistentContainer
13
+ {
14
+ const OPTION_PREFIX = 'saas-platform-client';
15
+
16
+ /**
17
+ * Set value.
18
+ *
19
+ * @param string $key Key.
20
+ * @param mixed $value Value.
21
+ */
22
+ public function set($key, $value)
23
+ {
24
+ update_option($this->prepareKeyName($key), $value);
25
+ }
26
+
27
+ /**
28
+ * Prepare transient name for key.
29
+ *
30
+ * @param string $key Key.
31
+ *
32
+ * @return string
33
+ */
34
+ private function prepareKeyName($key)
35
+ {
36
+ return self::OPTION_PREFIX . '-' . $key;
37
+ }
38
+
39
+ /**
40
+ * Get value.
41
+ *
42
+ * @param string $key Key.
43
+ *
44
+ * @return mixed
45
+ * @throws ElementNotExistsException Element not found.
46
+ */
47
+ public function get($key)
48
+ {
49
+ $value = get_option($this->prepareKeyName($key));
50
+ if (false === $value) {
51
+ throw new ElementNotExistsException(sprintf('Element %s not exists!', $key));
52
+ }
53
+
54
+ return $value;
55
+ }
56
+ }
vendor/wpdesk/wp-persistence/src/Wordpress/WordpressTransientContainer.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\Persistence\Wordpress;
4
+
5
+ use WPDesk\Persistence\ElementNotExistsException;
6
+ use WPDesk\Persistence\PersistentContainer;
7
+
8
+ /**
9
+ * Class WordpressTransientContainer
10
+ * @package WPDesk\Persistence\Wordpress
11
+ */
12
+ class WordpressTransientContainer implements PersistentContainer
13
+ {
14
+
15
+ const TRANSIENT_NAME = 'wsp_';
16
+
17
+ const TRANSIENT_TIMEOUT = 86400;
18
+
19
+ /**
20
+ * Set value.
21
+ *
22
+ * @param string $key Key.
23
+ * @param mixed $value Value.
24
+ */
25
+ public function set($key, $value)
26
+ {
27
+ set_transient($this->prepareTransientName($key), $value, self::TRANSIENT_TIMEOUT);
28
+ }
29
+
30
+ /**
31
+ * Prepare transient name for key.
32
+ *
33
+ * @param string $key Key.
34
+ *
35
+ * @return string
36
+ */
37
+ private function prepareTransientName($key)
38
+ {
39
+ return self::TRANSIENT_NAME . md5($key);
40
+ }
41
+
42
+ /**
43
+ * Get value.
44
+ *
45
+ * @param string $key Key.
46
+ *
47
+ * @return mixed
48
+ * @throws ElementNotExistsException Element not found.
49
+ */
50
+ public function get($key)
51
+ {
52
+ $value = get_transient($this->prepareTransientName($key));
53
+ if (false === $value) {
54
+ throw new ElementNotExistsException(sprintf('Element %s not exists!', $key));
55
+ }
56
+
57
+ return $value;
58
+ }
59
+ }