84% simplelightbox

Code Review | Simplelightbox

WordPress plugin Simplelightbox scored84%from 54 tests.

About plugin

  • Plugin page: simplelightbox
  • Plugin version: 2.14.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3.0
  • WordPress version: 6.3.1
  • First release: Oct 8, 2015
  • Latest release: Aug 31, 2023
  • Number of updates: 47
  • Update frequency: every 61.4 days
  • Top authors: aknieriem (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

2,000+ active /24,660 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼2.30ms] Passed 4 tests

A check of server-side resources used by Simplelightbox
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1449.61 ▲12.28
Dashboard /wp-admin3.51 ▲0.2059.40 ▲12.04
Posts /wp-admin/edit.php3.56 ▲0.2061.25 ▲10.87
Add New Post /wp-admin/post-new.php6.12 ▲0.2396.98 ▼3.59
Media Library /wp-admin/upload.php3.45 ▲0.2251.05 ▼28.52
Simplelightbox /wp-admin/themes.php?page=simplelightbox3.4045.53

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 57 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Simplelightbox
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲11113.73 ▼1.043.08 ▲0.7738.72 ▼5.31
Dashboard /wp-admin2,219 ▲314.91 ▲0.05114.13 ▼0.4341.73 ▼1.40
Posts /wp-admin/edit.php2,102 ▲132.06 ▲0.0540.07 ▼2.3633.91 ▼1.27
Add New Post /wp-admin/post-new.php1,523 ▼517.47 ▼5.86604.79 ▼78.7648.23 ▼23.37
Media Library /wp-admin/upload.php1,398 ▲104.25 ▲0.0295.76 ▼2.7543.15 ▲0.73
Simplelightbox /wp-admin/themes.php?page=simplelightbox1,6561.9834.0331.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simplelightbox/simplelightbox.php:564

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 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
Attributes that require attention:
  • Screenshots: Add an image for screenshot #1 (Admin page where you setup the plugin)
The official readme.txt is a good inspiration

simplelightbox/simplelightbox.php Passed 13 tests

The main file in "Simplelightbox" v. 2.14.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
89 characters long description:
Touch-friendly image lightbox for mobile and desktop with no need of jQuery for Wordpress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin8,877 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript87086057,171
CSS61832693
PHP13736491
Sass2260424
Markdown17058
JSON10034
Ruby16136

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods1090.91%
▷ Protected methods00.00%
▷ Private methods19.09%
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

PNG files should be compressed to save space and minimize bandwidth usage
23 PNG files occupy 0.11MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/img/custom_rgb_g.png1.04KB0.80KB▼ 23.67%
resources/img/custom_background.png1.87KB2.12KB0.00%
resources/img/custom_hsb_s.png1.14KB0.89KB▼ 21.75%
resources/img/colorpicker_hsb_h.png0.99KB0.77KB▼ 21.94%
resources/img/custom_rgb_r.png0.99KB0.74KB▼ 25.34%