89% total-cost-input-for-woocommerce

Code Review | Total Cost Input for WooCommerce

WordPress plugin Total Cost Input for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: total-cost-input-...
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.0-6.3.0
  • WordPress version: 6.3.1
  • First release: Jun 30, 2022
  • Latest release: Sep 7, 2023
  • Number of updates: 12
  • Update frequency: every 36.2 days
  • Top authors: ethereumicoio (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /456 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: ▼3.65ms] Passed 4 tests

Analyzing server-side resources used by Total Cost Input for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.64 ▼0.83
Dashboard /wp-admin3.31 ▲0.0053.48 ▲5.29
Posts /wp-admin/edit.php3.36 ▲0.0049.19 ▼1.04
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.49 ▼13.37
Media Library /wp-admin/upload.php3.23 ▲0.0035.55 ▲0.64

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 367 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Total Cost Input for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5413.37 ▼1.231.83 ▲0.0744.08 ▲3.23
Dashboard /wp-admin2,221 ▲184.88 ▼0.02101.84 ▼8.1843.20 ▲2.61
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0336.14 ▼5.5137.79 ▲1.41
Add New Post /wp-admin/post-new.php1,526 ▼1917.49 ▼5.63660.74 ▼72.5758.78 ▲4.91
Media Library /wp-admin/upload.php1,403 ▲34.16 ▼0.1098.10 ▼6.4441.44 ▼0.51

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: woocommerce, quantity, amount, e-commerce, total

total-cost-input-for-woocommerce/total-cost-input-for-woocommerce.php 85% from 13 tests

"Total Cost Input for WooCommerce" version 1.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 158 characters long)
  • Requires at least: Required version must match the one declared in readme.txt ("4.7" instead of "5.5.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin42,041 lines of code in 233 files:
LanguageFilesBlank linesComment linesLines of code
PHP1298,26417,47934,172
PO File822,2142,4747,526
JavaScript53660219
SVG10162
CSS144428
JSON10018
XML13016

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity87.79
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes52
▷ Abstract classes23.85%
▷ Concrete classes5096.15%
▷ Final classes00.00%
Methods1,296
▷ Static methods21316.44%
▷ Public methods90469.75%
▷ Protected methods171.31%
▷ Private methods37528.94%
Functions117
▷ Named functions11699.15%
▷ Anonymous functions10.85%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-4.png9.22KB3.67KB▼ 60.23%
vendor/freemius/wordpress-sdk/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/icon-256x256.png6.43KB3.35KB▼ 47.87%
vendor/freemius/wordpress-sdk/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/screenshot-3.png16.25KB5.74KB▼ 64.71%