84% total-spent-by-customer-for-woocommerce

Code Review | Total Spent by Customer for WooCommerce

WordPress plugin Total Spent by Customer for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: total-spent-by-cu...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.5.0-4.9.2
  • WordPress version: 6.3.1
  • First release: Mar 1, 2017
  • Latest release: Feb 2, 2018
  • Number of updates: 4
  • Update frequency: every 84.0 days
  • Top authors: Amgnando (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active /1,450 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

Analyzing server-side resources used by Total Spent by Customer for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.59 ▲0.49
Dashboard /wp-admin3.31 ▼0.0346.09 ▼16.90
Posts /wp-admin/edit.php3.37 ▲0.0145.47 ▲2.64
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.45 ▼24.81
Media Library /wp-admin/upload.php3.24 ▲0.0132.79 ▲2.84

Server storage [IO: ▲0.18MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Total Spent by Customer for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.071.76 ▲0.0444.25 ▲1.15
Dashboard /wp-admin2,192 ▲185.51 ▼0.2085.01 ▼14.9540.11 ▼4.20
Posts /wp-admin/edit.php2,097 ▼31.95 ▼0.0335.91 ▼2.9833.51 ▼3.35
Add New Post /wp-admin/post-new.php1,526 ▼1023.76 ▲0.85637.37 ▲42.4654.47 ▼1.49
Media Library /wp-admin/upload.php1,397 ▼34.18 ▼0.00100.56 ▲6.1641.12 ▲0.34

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
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 add_action() in wp-content/plugins/total-spent-by-customer-for-woocommerce/total-spent-by-customer-for-woocommerce.php:39

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Screenshots: Please add an image for screenshot #1 (The custom column)
The official readme.txt might help

total-spent-by-customer-for-woocommerce/total-spent-by-customer-for-woocommerce.php 92% from 13 tests

The main PHP script in "Total Spent by Customer for WooCommerce" version 1.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.1" instead of "2.5.0")

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
No dangerous file extensions were detected44 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1167344

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.43
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods457.14%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
banner.png33.32KB14.60KB▼ 56.19%