94% gallery-block-lightbox

Code Review | Lightbox for the Default Gallery & Image Block (Simple, Lightweight & No Lock In)

WordPress plugin Lightbox for the Default Gallery & Image Block (Simple, Lightweight & No Lock In) scored 94% from 54 tests.

About plugin

  • Plugin page: gallery-block-lig...
  • Plugin version: 1.9.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-5.8
  • WordPress version: 5.8.1
  • First release: Jun 4, 2020
  • Latest release: Sep 10, 2021
  • Number of updates: 26
  • Update frequency: every 17.8 days
  • Top authors: goaroundagain (100%)

Code review

54 tests

User reviews

37 reviews

Install metrics

5,000+ active / 24,236 total downloads

Benchmarks

Plugin footprint Passed 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: ▼0.00MB] [CPU: ▼144.16ms] Passed 4 tests

Server-side resources used by Lightbox for the Default Gallery & Image Block (Simple, Lightweight & No Lock In)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0132.42 ▲3.81
Dashboard /wp-admin3.06 ▲0.0142.45 ▲0.27
Posts /wp-admin/edit.php3.11 ▲0.0034.86 ▼11.67
Add New Post /wp-admin/post-new.php5.42 ▼0.0284.44 ▼560.87
Media Library /wp-admin/upload.php3.00 ▲0.0029.51 ▼4.36

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Lightbox for the Default Gallery & Image Block (Simple, Lightweight & No Lock In)
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲8316.17 ▲0.588.97 ▲0.4847.87 ▲1.12
Dashboard /wp-admin2,970 ▲365.91 ▼0.19134.04 ▼22.38108.81 ▲1.88
Posts /wp-admin/edit.php2,739 ▲32.70 ▲0.0260.97 ▼5.2487.62 ▼4.13
Add New Post /wp-admin/post-new.php1,672 ▲17218.85 ▲0.35369.03 ▲32.6298.07 ▼10.63
Media Library /wp-admin/upload.php1,810 ▲65.02 ▼0.00139.34 ▼17.72108.76 ▼7.74

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 75% from 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 50% from 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
Please fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Gallery_Block_Lightbox\\add_action() in wp-content/plugins/gallery-block-lightbox/gallery-block-lightbox.php:17

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

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed: Please take inspiration from this readme.txt

gallery-block-lightbox/gallery-block-lightbox.php Passed 13 tests

The entry point to "Lightbox for the Default Gallery & Image Block (Simple, Lightweight & No Lock In)" version 1.9.0 is a PHP file that has certain tags in its header comment area
70 characters long description:
Adds a Lightbox to the Block Editor (Gutenberg) Gallery & Image Block.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin17 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP12815
CSS1051
JavaScript1061

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code1.29
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin