*/ 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_pxlbsadminify_allow_collect', array($this, 'pxlbsadminify_allow_collect')); } /** * Allow collect data * * @author Jewel Theme */ public function pxlbsadminify_allow_collect() { check_ajax_referer('pxlbsadminify_allow_collect_nonce'); // Opting in to send diagnostic data to a third party is a // site-wide consent and must only be performed by a site // administrator. if ( ! current_user_can( 'manage_options' ) ) { wp_send_json_error( array( 'mess' => __( 'You are not allowed to perform this action.', 'adminify' ) ), 403 ); } $this->pxlbsadminify_collect_ajax_data(); } public function pxlbsadminify_collect_ajax_data() { if (!empty(get_option('pxlbsadminify_what_we_collect'))) { return; } $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, )); update_option('pxlbsadminify_what_we_collect', 'yes'); return $response; } /** * 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?

', esc_html__('Adminify', 'adminify') ); } /** * Link for collect data * * @author Jewel Theme */ public function what_we_collect_link() { echo '' . esc_html__('what we collect', 'adminify') . ''; } /** * 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.', 'adminify'), esc_html( __('Adminify', 'adminify') ) ) ); ?> (what_we_collect_link(); ?>)

*/ public function plugin_rate_url() { return '#'; } /** * Footer Content * * @author Jewel Theme */ public function footer_content() { ?> */ public function intervals() { return array(0, 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); ?>