@pepe the YOURLS API returns the link, whether it’s a new one or existing. the request from the plugin itself is the same. however, I am seeing that YOURS treats a URL with a trailing slash and without a trailing slash as separate links, so that would be why it’s returning a new one.
I am working on a bulk sync option now that should allow you to get the links imported into WP all at once, but there’s not a way to have YOURLS treat both links (with or without a slash) as the same.
Thread Starter
pepe
(@pputzer)
I’m using Yoast’s SEO plugin with the option to add a slash to all URLs checked. So yes, all my URLs do include the slash (also on the Edit Post script, the slug is shown with the slash at the end). I haven’t looked at your code, but could it be that you are explicitely stripping that trailing slash?
Thread Starter
pepe
(@pputzer)
OK, so you are stripping the slash because the second parameter to YOURLSCreator_Helper::prepare_api_link
is always left at the default, true
. I suggest that you either add an option or at least a filter for that. In addition, you could also check for the Yoast option directly – I think the plugin is widespread enough to justify such a “special case” handling.
I also use Yoast however i dont think this is my problem.
503 means out of action, however i can login into yourls admin just fine and generate links.
Will check my Yoast settings also
@pepe the previous versions (pre 2.0) did not consistently have the slash included, which is why I set it this way in 2.0.4. So prior to last night’s update, the links would have been sent with a slash. I can add a filter (which is what I’m doing now).
@rikk03 – please stop commenting on other threads that are unrelated to your problem.
@pepe I’ve added the filter and changed the default to be false on stripping the URL. I’ve also got the bulk import which should handle old items.
Thread Starter
pepe
(@pputzer)
Thank you. I’ve identified another problem regarding canonical URLs (SSL vs non-SSL), but I’ll post a separate issue for that.