Pixel Manager for WooCommerce – Track Google Analytics, Google Ads, Facebook and more - Version 1.20.1

Version Description

31.08.2022

  • Tweak: Added statuses "cancelled" and "refunded" to the exclusions when conversions should not be fired.
  • Tweak: Moved PMW column on orders page after WC actions
  • Fix: Made PMW admin css to only target PMW elements
Download this release

Release Info

Developer alekv
Plugin Icon 128x128 Pixel Manager for WooCommerce – Track Google Analytics, Google Ads, Facebook and more
Version 1.20.1
Comparing to
See all releases

Code changes from version 1.20.0 to 1.20.1

classes/admin/class-admin.php CHANGED
@@ -34,6 +34,7 @@ class Admin
34
  $this->plugin_hook = 'woocommerce_page_wpm';
35
  $this->google = new Google( $this->options );
36
  add_action( 'admin_enqueue_scripts', [ $this, 'wpm_admin_scripts' ] );
 
37
  // add the admin options page
38
  add_action( 'admin_menu', [ $this, 'wpm_plugin_admin_add_page' ], 99 );
39
  // install a settings page in the admin console
@@ -86,15 +87,30 @@ class Admin
86
  return '<script async src="https://www.googletagmanager.com/gtag/js?id=UA-39746956-10"></script>' . $html;
87
  }
88
 
