10% conditional-lightbox

Code Review | Conditional Lightbox

WordPress plugin Conditional Lightbox scored 10% from 54 tests.

About plugin

  • Plugin page: conditional-lightbox
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-3.5.1
  • WordPress version: 5.8.1
  • First release: Jan 28, 2013
  • Latest release: Jan 28, 2013
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: nonsalant (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,428 total downloads


Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/conditional-lightbox/conditional-lightbox.php+60
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.02MB] [CPU: ▼139.15ms] Passed 4 tests

This is a short check of server-side resources used by Conditional Lightbox
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1444.73 ▲15.55
Dashboard /wp-admin3.08 ▲0.0255.12 ▼1.85
Posts /wp-admin/edit.php3.13 ▲0.0251.35 ▲0.21
Add New Post /wp-admin/post-new.php5.44 ▲0.00102.73 ▼559.06
Media Library /wp-admin/upload.php3.02 ▲0.0242.70 ▲4.11
Conditional Lightbox /wp-admin/options-general.php?page=conditional-lightbox/conditional-lightbox.php2.9930.58

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, 1 new option
New WordPress options

Browser metrics Passed 4 tests

Checking browser requirements for Conditional Lightbox
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,391 ▲79516.23 ▲0.5718.78 ▲8.6252.28 ▲0.56
Dashboard /wp-admin2,975 ▲445.90 ▼0.16181.75 ▲19.20115.73 ▼4.38
Posts /wp-admin/edit.php2,744 ▲52.72 ▲0.0071.35 ▼8.9893.04 ▼11.09
Add New Post /wp-admin/post-new.php1,686 ▲318.77 ▲0.39419.47 ▼44.76118.89 ▲4.45
Media Library /wp-admin/upload.php1,812 ▲645.04 ▲0.01171.07 ▲3.74128.24 ▼3.78
Conditional Lightbox /wp-admin/options-general.php?page=conditional-lightbox/conditional-lightbox.php1,0952.0562.2587.33

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 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/conditional-lightbox/conditional-lightbox.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test


Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: android, mobile, iphone, rwd, images...

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

The main PHP file in "Conditional Lightbox" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
48 characters long description:
Use a lightbox only if the screen is big enough.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin483 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.14
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
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions9100.00%
▷ Anonymous functions00.00%
▷ Global constants00.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/twitter-icon.png1.71KB1.64KB▼ 3.89%
images/facebook-icon.png1.65KB1.61KB▼ 2.89%