94% photo-swipe

Code Review | PhotoSwipe

WordPress plugin PhotoSwipe scored 94% from 54 tests.

About plugin

  • Plugin page: photo-swipe
  • Plugin version: 4.1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.0
  • WordPress version: 5.8.1
  • First release: Feb 25, 2015
  • Latest release: Mar 17, 2016
  • Number of updates: 39
  • Update frequency: every 9.9 days
  • Top authors: louyx (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

3,000+ active / 28,133 total downloads

Benchmarks

Plugin footprint Passed 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 successfully, without throwing any errors or notices

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

Analyzing server-side resources used by PhotoSwipe
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1438.31 ▲15.88
Dashboard /wp-admin3.08 ▲0.0239.96 ▼6.16
Posts /wp-admin/edit.php3.14 ▲0.0248.81 ▼1.72
Add New Post /wp-admin/post-new.php5.44 ▲0.0088.13 ▼580.26
Media Library /wp-admin/upload.php3.03 ▲0.0237.28 ▲1.20

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by PhotoSwipe
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,901 ▲29516.31 ▲0.3714.70 ▲1.9544.89 ▼7.30
Dashboard /wp-admin2,973 ▲425.94 ▼0.09138.39 ▼13.98117.52 ▼4.99
Posts /wp-admin/edit.php2,739 ▲32.72 ▲0.0266.10 ▼2.31101.21 ▲0.70
Add New Post /wp-admin/post-new.php1,676 ▲17818.85 ▲0.02400.41 ▲33.40125.41 ▲2.10
Media Library /wp-admin/upload.php1,810 ▼05.01 ▼0.00151.39 ▲3.95124.72 ▼0.90

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

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 no errors were found, 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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/photo-swipe/photo-swipe.php:48

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (PhotoSwipe Website) image required
You can look at the official readme.txt

photo-swipe/photo-swipe.php Passed 13 tests

The main PHP file in "PhotoSwipe" ver. 4.1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
73 characters long description:
A very light implementation of PhotoSwipe javascript plugin for WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected3,936 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript59443963,329
CSS29487479
PHP12526127
SVG1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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.27MB with 0.10MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/default-skin/default-skin.png0.53KB0.72KB0.00%
screenshot-1.png280.53KB80.48KB▼ 71.31%