77% login-register-redirect-for-woocommerce

Code Review | Login & Register Redirect for WooCommerce

WordPress plugin Login & Register Redirect for WooCommerce scored 77% from 54 tests.

About plugin

  • Plugin page: login-register-re...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.4-4.9.4
  • WordPress version: 5.8.1
  • First release: Feb 27, 2018
  • Latest release: Feb 27, 2018
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: fuji9 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active / 1,937 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼140.23ms] Passed 4 tests

An overview of server-side resources used by Login & Register Redirect for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.00 ▲0.2836.36 ▲15.86
Dashboard /wp-admin3.31 ▲0.2650.21 ▲2.15
Posts /wp-admin/edit.php3.36 ▲0.2549.95 ▼1.07
Add New Post /wp-admin/post-new.php5.58 ▲0.1594.03 ▼559.35
Media Library /wp-admin/upload.php3.17 ▲0.1733.29 ▼2.66
Login & Register Redirect for WooCommerce /wp-admin/options-general.php?page=lrr-for-woocommerce-admin3.1733.81

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 43 new files
Database: no new tables, 1 new option
New WordPress options
lrrfw_basic

Browser metrics Passed 4 tests

Login & Register Redirect for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,039 ▲44318.19 ▲2.6015.66 ▲5.6544.90 ▲0.20
Dashboard /wp-admin3,219 ▲2888.19 ▲2.03173.26 ▲23.94108.48 ▼6.60
Posts /wp-admin/edit.php2,995 ▲2564.37 ▲1.6486.50 ▲18.5082.81 ▼10.26
Add New Post /wp-admin/post-new.php1,630 ▼2,06818.62 ▲0.53382.03 ▼98.28135.15 ▲29.72
Media Library /wp-admin/upload.php1,844 ▲374.89 ▼0.16123.08 ▼31.75120.18 ▼0.41
Login & Register Redirect for WooCommerce /wp-admin/options-general.php?page=lrr-for-woocommerce-admin1,3644.11102.7171.89

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 1 option
    • lrrfw_basic

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/login-register-redirect-for-woocommerce/public/partials/lrr-for-woocommerce-public-display.php
    • > /wp-content/plugins/login-register-redirect-for-woocommerce/admin/partials/lrr-for-woocommerce-admin-display.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WeDevs_Settings_API' not found in wp-content/plugins/login-register-redirect-for-woocommerce/includes/class-lrr-for-woocommerce-settings.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/login-register-redirect-for-woocommerce/vendor/tareq1988/wordpress-settings-api-class/src/class.settings-api.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/login-register-redirect-for-woocommerce/vendor/tareq1988/wordpress-settings-api-class/example/procedural-example.php:270

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Requires php: Invalid plugin version format
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Screenshots: Please add an image for screenshot #2 (Leave them blank if you want to return to the default WooCommerce settings.)
The official readme.txt might help

login-register-redirect-for-woocommerce/lrr-for-woocommerce.php 85% from 13 tests

The main file in "Login & Register Redirect for WooCommerce" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("login-register-redirect-for-woocommerce.php" instead of "lrr-for-woocommerce.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin1,558 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP243529361,430
JSON30075
Markdown121047
JavaScript24546
CSS2080

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity9.38
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods90
▷ Static methods66.67%
▷ Public methods8291.11%
▷ Protected methods00.00%
▷ Private methods88.89%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.38MB with 0.27MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/tareq1988/wordpress-settings-api-class/screenshot-1.png389.59KB115.93KB▼ 70.24%