83% quotes-for-woocommerce

Code Review | Quotes for WooCommerce

WordPress plugin Quotes for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: quotes-for-woocom...
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Aug 29, 2017
  • Latest release: Nov 29, 2023
  • Number of updates: 30
  • Update frequency: every 76.1 days
  • Top authors: pinal.shah (100%)

Code review

54 tests

User reviews

49 reviews

Install metrics

3,000+ active /51,364 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

An overview of server-side resources used by Quotes for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.01 ▼6.91
Dashboard /wp-admin3.31 ▲0.0050.66 ▼0.85
Posts /wp-admin/edit.php3.36 ▲0.0049.53 ▲2.16
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.07 ▼3.53
Media Library /wp-admin/upload.php3.23 ▲0.0032.64 ▼3.04

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Quotes for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.43 ▲0.031.86 ▼0.1238.18 ▼12.53
Dashboard /wp-admin2,195 ▲155.58 ▼0.0991.24 ▼6.0038.20 ▼4.07
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0135.54 ▼2.4831.83 ▼5.74
Add New Post /wp-admin/post-new.php1,526 ▼323.34 ▲0.21686.53 ▲73.9160.73 ▲0.27
Media Library /wp-admin/upload.php1,400 ▲64.25 ▲0.0597.36 ▼1.7341.83 ▲0.21

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please take a closer look at the following
  • 15× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Email' not found in wp-content/plugins/quotes-for-woocommerce/includes/emails/class-qwc-request-sent.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/quotes-for-woocommerce/includes/blocks/class-quotes-wc-blocks-integration.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\Payments\\Integrations\\AbstractPaymentMethodType' not found in wp-content/plugins/quotes-for-woocommerce/includes/blocks/class-quotes-payment-gateway-blocks.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_rtl() in wp-content/plugins/quotes-for-woocommerce/templates/emails/new-quote-request-sent-customer.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_rtl() in wp-content/plugins/quotes-for-woocommerce/templates/emails/plain/request-new-quote.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Email' not found in wp-content/plugins/quotes-for-woocommerce/includes/emails/class-qwc-send-quote.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_rtl() in wp-content/plugins/quotes-for-woocommerce/templates/emails/request-new-quote.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_rtl() in wp-content/plugins/quotes-for-woocommerce/templates/emails/plain/new-quote-request-sent-customer.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/quotes-for-woocommerce/class-quotes-wc.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/quotes-for-woocommerce/includes/admin/class-quotes-general-settings-page.php:21

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 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Plugin settings.), #2 (Product page.), #3 (WooCommerce Orders page.), #4 (Quote email.)
The official readme.txt is a good inspiration

quotes-for-woocommerce/quotes-woocommerce.php 77% from 13 tests

This is the main PHP file of "Quotes for WooCommerce" version 2.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 254 characters long)
  • 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 ("quotes-for-woocommerce.php" instead of "quotes-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected3,067 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP215198641,946
PO File4313561956
JavaScript4156087
CSS221443
JSON11028
XML1207

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity18.18
▷ Minimum class complexity4.00
▷ Maximum class complexity112.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes19.09%
Methods96
▷ Static methods77.29%
▷ Public methods96100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions861.54%
▷ Anonymous functions538.46%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot_2.png14.81KB5.93KB▼ 59.95%
screenshot_1.png18.56KB8.78KB▼ 52.71%
screenshot_3.png16.46KB6.89KB▼ 58.12%
screenshot_4.png24.40KB9.91KB▼ 59.39%