89% custom-fields-for-jwt-authentication-for-wp-rest-api

Code Review | User Data Fields For JWT Authentication

WordPress plugin User Data Fields For JWT Authentication scored89%from 54 tests.

About plugin

  • Plugin page: custom-fields-for...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 24, 2021
  • Latest release: Aug 1, 2022
  • Number of updates: 22
  • Update frequency: every 23.8 days
  • Top authors: ahmedriyadh (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active /1,333 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.68ms] Passed 4 tests

This is a short check of server-side resources used by User Data Fields For JWT Authentication
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.50 ▼1.99
Dashboard /wp-admin3.32 ▼0.0242.73 ▼20.11
Posts /wp-admin/edit.php3.37 ▲0.0245.41 ▲1.49
Add New Post /wp-admin/post-new.php5.90 ▲0.0288.64 ▼0.21
Media Library /wp-admin/upload.php3.24 ▲0.0232.46 ▼0.41

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for User Data Fields For JWT Authentication
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.23 ▼1.071.76 ▲0.0140.09 ▼5.39
Dashboard /wp-admin2,203 ▲154.83 ▼0.05107.22 ▲3.2142.03 ▼0.57
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0339.04 ▼0.0835.39 ▲2.58
Add New Post /wp-admin/post-new.php1,520 ▲623.10 ▲5.51637.62 ▼63.0564.00 ▲0.58
Media Library /wp-admin/upload.php1,391 ▼04.22 ▲0.0499.43 ▲0.5142.07 ▼1.17

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means 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
Everything seems fine, however this is by no means an exhaustive test

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: jwt, json web authentication, wp-api, wp-json

custom-fields-for-jwt-authentication-for-wp-rest-api/user-data-fields-for-jwt-authentication.php 85% from 13 tests

The main PHP script in "User Data Fields For JWT Authentication" version 1.2.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-fields-for-jwt-authentication-for-wp-rest-api.php" instead of "user-data-fields-for-jwt-authentication.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 221 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin39 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12939

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.06
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%
Functions2
▷ Named functions2100.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
PNG images were not found in this plugin