Codeinwp / tweet-old-post

Plugin to tweet about your old posts to get more hits for them and keep them alive.
GNU General Public License v2.0
13 stars 16 forks source link

Redirection error due to array value #916

Closed AndreeaCristinaRadacina closed 4 months ago

AndreeaCristinaRadacina commented 6 months ago

Description

Several users complained about the fact that they have not been redirected when trying to connect to Facebook since the latest update.

error encountered: Value is empty : pages in Array ( [id] => czoxNjoiMjI0NTI3NjA2MjMyOTk3MSI7 [pages] => Array ( ) )

ref: https://secure.helpscout.net/conversation/2512440165/404898?viewId=212385

Step-by-step reproduction instructions

  1. Go to the ROP dashboard
  2. Click to add a new Facebook account
  3. Make the configurations

Screenshots, screen recording, code snippet or Help Scout ticket

image image

I know the above error appears when you're not admin, as per - https://docs.revive.social/article/1374-facebook-error-value-is-empty-pages-in-array, but I am an admin, and I still get this error.

Environment info

No response

Is the issue you are reporting a regression

Yes, this is a regression.

AndreeaCristinaRadacina commented 6 months ago

+1 https://secure.helpscout.net/conversation/2501854913/403271?viewId=212385

AndreeaCristinaRadacina commented 6 months ago

+1 https://secure.helpscout.net/conversation/2512434982/404896?viewId=212385

AndreeaCristinaRadacina commented 6 months ago

+1 https://secure.helpscout.net/conversation/2511472493/404782?viewId=212385

AndreeaCristinaRadacina commented 6 months ago

+1 https://wordpress.org/support/topic/facebook-authorisation-not-redirecting/

poonam279 commented 6 months ago

+1 https://secure.helpscout.net/conversation/2502169911/403319/

AndreeaCristinaRadacina commented 6 months ago

+1 https://secure.helpscout.net/conversation/2513519348/405023?viewId=212385

Soare-Robert-Daniel commented 6 months ago

Regarding the functionality. The login and sharing posts with Facebook are working.

What needs to be fixed is the redirect after authorization.

After we authorize the user in the popup, we inform them that a redirect must be done, and if it is not done, we tell them to inform the support.


The problem is that controlling the popup with a different origin is unstable.

When trying to programmatically close the popup, a dom exception is raised. See https://developer.mozilla.org/en-US/docs/Web/API/Window/open#same-origin_policy

Screenshot 2024-02-19 at 14 42 22

Because of this error, the next step, which is the page reload, is not done. Thus, the user does not observe that the account might have already been added.


Changing the flow

Once the authorization is in the popup. We do two things:

@vytisbulkevicius

Soare-Robert-Daniel commented 6 months ago

+1 https://secure.helpscout.net/conversation/2501854913/403271?viewId=212385

Regarding Facebook SDK returned an error: Cross-site request forgery validation failed. Required param "state" missing from persistent data. I see that it happens when you try to add an account but do not finish (like closing the popup) and you try again without refreshing the page.

If you refresh the page, it will not give the error anymore.

AndreeaCristinaRadacina commented 6 months ago

+1 https://secure.helpscout.net/conversation/2511034371/404706?viewId=931544

poonam279 commented 6 months ago

+1 https://secure.helpscout.net/conversation/2515357973/405248?folderId=212385

AndreeaCristinaRadacina commented 6 months ago

+1 https://secure.helpscout.net/conversation/2513631661/405035?viewId=212385

AndreeaCristinaRadacina commented 6 months ago

+1 https://secure.helpscout.net/conversation/2515310322/405245?viewId=212385

Soare-Robert-Daniel commented 6 months ago

+1 https://secure.helpscout.net/conversation/2515357973/405248?folderId=212385

This is related to the refresh. https://github.com/Codeinwp/tweet-old-post/pull/918

https://secure.helpscout.net/conversation/2513631661/405035?viewId=212385 https://secure.helpscout.net/conversation/2515310322/405245?viewId=212385

Those two need to reintroduce their X, Twitter account since we changed the server, and they used our App to post.

For Facebook, I think it is the same. They need to reintroduce their account to allow for new permissions.

AndreeaCristinaRadacina commented 6 months ago

+1 https://secure.helpscout.net/conversation/2513577549/405031?viewId=931544

AndreeaCristinaRadacina commented 6 months ago

@Soare-Robert-Daniel another customer reported this issue - https://secure.helpscout.net/conversation/2512168501/404876?viewId=212385

He has multiple Facebook accounts and some of them cannot be connected. He gets an error similar to what is described in this issue. Can you kindly confirm if it's the same or if I should open another issue? file

AndreeaCristinaRadacina commented 5 months ago

+1 https://secure.helpscout.net/conversation/2530924960/407433?viewId=212385

AndreeaCristinaRadacina commented 4 months ago

Everything is fine now. The Business pages are also added.