sybrew / The-SEO-Framework-Extension-Manager

A WordPress plugin that manages extensions for The SEO Framework.
https://tsf.fyi/em
GNU General Public License v3.0
76 stars 9 forks source link

Import from Yoast not working #76

Open dciphered opened 1 year ago

dciphered commented 1 year ago

Describe the bug Firstly, all references to your Transport extension makes no reference to it being Beta however within the Extension manager dashboard itself the Transport extension is referred to as Transport (Beta).

Secondly, after installing the extension, in the available 3rd party plugin options within the importer drop down says 'Yoost SEO' instead of 'Yoast SEO'... typo I suspect.

Third, and most importantly, on each attempt to import from Yoast, it immediately fails with the following message: "Waiting for transport… ∶ An unknown error occured. Please refresh this page and try again."

I'm currently utilising Yoast SEO (free) plugin and would like to import SEO meta configurations into TSF however the above described issue keeps occurring.

The environment consists of: WP 6.2.2 PHP 8.1 Lightspeed web server

No other debug info apepars even with WP debug enabled.

Many thanks.

sybrew commented 1 year ago

Hello!

  1. It's well-tested, but I still want to alarm users into making backups because it irretrievably deletes data from the other plugin. I'll keep it in beta until I change this behavior.
  2. See #73.
  3. This must be a scripting error in the browser. Please see if another browser works. #626 and #627 might be related:
    • Summary: either the web server overrides the HTTP Accept header, or the browser doesn't support Event Streams at all.
    • The fallback for this has a bug, which is fixed in 4aa3b977b6ab8e9d6b3df4d326b4a1256421dcbd. This change will ship this week.
dciphered commented 1 year ago

Regarding your first comment. I think it's a terrible idea to be "irretrievably" deleting data from the original SEO plugin (Yoast in this case) during the import process. This should only read and copy meta and in the event things go wrong (like they have in my case) no data gets lost. I've noticed that even though the import process fails on multiple browsers, it's deleted the keyword metadata associated with each of my pages, previously configured via Yoast.

The Transport ext. is far too risky at this stage and should come with a proper descriptive warning before running the process. Backing up the DB is fine but an extreme measure to have to restore the DB from backup due to a plugin which should be doing nothing more than importing data from one table to another.

Point 3, multiple browsers tried (Firefox, Chrome, Safari) and all produce the same fail error. Ideally, would be good to have some detailed debug info within the log. I've looked at the browser dev console and can't see any script/execution errors.

I'll wait for the update to see if that helps fix this import issue.

sybrew commented 1 year ago

The Transport extension was built to translate data (update database rows) instead of writing new data (insert database rows). This initial decision caused the problem, but I stuck to it due to development fatigue. This will change in a future update but will require rewriting some of its foundations.

As for the error, your server is likely intercepting the HTTP Accept headers, which can cause many issues with unexpected or mixed content being sent and received. I cannot work around this, for I'd have to break the standard (slippery slope), but I can make the error more descriptive.

Since I wrote the extension, browser support for Event Streaming has greatly improved, and so I can drop the fallback to plain JSON. This means I no longer need to rely on the HTTP Accept header, and the error caused by intercepting it will disappear.

sybrew commented 1 year ago

In the next minor update (released today), I'll make it more clear that Transport will delete old data by writing the action directly into the button.

Before:

image

After:

image

I'll put back just "Import" once data clearing is optional.