83% gs-jwt-auth-and-otp-varification

Code Review | GS JWT Authentication for WP REST API

WordPress plugin GS JWT Authentication for WP REST API scored83%from 54 tests.

About plugin

  • Plugin page: gs-jwt-auth-and-o...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-5.8.3
  • WordPress version: 6.3.1
  • First release: Jan 11, 2022
  • Latest release: Jan 13, 2022
  • Number of updates: 6
  • Update frequency: every 0.5 days
  • Top authors: gauravin213 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /395 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼7.62ms] Passed 4 tests

Server-side resources used by GS JWT Authentication for WP REST API
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1238.71 ▲2.11
Dashboard /wp-admin3.43 ▲0.0845.03 ▼20.68
Posts /wp-admin/edit.php3.54 ▲0.1848.05 ▼2.84
Add New Post /wp-admin/post-new.php6.02 ▲0.1396.04 ▼7.14
Media Library /wp-admin/upload.php3.35 ▲0.1233.82 ▲0.19

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

GS JWT Authentication for WP REST API: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.78 ▲0.401.94 ▲0.2750.78 ▲7.87
Dashboard /wp-admin2,206 ▲215.88 ▲0.79106.83 ▼0.8541.62 ▼1.37
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.0338.84 ▼0.6634.92 ▼3.73
Add New Post /wp-admin/post-new.php1,544 ▲3018.35 ▲0.82602.30 ▼11.4345.51 ▼0.80
Media Library /wp-admin/upload.php1,391 ▲34.20 ▲0.0098.03 ▲0.2544.79 ▲2.42

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gs-jwt-auth-and-otp-varification/gs-jwt.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

gs-jwt-auth-and-otp-varification/gs-jwt.php 85% from 13 tests

The entry point to "GS JWT Authentication for WP REST API" version 1.0.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: The principal plugin file should be the same as the plugin slug ("gs-jwt-auth-and-otp-varification.php" instead of "gs-jwt.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
No dangerous file extensions were detected1,420 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12235437989
Markdown2950340
JSON30091

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity15.29
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity4.03
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods34
▷ Static methods1338.24%
▷ Public methods3088.24%
▷ Protected methods00.00%
▷ Private methods411.76%
Functions23
▷ Named functions1565.22%
▷ Anonymous functions834.78%
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
No PNG images were found in this plugin