83% facebook-for-woocommerce

Code Review | Facebook for WooCommerce

WordPress plugin Facebook for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: facebook-for-wooc...
  • Plugin version: 3.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4
  • WordPress version: 6.3.1
  • First release: Feb 22, 2019
  • Latest release: Nov 29, 2023
  • Number of updates: 165
  • Update frequency: every 10.6 days
  • Top authors: automattic (60.61%)SkyVerge (30.3%)facebook4woocommerce (8.48%)ecgan (2.42%)

Code review

54 tests

User reviews

410 reviews

Install metrics

700,000+ active /33,787,605 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.97ms] Passed 4 tests

An overview of server-side resources used by Facebook for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0532.03 ▼8.98
Dashboard /wp-admin3.35 ▲0.0544.51 ▼7.16
Posts /wp-admin/edit.php3.47 ▲0.1148.07 ▲2.04
Add New Post /wp-admin/post-new.php5.93 ▲0.0590.74 ▼5.78
Media Library /wp-admin/upload.php3.28 ▲0.0538.04 ▲6.44

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 233 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Facebook for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲4014.67 ▼0.041.60 ▼0.0440.37 ▼3.42
Dashboard /wp-admin2,207 ▲275.61 ▼0.0393.30 ▼5.2243.33 ▲2.26
Posts /wp-admin/edit.php2,113 ▲102.03 ▲0.0639.47 ▼0.9237.28 ▲2.91
Add New Post /wp-admin/post-new.php1,538 ▲1223.35 ▼0.23664.20 ▲32.3847.88 ▼3.45
Media Library /wp-admin/upload.php1,409 ▲64.17 ▼0.03102.42 ▲6.2144.34 ▲1.80

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Trait 'Automattic\\WooCommerce\\ActionSchedulerJobFramework\\Utilities\\BatchSize' not found in wp-content/plugins/facebook-for-woocommerce/vendor/woocommerce/action-scheduler-job-framework/src/Utilities/BatchQueryOffset.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Requires php: Invalid version format
The official readme.txt is a good inspiration

facebook-for-woocommerce/facebook-for-woocommerce.php 85% from 13 tests

The main PHP file in "Facebook for WooCommerce" ver. 3.1.5 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.4" instead of "5.6")
  • Description: Please don't use more than 140 characters for the plugin description (currently 298 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected17,402 lines of code in 218 files:
LanguageFilesBlank linesComment linesLines of code
PHP1845,06912,76915,802
JavaScript20384441862
CSS76032501
Markdown2350121
JSON40075
XML111541

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity12.93
▷ Minimum class complexity1.00
▷ Maximum class complexity242.00
Average method complexity2.61
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces62
Interfaces5
Traits8
Classes156
▷ Abstract classes106.41%
▷ Concrete classes14693.59%
▷ Final classes00.00%
Methods1,270
▷ Static methods17413.70%
▷ Public methods97576.77%
▷ Protected methods15912.52%
▷ Private methods13610.71%
Functions22
▷ Named functions29.09%
▷ Anonymous functions2090.91%
Constants202
▷ Global constants00.00%
▷ Class constants202100.00%
▷ Public constants202100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon-0.png1.71KB0.80KB▼ 53.03%
assets/images/icon-1.png1.87KB0.93KB▼ 50.18%
assets/images/background.png8.69KB3.84KB▼ 55.78%
assets/images/woocommerce-placeholder.png57.34KB31.56KB▼ 44.97%
assets/images/logo.png2.79KB1.45KB▼ 48.06%