84% login-register-using-jwt

Code Review | WP Login and Register using JWT

WordPress plugin WP Login and Register using JWT scored84%from 54 tests.

About plugin

  • Plugin page: login-register-us...
  • Plugin version: 2.6.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Sep 13, 2021
  • Latest release: Sep 14, 2023
  • Number of updates: 34
  • Update frequency: every 21.6 days
  • Top authors: abhiladdha07 (64.71%)cyberlord92 (38.24%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /2,383 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲2.06MB] [CPU: ▲6.99ms] Passed 4 tests

A check of server-side resources used by WP Login and Register using JWT
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.57 ▲2.1051.50 ▲7.20
Dashboard /wp-admin5.40 ▲2.0954.38 ▲6.15
Posts /wp-admin/edit.php5.45 ▲2.0959.99 ▲15.32
Add New Post /wp-admin/post-new.php7.94 ▲2.0594.25 ▼0.73
Media Library /wp-admin/upload.php5.26 ▲2.0350.89 ▲19.46

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 57 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
mo_jwt_client_secret
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
mo_jwt_attr_settings
mo_jwt_config_settings
can_compress_scripts
mo_jwt_plugin_version

Browser metrics Passed 4 tests

A check of browser resources used by WP Login and Register using JWT
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲8813.17 ▼1.585.15 ▲3.2741.52 ▼2.10
Dashboard /wp-admin2,217 ▲265.94 ▲1.0296.07 ▼7.6977.85 ▲32.55
Posts /wp-admin/edit.php2,112 ▲232.06 ▲0.0034.18 ▼6.2631.19 ▼3.81
Add New Post /wp-admin/post-new.php1,689 ▲15622.54 ▼0.57739.23 ▲88.9834.32 ▼25.76
Media Library /wp-admin/upload.php1,405 ▲234.25 ▲0.11106.99 ▲9.4571.10 ▲27.76

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 10 options in the database
    • theysaidso_admin_options
    • mo_jwt_attr_settings
    • can_compress_scripts
    • mo_jwt_client_secret
    • widget_recent-comments
    • mo_jwt_config_settings
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • mo_jwt_plugin_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/user.php' (include_path='.:/usr/share/php') in wp-content/plugins/login-register-using-jwt/classes/common/Methods/class-jwtdelete.php on line 19
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/login-register-using-jwt/classes/common/Methods/class-jwtdelete.php on line 19
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/user.php): failed to open stream: No such file or directory in wp-content/plugins/login-register-using-jwt/classes/common/Methods/class-jwtdelete.php on line 19
    • > PHP Fatal error
      Uncaught Error: Interface 'MoJWT\\Accounts\\AccountsInterface' not found in wp-content/plugins/login-register-using-jwt/classes/common/Accounts/class-accounts.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt might help

login-register-using-jwt/miniorange-jwt-login-settings.php 92% from 13 tests

The entry point to "WP Login and Register using JWT" version 2.6.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("login-register-using-jwt.php" instead of "miniorange-jwt-login-settings.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 detected8,845 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP331,5645,0708,837
CSS4054
JavaScript2084

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity47.31
▷ Minimum class complexity1.00
▷ Maximum class complexity416.00
Average method complexity5.29
▷ Minimum method complexity1.00
▷ Maximum method complexity84.00
Code structure
Namespaces6
Interfaces1
Traits0
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes00.00%
Methods317
▷ Static methods41.26%
▷ Public methods30194.95%
▷ Protected methods00.00%
▷ Private methods165.05%
Functions15
▷ Named functions1386.67%
▷ Anonymous functions213.33%
Constants82
▷ Global constants7591.46%
▷ Class constants78.54%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
16 PNG files occupy 0.34MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/images/icons/add-user.png22.66KB10.86KB▼ 52.09%
resources/images/icons/padlock.png30.64KB12.40KB▼ 59.53%
resources/images/icons/jwt-token.png84.47KB25.95KB▼ 69.28%
resources/images/miniorange.png0.44KB0.35KB▼ 18.61%
resources/images/icons/tick.png28.84KB12.74KB▼ 55.81%