88% token-vendor-for-woocommerce

Code Review | Token Vendor for WooCommerce

WordPress plugin Token Vendor for WooCommerce scored 88% from 54 tests.

About plugin

  • Plugin page: token-vendor-for-...
  • Plugin version: 0.1.11
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.8
  • WordPress version: 5.8.1
  • First release: Nov 3, 2018
  • Latest release: Dec 5, 2018
  • Number of updates: 15
  • Update frequency: every 2.3 days
  • Top authors: Nora0123456789 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 388 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼145.60ms] Passed 4 tests

Analyzing server-side resources used by Token Vendor for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0441.81 ▲8.28
Dashboard /wp-admin3.10 ▲0.0433.52 ▼18.21
Posts /wp-admin/edit.php3.18 ▲0.0845.42 ▼2.78
Add New Post /wp-admin/post-new.php5.45 ▲0.0287.96 ▼562.38
Media Library /wp-admin/upload.php3.04 ▲0.0433.61 ▲0.99

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 185 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Token Vendor for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10716.00 ▲0.4010.25 ▼1.5144.94 ▼1.92
Dashboard /wp-admin2,967 ▲305.93 ▼0.02139.49 ▼8.36111.96 ▼7.46
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0065.97 ▼3.6586.36 ▼7.69
Add New Post /wp-admin/post-new.php3,577 ▲1,89414.76 ▼4.03473.51 ▲68.64110.28 ▲1.58
Media Library /wp-admin/upload.php1,807 ▼35.02 ▼0.02185.62 ▲34.29111.37 ▼1.12

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 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
Almost there! Just fix the following items
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/token-vendor-for-woocommerce/includes/admin/views/template-updates.php
    • > /wp-content/plugins/token-vendor-for-woocommerce/includes/admin/views/template-popup-customer-downloads.php
    • > /wp-content/plugins/token-vendor-for-woocommerce/templates/admin-page/notice/template-updates.php
    • > /wp-content/plugins/token-vendor-for-woocommerce/templates/admin-page/header/template-admin-menu-page-tabs.php
    • > /wp-content/plugins/token-vendor-for-woocommerce/includes/endpoint/views/template-popup-customer-downloads.php
  • 63× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Lcobucci\\JWT\\Signer\\BaseSigner' not found in wp-content/plugins/token-vendor-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/src/Signer/Rsa.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Lcobucci\\JWT\\Signer' not found in wp-content/plugins/token-vendor-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/src/Signer/BaseSigner.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/token-vendor-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/test/unit/Signer/Rsa/Sha384Test.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/token-vendor-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/test/functional/UnsignedTokenTest.php:19
    • > PHP Notice
      Undefined variable: tabs in wp-content/plugins/token-vendor-for-woocommerce/templates/admin-page/header/template-admin-menu-page-tabs.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/token-vendor-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/test/unit/ValidationDataTest.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/token-vendor-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/test/unit/Signer/Ecdsa/Sha256Test.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/token-vendor-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/test/unit/Signer/BaseSignerTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'NTVWC_REST_API' not found in wp-content/plugins/token-vendor-for-woocommerce/includes/rest-api/class-ntvwc-rest-api-jwt.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/token-vendor-for-woocommerce/includes/3rd/jwt/lcobucci/jwt/test/unit/Signer/Hmac/Sha512Test.php:14

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes: You can look at the official readme.txt

token-vendor-for-woocommerce/token-vendor-by-woocommerce.php 85% from 13 tests

"Token Vendor for WooCommerce" version 0.1.11's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("token-vendor-for-woocommerce.php" instead of "token-vendor-by-woocommerce.php")

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
No dangerous file extensions were detected12,907 lines of code in 160 files:
LanguageFilesBlank linesComment linesLines of code
PHP1444,2829,73711,675
PO File1252432477
JavaScript6174183352
JSON200114
Markdown1470102
CSS38388
YAML23068
XML12031

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity12.01
▷ Minimum class complexity1.00
▷ Maximum class complexity201.00
Average method complexity2.39
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces9
Interfaces6
Traits1
Classes105
▷ Abstract classes109.52%
▷ Concrete classes9590.48%
▷ Final classes33.16%
Methods912
▷ Static methods444.82%
▷ Public methods73981.03%
▷ Protected methods14415.79%
▷ Private methods293.18%
Functions61
▷ Named functions5895.08%
▷ Anonymous functions34.92%
Constants27
▷ Global constants414.81%
▷ Class constants2385.19%
▷ Public constants23100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected