80% wp-widget-gallery

Code Review | WP Widget Gallery

WordPress plugin WP Widget Gallery scored80%from 54 tests.

About plugin

  • Plugin page: wp-widget-gallery
  • Plugin version: 1.5.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.9.1
  • WordPress version: 6.3.1
  • First release: Jun 28, 2013
  • Latest release: May 22, 2015
  • Number of updates: 30
  • Update frequency: every 23.1 days
  • Top authors: eyouth.ace (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

300+ active /15,200 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼1.71MB] [CPU: ▼47.11ms] Passed 4 tests

An overview of server-side resources used by WP Widget Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.188.99 ▼30.40
Dashboard /wp-admin2.29 ▼1.0111.38 ▼40.43
Posts /wp-admin/edit.php2.29 ▼1.0610.64 ▼41.15
Add New Post /wp-admin/post-new.php2.29 ▼3.5910.62 ▼76.47
Media Library /wp-admin/upload.php2.29 ▼0.948.64 ▼27.02

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 57 new files
Database: no new tables, 7 new options
New WordPress options
widget_wpwidget_media_gallery
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

WP Widget Gallery: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.071.66 ▼0.0844.00 ▼2.33
Dashboard /wp-admin2,195 ▲155.64 ▲0.0893.19 ▲0.7043.13 ▲2.63
Posts /wp-admin/edit.php2,100 ▲31.98 ▼0.1335.87 ▼6.0935.23 ▼2.48
Add New Post /wp-admin/post-new.php1,528 ▼023.26 ▲0.13682.50 ▼10.2461.13 ▲6.45
Media Library /wp-admin/upload.php1,394 ▼94.23 ▼0.00101.95 ▼2.9349.04 ▲4.08

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in wpwidget_media_gallery is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_wpwidget_media_gallery
    • can_compress_scripts

Smoke tests Passed 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)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: widget gallery, widget, sidebar, gallery, wp-widget...

wp-widget-gallery/wpwidgetgallery.php 92% from 13 tests

Analyzing the main PHP file in "WP Widget Gallery" version 1.5.3
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-widget-gallery.php" instead of "wpwidgetgallery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected1,176 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
CSS312771657
PHP27544394
JavaScript72361125

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity54.00
▷ Minimum class complexity54.00
▷ Maximum class complexity54.00
Average method complexity14.25
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
32 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/prettyPhoto/facebook/contentPatternRight.png0.13KB0.10KB▼ 24.26%
images/prettyPhoto/facebook/contentPatternTop.png0.14KB0.11KB▼ 21.13%
images/prettyPhoto/default/sprite_y.png1.13KB0.13KB▼ 88.81%
images/prettyPhoto/facebook/contentPatternBottom.png0.14KB0.11KB▼ 21.13%
images/prettyPhoto/dark_rounded/sprite.png3.98KB2.56KB▼ 35.79%