Bug fix: admin email on Pixel init #114
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The Problem:
The $param field in the Facebook Pixel initialization code was being populated with admin user data (email, first name, last name)
This occurred because the plugin was calling FacebookWordpressOptions::get_user_info() for any logged-in user, including admins
While all individual event tracking functions properly filter out admin users using FacebookPluginUtils::is_internal_user(), the main pixel initialization code did not apply this filter
This problem was also reported by the open source community: https://wordpress.org/support/topic/exposes-your-admin-email-address/
The Fix
I modified [class-facebookwordpresspixelinjection.php] to:
Type of change
Checklist
Changelog entry
Bug fix / vulnerability: fix admin email on Pixel init
Test Plan
Test by viewing source on my demo website. This fix ensures that admin user data is never included in the pixel tracking parameters, while maintaining full functionality for legitimate frontend users. The solution is consistent with how the plugin already protects admin data in all other tracking functions.
(Previous state: my wp-admin email/detail are included. New state: whether logged in or not (as admin), admin detail not included).
Screenshots
Please provide screenshots or snapshots of the system/state both before and after implementing the changes, if appropriate
Before
After