84% hot-random-image

Code Review | Hot Random Image

WordPress plugin Hot Random Image scored 84% from 54 tests.

About plugin

  • Plugin page: hot-random-image
  • Plugin version: 1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.3
  • WordPress version: 6.3.1
  • First release: Dec 28, 2014
  • Latest release: Aug 23, 2023
  • Number of updates: 39
  • Update frequency: every 81.0 days
  • Top authors: hotwptemplates (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

3,000+ active / 32,977 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▲3.35ms] Passed 4 tests

Analyzing server-side resources used by Hot Random Image
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0846.94 ▲4.13
Dashboard /wp-admin3.38 ▲0.0755.71 ▲2.22
Posts /wp-admin/edit.php3.43 ▲0.0756.85 ▲5.21
Add New Post /wp-admin/post-new.php5.96 ▲0.0794.61 ▲2.32
Media Library /wp-admin/upload.php3.30 ▲0.0742.36 ▲4.71

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_hot-random_image
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Hot Random Image
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▼913.29 ▼1.414.45 ▲2.2241.09 ▼4.33
Dashboard /wp-admin2,206 ▼05.90 ▲0.03107.34 ▼4.2143.87 ▲5.58
Posts /wp-admin/edit.php2,089 ▼32.04 ▲0.0040.24 ▲0.0436.38 ▲0.93
Add New Post /wp-admin/post-new.php1,533 ▼023.06 ▼0.07712.43 ▲9.1773.77 ▲17.65
Media Library /wp-admin/upload.php1,385 ▼04.24 ▲0.04100.23 ▼1.9241.48 ▼0.87

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_hot-random_image
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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 take a closer look at the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hot-random-image/hot_random_image.php:19

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === hot-random-image === )
The official readme.txt might help

hot-random-image/hot_random_image.php 92% from 13 tests

The main PHP file in "Hot Random Image" ver. 1.8 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hot-random-image.php" instead of "hot_random_image.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
No dangerous file extensions were detected195 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP178224151
PO File1111144

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity42.00
▷ Minimum class complexity42.00
▷ Maximum class complexity42.00
Average method complexity6.86
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.02MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png23.07KB22.18KB▼ 3.84%