83% random-post-redirect-also-with-shortcode

Code Review | Random Post Redirect (also with Shortcode)

WordPress plugin Random Post Redirect (also with Shortcode) scored83%from 54 tests.

About plugin

  • Plugin page: random-post-redir...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Mar 15, 2018
  • Latest release: Mar 15, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: dpoakaspine (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /488 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.77ms] Passed 4 tests

An overview of server-side resources used by Random Post Redirect (also with Shortcode)
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0144.05 ▼0.94
Dashboard /wp-admin3.32 ▲0.0153.94 ▼7.40
Posts /wp-admin/edit.php3.37 ▲0.0149.36 ▼1.46
Add New Post /wp-admin/post-new.php5.90 ▲0.0187.60 ▼15.12
Media Library /wp-admin/upload.php3.25 ▲0.0136.43 ▼3.10

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Random Post Redirect (also with Shortcode)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.15 ▼0.411.75 ▼0.3944.47 ▲0.00
Dashboard /wp-admin2,195 ▲215.50 ▼0.0185.70 ▼13.9037.16 ▼7.21
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0836.44 ▼0.7033.04 ▼3.50
Add New Post /wp-admin/post-new.php1,526 ▼923.05 ▲4.89651.88 ▼37.6164.55 ▲9.43
Media Library /wp-admin/upload.php1,397 ▲34.23 ▲0.0696.57 ▼7.3743.42 ▼0.20

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 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-post-redirect-also-with-shortcode/index.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Requires php: The plugin version is formatted incorrectly
  • Contributors: The plugin contributors field is not present
You can take inspiration from this readme.txt

random-post-redirect-also-with-shortcode/index.php 92% from 13 tests

The main file in "Random Post Redirect (also with Shortcode)" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("random-post-redirect-also-with-shortcode.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected43 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP181343

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
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%
Functions5
▷ Named functions5100.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