84% hw-image-widget

Code Review | HW Image Widget

WordPress plugin HW Image Widget scored84%from 54 tests.

About plugin

  • Plugin page: hw-image-widget
  • Plugin version: 4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.2.1
  • WordPress version: 6.3.1
  • First release: Mar 10, 2013
  • Latest release: Apr 28, 2015
  • Number of updates: 72
  • Update frequency: every 10.8 days
  • Top authors: PuffyThePirateBoy (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

2,000+ active /38,087 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
Install script ran successfully

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

An overview of server-side resources used by HW Image Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0237.10 ▼4.41
Dashboard /wp-admin3.32 ▲0.0248.74 ▲0.48
Posts /wp-admin/edit.php3.37 ▲0.0247.55 ▼5.00
Add New Post /wp-admin/post-new.php5.90 ▲0.0281.01 ▼11.41
Media Library /wp-admin/upload.php3.24 ▲0.0234.96 ▲3.20

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

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

Browser metrics Passed 4 tests

A check of browser resources used by HW Image Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.73 ▼0.654.35 ▲2.2843.33 ▼2.77
Dashboard /wp-admin2,209 ▲214.84 ▼0.1098.52 ▼3.3236.34 ▼5.78
Posts /wp-admin/edit.php2,089 ▲31.99 ▼0.0434.30 ▼5.8833.03 ▼4.71
Add New Post /wp-admin/post-new.php1,533 ▲523.14 ▲4.92670.13 ▲57.8855.95 ▼23.28
Media Library /wp-admin/upload.php1,382 ▼94.28 ▼0.0294.99 ▼5.9141.49 ▼3.01

Uninstaller [IO: ▲0.00MB] [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
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_hwim
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • 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)
Even though everything seems fine, this is not an exhaustive test

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
  • 8× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/hw-image-widget/html/hwim-template.php on line 59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/hw-image-widget/html/back-end.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/hw-image-widget/hw-image-widget.php:36
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/hw-image-widget/html/hwim-template.php on line 3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/hw-image-widget/html/hwim-template.php on line 3
    • > PHP Notice
      Undefined variable: div_id in wp-content/plugins/hw-image-widget/html/back-end.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/hw-image-widget/html/text-editor.php:91
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/hw-image-widget/html/hwim-template.php on line 59

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: image, widget, responsive, image widget

hw-image-widget/hw-image-widget.php 92% from 13 tests

This is the main PHP file of "HW Image Widget" version 4.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 323 characters long)

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
Success! There were no dangerous files found in this plugin759 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP45466536
JavaScript13511157
PO File1263566

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods1270.59%
▷ Protected methods529.41%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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