78% better-random-redirect

Code Review | Better Random Redirect

WordPress plugin Better Random Redirect scored 78% from 54 tests.

About plugin

  • Plugin page: better-random-red...
  • Plugin version: 1.3.16
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.8
  • WordPress version: 6.3.1
  • First release: Dec 6, 2014
  • Latest release: Nov 18, 2021
  • Number of updates: 45
  • Update frequency: every 56.4 days
  • Top authors: robert.peake (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active / 21,964 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.49ms] Passed 4 tests

Server-side resources used by Better Random Redirect
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0233.99 ▼9.62
Dashboard /wp-admin3.34 ▲0.0346.51 ▼1.99
Posts /wp-admin/edit.php3.39 ▲0.0349.65 ▲2.71
Add New Post /wp-admin/post-new.php5.92 ▲0.0382.35 ▼21.32
Media Library /wp-admin/upload.php3.26 ▲0.0336.69 ▼1.03
Better Random Redirect /wp-admin/options-general.php?page=better-random-redirect/admin.php3.2935.15

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 14 new options
New WordPress options
brr_default_timeout
brr_default_category
widget_recent-posts
widget_recent-comments
brr_transient_id
theysaidso_admin_options
brr_query_posttype_category_pattern
can_compress_scripts
widget_theysaidso_widget
brr_default_slug
...

Browser metrics Passed 4 tests

A check of browser resources used by Better Random Redirect
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4714.80 ▲0.431.62 ▼0.4644.74 ▲0.43
Dashboard /wp-admin2,210 ▲254.85 ▼0.02106.62 ▼13.2641.93 ▼3.71
Posts /wp-admin/edit.php2,093 ▲72.05 ▲0.0335.88 ▼3.8531.22 ▼2.82
Add New Post /wp-admin/post-new.php1,536 ▲2222.88 ▲5.39647.33 ▼4.0858.02 ▲2.49
Media Library /wp-admin/upload.php1,392 ▲74.19 ▲0.01101.21 ▲3.5745.98 ▲3.27
Better Random Redirect /wp-admin/options-general.php?page=better-random-redirect/admin.php1,0111.8327.7832.17

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 14 options
    • widget_recent-posts
    • brr_transient_id
    • brr_query_posttype_pattern
    • can_compress_scripts
    • widget_recent-comments
    • brr_query_posttype_category_pattern
    • brr_default_slug
    • brr_default_posttype
    • brr_default_category
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=better-random-redirect/admin.php
    • > Notice in wp-content/plugins/better-random-redirect/admin.php+87
    Undefined variable: lang
    • > GET request to /wp-admin/options-general.php?page=better-random-redirect/admin.php
    • > Notice in wp-content/plugins/better-random-redirect/classes/QtranslatexFilter.php+66
    Undefined variable: output

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
Please take a closer look at the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'BrrFilter' not found in wp-content/plugins/better-random-redirect/classes/QtranslatexFilter.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/better-random-redirect/admin.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === better-random-redirect === )
The official readme.txt is a good inspiration

better-random-redirect/better-random-redirect.php 92% from 13 tests

"Better Random Redirect" version 1.3.16's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

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 detected535 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP55342460
PO File1276175

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity22.67
▷ Minimum class complexity2.00
▷ Maximum class complexity55.00
Average method complexity3.71
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods24
▷ Static methods24100.00%
▷ Public methods2395.83%
▷ Protected methods00.00%
▷ Private methods14.17%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin