Official Facebook Pixel - Version 2.1.0

Version Description

Download this release

Release Info

Developer Facebook
Plugin Icon Official Facebook Pixel
Version 2.1.0
Comparing to
See all releases

Code changes from version 2.0.2 to 2.1.0

Files changed (39) hide show
  1. changelog.txt +3 -0
  2. core/FacebookPluginConfig.php +4 -1
  3. core/FacebookWordpressSettingsPage.php +69 -26
  4. core/PixelRenderer.php +3 -4
  5. core/ServerEventFactory.php +12 -0
  6. facebook-for-wordpress.php +1 -1
  7. integration/FacebookWordpressCalderaForm.php +10 -1
  8. integration/FacebookWordpressContactForm7.php +32 -4
  9. integration/FacebookWordpressWooCommerce.php +246 -0
  10. languages/official-facebook-pixel-ar_AR.po +1 -1
  11. languages/official-facebook-pixel-cs_CZ.po +1 -1
  12. languages/official-facebook-pixel-da_DK.po +1 -1
  13. languages/official-facebook-pixel-de_DE.po +1 -1
  14. languages/official-facebook-pixel-en_GB.po +1 -1
  15. languages/official-facebook-pixel-es_ES.po +1 -1
  16. languages/official-facebook-pixel-es_LA.po +1 -1
  17. languages/official-facebook-pixel-fi_FI.po +1 -1
  18. languages/official-facebook-pixel-fr_CA.po +1 -1
  19. languages/official-facebook-pixel-fr_FR.po +1 -1
  20. languages/official-facebook-pixel-he_IL.po +1 -1
  21. languages/official-facebook-pixel-it_IT.po +1 -1
  22. languages/official-facebook-pixel-ja_JP.po +1 -1
  23. languages/official-facebook-pixel-ko_KR.po +1 -1
  24. languages/official-facebook-pixel-nb_NO.po +1 -1
  25. languages/official-facebook-pixel-nl_NL.po +1 -1
  26. languages/official-facebook-pixel-pl_PL.po +1 -1
  27. languages/official-facebook-pixel-pt_BR.po +1 -1
  28. languages/official-facebook-pixel-pt_PT.po +1 -1
  29. languages/official-facebook-pixel-ru_RU.po +1 -1
  30. languages/official-facebook-pixel-sv_SE.po +1 -1
  31. languages/official-facebook-pixel-th_TH.po +1 -1
  32. languages/official-facebook-pixel-tr_TR.po +1 -1
  33. languages/official-facebook-pixel-vi_VN.po +1 -1
  34. languages/official-facebook-pixel-zh_CN.po +1 -1
  35. languages/official-facebook-pixel-zh_TW.po +1 -1
  36. readme.txt +5 -1
  37. vendor/autoload.php +1 -1
  38. vendor/composer/autoload_real.php +4 -4
  39. vendor/composer/autoload_static.php +4 -4
changelog.txt CHANGED
@@ -1,4 +1,7 @@
1
  *** Facebook for WordPress Changelog ***
 
 
 
2
  2020-04-23 version 2.0.2
3
  * Support for WordPress 5.4
4
  * Fixing an Illegal string offset error with WP Forms
1
  *** Facebook for WordPress Changelog ***
2
+ 2020-06-18 version 2.1.0
3
+ * Support for WooCommerce through the Server-Side API
4
+
5
  2020-04-23 version 2.0.2
6
  * Support for WordPress 5.4
7
  * Fixing an Illegal string offset error with WP Forms
core/FacebookPluginConfig.php CHANGED
@@ -20,13 +20,15 @@ namespace FacebookPixelPlugin\Core;
20
  defined('ABSPATH') or die('Direct access not allowed');
21
 
22
  class FacebookPluginConfig {
23
- const PLUGIN_VERSION = '2.0.2';
24
  const SOURCE = 'wordpress';
25
  const TEXT_DOMAIN = 'official-facebook-pixel';
26
 
27
  const ADMIN_CAPABILITY = 'manage_options';
28
  const ADMIN_DISMISS_PIXEL_ID_NOTICE = 'dismiss_pixel_id_notice';
29
  const ADMIN_IGNORE_PIXEL_ID_NOTICE = 'ignore_pixel_id_notice';
 
 
30
  const ADMIN_MENU_SLUG = 'facebook_pixel_options';
31
  const ADMIN_MENU_TITLE = 'Facebook Pixel';
32
  const ADMIN_OPTION_GROUP = 'facebook_option_group';
@@ -60,6 +62,7 @@ class FacebookPluginConfig {
60
  'NINJA_FORMS' => 'FacebookWordpressNinjaForms',
61
  'WPFORMS' => 'FacebookWordpressWPForms',
62
  'WP_E_COMMERCE' => 'FacebookWordpressWPECommerce',
 
63
  );
64
  }
65
  }
20
  defined('ABSPATH') or die('Direct access not allowed');
21
 
