84% simple-woocommerce-favourites

Code Review | Simple Woocommerce Favourites

WordPress plugin Simple Woocommerce Favourites scored84%from 54 tests.

About plugin

  • Plugin page: simple-woocommerc...
  • Plugin version: 2.1.3
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 23, 2017
  • Latest release: Oct 9, 2023
  • Number of updates: 23
  • Update frequency: every 103.8 days
  • Top authors: jonboss (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /5,132 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Analyzing server-side resources used by Simple Woocommerce Favourites
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.76 ▼0.28
Dashboard /wp-admin3.32 ▲0.0250.43 ▲3.64
Posts /wp-admin/edit.php3.37 ▲0.0247.36 ▼5.16
Add New Post /wp-admin/post-new.php5.90 ▲0.0284.50 ▼18.87
Media Library /wp-admin/upload.php3.25 ▲0.0237.26 ▲1.85

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Woocommerce Favourites
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲11413.37 ▼0.908.55 ▲6.9541.31 ▼1.06
Dashboard /wp-admin2,195 ▲185.63 ▼0.0088.73 ▼1.0639.01 ▼5.34
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0039.20 ▼2.3334.52 ▼5.05
Add New Post /wp-admin/post-new.php1,526 ▼223.49 ▲0.33685.62 ▲80.4552.54 ▼2.22
Media Library /wp-admin/upload.php1,403 ▲124.21 ▲0.09103.75 ▲3.5948.50 ▲5.90

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_id() on null in wp-content/plugins/simple-woocommerce-favourites/views/add-to-favourites-button.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_permalink() in wp-content/plugins/simple-woocommerce-favourites/views/favourites-template.php:18
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/simple-woocommerce-favourites/views/favourites-template.php on line 2
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/simple-woocommerce-favourites/views/favourites-template.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Requires at least: Invalid plugin version format
You can look at the official readme.txt

simple-woocommerce-favourites/simple-woocommerce-favourites.php Passed 13 tests

Analyzing the main PHP file in "Simple Woocommerce Favourites" version 2.1.3
90 characters long description:
Manages a simple list of favourite products for each user and displays it with a shortcode

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected414 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP9113128320
JavaScript14044
Sass15027
CSS11123

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity3.80
▷ Minimum class complexity2.00
▷ Maximum class complexity5.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods25
▷ Static methods25100.00%
▷ Public methods2184.00%
▷ Protected methods00.00%
▷ Private methods416.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin