Publicize: Store the syndicated URLs on the local site
After Publicize has processed a post, let's pass the URLs on social media back to the local site. It is already stored in meta on wp.com, so would need to update Publicize to insert post meta after success and Jetpack to be able to receive it.
This could help tie into indieweb setups that utilize syndicated URLs for webmentions and whatnot.
Added bonus: Could update the Publicize metabox to provide disabled checkboxes on which social media services a post was Pub'd to. Currently, this is a gap between WP.com and Jetpack.
Talking through this more, my suggestion would be:
- Sync this data to the same post meta fields that we use on WP.com, with it "frozen" on WP.com so the local site can't override that data on the WP.com side.
- Plugins could listen for adding that post meta and grab it.
- We add a 3rd-party hook to support Syndicated Links, which is the plugin suggested by the IndieWeb community, or at least work with the developer to make sure we're on the same page.
The post meta currently in use on WP.com may be going away at some point in the future (deferring to the publicize_actions section of the activity log), but the publicize_save_published_action hook on WP.com could be used to trigger a push to JP of the URL or we could access the activity log via an API if needed. (h/t @artpi for catching me up on the current status and direction of Publicize data storage).
I am the developer of Syndication Links. It is a relatively simple plugin. Happy to volunteer or participate.
This has been a while...has there been any movement on this?
@dshanske No, not yet.
This issue has been marked as stale. This happened because:
- It has been inactive in the past 6 months.
- It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.
Checking in on this issue
User vote on this thread: https://boffosocko.com/2019/03/28/55747397/
I’m still surprised they don’t return the URLs of where the content got shared for showing on the page with plugins like Syndication Links: https://wordpress.org/plugins/syndication-links/
Hat tip @ryanboren
This issue has been marked as stale. This happened because:
- It has been inactive in the past 6 months.
- It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.
@kraftbj Following up on this again
This issue has been marked as stale. This happened because:
- It has been inactive in the past 6 months.
- It hasn’t been labeled `[Pri] Blocker`, `[Pri] High`.
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.
I still want this.
No interest still in this, I guess.
Please don't confuse lack of activity as lack of interest. It is, however, very low priority and involves an aspect of a feature that crosses both WP.com and Jetpack that does not have a team actively working on. What seems like small changes can cascade to be larger problems.
Just checking in again.
Thanks for your patience @dshanske . The team working on Jetpack Social has this on their site as part of their Social Posts work (currently in beta).
@pablinos — In addition to saving the shared post for social posts, noting this request specifically for all Publicize (as post meta I would presume).
Yes, currently we're only storing it for Social Notes, but we want to extend this to all publicized posts. Part of the reason for only doing it for notes was that we wanted to test the approach, and also some sites share a lot of posts, and we didn't want to flood them with requests and store extra post meta, especially if they're not going to use it.
This would be lovely and would avoid a good deal of copy-pasting social links published by jetpack on a couple of my sites.
#38702 got us most of the way there. We need to adjust to all for additional post types beyond Social Notes. cc: @spsiddarthan
Yup, we are in the process of doing that. All going well, we should be able to launch it in the next Jetpack release.
If you could document where you store it, would appreciate
@dshanske it's stored in _publicize_shares
I'm proposing a hook to be added in 39398 that would allow you to grab the URLs when they're saved to the local site db.
If you want to pull the URLs already in the database, the data is stored as post meta in _publicize_shares for each post.
Each attempt at a share is in a multidimensional array. Items with status === 'success' will have a message key with the URL of the successfully shared post. If status === 'failed' the message is the failure reason. service is the social media service used.
If pulling from post meta, this is an example of what it'll look like:
array (
0 =>
array (
'status' => 'success',
'message' => 'https://mastodon.social/@KraftTesting/113131834695319922',
'timestamp' => 1726254802,
'service' => 'mastodon',
'connection_id' => 25383275,
'external_id' => '110346155483697827',
'external_name' => 'KraftTesting',
'profile_picture' => 'https://mastodon.social/avatars/original/missing.png',
'profile_link' => '',
),
1 =>
array (
'status' => 'success',
'message' => 'https://mastodon.social/@KraftTesting/113131853992527539',
'timestamp' => 1726255096,
'service' => 'mastodon',
'connection_id' => 25383275,
'external_id' => '110346155483697827',
'external_name' => 'KraftTesting',
'profile_picture' => 'https://mastodon.social/avatars/original/missing.png',
'profile_link' => '',
),
2 =>
array (
'status' => 'success',
'message' => 'https://mastodon.social/@KraftTesting/113131884688679461',
'timestamp' => 1726255565,
'service' => 'mastodon',
'connection_id' => 25383275,
'external_id' => '110346155483697827',
'external_name' => 'KraftTesting',
'profile_picture' => 'https://mastodon.social/avatars/original/missing.png',
'profile_link' => '',
),
)
If you're wanting to hook upon save, you can do something like:
add_action( 'jetpack_publicize_share_urls_saved', 'bk_test_save', 10, 2);
function bk_test_save( $urls ) {
if ( $urls ) {
update_option( 'bk_test_urls', $urls );
} else {
update_option( 'bk_test_urls', 'nothing present');
}
}
The $urls value in the hook approach looks like (once merged):
array (
0 =>
array (
'url' => 'https://mastodon.social/@KraftTesting/113131834695319922',
'service' => 'mastodon',
),
)
@dshanske Does that work for your needs or are there some changes that we can consider you'd suggest?
That's perfect. As long as it can be found.