84% simple-lightbox

Code Review | Simple Lightbox

WordPress plugin Simple Lightbox scored 84% from 54 tests.

About plugin

  • Plugin page: simple-lightbox
  • Plugin version: 2.9.3
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: May 29, 2010
  • Latest release: Aug 10, 2023
  • Number of updates: 143
  • Update frequency: every 33.8 days
  • Top authors: Archetyped (100%)

Code review

54 tests

User reviews

231 reviews

Install metrics

100,000+ active / 2,598,622 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲1.39MB] [CPU: ▲11.99ms] Passed 4 tests

A check of server-side resources used by Simple Lightbox
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.76 ▲1.3058.95 ▲16.15
Dashboard /wp-admin4.73 ▲1.4258.55 ▲6.56
Posts /wp-admin/edit.php4.84 ▲1.4963.48 ▲14.56
Add New Post /wp-admin/post-new.php7.31 ▲1.42108.96 ▲11.26
Media Library /wp-admin/upload.php4.65 ▲1.4248.92 ▲15.58
Lightbox /wp-admin/themes.php?page=slb_options4.8357.12

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 86 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
slb_options
slb_version
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Simple Lightbox
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7714.48 ▲0.111.79 ▼0.1842.56 ▼1.54
Dashboard /wp-admin2,216 ▲284.88 ▼0.03107.95 ▼8.8639.20 ▼6.12
Posts /wp-admin/edit.php2,096 ▲72.08 ▲0.0739.42 ▲2.7733.31 ▼1.03
Add New Post /wp-admin/post-new.php1,520 ▲117.38 ▼5.84676.11 ▲16.3755.81 ▼2.13
Media Library /wp-admin/upload.php1,395 ▲104.32 ▲0.1193.18 ▼8.1342.91 ▼1.18
Lightbox /wp-admin/themes.php?page=slb_options1,2942.3243.3434.20

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • theysaidso_admin_options
    • slb_version
    • can_compress_scripts
    • widget_recent-comments
    • slb_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 26× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'SLB_Base' not found in wp-content/plugins/simple-lightbox/includes/class.base_object.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'SLB_Admin_View' not found in wp-content/plugins/simple-lightbox/includes/class.admin_section.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'SLB_Base' not found in wp-content/plugins/simple-lightbox/includes/class.field_base.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'SLB_Field_Collection' not found in wp-content/plugins/simple-lightbox/includes/class.options.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'SLB_Base' not found in wp-content/plugins/simple-lightbox/includes/class.admin.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'SLB_Field_Type' not found in wp-content/plugins/simple-lightbox/includes/class.field.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/simple-lightbox/main.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'SLB_Field_Base' not found in wp-content/plugins/simple-lightbox/includes/class.field_collection.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'SLB_Base_Collection' not found in wp-content/plugins/simple-lightbox/includes/class.collection_controller.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'SLB_Field' not found in wp-content/plugins/simple-lightbox/includes/class.option.php:8

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 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
7 plugin tags: gallery, photography, theme, template, images...

simple-lightbox/main.php 92% from 13 tests

This is the main PHP file of "Simple Lightbox" version 2.9.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-lightbox.php" instead of "main.php")

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
No dangerous file extensions were detected10,525 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
PHP301,1544,7646,209
JavaScript165242,2833,288
SVG100407
Sass66619399
PO File1383986
HTML10049
XML1111631
JSON20027
Markdown215024
CSS5005

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity47.04
▷ Minimum class complexity1.00
▷ Maximum class complexity284.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes00.00%
Methods504
▷ Static methods00.00%
▷ Public methods41482.14%
▷ Protected methods6412.70%
▷ Private methods265.16%
Functions10
▷ Named functions330.00%
▷ Anonymous functions770.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
themes/default/images/ui_slideshow_play.png0.34KB0.24KB▼ 28.03%
themes/black/images/nav_prev.png0.96KB0.87KB▼ 9.87%
themes/default/images/nav_next.png0.89KB0.80KB▼ 9.86%
themes/default/images/ui_slideshow_pause.png0.27KB0.19KB▼ 29.93%
themes/default/images/ui_close.png0.39KB0.29KB▼ 25.74%