Commit inicial - WordPress Análisis de Precios Unitarios

- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,150 @@
<?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
/**
* Admin functionality for the adblocker module.
*
* @package AdvancedAds\Pro
* @author Advanced Ads <info@wpadvancedads.com>
*/
use AdvancedAds\Utilities\Conditional;
/**
* Class definition.
*/
class Advanced_Ads_Pro_Module_Extended_Adblocker_Admin {
/**
* Setting options
*
* @var array
*/
private $options = [];
/**
* Constructor
*
* @return void
*/
public function __construct() {
add_action( 'advanced-ads-settings-init', [ $this, 'settings_init' ], 9 );
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_admin_scripts' ] );
}
/**
* Initializes the settings for the adblocker module.
*
* @return void
*/
public function settings_init(): void {
$this->options = Advanced_Ads::get_instance()->get_adblocker_options();
add_settings_section(
'advanced_ads_adblocker_extended_setting_section',
'',
null,
ADVADS_SETTINGS_ADBLOCKER
);
add_settings_field(
'extended_ab',
__( 'Ad blocker countermeasures', 'advanced-ads-pro' ),
[ $this, 'render_settings_activate_extended' ],
ADVADS_SETTINGS_ADBLOCKER,
'advanced_ads_adblocker_extended_setting_section'
);
}
/**
* Enqueue admin scripts.
*
* @return void
*/
public function enqueue_admin_scripts(): void {
if ( ! Conditional::is_screen_advanced_ads() ) {
return;
}
$screen = get_current_screen();
if ( ! isset( $screen->id ) || 'advanced-ads_page_advanced-ads-settings' !== $screen->id ) {
return;
}
$admin_js = plugin_dir_url( __FILE__ ) . ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG
? 'assets/js/admin.js'
: 'assets/js/admin.min.js' );
wp_enqueue_script( 'eab-admin', $admin_js, [ 'jquery' ], AAP_VERSION, true );
}
/**
* Render 'adblocker checkbox'
*
* @return void
*/
public function render_settings_activate_extended(): void {
$method = empty( $this->options['method'] ) ? 'nothing' : $this->options['method'];
$redirect_url = $this->options['redirect']['url'] ?? '';
$abf_enabled = $this->options['use-adblocker'] ?? null;
include_once __DIR__ . '/views/setting-activate-extended.php';
}
/**
* Render content box
*
* @return void
*/
public function render_settings_overlay_content(): void {
$content = $this->options['overlay']['content'] ?? '';
$args = [
'textarea_name' => esc_attr( ADVADS_SETTINGS_ADBLOCKER ) . '[overlay][content]',
'textarea_rows' => 16,
'drag_drop_upload' => true,
];
include_once __DIR__ . '/views/setting-overlay-content.php';
}
/**
* Render 'overlay again and dismiss button'
*
* @return void
*/
public function render_settings_dismissible(): void {
$hide_checked = $this->options['overlay']['hide_dismiss'] ?? 0;
$button_text = $this->options['overlay']['dismiss_text'] ?? '';
$option_time_freq = 'time_frequency';
$time_freq = $this->options['overlay'][ $option_time_freq ] ?? 'everytime';
$option_dismiss_style = 'dismiss_style';
$dismiss_style = $this->options['overlay'][ $option_dismiss_style ] ?? '';
include_once __DIR__ . '/views/setting-dismissible.php';
}
/**
* Render 'styling for dismiss button, container, background'
*
* @return void
*/
public function render_settings_styling(): void {
$option_container = 'container_style';
$option_background = 'background_style';
$container_style = $this->options['overlay'][ $option_container ] ?? '';
$background_style = $this->options['overlay'][ $option_background ] ?? '';
include_once __DIR__ . '/views/setting-styling.php';
}
/**
* Render 'exclude settings'
*
* @return void
*/
public function render_settings_exclude(): void {
global $wp_roles;
$roles = $wp_roles->get_names();
$option_exclude = 'exclude';
$exclude = isset( $this->options[ $option_exclude ] ) ? Advanced_Ads_Utils::maybe_translate_cap_to_role( $this->options[ $option_exclude ] ) : [];
include_once __DIR__ . '/views/setting-exclude.php';
}
}

View File

@@ -0,0 +1,8 @@
<?php
/**
* Initialize class.
*
* @package AdvancedAds\Pro
*/
new Advanced_Ads_Pro_Module_Extended_Adblocker_Admin();

View File

