78% hao-image-box

Code Review | Hao Image Box

WordPress plugin Hao Image Box scored78%from 54 tests.

About plugin

  • Plugin page: hao-image-box
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.2.4
  • WordPress version: 6.3.1
  • First release: Nov 16, 2019
  • Latest release: Nov 16, 2019
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: haozhuti2019 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /749 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.06ms] Passed 4 tests

Analyzing server-side resources used by Hao Image Box
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.84 ▲3.16
Dashboard /wp-admin3.34 ▲0.0356.65 ▲2.55
Posts /wp-admin/edit.php3.39 ▲0.0355.54 ▼1.22
Add New Post /wp-admin/post-new.php5.92 ▲0.0388.40 ▼6.69
Media Library /wp-admin/upload.php3.26 ▲0.0335.62 ▼6.88
hao image box 设置 /wp-admin/options-general.php?page=hao-image-box3.2035.85

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Hao Image Box
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.24 ▼0.381.90 ▼0.4045.38 ▼0.51
Dashboard /wp-admin2,199 ▲195.65 ▼0.00121.77 ▲25.4450.87 ▲10.98
Posts /wp-admin/edit.php2,104 ▲12.00 ▲0.0341.97 ▲1.8039.64 ▲6.54
Add New Post /wp-admin/post-new.php1,529 ▲323.08 ▲2.05664.30 ▼119.1355.68 ▼8.89
Media Library /wp-admin/upload.php1,404 ▲44.30 ▲0.02105.35 ▼22.9145.85 ▼4.41
hao image box 设置 /wp-admin/options-general.php?page=hao-image-box8642.0024.9171.86

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • theysaidso_admin_options
    • hao_image_box_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=hao-image-box
    • > Warning in wp-admin/includes/template.php+1771
    call_user_func() expects parameter 1 to be a valid callback, function 'sandbox_general_options_callback' not found or invalid function name

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hao-image-box/inc/hao-image-view.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/hao-image-box/hao-image-box.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hao-image-box/inc/hao-image-setting.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Contributors: Contributors not specified
  • Contributors: Please add at least on tag
The official readme.txt might help

hao-image-box/hao-image-box.php 92% from 13 tests

Analyzing the main PHP file in "Hao Image Box" version 1.0
Please take the time to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("3.9.0" instead of "5.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected461 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP33514249
CSS1287211
JavaScript1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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