$now ) ) { return false; } $installed = (int) get_option( self::INSTALLED, $now ); if ( $now - $installed < self::WAIT_DAYS * DAY_IN_SECONDS ) { return false; } return ( null === $fixed ? self::fixed() : (int) $fixed ) > 0; } /** * Issues fixed so far, from the (cached) summary. * * @return int */ private static function fixed() { $summary = Store::summary(); return isset( $summary['fixed'] ) ? (int) $summary['fixed'] : 0; } /** * Prints the request on a Fixlight screen when it is due. */ public static function render() { if ( ! self::due() ) { return; } $fixed = self::fixed(); $link = static function ( $answer ) { return wp_nonce_url( admin_url( 'admin-post.php?action=fixlight_review_ask&answer=' . $answer ), 'fixlight_review_ask' ); }; echo '
'; echo esc_html( sprintf( /* translators: %s: number of issues fixed. */ _n( 'Fixlight has fixed %s accessibility issue on your site. If it helps you, a review on WordPress.org helps other site owners find it.', 'Fixlight has fixed %s accessibility issues on your site. If it helps you, a review on WordPress.org helps other site owners find it.', $fixed, 'fixlight' ), number_format_i18n( $fixed ) ) ); echo '
'; printf( '%2$s %3$s %5$s %7$s', esc_url( $link( 'review' ) ), esc_html__( 'Write a review', 'fixlight' ), esc_html__( '(opens in a new tab)', 'fixlight' ), esc_url( $link( 'later' ) ), esc_html__( 'Maybe later', 'fixlight' ), esc_url( $link( 'never' ) ), esc_html__( 'Don\'t ask again', 'fixlight' ) ); echo '