".$twae_review_css.""); add_action( 'admin_print_footer_scripts', function () { ?> "true") ); exit; } // admin notice public function twae_admin_notice_for_reviews(){ if( !current_user_can( 'update_plugins' ) ){ return; } // get installation dates and rated settings $installation_date = get_option( 'twae-installDate' ); $alreadyRated =get_option( 'twae-alreadyRated' )!=false?get_option( 'twae-alreadyRated'):"no"; // check user already rated if( $alreadyRated=="yes") { return; } // grab plugin installation date and compare it with current date $display_date = date( 'Y-m-d h:i:s' ); $install_date= new DateTime( $installation_date ); $current_date = new DateTime( $display_date ); $difference = $install_date->diff($current_date); $diff_days= $difference->days; // check if installation days is greator then week if (isset($diff_days) && $diff_days>=3) { echo $this->twae_create_notice_content(); } } // generated review notice HTML function twae_create_notice_content(){ $ajax_url=admin_url( 'admin-ajax.php' ); $ajax_callback='twae_dismiss_notice'; $wrap_cls="notice notice-info is-dismissible"; $img_path=TWAE_URL.'assets/images/timeline-widget-logo.png'; $p_name="Timeline Widget Addon For Elementor"; $like_it_text='Rate Now! ★★★★★'; $already_rated_text=esc_html__( 'I already rated it', 'cool-timeline' ); $not_interested=esc_html__( 'Not Interested', 'ect' ); $not_like_it_text=esc_html__( 'No, not good enough, i do not like to rate it!', 'cool-timeline' ); $p_link=esc_url('https://wordpress.org/support/plugin/timeline-widget-addon-for-elementor/reviews/#new-post'); $pro_url=esc_url('https://1.envato.market/c/1258464/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Fthe-events-calendar-templates-and-shortcode-wordpress-plugin%2F20143286'); $message="Thanks for using $p_name WordPress plugin. We hope it meets your expectations!
Please give us a quick rating, it works as a boost for us to keep working on more Cool Plugins!
"; $html='
%3$s
%4$s
'; return sprintf($html, $wrap_cls, $img_path, $p_name, $message, $p_link, $like_it_text, $already_rated_text, $ajax_url,// 8 $ajax_callback,//9 $pro_url,//10 $not_interested ); } } //class end }