84% random-image-light-box

Code Review | Random image light box

WordPress plugin Random image light box scored84%from 54 tests.

About plugin

  • Plugin page: random-image-ligh...
  • Plugin version: 1.3
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Oct 18, 2020
  • Latest release: Dec 1, 2022
  • Number of updates: 9
  • Update frequency: every 86.7 days
  • Top authors: gopiplus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /817 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.47ms] Passed 4 tests

A check of server-side resources used by Random image light box
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.1037.65 ▼8.09
Dashboard /wp-admin3.39 ▲0.0945.97 ▼0.58
Posts /wp-admin/edit.php3.50 ▲0.1547.48 ▼0.66
Add New Post /wp-admin/post-new.php5.97 ▲0.0984.97 ▼4.53
Media Library /wp-admin/upload.php3.31 ▲0.0937.79 ▲1.94
Random image /wp-admin/options-general.php?page=random-image-light-box3.3031.18

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 25 new files
Database: 1 new table, 8 new options
New tables
wp_randomimage_lb
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
random-image-light-box
widget_random-image-light-box
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Random image light box
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,965 ▲20814.00 ▼0.7510.97 ▲8.8442.40 ▲1.97
Dashboard /wp-admin2,213 ▲314.85 ▼1.01108.15 ▲6.5438.99 ▼4.20
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0236.61 ▼0.3334.18 ▼1.13
Add New Post /wp-admin/post-new.php1,517 ▼1717.66 ▼5.48727.19 ▲131.4357.50 ▲7.62
Media Library /wp-admin/upload.php1,392 ▲74.19 ▲0.0095.44 ▼9.4040.20 ▼4.74
Random image /wp-admin/options-general.php?page=random-image-light-box9272.0527.1828.89

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_random-image-light-box
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Please fix the following items
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/random-image-light-box/random-image-light-box.php
    • > /wp-content/plugins/random-image-light-box/pages/image-management-edit.php
    • > /wp-content/plugins/random-image-light-box/pages/image-management-add.php
    • > /wp-content/plugins/random-image-light-box/pages/image-management-show.php

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

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: widget, plugin, gallery, random, light box...

random-image-light-box/random-image-light-box.php Passed 13 tests

The main PHP file in "Random image light box" ver. 1.3 adds more information about the plugin and also serves as the entry point for this plugin
112 characters long description:
Random image light box plugin allows you to show one random image with on click light box effect in the website.

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
Success! There were no dangerous files found in this plugin1,556 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP714041865
JavaScript280105416
CSS1273174
PO File14364101

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity15.50
▷ Minimum class complexity11.00
▷ Maximum class complexity23.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods25
▷ Static methods1976.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/close.png0.27KB0.29KB0.00%
inc/image-icon.png2.98KB0.54KB▼ 81.86%
images/prev.png1.33KB1.59KB0.00%
images/next.png1.32KB1.58KB0.00%