84% simple-lightgallery

Code Review | Simple lightGallery

WordPress plugin Simple lightGallery scored 84% from 54 tests.

About plugin

  • Plugin page: simple-lightgallery
  • Plugin version: 1.5.2
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2
  • WordPress version: 6.3.1
  • First release: Oct 4, 2021
  • Latest release: Mar 31, 2023
  • Number of updates: 19
  • Update frequency: every 34.6 days
  • Top authors: savvasha (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,482 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
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▲1.88ms] Passed 4 tests

Analyzing server-side resources used by Simple lightGallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0947.30 ▲5.84
Dashboard /wp-admin3.40 ▲0.1053.18 ▲0.16
Posts /wp-admin/edit.php3.51 ▲0.1677.26 ▲22.58
Add New Post /wp-admin/post-new.php5.98 ▲0.1095.02 ▼2.35
Media Library /wp-admin/upload.php3.32 ▲0.1038.41 ▲3.86
Simple lightGallery /wp-admin/options-general.php?page=simple_lightgallery3.2938.09

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 84 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Simple lightGallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲1813.24 ▼0.441.92 ▲0.1944.18 ▼3.27
Dashboard /wp-admin2,210 ▲44.92 ▼0.95109.84 ▲8.8538.45 ▼3.20
Posts /wp-admin/edit.php2,099 ▲102.15 ▲0.1641.67 ▲4.2835.23 ▲1.62
Add New Post /wp-admin/post-new.php1,548 ▲618.07 ▼0.12618.59 ▼19.4353.79 ▲2.38
Media Library /wp-admin/upload.php1,392 ▲14.27 ▲0.08103.35 ▲3.0242.47 ▼1.40
Simple lightGallery /wp-admin/options-general.php?page=simple_lightgallery1,1852.3841.0630.34

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • 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
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-lightgallery/includes/class-slg-front.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-lightgallery/includes/class-slg-admin.php:20

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

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
These attributes need your attention: The official readme.txt might help

simple-lightgallery/simple-lightgallery.php Passed 13 tests

The main PHP script in "Simple lightGallery" version 1.5.2 is automatically included on every request by WordPress
64 characters long description:
An integration of lightGallery javascript v1 and v2 to 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 plugin15,604 lines of code in 71 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript462881,88311,207
CSS2064643,887
PHP38261405
SVG200105

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity17.00
▷ Minimum class complexity2.00
▷ Maximum class complexity37.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1890.00%
▷ Protected methods00.00%
▷ Private methods210.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/lightgallery/v1/img/youtube-play.png5.06KB2.37KB▼ 53.04%
assets/lightgallery/v1/img/vimeo-play.png5.30KB1.56KB▼ 70.65%
assets/lightgallery/v1/img/video-play.png4.42KB1.05KB▼ 76.27%