77% play-random-image

Code Review | Play Random Image Plugin

WordPress plugin Play Random Image Plugin scored77%from 54 tests.

About plugin

  • Plugin page: play-random-image
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.6
  • WordPress version: 6.3.1
  • First release: Jun 16, 2018
  • Latest release: Jun 16, 2018
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: goigi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /994 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.16MB] [CPU: ▼11.43ms] Passed 4 tests

A check of server-side resources used by Play Random Image Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0546.26 ▲5.52
Dashboard /wp-admin3.35 ▲0.0046.16 ▼9.41
Posts /wp-admin/edit.php3.40 ▲0.0446.02 ▼0.10
Add New Post /wp-admin/post-new.php5.18 ▼0.7158.29 ▼36.11
Media Library /wp-admin/upload.php3.27 ▲0.0432.86 ▼0.08
Add Gallery /wp-admin/post-new.php?post_type=random_gallery3.2735.00
All Gallery /wp-admin/edit.php?post_type=random_gallery3.3133.86

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Play Random Image Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲7514.17 ▼0.371.63 ▼0.0540.66 ▲2.34
Dashboard /wp-admin2,222 ▲455.62 ▲0.0196.52 ▲9.1743.05 ▲3.44
Posts /wp-admin/edit.php2,127 ▲272.00 ▲0.0640.31 ▲2.1236.31 ▲2.51
Add New Post /wp-admin/post-new.php1,549 ▲2123.65 ▲0.45643.73 ▼50.9753.31 ▼8.82
Media Library /wp-admin/upload.php1,430 ▲334.28 ▲0.0694.35 ▼8.3239.73 ▼5.69
Add Gallery /wp-admin/post-new.php?post_type=random_gallery2,2237.54169.5368.00
All Gallery /wp-admin/edit.php?post_type=random_gallery1,1051.9330.3628.44

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=random_gallery
    • > Notice in wp-content/plugins/play-random-image/random-gallery.php+73
    Undefined variable: post

SRP 50% from 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/play-random-image/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% 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
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #1 (screenshot-3.png)
The official readme.txt is a good inspiration

play-random-image/random-gallery.php 77% from 13 tests

"Play Random Image Plugin" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("play-random-image.php" instead of "random-gallery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin183 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3433147
CSS11036

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
5 PNG files occupy 0.99MB with 0.70MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
banner-772x250.png359.66KB119.42KB▼ 66.80%
screenshot-3.png78.44KB24.71KB▼ 68.50%
screenshot-1.png93.63KB29.66KB▼ 68.32%
icon-128x128.png49.94KB11.56KB▼ 76.85%
screenshot-2.png429.37KB106.11KB▼ 75.29%