Attribute term count displays wrong numbers
-
Hello,
I have lately migrated some products from my previous woocommerce installation to my new one and I had encountered a strange behavior. After I changed some attribute terms in 2 products and then when to see how many products have this specific attribute, I saw wrong numbers on the admin page. For example, the displayed number was 2.634 but when I click to see the products, the number is 2867 in total.
Things that I did so far:
Under the tab status -> tools -> I have run the term recount and the lookup, table regeneration. Nothing changed.I have disabled other plugins and left only woo-commerce. Also changed the theme to a default one. After that, I tried again the previous step I mentioned.
Still, the problem remained.Do you know what else I can do to fix this? Or how i can run a term recount?
Best Regards
-
Hi there!
Thanks for reaching out and specifying what you have tried already, this helps a lot. One thing that comes to mind and might be happening is that there might be another plugin on the site that could possibly interfere with the work of WooCommerce.
In that case, we can run the conflict test. I’d recommend cloning your site to a staging environment and performing the tests described below 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.
On that site, deactivate all plugins on your site except WooCommerce and switch to a default theme like Storefront or Twenty Twenty. Then, use the Recount Terms and Regenerate product lookup tables tools to regenerate everything (That last one does take some time to regenerate everything. You can check the status of the process from your Scheduled Actions tab. You can access it through WooCommerce > Status > Scheduled Actions > Pending and search for wc_update_product_lookup_tables).
If that sets the right counts, you can enable your theme and plugins one at a time, checking to make sure the counts stay correct as you go. If everything goes back to 0 again, then that plugin is causing the issue.
Would you be able to try these steps and let us know the outcome? Thanks!
Hello @katinthehatsite
I have disabled other plugins and left only woo-commerce. Also changed the theme to a default one. After that, I tried again the previous step I mentioned.
Still, the problem remained.I think that covers the conflict test that you mentioned.
Also on the WooCommerce > Status > Scheduled Actions > Pending tab there is no cron job that is pending. Only woocommerce_cleanup_draft_orders that is always pending and even if I am canceling it or run it, it still stays as Pending.
That’s the outcome.
Best Regards
Here is also proof that the above actions were taken on a staging enviroment:
### WordPress Environment ### WordPress address (URL): https://test.ypografi.com Site address (URL): https://test.ypografi.com WC Version: 7.1.0 REST API Version: ? 7.1.0 WC Blocks Version: ? 8.7.5 Action Scheduler Version: ? 3.4.0 Log Directory Writable: ? WP Version: ? 6.0.3 - Μια νε?τερη ?κδοση του WordPress ε?ναι διαθ?σιμη (6.1) WP Multisite: – WP Memory Limit: 4 GB WP Debug Mode: – WP Cron: ? Language: el External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 7.4.33 PHP Post Max Size: 128 MB PHP Time Limit: 300 PHP Max Input Vars: 5120 cURL Version: 7.29.0 NSS/3.53.1 SUHOSIN Installed: – MySQL Version: 5.5.5-10.3.36-MariaDB-cll-lve Max Upload Size: 128 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 7.1.0 WC Database Prefix: nd9N3_ypog Συνολικ? μ?γεθο? β?ση? δεδομ?νων: 168.66MB Μ?γεθο? β?ση? δεδομ?νων: 110.84MB Μ?γεθο? ευρετηρ?ου β?ση? δεδομ?νων: 57.82MB nd9N3_ypogwoocommerce_sessions: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_api_keys: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.03MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_attribute_taxonomies: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_downloadable_product_permissions: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.06MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_order_items: Δεδομ?να: 0.28MB + Ευρετ?ρια: 0.09MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_order_itemmeta: Δεδομ?να: 1.52MB + Ευρετ?ρια: 1.97MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_tax_rates: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.06MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_tax_rate_locations: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.03MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_shipping_zones: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_shipping_zone_locations: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.03MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_shipping_zone_methods: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_payment_tokens: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_payment_tokenmeta: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.03MB + Μηχαν? InnoDB. nd9N3_ypogwoocommerce_log: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogactionscheduler_actions: Δεδομ?να: 1.52MB + Ευρετ?ρια: 0.63MB + Μηχαν? InnoDB. nd9N3_ypogactionscheduler_claims: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogactionscheduler_groups: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogactionscheduler_logs: Δεδομ?να: 1.52MB + Ευρετ?ρια: 0.39MB + Μηχαν? InnoDB. nd9N3_ypogbarcode_scanner_locations: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogbarcode_scanner_logs: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogbarcode_scanner_posts: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogbarcode_scanner_posts_columns: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogbarcode_scanner_settings: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogcommentmeta: Δεδομ?να: 0.13MB + Ευρετ?ρια: 0.16MB + Μηχαν? InnoDB. nd9N3_ypogcomments: Δεδομ?να: 0.52MB + Ευρετ?ρια: 0.38MB + Μηχαν? InnoDB. nd9N3_ypoge_events: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypoglinks: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypognextcart_seo_url: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogoptions: Δεδομ?να: 4.41MB + Ευρετ?ρια: 0.14MB + Μηχαν? InnoDB. nd9N3_ypogpostmeta: Δεδομ?να: 41.58MB + Ευρετ?ρια: 42.14MB + Μηχαν? InnoDB. nd9N3_ypogposts: Δεδομ?να: 50.52MB + Ευρετ?ρια: 5.06MB + Μηχαν? InnoDB. nd9N3_ypogrevslider_css: Δεδομ?να: 0.13MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogrevslider_css_bkp: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogrevslider_layer_animations: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogrevslider_layer_animations_bkp: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogrevslider_navigations: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogrevslider_navigations_bkp: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogrevslider_sliders: Δεδομ?να: 0.05MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogrevslider_sliders_bkp: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogrevslider_slides: Δεδομ?να: 0.22MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogrevslider_slides_bkp: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogrevslider_static_slides: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogrevslider_static_slides_bkp: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogtermmeta: Δεδομ?να: 0.14MB + Ευρετ?ρια: 0.14MB + Μηχαν? InnoDB. nd9N3_ypogterms: Δεδομ?να: 0.09MB + Ευρετ?ρια: 0.09MB + Μηχαν? InnoDB. nd9N3_ypogterm_relationships: Δεδομ?να: 2.52MB + Ευρετ?ρια: 1.52MB + Μηχαν? InnoDB. nd9N3_ypogterm_taxonomy: Δεδομ?να: 0.09MB + Ευρετ?ρια: 0.11MB + Μηχαν? InnoDB. nd9N3_ypogusermeta: Δεδομ?να: 0.22MB + Ευρετ?ρια: 0.23MB + Μηχαν? InnoDB. nd9N3_ypogusers: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.05MB + Μηχαν? InnoDB. nd9N3_ypogwc_admin_notes: Δεδομ?να: 0.06MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogwc_admin_note_actions: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogwc_category_lookup: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogwc_customer_lookup: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.03MB + Μηχαν? InnoDB. nd9N3_ypogwc_download_log: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.03MB + Μηχαν? InnoDB. nd9N3_ypogwc_order_coupon_lookup: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.03MB + Μηχαν? InnoDB. nd9N3_ypogwc_order_product_lookup: Δεδομ?να: 0.25MB + Ευρετ?ρια: 0.27MB + Μηχαν? InnoDB. nd9N3_ypogwc_order_stats: Δεδομ?να: 0.13MB + Ευρετ?ρια: 0.14MB + Μηχαν? InnoDB. nd9N3_ypogwc_order_tax_lookup: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.03MB + Μηχαν? InnoDB. nd9N3_ypogwc_product_attributes_lookup: Δεδομ?να: 2.52MB + Ευρετ?ρια: 2.52MB + Μηχαν? InnoDB. nd9N3_ypogwc_product_download_directories: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogwc_product_meta_lookup: Δεδομ?να: 1.52MB + Ευρετ?ρια: 0.97MB + Μηχαν? InnoDB. nd9N3_ypogwc_rate_limits: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogwc_reserved_stock: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogwc_tax_rate_classes: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogwc_webhooks: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. nd9N3_ypogwoodmart_wishlists: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.00MB + Μηχαν? InnoDB. nd9N3_ypogwoodmart_wishlist_products: Δεδομ?να: 0.02MB + Ευρετ?ρια: 0.02MB + Μηχαν? InnoDB. ### Post Type Counts ### attachment: 14186 cms_block: 38 custom_css: 1 customize_changeset: 118 elementor_library: 1 mc4wp-form: 1 nav_menu_item: 211 page: 23 portfolio: 9 post: 13 product: 5355 product_variation: 435 revision: 1062 shop_order: 889 woodmart_layout: 5 woodmart_sidebar: 1 woodmart_size_guide: 1 woodmart_slide: 3 wp_global_styles: 1 wpcf7_contact_form: 2 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (1) ### WooCommerce: απ? τον/την Automattic – 7.1.0 ### Inactive Plugins (13) ### AutoConvert Greeklish Permalinks: απ? τον/την Dimitris Mavroudis – 4.1.1 Barcode Scanner with Inventory & Order Manager - (business): απ? τον/την UkrSolution – 1.2.2 Classic Widgets: απ? τον/την WordPress Contributors – 0.3 Contact Form 7: απ? τον/την Takayuki Miyoshi – 5.6.4 Duplicate Page: απ? τον/την mndpsingh287 – 4.4.9 Flexible Shipping: απ? τον/την Octolize – 4.16.1 Loco Translate: απ? τον/την Tim Whitlock – 2.6.3 MC4WP: Mailchimp for WordPress: απ? τον/την ibericode – 4.8.11 Pay in Store WooCommerce Payment Gateway: απ? τον/την Papaki – 1.2.6 Safe SVG: απ? τον/την 10up – 2.0.3 Slider Revolution: απ? τον/την ThemePunch – 6.6.5 Woodmart Core: απ? τον/την – 1.0.35 WPBakery Page Builder: απ? τον/την Michael M - WPBakery.com – 6.10.0 ### Dropin Plugins (1) ### maintenance.php: maintenance.php ### Settings ### API Enabled: – Force SSL: – Currency: EUR (€) Currency Position: right_space 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: ? ### WC Pages ### Β?ση καταστ?ματο?: #8 - /shop/ Καλ?θι: #9 - /cart/ Ταμε?ο: #10 - /checkout/ Ο λογαριασμ?? μου: #11 - /my-account/ ?ροι και Προ?ποθ?σει?: #8055 - /oroi-proypotheseis/ ### Theme ### Name: Storefront Version: 4.1.3 Author URL: https://woocommerce.com/ Child Theme: ? – Αν κ?νετε μετατροπ? του WooCommerce π?νω σε ?να γονικ? θ?μα που δεν δημιουργ?σατε εσε?? προσωπικ? τ?τε σα? προτε?νουμε να χρησιμοποι?σετε ?να θ?μα απ?γονο. Δε?τε: Πω? να δημιουργ?σετε ?να θ?μα απ?γονο WooCommerce Support: ? ### Templates ### Overrides: – ### Admin ### Enabled Features: activity-panels analytics coupons customer-effort-score-tracks experimental-products-task experimental-import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing multichannel-marketing mobile-app-banner navigation 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-page Disabled Features: minified-js new-product-management-experience settings Daily Cron: ? Next scheduled: 2022-11-15 06:39:26 +02:00 Options: ? Notes: 71 Onboarding: completed ### Action Scheduler ### Ολοκληρωμ?νη: 2.033 Oldest: 2022-10-15 22:28:10 +0300 Newest: 2022-11-14 11:52:11 +0200 Σε αναμον?: 1 Oldest: 2022-11-15 11:32:47 +0200 Newest: 2022-11-15 11:32:47 +0200 ### Status report information ### Generated at: 2022-11-14 12:48:39 +02:00
As I mentioned above, the problem still exists
Best Regards
-
This reply was modified 2 years, 3 months ago by
Efs. Reason: Added details and fix some typing errors
Hello @stevendigital,
Thank you for sharing the report.
I didn’t find anything that stands out, this could be a cache problem. Please navigate to
WooCommerce > Status > Tools
and run these two options on the test environment.
Link to image: https://i.imgur.com/wqzb11v.pngIf that didn’t take care of it, please attach some screenshots to help us understand the problem better. You can use a service like Snipbaord.
Let us know how it goes.
Hello @babylon1999,
I did the transient clean-up. To be more specific, every tool under the Tools tab is useless at the moment.
To better understand the problem, here is the screenshot from the attribute page inside the admin: https://snipboard.io/WbY0Hx.jpg. You can see that this is 2.540.
Here is a screenshot from the products, after I clicked on the number: https://snipboard.io/JZs8ck.jpg
As you can see it is 2861 products.
Let me know if you need anything else.
Best Regards
Hi there @stevendigital ??
To better understand the problem, here is the screenshot from the attribute page inside the admin: https://snipboard.io/WbY0Hx.jpg. You can see that this is 2.540.
Here is a screenshot from the products, after I clicked on the number: https://snipboard.io/JZs8ck.jpg
As you can see it is 2861 products.
Let me know if you need anything else.
Thanks for reaching back, clarifying things further. From what I gather, numbers are not lining-up, in general. While inspecting the SSR, it seems that the following count is off:
product: 5355
; based on this screenshot.Could you go ahead and export all products from the current test/staging installation and import them in a new, fresh, test installation, please? While having only the WooCommerce plugin and Storefront theme active. Do the numbers align in that migration?
Let us know how that goes.
Hello,
Before doing that, is there any way to recalculate them and not use the tools that woocommerce uses? Or is it possible to restart the scheduler of cron-jobs, somehow?
I don’t know why this is happening. And to do that debugging (import-export 5.355 products) I will stress the server. Import could be done on a local installation but the export should happen from the live server.So I am guessing that this probably happens, because something is stuck, and the counting is not happening correctly.
Best Regards
Hello @stevendigital,
Before doing that, is there any way to recalculate them and not use the tools that woocommerce uses? Or is it possible to restart the scheduler of cron-jobs, somehow?
I’m not aware of a cron job that updates product/post count, there’s
wp_update_user_counts
but it’s for counting customers. You can install WP-crontorl and check yourself. ??I don’t know why this is happening. And to do that debugging (import-export 5.355 products) I will stress the server. Import could be done on a local installation but the export should happen from the live server.
I don’t think the export will stress the server to the point it will crash, but you can try exporting only the necessary things like product name, attribute, price etc.
Let us know how things go.
We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.
Hello @gabrielfuentes
It took me some time, as I was conducting some tests and moving products from one site to another.
The problem persists still. I don’t know if there was any plugin that changed something on the database and now the problem just moves on. Currently, I do not know what else to do or how to resolve this.
Feel free to inform me how this can be done.
I am still conducting some tests but to no avail.Best Regards
Hi there @stevendigital,
Thank you for reaching back, with further information on this.
The problem persists still. I don’t know if there was any plugin that changed something on the database and now the problem just moves on. Currently, I do not know what else to do or how to resolve this.
Feel free to inform me how this can be done.
I am still conducting some tests but to no avail.To summarize:
1. You were able to export the products from the production site, to a staging/testing site.
2. Went ahead with a full conflict test, as detailed here.
3. Cleared both WooCommerce & Expired Transients; options found underWooCommerce > Status > Tools
, as described here.
4. Server-side, browser & CDN caching were cleared and disabled while testing.Could you clarify all the measures mentioned above were followed, please?
Furthermore, could you please share a copy of your test site’s System Status? You can find it via
WooCommerce > Status
. SelectGet system report
and then click theCopy for support
button.?You can either paste it in your response here, or use https://pastebin.com/ for pasting it there and sharing it with us (as it provides additional paste settings).Also, could you please navigate to
WooCommerce > Status > Logs
and from the dropdown on the right side, please see if there are any logs starting with the words fatal-error.If so, please select
View
and copy and paste them into your reply here.Looking forward to hearing from you!
-
This reply was modified 2 years, 3 months ago by
- The topic ‘Attribute term count displays wrong numbers’ is closed to new replies.