Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Author selection XHR is slow/not working #855

Closed
Fabmilan opened this issue Jun 8, 2022 · 15 comments
Closed

Author selection XHR is slow/not working #855

Fabmilan opened this issue Jun 8, 2022 · 15 comments

Comments

@Fabmilan
Copy link

Fabmilan commented Jun 8, 2022

Hey there!

I don't know why, but your plugin has stop working. I can't change author (the field is disabled) and the autocomplete input field (Select An Author) not working anymore.

I have been using your plugin for 1 year and everything was working fine until then. Did you change something ?

Thx.

@Fabmilan
Copy link
Author

Fabmilan commented Jun 8, 2022

image

@rebeccahum
Copy link
Contributor

@Fabmilan Do you have more details? What Co-Authors Plus version are you currently using? Was this after the latest update? What WordPress version are you running?

@Fabmilan
Copy link
Author

Fabmilan commented Jun 9, 2022

Hey thx for the reply.
I'm using the latest version of Co-Authors Plus 3.5.2 / Wordpress 6.0

In fact, the plugin is working, it is just the xhr who is very very slow and that gives me the authors (or users account), not co-authors :/

I don't know what happens here ^^

@lschuyler
Copy link
Contributor

lschuyler commented Jun 13, 2022

Hi @Fabmilan,

I've been unable to replicate this. Are there any corresponding errors showing in your browser's JavaScript console that could lend any clues as to why you are experiencing that author field as disabled?

Also, are what version of PHP?

Thanks!

@Fabmilan
Copy link
Author

:/

I do not have any JS error, like i said, the xhr request is working properly but I just can list user (classics users) and not co-authors. When I enter the name of a co-author user, the request didn't show co-authors. If I enter the name of a "real" user, it shows.

Did you change something in the xhr request ? Why are the co-authors no longer displayed?

I'm using PHP Version 7.4.15

Thx

@Fabmilan
Copy link
Author

I'm not the only one with this issue see plugin reviews: https://fr.wordpress.org/plugins/co-authors-plus/#reviews

@Antonio-Laguna
Copy link

Antonio-Laguna commented Jun 20, 2022

I reckon this could be related to this #851

@lschuyler
Copy link
Contributor

@Fabmilan - We are still working to replicate your experience so we can fix this. Could you tell us a bit more about your Co-Authors Plus setup?

Thanks!

@Fabmilan
Copy link
Author

Fabmilan commented Jul 6, 2022

@Fabmilan - We are still working to replicate your experience so we can fix this. Could you tell us a bit more about your Co-Authors Plus setup?

Thanks!

Nothing you ask me is used. I talk about the back office not the front office.

This part of the plugin "Multiple authors can be added to a Post, Page, or Custom Post Type using an auto-complete interface." doesn't work anymore.

I installed the plugin, create guests authors and now, like before the update that broke the plugin, I want to add guests users to native Wordpress posts. So I use the co-authors block on the right side column and start to tapying the firsts letters of an guest user. As a result, the request (xhr) is very very long and doesn't show me guest author but editors users instead.

@GaryJones
Copy link
Contributor

@Fabmilan Can you please check if this is still the case with 3.5.11?

@Fabmilan
Copy link
Author

Hello @GaryJones,

I'm sorry, but it is not working.
I have a guest author called Sandra
I begin to type San or san even Sandra or sandra... but nothing shows up :(

@GaryJones
Copy link
Contributor

Screenshot 2023-07-27 at 09 21 06

You may have a plugin conflict, or the REST API responses may be blocked. I'm going to need more information.

  • Do you see any JavaScript errors in the browser developer console?
  • Can you recreate the issue on a non-production site, and deactivate the other plugins and use a core theme to check?
  • Can you please also confirm your PHP, WP, and plugin versions?
  • Can you see XHR requests being made (Network tab of the console) when you type each character? Do they have responses?
Screenshot 2023-07-27 at 09 24 57 Screenshot 2023-07-27 at 09 27 53

@GaryJones GaryJones changed the title Co Authors not working anymore Author selection XHR is slow/not working Jul 27, 2023
@Fabmilan
Copy link
Author

  • Do you see any JavaScript errors in the browser developer console?
    No

  • Can you recreate the issue on a non-production site, and deactivate the other plugins and use a core theme to check?
    I tested in a sandbox and it works... Good call.

  • Can you please also confirm your PHP, WP, and plugin versions?
    7.4 / 6.2.2 / 3.15.11

  • Can you see XHR requests being made (Network tab of the console) when you type each character? Do they have responses?
    I have the XHR request but response is empty :/
    This endpoint is called : https://www.1jour1actu.com/wp-json/coauthors/v1/search/?q=san&existing_authors=admin-milan&_locale=user
    And I have this response :
    {"code":"rest_forbidden","message":"D\u00e9sol\u00e9, vous n\u2019avez pas l\u2019autorisation de faire cela.","data":{"status":401}}

The role of the user calling this route is Administrator.

API REST works for this website : https://www.1jour1actu.com/wp-json/wp/v2/posts

I have no clue of what is going on :D

Thank you for your help

@Fabmilan
Copy link
Author

FYI, here is what I checked and not working:

  • Desactivate all plugin (except coauthor of course :) )
  • Delete all plugin
  • Delete my current theme (to not have specific functions.php)
  • Use twentythree theme

And with a fresh install (WP 6.2.2, basic + coauthors), it works.

I'm thinking, is something in the database (eg: wp-options) could go wrong with api-rest ?

thx again ;)

@GaryJones
Copy link
Contributor

The JSON response suggests it's an authorisation thing. The request headers should include a nonce. Maybe one of your other plugins is amending that nonce, or doing something that makes the login cookie invalid. At this point, you'll need to enable your plugins and theme one by one to narrow down further what the culprit is.

(If you try to hit the REST API endpoint in a browser directly, then it's expected to fail as that request won't include the nonce.)

From a CAP point-of-view, the plugin is working, so I'm going to close this issue out but feel free to add more information on what you find if you can pinpoint the source of the problem.

@GaryJones GaryJones closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants