Plugin Directory

Changeset 3029416


Ignore:
Timestamp:
01/31/2024 11:14:55 AM (23 months ago)
Author:
advancedads
Message:

Update to version 1.49.0 from GitHub

Location:
advanced-ads
Files:
32 edited
1 copied

Legend:

Unmodified
Added
Removed
  • advanced-ads/tags/1.49.0/admin/assets/css/admin.css

    r2995001 r3029416  
    264264#advads-display-conditions, #advads-visitor-conditions { margin-top: 0; }
    265265#ad-targeting-box .advads-conditions-terms-show-search { height: 22px; line-height: 22px; font-weight: bold; font-size: 1.5em; }
    266 .advads-conditions-terms-search { display: none; }
     266.advads-conditions-terms-search, .advads-conditions-authors-search { display: none; }
    267267#advads-ad-usage .advads-usage input { width: 300px; }
    268268.post-type-advanced_ads #ad-parameters-box .advads-ad-parameters-spinner { display: block; float: none; }
  • advanced-ads/tags/1.49.0/admin/assets/js/conditions.js

    r2701373 r3029416  
    33 */
    44
    5 jQuery( document ).ready(
    6     function ( $ ) {
     5jQuery( document ).ready(function ( $ ) {
    76        /**
    87         * Pressing the button to add a new condition to the list of conditions
     
    111110        }
    112111
     112    // remove author from list by clicking on it.
     113    $(document).on(
     114        'click',
     115        '.advads-conditions-authors-buttons .button',
     116        function () {
     117            $(this).remove();
     118        }
     119    );
     120    // display input field to search for author.
     121    $(document).on(
     122        'click',
     123        '.advads-conditions-authors-show-search',
     124        function (e) {
     125            e.preventDefault();
     126            // display input field.
     127            $(this)
     128                .siblings('.advads-conditions-authors-search')
     129                .show()
     130                .focus();
     131            // register autocomplete.
     132            advadsRegisterAuthorAutocomplete(
     133                $(this).siblings('.advads-conditions-authors-search')
     134            );
     135            $(this).next('br').show();
     136            $(this).hide();
     137        }
     138    );
     139
     140    // author search box autocomplete.
     141    function advadsRegisterAuthorAutocomplete(self) {
     142        self.autocomplete({
     143            classes: {
     144                'ui-autocomplete': 'advads-ui-autocomplete',
     145            },
     146            source(request, callback) {
     147                advadsAuthorSearch(self, callback);
     148            },
     149            minLength: 1,
     150            select(event, ui) {
     151                // append new line with input fields.
     152                $(
     153                    '<label class="button advads-button advads-ui-state-active"><span class="advads-button-text">' +
     154                        ui.item.label +
     155                        '<input type="hidden" name="' +
     156                        self.data('inputName') +
     157                        '" value="' +
     158                        ui.item.value +
     159                        '"></span></label>'
     160                ).appendTo(self.siblings('.advads-conditions-authors-buttons'));
     161            },
     162            close() {
     163                self.val('');
     164            },
     165        });
     166    }
     167
    113168        // display input field to search for post, page, etc.
    114169        $( document ).on( 'click', '.advads-conditions-postids-show-search', function ( e ) {
     
    244299
    245300/**
     301 * Callback for author search autocomplete
     302 *
     303 * @param {string}           search   author
     304 * @param {HTMLInputElement} field    html input field
     305 * @param {Function}         callback Callback function
     306 * @return {Object} JSON object with labels and values
     307 */
     308
     309function advadsAuthorSearch(field, callback) {
     310    const query = {
     311        action: 'advads-authors-search',
     312        nonce: advadsglobal.ajax_nonce,
     313    };
     314
     315    query.search = field.val();
     316
     317    var querying = true;
     318
     319    const results = [];
     320    // eslint-disable-next-line no-undef
     321    jQuery.post(
     322        // eslint-disable-next-line no-undef
     323        ajaxurl,
     324        query,
     325        function (r) {
     326            querying = false;
     327            if (r) {
     328                r.map(function (element, index) {
     329                    results[index] = {
     330                        value: element.data.ID,
     331                        label: element.data.display_name,
     332                    };
     333                });
     334            }
     335            callback(results);
     336        },
     337        'json'
     338    );
     339}
     340
     341/**
    246342 * Callback for post search autocomplete
    247343 *
  • advanced-ads/tags/1.49.0/admin/includes/class-meta-box.php

    r2986093 r3029416  
    234234                $view                         = 'conditions/ad-targeting-metabox.php';
    235235                $hndlelinks                   = '<a href="#" class="advads-video-link">' . __( 'Video', 'advanced-ads' ) . '</a>';
    236                 $hndlelinks                  .= '<a href="https://wpadvancedads.com/manual/display-conditions/?utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-display" target="_blank" class="advads-manual-link">' . __( 'Display Conditions', 'advanced-ads' ) . '</a>';
    237                 $hndlelinks                  .= '<a href="https://wpadvancedads.com/manual/visitor-conditions/?utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-visitor" target="_blank" class="advads-manual-link">' . __( 'Visitor Conditions', 'advanced-ads' ) . '</a>';
     236                $hndlelinks                   .= '<a href="https://wpadvancedads.com/manual/display-conditions/?utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-display" target="_blank" class="advads-manual-link">' . __( 'Display Conditions', 'advanced-ads' ) . '</a>';
     237                $hndlelinks                   .= '<a href="https://wpadvancedads.com/manual/visitor-conditions/?utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-visitor" target="_blank" class="advads-manual-link">' . __( 'Visitor Conditions', 'advanced-ads' ) . '</a>';
    238238                $videomarkup                  = '<iframe width="420" height="315" src="https://www.youtube-nocookie.com/embed/VjfrRl5Qn4I?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>';
    239                 $display_conditions           = $ad->options( 'conditions', [] );
    240                 $visitor_conditions           = $ad->options( 'visitors', [] );
     239                $ad_options                   = $ad->options();
     240                $display_conditions           = is_array( $ad_options['conditions'] ) ? $ad_options['conditions'] : []; // default value for older version is `""` (empty string)
     241                $visitor_conditions           = is_array( $ad_options['visitors'] ) ? $ad_options['visitors'] : []; // default value for older version is `""` (empty string)
    241242                $display_conditions_available = ( empty( $display_conditions ) );
    242243                $visitor_conditions_available = ( empty( $visitor_conditions ) );
  • advanced-ads/tags/1.49.0/admin/views/conditions/condition-author.php

    r2986093 r3029416  
    33 * Templace for the Author display condition
    44 *
     5 * @package Advanced_Ads_Admin
    56 * @var string $name form name attribute.
    67 * @var int $max_authors number of maximum author entries to show.
    78 */
     9
    810?>
    911    <div class="advads-conditions-single advads-buttonset">
    1012        <?php
    11         foreach ( $authors as $_author ) {
    12             // don’t use strict comparision because $values contains strings.
    13             if ( in_array( $_author->ID, $values ) ) {
    14                 $_val = 1;
    15             } else {
    16                 $_val = 0;
     13        if ( count( $authors ) >= $max_authors ) :
     14            // show active authors.
     15            ?>
     16                <div class="advads-conditions-authors-buttons dynamic-search">
     17                    <?php
     18                    foreach ( $authors as $_author ) :
     19                        // don’t use strict comparision because $values contains strings.
     20                        if ( in_array( $_author->ID, $values ) ) :
     21                            $author_name = $_author->display_name;
     22                            $field_id    = 'advads-conditions-' . absint( $_author->ID ) . $rand;
     23                            ?>
     24                            <label class="button advads-button advads-ui-state-active">
     25                                <span class="advads-button-text">
     26                                    <?php echo esc_attr( $author_name ); ?>
     27                                    <input type="hidden"
     28                                    name="<?php echo esc_attr( $name ); ?>[value][]"
     29                                    value="<?php echo absint( $_author->ID ); ?>">
     30                                </span>
     31                            </label>
     32                            <?php
     33                        endif;
     34                    endforeach;
     35                    ?>
     36                </div>
     37                <span class="advads-conditions-authors-show-search button" title="<?php _ex( 'add more authors', 'display the authors search field on ad edit page', 'advanced-ads' ); ?>">
     38                +
     39                </span>
     40                <br/>
     41                <input type="text" class="advads-conditions-authors-search"
     42                data-input-name="<?php echo esc_attr( $name ); ?>[value][]"
     43                placeholder="<?php _e( 'author name or id', 'advanced-ads' ); ?>"/>
     44            <?php
     45        else :
     46            $max_counter = $max_authors;
     47            foreach ( $authors as $_author ) {
     48                if ( $max_counter <= 0 ) {
     49                    return false;
     50                }
     51                --$max_counter;
     52                // don’t use strict comparision because $values contains strings.
     53                if ( in_array( $_author->ID, $values ) ) {
     54                    $_val = 1;
     55                } else {
     56                    $_val = 0;
     57                }
     58                $author_name = $_author->display_name;
     59                $field_id    = 'advads-conditions-' . absint( $_author->ID ) . $rand;
     60                ?>
     61                <label class="button advads-button"
     62                    for="<?php echo esc_attr( $field_id ); ?>">
     63                    <?php echo esc_attr( $author_name ); ?>
     64                </label><input type="checkbox"
     65                            id="<?php echo esc_attr( $field_id ); ?>"
     66                            name="<?php echo esc_attr( $name ); ?>[value][]" <?php checked( $_val, 1 ); ?>
     67                            value="<?php echo absint( $_author->ID ); ?>">
     68                <?php
    1769            }
    18             $author_name = $_author->display_name;
    19             $field_id    = 'advads-conditions-' . absint( $_author->ID ) . $rand;
    20             ?>
    21             <label class="button advads-button"
    22                    for="<?php echo esc_attr( $field_id ); ?>">
    23                 <?php echo esc_attr( $author_name ); ?>
    24             </label><input type="checkbox"
    25                            id="<?php echo esc_attr( $field_id ); ?>"
    26                            name="<?php echo esc_attr( $name ); ?>[value][]" <?php checked( $_val, 1 ); ?>
    27                            value="<?php echo absint( $_author->ID ); ?>">
    28             <?php
    29         }
    30         include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php';
     70            include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php';
     71        endif;
    3172        ?>
    3273    </div>
    3374<?php
     75/*
    3476if ( count( $authors ) >= $max_authors ) :
    3577    ?>
     
    5597<?php
    5698endif;
     99*/
  • advanced-ads/tags/1.49.0/advanced-ads.php

    r3006148 r3029416  
    1313 * Plugin URI:        https://wpadvancedads.com
    1414 * Description:       Manage and optimize your ads in WordPress
    15  * Version:           1.48.1
     15 * Version:           1.49.0
    1616 * Author:            Advanced Ads GmbH
    1717 * Author URI:        https://wpadvancedads.com
     
    3434
    3535define( 'ADVADS_FILE', __FILE__ );
    36 define( 'ADVADS_VERSION', '1.48.1' );
     36define( 'ADVADS_VERSION', '1.49.0' );
    3737
    3838// Load the autoloader.
  • advanced-ads/tags/1.49.0/classes/ad_ajax_callbacks.php

    r2983598 r3029416  
    3131        add_action( 'wp_ajax_load_display_conditions_metabox', [ $this, 'load_display_condition' ] );
    3232        add_action( 'wp_ajax_advads-terms-search', [ $this, 'search_terms' ] );
     33        add_action( 'wp_ajax_advads-authors-search', [ $this, 'search_authors' ] );
    3334        add_action( 'wp_ajax_advads-close-notice', [ $this, 'close_notice' ] );
    3435        add_action( 'wp_ajax_advads-hide-notice', [ $this, 'hide_notice' ] );
     
    204205
    205206    /**
     207     * Search authors
     208     *
     209     * @since 1.47.5
     210     */
     211    public function search_authors() {
     212        check_ajax_referer( 'advanced-ads-admin-ajax-nonce', 'nonce' );
     213
     214        if ( ! WordPress::user_can( 'advanced_ads_edit_ads' ) ) {
     215            return;
     216        }
     217
     218        $args                   = [];
     219        $args['search_columns'] = [ 'ID', 'user_login', 'user_nicename', 'display_name' ];
     220
     221        if ( version_compare( get_bloginfo( 'version' ), '5.9' ) > -1 ) {
     222            $args['capability'] = [ 'edit_posts' ];
     223        } else {
     224            $args['who'] = 'authors';
     225        }
     226
     227        if ( ! isset( $_POST['search'] ) || '' === $_POST['search'] ) {
     228            die();
     229        }
     230
     231        $args['search'] = '*' . sanitize_text_field( wp_unslash( $_POST['search'] ) ) . '*';
     232
     233        $results = get_users( $args );
     234
     235        echo wp_json_encode( $results );
     236        die();
     237    }
     238
     239    /**
    206240     * Close a notice for good
    207241     *
  • advanced-ads/tags/1.49.0/classes/display-conditions.php

    r2983598 r3029416  
    11<?php
    2 
     2// phpcs:ignoreFile
    33/**
    44 * Display Conditions under which to (not) show an ad
     
    88 */
    99class Advanced_Ads_Display_Conditions {
    10 
    1110    /**
    1211     * Advanced_Ads_Display_Conditions
     
    250249        $conditions = self::get_instance()->get_conditions();
    251250
    252 
    253251        if ( isset( $options['in'] ) ) {
    254252            if ( 'global' === $options['in'] ) {
    255                 $conditions = array_filter( $conditions, function( $condition ) {
    256                     return ! isset( $condition['options']['global'] ) || $condition['options']['global'];
    257                 } );
     253                $conditions = array_filter(
     254                    $conditions,
     255                    function ( $condition ) {
     256                        return ! isset( $condition['options']['global'] ) || $condition['options']['global'];
     257                    }
     258                );
    258259            } elseif ( is_array( $options['in'] ) ) {
    259260                // Include already set condition types.
     
    315316     */
    316317    public static function render_connector_option( $index, $value, $form_name ) {
    317 
    318318        $label = ( 'or' === $value ) ? __( 'or', 'advanced-ads' ) : __( 'and', 'advanced-ads' );
    319319
     
    323323        $rand = md5( $form_name );
    324324
    325         return '<input style="display:none;" type="checkbox" name="' . $name . '[connector]' . '" value="or"
    326                 id="advads-conditions-' . $index . '-connector-' . $rand . '"' . checked( 'or', $value, false ) . '>
    327                 <label for="advads-conditions-' . $index . '-connector-' . $rand . '">' . $label . '</label>';
     325        return sprintf(
     326            "<input style='display:none' type='checkbox' name='%s[connector]' value='or' id='%s' %s><label for='%s'>%s</label>",
     327            esc_attr( $name ),
     328            esc_attr( "advads-conditions-$index-connector-$rand" ),
     329            checked( 'or', $value, false ),
     330            esc_attr( "advads-conditions-$index-connector-$rand" ),
     331            esc_html( $label )
     332        );
    328333    }
    329334
     
    335340     */
    336341    public static function render_type_field( $type, $name ) {
    337 
    338342        ?>
    339343        <input type="hidden" name="<?php echo esc_attr( $name ); ?>[type]" value="<?php echo esc_attr( $type ); ?>"/>
    340344        <?php
    341 
    342345    }
    343346
     
    396399        );
    397400        ?>
    398         <div class="advads-conditions-single advads-buttonset"><?php
     401        <div class="advads-conditions-single advads-buttonset">
     402        <?php
    399403        $type_label_counts = array_count_values( wp_list_pluck( $post_types, 'label' ) );
    400404
     
    412416            }
    413417            $field_id = "advads-conditions-$_type_id-$rand";
    414             ?><label class="button" for="<?php echo $field_id;
    415             ?>"><?php echo $_label ?></label><input type="checkbox"
    416             id="<?php echo $field_id; ?>"
    417             name="<?php echo $name; ?>[value][]" <?php checked( $_val, 1 ); ?>
    418             value="<?php echo $_type_id; ?>"><?php
     418            printf(
     419                "<label class='button' for='%s'>%s</label><input type='checkbox' id='%s' name='%s' %s value='%s'>",
     420                esc_attr( $field_id ),
     421                esc_html( $_label ),
     422                esc_attr( $field_id ),
     423                esc_attr( "{$name}[value][]" ),
     424                checked( $_val, 1, false ),
     425                esc_attr( $_type_id )
     426            );
    419427        }
    420428        include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php';
    421429        ?>
    422         </div><?php
     430        </div>
     431        <?php
    423432    }
    424433
     
    459468        $args        = [
    460469            'orderby' => 'nicename',
    461             'number'  => $max_authors,
    462470        ];
    463471        if ( version_compare( get_bloginfo( 'version' ), '5.9' ) > -1 ) {
     
    567575
    568576                $field_id = "advads-conditions-$_taxonomy_id-$rand";
    569                 ?><label class="button" for="<?php echo $field_id
    570             ?>"><?php echo $_label ?></label><input type="checkbox"
    571                 id="<?php echo $field_id; ?>"
    572                 name="<?php echo $name; ?>[value][]" <?php checked( $_val, 1 ); ?>
    573                 value="<?php echo $_taxonomy_id; ?>"><?php
     577                printf(
     578                    "<label class='button' for='%s'>%s</label><input type ='checkbox' id='%s' name='%s' %s value='%s'>",
     579                    esc_attr( $field_id ),
     580                    esc_html( $_label ),
     581                    esc_attr( $field_id ),
     582                    esc_attr( "{$name}[value][]" ),
     583                    checked( $_val, 1, false ),
     584                    esc_attr( $_taxonomy_id )
     585                );
    574586            endforeach;
    575587            include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php';
     
    586598     * @param string $inputname name of the input field.
    587599     * @param int    $max_terms maximum number of terms to show.
    588      * @param int    $index index of the conditions group.
     600     * @param int    $index index of the conditions group.
    589601     *
    590602     * @return array|int|WP_Error
    591603     */
    592604    public static function display_term_list( $taxonomy, $checked = [], $inputname = '', $max_terms = 50, $index = 0 ) {
    593 
    594605        $terms = get_terms(
    595606            $taxonomy->name,
     
    622633                } else {
    623634                    ?>
    624                     <div class="advads-conditions-terms-buttons dynamic-search"></div><?php
     635                    <div class="advads-conditions-terms-buttons dynamic-search"></div>
     636                    <?php
    625637                }
    626                 ?><span class="advads-conditions-terms-show-search button" title="<?php
    627             _ex( 'add more terms', 'display the terms search field on ad edit page', 'advanced-ads' );
    628             ?>">+</span><br/><input type="text" class="advads-conditions-terms-search"
    629                 data-tag-name="<?php echo $taxonomy->name;
    630                 ?>" data-input-name="<?php echo $inputname; ?>"
    631                 placeholder="<?php _e( 'term name or id', 'advanced-ads' ); ?>"/><?php
     638
     639                printf(
     640                    "<span class='advads-conditions-terms-show-search button' title='%s'>+</span><br>",
     641                    esc_attr_x( 'add more terms', 'display the terms search field on ad edit page', 'advanced-ads' )
     642                );
     643                printf(
     644                    "<input type='text' class='advads-conditions-terms-search' data-tag-name='%s' data-input-name='%s' placeholder='%s'>",
     645                    esc_attr( $taxonomy->name ),
     646                    esc_attr( $inputname ),
     647                    esc_attr__( 'term name or id', 'advanced-ads' )
     648                );
    632649            else :
    633                 foreach ( $terms as $_term ) :
     650                foreach ( $terms as $_term ) {
    634651                    $field_id = "advads-conditions-$_term->term_id-$rand";
    635                     ?><input type="checkbox" id="<?php echo $field_id; ?>" name="<?php echo $inputname; ?>"
    636                     value="<?php echo $_term->term_id; ?>" <?php checked( in_array( $_term->term_id, $checked ), true );
    637                     ?>><label for="<?php echo $field_id; ?>"><?php echo $_term->name; ?></label><?php
    638                 endforeach;
     652                    printf(
     653                        "<input type='checkbox' id='%s' name='%s' value='%s' %s><label for='%s'>%s</label>",
     654                        esc_attr( $field_id ),
     655                        esc_attr( $inputname ),
     656                        esc_attr( $_term->term_id ),
     657                        checked( in_array( $_term->term_id, $checked ), true, false ),
     658                        esc_attr( $field_id ),
     659                        esc_html( $_term->name )
     660                    );
     661                }
    639662                include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php';
    640663            endif;
     
    683706
    684707            ];
    685 
    686708            $the_query = new WP_Query( $args );
    687709            while ( $the_query->have_posts() ) {
     
    694716            }
    695717        }
    696         ?><span class="advads-conditions-postids-show-search button" <?php if ( ! count( $values ) ) {
    697                 echo 'style="display:none;"'; } ?>>+</span><p class="advads-conditions-postids-search-line">
    698             <input type="text" class="advads-display-conditions-individual-post" <?php if ( count( $values ) ) {
    699                 echo 'style="display:none;"';
    700             } ?>
    701                     placeholder="<?php _e( 'title or id', 'advanced-ads' ); ?>"
    702                     data-field-name="<?php echo $name; ?>"/><?php
    703             wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false );
    704             ?></p></div><?php
     718        printf(
     719            "<span class='advads-conditions-postids-show-search button' style='%s'>+</span>",
     720            empty( $values ) ? 'display:none;' : ''
     721        );
     722
     723        printf(
     724            "<p class='advads-conditions-postids-search-line'><input type='text' class='advads-display-conditions-individual-post' style='%s' placeholder='%s' data-field-name='%s' />%s</p></div>",
     725            ! empty( $values ) ? 'display:none;' : '',
     726            esc_attr__( 'title or id', 'advanced-ads' ),
     727            esc_attr( $name ),
     728            wp_kses(
     729                wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false, false ),
     730                [
     731                    'input' => [
     732                        'type'  => true,
     733                        'id'    => true,
     734                        'name'  => true,
     735                        'class' => true,
     736                        'value' => true,
     737                    ],
     738                ]
     739            )
     740        );
    705741        // phpcs:enable
    706742    }
     
    730766
    731767        $rand = md5( $form_name );
    732         foreach ( $conditions as $_key => $_condition ) :
    733 
     768        foreach ( $conditions as $_key => $_condition ) {
    734769            // activate by default.
    735             $value = ( [] === $values || in_array( $_key, $values, true ) ) ? 1 : 0;
    736 
     770            $value    = ( [] === $values || in_array( $_key, $values, true ) ) ? 1 : 0;
    737771            $field_id = "advads-conditions-$_key-$rand";
    738             ?><input type="checkbox" id="<?php echo $field_id; ?>" name="<?php echo $name; ?>[value][]"
    739             value="<?php echo $_key; ?>" <?php checked( 1, $value ); ?>><label
    740             for="<?php echo $field_id; ?>"><?php echo $_condition['label']; ?></label><?php
    741         endforeach;
     772            printf(
     773                "<input type='checkbox' id='%s' name='%s' %s value='%s'>",
     774                esc_attr( $field_id ),
     775                esc_attr( "{$name}[value][]" ),
     776                checked( 1, $value, false ),
     777                esc_attr( $_key )
     778            );
     779            printf(
     780                "<label for='%s'>%s</label>",
     781                esc_attr( $field_id ),
     782                esc_html( $_condition['label'] )
     783            );
     784
     785        }
    742786        include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php';
    743         ?></div><?php
    744         return;
     787        echo '</div>';
    745788    }
    746789
     
    751794     */
    752795    public static function general_conditions() {
    753         return $conditions = apply_filters( 'advanced-ads-display-conditions-general',
     796        return apply_filters(
     797            'advanced-ads-display-conditions-general',
    754798            [
    755799                'is_front_page' => [
     
    793837                    'type'        => 'radio',
    794838                ],
    795                 'is_rest_api'     => [
     839                'is_rest_api'   => [
    796840                    'label'       => __( 'REST API', 'advanced-ads' ),
    797841                    'description' => __( 'allow ads in REST API', 'advanced-ads' ),
     
    810854     */
    811855    public static function metabox_content_age( $options, $index = 0, $form_name = '' ) {
    812         if ( ! isset ( $options['type'] ) || '' === $options['type'] ) {
     856        if ( ! isset( $options['type'] ) || '' === $options['type'] ) {
    813857            return;
    814858        }
     
    829873
    830874        ?>
    831         <select name="<?php echo $name; ?>[operator]">
    832             <option value="older_than" <?php selected( 'older_than', $operator ); ?>><?php _e( 'older than', 'advanced-ads' ); ?></option>
    833             <option value="younger_than" <?php selected( 'younger_than', $operator ); ?>><?php _e( 'younger than', 'advanced-ads' ); ?></option>
     875        <select name="<?php echo esc_attr( $name ); ?>[operator]">
     876            <option value="older_than" <?php selected( 'older_than', $operator ); ?>><?php esc_html_e( 'older than', 'advanced-ads' ); ?></option>
     877            <option value="younger_than" <?php selected( 'younger_than', $operator ); ?>><?php esc_html_e( 'younger than', 'advanced-ads' ); ?></option>
    834878        </select>
    835879
     
    11011145
    11021146        // check general conditions added by other add-ons.
    1103         if ( null !== ( $result = apply_filters( 'advanced-ads-display-conditions-check-general', null, $options['value'] ) ) ) {
     1147        $result = apply_filters( 'advanced-ads-display-conditions-check-general', null, $options['value'] );
     1148        if ( null !== ( $result ) ) {
    11041149            return $result;
    11051150        }
     
    11241169
    11251170        // check home page.
    1126         if ( ( ( isset( $query['is_front_page'] ) && $query['is_front_page'] )
    1127               || ( isset( $query['is_home'] ) && $query['is_home'] ) )
    1128              && in_array( 'is_front_page', $options['value'], true )
     1171        if (
     1172            ( ( isset( $query['is_front_page'] ) && $query['is_front_page'] ) || ( isset( $query['is_home'] ) && $query['is_home'] ) )
     1173            && in_array( 'is_front_page', $options['value'], true )
    11291174        ) {
    11301175            return true;
    1131         } elseif ( isset( $query['is_front_page'] ) && $query['is_front_page'] && (
    1132             ! in_array( 'is_front_page', $options['value'], true )
    1133             ) ) {
     1176        } elseif ( isset( $query['is_front_page'] ) && $query['is_front_page'] && ( ! in_array( 'is_front_page', $options['value'], true ) ) ) {
    11341177            return false;
    11351178        }
     
    11381181        foreach ( self::$query_var_keys as $_type ) {
    11391182            if ( 'is_main_query' !== $_type && isset( $query[ $_type ] ) && $query[ $_type ] &&
    1140                  in_array( $_type, $options['value'], true ) ) {
     1183                in_array( $_type, $options['value'], true ) ) {
    11411184                return true;
    11421185            }
     
    11551198     */
    11561199    public static function check_content_age( $options, Advanced_Ads_Ad $ad ) {
    1157         global $post;
     1200        $post = get_post();
     1201
     1202        if ( ! $post
     1203            && wp_doing_ajax()
     1204            && isset( $_REQUEST['action'], $_REQUEST['theId'], $_REQUEST['isSingular'] )
     1205            && sanitize_key( $_REQUEST['action'] ) === 'advads_ad_select'
     1206            && ( $_REQUEST['isSingular'] )
     1207        ) {
     1208            $post = get_post( (int) $_REQUEST['theId'] );
     1209        }
    11581210
    11591211        $operator = ( isset( $options['operator'] ) && 'younger_than' === $options['operator'] ) ? 'younger_than' : 'older_than';
     
    12501302        }
    12511303        // get conditions with rebased index keys.
    1252         $conditions = array_values( $options['conditions'] );
    1253         $query      = $options['wp_the_query'];
    1254         $post       = isset( $options['post'] ) ? $options['post'] : null;
    1255 
    1256 
     1304        $conditions  = array_values( $options['conditions'] );
     1305        $query       = $options['wp_the_query'];
     1306        $post        = isset( $options['post'] ) ? $options['post'] : null;
    12571307        $last_result = false;
    12581308        $length      = count( $conditions );
    12591309
    1260         for ( $i = 0; $i < $length; ++ $i ) {
     1310        for ( $i = 0; $i < $length; ++$i ) {
    12611311            $_condition = current( $conditions );
    12621312            $next       = next( $conditions );
     
    12731323            $next_tax = ( isset( $next['type'] ) && isset( $this->conditions[ $next['type'] ]['taxonomy'] ) ) ? $this->conditions[ $next['type'] ]['taxonomy'] : false;
    12741324            if ( $tax && $next_tax && $next_key
    1275                  && $next_tax === $tax
    1276                  && ( ! isset( $next['connector'] ) || 'or' !== $next['connector'] )
    1277                  && 'is' === $_condition['operator'] && 'is' === $next['operator']
    1278                  && $_condition['type'] !== $next['type'] ) {
    1279                 $next['connector']                    = 'or';
    1280                 $conditions[ $next_key ]['connector'] = 'or';
     1325                && $next_tax === $tax
     1326                && ( ! isset( $next['connector'] ) || 'or' !== $next['connector'] )
     1327                && 'is' === $_condition['operator'] && 'is' === $next['operator']
     1328                && $_condition['type'] !== $next['type']
     1329            ) {
     1330                    $next['connector']                    = 'or';
     1331                    $conditions[ $next_key ]['connector'] = 'or';
    12811332            }
    12821333
     
    14181469    public static function modify_post_search_sql( $sql ) {
    14191470        global $wpdb;
    1420 
    1421         // $sql = preg_replace_callback( "/{$wpdb->posts}.post_(content|excerpt)( NOT)? LIKE '%(.*?)%'/", array( 'Advanced_Ads_Display_Conditions', 'modify_post_search_sql_callback' ), $sql );
    1422 
    14231471        // removes the search in content and excerpt columns.
    14241472        $sql = preg_replace( "/OR \({$wpdb->posts}.post_(content|excerpt)( NOT)? LIKE '(.*?)'\)/", '', $sql );
     
    14471495        }
    14481496    }
    1449 
    14501497}
  • advanced-ads/tags/1.49.0/classes/frontend_checks.php

    r3005553 r3029416  
    11<?php
    22// phpcs:ignoreFile
     3
     4use AdvancedAds\Assets_Registry;
    35use AdvancedAds\Utilities\WordPress;
    46
     
    4850        if ( Advanced_Ads_Ad_Health_Notices::notices_enabled() ) {
    4951            add_action( 'body_class', [ $this, 'body_class' ] );
     52        }
     53
     54        if( $this->has_adblocker_placements() ) {
     55            if ( ! Assets_Registry::script_is('find-adblocker', 'enqueued') ) {
     56                Assets_Registry::enqueue_script('find-adblocker');
     57            }
    5058        }
    5159    }
     
    11171125        return false;
    11181126    }
     1127
     1128    /**
     1129     * Check if atleast one placement uses `adblocker item`.
     1130     *
     1131     * @return bool True/False.
     1132     */
     1133    private function has_adblocker_placements() {
     1134        $placements = Advanced_Ads::get_instance()->get_model()->get_ad_placements_array();
     1135        foreach ($placements as $placement) {
     1136            if (!empty($placement['options']['item_adblocker'])) {
     1137                return true;
     1138            }
     1139        }
     1140
     1141        return false;
     1142    }
    11191143}
  • advanced-ads/tags/1.49.0/classes/plugin.php

    r2986093 r3029416  
    215215        }
    216216
     217        $frontend_prefix = $this->get_frontend_prefix();
     218
    217219        ob_start();
    218220        ?>
    219         <script id="<?php echo esc_attr( $this->get_frontend_prefix() ); ?>ready">
     221        <script id="<?php echo esc_attr( $frontend_prefix ); ?>ready">
    220222            <?php
    221223            readfile( sprintf(
     
    227229        </script>
    228230        <?php
     231
     232        /**
     233         * Print inline script in the page header form add-ons.
     234         *
     235         * @param string $frontend_prefix the prefix used for Advanced Ads related HTML ID-s and classes.
     236         */
     237        do_action( 'advanced_ads_inline_header_scripts', $frontend_prefix );
    229238        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaping would break the HTML
    230239        echo Advanced_Ads_Utils::get_inline_asset( ob_get_clean() );
  • advanced-ads/tags/1.49.0/includes/admin/class-assets.php

    r3005553 r3029416  
    6464        // TODO: add conditional loading.
    6565        Assets_Registry::enqueue_script( 'admin-global' );
    66         Assets_Registry::enqueue_script( 'admin-find-adblocker' );
     66        Assets_Registry::enqueue_script( 'find-adblocker' );
    6767
    6868        $params = [
  • advanced-ads/tags/1.49.0/includes/class-assets-registry.php

    r2983598 r3029416  
    5353
    5454    /**
     55     * Determines whether a script has been added to the queue.
     56     *
     57     * @param string $handle Name of the script.
     58     * @param string $status Optional. Status of the script to check. Default 'enqueued'.
     59     *                       Accepts 'enqueued', 'registered', 'queue', 'to_do', and 'done'.
     60     *
     61     * @return bool
     62     */
     63    public static function script_is( $handle, $status = 'enqueued' ): bool {
     64        return wp_script_is( self::prefix_it( $handle ), $status );
     65    }
     66
     67    /**
    5568     * Hook into WordPress.
    5669     *
     
    5972    public function hooks(): void {
    6073        add_action( 'admin_enqueue_scripts', [ $this, 'register_assets' ], 0 );
     74        add_action( 'wp_enqueue_scripts', [ $this, 'register_assets' ], 0 );
    6175    }
    6276
     
    89103    public function register_scripts(): void {
    90104        $this->register_script( 'admin-global', 'admin/assets/js/admin-global.js', [ 'jquery' ], false, true );
    91         $this->register_script( 'admin-find-adblocker', 'admin/assets/js/advertisement.js' );
     105        $this->register_script( 'find-adblocker', 'admin/assets/js/advertisement.js' );
    92106        $this->register_script( 'ui', 'admin/assets/js/ui.js', [ 'jquery' ] );
    93107        $this->register_script( 'conditions', 'admin/assets/js/conditions.js', [ 'jquery', self::prefix_it( 'ui' ) ] );
  • advanced-ads/tags/1.49.0/languages/advanced-ads.pot

    r3006148 r3029416  
    1 # Copyright (C) 2023 Advanced Ads GmbH
     1# Copyright (C) 2024 Advanced Ads GmbH
    22# This file is distributed under the GPL-2.0+.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Advanced Ads 1.48.0\n"
     5"Project-Id-Version: Advanced Ads 1.48.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n"
    77"Last-Translator: Thomas Maier <[email protected]>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2023-12-06T11:22:58+00:00\n"
     12"POT-Creation-Date: 2024-01-31T11:13:51+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.6.0\n"
     
    8585#. translators: %s is empty here, but the string will be followed by a name of an ad unit.
    8686#: admin/includes/ad-health-notices.php:112
    87 #: classes/frontend_checks.php:272
     87#: classes/frontend_checks.php:280
    8888msgid "Visible ads should not use the Header placement: %s"
    8989msgstr ""
     
    9191#: admin/includes/ad-health-notices.php:123
    9292#: classes/ad-debug.php:272
    93 #: classes/frontend_checks.php:259
     93#: classes/frontend_checks.php:267
    9494msgid "Your website is using HTTPS, but the ad code contains HTTP and might not work."
    9595msgstr ""
     
    293293
    294294#: admin/includes/class-ad-type.php:953
    295 #: classes/frontend_checks.php:539
     295#: classes/frontend_checks.php:547
    296296msgid "Get help"
    297297msgstr ""
     
    482482#: admin/views/settings/general/disable-notices.php:14
    483483#: classes/ad_type_plain.php:255
    484 #: classes/display-conditions.php:843
     484#: classes/display-conditions.php:887
    485485#: modules/ads-txt/admin/views/setting-create.php:12
    486486#: modules/privacy/admin/views/setting-general.php:34
     
    511511msgstr ""
    512512
    513 #: admin/includes/class-meta-box.php:267
     513#: admin/includes/class-meta-box.php:268
    514514#: admin/includes/class-overview-widgets.php:64
    515515msgid "Disable"
    516516msgstr ""
    517517
    518 #: admin/includes/class-meta-box.php:429
     518#: admin/includes/class-meta-box.php:430
    519519msgid "Ad Settings"
    520520msgstr ""
    521521
    522 #: admin/includes/class-meta-box.php:528
     522#: admin/includes/class-meta-box.php:529
    523523#: includes/admin/pages/class-dashboard.php:33
    524524#: includes/admin/pages/class-dashboard.php:44
     
    528528
    529529#. translators: %1$d is the number of ads, %2$s and %3$s are URLs.
    530 #: admin/includes/class-meta-box.php:544
     530#: admin/includes/class-meta-box.php:545
    531531msgid "%1$d ads – <a href=\"%2$s\">manage</a> - <a href=\"%3$s\">new</a>"
    532532msgstr ""
    533533
    534 #: admin/includes/class-meta-box.php:557
     534#: admin/includes/class-meta-box.php:558
    535535msgid "Get the tutorial via email"
    536536msgstr ""
    537537
    538 #: admin/includes/class-meta-box.php:566
     538#: admin/includes/class-meta-box.php:567
    539539msgid "Get AdSense tips via email"
    540540msgstr ""
    541541
    542 #: admin/includes/class-meta-box.php:575
     542#: admin/includes/class-meta-box.php:576
    543543msgid "Visit our blog for more articles about ad optimization"
    544544msgstr ""
    545545
    546546#. translators: %s is our URL.
    547 #: admin/includes/class-meta-box.php:630
     547#: admin/includes/class-meta-box.php:631
    548548msgid "Latest posts on wpadvancedads.com"
    549549msgstr ""
     
    12571257msgstr ""
    12581258
    1259 #. translators: %1$d is the number of elements in the list and %2$s a URL.
    1260 #: admin/views/conditions/condition-author.php:41
    1261 msgid "Only %1$d elements are displayed above. Use the <code>advanced-ads-admin-max-terms</code> filter to change this limit according to <a href=\"%2$s\" target=\"_blank\">this page</a>."
     1259#: admin/views/conditions/condition-author.php:37
     1260msgctxt "display the authors search field on ad edit page"
     1261msgid "add more authors"
     1262msgstr ""
     1263
     1264#: admin/views/conditions/condition-author.php:43
     1265msgid "author name or id"
    12621266msgstr ""
    12631267
     
    16901694
    16911695#: admin/views/settings/general/block-bots.php:11
    1692 #: classes/frontend_checks.php:130
     1696#: classes/frontend_checks.php:138
    16931697msgid "You look like a bot"
    16941698msgstr ""
     
    20602064
    20612065#. translators: %s is a URL.
    2062 #: classes/ad_ajax_callbacks.php:262
     2066#: classes/ad_ajax_callbacks.php:296
    20632067msgid "An error occurred. Please use <a href=\"%s\" target=\"_blank\">this form</a> to sign up."
    20642068msgstr ""
     
    23022306msgstr ""
    23032307
     2308#: classes/display-conditions.php:88
     2309msgid "post type"
     2310msgstr ""
     2311
    23042312#: classes/display-conditions.php:89
    2305 msgid "post type"
    2306 msgstr ""
    2307 
    2308 #: classes/display-conditions.php:90
    23092313#: includes/array_ad_conditions.php:40
    23102314msgid "Choose the public post types on which to display the ad."
    23112315msgstr ""
    23122316
     2317#: classes/display-conditions.php:95
     2318msgid "specific pages"
     2319msgstr ""
     2320
    23132321#: classes/display-conditions.php:96
    2314 msgid "specific pages"
    2315 msgstr ""
    2316 
    2317 #: classes/display-conditions.php:97
    23182322#: includes/array_ad_conditions.php:58
    23192323msgid "Choose on which individual posts, pages and public post type pages you want to display or hide ads."
    23202324msgstr ""
    23212325
    2322 #: classes/display-conditions.php:103
     2326#: classes/display-conditions.php:102
    23232327msgid "general conditions"
    23242328msgstr ""
    23252329
    2326 #: classes/display-conditions.php:109
     2330#: classes/display-conditions.php:108
    23272331msgid "author"
    23282332msgstr ""
    23292333
     2334#: classes/display-conditions.php:114
     2335msgid "content age"
     2336msgstr ""
     2337
    23302338#: classes/display-conditions.php:115
    2331 msgid "content age"
    2332 msgstr ""
    2333 
    2334 #: classes/display-conditions.php:116
    23352339msgid "Display ads based on age of the page."
    23362340msgstr ""
    23372341
     2342#: classes/display-conditions.php:121
     2343msgid "taxonomy"
     2344msgstr ""
     2345
    23382346#: classes/display-conditions.php:122
    2339 msgid "taxonomy"
    2340 msgstr ""
    2341 
    2342 #: classes/display-conditions.php:123
    23432347msgid "Display ads based on the taxonomy of an archive page."
    23442348msgstr ""
    23452349
    23462350#. translators: %s is a label of an archive page.
    2347 #: classes/display-conditions.php:171
     2351#: classes/display-conditions.php:170
    23482352msgid "archive: %s"
    23492353msgstr ""
    23502354
    2351 #: classes/display-conditions.php:287
     2355#: classes/display-conditions.php:288
    23522356msgid "parent page"
    23532357msgstr ""
    23542358
    2355 #: classes/display-conditions.php:288
     2359#: classes/display-conditions.php:289
    23562360msgid "post meta"
    23572361msgstr ""
    23582362
    2359 #: classes/display-conditions.php:289
     2363#: classes/display-conditions.php:290
    23602364msgid "page template"
    23612365msgstr ""
    23622366
    2363 #: classes/display-conditions.php:290
     2367#: classes/display-conditions.php:291
    23642368msgid "url parameters"
    23652369msgstr ""
    23662370
    2367 #: classes/display-conditions.php:293
     2371#: classes/display-conditions.php:294
    23682372msgid "accelerated mobile pages"
    23692373msgstr ""
     
    23842388msgstr ""
    23852389
    2386 #: classes/display-conditions.php:627
     2390#: classes/display-conditions.php:641
    23872391msgctxt "display the terms search field on ad edit page"
    23882392msgid "add more terms"
    23892393msgstr ""
    23902394
    2391 #: classes/display-conditions.php:631
     2395#: classes/display-conditions.php:647
    23922396msgid "term name or id"
    23932397msgstr ""
    23942398
    2395 #: classes/display-conditions.php:701
     2399#: classes/display-conditions.php:726
    23962400msgid "title or id"
    23972401msgstr ""
    23982402
    2399 #: classes/display-conditions.php:756
     2403#: classes/display-conditions.php:800
    24002404#: includes/array_ad_conditions.php:63
    24012405msgid "Home Page"
    24022406msgstr ""
    24032407
    2404 #: classes/display-conditions.php:757
     2408#: classes/display-conditions.php:801
    24052409#: includes/array_ad_conditions.php:64
    24062410msgid "show on Home page"
    24072411msgstr ""
    24082412
    2409 #: classes/display-conditions.php:761
     2413#: classes/display-conditions.php:805
    24102414#: includes/array_ad_conditions.php:68
    24112415msgid "Singular Pages"
    24122416msgstr ""
    24132417
    2414 #: classes/display-conditions.php:762
     2418#: classes/display-conditions.php:806
    24152419#: includes/array_ad_conditions.php:69
    24162420msgid "show on singular pages/posts"
    24172421msgstr ""
    24182422
    2419 #: classes/display-conditions.php:766
     2423#: classes/display-conditions.php:810
    24202424#: includes/array_ad_conditions.php:73
    24212425msgid "Archive Pages"
    24222426msgstr ""
    24232427
    2424 #: classes/display-conditions.php:767
     2428#: classes/display-conditions.php:811
    24252429#: includes/array_ad_conditions.php:74
    24262430msgid "show on any type of archive page (category, tag, author and date)"
    24272431msgstr ""
    24282432
    2429 #: classes/display-conditions.php:771
     2433#: classes/display-conditions.php:815
    24302434#: includes/array_ad_conditions.php:78
    24312435msgid "Search Results"
    24322436msgstr ""
    24332437
    2434 #: classes/display-conditions.php:772
     2438#: classes/display-conditions.php:816
    24352439#: includes/array_ad_conditions.php:79
    24362440msgid "show on search result pages"
    24372441msgstr ""
    24382442
    2439 #: classes/display-conditions.php:776
     2443#: classes/display-conditions.php:820
    24402444#: includes/array_ad_conditions.php:83
    24412445msgid "404 Page"
    24422446msgstr ""
    24432447
    2444 #: classes/display-conditions.php:777
     2448#: classes/display-conditions.php:821
    24452449#: includes/array_ad_conditions.php:84
    24462450msgid "show on 404 error page"
    24472451msgstr ""
    24482452
    2449 #: classes/display-conditions.php:781
     2453#: classes/display-conditions.php:825
    24502454#: includes/array_ad_conditions.php:88
    24512455msgid "Attachment Pages"
    24522456msgstr ""
    24532457
    2454 #: classes/display-conditions.php:782
     2458#: classes/display-conditions.php:826
    24552459#: includes/array_ad_conditions.php:89
    24562460msgid "show on attachment pages"
    24572461msgstr ""
    24582462
    2459 #: classes/display-conditions.php:786
     2463#: classes/display-conditions.php:830
    24602464#: includes/array_ad_conditions.php:93
    24612465msgid "Secondary Queries"
    24622466msgstr ""
    24632467
    2464 #: classes/display-conditions.php:787
     2468#: classes/display-conditions.php:831
    24652469#: includes/array_ad_conditions.php:94
    24662470msgid "allow ads in secondary queries"
    24672471msgstr ""
    24682472
    2469 #: classes/display-conditions.php:791
     2473#: classes/display-conditions.php:835
    24702474msgid "RSS Feed"
    24712475msgstr ""
    24722476
    2473 #: classes/display-conditions.php:792
     2477#: classes/display-conditions.php:836
    24742478msgid "allow ads in RSS Feed"
    24752479msgstr ""
    24762480
    2477 #: classes/display-conditions.php:796
     2481#: classes/display-conditions.php:840
    24782482msgid "REST API"
    24792483msgstr ""
    24802484
    2481 #: classes/display-conditions.php:797
     2485#: classes/display-conditions.php:841
    24822486msgid "allow ads in REST API"
    24832487msgstr ""
    24842488
    2485 #: classes/display-conditions.php:832
     2489#: classes/display-conditions.php:876
    24862490msgid "older than"
    24872491msgstr ""
    24882492
    2489 #: classes/display-conditions.php:833
     2493#: classes/display-conditions.php:877
    24902494msgid "younger than"
    24912495msgstr ""
    24922496
    2493 #: classes/display-conditions.php:838
     2497#: classes/display-conditions.php:882
    24942498msgid "days"
    24952499msgstr ""
    24962500
    2497 #: classes/display-conditions.php:841
     2501#: classes/display-conditions.php:885
    24982502msgid "Display ads based on the age of a page or post."
    24992503msgstr ""
     
    25512555msgstr ""
    25522556
    2553 #: classes/frontend_checks.php:115
     2557#: classes/frontend_checks.php:123
    25542558msgid "Random AdSense ads"
    25552559msgstr ""
    25562560
    2557 #: classes/frontend_checks.php:144
     2561#: classes/frontend_checks.php:152
    25582562msgid "Ad blocker enabled"
    25592563msgstr ""
    25602564
    2561 #: classes/frontend_checks.php:156
     2565#: classes/frontend_checks.php:164
    25622566msgid "<em>%s</em> filter does not exist"
    25632567msgstr ""
    25642568
    2565 #: classes/frontend_checks.php:172
     2569#: classes/frontend_checks.php:180
    25662570msgid "Ads are disabled in the content of this page"
    25672571msgstr ""
    25682572
    2569 #: classes/frontend_checks.php:184
     2573#: classes/frontend_checks.php:192
    25702574msgid "the current post ID is 0 "
    25712575msgstr ""
    25722576
    2573 #: classes/frontend_checks.php:203
     2577#: classes/frontend_checks.php:211
    25742578msgid "Ads are disabled on this page"
    25752579msgstr ""
    25762580
    2577 #: classes/frontend_checks.php:217
     2581#: classes/frontend_checks.php:225
    25782582msgid "Ads are disabled on all pages"
    25792583msgstr ""
    25802584
    2581 #: classes/frontend_checks.php:232
     2585#: classes/frontend_checks.php:240
    25822586msgid "Ads are disabled on 404 pages"
    25832587msgstr ""
    25842588
    2585 #: classes/frontend_checks.php:246
     2589#: classes/frontend_checks.php:254
    25862590msgid "Ads are disabled on non singular pages"
    25872591msgstr ""
    25882592
    2589 #: classes/frontend_checks.php:260
     2593#: classes/frontend_checks.php:268
    25902594msgid "Ad IDs: %s"
    25912595msgstr ""
    25922596
    2593 #: classes/frontend_checks.php:288
     2597#: classes/frontend_checks.php:296
    25942598msgid "AdSense violation"
    25952599msgstr ""
    25962600
    2597 #: classes/frontend_checks.php:289
     2601#: classes/frontend_checks.php:297
    25982602msgid "Ad is hidden"
    25992603msgstr ""
    26002604
    2601 #: classes/frontend_checks.php:290
     2605#: classes/frontend_checks.php:298
    26022606msgid "IDs: %s"
    26032607msgstr ""
    26042608
    2605 #: classes/frontend_checks.php:306
     2609#: classes/frontend_checks.php:314
    26062610msgid "The following responsive AdSense ads are not showing up: %s"
    26072611msgstr ""
    26082612
    2609 #: classes/frontend_checks.php:323
     2613#: classes/frontend_checks.php:331
    26102614msgid "Consent not given"
    26112615msgstr ""
    26122616
    2613 #: classes/frontend_checks.php:340
     2617#: classes/frontend_checks.php:348
    26142618msgid "Enable TCF integration"
    26152619msgstr ""
    26162620
    2617 #: classes/frontend_checks.php:355
     2621#: classes/frontend_checks.php:363
    26182622msgid "Debug Google Ad Manager"
    26192623msgstr ""
    26202624
    2621 #: classes/frontend_checks.php:372
     2625#: classes/frontend_checks.php:380
    26222626msgid "highlight ads"
    26232627msgstr ""
    26242628
    2625 #: classes/frontend_checks.php:492
     2629#: classes/frontend_checks.php:500
    26262630msgid "Ad Health"
    26272631msgstr ""
    26282632
    2629 #: classes/frontend_checks.php:507
     2633#: classes/frontend_checks.php:515
    26302634msgid "Show %d more notifications"
    26312635msgstr ""
    26322636
    2633 #: classes/frontend_checks.php:526
     2637#: classes/frontend_checks.php:534
    26342638msgid "Everything is fine"
    26352639msgstr ""
    26362640
    2637 #: classes/frontend_checks.php:597
     2641#: classes/frontend_checks.php:605
    26382642msgid "the following code is used for automatic error detection and only visible to admins"
    26392643msgstr ""
     
    32803284msgstr ""
    32813285
    3282 #: modules/adblock-finder/admin/views/setting-ga.php:10
     3286#: modules/adblock-finder/admin/views/setting-ga.php:12
    32833287msgid "Google Analytics Tracking ID"
    32843288msgstr ""
    32853289
    3286 #: modules/adblock-finder/admin/views/setting-ga.php:14
    3287 msgid "Do you want to know how many of your visitors are using an ad blocker? Enter your Google Analytics property ID above to count them."
    3288 msgstr ""
    3289 
    3290 #. translators: 1: is an example id for Universal Analytics <code>UA-123456-1</code>, 2: is an example id for GA4 '<code>G-A12BC3D456</code>'
     3290#. translators: %s is demo GA4 ID.
    32913291#: modules/adblock-finder/admin/views/setting-ga.php:19
    3292 msgid "%1$s for Universal Analytics or %2$s for Google Analytics 4."
     3292msgid "Do you want to know how many visitors use an ad blocker? Enter your Google Analytics property ID (%s) above to count them."
    32933293msgstr ""
    32943294
  • advanced-ads/tags/1.49.0/modules/adblock-finder/admin/views/setting-ga.php

    r2609369 r3029416  
    33 * Input for Google Analytics property ID.
    44 *
     5 * @package Advanced_Ads_Admin
    56 * @var string $ga_uid Google Analytics property ID
    67 */
     8
    79?>
    810<label>
     
    1214
    1315<p class="description">
    14     <?php esc_html_e( 'Do you want to know how many of your visitors are using an ad blocker? Enter your Google Analytics property ID above to count them.', 'advanced-ads' ); ?>
    15     <br>
    1616    <?php
    1717    printf(
    18     /* translators: 1: is an example id for Universal Analytics <code>UA-123456-1</code>, 2: is an example id for GA4 '<code>G-A12BC3D456</code>' */
    19         esc_html__( '%1$s for Universal Analytics or %2$s for Google Analytics 4.', 'advanced-ads' ),
    20         '<code>UA-123456-1</code>',
     18        // translators: %s is demo GA4 ID.
     19        esc_html__(
     20            'Do you want to know how many visitors use an ad blocker? Enter your Google Analytics property ID (%s) above to count them.',
     21            'advanced-ads'
     22        ),
    2123        '<code>G-A12BC3D456</code>'
    2224    );
  • advanced-ads/tags/1.49.0/modules/adblock-finder/public/adblocker-enabled.js

    r2587606 r3029416  
    22 * Check if an ad blocker is enabled.
    33 *
    4  * @param {function} callback A callback function that is executed after the check has been done.
    5  *                            The 'is_enabled' (bool) variable is passed as the callback's first argument.
     4 * @param function callback A callback function that is executed after the check has been done.
     5 *                 The 'isEnabled' (bool) variable is passed as the callback's first argument.
    66 */
    7 window.advanced_ads_check_adblocker = ( function ( callback ) {
    8     var pending_callbacks = [];
    9     var is_enabled        = null;
     7window.advanced_ads_check_adblocker = (function (callback) {
     8    let pendingCallbacks = [];
     9    let isEnabled = null;
    1010
    11     function RAF( RAF_callback ) {
    12         var fn = window.requestAnimationFrame
    13             || window.mozRequestAnimationFrame
    14             || window.webkitRequestAnimationFrame
    15             || function ( RAF_callback ) {
    16                 return setTimeout( RAF_callback, 16 );
     11    function RAF(RAF_callback) {
     12        const fn =
     13            window.requestAnimationFrame ||
     14            window.mozRequestAnimationFrame ||
     15            window.webkitRequestAnimationFrame ||
     16            function (RAF_callback) {
     17                return setTimeout(RAF_callback, 16);
    1718            };
    1819
    19         fn.call( window, RAF_callback );
     20        fn.call(window, RAF_callback);
    2021    }
    2122
    22     RAF( function () {
     23    RAF(function () {
    2324        // Create a bait.
    24         var ad       = document.createElement( 'div' );
     25        const ad = document.createElement('div');
    2526        ad.innerHTML = '&nbsp;';
    26         ad.setAttribute( 'class', 'ad_unit ad-unit text-ad text_ad pub_300x250' );
    27         ad.setAttribute( 'style', 'width: 1px !important; height: 1px !important; position: absolute !important; left: 0px !important; top: 0px !important; overflow: hidden !important;' );
    28         document.body.appendChild( ad );
     27        ad.setAttribute('class', 'ad_unit ad-unit text-ad text_ad pub_300x250');
     28        ad.setAttribute(
     29            'style',
     30            'width: 1px !important; height: 1px !important; position: absolute !important; left: 0px !important; top: 0px !important; overflow: hidden !important;'
     31        );
     32        document.body.appendChild(ad);
    2933
    30         RAF( function () {
    31             var styles      = window.getComputedStyle && window.getComputedStyle( ad );
    32             var moz_binding = styles && styles.getPropertyValue( '-moz-binding' );
     34        RAF(function () {
     35            const styles = window.getComputedStyle?.(ad);
     36            const mozBinding = styles?.getPropertyValue('-moz-binding');
    3337
    34             is_enabled = ( styles && styles.getPropertyValue( 'display' ) === 'none' )
    35                 || ( typeof moz_binding === 'string' && moz_binding.indexOf( 'about:' ) !== - 1 );
     38            isEnabled =
     39                (styles && styles.getPropertyValue('display') === 'none') ||
     40                (typeof mozBinding === 'string' &&
     41                    mozBinding.indexOf('about:') !== -1);
    3642
    3743            // Call pending callbacks.
    38             for ( var i = 0, length = pending_callbacks.length; i < length; i ++ ) {
    39                 pending_callbacks[i]( is_enabled );
     44            for (var i = 0, length = pendingCallbacks.length; i < length; i++) {
     45                pendingCallbacks[i](isEnabled);
    4046            }
    41             pending_callbacks = [];
    42         } );
    43     } );
     47            pendingCallbacks = [];
     48        });
     49    });
    4450
    45     return function ( callback ) {
    46         if ( is_enabled === null ) {
    47             pending_callbacks.push( callback );
     51    return function (callback) {
     52        if ('undefined' === typeof advanced_ads_adblocker_test) {
     53            isEnabled = true;
     54        }
     55        if (isEnabled === null) {
     56            pendingCallbacks.push(callback);
    4857            return;
    4958        }
    5059        // Run the callback immediately
    51         callback( is_enabled );
     60        callback(isEnabled);
    5261    };
    53 }() );
     62})();
  • advanced-ads/tags/1.49.0/modules/adblock-finder/public/adblocker-enabled.min.js

    r2983598 r3029416  
    1 window.advanced_ads_check_adblocker=function(t){var n=[],e=null;function i(t){var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return setTimeout(t,16)};n.call(window,t)}return i((function(){var t=document.createElement("div");t.innerHTML="&nbsp;",t.setAttribute("class","ad_unit ad-unit text-ad text_ad pub_300x250"),t.setAttribute("style","width: 1px !important; height: 1px !important; position: absolute !important; left: 0px !important; top: 0px !important; overflow: hidden !important;"),document.body.appendChild(t),i((function(){var i=window.getComputedStyle&&window.getComputedStyle(t),o=i&&i.getPropertyValue("-moz-binding");e=i&&"none"===i.getPropertyValue("display")||"string"==typeof o&&-1!==o.indexOf("about:");for(var a=0,r=n.length;a<r;a++)n[a](e);n=[]}))})),function(t){null!==e?t(e):n.push(t)}}();
     1window.advanced_ads_check_adblocker=function(t){var n=[],e=null;function i(t){var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return setTimeout(t,16)};n.call(window,t)}return i((function(){var t=document.createElement("div");t.innerHTML="&nbsp;",t.setAttribute("class","ad_unit ad-unit text-ad text_ad pub_300x250"),t.setAttribute("style","width: 1px !important; height: 1px !important; position: absolute !important; left: 0px !important; top: 0px !important; overflow: hidden !important;"),document.body.appendChild(t),i((function(){var i,o,a=null===(i=(o=window).getComputedStyle)||void 0===i?void 0:i.call(o,t),d=null==a?void 0:a.getPropertyValue("-moz-binding");e=a&&"none"===a.getPropertyValue("display")||"string"==typeof d&&-1!==d.indexOf("about:");for(var r=0,u=n.length;r<u;r++)n[r](e);n=[]}))})),function(t){"undefined"==typeof advanced_ads_adblocker_test&&(e=!0),null!==e?t(e):n.push(t)}}();
  • advanced-ads/tags/1.49.0/readme.txt

    r3006148 r3029416  
    55Tested up to: 6.4
    66Requires PHP: 7.2
    7 Stable tag: 1.48.1
     7Stable tag: 1.49.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1313== Description ==
    1414
    15 Are you looking for a simple ad manager plugin? These are the top arguments to use Advanced Ads:
    16 
    17 * approved in publishing and ad optimization since 2009
    18 * works with all ad types and networks, including Google AdSense, Google Ad Manager (formerly Google DoubleClick for Publishers, DFP), Amazon ads, or media.net ads
    19 * most features to test and optimize ads
    20 * unlimited ad units
    21 * ads.txt support
    22 * dedicated ad block for the block editor
    23 * Google AdSense Partner, who implements all technical changes early and in 100% compliance with the Google AdSense policies
    24 * the only advertising solution with *Ad Health* integration and Google AdSense violation checks
    25 * best rated [free support](https://wordpress.org/support/plugin/advanced-ads)
     15= The ultimate ad management plugin for WordPress =
     16
     17Advanced Ads is the most comprehensive ad management tool available. It strikes the perfect balance between ease of use and powerful features, trusted by thousands of companies and businesses.
     18
     19We took the pain out of advertising and made it easy to embed ads, banners, or any other code automatically—all within minutes and without the need for theme file editing. If you are looking for the best plugin for ad management, you have found it.
     20
     21[Manual](https://wpadvancedads.com/manual/?utm_source=wporg&utm_medium=link&utm_campaign=wp-linkbar-manual) | [Support](https://wpadvancedads.com/aa-links/support) | [Demo](https://wpadvancedads.com/aa-links/demo) | [Premium Features](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-linkbar-features)
     22
     23* <strong>Usability:</strong> Clearly structured interface • Smart workflows for fluid day-to-day operations
     24* <strong>Functionality:</strong> Setting the gold standard for the market with outstanding features
     25* <strong>Compatibility:</strong> All ad networks • Dedicated integrations with loads of popular plugins and themes
     26* <strong>Expertise:</strong> Fast and top-rated support • Approved in publishing and ad optimization since 2009
     27* <strong>Reputation:</strong> Recommended by Google • Fully compliant with Google AdSense policies
     28
     29Would you like to know if there is a certain feature, what the optimized setup would be, or how to implement your client’s demands? Just [open a thread in the forum](https://wordpress.org/support/plugin/advanced-ads#new-post)!
    2630
    2731This is what our users are saying about Advanced Ads:
    2832
    29 > We use this plugin to deliver rotating ads on a community news site, and it’s great. Both feature-rich and reliable, your imagination is the limit when it comes to the product you want to create for your users. We’ve delivered over a million ad impressions since we launched less than a year ago, using a combination of sidebar, top, sticky and in-content placements — both HTML5 and images. Advanced Ads makes it easy for our small team to deliver a good experience to our users and our advertisers.
    30 > mytown304 on wp.org
    31 
    32 Would you like to know if there is a certain feature, what the optimized setup would be, or how to implement your client’s demands? Just [open a thread in the forum](https://wordpress.org/support/plugin/advanced-ads#new-post)!
    33 
    34 Advanced Ads allowed us to grow from 0 to 100 MM monthly ad impressions. Benefit from our experience as a publisher and monetize your website today!
    35 
    36 > **Advanced Ads All Access**
    37 >This plugin is the lite version of the Advanced Ads plugin that comes with all the features you will ever need to optimize your ads and increase your revenues, including advanced ad targeting, split tests, click fraud protection, lazy loading, background, popups and sticky ads, full AMP support, adblocker detection, the most comfortable Google Ad Manager integration, and tons more. [Click here to purchase the best premium WordPress ad management plugin now!](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-all-access)
     33> We use this plugin to deliver rotating ads on a community news site, and it’s great. We’ve delivered over a million ad impressions since we launched less than a year ago, using a combination of sidebar, top, sticky and in-content placements — both HTML5 and images. Advanced Ads makes it easy for our small team to deliver a good experience to our users and our advertisers.
     34> <i>mytown304 on wp.org</i>
     35
     36Advanced Ads allowed our founder to grow from 0 to 100 MM monthly ad impressions. Benefit from our experience as publishers and monetize your website today!
     37
     38= Premium Features =
     39This plugin is the lite version of the Advanced Ads plugin that comes with all the features you will ever need to optimize your ads and increase your revenues, including performance tracking, advanced ad targeting, split tests, click fraud protection, lazy loading, background ads, popups and sticky ads, full AMP support, adblocker detection, the most comfortable Google Ad Manager integration, and tons more. [Click here to purchase the best premium WordPress ad management plugin now!](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-all-access)
    3840
    3941[Full Feature List](https://wpadvancedads.com/features/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features)
     
    150152https://vimeo.com/577170591
    151153
    152 > <strong>Add-Ons</strong>
    153 >
    154 > * all add-ons include priority email support
    155 > * [All Access](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – includes all available add-ons
    156 > * [Advanced Ads Pro](https://wpadvancedads.com/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – powerful tools for ad optimizations: cache-busting, more placements, [lazy loading](https://wpadvancedads.com/lazy-load-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features), ad blocker module, [click fraud protection](https://wpadvancedads.com/manual/click-fraud-protection/?utm_source=wporg&utm_medium=link&utm_campaign=features), [geo targeting](https://wpadvancedads.com/add-ons/geo-targeting/?utm_source=wporg&utm_medium=link&utm_campaign=features), [parallax ads](https://wpadvancedads.com/parallax-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features) and many more
    157 > * [Tracking](https://wpadvancedads.com/add-ons/tracking/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – track ad impressions and ad clicks with local methods or Google Analytics
    158 > * [AMP Ads](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – make your ads compatible with AMP and convert Google AdSense ads automatically
    159 > * [Google Ad Manager Integration](https://wpadvancedads.com/add-ons/google-ad-manager/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – a quick and error-free way to load ad units from your Google Ad Manager (formerly Google DoubleClick for Publishers, DFP) account without touching any ad codes
    160 > * [Sticky Ads](https://wpadvancedads.com/add-ons/sticky-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – increase click rates with fixed, sticky, and anchor ads
    161 > * [Fixed Widget for WordPress](https://wordpress.org/plugins/q2w3-fixed-widget/) – turn sidebar widgets into performant fixed sticky ads
    162 > * [PopUp and Layer Ads](https://wpadvancedads.com/add-ons/popup-and-layer-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – display ads and other content in layers, popups, and interstitials
    163 > * [Selling Ads](https://wpadvancedads.com/add-ons/selling-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) - allows you to sell ads on your website fully automated, including payments and advertiser profiles
    164 > * [Ad Slider](https://wpadvancedads.com/add-ons/slider/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – create a simple slider from your ads
    165 > * [Full Feature List](https://wpadvancedads.com/features/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons)
     154= Add-Ons =
     155
     156* all add-ons include priority email support
     157* [All Access](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – includes all available add-ons
     158* [Advanced Ads Pro](https://wpadvancedads.com/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – powerful tools for ad optimizations: cache-busting, more placements, [lazy loading](https://wpadvancedads.com/lazy-load-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features), ad blocker module, [click fraud protection](https://wpadvancedads.com/manual/click-fraud-protection/?utm_source=wporg&utm_medium=link&utm_campaign=features), [geo targeting](https://wpadvancedads.com/add-ons/geo-targeting/?utm_source=wporg&utm_medium=link&utm_campaign=features), [parallax ads](https://wpadvancedads.com/parallax-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features) and many more
     159* [Tracking](https://wpadvancedads.com/add-ons/tracking/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – track ad impressions and ad clicks with local methods or Google Analytics
     160* [AMP Ads](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – make your ads compatible with AMP and convert Google AdSense ads automatically
     161* [Google Ad Manager Integration](https://wpadvancedads.com/add-ons/google-ad-manager/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – a quick and error-free way to load ad units from your Google Ad Manager (formerly Google DoubleClick for Publishers, DFP) account without touching any ad codes
     162* [Sticky Ads](https://wpadvancedads.com/add-ons/sticky-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – increase click rates with fixed, sticky, and anchor ads
     163* [Fixed Widget for WordPress](https://wordpress.org/plugins/q2w3-fixed-widget/) – turn sidebar widgets into performant fixed sticky ads
     164* [PopUp and Layer Ads](https://wpadvancedads.com/add-ons/popup-and-layer-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – display ads and other content in layers, popups, and interstitials
     165* [Selling Ads](https://wpadvancedads.com/add-ons/selling-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) - allows you to sell ads on your website fully automated, including payments and advertiser profiles
     166* [Ad Slider](https://wpadvancedads.com/add-ons/slider/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – create a simple slider from your ads
     167* [Full Feature List](https://wpadvancedads.com/features/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons)
    166168
    167169= ad blocker =
     
    337339== Changelog ==
    338340
    339 = 1.48.1 (December 6, 2023) =
    340 
    341 - Fix: prevent ad weight from always showing 10
    342 
    343 = 1.48.0 (December 5, 2023) =
    344 
    345 - Improvement: show Google Ad Manager debug link in Ad Health even when only a head tag exists
    346 - Improvement: add arrows to jump through highlighted ads
    347 - Improvement: link ads in the group modal
    348 - Improvement: update the plugin list and its descriptions on the dashboard
    349 - Improvement: add correct jumping through highlighted AdSense ads
    350 - Fix: ensure ads without a stored ad weight in the database are displayed on the group page
    351 - Fix: show the tooltip with placement and ad names only when 'highlight ads' is enabled
     341= 1.49.0 (January 31, 2024) =
     342
     343- Improvement: enhance ad blocker detection to identify more ad blockers reliably
     344- Improvement: remove universal analytics description
     345- Fix: allow content age display condition to work with AJAX cache busting
     346- Fix: show search bar for author if max terms reach the limit
     347- Fix: prevent a fatal error on the ad edit page related to Display Conditions
  • advanced-ads/trunk/admin/assets/css/admin.css

    r2995001 r3029416  
    264264#advads-display-conditions, #advads-visitor-conditions { margin-top: 0; }
    265265#ad-targeting-box .advads-conditions-terms-show-search { height: 22px; line-height: 22px; font-weight: bold; font-size: 1.5em; }
    266 .advads-conditions-terms-search { display: none; }
     266.advads-conditions-terms-search, .advads-conditions-authors-search { display: none; }
    267267#advads-ad-usage .advads-usage input { width: 300px; }
    268268.post-type-advanced_ads #ad-parameters-box .advads-ad-parameters-spinner { display: block; float: none; }
  • advanced-ads/trunk/admin/assets/js/conditions.js

    r2701373 r3029416  
    33 */
    44
    5 jQuery( document ).ready(
    6     function ( $ ) {
     5jQuery( document ).ready(function ( $ ) {
    76        /**
    87         * Pressing the button to add a new condition to the list of conditions
     
    111110        }
    112111
     112    // remove author from list by clicking on it.
     113    $(document).on(
     114        'click',
     115        '.advads-conditions-authors-buttons .button',
     116        function () {
     117            $(this).remove();
     118        }
     119    );
     120    // display input field to search for author.
     121    $(document).on(
     122        'click',
     123        '.advads-conditions-authors-show-search',
     124        function (e) {
     125            e.preventDefault();
     126            // display input field.
     127            $(this)
     128                .siblings('.advads-conditions-authors-search')
     129                .show()
     130                .focus();
     131            // register autocomplete.
     132            advadsRegisterAuthorAutocomplete(
     133                $(this).siblings('.advads-conditions-authors-search')
     134            );
     135            $(this).next('br').show();
     136            $(this).hide();
     137        }
     138    );
     139
     140    // author search box autocomplete.
     141    function advadsRegisterAuthorAutocomplete(self) {
     142        self.autocomplete({
     143            classes: {
     144                'ui-autocomplete': 'advads-ui-autocomplete',
     145            },
     146            source(request, callback) {
     147                advadsAuthorSearch(self, callback);
     148            },
     149            minLength: 1,
     150            select(event, ui) {
     151                // append new line with input fields.
     152                $(
     153                    '<label class="button advads-button advads-ui-state-active"><span class="advads-button-text">' +
     154                        ui.item.label +
     155                        '<input type="hidden" name="' +
     156                        self.data('inputName') +
     157                        '" value="' +
     158                        ui.item.value +
     159                        '"></span></label>'
     160                ).appendTo(self.siblings('.advads-conditions-authors-buttons'));
     161            },
     162            close() {
     163                self.val('');
     164            },
     165        });
     166    }
     167
    113168        // display input field to search for post, page, etc.
    114169        $( document ).on( 'click', '.advads-conditions-postids-show-search', function ( e ) {
     
    244299
    245300/**
     301 * Callback for author search autocomplete
     302 *
     303 * @param {string}           search   author
     304 * @param {HTMLInputElement} field    html input field
     305 * @param {Function}         callback Callback function
     306 * @return {Object} JSON object with labels and values
     307 */
     308
     309function advadsAuthorSearch(field, callback) {
     310    const query = {
     311        action: 'advads-authors-search',
     312        nonce: advadsglobal.ajax_nonce,
     313    };
     314
     315    query.search = field.val();
     316
     317    var querying = true;
     318
     319    const results = [];
     320    // eslint-disable-next-line no-undef
     321    jQuery.post(
     322        // eslint-disable-next-line no-undef
     323        ajaxurl,
     324        query,
     325        function (r) {
     326            querying = false;
     327            if (r) {
     328                r.map(function (element, index) {
     329                    results[index] = {
     330                        value: element.data.ID,
     331                        label: element.data.display_name,
     332                    };
     333                });
     334            }
     335            callback(results);
     336        },
     337        'json'
     338    );
     339}
     340
     341/**
    246342 * Callback for post search autocomplete
    247343 *
  • advanced-ads/trunk/admin/includes/class-meta-box.php

    r2986093 r3029416  
    234234                $view                         = 'conditions/ad-targeting-metabox.php';
    235235                $hndlelinks                   = '<a href="#" class="advads-video-link">' . __( 'Video', 'advanced-ads' ) . '</a>';
    236                 $hndlelinks                  .= '<a href="https://wpadvancedads.com/manual/display-conditions/?utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-display" target="_blank" class="advads-manual-link">' . __( 'Display Conditions', 'advanced-ads' ) . '</a>';
    237                 $hndlelinks                  .= '<a href="https://wpadvancedads.com/manual/visitor-conditions/?utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-visitor" target="_blank" class="advads-manual-link">' . __( 'Visitor Conditions', 'advanced-ads' ) . '</a>';
     236                $hndlelinks                   .= '<a href="https://wpadvancedads.com/manual/display-conditions/?utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-display" target="_blank" class="advads-manual-link">' . __( 'Display Conditions', 'advanced-ads' ) . '</a>';
     237                $hndlelinks                   .= '<a href="https://wpadvancedads.com/manual/visitor-conditions/?utm_source=advanced-ads&utm_medium=link&utm_campaign=edit-visitor" target="_blank" class="advads-manual-link">' . __( 'Visitor Conditions', 'advanced-ads' ) . '</a>';
    238238                $videomarkup                  = '<iframe width="420" height="315" src="https://www.youtube-nocookie.com/embed/VjfrRl5Qn4I?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>';
    239                 $display_conditions           = $ad->options( 'conditions', [] );
    240                 $visitor_conditions           = $ad->options( 'visitors', [] );
     239                $ad_options                   = $ad->options();
     240                $display_conditions           = is_array( $ad_options['conditions'] ) ? $ad_options['conditions'] : []; // default value for older version is `""` (empty string)
     241                $visitor_conditions           = is_array( $ad_options['visitors'] ) ? $ad_options['visitors'] : []; // default value for older version is `""` (empty string)
    241242                $display_conditions_available = ( empty( $display_conditions ) );
    242243                $visitor_conditions_available = ( empty( $visitor_conditions ) );
  • advanced-ads/trunk/admin/views/conditions/condition-author.php

    r2986093 r3029416  
    33 * Templace for the Author display condition
    44 *
     5 * @package Advanced_Ads_Admin
    56 * @var string $name form name attribute.
    67 * @var int $max_authors number of maximum author entries to show.
    78 */
     9
    810?>
    911    <div class="advads-conditions-single advads-buttonset">
    1012        <?php
    11         foreach ( $authors as $_author ) {
    12             // don’t use strict comparision because $values contains strings.
    13             if ( in_array( $_author->ID, $values ) ) {
    14                 $_val = 1;
    15             } else {
    16                 $_val = 0;
     13        if ( count( $authors ) >= $max_authors ) :
     14            // show active authors.
     15            ?>
     16                <div class="advads-conditions-authors-buttons dynamic-search">
     17                    <?php
     18                    foreach ( $authors as $_author ) :
     19                        // don’t use strict comparision because $values contains strings.
     20                        if ( in_array( $_author->ID, $values ) ) :
     21                            $author_name = $_author->display_name;
     22                            $field_id    = 'advads-conditions-' . absint( $_author->ID ) . $rand;
     23                            ?>
     24                            <label class="button advads-button advads-ui-state-active">
     25                                <span class="advads-button-text">
     26                                    <?php echo esc_attr( $author_name ); ?>
     27                                    <input type="hidden"
     28                                    name="<?php echo esc_attr( $name ); ?>[value][]"
     29                                    value="<?php echo absint( $_author->ID ); ?>">
     30                                </span>
     31                            </label>
     32                            <?php
     33                        endif;
     34                    endforeach;
     35                    ?>
     36                </div>
     37                <span class="advads-conditions-authors-show-search button" title="<?php _ex( 'add more authors', 'display the authors search field on ad edit page', 'advanced-ads' ); ?>">
     38                +
     39                </span>
     40                <br/>
     41                <input type="text" class="advads-conditions-authors-search"
     42                data-input-name="<?php echo esc_attr( $name ); ?>[value][]"
     43                placeholder="<?php _e( 'author name or id', 'advanced-ads' ); ?>"/>
     44            <?php
     45        else :
     46            $max_counter = $max_authors;
     47            foreach ( $authors as $_author ) {
     48                if ( $max_counter <= 0 ) {
     49                    return false;
     50                }
     51                --$max_counter;
     52                // don’t use strict comparision because $values contains strings.
     53                if ( in_array( $_author->ID, $values ) ) {
     54                    $_val = 1;
     55                } else {
     56                    $_val = 0;
     57                }
     58                $author_name = $_author->display_name;
     59                $field_id    = 'advads-conditions-' . absint( $_author->ID ) . $rand;
     60                ?>
     61                <label class="button advads-button"
     62                    for="<?php echo esc_attr( $field_id ); ?>">
     63                    <?php echo esc_attr( $author_name ); ?>
     64                </label><input type="checkbox"
     65                            id="<?php echo esc_attr( $field_id ); ?>"
     66                            name="<?php echo esc_attr( $name ); ?>[value][]" <?php checked( $_val, 1 ); ?>
     67                            value="<?php echo absint( $_author->ID ); ?>">
     68                <?php
    1769            }
    18             $author_name = $_author->display_name;
    19             $field_id    = 'advads-conditions-' . absint( $_author->ID ) . $rand;
    20             ?>
    21             <label class="button advads-button"
    22                    for="<?php echo esc_attr( $field_id ); ?>">
    23                 <?php echo esc_attr( $author_name ); ?>
    24             </label><input type="checkbox"
    25                            id="<?php echo esc_attr( $field_id ); ?>"
    26                            name="<?php echo esc_attr( $name ); ?>[value][]" <?php checked( $_val, 1 ); ?>
    27                            value="<?php echo absint( $_author->ID ); ?>">
    28             <?php
    29         }
    30         include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php';
     70            include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php';
     71        endif;
    3172        ?>
    3273    </div>
    3374<?php
     75/*
    3476if ( count( $authors ) >= $max_authors ) :
    3577    ?>
     
    5597<?php
    5698endif;
     99*/
  • advanced-ads/trunk/advanced-ads.php

    r3006148 r3029416  
    1313 * Plugin URI:        https://wpadvancedads.com
    1414 * Description:       Manage and optimize your ads in WordPress
    15  * Version:           1.48.1
     15 * Version:           1.49.0
    1616 * Author:            Advanced Ads GmbH
    1717 * Author URI:        https://wpadvancedads.com
     
    3434
    3535define( 'ADVADS_FILE', __FILE__ );
    36 define( 'ADVADS_VERSION', '1.48.1' );
     36define( 'ADVADS_VERSION', '1.49.0' );
    3737
    3838// Load the autoloader.
  • advanced-ads/trunk/classes/ad_ajax_callbacks.php

    r2983598 r3029416  
    3131        add_action( 'wp_ajax_load_display_conditions_metabox', [ $this, 'load_display_condition' ] );
    3232        add_action( 'wp_ajax_advads-terms-search', [ $this, 'search_terms' ] );
     33        add_action( 'wp_ajax_advads-authors-search', [ $this, 'search_authors' ] );
    3334        add_action( 'wp_ajax_advads-close-notice', [ $this, 'close_notice' ] );
    3435        add_action( 'wp_ajax_advads-hide-notice', [ $this, 'hide_notice' ] );
     
    204205
    205206    /**
     207     * Search authors
     208     *
     209     * @since 1.47.5
     210     */
     211    public function search_authors() {
     212        check_ajax_referer( 'advanced-ads-admin-ajax-nonce', 'nonce' );
     213
     214        if ( ! WordPress::user_can( 'advanced_ads_edit_ads' ) ) {
     215            return;
     216        }
     217
     218        $args                   = [];
     219        $args['search_columns'] = [ 'ID', 'user_login', 'user_nicename', 'display_name' ];
     220
     221        if ( version_compare( get_bloginfo( 'version' ), '5.9' ) > -1 ) {
     222            $args['capability'] = [ 'edit_posts' ];
     223        } else {
     224            $args['who'] = 'authors';
     225        }
     226
     227        if ( ! isset( $_POST['search'] ) || '' === $_POST['search'] ) {
     228            die();
     229        }
     230
     231        $args['search'] = '*' . sanitize_text_field( wp_unslash( $_POST['search'] ) ) . '*';
     232
     233        $results = get_users( $args );
     234
     235        echo wp_json_encode( $results );
     236        die();
     237    }
     238
     239    /**
    206240     * Close a notice for good
    207241     *
  • advanced-ads/trunk/classes/display-conditions.php

    r2983598 r3029416  
    11<?php
    2 
     2// phpcs:ignoreFile
    33/**
    44 * Display Conditions under which to (not) show an ad
     
    88 */
    99class Advanced_Ads_Display_Conditions {
    10 
    1110    /**
    1211     * Advanced_Ads_Display_Conditions
     
    250249        $conditions = self::get_instance()->get_conditions();
    251250
    252 
    253251        if ( isset( $options['in'] ) ) {
    254252            if ( 'global' === $options['in'] ) {
    255                 $conditions = array_filter( $conditions, function( $condition ) {
    256                     return ! isset( $condition['options']['global'] ) || $condition['options']['global'];
    257                 } );
     253                $conditions = array_filter(
     254                    $conditions,
     255                    function ( $condition ) {
     256                        return ! isset( $condition['options']['global'] ) || $condition['options']['global'];
     257                    }
     258                );
    258259            } elseif ( is_array( $options['in'] ) ) {
    259260                // Include already set condition types.
     
    315316     */
    316317    public static function render_connector_option( $index, $value, $form_name ) {
    317 
    318318        $label = ( 'or' === $value ) ? __( 'or', 'advanced-ads' ) : __( 'and', 'advanced-ads' );
    319319
     
    323323        $rand = md5( $form_name );
    324324
    325         return '<input style="display:none;" type="checkbox" name="' . $name . '[connector]' . '" value="or"
    326                 id="advads-conditions-' . $index . '-connector-' . $rand . '"' . checked( 'or', $value, false ) . '>
    327                 <label for="advads-conditions-' . $index . '-connector-' . $rand . '">' . $label . '</label>';
     325        return sprintf(
     326            "<input style='display:none' type='checkbox' name='%s[connector]' value='or' id='%s' %s><label for='%s'>%s</label>",
     327            esc_attr( $name ),
     328            esc_attr( "advads-conditions-$index-connector-$rand" ),
     329            checked( 'or', $value, false ),
     330            esc_attr( "advads-conditions-$index-connector-$rand" ),
     331            esc_html( $label )
     332        );
    328333    }
    329334
     
    335340     */
    336341    public static function render_type_field( $type, $name ) {
    337 
    338342        ?>
    339343        <input type="hidden" name="<?php echo esc_attr( $name ); ?>[type]" value="<?php echo esc_attr( $type ); ?>"/>
    340344        <?php
    341 
    342345    }
    343346
     
    396399        );
    397400        ?>
    398         <div class="advads-conditions-single advads-buttonset"><?php
     401        <div class="advads-conditions-single advads-buttonset">
     402        <?php
    399403        $type_label_counts = array_count_values( wp_list_pluck( $post_types, 'label' ) );
    400404
     
    412416            }
    413417            $field_id = "advads-conditions-$_type_id-$rand";
    414             ?><label class="button" for="<?php echo $field_id;
    415             ?>"><?php echo $_label ?></label><input type="checkbox"
    416             id="<?php echo $field_id; ?>"
    417             name="<?php echo $name; ?>[value][]" <?php checked( $_val, 1 ); ?>
    418             value="<?php echo $_type_id; ?>"><?php
     418            printf(
     419                "<label class='button' for='%s'>%s</label><input type='checkbox' id='%s' name='%s' %s value='%s'>",
     420                esc_attr( $field_id ),
     421                esc_html( $_label ),
     422                esc_attr( $field_id ),
     423                esc_attr( "{$name}[value][]" ),
     424                checked( $_val, 1, false ),
     425                esc_attr( $_type_id )
     426            );
    419427        }
    420428        include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php';
    421429        ?>
    422         </div><?php
     430        </div>
     431        <?php
    423432    }
    424433
     
    459468        $args        = [
    460469            'orderby' => 'nicename',
    461             'number'  => $max_authors,
    462470        ];
    463471        if ( version_compare( get_bloginfo( 'version' ), '5.9' ) > -1 ) {
     
    567575
    568576                $field_id = "advads-conditions-$_taxonomy_id-$rand";
    569                 ?><label class="button" for="<?php echo $field_id
    570             ?>"><?php echo $_label ?></label><input type="checkbox"
    571                 id="<?php echo $field_id; ?>"
    572                 name="<?php echo $name; ?>[value][]" <?php checked( $_val, 1 ); ?>
    573                 value="<?php echo $_taxonomy_id; ?>"><?php
     577                printf(
     578                    "<label class='button' for='%s'>%s</label><input type ='checkbox' id='%s' name='%s' %s value='%s'>",
     579                    esc_attr( $field_id ),
     580                    esc_html( $_label ),
     581                    esc_attr( $field_id ),
     582                    esc_attr( "{$name}[value][]" ),
     583                    checked( $_val, 1, false ),
     584                    esc_attr( $_taxonomy_id )
     585                );
    574586            endforeach;
    575587            include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php';
     
    586598     * @param string $inputname name of the input field.
    587599     * @param int    $max_terms maximum number of terms to show.
    588      * @param int    $index index of the conditions group.
     600     * @param int    $index index of the conditions group.
    589601     *
    590602     * @return array|int|WP_Error
    591603     */
    592604    public static function display_term_list( $taxonomy, $checked = [], $inputname = '', $max_terms = 50, $index = 0 ) {
    593 
    594605        $terms = get_terms(
    595606            $taxonomy->name,
     
    622633                } else {
    623634                    ?>
    624                     <div class="advads-conditions-terms-buttons dynamic-search"></div><?php
     635                    <div class="advads-conditions-terms-buttons dynamic-search"></div>
     636                    <?php
    625637                }
    626                 ?><span class="advads-conditions-terms-show-search button" title="<?php
    627             _ex( 'add more terms', 'display the terms search field on ad edit page', 'advanced-ads' );
    628             ?>">+</span><br/><input type="text" class="advads-conditions-terms-search"
    629                 data-tag-name="<?php echo $taxonomy->name;
    630                 ?>" data-input-name="<?php echo $inputname; ?>"
    631                 placeholder="<?php _e( 'term name or id', 'advanced-ads' ); ?>"/><?php
     638
     639                printf(
     640                    "<span class='advads-conditions-terms-show-search button' title='%s'>+</span><br>",
     641                    esc_attr_x( 'add more terms', 'display the terms search field on ad edit page', 'advanced-ads' )
     642                );
     643                printf(
     644                    "<input type='text' class='advads-conditions-terms-search' data-tag-name='%s' data-input-name='%s' placeholder='%s'>",
     645                    esc_attr( $taxonomy->name ),
     646                    esc_attr( $inputname ),
     647                    esc_attr__( 'term name or id', 'advanced-ads' )
     648                );
    632649            else :
    633                 foreach ( $terms as $_term ) :
     650                foreach ( $terms as $_term ) {
    634651                    $field_id = "advads-conditions-$_term->term_id-$rand";
    635                     ?><input type="checkbox" id="<?php echo $field_id; ?>" name="<?php echo $inputname; ?>"
    636                     value="<?php echo $_term->term_id; ?>" <?php checked( in_array( $_term->term_id, $checked ), true );
    637                     ?>><label for="<?php echo $field_id; ?>"><?php echo $_term->name; ?></label><?php
    638                 endforeach;
     652                    printf(
     653                        "<input type='checkbox' id='%s' name='%s' value='%s' %s><label for='%s'>%s</label>",
     654                        esc_attr( $field_id ),
     655                        esc_attr( $inputname ),
     656                        esc_attr( $_term->term_id ),
     657                        checked( in_array( $_term->term_id, $checked ), true, false ),
     658                        esc_attr( $field_id ),
     659                        esc_html( $_term->name )
     660                    );
     661                }
    639662                include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php';
    640663            endif;
     
    683706
    684707            ];
    685 
    686708            $the_query = new WP_Query( $args );
    687709            while ( $the_query->have_posts() ) {
     
    694716            }
    695717        }
    696         ?><span class="advads-conditions-postids-show-search button" <?php if ( ! count( $values ) ) {
    697                 echo 'style="display:none;"'; } ?>>+</span><p class="advads-conditions-postids-search-line">
    698             <input type="text" class="advads-display-conditions-individual-post" <?php if ( count( $values ) ) {
    699                 echo 'style="display:none;"';
    700             } ?>
    701                     placeholder="<?php _e( 'title or id', 'advanced-ads' ); ?>"
    702                     data-field-name="<?php echo $name; ?>"/><?php
    703             wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false );
    704             ?></p></div><?php
     718        printf(
     719            "<span class='advads-conditions-postids-show-search button' style='%s'>+</span>",
     720            empty( $values ) ? 'display:none;' : ''
     721        );
     722
     723        printf(
     724            "<p class='advads-conditions-postids-search-line'><input type='text' class='advads-display-conditions-individual-post' style='%s' placeholder='%s' data-field-name='%s' />%s</p></div>",
     725            ! empty( $values ) ? 'display:none;' : '',
     726            esc_attr__( 'title or id', 'advanced-ads' ),
     727            esc_attr( $name ),
     728            wp_kses(
     729                wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false, false ),
     730                [
     731                    'input' => [
     732                        'type'  => true,
     733                        'id'    => true,
     734                        'name'  => true,
     735                        'class' => true,
     736                        'value' => true,
     737                    ],
     738                ]
     739            )
     740        );
    705741        // phpcs:enable
    706742    }
     
    730766
    731767        $rand = md5( $form_name );
    732         foreach ( $conditions as $_key => $_condition ) :
    733 
     768        foreach ( $conditions as $_key => $_condition ) {
    734769            // activate by default.
    735             $value = ( [] === $values || in_array( $_key, $values, true ) ) ? 1 : 0;
    736 
     770            $value    = ( [] === $values || in_array( $_key, $values, true ) ) ? 1 : 0;
    737771            $field_id = "advads-conditions-$_key-$rand";
    738             ?><input type="checkbox" id="<?php echo $field_id; ?>" name="<?php echo $name; ?>[value][]"
    739             value="<?php echo $_key; ?>" <?php checked( 1, $value ); ?>><label
    740             for="<?php echo $field_id; ?>"><?php echo $_condition['label']; ?></label><?php
    741         endforeach;
     772            printf(
     773                "<input type='checkbox' id='%s' name='%s' %s value='%s'>",
     774                esc_attr( $field_id ),
     775                esc_attr( "{$name}[value][]" ),
     776                checked( 1, $value, false ),
     777                esc_attr( $_key )
     778            );
     779            printf(
     780                "<label for='%s'>%s</label>",
     781                esc_attr( $field_id ),
     782                esc_html( $_condition['label'] )
     783            );
     784
     785        }
    742786        include ADVADS_ABSPATH . 'admin/views/conditions/not-selected.php';
    743         ?></div><?php
    744         return;
     787        echo '</div>';
    745788    }
    746789
     
    751794     */
    752795    public static function general_conditions() {
    753         return $conditions = apply_filters( 'advanced-ads-display-conditions-general',
     796        return apply_filters(
     797            'advanced-ads-display-conditions-general',
    754798            [
    755799                'is_front_page' => [
     
    793837                    'type'        => 'radio',
    794838                ],
    795                 'is_rest_api'     => [
     839                'is_rest_api'   => [
    796840                    'label'       => __( 'REST API', 'advanced-ads' ),
    797841                    'description' => __( 'allow ads in REST API', 'advanced-ads' ),
     
    810854     */
    811855    public static function metabox_content_age( $options, $index = 0, $form_name = '' ) {
    812         if ( ! isset ( $options['type'] ) || '' === $options['type'] ) {
     856        if ( ! isset( $options['type'] ) || '' === $options['type'] ) {
    813857            return;
    814858        }
     
    829873
    830874        ?>
    831         <select name="<?php echo $name; ?>[operator]">
    832             <option value="older_than" <?php selected( 'older_than', $operator ); ?>><?php _e( 'older than', 'advanced-ads' ); ?></option>
    833             <option value="younger_than" <?php selected( 'younger_than', $operator ); ?>><?php _e( 'younger than', 'advanced-ads' ); ?></option>
     875        <select name="<?php echo esc_attr( $name ); ?>[operator]">
     876            <option value="older_than" <?php selected( 'older_than', $operator ); ?>><?php esc_html_e( 'older than', 'advanced-ads' ); ?></option>
     877            <option value="younger_than" <?php selected( 'younger_than', $operator ); ?>><?php esc_html_e( 'younger than', 'advanced-ads' ); ?></option>
    834878        </select>
    835879
     
    11011145
    11021146        // check general conditions added by other add-ons.
    1103         if ( null !== ( $result = apply_filters( 'advanced-ads-display-conditions-check-general', null, $options['value'] ) ) ) {
     1147        $result = apply_filters( 'advanced-ads-display-conditions-check-general', null, $options['value'] );
     1148        if ( null !== ( $result ) ) {
    11041149            return $result;
    11051150        }
     
    11241169
    11251170        // check home page.
    1126         if ( ( ( isset( $query['is_front_page'] ) && $query['is_front_page'] )
    1127               || ( isset( $query['is_home'] ) && $query['is_home'] ) )
    1128              && in_array( 'is_front_page', $options['value'], true )
     1171        if (
     1172            ( ( isset( $query['is_front_page'] ) && $query['is_front_page'] ) || ( isset( $query['is_home'] ) && $query['is_home'] ) )
     1173            && in_array( 'is_front_page', $options['value'], true )
    11291174        ) {
    11301175            return true;
    1131         } elseif ( isset( $query['is_front_page'] ) && $query['is_front_page'] && (
    1132             ! in_array( 'is_front_page', $options['value'], true )
    1133             ) ) {
     1176        } elseif ( isset( $query['is_front_page'] ) && $query['is_front_page'] && ( ! in_array( 'is_front_page', $options['value'], true ) ) ) {
    11341177            return false;
    11351178        }
     
    11381181        foreach ( self::$query_var_keys as $_type ) {
    11391182            if ( 'is_main_query' !== $_type && isset( $query[ $_type ] ) && $query[ $_type ] &&
    1140                  in_array( $_type, $options['value'], true ) ) {
     1183                in_array( $_type, $options['value'], true ) ) {
    11411184                return true;
    11421185            }
     
    11551198     */
    11561199    public static function check_content_age( $options, Advanced_Ads_Ad $ad ) {
    1157         global $post;
     1200        $post = get_post();
     1201
     1202        if ( ! $post
     1203            && wp_doing_ajax()
     1204            && isset( $_REQUEST['action'], $_REQUEST['theId'], $_REQUEST['isSingular'] )
     1205            && sanitize_key( $_REQUEST['action'] ) === 'advads_ad_select'
     1206            && ( $_REQUEST['isSingular'] )
     1207        ) {
     1208            $post = get_post( (int) $_REQUEST['theId'] );
     1209        }
    11581210
    11591211        $operator = ( isset( $options['operator'] ) && 'younger_than' === $options['operator'] ) ? 'younger_than' : 'older_than';
     
    12501302        }
    12511303        // get conditions with rebased index keys.
    1252         $conditions = array_values( $options['conditions'] );
    1253         $query      = $options['wp_the_query'];
    1254         $post       = isset( $options['post'] ) ? $options['post'] : null;
    1255 
    1256 
     1304        $conditions  = array_values( $options['conditions'] );
     1305        $query       = $options['wp_the_query'];
     1306        $post        = isset( $options['post'] ) ? $options['post'] : null;
    12571307        $last_result = false;
    12581308        $length      = count( $conditions );
    12591309
    1260         for ( $i = 0; $i < $length; ++ $i ) {
     1310        for ( $i = 0; $i < $length; ++$i ) {
    12611311            $_condition = current( $conditions );
    12621312            $next       = next( $conditions );
     
    12731323            $next_tax = ( isset( $next['type'] ) && isset( $this->conditions[ $next['type'] ]['taxonomy'] ) ) ? $this->conditions[ $next['type'] ]['taxonomy'] : false;
    12741324            if ( $tax && $next_tax && $next_key
    1275                  && $next_tax === $tax
    1276                  && ( ! isset( $next['connector'] ) || 'or' !== $next['connector'] )
    1277                  && 'is' === $_condition['operator'] && 'is' === $next['operator']
    1278                  && $_condition['type'] !== $next['type'] ) {
    1279                 $next['connector']                    = 'or';
    1280                 $conditions[ $next_key ]['connector'] = 'or';
     1325                && $next_tax === $tax
     1326                && ( ! isset( $next['connector'] ) || 'or' !== $next['connector'] )
     1327                && 'is' === $_condition['operator'] && 'is' === $next['operator']
     1328                && $_condition['type'] !== $next['type']
     1329            ) {
     1330                    $next['connector']                    = 'or';
     1331                    $conditions[ $next_key ]['connector'] = 'or';
    12811332            }
    12821333
     
    14181469    public static function modify_post_search_sql( $sql ) {
    14191470        global $wpdb;
    1420 
    1421         // $sql = preg_replace_callback( "/{$wpdb->posts}.post_(content|excerpt)( NOT)? LIKE '%(.*?)%'/", array( 'Advanced_Ads_Display_Conditions', 'modify_post_search_sql_callback' ), $sql );
    1422 
    14231471        // removes the search in content and excerpt columns.
    14241472        $sql = preg_replace( "/OR \({$wpdb->posts}.post_(content|excerpt)( NOT)? LIKE '(.*?)'\)/", '', $sql );
     
    14471495        }
    14481496    }
    1449 
    14501497}
  • advanced-ads/trunk/classes/frontend_checks.php

    r3005553 r3029416  
    11<?php
    22// phpcs:ignoreFile
     3
     4use AdvancedAds\Assets_Registry;
    35use AdvancedAds\Utilities\WordPress;
    46
     
    4850        if ( Advanced_Ads_Ad_Health_Notices::notices_enabled() ) {
    4951            add_action( 'body_class', [ $this, 'body_class' ] );
     52        }
     53
     54        if( $this->has_adblocker_placements() ) {
     55            if ( ! Assets_Registry::script_is('find-adblocker', 'enqueued') ) {
     56                Assets_Registry::enqueue_script('find-adblocker');
     57            }
    5058        }
    5159    }
     
    11171125        return false;
    11181126    }
     1127
     1128    /**
     1129     * Check if atleast one placement uses `adblocker item`.
     1130     *
     1131     * @return bool True/False.
     1132     */
     1133    private function has_adblocker_placements() {
     1134        $placements = Advanced_Ads::get_instance()->get_model()->get_ad_placements_array();
     1135        foreach ($placements as $placement) {
     1136            if (!empty($placement['options']['item_adblocker'])) {
     1137                return true;
     1138            }
     1139        }
     1140
     1141        return false;
     1142    }
    11191143}
  • advanced-ads/trunk/classes/plugin.php

    r2986093 r3029416  
    215215        }
    216216
     217        $frontend_prefix = $this->get_frontend_prefix();
     218
    217219        ob_start();
    218220        ?>
    219         <script id="<?php echo esc_attr( $this->get_frontend_prefix() ); ?>ready">
     221        <script id="<?php echo esc_attr( $frontend_prefix ); ?>ready">
    220222            <?php
    221223            readfile( sprintf(
     
    227229        </script>
    228230        <?php
     231
     232        /**
     233         * Print inline script in the page header form add-ons.
     234         *
     235         * @param string $frontend_prefix the prefix used for Advanced Ads related HTML ID-s and classes.
     236         */
     237        do_action( 'advanced_ads_inline_header_scripts', $frontend_prefix );
    229238        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- escaping would break the HTML
    230239        echo Advanced_Ads_Utils::get_inline_asset( ob_get_clean() );
  • advanced-ads/trunk/includes/admin/class-assets.php

    r3005553 r3029416  
    6464        // TODO: add conditional loading.
    6565        Assets_Registry::enqueue_script( 'admin-global' );
    66         Assets_Registry::enqueue_script( 'admin-find-adblocker' );
     66        Assets_Registry::enqueue_script( 'find-adblocker' );
    6767
    6868        $params = [
  • advanced-ads/trunk/includes/class-assets-registry.php

    r2983598 r3029416  
    5353
    5454    /**
     55     * Determines whether a script has been added to the queue.
     56     *
     57     * @param string $handle Name of the script.
     58     * @param string $status Optional. Status of the script to check. Default 'enqueued'.
     59     *                       Accepts 'enqueued', 'registered', 'queue', 'to_do', and 'done'.
     60     *
     61     * @return bool
     62     */
     63    public static function script_is( $handle, $status = 'enqueued' ): bool {
     64        return wp_script_is( self::prefix_it( $handle ), $status );
     65    }
     66
     67    /**
    5568     * Hook into WordPress.
    5669     *
     
    5972    public function hooks(): void {
    6073        add_action( 'admin_enqueue_scripts', [ $this, 'register_assets' ], 0 );
     74        add_action( 'wp_enqueue_scripts', [ $this, 'register_assets' ], 0 );
    6175    }
    6276
     
    89103    public function register_scripts(): void {
    90104        $this->register_script( 'admin-global', 'admin/assets/js/admin-global.js', [ 'jquery' ], false, true );
    91         $this->register_script( 'admin-find-adblocker', 'admin/assets/js/advertisement.js' );
     105        $this->register_script( 'find-adblocker', 'admin/assets/js/advertisement.js' );
    92106        $this->register_script( 'ui', 'admin/assets/js/ui.js', [ 'jquery' ] );
    93107        $this->register_script( 'conditions', 'admin/assets/js/conditions.js', [ 'jquery', self::prefix_it( 'ui' ) ] );
  • advanced-ads/trunk/languages/advanced-ads.pot

    r3006148 r3029416  
    1 # Copyright (C) 2023 Advanced Ads GmbH
     1# Copyright (C) 2024 Advanced Ads GmbH
    22# This file is distributed under the GPL-2.0+.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Advanced Ads 1.48.0\n"
     5"Project-Id-Version: Advanced Ads 1.48.1\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n"
    77"Last-Translator: Thomas Maier <[email protected]>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2023-12-06T11:22:58+00:00\n"
     12"POT-Creation-Date: 2024-01-31T11:13:51+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.6.0\n"
     
    8585#. translators: %s is empty here, but the string will be followed by a name of an ad unit.
    8686#: admin/includes/ad-health-notices.php:112
    87 #: classes/frontend_checks.php:272
     87#: classes/frontend_checks.php:280
    8888msgid "Visible ads should not use the Header placement: %s"
    8989msgstr ""
     
    9191#: admin/includes/ad-health-notices.php:123
    9292#: classes/ad-debug.php:272
    93 #: classes/frontend_checks.php:259
     93#: classes/frontend_checks.php:267
    9494msgid "Your website is using HTTPS, but the ad code contains HTTP and might not work."
    9595msgstr ""
     
    293293
    294294#: admin/includes/class-ad-type.php:953
    295 #: classes/frontend_checks.php:539
     295#: classes/frontend_checks.php:547
    296296msgid "Get help"
    297297msgstr ""
     
    482482#: admin/views/settings/general/disable-notices.php:14
    483483#: classes/ad_type_plain.php:255
    484 #: classes/display-conditions.php:843
     484#: classes/display-conditions.php:887
    485485#: modules/ads-txt/admin/views/setting-create.php:12
    486486#: modules/privacy/admin/views/setting-general.php:34
     
    511511msgstr ""
    512512
    513 #: admin/includes/class-meta-box.php:267
     513#: admin/includes/class-meta-box.php:268
    514514#: admin/includes/class-overview-widgets.php:64
    515515msgid "Disable"
    516516msgstr ""
    517517
    518 #: admin/includes/class-meta-box.php:429
     518#: admin/includes/class-meta-box.php:430
    519519msgid "Ad Settings"
    520520msgstr ""
    521521
    522 #: admin/includes/class-meta-box.php:528
     522#: admin/includes/class-meta-box.php:529
    523523#: includes/admin/pages/class-dashboard.php:33
    524524#: includes/admin/pages/class-dashboard.php:44
     
    528528
    529529#. translators: %1$d is the number of ads, %2$s and %3$s are URLs.
    530 #: admin/includes/class-meta-box.php:544
     530#: admin/includes/class-meta-box.php:545
    531531msgid "%1$d ads – <a href=\"%2$s\">manage</a> - <a href=\"%3$s\">new</a>"
    532532msgstr ""
    533533
    534 #: admin/includes/class-meta-box.php:557
     534#: admin/includes/class-meta-box.php:558
    535535msgid "Get the tutorial via email"
    536536msgstr ""
    537537
    538 #: admin/includes/class-meta-box.php:566
     538#: admin/includes/class-meta-box.php:567
    539539msgid "Get AdSense tips via email"
    540540msgstr ""
    541541
    542 #: admin/includes/class-meta-box.php:575
     542#: admin/includes/class-meta-box.php:576
    543543msgid "Visit our blog for more articles about ad optimization"
    544544msgstr ""
    545545
    546546#. translators: %s is our URL.
    547 #: admin/includes/class-meta-box.php:630
     547#: admin/includes/class-meta-box.php:631
    548548msgid "Latest posts on wpadvancedads.com"
    549549msgstr ""
     
    12571257msgstr ""
    12581258
    1259 #. translators: %1$d is the number of elements in the list and %2$s a URL.
    1260 #: admin/views/conditions/condition-author.php:41
    1261 msgid "Only %1$d elements are displayed above. Use the <code>advanced-ads-admin-max-terms</code> filter to change this limit according to <a href=\"%2$s\" target=\"_blank\">this page</a>."
     1259#: admin/views/conditions/condition-author.php:37
     1260msgctxt "display the authors search field on ad edit page"
     1261msgid "add more authors"
     1262msgstr ""
     1263
     1264#: admin/views/conditions/condition-author.php:43
     1265msgid "author name or id"
    12621266msgstr ""
    12631267
     
    16901694
    16911695#: admin/views/settings/general/block-bots.php:11
    1692 #: classes/frontend_checks.php:130
     1696#: classes/frontend_checks.php:138
    16931697msgid "You look like a bot"
    16941698msgstr ""
     
    20602064
    20612065#. translators: %s is a URL.
    2062 #: classes/ad_ajax_callbacks.php:262
     2066#: classes/ad_ajax_callbacks.php:296
    20632067msgid "An error occurred. Please use <a href=\"%s\" target=\"_blank\">this form</a> to sign up."
    20642068msgstr ""
     
    23022306msgstr ""
    23032307
     2308#: classes/display-conditions.php:88
     2309msgid "post type"
     2310msgstr ""
     2311
    23042312#: classes/display-conditions.php:89
    2305 msgid "post type"
    2306 msgstr ""
    2307 
    2308 #: classes/display-conditions.php:90
    23092313#: includes/array_ad_conditions.php:40
    23102314msgid "Choose the public post types on which to display the ad."
    23112315msgstr ""
    23122316
     2317#: classes/display-conditions.php:95
     2318msgid "specific pages"
     2319msgstr ""
     2320
    23132321#: classes/display-conditions.php:96
    2314 msgid "specific pages"
    2315 msgstr ""
    2316 
    2317 #: classes/display-conditions.php:97
    23182322#: includes/array_ad_conditions.php:58
    23192323msgid "Choose on which individual posts, pages and public post type pages you want to display or hide ads."
    23202324msgstr ""
    23212325
    2322 #: classes/display-conditions.php:103
     2326#: classes/display-conditions.php:102
    23232327msgid "general conditions"
    23242328msgstr ""
    23252329
    2326 #: classes/display-conditions.php:109
     2330#: classes/display-conditions.php:108
    23272331msgid "author"
    23282332msgstr ""
    23292333
     2334#: classes/display-conditions.php:114
     2335msgid "content age"
     2336msgstr ""
     2337
    23302338#: classes/display-conditions.php:115
    2331 msgid "content age"
    2332 msgstr ""
    2333 
    2334 #: classes/display-conditions.php:116
    23352339msgid "Display ads based on age of the page."
    23362340msgstr ""
    23372341
     2342#: classes/display-conditions.php:121
     2343msgid "taxonomy"
     2344msgstr ""
     2345
    23382346#: classes/display-conditions.php:122
    2339 msgid "taxonomy"
    2340 msgstr ""
    2341 
    2342 #: classes/display-conditions.php:123
    23432347msgid "Display ads based on the taxonomy of an archive page."
    23442348msgstr ""
    23452349
    23462350#. translators: %s is a label of an archive page.
    2347 #: classes/display-conditions.php:171
     2351#: classes/display-conditions.php:170
    23482352msgid "archive: %s"
    23492353msgstr ""
    23502354
    2351 #: classes/display-conditions.php:287
     2355#: classes/display-conditions.php:288
    23522356msgid "parent page"
    23532357msgstr ""
    23542358
    2355 #: classes/display-conditions.php:288
     2359#: classes/display-conditions.php:289
    23562360msgid "post meta"
    23572361msgstr ""
    23582362
    2359 #: classes/display-conditions.php:289
     2363#: classes/display-conditions.php:290
    23602364msgid "page template"
    23612365msgstr ""
    23622366
    2363 #: classes/display-conditions.php:290
     2367#: classes/display-conditions.php:291
    23642368msgid "url parameters"
    23652369msgstr ""
    23662370
    2367 #: classes/display-conditions.php:293
     2371#: classes/display-conditions.php:294
    23682372msgid "accelerated mobile pages"
    23692373msgstr ""
     
    23842388msgstr ""
    23852389
    2386 #: classes/display-conditions.php:627
     2390#: classes/display-conditions.php:641
    23872391msgctxt "display the terms search field on ad edit page"
    23882392msgid "add more terms"
    23892393msgstr ""
    23902394
    2391 #: classes/display-conditions.php:631
     2395#: classes/display-conditions.php:647
    23922396msgid "term name or id"
    23932397msgstr ""
    23942398
    2395 #: classes/display-conditions.php:701
     2399#: classes/display-conditions.php:726
    23962400msgid "title or id"
    23972401msgstr ""
    23982402
    2399 #: classes/display-conditions.php:756
     2403#: classes/display-conditions.php:800
    24002404#: includes/array_ad_conditions.php:63
    24012405msgid "Home Page"
    24022406msgstr ""
    24032407
    2404 #: classes/display-conditions.php:757
     2408#: classes/display-conditions.php:801
    24052409#: includes/array_ad_conditions.php:64
    24062410msgid "show on Home page"
    24072411msgstr ""
    24082412
    2409 #: classes/display-conditions.php:761
     2413#: classes/display-conditions.php:805
    24102414#: includes/array_ad_conditions.php:68
    24112415msgid "Singular Pages"
    24122416msgstr ""
    24132417
    2414 #: classes/display-conditions.php:762
     2418#: classes/display-conditions.php:806
    24152419#: includes/array_ad_conditions.php:69
    24162420msgid "show on singular pages/posts"
    24172421msgstr ""
    24182422
    2419 #: classes/display-conditions.php:766
     2423#: classes/display-conditions.php:810
    24202424#: includes/array_ad_conditions.php:73
    24212425msgid "Archive Pages"
    24222426msgstr ""
    24232427
    2424 #: classes/display-conditions.php:767
     2428#: classes/display-conditions.php:811
    24252429#: includes/array_ad_conditions.php:74
    24262430msgid "show on any type of archive page (category, tag, author and date)"
    24272431msgstr ""
    24282432
    2429 #: classes/display-conditions.php:771
     2433#: classes/display-conditions.php:815
    24302434#: includes/array_ad_conditions.php:78
    24312435msgid "Search Results"
    24322436msgstr ""
    24332437
    2434 #: classes/display-conditions.php:772
     2438#: classes/display-conditions.php:816
    24352439#: includes/array_ad_conditions.php:79
    24362440msgid "show on search result pages"
    24372441msgstr ""
    24382442
    2439 #: classes/display-conditions.php:776
     2443#: classes/display-conditions.php:820
    24402444#: includes/array_ad_conditions.php:83
    24412445msgid "404 Page"
    24422446msgstr ""
    24432447
    2444 #: classes/display-conditions.php:777
     2448#: classes/display-conditions.php:821
    24452449#: includes/array_ad_conditions.php:84
    24462450msgid "show on 404 error page"
    24472451msgstr ""
    24482452
    2449 #: classes/display-conditions.php:781
     2453#: classes/display-conditions.php:825
    24502454#: includes/array_ad_conditions.php:88
    24512455msgid "Attachment Pages"
    24522456msgstr ""
    24532457
    2454 #: classes/display-conditions.php:782
     2458#: classes/display-conditions.php:826
    24552459#: includes/array_ad_conditions.php:89
    24562460msgid "show on attachment pages"
    24572461msgstr ""
    24582462
    2459 #: classes/display-conditions.php:786
     2463#: classes/display-conditions.php:830
    24602464#: includes/array_ad_conditions.php:93
    24612465msgid "Secondary Queries"
    24622466msgstr ""
    24632467
    2464 #: classes/display-conditions.php:787
     2468#: classes/display-conditions.php:831
    24652469#: includes/array_ad_conditions.php:94
    24662470msgid "allow ads in secondary queries"
    24672471msgstr ""
    24682472
    2469 #: classes/display-conditions.php:791
     2473#: classes/display-conditions.php:835
    24702474msgid "RSS Feed"
    24712475msgstr ""
    24722476
    2473 #: classes/display-conditions.php:792
     2477#: classes/display-conditions.php:836
    24742478msgid "allow ads in RSS Feed"
    24752479msgstr ""
    24762480
    2477 #: classes/display-conditions.php:796
     2481#: classes/display-conditions.php:840
    24782482msgid "REST API"
    24792483msgstr ""
    24802484
    2481 #: classes/display-conditions.php:797
     2485#: classes/display-conditions.php:841
    24822486msgid "allow ads in REST API"
    24832487msgstr ""
    24842488
    2485 #: classes/display-conditions.php:832
     2489#: classes/display-conditions.php:876
    24862490msgid "older than"
    24872491msgstr ""
    24882492
    2489 #: classes/display-conditions.php:833
     2493#: classes/display-conditions.php:877
    24902494msgid "younger than"
    24912495msgstr ""
    24922496
    2493 #: classes/display-conditions.php:838
     2497#: classes/display-conditions.php:882
    24942498msgid "days"
    24952499msgstr ""
    24962500
    2497 #: classes/display-conditions.php:841
     2501#: classes/display-conditions.php:885
    24982502msgid "Display ads based on the age of a page or post."
    24992503msgstr ""
     
    25512555msgstr ""
    25522556
    2553 #: classes/frontend_checks.php:115
     2557#: classes/frontend_checks.php:123
    25542558msgid "Random AdSense ads"
    25552559msgstr ""
    25562560
    2557 #: classes/frontend_checks.php:144
     2561#: classes/frontend_checks.php:152
    25582562msgid "Ad blocker enabled"
    25592563msgstr ""
    25602564
    2561 #: classes/frontend_checks.php:156
     2565#: classes/frontend_checks.php:164
    25622566msgid "<em>%s</em> filter does not exist"
    25632567msgstr ""
    25642568
    2565 #: classes/frontend_checks.php:172
     2569#: classes/frontend_checks.php:180
    25662570msgid "Ads are disabled in the content of this page"
    25672571msgstr ""
    25682572
    2569 #: classes/frontend_checks.php:184
     2573#: classes/frontend_checks.php:192
    25702574msgid "the current post ID is 0 "
    25712575msgstr ""
    25722576
    2573 #: classes/frontend_checks.php:203
     2577#: classes/frontend_checks.php:211
    25742578msgid "Ads are disabled on this page"
    25752579msgstr ""
    25762580
    2577 #: classes/frontend_checks.php:217
     2581#: classes/frontend_checks.php:225
    25782582msgid "Ads are disabled on all pages"
    25792583msgstr ""
    25802584
    2581 #: classes/frontend_checks.php:232
     2585#: classes/frontend_checks.php:240
    25822586msgid "Ads are disabled on 404 pages"
    25832587msgstr ""
    25842588
    2585 #: classes/frontend_checks.php:246
     2589#: classes/frontend_checks.php:254
    25862590msgid "Ads are disabled on non singular pages"
    25872591msgstr ""
    25882592
    2589 #: classes/frontend_checks.php:260
     2593#: classes/frontend_checks.php:268
    25902594msgid "Ad IDs: %s"
    25912595msgstr ""
    25922596
    2593 #: classes/frontend_checks.php:288
     2597#: classes/frontend_checks.php:296
    25942598msgid "AdSense violation"
    25952599msgstr ""
    25962600
    2597 #: classes/frontend_checks.php:289
     2601#: classes/frontend_checks.php:297
    25982602msgid "Ad is hidden"
    25992603msgstr ""
    26002604
    2601 #: classes/frontend_checks.php:290
     2605#: classes/frontend_checks.php:298
    26022606msgid "IDs: %s"
    26032607msgstr ""
    26042608
    2605 #: classes/frontend_checks.php:306
     2609#: classes/frontend_checks.php:314
    26062610msgid "The following responsive AdSense ads are not showing up: %s"
    26072611msgstr ""
    26082612
    2609 #: classes/frontend_checks.php:323
     2613#: classes/frontend_checks.php:331
    26102614msgid "Consent not given"
    26112615msgstr ""
    26122616
    2613 #: classes/frontend_checks.php:340
     2617#: classes/frontend_checks.php:348
    26142618msgid "Enable TCF integration"
    26152619msgstr ""
    26162620
    2617 #: classes/frontend_checks.php:355
     2621#: classes/frontend_checks.php:363
    26182622msgid "Debug Google Ad Manager"
    26192623msgstr ""
    26202624
    2621 #: classes/frontend_checks.php:372
     2625#: classes/frontend_checks.php:380
    26222626msgid "highlight ads"
    26232627msgstr ""
    26242628
    2625 #: classes/frontend_checks.php:492
     2629#: classes/frontend_checks.php:500
    26262630msgid "Ad Health"
    26272631msgstr ""
    26282632
    2629 #: classes/frontend_checks.php:507
     2633#: classes/frontend_checks.php:515
    26302634msgid "Show %d more notifications"
    26312635msgstr ""
    26322636
    2633 #: classes/frontend_checks.php:526
     2637#: classes/frontend_checks.php:534
    26342638msgid "Everything is fine"
    26352639msgstr ""
    26362640
    2637 #: classes/frontend_checks.php:597
     2641#: classes/frontend_checks.php:605
    26382642msgid "the following code is used for automatic error detection and only visible to admins"
    26392643msgstr ""
     
    32803284msgstr ""
    32813285
    3282 #: modules/adblock-finder/admin/views/setting-ga.php:10
     3286#: modules/adblock-finder/admin/views/setting-ga.php:12
    32833287msgid "Google Analytics Tracking ID"
    32843288msgstr ""
    32853289
    3286 #: modules/adblock-finder/admin/views/setting-ga.php:14
    3287 msgid "Do you want to know how many of your visitors are using an ad blocker? Enter your Google Analytics property ID above to count them."
    3288 msgstr ""
    3289 
    3290 #. translators: 1: is an example id for Universal Analytics <code>UA-123456-1</code>, 2: is an example id for GA4 '<code>G-A12BC3D456</code>'
     3290#. translators: %s is demo GA4 ID.
    32913291#: modules/adblock-finder/admin/views/setting-ga.php:19
    3292 msgid "%1$s for Universal Analytics or %2$s for Google Analytics 4."
     3292msgid "Do you want to know how many visitors use an ad blocker? Enter your Google Analytics property ID (%s) above to count them."
    32933293msgstr ""
    32943294
  • advanced-ads/trunk/modules/adblock-finder/admin/views/setting-ga.php

    r2609369 r3029416  
    33 * Input for Google Analytics property ID.
    44 *
     5 * @package Advanced_Ads_Admin
    56 * @var string $ga_uid Google Analytics property ID
    67 */
     8
    79?>
    810<label>
     
    1214
    1315<p class="description">
    14     <?php esc_html_e( 'Do you want to know how many of your visitors are using an ad blocker? Enter your Google Analytics property ID above to count them.', 'advanced-ads' ); ?>
    15     <br>
    1616    <?php
    1717    printf(
    18     /* translators: 1: is an example id for Universal Analytics <code>UA-123456-1</code>, 2: is an example id for GA4 '<code>G-A12BC3D456</code>' */
    19         esc_html__( '%1$s for Universal Analytics or %2$s for Google Analytics 4.', 'advanced-ads' ),
    20         '<code>UA-123456-1</code>',
     18        // translators: %s is demo GA4 ID.
     19        esc_html__(
     20            'Do you want to know how many visitors use an ad blocker? Enter your Google Analytics property ID (%s) above to count them.',
     21            'advanced-ads'
     22        ),
    2123        '<code>G-A12BC3D456</code>'
    2224    );
  • advanced-ads/trunk/modules/adblock-finder/public/adblocker-enabled.js

    r2587606 r3029416  
    22 * Check if an ad blocker is enabled.
    33 *
    4  * @param {function} callback A callback function that is executed after the check has been done.
    5  *                            The 'is_enabled' (bool) variable is passed as the callback's first argument.
     4 * @param function callback A callback function that is executed after the check has been done.
     5 *                 The 'isEnabled' (bool) variable is passed as the callback's first argument.
    66 */
    7 window.advanced_ads_check_adblocker = ( function ( callback ) {
    8     var pending_callbacks = [];
    9     var is_enabled        = null;
     7window.advanced_ads_check_adblocker = (function (callback) {
     8    let pendingCallbacks = [];
     9    let isEnabled = null;
    1010
    11     function RAF( RAF_callback ) {
    12         var fn = window.requestAnimationFrame
    13             || window.mozRequestAnimationFrame
    14             || window.webkitRequestAnimationFrame
    15             || function ( RAF_callback ) {
    16                 return setTimeout( RAF_callback, 16 );
     11    function RAF(RAF_callback) {
     12        const fn =
     13            window.requestAnimationFrame ||
     14            window.mozRequestAnimationFrame ||
     15            window.webkitRequestAnimationFrame ||
     16            function (RAF_callback) {
     17                return setTimeout(RAF_callback, 16);
    1718            };
    1819
    19         fn.call( window, RAF_callback );
     20        fn.call(window, RAF_callback);
    2021    }
    2122
    22     RAF( function () {
     23    RAF(function () {
    2324        // Create a bait.
    24         var ad       = document.createElement( 'div' );
     25        const ad = document.createElement('div');
    2526        ad.innerHTML = '&nbsp;';
    26         ad.setAttribute( 'class', 'ad_unit ad-unit text-ad text_ad pub_300x250' );
    27         ad.setAttribute( 'style', 'width: 1px !important; height: 1px !important; position: absolute !important; left: 0px !important; top: 0px !important; overflow: hidden !important;' );
    28         document.body.appendChild( ad );
     27        ad.setAttribute('class', 'ad_unit ad-unit text-ad text_ad pub_300x250');
     28        ad.setAttribute(
     29            'style',
     30            'width: 1px !important; height: 1px !important; position: absolute !important; left: 0px !important; top: 0px !important; overflow: hidden !important;'
     31        );
     32        document.body.appendChild(ad);
    2933
    30         RAF( function () {
    31             var styles      = window.getComputedStyle && window.getComputedStyle( ad );
    32             var moz_binding = styles && styles.getPropertyValue( '-moz-binding' );
     34        RAF(function () {
     35            const styles = window.getComputedStyle?.(ad);
     36            const mozBinding = styles?.getPropertyValue('-moz-binding');
    3337
    34             is_enabled = ( styles && styles.getPropertyValue( 'display' ) === 'none' )
    35                 || ( typeof moz_binding === 'string' && moz_binding.indexOf( 'about:' ) !== - 1 );
     38            isEnabled =
     39                (styles && styles.getPropertyValue('display') === 'none') ||
     40                (typeof mozBinding === 'string' &&
     41                    mozBinding.indexOf('about:') !== -1);
    3642
    3743            // Call pending callbacks.
    38             for ( var i = 0, length = pending_callbacks.length; i < length; i ++ ) {
    39                 pending_callbacks[i]( is_enabled );
     44            for (var i = 0, length = pendingCallbacks.length; i < length; i++) {
     45                pendingCallbacks[i](isEnabled);
    4046            }
    41             pending_callbacks = [];
    42         } );
    43     } );
     47            pendingCallbacks = [];
     48        });
     49    });
    4450
    45     return function ( callback ) {
    46         if ( is_enabled === null ) {
    47             pending_callbacks.push( callback );
     51    return function (callback) {
     52        if ('undefined' === typeof advanced_ads_adblocker_test) {
     53            isEnabled = true;
     54        }
     55        if (isEnabled === null) {
     56            pendingCallbacks.push(callback);
    4857            return;
    4958        }
    5059        // Run the callback immediately
    51         callback( is_enabled );
     60        callback(isEnabled);
    5261    };
    53 }() );
     62})();
  • advanced-ads/trunk/modules/adblock-finder/public/adblocker-enabled.min.js

    r2983598 r3029416  
    1 window.advanced_ads_check_adblocker=function(t){var n=[],e=null;function i(t){var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return setTimeout(t,16)};n.call(window,t)}return i((function(){var t=document.createElement("div");t.innerHTML="&nbsp;",t.setAttribute("class","ad_unit ad-unit text-ad text_ad pub_300x250"),t.setAttribute("style","width: 1px !important; height: 1px !important; position: absolute !important; left: 0px !important; top: 0px !important; overflow: hidden !important;"),document.body.appendChild(t),i((function(){var i=window.getComputedStyle&&window.getComputedStyle(t),o=i&&i.getPropertyValue("-moz-binding");e=i&&"none"===i.getPropertyValue("display")||"string"==typeof o&&-1!==o.indexOf("about:");for(var a=0,r=n.length;a<r;a++)n[a](e);n=[]}))})),function(t){null!==e?t(e):n.push(t)}}();
     1window.advanced_ads_check_adblocker=function(t){var n=[],e=null;function i(t){var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return setTimeout(t,16)};n.call(window,t)}return i((function(){var t=document.createElement("div");t.innerHTML="&nbsp;",t.setAttribute("class","ad_unit ad-unit text-ad text_ad pub_300x250"),t.setAttribute("style","width: 1px !important; height: 1px !important; position: absolute !important; left: 0px !important; top: 0px !important; overflow: hidden !important;"),document.body.appendChild(t),i((function(){var i,o,a=null===(i=(o=window).getComputedStyle)||void 0===i?void 0:i.call(o,t),d=null==a?void 0:a.getPropertyValue("-moz-binding");e=a&&"none"===a.getPropertyValue("display")||"string"==typeof d&&-1!==d.indexOf("about:");for(var r=0,u=n.length;r<u;r++)n[r](e);n=[]}))})),function(t){"undefined"==typeof advanced_ads_adblocker_test&&(e=!0),null!==e?t(e):n.push(t)}}();
  • advanced-ads/trunk/readme.txt

    r3006148 r3029416  
    55Tested up to: 6.4
    66Requires PHP: 7.2
    7 Stable tag: 1.48.1
     7Stable tag: 1.49.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1313== Description ==
    1414
    15 Are you looking for a simple ad manager plugin? These are the top arguments to use Advanced Ads:
    16 
    17 * approved in publishing and ad optimization since 2009
    18 * works with all ad types and networks, including Google AdSense, Google Ad Manager (formerly Google DoubleClick for Publishers, DFP), Amazon ads, or media.net ads
    19 * most features to test and optimize ads
    20 * unlimited ad units
    21 * ads.txt support
    22 * dedicated ad block for the block editor
    23 * Google AdSense Partner, who implements all technical changes early and in 100% compliance with the Google AdSense policies
    24 * the only advertising solution with *Ad Health* integration and Google AdSense violation checks
    25 * best rated [free support](https://wordpress.org/support/plugin/advanced-ads)
     15= The ultimate ad management plugin for WordPress =
     16
     17Advanced Ads is the most comprehensive ad management tool available. It strikes the perfect balance between ease of use and powerful features, trusted by thousands of companies and businesses.
     18
     19We took the pain out of advertising and made it easy to embed ads, banners, or any other code automatically—all within minutes and without the need for theme file editing. If you are looking for the best plugin for ad management, you have found it.
     20
     21[Manual](https://wpadvancedads.com/manual/?utm_source=wporg&utm_medium=link&utm_campaign=wp-linkbar-manual) | [Support](https://wpadvancedads.com/aa-links/support) | [Demo](https://wpadvancedads.com/aa-links/demo) | [Premium Features](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-linkbar-features)
     22
     23* <strong>Usability:</strong> Clearly structured interface • Smart workflows for fluid day-to-day operations
     24* <strong>Functionality:</strong> Setting the gold standard for the market with outstanding features
     25* <strong>Compatibility:</strong> All ad networks • Dedicated integrations with loads of popular plugins and themes
     26* <strong>Expertise:</strong> Fast and top-rated support • Approved in publishing and ad optimization since 2009
     27* <strong>Reputation:</strong> Recommended by Google • Fully compliant with Google AdSense policies
     28
     29Would you like to know if there is a certain feature, what the optimized setup would be, or how to implement your client’s demands? Just [open a thread in the forum](https://wordpress.org/support/plugin/advanced-ads#new-post)!
    2630
    2731This is what our users are saying about Advanced Ads:
    2832
    29 > We use this plugin to deliver rotating ads on a community news site, and it’s great. Both feature-rich and reliable, your imagination is the limit when it comes to the product you want to create for your users. We’ve delivered over a million ad impressions since we launched less than a year ago, using a combination of sidebar, top, sticky and in-content placements — both HTML5 and images. Advanced Ads makes it easy for our small team to deliver a good experience to our users and our advertisers.
    30 > mytown304 on wp.org
    31 
    32 Would you like to know if there is a certain feature, what the optimized setup would be, or how to implement your client’s demands? Just [open a thread in the forum](https://wordpress.org/support/plugin/advanced-ads#new-post)!
    33 
    34 Advanced Ads allowed us to grow from 0 to 100 MM monthly ad impressions. Benefit from our experience as a publisher and monetize your website today!
    35 
    36 > **Advanced Ads All Access**
    37 >This plugin is the lite version of the Advanced Ads plugin that comes with all the features you will ever need to optimize your ads and increase your revenues, including advanced ad targeting, split tests, click fraud protection, lazy loading, background, popups and sticky ads, full AMP support, adblocker detection, the most comfortable Google Ad Manager integration, and tons more. [Click here to purchase the best premium WordPress ad management plugin now!](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-all-access)
     33> We use this plugin to deliver rotating ads on a community news site, and it’s great. We’ve delivered over a million ad impressions since we launched less than a year ago, using a combination of sidebar, top, sticky and in-content placements — both HTML5 and images. Advanced Ads makes it easy for our small team to deliver a good experience to our users and our advertisers.
     34> <i>mytown304 on wp.org</i>
     35
     36Advanced Ads allowed our founder to grow from 0 to 100 MM monthly ad impressions. Benefit from our experience as publishers and monetize your website today!
     37
     38= Premium Features =
     39This plugin is the lite version of the Advanced Ads plugin that comes with all the features you will ever need to optimize your ads and increase your revenues, including performance tracking, advanced ad targeting, split tests, click fraud protection, lazy loading, background ads, popups and sticky ads, full AMP support, adblocker detection, the most comfortable Google Ad Manager integration, and tons more. [Click here to purchase the best premium WordPress ad management plugin now!](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-all-access)
    3840
    3941[Full Feature List](https://wpadvancedads.com/features/?utm_source=wporg&utm_medium=link&utm_campaign=wp-features)
     
    150152https://vimeo.com/577170591
    151153
    152 > <strong>Add-Ons</strong>
    153 >
    154 > * all add-ons include priority email support
    155 > * [All Access](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – includes all available add-ons
    156 > * [Advanced Ads Pro](https://wpadvancedads.com/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – powerful tools for ad optimizations: cache-busting, more placements, [lazy loading](https://wpadvancedads.com/lazy-load-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features), ad blocker module, [click fraud protection](https://wpadvancedads.com/manual/click-fraud-protection/?utm_source=wporg&utm_medium=link&utm_campaign=features), [geo targeting](https://wpadvancedads.com/add-ons/geo-targeting/?utm_source=wporg&utm_medium=link&utm_campaign=features), [parallax ads](https://wpadvancedads.com/parallax-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features) and many more
    157 > * [Tracking](https://wpadvancedads.com/add-ons/tracking/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – track ad impressions and ad clicks with local methods or Google Analytics
    158 > * [AMP Ads](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – make your ads compatible with AMP and convert Google AdSense ads automatically
    159 > * [Google Ad Manager Integration](https://wpadvancedads.com/add-ons/google-ad-manager/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – a quick and error-free way to load ad units from your Google Ad Manager (formerly Google DoubleClick for Publishers, DFP) account without touching any ad codes
    160 > * [Sticky Ads](https://wpadvancedads.com/add-ons/sticky-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – increase click rates with fixed, sticky, and anchor ads
    161 > * [Fixed Widget for WordPress](https://wordpress.org/plugins/q2w3-fixed-widget/) – turn sidebar widgets into performant fixed sticky ads
    162 > * [PopUp and Layer Ads](https://wpadvancedads.com/add-ons/popup-and-layer-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – display ads and other content in layers, popups, and interstitials
    163 > * [Selling Ads](https://wpadvancedads.com/add-ons/selling-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) - allows you to sell ads on your website fully automated, including payments and advertiser profiles
    164 > * [Ad Slider](https://wpadvancedads.com/add-ons/slider/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – create a simple slider from your ads
    165 > * [Full Feature List](https://wpadvancedads.com/features/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons)
     154= Add-Ons =
     155
     156* all add-ons include priority email support
     157* [All Access](https://wpadvancedads.com/add-ons/all-access/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – includes all available add-ons
     158* [Advanced Ads Pro](https://wpadvancedads.com/advanced-ads-pro/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – powerful tools for ad optimizations: cache-busting, more placements, [lazy loading](https://wpadvancedads.com/lazy-load-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features), ad blocker module, [click fraud protection](https://wpadvancedads.com/manual/click-fraud-protection/?utm_source=wporg&utm_medium=link&utm_campaign=features), [geo targeting](https://wpadvancedads.com/add-ons/geo-targeting/?utm_source=wporg&utm_medium=link&utm_campaign=features), [parallax ads](https://wpadvancedads.com/parallax-ads/?utm_source=wporg&utm_medium=link&utm_campaign=features) and many more
     159* [Tracking](https://wpadvancedads.com/add-ons/tracking/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – track ad impressions and ad clicks with local methods or Google Analytics
     160* [AMP Ads](https://wpadvancedads.com/add-ons/amp-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – make your ads compatible with AMP and convert Google AdSense ads automatically
     161* [Google Ad Manager Integration](https://wpadvancedads.com/add-ons/google-ad-manager/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – a quick and error-free way to load ad units from your Google Ad Manager (formerly Google DoubleClick for Publishers, DFP) account without touching any ad codes
     162* [Sticky Ads](https://wpadvancedads.com/add-ons/sticky-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – increase click rates with fixed, sticky, and anchor ads
     163* [Fixed Widget for WordPress](https://wordpress.org/plugins/q2w3-fixed-widget/) – turn sidebar widgets into performant fixed sticky ads
     164* [PopUp and Layer Ads](https://wpadvancedads.com/add-ons/popup-and-layer-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – display ads and other content in layers, popups, and interstitials
     165* [Selling Ads](https://wpadvancedads.com/add-ons/selling-ads/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) - allows you to sell ads on your website fully automated, including payments and advertiser profiles
     166* [Ad Slider](https://wpadvancedads.com/add-ons/slider/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons) – create a simple slider from your ads
     167* [Full Feature List](https://wpadvancedads.com/features/?utm_source=wporg&utm_medium=link&utm_campaign=wp-add-ons)
    166168
    167169= ad blocker =
     
    337339== Changelog ==
    338340
    339 = 1.48.1 (December 6, 2023) =
    340 
    341 - Fix: prevent ad weight from always showing 10
    342 
    343 = 1.48.0 (December 5, 2023) =
    344 
    345 - Improvement: show Google Ad Manager debug link in Ad Health even when only a head tag exists
    346 - Improvement: add arrows to jump through highlighted ads
    347 - Improvement: link ads in the group modal
    348 - Improvement: update the plugin list and its descriptions on the dashboard
    349 - Improvement: add correct jumping through highlighted AdSense ads
    350 - Fix: ensure ads without a stored ad weight in the database are displayed on the group page
    351 - Fix: show the tooltip with placement and ad names only when 'highlight ads' is enabled
     341= 1.49.0 (January 31, 2024) =
     342
     343- Improvement: enhance ad blocker detection to identify more ad blockers reliably
     344- Improvement: remove universal analytics description
     345- Fix: allow content age display condition to work with AJAX cache busting
     346- Fix: show search bar for author if max terms reach the limit
     347- Fix: prevent a fatal error on the ad edit page related to Display Conditions
Note: See TracChangeset for help on using the changeset viewer.