'http://adblockingdetector.johnmorris.me/how-to-collect-javascript-console-output/',
// How This Plugin Works
'howitworks' => 'http://adblockingdetector.johnmorris.me/how-this-plugin-works/',
// Combining CSS and Ad Blocking Detector
'csstargeting' => 'http://adblockingdetector.johnmorris.me/combine-css-and-ad-blocking-detector/',
// Combining JS and Ad Blocking Detector
'jstargeting' => 'http://adblockingdetector.johnmorris.me/combine-javascript-and-ad-blocking-detector/',
// What is the Block List Countermeasure Plugin
'bccpluginintro' => 'http://adblockingdetector.johnmorris.me/what-is-the-block-list-countermeasure-plugin/',
// Using Ad Blocking Detector for the first time
'pluginintro' => 'http://adblockingdetector.johnmorris.me/using-ad-blocking-detector-for-the-first-time/',
// Create a simple ad shortcode
'simpleadintro' => 'http://adblockingdetector.johnmorris.me/how-to-display-a-simple-ad-using-alternative-content-shortcodes/',
// Intro to User Defined Wrapper CSS Selectors
'userdefinedwrappers' => 'http://adblockingdetector.johnmorris.me/detection-improvement-user-defined-wrapper-css-selectors/',
// Intro to Manual Block List Countermeasure Plugin Management
'manualpluginintro' => 'http://adblockingdetector.johnmorris.me/manual-block-list-countermeasure-plugin-installation-and-management/',
// HTML Creator
'htmlcreator' => 'http://www.html.am/html-editors/html-text-editor.cfm',
// Demo
'demo' => 'http://adblockingdetector.johnmorris.me/demo/',
///// WordPress.org Links
'wporgreviews' => 'https://wordpress.org/support/view/plugin-reviews/ad-blocking-detector',
'wporgsupport' => 'https://wordpress.org/support/plugin/ad-blocking-detector',
'wporglisting' => 'https://wordpress.org/plugins/ad-blocking-detector/description/',
/////// Dev Info
'emaildev' => 'mailto:johntylermorris@jtmorris.net?subject=Ad%20Blocking%20Detector%20Support',
'devemail' => 'mailto:johntylermorris@jtmorris.net?subject=Ad%20Blocking%20Detector%20Support',
'devwebsite' => 'http://cs.johnmorris.me',
/////// Plugin Website/Repo
'website' => 'http://adblockingdetector.johnmorris.me',
'github' => 'http://github.com/jtmorris/ad-blocking-detector',
////// Miscellaneous
// Tweet love of this plugin
'twitterlove' => 'http://twitter.com/home?status=I%20love%20the%20Ad%20Blocking%20Detector%20WordPress%20plugin%20by%20%40jt_morris!%20http://wordpress.org/plugins/ad-blocking-detector/'
);
public static function add_action_notices() {
$message_array = array(
// Generic messages
'generic_success' => array(
'msg' => ABD_L::__( 'Success!' ),
'class' => 'updated'
),
'generic_failure' => array(
'msg' => ABD_L::__( 'Failed!' ),
'class' => 'error'
),
// Create fallback messages
'create_bcc_success' => array(
'msg' => ABD_L::__( 'Block List Countermeasure plugin created successfully.' ),
'class' => 'updated'
),
'create_bcc_failure' => array(
'msg' => ABD_L::__( 'Block List Countermeasure creation failed.' ),
'class' => 'error'
),
// Rename fallback messages
'rename_bcc_success' => array(
'msg' => ABD_L::__( 'Block List Countermeasure renamed successfully.' ),
'class' => 'updated'
),
'rename_bcc_failure' => array(
'msg' => ABD_L::__( 'Block List Countermeasure renaming failed.' ),
'class' => 'error'
),
// Delete fallback messages
'delete_bcc_success' => array(
'msg' => ABD_L::__( 'Block List Countermeasure deleted successfully.' ),
'class' => 'updated'
),
'delete_bcc_failure' => array(
'msg' => ABD_L::__( 'Block List Countermeasure deletion failed.' ),
'class' => 'error'
),
// Clear log messages
'clear_log_success' => array(
'msg' => ABD_L::__( 'Session log cleared successfully.' ),
'class' => 'updated'
),
// Delete shortocde messages
'delete_shortcode_success' => array(
'msg' => ABD_L::__( 'Shortcode deleted successfully.' ),
'class' => 'updated'
),
'delete_shortcode_failure_no_id' => array(
'msg' => ABD_L::__( 'Shortcode deletion failed! Invalid shortocde ID given.' ),
'class' => 'error'
),
'delete_shortcode_failure_unknown' => array(
'msg' => ABD_L::__( 'Shortcode deletion failed!' ),
'class' => 'error'
),
// Send usage info message
'send_usage_info_success' => array(
'msg' => ABD_L::__( 'Usage info submitted. Thanks for helping improve Ad Blocking Detector!' ),
'class' => 'updated'
),
// Delete All Statistics Table Rows
'delete_all_stats_success' => array(
'msg' => ABD_L::__( 'Statistics table cleared successfully.' ),
'class' => 'updated'
)
);
if( array_key_exists( 'msg-code', $_GET ) &&
!empty( $_GET['msg-code'] ) &&
array_key_exists( $_GET['msg-code'], $message_array ) ) {
// Message exists and is supposed to be displayed
$class = $message_array[$_GET['msg-code']]['class'];
$msg = $message_array[$_GET['msg-code']]['msg'];
// Echo it
?>
ABD_L::__( 'Getting Started' ),
'display_description' => self::getting_started_tab_header(),
'url_slug' => 'getting-started',
'page' => 'ad-blocking-detector'
) );
$Existing_Shortcodes_Tab = new ABDWPSM_Tab( array(
'display_name' => ABD_L::__( 'Manage Shortcodes' ),
'display_description' => self::manage_shortcodes_tab_header(),
'url_slug' => 'manage-shortcodes',
'page' => 'ad-blocking-detector'
) );
$New_Shortcode_Tab = new ABDWPSM_Tab( array(
'display_name' => ABD_L::__( 'Add New Shortcode' ),
'display_description' => self::add_new_shortcode_tab_header(),
'url_slug' => 'new-shortcodes',
'page' => 'ad-blocking-detector'
) );
$NST_OG = new ABDWPSM_Options_Group( array(
'db_option_name' => ABD_Database::get_shortcode_prefix() . ABD_Database::get_next_id(),
'validation_callback' => array( 'ABD_Admin_Views', 'cache_handler_validator' )
) );
$NST_OG->add_to_tab( $New_Shortcode_Tab );
$NST_Basic_Section = new ABDWPSM_Section( array(
'id' => 'nst_og-basic_options',
'display_name' => ABD_L::__( 'Basic Shortcode Settings' ),
'display_description' => self::add_new_basic_section_header()
) );
$NST_Basic_Section->add_to_options_group( $NST_OG );
$NST_Basic_Fs = array();
// Basic Section
$NST_Basic_Fs[] = new ABDWPSM_Field( array(
'field_name' => 'display_name',
'type' => 'text',
'display_name' => ABD_L::__( 'Name / Description' ),
'display_description' => ABD_L::__( 'Give this shortcode an identifying name for readability.' ),
'example_entry' => ABD_L::__( 'Google AdSense Sidebar Ad' ),
'field_options_array' => array( 'required' => true )
) );
$NST_Basic_Fs[] = new ABDWPSM_Field( array(
'field_name' => 'noadblocker',
'type' => 'textarea',
'display_name' => ABD_L::__( 'No Ad Blocker Detected Content' ),
'display_description' => sprintf( ABD_L::_x( 'Optional. The content to display to users with no detected ad blocker. Supports plain text or HTML. If you aren\'t familiar with HTML, you can use %sthis tool%s to generate the needed HTML for you.', 'No Ad Blocker Detected field description.' ), '', '' )
) );
$NST_Basic_Fs[] = new ABDWPSM_Field( array(
'field_name' => 'adblocker',
'type' => 'textarea',
'display_name' => ABD_L::__( 'Ad Blocker Detected Content' ),
'display_description' => sprintf( ABD_L::_x( 'Optional. The content to display to users with a detected ad blocker. Supports plain text or HTML. If you aren\'t familiar with HTML, you can use %sthis tool%s to generate the needed HTML for you.', 'Ad Blocker Detected field description.' ), '', '' )
) );
$NST_Basic_Fs[] = new ABDWPSM_Field( array(
'field_name' => 'user_defined_selectors',
'type' => 'text',
'display_name' => ABD_L::__( 'User-Defined Wrapper CSS Selectors' ),
'display_description' => sprintf( ABD_L::__( 'Optional. Improve ad blocker detection results by specifying the wrapping element around your advertisement that is not removed by ad blockers. This is required to detect privacy browser extensions like Ghostery, but not required for most ad blocking extensions like AdBlock Plus. Separate multiple selectors using semicolons. %sRead this article%s for more information, detailed instructions, and examples.' ), '', '' ),
'example_entry' => 'ins.adsbygoogle; #myadwrapper'
) );
$NST_Basic_Fs[] = new ABDWPSM_Field( array(
'field_name' => 'blog_id',
'type' => 'hidden',
'field_options_array' => array( 'default' => ABD_Multisite::get_current_blog_id() )
) );
foreach( $NST_Basic_Fs as $F ) {
$F->add_to_section( $NST_Basic_Section );
}
// Free memory
unset( $NST_Basic_Fs );
unset( $NST_Basic_Section );
unset( $NST_OG );
unset( $New_Shortcode_Tab );
$Settings_Tab = new ABDWPSM_Tab( array(
'display_name' => ABD_L::__( 'Advanced Settings' ),
'display_description' => self::settings_tab_header(),
'url_slug' => 'settings',
'page' => 'ad-blocking-detector'
) );
$AS_OG = new ABDWPSM_Options_Group( array(
'db_option_name' => 'abd_user_settings'
) );
$AS_OG->add_to_tab( $Settings_Tab );
$AS_UDS_Section = new ABDWPSM_Section( array(
'id' => 'as_uds-user_defined_selectors',
'display_name' => ABD_L::__( 'Improved Detection: User-Defined Wrapper CSS Selectors' ),
'display_description' => self::settings_user_defined_selectors_section_header()
) );
$AS_UDS_Section->add_to_options_group( $AS_OG );
$AS_UDS_Field = new ABDWPSM_Field( array(
'field_name' => 'user_defined_selectors',
'type' => 'text',
'display_name' => ABD_L::__( 'Global CSS Selectors' ),
'display_description' => ABD_L::__( 'A list of CSS selectors for the wrapping elements. Separate multiple selectors with semicolons.' ),
'example_entry' => 'ins.adsbygoogle; #myawesomeadserverwrapper',
'field_options_array' => array(
'default' => '',
'style' => 'min-width: 350px'
)
) );
$AS_UDS_Field->add_to_section( $AS_UDS_Section );
$AS_Disable_Section = new ABDWPSM_Section( array(
'id' => 'as_uds-disable_detection_methods',
'display_name' => ABD_L::__( 'Performance Improvement: Disable Detection Methods' ),
'display_description' => self::settings_disable_detection_method_section_header()
) );
$AS_Disable_Section->add_to_options_group( $AS_OG );
$AS_Disable_Iframe_Field = new ABDWPSM_Field( array(
'field_name' => 'enable_iframe',
'type' => 'radio',
'display_name' => ABD_L::__( 'Iframe Detection Method' ),
'field_options_array' => array(
'choices' => array( 'Enabled'=>'yes', 'Disabled'=>'no' ),
'default' => 'yes'
)
) );
$AS_Disable_Iframe_Field->add_to_section( $AS_Disable_Section );
$AS_Disable_Div_Field = new ABDWPSM_Field( array(
'field_name' => 'enable_div',
'type' => 'radio',
'display_name' => ABD_L::__( 'Div Element Detection Method' ),
'field_options_array' => array(
'choices' => array( 'Enabled'=>'yes', 'Disabled'=>'no' ),
'default' => 'yes'
)
) );
$AS_Disable_Div_Field->add_to_section( $AS_Disable_Section );
$AS_Disable_JS_Field = new ABDWPSM_Field( array(
'field_name' => 'enable_js_file',
'type' => 'radio',
'display_name' => ABD_L::__( 'JavaScript File Detection Method' ),
'field_options_array' => array(
'choices' => array( 'Enabled'=>'yes', 'Disabled'=>'no' ),
'default' => 'yes'
)
) );
$AS_Disable_JS_Field->add_to_section( $AS_Disable_Section );
$AS_Iframe_Section = new ABDWPSM_Section( array(
'id' => 'as_uds-customize_iframe',
'display_name' => ABD_L::__( 'Customize Iframe Detection Method' ),
'display_description' => self::settings_customize_iframe_section_header()
) );
$AS_Iframe_Section->add_to_options_group( $AS_OG );
$domain = substr(md5(rand(0, 1000000)), 0, 7);
$AS_Iframe_URL = new ABDWPSM_Field( array(
'field_name' => 'iframe_url',
'type' => 'text',
'display_name' => ABD_L::__( 'URL of Iframe' ),
'display_description' => ABD_L::__( 'The bait iframe\'s URL. This should contain ad or advertisement keywords. I recommend a URL that doesn\'t exist to keep loading times down. Leave empty to allow an automatic URL choice.' ),
'example_entry' => 'http://' . $domain . '-ad.us/adserver/adlogger_tracker.php',
'field_options_array' => array(
'default' => '',
'style' => 'width: 50%; max-width: 500px; min-width: 170px;'
)
) );
$AS_Iframe_URL->add_to_section( $AS_Iframe_Section );
$AS_Stats_Section = new ABDWPSM_Section( array(
'id' => 'as_uds-stats_management',
'display_name' => ABD_L::__( 'Statistics Collection Options' ),
'display_description' => ABD_L::__( 'This plugin can collect basic statistics on how many of your visitors utilize ad blockers. The statistics collection behavior can be modified below.' )
) );
$AS_Stats_Section->add_to_options_group( $AS_OG );
$AS_Stats_enable_statistics = new ABDWPSM_Field( array(
'field_name' => 'enable_statistics',
'type' => 'radio',
'display_name' => ABD_L::__( 'Enable Statistics Collection' ),
'display_description' => ABD_L::__( 'Whether to enable ad blocker detection statistics. Statistics results are viewable in the "Statistics" tab at the top of this page.' ),
'field_options_array' => array(
'choices' => array( 'Enabled'=>'yes', 'Disbaled'=>'no' ),
'default' => 'yes'
)
) );
$AS_Stats_ignore_ips = new ABDWPSM_Field( array(
'field_name' => 'stats_ignore_ips',
'type' => 'textarea',
'display_name' => ABD_L::__( 'Ignored IP Addresses' ),
'display_description' => ABD_L::__( 'List of IP addresses for which statistics will not be collected. CIDR netmask ranges are acceptable. One IP address, or CIDR netmask, per line. Your detected IP address is: ' ) . $_SERVER['REMOTE_ADDR'],
'example_entry' => '
' . $_SERVER['REMOTE_ADDR'] . '
192.168.0.0/16'
) );
$AS_Stats_ignore_registered = new ABDWPSM_Field( array(
'field_name' => 'stats_ignore_registered',
'type' => 'radio',
'display_name' => ABD_L::__( 'Ignore Logged In Users' ),
'display_description' => ABD_L::__( 'If enabled, statistics will not be collected for logged in users.' ),
'field_options_array' => array(
'choices' => array( 'Enabled'=>'yes', 'Disbaled'=>'no' ),
'default' => 'no'
)
) );
$AS_Stats_enable_statistics->add_to_section( $AS_Stats_Section );
$AS_Stats_ignore_ips->add_to_section( $AS_Stats_Section );
$AS_Stats_ignore_registered->add_to_section( $AS_Stats_Section );
$AS_Log_Section = new ABDWPSM_Section( array(
'id' => 'as_uds-log_management',
'display_name' => ABD_L::__( 'Log Options' ),
'display_description' => self::settings_customize_log_section_header()
) );
$AS_Log_Section->add_to_options_group( $AS_OG );
$AS_Log_enable_all = new ABDWPSM_Field( array(
'field_name' => 'enable_logging',
'type' => 'radio',
'display_name' => ABD_L::__( 'Allow Logging' ),
'display_description' => ABD_L::__( 'Whether to log any events in the "Session Log." If this is disabled, no logging will occur.' ),
'field_options_array' => array(
'choices' => array( 'Enabled'=>'yes', 'Disbaled'=>'no' ),
'default' => 'yes'
)
) );
$AS_Log_enable_info = new ABDWPSM_Field( array(
'field_name' => 'enable_info_logging',
'type' => 'radio',
'display_name' => ABD_L::__( 'Information Logging' ),
'display_description' => ABD_L::__( 'Whether to log noteworthy plugin actions in the "Session Log." Most Ad Blocking Detector Dashboard activities generates one or more of these log entries. Disabling this will improve plugin performance, but will drastically reduce the effectiveness of logging.' ),
'field_options_array' => array(
'choices' => array( 'Enabled'=>'yes', 'Disbaled'=>'no' ),
'default' => 'yes'
)
) );
$AS_Log_enable_debug = new ABDWPSM_Field( array(
'field_name' => 'enable_debug_logging',
'type' => 'radio',
'display_name' => ABD_L::__( 'Debugging Data Logging' ),
'display_description' => ABD_L::__( 'Whether to log debugging data in the "Session Log." These entries are rarely generated outside of plugin updates and activation. They often accompany error log entries with contextual information. It is recommended to match this with error logging. If error logging is on, debug logging should also be on.' ),
'field_options_array' => array(
'choices' => array( 'Enabled'=>'yes', 'Disbaled'=>'no' ),
'default' => 'yes'
)
) );
$AS_Log_enable_error = new ABDWPSM_Field( array(
'field_name' => 'enable_error_logging',
'type' => 'radio',
'display_name' => ABD_L::__( 'Error Report Logging' ),
'display_description' => ABD_L::__( 'Whether to log encountered errors in the "Session Log." These are very rarely generated outside of plugin updates and activation.' ),
'field_options_array' => array(
'choices' => array( 'Enabled'=>'yes', 'Disbaled'=>'no' ),
'default' => 'yes'
)
) );
$AS_Log_enable_perf = new ABDWPSM_Field( array(
'field_name' => 'enable_perf_logging',
'type' => 'radio',
'display_name' => ABD_L::__( 'Performance Statistics Logging' ),
'display_description' => ABD_L::__( 'Whether to record execution times and memory usage in the Session Log. This helps tracking down performance related plugin bugs, but generates a lot of log entries and generates significant database traffic.' ),
'field_options_array' => array(
'choices' => array( 'Enabled'=>'yes', 'Disabled'=>'no' ),
'default' => 'yes'
)
) );
$AS_Log_perf_filtering = new ABDWPSM_Field( array(
'field_name' => 'perf_logging_only_above_limits',
'type' => 'radio',
'display_name' => ABD_L::__( 'Filter Performance Summary Log Entries' ),
'display_description' => ABD_L::__( 'Whether to limit performance log entries to those exceeding the time and memory limits.' ),
'field_options_array' => array(
'choices' => array( 'Enabled'=>'yes', 'Disabled'=>'no' ),
'default' => 'yes'
)
) );
$AS_Log_perf_time_limit = new ABDWPSM_Field( array(
'field_name' => 'perf_logging_time_limit',
'type' => 'number',
'display_name' => ABD_L::__( 'Peformance Summary Log Entry Time Limit' ),
'display_description' => ABD_L::__( 'The time threshold, in milliseconds, at which log entries are highlighted and cut off if performance entry filtration is enabled.' ),
'field_options_array' => array(
'default' => 100
)
) );
$AS_Log_perf_mem_limit = new ABDWPSM_Field( array(
'field_name' => 'perf_logging_mem_limit',
'type' => 'number',
'display_name' => ABD_L::__( 'Peformance Summary Log Entry Memory Limit' ),
'display_description' => ABD_L::__( 'The used memory threshold, in bytes, at which log entries are highlighted and cut off if performance entry filtration is enabled.' ),
'field_options_array' => array(
'default' => 1048576
)
) );
$AS_Log_enable_all->add_to_section( $AS_Log_Section );
$AS_Log_enable_info->add_to_section( $AS_Log_Section );
$AS_Log_enable_debug->add_to_section( $AS_Log_Section );
$AS_Log_enable_error->add_to_section( $AS_Log_Section );
$AS_Log_enable_perf->add_to_section( $AS_Log_Section );
$AS_Log_perf_filtering->add_to_section( $AS_Log_Section );
$AS_Log_perf_time_limit->add_to_section( $AS_Log_Section );
$AS_Log_perf_mem_limit->add_to_section( $AS_Log_Section );
// Free memory
unset( $AS_Log_enable_all );
unset( $AS_Log_enable_info );
unset( $AS_Log_enable_debug );
unset( $AS_Log_enable_error );
unset( $AS_Log_enable_perf );
unset( $AS_Log_perf_filtering );
unset( $AS_Log_perf_time_limit );
unset( $AS_Log_perf_mem_limit );
unset( $AS_Log_Section );
unset( $AS_Iframe_URL );
unset( $AS_Iframe_Section );
unset( $AS_Disable_Iframe_Field );
unset( $AS_Disable_Div_Field );
unset( $AS_Disable_JS_Field );
unset( $AS_Disable_Section );
unset( $AS_UDS_Field );
unset( $AS_UDS_Section );
unset( $AS_OG );
unset( $Settings_Tab );
$stats_enabled = ABD_Database::get_specific_setting( 'enable_statistics' );
if( $stats_enabled != 'no' ) {
new ABDWPSM_Tab( array(
'display_name' => ABD_L::__( 'Statistics' ),
'display_description' => self::statistics_tab_header(),
'url_slug' => 'statistics',
'page' => 'ad-blocking-detector'
) );
}
new ABDWPSM_Tab( array(
'display_name' => ABD_L::__( 'Report a Problem / Debug' ),
'display_description' => self::debug_tab_header(),
'url_slug' => 'debug',
'page' => 'ad-blocking-detector'
) );
// Force cleanup before we move to populating existing shortcodes
ABD_Perf_Tools::force_garbage_collection();
ABD_Log::perf_summary( 'ABD_Database::wpsm_settings() // fields', $time_bt, $mem_bt, true );
// Performance log
ABD_Log::perf_summary( 'ABD_Database::wpsm_settings() // before ogize_existing_shortcodes()', $start_time, $start_mem );
// Deal with Existing Shortcodes Tab which is all programmatic, not hard coded
self::ogize_existing_shortcodes( $Existing_Shortcodes_Tab );
// Performance log
ABD_Log::perf_summary( 'ABD_Database::wpsm_settings()', $start_time, $start_mem );
}
protected static function ogize_existing_shortcodes( &$The_Tab_To_Add_To ) {
// Collect start state for performance logging
$start_time = microtime( true );
$start_mem = memory_get_usage( true );
$enabled_text = ABD_L::__( 'Enabled (default)' );
$disabled_text = ABD_L::__( 'Disabled' );
$choices_array = array();
$choices_array[$enabled_text] = 'enabled';
$choices_array[$disabled_text] = 'disabled';
// This site's shortcodes
$scs = ABD_Database::get_all_shortcodes(); // All shortcodes stored in DB for this site
if( !is_array( $scs ) ) { $scs = array(); }
if( !empty( $scs) ) {
foreach( $scs as $sc_id => $sc ) {
// Determine if we'll be disabling everything because shortcode is readonly
if( ABD_Database::array_value( 'readonly', $sc ) == true ) {
$readonly = true;
}
else {
$readonly = false;
}
$OG = new ABDWPSM_Options_Group( array(
'db_option_name' => ABD_Database::get_shortcode_prefix() . $sc_id,
'validation_callback' => array( 'ABD_Admin_Views', 'cache_handler_validator' ),
'section_object_array' => array(
new ABDWPSM_Section( array(
'id' => 'shortcode_section_' . $sc_id,
'display_name' => ABD_Database::array_value( 'display_name', $sc ),
'display_description'=> self::manage_shortcodes_shortcode_section_header( $sc_id, $readonly ),
'field_object_array' => array(
new ABDWPSM_Field( array(
'field_name' => 'display_name',
'type' => 'text',
'display_name' => ABD_L::__( 'Name / Description' ),
'display_description' => ABD_L::_x( 'Give this shortcode an identifying name for readability.', 'Display Name field description.' ),
'example_entry' => ABD_L::_x('Google AdSense Sidebar Ad', 'Display Name field example entry.'),
'field_options_array' => array( 'required' => true, 'default' => ABD_Database::array_value( 'display_name', $sc ), 'readonly' => $readonly, 'disabled' => $readonly )
) ),
new ABDWPSM_Field( array(
'field_name' => 'noadblocker',
'type' => 'textarea',
'display_name' => ABD_L::__( 'No Ad Blocker Detected Content' ),
'display_description' => sprintf( ABD_L::_x( 'Optional. The content to display to users with no detected ad blocker. Supports plain text or HTML. If you aren\'t familiar with HTML, you can use %sthis tool%s to generate the needed HTML for you.', 'No Ad Blocker Detected field description.' ), '', '' ),
'field_options_array' => array( 'default' => ABD_Database::array_value( 'noadblocker', $sc ), 'readonly' => $readonly, 'disabled' => $readonly )
) ),
new ABDWPSM_Field( array(
'field_name' => 'adblocker',
'type' => 'textarea',
'display_name' => ABD_L::__( 'Ad Blocker Detected Content' ),
'display_description' => sprintf( ABD_L::_x( 'Optional. The content to display to users with a detected ad blocker. Supports plain text or HTML. If you aren\'t familiar with HTML, you can use %sthis tool%s to generate the needed HTML for you.', 'Ad Blocker Detected field description.' ), '', '' ),
'field_options_array' => array( 'default' => ABD_Database::array_value( 'adblocker', $sc ), 'readonly' => $readonly, 'disabled' => $readonly )
) ),
new ABDWPSM_Field( array(
'field_name' => 'user_defined_selectors',
'type' => 'text',
'display_name' => ABD_L::__( 'User-Defined Wrapper CSS Selectors' ),
'display_description' => sprintf( ABD_L::__( 'Optional. Improve ad blocker detection results by specifying the wrapping element around your advertisement that is not removed by ad blockers. This is required to detect privacy browser extensions like Ghostery, but not required for most ad blocking extensions like AdBlock Plus. Separate multiple selectors using semicolons. %sRead this article%s for more information, detailed instructions, and examples.' ), '', '' ),
'example_entry' => 'ins.adsbygoogle; #myadwrapper',
'field_options_array' => array( 'default' => ABD_Database::array_value( 'user_defined_selectors', $sc ), 'readonly' => $readonly, 'disabled' => $readonly )
) ),
new ABDWPSM_Field( array(
'field_name' => 'blog_id',
'type' => 'hidden',
'field_options_array' => array( 'default' => ABD_Database::array_value( 'blog_id', $sc ), 'readonly' => $readonly, 'disabled' => $readonly )
) )
) // end 'field_object_array'
) ) // end new ABDWPSM_Section
) // end 'section_object_array'
) ); // end new ABDWPSM_Options_Group
$OG->add_to_tab( $The_Tab_To_Add_To );
} // end foreach(...
} // end if( is_array( $scs ) )
else {
// No shortcodes in array.
$The_Tab_To_Add_To->set_display_description( '
' . ABD_L::__( 'No shortcodes yet! Click the "Add New Shortcode" tab above to create your first one.' ) . '
' );
}
// Performance log
ABD_Log::perf_summary( 'ABD_Database::ogize_existing_shortcodes()', $start_time, $start_mem );
} // end ogize_existing_shortcodes
protected static function getting_started_tab_header() {
ob_start();
?>
ABD_Anti_Adblock::bcc_plugin_status( 'auto_plugin_activated' ),
'manual_plugin_activated' => ABD_Anti_Adblock::bcc_plugin_status( 'manual_plugin_activated' ),
'auto_plugin_exists' => ABD_Anti_Adblock::bcc_plugin_status( 'auto_plugin_exists' ),
'manual_plugin_exists' => ABD_Anti_Adblock::bcc_plugin_status( 'manual_plugin_exists' ),
'plugin_activated' => ABD_Anti_Adblock::bcc_plugin_status( 'plugin_activated' ),
'plugin_exists' => ABD_Anti_Adblock::bcc_plugin_status( 'plugin_exists' )
);
ABD_Log::perf_summary( 'ABD_Admin_Views::getting_started_tab_content // before $blcp_status = ABD_Anti_Adblock::bcc_plugin_status();', $bfs_time, $bfs_mem, true );
ob_start();
?>
- >
0 ) {
$class = 'class="abd_success_message"';
}
else {
$class = 'class="abd_failure_message"';
}
?>
- >
', '' ); ?>
-
Manually copy and paste the shortcode. Visit the "Manage Shortcodes" tab and click the "Get This Shortcode" button. You then copy and paste the shortcode anywhere WordPress supports them, such as posts.' ), array( 'strong' => array(), 'em' => array() ) ); ?>
-
Use this plugin\'s widget. Visit the "Widgets" page of your WordPress dashboard, and drag the Ad Blocking Detector widget to your desired widgets area. In the dropdown menu for the widget, choose the shortcode you wish to display.' ), array( 'strong' => array(), 'em' => array() ) ); ?>
-
Code the shortcode into your theme. Follow the same steps as above to manually copy your shortcode. Then, at the desired location in your theme, use WordPress\' do_shortcode() function. ' ), array( 'strong' => array(), 'em' => array() ) ); ?>
<?php echo do_shortcode('[adblockingdetector id="1234567"]'); ?>
-
WordPress.org listing.' ),
array(
'a' => array(
'href' => array(),
'target' => array()
)
)
), // end wp_kses
esc_url( $link )
); // end sprintf
?>
-
Share your thoughts on Twitter and other social media sites.' ),
array(
'a' => array(
'href' => array(),
'target' => array()
)
)
), // end wp_kses
esc_url( $link )
); // end sprintf
?>
-
GitHub.' ),
array(
'a' => array(
'href' => array(),
'target' => array()
)
)
), // end wp_kses
esc_url( $link )
); // end sprintf
?>
', '' ); ?>
base_prefix; // Used for some Support Request Notes
ob_start();
?>
- scared-carpenter-manual.zip
:
ABD_Anti_Adblock::bcc_plugin_status( 'auto_plugin_activated' ),
'manual_plugin_activated' => ABD_Anti_Adblock::bcc_plugin_status( 'manual_plugin_activated' ),
'auto_plugin_exists' => ABD_Anti_Adblock::bcc_plugin_status( 'auto_plugin_exists' ),
'manual_plugin_exists' => ABD_Anti_Adblock::bcc_plugin_status( 'manual_plugin_exists' ),
'plugin_activated' => ABD_Anti_Adblock::bcc_plugin_status( 'plugin_activated' ),
'plugin_exists' => ABD_Anti_Adblock::bcc_plugin_status( 'plugin_exists' )
);
ob_start();
?>
-
:
-
0 ) {
$class = 'abd_success_message';
}
else if ( ABD_Anti_Adblock::check_plugin_dir() < 0 ) {
$class = 'abd_unknown_message';
}
else {
$class = 'abd_failure_message';
}
?>
-
0 ) {
$class = 'abd_success_message';
}
else if ( ABD_Anti_Adblock::check_safe_mode() < 0 ) {
$class = 'abd_unknown_message';
}
else {
$class = 'abd_failure_message';
}
?>
-
0 ) {
$class = 'abd_success_message';
}
else if ( ABD_Anti_Adblock::check_mkdir() < 0 ) {
$class = 'abd_unknown_message';
}
else {
$class = 'abd_failure_message';
}
?>
-
0 ) {
$class = 'abd_success_message';
}
else if ( ABD_Anti_Adblock::check_php_version() < 0 ) {
$class = 'abd_unknown_message';
}
else {
$class = 'abd_failure_message';
}
?>
-
:
-
-
Ad Blocking Detector - Block List Countermeasure' ); ?>
adsbygoogle. If the ad is not blocked, this wrapper is filled with content. If the ad is blocked, this wrapper is empty. Click on the pictures below to expand them and see this in action.' ); ?>
ins.adsbygoogle. This selector should then be fed into the textbox below.' ); ?>
get_db_option_name();
update_option( 'abd_list_of_shortcodes', $scs );
ABD_Log::info( 'Adding ' . $OG->get_db_option_name() . ' to list of shortcodes.' );
// Run normal automatic validation and return results
return $OG->default_validation_function( $input );
}
protected static function dev_sig() {
ob_start();
?>
John Morris
============
WordPress Plugin Developer
john@johnmorris.me |
ABD_L::__( 'Copy and paste your shortcode...' ),
'copyShortcodeInstructions' => ABD_L::__( 'Copy the text in the box below to your clipboard, then paste it into your content. Alternatively, use this plugin\'s sidebar widget.' ),
'close' => ABD_L::__( 'Close' ),
'nevermind' => ABD_L::__( 'No! Take me back.' ),
'affirmative' => ABD_L::__( 'Yes! I\'m sure.' ),
'wait' => ABD_L::__( 'Please wait, this may take some time.' ),
'deleteDialogTitle' => ABD_L::__( 'Are you sure?' ),
'deleteDialogWarning' => ABD_L::__( 'A deleted shortcode can not be recovered!' ),
'updateManualPluginDownloadWarning' => sprintf( ABD_L::__( 'Before installing this updated plugin, delete the old version! Go to your installed plugins list, deactivate %s, then delete it.' ), ABD_L::__( 'Ad Blocking Detector - Block List Countermeasure' ) ),
'updateManualPluginDownloadTitle' => ABD_L::__( 'WARNING: Delete the old version before installing!' ),
'downloadManualPluginWarning' => sprintf( ABD_L::__( 'The manual plugin ZIP file is downloading now. More detailed instructions for installing this plugin are %savailable on the plugin\'s website%s. If automatic plugin management is an option, I highly encourage you to utilize it. Manual management will require you to reinstall the plugin from time to time, and without careful management, subtle problems can occur.' ), '', '' ),
'downloadManualPluginTitle' => ABD_L::__( 'Beyond these hills there be dragons!' ),
'idlingForceRefreshWarning' => ABD_L::__( 'To function properly, this page reserves database names and space on loading. However, if the page idles for an extended period, that reservation is released and a lot of errors and problems will result unless you refresh this page. It appears this page has sat for too long and needs a refresh. Upon closing this dialog, the page should automatically reload. If it does not, reload this page before submitting a shortcode.' ),
'idlingForceRefreshTitle' => ABD_L::__( 'This page has been idling too long!' ),
'submitLogToDevWarning' => ABD_L::__( 'Ad Blocking Detector is about to send the contents of the Session Log and Plugin, WordPress, and Server Configuration Data boxes to the developer. If you wish to check the contents before sending, close this dialog box, and review the content in the appropriate boxes. No contact information is submitted with the log entries, so you will not be responded to. If you require or desire feedback, you will need to contact the developer personally as well.' ),
'submitLogToDevTitle' => ABD_L::__( 'Are you sure?' ),
'resetStatisticsTitle' => ABD_L::__( 'Are you sure?' ),
'resetStatisticsWarning' => ABD_L::__( 'This will delete all recorded statistical information, and can not be undone!' )
);
return $jsarr;
}
public static function plugin_update_news() {
ob_start();
?>