68% digital-license-manager

Code Review | Digital License Manager

WordPress plugin Digital License Manager scored68%from 54 tests.

About plugin

  • Plugin page: digital-license-m...
  • Plugin version: 1.5.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-6.4
  • WordPress version: 6.3.1
  • First release: Jul 19, 2021
  • Latest release: Dec 1, 2023
  • Number of updates: 70
  • Update frequency: every 12.4 days
  • Top authors: DarkoG (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

300+ active /6,103 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.62MB] [CPU: ▲12.02ms] Passed 4 tests

A check of server-side resources used by Digital License Manager
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.82 ▲1.3647.68 ▲7.13
Dashboard /wp-admin4.99 ▲1.6964.73 ▲12.51
Posts /wp-admin/edit.php5.07 ▲1.7160.94 ▲17.27
Add New Post /wp-admin/post-new.php7.78 ▲1.8999.42 ▲11.18
Media Library /wp-admin/upload.php4.95 ▲1.7253.08 ▲22.18
Activations /wp-admin/admin.php?page=dlm_activations5.3648.61
Settings /wp-admin/admin.php?page=dlm_settings4.9448.09
Generators /wp-admin/admin.php?page=dlm_generators5.3247.01
Licenses /wp-admin/admin.php?page=dlm_licenses5.4251.28

Server storage [IO: ▲4.30MB] [DB: ▲0.08MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 454 new files
Database: 6 new tables, 8 new options
New tables
wp_dlm_licenses
wp_dlm_api_keys
wp_dlm_license_activations
wp_dlm_product_downloads
wp_dlm_license_meta
wp_dlm_generators
New WordPress options
dlm_db_version
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
dlm_settings_general
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Digital License Manager
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,961 ▲21414.38 ▼0.392.02 ▲0.2730.14 ▼16.34
Dashboard /wp-admin2,335 ▲1555.69 ▲0.0598.09 ▲5.9856.87 ▲14.42
Posts /wp-admin/edit.php2,243 ▲1432.09 ▲0.1537.63 ▲0.6446.71 ▲13.05
Add New Post /wp-admin/post-new.php1,836 ▲30922.16 ▼0.86677.75 ▲44.8937.07 ▼27.27
Media Library /wp-admin/upload.php1,543 ▲1434.22 ▲0.0398.24 ▲3.0451.40 ▲11.22
Activations /wp-admin/admin.php?page=dlm_activations1,3772.0043.2374.98
Settings /wp-admin/admin.php?page=dlm_settings1,2463.1962.4991.03
Generators /wp-admin/admin.php?page=dlm_generators1,3081.7628.5245.53
Licenses /wp-admin/admin.php?page=dlm_licenses1,6011.9134.0748.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie tables were found after uninstall: 6 tables
    • wp_dlm_license_activations
    • wp_dlm_generators
    • wp_dlm_license_meta
    • wp_dlm_licenses
    • wp_dlm_product_downloads
    • wp_dlm_api_keys
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • dlm_db_version
    • widget_recent-comments
    • dlm_settings_general
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/digital-license-manager/vendor/tecnickcom/tcpdf/tools/tcpdf_addfont.php
  • 175× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/digital-license-manager/includes/Abstracts/AbstractRestController.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'Spipu\\Html2Pdf\\Tests\\CrossVersionCompatibility\\PhpUnit5\\TagParserTestCase' not found in wp-content/plugins/digital-license-manager/vendor/spipu/html2pdf/Tests/CrossVersionCompatibility/TagParserTestCase.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'IdeoLogix\\DigitalLicenseManager\\Database\\Models\\ApiKey' not found in wp-content/plugins/digital-license-manager/includes/Database/Models/Resources/ApiKey.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'Spipu\\Html2Pdf\\Tag\\Html\\I' not found in wp-content/plugins/digital-license-manager/vendor/spipu/html2pdf/src/Tag/Html/Samp.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/digital-license-manager/vendor/spipu/html2pdf/Tests/CrossVersionCompatibility/PhpUnit5/HtmlTestCase.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Spipu\\Html2Pdf\\Tests\\AbstractTest' not found in wp-content/plugins/digital-license-manager/vendor/spipu/html2pdf/Tests/Tag/Svg/PathInvalidTest.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/digital-license-manager/vendor/spipu/html2pdf/Tests/ExamplesTest.php:20
    • > PHP Warning
      Use of undefined constant HTML2PDF_PHPUNIT_VERSION - assumed 'HTML2PDF_PHPUNIT_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/digital-license-manager/vendor/spipu/html2pdf/Tests/CrossVersionCompatibility/ExceptionFormatterTestCase.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/digital-license-manager/templates/woocommerce/dlm/my-account/licenses/partials/single-certificate.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/digital-license-manager/vendor/spipu/html2pdf/Tests/CrossVersionCompatibility/PhpUnit9/AbstractTestCase.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: serial key, woocommerce, license key, software license, license manager

digital-license-manager/digital-license-manager.php 92% from 13 tests

The main PHP script in "Digital License Manager" version 1.5.6 is automatically included on every request by WordPress
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "2.7")

Code Analysis 95% from 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 detected79,727 lines of code in 405 files:
LanguageFilesBlank linesComment linesLines of code
PHP3337,94628,69074,314
Markdown2596002,553
JavaScript171322451,249
CSS19126124787
JSON500498
HTML191242
XML20034
make19426
SVG19021
Bourne Shell1203

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 4,422)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 500)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity37.43
▷ Minimum class complexity1.00
▷ Maximum class complexity4,422.00
Average method complexity5.76
▷ Minimum method complexity1.00
▷ Maximum method complexity500.00
Code structure
Namespaces55
Interfaces15
Traits3
Classes258
▷ Abstract classes4818.60%
▷ Concrete classes21081.40%
▷ Final classes83.81%
Methods2,156
▷ Static methods35016.23%
▷ Public methods1,53371.10%
▷ Protected methods52424.30%
▷ Private methods994.59%
Functions34
▷ Named functions1750.00%
▷ Anonymous functions1750.00%
Constants246
▷ Global constants16567.07%
▷ Class constants8132.93%
▷ Public constants81100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/spipu/html2pdf/Tests/Image/res/logo.png20.53KB7.63KB▼ 62.85%