90% cocart-jwt-authentication

Code Review | CoCart - JWT Authentication

WordPress plugin CoCart - JWT Authentication scored90%from 54 tests.

About plugin

  • Plugin page: cocart-jwt-authen...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2.2
  • WordPress version: 6.3.1
  • First release: Mar 9, 2023
  • Latest release: Aug 3, 2023
  • Number of updates: 3
  • Update frequency: every 49.0 days
  • Top authors: sebd86 (66.67%)cocartforwc (66.67%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /535 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▼7.94ms] Passed 4 tests

Server-side resources used by CoCart - JWT Authentication
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0747.23 ▲2.65
Dashboard /wp-admin3.37 ▲0.0348.78 ▼18.55
Posts /wp-admin/edit.php3.42 ▲0.0751.32 ▼0.58
Add New Post /wp-admin/post-new.php5.95 ▲0.0786.91 ▼14.02
Media Library /wp-admin/upload.php3.30 ▲0.0739.73 ▲1.38

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

CoCart - JWT Authentication: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.37 ▲0.011.68 ▼0.2344.20 ▲1.06
Dashboard /wp-admin2,198 ▲245.63 ▲0.0490.33 ▼10.4739.15 ▼5.59
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0437.30 ▼0.3230.87 ▲0.40
Add New Post /wp-admin/post-new.php1,526 ▼023.50 ▲0.32674.64 ▲27.3453.65 ▼17.83
Media Library /wp-admin/upload.php1,394 ▼34.23 ▲0.12101.03 ▼5.9947.36 ▲2.88

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% 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
7 plugin tags: woocommerce, jwt-auth, headless, decoupled, cart...

cocart-jwt-authentication/cocart-jwt-authentication.php 92% from 13 tests

The principal PHP file in "CoCart - JWT Authentication" v. 1.0.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin241 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP383269241

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes1100.00%
Methods17
▷ Static methods17100.00%
▷ Public methods1164.71%
▷ Protected methods211.76%
▷ Private methods423.53%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin