93% load-random-post

Code Review | Load Random Post

WordPress plugin Load Random Post scored 93% from 54 tests.

About plugin

  • Plugin page: load-random-post
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.4
  • WordPress version: 5.8.1
  • First release: Feb 25, 2018
  • Latest release: Feb 25, 2018
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: appsoln (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,694 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

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

A check of server-side resources used by Load Random Post
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1236.50 ▲15.34
Dashboard /wp-admin3.06 ▲0.0151.19 ▲1.68
Posts /wp-admin/edit.php3.11 ▲0.0150.35 ▲5.18
Add New Post /wp-admin/post-new.php5.42 ▼0.0197.65 ▼634.81
Media Library /wp-admin/upload.php3.00 ▲0.0030.12 ▼6.26

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Load Random Post: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲9716.04 ▲0.5112.27 ▼0.8749.20 ▲0.39
Dashboard /wp-admin2,967 ▲365.92 ▼0.15172.74 ▲15.05114.22 ▲9.74
Posts /wp-admin/edit.php2,739 ▼02.70 ▼0.0176.59 ▲7.5188.37 ▼10.55
Add New Post /wp-admin/post-new.php3,634 ▲1,95114.98 ▼3.85512.27 ▲93.90115.90 ▲6.62
Media Library /wp-admin/upload.php1,807 ▼04.99 ▼0.07183.62 ▲18.74116.86 ▼0.49

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/load-random-post/LoadRandomPost.php:40

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Donate link: Invalid url: ""
  • Plugin Name: Please specify the plugin name on the first line ( === load-random-post === )
The official readme.txt is a good inspiration

load-random-post/LoadRandomPost.php 92% from 13 tests

The entry point to "Load Random Post" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("load-random-post.php" instead of "LoadRandomPost.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected21 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP141621

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin