48% license-manager-for-woocommerce

Code Review | License Manager for WooCommerce

WordPress plugin License Manager for WooCommerce scored48%from 54 tests.

About plugin

  • Plugin page: license-manager-f...
  • Plugin version: 3.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Feb 19, 2019
  • Latest release: Nov 24, 2023
  • Number of updates: 106
  • Update frequency: every 16.4 days
  • Top authors: wpexpertsio (66.98%)drazenbebic (33.96%)

Code review

54 tests

User reviews

124 reviews

Install metrics

6,000+ active /86,470 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲5.68MB] [CPU: ▲32.04ms] 75% from 4 tests

A check of server-side resources used by License Manager for WooCommerce
Please take the time to fix the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.68MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.18 ▲5.7164.15 ▲24.98
Dashboard /wp-admin9.19 ▲5.8985.60 ▲36.36
Posts /wp-admin/edit.php9.20 ▲5.8490.34 ▲41.80
Add New Post /wp-admin/post-new.php11.18 ▲5.29120.58 ▲28.07
Media Library /wp-admin/upload.php9.20 ▲5.9770.79 ▲38.75
Generators /wp-admin/admin.php?page=lmfwc_generators9.2066.45
License Keys /wp-admin/admin.php?page=lmfwc_licenses9.2070.40
Activations /wp-admin/admin.php?page=lmfwc_activations9.2065.30
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.2065.37

Server storage [IO: ▲14.58MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 774 new files
Database: 5 new tables, 14 new options
New tables
wp_lmfwc_licenses_meta
wp_lmfwc_api_keys
wp_lmfwc_licenses
wp_lmfwc_generators
wp_lmfwc_activations
New WordPress options
lmfwc_settings_general
fs_debug_mode
widget_recent-comments
lmfwc_db_version
widget_theysaidso_widget
fs_accounts
db_upgraded
theysaidso_admin_options
fs_active_plugins
widget_recent-posts
...

Browser metrics Passed 4 tests

A check of browser resources used by License Manager for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6814.33 ▼0.021.68 ▼0.0230.48 ▼15.97
Dashboard /wp-admin2,235 ▲555.52 ▼0.1496.20 ▼3.4746.08 ▼0.43
Posts /wp-admin/edit.php2,141 ▲411.97 ▼0.0439.62 ▲1.3738.39 ▲3.86
Add New Post /wp-admin/post-new.php1,560 ▲3418.04 ▼5.49622.58 ▼21.4471.16 ▲11.67
Media Library /wp-admin/upload.php1,443 ▲404.24 ▲0.00101.17 ▼1.0646.05 ▲2.86
Generators /wp-admin/admin.php?page=lmfwc_generators1,1951.9529.1536.09
License Keys /wp-admin/admin.php?page=lmfwc_licenses1,3061.6927.7032.99
Activations /wp-admin/admin.php?page=lmfwc_activations1,1621.7029.2933.82
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0921.6725.8427.55

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/license-manager-for-woocommerce/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 5 tables in the database
    • wp_lmfwc_generators
    • wp_lmfwc_api_keys
    • wp_lmfwc_licenses_meta
    • wp_lmfwc_licenses
    • wp_lmfwc_activations
  • This plugin does not fully uninstall, leaving 14 options in the database
    • theysaidso_admin_options
    • lmfwc_settings_tools
    • can_compress_scripts
    • widget_recent-comments
    • fs_active_plugins
    • fs_debug_mode
    • widget_recent-posts
    • lmfwc_settings_woocommerce
    • fs_accounts
    • lmfwc_settings_general
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following items
  • 9× PHP files output text when accessed directly:
    • > /wp-content/plugins/license-manager-for-woocommerce/vendor/setasign/fpdf/tutorial/tuto4.php
    • > /wp-content/plugins/license-manager-for-woocommerce/vendor/setasign/fpdf/tutorial/tuto3.php
    • > /wp-content/plugins/license-manager-for-woocommerce/vendor/setasign/fpdf/tutorial/tuto7.php
    • > /wp-content/plugins/license-manager-for-woocommerce/vendor/setasign/fpdf/tutorial/tuto5.php
    • > /wp-content/plugins/license-manager-for-woocommerce/vendor/setasign/fpdf/tutorial/tuto2.php
    • > /wp-content/plugins/license-manager-for-woocommerce/vendor/setasign/fpdf/tutorial/tuto6.php
    • > /wp-content/plugins/license-manager-for-woocommerce/vendor/setasign/fpdf/tutorial/tuto1.php
    • > /wp-content/plugins/license-manager-for-woocommerce/vendor/setasign/fpdf/tutorial/makefont.php
    • > /wp-content/plugins/license-manager-for-woocommerce/vendor/masterminds/html5/bin/entities.php
  • 142× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Parsing\\SourceException' not found in wp-content/plugins/license-manager-for-woocommerce/vendor/sabberworm/php-css-parser/src/Parsing/UnexpectedTokenException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/license-manager-for-woocommerce/vendor/dompdf/dompdf/src/FrameReflower/Image.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Defuse\\Crypto\\Exception\\CryptoException' not found in wp-content/plugins/license-manager-for-woocommerce/vendor/defuse/php-encryption/src/Exception/WrongKeyOrModifiedCiphertextException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\Renderer\\Block' not found in wp-content/plugins/license-manager-for-woocommerce/vendor/dompdf/dompdf/src/Renderer/TableCell.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\TrueType\\Header' not found in wp-content/plugins/license-manager-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/WOFF/Header.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameReflower\\AbstractFrameReflower' not found in wp-content/plugins/license-manager-for-woocommerce/vendor/dompdf/dompdf/src/FrameReflower/TableRowGroup.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\AbstractTag' not found in wp-content/plugins/license-manager-for-woocommerce/vendor/phenx/php-svg-lib/src/Svg/Tag/Stop.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Dompdf\\FrameDecorator\\AbstractFrameDecorator' not found in wp-content/plugins/license-manager-for-woocommerce/vendor/dompdf/dompdf/src/FrameDecorator/Table.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Svg\\Tag\\Shape' not found in wp-content/plugins/license-manager-for-woocommerce/vendor/phenx/php-svg-lib/src/Svg/Tag/Polygon.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'FontLib\\BinaryStream' not found in wp-content/plugins/license-manager-for-woocommerce/vendor/phenx/php-font-lib/src/FontLib/Table/DirectoryEntry.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 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
8 plugin tags: wordpress, key, license, license key, serial key...

license-manager-for-woocommerce/license-manager-for-woocommerce.php Passed 13 tests

The main PHP file in "License Manager for WooCommerce" ver. 3.0.4 adds more information about the plugin and also serves as the entry point for this plugin
75 characters long description:
Easily sell and manage software license keys through your WooCommerce shop.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Almost there! Just fix the following issues
  • For security reasons, never distribute binary or executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/license-manager-for-woocommerce/vendor/bin/generate-defuse-key.bat
102,636 lines of code in 609 files:
LanguageFilesBlank linesComment linesLines of code
PHP47319,74339,09391,381
HTML607203,257
JSON18003,183
Markdown261,04803,150
JavaScript811372808
CSS1713446748
YAML19035
XML20032
make19426
SVG1008
DOS Batch1005
Bourne Shell1203

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity38.96
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.06
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces53
Interfaces12
Traits0
Classes312
▷ Abstract classes216.73%
▷ Concrete classes29193.27%
▷ Final classes82.75%
Methods4,133
▷ Static methods42810.36%
▷ Public methods3,14676.12%
▷ Protected methods48611.76%
▷ Private methods50112.12%
Functions176
▷ Named functions13476.14%
▷ Anonymous functions4223.86%
Constants466
▷ Global constants11925.54%
▷ Class constants34774.46%
▷ Public constants34298.56%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/wc-admin.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/img/lmfwc_qr.png22.16KB9.19KB▼ 58.53%
vendor/dompdf/dompdf/lib/res/broken_image.png0.60KB0.47KB▼ 22.33%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%