78% photoswipe-masonry

Code Review | Photoswipe Masonry Gallery

WordPress plugin Photoswipe Masonry Gallery scored78%from 54 tests.

About plugin

  • Plugin page: photoswipe-masonry
  • Plugin version: 1.2.26
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Dec 28, 2014
  • Latest release: Nov 9, 2023
  • Number of updates: 62
  • Update frequency: every 52.3 days
  • Top authors: deanoakley (100%)

Code review

54 tests

User reviews

45 reviews

Install metrics

9,000+ active /155,918 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼4.42ms] Passed 4 tests

This is a short check of server-side resources used by Photoswipe Masonry Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1141.03 ▲1.99
Dashboard /wp-admin3.39 ▲0.0451.41 ▼7.98
Posts /wp-admin/edit.php3.44 ▲0.0846.02 ▼1.04
Add New Post /wp-admin/post-new.php5.97 ▲0.0883.87 ▼5.01
Media Library /wp-admin/upload.php3.31 ▲0.0833.21 ▼3.64

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
photoswipe_options

Browser metrics Passed 4 tests

Checking browser requirements for Photoswipe Masonry Gallery
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,964 ▲21713.47 ▼0.7710.62 ▲8.7841.85 ▼1.12
Dashboard /wp-admin2,202 ▲225.47 ▼0.1683.32 ▼13.9839.53 ▼7.26
Posts /wp-admin/edit.php2,104 ▲71.96 ▲0.0236.69 ▲1.9131.80 ▼3.97
Add New Post /wp-admin/post-new.php1,529 ▼623.45 ▼1.77687.21 ▲68.2262.60 ▲2.98
Media Library /wp-admin/upload.php1,401 ▼24.30 ▲0.14101.64 ▲0.8042.35 ▲2.55
PhotoSwipe /wp-admin/photoswipe-masonry.php260.410.0813.54

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • photoswipe_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/photoswipe-masonry/photoswipe-masonry-footer-html.php
    • > /wp-content/plugins/photoswipe-masonry/photoswipe-masonry.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/photoswipe-masonry.php
    • > Network (severe)
    wp-admin/photoswipe-masonry.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
  • Screenshots: These screenshots require images: #1 (Screenshot Default gallery layout), #2 (Screenshot Popup layout)
You can look at the official readme.txt

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

This is the main PHP file of "Photoswipe Masonry Gallery" version 1.2.26, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
89 characters long description:
This is a image gallery plugin for WordPress built using PhotoSwipe from Dmitry Semenov.

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
Success! There were no dangerous files found in this plugin4,751 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript99824273,445
CSS5184145930
PHP212682374
SVG2002

PHP code Passed 2 tests

This is a very shot review of 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.25
Average class complexity43.00
▷ Minimum class complexity43.00
▷ Maximum class complexity43.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods211.76%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
photoswipe-dist/white-skin/skin.png15.02KB0.72KB▼ 95.22%
photoswipe-dist/default-skin/default-skin.png0.53KB0.72KB0.00%