= $install_date && false === $spare_me ) { add_action( 'admin_notices', array( $this, 'rating_admin_notice' ) ); } } // =========================================================================================== /** * Displays a rating admin notice. * * This function is called when the plugin has been active for 7 days. */ public function rating_admin_notice() { $screen = get_current_screen(); $allowed_screens = array( 'dashboard', 'plugins' ); if ( ! in_array( $screen->base, $allowed_screens, true ) ) { return; } $nonce = wp_create_nonce( 'lwp_cfdb_nonce' ); $dont_disturb = esc_url( get_admin_url() . '?lwp_cfdb_spare_me=1&lwp_cfdb_nonce=' . $nonce ); $dont_show = esc_url( get_admin_url() . '?lwp_cfdb_spare_me=1&lwp_cfdb_nonce=' . $nonce ); $plugin_info = 'Divi Contact Form DB'; $reviewurl = esc_url( 'https://wordpress.org/support/plugin/contact-form-db-divi/reviews/?filter=5' ); // phpcs:disable // All variables in the printf are escaped in the start of the function. printf( __( '

Hello! Seems like you are using %s plugin on your Divi website. 🌟 If you\'ve found it helpful, could you take a moment to rate us 5 stars 🌟 on WordPress? It would mean the world to us and help others choose the right plugin. Thank you!

Ok,you deserve it I already did Don\'t show this again.
', 'contact-form-db-divi' ), $plugin_info, $reviewurl, $dont_disturb, $dont_show ); // phpcs:enable } // =========================================================================================== /** * Handles the 'spare me' functionality which disables the rating admin notice. * * This function is called on 'admin_init' hook. */ public function spare_me() { if ( isset( $_GET['lwp_cfdb_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['lwp_cfdb_nonce'] ) ), 'lwp_cfdb_nonce' ) ) { if ( ! empty( $_GET['lwp_cfdb_spare_me'] ) ) { add_option( 'lwp_cfdb_spare_me', true ); } } } // =========================================================================================== }