'', 'plugin_name' => '', 'review_url' => '', 'image_url' => '', 'cookie_name' => 'review_notice_shown', 'option_name' => 'review_notice_shown', 'nonce_action' => 'dismiss-review', 'screen_bases' => ['dashboard', 'plugins'] ); // Private constructor to prevent instantiation from outside private function __construct($custom_options = []) { // Merge custom options with default options $this->options = array_merge($this->options, $custom_options); // Hook the necessary actions add_action('admin_notices', array($this, 'show_leave_review_notice')); add_action('wp_ajax_dismiss_review_notice', array($this, 'dismiss_review_notice_callback')); } // Get or create the singleton instance public static function get_instance($options = array()) { if (self::$instance === null) { self::$instance = new self($options); } return self::$instance; } // Method to display the review notice public function show_leave_review_notice() { $screen = get_current_screen(); // Use dynamic cookie name if (isset($_COOKIE[$this->options['cookie_name']])) { update_option($this->options['option_name'], true); setcookie($this->options['cookie_name'], '', time() - 3600, '/'); } if (!current_user_can('manage_options') || get_option($this->options['option_name'], false) || !in_array($screen->base, $this->options['screen_bases'])) { return; } $activation_timestamp = get_option('divitorque_lite_activation_time', false); $three_days_ago = strtotime('-3 days'); if ($activation_timestamp && $activation_timestamp < $three_days_ago) : ?>
review-logo

options['plugin_name'] . " for some time now. Thank you! 💕", 'addons-for-divi'); ?>

Don't hesitate to share your feature requests with the review, I always check them and try my best.", 'addons-for-divi'); ?>

options['nonce_action'], 'sec'); $type = sanitize_text_field($_POST['type']); if ($type === 'dismiss') { update_option($this->options['option_name'], true); } wp_send_json_success(); } }