$time, 'dismissed' => false, ); $load = true; } else { // Check if it has been dismissed or not. if ( ( isset( $rating['dismissed'] ) && ! $rating['dismissed'] ) && ( isset( $rating['time'] ) && ( ( $rating['time'] ) <= $time ) ) ) { $load = true; } } // If we cannot load, return early. if ( ! $load ) { return; } // Update the review option now. update_option( 'socialsnap_rating', $rating ); // Fetch total shares. $shares = intval( socialsnap()->stats->get_stats( array( 'type' => 'share', ), true ) ); // Don't display the notice if share count is less than 30. if ( $shares < 50 ) { return; } $message = '

' . esc_html__( 'Hey, you just crossed 50 shares via Social Snap - that’s awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.', 'socialsnap' ) . '

'; $message .= '

~ Branko Conjic
' . __( 'Co-Founder of Social Snap', 'socialsnap' ) . '

'; $message .= '

' . esc_html__( 'Ok, you deserve it', 'socialsnap' ) . '
' . esc_html__( 'Nope, maybe later', 'socialsnap' ) . '
' . esc_html__( 'I already did', 'socialsnap' ) . '

'; socialsnap_print_notice( array( 'type' => 'info', 'message' => $message, 'message_id' => 'request-review-notice', 'is_dismissible' => true, ) ); } /** * Filter WordPress footer right text to display our text. * * @since 1.0.0 */ public function filter_update_footer( $old ) { // Only do this if we are on one of our plugin pages if ( strpos( get_current_screen()->base, 'socialsnap' ) !== false ) { return false; } else { return $old; } } /** * Filter WordPress footer left text to display our text. * * @since 1.0 */ public function filter_admin_footer_text( $text ) { // Only do this if we are on one of our plugin pages if ( strpos( get_current_screen()->base, 'socialsnap' ) !== false ) { $url = 'https://wordpress.org/support/plugin/socialsnap/reviews/?filter=5#new-post'; // translators: %s = review link. $text = sprintf( __( 'If you like Social Snap please leave us a ★★★★★ rating to help us spread the word. Thank you!', 'socialsnap' ), $url ); } return $text; } } new SocialSnap_Rating();