83% yith-woocommerce-request-a-quote

Code Review | YITH Request a Quote for WooCommerce

WordPress plugin YITH Request a Quote for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: yith-woocommerce-...
  • Plugin version: 2.27.0
  • PHP version: 7.4.16
  • WordPress compatibility: 8.1.0-6.4
  • WordPress version: 6.3.1
  • First release: Mar 12, 2015
  • Latest release: Nov 14, 2023
  • Number of updates: 200
  • Update frequency: every 15.9 days
  • Top authors: yithemes (100%)

Code review

54 tests

User reviews

56 reviews

Install metrics

20,000+ active /787,757 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
This plugin's installer ran successfully

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

Server-side resources used by YITH Request a Quote for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.02 ▼5.59
Dashboard /wp-admin3.31 ▼0.0346.36 ▼17.28
Posts /wp-admin/edit.php3.36 ▲0.0151.54 ▲8.03
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.89 ▼1.88
Media Library /wp-admin/upload.php3.23 ▲0.0133.76 ▼0.24

Server storage [IO: ▲5.72MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

Checking browser requirements for YITH Request a Quote for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲4914.65 ▲0.411.90 ▲0.3343.50 ▲0.52
Dashboard /wp-admin2,204 ▲265.62 ▼0.0996.93 ▼16.5544.18 ▼1.86
Posts /wp-admin/edit.php2,107 ▲42.03 ▲0.0033.53 ▼2.0233.19 ▲1.73
Add New Post /wp-admin/post-new.php1,532 ▼423.34 ▲0.01674.80 ▲34.3765.73 ▲18.23
Media Library /wp-admin/upload.php1,403 ▲34.19 ▲0.05100.29 ▲4.7342.97 ▲0.82

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • yit_recently_activated

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 fix the following items
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/yith-woocommerce-request-a-quote/templates/request-quote.php:15
    • > PHP Notice
      Undefined variable: product_id in wp-content/plugins/yith-woocommerce-request-a-quote/templates/add-to-quote.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/yith-woocommerce-request-a-quote/templates/add-to-quote.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/yith-woocommerce-request-a-quote/templates/request-quote-view.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/yith-woocommerce-request-a-quote/templates/add-to-quote-button.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/yith-woocommerce-request-a-quote/templates/emails/request-quote.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/yith-woocommerce-request-a-quote/templates/request-quote-form.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: There are too many tags (18 tag instead of maximum 10)
Please take inspiration from this readme.txt

yith-woocommerce-request-a-quote/yith-woocommerce-request-a-quote.php 85% from 13 tests

The main PHP script in "YITH Request a Quote for WooCommerce" version 2.27.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("6.2" instead of "8.1.0")
  • Description: Keep the plugin description shorter than 140 characters (currently 394 characters long)

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
Good job! No executable or dangerous file extensions detected44,427 lines of code in 270 files:
LanguageFilesBlank linesComment linesLines of code
PHP1823,0166,02916,648
JavaScript491,3438389,403
CSS191,6752589,219
PO File102,4743,8226,176
SVG8012,926
XML212955

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity42.94
▷ Minimum class complexity1.00
▷ Maximum class complexity336.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes32
▷ Abstract classes13.12%
▷ Concrete classes3196.88%
▷ Final classes00.00%
Methods434
▷ Static methods5211.98%
▷ Public methods36082.95%
▷ Protected methods5211.98%
▷ Private methods225.07%
Functions156
▷ Named functions14894.87%
▷ Anonymous functions85.13%
Constants19
▷ Global constants1894.74%
▷ Class constants15.26%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
30 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
plugin-fw/assets/css/jquery-ui/images/ui-icons_454545_256x240.png3.69KB4.18KB0.00%
plugin-fw/assets/images/no-sidebar.png0.92KB0.08KB▼ 90.72%
plugin-fw/assets/css/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png0.09KB0.16KB0.00%
plugin-fw/assets/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
plugin-fw/assets/css/jquery-ui/images/ui-icons_888888_256x240.png3.69KB4.18KB0.00%