PHP Warning After Latest Update
-
I’m receiving the following warning in my error logs after the latest update. Any idea how to resolve this?
PHP Warning: Invalid argument supplied for foreach() in /home/customer/www/….com/public_html/wp-content/plugins/google-listings-and-ads/src/MerchantCenter/MerchantStatuses.php on line 386
-
Hello @chargeup,
I’m not seeing any other reports of this error.
Could you please share a copy of your site’s System Status?
You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”.? Once you’ve done that, paste it here in your response or in a Gist.
Look forward to hearing back from you.Thanks for such a quick response. Here is the system report:
### WordPress Environment ###
WordPress address (URL): https://www…..com
Site address (URL): https://www…..com
WC Version: 7.4.1
REST API Version:7.4.1
WC Blocks Version:9.4.4
Action Scheduler Version:3.5.4
Log Directory Writable:WP Version: 6.1.1
WP Multisite: –
WP Memory Limit: 768 MB
WP Debug Mode: –
WP Cron: –
Language: en_US
External object cache: –### Server Environment ###
Server Info: Apache
PHP Version: 7.4.33
PHP Post Max Size: 256 MB
PHP Time Limit: 120
PHP Max Input Vars: 3000
cURL Version: 7.85.0
OpenSSL/3.0.8SUHOSIN Installed: –
MySQL Version: 5.7.39-42-log
Max Upload Size: 256 MB
Default Timezone is UTC:fsockopen/cURL:
SoapClient:
DOMDocument:
GZip:
Multibyte String:
Remote Post:
Remote Get:
### Database ###
WC Database Version: 7.4.1
WC Database Prefix: wfu_
Total Database Size: 13.14MB
Database Data Size: 9.55MB
Database Index Size: 3.59MB
wfu_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wfu_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wfu_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wfu_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wfu_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_actionscheduler_actions: Data: 0.14MB + Index: 0.11MB + Engine InnoDB
wfu_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_actionscheduler_logs: Data: 0.09MB + Index: 0.03MB + Engine InnoDB
wfu_aws_cache: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wfu_aws_index: Data: 0.34MB + Index: 0.30MB + Engine InnoDB
wfu_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wfu_e_events: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_e_notes: Data: 0.02MB + Index: 0.17MB + Engine InnoDB
wfu_e_notes_users_relations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wfu_e_submissions: Data: 0.06MB + Index: 0.27MB + Engine InnoDB
wfu_e_submissions_actions_log: Data: 0.02MB + Index: 0.11MB + Engine InnoDB
wfu_e_submissions_values: Data: 0.09MB + Index: 0.03MB + Engine InnoDB
wfu_gf_draft_submissions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_gf_entry: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_gf_entry_meta: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wfu_gf_entry_notes: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_gf_form: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wfu_gf_form_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wfu_gf_form_revisions: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_gf_form_view: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_gf_rest_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_gla_attribute_mapping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wfu_gla_budget_recommendations: Data: 0.22MB + Index: 0.14MB + Engine InnoDB
wfu_gla_merchant_issues: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wfu_gla_shipping_rates: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wfu_gla_shipping_times: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_options: Data: 5.06MB + Index: 0.11MB + Engine InnoDB
wfu_postmeta: Data: 1.52MB + Index: 0.31MB + Engine InnoDB
wfu_posts: Data: 0.22MB + Index: 0.06MB + Engine InnoDB
wfu_sgs_log_events: Data: 0.05MB + Index: 0.00MB + Engine InnoDB
wfu_sgs_log_visitors: Data: 0.08MB + Index: 0.00MB + Engine InnoDB
wfu_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_tm_taskmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_tm_tasks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_usermeta: Data: 0.03MB + Index: 0.03MB + Engine InnoDB
wfu_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wfu_wc_admin_notes: Data: 0.08MB + Index: 0.00MB + Engine InnoDB
wfu_wc_admin_note_actions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB
wfu_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wfu_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
wfu_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wfu_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wfu_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wfu_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_woo_shippment_provider: Data: 0.09MB + Index: 0.00MB + Engine InnoDB
wfu_wpmailsmtp_debug_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wfu_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
wfu_wpr_rocket_cache: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wfu_wpr_rucss_used_css: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
wfu_yoast_indexable: Data: 0.08MB + Index: 0.09MB + Engine InnoDB
wfu_yoast_indexable_hierarchy: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
wfu_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
wfu_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
wfu_yoast_seo_links: Data: 0.05MB + Index: 0.03MB + Engine InnoDB### Post Type Counts ###
astra-advanced-hook: 1
attachment: 249
custom_css: 1
elementor_library: 2
nav_menu_item: 18
page: 10
post: 2
product: 29
revision: 32
shop_order: 8
wp_global_styles: 1### Security ###
Secure connection (HTTPS):
Hide errors from visitors:
### Active Plugins (20) ###
Advanced Woo Search: by ILLID – 2.74
Astra Pro: by Brainstorm Force – 4.0.1
Elementor Pro: by Elementor.com – 3.11.4
Elementor: by Elementor.com – 3.11.3
Google Listings and Ads: by WooCommerce – 2.4.0
WP Armour – Honeypot Anti Spam: by Dnesscarkey – 2.1.1
Jetpack: by Automattic – 11.9
Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.1.5
SiteGround Optimizer: by SiteGround – 7.3.1
SiteGround Security: by SiteGround – 1.4.1
Ultimate Addons for Elementor: by Brainstorm Force – 1.36.14
Advanced Shipment Tracking for WooCommerce: by zorem – 3.5.2
WooCommerce Conversion Tracking: by weDevs – 2.0.10
WooCommerce Stripe Gateway: by WooCommerce – 7.2.0
WooCommerce Shipping & Tax: by WooCommerce – 2.2.3
WooCommerce: by Automattic – 7.4.1
Yoast SEO: by Team Yoast – 20.2.1
WP Mail SMTP: by WPForms – 3.7.0
WP Rocket | Deactivate WooCommerce Refresh Cart Fragments Cache: by WP Rocket Support Team –
WP Rocket: by WP Media – 3.12.5.3### Inactive Plugins (1) ###
Gravity Forms: by Gravity Forms – 2.6.6
### Dropin Plugins (1) ###
advanced-cache.php: advanced-cache.php
### Settings ###
API Enabled:
Force SSL: –
Currency: USD ($)
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: –
Enforce Approved Product Download Directories: –
Order datastore: WC_Order_Data_Store_CPT### WC Pages ###
Shop base: #5 – /shop/
Cart: #6 – /cart/
Checkout: #7 – /checkout/
My account: #8 – /my-account/
Terms and conditions: #3 – /terms-of-use/### Theme ###
Name: Astra
Version: 1.0.0
Author URL: https://wpastra.com/about/
Child Theme:Parent Theme Name: Astra
Parent Theme Version: 4.0.2
Parent Theme Author URL: https://wpastra.com/about/?utm_source=theme_preview&utm_medium=author_link&utm_campaign=astra_theme
WooCommerce Support:### Templates ###
Overrides: –
### Admin ###
Enabled Features: activity-panels
analytics
coupons
customer-effort-score-tracks
import-products-task
experimental-fashion-sample-products
shipping-smart-defaults
shipping-setting-tour
homescreen
marketing
multichannel-marketing
mobile-app-banner
navigation
new-product-management-experience
onboarding
onboarding-tasks
remote-inbox-notifications
remote-free-extensions
payment-gateway-suggestions
shipping-label-banner
subscriptions
store-alerts
transient-notices
woo-mobile-welcome
wc-pay-promotion
wc-pay-welcome-pageDisabled Features: minified-js
product-variation-management
settingsDaily Cron:
Next scheduled: 2023-03-13 16:18:13 -04:00
Options:Notes: 104
Onboarding: completed### Status report information ###
Generated at: 2023-03-13 09:55:35 -04:00
`Hello,
Can you temporarily switch your site theme to Storefront, and then make sure to disable all plugins except WooCommerce and Google Listings & Ads? Check if the issue is still present at this point.
If the issue is not present, you can switch back the theme, and then the plugins one by one until you find the cause of the issue.
We recommend the Meks Quick Plugin Disabler, this plugin will remember what plugins you currently have active, so it’s easy to switch them back on.
Hope this helps.
Not sure if that is going to show anything if I switch themes and deactivate plugins. Code suggests it’s for looking for account issues. The warning is showing once a day at roughly the exact same time. This is happening on both sites I’m using the Google Listings and Ads plugin on.
I think it has something to do with refreshing account issues each day.
/**
* Retrieve all account-level issues and store them in the database.
*
* @throws Exception If the account state can't be retrieved from Google.
*/
protected function refresh_account_issues(): void {
/** @var Merchant $merchant */
$merchant = $this->container->get( Merchant::class );
$account_issues = [];
$created_at = $this->cache_created_time->format( 'Y-m-d H:i:s' );
foreach ( $merchant->get_accountstatus()->getAccountLevelIssues() as $issue ) {
$key = md5( $issue->getTitle() ); if ( isset( $account_issues[ $key ] ) ) {
$account_issues[ $key ]['applicable_countries'][] = $issue->getCountry();
} else {
$account_issues[ $key ] = [
'product_id' => 0,
'product' => __( 'All products', 'google-listings-and-ads' ),
'code' => $issue->getId(),
'issue' => $issue->getTitle(),
'action' => $issue->getDetail(),
'action_url' => $issue->getDocumentation(),
'created_at' => $created_at,
'type' => self::TYPE_ACCOUNT,
'severity' => $issue->getSeverity(),
'source' => 'mc',
'applicable_countries' => [ $issue->getCountry() ],
]; $account_issues[ $key ] = $this->maybe_override_issue_values( $account_issues[ $key ] );
}
}Hi @chargeup
I understand that you are hesitant to try @ihereira suggestion above but we would like to rule out if the error message above is being caused by your theme or a third-party plugin present on your site.
A conflict is an error or malfunction caused by two parts of code giving conflicting signals. For example, plugin A gives the signal to put the order in “Completed” status and plugin B prevents this from happening.
Themes and plugins provide additional functionality and features — it also means more code is running on your website and the risk of incompatibility is higher. We strive to ensure compatibility with our own extensions, but third-party products made for WooCommerce are not guaranteed to work with our software. In this documentation page, we will explain how to test for plugin and theme conflicts.
Hence, can you please try to switch to the default Storefront theme and only WooCommerce and Google Listings and Ads plugins are enabled and see if this works?
If so, then this kind of problem is usually caused by your theme or a third-party plugin present on your site. We can run a conflict test to verify this. I’d recommend cloning your site to a staging environment and performing the tests described on this guide without modifying your live site or impacting customers. Many hosts provide staging facilities, so it’s worth checking in with them. It’s also possible to do it using the free WP Staging plugin.
If this was caused by a third-party plugin present on your site, it would be best to reach out to the developers for further assistance here.
If this did not resolve the issue, please provide the fatal error logs (if any) under
WooCommerce > Status > Logs
.You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.
Let us know how it goes!
Thanks. I’ve setup everything on staging and have switched to Storefront and deactivated plugins. I’ll get back to you once I see the error.
Hi @chargeup
Sounds like a plan! Let us know how the testing goes!
Just want to let you know that the error continues with only the Storefront theme, WooCommerce, and Google Listings and Ads activated. Hope this helps.
Hi,
While I understand your point, please note it is a warning, which means it will not affect the site, it is not an error.
I’d recommend the following solutions to see if that makes a difference on your site, please check:
Let us know if you need further help.
Thanks for the help. I’m aware of how to turn off errors and I understand that the warning is nothing to worry about. However, it’s a bit aggravating to have an error log that constantly fills up if it doesn’t need to.
Might want to fix the code in a future update to help solve that warning.
Hi @chargeup ,
I hear you, and understand that this can be a frustrating experience.
Please could you clarify if this warning is being displayed anywhere on the front end of your site, or if this is only found in the error logs?
Also, can you try deactivating Google Listings and Ads, and then reactivating it to see if this clears up the warning message?
Let us know how this goes!
It’s not being displayed on the front end that I can see. It’s just filling up the error log.
It’s also not intermittent to just one site. The same warning is showing up every site using the plugin after the latest update.
Have you used it with a live Merchant Account to try and see the warning yourself? It happens at just about the exact same time every day which I’m assuming the plugin makes a scheduled call to Google Merchant to retrieve account data, issues, etc.
Hi,
I understand what you are saying.
Can you clear the site cache to see if that makes a difference? If not, please navigate to?
WooCommerce > Status > Scheduled Actions
?and see if there are any pending actions, and run them manually, allow some time after that to see if that helps to resolve the issue.Let us know how that goes.
It’s not caching. I cleared caching and also have it to automatically clear cache every 10 hours. I’ve also deactivated all unnecessary plugins and switched themes.
Scheduled actions are running just fine.
I’ve done all the basic debugging. Might just be something in your code you should look into. Thanks and good luck.
Hello @chargeup,
Seems like we’ll need to take a closer look. Could you please open a ticket about this from WooCommerce.com > MY profile > Support?Make sure to include a link to this thread so we know what has been done already.
Cheers!
- The topic ‘PHP Warning After Latest Update’ is closed to new replies.