Counter not incrementing properly

Am doing some testing on my site…the plugin works great when I add a new site (the site counter increments by +1)…but I decided to delete that site to do further testing, and observed that the site counter did not …. de-increment? The counter still shows one blog in the category when there are now zero…didn’t know if maybe there was a magic trick I was missing and wanted to ask! :slight_smile:


  • Paul
    • The Green Incsub

    @christopher_d__hartpence, Hmm. Will look into this. Technically the site categories are a custom taxonomy like post categories and/or post tags. So the increment and decrement and managed by WordPress core. I have some other bug fixes in the morning to investigate and will add this top on my list.

    Thanks for bringing it to our attention. Should here back from me sometime tomorrow.

  • Paul
    • The Green Incsub


    Can definitely confirm this is a bug. The code is there but not being executed properly. Excellent catch. Going to take some time and rework the logic. I basically want to have this work like a Post does with categories. When you move a post to Trash for example the category and post tag counters are decremented. Then is the post is untrashed the counters are restored.

    Similar to how I see sites working. I should be able to deactivate a site and see the site categories counters decrement. Then if I reactivate the site the counters should increment.

    Should have a beta for you to test and verify later today. Unless the end of the world thing happens. Then we’ll have to reschedule.

  • Paul
    • The Green Incsub

    Ok, finally have this working the way I want. Here is the link for the beta.

    Couple of notes:

    1. To correct the now wrong number showing on the Site Categories Taxonomy listing just edit the category then save it. This will trigger the recalculation of the item count.

    2. On the Network > Sites listing I’ve added a new column for ‘Categories’. Will probably rename this fully to ‘Site Categories’.

    3. On the Network > Sites listing when you chose any of the functions Spam, Deactivate, Archive it leave the site categories in place for the blog. But decrements the counters for each associated term. Similarly, when you Activate, Not Spam, Unarchive the blog the counters are incremented.

    Also if you double set the status like setting a blog to Deactivate AND Spam. It does not double decrement. Same as Activating AND Un Spam. does not double increments.

    4. Also, fixed an issue on the landing page category site listing where is was showing Archived, Deactivated or Spam sites.

    Sorry this took all day. Had some other fires to work out. Let me know. No rush.

  • christopher_d__hartpence
    • Design Lord, Child of Thor

    Happy to report that we’re firing on all cylinders! Everything’s working exactly as you spelled out above (I even threw you a curve ball and tested against sites that have more than one category classification to make sure that both incremented/decremented correctly – smooth sailing!

    Thank you sir! :slight_smile:


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.