Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Smash Balloon Nigel

    (@nigelrsb)

    Hi @spyrosvl

    Thank you for contacting us! I am checking with my colleagues to get more details on this. I’ll get back to you as soon as I have an update; thank you in advance for your patience. If you have any additional thoughts or questions in the meantime, please let me know. 

    Thanks! 🙂

    Plugin Support Smash Balloon Nigel

    (@nigelrsb)

    Hi @spyrosvl,

    Just a quick update. The SBI_Notifications->fetch_feed() only retrieves a remote json that mostly contains important notices related to your API status and required updates and similar information related to our products. For example, if Instagram makes an API change that might not require a plugin software update but still requires some kind of action on the user side, like reconnecting your feed.

    I’m still checking with our developers to get more detailed feedback but what I described above covers most of it.

    Please let me know if you have questions.

    Thread Starter Nitroweb

    (@spyrosvl)

    Hi @nigelrsb ,

    I am not saying it is not needed. I am just questioning if 3 requests are needed on every wp-admin page load. Why not just put a transient and do the request every n minutes/hours etc?

    Best regards,
    Spyros

    • This reply was modified 1 year, 2 months ago by Nitroweb.
    Plugin Support Smash Balloon Nigel

    (@nigelrsb)

    Hi Spyros,

    Thanks for the clarification and insightful suggestion. I’ve added add these details to the internal enquiry I made earlier. I expect to hear back from the developer by early next week.

    In the meantime, please let me know if you have additional questions or details to add.

    Best Regards,

    @nigelrsb I would also like to suggest that you use cache to store the result from https://plugin.smashballoon.com/notifications.json a couple of hours at least. I would say it might be enough to just do it once a day really. How often do you actually update the notifications anyway? 🙂

    According to Query Monitor it does it twice per page load.

    Here is some debug information you can send to the developers.

    First time it goes (reverse trace):

    1. SBI_Notifications->fetch_feed()
      wp-content/plugins/instagram-feed-pro/inc/admin/class-sbi-notifications.php:141
    2. SBI_Notifications->update()
      wp-content/plugins/instagram-feed-pro/inc/admin/class-sbi-notifications.php:403
    3. SBI_Notifications->get()
      wp-content/plugins/instagram-feed-pro/inc/admin/class-sbi-notifications.php:332
    4. SBI_Notifications->output()
      wp-content/plugins/instagram-feed-pro/inc/admin/class-sbi-notifications.php:495
    5. do_action('admin_init')
      wp-includes/plugin.php:517

    And the second time:

    1. SBI_Notifications->fetch_feed()
      wp-content/plugins/instagram-feed-pro/inc/admin/class-sbi-notifications.php:141
    2. SBI_Notifications->update()
      wp-content/plugins/instagram-feed-pro/inc/admin/class-sbi-notifications.php:403
    3. SBI_Notifications->get()
      wp-content/plugins/instagram-feed-pro/inc/admin/class-sbi-notifications.php:332
    4. SBI_Notifications->enqueues()
      wp-content/plugins/instagram-feed-pro/inc/admin/class-sbi-notifications.php:427
    5. do_action('admin_enqueue_scripts')
      wp-includes/plugin.php:517

    I have not debugged it further to see if its a simple bug in SBI_Notifications or if the object gets initialized twice.

    But yeah, even if that bug is fixed. Calling remote on every page load is a bit excessive. 🙂

    Plugin Support Smash Balloon Nigel

    (@nigelrsb)

    Hi @spyrosvl,

    Sorry for not getting back to you earlier. The default notifications schedule is set to run once a week on the sbi_notification_update wp-cron hook. If it is running more frequently than that, there may be a problem with your website’s wp-cron function. We might need to troubleshoot the issue on your specific setup to fix it. To further investigate the issue, please submit a support request via the form on our website, https://smashballoon.com/support/, and include the System Info. 

    To obtain this information, please follow the steps on this page: https://smashballoon.com/doc/how-to-get-system-info. We ask you to use our form, as the System Info contains other website information from your site, which we do not suggest posting here.

    @feedmeastraycat, thank you for sharing your insight. I suspect the issue could also be wp-cron related for you too. To troubleshoot further on your specific setup, please submit a request on our support form linked above and include your system info too.

    Best Regards,

    @nigelrsb I found the issue! The site is a bit older and the options table was still on utf8mb3 for some reason and you guys are sending in an emoji in the notifications data. So when SBI_Notifications->update() runs update_option() it fails (it returns false, but that is never checked in the plugin).

    It’s true that there is a cron job fetching the notifications once per week. But there is also a fallback to fetch the notifications on each page load if the cron has failed. And this fallback will run twice if update_option() fails. So when it the notification data contained a emoji, it failed, and it tried again. The cron works fine. But will also fail because of the same issue.

    Might be a good idea not to use emojis. Or at least have some error handling when update_option() fails. Maybe set empty data just updating the timestamp so it does not try again.

    @spyrosvl Sorry for hijacking your support thread. 🙂 But maybe you have the same issue!

    If anyone else finds this issue and have the same problem it was fixed by changing the table charset, for example:

    ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

    Remember to backup first!

    Thread Starter Nitroweb

    (@spyrosvl)

    @feedmeastraycat thank you for investigating this further.

    I’ve also noticed that this happens when the feed(s) are not connected/configured. It keeps on running SBI_Notifications->fetch_feed() twice on every wp-admin load.

    Plugin Support Smash Balloon Nigel

    (@nigelrsb)

    Hey @feedmeastraycat,

    Thank you for the valuable insight! it’s definitely worth looking into. As a quick fix, you can install the free “Database Collation Fix” plugin on your website. Once installed, navigate to Tools > Collation Fix in your WordPress dashboard. On this page, you’ll see an option to “Force Collation Algorithm.” Please choose “utf8mb4_unicode_ci” and click the “Fix Database Collation” button.

    Important Note: Please create a complete backup of your website before following this process, as it alters your database and may break your website if the update does not work as expected. Typically, this is a safe, one-time, permanent solution. Once the collation error is fixed, you can safely uninstall the “Database Collation Fix” plugin.

    @spyrosvl, if you had already opened a support thread on our website, could you include a link to this forum thread in your reply so we can check if you were affected by a similar issue. In the meantime, I’ll bring this up with my colleagues so we can investigate how to improve the error handling.

    Best Regards,

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘HTTP API Calls on every admin page’ is closed to new replies.