83% hooks

Code Review | hooks

WordPress plugin hooks scored83%from 54 tests.

About plugin

  • Plugin page: hooks
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.2.2
  • WordPress version: 6.3.1
  • First release: May 21, 2014
  • Latest release: Nov 1, 2016
  • Number of updates: 4
  • Update frequency: every 223.8 days
  • Top authors: Dejan Batanjac (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,775 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
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by hooks
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.56 ▼0.49
Dashboard /wp-admin3.33 ▲0.0344.14 ▼2.43
Posts /wp-admin/edit.php3.46 ▲0.1071.59 ▲21.28
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.14 ▼18.11
Media Library /wp-admin/upload.php3.25 ▲0.0237.45 ▲4.05
Hooks List /wp-admin/plugins.php?page=hooks3.2228.80

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
DB_Plugin_Hooks
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for hooks
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4714.48 ▲1.361.89 ▼3.5040.36 ▼2.29
Dashboard /wp-admin2,207 ▲194.85 ▼0.03101.41 ▼12.3041.19 ▼2.65
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0340.26 ▼2.0536.57 ▲1.44
Add New Post /wp-admin/post-new.php1,517 ▼2517.56 ▼0.70661.03 ▲45.0750.91 ▼2.51
Media Library /wp-admin/upload.php1,392 ▲44.22 ▲0.0595.42 ▼10.8241.52 ▼4.58
Hooks List /wp-admin/plugins.php?page=hooks8042.0224.0826.80

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • DB_Plugin_Hooks
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/hooks/hooks.php:36

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Please describe screenshot #2 in hooks/assets to your readme.txt
You can look at the official readme.txt

hooks/hooks.php 77% from 13 tests

"hooks" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path should be prefixed with a forward slash character ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin42 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13411242

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity1.89
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected