89% responsive-lightbox

Code Review | Responsive Lightbox & Gallery

WordPress plugin Responsive Lightbox & Gallery scored89%from 54 tests.

About plugin

  • Plugin page: responsive-lightbox
  • Plugin version: 2.4.6
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 8, 2013
  • Latest release: Nov 24, 2023
  • Number of updates: 192
  • Update frequency: every 19.8 days
  • Top authors: dfactory (100%)

Code review

54 tests

User reviews

1916 reviews

Install metrics

200,000+ active /5,012,009 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲3.00MB] [CPU: ▲25.03ms] 75% from 4 tests

Analyzing server-side resources used by Responsive Lightbox & Gallery
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,020.63ms on /wp-admin/admin.php?page=responsive-lightbox-addons)
PageMemory (MB)CPU Time (ms)
Home /6.27 ▲2.8158.66 ▲14.05
Dashboard /wp-admin6.37 ▲3.0671.07 ▲21.06
Posts /wp-admin/edit.php6.42 ▲3.0675.67 ▲27.96
Add New Post /wp-admin/post-new.php8.96 ▲3.062,279.99 ▲2,189.33
Media Library /wp-admin/upload.php6.34 ▲3.1172.26 ▲37.05
Categories /wp-admin/edit-tags.php?taxonomy=rl_category&post_type=rl_gallery6.3560.54
Add-ons /wp-admin/admin.php?page=responsive-lightbox-addons6.331,020.63
Capabilities /wp-admin/admin.php?page=responsive-lightbox-capabilities6.2057.17
Remote Library /wp-admin/admin.php?page=responsive-lightbox-remote_library6.2155.45
Builder /wp-admin/admin.php?page=responsive-lightbox-builder6.2057.04
Tags /wp-admin/edit-tags.php?taxonomy=rl_tag&post_type=rl_gallery6.3554.47
General /wp-admin/admin.php?page=responsive-lightbox-settings6.2054.05
Lightboxes /wp-admin/admin.php?page=responsive-lightbox-configuration6.2052.29
Add New /wp-admin/post-new.php?post_type=rl_gallery6.5481.41
Galleries /wp-admin/admin.php?page=responsive-lightbox-gallery6.1958.27

Server storage [IO: ▲3.13MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 275 new files
Database: no new tables, 9 new options
New WordPress options
responsive_lightbox_activation_date
widget_recent-comments
widget_responsive_lightbox_gallery_widget
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_responsive_lightbox_image_widget
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Responsive Lightbox & Gallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,997 ▲23513.68 ▼0.4810.84 ▲9.1537.42 ▼5.94
Dashboard /wp-admin2,283 ▲1035.62 ▼0.0296.98 ▲12.0843.85 ▲1.58
Posts /wp-admin/edit.php2,188 ▲881.99 ▼0.0241.35 ▲1.2737.90 ▼0.92
Add New Post /wp-admin/post-new.php6,603 ▲5,06728.17 ▲5.06840.54 ▲222.6136.34 ▼9.75
Media Library /wp-admin/upload.php1,749 ▲3465.25 ▲1.05121.61 ▲21.6942.00 ▼1.01
Categories /wp-admin/edit-tags.php?taxonomy=rl_category&post_type=rl_gallery1,3622.1429.9031.99
Add-ons /wp-admin/admin.php?page=responsive-lightbox-addons1,2041.8628.0032.80
Capabilities /wp-admin/admin.php?page=responsive-lightbox-capabilities1,4701.9028.1729.94
Remote Library /wp-admin/admin.php?page=responsive-lightbox-remote_library1,0892.0328.4827.03
Builder /wp-admin/admin.php?page=responsive-lightbox-builder1,1361.9030.7137.16
Tags /wp-admin/edit-tags.php?taxonomy=rl_tag&post_type=rl_gallery1,3342.1428.3028.54
General /wp-admin/admin.php?page=responsive-lightbox-settings1,4541.9733.4428.32
Lightboxes /wp-admin/admin.php?page=responsive-lightbox-configuration1,1572.0927.6029.77
Add New /wp-admin/post-new.php?post_type=rl_gallery3,5904.47133.3044.23
Galleries /wp-admin/admin.php?page=responsive-lightbox-gallery1,1361.9028.3029.88

Uninstaller [IO: ▲0.16MB] [DB: ▲0.01MB] 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
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_recent-comments
    • widget_responsive_lightbox_gallery_widget
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_responsive_lightbox_image_widget
    • responsive_lightbox_activation_date
    • db_upgraded

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots lack descriptions #3, #4 in responsive-lightbox/assets to your readme.txt
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can look at the official readme.txt

responsive-lightbox/responsive-lightbox.php 92% from 13 tests

This is the main PHP file of "Responsive Lightbox & Gallery" version 2.4.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 180 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin45,114 lines of code in 179 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1084,9716,01926,190
PHP172,5133,44011,567
CSS363222296,179
Markdown1451001,128
SVG315137
XML10013

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 118)
Cyclomatic complexity
Average complexity per logical line of code0.68
Average class complexity138.82
▷ Minimum class complexity1.00
▷ Maximum class complexity808.00
Average method complexity9.36
▷ Minimum method complexity1.00
▷ Maximum method complexity118.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes15.88%
▷ Concrete classes1694.12%
▷ Final classes00.00%
Methods283
▷ Static methods10.35%
▷ Public methods26995.05%
▷ Protected methods00.00%
▷ Private methods144.95%
Functions13
▷ Named functions1292.31%
▷ Anonymous functions17.69%
Constants4
▷ Global constants4100.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
59 PNG files occupy 0.42MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/prettyphoto/images/prettyPhoto/facebook/contentPatternLeft.png0.13KB0.10KB▼ 24.82%
assets/nivo/themes/default/prev.png3.11KB0.32KB▼ 89.67%
assets/jstree/themes/default/40px.png2.16KB1.84KB▼ 15.12%
images/welcome.png288.49KB89.89KB▼ 68.84%
assets/fancybox/fancy_title_over.png0.07KB0.09KB0.00%