78% hatchbuck

Code Review | Hatchbuck

WordPress plugin Hatchbuck scored 78% from 54 tests.

About plugin

  • Plugin page: hatchbuck
  • Plugin version: 1.4.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.0.2
  • WordPress version: 5.8.1
  • First release: Jan 8, 2015
  • Latest release: Dec 23, 2018
  • Number of updates: 47
  • Update frequency: every 30.8 days
  • Top authors: projectarmy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,868 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼145.60ms] Passed 4 tests

Server-side resources used by Hatchbuck
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.1629.88 ▲7.68
Dashboard /wp-admin3.16 ▲0.1043.16 ▲0.81
Posts /wp-admin/edit.php3.24 ▲0.1435.04 ▼10.24
Add New Post /wp-admin/post-new.php5.76 ▲0.3380.76 ▼564.92
Media Library /wp-admin/upload.php3.12 ▲0.1130.44 ▼8.04
Addons /wp-admin/admin.php?page=hatchbuck-addons3.1130.91
Help /wp-admin/admin.php?page=hatchbuck-help3.0749.56
Settings /wp-admin/admin.php?page=hatchbuck-settings3.0931.79
Forms /wp-admin/admin.php?page=hatchbuck-manage3.1031.87

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 89 new files
Database: 1 new table, 4 new options
New tables
wp_hatchbuck_shortcode
New WordPress options
hatchbuck_limit
hatchbuck_postTypeTc
hatchbuck_addons_metabox
hatchbuck_help_script

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hatchbuck
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,847 ▲25216.09 ▲0.638.04 ▼0.2549.15 ▲3.23
Dashboard /wp-admin3,077 ▲1467.02 ▲0.82140.17 ▼4.38126.13 ▲18.73
Posts /wp-admin/edit.php2,870 ▲1312.78 ▲0.1164.86 ▲2.27120.76 ▲37.09
Add New Post /wp-admin/post-new.php2,397 ▲71425.25 ▲6.46394.77 ▲27.00134.29 ▲23.82
Media Library /wp-admin/upload.php1,858 ▲515.44 ▲0.45129.34 ▼21.78132.57 ▲10.30
Addons /wp-admin/admin.php?page=hatchbuck-addons1,5443.1166.6181.74
Help /wp-admin/admin.php?page=hatchbuck-help2,92117.84484.65114.03
Settings /wp-admin/admin.php?page=hatchbuck-settings1,5093.2666.05102.61
Forms /wp-admin/admin.php?page=hatchbuck-manage1,4013.2564.1892.91

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • hatchbuck_help_script

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/hatchbuck/admin/header.php
    • > /wp-content/plugins/hatchbuck/admin/sidebar.php
    • > /wp-content/plugins/hatchbuck/admin/footer.php
  • 32× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/hatchbuck/admin/addons/addons-view/addons-view.php:79
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/hatchbuck/admin/addons/addons.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function stripslashes_deep() in wp-content/plugins/hatchbuck/admin/snippet-status.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hatchbuck/admin/ajax-backlink.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hatchbuck/add_shortcode_tynimce.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/hatchbuck/admin/settings.php:72
    • > PHP Fatal error
      Uncaught Error: Call to undefined function stripslashes_deep() in wp-content/plugins/hatchbuck/admin/snippets.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hatchbuck/hatchbuck-functions.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hatchbuck/hatchbuck-admin-menu.php:2
    • > PHP Warning
      Use of undefined constant PLUGIN_NAME - assumed 'PLUGIN_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/hatchbuck/admin/header.php on line 19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
Please take inspiration from this readme.txt

hatchbuck/hatchbuck.php 85% from 13 tests

"Hatchbuck" version 1.4.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Description: The description should be shorter than 140 characters (currently 171 characters long)

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
There were no executable files found in this plugin2,558 lines of code in 77 files:
LanguageFilesBlank linesComment linesLines of code
PHP344231771,987
CSS2443288
JavaScript374335244
Sass33138
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity6.00
▷ Minimum class complexity5.00
▷ Maximum class complexity7.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions41
▷ Named functions4097.56%
▷ Anonymous functions12.44%
Constants4
▷ Global constants4100.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
6 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/addons/addons-view/image/form-widget-screenshot.png4.85KB3.63KB▼ 25.12%
images/hb-scroll-box-thumb.png23.16KB9.26KB▼ 60.00%
admin/addons/addons-view/image/gutenberg-block.png1.53KB0.36KB▼ 76.53%
admin/addons/addons-view/image/scroll-box-screenshot.png5.82KB2.63KB▼ 54.92%
images/hb-tutorial-thumb.png21.97KB8.86KB▼ 59.67%