84% handy-custom-fields

Code Review | Handy Custom Fields

WordPress plugin Handy Custom Fields scored 84% from 54 tests.

About plugin

  • Plugin page: handy-custom-fields
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.1-5.2.1
  • WordPress version: 6.3.1
  • First release: May 23, 2019
  • Latest release: May 23, 2019
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: 526m (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 485 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
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.31ms] Passed 4 tests

Analyzing server-side resources used by Handy Custom Fields
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0145.05 ▲1.91
Dashboard /wp-admin3.31 ▲0.0053.42 ▲1.11
Posts /wp-admin/edit.php3.36 ▲0.0054.76 ▼11.79
Add New Post /wp-admin/post-new.php5.89 ▲0.01102.98 ▲5.42
Media Library /wp-admin/upload.php3.23 ▲0.0039.23 ▼0.47

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Handy Custom Fields
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲3013.20 ▼0.092.05 ▼0.1241.32 ▼3.93
Dashboard /wp-admin2,222 ▲164.87 ▲0.07107.04 ▼4.1137.65 ▼3.97
Posts /wp-admin/edit.php2,105 ▲192.04 ▲0.0342.75 ▲2.9235.70 ▲0.54
Add New Post /wp-admin/post-new.php6,473 ▲4,93920.49 ▼2.66900.80 ▲301.6355.47 ▲1.73
Media Library /wp-admin/upload.php1,404 ▲224.24 ▲0.0495.11 ▼3.7440.47 ▼2.82

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 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/handy-custom-fields/HCF.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/handy-custom-fields/includes/HCF-functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/handy-custom-fields/includes/index.php:18

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)
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: additional fields, custom fields

handy-custom-fields/HCF.php 92% from 13 tests

Analyzing the main PHP file in "Handy Custom Fields" version 1.1
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("handy-custom-fields.php" instead of "HCF.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin115 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP31419115

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin