84% product-enquiry-for-woocommerce

Code Review | Product Enquiry for WooCommerce

WordPress plugin Product Enquiry for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: product-enquiry-f...
  • Plugin version: 3.1.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.0
  • WordPress version: 6.3.1
  • First release: Feb 13, 2013
  • Latest release: Jun 6, 2022
  • Number of updates: 104
  • Update frequency: every 32.7 days
  • Top authors: WisdmLabs (100%)

Code review

54 tests

User reviews

64 reviews

Install metrics

10,000+ active /239,499 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.00MB] [CPU: ▼5.03ms] Passed 4 tests

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.47 ▲0.0141.60 ▲0.99
Dashboard /wp-admin3.31 ▲0.0149.35 ▲2.63
Posts /wp-admin/edit.php3.36 ▲0.0044.97 ▼5.95
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.92 ▼13.12
Media Library /wp-admin/upload.php3.23 ▲0.0031.91 ▼2.05

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 120 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

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 /2,840 ▲10514.80 ▲0.511.95 ▲0.1638.60 ▼7.20
Dashboard /wp-admin2,221 ▲335.83 ▲0.92104.08 ▼7.6341.01 ▼5.67
Posts /wp-admin/edit.php2,104 ▲152.14 ▲0.1435.01 ▼6.1534.77 ▲0.02
Add New Post /wp-admin/post-new.php1,560 ▲4118.53 ▼4.73620.71 ▼6.9563.46 ▲7.96
Media Library /wp-admin/upload.php1,406 ▲184.25 ▲0.0397.81 ▲1.4041.36 ▲0.51

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

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 | 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× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Product_Enquiry_For_Woocommerce' not found in wp-content/plugins/product-enquiry-for-woocommerce/templates/pdf-options.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Product_Enquiry_For_Woocommerce' not found in wp-content/plugins/product-enquiry-for-woocommerce/templates/email-information.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/product-enquiry-for-woocommerce/templates/pro-banner.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Product_Enquiry_For_Woocommerce' not found in wp-content/plugins/product-enquiry-for-woocommerce/templates/terms-condition-options.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/product-enquiry-for-woocommerce/templates/premium.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Product_Enquiry_For_Woocommerce' not found in wp-content/plugins/product-enquiry-for-woocommerce/templates/enq-button-options.php:8
    • > PHP Warning
      Use of undefined constant WDM_PE_PLUGIN_URL - assumed 'WDM_PE_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/product-enquiry-for-woocommerce/templates/pro-banner.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Product_Enquiry_For_Woocommerce' not found in wp-content/plugins/product-enquiry-for-woocommerce/templates/form-options.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/product-enquiry-for-woocommerce/templates/newsletter-subscribe-form.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Product_Enquiry_For_Woocommerce' not found in wp-content/plugins/product-enquiry-for-woocommerce/templates/styling-options.php:8

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: request a quote woocommerce, woocommerce enquiry, product enquiry for woocommerce, woocommerce inquiry, product inquiry for woocommerce

product-enquiry-for-woocommerce/product-enquiry-for-woocommerce.php Passed 13 tests

Analyzing the main PHP file in "Product Enquiry for WooCommerce" version 3.1.6
109 characters long description:
Allows prospective customers or visitors to make enquiry about a product, right from within the product page.

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
There were no executable files found in this plugin6,120 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
CSS53581742,674
PHP341757571,728
SVG301716
PO File2232269588
JavaScript142936414

PHP code Passed 2 tests

This is a very shot review 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.28
Average class complexity7.60
▷ Minimum class complexity2.00
▷ Maximum class complexity37.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes16.67%
Methods67
▷ Static methods1725.37%
▷ Public methods6495.52%
▷ Protected methods00.00%
▷ Private methods34.48%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
47 compressed PNG files occupy 0.69MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/public/images/ui-bg_glass_55_444444_1x400.png0.12KB0.16KB0.00%
assets/admin/img/scroll-icon.png0.56KB0.58KB0.00%
assets/admin/img/services-icons/shopping.png5.02KB2.98KB▼ 40.70%
assets/public/images/ui-bg_glass_25_e1f0f5_1x400.png0.11KB0.11KB0.00%
assets/admin/img/wisdm-BFCM.png27.51KB28.55KB0.00%