10% allowed-routes

Code Review | Allowed Routes

WordPress plugin Allowed Routes scored10%from 54 tests.

About plugin

  • Plugin page: allowed-routes
  • Plugin version: 1.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.3
  • WordPress version: 6.3.1
  • First release: Dec 7, 2017
  • Latest release: Sep 26, 2019
  • Number of updates: 7
  • Update frequency: every 94.0 days
  • Top authors: nerdismftw (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /874 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/allowed-routes/allowedroutes.php+28
    Use of undefined constant ALWDRTS_DISABLE_ROUTING - assumed 'ALWDRTS_DISABLE_ROUTING' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.90MB] [CPU: ▼52.58ms] Passed 4 tests

Server-side resources used by Allowed Routes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.374.82 ▼33.59
Dashboard /wp-admin2.11 ▼1.196.32 ▼43.63
Posts /wp-admin/edit.php2.11 ▼1.246.78 ▼43.74
Add New Post /wp-admin/post-new.php2.11 ▼3.785.98 ▼89.36
Media Library /wp-admin/upload.php2.11 ▼1.125.60 ▼29.10

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Allowed Routes
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲5113.24 ▼1.154.23 ▲2.2543.42 ▲0.49
Dashboard /wp-admin2,231 ▲454.84 ▼1.04107.63 ▼17.1739.66 ▼7.10
Posts /wp-admin/edit.php2,111 ▲222.02 ▲0.0233.70 ▼6.9533.35 ▼7.11
Add New Post /wp-admin/post-new.php1,533 ▲223.23 ▲0.24663.30 ▲11.6468.46 ▲15.09
Media Library /wp-admin/upload.php1,410 ▲254.21 ▲0.0294.83 ▼10.1443.39 ▼4.03

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/allowed-routes/allowedroutes.php+28
    Use of undefined constant ALWDRTS_DISABLE_ROUTING - assumed 'ALWDRTS_DISABLE_ROUTING' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 7 options in the database
    • enabled
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% 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 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 items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/allowed-routes/allowedroutes.php
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/allowed-routes/partials/part_tab1content.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'AlwdRts_AbstractFunctions' not found in wp-content/plugins/allowed-routes/classes/class.router.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/allowed-routes/partials/part_tab2sidebar.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_site_url() in wp-content/plugins/allowed-routes/partials/part_tab2content.php:19
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/allowed-routes/partials/part_tab1sidebar.php:47

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: whitelist, route, routes, permalink, routing...

allowed-routes/allowedroutes.php 92% from 13 tests

The main PHP script in "Allowed Routes" version 1.1 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("allowed-routes.php" instead of "allowedroutes.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 detected859 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP795304646
JavaScript1321133
CSS222480

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity24.67
▷ Minimum class complexity18.00
▷ Maximum class complexity36.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes133.33%
▷ Concrete classes266.67%
▷ Final classes150.00%
Methods31
▷ Static methods00.00%
▷ Public methods1858.06%
▷ Protected methods1341.94%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected