77% order-signature-for-woocommerce

Code Review | Order Signature for WooCommerce

WordPress plugin Order Signature for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: order-signature-f...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 30, 2017
  • Latest release: Jun 6, 2023
  • Number of updates: 45
  • Update frequency: every 48.8 days
  • Top authors: wordpressheroes (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

300+ active /6,834 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.72ms] Passed 4 tests

An overview of server-side resources used by Order Signature for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.20 ▲1.82
Dashboard /wp-admin3.31 ▲0.0044.50 ▼5.39
Posts /wp-admin/edit.php3.36 ▲0.0046.47 ▼13.79
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.16 ▼8.94
Media Library /wp-admin/upload.php3.23 ▲0.0035.93 ▲1.26

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Order Signature for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.27 ▼0.991.82 ▲0.0043.99 ▲0.51
Dashboard /wp-admin2,209 ▲214.86 ▼0.0398.44 ▼7.2441.40 ▼3.71
Posts /wp-admin/edit.php2,086 ▼32.04 ▼0.1439.46 ▲2.1435.74 ▲3.54
Add New Post /wp-admin/post-new.php1,514 ▼717.73 ▼5.50660.45 ▼19.3953.79 ▼10.95
Media Library /wp-admin/upload.php1,382 ▼64.20 ▲0.0497.74 ▼3.8641.15 ▼4.79

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/order-signature-for-woocommerce/swph-woo-order-signature-light.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/order-signature-for-woocommerce/includes/class-swph-signature-backend.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/order-signature-for-woocommerce/includes/class-swph-signature-woo.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/order-signature-for-woocommerce/templates/signature-pad-template.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/order-signature-for-woocommerce/templates/signature-template.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/order-signature-for-woocommerce/includes/class-swph-signature-frontend.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes: You can look at the official readme.txt

order-signature-for-woocommerce/swph-woo-order-signature-light.php 77% from 13 tests

"Order Signature for WooCommerce" version 2.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 267 characters long)
  • Requires at least: Required version must match the one declared in readme.txt ("4.7.4" instead of "4.0")
  • Main file name: The principal plugin file should be the same as the plugin slug ("order-signature-for-woocommerce.php" instead of "swph-woo-order-signature-light.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin884 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP8130337641
JavaScript3222290
PO File1283982
Markdown132069
CSS2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity12.60
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods38
▷ Static methods513.16%
▷ Public methods3284.21%
▷ Protected methods00.00%
▷ Private methods615.79%
Functions6
▷ Named functions00.00%
▷ Anonymous functions6100.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
9 PNG files occupy 0.58MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icon-256x256.png37.61KB13.17KB▼ 64.98%
banner-1544x500.png138.63KB59.67KB▼ 56.96%
screenshot-1.png73.61KB26.64KB▼ 63.80%
assets/img/order-signature-for-woocommerce-go-pro-banner.png36.83KB18.49KB▼ 49.80%
banner-772x250.png63.31KB28.93KB▼ 54.30%