90% cost-of-goods-for-woocommerce

Code Review | Cost of Goods Sold (COGS): Cost & Profit Calculator for WooCommerce

WordPress plugin Cost of Goods Sold (COGS): Cost & Profit Calculator for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: cost-of-goods-for...
  • Plugin version: 3.1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.4
  • WordPress version: 6.3.1
  • First release: Dec 6, 2018
  • Latest release: Nov 29, 2023
  • Number of updates: 158
  • Update frequency: every 11.5 days
  • Top authors: wpcodefactory (56.96%)algoritmika (43.67%)

Code review

54 tests

User reviews

34 reviews

Install metrics

9,000+ active /309,576 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Cost of Goods Sold (COGS): Cost & Profit Calculator for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.34 ▼4.18
Dashboard /wp-admin3.31 ▼0.0345.02 ▼15.44
Posts /wp-admin/edit.php3.37 ▲0.0147.02 ▼0.34
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.60 ▼8.71
Media Library /wp-admin/upload.php3.24 ▲0.0132.55 ▼4.94

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 81 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Cost of Goods Sold (COGS): Cost & Profit Calculator for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.37 ▲0.081.69 ▼0.1343.44 ▼1.96
Dashboard /wp-admin2,195 ▲155.52 ▼0.1385.80 ▼12.1839.65 ▼5.58
Posts /wp-admin/edit.php2,100 ▲32.00 ▲0.0334.87 ▼1.0534.86 ▼2.92
Add New Post /wp-admin/post-new.php1,529 ▲323.32 ▲0.05605.95 ▼66.2450.00 ▼2.57
Media Library /wp-admin/upload.php1,397 ▼04.21 ▲0.0697.08 ▼7.0941.22 ▼3.45

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Product cost of goods.), #2 (Cost of goods: variable product.), #3 (Cost of goods: variation.), #4 (Order "Cost of Goods" meta box.), #5 (Product bulk edit costs tool.), #6 (Cost of goods columns in "Analytics > Orders" report.)
Please take inspiration from this readme.txt

cost-of-goods-for-woocommerce/cost-of-goods-for-woocommerce.php Passed 13 tests

"Cost of Goods Sold (COGS): Cost & Profit Calculator for WooCommerce" version 3.1.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
72 characters long description:
Save product purchase costs (cost of goods) in WooCommerce. Beautifully.

Code Analysis Passed 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
There were no executable files found in this plugin11,524 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
PHP499443,6137,547
PO File31,3541,8243,227
JavaScript1144121647
JSON40062
CSS25627
Markdown1609
XML1005
Sass1010

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity21.82
▷ Minimum class complexity1.00
▷ Maximum class complexity218.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes39
▷ Abstract classes00.00%
▷ Concrete classes39100.00%
▷ Final classes12.56%
Methods332
▷ Static methods164.82%
▷ Public methods30993.07%
▷ Protected methods216.33%
▷ Private methods20.60%
Functions28
▷ Named functions1760.71%
▷ Anonymous functions1139.29%
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
There were not PNG files found in your plugin