= self::SHOW_LAPSE ) {
$remind_later_notice = get_user_meta( $user_id, self::REMIND_LATER_NOTICE, true );
if ( empty( $remind_later_notice ) || ( time() > $remind_later_notice ) ) {
add_action( 'admin_notices', array( __CLASS__, 'admin_notices' ) );
}
}
}
}
}
}
/**
* Initializes if necessary and returns the init time.
*
* @return int
*/
public static function get_init_time() {
$init_time = get_site_option( self::INIT_TIME, null );
if ( $init_time === null ) {
$init_time = time();
add_site_option( self::INIT_TIME, $init_time );
}
return $init_time;
}
/**
* Adds the admin notice.
*/
public static function admin_notices() {
$current_url = groups_get_current_url();
$hide_url = wp_nonce_url( add_query_arg( self::HIDE_REVIEW_NOTICE, true, $current_url ), 'hide', 'groups_notice' );
$remind_url = wp_nonce_url( add_query_arg( self::REMIND_LATER_NOTICE, true, $current_url ), 'later', 'groups_notice' );
$output = '';
$output .= '';
$output .= '
';
$output .= '
';
$output .= wp_kses_post( __( 'Many thanks for using Groups!', 'groups' ) );
$output .= ' ';
$output .= esc_html__( 'Could you please spare a minute and give it a review over at WordPress.org?', 'groups' );
$output .= ' ';
$output .= sprintf(
'%s',
esc_attr__( 'I have already done that or do not want to submit a review.', 'groups' ),
esc_url( $hide_url ),
esc_html__( 'Dismiss', 'groups' )
);
$output .= '
';
$output .= '
';
$output .= sprintf(
'%s',
esc_attr__( 'I want to submit a review right now!', 'groups' ),
esc_url( 'https://wordpress.org/support/view/plugin-reviews/groups?filter=5#postform' ),
esc_html__( 'Yes, here we go!', 'groups' )
);
$output .= ' ';
$output .= sprintf(
'%s',
esc_attr__( 'I want to submit a review later, remind me!', 'groups' ),
esc_url( $remind_url ),
esc_html__( 'Remind me later', 'groups' )
);
$output .= '
';
$output .= '
';
$output .= sprintf(
/* translators: 1: link, 2: link */
__( 'Follow %1$s and visit %2$s to stay tuned for free and premium tools.', 'groups' ),
'@itthinx',
'itthinx.com'
);
$output .= '
';
$output .= '
';
echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
}
Groups_Admin_Notice::init();