*/ class What_We_Collect extends Notice { use User_Data; public $color = 'warning'; /** * Constructor method * * @author Jewel Theme */ public function __construct() { parent::__construct(); add_action( 'wp_ajax_jlt_admin_bar_editor_allow_collect', array( $this, 'jlt_admin_bar_editor_allow_collect' ) ); } /** * Allow collect data * * @author Jewel Theme */ public function jlt_admin_bar_editor_allow_collect() { check_ajax_referer( 'jlt_admin_bar_editor_allow_collect_nonce' ); $email = get_bloginfo( 'admin_email' ); $author_obj = get_user_by( 'email', $email ); $user_id = $author_obj->ID; $full_name = $author_obj->display_name; $response = $this->get_collect_data( $user_id, array( 'first_name' => $full_name, 'email' => $email, ) ); if ( ! is_wp_error( $response ) && 200 === $response['response']['code'] && 'OK' === $response['response']['message'] ) { wp_send_json_success( 'Thanks for Allow!' ); } else { wp_send_json_error( "Couldn't Collect" ); } } /** * Title Content * * @author Jewel Theme */ public function set_title() { printf( '

Wanna get some discount for %1$s? No Worries!! We got you!! give us your email we will send you the discount code?

', JLT_ADMIN_BAR_EDITOR ); } /** * Link for collect data * * @author Jewel Theme */ public function what_we_collect_link() { echo '' . esc_html__( 'what we collect', 'admin-bar' ) . ''; } /** * Notice Content * * @author Jewel Theme */ public function notice_content() { ?>

%1$s even more awesome? Allow %1$s to collect non-sensitive diagnostic data and usage information.', 'admin-bar' ), __( 'admin-bar', 'admin-bar' ) ); ?> (what_we_collect_link(); ?>)

*/ public function plugin_rate_url() { return '#'; } /** * Footer Content * * @author Jewel Theme */ public function footer_content() { ?> */ public function intervals() { return array( 7, 10, 15, 20, 15, 25, 30 ); } /** * Core Script * * @param [type] $trigger_time . * @author Jewel Theme */ public function core_script( $trigger_time ) { parent::core_script( $trigger_time ); ?>