68% wplicense-it

Code Review | WPLicense It

WordPress plugin WPLicense It scored68%from 54 tests.

About plugin

  • Plugin page: wplicense-it
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Mar 24, 2022
  • Latest release: Jun 23, 2022
  • Number of updates: 10
  • Update frequency: every 17.7 days
  • Top authors: devlloplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,175 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.37MB] [CPU: ▼4.15ms] Passed 4 tests

A check of server-side resources used by WPLicense It
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3346.42 ▲0.58
Dashboard /wp-admin3.71 ▲0.4049.74 ▼3.47
Posts /wp-admin/edit.php3.75 ▲0.4053.95 ▲8.05
Add New Post /wp-admin/post-new.php6.30 ▲0.4189.56 ▼16.68
Media Library /wp-admin/upload.php3.56 ▲0.3340.58 ▲2.98
Dashboard /wp-admin/edit.php?post_type=wplit_product&page=wplit-admin-dashboard3.5237.34
Settings /wp-admin/edit.php?post_type=wplit_product&page=wplit-admin-settings3.5331.34

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 286 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-posts
wplicense-it-api-rewrite-rules-version
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WPLicense It
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲9213.20 ▼1.212.03 ▲0.0642.00 ▼1.84
Dashboard /wp-admin2,238 ▲505.76 ▼0.2497.67 ▼16.6240.01 ▼4.59
Posts /wp-admin/edit.php2,124 ▲322.04 ▲0.0738.92 ▼1.1933.88 ▼1.93
Add New Post /wp-admin/post-new.php1,562 ▲3923.40 ▲0.36668.34 ▲11.7863.32 ▲4.62
Media Library /wp-admin/upload.php1,426 ▲414.16 ▼0.1397.02 ▼11.6645.30 ▼0.07
Dashboard /wp-admin/edit.php?post_type=wplit_product&page=wplit-admin-dashboard1,0192.0324.4878.55
Settings /wp-admin/edit.php?post_type=wplit_product&page=wplit-admin-settings1,0292.0222.2333.33

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • wplicense-it-api-rewrite-rules-version
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

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)
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/update_certs.php
    • > /wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/build.php
  • 208× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/lib/LoginLink.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\OAuth\\OAuthErrorException' not found in wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/lib/Exception/OAuth/UnsupportedResponseTypeException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\BaseStripeClient' not found in wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/lib/StripeClient.php:66
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/lib/Service/TokenService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\StripeObject' not found in wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/lib/OrderItem.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/lib/Service/FileLinkService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/lib/Service/CustomerService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/lib/Event.php:53
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/lib/Exception/ApiConnectionException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/lib/Capability.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (Add New License Product)
You can look at the official readme.txt

wplicense-it/wplicense-it.php 92% from 13 tests

The main file in "WPLicense It" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Almost there! Just fix the following issues
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wplicense-it/includes/payment/vendor/stripe/stripe-php/data/ca-certificates.crt
20,823 lines of code in 273 files:
LanguageFilesBlank linesComment linesLines of code
PHP2582,64510,2819,829
CSS41,743389,559
Markdown369801,147
JSON300123
JavaScript21921104
XML10031
make19027
YAML1003

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.56
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces25
Interfaces9
Traits7
Classes228
▷ Abstract classes104.39%
▷ Concrete classes21895.61%
▷ Final classes00.00%
Methods828
▷ Static methods18722.58%
▷ Public methods74489.86%
▷ Protected methods323.86%
▷ Private methods526.28%
Functions19
▷ Named functions631.58%
▷ Anonymous functions1368.42%
Constants775
▷ Global constants101.29%
▷ Class constants76598.71%
▷ Public constants765100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.27MB with 0.20MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png280.25KB71.19KB▼ 74.60%