10% downloadable-gallery

Code Review | downloadable gallery

WordPress plugin downloadable gallery scored10%from 54 tests.

About plugin

  • Plugin page: downloadable-gallery
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 6.3.1
  • First release: Nov 9, 2014
  • Latest release: Jan 8, 2017
  • Number of updates: 22
  • Update frequency: every 36.1 days
  • Top authors: jondor (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /4,025 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/downloadable-gallery/downloadable_gallery-plugin.php+20
    Declaration of downloadable_gallery_class::pluginInfoRight($info) should be compatible with basic_plugin_class::pluginInfoRight($info, $added = false)

Server metrics [RAM: ▼1.90MB] [CPU: ▼53.89ms] Passed 4 tests

Analyzing server-side resources used by downloadable gallery
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.385.05 ▼38.78
Dashboard /wp-admin2.10 ▼1.205.95 ▼45.32
Posts /wp-admin/edit.php2.11 ▼1.256.48 ▼42.48
Add New Post /wp-admin/post-new.php2.10 ▼3.787.56 ▼88.96
Media Library /wp-admin/upload.php2.10 ▼1.126.07 ▼34.87
Funsite plugins /wp-admin/plugins.php?page=funsite_plugins2.115.67

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by downloadable gallery
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.35 ▼0.211.68 ▲0.0244.68 ▼5.94
Dashboard /wp-admin2,200 ▲205.64 ▼0.0296.83 ▼5.2941.90 ▼0.72
Posts /wp-admin/edit.php2,108 ▲82.01 ▲0.0039.94 ▲5.8535.10 ▼7.39
Add New Post /wp-admin/post-new.php1,533 ▲722.99 ▲0.08651.91 ▼18.5559.53 ▼13.68
Media Library /wp-admin/upload.php1,405 ▲54.22 ▲0.05101.85 ▼14.1343.03 ▼5.95
Funsite plugins /wp-admin/plugins.php?page=funsite_plugins8272.0025.4825.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/downloadable-gallery/downloadable_gallery-plugin.php+20
    Declaration of downloadable_gallery_class::pluginInfoRight($info) should be compatible with basic_plugin_class::pluginInfoRight($info, $added = false)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/plugins.php?page=funsite_plugins
    • > Warning in wp-content/plugins/downloadable-gallery/downloadable_gallery-plugin.php+20
    Declaration of downloadable_gallery_class::pluginInfoRight($info) should be compatible with basic_plugin_class::pluginInfoRight($info, $added = false)

SRP Passed 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
The SRP test was a success

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

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === downloadable-gallery === )
You can take inspiration from this readme.txt

downloadable-gallery/downloadable_gallery.php 92% from 13 tests

The primary PHP file in "downloadable gallery" version 1.3 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("downloadable-gallery.php" instead of "downloadable_gallery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected185 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS2210100
PHP2191854
PO File13525
JavaScript1006

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.17
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
basics/icon-128x128.png20.08KB8.01KB▼ 60.11%