77% electronic-signatures

Code Review | Electronic Signature

WordPress plugin Electronic Signature scored77%from 54 tests.

About plugin

  • Plugin page: electronic-signat...
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3
  • WordPress version: 6.3.1
  • First release: Jan 4, 2016
  • Latest release: Sep 13, 2023
  • Number of updates: 129
  • Update frequency: every 21.8 days
  • Top authors: SwiftCloud (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /14,735 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.27MB] [CPU: ▼12.71ms] 75% from 4 tests

This is a short check of server-side resources used by Electronic Signature
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 2,559.04ms on /wp-admin/admin.php?page=ssign_dashboard)
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2441.24 ▲0.30
Dashboard /wp-admin3.58 ▲0.2349.24 ▼17.08
Posts /wp-admin/edit.php3.68 ▲0.3247.62 ▼2.04
Add New Post /wp-admin/post-new.php6.29 ▲0.4074.06 ▼31.19
Media Library /wp-admin/upload.php3.53 ▲0.3035.37 ▼0.54
Settings /wp-admin/admin.php?page=ss_control_panel3.4438.64
Signed Log Detail /wp-admin/admin.php?page=ssign_signed_docs_details3.4433.04
Updates & Tips /wp-admin/admin.php?page=ssign_dashboard3.552,559.04
Signed Docs /wp-admin/admin.php?page=ss_signed_docs3.4437.88
Help & Setup /wp-admin/admin.php?page=ssign_help_setup3.4432.26

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 94 new files
Database: 2 new tables, 7 new options
New tables
wp_ssing_lead_report
wp_ssing_log
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
swift_sign_version

Browser metrics Passed 4 tests

Electronic Signature: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,973 ▲22713.74 ▼0.614.98 ▲3.3031.81 ▼13.74
Dashboard /wp-admin2,276 ▲885.07 ▼0.79101.14 ▼2.8381.75 ▲46.96
Posts /wp-admin/edit.php2,180 ▲912.08 ▲0.0640.64 ▼0.9142.46 ▲5.19
Add New Post /wp-admin/post-new.php1,743 ▲21521.09 ▲2.73712.57 ▼17.7531.05 ▼22.51
Media Library /wp-admin/upload.php1,461 ▲704.32 ▲0.06103.15 ▲1.3495.85 ▲52.19
Settings /wp-admin/admin.php?page=ss_control_panel9191.8328.7134.53
Signed Log Detail /wp-admin/admin.php?page=ssign_signed_docs_details8801.8129.5430.67
Updates & Tips /wp-admin/admin.php?page=ssign_dashboard9792.2531.2646.35
Signed Docs /wp-admin/admin.php?page=ss_signed_docs9061.7927.5931.54
Help & Setup /wp-admin/admin.php?page=ssign_help_setup8931.9134.0439.39

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant SWIFTSIGN_MINIMUM_WP_VERSION - assumed 'SWIFTSIGN_MINIMUM_WP_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/electronic-signatures/admin/swiftsignature-admin.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/electronic-signatures/swiftsignature-thanks.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/electronic-signatures/section/swiftsignature-shortcode.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/electronic-signatures/shortcode-generator/swiftsignature_shortcode_generator.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/electronic-signatures/section/swiftsignature-form-shortcode.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/electronic-signatures/swiftsignature-pagetemplater.php:143
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/electronic-signatures/admin/swiftsignature-admin.php:32
    • > PHP Notice
      Undefined index: wp_version in wp-content/plugins/electronic-signatures/admin/swiftsignature-admin.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/electronic-signatures/swiftsignature.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/electronic-signatures/admin/section/swiftsignature-dashboard.php:179

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=ss_control_panel
    • > Network (severe)
    wp-content/plugins/electronic-signatures/admin/section/css/sc_rcswitcher.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=ss_control_panel
    • > Network (severe)
    wp-content/plugins/electronic-signatures/admin/section/js/sc_rcswitcher.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: electronic signature, e-sign, e-signature, waivers

electronic-signatures/swiftsignature.php 77% from 13 tests

This is the main PHP file of "Electronic Signature" version 2.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/swiftsign/")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("electronic-signatures.php" instead of "swiftsignature.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin7,623 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
CSS151431723,098
JavaScript125734372,641
PHP141611711,081
PO File9324338803

PHP code Passed 2 tests

Analyzing 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.28
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods480.00%
▷ Protected methods00.00%
▷ Private methods120.00%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.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
32 PNG files occupy 0.12MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_flat_10_000000_40x100.png0.20KB0.08KB▼ 57.56%
images/close.png1.09KB1.71KB0.00%
css/images/checkbox.png0.50KB0.31KB▼ 38.57%
admin/images/ss-help-1.png22.89KB9.90KB▼ 56.75%
shortcode-generator/js/eSignature.png0.65KB0.46KB▼ 28.72%