10% account-manager-woocommerce

Code Review | Account Manager for WooCommerce

WordPress plugin Account Manager for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: account-manager-w...
  • Plugin version: 2.0.19
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.4.0-5.8.0
  • WordPress version: 6.3.1
  • First release: Jan 6, 2019
  • Latest release: Aug 4, 2021
  • Number of updates: 37
  • Update frequency: every 25.5 days
  • Top authors: bizswoop (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /2,782 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/account-manager-woocommerce/accountmanager.php+20
    Constant WP_PLUGIN_DIR already defined

Server metrics [RAM: ▼1.96MB] [CPU: ▼56.19ms] Passed 4 tests

An overview of server-side resources used by Account Manager for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.40 ▼36.15
Dashboard /wp-admin2.05 ▼1.266.01 ▼47.49
Posts /wp-admin/edit.php2.05 ▼1.315.83 ▼43.10
Add New Post /wp-admin/post-new.php2.05 ▼3.845.27 ▼98.02
Media Library /wp-admin/upload.php2.05 ▼1.185.95 ▼30.04
Overview /wp-admin/admin.php?page=zacctmgr2.055.23
Insights /wp-admin/admin.php?page=zacctmgr_insights2.065.67
Commission /wp-admin/admin.php?page=zacctmgr_commission2.065.39
Settings /wp-admin/admin.php?page=zacctmgr_settings2.066.24

Server storage [IO: ▲0.57MB] [DB: ▲0.08MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 28 new files
Database: 4 new tables, 12 new options
New tables
wp_zacctmgr_acm_manager_commission_audit_mapping
wp_zacctmgr_acm_commissions_mapping
wp_zacctmgr_acm_order_audit_mapping
wp_zacctmgr_acm_assignments_mapping
New WordPress options
can_compress_scripts
db_upgraded
zacctmgr_v2_install_date
zacctmgr_acm_order_audit_mapping_version
zacctmgr_acm_commissions_mapping_version
widget_recent-comments
widget_recent-posts
recovery_mode_email_last_sent
theysaidso_admin_options
zacctmgr_acm_manager_commission_audit_mapping
...

Browser metrics Passed 4 tests

An overview of browser requirements for Account Manager for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲7113.27 ▼0.961.74 ▼0.2842.33 ▼2.36
Dashboard /wp-admin2,266 ▲925.07 ▼0.60103.28 ▼4.7543.28 ▼1.60
Posts /wp-admin/edit.php2,169 ▲722.38 ▲0.3438.27 ▲0.0637.74 ▲3.80
Add New Post /wp-admin/post-new.php1,581 ▲3623.71 ▲0.65682.30 ▲18.5556.10 ▼6.61
Media Library /wp-admin/upload.php1,471 ▲744.60 ▲0.36104.49 ▼3.0446.97 ▲1.90
Overview /wp-admin/admin.php?page=zacctmgr8881.536.5627.65
Insights /wp-admin/admin.php?page=zacctmgr_insights7401.146.4019.33
Commission /wp-admin/admin.php?page=zacctmgr_commission7461.536.4827.48
Settings /wp-admin/admin.php?page=zacctmgr_settings7291.148.1120.05

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/account-manager-woocommerce/accountmanager.php+20
    Constant WP_PLUGIN_DIR already defined
  • Zombie tables detected upon uninstall: 4 tables
    • wp_zacctmgr_acm_manager_commission_audit_mapping
    • wp_zacctmgr_acm_order_audit_mapping
    • wp_zacctmgr_acm_commissions_mapping
    • wp_zacctmgr_acm_assignments_mapping
  • Zombie WordPress options detected upon uninstall: 12 options
    • zacctmgr_acm_commissions_mapping_version
    • zacctmgr_acm_manager_commission_audit_mapping
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • zacctmgr_acm_assignments_mapping_version
    • widget_recent-comments
    • zacctmgr_v2_install_date
    • recovery_mode_email_last_sent
    • ...

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=zacctmgr_settings
    • > Notice in wp-content/plugins/account-manager-woocommerce/accountmanager.php+20
    Constant WP_PLUGIN_DIR already defined
    • > GET request to /wp-admin/admin.php?page=zacctmgr
    • > Error in wp-content/plugins/account-manager-woocommerce/helper/class-zacctmgr-core-customer.php+143
    Uncaught Error: Call to undefined function wc_price() in wp-content/plugins/account-manager-woocommerce/helper/class-zacctmgr-core-customer.php:143
    Stack trace:
    #0 wp-admin/includes/class-wp-list-table.php(1752): ZACCTMGR_Core_Customer->column_default()
    #1 wp-admin/includes/class-wp-list-table.php(1690): WP_List_Table->single_row_columns()
    #2 wp-admin/includes/class-wp-list-table.php(1677): WP_List_Table->single_row()
    #3 wp-admin/includes/class-wp-list-table.php(1662): WP_List_Table->display_rows()
    #4 wp-admin/includes/class-wp-list-table.php(1589): WP_List_Table->display_rows_or_placeholder()
    #5 wp-content/plugins/account-manager-woocommerce/helper/class-zacctmgr-core-customer.php(75): WP_List_Table->display()
    #6 wp-content/plugins/account-manager-woocommerce/template/overview.php(10): ZACCTMGR_Core_Customer->print_overview()
    #7 wp-content/
    • > GET request to /wp-admin/admin.php?page=zacctmgr_insights
    • > Error in wp-content/plugins/account-manager-woocommerce/accountmanager_functions.php+233
    Uncaught Error: Call to undefined function wc_get_customer_total_spent() in wp-content/plugins/account-manager-woocommerce/accountmanager_functions.php:233
    Stack trace:
    #0 wp-content/plugins/account-manager-woocommerce/template/tab/customers.php(10): zacctmgr_get_top_customers()
    #1 wp-content/plugins/account-manager-woocommerce/template/insights.php(14): include_once('/var/www/wordpr...')
    #2 wp-content/plugins/account-manager-woocommerce/helper/class-zacctmgr-core-admin.php(224): include_once('/var/www/wordpr...')
    #3 wp-includes/class-wp-hook.php(310): ZACCTMGR_Core_Admin->show_zacctmgr_insights()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=zacctmgr_commission
    • > Error in wp-content/plugins/account-manager-woocommerce/accountmanager_functions.php+1022
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/account-manager-woocommerce/accountmanager_functions.php:1022
    Stack trace:
    #0 wp-content/plugins/account-manager-woocommerce/template/commission/my_commission.php(125): zacctmgr_get_manager_report()
    #1 wp-content/plugins/account-manager-woocommerce/template/commissions.php(25): include_once('/var/www/wordpr...')
    #2 wp-content/plugins/account-manager-woocommerce/helper/class-zacctmgr-core-admin.php(216): include_once('/var/www/wordpr...')
    #3 wp-includes/class-wp-hook.php(310): ZACCTMGR_Core_Admin->show_zacctmgr_commission()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=zacctmgr_settings
    • > Error in wp-content/plugins/account-manager-woocommerce/template/settings.php+22
    Uncaught Error: Call to undefined function wc_get_order_statuses() in wp-content/plugins/account-manager-woocommerce/template/settings.php:22
    Stack trace:
    #0 wp-content/plugins/account-manager-woocommerce/helper/class-zacctmgr-core-admin.php(220): include_once()
    #1 wp-includes/class-wp-hook.php(310): ZACCTMGR_Core_Admin->show_zacctmgr_settings()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

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
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 issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 26 tag instead of maximum 10
You can take inspiration from this readme.txt

account-manager-woocommerce/accountmanager.php 85% from 13 tests

Analyzing the main PHP file in "Account Manager for WooCommerce" version 2.0.19
Please make the necessary changes and fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("3.0" instead of "2.4.0")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("account-manager-woocommerce.php" instead of "accountmanager.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected11,819 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP211,1114728,624
JavaScript212212,719
CSS1960471
Markdown2405

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity74.00
▷ Minimum class complexity8.00
▷ Maximum class complexity268.00
Average method complexity7.53
▷ Minimum method complexity1.00
▷ Maximum method complexity96.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods79
▷ Static methods1113.92%
▷ Public methods7898.73%
▷ Protected methods00.00%
▷ Private methods11.27%
Functions52
▷ Named functions5198.08%
▷ Anonymous functions11.92%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin