89% prettyphoto

Code Review | WordPress prettyPhoto

WordPress plugin WordPress prettyPhoto scored89%from 54 tests.

About plugin

  • Plugin page: prettyphoto
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.6
  • WordPress version: 6.3.1
  • First release: Jan 26, 2013
  • Latest release: Nov 26, 2020
  • Number of updates: 13
  • Update frequency: every 220.6 days
  • Top authors: Litonice13 (53.85%)ibabar (53.85%)

Code review

54 tests

User reviews

15 reviews

Install metrics

4,000+ active /81,970 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼1.96ms] Passed 4 tests

Analyzing server-side resources used by WordPress prettyPhoto
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0639.49 ▼5.79
Dashboard /wp-admin3.36 ▲0.0648.95 ▲1.07
Posts /wp-admin/edit.php3.41 ▲0.0543.29 ▲0.42
Add New Post /wp-admin/post-new.php5.94 ▲0.0584.06 ▼3.53
Media Library /wp-admin/upload.php3.28 ▲0.0536.20 ▲2.65

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

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

Browser metrics Passed 4 tests

WordPress prettyPhoto: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲14213.64 ▼0.7510.17 ▲8.0342.85 ▼0.33
Dashboard /wp-admin2,211 ▲234.85 ▼1.0499.37 ▼20.1739.61 ▼6.11
Posts /wp-admin/edit.php2,088 ▼12.00 ▼0.0235.39 ▼1.6033.50 ▼1.65
Add New Post /wp-admin/post-new.php1,535 ▲623.16 ▲4.93671.93 ▲42.2154.88 ▲13.05
Media Library /wp-admin/upload.php1,393 ▲54.21 ▼0.0594.58 ▼6.1641.74 ▼2.45

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Enable/Disable prettyPhoto), #2 (Image Popup), #3 (Elementor Addon)
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt might help

prettyphoto/prettyphoto.php 92% from 13 tests

"WordPress prettyPhoto" version 1.2.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("3.1" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected416 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP310336245
CSS100170
JavaScript1061

PHP code Passed 2 tests

A brief analysis 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.23
Average class complexity9.50
▷ Minimum class complexity4.00
▷ Maximum class complexity15.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods24
▷ Static methods14.17%
▷ Public methods2291.67%
▷ Protected methods28.33%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants777.78%
▷ Class constants222.22%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
30 PNG files occupy 1.41MB with 0.58MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/prettyPhoto/default/sprite.png6.53KB3.21KB▼ 50.87%
images/prettyPhoto/facebook/btnPrevious.png0.81KB0.58KB▼ 27.90%
images/prettyPhoto/light_rounded/sprite.png4.00KB2.56KB▼ 36.16%
images/prettyPhoto/light_square/btnNext.png1.38KB1.14KB▼ 17.29%
screenshot-2.png1,292.83KB338.04KB▼ 73.85%