84% genesis-simple-hooks

Code Review | Genesis Simple Hooks

WordPress plugin Genesis Simple Hooks scored84%from 54 tests.

About plugin

  • Plugin page: genesis-simple-hooks
  • Plugin version: 2.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.2-6.3
  • WordPress version: 6.3.1
  • First release: Apr 26, 2010
  • Latest release: Aug 7, 2023
  • Number of updates: 36
  • Update frequency: every 134.8 days
  • Top authors: nathanrice (83.33%)studiopress (16.67%)Nick_theGeek (5.56%)

Code review

54 tests

User reviews

22 reviews

Install metrics

40,000+ active /774,133 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.07ms] Passed 4 tests

An overview of server-side resources used by Genesis Simple Hooks
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0238.70 ▼2.62
Dashboard /wp-admin3.37 ▼0.0251.06 ▼12.56
Posts /wp-admin/edit.php3.49 ▲0.0952.70 ▲0.03
Add New Post /wp-admin/post-new.php5.96 ▲0.0290.14 ▼9.11
Media Library /wp-admin/upload.php3.30 ▲0.0236.16 ▲1.13

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Genesis Simple Hooks
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.35 ▼0.001.75 ▼0.1140.91 ▲1.43
Dashboard /wp-admin2,195 ▲185.55 ▼0.1286.76 ▼9.8242.81 ▲3.42
Posts /wp-admin/edit.php2,106 ▲32.02 ▼0.0035.26 ▼3.1239.19 ▲1.52
Add New Post /wp-admin/post-new.php1,532 ▲423.09 ▲0.02667.70 ▼28.9756.95 ▲8.16
Media Library /wp-admin/upload.php1,409 ▲94.17 ▼0.0495.22 ▼21.0043.79 ▼4.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

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
Good news, no errors were detected

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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/genesis-simple-hooks/plugin.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/genesis-simple-hooks/genesis-simple-hooks.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Genesis_Admin_Boxes' not found in wp-content/plugins/genesis-simple-hooks/includes/class-genesis-simple-hooks-admin.php:14

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 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === genesis-simple-hooks === )
You can take inspiration from this readme.txt

genesis-simple-hooks/plugin.php 92% from 13 tests

"Genesis Simple Hooks" version 2.3.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("genesis-simple-hooks.php" instead of "plugin.php")

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
Everything looks great! No dangerous files found in this plugin733 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP6210419582
JavaScript116872
JSON30060
YAML13019

PHP code Passed 2 tests

Analyzing 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.19
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity1.76
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected