84% woocommerce-email-inquiry-cart-options

Code Review | Email Inquiry & Cart Options for WooCommerce

WordPress plugin Email Inquiry & Cart Options for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-email...
  • Plugin version: 3.4.0
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 12, 2013
  • Latest release: Nov 27, 2023
  • Number of updates: 193
  • Update frequency: every 20.3 days
  • Top authors: a3rev (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

1,000+ active /131,870 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
Install script ran successfully

Server metrics [RAM: ▲2.57MB] [CPU: ▲10.67ms] Passed 4 tests

Server-side resources used by Email Inquiry & Cart Options for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /6.08 ▲2.6251.87 ▲10.88
Dashboard /wp-admin5.86 ▲2.5560.79 ▲10.03
Posts /wp-admin/edit.php5.98 ▲2.6163.49 ▲11.38
Add New Post /wp-admin/post-new.php8.47 ▲2.5896.96 ▲10.38
Media Library /wp-admin/upload.php5.79 ▲2.5553.42 ▲20.28
Email & Cart /wp-admin/admin.php?page=email-cart-options5.8459.58

Server storage [IO: ▲2.77MB] [DB: ▲0.06MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 181 new files
Database: no new tables, 18 new options
New WordPress options
wc_email_inquiry_customize_email_button
wc_email_inquiry_clean_on_deletion
widget_recent-comments
wc_email_inquiry_contact_form_information_text
wc_email_inquiry_google_font_list
wc_email_inquiry_rules_roles_settings
widget_theysaidso_widget
wc_email_inquiry_contact_form_condition_text
wc_email_inquiry_cart_options_style_version
db_upgraded
...

Browser metrics Passed 4 tests

Checking browser requirements for Email Inquiry & Cart Options for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,944 ▲18214.11 ▼0.121.76 ▲0.1937.20 ▼0.45
Dashboard /wp-admin2,196 ▲285.55 ▼0.0394.08 ▼5.6743.08 ▼4.42
Posts /wp-admin/edit.php2,104 ▲42.02 ▲0.0836.71 ▼1.3832.95 ▼3.03
Add New Post /wp-admin/post-new.php1,536 ▲1022.91 ▼0.29670.04 ▲65.5550.20 ▲3.66
Media Library /wp-admin/upload.php1,401 ▼24.16 ▲0.0198.59 ▲2.9942.09 ▲2.11
Email & Cart /wp-admin/admin.php?page=email-cart-options2,0964.0693.82102.18

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 17 options
    • wc_email_inquiry_contact_form_condition_text
    • widget_recent-comments
    • a3rev_wc_email_inquiry_version
    • theysaidso_admin_options
    • a3rev_wc_email_inquiry_ultimate_version
    • widget_theysaidso_widget
    • wc_email_inquiry_contact_success
    • wc_email_inquiry_contact_form_settings
    • wc_email_inquiry_clean_on_deletion
    • wc_email_inquiry_contact_form_information_text
    • ...

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 22× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: inquiry_button_bg_colour_to in wp-content/plugins/woocommerce-email-inquiry-cart-options/templates/customized_style.php on line 47
    • > PHP Notice
      Undefined variable: inquiry_button_bg_colour in wp-content/plugins/woocommerce-email-inquiry-cart-options/templates/customized_style.php on line 36
    • > PHP Fatal error
      Uncaught Error: Call to a member function generate_border_css() on null in wp-content/plugins/woocommerce-email-inquiry-cart-options/templates/customized_style.php:52
    • > PHP Warning
      Use of undefined constant WC_EMAIL_INQUIRY_PREFIX - assumed 'WC_EMAIL_INQUIRY_PREFIX' (this will throw an Error in a future version of PHP) in wp-content/plugins/woocommerce-email-inquiry-cart-options/templates/customized_style.php on line 52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/woocommerce-email-inquiry-cart-options/woocommerce-email-inquiry-cart-options.php:29
    • > PHP Notice
      Undefined variable: inquiry_button_bg_colour_to in wp-content/plugins/woocommerce-email-inquiry-cart-options/templates/customized_style.php on line 42
    • > PHP Notice
      Undefined variable: inquiry_button_margin_right in wp-content/plugins/woocommerce-email-inquiry-cart-options/templates/customized_style.php on line 23
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/woocommerce-email-inquiry-cart-options/templates/customized_style.php on line 13
    • > PHP Notice
      Undefined variable: inquiry_button_margin_top in wp-content/plugins/woocommerce-email-inquiry-cart-options/templates/customized_style.php on line 21
    • > PHP Notice
      Undefined index: WC_EMAIL_INQUIRY_PREFIXadmin_interface in wp-content/plugins/woocommerce-email-inquiry-cart-options/templates/customized_style.php on line 52

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: woocommerce brochure page, woocommerce catalog visibility, woocommerce, woocommerce product emails, woocommerce add to cart...

woocommerce-email-inquiry-cart-options/woocommerce-email-inquiry-cart-options.php 92% from 13 tests

The main file in "Email Inquiry & Cart Options for WooCommerce" v. 3.4.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 310 characters long)

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected53,002 lines of code in 122 files:
LanguageFilesBlank linesComment linesLines of code
JSON50023,814
JavaScript312,0451,49412,553
PHP482,6242,26611,080
CSS223061583,385
PO File29541,9161,420
LESS57526642
SVG53049
Sass33130
HTML12029

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 410)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity69.10
▷ Minimum class complexity1.00
▷ Maximum class complexity801.00
Average method complexity5.62
▷ Minimum method complexity1.00
▷ Maximum method complexity410.00
Code structure
Namespaces8
Interfaces0
Traits0
Classes29
▷ Abstract classes00.00%
▷ Concrete classes29100.00%
▷ Final classes00.00%
Methods429
▷ Static methods5412.59%
▷ Public methods26060.61%
▷ Protected methods14132.87%
▷ Private methods286.53%
Functions31
▷ Named functions2064.52%
▷ Anonymous functions1135.48%
Constants20
▷ Global constants1575.00%
▷ Class constants525.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
32 PNG files occupy 0.10MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/slider-container-start.png1.69KB0.70KB▼ 58.32%
assets/images/follow-twitter.png4.04KB2.07KB▼ 48.62%
admin/assets/images/slider-handle.png2.67KB1.71KB▼ 36.00%
assets/images/a3-plugins.png2.94KB1.71KB▼ 41.84%
admin/includes/uploader/delete.png0.13KB0.13KB0.00%