22
  class FacebookPluginConfig {
23
+ const PLUGIN_VERSION = '2.1.0';
24
  const SOURCE = 'wordpress';
25
  const TEXT_DOMAIN = 'official-facebook-pixel';
26
 
27
  const ADMIN_CAPABILITY = 'manage_options';
28
  const ADMIN_DISMISS_PIXEL_ID_NOTICE = 'dismiss_pixel_id_notice';
29
  const ADMIN_IGNORE_PIXEL_ID_NOTICE = 'ignore_pixel_id_notice';
30
+ const ADMIN_DISMISS_SSAPI_NOTICE = 'dismiss_ssapi__notice';
31
+ const ADMIN_IGNORE_SSAPI_NOTICE = 'ignore_ssapi_notice';
32
  const ADMIN_MENU_SLUG = 'facebook_pixel_options';
33
  const ADMIN_MENU_TITLE = 'Facebook Pixel';
34
  const ADMIN_OPTION_GROUP = 'facebook_option_group';
62
  'NINJA_FORMS' => 'FacebookWordpressNinjaForms',
63
  'WPFORMS' => 'FacebookWordpressWPForms',
64
  'WP_E_COMMERCE' => 'FacebookWordpressWPECommerce',
65
+ 'WOOCOMMERCE' => 'FacebookWordpressWooCommerce'
66
  );
67
  }
68
  }
