84% wp-lightbox-2

Code Review | WP Lightbox 2

WordPress plugin WP Lightbox 2 scored 84% from 54 tests.

About plugin

  • Plugin page: wp-lightbox-2
  • Plugin version: 3.0.6.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.6
  • WordPress version: 5.8.1
  • First release: Nov 27, 2011
  • Latest release: Jan 3, 2021
  • Number of updates: 191
  • Update frequency: every 17.4 days
  • Top authors: masdiblogs (56.54%)wpdevart (34.55%)dvinson (3.66%)smub (2.62%)csskevin (2.09%)

Code review

54 tests

User reviews

90 reviews

Install metrics

60,000+ active / 1,172,737 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼136.97ms] Passed 4 tests

Analyzing server-side resources used by WP Lightbox 2
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.1345.45 ▲10.12
Dashboard /wp-admin3.20 ▲0.1452.77 ▲7.69
Posts /wp-admin/edit.php3.31 ▲0.2050.03 ▲6.25
Add New Post /wp-admin/post-new.php5.55 ▲0.1298.71 ▼564.50
Media Library /wp-admin/upload.php3.14 ▲0.1433.29 ▲2.68

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 90 new files
Database: no new tables, 7 new options
New WordPress options
jqlb_navbarOnTop
jqlb_comments
jqlb_show_download
jqlb_help_text
jqlb_resize_on_demand
jqlb_resize_speed
jqlb_automate

Browser metrics Passed 4 tests

A check of browser resources used by WP Lightbox 2
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,909 ▲31316.31 ▲0.6216.34 ▲6.0146.43 ▼2.61
Dashboard /wp-admin2,983 ▲526.08 ▼0.01157.37 ▲5.95127.77 ▲16.57
Posts /wp-admin/edit.php2,785 ▲462.72 ▲0.0166.93 ▼1.3585.58 ▼1.65
Add New Post /wp-admin/post-new.php1,632 ▲1720.90 ▼0.48308.24 ▼15.00104.21 ▼6.51
Media Library /wp-admin/upload.php1,776 ▲285.04 ▲0.04147.76 ▼9.66132.86 ▲15.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • jqlb_comments
    • jqlb_help_text
    • jqlb_resize_speed
    • jqlb_automate
    • jqlb_resize_on_demand
    • jqlb_navbarOnTop
    • jqlb_show_download

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-lightbox-2/wp-lightbox-2.php:28
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wp-lightbox-2/admin/admin_menu.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: Please delete some tags, you are using 22 tag instead of maximum 10
The official readme.txt is a good inspiration

wp-lightbox-2/wp-lightbox-2.php 92% from 13 tests

"WP Lightbox 2" version 3.0.6.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 235 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin8,745 lines of code in 27 files:
LanguageFilesBlank linesComment linesLines of code
JSON3004,489
JavaScript121083032,228
CSS654621,363
PHP49754650
HTML10013
Markdown1002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.25
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
24 PNG files occupy 0.48MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/icon_lightbox2.png2.18KB1.28KB▼ 41.43%
admin/styles/images/ui-bg_diagonals-thick_20_666666_40x40.png0.34KB0.15KB▼ 55.27%
admin/styles/images/ui-icons_ffffff_256x240.png6.32KB4.18KB▼ 33.80%
admin/styles/images/ui-bg_glass_65_ffffff_1x400.png0.24KB0.09KB▼ 64.23%
admin/styles/images/ui-icons_ef8c08_256x240.png4.49KB4.18KB▼ 6.89%