84% random-gallery

Code Review | Random Gallery

WordPress plugin Random Gallery scored84%from 54 tests.

About plugin

  • Plugin page: random-gallery
  • Plugin version: 00.08
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Mar 23, 2015
  • Latest release: Apr 2, 2023
  • Number of updates: 33
  • Update frequency: every 88.9 days
  • Top authors: David Greenwold (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

300+ active /5,262 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

A check of server-side resources used by Random Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.02 ▼6.48
Dashboard /wp-admin3.31 ▲0.0047.70 ▼4.17
Posts /wp-admin/edit.php3.36 ▲0.0051.85 ▲2.15
Add New Post /wp-admin/post-new.php5.89 ▲0.0099.80 ▼1.11
Media Library /wp-admin/upload.php3.23 ▲0.0037.55 ▲3.29

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

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

Browser metrics Passed 4 tests

Random Gallery: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.29 ▼1.331.84 ▼0.1444.23 ▼0.62
Dashboard /wp-admin2,209 ▲215.90 ▲0.0999.98 ▼20.5139.52 ▼3.09
Posts /wp-admin/edit.php2,092 ▼02.02 ▼0.0240.10 ▲3.3336.96 ▲1.36
Add New Post /wp-admin/post-new.php1,534 ▼023.18 ▼0.08654.53 ▼12.7565.19 ▲13.84
Media Library /wp-admin/upload.php1,388 ▼04.26 ▼0.0097.02 ▼9.3745.19 ▼1.72

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

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 everything seems fine, this is not 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/random-gallery/random-gallery.php:86

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: gallery, category, subset, images, random

random-gallery/random-gallery.php Passed 13 tests

"Random Gallery" version 00.08's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
92 characters long description:
Random Gallery displays a different subset of your images every time your page is refreshed.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected58 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP162258

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity15.00
▷ Minimum method complexity15.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods1100.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected