90% wpb-image-widget

Code Review | WPB Image Widget

WordPress plugin WPB Image Widget scored 90% from 54 tests.

About plugin

  • Plugin page: wpb-image-widget
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.6
  • WordPress version: 6.3.1
  • First release: Mar 21, 2016
  • Latest release: May 20, 2018
  • Number of updates: 4
  • Update frequency: every 197.5 days
  • Top authors: wpbean (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 3,181 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

An overview of server-side resources used by WPB Image Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0646.45 ▼2.14
Dashboard /wp-admin3.38 ▲0.0855.37 ▲5.79
Posts /wp-admin/edit.php3.50 ▲0.1551.29 ▲6.85
Add New Post /wp-admin/post-new.php5.97 ▲0.08137.02 ▲48.65
Media Library /wp-admin/upload.php3.29 ▲0.0636.15 ▲1.69

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_wpb_iw_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for WPB Image Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,943 ▲19714.76 ▲0.581.72 ▼0.2743.22 ▼2.91
Dashboard /wp-admin2,350 ▲1656.42 ▲0.56133.61 ▲15.8042.23 ▼0.76
Posts /wp-admin/edit.php2,256 ▲1673.33 ▲1.3052.81 ▲12.5931.36 ▼13.52
Add New Post /wp-admin/post-new.php1,518 ▼1523.21 ▼0.10622.24 ▼81.8534.78 ▼29.22
Media Library /wp-admin/upload.php1,394 ▲94.14 ▼0.0781.31 ▼34.7343.28 ▼3.19

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • widget_wpb_iw_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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 SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: image widget, image, wpb image widget, upload image in widget, widget...

wpb-image-widget/main.php 92% from 13 tests

The main file in "WPB Image Widget" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wpb-image-widget.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected308 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP47876228
CSS23160
JavaScript19020

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity52.00
▷ Minimum class complexity52.00
▷ Maximum class complexity52.00
Average method complexity9.50
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods583.33%
▷ Protected methods116.67%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin