78% lightgallerywp

Code Review | LightGallery WP

WordPress plugin LightGallery WP scored78%from 54 tests.

About plugin

  • Plugin page: lightgallerywp
  • Plugin version: 1.0.5
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.0
  • WordPress version: 6.3.1
  • First release: Jan 19, 2022
  • Latest release: May 20, 2022
  • Number of updates: 8
  • Update frequency: every 15.1 days
  • Top authors: namith.jawahar (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /2,621 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.44MB] [CPU: ▲0.73ms] Passed 4 tests

An overview of server-side resources used by LightGallery WP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4545.48 ▲1.09
Dashboard /wp-admin3.75 ▲0.4450.53 ▼0.76
Posts /wp-admin/edit.php3.86 ▲0.5051.85 ▲6.99
Add New Post /wp-admin/post-new.php6.33 ▲0.4486.80 ▼0.99
Media Library /wp-admin/upload.php3.67 ▲0.4435.93 ▲3.59
Add New /wp-admin/post-new.php?post_type=lightgalleries3.7454.04
LightGallery /wp-admin/edit.php?post_type=lightgalleries3.7143.84
Gutenberg Settings /wp-admin/edit.php?post_type=lightgalleries&page=gutenberg_settings3.6538.80

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for LightGallery WP
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,955 ▲22013.67 ▼1.008.65 ▲6.9336.34 ▼9.13
Dashboard /wp-admin2,237 ▲494.86 ▼0.03108.81 ▼5.8841.47 ▼4.79
Posts /wp-admin/edit.php2,120 ▲311.97 ▼0.0540.78 ▲4.8836.14 ▲0.87
Add New Post /wp-admin/post-new.php1,559 ▲2623.39 ▲0.24633.22 ▼43.8449.18 ▼4.59
Media Library /wp-admin/upload.php1,422 ▲374.16 ▼0.1397.78 ▼7.0542.03 ▼0.50
Add New /wp-admin/post-new.php?post_type=lightgalleries2,8453.7277.5160.58
LightGallery /wp-admin/edit.php?post_type=lightgalleries1,0841.9529.6628.18
Gutenberg Settings /wp-admin/edit.php?post_type=lightgalleries&page=gutenberg_settings2,0292.1029.6346.05

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/lightgallerywp/features/upgrade-banner.php
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_js() in wp-content/plugins/lightgallerywp/features/gutenberg/script-js.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_js() in wp-content/plugins/lightgallerywp/features/custom-gallery/justified-gallery-js.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_js() in wp-content/plugins/lightgallerywp/features/gutenberg/justified-gallery-js.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function LightGallery\\add_shortcode() in wp-content/plugins/lightgallerywp/features/custom-gallery/shortcode.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lightgallerywp/features/custom-gallery/invoke-script.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_js() in wp-content/plugins/lightgallerywp/features/custom-gallery/script-inline-js.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lightgallerywp/features/invoke-scripts.php:60
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lightgallerywp/features/invoke-scripts.php:60
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_js() in wp-content/plugins/lightgallerywp/features/custom-gallery/script-js.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function LightGallery\\add_action() in wp-content/plugins/lightgallerywp/features/gutenberg/settings.php:16

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

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4, #5 in lightgallerywp/assets to your readme.txt
You can look at the official readme.txt

lightgallerywp/lightgallerywp.php Passed 13 tests

Analyzing the main PHP file in "LightGallery WP" version 1.0.5
43 characters long description:
Full featured gallery plugin for WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected4,543 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
CSS5282111,885
PHP24963361,710
JavaScript735271893
SVG20055

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity62.00
▷ Minimum class complexity53.00
▷ Maximum class complexity78.00
Average method complexity10.63
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods19
▷ Static methods421.05%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions1571.43%
▷ Anonymous functions628.57%
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
No PNG images were found in this plugin