88% distinctive-lightbox

Code Review | Distinctive Lightbox

WordPress plugin Distinctive Lightbox scored 88% from 54 tests.

About plugin

  • Plugin page: distinctive-lightbox
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4.2
  • WordPress version: 5.8.1
  • First release: May 25, 2020
  • Latest release: Jul 7, 2020
  • Number of updates: 11
  • Update frequency: every 3.8 days
  • Top authors: distinctivepixels (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 341 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.20MB] [CPU: ▼142.15ms] Passed 4 tests

This is a short check of server-side resources used by Distinctive Lightbox
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.1926.85 ▲8.67
Dashboard /wp-admin3.32 ▲0.2648.57 ▼2.46
Posts /wp-admin/edit.php3.37 ▲0.2646.36 ▲1.50
Add New Post /wp-admin/post-new.php5.61 ▲0.1890.68 ▼568.36
Media Library /wp-admin/upload.php3.20 ▲0.1932.36 ▲0.72
Distinctive Lightbox /wp-admin/options-general.php?page=distinctive-lightbox-settings3.1529.82

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Distinctive Lightbox
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,727 ▲13115.92 ▲0.2011.11 ▲1.6747.72 ▼1.90
Dashboard /wp-admin2,977 ▲465.91 ▼0.07140.47 ▼1.29106.17 ▼12.87
Posts /wp-admin/edit.php2,749 ▲102.83 ▼0.0163.57 ▼5.4990.92 ▲1.65
Add New Post /wp-admin/post-new.php1,679 ▲18118.78 ▲0.01356.20 ▼22.11109.42 ▲1.25
Media Library /wp-admin/upload.php1,820 ▲135.03 ▲0.02144.53 ▼0.88120.30 ▼4.86
Distinctive Lightbox /wp-admin/options-general.php?page=distinctive-lightbox-settings1,6092.3356.7488.57

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=distinctive-lightbox-settings
    • > Notice in wp-content/plugins/distinctive-lightbox/includes/classes/DistinctiveLightbox.php+103
    Undefined index: exclusive-image-class
    • > GET request to /wp-admin/options-general.php?page=distinctive-lightbox-settings
    • > Notice in wp-content/plugins/distinctive-lightbox/includes/classes/DistinctiveLightbox.php+103
    Undefined index: included-image-class

SRP 50% from 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
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/distinctive-lightbox/distinctive-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 on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

distinctive-lightbox/distinctive-lightbox.php Passed 13 tests

"Distinctive Lightbox" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
96 characters long description:
A lightweight, pure JS lightbox which supports beatiful galleries and also YouTube/Vimeo videos.

Code Analysis Passed 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
Everything looks great! No dangerous files found in this plugin908 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP12206336892
JSON20011
CSS2002
JavaScript2002
Markdown1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity19.17
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity3.87
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods39
▷ Static methods512.82%
▷ Public methods3384.62%
▷ Protected methods00.00%
▷ Private methods615.38%
Functions16
▷ Named functions1487.50%
▷ Anonymous functions212.50%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected