83% gm-woocommerce-quote-popup

Code Review | Product Enquiry for WooCommerce

WordPress plugin Product Enquiry for WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: gm-woocommerce-qu...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Apr 27, 2019
  • Latest release: Sep 26, 2021
  • Number of updates: 34
  • Update frequency: every 26.0 days
  • Top authors: gravitymaster97 (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active / 6,992 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
Installer ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼140.66ms] Passed 4 tests

A check of server-side resources used by Product Enquiry for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.02 ▲0.3053.73 ▲27.75
Dashboard /wp-admin3.26 ▲0.2163.83 ▲2.09
Posts /wp-admin/edit.php3.37 ▲0.2759.17 ▲6.90
Add New Post /wp-admin/post-new.php5.62 ▲0.19100.66 ▼575.41
Media Library /wp-admin/upload.php3.20 ▲0.2042.93 ▲3.80

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 23 new files
Database: no new tables, 16 new options
New WordPress options
gmwqp_sp_bl
gmwqp_field_customizer_required
gmwqp_field_customizer_order
gmwqp_label_show
gmwqp_cart_display
gmwqp_display
gmwqp_cart_button_label
gmwqp_email_sucesemsg
gmwqp_field_customizer_field
gmwqp_field_customizer_type
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product Enquiry for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,823 ▲25115.91 ▲0.1412.26 ▼2.0652.05 ▼10.78
Dashboard /wp-admin3,020 ▲867.10 ▲1.11156.28 ▼3.54114.45 ▼2.31
Posts /wp-admin/edit.php2,795 ▲562.72 ▲0.0083.76 ▼8.27104.12 ▼1.44
Add New Post /wp-admin/post-new.php1,655 ▲4021.73 ▲0.28327.48 ▲13.50124.02 ▲15.37
Media Library /wp-admin/upload.php1,860 ▲535.54 ▲0.50162.67 ▼4.49126.40 ▲1.51

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 16 options in the database
    • gmwqp_email_sucesemsg
    • gmwqp_field_customizer_order
    • gmwqp_field_customizer_field
    • gmwqp_sp_bl
    • gmwqp_button_label
    • gmwqp_field_customizer_type
    • gmwqp_label_show
    • gmwqp_field_customizer_enble
    • gmwqp_customer_email_subject
    • gmwqp_usershow
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/gm-woocommerce-quote-popup/includes/GMWQP_list.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gm-woocommerce-quote-popup/includes/GMWQP_Exclude.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/gm-woocommerce-quote-popup/includes/GMWQP_list.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gm-woocommerce-quote-popup/includes/GMWQP_Enquiry_Button_Cart.php:2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/gm-woocommerce-quote-popup/includes/GMWQP_list.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gm-woocommerce-quote-popup/includes/GMWQP_Email_customizer.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'GMWQP_Shortcode' not found in wp-content/plugins/gm-woocommerce-quote-popup/includes/GMWQP_Frontend.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gm-woocommerce-quote-popup/includes/GMWQP_General.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gm-woocommerce-quote-popup/includes/GMWQP_Enquiry_Button.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gm-woocommerce-quote-popup/includes/GMWQP_Form_customizer.php:3

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 on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Contributors: Plugin contributors not specified
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5, #6, #7, #8, #9 in gm-woocommerce-quote-popup/assets to your readme.txt
The official readme.txt might help

gm-woocommerce-quote-popup/gm-woo-request-quote.php 85% from 13 tests

The primary PHP file in "Product Enquiry for WooCommerce" version 3.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gm-woocommerce-quote-popup.php" instead of "gm-woo-request-quote.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin4,865 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript45633872,649
PHP132561241,478
CSS311739738

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity19.83
▷ Minimum class complexity5.00
▷ Maximum class complexity28.00
Average method complexity3.69
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/select2/select2.png0.51KB0.99KB0.00%
assents/img/close_btn.png36.22KB17.59KB▼ 51.42%