10% wc-customer-source

Code Review | Where Did You Hear About Us Checkout Field for WooCommerce

WordPress plugin Where Did You Hear About Us Checkout Field for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: wc-customer-source
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.1
  • WordPress version: 6.3.1
  • First release: Oct 24, 2016
  • Latest release: Apr 27, 2023
  • Number of updates: 26
  • Update frequency: every 96.0 days
  • Top authors: Wooassist (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

2,000+ active /12,928 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Error in wp-content/plugins/wc-customer-source/wc-customer-source.php+241
    Uncaught Error: Call to undefined function wc_get_order_statuses() in wp-content/plugins/wc-customer-source/wc-customer-source.php:241
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): WC_Customer_Source->install()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(693): do_action()

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

This is a short check of server-side resources used by Where Did You Hear About Us Checkout Field for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0047.71 ▲6.26
Dashboard /wp-admin3.31 ▲0.0051.98 ▼0.19
Posts /wp-admin/edit.php3.36 ▲0.0052.00 ▲1.00
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.39 ▼14.72
Media Library /wp-admin/upload.php3.23 ▲0.0038.80 ▲3.25

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
wc-customer-source-version
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Where Did You Hear About Us Checkout Field for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.73 ▲0.351.56 ▼0.2346.69 ▲5.83
Dashboard /wp-admin2,198 ▲275.64 ▲0.0390.15 ▲0.2840.74 ▲2.85
Posts /wp-admin/edit.php2,100 ▼02.06 ▲0.0834.53 ▼6.4036.09 ▲0.39
Add New Post /wp-admin/post-new.php1,545 ▲1923.32 ▲5.81661.38 ▼7.0867.27 ▲8.45
Media Library /wp-admin/upload.php1,403 ▲64.24 ▲0.0498.76 ▼2.1446.50 ▲4.94

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • wc-customer-source-version
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% 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
5 plugin tags: logo, branding, customizer, custom, storefront

wc-customer-source/wc-customer-source.php 92% from 13 tests

The primary PHP file in "Where Did You Hear About Us Checkout Field for WooCommerce" version 1.3.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("3.0.1" instead of "4.0.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected562 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5136219562

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity19.25
▷ Minimum class complexity11.00
▷ Maximum class complexity26.00
Average method complexity3.81
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes375.00%
Methods26
▷ Static methods623.08%
▷ Public methods2596.15%
▷ Protected methods00.00%
▷ Private methods13.85%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin