84% simple-website-redirect

Code Review | Simple Website Redirect

WordPress plugin Simple Website Redirect scored84%from 54 tests.

About plugin

  • Plugin page: simple-website-re...
  • Plugin version: 1.2.8
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Feb 6, 2018
  • Latest release: Sep 29, 2021
  • Number of updates: 17
  • Update frequency: every 78.3 days
  • Top authors: woodent (64.71%)wpscholar (41.18%)

Code review

54 tests

User reviews

21 reviews

Install metrics

8,000+ active /126,304 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
Installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼0.21ms] Passed 4 tests

This is a short check of server-side resources used by Simple Website Redirect
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1741.60 ▼1.27
Dashboard /wp-admin3.54 ▲0.2447.87 ▼0.17
Posts /wp-admin/edit.php3.60 ▲0.2450.20 ▼0.48
Add New Post /wp-admin/post-new.php6.06 ▲0.1895.26 ▲1.45
Media Library /wp-admin/upload.php3.40 ▲0.1836.71 ▲1.07
Website Redirect /wp-admin/options-general.php?page=simple-website-redirect3.3734.76

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Simple Website Redirect
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.37 ▼1.231.81 ▼0.4240.59 ▼5.10
Dashboard /wp-admin2,210 ▲255.84 ▼0.01106.75 ▼2.8141.35 ▼3.46
Posts /wp-admin/edit.php2,090 ▲221.97 ▼0.0239.60 ▲2.9234.82 ▲2.28
Add New Post /wp-admin/post-new.php1,545 ▲1118.65 ▼4.62604.66 ▼63.8450.87 ▼10.63
Media Library /wp-admin/upload.php1,392 ▲134.19 ▼0.0897.72 ▼5.8142.21 ▼2.06
Website Redirect /wp-admin/options-general.php?page=simple-website-redirect8911.7226.8529.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
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 load_plugin_textdomain() in wp-content/plugins/simple-website-redirect/SimpleWebsiteRedirect.php:60

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: redirect, redirection, forwarding, site, website...

simple-website-redirect/SimpleWebsiteRedirect.php 92% from 13 tests

The main PHP file in "Simple Website Redirect" ver. 1.2.8 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-website-redirect.php" instead of "SimpleWebsiteRedirect.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected1,176 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP112607361,129
JSON10047

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity26.83
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods86
▷ Static methods4956.98%
▷ Public methods8497.67%
▷ Protected methods00.00%
▷ Private methods22.33%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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