10% wc-estimate-and-quote

Code Review | WooCommerce Estimate and Quote - Live Product Cost Estimation and Quotation system for WordPress

WordPress plugin WooCommerce Estimate and Quote - Live Product Cost Estimation and Quotation system for WordPress scored10%from 54 tests.

About plugin

  • Plugin page: wc-estimate-and-q...
  • Plugin version: 1.0.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 6.3.1
  • First release: Apr 14, 2020
  • Latest release: Feb 20, 2022
  • Number of updates: 13
  • Update frequency: every 64.5 days
  • Top authors: innovs (92.31%)cscode (15.38%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,182 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

Server metrics [RAM: ▲0.44MB] [CPU: ▼3.76ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Estimate and Quote - Live Product Cost Estimation and Quotation system for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4143.24 ▲4.01
Dashboard /wp-admin3.79 ▲0.4848.57 ▼0.92
Posts /wp-admin/edit.php3.84 ▲0.4852.43 ▲3.77
Add New Post /wp-admin/post-new.php6.33 ▲0.4484.50 ▼19.40
Media Library /wp-admin/upload.php3.65 ▲0.4239.53 ▲1.50
Quote /wp-admin/admin.php?page=Quote3.6337.94
Settings /wp-admin/admin.php?page=settings3.6331.47
Product Estimate /wp-admin/admin.php?page=product-innovs_wc_es3.6332.14

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 102 new files
Database: 4 new tables, 21 new options
New tables
wp_innovs_wc_es_products
wp_innovs_wc_es_quote
wp_innovs_wc_es
wp_innovs_product_quote_details
New WordPress options
primary_color
estimate_export_footer
create_estimate
hover_color
widget_theysaidso_widget
estimate_category2
estimate_category1
widget_recent-posts
estimate_limit
can_compress_scripts
...

Browser metrics Passed 4 tests

WooCommerce Estimate and Quote - Live Product Cost Estimation and Quotation system for WordPress: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,909 ▲14814.07 ▼0.4810.73 ▲8.9424.76 ▼12.57
Dashboard /wp-admin2,198 ▲245.21 ▼0.3295.27 ▲9.5941.86 ▼0.48
Posts /wp-admin/edit.php2,105 ▲82.58 ▲0.6144.38 ▲7.4240.04 ▲4.24
Add New Post /wp-admin/post-new.php1,544 ▲1823.80 ▲0.81679.45 ▲28.3638.99 ▼21.20
Media Library /wp-admin/upload.php1,406 ▲34.75 ▲0.5998.33 ▲6.0944.30 ▲1.74
Quote /wp-admin/admin.php?page=Quote1,1182.4842.6936.97
Settings /wp-admin/admin.php?page=settings1,4453.0756.4537.99
Product Estimate /wp-admin/admin.php?page=product-innovs_wc_es1,0032.5144.6731.47

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 4 tables
    • wp_innovs_wc_es_quote
    • wp_innovs_product_quote_details
    • wp_innovs_wc_es
    • wp_innovs_wc_es_products
  • Zombie WordPress options were found after uninstall: 21 options
    • seccondary_color
    • estimate_export_footer
    • widget_theysaidso_widget
    • primary_color
    • set_currency
    • estimate_menu
    • widget_recent-comments
    • delete_time
    • company_name
    • per_page
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wc-estimate-and-quote/admin/partials/plugin-name-admin-display.php
    • > /wp-content/plugins/wc-estimate-and-quote/includes/class-csv_export.php
  • 14× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/wc-estimate-and-quote/public/partials/estimate.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/wc-estimate-and-quote/public/partials/estimate_list.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wc-estimate-and-quote/public/partials/signup.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WC_es_Public' not found in wp-content/plugins/wc-estimate-and-quote/public/partials/part/estimate_cart.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/wc-estimate-and-quote/admin/partials/product_estimate.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/wc-estimate-and-quote/public/partials/estimate_edit.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-estimate-and-quote/includes/wp-ajax.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/wc-estimate-and-quote/public/partials/part/sidebar.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/wc-estimate-and-quote/admin/partials/settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-estimate-and-quote/public/partials/product-estimate-template.php:126

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=product-innovs_wc_es
    • > Javascript (severe) in unknown
    /wp-content/plugins/wc-estimate-and-quote/admin/js/pe-bootstrap.min.js?ver=1.0.2.4 7:361 Uncaught TypeError: Cannot read properties of undefined (reading 'defaults')
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=product-innovs_wc_es
    • > Network (severe)
    wp-content/plugins/wc-estimate-and-quote/admin/images/sort_both.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=Quote
    • > Network (severe)
    wp-content/plugins/wc-estimate-and-quote/admin/images/sort_asc.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=product-innovs_wc_es
    • > Network (severe)
    wp-content/plugins/wc-estimate-and-quote/admin/images/sort_desc.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed: You can look at the official readme.txt

wc-estimate-and-quote/wc-estimate-quote.php 92% from 13 tests

The entry point to "WooCommerce Estimate and Quote - Live Product Cost Estimation and Quotation system for WordPress" version 1.0.2.4 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wc-estimate-and-quote.php" instead of "wc-estimate-quote.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected10,708 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
SVG150176,648
PHP275537462,833
JavaScript6117166669
CSS56439558

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity6.10
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity1.73
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods70
▷ Static methods2130.00%
▷ Public methods5477.14%
▷ Protected methods00.00%
▷ Private methods1622.86%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/menu-icon.png1.07KB1.10KB0.00%