83% woo-simple-hooks

Code Review | Simple Hooks for WooCommerce

WordPress plugin Simple Hooks for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: woo-simple-hooks
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.7.1
  • WordPress version: 6.3.1
  • First release: Aug 23, 2018
  • Latest release: May 2, 2021
  • Number of updates: 22
  • Update frequency: every 44.7 days
  • Top authors: femiyb (90.91%)devlloplugins (13.64%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /3,607 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.23MB] [CPU: ▼7.13ms] Passed 4 tests

Analyzing server-side resources used by Simple Hooks for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2436.94 ▼3.42
Dashboard /wp-admin3.55 ▲0.2146.21 ▼12.35
Posts /wp-admin/edit.php3.67 ▲0.3141.33 ▼7.71
Add New Post /wp-admin/post-new.php6.13 ▲0.2583.39 ▼5.05
Media Library /wp-admin/upload.php3.47 ▲0.2537.68 ▲2.39

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Simple Hooks for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3413.92 ▼0.501.84 ▲0.0437.34 ▼5.78
Dashboard /wp-admin2,204 ▲305.57 ▼0.0986.31 ▼28.3936.13 ▼15.15
Posts /wp-admin/edit.php2,107 ▲42.01 ▲0.0036.15 ▼7.7934.19 ▼4.36
Add New Post /wp-admin/post-new.php1,534 ▲623.47 ▲0.55598.92 ▼14.9844.27 ▼16.41
Media Library /wp-admin/upload.php1,406 ▲64.21 ▲0.0198.10 ▼9.5641.07 ▼3.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/woo-simple-hooks/woocommerce-simple-hooks.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Simple Hooks Settings Page), #2 (Shop Page with Simple Hooks)
Please take inspiration from this readme.txt

woo-simple-hooks/woocommerce-simple-hooks.php 85% from 13 tests

The main PHP script in "Simple Hooks for WooCommerce" version 1.1.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 152 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woo-simple-hooks.php" instead of "woocommerce-simple-hooks.php")

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 detected759 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2127175574
PO File18282185

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods73
▷ Static methods00.00%
▷ Public methods7298.63%
▷ Protected methods00.00%
▷ Private methods11.37%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.42MB with 0.29MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png214.24KB55.27KB▼ 74.20%
screenshot-1.png200.14KB53.46KB▼ 73.29%
icon-256x256.png19.56KB8.81KB▼ 54.95%