84% photoswipe-foogallery

Code Review | PhotoSwipe Lightbox for FooGallery Extension

WordPress plugin PhotoSwipe Lightbox for FooGallery Extension scored84%from 54 tests.

About plugin

  • Plugin page: photoswipe-foogal...
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.3.2
  • WordPress version: 6.3.1
  • First release: Feb 20, 2020
  • Latest release: Feb 22, 2020
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: mbergann (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /1,428 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
The plugin installed gracefully, with no errors

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

Server-side resources used by PhotoSwipe Lightbox for FooGallery Extension
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.67 ▲0.41
Dashboard /wp-admin3.34 ▼0.0144.14 ▼19.97
Posts /wp-admin/edit.php3.39 ▲0.0344.51 ▲3.13
Add New Post /wp-admin/post-new.php5.92 ▲0.0380.30 ▼6.44
Media Library /wp-admin/upload.php3.26 ▲0.0333.10 ▲0.75

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for PhotoSwipe Lightbox for FooGallery Extension
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.23 ▼1.154.91 ▲3.1345.63 ▲1.72
Dashboard /wp-admin2,206 ▲184.86 ▼0.0396.80 ▼6.5237.49 ▲1.61
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0039.83 ▼0.3435.82 ▼4.43
Add New Post /wp-admin/post-new.php1,542 ▲1418.40 ▲0.37619.16 ▲8.7055.57 ▼0.94
Media Library /wp-admin/upload.php1,391 ▲64.20 ▲0.0294.69 ▼3.9340.71 ▲1.06

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/photoswipe-foogallery/photoswipe-foogallery-init.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/photoswipe-foogallery/photoswipe-foogallery-extension.php:25

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

readme.txt Passed 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
4 plugin tags: foogallery-extension, foogallery, lightbox, photoswipe

photoswipe-foogallery/photoswipe-foogallery-extension.php 85% from 13 tests

The primary PHP file in "PhotoSwipe Lightbox for FooGallery Extension" version 1.0.4 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("photoswipe-foogallery.php" instead of "photoswipe-foogallery-extension.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 186 characters long)

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 plugin4,055 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript59474013,345
CSS39690480
PHP25560220
Markdown1509
SVG1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.80
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.14MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/extension_bg.png145.44KB45.86KB▼ 68.47%
photoswipe/default-skin/default-skin.png0.53KB0.72KB0.00%