89% simple-301-redirects

Code Review | Simple 301 Redirects by BetterLinks

WordPress plugin Simple 301 Redirects by BetterLinks scored89%from 54 tests.

About plugin

  • Plugin page: simple-301-redirects
  • Plugin version: 2.0.9
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 2, 2009
  • Latest release: Sep 27, 2023
  • Number of updates: 64
  • Update frequency: every 80.3 days
  • Top authors: scottnelle (62.5%)re_enter_rupok (15.63%)Asif2BD (12.5%)priyomukul (9.38%)wpdevteam (6.25%)

Code review

54 tests

User reviews

161 reviews

Install metrics

200,000+ active /2,367,507 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.29MB] [CPU: ▼4.07ms] Passed 4 tests

Server-side resources used by Simple 301 Redirects by BetterLinks
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0840.77 ▲4.43
Dashboard /wp-admin3.72 ▲0.3748.06 ▼13.20
Posts /wp-admin/edit.php3.77 ▲0.4150.14 ▲4.16
Add New Post /wp-admin/post-new.php6.23 ▲0.3588.93 ▼10.90
Media Library /wp-admin/upload.php3.58 ▲0.3540.62 ▲3.66
301 Redirects /wp-admin/options-general.php?page=301options3.5535.81

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 33 new files
Database: no new tables, 7 new options
New WordPress options
simple301redirects_version
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Simple 301 Redirects by BetterLinks
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.10 ▼1.271.95 ▲0.3439.21 ▼2.16
Dashboard /wp-admin2,230 ▲395.83 ▲0.8095.33 ▼5.8140.91 ▲1.13
Posts /wp-admin/edit.php2,115 ▲262.01 ▼0.0035.74 ▲0.7834.10 ▲0.50
Add New Post /wp-admin/post-new.php1,572 ▲5823.25 ▲5.83674.58 ▼0.9553.09 ▼0.75
Media Library /wp-admin/upload.php1,415 ▲274.29 ▲0.11112.05 ▼1.0547.45 ▼3.12
301 Redirects /wp-admin/options-general.php?page=301options1,1172.6750.4548.09

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • simple301redirects_version
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

simple-301-redirects/wp-simple-301-redirects.php 92% from 13 tests

"Simple 301 Redirects by BetterLinks" version 2.0.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("simple-301-redirects.php" instead of "wp-simple-301-redirects.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin1,903 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP193205161,694
SVG807202
JSON1005
CSS1001
JavaScript1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity23.31
▷ Minimum class complexity1.00
▷ Maximum class complexity119.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes17.69%
Methods110
▷ Static methods2320.91%
▷ Public methods10191.82%
▷ Protected methods43.64%
▷ Private methods54.55%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants11
▷ Global constants981.82%
▷ Class constants218.18%
▷ Public constants2100.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