dshanske / syndication-links

Add and Display Syndication Links in WordPress
https://wordpress.org/plugins/syndication-links/
GNU General Public License v2.0
30 stars 13 forks source link

Improved support for SNAP #39

Closed chrisaldrich closed 6 years ago

chrisaldrich commented 7 years ago

Many of the channels in SNAP are already supported, but most are currently missing. Support would include not only adding the SVG icons for them, but adding auto-import for displaying them in the list based on the storage location within SNAP.

SNAP currently supports the following: 500px App.net - perhaps leave this off as App.net is currently shutting down? Blogger DeviantART Diigo Delicious +Facebook Flickr Flipboard +Google+ (did the icon get fixed for plus.google.com? It doesn't currently display in the stable version) Instagram Instapaper LinkedIn LiveJournal MailChimp Medium Ok.ru Plurk Pinterest Reddit Scoop.it Sett StumbleUpon Telegram +Tumblr +Twitter vBulletin VK.com Weibo WordPress XING Yo YouTube

Those marked with a * currently have support for icon display Those marked with a + currently have support for import of the link

dshanske commented 7 years ago

Some of this will be addressed by my plan. I intend to remove dependency on the SNAP plugin in case switching from it is desired. But I also intend to change how the icons are generated.

dshanske commented 7 years ago

http://www.nextscripts.com/forums/topic/snap-plugin-custom-fields/ - I was looking at this and discovered a recent change to the plugin that stores the full URL instead of generating it dynamically. Asking for more info, but the developers seem to avoid questions about the data fields...my latest post using SNAP has it, but one two weeks ago doesn't.

What I may do is write a function to search post meta for snap?? keys, check for postURL as a key inside it, and then fall back on the older code if not found.

chrisaldrich commented 7 years ago

I'd noticed this a few days ago too as it seemed to have fixed an issue they'd had previously with the Facebook URL they displayed in the admin interface that didn't work, but was different from the URL that Syndication Links picked up. I mostly noticed because when using the SNAP buttons after initial publication they give modals showing success in posting which include the returned URLs, which for some silos can make it easier to cut and paste if necessary.

Your solution sounds like a sound one.

Your other thought recently about storing the URLs separately from SNAP's store is a good one as well because I've noticed (and generally not cared, though others surely may/will) that if one re-syndicates a post with SNAP, it overwrites the prior URL with the new one, which means that Syndication Links wouldn't have a "complete" list of all POSSE copies. This also means that Bridgy will only return replies on the most recent one for each silo this is done in. Anyone using SNAP's scheduling feature will be losing some of their backfeed as a result.

tamaracks commented 7 years ago

I have noticed that Syndication Links isn't getting the whole URL for the Facebook post in the Syndication Links box in the post edit screen. As an example, for one of my posts, the Syndication links box shows /posts/10102300817924336 but the snapFB custom field (as well as the SNAP box on the edit page) shows http://www.facebook.com/10102293194416906/posts/10102300817924336.

The link in the Syndication Links box is missing the part of the URL up to the user id.

dshanske commented 7 years ago

You would set that in the SNAP interface. But they recently changed storage format. I was going to try to support the new changes for new posts.

tamaracks commented 7 years ago

I don't see anything in the SNAP interface that would have an impact on the link to the resulting post on the social network.

interllectual commented 6 years ago

I am using SNAP to syndicate, but the links are not being populated into the Syndication Links field at all. Am I missing something, or is there a bug?

dshanske commented 6 years ago

Not that I am aware of. I use SNAP and this on my site.

dshanske commented 6 years ago

What is the site? Would like to troubleshoot.

interllectual commented 6 years ago

It is andreaarbogast.com. Just getting it set up, so it is very possible I have missed something. For one post that is showing the links, I entered the links manually. Appreciate your help!

interllectual commented 6 years ago

It just occurred to me that maybe this is happening because I am using filters to only syndicate specific posts?

dshanske commented 6 years ago

It is possible. I manually set the checkbox. But my plugin pulls it from where SNAP stores it.

chrisaldrich commented 6 years ago

@interllectual Which sites are you syndicating to? I know it's the case that not all sites that SNAP supports are supported by Syndication Links. Most of the major ones like Facebook, Twitter, and Tumblr are, but some of the lesser ones like Flipboard, 500px aren't.

interllectual commented 6 years ago

I am just syndicating to Twitter and Facebook. Still having this issue, although everything else is now working. I have been adding the syndication links urls by hand.

interllectual commented 6 years ago

The post meta for https://andreaarbogast.com/2017/12/01/16072/ is:

Key Value
_edit_last '1'
_edit_lock '1512172660:1'
snap_isAutoPosted '1512137745'
mf2_mp-syndicate-to 'a:1:{i:0;s:4:"none";}'
_snapPHST 'a:1:{s:2:"tw";a:1:{i:0;a:1:{i:0;a:4:{s:1:"l";s:52:"https://twitter.com/andrea/status/936599910715219969";s:2:"id";s:18:"936599910715219969";s:1:"d";s:19:"2017-12-01 14:16:34";s:1:"w";s:1:"s";}}}}'
_snap_forceSURL '2'
snap_MYURL ''
snapEdIT '1'
snapFB 's:197:"a:1:{i:0;a:8:{s:2:"do";s:1:"2";s:9:"msgFormat";s:10:"%FULLTEXT%";s:8:"postType";s:1:"I";s:9:"isAutoImg";s:1:"A";s:8:"imgToUse";s:0:"";s:9:"isAutoURL";s:1:"A";s:8:"urlToUse";s:0:"";s:4:"doFB";i:0;}}";'
snapTW 's:371:"a:1:{i:0;a:12:{s:2:"do";s:1:"2";s:9:"msgFormat";s:10:"%FULLTEXT%";s:8:"attchImg";s:1:"1";s:9:"isAutoImg";s:1:"A";s:8:"imgToUse";s:0:"";s:9:"isAutoURL";s:1:"A";s:8:"urlToUse";s:0:"";s:4:"doTW";i:0;s:8:"isPosted";s:1:"1";s:4:"pgID";s:18:"936599910715219969";s:7:"postURL";s:52:"https://twitter.com/andrea/status/936599910715219969";s:5:"pDate";s:19:"2017-12-01 14:16:34";}}";'
mf2_syndication 'a:1:{i:0;s:52:"https://twitter.com/andrea/status/936599910715219969";}'
interllectual commented 6 years ago

After disabling caching via cPanel, created a new post: https://andreaarbogast.com/2017/12/01/16080/

Key Value
_edit_last '1'
_edit_lock '1512173324:1'
snap_isAutoPosted '1512173319'
mf2_mp-syndicate-to 'a:1:{i:0;s:4:"none";}'
_snap_forceSURL '2'
snap_MYURL ''
snapEdIT '1'
snapFB 's:197:"a:1:{i:0;a:8:{s:2:"do";s:1:"2";s:9:"msgFormat";s:10:"%FULLTEXT%";s:8:"postType";s:1:"I";s:9:"isAutoImg";s:1:"A";s:8:"imgToUse";s:0:"";s:9:"isAutoURL";s:1:"A";s:8:"urlToUse";s:0:"";s:4:"doFB";i:0;}}";'
snapTW 's:197:"a:1:{i:0;a:8:{s:2:"do";s:1:"2";s:9:"msgFormat";s:10:"%FULLTEXT%";s:8:"attchImg";s:1:"1";s:9:"isAutoImg";s:1:"A";s:8:"imgToUse";s:0:"";s:9:"isAutoURL";s:1:"A";s:8:"urlToUse";s:0:"";s:4:"doTW";i:0;}}";'
interllectual commented 6 years ago

I don't this this is just a SNAP issue. If I use Bridgy Publish the same thing happens-- the publish goes through but the links are not autopopulated into the Syndication Links field.

dshanske commented 6 years ago

That is very strange.

dshanske commented 6 years ago

Is there a mf2_syndication property in Post Meta?

interllectual commented 6 years ago

It is not there when I first publish, but populates in the mf2_syndication property if I update. Same with SNAP. But updating doesn't cause the links to get added to Syn Links.

dshanske commented 6 years ago

I can't reproduce it so far.

interllectual commented 6 years ago

I just deactivated all plugins but the Indieweb ones, and created a new post, syndicating to FB and Twitter.

Upon submit:

Key Value
_edit_last '1'
snap_isAutoPosted '1512258891'
mf2_mp-syndicate-to 'a:1:{i:0;s:4:"none";}'
_bridgy_backlink 'true'
_snap_forceSURL '2'
snap_MYURL ''
snapEdIT '1'
snapFB 's:197:"a:1:{i:0;a:8:{s:2:"do";s:1:"2";s:9:"msgFormat";s:10:"%FULLTEXT%";s:8:"postType";s:1:"I";s:9:"isAutoImg";s:1:"A";s:8:"imgToUse";s:0:"";s:9:"isAutoURL";s:1:"A";s:8:"urlToUse";s:0:"";s:4:"doFB";i:0;}}";'
snapTW 's:197:"a:1:{i:0;a:8:{s:2:"do";s:1:"1";s:9:"msgFormat";s:10:"%FULLTEXT%";s:8:"attchImg";s:1:"1";s:9:"isAutoImg";s:1:"A";s:8:"imgToUse";s:0:"";s:9:"isAutoURL";s:1:"A";s:8:"urlToUse";s:0:"";s:4:"doTW";i:0;}}";'
_edit_lock '1512258895:1'

After update, without changing anything:

Key Value
_edit_last '1'
snap_isAutoPosted '1512258891'
mf2_mp-syndicate-to 'a:1:{i:0;s:4:"none";}'
_bridgy_backlink 'true'
_edit_lock '1512259011:1'
_snapPHST 'a:1:{s:2:"tw";a:1:{i:0;a:1:{i:0;a:4:{s:1:"l";s:52:"https://twitter.com/andrea/status/937108323308048385";s:2:"id";s:18:"937108323308048385";s:1:"d";s:19:"2017-12-02 23:56:49";s:1:"w";s:1:"s";}}}}'
_snap_forceSURL '2'
snap_MYURL ''
snapEdIT '1'
snapFB 's:197:"a:1:{i:0;a:8:{s:2:"do";s:1:"2";s:9:"msgFormat";s:10:"%FULLTEXT%";s:8:"postType";s:1:"I";s:9:"isAutoImg";s:1:"A";s:8:"imgToUse";s:0:"";s:9:"isAutoURL";s:1:"A";s:8:"urlToUse";s:0:"";s:4:"doFB";i:0;}}";'
snapTW 's:371:"a:1:{i:0;a:12:{s:2:"do";s:1:"1";s:9:"msgFormat";s:10:"%FULLTEXT%";s:8:"attchImg";s:1:"1";s:9:"isAutoImg";s:1:"A";s:8:"imgToUse";s:0:"";s:9:"isAutoURL";s:1:"A";s:8:"urlToUse";s:0:"";s:4:"doTW";i:0;s:8:"isPosted";s:1:"1";s:4:"pgID";s:18:"937108323308048385";s:7:"postURL";s:52:"https://twitter.com/andrea/status/937108323308048385";s:5:"pDate";s:19:"2017-12-02 23:56:49";}}";'

Looks like FB did not go thru this time

chrisaldrich commented 6 years ago

@dshanske, are you using the newest version of SNAP? It dawns on me that I haven't upgraded after their recent big update on any of my sites since I haven't had a chance to test things out (and it was a relatively large upgrade). Perhaps it's an issue with them storing the data slightly differently in the newest X.0.0 upgrade?

dshanske commented 6 years ago

It looks for post URL properties. But I mean to do a deeper dive. Either way, I did upgrade and mine still does work. Admittedly sometimes SNAP doesn't always post automatically, but separate issue.

dshanske commented 6 years ago

I was looking at the properties, and I don't see the URL in the SNAP properties. Is it possible that you are running foul of the delayed posting on the SNAP side? I get that sometimes.

interllectual commented 6 years ago

I thought of this too, and changed the snap publishing to immediately rather than using Cron. Now the url goes into the snap,properties right away, but the link still isn’t added to syndication links. I haven’t updated to the newest version of snap that came out yesterday.

interllectual commented 6 years ago

Not sure if this helps, but I turned on WP debugging and got these two errors when I syndicate to Twitter:

[08-Dec-2017 13:43:32 UTC] PHP Notice: Undefined index: items in /[REDACTED]/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php on line 328 [08-Dec-2017 13:43:43 UTC] PHP Warning: DOMDocument::loadHTML(): Empty string supplied as input in /[REDACTED]/wp-content/plugins/webmention/includes/functions.php on line 166

dshanske commented 6 years ago

Neither of which is part of this plugin

dshanske commented 6 years ago

Going to declare this closed as the newer version of Syndication Links looks at all URLs in snap fields.