72% simple-photoswipe

Code Review | Simple Photoswipe

WordPress plugin Simple Photoswipe scored72%from 54 tests.

About plugin

  • Plugin page: simple-photoswipe
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.1
  • WordPress version: 6.3.1
  • First release: Jan 14, 2015
  • Latest release: Jan 14, 2015
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: zitscher (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /3,724 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼5.92ms] Passed 4 tests

Server-side resources used by Simple Photoswipe
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.43 ▲1.65
Dashboard /wp-admin3.31 ▼0.0344.12 ▼17.51
Posts /wp-admin/edit.php3.36 ▲0.0145.38 ▲2.01
Add New Post /wp-admin/post-new.php5.89 ▲0.0181.82 ▼9.82
Media Library /wp-admin/upload.php3.24 ▲0.0136.25 ▲4.41

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Simple Photoswipe
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,874 ▲12814.46 ▼0.312.06 ▲0.2942.28 ▼3.11
Dashboard /wp-admin2,208 ▲205.80 ▲0.9197.54 ▼18.6436.63 ▼8.05
Posts /wp-admin/edit.php2,094 ▲22.02 ▲0.0236.16 ▼2.8033.24 ▼0.41
Add New Post /wp-admin/post-new.php1,532 ▲1323.50 ▲0.24686.31 ▼0.0451.03 ▼0.38
Media Library /wp-admin/upload.php1,393 ▲24.27 ▲0.0693.93 ▼9.6642.50 ▼2.29
Simple PhotoSwipe /wp-admin/admin-options.php260.440.1313.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • photoswipe_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/simple-photoswipe/simple-photoswipe.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/simple-photoswipe/custom-gallery.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-photoswipe/photoswipe/photoswipe-ui.php:839
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-photoswipe/photoswipe/photoswipe-template.php:49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-photoswipe/admin-options.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-photoswipe/photoswipe/photoswipe-init.php:208

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin-options.php
    • > Network (severe)
    wp-admin/admin-options.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 an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
  • Screenshots: Add images for these screenshots: #1 (Built in Wordpress Gallery with Masonry CSS Styles (noJS)), #2 (Photoswipe in all it’s glory), #3 (Simple Photoswipe Admin Settings Section), #4 (Disable proportional thumbnails)
You can look at the official readme.txt

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

"Simple Photoswipe" version 0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
67 characters long description:
A simple plugin for galleries using PhotoSwipe from Dmitry Semenov.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin1,571 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP62651001,088
CSS3825466
Markdown19015
JavaScript1031
SVG1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity5.33
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods3100.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.18MB with 0.06MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png182.87KB62.45KB▼ 65.85%
lib/default-skin/default-skin.png0.53KB0.72KB0.00%