68% show-random-post

Code Review | Show_Random_Post

WordPress plugin Show_Random_Post scored68%from 54 tests.

About plugin

  • Plugin page: show-random-post
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.3.1
  • WordPress version: 6.3.1
  • First release: Oct 9, 2015
  • Latest release: Oct 11, 2015
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: k2klettern (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /675 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.89MB] [CPU: ▼36.42ms] Passed 4 tests

Server-side resources used by Show_Random_Post
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0229.02 ▼18.18
Dashboard /wp-admin3.06 ▼0.2924.07 ▼36.94
Posts /wp-admin/edit.php3.06 ▼0.3026.93 ▼20.62
Add New Post /wp-admin/post-new.php3.06 ▼2.8327.60 ▼69.92
Media Library /wp-admin/upload.php3.06 ▼0.1724.26 ▼13.55
Show Random Post Options /wp-admin/tools.php?page=showrandompost-plugin3.0626.44

Server storage [IO: ▲0.31MB] [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, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_showrandompost_widget
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Show_Random_Post
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲15213.47 ▼0.889.01 ▲7.2844.87 ▼0.88
Dashboard /wp-admin2,199 ▲195.52 ▼0.1484.00 ▼9.1838.45 ▼3.70
Posts /wp-admin/edit.php2,104 ▲11.98 ▲0.0436.26 ▼3.1035.59 ▼1.15
Add New Post /wp-admin/post-new.php1,529 ▲122.81 ▼0.18657.34 ▼5.3452.78 ▼1.21
Media Library /wp-admin/upload.php1,404 ▲44.19 ▼0.04106.28 ▼3.8346.41 ▼0.69
Show Random Post Options /wp-admin/tools.php?page=showrandompost-plugin7802.0224.5627.23

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_showrandompost_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/tools.php?page=showrandompost-plugin
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

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 fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/show-random-post/lib/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/show-random-post/lib/functions.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/show-random-post/show_random_post.php:28

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 errors were detected

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 need to be fixed:
  • Screenshots: These screenshots require images: #1 (Widgets created), #2 (Drop your widget to the Sidebar of your choice), #3 (Select which categories of post you want to show), #4 (Select the time for the loop), #5 (You can drop how many widgets you want to show with diferent categories), #6 (This is how every widget will load the posts, and will change automatically on the set time)
You can look at the official readme.txt

show-random-post/show_random_post.php 92% from 13 tests

The principal PHP file in "Show_Random_Post" v. 0.1.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("show-random-post.php" instead of "show_random_post.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
Good job! No executable or dangerous file extensions detected296 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP45234261
JavaScript10335

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity8.50
▷ Minimum class complexity3.00
▷ Maximum class complexity14.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/noimage.png4.98KB3.65KB▼ 26.66%