89% redirect-front-end-to-login-headless-wp

Code Review | Redirect Front-end to Login | Headless WP

WordPress plugin Redirect Front-end to Login | Headless WP scored89%from 54 tests.

About plugin

  • Plugin page: redirect-front-en...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.8.2
  • WordPress version: 6.3.1
  • First release: Sep 26, 2017
  • Latest release: Sep 26, 2017
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: bfintal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /5,400 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.16MB] [CPU: ▼12.28ms] Passed 4 tests

An overview of server-side resources used by Redirect Front-end to Login | Headless WP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.82 ▼0.6416.63 ▼24.09
Dashboard /wp-admin3.31 ▲0.0144.33 ▼1.21
Posts /wp-admin/edit.php3.36 ▲0.0040.42 ▼6.55
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.83 ▼17.27
Media Library /wp-admin/upload.php3.23 ▲0.0037.08 ▲4.37

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Redirect Front-end to Login | Headless WP
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,641 ▼9420.30 ▲5.6429.03 ▲27.230.88 ▼42.74
Dashboard /wp-admin2,209 ▲184.86 ▼0.07103.88 ▲2.2139.24 ▼7.42
Posts /wp-admin/edit.php2,092 ▲62.05 ▲0.0536.26 ▼1.9232.05 ▼0.92
Add New Post /wp-admin/post-new.php1,535 ▲1623.42 ▲0.06675.87 ▲4.5167.88 ▲13.48
Media Library /wp-admin/upload.php1,391 ▼04.17 ▼0.0699.57 ▼6.4648.80 ▲5.57

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • 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)
Even though everything seems fine, this is not an exhaustive test

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
Looking good! No server-side errors or output on direct access of PHP files

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

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
10 plugin tags: api, headless, rest-api, wp-json, 301...

redirect-front-end-to-login-headless-wp/plugin.php 85% from 13 tests

The principal PHP file in "Redirect Front-end to Login | Headless WP" v. 1.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("redirect-front-end-to-login-headless-wp.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected14 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP221314

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.60
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%
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

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin