84% image-widget-rb

Code Review | Image Widget

WordPress plugin Image Widget scored 84% from 54 tests.

About plugin

  • Plugin page: image-widget-rb
  • Plugin version: 1.0.10
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.2
  • WordPress version: 6.3.1
  • First release: Jul 18, 2018
  • Latest release: May 19, 2023
  • Number of updates: 13
  • Update frequency: every 135.9 days
  • Top authors: rbplugins (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

5,000+ active / 39,243 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
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Image Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.66 ▲0.57
Dashboard /wp-admin3.32 ▲0.0246.74 ▼7.41
Posts /wp-admin/edit.php3.37 ▲0.0247.88 ▼1.04
Add New Post /wp-admin/post-new.php5.90 ▲0.0297.38 ▲1.51
Media Library /wp-admin/upload.php3.24 ▲0.0234.89 ▼1.74

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
rb-image-widget-install
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_rbimagewidget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Image Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.26 ▼1.434.41 ▲2.5044.44 ▼6.86
Dashboard /wp-admin2,203 ▲155.86 ▲0.98104.77 ▼12.5741.68 ▼4.85
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0539.67 ▲3.3635.40 ▼2.69
Add New Post /wp-admin/post-new.php1,547 ▲1418.32 ▼4.69625.27 ▲31.0967.76 ▲9.64
Media Library /wp-admin/upload.php1,382 ▼64.20 ▲0.0699.34 ▼8.0141.29 ▼1.42

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
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_rbimagewidget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/image-widget-rb/widget.php:8

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 errors were detected

Optimizations

Plugin configuration Passed 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
5 plugin tags: sidebar, image widget, image, gallery widget, widget

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

The entry point to "Image Widget" version 1.0.10 is a PHP file that has certain tags in its header comment area
63 characters long description:
Most simple and fast way to create image widget to your sidebar

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
Everything looks great! No dangerous files found in this plugin1,407 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript3174110709
CSS1303262
PHP57435236
PO File36060199
SVG1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity9.33
▷ Minimum class complexity2.00
▷ Maximum class complexity21.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods18
▷ Static methods316.67%
▷ Public methods1583.33%
▷ Protected methods00.00%
▷ Private methods316.67%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/css/images/icons.png0.71KB0.43KB▼ 39.64%