@@ -0,0 +1,95 @@
.advads-modal {
display: none;
position: fixed;
z-index: -1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(34, 34, 34, 0.4);
opacity: 0;
pointer-events: none;
-webkit-transition: opacity 400ms ease-in;
-moz-transition: opacity 400ms ease-in;
transition: opacity 400ms ease-in;
}
.advads-modal:target,
.advads-modal[open] {
display: flex;
align-items: center;
opacity: 1;
pointer-events: auto;
z-index: 9999;
}
dialog.advads-modal {
padding: 0;
border: 0;
margin: 0;
max-width: 100vw;
max-height: 100vh;
}
.advads-modal-content {
background-color: #fff;
border: 3px solid #20802d;
border-radius: 10px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
box-sizing: border-box;
margin: calc(5vh + var(--wp-admin--admin-bar--height, 0px)) auto 5vh;
width: 50em;
max-width: 50em;
max-height: calc(90vh - var(--wp-admin--admin-bar--height, 0px));
height: auto;
animation-name: advads-modal-animatetop;
animation-duration: 0.4s;
position: relative;
padding: 40px;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.advads-modal-body {
padding: 16px 16px;
}
.close-wrapper {
display: flex;
justify-content: center;
margin: 1em 0;
}
button.advads-modal-close-action {
padding: 10px 20px;
border-radius: 3px;
font-weight: bold;
text-decoration: none;
cursor: pointer;
outline: inherit;
color: #fff;
border: 1px solid #0474a2;
margin: auto 40px;
background-color: #20802d;
}
@keyframes advads-modal-animatetop {
from {
top: -300px;
opacity: 0
}
to {
top: 0;
opacity: 1
}
}
.advads-ui-autocomplete.ui-front {
z-index: 10000;
}
@media (min-width: 60em) {
.advads-modal-content {
margin: 5% auto;
}
}

View File

@@ -0,0 +1,40 @@
(function ($) {
const overlayNotice = $('.advads-eab-overlay-notice');
const divOverlay = $('#advanced-ads-adblocker-overlay-options');
const divRedirect = $('#advanced-ads-adblocker-redirect-options');
const divExclude = $('#advanced-ads-adblocker-option-exclude');
const adblockerFixEnabled = $('#advanced-ads-use-adblocker').prop(
'checked'
);
$('.advanced-ads-adblocker-eab-method').on('change', function () {
overlayNotice.hide();
switch (this.value) {
case 'nothing':
divOverlay.hide();
divRedirect.hide();
divExclude.hide();
break;
case 'overlay':
divOverlay.show();
divRedirect.hide();
divExclude.show();
// eslint-disable-next-line no-unused-expressions
!adblockerFixEnabled && overlayNotice.show();
break;
case 'redirect':
divOverlay.hide();
divRedirect.show();
divExclude.show();
break;
}
});
const dismissButton = $('#advanced-ads-adblocker-dismiss-button-input');
dismissButton.on('change', function () {
$('#advanced-ads-adblocker-dismiss-options').toggle(!this.checked);
});
dismissButton.change();
})(jQuery);

View File

@@ -0,0 +1 @@
!function(e){const a=e(".advads-eab-overlay-notice"),d=e("#advanced-ads-adblocker-overlay-options"),o=e("#advanced-ads-adblocker-redirect-options"),c=e("#advanced-ads-adblocker-option-exclude"),s=e("#advanced-ads-use-adblocker").prop("checked");e(".advanced-ads-adblocker-eab-method").on("change",(function(){switch(a.hide(),this.value){case"nothing":d.hide(),o.hide(),c.hide();break;case"overlay":d.show(),o.hide(),c.show(),!s&&a.show();break;case"redirect":d.hide(),o.show(),c.show()}}));const n=e("#advanced-ads-adblocker-dismiss-button-input");n.on("change",(function(){e("#advanced-ads-adblocker-dismiss-options").toggle(!this.checked)})),n.change()}(jQuery);

View File

@@ -0,0 +1,240 @@
<?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
use AdvancedAds\Modal;
use AdvancedAds\Framework\Utilities\Params;
/**
* Adblocker
*/
class Advanced_Ads_Pro_Module_Extended_Adblocker {
/**
* Setting options
*
* @var array
*/
private $options = [];
/**
* Overlay time frequency
*
* @var string
*/
private $show_frequency;
/**
* Overlay last displayed: cookie name
*
* @var string
*/
private const COOKIE_NAME = AA_PRO_SLUG . '-overlay-last-display';
/**
* Constructor
*
* @return void
*/
public function __construct() {
$this->options = Advanced_Ads::get_instance()->get_adblocker_options();
$this->show_frequency = $this->options['overlay']['time_frequency'] ?? 'everytime';
$this->options['method'] = $this->options['method'] ?? 'nothing';
add_action( 'init', [ $this, 'print_extended_adblocker' ], 99 );
}
/**
* Print the appropriate code on frontend.
*
* @return void
*/
public function print_extended_adblocker(): void {
if ( ! $this->prechecks() ) {
return;
}
$method_name = '';
if ( 'overlay' === $this->options['method'] ) {
wp_enqueue_style( 'eab-modal', plugin_dir_url( __FILE__ ) . 'assets/css/modal.css', [], AAP_VERSION );
if ( $this->should_show_overlay() ) {
$this->set_last_display_time();
$method_name = 'print_overlay';
}
} elseif ( 'redirect' === $this->options['method'] ) {
$method_name = 'print_redirect';
}
if ( method_exists( $this, $method_name ) ) {
add_action( 'wp_footer', [ $this, $method_name ], 99 );
}
}
/**
* Overlay logic
*
* @return void
*/
public function print_overlay(): void {
$button_text = null;
// Show dismiss only when hide button is unchecked.
if ( ! isset( $this->options['overlay']['hide_dismiss'] ) ) {
$button_text = __( 'Dismiss', 'advanced-ads-pro' );
if ( isset( $this->options['overlay']['dismiss_text'] ) && '' !== $this->options['overlay']['dismiss_text'] ) {
$button_text = $this->options['overlay']['dismiss_text'];
}
}
Modal::create(
[
'modal_slug' => 'extended-adblocker',
'modal_content' => $this->options['overlay']['content'],
'close_action' => $button_text,
'template' => plugin_dir_path( __FILE__ ) . 'views/modal.php',
'dismiss_button_styling' => $this->options['overlay']['dismiss_style'],
'container_styling' => $this->options['overlay']['container_style'],
'background_styling' => $this->options['overlay']['background_style'],
]
);
?>
<script>
jQuery(function() {
window.advanced_ads_check_adblocker( function ( is_enabled ) {
if ( is_enabled ) {
document.getElementById('modal-extended-adblocker').showModal();
}
} );
});
</script>
<?php
}
/**
* Redirect logic
*
* @return void
*/
public function print_redirect(): void {
$url = $this->options['redirect']['url'] ?? '';
$current_url = ( is_ssl() ? 'https://' : 'http://' ) .
Params::server( 'HTTP_HOST' ) .
Params::server( 'REQUEST_URI' );
if ( ! empty( $url ) && ! $this->compare_urls( $url, $current_url ) ) {
?>
<script>
jQuery(function() {
window.advanced_ads_check_adblocker( function ( is_enabled ) {
if ( is_enabled ) {
window.location.href = '<?php echo esc_html( $url ); ?>';
}
} );
});
</script>
<?php
}
}
/**
* Conditions which has to pass to go ahead
*
* @return bool
*/
private function prechecks(): bool {
/**
* Don't run:
* - on AMP
* - when method is set to 'nothing'
*/
if ( advads_is_amp() || 'nothing' === $this->options['method'] ) {
return false;
}
// check if exclude matches with current user.
$hide_for_roles = isset( $this->options['exclude'] )
? Advanced_Ads_Utils::maybe_translate_cap_to_role( $this->options['exclude'] )
: [];
$user = wp_get_current_user();
if ( is_user_logged_in() &&
$hide_for_roles &&
is_array( $user->roles ) &&
array_intersect( $hide_for_roles, $user->roles ) ) {
return false;
}
return true;
}
/**
* Overlay Helpers
*
* @return int
*/
private function get_last_display_time(): int {
return Params::cookie( self::COOKIE_NAME, 0 );
}
/**
* Overlay Helpers
*
* @return void
*/
private function set_last_display_time(): void {
$expire_time = time() + $this->get_interval_from_frequency();
setcookie( self::COOKIE_NAME, time(), $expire_time, '/' );
}
/**
* Overlay Helpers
*
* @return bool
*/
private function should_show_overlay(): bool {
switch ( $this->show_frequency ) {
case 'everytime':
return true;
case 'never':
return false;
default:
$last_display_time = $this->get_last_display_time();
$interval = $this->get_interval_from_frequency( $this->show_frequency );
return time() >= $last_display_time + $interval;
}
}
/**
* Overlay Helpers
*
* @return int
*/
private function get_interval_from_frequency(): int {
// Map frequency strings to seconds.
$intervals = [
'everytime' => 0,
'hour' => 3600,
'day' => 86400,
'week' => 604800,
'month' => 2592000, // 30 days.
];
return $intervals[ $this->show_frequency ];
}
/**
* Compare URLs
*
* @param string $url1 URL in database.
* @param string $url2 current page url.
*
* @return bool
*/
private function compare_urls( $url1, $url2 ): bool {
$url1 = wp_parse_url( $url1 );
$url2 = wp_parse_url( $url2 );
return $url1['path'] === $url2['path'];
}
}

View File

@@ -0,0 +1,10 @@
<?php
/**
* Initialize class.
*
* @package AdvancedAds\Pro
*/
if ( ! is_admin() ) {
new Advanced_Ads_Pro_Module_Extended_Adblocker();
}

View File

@@ -0,0 +1,38 @@
<?php
/**
* Extended Adblocker Popup Modal
*
* @package AdvancedAds\Pro
*
* @var string $modal_slug Unique slug that can be addressed by a link or button.
* @var string $modal_content The modal content. May contain HTML.
* @var string $close_action Adds close button.
* @var string $dismiss_button_styling Dismiss button styling.
* @var string $container_styling Container styling.
* @var string $background_styling Background styling.
*/
?>
<dialog id="modal-<?php echo esc_attr( $modal_slug ); ?>"
class="advads-modal"
data-modal-id="<?php echo esc_attr( $modal_slug ); ?>"
autofocus
style="<?php echo esc_attr( $background_styling ?? '' ); ?>">
<div class="advads-modal-content" style="<?php echo esc_attr( $container_styling ?? '' ); ?>">
<div class="advads-modal-body">
<?php
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- modal content may contain any kind of custom html
echo $modal_content;
?>
<?php if ( $close_action ) : ?>
<div class="close-wrapper">
<button class="advads-modal-close-action"
onclick="document.getElementById('modal-<?php echo esc_attr( $modal_slug ); ?>').close()"
style="<?php echo esc_attr( $dismiss_button_styling ?? '' ); ?>">
<?php echo esc_html( $close_action ); ?>
</button>
</div>
<?php endif; ?>
</div>
</div>
</dialog>

View File

@@ -0,0 +1,81 @@
<?php
/**
* Activate adblocker.
*
* @package Advanced_Ads_Pro\Module
*
* @var string $option_name array index name
* @var string $option_exclude array index name
* @var boolean $checked True, when the option is checked.
* @var boolean $exclude_checked True, when the option is checked.
* @var boolean $abf_enabled True, when the adblocker disguise is enabled.
*/
?>
<label class="advads-eadblocker-radio-button">
<input class="advanced-ads-adblocker-eab-method" name="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER . '[method]' ); ?>" type="radio" value="nothing"<?php checked( $method, 'nothing' ); ?> />
<?php esc_html_e( 'No additional actions', 'advanced-ads-pro' ); ?>
</label>
<label class="advads-eadblocker-radio-button">
<input class="advanced-ads-adblocker-eab-method" name="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER . '[method]' ); ?>" type="radio" value="overlay"<?php checked( $method, 'overlay' ); ?> />
<?php esc_html_e( 'Overlay', 'advanced-ads-pro' ); ?>
<span class="advads-help">
<span class="advads-tooltip" style="position: fixed; left: 628px; top: 332px;">
<?php
esc_html_e(
'Show a custom overlay to users with an ad blocker enabled, prompting them to turn it off on your website.',
'advanced-ads-pro'
);
?>
</span>
</span>
</label>
<label class="advads-eadblocker-radio-button">
<input class="advanced-ads-adblocker-eab-method" name="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER . '[method]' ); ?>" type="radio" value="redirect"<?php checked( $method, 'redirect' ); ?> />
<?php esc_html_e( 'Redirect', 'advanced-ads-pro' ); ?>
<span class="advads-help">
<span class="advads-tooltip" style="position: fixed; left: 628px; top: 332px;">
<?php
esc_html_e(
'Automatically redirect users with ad blockers enabled to an internal page. Content access is granted after turning off the ad blocker.',
'advanced-ads-pro'
);
?>
</span>
</span>
</label>
<p class="description advads-eab-overlay-notice">
<?php esc_html_e( 'Activate the ad blocker disguise above to display the overlay.', 'advanced-ads-pro' ); ?>
</p>
<div id="advanced-ads-adblocker-overlay-options" <?php echo 'overlay' === $method ? '' : 'style="display: none;"'; ?>>
<?php
$this->render_settings_overlay_content();
$this->render_settings_dismissible();
$this->render_settings_styling();
?>
</div>
<div id="advanced-ads-adblocker-redirect-options" <?php echo 'redirect' === $method ? '' : 'style="display: none;"'; ?>>
<h4>
<?php esc_html_e( 'Redirect URL', 'advanced-ads-pro' ); ?>
<span class="advads-help">
<span class="advads-tooltip">
<?php
esc_html_e(
'Enter a specific page on your domain to which users with activated AdBlocker should be automatically redirected.',
'advanced-ads-pro'
);
?>
</span>
</span>
</h4>
<input class="width-100" type="text" name="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER . '[redirect][url]' ); ?>" value="<?php echo esc_attr( $redirect_url ); ?>" />
</div>
<div id="advanced-ads-adblocker-option-exclude" <?php echo ( 'redirect' === $method || 'overlay' === $method ) ? '' : 'style="display: none;"'; ?>>
<?php $this->render_settings_exclude(); ?>
</div>

View File

@@ -0,0 +1,96 @@
<?php
/**
* Ad Blocker overlay options 'overlay again and dismiss button'
*
* @package Advanced_Ads_Pro\Module
*
* @var string $option_time_freq The array index name for the overlay timing option.
* @var string $button_text The option value for the dismiss button text.
* @var string $time_freq The option value for the overlay timing.
* @var boolean $hide_checked True, when the hide dismiss button option is checked.
* @var string $option_dismiss_style The array index name for the dismiss button styling option.
* @var string $dismiss_style The CSS value for the dismiss button styling.
*/
?>
<h4>
<?php esc_html_e( 'When to show overlay again?', 'advanced-ads-pro' ); ?>
<span class="advads-help">
<span class="advads-tooltip">
<?php esc_html_e( 'Set the timing for the overlay to reappear after being dismissed.', 'advanced-ads-pro' ); ?>
</span>
</span>
</h4>
<div class="advads-settings-margin">
<select name="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER . "[overlay][$option_time_freq]" ); ?>">
<option value="everytime" <?php selected( $time_freq, 'everytime' ); ?>>
<?php esc_html_e( 'Everytime', 'advanced-ads-pro' ); ?>
</option>
<option value="hour" <?php selected( $time_freq, 'hour' ); ?>>
<?php esc_html_e( '1 hour', 'advanced-ads-pro' ); ?>
</option>
<option value="day" <?php selected( $time_freq, 'day' ); ?>>
<?php esc_html_e( '1 day', 'advanced-ads-pro' ); ?>
</option>
<option value="week" <?php selected( $time_freq, 'week' ); ?>>
<?php esc_html_e( '1 week', 'advanced-ads-pro' ); ?>
</option>
<option value="month" <?php selected( $time_freq, 'month' ); ?>>
<?php esc_html_e( '1 month', 'advanced-ads-pro' ); ?>
</option>
<option value="never" <?php selected( $time_freq, 'never' ); ?>>
<?php esc_html_e( 'Never', 'advanced-ads-pro' ); ?>
</option>
</select>
</div>
<h4><?php esc_html_e( 'Dismiss button', 'advanced-ads-pro' ); ?></h4>
<input id="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER ); ?>-dismiss-button-input"
type="checkbox"
value="1"
name="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER . '[overlay][hide_dismiss]' ); ?>"
<?php checked( $hide_checked, 1, true ); ?>>
<label for="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER ); ?>-dismiss-button-input">
<?php esc_html_e( 'Hide dismiss button', 'advanced-ads-pro' ); ?>
<span class="advads-help">
<span class="advads-tooltip">
<?php esc_html_e( 'Disabling the dismiss button significantly limits site interaction.', 'advanced-ads-pro' ); ?>
</span>
</span>
</label>
<div id="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER ); ?>-dismiss-options">
<h4>
<?php esc_html_e( 'Dismiss button text', 'advanced-ads-pro' ); ?>
<span class="advads-help">
<span class="advads-tooltip">
<?php esc_html_e( 'Enter the text that you want to appear on the dismiss button.', 'advanced-ads-pro' ); ?>
</span>
</span>
</h4>
<input type="text"
name="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER . '[overlay][dismiss_text]' ); ?>"
value="<?php echo esc_attr( $button_text ); ?>"
placeholder="<?php esc_html_e( 'Dismiss', 'advanced-ads-pro' ); ?>" >
<?php if ( ! empty( $button_text ) ) : ?>
<p class="description"><?php esc_html_e( 'Empty and save to revert to defaults.', 'advanced-ads-pro' ); ?></p>
<?php endif; ?>
<h4>
<?php esc_html_e( 'Dismiss button styling', 'advanced-ads-pro' ); ?>
<span class="advads-help">
<span class="advads-tooltip">
<?php esc_html_e( 'Insert CSS to customize the dismiss button layout.', 'advanced-ads-pro' ); ?>
</span>
</span>
</h4>
<input class="width-100"
type="text"
name="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER . "[overlay][$option_dismiss_style]" ); ?>"
value="<?php echo esc_attr( $dismiss_style ); ?>"
placeholder="e.g. background-color: black; border-radius: 20px;">
<?php if ( ! empty( $dismiss_style ) ) : ?>
<p class="description"><?php esc_html_e( 'Empty and save to revert to defaults.', 'advanced-ads-pro' ); ?></p>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,35 @@
<?php
/**
* Ad Blocker options 'exclude'
*
* @package Advanced_Ads_Pro\Module
* @var string $option_exclude array index name
* @var array $exclude exclude option value
*/
?>
<h4>
<?php esc_html_e( 'Exclude', 'advanced-ads-pro' ); ?>
<span class="advads-help">
<span class="advads-tooltip">
<?php esc_html_e( 'Choose which user roles to exclude from this ad blocker countermeasure.', 'advanced-ads-pro' ); ?>
</span>
</span>
</h4>
<div class="advads-settings-checkbox-inline">
<?php
foreach ( $roles as $_role => $_display_name ) :
$checked = in_array( $_role, $exclude, true );
?>
<label>
<input type="checkbox" value="<?php echo esc_attr( $_role ); ?>"
name="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER . "[$option_exclude][]" ); ?>"
<?php checked( $checked, true ); ?>>
<?php echo esc_html( $_display_name ); ?>
</label>
<?php
endforeach;
?>
</div>

View File

@@ -0,0 +1,12 @@
<?php
/**
* Ad Blocker overlay options 'dismiss button'
*
* @package Advanced_Ads_Pro\Module
* @var string $option_name array index name
* @var boolean $checked True, when the option is checked.
*/
?>
<h4><?php esc_html_e( 'Content', 'advanced-ads-pro' ); ?></h4>
<?php wp_editor( $content, 'adblocker_overlay_content_editor', $args ); ?>

View File

@@ -0,0 +1,47 @@
<?php
/**
* Ad Blocker overlay options 'stylings'
*
* @package Advanced_Ads_Pro\Module
* @var string $option_dismiss array index name
* @var string $option_container array index name
* @var string $option_background array index name
* @var string $container_style css
* @var string $background_style css
*/
?>
<h4>
<?php esc_html_e( 'Container styling', 'advanced-ads-pro' ); ?>
<span class="advads-help">
<span class="advads-tooltip">
<?php esc_html_e( 'Insert CSS to customize the overlay container layout.', 'advanced-ads-pro' ); ?>
</span>
</span>
</h4>
<input class="width-100"
type="text"
name="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER . "[overlay][$option_container]" ); ?>"
value="<?php echo esc_attr( $container_style ); ?>"
placeholder="e.g. background-color: salmon; border-radius: 10px; padding: 20px;">
<?php if ( ! empty( $container_style ) ) : ?>
<p class="description"><?php esc_html_e( 'Empty and save to revert to defaults.', 'advanced-ads-pro' ); ?></p>
<?php endif; ?>
<h4>
<?php esc_html_e( 'Background styling', 'advanced-ads-pro' ); ?>
<span class="advads-help">
<span class="advads-tooltip">
<?php esc_html_e( 'Insert CSS to customize the background of the overlay.', 'advanced-ads-pro' ); ?>
</span>
</span>
</h4>
<input class="width-100"
type="text"
name="<?php echo esc_attr( ADVADS_SETTINGS_ADBLOCKER . "[overlay][$option_background]" ); ?>"
value="<?php echo esc_attr( $background_style ); ?>"
placeholder="e.g. background-color: rgba(0, 0, 0, 0.9);">
<?php if ( ! empty( $background_style ) ) : ?>
<p class="description"><?php esc_html_e( 'Empty and save to revert to defaults.', 'advanced-ads-pro' ); ?></p>
<?php endif; ?>