• Resolved silvercode

    (@silvercode)


    I’ve noticed recently that posts are now being shared to company pages twice. Nothing has changed in our process. We always schedule posts ahead of time and they normally share to LinkedIn using this plugin just fine.

    You can see in this screenshot back in December they were posting normally; once to the connected personal profile and once to the connected company page. We then had a break for a couple of months and now since starting to post again in March this year, they all get shared to the company page twice.

    Any ideas?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @silvercode,

    Does the issue happen on a non-scheduled post? So what if you create a post, click the publish button, how many times does a share occur?

    Are you using the classic editor or Gutenberg editor or something else? And did you change editors over this break you had?

    Thanks,

    Thread Starter silvercode

    (@silvercode)

    Thanks for getting back to me so quickly. I tested with a non-scheduled post and all is well – it shares across to LinkedIn as expected (once to the personal profile, once to the company page).

    So the issue is seemingly only happening on scheduled posts.

    Using Gutenberg editor – no change to the editor being used.

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @silvercode,

    Are you using the standard WooCommerce post scheduling option? You don’t have any plugins around post scheduling that might be affecting things?

    I know you are probably certain there’s a repeatable issue, but I would appreciate it, if you could do a quick test schedule again and see if the issue repeats, like set the time to be like 5 minutes from the current time or something and just see what happens. I am just asking because I tried doing a schedule post earlier today with the latest version of the plugin and I didn’t run into an issue. Thanks,

    Thread Starter silvercode

    (@silvercode)

    For some background, we use the plugin to share posts both to an individual profile, as well as an organisation profile. So two shares in total. The issue we were experiencing is that it was sharing twice to the organisation – 3 shares in total.

    At first we thought this wasn’t occurring on manually posted posts, but this appears to be incorrect. It will occur whether it’s a ‘future’ scheduled post, or a manual post. Initially I was looking into the possibility of a duplication during publish, as the plugin utilises a number of related hooks, e.g. transition_post_status and save_post. However after adding some logging, what we found was that the primary function responsible for sharing the post to LinkedIn wp_linkedin_autopublish_post_to_linkedin_common() wasn’t actually firing more than once. It was firing once, and sharing the post to the personal profile once, and then twice to the organisation.

    After some more logging and debugging, we found that the “share profiles” that are stored in the plugin settings under wp_linkedin_autopublish_settings are incorrect. In our case, the default share profile is set to the following example:

    32101,n1f6wl6-Q5,urn:li:organization:32101

    Despite the plugin settings reflecting the correct two profiles in the UI, the actual option data is a comma separated list of 3 IDs. The first is the org ID, the second is the profile ID, and the third is the org ID again – this is why in the publishing loop in  wp_linkedin_autopublish_post_to_linkedin_common() it is posting to the same organisation twice.

    So after everything, the issue appears to be wp_linkedin_autopublish_get_companies() isn’t handling the data from LinkedIn properly. Either something is unique to our account and the plugin isn’t expecting it, or the LinkedIn REST API has changed enough to break the way that the plugin is parsing the response. Besides parsing the response from LinkedIn and extracting the IDs, ideally if it ever gets to this point, duplicates could be filtered out at other points in the code as well, e.g. publishing or saving, or sharing the post. Note that re-authorising results in the same issue, so I don’t believe it’s a once-off.

    Can you please have a look at the responses you’re getting from LinkedIn for the organisation IDs? It seems pretty unlikely that this is local to this specific LinkedIn account. For now we’ve just manually added a solution for our own case. Let me know if you need any further information. Thank you.

    • This reply was modified 8 months, 2 weeks ago by silvercode.
    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @silvercode,

    Thanks for that info – very helpful. I have seen this kind of issue before. What has solved this in the past is deleting all settings and this will clear out bad values for the company and then connect again.

    So to do this, firstly note down any important changes/customisations you might have done in the settings. Then to delete the settings, please go to the “Help” tab and go to the question “How do I clear all plugin settings?” and then click the link mentioned. Then refresh the page, go to the “Sharing Options” tab and click “Save All Settings”, and then go to the “Connect” tab and re-authentication again and then add in any custom settings you have entered.

    Once you have done this, I strongly suspect this won’t happen again. I will also mention that deleting the plugin settings, doesn’t delete any historical shares or anything ??

    Thanks,

    Thread Starter silvercode

    (@silvercode)

    Thanks for that, clearing all settings and re-adding them appears to have fixed it. We’re not seeing duplicate profiles in the wp_linkedin_autopublish_default_share_profile option anymore.

    Having said that, if you do get a chance at some point in the future it would be good to have some checks for duplication at some points in the process so this doesn’t happen again. Either when the company/profile IDs are fetched and before they’re saved to the DB, or a check for duplication before posts are shared. All good for now though, maybe just something to add to the todo list.

    Thanks again, and thanks for offering the plugin for free. ??

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @silvercode,

    I am glad to hear this solved the issue. I get what you are saying, the issue was initially caused by an API change on LinkedIn’s end, so we don’t anticipate this will re-emerge unless they change their API again (and the probably of this is very close to 0). If they change their API again in a way that affects the fetching of companies, I am going to be a lot more on top of the transition from a data perspective so people don’t experience issues like you described ??

    Have a great weekend,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Scheduled posts being shared to company pages twice’ is closed to new replies.