84% hydrogen-directory

Code Review | Hydrogen Directory

WordPress plugin Hydrogen Directory scored 84% from 54 tests.

About plugin

  • Plugin page: hydrogen-directory
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Jun 29, 2021
  • Latest release: May 16, 2022
  • Number of updates: 12
  • Update frequency: every 26.8 days
  • Top authors: lbell (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 486 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.64ms] Passed 4 tests

Server-side resources used by Hydrogen Directory
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.44 ▼9.10
Dashboard /wp-admin3.34 ▲0.0461.61 ▲2.00
Posts /wp-admin/edit.php3.39 ▲0.0450.09 ▼5.19
Add New Post /wp-admin/post-new.php5.93 ▲0.04106.91 ▲1.73
Media Library /wp-admin/upload.php3.27 ▲0.0440.88 ▲2.46
New Entry /wp-admin/post-new.php?post_type=hy_directory3.3965.60
Roles /wp-admin/edit-tags.php?taxonomy=role&post_type=hy_directory3.2641.53
Directory Help /wp-admin/edit.php?post_type=hy_directory&page=directory_help3.2339.57
All Entries /wp-admin/edit.php?post_type=hy_directory3.3146.72

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Hydrogen Directory
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲6313.21 ▼1.044.85 ▲2.8346.82 ▼1.63
Dashboard /wp-admin2,266 ▲604.84 ▼0.17105.38 ▼17.1637.30 ▼6.86
Posts /wp-admin/edit.php2,153 ▲642.05 ▲0.0342.58 ▲7.1335.90 ▲2.82
Add New Post /wp-admin/post-new.php1,559 ▲4023.19 ▲0.20694.17 ▼4.4250.67 ▼3.34
Media Library /wp-admin/upload.php1,448 ▲634.18 ▼0.03134.22 ▲25.3449.63 ▲7.67
New Entry /wp-admin/post-new.php?post_type=hy_directory2,3477.61205.8872.34
Roles /wp-admin/edit-tags.php?taxonomy=role&post_type=hy_directory1,3222.1529.3829.50
Directory Help /wp-admin/edit.php?post_type=hy_directory&page=directory_help1,0682.0634.0145.97
All Entries /wp-admin/edit.php?post_type=hy_directory1,1242.1541.6433.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/hydrogen-directory/templates/directory-list-entry-card.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/hydrogen-directory/templates/directory-list-entry-text.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/hydrogen-directory/templates/directory-single.php:3
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/hydrogen-directory/templates/directory-list-entry-list.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_permalink() in wp-content/plugins/hydrogen-directory/templates/directory-list-entry-list.php:8
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/hydrogen-directory/templates/directory-list-entry-list.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hydrogen-directory/init/admin/position-meta-box.php:67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/hydrogen-directory/templates/directory-single-content.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/hydrogen-directory/init/templates.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hydrogen-directory/init/init.php:160

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: directory, people list, church, officers, student...

hydrogen-directory/hydrogen-directory.php 92% from 13 tests

This is the main PHP file of "Hydrogen Directory" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin967 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP17175250707
CSS34618243
SVG30017

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png24.13KB8.99KB▼ 62.74%