core/FacebookWordpressSettingsPage.php CHANGED
@@ -119,7 +119,8 @@ class FacebookWordpressSettingsPage {
119
  public function sectionSubTitle() {
120
  printf(
121
  esc_html__(
122
- 'Please note that we are now also supporting lower funnel pixel events for Contact Form 7, Easy Digital Downloads, Ninja Forms and WP Forms',
 
123
  FacebookPluginConfig::TEXT_DOMAIN));
124
  }
125
 
@@ -134,7 +135,8 @@ class FacebookWordpressSettingsPage {
134
  <input name="%s" id="%s" value="%s" />
135
  <p class="description">%s</p>
136
  ',
137
- FacebookPluginConfig::SETTINGS_KEY . '[' . FacebookPluginConfig::PIXEL_ID_KEY . ']',
 
138
  FacebookPluginConfig::PIXEL_ID_KEY,
139
  isset($pixel_id)
140
  ? esc_attr($pixel_id)
@@ -149,7 +151,8 @@ class FacebookWordpressSettingsPage {
149
  FacebookPluginConfig::TEXT_DOMAIN);
150
 
151
  $access_token = FacebookWordpressOptions::getAccessToken();
152
- $existing_access_token_value = isset($access_token) ? esc_attr($access_token) : '';
 
153
  $input_name = FacebookPluginConfig::SETTINGS_KEY .
154
  '[' . FacebookPluginConfig::ACCESS_TOKEN_KEY . ']';
155
 
@@ -168,7 +171,10 @@ class FacebookWordpressSettingsPage {
168
  $link = sprintf(
169
  wp_kses(
170
  __(
171
- 'For businesses that operate in the European Union, you may need to take additional action. Read the <a href="%s" target="_blank">Cookie Consent Guide for Sites and Apps</a> for suggestions on complying with EU privacy requirements.',
 
 
 
172
  FacebookPluginConfig::TEXT_DOMAIN),
173
  array('a' => array('href' => array(), 'target' => array()))),
174
  esc_url(FacebookPluginConfig::ADMIN_PRIVACY_URL));
@@ -182,7 +188,8 @@ class FacebookWordpressSettingsPage {
182
  value="1"
183
  ',
184
  FacebookPluginConfig::USE_PII_KEY,
185
- FacebookPluginConfig::SETTINGS_KEY . '[' . FacebookPluginConfig::USE_PII_KEY . ']',
 
186
  FacebookPluginConfig::USE_PII_KEY);
187
  checked(1, FacebookWordpressOptions::getUsePii());
188
  printf(
@@ -218,7 +225,8 @@ class FacebookWordpressSettingsPage {
218
  value="1"
219
  ',
220
  FacebookPluginConfig::USE_S2S_KEY,
221
- FacebookPluginConfig::SETTINGS_KEY . '[' . FacebookPluginConfig::USE_S2S_KEY . ']',
 
222
  FacebookPluginConfig::USE_S2S_KEY);
223
  checked(1, FacebookWordpressOptions::getUseS2S());
224
  printf(
@@ -239,30 +247,39 @@ class FacebookWordpressSettingsPage {
239
  public function registerNotices() {
240
  // Update class field
241
  $pixel_id = FacebookWordpressOptions::getPixelId();
 
 
242
  $current_screen_id = get_current_screen()->id;
243
- if (
244
- !FacebookPluginUtils::isPositiveInteger($pixel_id)
245
- && current_user_can(FacebookPluginConfig::ADMIN_CAPABILITY)
246
- && in_array(
247
- $current_screen_id,
248
- array('dashboard', 'plugins', $this->optionsPage),
249
- true)
250
- && !get_user_meta(
 
 
 
 
 
251
  get_current_user_id(),
252
- FacebookPluginConfig::ADMIN_IGNORE_PIXEL_ID_NOTICE,
253
- true)
254
- ) {
255
- add_action('admin_notices', array($this, 'pixelIdNotSetNotice'));
 
 
256
  }
257
  }
258
 
259
- public function pixelIdNotSetNotice() {
260
- $url = admin_url('options-general.php?page='.FacebookPluginConfig::ADMIN_MENU_SLUG);
 
 
261
  $link = sprintf(
262
  wp_kses(
263
- __(
264
- 'The Facebook Pixel plugin requires a Pixel ID. Click <a href="%s">here</a> to configure the plugin.',
265
- FacebookPluginConfig::TEXT_DOMAIN),
266
  array('a' => array('href' => array()))),
267
  esc_url($url));
268
  printf(
@@ -278,16 +295,41 @@ class FacebookWordpressSettingsPage {
278
  </div>
279
  ',
280
  $link,
281
- esc_url(add_query_arg(FacebookPluginConfig::ADMIN_DISMISS_PIXEL_ID_NOTICE, '')),
282
  esc_html__(
283
  'Dismiss this notice.',
284
  FacebookPluginConfig::TEXT_DOMAIN));
285
  }
286
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  public function dismissNotices() {
288
  $user_id = get_current_user_id();
289
  if (isset($_GET[FacebookPluginConfig::ADMIN_DISMISS_PIXEL_ID_NOTICE])) {
290
- update_user_meta($user_id, FacebookPluginConfig::ADMIN_IGNORE_PIXEL_ID_NOTICE, true);
 
 
 
 
 
 
 
 
291
  }
292
  }
293
 
@@ -302,7 +344,8 @@ class FacebookWordpressSettingsPage {
302
  $settings = array(
303
  'settings' => sprintf(
304
  '<a href="%s">%s</a>',
305
- admin_url('options-general.php?page='.FacebookPluginConfig::ADMIN_MENU_SLUG),
 
306
  'Settings')
307
  );
308
  return array_merge($settings, $links);
119
  public function sectionSubTitle() {
120
  printf(
121
  esc_html__(
122
+ 'Please note that we are now also supporting lower funnel pixel events
123
+ for Contact Form 7, Easy Digital Downloads, Ninja Forms and WP Forms',
124
  FacebookPluginConfig::TEXT_DOMAIN));
125
  }
126
 
135
  <input name="%s" id="%s" value="%s" />
136
  <p class="description">%s</p>
137
  ',
138
+ FacebookPluginConfig::SETTINGS_KEY . '[' .
139
+ FacebookPluginConfig::PIXEL_ID_KEY . ']',
140
  FacebookPluginConfig::PIXEL_ID_KEY,
141
  isset($pixel_id)
142
  ? esc_attr($pixel_id)
151
  FacebookPluginConfig::TEXT_DOMAIN);
152
 
153
  $access_token = FacebookWordpressOptions::getAccessToken();
154
+ $existing_access_token_value =
155
+ isset($access_token) ? esc_attr($access_token) : '';
156
  $input_name = FacebookPluginConfig::SETTINGS_KEY .
157
  '[' . FacebookPluginConfig::ACCESS_TOKEN_KEY . ']';
158
 
171
  $link = sprintf(
172
  wp_kses(
173
  __(
174
+ 'For businesses that operate in the European Union, you may need to
175
+ take additional action. Read the <a href="%s" target="_blank">
176
+ Cookie Consent Guide for Sites and Apps</a> for suggestions on
177
+ complying with EU privacy requirements.',
178
  FacebookPluginConfig::TEXT_DOMAIN),
179
  array('a' => array('href' => array(), 'target' => array()))),
180
  esc_url(FacebookPluginConfig::ADMIN_PRIVACY_URL));
188
  value="1"
189
  ',
190
  FacebookPluginConfig::USE_PII_KEY,
191
+ FacebookPluginConfig::SETTINGS_KEY . '[' .
192
+ FacebookPluginConfig::USE_PII_KEY . ']',
193
  FacebookPluginConfig::USE_PII_KEY);
194
  checked(1, FacebookWordpressOptions::getUsePii());
195
  printf(
225
  value="1"
226
  ',
227
  FacebookPluginConfig::USE_S2S_KEY,
228
+ FacebookPluginConfig::SETTINGS_KEY . '[' .
229
+ FacebookPluginConfig::USE_S2S_KEY . ']',
230
  FacebookPluginConfig::USE_S2S_KEY);
231
  checked(1, FacebookWordpressOptions::getUseS2S());
232
  printf(
247
  public function registerNotices() {
248
  // Update class field
249
  $pixel_id = FacebookWordpressOptions::getPixelId();
250
+ $use_s2s = FacebookWordpressOptions::getUseS2S();
251
+ $access_token = FacebookWordpressOptions::getAccessToken();
252
  $current_screen_id = get_current_screen()->id;
253
+
254
+ if (current_user_can(FacebookPluginConfig::ADMIN_CAPABILITY) &&
255
+ in_array($current_screen_id, array('dashboard', 'plugins'), true))
256
+ {
257
+ if (!FacebookPluginUtils::isPositiveInteger($pixel_id)
258
+ && !get_user_meta(
259
+ get_current_user_id(),
260
+ FacebookPluginConfig::ADMIN_IGNORE_PIXEL_ID_NOTICE,
261
+ true))
262
+ {
263
+ add_action('admin_notices', array($this, 'pixelIdNotSetNotice'));
264
+ } else if ((!$use_s2s || empty($access_token))
265
+ && !get_user_meta(
266
  get_current_user_id(),
267
+ FacebookPluginConfig::ADMIN_IGNORE_SSAPI_NOTICE,
268
+ true))
269
+ {
270
+ add_action('admin_notices',
271
+ array($this, 'serverSideApiNotEnabledNotice'));
272
+ }
273
  }
274
  }
275
 
276
+ public function setNotice($notice, $dismiss_config) {
277
+ $url = admin_url('options-general.php?page=' .
278
+ FacebookPluginConfig::ADMIN_MENU_SLUG);
279
+
280
  $link = sprintf(
281
  wp_kses(
282
+ $notice,
 
 
283
  array('a' => array('href' => array()))),
284
  esc_url($url));
285
  printf(
295
  </div>
296
  ',
297
  $link,
298
+ esc_url(add_query_arg($dismiss_config, '')),
299
  esc_html__(
300
  'Dismiss this notice.',
301
  FacebookPluginConfig::TEXT_DOMAIN));
302
  }
303
 
304
+ public function pixelIdNotSetNotice() {
305
+ $this->setNotice(
306
+ __('The Facebook Pixel plugin requires a Pixel ID.
307
+ Click <a href="%s">here</a> to configure the plugin.',
308
+ FacebookPluginConfig::TEXT_DOMAIN),
309
+ FacebookPluginConfig::ADMIN_DISMISS_PIXEL_ID_NOTICE);
310
+ }
311
+
312
+ public function serverSideApiNotEnabledNotice() {
313
+ $this->setNotice(
314
+ __('The Facebook Pixel plugin now includes support for the Server-Side
315
+ API, which lets you send events directly from your page\'s website.
316
+ Click <a href="%s">here</a> to configure the plugin.',
317
+ FacebookPluginConfig::TEXT_DOMAIN),
318
+ FacebookPluginConfig::ADMIN_DISMISS_SSAPI_NOTICE);
319
+ }
320
+
321
  public function dismissNotices() {
322
  $user_id = get_current_user_id();
323
  if (isset($_GET[FacebookPluginConfig::ADMIN_DISMISS_PIXEL_ID_NOTICE])) {
324
+ update_user_meta($user_id,
325
+ FacebookPluginConfig::ADMIN_IGNORE_PIXEL_ID_NOTICE,
326
+ true);
327
+ }
328
+
329
+ if (isset($_GET[FacebookPluginConfig::ADMIN_DISMISS_SSAPI_NOTICE])) {
330
+ update_user_meta($user_id,
331
+ FacebookPluginConfig::ADMIN_IGNORE_SSAPI_NOTICE,
332
+ true);
333
  }
334
  }
335
 
344
  $settings = array(
345
  'settings' => sprintf(
346
  '<a href="%s">%s</a>',
347
+ admin_url('options-general.php?page=' .
348
+ FacebookPluginConfig::ADMIN_MENU_SLUG),
349
  'Settings')
350
  );
351
  return array_merge($settings, $links);
core/PixelRenderer.php CHANGED
@@ -32,17 +32,16 @@ class PixelRenderer {
32
  fbq('%s', '%s', %s, %s);
33
  ";
34
 
35
- public static function render($events, $fb_integration_tracking) {
 
36
  if (empty($events)) {
37
  return "";
38
  }
39
-
40
  $code = "";
41
  foreach ($events as $event) {
42
  $code .= self::getPixelTrackCode($event, $fb_integration_tracking);
43
  }
44
-
45
- return sprintf(self::SCRIPT_TAG, $code);
46
  }
47
 
48
  private static function getPixelTrackCode($event, $fb_integration_tracking) {
32
  fbq('%s', '%s', %s, %s);
33
  ";
34
 
35
+ public static function render($events, $fb_integration_tracking,
36
+ $script_tag = true) {
37
  if (empty($events)) {
38
  return "";
39
  }
 
40
  $code = "";
41
  foreach ($events as $event) {
42
  $code .= self::getPixelTrackCode($event, $fb_integration_tracking);
43
  }
44
+ return $script_tag ? sprintf(self::SCRIPT_TAG, $code) : $code;
 
45
  }
46
 
47
  private static function getPixelTrackCode($event, $fb_integration_tracking) {
core/ServerEventFactory.php CHANGED
@@ -159,6 +159,10 @@ class ServerEventFactory {
159
  if (!empty($data['last_name'])) {
160
  $user_data->setLastName($data['last_name']);
161
  }
 
 
 
 
162
  }
163
 
164
  $custom_data = $event->getCustomData();
@@ -172,6 +176,10 @@ class ServerEventFactory {
172
  $custom_data->setValue($data['value']);
173
  }
174
 
 
 
 
 
175
  if (!empty($data['content_ids'])) {
176
  $custom_data->setContentIds($data['content_ids']);
177
  }
@@ -179,6 +187,10 @@ class ServerEventFactory {
179
  if (!empty($data['content_type'])) {
180
  $custom_data->setContentType($data['content_type']);
181
  }
 
 
 
 
182
  } catch (\Exception $e) {
183
  // Need to log
184
  }
159
  if (!empty($data['last_name'])) {
160
  $user_data->setLastName($data['last_name']);
161
  }
162
+
163
+ if (!empty($data['phone'])) {
164
+ $user_data->setPhone($data['phone']);
165
+ }
166
  }
167
 
168
  $custom_data = $event->getCustomData();
176
  $custom_data->setValue($data['value']);
177
  }
178
 
179
+ if (!empty($data['contents'])) {
180
+ $custom_data->setContents($data['contents']);
181
+ }
182
+
183
  if (!empty($data['content_ids'])) {
184
  $custom_data->setContentIds($data['content_ids']);
185
  }
187
  if (!empty($data['content_type'])) {
188
  $custom_data->setContentType($data['content_type']);
189
  }
190
+
191
+ if (!empty($data['num_items'])) {
192
+ $custom_data->setNumItems($data['num_items']);
193
+ }
194
  } catch (\Exception $e) {
195
  // Need to log
196
  }
facebook-for-wordpress.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: <strong><em>***ATTENTION: After upgrade the plugin may be deactivated due to a known issue, to workaround please refresh this page and activate plugin.***</em></strong> The Facebook pixel is an analytics tool that helps you measure the effectiveness of your advertising. You can use the Facebook pixel to understand the actions people are taking on your website and reach audiences you care about.
6
  * Author: Facebook
7
  * Author URI: https://www.facebook.com/
8
- * Version: 2.0.2
9
  * Text Domain: official-facebook-pixel
10
  */
11
 
5
  * Description: <strong><em>***ATTENTION: After upgrade the plugin may be deactivated due to a known issue, to workaround please refresh this page and activate plugin.***</em></strong> The Facebook pixel is an analytics tool that helps you measure the effectiveness of your advertising. You can use the Facebook pixel to understand the actions people are taking on your website and reach audiences you care about.
6
  * Author: Facebook
7
  * Author URI: https://www.facebook.com/
8
+ * Version: 2.1.0
9
  * Text Domain: official-facebook-pixel
10
  */
11
 
integration/FacebookWordpressCalderaForm.php CHANGED
@@ -72,7 +72,8 @@ class FacebookWordpressCalderaForm extends FacebookWordpressIntegrationBase {
72
  return array(
73
  'email' => self::getEmail($form),
74
  'first_name' => self::getFirstName($form),
75
- 'last_name' => self::getLastName($form)
 
76
  );
77
  }
78
 
@@ -88,6 +89,14 @@ class FacebookWordpressCalderaForm extends FacebookWordpressIntegrationBase {
88
  return self::getFieldValue($form, 'slug', 'last_name');
89
  }
90
 
 
 
 
 
 
 
 
 
91
  private static function getFieldValue($form, $attr, $attr_value) {
92
  if (empty($form['fields'])) {
93
  return null;
72
  return array(
73
  'email' => self::getEmail($form),
74
  'first_name' => self::getFirstName($form),
75
+ 'last_name' => self::getLastName($form),
76
+ 'phone' => self::getPhone($form)
77
  );
78
  }
79
 
89
  return self::getFieldValue($form, 'slug', 'last_name');
90
  }
91
 
92
+ private static function getPhone($form) {
93
+ // Extract phone number from the better version first, fallback to the basic
94
+ // version if it's null
95
+ $phone = self::getFieldValue($form, 'type', 'phone_better');
96
+ return empty($phone) ? self::getFieldValue($form, 'type', 'phone')
97
+ : $phone;
98
+ }
99
+
100
  private static function getFieldValue($form, $attr, $attr_value) {
101
  if (empty($form['fields'])) {
102
  return null;
integration/FacebookWordpressContactForm7.php CHANGED
@@ -66,13 +66,25 @@ class FacebookWordpressContactForm7 extends FacebookWordpressIntegrationBase {
66
  }
67
 
68
  $events = FacebookServerSideEvent::getInstance()->getTrackedEvents();
69
- $code = PixelRenderer::render($events, self::TRACKING_NAME);
 
 
 
 
70
  $code = sprintf("
71
  <!-- Facebook Pixel Event Code -->
72
- %s
 
 
 
 
 
 
73
  <!-- End Facebook Pixel Event Code -->
74
  ",
75
- $code);
 
 
76
 
77
  $response['message'] .= $code;
78
  return $response;
@@ -89,7 +101,8 @@ class FacebookWordpressContactForm7 extends FacebookWordpressIntegrationBase {
89
  return array(
90
  'email' => self::getEmail($form_tags),
91
  'first_name' => $name[0],
92
- 'last_name' => $name[1]
 
93
  );
94
  }
95
 
@@ -121,4 +134,19 @@ class FacebookWordpressContactForm7 extends FacebookWordpressIntegrationBase {
121
 
122
  return null;
123
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  }
66
  }
67
 
68
  $events = FacebookServerSideEvent::getInstance()->getTrackedEvents();
69
+ if( count($events) == 0 ){
70
+ return $response;
71
+ }
72
+ $event_id = $events[0]->getEventId();
73
+ $fbq_calls = PixelRenderer::render($events, self::TRACKING_NAME, false);
74
  $code = sprintf("
75
  <!-- Facebook Pixel Event Code -->
76
+ <script type='text/javascript'>
77
+ if( typeof window.pixelLastGeneratedLeadEvent === 'undefined'
78
+ || window.pixelLastGeneratedLeadEvent != '%s' ){
79
+ window.pixelLastGeneratedLeadEvent = '%s';
80
+ %s
81
+ }
82
+ </script>
83
  <!-- End Facebook Pixel Event Code -->
84
  ",
85
+ $event_id ,
86
+ $event_id ,
87
+ $fbq_calls);
88
 
89
  $response['message'] .= $code;
90
  return $response;
101
  return array(
102
  'email' => self::getEmail($form_tags),
103
  'first_name' => $name[0],
104
+ 'last_name' => $name[1],
105
+ 'phone' => self::getPhone($form_tags)
106
  );
107
  }
108
 
134
 
135
  return null;
136
  }
137
+
138
+ private static function getPhone($form_tags) {
139
+ if (empty($form_tags)) {
140
+ return null;
141
+ }
142
+
143
+ foreach ($form_tags as $tag) {
144
+ if ($tag->basetype === "tel") {
145
+ return $_POST[$tag->name];
146
+ }
147
+ }
148
+
149
+ return null;
150
+ }
151
+
152
  }
integration/FacebookWordpressWooCommerce.php ADDED
@@ -0,0 +1,246 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Copyright (C) 2017-present, Facebook, Inc.
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; version 2 of the License.
8
+ * This program is distributed in the hope that it will be useful,
9
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ * GNU General Public License for more details.
12
+ */
13
+
14
+ /**
15
+ * @package FacebookPixelPlugin
16
+ */
17
+
18
+ namespace FacebookPixelPlugin\Integration;
19
+
20
+ defined('ABSPATH') or die('Direct access not allowed');
21
+
22
+ use FacebookPixelPlugin\Core\FacebookPixel;
23
+ use FacebookPixelPlugin\Core\FacebookPluginUtils;
24
+ use FacebookPixelPlugin\Core\ServerEventFactory;
25
+ use FacebookPixelPlugin\Core\FacebookServerSideEvent;
26
+ use FacebookPixelPlugin\Core\PixelRenderer;
27
+ use FacebookAds\Object\ServerSide\Content;
28
+
29
+ class FacebookWordpressWooCommerce extends FacebookWordpressIntegrationBase {
30
+ const PLUGIN_FILE = 'facebook-for-woocommerce/facebook-for-woocommerce.php';
31
+ const TRACKING_NAME = 'woocommerce';
32
+
33
+ // Being consistent with the WooCommerce plugin
34
+ const FB_ID_PREFIX = 'wc_post_id_';
35
+
36
+ public static function injectPixelCode() {
37
+ // Add the hooks only if the WooCommerce plugin is not active
38
+ if(!self::isFacebookForWooCommerceActive()) {
39
+ add_action('woocommerce_after_checkout_form',
40
+ array(__CLASS__, 'trackInitiateCheckout'),
41
+ 40);
42
+
43
+ add_action( 'woocommerce_add_to_cart',
44
+ array(__CLASS__, 'trackAddToCartEvent'),
45
+ 40, 4);
46
+
47
+ add_action( 'woocommerce_thankyou',
48
+ array(__CLASS__, 'trackPurchaseEvent'),
49
+ 40);
50
+
51
+ add_action( 'woocommerce_payment_complete',
52
+ array(__CLASS__, 'trackPurchaseEvent'),
53
+ 40);
54
+ }
55
+ }
56
+
57
+ public static function trackPurchaseEvent($order_id) {
58
+ if (FacebookPluginUtils::isAdmin()) {
59
+ return;
60
+ }
61
+
62
+ $server_event = ServerEventFactory::safeCreateEvent(
63
+ 'Purchase',
64
+ array(__CLASS__, 'createPurchaseEvent'),
65
+ array($order_id),
66
+ self::TRACKING_NAME
67
+ );
68
+
69
+ FacebookServerSideEvent::getInstance()->track($server_event);
70
+ }
71
+
72
+ public static function createPurchaseEvent($order_id) {
73
+ $order = wc_get_order($order_id);
74
+
75
+ $content_type = 'product';
76
+ $product_ids = array();
77
+ $contents = array();
78
+
79
+ foreach ($order->get_items() as $item) {
80
+ $product = wc_get_product($item->get_product_id());
81
+ if ('product_group' !== $content_type
82
+ && $product->is_type('variable'))
83
+ {
84
+ $content_type = 'product_group';
85
+ }
86
+
87
+ $quantity = $item->get_quantity();
88
+ $product_id = self::getProductId($product);
89
+
90
+ $content = new Content();
91
+ $content->setProductId($product_id);
92
+ $content->setQuantity($quantity);
93
+ $content->setItemPrice($item->get_total() / $quantity);
94
+
95
+ $contents[] = $content;
96
+ $product_ids[] = $product_id;
97
+ }
98
+
99
+ $event_data = self::getPiiFromBillingInformation($order);
100
+ $event_data['content_type'] = $content_type;
101
+ $event_data['currency'] = \get_woocommerce_currency();
102
+ $event_data['value'] = $order->get_total();
103
+ $event_data['content_ids'] = $product_ids;
104
+ $event_data['contents'] = $contents;
105
+
106
+ return $event_data;
107
+ }
108
+
109
+ public static function trackAddToCartEvent(
110
+ $cart_item_key, $product_id, $quantity, $variation_id) {
111
+ if (FacebookPluginUtils::isAdmin()) {
112
+ return;
113
+ }
114
+
115
+ $server_event = ServerEventFactory::safeCreateEvent(
116
+ 'AddToCart',
117
+ array(__CLASS__, 'createAddToCartEvent'),
118
+ array($cart_item_key, $product_id, $quantity),
119
+ self::TRACKING_NAME
120
+ );
121
+
122
+ FacebookServerSideEvent::getInstance()->track($server_event);
123
+ }
124
+
125
+ public static function createAddToCartEvent(
126
+ $cart_item_key, $product_id, $quantity)
127
+ {
128
+ $event_data = FacebookPluginUtils::getLoggedInUserInfo();
129
+ $event_data['content_type'] = 'product';
130
+ $event_data['currency'] = \get_woocommerce_currency();
131
+
132
+ $cart_item = self::getCartItem($cart_item_key);
133
+ if (!empty($cart_item_key)) {
134
+ $event_data['content_ids'] =
135
+ array(self::getProductId($cart_item['data']));
136
+ $event_data['value'] = self::getAddToCartValue($cart_item, $quantity);
137
+ }
138
+
139
+ return $event_data;
140
+ }
141
+
142
+ public static function trackInitiateCheckout() {
143
+ if (FacebookPluginUtils::isAdmin()) {
144
+ return;
145
+ }
146
+
147
+ $server_event = ServerEventFactory::safeCreateEvent(
148
+ 'InitiateCheckout',
149
+ array(__CLASS__, 'createInitiateCheckoutEvent'),
150
+ array(),
151
+ self::TRACKING_NAME
152
+ );
153
+
154
+ FacebookServerSideEvent::getInstance()->track($server_event);
155
+ }
156
+
157
+ public static function createInitiateCheckoutEvent() {
158
+ $event_data = FacebookPluginUtils::getLoggedInUserInfo();
159
+ $event_data['content_type'] = 'product';
160
+ $event_data['currency'] = \get_woocommerce_currency();
161
+
162
+ if ($cart = WC()->cart) {
163
+ $event_data['num_items'] = $cart->get_cart_contents_count();
164
+ $event_data['value'] = $cart->total;
165
+ $event_data['content_ids'] = self::getContentIds($cart);
166
+ $event_data['contents'] = self::getContents($cart);
167
+ }
168
+
169
+ return $event_data;
170
+ }
171
+
172
+ private static function getPiiFromBillingInformation($order) {
173
+ $pii = array();
174
+ $billingInfo = $order->data['billing'];
175
+
176
+ if (!empty($billingInfo)) {
177
+ $pii['first_name'] = $billingInfo['first_name'];
178
+ $pii['last_name'] = $billingInfo['last_name'];
179
+ $pii['email'] = $billingInfo['email'];
180
+ $pii['phone'] = $billingInfo['phone'];
181
+ }
182
+
183
+ return $pii;
184
+ }
185
+
186
+ private static function getAddToCartValue($cart_item, $quantity) {
187
+ if (!empty($cart_item)) {
188
+ $price = $cart_item['line_total'] / $cart_item['quantity'];
189
+ return $quantity * $price;
190
+ }
191
+
192
+ return null;
193
+ }
194
+
195
+ private static function getCartItem($cart_item_key) {
196
+ if (WC()->cart) {
197
+ $cart = WC()->cart->get_cart();
198
+ if (!empty($cart) && !empty($cart[$cart_item_key])) {
199
+ return $cart[$cart_item_key];
200
+ }
201
+ }
202
+
203
+ return null;
204
+ }
205
+
206
+ private static function getContentIds($cart) {
207
+ $product_ids = [];
208
+ foreach ($cart->get_cart() as $item) {
209
+ if (!empty($item['data'])) {
210
+ $product_ids[] = self::getProductId($item['data']);
211
+ }
212
+ }
213
+
214
+ return $product_ids;
215
+ }
216
+
217
+ private static function getContents($cart) {
218
+ $contents = [];
219
+ foreach ($cart->get_cart() as $item) {
220
+ if (!empty($item['data']) && !empty($item['quantity'])) {
221
+ $content = new Content();
222
+ $content->setProductId(self::getProductId($item['data']));
223
+ $content->setQuantity($item['quantity']);
224
+ $content->setItemPrice($item['line_total'] / $item['quantity']);
225
+
226
+ $contents[] = $content;
227
+ }
228
+ }
229
+
230
+ return $contents;
231
+ }
232
+
233
+ private static function getProductId($product) {
234
+ $woo_id = $product->get_id();
235
+
236
+ return $product->get_sku() ?
237
+ $product->get_sku() . '_' . $woo_id
238
+ : self::FB_ID_PREFIX . $woo_id;
239
+ }
240
+
241
+ private static function isFacebookForWooCommerceActive() {
242
+ return in_array(
243
+ 'facebook-for-woocommerce/facebook-for-woocommerce.php',
244
+ get_option('active_plugins'));
245
+ }
246
+ }
languages/official-facebook-pixel-ar_AR.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-cs_CZ.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-da_DK.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-de_DE.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-en_GB.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-es_ES.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-es_LA.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-fi_FI.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-fr_CA.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-fr_FR.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-he_IL.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-it_IT.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-ja_JP.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-ko_KR.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-nb_NO.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-nl_NL.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-pl_PL.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-pt_BR.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-pt_PT.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-ru_RU.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-sv_SE.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-th_TH.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-pixel\n"
7
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
8
  "PO-Revision-Date: 2018-11-28 17:37-0800\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-pixel\n"
7
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
8
  "PO-Revision-Date: 2018-11-28 17:37-0800\n"
languages/official-facebook-pixel-tr_TR.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-vi_VN.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-zh_CN.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
languages/official-facebook-pixel-zh_TW.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Official Facebook Pixel 2.0.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
2
  # This file is distributed under the same license as the Facebook Pixel package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Official Facebook Pixel 2.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/official-facebook-"
7
  "pixel\n"
8
  "POT-Creation-Date: 2018-11-29 01:26:28+00:00\n"
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: Facebook, Facebook Conversion Pixel, Facebook Pixel, Facebook Pixel Events
4
  Requires at least: 4.4
5
  Tested up to: 5.4
6
  Requires PHP: 5.3
7
- Stable tag: 2.0.1
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -23,6 +23,7 @@ This plugin also includes built-in support for these other WordPress plugins:
23
  * Ninja Forms
24
  * WP eCommerce
25
  * WPForms
 
26
 
27
  == Installation ==
28
  __To install from your WordPress site__ <br />
@@ -49,6 +50,9 @@ If you get stuck, or have any questions, you can ask for help in the [Official F
49
  Of course! This plugin is open sourced on the Facebook Incubator GitHub. You can find the code and contribution instructions in the [plugin repository](https://github.com/facebookincubator/Facebook-Pixel-for-WordPress).
50
 
51
  == Changelog ==
 
 
 
52
  = 2020-04-23 version 2.0.2 =
53
  * Support for WordPress 5.4
54
  * Fixing an Illegal string offset error with WP Forms
4
  Requires at least: 4.4
5
  Tested up to: 5.4
6
  Requires PHP: 5.3
7
+ Stable tag: 2.1.0
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
23
  * Ninja Forms
24
  * WP eCommerce
25
  * WPForms
26
+ * WooCommerce (through the Server-Side API)
27
 
28
  == Installation ==
29
  __To install from your WordPress site__ <br />
50
  Of course! This plugin is open sourced on the Facebook Incubator GitHub. You can find the code and contribution instructions in the [plugin repository](https://github.com/facebookincubator/Facebook-Pixel-for-WordPress).
51
 
52
  == Changelog ==
53
+ = 2020-06-18 version 2.1.0 =
54
+ * Support for WooCommerce through the Server-Side API
55
+
56
  = 2020-04-23 version 2.0.2 =
57
  * Support for WordPress 5.4
58
  * Fixing an Illegal string offset error with WP Forms
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit165d98fad3305706935a9a1555187039::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitf86f03e642fb38d360aec66970fd23ac::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit165d98fad3305706935a9a1555187039
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit165d98fad3305706935a9a1555187039
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit165d98fad3305706935a9a1555187039', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit165d98fad3305706935a9a1555187039', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit165d98fad3305706935a9a1555187039::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitf86f03e642fb38d360aec66970fd23ac
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitf86f03e642fb38d360aec66970fd23ac', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitf86f03e642fb38d360aec66970fd23ac', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitf86f03e642fb38d360aec66970fd23ac::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit165d98fad3305706935a9a1555187039
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'F' =>
@@ -42,9 +42,9 @@ class ComposerStaticInit165d98fad3305706935a9a1555187039
42
  public static function getInitializer(ClassLoader $loader)
43
  {
44
  return \Closure::bind(function () use ($loader) {
45
- $loader->prefixLengthsPsr4 = ComposerStaticInit165d98fad3305706935a9a1555187039::$prefixLengthsPsr4;
46
- $loader->prefixDirsPsr4 = ComposerStaticInit165d98fad3305706935a9a1555187039::$prefixDirsPsr4;
47
- $loader->classMap = ComposerStaticInit165d98fad3305706935a9a1555187039::$classMap;
48
 
49
  }, null, ClassLoader::class);
50
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitf86f03e642fb38d360aec66970fd23ac
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'F' =>
42
  public static function getInitializer(ClassLoader $loader)
43
  {
44
  return \Closure::bind(function () use ($loader) {
45
+ $loader->prefixLengthsPsr4 = ComposerStaticInitf86f03e642fb38d360aec66970fd23ac::$prefixLengthsPsr4;
46
+ $loader->prefixDirsPsr4 = ComposerStaticInitf86f03e642fb38d360aec66970fd23ac::$prefixDirsPsr4;
47
+ $loader->classMap = ComposerStaticInitf86f03e642fb38d360aec66970fd23ac::$classMap;
48
 
49
  }, null, ClassLoader::class);
50
  }