{"id":17961067,"date":"2024-08-19T04:47:30","date_gmt":"2024-08-19T04:47:30","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/reduce-3\/"},"modified":"2024-08-19T05:02:07","modified_gmt":"2024-08-19T05:02:07","slug":"reduce-3","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/reduce-3\/","title":{"rendered":"How to reduce plugin-notification load on every page"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello. Nice plugin and great features.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I have a question. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Is there a way to reduce plugin-notification load to once every day.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">https:\/\/groundho.gg\/wp-json\/wp\/v2\/plugin-notification\/<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In order to optimize wp, I disabled external requests. And now it tries to load it on every page when I am logged in. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It was trying to load it twice per page. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1st \u2014 in &#8216;admin_print_styles&#8217;. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2nd \u2014 in do_action(&#8216;wp_after_admin_bar_render&#8217;)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I managed to remove 2nd by removing groundhogg from admin bar. In settings \u2014 misc tab. (Thanks for having that option)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is how 1st one called.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\"Groundhogg\\\\Notices-&gt;count_unread\",      <br \/>\"Groundhogg\\\\maybe_print_menu_styles\",      <br \/>\"WP_Hook-&gt;apply_filters\",      <br \/>\"WP_Hook-&gt;do_action\",      <br \/>\"do_action('admin_print_styles')\",      <br \/>\"require_once('wp-admin\/admin-header.php')\",      <br \/>\"require_once('wp-admin\/admin.php')\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Is there a way to reduce number of checks to 1 per day even if it was not successfully loaded for couple days or weeks?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ps: other plugins also load latest news\/notifications from ther website. But they are not trying it too hard to load it on every page when last try failed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Suggestion: it might be better to load notification inside cronjob, ajax or internal rest api. (In order to not slow down page generation of wordpress admin interface). Best solution I think once per day cron job. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you. <\/p>\n","protected":false},"template":"","class_list":["post-17961067","topic","type-topic","status-publish","hentry","topic-tag-performance"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17961067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17961067\/revisions"}],"predecessor-version":[{"id":17961077,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/17961067\/revisions\/17961077"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=17961067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}