62% official-facebook-pixel

Code Review | Meta pixel for WordPress

WordPress plugin Meta pixel for WordPress scored62%from 54 tests.

About plugin

  • Plugin page: official-facebook...
  • Plugin version: 3.0.14
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.2
  • WordPress version: 6.3.1
  • First release: Nov 6, 2018
  • Latest release: Nov 16, 2023
  • Number of updates: 114
  • Update frequency: every 16.2 days
  • Top authors: Facebook (100%)

Code review

54 tests

User reviews

134 reviews

Install metrics

500,000+ active /6,993,634 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.36MB] [CPU: ▼1.86ms] Passed 4 tests

This is a short check of server-side resources used by Meta pixel for WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3038.75 ▼2.98
Dashboard /wp-admin3.69 ▲0.3954.54 ▲7.01
Posts /wp-admin/edit.php3.73 ▲0.3847.35 ▲1.41
Add New Post /wp-admin/post-new.php6.28 ▲0.4087.13 ▼11.64
Media Library /wp-admin/upload.php3.61 ▲0.3837.96 ▲5.77
Meta /wp-admin/options-general.php?page=facebook_pixel_options3.5234.27

Server storage [IO: ▲6.00MB] [DB: ▲0.00MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 1,697 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
facebook_capi_integration_status
widget_theysaidso_widget
facebook_capi_integration_events_filter
db_upgraded

Browser metrics Passed 4 tests

Meta pixel for WordPress: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲3214.66 ▲0.311.71 ▼0.2242.38 ▼2.70
Dashboard /wp-admin2,227 ▲505.64 ▼0.0586.07 ▼8.8141.76 ▲3.61
Posts /wp-admin/edit.php2,106 ▲32.00 ▲0.0436.26 ▼7.1733.59 ▼3.75
Add New Post /wp-admin/post-new.php1,531 ▼423.02 ▼1.89615.93 ▼52.7846.87 ▼20.29
Media Library /wp-admin/upload.php1,406 ▲64.21 ▲0.13104.20 ▼1.8541.66 ▼2.70
Meta /wp-admin/options-general.php?page=facebook_pixel_options1,55710.52292.0081.83

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • facebook_capi_integration_events_filter
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • facebook_capi_integration_status

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 24× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/official-facebook-pixel/core/ServerEventFactory.php
    • > /wp-content/plugins/official-facebook-pixel/integration/EDDUtils.php
    • > /wp-content/plugins/official-facebook-pixel/core/FacebookServerSideEvent.php
    • > /wp-content/plugins/official-facebook-pixel/integration/FacebookWordpressFormidableForm.php
    • > /wp-content/plugins/official-facebook-pixel/integration/FacebookWordpressWPForms.php
    • > /wp-content/plugins/official-facebook-pixel/integration/FacebookWordpressWPECommerce.php
    • > /wp-content/plugins/official-facebook-pixel/integration/FacebookWordpressContactForm7.php
    • > /wp-content/plugins/official-facebook-pixel/core/PixelRenderer.php
    • > /wp-content/plugins/official-facebook-pixel/integration/FacebookWordpressNinjaForms.php
    • > /wp-content/plugins/official-facebook-pixel/integration/FacebookWordpressWooCommerce.php
  • 1666× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'FacebookAds\\Enum\\AbstractEnum' not found in wp-content/plugins/official-facebook-pixel/vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/PageParkingFields.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'FacebookAds\\Object\\AbstractCrudObject' not found in wp-content/plugins/official-facebook-pixel/vendor/facebook/php-business-sdk/src/FacebookAds/Object/URL.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'FacebookAds\\Object\\AbstractCrudObject' not found in wp-content/plugins/official-facebook-pixel/vendor/facebook/php-business-sdk/src/FacebookAds/Object/Experience.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'FacebookAds\\Object\\AbstractObject' not found in wp-content/plugins/official-facebook-pixel/vendor/facebook/php-business-sdk/src/FacebookAds/Object/ProductCatalogImageSettings.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'FacebookAds\\Enum\\AbstractEnum' not found in wp-content/plugins/official-facebook-pixel/vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/ProductCatalogImageSettingsFields.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'FacebookAds\\Enum\\AbstractEnum' not found in wp-content/plugins/official-facebook-pixel/vendor/facebook/php-business-sdk/src/FacebookAds/Object/Fields/AdCampaignPacedBidInfoFields.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'FacebookAds\\Object\\AbstractObject' not found in wp-content/plugins/official-facebook-pixel/vendor/facebook/php-business-sdk/src/FacebookAds/Object/FAMEExportConfig.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'FacebookAdsTest\\Object\\AbstractAsyncJobTestCase' not found in wp-content/plugins/official-facebook-pixel/vendor/facebook/php-business-sdk/test/FacebookAdsTest/Object/AsyncJobInsightsTest.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'FacebookAds\\Object\\AbstractObject' not found in wp-content/plugins/official-facebook-pixel/vendor/facebook/php-business-sdk/src/FacebookAds/Object/AdRuleExecutionOptions.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'FacebookAds\\Object\\AbstractObject' not found in wp-content/plugins/official-facebook-pixel/vendor/facebook/php-business-sdk/src/FacebookAds/Object/ManagedPartnerBusiness.php:42

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=facebook_pixel_options
    • > Console-api (warning) in wp-content/plugins/official-facebook-pixel/js/fbe_allinone.js?ver=6.3.1+21423:14
    Warning: Accessing createClass via the main React package is deprecated, and will be removed in React v16.0. Use a plain JavaScript class instead. If you're not yet ready to migrate, create-react-class v15.* is available on npm as a temporary, drop-in replacement. For more info see https://fb.me/react-create-class
    • > GET request to /wp-admin/options-general.php?page=facebook_pixel_options
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/options-general.php?page=facebook_pixel_options
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
10 plugin tags: facebook pixel, facebook conversion pixel, facebook standard events, facebook retargeting, meta conversion api...

official-facebook-pixel/facebook-for-wordpress.php 85% from 13 tests

The primary PHP file in "Meta pixel for WordPress" version 3.0.14 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("official-facebook-pixel.php" instead of "facebook-for-wordpress.php")
  • Description: The description should be shorter than 140 characters (currently 397 characters long)

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
It is important to fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/official-facebook-pixel/vendor/facebook/php-business-sdk/fb_ca_chain_bundle.crt
90,911 lines of code in 1,658 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,60915,45152,86174,822
JavaScript12,4986,23812,982
PO File263125151,660
Markdown113850901
JSON400197
HTML11318143
CSS22534131
XML30051
YAML14024

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity2.61
▷ Minimum class complexity1.00
▷ Maximum class complexity118.00
Average method complexity1.58
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces39
Interfaces13
Traits4
Classes1,440
▷ Abstract classes151.04%
▷ Concrete classes1,42598.96%
▷ Final classes60.42%
Methods4,075
▷ Static methods1,12127.51%
▷ Public methods3,37082.70%
▷ Protected methods58814.43%
▷ Private methods1172.87%
Functions42
▷ Named functions614.29%
▷ Anonymous functions3685.71%
Constants9,566
▷ Global constants60.06%
▷ Class constants9,56099.94%
▷ Public constants9,560100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/facebook/php-business-sdk/test/misc/image.png6.46KB5.92KB▼ 8.50%