83% customer-manager-for-woocommerce

Code Review | Customer Manager for Woocommerce

WordPress plugin Customer Manager for Woocommerce scored83%from 54 tests.

About plugin

  • Plugin page: customer-manager-...
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.3
  • WordPress version: 6.3.1
  • First release: Sep 30, 2016
  • Latest release: Jan 23, 2020
  • Number of updates: 52
  • Update frequency: every 23.3 days
  • Top authors: phoeniixx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /5,633 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

This is a short check of server-side resources used by Customer Manager for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.00 ▲5.44
Dashboard /wp-admin3.31 ▲0.0050.29 ▼2.48
Posts /wp-admin/edit.php3.36 ▲0.0049.57 ▲0.44
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.96 ▼4.52
Media Library /wp-admin/upload.php3.23 ▲0.0039.42 ▲4.37

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 60 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Customer Manager for Woocommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.481.88 ▲0.1044.39 ▲4.92
Dashboard /wp-admin2,200 ▲185.85 ▼0.04111.73 ▲0.8344.46 ▼3.30
Posts /wp-admin/edit.php2,089 ▼32.01 ▲0.0139.97 ▲2.9635.12 ▲0.96
Add New Post /wp-admin/post-new.php1,514 ▼017.45 ▼0.10636.39 ▼43.8950.82 ▼2.33
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.0295.50 ▼14.2042.75 ▼4.71

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
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/customer-manager-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/customer-manager-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/customer-manager-for-woocommerce/libs/tgm/class-tgm-plugin-activation.php:2109

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

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

customer-manager-for-woocommerce/mainfilter.php 77% from 13 tests

The principal PHP file in "Customer Manager for Woocommerce" v. 2.3 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.0" instead of "2.6.0")
  • Main file name: Name the main plugin file the same as the plugin slug ("customer-manager-for-woocommerce.php" instead of "mainfilter.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin13,368 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript66364743,776
PHP81,1811,6522,566
CSS75562,505
Sass15153412,190
LESS1434441,646
SVG100685

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity48.14
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.27
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods101
▷ Static methods54.95%
▷ Public methods7877.23%
▷ Protected methods2322.77%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/aa2.png1.34KB1.26KB▼ 5.77%