78% blueimp-lightbox

Code Review | blueimp lightbox

WordPress plugin blueimp lightbox scored78%from 54 tests.

About plugin

  • Plugin page: blueimp-lightbox
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.1-4.0.0
  • WordPress version: 6.3.1
  • First release: Oct 19, 2013
  • Latest release: Sep 4, 2014
  • Number of updates: 11
  • Update frequency: every 29.2 days
  • Top authors: blueimp (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

1,000+ active /21,225 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼7.05ms] Passed 4 tests

Server-side resources used by blueimp lightbox
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0645.52 ▲7.40
Dashboard /wp-admin3.37 ▲0.0650.00 ▼3.29
Posts /wp-admin/edit.php3.48 ▲0.1248.40 ▼1.40
Add New Post /wp-admin/post-new.php5.95 ▲0.0683.72 ▼23.44
Media Library /wp-admin/upload.php3.29 ▲0.0638.39 ▼0.07
blueimp lightbox /wp-admin/options-general.php?page=blueimp-lightbox3.2332.17

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by blueimp lightbox
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,985 ▲22413.80 ▼0.3312.03 ▲10.0141.07 ▼6.89
Dashboard /wp-admin2,199 ▲225.63 ▲0.0590.09 ▼14.4142.30 ▼0.97
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0836.96 ▼0.1032.00 ▼3.93
Add New Post /wp-admin/post-new.php1,540 ▲918.34 ▼4.81663.40 ▼12.8667.53 ▲5.06
Media Library /wp-admin/upload.php1,407 ▲74.24 ▲0.0195.99 ▼3.8644.35 ▼1.05
blueimp lightbox /wp-admin/options-general.php?page=blueimp-lightbox8062.0324.8528.52

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=blueimp-lightbox
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=blueimp-lightbox
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/blueimp-lightbox/lib/class-blueimp-lightbox.php:51

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Options page), #2 (Lightbox with bright image), #3 (Lightbox with dark image)
The official readme.txt is a good inspiration

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

The main PHP script in "blueimp lightbox" version 1.1.1 is automatically included on every request by WordPress
48 characters long description:
Official blueimp Gallery lightbox for Wordpress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin2,510 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript71562751,852
CSS3840336
PHP21725212
PO File2161676
HTML20018
SVG30016

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 code0.11
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity1.54
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/error.png2.16KB1.62KB▼ 25.05%
img/video-play.png2.75KB1.80KB▼ 34.51%
screenshot-1.png72.39KB22.30KB▼ 69.19%
img/play-pause.png0.59KB0.46KB▼ 22.77%