woocommerce / woocommerce-square

Square POS and Payments Integration
https://woo.com/products/square
Other
10 stars 4 forks source link

PHP curl api is failing with an error, and the WooCommerce Square plugin simply suppresses the error and returns an empty array #5

Open billrobbins opened 4 years ago

billrobbins commented 4 years ago

This is feedback from a customer regarding the handling of errors.


the PHP curl api is failing with an error, and the WooCommerce Square plugin simply supresses the error and returns an empty array. This makes debugging really hard!

The problem was that SElinux had been enabled on the server, and the HTTP process did not have permissions to access the network in that way; even though the curl from the command line would work, the PHP curl() method would fail.

To check that this is the cause, run:

getsebool httpd_can_network_connect

httpd_can_network_connect --> off

To fix it, run:

setsebool -P httpd_can_network_connect on

It would be really helpful if you could fix the plugin so that it does not supress the error messages.


3348631-zen

System status ``` ### WordPress Environment ### WordPress address (URL): https://www.southgundenhamfarm.co.uk Site address (URL): https://www.southgundenhamfarm.co.uk WC Version: 4.5.2 REST API Version: ✔ 4.5.2 WC Blocks Version: ✔ 3.1.0 Action Scheduler Version: ✔ 3.1.6 WC Admin Version: ✔ 1.5.0 Log Directory Writable: ✔ WP Version: 5.4.2 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ✔ Language: en_US External object cache: – ### Server Environment ### Server Info: Apache/2.4.37 (centos) PHP Version: 7.2.24 PHP Post Max Size: 50 MB PHP Time Limit: 300 PHP Max Input Vars: 1000 cURL Version: 7.61.1 OpenSSL/1.1.1c SUHOSIN Installed: – MySQL Version: 5.5.5-10.3.17-MariaDB Max Upload Size: 50 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ❌ Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected. DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ❌ wp_remote_post() failed. Contact your hosting provider. Remote Get: ❌ wp_remote_get() failed. Contact your hosting provider. ### Database ### WC Database Version: 4.5.2 WC Database Prefix: wp_ Total Database Size: 11.35MB Database Data Size: 8.43MB Database Index Size: 2.92MB wp_woocommerce_sessions: Data: 0.16MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 4.02MB + Index: 0.92MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 1.02MB + Index: 0.70MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_eum_logs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailchimp_carts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_mailchimp_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_options: Data: 2.06MB + Index: 0.06MB + Engine InnoDB wp_postmeta: Data: 0.19MB + Index: 0.06MB + Engine InnoDB wp_posts: Data: 0.16MB + Index: 0.06MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_square_customers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB ### Post Type Counts ### attachment: 40 nav_menu_item: 4 page: 8 post: 7 product: 10 revision: 56 shop_order: 5 shop_order_refund: 1 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (8) ### All In One SEO Pack: by All in One SEO Team – 3.6.2 Facebook for WooCommerce: by Facebook – 1.11.4 – Installed version not tested with active version of WooCommerce 4.5.2 Google Ads for WooCommerce: by Kliken – 1.0.4 – Installed version not tested with active version of WooCommerce 4.5.2 Mailchimp for WooCommerce: by Mailchimp – 2.4.1 – Installed version not tested with active version of WooCommerce 4.5.2 Easy Updates Manager: by Easy Updates Manager Team – 9.0.3 WooCommerce Services: by Automattic – 1.24.3 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Square: by WooCommerce – 2.2.2 WooCommerce: by Automattic – 4.5.2 ### Inactive Plugins (1) ### Akismet Anti-Spam: by Automattic – 4.1.6 ### Settings ### API Enabled: – Force SSL: – Currency: GBP (£) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: ✔ ### WC Pages ### Shop base: woocommerce/woocommerce-square-private#7 - /?page_id=7 Cart: woocommerce/woocommerce-square-private#8 - /?page_id=8 Checkout: woocommerce/woocommerce-square-private#9 - /?page_id=9 My account: woocommerce/woocommerce-square-private#10 - /?page_id=10 Terms and conditions: ❌ Page not set ### Theme ### Name: Dyad 2 Version: 2.0.9 Author URL: http://wordpress.com/themes Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ✔ ### Templates ### Overrides: – ### Square ### Environment: Production Tokenization Enabled: – Debug Mode: Off ### Action Scheduler ### Canceled: 1 Oldest: -0001-11-30 00:00:00 +0000 Newest: -0001-11-30 00:00:00 +0000 Complete: 4,258 Oldest: 2020-07-28 21:55:45 +0000 Newest: 2020-09-25 12:26:12 +0000 Pending: 5 Oldest: 2020-09-25 12:32:56 +0000 Newest: 2020-10-02 12:35:52 +0000 ```
AashikP commented 3 years ago

Another report in 3853936-zen