90% responsive-lightbox2

Code Review | Responsive Lightbox2

WordPress plugin Responsive Lightbox2 scored90%from 54 tests.

About plugin

  • Plugin page: responsive-lightbox2
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1
  • WordPress version: 6.3.1
  • First release: May 20, 2016
  • Latest release: Nov 14, 2022
  • Number of updates: 10
  • Update frequency: every 236.9 days
  • Top authors: naa986 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active /8,430 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼1.23ms] Passed 4 tests

This is a short check of server-side resources used by Responsive Lightbox2
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.73 ▼0.93
Dashboard /wp-admin3.34 ▲0.0350.90 ▲5.29
Posts /wp-admin/edit.php3.39 ▲0.0345.84 ▼1.37
Add New Post /wp-admin/post-new.php5.92 ▲0.0382.29 ▼2.39
Media Library /wp-admin/upload.php3.26 ▲0.0338.25 ▼0.23
Lightbox2 /wp-admin/options-general.php?page=responsive-lightbox2-settings3.2329.27

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Responsive Lightbox2
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,954 ▲19313.70 ▼0.9411.60 ▲10.0347.26 ▲5.47
Dashboard /wp-admin2,199 ▲225.61 ▲0.0593.02 ▲8.4541.48 ▲1.79
Posts /wp-admin/edit.php2,104 ▲71.95 ▲0.0133.15 ▼1.0233.28 ▼4.43
Add New Post /wp-admin/post-new.php1,531 ▼722.99 ▼0.16664.75 ▼30.4161.33 ▲4.57
Media Library /wp-admin/upload.php1,407 ▲44.18 ▲0.00109.00 ▲7.5546.69 ▲1.60
Lightbox2 /wp-admin/options-general.php?page=responsive-lightbox2-settings7702.0222.3925.97

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The SRP test was a success

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

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: lightbox, gallery, photos, images, responsive

responsive-lightbox2/main.php 92% from 13 tests

The main PHP script in "Responsive Lightbox2" version 1.0.4 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("responsive-lightbox2.php" instead of "main.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
Everything looks great! No dangerous files found in this plugin653 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript176105373
CSS1273174
PHP11611106

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of 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.24
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/close.png0.27KB0.29KB0.00%
images/next.png1.32KB1.58KB0.00%
images/prev.png1.33KB1.59KB0.00%