79% cost-of-goods-manager-for-woocommerce

Code Review | Cost of Goods Manager for WooCommerce

WordPress plugin Cost of Goods Manager for WooCommerce scored 79% from 54 tests.

About plugin

  • Plugin page: cost-of-goods-man...
  • Plugin version: 1.0.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.4.0-5.8.0
  • WordPress version: 6.3.1
  • First release: Apr 9, 2020
  • Latest release: Aug 4, 2021
  • Number of updates: 23
  • Update frequency: every 21.0 days
  • Top authors: bizswoop (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 1,839 total downloads

Benchmarks

Plugin footprint 65% 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.12MB] [CPU: ▼4.53ms] Passed 4 tests

Server-side resources used by Cost of Goods Manager for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.67 ▼1.36
Dashboard /wp-admin3.45 ▲0.1544.09 ▲0.01
Posts /wp-admin/edit.php3.56 ▲0.2143.94 ▼4.18
Add New Post /wp-admin/post-new.php6.05 ▲0.1783.82 ▼12.27
Media Library /wp-admin/upload.php3.37 ▲0.1434.74 ▼0.32

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: 1 new table, 6 new options
New tables
wp_zcostofgoods_product_cog
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cost of Goods Manager for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲10813.23 ▼1.362.11 ▲0.4843.49 ▲5.21
Dashboard /wp-admin2,224 ▲415.87 ▲0.9899.34 ▼8.2439.95 ▼3.39
Posts /wp-admin/edit.php2,107 ▲182.03 ▼0.0235.83 ▼1.2333.96 ▼1.04
Add New Post /wp-admin/post-new.php1,380 ▼14016.72 ▼6.29546.85 ▼140.0145.47 ▼6.36
Media Library /wp-admin/upload.php1,406 ▲184.20 ▼0.0394.95 ▼1.5742.06 ▼4.96

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_zcostofgoods_product_cog
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 86% 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 need to be fixed:
  • Tags: You are using too many tags: 28 tag instead of maximum 10
The official readme.txt might help

cost-of-goods-manager-for-woocommerce/cost-of-goods.php 77% from 13 tests

This is the main PHP file of "Cost of Goods Manager for WooCommerce" version 1.0.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0" instead of "2.4.0")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cost-of-goods-manager-for-woocommerce.php" instead of "cost-of-goods.php")

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
There were no executable files found in this plugin1,061 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP414717664
CSS1740347
JavaScript18049
Markdown1101

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity24.00
▷ Minimum class complexity5.00
▷ Maximum class complexity43.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods33
▷ Static methods515.15%
▷ Public methods3296.97%
▷ Protected methods00.00%
▷ Private methods13.03%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants2
▷ Global constants2100.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
PNG images were not found in this plugin