89
- public function wpm_admin_scripts( $hook_suffix )
90
  {
 
 
 
 
91
  wp_enqueue_style(
92
  'wpm-admin',
93
  WPM_PLUGIN_DIR_PATH . 'css/admin.css',
94
  [],
95
  WPM_CURRENT_VERSION
96
  );
97
- // Only ouput the remaining scripts on PMW settings page
 
 
 
 
 
 
 
 
 
 
 
98
  if ( !strpos( $hook_suffix, 'page_wpm' ) ) {
99
  return;
100
  }
@@ -870,7 +886,7 @@ class Admin
870
  {
871
  ?>
872
 
873
- <div class="developer-banner">
874
  <div style="display: flex; justify-content: space-between">
875
  <span>
876
  <?php
@@ -885,7 +901,7 @@ class Admin
885
  <span style="padding-right: 6px">
886
  Enable Pro version demo features
887
  </span>
888
- <label class="switch" id="wpm_pro_version_demo">
889
 
890
  <input type='hidden' value='0'
891
  name='wgact_plugin_options[general][pro_version_demo]'>
@@ -895,7 +911,7 @@ class Admin
895
  checked( $this->options['general']['pro_version_demo'] );
896
  ?>
897
  />
898
- <span class="slider round"></span>
899
  </label>
900
  </div>
901
 
@@ -956,7 +972,7 @@ class Admin
956
  <?php
957
  esc_html_e( 'Payment Gateway Tracking Accuracy Report', 'woocommerce-google-adwords-conversion-tracking-tag' );
958
  ?>
959
- <div class="status-icon beta"><?php
960
  esc_html_e( 'beta', 'woocommerce-google-adwords-conversion-tracking-tag' );
961
  ?></div>
962
  </h2>
@@ -1735,17 +1751,17 @@ class Admin
1735
 
1736
  protected function get_documentation_html( $path )
1737
  {
1738
- // $html = '<a class="documentation-icon" href="' . $path . '" target="_blank">';
1739
  // $html .= '<span style="vertical-align: top; margin-top: 0px" class="dashicons dashicons-info-outline tooltip"><span class="tooltiptext">';
1740
  // $html .= esc_html__('open the documentation', 'woocommerce-google-adwords-conversion-tracking-tag');
1741
  // $html .= '</span></span></a>';
1742
  //
1743
  // return $html;
1744
  ?>
1745
- <a class="documentation-icon" href="<?php
1746
  echo esc_url( $path ) ;
1747
  ?>" target="_blank">
1748
- <span style="vertical-align: top; margin-top: 0" class="dashicons dashicons-info-outline tooltip"><span
1749
  class="tooltiptext">
1750
  <?php
1751
  esc_html_e( 'open the documentation', 'woocommerce-google-adwords-conversion-tracking-tag' );
@@ -2643,13 +2659,13 @@ class Admin
2643
 
2644
  private function html_beta()
2645
  {
2646
- return '<div class="status-icon beta">' . esc_html__( 'beta', 'woocommerce-google-adwords-conversion-tracking-tag' ) . '</div>';
2647
  }
2648
 
2649
  private function html_beta_e( $margin_top = '1px' )
2650
  {
2651
  ?>
2652
- <div class="status-icon beta"
2653
  style="margin-top: <?php
2654
  esc_html_e( $margin_top );
2655
  ?>"
@@ -2663,13 +2679,13 @@ class Admin
2663
 
2664
  private function html_active()
2665
  {
2666
- return '<div class="status-icon active">' . esc_html__( 'active', 'woocommerce-google-adwords-conversion-tracking-tag' ) . '</div>';
2667
  }
2668
 
2669
  private function html_active_new()
2670
  {
2671
  ?>
2672
- <div class="status-icon active"><?php
2673
  esc_html_e( 'active', 'woocommerce-google-adwords-conversion-tracking-tag' );
2674
  ?></div>
2675
  <?php
@@ -2677,13 +2693,13 @@ class Admin
2677
 
2678
  private function html_inactive()
2679
  {
2680
- return '<div class="status-icon inactive">' . esc_html__( 'inactive', 'woocommerce-google-adwords-conversion-tracking-tag' ) . '</div>';
2681
  }
2682
 
2683
  private function html_inactive_new()
2684
  {
2685
  ?>
2686
- <div class="status-icon inactive"><?php
2687
  esc_html_e( 'inactive', 'woocommerce-google-adwords-conversion-tracking-tag' );
2688
  ?></div>
2689
  <?php
@@ -2691,13 +2707,13 @@ class Admin
2691
 
2692
  private function html_partially_active()
2693
  {
2694
- return '<div class="status-icon partially-active">' . esc_html__( 'partially active', 'woocommerce-google-adwords-conversion-tracking-tag' ) . '</div>';
2695
  }
2696
 
2697
  private function html_partially_active_new()
2698
  {
2699
  ?>
2700
- <div class="status-icon partially-active"><?php
2701
  esc_html_e( 'partially active', 'woocommerce-google-adwords-conversion-tracking-tag' );
2702
  ?></div>
2703
  <?php
@@ -2708,9 +2724,9 @@ class Admin
2708
 
2709
  if ( !wpm_fs()->is__premium_only() && $this->options['general']['pro_version_demo'] ) {
2710
  // if (1===1) {
2711
- // return '<div class="pro-feature">' . esc_html__('Pro Feature', 'woocommerce-google-adwords-conversion-tracking-tag') . '</div>';
2712
  ?>
2713
- <div class="pro-feature"><?php
2714
  esc_html_e( 'Pro Feature', 'woocommerce-google-adwords-conversion-tracking-tag' );
2715
  ?></div>
2716
 
34
  $this->plugin_hook = 'woocommerce_page_wpm';
35
  $this->google = new Google( $this->options );
36
  add_action( 'admin_enqueue_scripts', [ $this, 'wpm_admin_scripts' ] );
37
+ add_action( 'admin_enqueue_scripts', [ $this, 'wpm_admin_css' ] );
38
  // add the admin options page
39
  add_action( 'admin_menu', [ $this, 'wpm_plugin_admin_add_page' ], 99 );
40
  // install a settings page in the admin console
87
  return '<script async src="https://www.googletagmanager.com/gtag/js?id=UA-39746956-10"></script>' . $html;
88
  }
89
 
90
+ public function wpm_admin_css( $hook_suffix )
91
  {
92
+ // Only output the css on PMW pages and the order page
93
+ if ( !(strpos( $hook_suffix, 'page_wpm' ) || $this->is_orders_page()) ) {
94
+ return;
95
+ }
96
  wp_enqueue_style(
97
  'wpm-admin',
98
  WPM_PLUGIN_DIR_PATH . 'css/admin.css',
99
  [],
100
  WPM_CURRENT_VERSION
101
  );
102
+ }
103
+
104
+ private function is_orders_page()
105
+ {
106
+ global $pagenow ;
107
+ $_get = $this->get_input_vars( INPUT_GET );
108
+ return 'edit.php' === $pagenow && isset( $_get['post_type'] ) && 'shop_order' === $_get['post_type'];
109
+ }
110
+
111
+ public function wpm_admin_scripts( $hook_suffix )
112
+ {
113
+ // Only output the remaining scripts on PMW settings page
114
  if ( !strpos( $hook_suffix, 'page_wpm' ) ) {
115
  return;
116
  }
886
  {
887
  ?>
888
 
889
+ <div class="pmw-developer-banner">
890
  <div style="display: flex; justify-content: space-between">
891
  <span>
892
  <?php
901
  <span style="padding-right: 6px">
902
  Enable Pro version demo features
903
  </span>
904
+ <label class="pmw-switch" id="wpm_pro_version_demo">
905
 
906
  <input type='hidden' value='0'
907
  name='wgact_plugin_options[general][pro_version_demo]'>
911
  checked( $this->options['general']['pro_version_demo'] );
912
  ?>
913
  />
914
+ <span class="pmw-slider round"></span>
915
  </label>
916
  </div>
917
 
972
  <?php
973
  esc_html_e( 'Payment Gateway Tracking Accuracy Report', 'woocommerce-google-adwords-conversion-tracking-tag' );
974
  ?>
975
+ <div class="pmw-status-icon beta"><?php
976
  esc_html_e( 'beta', 'woocommerce-google-adwords-conversion-tracking-tag' );
977
  ?></div>
978
  </h2>
1751
 
1752
  protected function get_documentation_html( $path )
1753
  {
1754
+ // $html = '<a class="pmw-documentation-icon" href="' . $path . '" target="_blank">';
1755
  // $html .= '<span style="vertical-align: top; margin-top: 0px" class="dashicons dashicons-info-outline tooltip"><span class="tooltiptext">';
1756
  // $html .= esc_html__('open the documentation', 'woocommerce-google-adwords-conversion-tracking-tag');
1757
  // $html .= '</span></span></a>';
1758
  //
1759
  // return $html;
1760
  ?>
1761
+ <a class="pmw-documentation-icon" href="<?php
1762
  echo esc_url( $path ) ;
1763
  ?>" target="_blank">
1764
+ <span style="vertical-align: top; margin-top: 0" class="dashicons dashicons-info-outline pmw-tooltip"><span
1765
  class="tooltiptext">
1766
  <?php
1767
  esc_html_e( 'open the documentation', 'woocommerce-google-adwords-conversion-tracking-tag' );
2659
 
2660
  private function html_beta()
2661
  {
2662
+ return '<div class="pmw-status-icon beta">' . esc_html__( 'beta', 'woocommerce-google-adwords-conversion-tracking-tag' ) . '</div>';
2663
  }
2664
 
2665
  private function html_beta_e( $margin_top = '1px' )
2666
  {
2667
  ?>
2668
+ <div class="pmw-status-icon beta"
2669
  style="margin-top: <?php
2670
  esc_html_e( $margin_top );
2671
  ?>"
2679
 
2680
  private function html_active()
2681
  {
2682
+ return '<div class="pmw-status-icon active">' . esc_html__( 'active', 'woocommerce-google-adwords-conversion-tracking-tag' ) . '</div>';
2683
  }
2684
 
2685
  private function html_active_new()
2686
  {
2687
  ?>
2688
+ <div class="pmw-status-icon active"><?php
2689
  esc_html_e( 'active', 'woocommerce-google-adwords-conversion-tracking-tag' );
2690
  ?></div>
2691
  <?php
2693
 
2694
  private function html_inactive()
2695
  {
2696
+ return '<div class="pmw-status-icon inactive">' . esc_html__( 'inactive', 'woocommerce-google-adwords-conversion-tracking-tag' ) . '</div>';
2697
  }
2698
 
2699
  private function html_inactive_new()
2700
  {
2701
  ?>
2702
+ <div class="pmw-status-icon inactive"><?php
2703
  esc_html_e( 'inactive', 'woocommerce-google-adwords-conversion-tracking-tag' );
2704
  ?></div>
2705
  <?php
2707
 
2708
  private function html_partially_active()
2709
  {
2710
+ return '<div class="pmw-status-icon partially-active">' . esc_html__( 'partially active', 'woocommerce-google-adwords-conversion-tracking-tag' ) . '</div>';
2711
  }
2712
 
2713
  private function html_partially_active_new()
2714
  {
2715
  ?>
2716
+ <div class="pmw-status-icon partially-active"><?php
2717
  esc_html_e( 'partially active', 'woocommerce-google-adwords-conversion-tracking-tag' );
2718
  ?></div>
2719
  <?php
2724
 
2725
  if ( !wpm_fs()->is__premium_only() && $this->options['general']['pro_version_demo'] ) {
2726
  // if (1===1) {
2727
+ // return '<div class="pmw-pro-feature">' . esc_html__('Pro Feature', 'woocommerce-google-adwords-conversion-tracking-tag') . '</div>';
2728
  ?>
2729
+ <div class="pmw-pro-feature"><?php
2730
  esc_html_e( 'Pro Feature', 'woocommerce-google-adwords-conversion-tracking-tag' );
2731
  ?></div>
2732
 
classes/admin/class-order-columns.php CHANGED
@@ -148,7 +148,7 @@ class Order_Columns {
148
  // Inserting columns to a specific location
149
  foreach ($columns as $key => $column) {
150
  $reordered_columns[$key] = $column;
151
- if ('order_total' === $key) {
152
  // $reordered_columns['pmw-monitored'] = '<a href="' . get_site_url() . '/wp-admin/edit.php?post_type=shop_order&amp;orderby=pmw-monitored' . get_list_order_parameter($list_order) . '"><span class="widefat column-order_date column-pmw-monitored { width: 9%; } pmw-monitored-head tips" data-tip="PMW monitored">PMW monitored</span></a>';
153
  $pixels_fired_text = esc_html__('PMW pixels fired', 'woocommerce-google-adwords-conversion-tracking-tag');
154
  $reordered_columns['pmw-pixels-fired'] = '<span class="pmw-monitored-head tips" data-tip="' . $pixels_fired_text . '">' . $pixels_fired_text . '</span>';
148
  // Inserting columns to a specific location
149
  foreach ($columns as $key => $column) {
150
  $reordered_columns[$key] = $column;
151
+ if ('wc_actions' === $key) {
152
  // $reordered_columns['pmw-monitored'] = '<a href="' . get_site_url() . '/wp-admin/edit.php?post_type=shop_order&amp;orderby=pmw-monitored' . get_list_order_parameter($list_order) . '"><span class="widefat column-order_date column-pmw-monitored { width: 9%; } pmw-monitored-head tips" data-tip="PMW monitored">PMW monitored</span></a>';
153
  $pixels_fired_text = esc_html__('PMW pixels fired', 'woocommerce-google-adwords-conversion-tracking-tag');
154
  $reordered_columns['pmw-pixels-fired'] = '<span class="pmw-monitored-head tips" data-tip="' . $pixels_fired_text . '">' . $pixels_fired_text . '</span>';
classes/pixels/trait-shop.php CHANGED
@@ -511,7 +511,7 @@ trait Trait_Shop
511
  );
512
  $conversion_prevention = apply_filters( 'wpm_conversion_prevention', $conversion_prevention, $order );
513
 
514
- if ( $this->is_nodedupe_parameter_set() || !$order->has_status( 'failed' ) && $this->track_user() && false === $conversion_prevention && (!$this->options['shop']['order_deduplication'] || $this->has_conversion_pixel_already_fired( $order ) !== true) ) {
515
  return true;
516
  } else {
517
  return false;
@@ -519,6 +519,19 @@ trait Trait_Shop
519
 
520
  }
521
 
 
 
 
 
 
 
 
 
 
 
 
 
 
522
  protected function has_conversion_pixel_already_fired( $order )
523
  {
524
  return false;
511
  );
512
  $conversion_prevention = apply_filters( 'wpm_conversion_prevention', $conversion_prevention, $order );
513
 
514
+ if ( $this->is_nodedupe_parameter_set() || $this->is_order_confirmation_allowed_status( $order ) && $this->track_user() && false === $conversion_prevention && (!$this->options['shop']['order_deduplication'] || $this->has_conversion_pixel_already_fired( $order ) !== true) ) {
515
  return true;
516
  } else {
517
  return false;
519
 
520
  }
521
 
522
+ protected function is_order_confirmation_allowed_status( $order )
523
+ {
524
+ if ( $order->has_status( 'failed' ) || $order->has_status( 'cancelled' ) || $order->has_status( 'refunded' ) ) {
525
+ return false;
526
+ }
527
+ return true;
528
+ }
529
+
530
+ protected function is_order_confirmation_not_allowed_status( $order )
531
+ {
532
+ return !$this->is_order_confirmation_allowed_status( $order );
533
+ }
534
+
535
  protected function has_conversion_pixel_already_fired( $order )
536
  {
537
  return false;
css/admin.css CHANGED
@@ -1,29 +1,29 @@
1
- .subnav-li-active {
2
  font-weight: bold;
3
  }
4
 
5
- .subnav-li-inactive {
6
  /*text-decoration: underline;*/
7
  color: #0073aa;
8
  }
9
 
10
- .subnav-tabs li {
11
  display: inline-block;
12
  }
13
 
14
- .subnav-tabs li + li::before {
15
  content: "|";
16
  padding: 0 5px 0 5px;
17
  color: black;
18
  font-weight: normal;
19
  }
20
 
21
- .tooltip {
22
  position: relative;
23
  display: inline-block;
24
  }
25
 
26
- .tooltip .tooltiptext {
27
  visibility: hidden;
28
  /* width: 120px; */
29
  background-color: #0073aa;
@@ -40,11 +40,11 @@
40
  font-size: 16px;
41
  }
42
 
43
- .tooltip:hover .tooltiptext {
44
  visibility: visible;
45
  }
46
 
47
- .developer-banner {
48
  background: #f3f5f6;
49
  color: #0071a1;
50
  padding: 0 10px;
@@ -59,7 +59,7 @@
59
  }
60
 
61
  /* The switch - the box around the slider */
62
- .switch {
63
  position: relative;
64
  display: inline-block;
65
  width: 30px;
@@ -67,14 +67,14 @@
67
  }
68
 
69
  /* Hide default HTML checkbox */
70
- .switch input {
71
  opacity: 0;
72
  width: 0;
73
  height: 0;
74
  }
75
 
76
  /* The slider */
77
- .slider {
78
  position: absolute;
79
  cursor: pointer;
80
  top: 0;
@@ -86,7 +86,7 @@
86
  transition: .4s;
87
  }
88
 
89
- .slider:before {
90
  position: absolute;
91
  content: "";
92
  height: 18px;
@@ -98,30 +98,30 @@
98
  transition: .4s;
99
  }
100
 
101
- input:checked + .slider {
102
  background-color: #2196F3;
103
  }
104
 
105
- input:focus + .slider {
106
  box-shadow: 0 0 1px #2196F3;
107
  }
108
 
109
- input:checked + .slider:before {
110
  -webkit-transform: translateX(16px);
111
  -ms-transform: translateX(16px);
112
  transform: translateX(16px);
113
  }
114
 
115
  /* Rounded sliders */
116
- .slider.round {
117
  border-radius: 14px;
118
  }
119
 
120
- .slider.round:before {
121
  border-radius: 50%;
122
  }
123
 
124
- .status-icon {
125
  display: inline-block;
126
  vertical-align: top;
127
  text-decoration: none;
@@ -135,27 +135,27 @@ input:checked + .slider:before {
135
  padding: 1px 3px 1px 3px;
136
  }
137
 
138
- .active {
139
  border-color: #18b208;
140
  color: #18b208;
141
  }
142
 
143
- .inactive {
144
  border-color: #ff170b;
145
  color: #ff170b;
146
  }
147
 
148
- .partially-active {
149
  border-color: #fab32a;
150
  color: #fab32a;
151
  }
152
 
153
- .beta {
154
  border-color: #fab32a;
155
  color: #fab32a;
156
  }
157
 
158
- .pro-feature {
159
  display: inline-block;
160
  vertical-align: top;
161
  text-decoration: none;
@@ -170,7 +170,7 @@ input:checked + .slider:before {
170
  color: #18b208;
171
  }
172
 
173
- .documentation-icon {
174
  text-decoration: none;
175
  margin-left: 5px;
176
  margin-right: 5px;
1
+ .pmw-wsubnav-li-active {
2
  font-weight: bold;
3
  }
4
 
5
+ .pmw-subnav-li-inactive {
6
  /*text-decoration: underline;*/
7
  color: #0073aa;
8
  }
9
 
10
+ .pmw-subnav-tabs li {
11
  display: inline-block;
12
  }
13
 
14
+ .pmw-subnav-tabs li + li::before {
15
  content: "|";
16
  padding: 0 5px 0 5px;
17
  color: black;
18
  font-weight: normal;
19
  }
20
 
21
+ .pmw-tooltip {
22
  position: relative;
23
  display: inline-block;
24
  }
25
 
26
+ .pmw-tooltip .tooltiptext {
27
  visibility: hidden;
28
  /* width: 120px; */
29
  background-color: #0073aa;
40
  font-size: 16px;
41
  }
42
 
43
+ .pmw-tooltip:hover .tooltiptext {
44
  visibility: visible;
45
  }
46
 
47
+ .pmw-developer-banner {
48
  background: #f3f5f6;
49
  color: #0071a1;
50
  padding: 0 10px;
59
  }
60
 
61
  /* The switch - the box around the slider */
62
+ .pmw-switch {
63
  position: relative;
64
  display: inline-block;
65
  width: 30px;
67
  }
68
 
69
  /* Hide default HTML checkbox */
70
+ .pmw-switch input {
71
  opacity: 0;
72
  width: 0;
73
  height: 0;
74
  }
75
 
76
  /* The slider */
77
+ .pmw-slider {
78
  position: absolute;
79
  cursor: pointer;
80
  top: 0;
86
  transition: .4s;
87
  }
88
 
89
+ .pmw-slider:before {
90
  position: absolute;
91
  content: "";
92
  height: 18px;
98
  transition: .4s;
99
  }
100
 
101
+ input:checked + .pmw-slider {
102
  background-color: #2196F3;
103
  }
104
 
105
+ input:focus + .pmw-slider {
106
  box-shadow: 0 0 1px #2196F3;
107
  }
108
 
109
+ input:checked + .pmw-slider:before {
110
  -webkit-transform: translateX(16px);
111
  -ms-transform: translateX(16px);
112
  transform: translateX(16px);
113
  }
114
 
115
  /* Rounded sliders */
116
+ .pmw-slider.round {
117
  border-radius: 14px;
118
  }
119
 
120
+ .pmw-slider.round:before {
121
  border-radius: 50%;
122
  }
123
 
124
+ .pmw-status-icon {
125
  display: inline-block;
126
  vertical-align: top;
127
  text-decoration: none;
135
  padding: 1px 3px 1px 3px;
136
  }
137
 
138
+ .pmw-status-icon.active {
139
  border-color: #18b208;
140
  color: #18b208;
141
  }
142
 
143
+ .pmw-status-icon.inactive {
144
  border-color: #ff170b;
145
  color: #ff170b;
146
  }
147
 
148
+ .pmw-status-icon.partially-active {
149
  border-color: #fab32a;
150
  color: #fab32a;
151
  }
152
 
153
+ .pmw-status-icon.beta {
154
  border-color: #fab32a;
155
  color: #fab32a;
156
  }
157
 
158
+ .pmw-pro-feature {
159
  display: inline-block;
160
  vertical-align: top;
161
  text-decoration: none;
170
  color: #18b208;
171
  }
172
 
173
+ .pmw-documentation-icon {
174
  text-decoration: none;
175
  margin-left: 5px;
176
  margin-right: 5px;
js/admin/tabs.js CHANGED
@@ -58,15 +58,15 @@ jQuery(function () {
58
  })
59
 
60
  // Create on-click events on subsection tabs that toggle the views
61
- jQuery(".subnav-li").on("click", function (e) {
62
 
63
  e.preventDefault()
64
 
65
  // jQuery(this).hide();
66
  jQuery(this)
67
- .addClass("subnav-li-active").removeClass("subnav-li-inactive")
68
  .siblings()
69
- .addClass("subnav-li-inactive").removeClass("subnav-li-active")
70
 
71
  wpmToggleSubsection(jQuery(this).parent().data("section-slug"), jQuery(this).data("subsection-slug"))
72
  })
@@ -100,12 +100,12 @@ function wpmCreateSubtabUlHtml(subsections) {
100
  let html = ""
101
 
102
  subsectionsKeys.forEach(function (subsectionKey) {
103
- html += "<ul class=\"subnav-tabs\" data-section-slug=\"" + subsectionKey + "\">"
104
 
105
  let subtabs = subsections[subsectionKey]
106
 
107
  subtabs.forEach(function (subtab) {
108
- html += "<li class=\"subnav-li subnav-li-inactive\" style=\"cursor: pointer;\" data-subsection-slug=\"" + subtab["slug"] + "\">" + subtab["title"] + "</li>"
109
  })
110
 
111
  html += "</ul>"
@@ -137,8 +137,8 @@ function wpmGetSectionParams() {
137
  function wpmToggleSections(sectionSlug, sections) {
138
 
139
  jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide()
140
- jQuery(".subnav-tabs").hide()
141
- jQuery(".subnav-tabs[data-section-slug=" + sectionSlug + "]").show()
142
 
143
  let sectionPos = sections.findIndex((arrayElement) => arrayElement["slug"] === sectionSlug)
144
 
58
  })
59
 
60
  // Create on-click events on subsection tabs that toggle the views
61
+ jQuery(".pmw-subnav-li").on("click", function (e) {
62
 
63
  e.preventDefault()
64
 
65
  // jQuery(this).hide();
66
  jQuery(this)
67
+ .addClass("pmw-subnav-li-active").removeClass("pmw-subnav-li-inactive")
68
  .siblings()
69
+ .addClass("pmw-subnav-li-inactive").removeClass("pmw-subnav-li-active")
70
 
71
  wpmToggleSubsection(jQuery(this).parent().data("section-slug"), jQuery(this).data("subsection-slug"))
72
  })
100
  let html = ""
101
 
102
  subsectionsKeys.forEach(function (subsectionKey) {
103
+ html += "<ul class=\"pmw-subnav-tabs\" data-section-slug=\"" + subsectionKey + "\">"
104
 
105
  let subtabs = subsections[subsectionKey]
106
 
107
  subtabs.forEach(function (subtab) {
108
+ html += "<li class=\"pmw-subnav-li pmw-subnav-li-inactive\" style=\"cursor: pointer;\" data-subsection-slug=\"" + subtab["slug"] + "\">" + subtab["title"] + "</li>"
109
  })
110
 
111
  html += "</ul>"
137
  function wpmToggleSections(sectionSlug, sections) {
138
 
139
  jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide()
140
+ jQuery(".pmw-subnav-tabs").hide()
141
+ jQuery(".pmw-subnav-tabs[data-section-slug=" + sectionSlug + "]").show()
142
 
143
  let sectionPos = sections.findIndex((arrayElement) => arrayElement["slug"] === sectionSlug)
144
 
js/admin/wpm-admin.p1.min.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{var e={663:()=>{jQuery((function(){jQuery("#debug-info-button").on("click",(function(){jQuery("#debug-info-textarea").select(),document.execCommand("copy")})),jQuery("#wpm_pro_version_demo").on("click",(function(){jQuery("#submit").trigger("click")})),document.getElementById("json-settings-file-input").addEventListener("change",wpm.readSingleFile,!1)})),function(e,t,n){e.saveSettingsToDisk=()=>{let t=document.getElementById("export-settings-json").value;t=t.replace(/\n/g,"\r\n");let n=new Blob([t],{type:"text/plain"}),s=document.createElement("a");s.download="pixel-manager-settings-"+e.getCurrentDateForFileName()+".json",s.href=window.URL.createObjectURL(n),s.target="_blank",s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},e.getCurrentDateForFileName=()=>{let e=new Date;return e.getFullYear()+"."+("0"+(e.getMonth()+1)).slice(-2)+"."+("0"+e.getDate()).slice(-2)},e.readSingleFile=t=>{let n=t.target.files[0];if(!n)return;let s=new FileReader;s.onload=function(t){let n=JSON.parse(t.target.result);e.saveImportedSettingsToDb(n)},s.readAsText(n)},e.saveImportedSettingsToDb=e=>{fetch(pmwAdminApi.root+"pmw/v1/settings/",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":pmwAdminApi.nonce},body:JSON.stringify(e)}).then((e=>e.json())).then((async e=>{e.success?(console.log(e),document.getElementById("upload-status-success").style.display="block",await new Promise((e=>setTimeout(e,5e3))),window.location.reload()):(console.log(e),document.getElementById("upload-status-error").style.display="block")})).catch((e=>{console.error(e),document.getElementById("upload-status-error").style.display="block"}))}}(window.wpm=window.wpm||{},jQuery)},958:()=>{function e(){jQuery("#script-blocker-notice").hide()}e(),jQuery((function(){e()}))},966:()=>{function e(){const e=window.location.search,t=new URLSearchParams(e);return!!t.get("section")&&{section:t.get("section"),subsection:t.get("subsection")}}function t(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const s=window.location.search,i=new URLSearchParams(s);i.delete("section"),i.delete("subsection");let a="section="+e;a+=t?"&subsection="+t:"",history.pushState("","wpm"+e,document.location.pathname+"?page=wpm&"+a),jQuery('input[name ="_wp_http_referer"]').val(n()+"?page=wpm&"+a+"&settings-updated=true")}function n(){return new URL(jQuery("#wp-admin-canonical").attr("href")).pathname}jQuery((function(){if("wpm"!==wpmGetPageId())return;let n=[],s={};if(jQuery(".section").closest("tr").hide(),jQuery(".section").each((function(){n.push({slug:jQuery(this).data("sectionSlug"),title:jQuery(this).data("sectionTitle")})})),jQuery(".subsection").each((function(){s[jQuery(this).data("sectionSlug")]=s[jQuery(this).data("sectionSlug")]||[],s[jQuery(this).data("sectionSlug")].push({title:jQuery(this).data("subsectionTitle"),slug:jQuery(this).data("subsectionSlug")})})),n.forEach((function(e){jQuery(".nav-tab-wrapper").append('<a href="#" class="nav-tab" data-section-slug="'+e.slug+'">'+e.title+"</a>")})),jQuery(".nav-tab-wrapper").after(function(e){let t=Object.keys(e),n="";return t.forEach((function(t){n+='<ul class="subnav-tabs" data-section-slug="'+t+'">',e[t].forEach((function(e){n+='<li class="subnav-li subnav-li-inactive" style="cursor: pointer;" data-subsection-slug="'+e.slug+'">'+e.title+"</li>"})),n+="</ul>"})),n}(s)),jQuery(".nav-tab-wrapper a").on("click",(function(e){e.preventDefault(),jQuery(this).addClass("nav-tab-active").siblings().removeClass("nav-tab-active");let i=jQuery(this).data("section-slug");!function(e,n){jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide(),jQuery(".subnav-tabs").hide(),jQuery(".subnav-tabs[data-section-slug="+e+"]").show();let s=n.findIndex((t=>t.slug===e));jQuery("div[data-section-slug="+e+"]").closest("table").prevAll("h2:first").next().nextUntil("h2, .submit").andSelf().show(),t(n[s].slug)}(i,n),i in s&&jQuery("ul[data-section-slug="+i+"]").children(":first").trigger("click")})),jQuery(".subnav-li").on("click",(function(e){var n,s;e.preventDefault(),jQuery(this).addClass("subnav-li-active").removeClass("subnav-li-inactive").siblings().addClass("subnav-li-inactive").removeClass("subnav-li-active"),n=jQuery(this).parent().data("section-slug"),s=jQuery(this).data("subsection-slug"),jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+s+"]").closest("tr").siblings().andSelf().hide(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+s+"]").closest("table").show(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+s+"]").closest("tr").nextUntil(jQuery("[data-section-slug="+n+"][data-subsection-slug]").closest("tr")).show(),t(n,s)})),e()){let t=e();jQuery("a[data-section-slug="+t.section+"]").trigger("click"),!1!==t.subsection&&jQuery("ul[data-section-slug="+t.section+"]").children("[data-subsection-slug="+t.subsection+"]").trigger("click")}else jQuery("a[data-section-slug="+n[0].slug+"]").trigger("click")})),wpmGetPageId=()=>{const e=window.location.search;return new URLSearchParams(e).get("page")}}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var a=t[s]={exports:{}};return e[s](a,a.exports,n),a.exports}n(663),n(958),n(966)})();
2
  //# sourceMappingURL=wpm-admin.p1.min.js.map
1
+ (()=>{var e={663:()=>{jQuery((function(){jQuery("#debug-info-button").on("click",(function(){jQuery("#debug-info-textarea").select(),document.execCommand("copy")})),jQuery("#wpm_pro_version_demo").on("click",(function(){jQuery("#submit").trigger("click")})),document.getElementById("json-settings-file-input").addEventListener("change",wpm.readSingleFile,!1)})),function(e,t,n){e.saveSettingsToDisk=()=>{let t=document.getElementById("export-settings-json").value;t=t.replace(/\n/g,"\r\n");let n=new Blob([t],{type:"text/plain"}),s=document.createElement("a");s.download="pixel-manager-settings-"+e.getCurrentDateForFileName()+".json",s.href=window.URL.createObjectURL(n),s.target="_blank",s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},e.getCurrentDateForFileName=()=>{let e=new Date;return e.getFullYear()+"."+("0"+(e.getMonth()+1)).slice(-2)+"."+("0"+e.getDate()).slice(-2)},e.readSingleFile=t=>{let n=t.target.files[0];if(!n)return;let s=new FileReader;s.onload=function(t){let n=JSON.parse(t.target.result);e.saveImportedSettingsToDb(n)},s.readAsText(n)},e.saveImportedSettingsToDb=e=>{fetch(pmwAdminApi.root+"pmw/v1/settings/",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-WP-Nonce":pmwAdminApi.nonce},body:JSON.stringify(e)}).then((e=>e.json())).then((async e=>{e.success?(console.log(e),document.getElementById("upload-status-success").style.display="block",await new Promise((e=>setTimeout(e,5e3))),window.location.reload()):(console.log(e),document.getElementById("upload-status-error").style.display="block")})).catch((e=>{console.error(e),document.getElementById("upload-status-error").style.display="block"}))}}(window.wpm=window.wpm||{},jQuery)},958:()=>{function e(){jQuery("#script-blocker-notice").hide()}e(),jQuery((function(){e()}))},966:()=>{function e(){const e=window.location.search,t=new URLSearchParams(e);return!!t.get("section")&&{section:t.get("section"),subsection:t.get("subsection")}}function t(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const s=window.location.search,i=new URLSearchParams(s);i.delete("section"),i.delete("subsection");let a="section="+e;a+=t?"&subsection="+t:"",history.pushState("","wpm"+e,document.location.pathname+"?page=wpm&"+a),jQuery('input[name ="_wp_http_referer"]').val(n()+"?page=wpm&"+a+"&settings-updated=true")}function n(){return new URL(jQuery("#wp-admin-canonical").attr("href")).pathname}jQuery((function(){if("wpm"!==wpmGetPageId())return;let n=[],s={};if(jQuery(".section").closest("tr").hide(),jQuery(".section").each((function(){n.push({slug:jQuery(this).data("sectionSlug"),title:jQuery(this).data("sectionTitle")})})),jQuery(".subsection").each((function(){s[jQuery(this).data("sectionSlug")]=s[jQuery(this).data("sectionSlug")]||[],s[jQuery(this).data("sectionSlug")].push({title:jQuery(this).data("subsectionTitle"),slug:jQuery(this).data("subsectionSlug")})})),n.forEach((function(e){jQuery(".nav-tab-wrapper").append('<a href="#" class="nav-tab" data-section-slug="'+e.slug+'">'+e.title+"</a>")})),jQuery(".nav-tab-wrapper").after(function(e){let t=Object.keys(e),n="";return t.forEach((function(t){n+='<ul class="pmw-subnav-tabs" data-section-slug="'+t+'">',e[t].forEach((function(e){n+='<li class="pmw-subnav-li pmw-subnav-li-inactive" style="cursor: pointer;" data-subsection-slug="'+e.slug+'">'+e.title+"</li>"})),n+="</ul>"})),n}(s)),jQuery(".nav-tab-wrapper a").on("click",(function(e){e.preventDefault(),jQuery(this).addClass("nav-tab-active").siblings().removeClass("nav-tab-active");let i=jQuery(this).data("section-slug");!function(e,n){jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide(),jQuery(".pmw-subnav-tabs").hide(),jQuery(".pmw-subnav-tabs[data-section-slug="+e+"]").show();let s=n.findIndex((t=>t.slug===e));jQuery("div[data-section-slug="+e+"]").closest("table").prevAll("h2:first").next().nextUntil("h2, .submit").andSelf().show(),t(n[s].slug)}(i,n),i in s&&jQuery("ul[data-section-slug="+i+"]").children(":first").trigger("click")})),jQuery(".pmw-subnav-li").on("click",(function(e){var n,s;e.preventDefault(),jQuery(this).addClass("pmw-subnav-li-active").removeClass("pmw-subnav-li-inactive").siblings().addClass("pmw-subnav-li-inactive").removeClass("pmw-subnav-li-active"),n=jQuery(this).parent().data("section-slug"),s=jQuery(this).data("subsection-slug"),jQuery("#wpm_settings_form > h2").nextUntil(".submit").andSelf().hide(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+s+"]").closest("tr").siblings().andSelf().hide(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+s+"]").closest("table").show(),jQuery("[data-section-slug="+n+"][data-subsection-slug="+s+"]").closest("tr").nextUntil(jQuery("[data-section-slug="+n+"][data-subsection-slug]").closest("tr")).show(),t(n,s)})),e()){let t=e();jQuery("a[data-section-slug="+t.section+"]").trigger("click"),!1!==t.subsection&&jQuery("ul[data-section-slug="+t.section+"]").children("[data-subsection-slug="+t.subsection+"]").trigger("click")}else jQuery("a[data-section-slug="+n[0].slug+"]").trigger("click")})),wpmGetPageId=()=>{const e=window.location.search;return new URLSearchParams(e).get("page")}}},t={};function n(s){var i=t[s];if(void 0!==i)return i.exports;var a=t[s]={exports:{}};return e[s](a,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yBgG,EAAS,GAAT,KAAsB,KAAK3F,QAAQ,QAEpE,IA6FD0F,aAAe,KAEd,MAAMhB,EAAcvD,OAAOgD,SAASQ,OAGpC,OAFoB,IAAIE,gBAAgBH,GAEvBI,IAAI,OAArB,C,GC7LG+C,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBzH,IAAjB0H,EACH,OAAOA,EAAaC,QAGrB,IAAIC,EAASL,EAAyBE,GAAY,CAGjDE,QAAS,CAAC,GAOX,OAHAE,EAAoBJ,GAAUG,EAAQA,EAAOD,QAASH,GAG/CI,EAAOD,OACf,CChBAG,EAAQ,KACRA,EAAQ,KACRA,EAAQ,I","sources":["webpack://Pixel-Manager-for-WooCommerce/./src/js/admin/helpers.js","webpack://Pixel-Manager-for-WooCommerce/./src/js/admin/script-blocker-warning.js","webpack://Pixel-Manager-for-WooCommerce/./src/js/admin/tabs.js","webpack://Pixel-Manager-for-WooCommerce/webpack/bootstrap","webpack://Pixel-Manager-for-WooCommerce/./src/js/admin/main.js"],"sourcesContent":["jQuery(function () {\n\n\t// copy debug info textarea\n\tjQuery(\"#debug-info-button\").on(\"click\", function () {\n\t\tjQuery(\"#debug-info-textarea\").select()\n\t\tdocument.execCommand(\"copy\")\n\t})\n\n\tjQuery(\"#wpm_pro_version_demo\").on(\"click\", function () {\n\t\tjQuery(\"#submit\").trigger(\"click\")\n\t})\n\n\tdocument.getElementById(\"json-settings-file-input\")\n\t\t.addEventListener(\"change\", wpm.readSingleFile, false)\n});\n\n(function (wpm, $, undefined) {\n\n\twpm.saveSettingsToDisk = () => {\n\t\tlet text = document.getElementById(\"export-settings-json\").value\n\t\ttext = text.replace(/\\n/g, \"\\r\\n\") // To retain the Line breaks.\n\t\tlet blob = new Blob([text], {type: \"text/plain\"})\n\t\tlet anchor = document.createElement(\"a\")\n\t\tanchor.download = \"pixel-manager-settings-\" + wpm.getCurrentDateForFileName() + \".json\"\n\t\tanchor.href = window.URL.createObjectURL(blob)\n\t\tanchor.target = \"_blank\"\n\t\tanchor.style.display = \"none\" // just to be safe!\n\t\tdocument.body.appendChild(anchor)\n\t\tanchor.click()\n\t\tdocument.body.removeChild(anchor)\n\t}\n\n\t// Get date in year month day divided by dots. Month and day have to be zero padded.\n\twpm.getCurrentDateForFileName = () => {\n\t\tlet date = new Date()\n\t\tlet year = date.getFullYear()\n\t\tlet month = (\"0\" + (date.getMonth() + 1)).slice(-2)\n\t\tlet day = (\"0\" + date.getDate()).slice(-2)\n\t\treturn year + \".\" + month + \".\" + day\n\n\t\t// return date.toLocaleDateString(\n\t\t// \t\"en-US\", {\n\t\t// \t\tyear : \"numeric\",\n\t\t// \t\tmonth: \"2-digit\",\n\t\t// \t\tday : \"2-digit\",\n\t\t// \t},\n\t\t// )\n\t}\n\n\twpm.readSingleFile = e => {\n\n\t\tlet file = e.target.files[0]\n\t\tif (!file) return\n\t\tlet reader = new FileReader()\n\t\treader.onload = function (e) {\n\t\t\tlet contents = JSON.parse(e.target.result)\n\n\t\t\t// document.getElementById(\"import-settings-json\").textContent = JSON.stringify(contents)\n\n\t\t\twpm.saveImportedSettingsToDb(contents)\n\t\t}\n\t\treader.readAsText(file)\n\t}\n\n\twpm.saveImportedSettingsToDb = settings => {\n\n\t\tfetch(pmwAdminApi.root + 'pmw/v1/settings/', {\n\t\t\tmethod: 'POST',\n\t\t\tcredentials: 'same-origin',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'X-WP-Nonce': pmwAdminApi.nonce\n\t\t\t},\n\t\t\tbody: JSON.stringify(settings)\n\t\t})\n\t\t\t.then(response => response.json())\n\t\t\t.then(async message=> {\n\t\t\t\tif (message.success) {\n\t\t\t\t\tconsole.log(message)\n\t\t\t\t\t// reload window\n\t\t\t\t\tdocument.getElementById(\"upload-status-success\").style.display = \"block\"\n\t\t\t\t\t// wait 5 seconds\n\t\t\t\t\tawait new Promise(resolve => setTimeout(resolve, 5000))\n\t\t\t\t\twindow.location.reload()\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(message)\n\t\t\t\t\tdocument.getElementById(\"upload-status-error\").style.display = \"block\"\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.error(error)\n\t\t\t\tdocument.getElementById(\"upload-status-error\").style.display = \"block\"\n\t\t\t})\n\t}\n\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n","function wpm_hide_script_blocker_warning() {\n\tjQuery('#script-blocker-notice').hide();\n}\n\n// try to hide as soon as this script is loaded\n// might be too early in some cases, as the HTML is not rendered yet\nwpm_hide_script_blocker_warning();\n\n// if all other earlier attempts to hide did fail\n// run the function after entire DOM has been loaded\njQuery(function () {\n\twpm_hide_script_blocker_warning();\n});\n","jQuery(function () {\n\n\t // Don't run if we are not one of the\n\t // WPM main tabs\n\tif(\"wpm\" !== wpmGetPageId()) return\n\n\tlet sections = []\n\tlet subsections = {}\n\n\t// Hide unnecessary elements\n\tjQuery(\".section\").closest(\"tr\").hide()\n\n\t// Collect information on sections\n\tjQuery(\".section\").each(function () {\n\t\tsections.push({\n\t\t\t\"slug\" : jQuery(this).data(\"sectionSlug\"),\n\t\t\t\"title\": jQuery(this).data(\"sectionTitle\"),\n\t\t})\n\t})\n\n\t// Collect information on subsections\n\tjQuery(\".subsection\").each(function () {\n\n\t\tsubsections[jQuery(this).data(\"sectionSlug\")] = subsections[jQuery(this).data(\"sectionSlug\")] || []\n\n\t\tsubsections[jQuery(this).data(\"sectionSlug\")].push({\n\t\t\t\"title\": jQuery(this).data(\"subsectionTitle\"),\n\t\t\t\"slug\" : jQuery(this).data(\"subsectionSlug\"),\n\t\t})\n\t})\n\n\t// Create tabs for sections\n\tsections.forEach(\n\t\tfunction (section) {\n\t\t\tjQuery(\".nav-tab-wrapper\").append(\"<a href=\\\"#\\\" class=\\\"nav-tab\\\" data-section-slug=\\\"\" + section[\"slug\"] + \"\\\">\" + section[\"title\"] + \"</a>\")\n\t\t})\n\n\t// Create tabs for each subsections\n\tjQuery(\".nav-tab-wrapper\").after(wpmCreateSubtabUlHtml(subsections))\n\n\t// Create on-click events on section tabs that toggle the views\n\tjQuery(\".nav-tab-wrapper a\").on(\"click\", function (e) {\n\n\t\te.preventDefault()\n\n\t\t// show clicked tab as active\n\t\tjQuery(this).addClass(\"nav-tab-active\").siblings().removeClass(\"nav-tab-active\")\n\n\t\t// toggle the sections visible / invisible based on clicked tab\n\n\t\tlet sectionSlug = jQuery(this).data(\"section-slug\")\n\t\twpmToggleSections(sectionSlug, sections)\n\n\t\t// if subsection exists, click on first subsection\n\t\tif (sectionSlug in subsections) {\n\t\t\tjQuery(\"ul[data-section-slug=\" + sectionSlug + \"]\").children(\":first\").trigger(\"click\")\n\t\t}\n\t})\n\n\t// Create on-click events on subsection tabs that toggle the views\n\tjQuery(\".subnav-li\").on(\"click\", function (e) {\n\n\t\te.preventDefault()\n\n\t\t// jQuery(this).hide();\n\t\tjQuery(this)\n\t\t\t.addClass(\"subnav-li-active\").removeClass(\"subnav-li-inactive\")\n\t\t\t.siblings()\n\t\t\t.addClass(\"subnav-li-inactive\").removeClass(\"subnav-li-active\")\n\n\t\twpmToggleSubsection(jQuery(this).parent().data(\"section-slug\"), jQuery(this).data(\"subsection-slug\"))\n\t})\n\n\t/**\n\t * If someone accesses a plugin tab by deep link, open the right tab\n\t * or fallback to default (first tab)\n\t *\n\t * If deeplink is being opened,\n\t * open the according section and subsection\n\t */\n\tif (wpmGetSectionParams()) {\n\n\t\tlet sectionParams = wpmGetSectionParams()\n\n\t\tjQuery(\"a[data-section-slug=\" + sectionParams[\"section\"] + \"]\").trigger(\"click\")\n\n\t\tif (sectionParams[\"subsection\"] !== false) {\n\t\t\tjQuery(\"ul[data-section-slug=\" + sectionParams[\"section\"] + \"]\").children(\"[data-subsection-slug=\" + sectionParams[\"subsection\"] + \"]\").trigger(\"click\")\n\t\t}\n\t} else {\n\t\tjQuery(\"a[data-section-slug=\" + sections[0][\"slug\"] + \"]\").trigger(\"click\")\n\t}\n})\n\n// Creates the html with all subsection elements\nfunction wpmCreateSubtabUlHtml(subsections) {\n\n\tlet subsectionsKeys = Object.keys(subsections)\n\n\tlet html = \"\"\n\n\tsubsectionsKeys.forEach(function (subsectionKey) {\n\t\thtml += \"<ul class=\\\"subnav-tabs\\\" data-section-slug=\\\"\" + subsectionKey + \"\\\">\"\n\n\t\tlet subtabs = subsections[subsectionKey]\n\n\t\tsubtabs.forEach(function (subtab) {\n\t\t\thtml += \"<li class=\\\"subnav-li subnav-li-inactive\\\" style=\\\"cursor: pointer;\\\" data-subsection-slug=\\\"\" + subtab[\"slug\"] + \"\\\">\" + subtab[\"title\"] + \"</li>\"\n\t\t})\n\n\t\thtml += \"</ul>\"\n\t})\n\n\treturn html\n}\n\n/**\n * If section (and subsection) URL parameters are set,\n * return them, otherwise return false\n */\nfunction wpmGetSectionParams() {\n\n\tconst queryString = window.location.search\n\tconst urlParams = new URLSearchParams(queryString)\n\n\tif (urlParams.get(\"section\")) {\n\t\treturn {\n\t\t\t\"section\" : urlParams.get(\"section\"),\n\t\t\t\"subsection\": urlParams.get(\"subsection\"),\n\t\t}\n\t} else {\n\t\treturn false\n\t}\n}\n\n// Toggles the sections\nfunction wpmToggleSections(sectionSlug, sections) {\n\n\tjQuery(\"#wpm_settings_form > h2\").nextUntil(\".submit\").andSelf().hide()\n\tjQuery(\".subnav-tabs\").hide()\n\tjQuery(\".subnav-tabs[data-section-slug=\" + sectionSlug + \"]\").show()\n\n\tlet sectionPos = sections.findIndex((arrayElement) => arrayElement[\"slug\"] === sectionSlug)\n\n\tjQuery(\"div[data-section-slug=\" + sectionSlug + \"]\").closest(\"table\").prevAll(\"h2:first\").next().nextUntil(\"h2, .submit\").andSelf().show()\n\n\t// set the URL with the active tab parameter\n\twpmSetUrl(sections[sectionPos][\"slug\"])\n}\n\nfunction wpmToggleSubsection(sectionSlug, subsectionSlug) {\n\n\tjQuery(\"#wpm_settings_form > h2\").nextUntil(\".submit\").andSelf().hide()\n\tjQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug=\" + subsectionSlug + \"]\").closest(\"tr\").siblings().andSelf().hide()\n\n\tjQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug=\" + subsectionSlug + \"]\").closest(\"table\").show()\n\tjQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug=\" + subsectionSlug + \"]\").closest(\"tr\").nextUntil(jQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug]\").closest(\"tr\")).show()\n\n\t// Set the URL with the active tab parameter\n\twpmSetUrl(sectionSlug, subsectionSlug)\n}\n\n// Sets the new URL parameters\nfunction wpmSetUrl(sectionSlug, subsectionSlug = \"\") {\n\n\tconst queryString = window.location.search\n\tconst urlParams = new URLSearchParams(queryString)\n\n\turlParams.delete(\"section\")\n\turlParams.delete(\"subsection\")\n\n\tlet newParams = \"section=\" + sectionSlug\n\tnewParams += subsectionSlug ? \"&subsection=\" + subsectionSlug : \"\"\n\n\thistory.pushState(\"\", \"wpm\" + sectionSlug, document.location.pathname + \"?page=wpm&\" + newParams)\n\n\t// Make WP remember which was the selected tab on a save and return to the same tab after saving\n\tjQuery(\"input[name =\\\"_wp_http_referer\\\"]\").val(wpmGetAdminPath() + \"?page=wpm&\" + newParams + \"&settings-updated=true\")\n}\n\nfunction wpmGetAdminPath() {\n\tlet url = new URL(jQuery(\"#wp-admin-canonical\").attr(\"href\"))\n\treturn url.pathname\n}\n\nwpmGetPageId = () => {\n\n\tconst queryString = window.location.search\n\tconst urlParams = new URLSearchParams(queryString)\n\n\treturn urlParams.get(\"page\")\n}\n\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Combine all admin scripts\n * (which only run on the wpm pages)\n */\n\n// require(\"./environment-check\")\nrequire(\"./helpers\")\nrequire(\"./script-blocker-warning\")\nrequire(\"./tabs\")\n\n// console.log('Pixel Manager for WooCommerce admin script')\n"],"names":["jQuery","on","select","document","execCommand","trigger","getElementById","addEventListener","wpm","readSingleFile","$","undefined","saveSettingsToDisk","text","value","replace","blob","Blob","type","anchor","createElement","download","getCurrentDateForFileName","href","window","URL","createObjectURL","target","style","display","body","appendChild","click","removeChild","date","Date","getFullYear","getMonth","slice","getDate","e","file","files","reader","FileReader","onload","contents","JSON","parse","result","saveImportedSettingsToDb","readAsText","settings","fetch","pmwAdminApi","root","method","credentials","headers","nonce","stringify","then","response","json","async","message","success","console","log","Promise","resolve","setTimeout","location","reload","catch","error","wpm_hide_script_blocker_warning","hide","wpmGetSectionParams","queryString","search","urlParams","URLSearchParams","get","wpmSetUrl","sectionSlug","subsectionSlug","delete","newParams","history","pushState","pathname","val","wpmGetAdminPath","attr","wpmGetPageId","sections","subsections","closest","each","push","this","data","forEach","section","append","after","subsectionsKeys","Object","keys","html","subsectionKey","subtab","wpmCreateSubtabUlHtml","preventDefault","addClass","siblings","removeClass","nextUntil","andSelf","show","sectionPos","findIndex","arrayElement","prevAll","next","wpmToggleSections","children","parent","sectionParams","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","require"],"sourceRoot":""}
1
+ {"version":3,"file":"wpm-admin.p1.min.js","mappings":"sBAAAA,QAAO,WAGNA,OAAO,sBAAsBC,GAAG,SAAS,WACxCD,OAAO,wBAAwBE,SAC/BC,SAASC,YAAY,OACrB,IAEDJ,OAAO,yBAAyBC,GAAG,SAAS,WAC3CD,OAAO,WAAWK,QAAQ,QAC1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,QAAS,CAAC,GAOX,OAHAE,EAAoBJ,GAAUG,EAAQA,EAAOD,QAASH,GAG/CI,EAAOD,OACf,CChBAG,EAAQ,KACRA,EAAQ,KACRA,EAAQ,I","sources":["webpack://Pixel-Manager-for-WooCommerce/./src/js/admin/helpers.js","webpack://Pixel-Manager-for-WooCommerce/./src/js/admin/script-blocker-warning.js","webpack://Pixel-Manager-for-WooCommerce/./src/js/admin/tabs.js","webpack://Pixel-Manager-for-WooCommerce/webpack/bootstrap","webpack://Pixel-Manager-for-WooCommerce/./src/js/admin/main.js"],"sourcesContent":["jQuery(function () {\n\n\t// copy debug info textarea\n\tjQuery(\"#debug-info-button\").on(\"click\", function () {\n\t\tjQuery(\"#debug-info-textarea\").select()\n\t\tdocument.execCommand(\"copy\")\n\t})\n\n\tjQuery(\"#wpm_pro_version_demo\").on(\"click\", function () {\n\t\tjQuery(\"#submit\").trigger(\"click\")\n\t})\n\n\tdocument.getElementById(\"json-settings-file-input\")\n\t\t.addEventListener(\"change\", wpm.readSingleFile, false)\n});\n\n(function (wpm, $, undefined) {\n\n\twpm.saveSettingsToDisk = () => {\n\t\tlet text = document.getElementById(\"export-settings-json\").value\n\t\ttext = text.replace(/\\n/g, \"\\r\\n\") // To retain the Line breaks.\n\t\tlet blob = new Blob([text], {type: \"text/plain\"})\n\t\tlet anchor = document.createElement(\"a\")\n\t\tanchor.download = \"pixel-manager-settings-\" + wpm.getCurrentDateForFileName() + \".json\"\n\t\tanchor.href = window.URL.createObjectURL(blob)\n\t\tanchor.target = \"_blank\"\n\t\tanchor.style.display = \"none\" // just to be safe!\n\t\tdocument.body.appendChild(anchor)\n\t\tanchor.click()\n\t\tdocument.body.removeChild(anchor)\n\t}\n\n\t// Get date in year month day divided by dots. Month and day have to be zero padded.\n\twpm.getCurrentDateForFileName = () => {\n\t\tlet date = new Date()\n\t\tlet year = date.getFullYear()\n\t\tlet month = (\"0\" + (date.getMonth() + 1)).slice(-2)\n\t\tlet day = (\"0\" + date.getDate()).slice(-2)\n\t\treturn year + \".\" + month + \".\" + day\n\n\t\t// return date.toLocaleDateString(\n\t\t// \t\"en-US\", {\n\t\t// \t\tyear : \"numeric\",\n\t\t// \t\tmonth: \"2-digit\",\n\t\t// \t\tday : \"2-digit\",\n\t\t// \t},\n\t\t// )\n\t}\n\n\twpm.readSingleFile = e => {\n\n\t\tlet file = e.target.files[0]\n\t\tif (!file) return\n\t\tlet reader = new FileReader()\n\t\treader.onload = function (e) {\n\t\t\tlet contents = JSON.parse(e.target.result)\n\n\t\t\t// document.getElementById(\"import-settings-json\").textContent = JSON.stringify(contents)\n\n\t\t\twpm.saveImportedSettingsToDb(contents)\n\t\t}\n\t\treader.readAsText(file)\n\t}\n\n\twpm.saveImportedSettingsToDb = settings => {\n\n\t\tfetch(pmwAdminApi.root + 'pmw/v1/settings/', {\n\t\t\tmethod: 'POST',\n\t\t\tcredentials: 'same-origin',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'X-WP-Nonce': pmwAdminApi.nonce\n\t\t\t},\n\t\t\tbody: JSON.stringify(settings)\n\t\t})\n\t\t\t.then(response => response.json())\n\t\t\t.then(async message=> {\n\t\t\t\tif (message.success) {\n\t\t\t\t\tconsole.log(message)\n\t\t\t\t\t// reload window\n\t\t\t\t\tdocument.getElementById(\"upload-status-success\").style.display = \"block\"\n\t\t\t\t\t// wait 5 seconds\n\t\t\t\t\tawait new Promise(resolve => setTimeout(resolve, 5000))\n\t\t\t\t\twindow.location.reload()\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(message)\n\t\t\t\t\tdocument.getElementById(\"upload-status-error\").style.display = \"block\"\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.error(error)\n\t\t\t\tdocument.getElementById(\"upload-status-error\").style.display = \"block\"\n\t\t\t})\n\t}\n\n\n}(window.wpm = window.wpm || {}, jQuery))\n\n\n","function wpm_hide_script_blocker_warning() {\n\tjQuery('#script-blocker-notice').hide();\n}\n\n// try to hide as soon as this script is loaded\n// might be too early in some cases, as the HTML is not rendered yet\nwpm_hide_script_blocker_warning();\n\n// if all other earlier attempts to hide did fail\n// run the function after entire DOM has been loaded\njQuery(function () {\n\twpm_hide_script_blocker_warning();\n});\n","jQuery(function () {\n\n\t // Don't run if we are not one of the\n\t // WPM main tabs\n\tif(\"wpm\" !== wpmGetPageId()) return\n\n\tlet sections = []\n\tlet subsections = {}\n\n\t// Hide unnecessary elements\n\tjQuery(\".section\").closest(\"tr\").hide()\n\n\t// Collect information on sections\n\tjQuery(\".section\").each(function () {\n\t\tsections.push({\n\t\t\t\"slug\" : jQuery(this).data(\"sectionSlug\"),\n\t\t\t\"title\": jQuery(this).data(\"sectionTitle\"),\n\t\t})\n\t})\n\n\t// Collect information on subsections\n\tjQuery(\".subsection\").each(function () {\n\n\t\tsubsections[jQuery(this).data(\"sectionSlug\")] = subsections[jQuery(this).data(\"sectionSlug\")] || []\n\n\t\tsubsections[jQuery(this).data(\"sectionSlug\")].push({\n\t\t\t\"title\": jQuery(this).data(\"subsectionTitle\"),\n\t\t\t\"slug\" : jQuery(this).data(\"subsectionSlug\"),\n\t\t})\n\t})\n\n\t// Create tabs for sections\n\tsections.forEach(\n\t\tfunction (section) {\n\t\t\tjQuery(\".nav-tab-wrapper\").append(\"<a href=\\\"#\\\" class=\\\"nav-tab\\\" data-section-slug=\\\"\" + section[\"slug\"] + \"\\\">\" + section[\"title\"] + \"</a>\")\n\t\t})\n\n\t// Create tabs for each subsections\n\tjQuery(\".nav-tab-wrapper\").after(wpmCreateSubtabUlHtml(subsections))\n\n\t// Create on-click events on section tabs that toggle the views\n\tjQuery(\".nav-tab-wrapper a\").on(\"click\", function (e) {\n\n\t\te.preventDefault()\n\n\t\t// show clicked tab as active\n\t\tjQuery(this).addClass(\"nav-tab-active\").siblings().removeClass(\"nav-tab-active\")\n\n\t\t// toggle the sections visible / invisible based on clicked tab\n\n\t\tlet sectionSlug = jQuery(this).data(\"section-slug\")\n\t\twpmToggleSections(sectionSlug, sections)\n\n\t\t// if subsection exists, click on first subsection\n\t\tif (sectionSlug in subsections) {\n\t\t\tjQuery(\"ul[data-section-slug=\" + sectionSlug + \"]\").children(\":first\").trigger(\"click\")\n\t\t}\n\t})\n\n\t// Create on-click events on subsection tabs that toggle the views\n\tjQuery(\".pmw-subnav-li\").on(\"click\", function (e) {\n\n\t\te.preventDefault()\n\n\t\t// jQuery(this).hide();\n\t\tjQuery(this)\n\t\t\t.addClass(\"pmw-subnav-li-active\").removeClass(\"pmw-subnav-li-inactive\")\n\t\t\t.siblings()\n\t\t\t.addClass(\"pmw-subnav-li-inactive\").removeClass(\"pmw-subnav-li-active\")\n\n\t\twpmToggleSubsection(jQuery(this).parent().data(\"section-slug\"), jQuery(this).data(\"subsection-slug\"))\n\t})\n\n\t/**\n\t * If someone accesses a plugin tab by deep link, open the right tab\n\t * or fallback to default (first tab)\n\t *\n\t * If deeplink is being opened,\n\t * open the according section and subsection\n\t */\n\tif (wpmGetSectionParams()) {\n\n\t\tlet sectionParams = wpmGetSectionParams()\n\n\t\tjQuery(\"a[data-section-slug=\" + sectionParams[\"section\"] + \"]\").trigger(\"click\")\n\n\t\tif (sectionParams[\"subsection\"] !== false) {\n\t\t\tjQuery(\"ul[data-section-slug=\" + sectionParams[\"section\"] + \"]\").children(\"[data-subsection-slug=\" + sectionParams[\"subsection\"] + \"]\").trigger(\"click\")\n\t\t}\n\t} else {\n\t\tjQuery(\"a[data-section-slug=\" + sections[0][\"slug\"] + \"]\").trigger(\"click\")\n\t}\n})\n\n// Creates the html with all subsection elements\nfunction wpmCreateSubtabUlHtml(subsections) {\n\n\tlet subsectionsKeys = Object.keys(subsections)\n\n\tlet html = \"\"\n\n\tsubsectionsKeys.forEach(function (subsectionKey) {\n\t\thtml += \"<ul class=\\\"pmw-subnav-tabs\\\" data-section-slug=\\\"\" + subsectionKey + \"\\\">\"\n\n\t\tlet subtabs = subsections[subsectionKey]\n\n\t\tsubtabs.forEach(function (subtab) {\n\t\t\thtml += \"<li class=\\\"pmw-subnav-li pmw-subnav-li-inactive\\\" style=\\\"cursor: pointer;\\\" data-subsection-slug=\\\"\" + subtab[\"slug\"] + \"\\\">\" + subtab[\"title\"] + \"</li>\"\n\t\t})\n\n\t\thtml += \"</ul>\"\n\t})\n\n\treturn html\n}\n\n/**\n * If section (and subsection) URL parameters are set,\n * return them, otherwise return false\n */\nfunction wpmGetSectionParams() {\n\n\tconst queryString = window.location.search\n\tconst urlParams = new URLSearchParams(queryString)\n\n\tif (urlParams.get(\"section\")) {\n\t\treturn {\n\t\t\t\"section\" : urlParams.get(\"section\"),\n\t\t\t\"subsection\": urlParams.get(\"subsection\"),\n\t\t}\n\t} else {\n\t\treturn false\n\t}\n}\n\n// Toggles the sections\nfunction wpmToggleSections(sectionSlug, sections) {\n\n\tjQuery(\"#wpm_settings_form > h2\").nextUntil(\".submit\").andSelf().hide()\n\tjQuery(\".pmw-subnav-tabs\").hide()\n\tjQuery(\".pmw-subnav-tabs[data-section-slug=\" + sectionSlug + \"]\").show()\n\n\tlet sectionPos = sections.findIndex((arrayElement) => arrayElement[\"slug\"] === sectionSlug)\n\n\tjQuery(\"div[data-section-slug=\" + sectionSlug + \"]\").closest(\"table\").prevAll(\"h2:first\").next().nextUntil(\"h2, .submit\").andSelf().show()\n\n\t// set the URL with the active tab parameter\n\twpmSetUrl(sections[sectionPos][\"slug\"])\n}\n\nfunction wpmToggleSubsection(sectionSlug, subsectionSlug) {\n\n\tjQuery(\"#wpm_settings_form > h2\").nextUntil(\".submit\").andSelf().hide()\n\tjQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug=\" + subsectionSlug + \"]\").closest(\"tr\").siblings().andSelf().hide()\n\n\tjQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug=\" + subsectionSlug + \"]\").closest(\"table\").show()\n\tjQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug=\" + subsectionSlug + \"]\").closest(\"tr\").nextUntil(jQuery(\"[data-section-slug=\" + sectionSlug + \"][data-subsection-slug]\").closest(\"tr\")).show()\n\n\t// Set the URL with the active tab parameter\n\twpmSetUrl(sectionSlug, subsectionSlug)\n}\n\n// Sets the new URL parameters\nfunction wpmSetUrl(sectionSlug, subsectionSlug = \"\") {\n\n\tconst queryString = window.location.search\n\tconst urlParams = new URLSearchParams(queryString)\n\n\turlParams.delete(\"section\")\n\turlParams.delete(\"subsection\")\n\n\tlet newParams = \"section=\" + sectionSlug\n\tnewParams += subsectionSlug ? \"&subsection=\" + subsectionSlug : \"\"\n\n\thistory.pushState(\"\", \"wpm\" + sectionSlug, document.location.pathname + \"?page=wpm&\" + newParams)\n\n\t// Make WP remember which was the selected tab on a save and return to the same tab after saving\n\tjQuery(\"input[name =\\\"_wp_http_referer\\\"]\").val(wpmGetAdminPath() + \"?page=wpm&\" + newParams + \"&settings-updated=true\")\n}\n\nfunction wpmGetAdminPath() {\n\tlet url = new URL(jQuery(\"#wp-admin-canonical\").attr(\"href\"))\n\treturn url.pathname\n}\n\nwpmGetPageId = () => {\n\n\tconst queryString = window.location.search\n\tconst urlParams = new URLSearchParams(queryString)\n\n\treturn urlParams.get(\"page\")\n}\n\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/**\n * Combine all admin scripts\n * (which only run on the wpm pages)\n */\n\n// require(\"./environment-check\")\nrequire(\"./helpers\")\nrequire(\"./script-blocker-warning\")\nrequire(\"./tabs\")\n\n// console.log('Pixel Manager for WooCommerce admin script')\n"],"names":["jQuery","on","select","document","execCommand","trigger","getElementById","addEventListener","wpm","readSingleFile","$","undefined","saveSettingsToDisk","text","value","replace","blob","Blob","type","anchor","createElement","download","getCurrentDateForFileName","href","window","URL","createObjectURL","target","style","display","body","appendChild","click","removeChild","date","Date","getFullYear","getMonth","slice","getDate","e","file","files","reader","FileReader","onload","contents","JSON","parse","result","saveImportedSettingsToDb","readAsText","settings","fetch","pmwAdminApi","root","method","credentials","headers","nonce","stringify","then","response","json","async","message","success","console","log","Promise","resolve","setTimeout","location","reload","catch","error","wpm_hide_script_blocker_warning","hide","wpmGetSectionParams","queryString","search","urlParams","URLSearchParams","get","wpmSetUrl","sectionSlug","subsectionSlug","delete","newParams","history","pushState","pathname","val","wpmGetAdminPath","attr","wpmGetPageId","sections","subsections","closest","each","push","this","data","forEach","section","append","after","subsectionsKeys","Object","keys","html","subsectionKey","subtab","wpmCreateSubtabUlHtml","preventDefault","addClass","siblings","removeClass","nextUntil","andSelf","show","sectionPos","findIndex","arrayElement","prevAll","next","wpmToggleSections","children","parent","sectionParams","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","module","__webpack_modules__","require"],"sourceRoot":""}
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: woocommerce, google analytics, google ads, facebook, conversion tracking,
4
  Requires at least: 3.7
5
  Tested up to: 6.0
6
  Requires PHP: 7.3
7
- Stable tag: 1.20.0
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -209,11 +209,18 @@ You can send the link to the front page of your shop too if you think it would b
209
 
210
  == Changelog ==
211
 
 
 
 
 
 
 
212
  = 1.20.0 = 30.08.2022
213
 
214
 
215
  * New: Column on order list, showing for which orders the browser conversion pixels have fired.
216
  * New: View in order list that only shows orders where browser conversion pixels have not fired.
 
217
  * Tweak: Removed the off-site payment gateway notification.
218
  * Tweak: Added CartFlows custom thankyou pages compatibility.
219
  * Tweak: Changed product price output to include tax by default, plus added a filter to turn it off.
@@ -225,7 +232,7 @@ You can send the link to the front page of your shop too if you think it would b
225
  * Tweak: Analyse only orders in the payment gateway report that have been created by customers, not shop managers.
226
  * Fix: Added brand output for variations.
227
  * Fix: Fixed a bug that caused the conversion pixels to fire on purchase order payment pages (orders manually created by the shop manager and sent to the customer for payment).
228
- * Fix: Fixed variations output for FB CAPI server side orders when variaitons output is enabled.
229
 
230
  = 1.19.4 = 14.08.2022
231
 
4
  Requires at least: 3.7
5
  Tested up to: 6.0
6
  Requires PHP: 7.3
7
+ Stable tag: 1.20.1
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
209
 
210
  == Changelog ==
211
 
212
+ = 1.20.1 = 31.08.2022
213
+
214
+ * Tweak: Added statuses "cancelled" and "refunded" to the exclusions when conversions should not be fired.
215
+ * Tweak: Moved PMW column on orders page after WC actions
216
+ * Fix: Made PMW admin css to only target PMW elements
217
+
218
  = 1.20.0 = 30.08.2022
219
 
220
 
221
  * New: Column on order list, showing for which orders the browser conversion pixels have fired.
222
  * New: View in order list that only shows orders where browser conversion pixels have not fired.
223
+
224
  * Tweak: Removed the off-site payment gateway notification.
225
  * Tweak: Added CartFlows custom thankyou pages compatibility.
226
  * Tweak: Changed product price output to include tax by default, plus added a filter to turn it off.
232
  * Tweak: Analyse only orders in the payment gateway report that have been created by customers, not shop managers.
233
  * Fix: Added brand output for variations.
234
  * Fix: Fixed a bug that caused the conversion pixels to fire on purchase order payment pages (orders manually created by the shop manager and sent to the customer for payment).
235
+ * Fix: Fixed variations output for FB CAPI server side orders when variations output is enabled.
236
 
237
  = 1.19.4 = 14.08.2022
238
 
wgact.php CHANGED
@@ -10,7 +10,7 @@
10
  * Developer URI: https://sweetcode.com
11
  * Text Domain: woocommerce-google-adwords-conversion-tracking-tag
12
  * Domain path: /languages
13
- * * Version: 1.20.0
14
  *
15
  * WC requires at least: 3.7
16
  * WC tested up to: 6.8
@@ -19,7 +19,7 @@
19
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
20
  *
21
  **/
22
- const WPM_CURRENT_VERSION = '1.20.0' ;
23
  // TODO add option checkbox on uninstall and ask if user wants to delete options from db
24
 
25
  if ( !defined( 'ABSPATH' ) ) {
10
  * Developer URI: https://sweetcode.com
11
  * Text Domain: woocommerce-google-adwords-conversion-tracking-tag
12
  * Domain path: /languages
13
+ * * Version: 1.20.1
14
  *
15
  * WC requires at least: 3.7
16
  * WC tested up to: 6.8
19
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
20
  *
21
  **/
22
+ const WPM_CURRENT_VERSION = '1.20.1' ;
23
  // TODO add option checkbox on uninstall and ask if user wants to delete options from db
24
 
25
  if ( !defined( 'ABSPATH' ) ) {