• Resolved kubazabran

    (@kubazabran)


    Hey,

    we got an interesting error. The LinkedIn authorization expired, I didn’t noticed and it basically broke our website.

    Authors were getting this error “Updating failed. The response is not a valid JSON response.” and all other events and plugins connected to publishing stopped working. It impacted features like social media auto publishing or sending mail notifications to editors.

    It would be nice to fix it. Admins can forget about the re-authorization.

    Thanks!

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

    (@northernbeacheswebsites)

    Hi @kubazabran,

    As per LinkedIn’s API requirements re-authentication is required every 60 days, unfortunately there’s no way to get around this. Our plugin creates a notice when authentication is about to expire.

    If authorisation has expired, it shouldn’t prevent posts being updated/published though. Is this what you are saying? If so, are you using the classic or Gutenberg editor? Can you also please check your WordPress debug log for any errors. If you aren’t sure what I mean, please see: https://wordpress.org/support/article/debugging-in-wordpress/

    Thanks,

    When the plugin needs to be re-authenticated, we get the following when we try to publish a post:

    Warning: Undefined variable $profileType in [root_directory]/wp-content/plugins/wp-linkedin-auto-publish/wp-linkedin-auto-publish.php on line 691

    Warning: Undefined variable $profileId in [root_directory]/wp-content/plugins/wp-linkedin-auto-publish/wp-linkedin-auto-publish.php on line 691

    Fatal error: Uncaught TypeError: Cannot access offset of type string on string in [root_directory]/wp-content/plugins/wp-linkedin-auto-publish/wp-linkedin-auto-publish.php:777 Stack trace: #0 [root_directory]/wp-content/plugins/wp-linkedin-auto-publish/wp-linkedin-auto-publish.php(635): wp_linkedin_autopublish_post_to_linkedin_common(6246) #1 [root_directory]/wp-includes/class-wp-hook.php(307): wp_linkedin_autopublish_post_to_linkedin(‘publish’, ‘draft’, Object(WP_Post)) #2 [root_directory]/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #3 [root_directory]/wp-includes/plugin.php(476): WP_Hook->do_action(Array) #4 [root_directory]/wp-includes/post.php(5303): do_action(‘transition_post…’, ‘publish’, ‘draft’, Object(WP_Post)) #5 [root_directory]/wp-includes/post.php(4563): wp_transition_post_status(‘publish’, ‘draft’, Object(WP_Post)) #6 [root_directory]/wp-includes/post.php(4775): wp_insert_post(Array, false, true) #7 [root_directory]/wp-admin/includes/post.php(426): wp_update_post(Array) #8 [root_directory]/wp-admin/post.php(227): edit_post() #9 {main} thrown in [root_directory]/wp-content/plugins/wp-linkedin-auto-publish/wp-linkedin-auto-publish.php on line 777`

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @dking64,

    Thanks for your contribution.

    Why are you trying to publish a post if the plugin needs to be re-authenticated?

    You should re-authenticate, and then publish a post and that way you won’t experience any error.

    Thank you,

    Thanks for following up quickly.

    I’m a developer so technical notices in WordPress are meaningful to me. And your question is a valid one if it addresses a technical user. My client who uses the site daily, however, is not technical. He just wants to post, and wants the convenience of automatic cross-posting to LinkedIn. But because of LinkedIn’s requirements, the plugin loses its authentication, my client pays no attention to technical notices and tries to post, an error that is illegible to him is thrown, and he contacts me. I re-authenticate as soon as I’m available and then he posts.

    So I guess my question boils down to this: should a plugin that loses authentication every 60 days prevent a user from posting?

    Of course further training with my client can mitigate problems here, as can me noting in my calendar to log into my client’s site every 60 days to re-authenticate. But I think it would be better if a notification email to the main admin were generated when the plugin loses its authentication. And/or a user is allowed to post but a notice communicates that cross-posting has discontinued. Those would be better than a technical error notice to a non-technical user that the plugin is preventing her/him from posting.

    Thanks again!

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @dking64,

    Your comments are fair and I appreciate your feedback. I have released an update which will fix this fatal error.

    I just want to note, and hopefully this doesn’t come across as too much of an upsell, however the pro version does have better developer hooks so it is possible to send yourself an email when authentication has expired. The action is called: autosocial_authentication_expiry

    and I can even provide a code snippet for you to get started if you do choose to get the pro version. Thanks!

    I just bought the Pro version. A completely reasonable upsell (and anyone who apologizes for a reasonable upsell probably deserves more than he gets).

    Please provide the code snippet for the de-authentication notice when you have a chance.

    Thanks again for your help, Martin!

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @dking64,

    Thank you 🙂

    Could you please send an email to: info@northernbeacheswebsites.com.au and just mention your order ID and I will get this sorted for you as I am not allowed to provide pro support on this forum.

    Thanks,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Unauthorized account results to fatal error’ is closed to new replies.