77% woo-license-keys

Code Review | License Keys for WooCommerce

WordPress plugin License Keys for WooCommerce scored 77% from 54 tests.

About plugin

  • Plugin page: woo-license-keys
  • Plugin version: 1.5.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3-5.5
  • WordPress version: 5.8.1
  • First release: Feb 28, 2018
  • Latest release: Oct 4, 2020
  • Number of updates: 102
  • Update frequency: every 9.3 days
  • Top authors: 10quality (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

200+ active / 13,807 total downloads

Benchmarks

Plugin footprint 82% 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.80MB] [CPU: ▼135.83ms] Passed 4 tests

Analyzing server-side resources used by License Keys for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.7940.88 ▲17.63
Dashboard /wp-admin3.91 ▲0.8552.40 ▲3.10
Posts /wp-admin/edit.php3.97 ▲0.8552.71 ▲5.69
Add New Post /wp-admin/post-new.php6.20 ▲0.7698.41 ▼563.38
Media Library /wp-admin/upload.php3.80 ▲0.7942.25 ▲11.26

Server storage [IO: ▲1.63MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • You have illegally modified 2 files (0.06KB) outside of "wp-content/plugins/woo-license-keys/" and "wp-content/uploads/"
    • (new file) wp-content/wpmvc/log/.empty
    • (new file) wp-content/wpmvc/cache/pcom/.htaccess
Filesystem: 536 new files
Database: no new tables, 2 new options
New WordPress options
model_wpmvc_reviewer
woocommerce_store_code

Browser metrics Passed 4 tests

A check of browser resources used by License Keys for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,719 ▲11315.90 ▲0.409.32 ▼1.8048.73 ▼12.47
Dashboard /wp-admin2,986 ▲556.06 ▲0.11139.18 ▼17.25106.60 ▼6.68
Posts /wp-admin/edit.php2,755 ▲192.71 ▼0.0164.84 ▲1.5695.98 ▲5.64
Add New Post /wp-admin/post-new.php2,067 ▲39119.37 ▲0.52380.10 ▼10.69104.80 ▼0.99
Media Library /wp-admin/upload.php1,823 ▲165.04 ▲0.02148.51 ▼0.08116.58 ▼0.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 2 options in the database
    • woocommerce_store_code
    • model_wpmvc_reviewer

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/woo-license-keys/assets/views/admin/inline-script-data.php
  • 306× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\KeyRename' not found in wp-content/plugins/woo-license-keys/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Command/KeyRenamePreserve.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Connection\\StreamConnection' not found in wp-content/plugins/woo-license-keys/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Connection/CompositeStreamConnection.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Profile\\RedisProfile' not found in wp-content/plugins/woo-license-keys/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Profile/RedisVersion260.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WPMVC\\PHPFastCache\\BasePhpFastCache' not found in wp-content/plugins/woo-license-keys/vendor/10quality/wpmvc-phpfastcache/src/psr4/drivers/redis.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'WPMVC\\Contracts\\Loggable' not found in wp-content/plugins/woo-license-keys/vendor/10quality/wpmvc-core/src/psr4/Log.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Pipeline\\Pipeline' not found in wp-content/plugins/woo-license-keys/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Pipeline/ConnectionErrorProof.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\PredisException' not found in wp-content/plugins/woo-license-keys/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Response/ServerException.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\ListPopFirstBlocking' not found in wp-content/plugins/woo-license-keys/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Command/ListPopLastBlocking.php:18
    • > PHP Fatal error
      Uncaught Predis\\Connection\\ConnectionException: Connection refused [tcp://127.0.0.1:6379] in wp-content/plugins/woo-license-keys/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Connection/AbstractConnection.php:146
    • > PHP Fatal error
      Uncaught Error: Interface 'Predis\\Protocol\\ResponseReaderInterface' not found in wp-content/plugins/woo-license-keys/vendor/10quality/wpmvc-phpfastcache/src/_extensions/predis-1.0/src/Protocol/Text/ResponseReader.php:25

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

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === License Keys for WooCommerce === )
You can take inspiration from this readme.txt

woo-license-keys/plugin.php 77% from 13 tests

"License Keys for WooCommerce" version 1.5.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-license-keys.php" instead of "plugin.php")
  • Requires PHP: The required version number must match the one declared in readme.txt ("5.4" instead of "5.6")
  • Requires at least: Please use periods and digits for the required version (ex. "7.0" instead of "3")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin23,293 lines of code in 474 files:
LanguageFilesBlank linesComment linesLines of code
PHP4263,67214,74619,241
Markdown1560601,502
JSON13101,098
PO File42722612
SVG222589
XML800118
JavaScript5463109
INI16624

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 121)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity6.64
▷ Minimum class complexity1.00
▷ Maximum class complexity162.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity121.00
Code structure
Namespaces56
Interfaces46
Traits22
Classes322
▷ Abstract classes288.70%
▷ Concrete classes29491.30%
▷ Final classes10.34%
Methods1,619
▷ Static methods1056.49%
▷ Public methods1,31581.22%
▷ Protected methods22413.84%
▷ Private methods804.94%
Functions72
▷ Named functions2737.50%
▷ Anonymous functions4562.50%
Constants44
▷ Global constants49.09%
▷ Class constants4090.91%
▷ Public constants40100.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 were not PNG files found in your plugin