84% simple-www-redirect

Code Review | Simple WWW Redirect

WordPress plugin Simple WWW Redirect scored84%from 54 tests.

About plugin

  • Plugin page: simple-www-redirect
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Sep 17, 2019
  • Latest release: May 18, 2022
  • Number of updates: 16
  • Update frequency: every 60.9 days
  • Top authors: lightplugins (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /11,686 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

Analyzing server-side resources used by Simple WWW Redirect
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0345.36 ▲2.26
Dashboard /wp-admin3.34 ▲0.0451.63 ▼3.19
Posts /wp-admin/edit.php3.39 ▲0.0453.65 ▲0.27
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.60 ▼18.14
Media Library /wp-admin/upload.php3.26 ▲0.0338.80 ▼0.95
Simple www Redirect /wp-admin/options-general.php?page=simple-www-redirect3.2335.41

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Simple WWW Redirect
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.28 ▼0.091.95 ▲0.1646.72 ▲1.90
Dashboard /wp-admin2,193 ▲195.54 ▲0.0184.18 ▼11.2742.58 ▲1.58
Posts /wp-admin/edit.php2,101 ▲11.99 ▲0.0238.05 ▲0.5235.04 ▼0.04
Add New Post /wp-admin/post-new.php1,529 ▲123.61 ▲0.73713.41 ▲33.1953.82 ▼6.57
Media Library /wp-admin/upload.php1,404 ▲74.20 ▲0.01103.37 ▼14.3647.12 ▼2.18
Simple www Redirect /wp-admin/options-general.php?page=simple-www-redirect8091.6527.2633.07

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/simple-www-redirect/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
5 plugin tags: disable, www, redirect, world wide web, non-www

simple-www-redirect/index.php 85% from 13 tests

The main PHP script in "Simple WWW Redirect" version 1.0.2 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simple-www-redirect.php" instead of "index.php")

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
Success! There were no dangerous files found in this plugin234 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP19462149
CSS114072
JavaScript15313

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
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%
Functions10
▷ Named functions10100.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