10% woo-customer-insight

Code Review | Web Analytics for Woocommerce

WordPress plugin Web Analytics for Woocommerce scored10%from 54 tests.

About plugin

  • Plugin page: woo-customer-insight
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5.2
  • WordPress version: 6.3.1
  • First release: May 4, 2016
  • Latest release: Apr 2, 2020
  • Number of updates: 9
  • Update frequency: every 159.0 days
  • Top authors: smackcoders (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,998 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method WooCustomerInsightSchema::generate_tables() should not be called statically

Server metrics [RAM: ▲0.45MB] [CPU: ▼113.83ms] Passed 4 tests

A check of server-side resources used by Web Analytics for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4544.99 ▼2.48
Dashboard /wp-admin3.77 ▲0.3847.85 ▼450.36
Posts /wp-admin/edit.php3.88 ▲0.5250.17 ▼2.96
Add New Post /wp-admin/post-new.php6.37 ▲0.4898.41 ▲14.13
Media Library /wp-admin/upload.php3.70 ▲0.4636.09 ▲0.47
Customer Stats /wp-admin/admin.php?page=customer_logs3.6938.33
Opportunities /wp-admin/admin.php?page=user_payments3.7235.64
Dashboard /wp-admin/admin.php?page=dashboard3.9341.27
Reports /wp-admin/admin.php?page=reports3.6932.76

Server storage [IO: ▲1.54MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 45 new files
Database: 8 new tables, 6 new options
New tables
wci_user_purchased_history
wci_successful_purchases
wci_user_profile_updated
wci_activity
wci_user_session
wci_abandon_cart
wci_events
wci_history
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Web Analytics for Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,937 ▲19114.52 ▲0.131.14 ▼0.6347.04 ▲7.62
Dashboard /wp-admin2,353 ▲1686.20 ▲0.32115.51 ▲16.5894.26 ▲54.38
Posts /wp-admin/edit.php2,161 ▲692.83 ▲0.8451.23 ▲8.6334.06 ▼4.96
Add New Post /wp-admin/post-new.php1,576 ▲3423.71 ▲5.20684.99 ▼7.4340.09 ▼18.11
Media Library /wp-admin/upload.php1,451 ▲635.19 ▲0.81111.62 ▼1.3582.59 ▲31.66
Customer Stats /wp-admin/admin.php?page=customer_logs1,0262.7847.6147.93
Opportunities /wp-admin/admin.php?page=user_payments1,0762.7538.2840.06
Dashboard /wp-admin/admin.php?page=dashboard1,4402.6549.2754.71
Reports /wp-admin/admin.php?page=reports1,0522.4136.5231.21

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie tables were found after uninstall: 8 tables
    • wci_history
    • wci_successful_purchases
    • wci_user_profile_updated
    • wci_events
    • wci_user_session
    • wci_abandon_cart
    • wci_user_purchased_history
    • wci_activity
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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 trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/woo-customer-insight/includes/wci_cart_submit.php:8

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=reports
    • > Network (severe)
    wp-content/plugins/woo-customer-insight/fonts/fontawesome-webfont.woff2?v=4.6.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=customer_logs
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=customer_logs 0:0 Uncaught SyntaxError: Unexpected token '
    • > GET request to /wp-admin/admin.php?page=user_payments
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=user_payments 0:0 Uncaught SyntaxError: Unexpected token '
    • > GET request to /wp-admin/admin.php?page=dashboard
    • > Network (severe)
    wp-content/plugins/woo-customer-insight/css/images/ui-bg_flat_75_ffffff_40x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=dashboard
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=dashboard 0:0 Uncaught SyntaxError: Unexpected token '
    • > GET request to /wp-admin/admin.php?page=reports
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=reports 0:0 Uncaught SyntaxError: Unexpected token '

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Dashboard view.), #2 (Opportunities view.), #3 (Customer Stats.), #4 (Reports.)
Please take inspiration from this readme.txt

woo-customer-insight/woo-customer-insight.php 92% from 13 tests

"Web Analytics for Woocommerce" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder was not found ("/languages")

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
Good job! No executable or dangerous file extensions detected7,415 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP216082795,028
JavaScript103894291,781
CSS68781606

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity36.62
▷ Minimum class complexity1.00
▷ Maximum class complexity220.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods61
▷ Static methods1931.15%
▷ Public methods5996.72%
▷ Protected methods00.00%
▷ Private methods23.28%
Functions7
▷ Named functions114.29%
▷ Anonymous functions685.71%
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
6 PNG files occupy 0.65MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-4.png87.60KB34.58KB▼ 60.52%
images/eye2Icons24.png1.15KB0.75KB▼ 34.36%
screenshot-2.png170.67KB71.09KB▼ 58.35%
screenshot-3.png240.65KB94.41KB▼ 60.77%
images/Sample.png18.44KB7.16KB▼ 61.16%