10% account-manager-woocommerce

Code Review | Account Manager for WooCommerce

WordPress plugin Account Manager for WooCommerce scored 10% 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: 5.9.2
  • 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

70+ active / 2,344 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/account-manager-woocommerce/accountmanager.php+20
    Constant WP_PLUGIN_DIR already defined

Server metrics [RAM: ▼2.51MB] [CPU: ▼339.90ms] Passed 4 tests

Server-side resources used by Account Manager for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.86 ▼1.654.53 ▼45.67
Dashboard /wp-admin1.88 ▼1.533.65 ▼28.52
Posts /wp-admin/edit.php1.88 ▼1.764.01 ▼33.14
Add New Post /wp-admin/post-new.php1.88 ▼5.094.68 ▼1,252.25
Media Library /wp-admin/upload.php1.88 ▼1.413.63 ▼22.03
Insights /wp-admin/admin.php?page=zacctmgr_insights1.884.21
Settings /wp-admin/admin.php?page=zacctmgr_settings1.884.90
Overview /wp-admin/admin.php?page=zacctmgr1.883.71
Commission /wp-admin/admin.php?page=zacctmgr_commission1.884.47

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 28 new files
Database: 4 new tables, 6 new options
New tables
wp_zacctmgr_acm_order_audit_mapping
wp_zacctmgr_acm_commissions_mapping
wp_zacctmgr_acm_manager_commission_audit_mapping
wp_zacctmgr_acm_assignments_mapping
New WordPress options
zacctmgr_v2_install_date
zacctmgr_acm_assignments_mapping_version
zacctmgr_acm_manager_commission_audit_mapping
recovery_mode_email_last_sent
zacctmgr_acm_order_audit_mapping_version
zacctmgr_acm_commissions_mapping_version

Browser metrics Passed 4 tests

Checking browser requirements for Account Manager for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,849 ▲9116.63 ▲0.896.63 ▲0.702.32 ▼0.06
Dashboard /wp-admin2,972 ▲1146.95 ▲0.83119.67 ▼11.10156.65 ▼3.00
Posts /wp-admin/edit.php2,776 ▲823.54 ▲0.3170.12 ▲1.19144.37 ▲2.78
Add New Post /wp-admin/post-new.php1,728 ▲6019.41 ▲1.30396.77 ▲20.45161.13 ▲4.38
Media Library /wp-admin/upload.php1,781 ▲835.97 ▲0.50126.55 ▼11.20181.21 ▼2.03
Insights /wp-admin/admin.php?page=zacctmgr_insights9071.9737.67102.98
Settings /wp-admin/admin.php?page=zacctmgr_settings8891.9736.9671.37
Overview /wp-admin/admin.php?page=zacctmgr1,0872.1637.19107.19
Commission /wp-admin/admin.php?page=zacctmgr_commission9161.9841.56111.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/account-manager-woocommerce/accountmanager.php+20
    Constant WP_PLUGIN_DIR already defined
  • Zombie tables were found after uninstall: 4 tables
    • wp_zacctmgr_acm_manager_commission_audit_mapping
    • wp_zacctmgr_acm_order_audit_mapping
    • wp_zacctmgr_acm_assignments_mapping
    • wp_zacctmgr_acm_commissions_mapping
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • recovery_mode_email_last_sent
    • zacctmgr_acm_manager_commission_audit_mapping
    • zacctmgr_acm_commissions_mapping_version
    • zacctmgr_v2_install_date
    • zacctmgr_acm_assignments_mapping_version
    • zacctmgr_acm_order_audit_mapping_version

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=zacctmgr_commission
    • > 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_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(307): ZACCTMGR_Core_Admin->show_zacctmgr_insights()
    #4 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(474): 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(307): ZACCTMGR_Core_Admin->show_zacctmgr_settings()
    #2 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(474): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > 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(1450): ZACCTMGR_Core_Customer->column_default()
    #1 wp-admin/includes/class-wp-list-table.php(1390): WP_List_Table->single_row_columns()
    #2 wp-admin/includes/class-wp-list-table.php(1377): WP_List_Table->single_row()
    #3 wp-admin/includes/class-wp-list-table.php(1362): WP_List_Table->display_rows()
    #4 wp-admin/includes/class-wp-list-table.php(1289): 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_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(307): ZACCTMGR_Core_Admin->show_zacctmgr_commission()
    #4 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(474): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 {main}
    thrown

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: There are too many tags (26 tag instead of maximum 10)
Please take inspiration from this readme.txt

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

"Account Manager for WooCommerce" version 2.0.19's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Requires at least: The required version number must 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 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were 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

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected