72% custom-fields-account-registration-for-woocommerce

Code Review | Custom Fields Account Registration For Woocommerce

WordPress plugin Custom Fields Account Registration For Woocommerce scored72%from 54 tests.

About plugin

  • Plugin page: custom-fields-acc...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 3, 2022
  • Latest release: Sep 26, 2023
  • Number of updates: 5
  • Update frequency: every 84.2 days
  • Top authors: silverplugins217 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /2,047 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.28MB] [CPU: ▲3.55ms] Passed 4 tests

An overview of server-side resources used by Custom Fields Account Registration For Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2944.36 ▲4.36
Dashboard /wp-admin3.57 ▲0.2750.75 ▲3.91
Posts /wp-admin/edit.php3.69 ▲0.3348.30 ▲2.19
Add New Post /wp-admin/post-new.php6.18 ▲0.2994.22 ▲6.94
Media Library /wp-admin/upload.php3.49 ▲0.2744.53 ▲3.72
Settings /wp-admin/edit.php?post_type=wporg_custom_field&page=custom-fields-registration-settings3.4839.30
All Register Fields /wp-admin/edit.php?post_type=wporg_custom_field3.5443.11
Add New Field /wp-admin/post-new.php?post_type=wporg_custom_field3.5046.56

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 30 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
recovery_mode_email_last_sent
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Fields Account Registration For Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲12413.24 ▼0.958.55 ▲6.7642.27 ▼1.25
Dashboard /wp-admin2,250 ▲705.82 ▲0.1989.51 ▲1.1936.54 ▼8.77
Posts /wp-admin/edit.php2,159 ▲802.30 ▲0.2737.68 ▲2.3032.98 ▼2.07
Add New Post /wp-admin/post-new.php1,575 ▲2423.50 ▲5.46630.17 ▲4.4335.91 ▼37.29
Media Library /wp-admin/upload.php1,455 ▲554.45 ▲0.2997.69 ▼1.3743.94 ▼1.64
Settings /wp-admin/edit.php?post_type=wporg_custom_field&page=custom-fields-registration-settings1,1982.0727.6553.01
All Register Fields /wp-admin/edit.php?post_type=wporg_custom_field1,1302.4438.5029.35
Add New Field /wp-admin/post-new.php?post_type=wporg_custom_field1,2891.517.2524.95

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • recovery_mode_email_last_sent
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=wporg_custom_field
    • > Error in wp-content/plugins/custom-fields-account-registration-for-woocommerce/main/backend/cfafwr_backend.php+288
    Uncaught Error: Call to undefined function wc() in wp-content/plugins/custom-fields-account-registration-for-woocommerce/main/backend/cfafwr_backend.php:288
    Stack trace:
    #0 wp-admin/includes/template.php(1443): cusrom_field_meta_box_callback()
    #1 wp-admin/edit-form-advanced.php(711): do_meta_boxes()
    #2 wp-admin/post-new.php(75): require('/var/www/wordpr...')
    #3 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-fields-account-registration-for-woocommerce/main/backend/cfafwr_comman.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-fields-account-registration-for-woocommerce/main/resource/cfafwr-load-js-css.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-fields-account-registration-for-woocommerce/main/frontend/cfafwr_frontend.php:345
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-fields-account-registration-for-woocommerce/main/resource/cfafwr-language.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-fields-account-registration-for-woocommerce/main/backend/cfafwr_backend.php:645

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wporg_custom_field
    • > Network (severe)
    wp-content/plugins/woocommerce/assets/css/admin.css?ver=1.0 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Contributors: The plugin contributors field is not present
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Add New Custom Registration Field), #2 (General Setting Like Enable Disable Authentication And Labels, Text Change), #3 (Hide Show custom Fields On My Account Page), #4 (Ragistration Fields on My Account Page)
The official readme.txt is a good inspiration

custom-fields-account-registration-for-woocommerce/custom_fields_registration_main.php 85% from 13 tests

The main PHP script in "Custom Fields Account Registration For Woocommerce" version 1.0 is automatically included on every request by WordPress
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
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-fields-account-registration-for-woocommerce.php" instead of "custom_fields_registration_main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin5,295 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript44712342,906
CSS6100451,332
PHP676151,056
SVG1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 compressed PNG files occupy 0.07MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/edit_icon.png2.53KB2.10KB▼ 17.15%
assets/images/remove.png1.76KB1.64KB▼ 6.79%
assets/images/remove_icon.png0.44KB0.56KB0.00%
assets/images/review.png15.87KB11.90KB▼ 25.01%
assets/images/add_icon.png0.43KB0.52KB0.00%