0 && $facts['now'] < $facts['remindLater'] ) { return false; } // Max 2 reminders. return $facts['remindCount'] < 2; } /** * Show review notice if conditions are met. */ function f12_cf7_doubleoptin_maybe_show_review_notice() { if ( ! current_user_can( 'manage_options' ) ) { return; } global $pagenow; $optin_counters = get_option( 'f12_cf7_doubleoptin_telemetry_counters', [] ); $confirmed_optins = isset( $optin_counters['confirmed_optins'] ) ? (int) $optin_counters['confirmed_optins'] : 0; $due = f12_cf7_doubleoptin_review_is_due( array( 'now' => time(), 'installedAt' => (int) get_option( 'f12_cf7_doubleoptin_installed_at', time() ), 'confirmed' => $confirmed_optins, 'dismissed' => (bool) get_option( 'f12_cf7_doubleoptin_review_dismissed', false ), 'remindLater' => (int) get_option( 'f12_cf7_doubleoptin_review_remind_later', 0 ), 'remindCount' => (int) get_option( 'f12_cf7_doubleoptin_review_remind_count', 0 ), 'pagenow' => isset( $pagenow ) ? (string) $pagenow : '', // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only: which admin page is open. 'page' => isset( $_GET['page'] ) ? sanitize_key( wp_unslash( $_GET['page'] ) ) : '', ) ); if ( ! $due ) { return; } // Claim this screen. The credit-link notice runs later on the same hook // and stands down when it sees this — asking a site owner for two // favours at once is how a plugin earns a one-star review, and the // review request is the more valuable of the two. $GLOBALS['f12_doi_review_notice_shown'] = true; ?>