73% mpcx-lightbox

Code Review | Lightbox

WordPress plugin Lightbox scored73%from 54 tests.

About plugin

  • Plugin page: mpcx-lightbox
  • Plugin version: 1.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.1
  • WordPress version: 6.3.1
  • First release: Apr 13, 2016
  • Latest release: Feb 19, 2019
  • Number of updates: 24
  • Update frequency: every 43.4 days
  • Top authors: DeusTron (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active /17,998 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.05MB] [CPU: ▼5.87ms] Passed 4 tests

Analyzing server-side resources used by Lightbox
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0643.57 ▼5.71
Dashboard /wp-admin3.36 ▲0.0554.27 ▲0.10
Posts /wp-admin/edit.php3.41 ▲0.0551.31 ▼3.93
Add New Post /wp-admin/post-new.php5.94 ▲0.0589.20 ▼12.67
Media Library /wp-admin/upload.php3.28 ▲0.0536.10 ▼1.16
Lightbox /wp-admin/options-general.php?page=lightbox3.3033.98

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 80 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
mpcx_lightbox
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Lightbox: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,987 ▲22613.48 ▼1.1013.90 ▲11.9846.44 ▼0.16
Dashboard /wp-admin2,202 ▲255.58 ▼0.0286.76 ▼11.9941.31 ▲0.23
Posts /wp-admin/edit.php2,104 ▲11.96 ▼0.0636.85 ▼3.9834.04 ▼1.07
Add New Post /wp-admin/post-new.php1,529 ▲323.61 ▲0.58653.86 ▼23.8562.45 ▲12.11
Media Library /wp-admin/upload.php1,404 ▲44.34 ▲0.1598.89 ▼3.5344.11 ▼2.56
Lightbox /wp-admin/options-general.php?page=lightbox1,1141.8225.9828.45

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% 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)
Almost there, just fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=lightbox
    • > Notice in wp-content/plugins/mpcx-lightbox/admin/options.php+91
    Undefined index: colorbox_layout

SRP 0% 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 take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/mpcx-lightbox/admin/options.php
    • > /wp-content/plugins/mpcx-lightbox/mpcx-lightbox.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/mpcx-lightbox/update.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: lightbox, colorbox, gallery, fancybox, justified gallery

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

"Lightbox" version 1.2.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
15 characters long description:
Lightbox Plugin

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
Good job! No executable or dangerous file extensions detected578 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP53827468
PO File1294059
JavaScript4303043
CSS8068

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
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
Namespaces0
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%
Functions9
▷ Named functions111.11%
▷ Anonymous functions888.89%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
14 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/css/colorbox/3/images/border1.png0.61KB0.82KB0.00%
public/css/colorbox/2/images/controls.png1.59KB1.67KB0.00%
public/images/next.png1.32KB1.58KB0.00%
public/css/colorbox/1/images/controls.png0.49KB0.57KB0.00%
public/css/colorbox/0/images/overlay.png0.11KB0.15KB0.00%