84% distinctive-lightbox

Code Review | Distinctive Lightbox

WordPress plugin Distinctive Lightbox scored84%from 54 tests.

About plugin

  • Plugin page: distinctive-lightbox
  • Plugin version: 1.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: May 25, 2020
  • Latest release: Mar 21, 2023
  • Number of updates: 12
  • Update frequency: every 85.8 days
  • Top authors: distinctivepixels (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,102 total downloads

Benchmarks

Plugin footprint 83% from 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: ▼5.11ms] 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 /3.66 ▲0.2041.24 ▲2.54
Dashboard /wp-admin3.50 ▲0.2045.92 ▼2.16
Posts /wp-admin/edit.php3.61 ▲0.2651.43 ▲1.29
Add New Post /wp-admin/post-new.php6.10 ▲0.2183.47 ▼21.63
Media Library /wp-admin/upload.php3.42 ▲0.2038.13 ▲2.06
Distinctive Lightbox /wp-admin/options-general.php?page=distinctive-lightbox-settings3.3931.19

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: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_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 /2,809 ▲4814.51 ▲0.244.64 ▲3.0744.94 ▲5.24
Dashboard /wp-admin2,203 ▲235.51 ▼0.1482.74 ▼7.5639.91 ▼3.79
Posts /wp-admin/edit.php2,108 ▲52.04 ▲0.0636.63 ▼4.7436.63 ▲2.81
Add New Post /wp-admin/post-new.php1,533 ▼223.47 ▲0.70661.25 ▲31.3863.54 ▲5.76
Media Library /wp-admin/upload.php1,408 ▲114.18 ▼0.0393.35 ▼16.6343.17 ▼0.75
Distinctive Lightbox /wp-admin/options-general.php?page=distinctive-lightbox-settings1,1911.8423.0728.36

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • 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)
Even though no errors were found, this is by no means an exhaustive test

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.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
97 characters long description:
A lightweight, pure JS lightbox which supports beautiful 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 plugin899 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12206336894
CSS2002
JavaScript2002
JSON1001

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