84% simple-license-key-for-woocommerce

Code Review | Simple License Key for WooCommerce

WordPress plugin Simple License Key for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: simple-license-ke...
  • Plugin version: 1.14
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4
  • WordPress version: 6.3.1
  • First release: Sep 23, 2021
  • Latest release: Nov 1, 2023
  • Number of updates: 37
  • Update frequency: every 20.8 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,383 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.52ms] Passed 4 tests

This is a short check of server-side resources used by Simple License Key for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1036.86 ▼7.80
Dashboard /wp-admin3.40 ▲0.1046.04 ▼6.43
Posts /wp-admin/edit.php3.51 ▲0.1648.65 ▼2.83
Add New Post /wp-admin/post-new.php5.99 ▲0.1089.21 ▼0.42
Media Library /wp-admin/upload.php3.32 ▲0.1035.47 ▼1.02

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
slkwoo_passphrase

Browser metrics Passed 4 tests

Checking browser requirements for Simple License Key for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▲0.041.68 ▼0.0740.64 ▼3.49
Dashboard /wp-admin2,198 ▲185.57 ▼0.0990.06 ▼9.1541.20 ▲1.27
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0140.52 ▲2.1235.56 ▼2.27
Add New Post /wp-admin/post-new.php1,526 ▼023.13 ▼0.52678.55 ▲43.2759.50 ▲9.26
Media Library /wp-admin/upload.php1,397 ▼04.21 ▲0.02101.33 ▼7.0043.17 ▼2.06

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need 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 75% 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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 fix the following items
  • 2× 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/simple-license-key-for-woocommerce/lib/class-slkwoo.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-license-key-for-woocommerce/lib/class-slkwoo.php:38

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
3 plugin tags: woocommerce, license key, license

simple-license-key-for-woocommerce/slkwoo.php 85% from 13 tests

The main PHP script in "Simple License Key for WooCommerce" version 1.14 is automatically included on every request by WordPress
It is important to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.7" instead of "3.0")
  • Main file name: The principal plugin file should be the same as the plugin slug ("simple-license-key-for-woocommerce.php" instead of "slkwoo.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected700 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP484207422
JavaScript3171210
CSS20029
JSON10020
Sass10019

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity46.00
▷ Minimum class complexity46.00
▷ Maximum class complexity46.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods1881.82%
▷ Protected methods00.00%
▷ Private methods418.18%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
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 files were detected