78% woocommerce-retargeting

Code Review | WooCommerce Retargeting

WordPress plugin WooCommerce Retargeting scored78%from 54 tests.

About plugin

  • Plugin page: woocommerce-retar...
  • Plugin version: 3.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.8
  • WordPress version: 6.3.1
  • First release: May 13, 2015
  • Latest release: Sep 21, 2021
  • Number of updates: 52
  • Update frequency: every 44.7 days
  • Top authors: retargeting (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /8,098 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.24ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Retargeting
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.27 ▼1.89
Dashboard /wp-admin3.34 ▼0.0149.63 ▼15.82
Posts /wp-admin/edit.php3.39 ▲0.0350.30 ▼1.02
Add New Post /wp-admin/post-new.php5.92 ▲0.0395.04 ▼14.22
Media Library /wp-admin/upload.php3.26 ▲0.0338.63 ▲4.94

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 89 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Retargeting
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲7913.56 ▼1.194.53 ▲2.5540.70 ▼0.37
Dashboard /wp-admin2,224 ▲215.84 ▼0.07100.14 ▼13.8641.36 ▼6.27
Posts /wp-admin/edit.php2,100 ▼32.01 ▼0.0434.06 ▼3.6933.60 ▼2.47
Add New Post /wp-admin/post-new.php1,545 ▲523.42 ▲0.44634.65 ▼32.0762.03 ▼4.27
Media Library /wp-admin/upload.php1,400 ▼04.27 ▲0.0498.26 ▼16.9147.70 ▼4.42

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/woocommerce-retargeting/woocommerce-retargeting.php
  • 58× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'RetargetingSDK\\AbstractRetargetingSDK' not found in wp-content/plugins/woocommerce-retargeting/vendor/retargeting/retargeting-sdk/lib/Brand.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woocommerce-retargeting/vendor/retargeting/retargeting-sdk/tests/Unit/StockManagementTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woocommerce-retargeting/vendor/retargeting/retargeting-sdk/tests/Unit/CategoryTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'RetargetingSDK\\Javascript\\Item\\AbstractItem' not found in wp-content/plugins/woocommerce-retargeting/vendor/retargeting/retargeting-sdk/lib/Javascript/Item/ProductComment.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woocommerce-retargeting/vendor/retargeting/retargeting-sdk/tests/Unit/BrandTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woocommerce-retargeting/vendor/retargeting/retargeting-sdk/tests/Unit/OrderTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'RetargetingSDK\\Helpers\\AbstractHelper' not found in wp-content/plugins/woocommerce-retargeting/vendor/retargeting/retargeting-sdk/lib/Helpers/VariationsHelper.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_url() in wp-content/plugins/woocommerce-retargeting/includes/class-rtg-integration.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'RetargetingSDK\\Javascript\\Item\\AbstractItem' not found in wp-content/plugins/woocommerce-retargeting/vendor/retargeting/retargeting-sdk/lib/Javascript/Item/PageHome.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'RetargetingSDK\\Javascript\\Item\\AbstractItem' not found in wp-content/plugins/woocommerce-retargeting/vendor/retargeting/retargeting-sdk/lib/Javascript/Item/Email.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: retargeting, woocommerce

woocommerce-retargeting/woocommerce-retargeting.php 85% from 13 tests

The main PHP script in "WooCommerce Retargeting" version 3.1.0 is automatically included on every request by WordPress
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.6" instead of "4.0.0")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin4,807 lines of code in 82 files:
LanguageFilesBlank linesComment linesLines of code
PHP741,0202,3354,476
Markdown3370213
JSON30097
XML13021
JavaScript12770

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.85
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity1.91
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces8
Interfaces1
Traits0
Classes67
▷ Abstract classes34.48%
▷ Concrete classes6495.52%
▷ Final classes914.06%
Methods439
▷ Static methods245.47%
▷ Public methods40291.57%
▷ Protected methods163.64%
▷ Private methods214.78%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants13
▷ Global constants215.38%
▷ Class constants1184.62%
▷ Public constants11100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.29MB with 0.22MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png13.58KB4.45KB▼ 67.26%
assets/icon-256x256.png20.07KB6.54KB▼ 67.41%
(invalid) assets/banner-772x250.png260.31KB0.00KB▼ 100.00%