84% random-page-redirect-for-wordpress

Code Review | Random Post Redirect for WordPress

WordPress plugin Random Post Redirect for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: random-page-redir...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.5.0
  • WordPress version: 6.3.1
  • First release: May 24, 2012
  • Latest release: Apr 6, 2016
  • Number of updates: 8
  • Update frequency: every 176.8 days
  • Top authors: christopherross (87.5%)nickadamstv (25%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /2,984 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.00MB] [CPU: ▼12.06ms] Passed 4 tests

A check of server-side resources used by Random Post Redirect for WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.17 ▼3.88
Dashboard /wp-admin3.31 ▼0.0345.99 ▼16.70
Posts /wp-admin/edit.php3.36 ▲0.0147.73 ▼6.44
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.35 ▼21.21
Media Library /wp-admin/upload.php3.23 ▲0.0036.56 ▼0.73

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Random Post Redirect for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.73 ▲0.391.65 ▲0.1741.08 ▼1.07
Dashboard /wp-admin2,198 ▲215.61 ▲0.0493.50 ▲8.8738.36 ▼1.27
Posts /wp-admin/edit.php2,100 ▼32.02 ▲0.0242.40 ▲2.1439.48 ▲0.18
Add New Post /wp-admin/post-new.php1,526 ▼1122.95 ▲4.90654.44 ▲30.5451.82 ▼14.93
Media Library /wp-admin/upload.php1,403 ▲34.20 ▲0.0293.77 ▼11.0740.26 ▼4.33

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/random-page-redirect-for-wordpress/random-post-redirect-for-wordpress.php:38

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: wordpress, redirect, random

random-page-redirect-for-wordpress/random-post-redirect-for-wordpress.php 92% from 13 tests

The main file in "Random Post Redirect for WordPress" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("random-page-redirect-for-wordpress.php" instead of "random-post-redirect-for-wordpress.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin10 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP162210

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code1.00
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
PNG images were not found in this plugin