88% jms-url-rewrite-rule

Code Review | JMS URL Rewrite Rule

WordPress plugin JMS URL Rewrite Rule scored 88% from 54 tests.

About plugin

  • Plugin page: jms-url-rewrite-rule
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.8.0
  • WordPress version: 5.8.1
  • First release: Dec 27, 2017
  • Latest release: Mar 28, 2018
  • Number of updates: 5
  • Update frequency: every 19.6 days
  • Top authors: james.liu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 421 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

A check of server-side resources used by JMS URL Rewrite Rule
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1436.14 ▲12.53
Dashboard /wp-admin3.09 ▲0.0449.12 ▲0.48
Posts /wp-admin/edit.php3.14 ▲0.0449.28 ▲3.96
Add New Post /wp-admin/post-new.php5.45 ▲0.0292.53 ▼607.63
Media Library /wp-admin/upload.php3.03 ▲0.0333.30 ▼4.40
Fixed URL /wp-admin/admin.php?page=jms-fixed-url-rewrite-menu3.0032.25
POST URL /wp-admin/admin.php?page=jms-url-rewrite-top-menu3.0030.53

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for JMS URL Rewrite Rule
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,713 ▲11716.00 ▲0.0510.44 ▼0.2345.90 ▼7.23
Dashboard /wp-admin3,001 ▲645.84 ▼0.33151.02 ▼6.17117.31 ▲0.46
Posts /wp-admin/edit.php2,773 ▲342.72 ▼0.0066.61 ▼4.9789.02 ▼0.56
Add New Post /wp-admin/post-new.php1,637 ▼4621.49 ▲3.10304.52 ▼164.49103.19 ▼17.00
Media Library /wp-admin/upload.php1,841 ▲345.04 ▼0.04172.29 ▲6.51117.37 ▲0.12
Fixed URL /wp-admin/admin.php?page=jms-fixed-url-rewrite-menu1,1262.1155.0193.70
POST URL /wp-admin/admin.php?page=jms-url-rewrite-top-menu1,1242.2162.7492.01

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/jms-url-rewrite-rule/jms-urlrewrite-rule.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/jms-url-rewrite-rule/template/fixed_url_rules.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/jms-url-rewrite-rule/template/post_url_rules.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: htaccess, url rewrite, permalink

jms-url-rewrite-rule/jms-urlrewrite-rule.php 85% from 13 tests

"JMS URL Rewrite Rule" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("jms-url-rewrite-rule.php" instead of "jms-urlrewrite-rule.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 285 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin220 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33129220

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.55
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin