*Allow Ad Blocker Notify to anonymously track how this plugin is used and help us make
the plugin better. No sensitive data is tracked.
Over 6.000 happy clients
Useful for all people who display ads on their websites!
Why lose the ad views or clicks when you can ‘politely’ ask the people to disable the AdBlock and
support you?!
This plugin just does that for you. Quit blabbering non-sense and make use of this wonderful plugin!
by Antony Agnel
$status,
) );
}
add_filter( 'adblock_notify_by_bweb_logger_flag', 'an_check_logger' );
/**
* Return the logger status.
*
* @return bool Logger status.
*/
function an_check_logger() {
return ( get_option( 'an_logger_flag', 'no' ) == 'yes' ) ? true : false;
}
require AN_PATH . 'vendor/subscribe/subscribe.php';
$an_subscribe = new THEMEISLE_SUBSCRIBE( AN_ID );
// change subscribe list
add_filter( 'adblock_notify_themeisle_sdk_subscribe_list', 'an_change_subscribe_list' );
/**
* Change the subscribe list id.
*
* @return int The new list id.
*/
function an_change_subscribe_list() {
return 87;
}
// change default heading msg
add_filter( 'adblock_notify_themeisle_subscribe_heading', 'an_change_heading_subscribe' );
/**
* Change the default heading message.
*
* @return string The new heading msg.
*/
function an_change_heading_subscribe() {
return __( ' Subscribe for 20% coupon', 'an-translate' );
}
// change success subscribe message
add_filter( 'adblock_notify_themeisle_subscribed_msg', 'an_change_subscribe_success' );
/**
* Change the default success message.
*
* @return string The new success msg.
*/
function an_change_subscribe_success() {
return __( 'You can now check your email for the discount code.', 'an-translate' );
}
add_filter( 'adblock_notify_themeisle_subscribe_msg', 'an_change_subscribe_msg' );
/**
* Change the default success message.
*
* @return string The new success msg.
*/
function an_change_subscribe_msg() {
return __( 'Get a sweet 20% discount coupon right on your email for upgrading to the FULL version. ', 'an-translate' );
}
add_action( 'admin_init', 'an_flag_user' );
/**
* Marks the new user if he is before 2.1 or not
*/
function an_flag_user() {
$check = get_option( 'adblock_notify_new_user', '' );
if ( $check === '' ) {
if ( get_option( 'adblocker_notify_options' ) === false ) {
update_option( 'adblock_notify_new_user', 'yes' );
} else {
update_option( 'adblock_notify_new_user', 'no' );
}
}
}
/**
* Helper to see if the user is new or not.
*
* @return bool If the user is new or not.
*/
function an_is_new() {
return ( get_option( 'adblock_notify_new_user', 'yes' ) === 'yes' );
}
/**
* Helper to check if the user is using personal plan or not
*
* @return bool If he is using personal plan or not
*/
function an_is_personal() {
return defined( 'AN_PRO_VERSION' );
}
/**
* Helper to check if the user is using marketer plan or not
*
* @return bool If he is using marketer plan or not
*/
function an_is_marketer() {
if ( an_is_personal() ) {
$plan = apply_filters( 'an_pro_current_plan', '1' );
$plan = intval( $plan );
if ( $plan > 1 ) {
return true;
}
return false;
} else {
return false;
}
}
/**
* Helper to check if the user is using agency plan or not
*
* @return bool If he is using agency plan or not
*/
function an_is_agency() {
if ( an_is_marketer() ) {
$plan = apply_filters( 'an_pro_current_plan', '1' );
$plan = intval( $plan );
if ( $plan > 2 ) {
return true;
}
return false;
} else {
return false;
}
}
/**
* Returns the number of views used.
*
* @return int The current views
*/
function an_get_current_views() {
return intval( an_get_option( 'adblock_notify_global_counter' ) ) > an_get_limit() ? an_get_limit() : intval( intval( an_get_option( 'adblock_notify_global_counter' ) ) );
}
/**
* Return the user current limit.
*
* @return int The current limit.
*/
function an_get_limit() {
$limit = '5000';
if ( an_is_personal() ) {
$limit = '30000';
}
if ( an_is_marketer() ) {
$limit = '70000';
}
if ( an_is_agency() ) {
$limit = '250000';
}
return intval( $limit );
}
/**
* Return true if users reached the limit.
*
* @return bool State of the views.
*/
function an_check_views() {
return false;
if ( ! an_is_new() ) {
return false;
}
$limit = an_get_limit();
$current = an_get_current_views();
if ( $current === 0 ) {
an_update_option( 'adblock_notify_month_reset', time() );
} else {
$reset_time = an_get_option( 'adblock_notify_month_reset' );
if ( ( time() - $reset_time ) > ( 31 * 24 * 3600 ) ) {
$current = 0;
an_update_option( 'adblock_notify_global_counter', '0' );
an_update_option( 'adblock_notify_month_reset', time() );
}
}
if ( $limit <= $current ) {
return true;
}
return false;
}