84% page-guard-redirect

Code Review | Page Guard Redirect

WordPress plugin Page Guard Redirect scored84%from 54 tests.

About plugin

  • Plugin page: page-guard-redirect
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0.1
  • WordPress version: 6.3.1
  • First release: Mar 21, 2017
  • Latest release: Aug 22, 2022
  • Number of updates: 5
  • Update frequency: every 395.4 days
  • Top authors: fculross (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /506 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼9.46ms] Passed 4 tests

A check of server-side resources used by Page Guard Redirect
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.76 ▲0.93
Dashboard /wp-admin3.38 ▲0.0742.73 ▼6.50
Posts /wp-admin/edit.php3.41 ▲0.0542.39 ▼5.18
Add New Post /wp-admin/post-new.php6.05 ▲0.1670.73 ▼27.10
Media Library /wp-admin/upload.php3.31 ▲0.0933.47 ▲1.16

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Page Guard Redirect: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.35 ▼1.051.69 ▼0.1043.33 ▲0.99
Dashboard /wp-admin2,206 ▲145.86 ▲0.87103.89 ▼4.1740.17 ▼3.94
Posts /wp-admin/edit.php2,089 ▼01.97 ▼0.0637.73 ▼3.8932.34 ▼2.71
Add New Post /wp-admin/post-new.php1,542 ▲2318.28 ▼4.93602.72 ▼34.3358.22 ▲5.00
Media Library /wp-admin/upload.php1,385 ▲34.21 ▲0.0496.67 ▼3.7841.84 ▼2.95

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/page-guard-redirect/pg-redirect.php:50

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 issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: url params, url, urlparam, redirect, query string...

page-guard-redirect/pg-redirect.php 92% from 13 tests

The principal PHP file in "Page Guard Redirect" v. 1.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("page-guard-redirect.php" instead of "pg-redirect.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected41 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1155141

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
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%
Functions2
▷ Named functions2100.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
No PNG files were detected