/** * Displays the notice on the top of admin panel if it has caching issues * * @since 2.2.7 */ function plugin_admin_notices() { $options = new SG_CachePress_Options(); if ($options->get_option('show_notice') == 1) { $html = '<div id="ajax-notification" class="updated sg-cachepress-notification">'; $html .= '<p>'; $html .= __('<strong>SG CachePress:</strong> Your site ' . get_site_url() . ' is <strong>not cached</strong>! Make sure the Dynamic Cache is enabled in the SuperCacher tool in cPanel. <a href="javascript:;" id="dismiss-sg-cahepress-notification">Click here to hide this notice</a>.', 'ajax-notification'); $html .= '</p>'; $html .= '<span id="ajax-notification-nonce" class="hidden">' . wp_create_nonce('ajax-notification-nonce') . '</span>'; $html .= '</div>'; echo $html; } }
/** * Fired for each blog when the plugin is activated. * * @since 1.1.0 */ private static function single_activate() { $sg_cachepress_options = new SG_CachePress_Options(); $sg_cachepress = new SG_CachePress($sg_cachepress_options); if (!$sg_cachepress_options->get_option()) { $sg_cachepress_options->init_options(); } }