84% image-widget

Code Review | Image Widget

WordPress plugin Image Widget scored84%from 54 tests.

About plugin

  • Plugin page: image-widget
  • Plugin version: 4.4.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 26, 2008
  • Latest release: May 31, 2023
  • Number of updates: 234
  • Update frequency: every 23.2 days
  • Top authors: peterchester (69.23%)zbtirrell (8.97%)mattwiebe (7.26%)borkweb (6.84%)barry.hughes (3.42%)

Code review

54 tests

User reviews

288 reviews

Install metrics

100,000+ active /4,403,034 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼2.85ms] Passed 4 tests

Analyzing server-side resources used by Image Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0749.59 ▲3.03
Dashboard /wp-admin3.37 ▲0.0748.51 ▲1.27
Posts /wp-admin/edit.php3.42 ▲0.0748.86 ▼6.12
Add New Post /wp-admin/post-new.php5.95 ▲0.0792.98 ▼8.31
Media Library /wp-admin/upload.php3.30 ▲0.0738.79 ▲1.76

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_widget_sp_image
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Image Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.72 ▲0.472.55 ▲0.7245.16 ▲1.81
Dashboard /wp-admin2,189 ▲155.67 ▲0.0892.69 ▲3.0844.97 ▼0.56
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0539.87 ▼2.4335.79 ▼5.66
Add New Post /wp-admin/post-new.php1,537 ▼118.11 ▼4.91653.03 ▲5.4570.43 ▲13.66
Media Library /wp-admin/upload.php1,397 ▼34.21 ▲0.00101.80 ▼10.8046.39 ▼0.52

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_widget_sp_image
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

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 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
Almost there! Just fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/image-widget/image-widget.php
    • > /wp-content/plugins/image-widget/views/widget-admin.deprecated.php
    • > /wp-content/plugins/image-widget/views/widget-admin.php
    • > /wp-content/plugins/image-widget/views/widget.php

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

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #2, #3 in image-widget/assets to your readme.txt
The official readme.txt might help

image-widget/image-widget.php Passed 13 tests

"Image Widget" version 4.4.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
101 characters long description:
A simple image widget that uses the native WordPress media manager to add image widgets to your site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin768 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6126196516
JavaScript35859232
CSS13020

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity43.00
▷ Minimum class complexity30.00
▷ Maximum class complexity56.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods313.04%
▷ Public methods1773.91%
▷ Protected methods00.00%
▷ Private methods626.09%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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 images were found in this plugin