Support » Plugin: Wicked Folders » Numbers of items in folders display always 0

  • Resolved Peter Baumgartner

    (@pbaumgartner)


    Except for the folders “Unassigned items” and “All folders,” the folders do not show how many items they have.

    I have tried with and without “Include items from child folder,” but there was no difference. All folders – except the two folders mentioned above – always display zero (0).

    I have deactivated all other plugins, but this has not helped.

    (I am working with WordPress 5.5.1)

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author wickedplugins

    (@wickedplugins)

    Hi @pbaumgartner,

    Sorry to hear you’re having trouble with this. What post type are you using the folders for? Does this happen with all post types or just certain ones? Did you happen to try temporarily changing the theme to a built-in WordPress one such as TwentyTwenty to see if that changes anything?

    Would it be possible for you to provide a screenshot?

    Oops, that was really fast! Thank you for answering so quickly.

    The problem happens with post and page types.
    And sorry! I didn’t mention that I am using the built-in WordPress theme TwentyTwenty.

    And here is a screenshot. https://imgur.com/a/jTZ1bgF

    Peter

    Plugin Author wickedplugins

    (@wickedplugins)

    Thanks for the screenshot @pbaumgartner.

    I’m having a hard time identifying a reasonable explanation for why the counts would be showing up as zero.

    Are you familiar with using phpMyAdmin at all? If so, I could send you the query we’re using to obtain the counts that you could try running in order to help narrow down where the problem is. Let me know if you’d like to try that.

    I am not familiar with using phpMyAdmin. I remember I had used it once many years ago. But I will try to run the query.

    I just have asked my provider for an account and access. So please stay tuned until I come back to you.

    Ok, I have now access phpMyAdmin.

    Could you tell me what I have to do?

    Plugin Author wickedplugins

    (@wickedplugins)

    Okay, great. Can you please log in to phpMyAdmin and do the following:

    1. Your database should be listed on in the left-hand navigation; click on it to select it
    2. Click on the “SQL” tab, paste in the following query, and click “Go” to run it:
      SELECT tr.term_taxonomy_id, COUNT(tr.object_id) AS n FROM wp_term_relationships AS tr INNER JOIN wp_term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id INNER JOIN wp_posts p ON tr.object_id = p.ID WHERE tt.taxonomy = 'wf_page_folders' AND p.post_status NOT IN ('trash') GROUP BY tr.term_taxonomy_id;
      Note that if your database tables use a prefix other than wp_, replace wp_ in the query above with whatever that prefix is
    3. Please take a screenshot of the results and send to me

    Thanks for your help in troubleshooting this. Let me know if you have any questions.

    Here is the screenshot

    The German text in the yellow line says: MySQL returned an empty result (e.g., null lines). (the query took 0.0002 seconds)

    Hope this helps

    • This reply was modified 2 months, 3 weeks ago by Peter Baumgartner. Reason: new link
    Plugin Author wickedplugins

    (@wickedplugins)

    Thanks Peter. That would certainly explain why the item counts aren’t displaying correctly as that query shouldn’t be empty if there are pages assigned to folders.

    Let’s try a few other things if you’re up for it.

    Can you please log into your WordPress admin and change the part of the URL after /wp-admin/ to edit-tags.php?taxonomy=wf_page_folders&post_type=page and take a screenshot of what you see?

    Next, can you please click on the link in the “Count” column for one of the folders that you know you’ve assigned a page to and take a screenshot of what appears?

    Next, go back to edit-tags.php?taxonomy=wf_page_folders&post_type=page and click “Edit” for the same folder and note the “tag_ID” parameter in the URL. Then, go back to phpMyAdmin, run the following query and take a screenshot (remember to replace the “xxx” below with the number you noted from the “tag_ID” parameter):

    SELECT * FROMwp_term_relationshipsWHERE term_taxonomy_id = xxx;

    Sorry for all the back-and-forth but, at the moment, it’s a complete mystery to me as to why the count query isn’t working for you and this is the only thing I can think of to try to narrow down the issue. Thanks for your help.

    Here are 4 screenshots.

    The screenshots are from my productive site. There are many other plugins active. So I am a little worried if there is some clash with other plugins. For instance with “Category Tag Pages”.

    I tried it at first another way: I cloned my site with wp-staging and deactivated all plugins. I did all your suggested steps but in the end, I could not open phpmyadmin with my cloned site.

    But hopefully, the 4 screenshots will help. If not: I could contact the people from wp-staging and ask how I could enter queries for the cloned site.

    In the meanwhile, I learned how to use my cloned site.

    Here are 4 screenshots with only the plugin Wicked Folders enabled.

    Plugin Author wickedplugins

    (@wickedplugins)

    Hi @pbaumgartner,

    Thanks for providing those screenshots. Can you please do me one more favor and provide the page ID of the first two or three pages in the folder? I want to cross-reference them with the object IDs in the screenshot from the database query to see if any match (which they should in theory).

    Also, by chance have you tried creating another folder and putting some items in it to see what happens? If not, can you try that? This is a really bizarre issue and I’m wondering if perhaps there’s something wonky going on with that specific folder.

    Hi @wickedplugins,

    I am referring to the second set of screenshots with only Wicked Folders as an active plugin:

    As there is no difference, I did screenshots this time with plugins enabled.
    https://imgur.com/a/3RFs4HN

    I am using the plugin Reveal IDs. Therefore you can see on the two screenshots the IDs of the pages on the right side of the screenshots.

    One screenshot is the same wicked folder as above (Plugins), the second one displays a new generated wicked folder (Audio) – with the same problem.

    • This reply was modified 2 months, 2 weeks ago by Peter Baumgartner. Reason: typo and link added
    Plugin Author wickedplugins

    (@wickedplugins)

    Okay, let’s try something different. Would it be possible for you to export your staging site’s database and send that to me? You can export the database either through phpMyAdmin or by using a plugin like WP Migrate DB. Please make sure you export the staging site database and not the production database.

    Once you have it exported, could you upload the zip to a file sharing service and send me the link? You can send me the link using our contact form so you don’t have to post it here.

    I’ve just sent you the link with a message in your contact form.

    Plugin Author wickedplugins

    (@wickedplugins)

    Thanks @pbaumgartner for sending that to me.

    I was able to figure out the issue. The query we were using to count the number of items in each folder was grouping on the term_taxonomy_id field instead of the term_id field. Most of the time these two fields are the same; however, they can diverge and term_id is actually the correct field to group by that we should have been using.

    We’ve updated the plugin to fix this issue and once you update to 2.17.4 it should work for you.

    Thank you so much for your patience, everything you did, and the time you invested to help us track down this bug. As a small thank you, I’m going to send you an email with a discount code to receive a free copy of the pro version of the plugin in case you’d like to use it.

    Thanks again!

Viewing 15 replies - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.