78% url-redirect-and-rewrite

Code Review | Url Redirect Rewrite

WordPress plugin Url Redirect Rewrite scored78%from 54 tests.

About plugin

  • Plugin page: url-redirect-and-...
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.8.5
  • WordPress version: 6.3.1
  • First release: Feb 3, 2018
  • Latest release: Feb 5, 2018
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: gokulakrishnan (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /1,501 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.67ms] Passed 4 tests

An overview of server-side resources used by Url Redirect Rewrite
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.39 ▼7.30
Dashboard /wp-admin3.32 ▲0.0144.30 ▼7.16
Posts /wp-admin/edit.php3.37 ▲0.0147.02 ▲3.21
Add New Post /wp-admin/post-new.php5.90 ▲0.0193.84 ▲1.24
Media Library /wp-admin/upload.php3.24 ▲0.0132.99 ▼1.45
URL Redirect Rewrite /wp-admin/tools.php?page=wp_url_redirect_rewrite3.2430.08

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
url_redirect_rewrite_map
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Url Redirect Rewrite
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.60 ▼0.771.84 ▲0.1242.20 ▼1.90
Dashboard /wp-admin2,210 ▲224.84 ▼1.06111.05 ▼3.4941.64 ▼8.21
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0039.77 ▲2.4234.04 ▼3.23
Add New Post /wp-admin/post-new.php1,542 ▲1323.35 ▲5.05668.46 ▲54.9057.37 ▲7.43
Media Library /wp-admin/upload.php1,392 ▲14.19 ▼0.0496.38 ▼4.0541.28 ▼4.01
URL Redirect Rewrite /wp-admin/tools.php?page=wp_url_redirect_rewrite7191.146.8617.15

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 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • url_redirect_rewrite_map
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/tools.php?page=wp_url_redirect_rewrite
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/url-redirect-and-rewrite/templates/tools.php on line 29 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/url-redirect-and-rewrite/templates/tools.php(29): do_settings_fields()
    #1 wp-content/plugins/url-redirect-and-rewrite/url-redirect-rewrite.php(135): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): URL_Redirect_Rewrite->url_redirect_rewrite_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/tools.php(40): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

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 take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/url-redirect-and-rewrite/url-redirect-rewrite.php:190
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/url-redirect-and-rewrite/templates/tools.php:28
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/url-redirect-and-rewrite/templates/tools.php on line 3
    • > PHP Notice
      Undefined variable: map in wp-content/plugins/url-redirect-and-rewrite/templates/tools.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: redirect, url rewrite, redirecting, rewriting, rewrite...

url-redirect-and-rewrite/url-redirect-rewrite.php 85% from 13 tests

Analyzing the main PHP file in "Url Redirect Rewrite" version 0.0.1
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("url-redirect-and-rewrite.php" instead of "url-redirect-rewrite.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
Good job! No executable or dangerous file extensions detected253 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP26234206
JavaScript112047

PHP code Passed 2 tests

Analyzing 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.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods228.57%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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