2

I've a bug that I cannot reproduce on my local/staging evn and occurs only on prod(having the same code, db and files). Here is what I get when visiting all of the default post types/taxonomies or custom created by me or plugins(it's not bugged on settings pages for ex):

When visiting /wp-admin/edit.php?post_type=page the page loads as it should, immediately after it load the URL changes to

/wp-admin/edit.php?post_type=page%3Fpost_type%3Dpage

therefore any further action in this window will lead to Invalid post type. Updating the core and all of the plugins, or removing all of them didn't fixes the issue. Couldn't find anything related in the debug.log. Only when I disable my browser JS it's working fine, but I don't load any custom script to the wp admin.

I'll really appreciate if someone can give a hint, thanks in advance.

1

What you can do is copy live DB, and deploy it to dev. Once you do that, start to disabling plugins one by one to see which one causes an error. If it doesn't help - check where else you have code injections ( theme or drop-in or must use plugins). If it doesn't help you need to perform the same actions on live (which isn't better solution). I would suggest to open (with js disabled page "/wp-admin/edit.php?post_type=page" and see what js file and code included - from which plugins, this will be a massive hint where to search next.)

  • I tried the explain in my question that all of your suggestions were tested already and w/o success. One thing I found, tho. There used to be a bug in the previous WP versions in the generation of wp_admin_canonical_url, by the looks of it, it's still present in the latest version or at least in my case. – Kuliraj Apr 13 '18 at 8:11
0

Posting the solution I've found for my problem.

It appears that we have mod_security on our prod env, and recommended clause is to replace "server info" and on what the site is hosted on(for security reasons).

In my case it was replaced with IIS 6, and that tricked the WordPress installation as well, which on it's end is doing additional URL optimizations...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.