78% woocommerce-digital-signature

Code Review | WooCommerce Digital Signature

WordPress plugin WooCommerce Digital Signature scored78%from 54 tests.

About plugin

  • Plugin page: woocommerce-digit...
  • Plugin version: 1.7.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.2
  • WordPress version: 6.3.1
  • First release: Jun 18, 2015
  • Latest release: Jul 10, 2023
  • Number of updates: 291
  • Update frequency: every 10.1 days
  • Top authors: approveme (93.81%)stephenapproveme (6.53%)

Code review

54 tests

User reviews

18 reviews

Install metrics

1,000+ active /51,524 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼3.34ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Digital Signature
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1745.94 ▲2.03
Dashboard /wp-admin3.48 ▲0.1354.65 ▼8.71
Posts /wp-admin/edit.php3.59 ▲0.2351.12 ▲0.32
Add New Post /wp-admin/post-new.php6.06 ▲0.1787.64 ▼6.98
Media Library /wp-admin/upload.php3.40 ▲0.1740.04 ▲5.07
E-signature /wp-admin/admin.php?page=esign3.4734.09
About /wp-admin/admin.php?page=esign-woocommerce-about3.4734.37

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 85 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
WP_ESignature__woocommerce_documentation
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

WooCommerce Digital Signature: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.35 ▼0.241.84 ▲0.2444.46 ▼1.60
Dashboard /wp-admin2,209 ▲395.49 ▼0.1986.85 ▼12.2774.69 ▲33.19
Posts /wp-admin/edit.php2,126 ▲261.95 ▼0.0637.60 ▼2.1534.20 ▼6.68
Add New Post /wp-admin/post-new.php1,550 ▲2423.08 ▼0.55655.30 ▲8.5953.35 ▼4.33
Media Library /wp-admin/upload.php1,426 ▲234.20 ▲0.0398.94 ▼2.6172.58 ▲26.21
E-signature /wp-admin/admin.php?page=esign1,7182.7469.0772.47
About /wp-admin/admin.php?page=esign-woocommerce-about1,7622.8878.35158.50

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
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • WP_ESignature__woocommerce_documentation
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/woocommerce-digital-signature/admin/views/esig-core-about.php
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/woocommerce-digital-signature/admin/rating-widget/views/esig-ratting-widget-view.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woocommerce-digital-signature/admin/rating-widget/views/esig-ratting-widget-view.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/woocommerce-digital-signature/admin/about/views/woocommerce-esign-about-steps.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/woocommerce-digital-signature/admin/about/views/esign-iframe.php:4
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/woocommerce-digital-signature/admin/rating-widget/views/esig-ratting-widget-view.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/woocommerce-digital-signature/admin/rating-widget/views/esig-ratting-widget-view.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woocommerce-digital-signature/includes/esigWooFilters.php:8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woocommerce-digital-signature/admin/rating-widget/views/esig-ratting-widget-view.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/woocommerce-digital-signature/admin/about/autoload.php:17
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/woocommerce-digital-signature/admin/rating-widget/views/esig-ratting-widget-view.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: e-signatures, sign documents online, sign document, woocommerce, terms of service and privacy policy...

woocommerce-digital-signature/woocommerce-digital-signature.php 77% from 13 tests

Analyzing the main PHP file in "WooCommerce Digital Signature" version 1.7.8
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Requires at least: The required version number must match the one declared in readme.txt ("5.1" instead of "3.7")
  • Description: The description should be shorter than 140 characters (currently 144 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected4,604 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
PHP291,0135072,660
CSS5125331,391
SVG1111196
PO File24853183
JavaScript37027174

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity30.20
▷ Minimum class complexity4.00
▷ Maximum class complexity111.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods123
▷ Static methods4939.84%
▷ Public methods11089.43%
▷ Protected methods00.00%
▷ Private methods1310.57%
Functions12
▷ Named functions1191.67%
▷ Anonymous functions18.33%
Constants8
▷ Global constants450.00%
▷ Class constants450.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
14 PNG files occupy 0.36MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/about/assets/images/gf-count-on-us.png32.44KB32.96KB0.00%
admin/about/assets/images/gf-advisor.png48.61KB48.68KB0.00%
admin/rating-widget/views/esign-monster.png12.46KB3.78KB▼ 69.70%
admin/about/assets/images/woo-add-on-step-4.png47.89KB28.87KB▼ 39.72%
admin/about/assets/images/gf-completed-steps.png23.42KB23.45KB0.00%