Crazy issue with CPT UI resetting wp_query loop
-
Just started today – when the plugin is activated, every single page on my site is replaced with the index – so its resetting the WP_QUERY at some high level to just show the basic index pages. Can’t see page single, single anything. when i deactivate plugin, all works fine. What is going on?
-
Hard to tell, because we don’t do anything that interacts with the WP_Query object.
Closest I can think of for this would be calls to flush_rewrite_rules() but that shouldn’t be occurring constantly by any means, only when necessary.
Its really strange – I even picked through your files and couldn’t find anything.
Another thing I tried was to deactivate CPTUI, export everything and then just use that code in functions.php. Same error. When that code is run, ALL queries get resent as if it were index.php (I even dump wp_query arg). If that code is not run, everything functions site, but my site is screwed because I have a million taxonomies and custom post types.
This just started happening 2 days ago. Do you have any idea what this may be, or any code that changed? This was on a dev site that was supposed to launch early next week!
I haven’t had any releases of the plugin for a few weeks now, and anything in that last release was very minor.
Have you set up any post types or taxonomies with our plugin yet? or are you not able to get that far?
Curious if you shared your import/export page settings for what you have, would cause the same issues for me.
If you have gotten far enough to create some post types, what post types did you create? Perhaps the naming of them are having adverse effects. I know there are some that you shouldn’t register custom because they’re already registered by core.
Here’s the details:
1. Installed CPT UI on a development site about one year ago.
2. Set up like 6 taxonomies and 5 CPTs
3. Have updated normally, flushed permalinks, updated all other plugins & WP core for the whole year.
4. As of one week ago, this issue started – nothing has changed in the setup or anything else.
5. When I tried to generate the code and include in functions.php, not only do I get the same problems but there are issues with generated export code, you are generating “name” as the slug (which looks weird in WP backend) but this is not an emergency as much as the other.Any suggestions?
Ahh, this isn’t a fresh install that you just did recently, it’s an update from pre-1.0.x.
Did it start happening right after you updated CPTUI from 0.8.x to 1.0.8?
Would you be willing to let me into the site to see firsthand the things going on? I may be able to determine something or at least get a more solid visualization going on.
Michael, thats right – we’ve been running whatever version for at least a year of development. I honestly don’t know what happened in that initial 0.8 > 1.0.8x.
Unfortunately I can’t let you see the site since it is of a highly-sensitive nature; I wish that I could. Is there any other way we can brainstorm what the problem is? Do I need to uninstall and reinstall everything?
Thanks again for your prompt attention!
The 1.0.x release was a rocky one earlier this year, and various solutions worked for various people, so I don’t have any specific answer that encompasses everything.
I can say that I didn’t overwrite the 0.8.x settings, so it is fully possible to revert back to it and you should be able to pick up where you left off. I can’t think of any “necessary” things in the 1.0.x line, as much of that was underlying code refactor and modernization.
Are you able to at least share the CPTUI settings or get code results? I may be able to determine something there. Both should be available via the tabs in the Import/Export area.
Sure – can I email you somewhere?
michael @ webdevstudios.com
Please reference this forum thread as well so I can keep things in context.
Not managing to recreate sitewide issues with permalinks. page.php is being used for pages, single.php is being used for single posts. Queries aren’t being thrown for a loop, pun intended.
I did notice you were using “year” for a taxonomy, which is actually a reserved name https://codex.ww.wp.xz.cn/Function_Reference/register_taxonomy#Reserved_Terms. Doubtful it’s detrimental to everything, unless you keep the year in the permalinks constantly. Would just trigger a WordPress 404.
Thank you for pointing out the issue with the export for taxonomies. I created a new github issue for it.
Really not quite sure what’s going on at this point, sadly.
OK, thanks for looking into it. You have no idea what it could be?
Michael, I have been doing more searching and judging from this stackexchange thread, it seems like the year taxonomy actually was the issue!
I think a welcome addition to your plugin would be around the slug, twofold:
1. Give JS feedback when entering a slug about reserved names; eg don’t allow them…
2. Allow us to see (like your pre 1.0 version) what slugs are already in use on the system, since your new UI doesn’t allow us to see; we have to keep selecting taxonomies/cpts and seeing what slug we used for them.
I have both ideas at least partially implemented.
I know I have a list of reserved post type slugs, but it appears I don’t have a list of reserved taxonomy slugs. I also check the post types upon submit, but not pre-submit via javascript.
Probably a good idea to finish that off in a future version, though likely not version 1.1 which is pending done.
That said, thanks for sticking with it and good to hear that things appear to be better on your end now. Also thanks for the feedback and reminding me of what’s already been done and what still needs completion.
Thanks, this helped my issue. I had used a Year taxonomy and couldn’t figure out why most of my pages were showing the “Posts Page”. Took awhile to narrow it down just to CPT-UI, that was one of the last places I checked of course.
Thanks!
The topic ‘Crazy issue with CPT UI resetting wp_query loop’ is closed to new replies.