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

Version Description

Download this release

Release Info

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

Code changes from version 2.1 to 2.2

Files changed (4) hide show
  1. facebook-pixel-master.php +2 -2
  2. inc/admin.php +149 -9
  3. inc/admin_notices.php +162 -20
  4. readme.txt +28 -12
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.1
9
  License: GPLv3
10
  */
11
 
@@ -18,7 +18,7 @@ if ( ! defined( 'WPINC' ) ) {
18
  * Constants
19
  */
20
  //Plugin Version
21
- define( 'FBPMP_VERSION', '2.1');
22
 
23
 
24
 
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
9
  License: GPLv3
10
  */
11
 
18
  * Constants
19
  */
20
  //Plugin Version
21
+ define( 'FBPMP_VERSION', '2.2');
22
 
23
 
24
 
inc/admin.php CHANGED
@@ -5,9 +5,10 @@
5
  <div class="facebook-pixel-body">
6
  <ul class="facebook-pixel-menu nav-tab-wrapper">
7
  <li id="facebook-pixel-menu-1" class="nav-tab nav-tab-active selected">Facebook Pixel</li>
8
- <li id="facebook-pixel-menu-2" class="nav-tab">Standard Events Setup</li>
9
- <li id="facebook-pixel-menu-3" class="nav-tab">Woocommerce Setup</li>
10
- <li id="facebook-pixel-menu-4" class="nav-tab">PayPal Setup</li>
 
11
  </ul>
12
 
13
 
@@ -48,6 +49,25 @@
48
  <th scope="row">&nbsp;</th>
49
  <td><input type="button" class="button button-primary woofp-savesettings" value="Save Settings" /></td>
50
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  </tbody>
53
  </table>
@@ -77,7 +97,7 @@
77
 
78
  <tr class=" <?php echo $hide_standardevent; ?>">
79
  <th scope="row">&nbsp;</th>
80
- <td><h3 style="float:left;" class="woofpimportant">Customize your code with standard events <span class="woofp-events-help"><b class="woofp-help-icon">?</b><?php woofp_event_help(); ?></span></h3></td>
81
  </tr>
82
 
83
  <?php
@@ -238,8 +258,128 @@
238
  </table>
239
  </div><!-- panel 2 -->
240
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
 
242
- <div id="facebook-pixel-panel-3" class="facebook-pixel-panel">
 
 
 
 
 
 
 
 
 
 
 
243
  <?php if( woofp_is_woocommerce() ){ ?>
244
  <table class="form-table">
245
  <tbody>
@@ -255,7 +395,7 @@
255
 
256
  <tr>
257
  <th scope="row">&nbsp;</th>
258
- <td><p><b class="woofpimportant">Don't miss this:</b> <a href="http://www.pixelyoursite.com/facebook-pixel-plugin-woocommerce" target="_blank">Read this before activating WooCommerce Setup.</a></p></td>
259
  </tr>
260
 
261
  <tr>
@@ -409,10 +549,10 @@
409
  <p>Please install and activate <b>WooCommerce</b> to enable WooCommerce integration</p>
410
  </div>
411
  <?php } ?>
412
- </div><!-- panel 3 -->
413
 
414
 
415
- <div id="facebook-pixel-panel-4" class="facebook-pixel-panel">
416
  <?php if( woofp_is_woocommerce() ){ ?>
417
  <table class="form-table">
418
  <tbody>
@@ -473,7 +613,7 @@
473
  <p>Please install and activate <b>WooCommerce</b> to enable WooCommerce integration</p>
474
  </div>
475
  <?php } ?>
476
- </div>
477
 
478
  </form>
479
  </div>
5
  <div class="facebook-pixel-body">
6
  <ul class="facebook-pixel-menu nav-tab-wrapper">
7
  <li id="facebook-pixel-menu-1" class="nav-tab nav-tab-active selected">Facebook Pixel</li>
8
+ <li id="facebook-pixel-menu-2" class="nav-tab">On Post/Page Events</li>
9
+ <li id="facebook-pixel-menu-3" class="nav-tab">Dynamic Events</li>
10
+ <li id="facebook-pixel-menu-4" class="nav-tab">WooCommerce Setup</li>
11
+ <li id="facebook-pixel-menu-5" class="nav-tab">PayPal Setup</li>
12
  </ul>
13
 
14
 
49
  <th scope="row">&nbsp;</th>
50
  <td><input type="button" class="button button-primary woofp-savesettings" value="Save Settings" /></td>
51
  </tr>
52
+
53
+ <tr>
54
+ <th scope="row">&nbsp;</th>
55
+ <td style="color:#333;">
56
+ <h2 style="font-weight: 400;color:#333;">Important Readings</h2>
57
+
58
+ <p style="font-weight: 400; font-size:12px; color:#333;">
59
+ PixelYourSite is not just a simple plugin, we try to connect with our users and offer them the best possible information.
60
+ <br><b>Here are some of the most appreciated articles from our Learning Section:</b></p>
61
+ <br>
62
+ <a href="http://www.pixelyoursite.com/custom-audiences-from-events" target="_blank">How to Create Custom Audiences based on Events on your website</a>
63
+ <br><br>
64
+ <a href="http://www.pixelyoursite.com/facebook-ads-reports-optimisation" target="_blank">How to optimize Facebook Ads Reports to better understand conversion</a>
65
+ <br><br>
66
+ <a href="http://www.pixelyoursite.com/how-to-use-google-analytics-ecommerce-reports-on-woocommerce-free-plugin-inlculded" target="_blank">How to use Google Adsense Ecommerce Reports for WooCommerce</a>
67
+
68
+
69
+ </td>
70
+ </tr>
71
 
72
  </tbody>
73
  </table>
97
 
98
  <tr class=" <?php echo $hide_standardevent; ?>">
99
  <th scope="row">&nbsp;</th>
100
+ <td><h3 style="float:left;" class="woofpimportant">Add Standard or Custom Events on Page/Post <span class="woofp-events-help"><b class="woofp-help-icon">?</b><?php woofp_event_help(); ?></span></h3></td>
101
  </tr>
102
 
103
  <?php
258
  </table>
259
  </div><!-- panel 2 -->
260
 
261
+
262
+ <div id="facebook-pixel-panel-3" class="facebook-pixel-panel ">
263
+ <table class="form-table">
264
+ <tbody>
265
+
266
+ <tr>
267
+ <td colspan="2"><?php echo woofp_admin_notices(true); ?></td>
268
+ </tr>
269
+
270
+ <tr>
271
+ <th scope="row">&nbsp;</th>
272
+ <td style="color:#333;">
273
+ <h2 style="font-weight: 400;color:#333;">Start using Dynamic Events with the PRO version of the plugin</h2>
274
+
275
+ <p style="font-weight: 400; font-size:12px; color:#333;">
276
+ With Dynamic Events you can optimize your ads for actions on your website, like filing up forms (Contact Form 7 supported), newsletter sign ups, <br>or any other click on links and buttons. Better ad optimization, better custom audience targeting, better conversion tracking. <br><b>If you are not using Facebook Dynamic Events you are literally leaving money on the table</b>
277
+ </p>
278
+ <br>
279
+ <b>Super Offer Ending Soon: </b><a href="http://www.pixelyoursite.com/super-offer?utm_source=woordpress-tab-fb-dynamic-events&utm_medium=tab-fb-dynamic-events&utm_campaign=tab-fb-dynamic-events" target="_blank">Update now and start to benefit from Dynamic Events</a>
280
+ <br><br>
281
+ Or Learn more about <a href="http://www.pixelyoursite.com/facebook-pixel-dynamic-events" target="_blank">How to use Dynamic Events - Complete guide</a>
282
+
283
+
284
+ </td>
285
+ </tr>
286
+
287
+ <tr>
288
+ <th scope="row">Process links</th>
289
+ <td>
290
+ <p><input type="checkbox" value="1" id="custom_event-content" name="custom_event[enable_post_contents]"
291
+ disabled="disabled" />
292
+ Process links in Post Content <code>( the_content(); hook )</code>
293
+ </p>
294
+
295
+
296
+ <p><input type="checkbox" value="1" id="custom_event-widget" name="custom_event[enable_widget_text]"
297
+ disabled="disabled" />
298
+ Process links in Widgets Text <code>( widget_text(); hook )</code>
299
+ </p>
300
+
301
+ </td>
302
+
303
+ </tr>
304
+
305
+
306
+ <tr class="woofp-hreflink-tr ">
307
+ <th scope="row" style="padding-top: 60px;">Full or Partial URL</th>
308
+ <td>
309
+
310
+
311
+ <p>
312
+ <b class="event_param">Trigger Event On:</b>
313
+ <select name="custom_event[trigger_type]">
314
+ <option value="url">URL</option>
315
+ <option value="css_selector">CSS Selector</option>
316
+ </select>
317
+ </p>
318
+
319
+ <p class="woofp-custom-event-inputvalue">
320
+ <input type="text" name="custom_event[hreflink][]" value="" class="woofp-input-hreflink" disabled="disabled" />
321
+ <input type="text" name="custom_event[selector][]" value="" class="woofp-customevent-selector woofp-input-hreflink" style="display:none;"/>
322
+ </p>
323
+ <p class="description woofp-custom-event-valuedesc">
324
+ <span class="woofp-custom-event-urldesc">
325
+ This Event will trigger on any URL that contains the partial string.<br>
326
+ If you add <b class="woofp-wildcard">*</b> at the end of the Full URL it will match all URLs starting with the URL.
327
+ </span>
328
+ <span class="woofp-custom-event-selectordesc" style="display:none;">
329
+ This Event will trigger on the entered CSS Selector.<br>
330
+ Please read about CSS Selector <a href="#">here</a>.
331
+ </span>
332
+ </p>
333
+
334
+
335
+ <p>
336
+ <b class="event_param">Event Type: </b>
337
+ <select name="custom_event[eventtype][]" class="woofp-input-customevent" disabled="disabled">
338
+ <option value="">- Select Event -</option>
339
+
340
+ </select>
341
+ </p>
342
+
343
+ <p class="standarevent-value">
344
+ <b class="event_param">Value: </b><input type="text" name="custom_event[value][]" value="" disabled="disabled" class=" woofp-input-value" />
345
+ </p>
346
+
347
+ <p class="standarevent-currency">
348
+ <b class="event_param">Currency: </b><select name="custom_event[currency][]" class=" woofp-input-currency" disabled="disabled">
349
+ <option value="">Select Currency</option>
350
+ </select>
351
+
352
+ <span class="woofp-input-desc">*Mandatory for purchase event only.</span>
353
+ </p>
354
+ <div class="custom_event-params"></div>
355
+ <h4>OR add event code here (Advance users only):</h4>
356
+ <textarea style="width:35em;height:180px;" name="custom_event[code][]" disabled="disabled"></textarea>
357
+
358
+ </td>
359
+ </tr>
360
+
361
+
362
+
363
+ <tr>
364
+ <th scope="row">&nbsp;</th>
365
+ <td>
366
+ <input type="checkbox" value="1" id="custom_event-activate" name="custom_event[activate]" disabled="disabled" />Activate Custom Event Setup.
367
+ <p class="description">Check this to enable Custom Event Setup.</p>
368
+ </td>
369
+ </tr>
370
 
371
+ <tr>
372
+ <th scope="row">&nbsp;</th>
373
+ <td><input type="button" class="button button-primary woofp-savesettings woopf-custom-event-setup" value="Save Custom Event Setup Settings" disabled="disabled" /></td>
374
+ </tr>
375
+
376
+ </tbody>
377
+ </table>
378
+ </div><!-- panel 3 -->
379
+
380
+
381
+
382
+ <div id="facebook-pixel-panel-4" class="facebook-pixel-panel">
383
  <?php if( woofp_is_woocommerce() ){ ?>
384
  <table class="form-table">
385
  <tbody>
395
 
396
  <tr>
397
  <th scope="row">&nbsp;</th>
398
+ <td><p><b class="woofpimportant">WooCommerce Help:</b> <a href="http://www.pixelyoursite.com/facebook-pixel-plugin-woocommerce" target="_blank">Read this before activating WooCommerce Setup.</a></p></td>
399
  </tr>
400
 
401
  <tr>
549
  <p>Please install and activate <b>WooCommerce</b> to enable WooCommerce integration</p>
550
  </div>
551
  <?php } ?>
552
+ </div><!-- panel 4 -->
553
 
554
 
555
+ <div id="facebook-pixel-panel-5" class="facebook-pixel-panel">
556
  <?php if( woofp_is_woocommerce() ){ ?>
557
  <table class="form-table">
558
  <tbody>
613
  <p>Please install and activate <b>WooCommerce</b> to enable WooCommerce integration</p>
614
  </div>
615
  <?php } ?>
616
+ </div><!-- panel 5 -->
617
 
618
  </form>
619
  </div>
inc/admin_notices.php CHANGED
@@ -13,6 +13,7 @@ if( empty($activation_time) || version_compare($version, FBPMP_VERSION, '<') ){
13
  update_option( 'pysf_activation_date', $activation_time);
14
  update_option( 'pysf_plugin_version', FBPMP_VERSION);
15
  update_option( 'pysf_notice_dismiss', '');
 
16
  }
17
 
18
 
@@ -32,22 +33,24 @@ $link_2 = 'http://www.pixelyoursite.com/super-offer?utm_source=wadmin&utm_medium
32
 
33
 
34
  //Message for day 1
35
- $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: ';
36
- $day_1_text .= '<a href="'.$link_1.'" target="_blank">Download PixelYourSite PRO for a big discount</a>';
 
 
37
 
38
  //Message for day 2
39
- $day_2_text = '<span class="pysf_note"><b>Limited Offer, ending in 1 day:</b></span> With PixelYourSite PRO you can track Conversion Value and enable Facebook Dynamic Ads for WooCommerce. ';
40
  $day_2_text .= '<a href="'.$link_1.'" target="_blank">Download now for a big discount</a>';
41
 
42
  //Message for day 3
43
- $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. ';
44
  $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>';
45
 
46
  //Message for day 4 to 7;
47
  $day_4_to_7_text = '';
48
 
49
  //Message for day 7 to 12
50
- $day_7_to_12_text = '<span class="pysf_note"><b>Special Offer:</b></span> Update to PixelYourSite PRO to enable Facebook Dynamic Ads for WooCommerce, track conversion value or track WooCommerce Affiliate Products events: <a href="'.$link_2.'">Click here for your discount</a>';
51
 
52
 
53
  $options = array(
@@ -109,13 +112,119 @@ $options = array(
109
 
110
 
111
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
  //we will store the message of each day
114
  $notice_message = '';
115
 
116
 
117
- //Get dismissed notices
118
- $dismiss_option = get_option( 'pysf_notice_dismiss', '');
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
  //loop through notice settings
121
  foreach ($options as $key => $option) {
@@ -157,30 +266,57 @@ $options = array(
157
 
158
  $notice = '<style type="text/css">
159
  .pysf_note{ color: #dd4e4e; }
160
- #pysf_notice{ padding-top:0; padding-bottom:0; border-left-width:10px;}
 
 
 
 
 
 
 
161
  </style>';
162
 
163
  $html_class = '';
164
  $html_id = 'pysf_notice_tab';
165
- $button_html = '<button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button>';
166
  if( !$return){
167
  $html_class = 'update-nag notice is-dismissible';
168
  $html_id = 'pysf_notice';
169
  $button_html = '';
170
  }
171
 
172
- $notice .= '<div id="'.$html_id.'" class="'.$html_class.' pysf_notice pysf_notice_day_'.$dismiss_option.'">';
173
  $notice .= '<p>'.$notice_message.'</p>';
174
  $notice .= $button_html;
175
  $notice .= '</div>';
176
 
177
- $notice .= "<script type='text/javascript'>
 
 
 
 
 
 
 
 
 
 
 
 
178
  jQuery(function($){
179
 
180
- jQuery(document).on( 'click', '.pysf_notice .notice-dismiss', function() {
181
 
182
- jQuery(this).closest('.notice-dismiss').fadeOut('slow');
 
 
 
 
183
 
 
 
 
 
184
  jQuery.ajax({
185
  url: ajaxurl,
186
  data: {
@@ -189,16 +325,14 @@ $options = array(
189
  }
190
  });
191
 
 
 
192
  });
193
 
194
  });
195
  </script>";
196
- if( !$return)
197
- echo $notice;
198
- else
199
- return $notice;
200
- }
201
 
 
202
  }
203
 
204
  function woofp_admin_notices_action(){
@@ -222,11 +356,18 @@ add_action('wp_enqueue_scripts', 'woofp_admin_notices_script');
222
 
223
  function ajax_pysf_notice_dismiss(){
224
 
 
 
 
 
 
 
225
  if( isset($_REQUEST['option'])){
226
- $dismiss_option = get_option( 'pysf_notice_dismiss', '');
227
  $dismiss_option[$_REQUEST['option']] = 1;
228
- update_option( 'pysf_notice_dismiss', $dismiss_option);
229
  }
 
230
  die();
231
  }
232
  add_action('wp_ajax_pysf_notice_dismiss', 'ajax_pysf_notice_dismiss');
@@ -241,6 +382,7 @@ function pysf_plugin_activated(){
241
  update_option( 'pysf_activation_date', time());
242
  update_option( 'pysf_plugin_version', FBPMP_VERSION);
243
  update_option( 'pysf_notice_dismiss', '');
 
244
  }
245
  }
246
  register_activation_hook(__FILE__, 'pysf_plugin_activated');
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
 
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 living 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(
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) {
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
+
294
+ if( !$return)
295
+ echo $notice;
296
+ else
297
+ return $notice;
298
+ }
299
+
300
+ }
301
+
302
+ add_action('admin_footer', 'woofp_admin_noices_script');
303
+ function woofp_admin_noices_script() {
304
+
305
+ $script = "<script type='text/javascript'>
306
  jQuery(function($){
307
 
308
+ jQuery(document).on( 'click', '.pysf_notice .notice-dismiss', function(e){
309
 
310
+ e.preventDefault();
311
+ e.stopPropagation();
312
+ var class_name = jQuery(this).closest('.pysf_notice').attr('data-pysf');
313
+
314
+ jQuery('.'+class_name).each(function(){
315
 
316
+ jQuery(this).closest('tr').remove();
317
+
318
+ });
319
+
320
  jQuery.ajax({
321
  url: ajaxurl,
322
  data: {
325
  }
326
  });
327
 
328
+ return false;
329
+
330
  });
331
 
332
  });
333
  </script>";
 
 
 
 
 
334
 
335
+ echo $script;
336
  }
337
 
338
  function woofp_admin_notices_action(){
356
 
357
  function ajax_pysf_notice_dismiss(){
358
 
359
+ if ( class_exists( 'WooCommerce' ) ) {
360
+ $name = 'woo_pysf_notice_dismiss';
361
+ } else {
362
+ $name = 'pysf_notice_dismiss';
363
+ }
364
+
365
  if( isset($_REQUEST['option'])){
366
+ $dismiss_option = get_option( $name, '');
367
  $dismiss_option[$_REQUEST['option']] = 1;
368
+ update_option( $name, $dismiss_option);
369
  }
370
+
371
  die();
372
  }
373
  add_action('wp_ajax_pysf_notice_dismiss', 'ajax_pysf_notice_dismiss');
382
  update_option( 'pysf_activation_date', time());
383
  update_option( 'pysf_plugin_version', FBPMP_VERSION);
384
  update_option( 'pysf_notice_dismiss', '');
385
+ update_option( 'woo_pysf_notice_dismiss', '');
386
  }
387
  }
388
  register_activation_hook(__FILE__, 'pysf_plugin_activated');
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: PixelYourSite, c0d3fev3r
3
  Tags: Facebook Pixel, Facebook, Facebook Conversion Pixel, Facebook Pixel Events, Tracking, Standard events, Facebook Events, Facebook Standard Events, New Facebook Pixel, Facebook Dynamic Ads, WooCommerce, Facebook Custom Events, Custom Events, Conversion pixel, track conversion, Facebook pixel WooCommerce, Facebook Ads, Facebook Campaign, Facebook Ads Campaign, Facebook Conversion Value, Conversion Value, WooCommerce Affiliate Products, Track Affiliate Products, Affiliate links, New Facebook Pixel WooCommerce, PayPal, Facebook Pixel PayPal, New Facebook Pixel Events, facebook standard events woocommerce, facebook tracking pixel woocommerce, facebook conversion pixel for woocommerce, new pixel, pixel plugin, tracking pixel
4
  Requires at least: 3.0.1
5
  Tested up to: 4.4.1
6
- Stable tag: 2.1
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -12,7 +12,6 @@ Insert Facebook Pixel, add Custom or Standard Events, activate WooCommerce event
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
- **There is a Special Offer for the PRO version that will exiper soon. You'll get more details and a secret link inside the plugin admin area.**
16
 
17
  <p style="text-align: center;">Visit this page for <strong><a href="http://www.pixelyoursite.com/facebook-pixel-plugin-help" target="_blank"><span style="color:#DE4D4D;">more&nbsp;details about how to use the plugin: Click Here</span></a></strong></p>
18
 
@@ -26,7 +25,9 @@ As you probably know, Facebook will retire the old Facebook Conversion Pixel in
26
 
27
  * **Dynamic AddToCart** is fully supported (the AddToCart event will fire on add to cart button click)
28
 
29
- * **Search Event** on the search page
 
 
30
 
31
  * **Track conversion value for WooCommerce** (<a href="http://www.pixelyoursite.com" target="_blank">Pro Version</a>)
32
 
@@ -36,24 +37,33 @@ As you probably know, Facebook will retire the old Facebook Conversion Pixel in
36
 
37
  * **WooCommerce PayPal Standard Events:** you can add a dynamic event that will trigger on WooCommerce PayPal button clicks (<a href="http://www.pixelyoursite.com" target="_blank">Pro Version</a>)
38
 
39
- **Important**
40
 
41
- If you are testing your pixel with Pixel Helper Chrome extension you will see some **false** errors:
42
 
43
- Facebook Pixel did not load.
44
- Event ID: AddToCart
 
 
 
 
 
45
 
46
- You can safely ignore them. It is a normal error trigger by the dynamic AddToCart event, that will disappear after you click on the add to cart button.
47
 
48
  **What's next**
49
 
 
50
 
51
- 1. **Dynamic events on clicks**
52
 
53
- 2. More control for WooCommerce variable products events - some cool new things comming soon
54
 
55
- 3. ... and some secret cool stuf
 
 
 
56
 
 
57
 
58
  <p style="text-align: center;">Visit this page for <strong><a href="http://www.pixelyoursite.com/facebook-pixel-plugin-help" target="_blank"><span style="color:#DE4D4D;">more&nbsp;details about how to use the plugin: Click Here</span></a></strong></p>
59
 
@@ -147,6 +157,12 @@ We have an article about how to optimize Facebook Ads Reports:
147
 
148
  == Changelog ==
149
 
 
 
 
 
 
 
150
  PixelYourSite 2.1
151
 
152
  - Introducing new WooCommerce Paypal Standard events (pro)
@@ -187,4 +203,4 @@ PixelYourSite 1.01
187
 
188
  == Upgrade Notice ==
189
 
190
- - Introducing WooCommerce PayPal Standard button events (pro)
3
  Tags: Facebook Pixel, Facebook, Facebook Conversion Pixel, Facebook Pixel Events, Tracking, Standard events, Facebook Events, Facebook Standard Events, New Facebook Pixel, Facebook Dynamic Ads, WooCommerce, Facebook Custom Events, Custom Events, Conversion pixel, track conversion, Facebook pixel WooCommerce, Facebook Ads, Facebook Campaign, Facebook Ads Campaign, Facebook Conversion Value, Conversion Value, WooCommerce Affiliate Products, Track Affiliate Products, Affiliate links, New Facebook Pixel WooCommerce, PayPal, Facebook Pixel PayPal, New Facebook Pixel Events, facebook standard events woocommerce, facebook tracking pixel woocommerce, facebook conversion pixel for woocommerce, new pixel, pixel plugin, tracking pixel
4
  Requires at least: 3.0.1
5
  Tested up to: 4.4.1
6
+ Stable tag: 2.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
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
 
16
  <p style="text-align: center;">Visit this page for <strong><a href="http://www.pixelyoursite.com/facebook-pixel-plugin-help" target="_blank"><span style="color:#DE4D4D;">more&nbsp;details about how to use the plugin: Click Here</span></a></strong></p>
17
 
25
 
26
  * **Dynamic AddToCart** is fully supported (the AddToCart event will fire on add to cart button click)
27
 
28
+ * **Search Event** on the search page with the search string as parameter
29
+
30
+ * **Dynamic Events:** optimize your Facebook Campaigns for actions on your website (clicks on links, buttons, forms). Works with **Contact Form 7** and other form or pop-up plugins. (<a href="http://www.pixelyoursite.com" target="_blank">Pro Version</a>)
31
 
32
  * **Track conversion value for WooCommerce** (<a href="http://www.pixelyoursite.com" target="_blank">Pro Version</a>)
33
 
37
 
38
  * **WooCommerce PayPal Standard Events:** you can add a dynamic event that will trigger on WooCommerce PayPal button clicks (<a href="http://www.pixelyoursite.com" target="_blank">Pro Version</a>)
39
 
40
+ - Fully tested with WooCommerce 2.5 -
41
 
42
+ **PixelYourSite Learning Section**
43
 
44
+ We try to stay close to all our users and give you valuable information. Here are some of our most appreciated articles:
45
+
46
+ <a href="http://www.pixelyoursite.com/custom-audiences-from-events" target="_blank">How to create Custom Audiences based on website Events</a>
47
+
48
+ <a href="http://www.pixelyoursite.com/facebook-ads-reports-optimisation" target="_blank">How to optimize your Facebook Ads Reports for conversion tracking</a>
49
+
50
+ <a href="http://www.pixelyoursite.com/how-to-use-google-analytics-ecommerce-reports-on-woocommerce-free-plugin-inlculded" target="_blank">How to activate Google Analytics Ecommerce Reports for WooCommerce</a>
51
 
 
52
 
53
  **What's next**
54
 
55
+ 1. More control for WooCommerce variable products events - some cool new things comming soon
56
 
57
+ 2. ... and some secret stuf we don't want to reveal just yeat
58
 
59
+ **Important:**
60
 
61
+ If you are testing your pixel with Pixel Helper Chrome extension you will see some **false** errors:
62
+
63
+ Facebook Pixel did not load.
64
+ Event ID: AddToCart
65
 
66
+ You can safely ignore them. It is a normal error trigger by the dynamic AddToCart event, that will disappear after you click on the add to cart button.
67
 
68
  <p style="text-align: center;">Visit this page for <strong><a href="http://www.pixelyoursite.com/facebook-pixel-plugin-help" target="_blank"><span style="color:#DE4D4D;">more&nbsp;details about how to use the plugin: Click Here</span></a></strong></p>
69
 
157
 
158
  == Changelog ==
159
 
160
+ PixelYourSite 2.2
161
+
162
+ - Introducing Dynamic Events (pro)
163
+
164
+ - Introducing our new Learning Section
165
+
166
  PixelYourSite 2.1
167
 
168
  - Introducing new WooCommerce Paypal Standard events (pro)
203
 
204
  == Upgrade Notice ==
205
 
206
+ - Introducing Dynamic Events (pro) and our new Learning Section