78% lightbox-photoswipe

Code Review | Lightbox with PhotoSwipe

WordPress plugin Lightbox with PhotoSwipe scored78%from 54 tests.

About plugin

  • Plugin page: lightbox-photoswipe
  • Plugin version: 5.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: Nov 2, 2017
  • Latest release: Nov 25, 2023
  • Number of updates: 477
  • Update frequency: every 4.6 days
  • Top authors: awelzel (100%)

Code review

54 tests

User reviews

102 reviews

Install metrics

20,000+ active /578,678 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
Installer ran successfully

Server metrics [RAM: ▲0.40MB] [CPU: ▲6.31ms] Passed 4 tests

An overview of server-side resources used by Lightbox with PhotoSwipe
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4347.82 ▲7.98
Dashboard /wp-admin3.74 ▲0.3955.51 ▼5.09
Posts /wp-admin/edit.php3.79 ▲0.4367.56 ▲17.46
Add New Post /wp-admin/post-new.php6.26 ▲0.3899.07 ▲4.89
Media Library /wp-admin/upload.php3.62 ▲0.3951.38 ▲19.34
Lightbox with PhotoSwipe /wp-admin/options-general.php?page=lightbox-photoswipe3.6147.78

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 187 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
lightbox_photoswipe_db_version
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Lightbox with PhotoSwipe: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5314.26 ▼0.042.44 ▲0.6540.55 ▼3.78
Dashboard /wp-admin2,202 ▲225.63 ▲0.0492.73 ▼2.7942.20 ▼3.92
Posts /wp-admin/edit.php2,104 ▲41.96 ▼0.0439.77 ▲0.8436.96 ▲3.22
Add New Post /wp-admin/post-new.php6,227 ▲4,68825.95 ▲2.87820.23 ▲209.2052.74 ▲1.14
Media Library /wp-admin/upload.php1,401 ▲14.20 ▲0.0195.51 ▼1.2941.06 ▼0.10
Lightbox with PhotoSwipe /wp-admin/options-general.php?page=lightbox-photoswipe1,7471.6629.4626.99

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/lightbox-photoswipe/templates/options-script.inc.php
  • 18× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lightbox-photoswipe/templates/options-tab2.inc.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lightbox-photoswipe/templates/options.inc.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'MatthiasMullie\\PathConverter\\ConverterInterface' not found in wp-content/plugins/lightbox-photoswipe/vendor/matthiasmullie/path-converter/src/Converter.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'MatthiasMullie\\Minify\\Minify' not found in wp-content/plugins/lightbox-photoswipe/vendor/matthiasmullie/minify/src/CSS.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lightbox-photoswipe/templates/frontend.inc.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lightbox-photoswipe/templates/options-tab5.inc.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lightbox-photoswipe/templates/options-tab3.inc.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lightbox-photoswipe/templates/options-navigation.inc.php:1
    • > PHP Fatal error
      Namespace declaration statement has to be the very first statement or after any declare call in the script in wp-content/plugins/lightbox-photoswipe/build.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/lightbox-photoswipe/templates/options-tab7.inc.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Screenshot #7 (Example for the use in the frontend) image required
The official readme.txt is a good inspiration

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

Analyzing the main PHP file in "Lightbox with PhotoSwipe" version 5.1.0
24 characters long description:
Lightbox with PhotoSwipe

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin22,260 lines of code in 132 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript203,7393,91812,859
PHP396801,5043,412
CSS135134012,506
PO File45246571,782
TypeScript3402,0291,232
JSON400213
Markdown4530112
YAML313187
SVG90241
Dockerfile12012
make1004

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity22.22
▷ Minimum class complexity1.00
▷ Maximum class complexity175.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity85.00
Code structure
Namespaces6
Interfaces1
Traits0
Classes17
▷ Abstract classes317.65%
▷ Concrete classes1482.35%
▷ Final classes00.00%
Methods142
▷ Static methods1510.56%
▷ Public methods9566.90%
▷ Protected methods4330.28%
▷ Private methods42.82%
Functions14
▷ Named functions17.14%
▷ Anonymous functions1392.86%
Constants10
▷ Global constants220.00%
▷ Class constants880.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/lib/skins/classic-solid/controls.png0.53KB0.72KB0.00%
src/lib/skins/default-solid/controls.png1.33KB0.86KB▼ 35.07%
src/lib/skins/default/controls.png1.33KB0.86KB▼ 35.07%
src/lib/skins/classic/controls.png0.53KB0.72KB0.00%