78% custom-menu-for-wc-my-account

Code Review | Custom Menu for WooCommerce My Account

WordPress plugin Custom Menu for WooCommerce My Account scored78%from 54 tests.

About plugin

  • Plugin page: custom-menu-for-w...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Dec 15, 2021
  • Latest release: Dec 15, 2021
  • Number of updates: 6
  • Update frequency: N/A
  • Top authors: charlestsmith (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,791 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.01MB] [CPU: ▼4.22ms] Passed 4 tests

This is a short check of server-side resources used by Custom Menu for WooCommerce My Account
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0139.58 ▼1.26
Dashboard /wp-admin3.31 ▲0.0148.17 ▼4.19
Posts /wp-admin/edit.php3.36 ▲0.0147.87 ▲1.44
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.60 ▼12.88
Media Library /wp-admin/upload.php3.23 ▲0.0132.87 ▲2.74
Add Account Menu /wp-admin/admin.php?page=WACM_add_menu_page3.2329.14

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Custom Menu for WooCommerce My Account
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9014.74 ▲0.112.12 ▲0.3243.96 ▼4.48
Dashboard /wp-admin2,203 ▲125.83 ▼0.02103.41 ▼3.3937.03 ▼1.67
Posts /wp-admin/edit.php2,086 ▼32.05 ▲0.0435.94 ▼1.3331.38 ▼0.10
Add New Post /wp-admin/post-new.php1,533 ▼523.25 ▲0.07682.02 ▲50.0355.22 ▼8.66
Media Library /wp-admin/upload.php1,388 ▼34.22 ▲0.0395.03 ▼5.8042.73 ▼2.58
Add Account Menu /wp-admin/admin.php?page=WACM_add_menu_page8402.0333.4027.61

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=WACM_add_menu_page
    • > Notice in wp-content/plugins/custom-menu-for-wc-my-account/templates/add_menu_template.php+37
    Trying to access array offset on value of type int

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/custom-menu-for-wc-my-account/index.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
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 is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: custom my account, pages, add my account, woocommerce

custom-menu-for-wc-my-account/index.php 85% from 13 tests

The entry point to "Custom Menu for WooCommerce My Account" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.5" instead of "5.0")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("custom-menu-for-wc-my-account.php" instead of "index.php")

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
No dangerous file extensions were detected336 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP46625175
CSS1180143
JavaScript13018

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.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
No PNG files were detected