PixelYourSite – Facebook Pixel (Events, WooCommerce & Easy Digital Downloads) - Version 2.2.5

Version Description

Download this release

Release Info

Developer PixelYourSite
Plugin Icon 128x128 PixelYourSite – Facebook Pixel (Events, WooCommerce & Easy Digital Downloads)
Version 2.2.5
Comparing to
See all releases

Code changes from version 2.2.4 to 2.2.5

facebook-pixel-master.php CHANGED
@@ -5,7 +5,7 @@ Description: Add the Facebook Pixel code into your Wordpress site and set up sta
5
  Plugin URI: http://www.pixelyoursite.com/facebook-pixel-plugin-help
6
  Author: PixelYourSite
7
  Author URI: http://www.pixelyoursite.com
8
- Version: 2.2.4
9
  License: GPLv3
10
  */
11
 
5
  Plugin URI: http://www.pixelyoursite.com/facebook-pixel-plugin-help
6
  Author: PixelYourSite
7
  Author URI: http://www.pixelyoursite.com
8
+ Version: 2.2.5
9
  License: GPLv3
10
  */
11
 
inc/admin_notices.php DELETED
@@ -1,387 +0,0 @@
1
- <?php
2
- function woofp_admin_notices($return=false){
3
-
4
-
5
- $activation_time = get_option('pysf_activation_date', '');
6
- $version = get_option('pysf_plugin_version', '');
7
-
8
-
9
- $current_time = time();
10
-
11
- if( empty($activation_time) || version_compare($version, FBPMP_VERSION, '<') ){
12
- $activation_time = $current_time;
13
- update_option( 'pysf_activation_date', $activation_time);
14
- update_option( 'pysf_plugin_version', FBPMP_VERSION);
15
- update_option( 'pysf_notice_dismiss', '');
16
- update_option( 'woo_pysf_notice_dismiss', '');
17
- }
18
-
19
-
20
- //Expiration time ( 3 days ) = ( number of days * hours * minutes * seconds )
21
- $expiration_days = 3;
22
- $expiration_time = $activation_time + ( $expiration_days * 24 * 60 * 60);
23
-
24
- //calculate number of days passed since activation;
25
- $days_passed = woofp_days_passed($current_time, $activation_time);
26
-
27
- //date of expiration
28
- $expiration_date = date('l jS \of F Y', $expiration_time);
29
-
30
- $link_1 = 'http://www.pixelyoursite.com/limited-offer?utm_source=wadmin&utm_medium=wordpress&utm_campaign=limited-offer';
31
- $link_2 = 'http://www.pixelyoursite.com/super-offer?utm_source=wadmin&utm_medium=wordpress&utm_campaign=super-offer';
32
-
33
-
34
-
35
- //Message for day 1
36
- $day_1_text = '<span class="pysf_note"><b>Limited Offer, ends on “'.$expiration_date.'”:</b></span> If you are not using Dynamic Events - ';
37
- $day_1_text .= '<a href="http://www.pixelyoursite.com/facebook-pixel-dynamic-events" target="_blank">see guide</a>';
38
- $day_1_text .= ' - you are leaving money on the table. Optimize your ads for actions on your website, create better Custom Audiences, and get better conversion reports. ';
39
- $day_1_text .= '<a href="'.$link_1.'" target="_blank">Enable Dynamic Events with PixelYourSite PRO</a>';
40
-
41
- //Message for day 2
42
- $day_2_text = '<span class="pysf_note"><b>Limited Offer, ending in 1 day:</b></span> Enable Dynamic Events and optimize your campaigns for site actions (newsletter sign up, contact forms, pop-ups). ';
43
- $day_2_text .= '<a href="'.$link_1.'" target="_blank">Download now for a big discount</a>';
44
-
45
- //Message for day 3
46
- $day_3_text = '<span class="pysf_note"><b>Limited Offer Ends Today, “'.$expiration_date.'”:</b></span> Last chance to get your big discount for PixelYourSite PRO and start to use <b>Dynamic Events.</b> ';
47
- $day_3_text .= 'Don’t lose this opportunity, because you might need the plugin later: <a href="'.$link_1.'" target="_blank">Click here for your big discount</a>';
48
-
49
- //Message for day 4 to 7;
50
- $day_4_to_7_text = '';
51
-
52
- //Message for day 7 to 12
53
- $day_7_to_12_text = '<span class="pysf_note"><b>Special Offer:</b></span> Update to PixelYourSite PRO and enable Facebook Dynamic Events: optimize your ads for website actions, create better Custom Audiences, get better conversion reports. <a href="'.$link_2.'">Click here for your discount</a>';
54
-
55
-
56
- $options = array(
57
-
58
-
59
- //message for day 1
60
- array(
61
-
62
- 'day' => 1,
63
- 'message' => $day_1_text,
64
- 'visibility' => 'visible', /* visible OR hidden */
65
-
66
- ),
67
-
68
- //message for day 2
69
- array(
70
-
71
- 'day' => 2,
72
- 'message' => $day_2_text,
73
- 'visibility' => 'visible', /* visible OR hidden */
74
-
75
-
76
- ),
77
-
78
- //message for day 3
79
- array(
80
-
81
- 'day' => 3,
82
- 'message' => $day_3_text,
83
- 'visibility' => 'visible', /* visible OR hidden */
84
-
85
-
86
- ),
87
-
88
-
89
- //message for day 4-7
90
- //This will start on day 4
91
- //and end on day 7
92
- array(
93
-
94
- 'day' => '4-7',
95
- 'message' => $day_4_to_7_text,
96
- 'visibility' => 'hidden', /* visible OR hidden */
97
-
98
-
99
- ),
100
-
101
- //message for day 7-12
102
- //This will start on day 7
103
- //and end on day 12
104
- array(
105
-
106
- 'day' => '7-12',
107
- 'message' => $day_7_to_12_text,
108
- 'visibility' => 'visible', /* visible OR hidden */
109
-
110
-
111
- ),
112
-
113
-
114
- );
115
-
116
-
117
- //Messages when WooCommerce is installed and activated
118
-
119
- //WooCommerce Message for day 1
120
- $woo_day_1_text = 'WooCommerce Day 1 Message';
121
- $woo_day_1_text = '<span class="pysf_note"><b>Limited Offer, ends on “'.$expiration_date.'”:</b></span> Track Facebook Ads conversion value and enable Facebook Dynamic Ads for WooCommerce: ';
122
- $woo_day_1_text .= '<a href="'.$link_1.'" target="_blank">Download PixelYourSite PRO for a big discount</a>';
123
-
124
-
125
- //WooCommerce Message for day 2
126
- $woo_day_2_text = 'WooCommerce Day 2 Message.';
127
- $woo_day_2_text = '<span class="pysf_note"><b>Limited Offer, ending in 1 day:</b></span> Enable Facebook Dynamic Ads for WooCommerce and automatically retarget your visitors. ';
128
- $woo_day_2_text .= '<a href="'.$link_1.'" target="_blank">Update now for a big discount</a>';
129
-
130
- //WooCommerce Message for day 3
131
- $woo_day_3_text = 'WooCommerce Day 3 Message.';
132
- $woo_day_3_text = '<span class="pysf_note"><b>Limited Offer Ends Today, “'.$expiration_date.'”:</b></span> With PixelYourSite PRO you can enable WooCommerce Dynamic Ads and you can use Dynamic Events for your campaings. ';
133
- $woo_day_3_text .= 'Don’t lose this opportunity, because you might need the plugin later: <a href="'.$link_1.'" target="_blank">Click here for your big discount</a>';
134
-
135
-
136
- //WooCommerce Message for day 4 to 7;
137
- $woo_day_4_to_7_text = 'WooCommerce Day 4 to 7 Message.';
138
-
139
- //WooCommerce Message for day 7 to 12
140
- $woo_day_7_to_12_text = 'WooCommerce Day 7 to 12 Message.';
141
- $woo_day_7_to_12_text = '<span class="pysf_note"><b>Special Offer:</b></span> Update to PixelYourSite PRO and enable Facebook Dynamic Events: optimize your ads for website actions, create better Custom Audiences, get better conversion reports. WooCommerce Facebook Dynamic Ads fully suported. <a href="'.$link_2.'">Click here for your discount</a>';
142
-
143
-
144
-
145
- $woo_options = array(
146
-
147
-
148
- //woocommerce message for day 1
149
- array(
150
-
151
- 'day' => 1,
152
- 'message' => $woo_day_1_text,
153
- 'visibility' => 'visible', /* visible OR hidden */
154
-
155
- ),
156
-
157
- //woocommerce message for day 2
158
- array(
159
-
160
- 'day' => 2,
161
- 'message' => $woo_day_2_text,
162
- 'visibility' => 'visible', /* visible OR hidden */
163
-
164
-
165
- ),
166
-
167
- //woocommerce message for day 3
168
- array(
169
-
170
- 'day' => 3,
171
- 'message' => $woo_day_3_text,
172
- 'visibility' => 'visible', /* visible OR hidden */
173
-
174
-
175
- ),
176
-
177
-
178
- //woocommerce message for day 4-7
179
- //This will start on day 4
180
- //and end on day 7
181
- array(
182
-
183
- 'day' => '4-7',
184
- 'message' => $woo_day_4_to_7_text,
185
- 'visibility' => 'hidden', /* visible OR hidden */
186
-
187
-
188
- ),
189
-
190
- //woocommerce message for day 7-12
191
- //This will start on day 7
192
- //and end on day 12
193
- array(
194
-
195
- 'day' => '7-12',
196
- 'message' => $woo_day_7_to_12_text,
197
- 'visibility' => 'visible', /* visible OR hidden */
198
-
199
-
200
- ),
201
-
202
-
203
- );
204
-
205
-
206
-
207
-
208
-
209
- //we will store the message of each day
210
- $notice_message = '';
211
-
212
-
213
- if ( class_exists( 'WooCommerce' ) ) {
214
- //WooCommerce is installed
215
-
216
- //Get dismissed notices
217
- $dismiss_option = get_option( 'woo_pysf_notice_dismiss', '');
218
- $options = $woo_options;
219
-
220
- } else {
221
- //No WooCommerce
222
-
223
- //Get dismissed notices
224
- $dismiss_option = get_option( 'pysf_notice_dismiss', '');
225
-
226
- }
227
-
228
-
229
- //loop through notice settings
230
- foreach ($options as $key => $option) {
231
-
232
- $is_dismissed = isset( $dismiss_option[$option['day']] ) ? true : false;
233
-
234
- if( is_integer( $option['day']) ){
235
-
236
- //check if there is a message for a day and that it is on
237
- if( !$is_dismissed && $option['day'] == $days_passed && $option['visibility'] == 'visible' ){
238
-
239
- $dismiss_option = $option['day'];
240
- $notice_message = $option['message'];
241
- break;
242
- }
243
-
244
- } else {
245
-
246
- //check range of days
247
-
248
- $pieces = explode('-', $option['day']);
249
- $start = $pieces[0];
250
- $end = $pieces[1];
251
-
252
- //check if there is a message for a day and that it is on
253
- if( !$is_dismissed && ( $days_passed >= $start && $days_passed <= $end) && $option['visibility'] == 'visible' ){
254
-
255
- $dismiss_option = $option['day'];
256
- $notice_message = $option['message'];
257
- break;
258
- }
259
-
260
-
261
- }
262
- }
263
-
264
-
265
- if( !empty( $notice_message ) ){
266
-
267
- $notice = '<style type="text/css">
268
- .pysf_note{ color: #dd4e4e; }
269
- #pysf_notice {
270
- border-left-width: 10px;
271
- display: block;
272
- margin: 25px 20px 10px 2px;
273
- padding: 4px 10px;
274
- }
275
- #pysf_notice p{ width:98%;}
276
- .pysf_clear{ clear:both;}
277
- </style>';
278
-
279
- $html_class = '';
280
- $html_id = 'pysf_notice_tab';
281
- $button_html = '<button type="button" class="notice-dismiss" title="Dismiss Notice"><span class="screen-reader-text">Dismiss this notice.</span></button>';
282
- if( !$return){
283
- $html_class = 'update-nag notice is-dismissible';
284
- $html_id = 'pysf_notice';
285
- $button_html = '';
286
- }
287
-
288
- $notice .= '<div id="'.$html_id.'" class="'.$html_class.' pysf_clear pysf_notice pysf_notice_day_'.$dismiss_option.'" data-pysf="pysf_notice_day_'.$dismiss_option.'">';
289
- $notice .= '<p>'.$notice_message.'</p>';
290
- $notice .= $button_html;
291
- $notice .= '</div>';
292
-
293
- $notice .= "<script type='text/javascript'>
294
- jQuery(function($){
295
-
296
- jQuery(document).on( 'click', '.pysf_notice .notice-dismiss', function() {
297
-
298
- jQuery(this).closest('.notice-dismiss').fadeOut('slow');
299
-
300
- jQuery.ajax({
301
- url: ajaxurl,
302
- data: {
303
- action: 'pysf_notice_dismiss',
304
- option: '".$dismiss_option."'
305
- }
306
- });
307
-
308
- });
309
-
310
- });
311
- </script>";
312
-
313
- if( !$return)
314
- echo $notice;
315
- else
316
- return $notice;
317
- }
318
-
319
- }
320
-
321
-
322
-
323
- function woofp_admin_notices_action(){
324
- woofp_admin_notices();
325
- }
326
- if( isset($_GET['page']) && $_GET['page'] == 'woo-facebookpixel' ){
327
-
328
- } else {
329
- add_action( 'admin_notices', 'woofp_admin_notices_action' );
330
- }
331
-
332
-
333
- //add jquery if not already included;
334
- function woofp_admin_notices_script(){
335
-
336
- wp_enqueue_script('jquery');
337
-
338
- }
339
- add_action('wp_enqueue_scripts', 'woofp_admin_notices_script');
340
-
341
-
342
- function ajax_pysf_notice_dismiss(){
343
-
344
- if ( class_exists( 'WooCommerce' ) ) {
345
- $name = 'woo_pysf_notice_dismiss';
346
- } else {
347
- $name = 'pysf_notice_dismiss';
348
- }
349
-
350
- if( isset($_REQUEST['option'])){
351
- $dismiss_option = get_option( $name, '');
352
- $dismiss_option[$_REQUEST['option']] = 1;
353
- update_option( $name, $dismiss_option);
354
- }
355
-
356
- die();
357
- }
358
- add_action('wp_ajax_pysf_notice_dismiss', 'ajax_pysf_notice_dismiss');
359
-
360
- //save activated time on plugin activation
361
- function pysf_plugin_activated(){
362
-
363
- $activation_date = get_option('pysf_activation_date', '');
364
- $version = get_option('pysf_plugin_version', '');
365
-
366
- if( empty($activation_date) || version_compare($version, FBPMP_VERSION, '<') ){
367
- update_option( 'pysf_activation_date', time());
368
- update_option( 'pysf_plugin_version', FBPMP_VERSION);
369
- update_option( 'pysf_notice_dismiss', '');
370
- update_option( 'woo_pysf_notice_dismiss', '');
371
- }
372
- }
373
- register_activation_hook(__FILE__, 'pysf_plugin_activated');
374
-
375
-
376
-
377
- //get number of days passed since activation
378
- function woofp_days_passed($current_time, $activation_time){
379
-
380
- $timepassed = $current_time-$activation_time;
381
- $timepassed = ( ( ( $timepassed/24 )/60 )/60 );
382
- $dayspassed = floor($timepassed);
383
- $dayspassed = $dayspassed + 1;
384
-
385
- return $dayspassed;
386
-
387
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/helper-functions - Copy.php DELETED
@@ -1,901 +0,0 @@
1
- <?php
2
- /**
3
- * Get Admin Settings
4
- *
5
- * @return array
6
- * @author PixelYourSite
7
- **/
8
- function woofp_admin_settings($option_name='all'){
9
-
10
-
11
- $settings = get_option('woofp_admin_settings');
12
-
13
- if(empty($settings)) {
14
-
15
- $settings = array();
16
-
17
- } else {
18
-
19
- $options = array('facebookpixel', 'standardevent', 'woocommerce');
20
- foreach ( $options as $key => $name ) {
21
-
22
- if( !isset( $settings[$name]) || empty( $settings[$name] ) ){
23
-
24
- $settings[$name] = array();
25
- }
26
- }
27
- }
28
-
29
-
30
- switch ($option_name) {
31
- case 'all':
32
-
33
- return $settings;
34
-
35
- break;
36
-
37
- case 'facebookpixel':
38
-
39
- return ( isset($settings['facebookpixel']) ? $settings['facebookpixel'] : '' );
40
-
41
- break;
42
-
43
- case 'standardevent':
44
-
45
- return ( isset($settings['standardevent']) ? $settings['standardevent'] : '' );
46
-
47
-
48
- break;
49
-
50
- case 'woocommerce':
51
-
52
- return ( isset($settings['woocommerce']) ? $settings['woocommerce'] : '' );
53
-
54
-
55
- break;
56
-
57
- default:
58
-
59
- return $settings;
60
-
61
- break;
62
- }
63
- }
64
-
65
- /**
66
- * Get Saved Option Value
67
- *
68
- * @return array|string
69
- * @author PixelYourSite
70
- **/
71
- function woofp_get_option($name='', $option=''){
72
-
73
- if(empty($name) || empty($option))
74
- return '';
75
-
76
- $settings = woofp_admin_settings();
77
-
78
- if( isset( $settings[$name][$option] ) )
79
- return $settings[$name][$option];
80
- else
81
- return '';
82
- }
83
-
84
- /**
85
- * Current Page Full URL
86
- *
87
- * @return string
88
- * @author PixelYourSite
89
- **/
90
- function woofp_current_url(){
91
-
92
- $current_url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
93
- $current_url = rtrim($current_url, '/');
94
-
95
- return $current_url;
96
- }
97
-
98
- /**
99
- * Return Javascript Code for facebook standard event
100
- * ( With fallback for No Javascript )
101
- *
102
- * @return array
103
- * @author PixelYourSite
104
- **/
105
- function woofp_page_event(){
106
-
107
- $facebookpixel = woofp_admin_settings('facebookpixel');
108
- $standardevent = woofp_admin_settings('standardevent');
109
- $woocommerce_settings = woofp_admin_settings('woocommerce');
110
-
111
-
112
- $pixelcode = "";
113
-
114
- /* whether facebook pixel is activated */
115
- if( isset($facebookpixel['activate']) && $facebookpixel['activate'] == 1 ){
116
-
117
- $pixel_id = isset($facebookpixel['ID']) ? $facebookpixel['ID'] : '';
118
- $current_url = woofp_current_url();
119
- $event_added = array();
120
-
121
-
122
- $nojs_pixelcode = "";
123
-
124
- $pixelcode .= "\n";
125
- $nojs_pixelcode .= "\n";
126
-
127
-
128
- $pixelcode .= "// Insert Your Facebook Pixel ID below. \n fbq('init', '".$pixel_id."'); \n\n";
129
-
130
- $eventtype = 'PageView';
131
-
132
- $pixelcode .= "//Default Event \n" . woofp_get_event( $eventtype ) . " \n\n";
133
- $nojs_pixelcode .= "<!-- Default Event --> \n" . woofp_get_event_noscript( $pixel_id, $eventtype ) . " \n\n";
134
- $event_added[] = array( $current_url, $eventtype );
135
-
136
-
137
- /* whether standerd events is activated */
138
- if( isset($standardevent['activate']) && $standardevent['activate'] == 1 ){
139
-
140
-
141
-
142
-
143
- if( isset($standardevent['pageurl']) && !empty( $standardevent['pageurl'] ) ) {
144
-
145
- foreach ( $standardevent['pageurl'] as $key => $link) {
146
-
147
- //if url or event is empty don't go further
148
- if( empty($standardevent['pageurl'][$key]) || empty($standardevent['eventtype'][$key]) )
149
- continue;
150
-
151
- $pageurl = rtrim($standardevent['pageurl'][$key], '/');
152
- $cartvalue = $standardevent['value'][$key];
153
- $currency = $standardevent['currency'][$key];
154
- $eventtype = $standardevent['eventtype'][$key];
155
-
156
-
157
-
158
-
159
-
160
-
161
- //Add pixel event for added url
162
- if( !woofp_is_eventadded( $event_added, $eventtype ) && woofp_match_url($current_url, $pageurl, $eventtype) == 'true' ){
163
- $event_added[] = array($current_url, $eventtype );
164
-
165
-
166
- $pixelcode .= "//Standard Event\n" . woofp_get_event( $eventtype, $cartvalue, $currency, 'standardevent') . " \n\n";
167
- $nojs_pixelcode .= "<!-- Standard Event --> \n" . woofp_get_event_noscript( $pixel_id, $eventtype, 'standardevent') . " \n\n";
168
-
169
- }
170
-
171
- } /* foreach standardevent['pageurl'] */
172
-
173
- } /* not empty $standardevent['pageurl'] */
174
-
175
-
176
- } /* standerd event activated */
177
-
178
- /* Woocommerce settings */
179
- if( isset($woocommerce_settings['activate']) && $woocommerce_settings['activate'] == 1 && woofp_is_woocommerce() ){
180
-
181
- global $woocommerce;
182
-
183
- $cartvalue = $woocommerce->cart->get_cart_total();
184
- $currency = get_woocommerce_currency();
185
-
186
- $symbol = get_woocommerce_currency_symbol();
187
- $cartvalue = str_replace($symbol, '', $cartvalue);
188
-
189
-
190
- $cartvalue = strip_tags($cartvalue);
191
- $cartvalue = preg_replace("/[^0-9\.]/", "", $cartvalue);
192
-
193
- //Add pixel event for woocommerce pages
194
- foreach (woofp_woocommerce_events() as $key => $woocommerc_event) {
195
-
196
- $eventtype = $woocommerc_event['event'];
197
-
198
- if(
199
- woofp_is_woocommerce_page($woocommerc_event['page'])
200
- && !woofp_is_eventadded( $event_added, $woocommerc_event['event'] )
201
- && woofp_is_woocommerce_event($woocommerc_event['event'], $woocommerce_settings, false)
202
- )
203
- {
204
-
205
-
206
- $event_added[] = array( $current_url, $eventtype );
207
-
208
- $pixelcode .= "//WooCommerce Event\n" . woofp_get_event( $eventtype, $cartvalue, $currency, 'woocommerce') . " \n\n";
209
- $nojs_pixelcode .= "<!-- WooCommerce Event --> \n" . woofp_get_event_noscript( $pixel_id, $eventtype, 'woocommerce') . " \n\n";
210
-
211
- }
212
-
213
-
214
- } /* foreach woofp_woocommerce_events*/
215
-
216
- } /* Woocommerce Settings */
217
-
218
-
219
-
220
- //Search Page
221
- if( isset($_GET['s']) && $_GET['s'] !='' ){
222
-
223
- $eventtype = 'Search';
224
-
225
- if( !woofp_is_eventadded( $event_added, $eventtype ) ) {
226
- $pixelcode .= "//Default Event \n" . woofp_get_event( $eventtype, 'default') . " \n";
227
- $nojs_pixelcode .= "<!-- Default Event--> \n" . woofp_get_event_noscript( $pixel_id, $eventtype, 'default') . " \n\n";
228
- $event_added[] = array( $current_url, $eventtype );
229
- }
230
- }
231
-
232
- //registered page
233
- if( isset($_GET['checkemail']) && $_GET['checkemail'] =='registered' ){
234
-
235
- $eventtype = 'CompleteRegistration';
236
- if( !woofp_is_eventadded( $event_added, $eventtype ) ) {
237
- $pixelcode .= "//Default Event \n" . woofp_get_event( $eventtype, 'default') . " \n\n";
238
- $nojs_pixelcode .= "<!-- Default Event--> \n" . woofp_get_event_noscript( $pixel_id, $eventtype, 'default') . " \n\n";
239
- $event_added[] = array( $current_url, $eventtype );
240
- }
241
- }
242
-
243
-
244
- }/* facebook pixel activated */
245
-
246
- $pixelcode .= "\n";
247
- $nojs_pixelcode .= "\n";
248
-
249
- return array($pixelcode, $nojs_pixelcode);
250
- }
251
-
252
-
253
-
254
- /* Todo Prevent Duplicate Event*/
255
- function woofp_is_eventadded($addedevents, $event){
256
-
257
- return false;
258
-
259
- if(!empty($addedevents)){
260
-
261
- $result = false;
262
- $current_url = woofp_current_url();
263
-
264
-
265
- foreach ($addedevents as $key => $addedevent) {
266
-
267
- if( woofp_match_url($current_url, $addedevent[0]) == 'true' && $event == $addedevent[1] ){
268
-
269
- $result = true;
270
- }
271
- }
272
-
273
- } else {
274
-
275
- $result = false;
276
- }
277
-
278
- return $result;
279
- }
280
-
281
- function woofp_get_event($event='', $value=false, $currency='USD', $type=''){
282
-
283
- if( 'ProductAddToCart' == $event )
284
- $event = 'AddToCart';
285
-
286
- if( 'Purchase' == $event ){
287
-
288
- if( $type == 'standardevent' && $value != false && is_numeric( $value ) )
289
- return "fbq('track', '".$event."', {currency:'".$currency."', value:".$value."});";
290
- else
291
- return "fbq('track', '".$event."', {currency:'USD', value:0.00});";
292
-
293
- } else {
294
-
295
- if( $type == 'standardevent' && $value != false && is_numeric( $value ) )
296
- return "fbq('track', '".$event."', {currency:'".$currency."', value:".$value."});";
297
- else
298
- return "fbq('track', '".$event."');";
299
-
300
- }
301
- }
302
-
303
- function woofp_get_event_noscript($pixel_id, $event, $type=''){
304
-
305
- return "<noscript><img height='1' width='1' style='display:none'
306
- src='https://www.facebook.com/tr?id=".$pixel_id."&ev=".$event."&noscript=1'
307
- /></noscript>";
308
-
309
- }
310
-
311
- function woofp_event_types($current=''){
312
- ?>
313
-
314
- <option <?php echo selected( 'ViewContent', $current, true ); ?> value="ViewContent">ViewContent</option>
315
- <option <?php echo selected( 'Search', $current, true ); ?> value="Search">Search</option>
316
- <option <?php echo selected( 'AddToCart', $current, true ); ?> value="AddToCart">AddToCart</option>
317
- <option <?php echo selected( 'AddToWishlist', $current, true ); ?> value="AddToWishlist">AddToWishlist</option>
318
- <option <?php echo selected( 'InitiateCheckout', $current, true ); ?> value="InitiateCheckout">InitiateCheckout</option>
319
- <option <?php echo selected( 'AddPaymentInfo', $current, true ); ?> value="AddPaymentInfo">AddPaymentInfo</option>
320
- <option <?php echo selected( 'Purchase', $current, true ); ?> value="Purchase">Purchase</option>
321
- <option <?php echo selected( 'Lead', $current, true ); ?> value="Lead">Lead</option>
322
- <option <?php echo selected( 'CompleteRegistration', $current, true ); ?> value="CompleteRegistration">CompleteRegistration</option>
323
-
324
- <?php
325
- }
326
-
327
- function woofp_event_help(){
328
- ?>
329
- <ul class="woofp-event-help">
330
- <li><b>ViewContent:</b> Track key page views (ex: product page, landing page or article)</li>
331
- <li><b>Search:</b> Track searches on your website (ex. product searches)</li>
332
- <li><b>AddToCart:</b> Track when items are added to a shopping cart (ex. click/landing page on Add to Cart button)</li>
333
- <li><b>AddToWishlist:</b> Track when items are added to a wishlist (ex. click/landing page on Add to Wishlist button)</li>
334
- <li><b>InitiateCheckout:</b> Track when people enter the checkout flow (ex. click/landing page on checkout button)</li>
335
- <li><b>AddPaymentInfo:</b> Track when payment information is added in the checkout flow (ex. click/landing page on billing info)</li>
336
- <li><b>Purchase:</b> Track purchases or checkout flow completions (ex. landing on "Thank You" or confirmation page)</li>
337
- <li><b>Lead:</b> Track when a user expresses interest in your offering (ex. form submission, sign up for trial, landing on pricing page)</li>
338
- <li><b>CompleteRegistration:</b> Track when a registration form is completed (ex. complete subscription, sign up for a service)</li>
339
- </ul>
340
- <?php
341
- }
342
-
343
-
344
-
345
- function woofp_currency_options( $current='USD' ){
346
- ?>
347
- <option <?php echo selected( 'AUD', $current, true ); ?> value="AUD">Australian Dollar</option>
348
- <option <?php echo selected( 'BRL', $current, true ); ?> value="BRL">Brazilian Real </option>
349
- <option <?php echo selected( 'CAD', $current, true ); ?> value="CAD">Canadian Dollar</option>
350
- <option <?php echo selected( 'CZK', $current, true ); ?> value="CZK">Czech Koruna</option>
351
- <option <?php echo selected( 'DKK', $current, true ); ?> value="DKK">Danish Krone</option>
352
- <option <?php echo selected( 'EUR', $current, true ); ?> value="EUR">Euro</option>
353
- <option <?php echo selected( 'HKD', $current, true ); ?> value="HKD">Hong Kong Dollar</option>
354
- <option <?php echo selected( 'HUF', $current, true ); ?> value="HUF">Hungarian Forint </option>
355
- <option <?php echo selected( 'ILS', $current, true ); ?> value="ILS">Israeli New Sheqel</option>
356
- <option <?php echo selected( 'JPY', $current, true ); ?> value="JPY">Japanese Yen</option>
357
- <option <?php echo selected( 'MYR', $current, true ); ?> value="MYR">Malaysian Ringgit</option>
358
- <option <?php echo selected( 'MXN', $current, true ); ?> value="MXN">Mexican Peso</option>
359
- <option <?php echo selected( 'NOK', $current, true ); ?> value="NOK">Norwegian Krone</option>
360
- <option <?php echo selected( 'NZD', $current, true ); ?> value="NZD">New Zealand Dollar</option>
361
- <option <?php echo selected( 'PHP', $current, true ); ?> value="PHP">Philippine Peso</option>
362
- <option <?php echo selected( 'PLN', $current, true ); ?> value="PLN">Polish Zloty</option>
363
- <option <?php echo selected( 'GBP', $current, true ); ?> value="GBP">Pound Sterling</option>
364
- <option <?php echo selected( 'SGD', $current, true ); ?> value="SGD">Singapore Dollar</option>
365
- <option <?php echo selected( 'SEK', $current, true ); ?> value="SEK">Swedish Krona</option>
366
- <option <?php echo selected( 'CHF', $current, true ); ?> value="CHF">Swiss Franc</option>
367
- <option <?php echo selected( 'TWD', $current, true ); ?> value="TWD">Taiwan New Dollar</option>
368
- <option <?php echo selected( 'THB', $current, true ); ?> value="THB">Thai Baht</option>
369
- <option <?php echo selected( 'TRY', $current, true ); ?> value="TRY">Turkish Lira</option>
370
- <option <?php echo selected( 'USD', $current, true ); ?> value="USD">U.S. Dollar</option>
371
-
372
- <?php
373
- }
374
-
375
-
376
- function woofp_pixelcode(){
377
-
378
- //load facebook pixel on front only
379
- if( !is_admin() ){
380
-
381
- $facebookpixel = woofp_admin_settings('facebookpixel');
382
-
383
- if( isset($facebookpixel['activate']) && $facebookpixel['activate'] == 1 ) {
384
- ?>
385
-
386
-
387
- <!-- Facebook Pixel Code -->
388
- <script>
389
- var PYS_DOMReady = function(a,b,c){b=document,c='addEventListener';b[c]?b[c]('DOMContentLoaded',a):window.attachEvent('onload',a)}
390
- !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
391
- n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
392
- n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
393
- t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
394
- document,'script','//connect.facebook.net/en_US/fbevents.js');
395
-
396
- /* pixel plugin code */
397
- PYS_DOMReady(function(){
398
-
399
- <?php
400
- $facebookpixel_code = woofp_page_event();
401
- echo $facebookpixel_code[0];
402
- ?>
403
-
404
- });
405
- /* pixel plugin code */
406
-
407
- </script>
408
-
409
- <!-- End Facebook Pixel Code -->
410
-
411
- <?php
412
- }
413
-
414
- } else {
415
- ?>
416
- <img src="<?php echo admin_url('admin-ajax.php'); ?>" style="display:none;">
417
-
418
- <?php
419
- }
420
-
421
-
422
-
423
- }
424
-
425
-
426
- /*
427
- Woocommerce Related Functions
428
- Check if woocommerce is install and activated.
429
- */
430
-
431
- function woofp_addtocart_urls($woofp_options=''){
432
-
433
-
434
- $facebookpixel = $woofp_options['facebookpixel'];
435
- $standardevent = $woofp_options['standardevent'];
436
- $woocommerce_settings = $woofp_options['woocommerce'];
437
-
438
-
439
-
440
- /* whether facebook pixel is activated */
441
- if( woofp_get_option('facebookpixel', 'activate') == 1 ){
442
-
443
- /* whether standerd events is activated */
444
- if( woofp_get_option('standardevent', 'activate') == 1 ){
445
-
446
-
447
-
448
- $results = array();
449
- if( isset( $standardevent['pageurl'] ) && !empty($standardevent['pageurl']) ){
450
-
451
- foreach ( $standardevent['pageurl'] as $key => $link) {
452
-
453
- $pageurl = rtrim($standardevent['pageurl'][$key], '/');
454
- $cartvalue = $standardevent['value'][$key];
455
- $currency = $standardevent['currency'][$key];
456
- $eventtype = $standardevent['eventtype'][$key];
457
-
458
- if( !in_array($pageurl, $results) && $eventtype == 'AddToCart' )
459
- $results[] = $pageurl;
460
-
461
-
462
- }
463
-
464
- }
465
-
466
- if( woofp_get_option('woocommerce', 'activate') == 1 ){
467
-
468
- //Add pixel event for woocommerce pages
469
- foreach (woofp_woocommerce_events() as $key => $woocommerc_event) {
470
-
471
- $eventtype = $woocommerc_event['event'];
472
- if( !in_array( '***', $results) && woofp_is_woocommerce_event($eventtype, $woocommerce_settings, false) && $eventtype == 'AddToCart' )
473
- $results[] = '***';
474
- }
475
-
476
- }
477
-
478
- }
479
-
480
- }
481
-
482
-
483
- return $results;
484
-
485
- }
486
-
487
-
488
- function woofp_addtocart_pixel(){
489
-
490
-
491
- //
492
-
493
- ?>
494
-
495
- <!-- noscript facebook pixel -->
496
-
497
- <?php
498
- $facebookpixel_code = woofp_page_event();
499
- echo $facebookpixel_code[1];
500
- ?>
501
-
502
- <!-- end noscript facebook pixel -->
503
-
504
- <?php
505
- //Run AddToCart Event when product are added using ajax
506
- //todo: woocommerce_cart_redirect_after_add
507
-
508
- $woofp_options = get_option('woofp_admin_settings');
509
- $facebookpixel = $woofp_options['facebookpixel'];
510
- $standardevent = $woofp_options['standardevent'];
511
- $woocommerce_settings = $woofp_options['woocommerce'];
512
-
513
-
514
-
515
- ?>
516
- <!-- Dynamic AddToCart when Ajax enabled on Woocommerce -->
517
- <?php
518
-
519
- if ( get_option( 'woocommerce_enable_ajax_add_to_cart' ) == 'yes' && ( is_woocommerce() || is_page() || is_single() ) ) {
520
-
521
- $php_array = woofp_addtocart_urls($woofp_options);
522
- $js_array = json_encode($php_array);
523
- ?>
524
-
525
-
526
- <script type="text/javascript">
527
- var fbpmpaddtocart_eventcode = '';
528
-
529
- jQuery(function($){
530
-
531
- /*$.ajax({
532
- url: '<?php echo admin_url("admin-ajax.php"); ?>',
533
- type: 'POST',
534
- dataType: 'json',
535
- data: {action: 'fbpmpaddtocart', nonce:'<?php echo wp_create_nonce("fbpmp_nonce_ajaxaddtocart"); ?>'},
536
- })
537
- .done(function(result){
538
-
539
- if( 1 == result.status ){
540
- fbpmpaddtocart_eventcode = result.event_code;
541
- }
542
- console.log(result);
543
- console.log(fbpmpaddtocart_eventcode);
544
-
545
- });*/
546
-
547
- //Run AddToCart Event when product are added using ajax
548
- jQuery(document).on( 'click', '.add_to_cart_button', function(e) {
549
-
550
- e.preventDefault();
551
-
552
- var current_url = jQuery(this).attr('href') || '';
553
- var product_id = jQuery(this).attr('data-product_id') || 0;
554
-
555
- <?php echo "var url_array = ". $js_array . ";\n"; ?>
556
- <?php echo "var homeurl = '". home_url() . "';\n"; ?>
557
-
558
- if (current_url.indexOf('http://') < 0 || current_url.indexOf('https://') < 0){
559
- current_url = homeurl + current_url;
560
- }
561
-
562
-
563
-
564
- for (i = 0; i < url_array.length; i++) {
565
-
566
- if( url_array[i] == '***' ){
567
-
568
-
569
- fbq('track', 'AddToCart');
570
-
571
- } else if( current_url.search(url_array[i]) !== -1 ){
572
-
573
-
574
- fbq('track', 'AddToCart');
575
-
576
- }
577
-
578
- }
579
-
580
-
581
- });
582
-
583
- });
584
- </script>
585
- <?php }
586
- }
587
-
588
-
589
-
590
- function woofp_is_woocommerce_page ($page) {
591
-
592
- switch ($page) {
593
-
594
- case 'woocommerce_view_content':
595
-
596
- return is_product();
597
-
598
- case 'woocommerce_added_to_cart':
599
-
600
- if ( isset($_REQUEST['add-to-cart']) && is_numeric($_REQUEST['add-to-cart']) )
601
- return true;
602
- else
603
- return false;
604
-
605
-
606
- break;
607
-
608
-
609
- case 'woocommerce_cart_page_id':
610
-
611
- return is_cart();
612
-
613
- break;
614
-
615
- case 'woocommerce_checkout_page_id':
616
-
617
- if( is_checkout() && !is_wc_endpoint_url() )
618
- return true;
619
- else
620
- return false;
621
-
622
- break;
623
-
624
- case 'woocommerce_thanks_page_id':
625
-
626
- if( is_wc_endpoint_url( 'order-received' ) )
627
- return true;
628
- else
629
- return false;
630
-
631
-
632
- break;
633
-
634
- case 'woocommerce_search_product':
635
-
636
- if ( isset($_GET['s']) && ( isset($_GET['post_type']) && $_GET['post_type'] == 'product' ) ) {
637
-
638
- return true ;
639
-
640
- } else {
641
-
642
- return false;
643
- }
644
-
645
- break;
646
-
647
- default:
648
- return false;
649
- break;
650
- }
651
-
652
- }
653
-
654
-
655
- /**
656
- * Return appropriate pixel events for woocommerce pages
657
- *
658
- * @return array
659
- * @author PixelYourSite
660
- **/
661
- function woofp_woocommerce_events(){
662
-
663
- $woocommerce_events = array(
664
-
665
- array(
666
- 'event' => 'ViewContent',
667
- 'page' => 'woocommerce_view_content',
668
- 'title' => 'Any WooCommerce Page',
669
- 'label' => 'ViewContent Event'
670
- ),
671
-
672
- array(
673
- 'event' => 'ProductAddToCart',
674
- 'page' => 'woocommerce_added_to_cart',
675
- 'title' => 'Product Added to Cart',
676
- 'label' => 'AddToCart Event'
677
- ),
678
-
679
- array(
680
- 'event' => 'AddToCart',
681
- 'page' => 'woocommerce_cart_page_id',
682
- 'title' => 'AddToCart Page',
683
- 'label' => 'AddToCart Event'
684
- ),
685
- array(
686
- 'event' => 'InitiateCheckout',
687
- 'page' => 'woocommerce_checkout_page_id',
688
- 'title' => 'CheckOut Page',
689
- 'label' => 'InitiateCheckout Event'
690
- ),
691
- /*array(
692
- 'event' => 'AddPaymentInfo',
693
- 'page' => 'woocommerce_checkout_page_id',
694
- 'title' => 'Checkout Page',
695
- 'label' => 'AddPaymentInfo Event'
696
- ),*/
697
- array(
698
- 'event' => 'Purchase',
699
- 'page' => 'woocommerce_thanks_page_id',
700
- 'title' => 'Thankyou Page',
701
- 'label' => 'Purchase Event'
702
- ),
703
- /*array(
704
- 'event' => 'Search',
705
- 'page' => 'woocommerce_search_product',
706
- 'title' => 'Product Search',
707
- 'label' => ' Search Event'
708
- ),*/
709
-
710
- );
711
-
712
- return $woocommerce_events;
713
- }
714
-
715
- /**
716
- * Check if woocommerce event is activated in settings
717
- * @return string | true/false
718
- * @author PixelYourSite
719
- **/
720
- function woofp_is_woocommerce_event($event, $settings, $echo=true){
721
-
722
-
723
- if( isset( $settings['events'] ) && !empty($settings['events']) && isset($settings['events'][$event]) && $settings['events'][$event] == 1 ){
724
- $checked = 'checked="checked"';
725
- $return = true;
726
- } else {
727
-
728
- $checked = '';
729
- $return = false;
730
- }
731
-
732
- if($echo){
733
- echo $checked;
734
- } else {
735
-
736
- return $return;
737
- }
738
- }
739
-
740
- function woofp_startsWith($haystack, $needle) {
741
- // search backwards starting from haystack length characters from the end
742
- return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;
743
- }
744
-
745
- function woofp_endsWith($haystack, $needle) {
746
- // search forward starting from end minus needle length characters
747
- return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== FALSE);
748
- }
749
-
750
-
751
- function woofp_valid_url($value){
752
- $pattern = "@^(?:https?://)?(?:[a-z0-9-]+\.)*((?:[a-z0-9-]+\.)[a-z]+)@";
753
-
754
- if (!preg_match($pattern, $value)){
755
- return false;
756
- }
757
-
758
- return true;
759
- }
760
-
761
- /**
762
- * add http:// to url if missing
763
- *
764
- * @return string
765
- * @author PixelYourSite
766
- **/
767
- function woofp_addhttp($url=''){
768
-
769
- if (preg_match("#https?://#", $url) === 0) {
770
- $url = 'http://'.$url;
771
- }
772
-
773
- return $url;
774
- }
775
-
776
-
777
- /**
778
- * Remove http(s)/www. from url
779
- *
780
- * @return string
781
- * @author PixelYourSite
782
- **/
783
- function woofp_remove_protocol($url=''){
784
-
785
- if(empty($url) && !woofp_valid_url($url))
786
- return $url;
787
-
788
- $url = str_replace(array('http://', 'https://', 'http://www.', 'https://www.'), '', $url);
789
-
790
- $url = trim($url);
791
- $url = trim($url, '//');
792
- $url = rtrim($url, '/');
793
-
794
- return $url;
795
- }
796
-
797
-
798
- function woofp_match_url($current_url, $match_url, $eventtype='' ){
799
-
800
- $current_url = woofp_remove_protocol($current_url);
801
- $match_url = woofp_remove_protocol($match_url);
802
-
803
- if(strpos($match_url, '*') !== false && woofp_endsWith($match_url, '*') ){
804
-
805
- $temp_url = $match_url;
806
- $temp_url = rtrim($temp_url, '*');
807
-
808
- $temp_url = trim($temp_url);
809
- $temp_url = trim($temp_url, '//');
810
- $temp_url = rtrim($temp_url, '/');
811
-
812
-
813
-
814
- if ( woofp_valid_url($temp_url) === true) {
815
-
816
- $current_postid = url_to_postid( woofp_addhttp($current_url) );
817
- $match_postid = url_to_postid( woofp_addhttp($temp_url) );
818
- $current_length = strlen($current_url);
819
- $match_length = strlen($temp_url);
820
-
821
- $postmatch = false;
822
-
823
- if( $current_postid && $match_postid && $current_postid == $match_postid ){
824
- $postmatch = true;
825
- }
826
-
827
-
828
- $strcmp1 = strcmp($temp_url, $current_url);
829
- $strcmp2 = strcmp($current_url, $temp_url);
830
-
831
- $found1 = ( (strpos($temp_url, $current_url) !== false ) ? 'true' : 'false' );
832
- $found2 = ( (strpos($current_url, $temp_url) !== false ) ? 'true' : 'false' );
833
-
834
- if( $match_length > $current_length && $found1 == 'true' ){
835
-
836
- $ret = ( ( $strcmp1 < 0 || $postmatch ) ? 'true' : 'false' );
837
-
838
- } else if( $match_length < $current_length && $found2 == 'true' ){
839
-
840
- $ret = ( ( $strcmp2 > 0 || $postmatch ) ? 'true' : 'false' );
841
-
842
- } else {
843
-
844
- $ret = ( ( $strcmp1 == 0 || $postmatch ) ? 'true' : 'false' );
845
-
846
- }
847
-
848
-
849
- return $ret;
850
-
851
- } else {
852
-
853
-
854
- return 'false';
855
- }
856
-
857
- } else {
858
-
859
-
860
- if ( woofp_valid_url($match_url) === true ) {
861
-
862
- $current_postid = url_to_postid( woofp_addhttp($current_url) );
863
- $match_postid = url_to_postid( woofp_addhttp($match_url) );
864
-
865
- $postmatch = false;
866
- if( $current_postid && $match_postid && $current_postid == $match_postid ){
867
- $postmatch = true;
868
- }
869
-
870
- $strcmp = strcmp( $current_url, $match_url );
871
- $ret = ( ( $strcmp == 0 || $postmatch ) ? 'true' : 'false' );
872
-
873
-
874
- return $ret;
875
-
876
- } else {
877
-
878
- $strpos = strpos($current_url, $match_url);
879
- $ret = ( $strpos !== false ? 'true' : 'false' );
880
-
881
-
882
- return $ret;
883
-
884
- }
885
-
886
- }
887
- }
888
-
889
- function woofp_is_woocommerce(){
890
-
891
- if ( !class_exists( 'WooCommerce' ) ) {
892
-
893
- return false;
894
-
895
- } else {
896
-
897
-
898
- return true;
899
- }
900
-
901
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/helper-functions.php CHANGED
@@ -545,6 +545,7 @@ function woofp_currency_options( $current='USD' ){
545
  <option <?php echo selected( 'HUF', $current, true ); ?> value="HUF">Hungarian Forint </option>
546
  <option <?php echo selected( 'ILS', $current, true ); ?> value="ILS">Israeli New Sheqel</option>
547
  <option <?php echo selected( 'JPY', $current, true ); ?> value="JPY">Japanese Yen</option>
 
548
  <option <?php echo selected( 'KRW', $current, true ); ?> value="KRW">Korean Won</option>
549
  <option <?php echo selected( 'MYR', $current, true ); ?> value="MYR">Malaysian Ringgit</option>
550
  <option <?php echo selected( 'MXN', $current, true ); ?> value="MXN">Mexican Peso</option>
545
  <option <?php echo selected( 'HUF', $current, true ); ?> value="HUF">Hungarian Forint </option>
546
  <option <?php echo selected( 'ILS', $current, true ); ?> value="ILS">Israeli New Sheqel</option>
547
  <option <?php echo selected( 'JPY', $current, true ); ?> value="JPY">Japanese Yen</option>
548
+ <option <?php echo selected( 'IDR', $current, true ); ?> value="USD">Indonesian Rupiah</option>
549
  <option <?php echo selected( 'KRW', $current, true ); ?> value="KRW">Korean Won</option>
550
  <option <?php echo selected( 'MYR', $current, true ); ?> value="MYR">Malaysian Ringgit</option>
551
  <option <?php echo selected( 'MXN', $current, true ); ?> value="MXN">Mexican Peso</option>
readme.txt CHANGED
@@ -2,18 +2,22 @@
2
  Contributors: PixelYourSite, c0d3fev3r
3
  Tags: Facebook Pixel, New Facebook Pixel, Facebook Conversion Pixel, Facebook Pixel Events, Facebook, New Facebook Pixel Events, Dynamic Events, Standard Events, Facebook Events, Facebook Standard Events, Facebook Dynamic Product Ads, WooCommerce, WooCommerce Facebook Pixel, Facebook Custom Events, Facebook Conversion Value, WooCommerce Affiliate Products, Facebook Pixel PayPal
4
  Requires at least: 3.0.1
5
- Tested up to: 4.5.1
6
- Stable tag: 2.2.4
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
10
  Insert the new Facebook Pixel on WordPress, add Standard Events, enjoy superb WooCommerce Facebook Pixel integration
11
 
12
  == Description ==
 
 
 
13
  As you probably know, Facebook will retire the old Facebook Conversion Pixel in 2016. They recommend to use the new Facebook Pixel for conversion tracking, optimization and remarketing. **This plugin will help you insert the pixel code on every page with just one click and setup custom or standard events on any page or post.** There is an **out of the box WooCommerce setup** that will configure all the necessary standard events for you.
14
 
15
  **Visit this page for [more details about how to use the pixel plugin: Click here](http://www.pixelyoursite.com/facebook-pixel-plugin-help)**
16
 
 
17
  * You can **insert the pixel on every page of your website with just a few clicks**. No need to edit any post or pages
18
 
19
  * You can **set up and track Standard or Custom Events** and add parameters for each of them
@@ -152,6 +156,11 @@ We have an article about how to optimize Facebook Ads Reports:
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
155
  PixelYourSite 2.2.4
156
 
157
  - Fixig a few back-end errors and conflicts
2
  Contributors: PixelYourSite, c0d3fev3r
3
  Tags: Facebook Pixel, New Facebook Pixel, Facebook Conversion Pixel, Facebook Pixel Events, Facebook, New Facebook Pixel Events, Dynamic Events, Standard Events, Facebook Events, Facebook Standard Events, Facebook Dynamic Product Ads, WooCommerce, WooCommerce Facebook Pixel, Facebook Custom Events, Facebook Conversion Value, WooCommerce Affiliate Products, Facebook Pixel PayPal
4
  Requires at least: 3.0.1
5
+ Tested up to: 4.5.2
6
+ Stable tag: 2.2.5
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
10
  Insert the new Facebook Pixel on WordPress, add Standard Events, enjoy superb WooCommerce Facebook Pixel integration
11
 
12
  == Description ==
13
+ **Note:** Version 3.0 is in the final testing stage and will be realeased in a few days with new and powerful features.
14
+
15
+
16
  As you probably know, Facebook will retire the old Facebook Conversion Pixel in 2016. They recommend to use the new Facebook Pixel for conversion tracking, optimization and remarketing. **This plugin will help you insert the pixel code on every page with just one click and setup custom or standard events on any page or post.** There is an **out of the box WooCommerce setup** that will configure all the necessary standard events for you.
17
 
18
  **Visit this page for [more details about how to use the pixel plugin: Click here](http://www.pixelyoursite.com/facebook-pixel-plugin-help)**
19
 
20
+
21
  * You can **insert the pixel on every page of your website with just a few clicks**. No need to edit any post or pages
22
 
23
  * You can **set up and track Standard or Custom Events** and add parameters for each of them
156
 
157
  == Changelog ==
158
 
159
+ PixelYourSite 2.2.5
160
+
161
+ - Adding IDR (Indonezian Ruphiah) in the currency list
162
+
163
+
164
  PixelYourSite 2.2.4
165
 
166
  - Fixig a few back-end errors and conflicts