84% convert-username-to-customer-code-for-woocommerce

Code Review | Convert Username to Customer Code for Woocommerce

WordPress plugin Convert Username to Customer Code for Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: convert-username-...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.6
  • WordPress version: 6.3.1
  • First release: Jan 30, 2021
  • Latest release: Jan 31, 2021
  • Number of updates: 8
  • Update frequency: every 0.5 days
  • Top authors: 4wpbari (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /407 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Convert Username to Customer Code for Woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.73 ▼5.12
Dashboard /wp-admin3.31 ▼0.0350.38 ▼13.80
Posts /wp-admin/edit.php3.36 ▲0.0146.82 ▼6.95
Add New Post /wp-admin/post-new.php5.89 ▲0.0187.57 ▼14.80
Media Library /wp-admin/upload.php3.23 ▲0.0134.85 ▼2.53

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Convert Username to Customer Code for Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.521.84 ▼0.0443.06 ▲3.88
Dashboard /wp-admin2,203 ▲155.83 ▲0.95109.66 ▼9.2441.77 ▼3.53
Posts /wp-admin/edit.php2,089 ▲212.12 ▲0.1033.90 ▼3.1235.51 ▼0.99
Add New Post /wp-admin/post-new.php1,537 ▲923.04 ▲2.32674.43 ▼27.7052.21 ▲7.31
Media Library /wp-admin/upload.php1,388 ▲34.18 ▲0.0698.97 ▼18.7044.13 ▼6.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/convert-username-to-customer-code-for-woocommerce/cutccfw-admin-settings.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/convert-username-to-customer-code-for-woocommerce/cutccfw-settings.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: codice cliente, username code, woocommerce, customer code

convert-username-to-customer-code-for-woocommerce/convert-username-to-customer-code-for-woocommerce.php 85% from 13 tests

The main PHP file in "Convert Username to Customer Code for Woocommerce" ver. 1.0.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 552 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin542 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4172130427
JavaScript12017114
JSON1001

PHP code Passed 2 tests

A brief analysis 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.43
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods5100.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin