Version Description
- inject ads automatically based on div, table, quotes, iframe, and other HTML tags
- define your own injection rules using the new "custom" option for the Content placement
- hide Shortcode button in TinyMCE editor by default for new users
- added
advanced-ads-options
filter for main plugin options - prevent automatic ad injection into paragraphs within blockquotes
- hide placement options after publishing an ad translated with WPML
- disallowed ad insertion into the header of the WP File Manager's admin page
Download this release
Release Info
Developer | advancedads |
Plugin | Advanced Ads |
Version | 1.18.0 |
Comparing to | |
See all releases |
Code changes from version 1.17.12 to 1.18.0
- admin/assets/img/tinymce-icon.png +0 -0
- admin/assets/js/admin.js +25 -0
- admin/includes/class-ad-type.php +15 -2
- admin/includes/class-menu.php +1 -1
- admin/views/checks.php +1 -1
- admin/views/placement-injection-top.php +1 -4
- admin/views/placements-content-index.php +15 -9
- admin/views/placements.php +11 -0
- admin/views/settings.php +1 -1
- admin/views/support.php +1 -1
- admin/views/upgrades/repeat-the-position.php +3 -0
- advanced-ads.php +2 -2
- classes/EDD_SL_Plugin_Updater.php +30 -13
- classes/ad-debug.php +1 -1
- classes/ad_group.php +31 -31
- classes/ad_placements.php +133 -6
- classes/ad_type_abstract.php +10 -10
- classes/ad_type_content.php +5 -5
- classes/ad_type_dummy.php +3 -3
- classes/ad_type_group.php +4 -4
- classes/ad_type_image.php +95 -78
- classes/ad_type_plain.php +33 -24
- classes/frontend_checks.php +1 -1
- classes/plugin.php +21 -0
- classes/upgrades.php +1 -1
- includes/array_ad_conditions.php +1 -1
- includes/functions.php +7 -7
- languages/advanced-ads.pot +185 -138
- lib/composer/autoload_real.php +3 -0
- modules/ad-blocker/admin/admin.php +4 -4
- modules/ad-blocker/classes/plugin.php +2 -2
- modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php +0 -10
- modules/gadsense/includes/class-adsense-report.php +4 -4
- modules/gadsense/includes/class-mapi.php +3 -3
- modules/gadsense/public/public.php +1 -1
- modules/gutenberg/includes/class-gutenberg.php +1 -1
- modules/import-export/classes/export.php +1 -1
- modules/import-export/classes/import.php +4 -4
- modules/import-export/views/page.php +1 -1
- modules/privacy/admin/admin.php +5 -5
- modules/privacy/classes/plugin.php +2 -2
- public/class-advanced-ads.php +5 -0
- readme.txt +13 -293
admin/assets/img/tinymce-icon.png
CHANGED
Binary file
|
admin/assets/js/admin.js
CHANGED
@@ -434,6 +434,31 @@ jQuery( document ).ready( function ( $ ) {
|
|
434 |
} )
|
435 |
} )
|
436 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
/**
|
438 |
* Image ad uploader
|
439 |
*/
|
434 |
} )
|
435 |
} )
|
436 |
|
437 |
+
// show input field for custom xpath rule when "custom" option is selected for Content placement
|
438 |
+
// iterate through all tag options of all placements
|
439 |
+
$( '.advads-placements-content-tag' ).each( function(){
|
440 |
+
advads_show_placement_content_xpath_field( this );
|
441 |
+
})
|
442 |
+
// update xpath field when tag option changes
|
443 |
+
$( '.advads-placements-content-tag' ).change( function () {
|
444 |
+
advads_show_placement_content_xpath_field( this );
|
445 |
+
} )
|
446 |
+
/**
|
447 |
+
* show / hide input field for xpath rule
|
448 |
+
*
|
449 |
+
* @param tag field
|
450 |
+
*/
|
451 |
+
function advads_show_placement_content_xpath_field( tag_field ){
|
452 |
+
// get the value of the content tag option
|
453 |
+
var tag = $( tag_field ).find( 'option:selected').val();
|
454 |
+
// show or hide the next following custom xpath option
|
455 |
+
if( 'custom' === tag ) {
|
456 |
+
$( tag_field ).next( '.advads-placements-content-custom-xpath' ).show();
|
457 |
+
} else {
|
458 |
+
$( tag_field ).next( '.advads-placements-content-custom-xpath' ).hide();
|
459 |
+
}
|
460 |
+
}
|
461 |
+
|
462 |
/**
|
463 |
* Image ad uploader
|
464 |
*/
|
admin/includes/class-ad-type.php
CHANGED
@@ -505,6 +505,7 @@ class Advanced_Ads_Admin_Ad_Type {
|
|
505 |
*/
|
506 |
public function save_ad( $post_id ) {
|
507 |
|
|
|
508 |
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads' ) ) // only use for ads, no other post type.
|
509 |
|| ! isset( $_POST['post_type'] )
|
510 |
|| $this->post_type != $_POST['post_type']
|
@@ -625,6 +626,8 @@ class Advanced_Ads_Admin_Ad_Type {
|
|
625 |
}
|
626 |
}
|
627 |
|
|
|
|
|
628 |
$ad->save();
|
629 |
}
|
630 |
|
@@ -712,8 +715,18 @@ class Advanced_Ads_Admin_Ad_Type {
|
|
712 |
|
713 |
// display general and wizard information.
|
714 |
include ADVADS_BASE_PATH . 'admin/views/ad-info-top.php';
|
715 |
-
//
|
716 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
717 |
}
|
718 |
|
719 |
/**
|
505 |
*/
|
506 |
public function save_ad( $post_id ) {
|
507 |
|
508 |
+
// phpcs:disable WordPress.Security.NonceVerification.Missing
|
509 |
if ( ! current_user_can( Advanced_Ads_Plugin::user_cap( 'advanced_ads_edit_ads' ) ) // only use for ads, no other post type.
|
510 |
|| ! isset( $_POST['post_type'] )
|
511 |
|| $this->post_type != $_POST['post_type']
|
626 |
}
|
627 |
}
|
628 |
|
629 |
+
// phpcs:enable
|
630 |
+
|
631 |
$ad->save();
|
632 |
}
|
633 |
|
715 |
|
716 |
// display general and wizard information.
|
717 |
include ADVADS_BASE_PATH . 'admin/views/ad-info-top.php';
|
718 |
+
// Don’t show placement options if this is an ad translated with WPML since the placement might exist already.
|
719 |
+
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
|
720 |
+
$trid = apply_filters( 'wpml_element_trid', null, $post->ID );
|
721 |
+
$translations = apply_filters( 'wpml_get_element_translations', null, $trid, 'Advanced_Ads' );
|
722 |
+
if ( count( $translations ) > 1 ) {
|
723 |
+
return;
|
724 |
+
}
|
725 |
+
}
|
726 |
+
// Display ad injection information after ad is created.
|
727 |
+
if ( isset( $_GET['message'] ) && 6 === $_GET['message'] ) {
|
728 |
+
include ADVADS_BASE_PATH . 'admin/views/placement-injection-top.php';
|
729 |
+
}
|
730 |
}
|
731 |
|
732 |
/**
|
admin/includes/class-menu.php
CHANGED
@@ -68,7 +68,7 @@ class Advanced_Ads_Admin_Menu {
|
|
68 |
Advanced_Ads_Plugin::user_cap( 'advanced_ads_see_interface' ),
|
69 |
$this->plugin_slug,
|
70 |
array( $this, 'display_overview_page' ),
|
71 |
-
|
72 |
'58.74'
|
73 |
);
|
74 |
}
|
68 |
Advanced_Ads_Plugin::user_cap( 'advanced_ads_see_interface' ),
|
69 |
$this->plugin_slug,
|
70 |
array( $this, 'display_overview_page' ),
|
71 |
+
Advanced_Ads_Plugin::get_icon_svg(),
|
72 |
'58.74'
|
73 |
);
|
74 |
}
|
admin/views/checks.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
*
|
5 |
* listed on support and settings page
|
6 |
*/
|
7 |
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* A couple of checks to see if there is any critical issue
|
5 |
* listed on support and settings page
|
6 |
*/
|
7 |
|
admin/views/placement-injection-top.php
CHANGED
@@ -6,9 +6,7 @@
|
|
6 |
*/
|
7 |
// show quick injection options.
|
8 |
// check if the ad code contains the AdSense verification and Auto ads code.
|
9 |
-
$is_page_level_ad_in_code_field = ( isset( $ad->type ) && 'plain' === $ad->type && strpos( $ad->content, 'enable_page_level_ads' ) ) || preg_match( '/script[^>]+data-ad-client=/', $ad->content );
|
10 |
-
|
11 |
-
if ( isset( $_GET['message'] ) && 6 === $_GET['message'] ) : ?>
|
12 |
<div id="advads-ad-injection-box" class="advads-ad-metabox postbox">
|
13 |
<span class="advads-loader" style="display: none;"></span>
|
14 |
<div id="advads-ad-injection-message-placement-created" class="hidden">
|
@@ -184,4 +182,3 @@ if ( isset( $_GET['message'] ) && 6 === $_GET['message'] ) : ?>
|
|
184 |
</div>
|
185 |
</div>
|
186 |
<?php
|
187 |
-
endif;
|
6 |
*/
|
7 |
// show quick injection options.
|
8 |
// check if the ad code contains the AdSense verification and Auto ads code.
|
9 |
+
$is_page_level_ad_in_code_field = ( isset( $ad->type ) && 'plain' === $ad->type && strpos( $ad->content, 'enable_page_level_ads' ) ) || preg_match( '/script[^>]+data-ad-client=/', $ad->content ); ?>
|
|
|
|
|
10 |
<div id="advads-ad-injection-box" class="advads-ad-metabox postbox">
|
11 |
<span class="advads-loader" style="display: none;"></span>
|
12 |
<div id="advads-ad-injection-message-placement-created" class="hidden">
|
182 |
</div>
|
183 |
</div>
|
184 |
<?php
|
|
admin/views/placements-content-index.php
CHANGED
@@ -4,13 +4,14 @@
|
|
4 |
*
|
5 |
* @var string $_placement_slug slug of the current placement.
|
6 |
* @var array $_placement information of the current placement.
|
|
|
|
|
|
|
|
|
7 |
*/
|
8 |
-
|
9 |
-
'after' => __( 'after', 'advanced-ads' ),
|
10 |
-
'before' => __( 'before', 'advanced-ads' ),
|
11 |
-
); ?>
|
12 |
<select name="advads[placements][<?php echo esc_attr( $_placement_slug ); ?>][options][position]">
|
13 |
-
<?php foreach ( $
|
14 |
<option value="<?php echo esc_attr( $_pos_key ); ?>"
|
15 |
<?php
|
16 |
if ( isset( $_placement['options']['position'] ) ) {
|
@@ -22,19 +23,24 @@ $_positions = array(
|
|
22 |
<?php endforeach; ?>
|
23 |
</select>
|
24 |
|
25 |
-
<input type="number" name="advads[placements][<?php echo esc_attr( $_placement_slug ); ?>][options][index]" value="<?php echo
|
26 |
|
27 |
<?php $tags = Advanced_Ads_Placements::tags_for_content_injection(); ?>
|
28 |
-
<select name="advads[placements][<?php echo esc_attr( $_placement_slug ); ?>][options][tag]">
|
29 |
<?php foreach ( $tags as $_tag_key => $_tag ) : ?>
|
30 |
<option value="<?php echo esc_attr( $_tag_key ); ?>"
|
31 |
<?php
|
32 |
-
if (
|
33 |
-
selected( $
|
34 |
?>
|
35 |
><?php echo esc_html( $_tag ); ?></option>
|
36 |
<?php endforeach; ?>
|
37 |
</select>
|
|
|
|
|
|
|
|
|
|
|
38 |
|
39 |
<p><label><input type="checkbox" name="advads[placements][<?php echo esc_attr( $_placement_slug ); ?>][options][start_from_bottom]" value="1"
|
40 |
<?php
|
4 |
*
|
5 |
* @var string $_placement_slug slug of the current placement.
|
6 |
* @var array $_placement information of the current placement.
|
7 |
+
* @var string $option_xpath xpath option.
|
8 |
+
* @var string $option_tag tag option.
|
9 |
+
* @var string $option_index index option.
|
10 |
+
* @var array $positions positions option.
|
11 |
*/
|
12 |
+
?>
|
|
|
|
|
|
|
13 |
<select name="advads[placements][<?php echo esc_attr( $_placement_slug ); ?>][options][position]">
|
14 |
+
<?php foreach ( $positions as $_pos_key => $_pos ) : ?>
|
15 |
<option value="<?php echo esc_attr( $_pos_key ); ?>"
|
16 |
<?php
|
17 |
if ( isset( $_placement['options']['position'] ) ) {
|
23 |
<?php endforeach; ?>
|
24 |
</select>
|
25 |
|
26 |
+
<input type="number" name="advads[placements][<?php echo esc_attr( $_placement_slug ); ?>][options][index]" value="<?php echo absint( $option_index ); ?>" min="1"/>.
|
27 |
|
28 |
<?php $tags = Advanced_Ads_Placements::tags_for_content_injection(); ?>
|
29 |
+
<select class="advads-placements-content-tag" name="advads[placements][<?php echo esc_attr( $_placement_slug ); ?>][options][tag]">
|
30 |
<?php foreach ( $tags as $_tag_key => $_tag ) : ?>
|
31 |
<option value="<?php echo esc_attr( $_tag_key ); ?>"
|
32 |
<?php
|
33 |
+
if ( $option_tag ) {
|
34 |
+
selected( $option_tag, $_tag_key ); }
|
35 |
?>
|
36 |
><?php echo esc_html( $_tag ); ?></option>
|
37 |
<?php endforeach; ?>
|
38 |
</select>
|
39 |
+
<input name="advads[placements][<?php echo esc_attr( $_placement_slug ); ?>][options][xpath]"
|
40 |
+
class="advads-placements-content-custom-xpath<?php echo 'custom' !== $option_tag ? ' hidden' : ''; ?>"
|
41 |
+
type="text"
|
42 |
+
value="<?php echo esc_html( $option_xpath ); ?>"
|
43 |
+
placeholder="<?php esc_html_e( 'use xpath, e.g. `p[not(parent::blockquote)]`', 'advanced-ads' ); ?>"/>
|
44 |
|
45 |
<p><label><input type="checkbox" name="advads[placements][<?php echo esc_attr( $_placement_slug ); ?>][options][start_from_bottom]" value="1"
|
46 |
<?php
|
admin/views/placements.php
CHANGED
@@ -148,8 +148,19 @@ if ( isset( $placements ) && is_array( $placements ) && count( $placements ) ) :
|
|
148 |
<?php
|
149 |
switch ( $_placement['type'] ) :
|
150 |
case 'post_content':
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
ob_start();
|
152 |
include ADVADS_BASE_PATH . 'admin/views/placements-content-index.php';
|
|
|
|
|
|
|
|
|
153 |
do_action( 'advanced-ads-placement-post-content-position', $_placement_slug, $_placement );
|
154 |
$option_content = ob_get_clean();
|
155 |
|
148 |
<?php
|
149 |
switch ( $_placement['type'] ) :
|
150 |
case 'post_content':
|
151 |
+
$option_index = isset( $_placement['options']['index'] ) ? absint( max( 1, (int) $_placement['options']['index'] ) ) : 1;
|
152 |
+
$option_tag = isset( $_placement['options']['tag'] ) ? $_placement['options']['tag'] : 'p';
|
153 |
+
$option_xpath = isset( $_placement['options']['xpath'] ) ? stripslashes( $_placement['options']['xpath'] ) : '';
|
154 |
+
$positions = array(
|
155 |
+
'after' => __( 'after', 'advanced-ads' ),
|
156 |
+
'before' => __( 'before', 'advanced-ads' ),
|
157 |
+
);
|
158 |
ob_start();
|
159 |
include ADVADS_BASE_PATH . 'admin/views/placements-content-index.php';
|
160 |
+
if ( ! defined( 'AAP_VERSION' ) ) {
|
161 |
+
include ADVADS_BASE_PATH . 'admin/views/upgrades/repeat-the-position.php';
|
162 |
+
}
|
163 |
+
|
164 |
do_action( 'advanced-ads-placement-post-content-position', $_placement_slug, $_placement );
|
165 |
$option_content = ob_get_clean();
|
166 |
|
admin/views/settings.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*/
|
5 |
|
6 |
// array with setting tabs for frontend.
|
1 |
<?php
|
2 |
/**
|
3 |
+
* The view for the settings page
|
4 |
*/
|
5 |
|
6 |
// array with setting tabs for frontend.
|
admin/views/support.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*/
|
5 |
?><div class="wrap">
|
6 |
<p><?php esc_html_e( 'Please fix the red highlighted issues on this page or try to understand their consequences before contacting support.', 'advanced-ads' ); ?></p>
|
1 |
<?php
|
2 |
/**
|
3 |
+
* The view for the support page
|
4 |
*/
|
5 |
?><div class="wrap">
|
6 |
<p><?php esc_html_e( 'Please fix the red highlighted issues on this page or try to understand their consequences before contacting support.', 'advanced-ads' ); ?></p>
|
admin/views/upgrades/repeat-the-position.php
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
<p><label><input type="checkbox" disabled="disabled"/><?php esc_html_e( 'repeat the position', 'advanced-ads' ); ?></label>
|
2 |
+
<?php Advanced_Ads_Admin_Upgrades::upgrade_link( null, ADVADS_URL . 'add-ons/advanced-ads-pro/', 'upgrade-content-repeat' ); ?>
|
3 |
+
</p>
|
advanced-ads.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
* Plugin Name: Advanced Ads
|
13 |
* Plugin URI: https://wpadvancedads.com
|
14 |
* Description: Manage and optimize your ads in WordPress
|
15 |
-
* Version: 1.
|
16 |
* Author: Thomas Maier, Advanced Ads GmbH
|
17 |
* Author URI: https://wpadvancedads.com
|
18 |
* Text Domain: advanced-ads
|
@@ -39,7 +39,7 @@ define( 'ADVADS_BASE_DIR', dirname( ADVADS_BASE ) ); // directory of the plugin
|
|
39 |
// general and global slug, e.g. to store options in WP.
|
40 |
define( 'ADVADS_SLUG', 'advanced-ads' );
|
41 |
define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
|
42 |
-
define( 'ADVADS_VERSION', '1.
|
43 |
|
44 |
// Autoloading, modules and functions.
|
45 |
|
12 |
* Plugin Name: Advanced Ads
|
13 |
* Plugin URI: https://wpadvancedads.com
|
14 |
* Description: Manage and optimize your ads in WordPress
|
15 |
+
* Version: 1.18.0
|
16 |
* Author: Thomas Maier, Advanced Ads GmbH
|
17 |
* Author URI: https://wpadvancedads.com
|
18 |
* Text Domain: advanced-ads
|
39 |
// general and global slug, e.g. to store options in WP.
|
40 |
define( 'ADVADS_SLUG', 'advanced-ads' );
|
41 |
define( 'ADVADS_URL', 'https://wpadvancedads.com/' );
|
42 |
+
define( 'ADVADS_VERSION', '1.18.0' );
|
43 |
|
44 |
// Autoloading, modules and functions.
|
45 |
|
classes/EDD_SL_Plugin_Updater.php
CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
7 |
* Allows plugins to use their own update API.
|
8 |
*
|
9 |
* @author Easy Digital Downloads
|
10 |
-
* @version 1.7
|
11 |
*/
|
12 |
class ADVADS_SL_Plugin_Updater {
|
13 |
|
@@ -317,10 +317,8 @@ class ADVADS_SL_Plugin_Updater {
|
|
317 |
)
|
318 |
);
|
319 |
|
320 |
-
$cache_key = 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
|
321 |
-
|
322 |
// Get the transient where we store the api request for this plugin for 24 hours
|
323 |
-
$edd_api_request_transient = $this->get_cached_version_info(
|
324 |
|
325 |
//If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
|
326 |
if ( empty( $edd_api_request_transient ) ) {
|
@@ -328,7 +326,7 @@ class ADVADS_SL_Plugin_Updater {
|
|
328 |
$api_response = $this->api_request( 'plugin_information', $to_send );
|
329 |
|
330 |
// Expires in 3 hours
|
331 |
-
$this->set_version_info_cache( $api_response
|
332 |
|
333 |
if ( false !== $api_response ) {
|
334 |
$_data = $api_response;
|
@@ -493,6 +491,9 @@ class ADVADS_SL_Plugin_Updater {
|
|
493 |
return $request;
|
494 |
}
|
495 |
|
|
|
|
|
|
|
496 |
public function show_changelog() {
|
497 |
|
498 |
global $edd_plugin_data;
|
@@ -514,9 +515,7 @@ class ADVADS_SL_Plugin_Updater {
|
|
514 |
}
|
515 |
|
516 |
$data = $edd_plugin_data[ $_REQUEST['slug'] ];
|
517 |
-
$
|
518 |
-
$cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' );
|
519 |
-
$version_info = $this->get_cached_version_info( $cache_key );
|
520 |
|
521 |
if( false === $version_info ) {
|
522 |
|
@@ -537,7 +536,6 @@ class ADVADS_SL_Plugin_Updater {
|
|
537 |
$version_info = json_decode( wp_remote_retrieve_body( $request ) );
|
538 |
}
|
539 |
|
540 |
-
|
541 |
if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
|
542 |
$version_info->sections = maybe_unserialize( $version_info->sections );
|
543 |
} else {
|
@@ -550,17 +548,28 @@ class ADVADS_SL_Plugin_Updater {
|
|
550 |
}
|
551 |
}
|
552 |
|
553 |
-
$this->set_version_info_cache( $version_info
|
554 |
|
|
|
|
|
555 |
}
|
556 |
|
557 |
-
if
|
558 |
-
|
|
|
|
|
|
|
559 |
}
|
560 |
|
561 |
exit;
|
562 |
}
|
563 |
|
|
|
|
|
|
|
|
|
|
|
|
|
564 |
public function get_cached_version_info( $cache_key = '' ) {
|
565 |
|
566 |
if( empty( $cache_key ) ) {
|
@@ -570,7 +579,7 @@ class ADVADS_SL_Plugin_Updater {
|
|
570 |
$cache = get_option( $cache_key );
|
571 |
|
572 |
if( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
|
573 |
-
return false; // Cache is expired
|
574 |
}
|
575 |
|
576 |
// We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point.
|
@@ -583,6 +592,12 @@ class ADVADS_SL_Plugin_Updater {
|
|
583 |
|
584 |
}
|
585 |
|
|
|
|
|
|
|
|
|
|
|
|
|
586 |
public function set_version_info_cache( $value = '', $cache_key = '' ) {
|
587 |
|
588 |
if( empty( $cache_key ) ) {
|
@@ -596,6 +611,8 @@ class ADVADS_SL_Plugin_Updater {
|
|
596 |
|
597 |
update_option( $cache_key, $data, 'no' );
|
598 |
|
|
|
|
|
599 |
}
|
600 |
|
601 |
/**
|
7 |
* Allows plugins to use their own update API.
|
8 |
*
|
9 |
* @author Easy Digital Downloads
|
10 |
+
* @version 1.7.1
|
11 |
*/
|
12 |
class ADVADS_SL_Plugin_Updater {
|
13 |
|
317 |
)
|
318 |
);
|
319 |
|
|
|
|
|
320 |
// Get the transient where we store the api request for this plugin for 24 hours
|
321 |
+
$edd_api_request_transient = $this->get_cached_version_info();
|
322 |
|
323 |
//If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
|
324 |
if ( empty( $edd_api_request_transient ) ) {
|
326 |
$api_response = $this->api_request( 'plugin_information', $to_send );
|
327 |
|
328 |
// Expires in 3 hours
|
329 |
+
$this->set_version_info_cache( $api_response );
|
330 |
|
331 |
if ( false !== $api_response ) {
|
332 |
$_data = $api_response;
|
491 |
return $request;
|
492 |
}
|
493 |
|
494 |
+
/**
|
495 |
+
* If available, show the changelog for sites in a multisite install.
|
496 |
+
*/
|
497 |
public function show_changelog() {
|
498 |
|
499 |
global $edd_plugin_data;
|
515 |
}
|
516 |
|
517 |
$data = $edd_plugin_data[ $_REQUEST['slug'] ];
|
518 |
+
$version_info = $this->get_cached_version_info();
|
|
|
|
|
519 |
|
520 |
if( false === $version_info ) {
|
521 |
|
536 |
$version_info = json_decode( wp_remote_retrieve_body( $request ) );
|
537 |
}
|
538 |
|
|
|
539 |
if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
|
540 |
$version_info->sections = maybe_unserialize( $version_info->sections );
|
541 |
} else {
|
548 |
}
|
549 |
}
|
550 |
|
551 |
+
$this->set_version_info_cache( $version_info );
|
552 |
|
553 |
+
// Delete the unneeded option.
|
554 |
+
delete_option( md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $this->beta . '_version_info' ) );
|
555 |
}
|
556 |
|
557 |
+
if ( isset( $version_info->sections ) ) {
|
558 |
+
$sections = $this->convert_object_to_array( $version_info->sections );
|
559 |
+
if ( ! empty( $sections['changelog'] ) ) {
|
560 |
+
echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections['changelog'] ) . '</div>';
|
561 |
+
}
|
562 |
}
|
563 |
|
564 |
exit;
|
565 |
}
|
566 |
|
567 |
+
/**
|
568 |
+
* Gets the plugin's cached version information from the database.
|
569 |
+
*
|
570 |
+
* @param string $cache_key needs to be explained by EDD.
|
571 |
+
* @return boolean|string
|
572 |
+
*/
|
573 |
public function get_cached_version_info( $cache_key = '' ) {
|
574 |
|
575 |
if( empty( $cache_key ) ) {
|
579 |
$cache = get_option( $cache_key );
|
580 |
|
581 |
if( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
|
582 |
+
return false; // Cache is expired.
|
583 |
}
|
584 |
|
585 |
// We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point.
|
592 |
|
593 |
}
|
594 |
|
595 |
+
/**
|
596 |
+
* Adds the plugin version information to the database.
|
597 |
+
*
|
598 |
+
* @param string $value needs to be explained by EDD.
|
599 |
+
* @param string $cache_key needs to be explained by EDD.
|
600 |
+
*/
|
601 |
public function set_version_info_cache( $value = '', $cache_key = '' ) {
|
602 |
|
603 |
if( empty( $cache_key ) ) {
|
611 |
|
612 |
update_option( $cache_key, $data, 'no' );
|
613 |
|
614 |
+
// Delete the duplicate option.
|
615 |
+
delete_option( 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) ) );
|
616 |
}
|
617 |
|
618 |
/**
|
classes/ad-debug.php
CHANGED
@@ -78,7 +78,7 @@ class Advanced_Ads_Ad_Debug {
|
|
78 |
}
|
79 |
|
80 |
/**
|
81 |
-
*
|
82 |
*
|
83 |
* @since 1.7.0.3
|
84 |
*/
|
78 |
}
|
79 |
|
80 |
/**
|
81 |
+
* Build table with differences between current and main query
|
82 |
*
|
83 |
* @since 1.7.0.3
|
84 |
*/
|
classes/ad_group.php
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
*/
|
12 |
|
13 |
/**
|
14 |
-
*
|
15 |
*
|
16 |
* @package Advanced_Ads_Group
|
17 |
* @author Thomas Maier <support@wpadvancedads.com>
|
@@ -19,55 +19,55 @@
|
|
19 |
class Advanced_Ads_Group {
|
20 |
|
21 |
/**
|
22 |
-
*
|
23 |
* previously called MAX_AD_GROUP_WEIGHT
|
24 |
*/
|
25 |
const MAX_AD_GROUP_DEFAULT_WEIGHT = 10;
|
26 |
|
27 |
/**
|
28 |
-
*
|
29 |
*/
|
30 |
public $id = 0;
|
31 |
|
32 |
/**
|
33 |
-
*
|
34 |
*
|
35 |
* @since 1.4.8
|
36 |
*/
|
37 |
public $type = 'default';
|
38 |
|
39 |
/**
|
40 |
-
*
|
41 |
*/
|
42 |
public $taxonomy = '';
|
43 |
|
44 |
/**
|
45 |
-
*
|
46 |
*/
|
47 |
protected $post_type = '';
|
48 |
|
49 |
/**
|
50 |
-
*
|
51 |
*/
|
52 |
protected $current_ad = '';
|
53 |
|
54 |
/**
|
55 |
-
*
|
56 |
*/
|
57 |
public $name = '';
|
58 |
|
59 |
/**
|
60 |
-
*
|
61 |
*/
|
62 |
public $slug = '';
|
63 |
|
64 |
/**
|
65 |
-
*
|
66 |
*/
|
67 |
public $description = '';
|
68 |
|
69 |
/**
|
70 |
-
*
|
71 |
*/
|
72 |
public $ad_count = 1;
|
73 |
|
@@ -86,12 +86,12 @@ class Advanced_Ads_Group {
|
|
86 |
public $ad_args = array();
|
87 |
|
88 |
/**
|
89 |
-
*
|
90 |
*/
|
91 |
private $ad_weights = 0;
|
92 |
|
93 |
/**
|
94 |
-
*
|
95 |
*/
|
96 |
private $ads = array();
|
97 |
|
@@ -109,7 +109,7 @@ class Advanced_Ads_Group {
|
|
109 |
public $label = '';
|
110 |
|
111 |
/**
|
112 |
-
*
|
113 |
*
|
114 |
* @since 1.0.0
|
115 |
* @param int|obj $group either id of the ad group (= taxonomy id) or term object
|
@@ -127,7 +127,7 @@ class Advanced_Ads_Group {
|
|
127 |
}
|
128 |
|
129 |
/**
|
130 |
-
*
|
131 |
*
|
132 |
* @since 1.4.8
|
133 |
* @param int $id group id
|
@@ -152,7 +152,7 @@ class Advanced_Ads_Group {
|
|
152 |
}
|
153 |
|
154 |
/**
|
155 |
-
*
|
156 |
*
|
157 |
* @since 1.4.8
|
158 |
*/
|
@@ -184,7 +184,7 @@ class Advanced_Ads_Group {
|
|
184 |
}
|
185 |
|
186 |
/**
|
187 |
-
*
|
188 |
*
|
189 |
* @since 1.4.8
|
190 |
* @param array/null ordered_ad_ids ordered ids of the ads that belong to the group
|
@@ -268,7 +268,7 @@ class Advanced_Ads_Group {
|
|
268 |
}
|
269 |
|
270 |
/**
|
271 |
-
*
|
272 |
*
|
273 |
* @return array/null ordered ad ads that belong to the group
|
274 |
*/
|
@@ -314,7 +314,7 @@ class Advanced_Ads_Group {
|
|
314 |
}
|
315 |
|
316 |
/**
|
317 |
-
*
|
318 |
*
|
319 |
* @since 1.0.0
|
320 |
*/
|
@@ -326,7 +326,7 @@ class Advanced_Ads_Group {
|
|
326 |
}
|
327 |
|
328 |
/**
|
329 |
-
*
|
330 |
*
|
331 |
* @since 1.0.0
|
332 |
* @update 1.1.0 load only public ads
|
@@ -370,7 +370,7 @@ class Advanced_Ads_Group {
|
|
370 |
}
|
371 |
|
372 |
/**
|
373 |
-
*
|
374 |
*
|
375 |
* @since 1.0.0
|
376 |
* @param arr $ads array with post objects
|
@@ -388,7 +388,7 @@ class Advanced_Ads_Group {
|
|
388 |
}
|
389 |
|
390 |
/**
|
391 |
-
*
|
392 |
*
|
393 |
* @since 1.0.0
|
394 |
* @param arr $ads array with ad objects
|
@@ -442,7 +442,7 @@ class Advanced_Ads_Group {
|
|
442 |
}
|
443 |
|
444 |
/**
|
445 |
-
*
|
446 |
*
|
447 |
* @since 1.0.0
|
448 |
* @param array $ad_weights e.g. array(A => 2, B => 3, C => 5)
|
@@ -468,7 +468,7 @@ class Advanced_Ads_Group {
|
|
468 |
}
|
469 |
|
470 |
/**
|
471 |
-
*
|
472 |
*
|
473 |
* @since 1.0.0
|
474 |
*/
|
@@ -490,7 +490,7 @@ class Advanced_Ads_Group {
|
|
490 |
}
|
491 |
|
492 |
/**
|
493 |
-
*
|
494 |
*
|
495 |
* @since 1.4.8
|
496 |
* @param arr $args group arguments
|
@@ -509,7 +509,7 @@ class Advanced_Ads_Group {
|
|
509 |
}
|
510 |
|
511 |
/**
|
512 |
-
*
|
513 |
*
|
514 |
* @since 1.0.0
|
515 |
* @param arr|str $weights array with ad weights (key: ad id; value: weight)
|
@@ -525,7 +525,7 @@ class Advanced_Ads_Group {
|
|
525 |
$global_weights[$this->id] = $this->sanitize_ad_weights( $weights );
|
526 |
|
527 |
/**
|
528 |
-
*
|
529 |
* always save in admin
|
530 |
* use the constant to prevent accidental overriding of ad settings in the frontend as happened on very large sites
|
531 |
*/
|
@@ -538,7 +538,7 @@ class Advanced_Ads_Group {
|
|
538 |
}
|
539 |
|
540 |
/**
|
541 |
-
*
|
542 |
*
|
543 |
* @since 1.0.0
|
544 |
*/
|
@@ -561,7 +561,7 @@ class Advanced_Ads_Group {
|
|
561 |
}
|
562 |
|
563 |
/**
|
564 |
-
*
|
565 |
*
|
566 |
* @since 1.0.0
|
567 |
* @param arr $weights ad weights array with (key: ad id; value: weight)
|
@@ -582,7 +582,7 @@ class Advanced_Ads_Group {
|
|
582 |
}
|
583 |
|
584 |
/**
|
585 |
-
*
|
586 |
*
|
587 |
* @since 1.0.0
|
588 |
*/
|
@@ -636,7 +636,7 @@ class Advanced_Ads_Group {
|
|
636 |
}
|
637 |
|
638 |
/**
|
639 |
-
*
|
640 |
* number of ads and default value
|
641 |
*
|
642 |
* @param int $num_ads number of ads in the group
|
11 |
*/
|
12 |
|
13 |
/**
|
14 |
+
* An ad group object
|
15 |
*
|
16 |
* @package Advanced_Ads_Group
|
17 |
* @author Thomas Maier <support@wpadvancedads.com>
|
19 |
class Advanced_Ads_Group {
|
20 |
|
21 |
/**
|
22 |
+
* Default ad group weight
|
23 |
* previously called MAX_AD_GROUP_WEIGHT
|
24 |
*/
|
25 |
const MAX_AD_GROUP_DEFAULT_WEIGHT = 10;
|
26 |
|
27 |
/**
|
28 |
+
* Term id of this ad group
|
29 |
*/
|
30 |
public $id = 0;
|
31 |
|
32 |
/**
|
33 |
+
* Group type
|
34 |
*
|
35 |
* @since 1.4.8
|
36 |
*/
|
37 |
public $type = 'default';
|
38 |
|
39 |
/**
|
40 |
+
* Name of the taxonomy
|
41 |
*/
|
42 |
public $taxonomy = '';
|
43 |
|
44 |
/**
|
45 |
+
* Post type of the ads
|
46 |
*/
|
47 |
protected $post_type = '';
|
48 |
|
49 |
/**
|
50 |
+
* The current loaded ad
|
51 |
*/
|
52 |
protected $current_ad = '';
|
53 |
|
54 |
/**
|
55 |
+
* The name of the term
|
56 |
*/
|
57 |
public $name = '';
|
58 |
|
59 |
/**
|
60 |
+
* The slug of the term
|
61 |
*/
|
62 |
public $slug = '';
|
63 |
|
64 |
/**
|
65 |
+
* The description of the term
|
66 |
*/
|
67 |
public $description = '';
|
68 |
|
69 |
/**
|
70 |
+
* Number of ads to display in the group block
|
71 |
*/
|
72 |
public $ad_count = 1;
|
73 |
|
86 |
public $ad_args = array();
|
87 |
|
88 |
/**
|
89 |
+
* Containing ad weights
|
90 |
*/
|
91 |
private $ad_weights = 0;
|
92 |
|
93 |
/**
|
94 |
+
* Array with post type objects (ads)
|
95 |
*/
|
96 |
private $ads = array();
|
97 |
|
109 |
public $label = '';
|
110 |
|
111 |
/**
|
112 |
+
* Init ad group object
|
113 |
*
|
114 |
* @since 1.0.0
|
115 |
* @param int|obj $group either id of the ad group (= taxonomy id) or term object
|
127 |
}
|
128 |
|
129 |
/**
|
130 |
+
* Load additional ad group properties
|
131 |
*
|
132 |
* @since 1.4.8
|
133 |
* @param int $id group id
|
152 |
}
|
153 |
|
154 |
/**
|
155 |
+
* Load additional attributes for groups that are not part of the WP terms
|
156 |
*
|
157 |
* @since 1.4.8
|
158 |
*/
|
184 |
}
|
185 |
|
186 |
/**
|
187 |
+
* Control the output of the group by type and amount of ads
|
188 |
*
|
189 |
* @since 1.4.8
|
190 |
* @param array/null ordered_ad_ids ordered ids of the ads that belong to the group
|
268 |
}
|
269 |
|
270 |
/**
|
271 |
+
* Get ordered ids of the ads that belong to the group
|
272 |
*
|
273 |
* @return array/null ordered ad ads that belong to the group
|
274 |
*/
|
314 |
}
|
315 |
|
316 |
/**
|
317 |
+
* Return all ads from this group
|
318 |
*
|
319 |
* @since 1.0.0
|
320 |
*/
|
326 |
}
|
327 |
|
328 |
/**
|
329 |
+
* Load all public ads for this group
|
330 |
*
|
331 |
* @since 1.0.0
|
332 |
* @update 1.1.0 load only public ads
|
370 |
}
|
371 |
|
372 |
/**
|
373 |
+
* Use post ids as keys for ad array
|
374 |
*
|
375 |
* @since 1.0.0
|
376 |
* @param arr $ads array with post objects
|
388 |
}
|
389 |
|
390 |
/**
|
391 |
+
* Shuffle ads based on ad weight
|
392 |
*
|
393 |
* @since 1.0.0
|
394 |
* @param arr $ads array with ad objects
|
442 |
}
|
443 |
|
444 |
/**
|
445 |
+
* Get random ad by ad weight
|
446 |
*
|
447 |
* @since 1.0.0
|
448 |
* @param array $ad_weights e.g. array(A => 2, B => 3, C => 5)
|
468 |
}
|
469 |
|
470 |
/**
|
471 |
+
* Get weights of ads in this group
|
472 |
*
|
473 |
* @since 1.0.0
|
474 |
*/
|
490 |
}
|
491 |
|
492 |
/**
|
493 |
+
* Save ad group information that are not included in terms or ad weight
|
494 |
*
|
495 |
* @since 1.4.8
|
496 |
* @param arr $args group arguments
|
509 |
}
|
510 |
|
511 |
/**
|
512 |
+
* Save ad group weight (into global ad weight array)
|
513 |
*
|
514 |
* @since 1.0.0
|
515 |
* @param arr|str $weights array with ad weights (key: ad id; value: weight)
|
525 |
$global_weights[$this->id] = $this->sanitize_ad_weights( $weights );
|
526 |
|
527 |
/**
|
528 |
+
* Save ad weights in frontend only, if contanst is not set
|
529 |
* always save in admin
|
530 |
* use the constant to prevent accidental overriding of ad settings in the frontend as happened on very large sites
|
531 |
*/
|
538 |
}
|
539 |
|
540 |
/**
|
541 |
+
* Update ad weight based on current ads for the group and ad weight
|
542 |
*
|
543 |
* @since 1.0.0
|
544 |
*/
|
561 |
}
|
562 |
|
563 |
/**
|
564 |
+
* Sanitize ad weights
|
565 |
*
|
566 |
* @since 1.0.0
|
567 |
* @param arr $weights ad weights array with (key: ad id; value: weight)
|
582 |
}
|
583 |
|
584 |
/**
|
585 |
+
* Delete all the ad weights for a group by id
|
586 |
*
|
587 |
* @since 1.0.0
|
588 |
*/
|
636 |
}
|
637 |
|
638 |
/**
|
639 |
+
* Calculate the number of available weights for a group depending on
|
640 |
* number of ads and default value
|
641 |
*
|
642 |
* @param int $num_ads number of ads in the group
|
classes/ad_placements.php
CHANGED
@@ -282,6 +282,9 @@ class Advanced_Ads_Placements {
|
|
282 |
* @since 1.3.5
|
283 |
*/
|
284 |
public static function tags_for_content_injection() {
|
|
|
|
|
|
|
285 |
$tags = apply_filters(
|
286 |
'advanced-ads-tags-for-injection',
|
287 |
array(
|
@@ -295,6 +298,24 @@ class Advanced_Ads_Placements {
|
|
295 |
'h3' => sprintf( __( 'headline 3 (%s)', 'advanced-ads' ), '<h3>' ),
|
296 |
// translators: %s is an html tag.
|
297 |
'h4' => sprintf( __( 'headline 4 (%s)', 'advanced-ads' ), '<h4>' ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
)
|
299 |
);
|
300 |
|
@@ -377,8 +398,8 @@ class Advanced_Ads_Placements {
|
|
377 |
|
378 |
break;
|
379 |
|
380 |
-
// avoid loops (programmatical error).
|
381 |
case Advanced_Ads_Select::PLACEMENT:
|
|
|
382 |
return;
|
383 |
|
384 |
case Advanced_Ads_Select::GROUP:
|
@@ -430,6 +451,9 @@ class Advanced_Ads_Placements {
|
|
430 |
return $content;
|
431 |
}
|
432 |
|
|
|
|
|
|
|
433 |
// get plugin options.
|
434 |
$plugin_options = Advanced_Ads::get_instance()->options();
|
435 |
|
@@ -455,12 +479,84 @@ class Advanced_Ads_Placements {
|
|
455 |
// parse arguments.
|
456 |
$tag = isset( $placement_opts['tag'] ) ? $placement_opts['tag'] : 'p';
|
457 |
$tag = preg_replace( '/[^a-z0-9]/i', '', $tag ); // simplify tag.
|
|
|
|
|
|
|
|
|
|
|
458 |
|
459 |
// allow more complex xPath expression.
|
460 |
$tag = apply_filters( 'advanced-ads-placement-content-injection-xpath', $tag, $placement_opts );
|
461 |
|
462 |
-
|
463 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
464 |
}
|
465 |
|
466 |
// select positions.
|
@@ -478,18 +574,23 @@ class Advanced_Ads_Placements {
|
|
478 |
$options['paragraph_id'] = max( 1, (int) $options['paragraph_id'] );
|
479 |
|
480 |
// if there are too few items at this level test nesting.
|
481 |
-
$options['itemLimit'] = 'p' === $
|
482 |
|
483 |
// trigger such a high item limit that all elements will be considered.
|
484 |
if ( ! empty( $plugin_options['content-injection-level-disabled'] ) ) {
|
485 |
$options['itemLimit'] = 1000;
|
486 |
}
|
487 |
|
|
|
|
|
|
|
|
|
|
|
488 |
// allow hooks to change some options.
|
489 |
$options = apply_filters(
|
490 |
'advanced-ads-placement-content-injection-options',
|
491 |
$options,
|
492 |
-
$
|
493 |
);
|
494 |
|
495 |
if ( $items->length < $options['itemLimit'] ) {
|
@@ -505,7 +606,7 @@ class Advanced_Ads_Placements {
|
|
505 |
}
|
506 |
|
507 |
// allow to select other elements.
|
508 |
-
$items = apply_filters( 'advanced-ads-placement-content-injection-items', $items, $xpath, $
|
509 |
|
510 |
// filter empty tags from items.
|
511 |
$whitespaces = json_decode( '"\t\n\r \u00A0"' );
|
@@ -527,9 +628,33 @@ class Advanced_Ads_Placements {
|
|
527 |
$did_inject = false;
|
528 |
|
529 |
foreach ( $offsets as $offset ) {
|
|
|
530 |
// inject.
|
531 |
$node = apply_filters( 'advanced-ads-placement-content-injection-node', $paragraphs[ $offset ], $tag, $options['before'] );
|
532 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
533 |
$ad_content = Advanced_Ads_Select::get_instance()->get_ad_by_method( $placement_id, 'placement', $placement_opts );
|
534 |
|
535 |
if ( trim( $ad_content, $whitespaces ) === '' ) {
|
@@ -618,6 +743,8 @@ class Advanced_Ads_Placements {
|
|
618 |
}
|
619 |
}
|
620 |
|
|
|
|
|
621 |
return $content;
|
622 |
}
|
623 |
|
282 |
* @since 1.3.5
|
283 |
*/
|
284 |
public static function tags_for_content_injection() {
|
285 |
+
$headline_tags = apply_filters( 'advanced-ads-headlines-for-ad-injection', array( 'h2', 'h3', 'h4' ) );
|
286 |
+
$headline_tags_imploded = '<' . implode( '>, <', $headline_tags ) . '>';
|
287 |
+
|
288 |
$tags = apply_filters(
|
289 |
'advanced-ads-tags-for-injection',
|
290 |
array(
|
298 |
'h3' => sprintf( __( 'headline 3 (%s)', 'advanced-ads' ), '<h3>' ),
|
299 |
// translators: %s is an html tag.
|
300 |
'h4' => sprintf( __( 'headline 4 (%s)', 'advanced-ads' ), '<h4>' ),
|
301 |
+
// translators: %s is an html tag.
|
302 |
+
'headlines' => sprintf( __( 'any headline (%s)', 'advanced-ads' ), $headline_tags_imploded ),
|
303 |
+
// translators: %s is an html tag.
|
304 |
+
'img' => sprintf( __( 'image (%s)', 'advanced-ads' ), '<img>' ),
|
305 |
+
// translators: %s is an html tag.
|
306 |
+
'table' => sprintf( __( 'table (%s)', 'advanced-ads' ), '<table>' ),
|
307 |
+
// translators: %s is an html tag.
|
308 |
+
'li' => sprintf( __( 'list item (%s)', 'advanced-ads' ), '<li>' ),
|
309 |
+
// translators: %s is an html tag.
|
310 |
+
'blockquote' => sprintf( __( 'quote (%s)', 'advanced-ads' ), '<blockquote>' ),
|
311 |
+
// translators: %s is an html tag.
|
312 |
+
'iframe' => sprintf( __( 'iframe (%s)', 'advanced-ads' ), '<iframe>' ),
|
313 |
+
// translators: %s is an html tag.
|
314 |
+
'div' => sprintf( __( 'container (%s)', 'advanced-ads' ), '<div>' ),
|
315 |
+
// any HTML tag.
|
316 |
+
'anyelement' => __( 'any element', 'advanced-ads' ),
|
317 |
+
// custom
|
318 |
+
'custom' => _x( 'custom', 'for the "custom" content placement option', 'advanced-ads' ),
|
319 |
)
|
320 |
);
|
321 |
|
398 |
|
399 |
break;
|
400 |
|
|
|
401 |
case Advanced_Ads_Select::PLACEMENT:
|
402 |
+
// avoid loops (programmatical error).
|
403 |
return;
|
404 |
|
405 |
case Advanced_Ads_Select::GROUP:
|
451 |
return $content;
|
452 |
}
|
453 |
|
454 |
+
// phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
|
455 |
+
// phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase
|
456 |
+
|
457 |
// get plugin options.
|
458 |
$plugin_options = Advanced_Ads::get_instance()->options();
|
459 |
|
479 |
// parse arguments.
|
480 |
$tag = isset( $placement_opts['tag'] ) ? $placement_opts['tag'] : 'p';
|
481 |
$tag = preg_replace( '/[^a-z0-9]/i', '', $tag ); // simplify tag.
|
482 |
+
/**
|
483 |
+
* Store the original tag value since $tag is changed on the fly and we might want to know the original selected
|
484 |
+
* options for some checks later.
|
485 |
+
*/
|
486 |
+
$tag_option = $tag;
|
487 |
|
488 |
// allow more complex xPath expression.
|
489 |
$tag = apply_filters( 'advanced-ads-placement-content-injection-xpath', $tag, $placement_opts );
|
490 |
|
491 |
+
/**
|
492 |
+
* Handle advanced tags.
|
493 |
+
*/
|
494 |
+
switch ( $tag_option ) {
|
495 |
+
case 'p':
|
496 |
+
// exclude paragraphs within blockquote tags
|
497 |
+
$tag = 'p[not(parent::blockquote)]';
|
498 |
+
break;
|
499 |
+
case 'pwithoutimg':
|
500 |
+
// convert option name into correct path, exclude paragraphs within blockquote tags
|
501 |
+
$tag = 'p[not(descendant::img) and not(parent::blockquote)]';
|
502 |
+
break;
|
503 |
+
case 'img':
|
504 |
+
// prevent injection of ads next to images in tables.
|
505 |
+
$tag = 'img[not(ancestor::table)]';
|
506 |
+
break;
|
507 |
+
// any headline. By default h2, h3, and h4
|
508 |
+
case 'headlines':
|
509 |
+
$headlines = apply_filters( 'advanced-ads-headlines-for-ad-injection', array( 'h2', 'h3', 'h4' ) );
|
510 |
+
|
511 |
+
foreach ( $headlines as &$headline ) {
|
512 |
+
$headline = 'self::' . $headline;
|
513 |
+
}
|
514 |
+
$tag = '*[' . implode( ' or ', $headlines ) . ']'; // /html/body/*[self::h2 or self::h3 or self::h4]
|
515 |
+
break;
|
516 |
+
// any HTML element that makes sense in the content
|
517 |
+
case 'anyelement':
|
518 |
+
$exclude = array(
|
519 |
+
'html',
|
520 |
+
'body',
|
521 |
+
'script',
|
522 |
+
'style',
|
523 |
+
'tr',
|
524 |
+
'td',
|
525 |
+
// Inline tags.
|
526 |
+
'a',
|
527 |
+
'abbr',
|
528 |
+
'b',
|
529 |
+
'bdo',
|
530 |
+
'br',
|
531 |
+
'button',
|
532 |
+
'cite',
|
533 |
+
'code',
|
534 |
+
'dfn',
|
535 |
+
'em',
|
536 |
+
'i',
|
537 |
+
'img',
|
538 |
+
'kbd',
|
539 |
+
'label',
|
540 |
+
'option',
|
541 |
+
'q',
|
542 |
+
'samp',
|
543 |
+
'select',
|
544 |
+
'small',
|
545 |
+
'span',
|
546 |
+
'strong',
|
547 |
+
'sub',
|
548 |
+
'sup',
|
549 |
+
'textarea',
|
550 |
+
'time',
|
551 |
+
'tt',
|
552 |
+
'var',
|
553 |
+
);
|
554 |
+
$tag = '*[not(self::' . implode( ' or self::', $exclude ) . ')]';
|
555 |
+
break;
|
556 |
+
case 'custom':
|
557 |
+
// get the path for the "custom" tag choice, use p as a fallback to prevent it from showing any ads if users left it empty
|
558 |
+
$tag = ! empty( $placement_opts['xpath'] ) ? stripslashes( $placement_opts['xpath'] ) : 'p';
|
559 |
+
break;
|
560 |
}
|
561 |
|
562 |
// select positions.
|
574 |
$options['paragraph_id'] = max( 1, (int) $options['paragraph_id'] );
|
575 |
|
576 |
// if there are too few items at this level test nesting.
|
577 |
+
$options['itemLimit'] = 'p' === $tag_option ? 2 : 1;
|
578 |
|
579 |
// trigger such a high item limit that all elements will be considered.
|
580 |
if ( ! empty( $plugin_options['content-injection-level-disabled'] ) ) {
|
581 |
$options['itemLimit'] = 1000;
|
582 |
}
|
583 |
|
584 |
+
// handle tags that are empty by definition or could be empty ("custom" option)
|
585 |
+
if ( in_array( $tag_option, array( 'img', 'iframe', 'custom' ), true ) ) {
|
586 |
+
$options['allowEmpty'] = true;
|
587 |
+
}
|
588 |
+
|
589 |
// allow hooks to change some options.
|
590 |
$options = apply_filters(
|
591 |
'advanced-ads-placement-content-injection-options',
|
592 |
$options,
|
593 |
+
$tag_option
|
594 |
);
|
595 |
|
596 |
if ( $items->length < $options['itemLimit'] ) {
|
606 |
}
|
607 |
|
608 |
// allow to select other elements.
|
609 |
+
$items = apply_filters( 'advanced-ads-placement-content-injection-items', $items, $xpath, $tag_option );
|
610 |
|
611 |
// filter empty tags from items.
|
612 |
$whitespaces = json_decode( '"\t\n\r \u00A0"' );
|
628 |
$did_inject = false;
|
629 |
|
630 |
foreach ( $offsets as $offset ) {
|
631 |
+
|
632 |
// inject.
|
633 |
$node = apply_filters( 'advanced-ads-placement-content-injection-node', $paragraphs[ $offset ], $tag, $options['before'] );
|
634 |
|
635 |
+
// Prevent injection into image caption and gallery.
|
636 |
+
$parent = $node;
|
637 |
+
for ( $i = 0; $i < 4; $i++ ) {
|
638 |
+
$parent = $parent->parentNode;
|
639 |
+
if ( ! $parent instanceof DOMElement ) {
|
640 |
+
break;
|
641 |
+
}
|
642 |
+
if ( preg_match( '/\b(wp-caption|gallery-size)\b/', $parent->getAttribute( 'class' ) ) ) {
|
643 |
+
$node = $parent;
|
644 |
+
break;
|
645 |
+
}
|
646 |
+
}
|
647 |
+
|
648 |
+
// make sure that the ad is injected outside the link
|
649 |
+
if ( 'img' === $tag_option && 'a' === $node->parentNode->tagName ) {
|
650 |
+
if ( $options['before'] ) {
|
651 |
+
$node->parentNode;
|
652 |
+
} else {
|
653 |
+
// go one level deeper if inserted after to not insert the ad into the link; probably after the paragraph
|
654 |
+
$node->parentNode->parentNode;
|
655 |
+
}
|
656 |
+
}
|
657 |
+
|
658 |
$ad_content = Advanced_Ads_Select::get_instance()->get_ad_by_method( $placement_id, 'placement', $placement_opts );
|
659 |
|
660 |
if ( trim( $ad_content, $whitespaces ) === '' ) {
|
743 |
}
|
744 |
}
|
745 |
|
746 |
+
// phpcs:enable
|
747 |
+
|
748 |
return $content;
|
749 |
}
|
750 |
|
classes/ad_type_abstract.php
CHANGED
@@ -26,7 +26,7 @@ class Advanced_Ads_Ad_Type_Abstract {
|
|
26 |
public $ID = '';
|
27 |
|
28 |
/**
|
29 |
-
*
|
30 |
*
|
31 |
* will be set within __construct so one can localize it
|
32 |
*
|
@@ -35,7 +35,7 @@ class Advanced_Ads_Ad_Type_Abstract {
|
|
35 |
public $title = '';
|
36 |
|
37 |
/**
|
38 |
-
*
|
39 |
*
|
40 |
* will be set within __construct so one can localize it
|
41 |
*
|
@@ -44,14 +44,14 @@ class Advanced_Ads_Ad_Type_Abstract {
|
|
44 |
public $description = '';
|
45 |
|
46 |
/**
|
47 |
-
*
|
48 |
*
|
49 |
* defaults are set in construct
|
50 |
*/
|
51 |
public $parameters = array();
|
52 |
|
53 |
/**
|
54 |
-
*
|
55 |
*
|
56 |
* @since 1.0.0
|
57 |
*/
|
@@ -60,21 +60,21 @@ class Advanced_Ads_Ad_Type_Abstract {
|
|
60 |
}
|
61 |
|
62 |
/**
|
63 |
-
*
|
64 |
*
|
65 |
* @param obj $ad ad object
|
66 |
* @since 1.0.0
|
67 |
*/
|
68 |
public function render_parameters($ad){
|
69 |
/**
|
70 |
-
*
|
71 |
* echo the output right away here
|
72 |
* name parameters must be in the "advanced_ads" array
|
73 |
*/
|
74 |
}
|
75 |
|
76 |
/**
|
77 |
-
*
|
78 |
*
|
79 |
* @param arr $parameters array with ad parameters
|
80 |
* @return arr $parameters sanitized ad parameters
|
@@ -86,7 +86,7 @@ class Advanced_Ads_Ad_Type_Abstract {
|
|
86 |
}
|
87 |
|
88 |
/**
|
89 |
-
*
|
90 |
*
|
91 |
* @param str $content ad content
|
92 |
* @return str $content sanitized ad content
|
@@ -99,7 +99,7 @@ class Advanced_Ads_Ad_Type_Abstract {
|
|
99 |
}
|
100 |
|
101 |
/**
|
102 |
-
*
|
103 |
*
|
104 |
* @param obj $post WP post object
|
105 |
* @return str $content ad content
|
@@ -111,7 +111,7 @@ class Advanced_Ads_Ad_Type_Abstract {
|
|
111 |
}
|
112 |
|
113 |
/**
|
114 |
-
*
|
115 |
*
|
116 |
* @param obj $ad ad object
|
117 |
* @return str $content ad content prepared for frontend output
|
26 |
public $ID = '';
|
27 |
|
28 |
/**
|
29 |
+
* Public title
|
30 |
*
|
31 |
* will be set within __construct so one can localize it
|
32 |
*
|
35 |
public $title = '';
|
36 |
|
37 |
/**
|
38 |
+
* Description of the ad type
|
39 |
*
|
40 |
* will be set within __construct so one can localize it
|
41 |
*
|
44 |
public $description = '';
|
45 |
|
46 |
/**
|
47 |
+
* Parameters of the ad
|
48 |
*
|
49 |
* defaults are set in construct
|
50 |
*/
|
51 |
public $parameters = array();
|
52 |
|
53 |
/**
|
54 |
+
* Set basic attributes
|
55 |
*
|
56 |
* @since 1.0.0
|
57 |
*/
|
60 |
}
|
61 |
|
62 |
/**
|
63 |
+
* Output for the ad parameters metabox
|
64 |
*
|
65 |
* @param obj $ad ad object
|
66 |
* @since 1.0.0
|
67 |
*/
|
68 |
public function render_parameters($ad){
|
69 |
/**
|
70 |
+
* This will be loaded by default or using ajax when changing the ad type radio buttons
|
71 |
* echo the output right away here
|
72 |
* name parameters must be in the "advanced_ads" array
|
73 |
*/
|
74 |
}
|
75 |
|
76 |
/**
|
77 |
+
* Sanitize ad parameters on save
|
78 |
*
|
79 |
* @param arr $parameters array with ad parameters
|
80 |
* @return arr $parameters sanitized ad parameters
|
86 |
}
|
87 |
|
88 |
/**
|
89 |
+
* Sanitize content field on save
|
90 |
*
|
91 |
* @param str $content ad content
|
92 |
* @return str $content sanitized ad content
|
99 |
}
|
100 |
|
101 |
/**
|
102 |
+
* Load content field for the ad
|
103 |
*
|
104 |
* @param obj $post WP post object
|
105 |
* @return str $content ad content
|
111 |
}
|
112 |
|
113 |
/**
|
114 |
+
* Prepare the ads frontend output
|
115 |
*
|
116 |
* @param obj $ad ad object
|
117 |
* @return str $content ad content prepared for frontend output
|
classes/ad_type_content.php
CHANGED
@@ -27,7 +27,7 @@ class Advanced_Ads_Ad_Type_Content extends Advanced_Ads_Ad_Type_Abstract{
|
|
27 |
public $ID = 'content';
|
28 |
|
29 |
/**
|
30 |
-
*
|
31 |
*
|
32 |
* @since 1.0.0
|
33 |
*/
|
@@ -41,7 +41,7 @@ class Advanced_Ads_Ad_Type_Content extends Advanced_Ads_Ad_Type_Abstract{
|
|
41 |
|
42 |
|
43 |
/**
|
44 |
-
*
|
45 |
*
|
46 |
* this will be loaded using ajax when changing the ad type radio buttons
|
47 |
* echo the output right away here
|
@@ -55,7 +55,7 @@ class Advanced_Ads_Ad_Type_Content extends Advanced_Ads_Ad_Type_Abstract{
|
|
55 |
$content = (isset($ad->content)) ? $ad->content : '';
|
56 |
|
57 |
/**
|
58 |
-
*
|
59 |
* @link http://codex.wordpress.org/Function_Reference/wp_editor
|
60 |
*
|
61 |
* don’t build it when ajax is used; display message and buttons instead
|
@@ -82,7 +82,7 @@ class Advanced_Ads_Ad_Type_Content extends Advanced_Ads_Ad_Type_Abstract{
|
|
82 |
}
|
83 |
|
84 |
/**
|
85 |
-
*
|
86 |
*
|
87 |
* @param str $content ad content
|
88 |
* @return str $content sanitized ad content
|
@@ -98,7 +98,7 @@ class Advanced_Ads_Ad_Type_Content extends Advanced_Ads_Ad_Type_Abstract{
|
|
98 |
}
|
99 |
|
100 |
/**
|
101 |
-
*
|
102 |
*
|
103 |
* @param obj $ad ad object
|
104 |
* @return str $content ad content prepared for frontend output
|
27 |
public $ID = 'content';
|
28 |
|
29 |
/**
|
30 |
+
* Set basic attributes
|
31 |
*
|
32 |
* @since 1.0.0
|
33 |
*/
|
41 |
|
42 |
|
43 |
/**
|
44 |
+
* Output for the ad parameters metabox
|
45 |
*
|
46 |
* this will be loaded using ajax when changing the ad type radio buttons
|
47 |
* echo the output right away here
|
55 |
$content = (isset($ad->content)) ? $ad->content : '';
|
56 |
|
57 |
/**
|
58 |
+
* Build the tinymc editor
|
59 |
* @link http://codex.wordpress.org/Function_Reference/wp_editor
|
60 |
*
|
61 |
* don’t build it when ajax is used; display message and buttons instead
|
82 |
}
|
83 |
|
84 |
/**
|
85 |
+
* Sanitize content field on save
|
86 |
*
|
87 |
* @param str $content ad content
|
88 |
* @return str $content sanitized ad content
|
98 |
}
|
99 |
|
100 |
/**
|
101 |
+
* Prepare the ads frontend output
|
102 |
*
|
103 |
* @param obj $ad ad object
|
104 |
* @return str $content ad content prepared for frontend output
|
classes/ad_type_dummy.php
CHANGED
@@ -20,7 +20,7 @@ class Advanced_Ads_Ad_Type_Dummy extends Advanced_Ads_Ad_Type_Abstract{
|
|
20 |
public $ID = 'dummy';
|
21 |
|
22 |
/**
|
23 |
-
*
|
24 |
*/
|
25 |
public function __construct() {
|
26 |
$this->title = __( 'Dummy', 'advanced-ads' );
|
@@ -29,7 +29,7 @@ class Advanced_Ads_Ad_Type_Dummy extends Advanced_Ads_Ad_Type_Abstract{
|
|
29 |
}
|
30 |
|
31 |
/**
|
32 |
-
*
|
33 |
*
|
34 |
* this will be loaded using ajax when changing the ad type radio buttons
|
35 |
* echo the output right away here
|
@@ -53,7 +53,7 @@ class Advanced_Ads_Ad_Type_Dummy extends Advanced_Ads_Ad_Type_Abstract{
|
|
53 |
}
|
54 |
|
55 |
/**
|
56 |
-
*
|
57 |
*
|
58 |
* @param obj $ad ad object
|
59 |
* @return str static image content
|
20 |
public $ID = 'dummy';
|
21 |
|
22 |
/**
|
23 |
+
* Set basic attributes
|
24 |
*/
|
25 |
public function __construct() {
|
26 |
$this->title = __( 'Dummy', 'advanced-ads' );
|
29 |
}
|
30 |
|
31 |
/**
|
32 |
+
* Output for the ad parameters metabox
|
33 |
*
|
34 |
* this will be loaded using ajax when changing the ad type radio buttons
|
35 |
* echo the output right away here
|
53 |
}
|
54 |
|
55 |
/**
|
56 |
+
* Prepare the ads frontend output
|
57 |
*
|
58 |
* @param obj $ad ad object
|
59 |
* @return str static image content
|
classes/ad_type_group.php
CHANGED
@@ -24,7 +24,7 @@ class Advanced_Ads_Ad_Type_Group extends Advanced_Ads_Ad_Type_Abstract{
|
|
24 |
public $ID = 'group';
|
25 |
|
26 |
/**
|
27 |
-
*
|
28 |
*/
|
29 |
public function __construct() {
|
30 |
$this->title = __( 'Ad Group', 'advanced-ads' );
|
@@ -38,7 +38,7 @@ class Advanced_Ads_Ad_Type_Group extends Advanced_Ads_Ad_Type_Abstract{
|
|
38 |
}
|
39 |
|
40 |
/**
|
41 |
-
*
|
42 |
* see also: /admin/includes/class-ad-groups-list.php::update_groups()
|
43 |
*/
|
44 |
public function remove_from_ad_group( $post_id ){
|
@@ -60,7 +60,7 @@ class Advanced_Ads_Ad_Type_Group extends Advanced_Ads_Ad_Type_Abstract{
|
|
60 |
|
61 |
|
62 |
/**
|
63 |
-
*
|
64 |
*
|
65 |
* this will be loaded using ajax when changing the ad type radio buttons
|
66 |
* echo the output right away here
|
@@ -93,7 +93,7 @@ class Advanced_Ads_Ad_Type_Group extends Advanced_Ads_Ad_Type_Abstract{
|
|
93 |
}
|
94 |
|
95 |
/**
|
96 |
-
*
|
97 |
*
|
98 |
* @param obj $ad ad object
|
99 |
* @return str $content ad content prepared for frontend output
|
24 |
public $ID = 'group';
|
25 |
|
26 |
/**
|
27 |
+
* Set basic attributes
|
28 |
*/
|
29 |
public function __construct() {
|
30 |
$this->title = __( 'Ad Group', 'advanced-ads' );
|
38 |
}
|
39 |
|
40 |
/**
|
41 |
+
* When saving the ad, remove it from the ad group, if this is the group assigned as ad content
|
42 |
* see also: /admin/includes/class-ad-groups-list.php::update_groups()
|
43 |
*/
|
44 |
public function remove_from_ad_group( $post_id ){
|
60 |
|
61 |
|
62 |
/**
|
63 |
+
* Output for the ad parameters metabox
|
64 |
*
|
65 |
* this will be loaded using ajax when changing the ad type radio buttons
|
66 |
* echo the output right away here
|
93 |
}
|
94 |
|
95 |
/**
|
96 |
+
* Prepare the ads frontend output
|
97 |
*
|
98 |
* @param obj $ad ad object
|
99 |
* @return str $content ad content prepared for frontend output
|
classes/ad_type_image.php
CHANGED
@@ -7,79 +7,84 @@
|
|
7 |
* @license GPL-2.0+
|
8 |
* @link https://wpadvancedads.com
|
9 |
* @copyright 2015 Thomas Maier, Advanced Ads GmbH
|
10 |
-
* @since 1.6.10
|
11 |
*
|
12 |
* Class containing information about the content ad type
|
13 |
* this should also work as an example for other ad types
|
14 |
-
*
|
15 |
*/
|
16 |
-
class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract{
|
17 |
|
18 |
/**
|
19 |
* ID - internal type of the ad type
|
20 |
-
*
|
21 |
* must be static so set your own ad type ID here
|
22 |
* use slug like format, only lower case, underscores and hyphens
|
23 |
*
|
24 |
-
* @
|
25 |
*/
|
26 |
public $ID = 'image';
|
27 |
|
28 |
/**
|
29 |
-
*
|
30 |
-
*
|
31 |
-
* @since 1.6.10
|
32 |
*/
|
33 |
public function __construct() {
|
34 |
-
$this->title
|
35 |
$this->description = __( 'Ads in various image formats.', 'advanced-ads' );
|
36 |
-
$this->parameters
|
37 |
-
'image_url'
|
38 |
'image_title' => '',
|
39 |
-
'image_alt'
|
40 |
);
|
41 |
}
|
42 |
|
43 |
/**
|
44 |
-
*
|
45 |
*
|
46 |
-
* @param
|
47 |
-
* @since 1.6.10
|
48 |
*/
|
49 |
-
public function render_parameters($ad){
|
50 |
// load tinymc content exitor
|
51 |
-
$id
|
52 |
$url = ( isset( $ad->url ) ) ? esc_attr( $ad->url ) : '';
|
53 |
|
54 |
-
?><p><button href="#" class="advads_image_upload button button-secondary" type="button" data-uploader-title="
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
</p>
|
58 |
-
<input type="hidden" name="advanced_ad[output][image_id]" value="<?php echo $id; ?>" id="advads-image-id"/>
|
59 |
<div id="advads-image-preview">
|
60 |
-
|
61 |
</div>
|
62 |
-
<?php
|
63 |
-
|
64 |
-
|
|
|
|
|
65 |
<div>
|
66 |
-
<input type="url" name="advanced_ad[url]" id="advads-url" class="advads-ad-url" value="<?php echo $url; ?>" placeholder="https://www.example.com/"/>
|
67 |
<p class="description">
|
68 |
-
<?php
|
69 |
</p>
|
70 |
</div>
|
71 |
-
<hr
|
|
|
72 |
endif;
|
73 |
}
|
74 |
|
75 |
/**
|
76 |
-
*
|
77 |
*
|
78 |
-
* @param int
|
79 |
-
* @param
|
80 |
-
* @since 1.6.10
|
81 |
*/
|
82 |
-
public function create_image_tag( $attachment_id, $ad ){
|
83 |
|
84 |
$image = wp_get_attachment_image_src( $attachment_id, 'full' );
|
85 |
$style = '';
|
@@ -87,27 +92,29 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract{
|
|
87 |
if ( $image ) {
|
88 |
list( $src, $width, $height ) = $image;
|
89 |
// override image sizes with the sizes given in ad options, but in frontend only
|
90 |
-
if( ! is_admin() || (
|
91 |
-
is_admin() && defined( 'DOING_AJAX' ) && DOING_AJAX ) ){ // is AJAX call (cache-busting)
|
92 |
$width = isset( $ad->width ) ? absint( $ad->width ) : $width;
|
93 |
$height = isset( $ad->height ) ? absint( $ad->height ) : $height;
|
94 |
}
|
95 |
-
$hwstring
|
96 |
-
$attachment = get_post($attachment_id);
|
97 |
-
$alt
|
98 |
|
99 |
global $wp_current_filter;
|
100 |
|
101 |
// TODO: use an array for attributes so they are simpler to extend
|
102 |
-
$
|
|
|
|
|
103 |
// create srcset and sizes attributes if we are in the the_content filter and in WordPress 4.4
|
104 |
-
if( isset( $wp_current_filter )
|
105 |
-
&& in_array( 'the_content', $wp_current_filter )
|
106 |
-
&& ! defined( 'ADVADS_DISABLE_RESPONSIVE_IMAGES' )){
|
107 |
-
if( function_exists( 'wp_get_attachment_image_srcset' ) ){
|
108 |
$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
|
109 |
}
|
110 |
-
if( function_exists( 'wp_get_attachment_image_sizes' ) ){
|
111 |
$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
|
112 |
}
|
113 |
if ( $srcset && $sizes ) {
|
@@ -124,8 +131,8 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract{
|
|
124 |
}
|
125 |
|
126 |
// add css rule to be able to center the ad.
|
127 |
-
if( isset( $ad->output['position'] ) && 'center' === $ad->output['position'] ){
|
128 |
-
|
129 |
}
|
130 |
|
131 |
$style = apply_filters( 'advanced-ads-ad-image-tag-style', $style );
|
@@ -133,58 +140,60 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract{
|
|
133 |
|
134 |
$more_attributes = apply_filters( 'advanced-ads-ad-image-tag-attributes', $more_attributes );
|
135 |
|
136 |
-
|
|
|
137 |
}
|
138 |
}
|
139 |
|
140 |
/**
|
141 |
-
*
|
142 |
*
|
143 |
-
* @param int $attachment_id post id of the image
|
144 |
-
* @since 1.7.4
|
145 |
*/
|
146 |
-
public function create_image_icon( $attachment_id ){
|
147 |
|
148 |
$image = wp_get_attachment_image_src( $attachment_id, 'medium', true );
|
149 |
if ( $image ) {
|
150 |
list( $src, $width, $height ) = $image;
|
151 |
|
152 |
// scale down width or height to max 100px
|
153 |
-
if( $width > $height ){
|
154 |
-
|
155 |
-
|
156 |
} else {
|
157 |
-
|
158 |
-
|
159 |
}
|
160 |
|
161 |
-
$hwstring
|
162 |
-
$attachment = get_post($attachment_id);
|
163 |
-
$alt
|
164 |
|
|
|
165 |
echo "<img $hwstring src='$src' alt='$alt' />";
|
166 |
}
|
167 |
}
|
168 |
|
169 |
/**
|
170 |
-
*
|
171 |
*
|
172 |
-
* @param
|
173 |
-
* @return
|
174 |
-
* @since 1.6.10.
|
175 |
*/
|
176 |
-
public function prepare_output($ad){
|
177 |
|
178 |
-
$id
|
179 |
-
$url =
|
180 |
// get general target setting
|
181 |
-
$options
|
182 |
-
$target_blank =
|
183 |
|
184 |
ob_start();
|
185 |
-
if( ! defined( 'AAT_VERSION' ) && $url ){
|
|
|
186 |
echo $this->create_image_tag( $id, $ad );
|
187 |
-
if( ! defined( 'AAT_VERSION' ) && $url ){
|
|
|
188 |
|
189 |
return ob_get_clean();
|
190 |
}
|
@@ -193,10 +202,10 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract{
|
|
193 |
* Generate a string with the original image size for output in the backend
|
194 |
* Only show, if different from entered image sizes
|
195 |
*
|
196 |
-
* @param
|
197 |
-
* @return
|
198 |
*/
|
199 |
-
public static function show_original_image_size( $ad ){
|
200 |
|
201 |
$attachment_id = ( isset( $ad->output['image_id'] ) ) ? absint( $ad->output['image_id'] ) : '';
|
202 |
|
@@ -204,14 +213,22 @@ class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract{
|
|
204 |
|
205 |
if ( $image ) {
|
206 |
list( $src, $width, $height ) = $image;
|
207 |
-
|
208 |
-
|
209 |
-
|
|
|
|
|
|
|
210 |
/**
|
211 |
-
* translators: $s is a size string like "728 x 90".
|
212 |
* This string shows up on the ad edit page of image ads if the size entered for the ad is different from the size of the uploaded image.
|
213 |
*/
|
214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
}
|
216 |
}
|
217 |
|
7 |
* @license GPL-2.0+
|
8 |
* @link https://wpadvancedads.com
|
9 |
* @copyright 2015 Thomas Maier, Advanced Ads GmbH
|
|
|
10 |
*
|
11 |
* Class containing information about the content ad type
|
12 |
* this should also work as an example for other ad types
|
|
|
13 |
*/
|
14 |
+
class Advanced_Ads_Ad_Type_Image extends Advanced_Ads_Ad_Type_Abstract {
|
15 |
|
16 |
/**
|
17 |
* ID - internal type of the ad type
|
|
|
18 |
* must be static so set your own ad type ID here
|
19 |
* use slug like format, only lower case, underscores and hyphens
|
20 |
*
|
21 |
+
* @var string $ID ad type ID.
|
22 |
*/
|
23 |
public $ID = 'image';
|
24 |
|
25 |
/**
|
26 |
+
* Set basic attributes
|
|
|
|
|
27 |
*/
|
28 |
public function __construct() {
|
29 |
+
$this->title = __( 'Image Ad', 'advanced-ads' );
|
30 |
$this->description = __( 'Ads in various image formats.', 'advanced-ads' );
|
31 |
+
$this->parameters = array(
|
32 |
+
'image_url' => '',
|
33 |
'image_title' => '',
|
34 |
+
'image_alt' => '',
|
35 |
);
|
36 |
}
|
37 |
|
38 |
/**
|
39 |
+
* Output for the ad parameters metabox
|
40 |
*
|
41 |
+
* @param Advanced_Ads_Ad $ad ad object.
|
|
|
42 |
*/
|
43 |
+
public function render_parameters( $ad ) {
|
44 |
// load tinymc content exitor
|
45 |
+
$id = ( isset( $ad->output['image_id'] ) ) ? $ad->output['image_id'] : '';
|
46 |
$url = ( isset( $ad->url ) ) ? esc_attr( $ad->url ) : '';
|
47 |
|
48 |
+
?><p><button href="#" class="advads_image_upload button button-secondary" type="button" data-uploader-title="
|
49 |
+
<?php
|
50 |
+
esc_html_e( 'Insert File', 'advanced-ads' );
|
51 |
+
?>
|
52 |
+
" data-uploader-button-text="<?php esc_html_e( 'Insert', 'advanced-ads' ); ?>" onclick="return false;"><?php esc_html_e( 'select image', 'advanced-ads' ); ?></button>
|
53 |
+
<a id="advads-image-edit-link" href="
|
54 |
+
<?php
|
55 |
+
if ( $id ) {
|
56 |
+
echo esc_url( get_edit_post_link( $id ) );
|
57 |
+
}
|
58 |
+
?>
|
59 |
+
"><?php esc_html_e( 'edit', 'advanced-ads' ); ?></a>
|
60 |
</p>
|
61 |
+
<input type="hidden" name="advanced_ad[output][image_id]" value="<?php echo absint( $id ); ?>" id="advads-image-id"/>
|
62 |
<div id="advads-image-preview">
|
63 |
+
<?php $this->create_image_tag( $id, $ad ); ?>
|
64 |
</div>
|
65 |
+
<?php
|
66 |
+
// don’t show if tracking plugin enabled
|
67 |
+
if ( ! defined( 'AAT_VERSION' ) ) :
|
68 |
+
?>
|
69 |
+
<label for="advads-url" class="label"><?php esc_html_e( 'URL', 'advanced-ads' ); ?></label>
|
70 |
<div>
|
71 |
+
<input type="url" name="advanced_ad[url]" id="advads-url" class="advads-ad-url" value="<?php echo esc_url( $url ); ?>" placeholder="https://www.example.com/"/>
|
72 |
<p class="description">
|
73 |
+
<?php esc_html_e( 'Link to target site including http(s)', 'advanced-ads' ); ?>
|
74 |
</p>
|
75 |
</div>
|
76 |
+
<hr/>
|
77 |
+
<?php
|
78 |
endif;
|
79 |
}
|
80 |
|
81 |
/**
|
82 |
+
* Render image tag
|
83 |
*
|
84 |
+
* @param int $attachment_id post id of the image.
|
85 |
+
* @param Advanced_Ads_Ad $ad ad object.
|
|
|
86 |
*/
|
87 |
+
public function create_image_tag( $attachment_id, $ad ) {
|
88 |
|
89 |
$image = wp_get_attachment_image_src( $attachment_id, 'full' );
|
90 |
$style = '';
|
92 |
if ( $image ) {
|
93 |
list( $src, $width, $height ) = $image;
|
94 |
// override image sizes with the sizes given in ad options, but in frontend only
|
95 |
+
if ( ! is_admin() || ( // is frontend
|
96 |
+
is_admin() && defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { // is AJAX call (cache-busting)
|
97 |
$width = isset( $ad->width ) ? absint( $ad->width ) : $width;
|
98 |
$height = isset( $ad->height ) ? absint( $ad->height ) : $height;
|
99 |
}
|
100 |
+
$hwstring = image_hwstring( $width, $height );
|
101 |
+
$attachment = get_post( $attachment_id );
|
102 |
+
$alt = trim( esc_textarea( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) );
|
103 |
|
104 |
global $wp_current_filter;
|
105 |
|
106 |
// TODO: use an array for attributes so they are simpler to extend
|
107 |
+
$sizes = '';
|
108 |
+
$srcset = '';
|
109 |
+
$more_attributes = $srcset;
|
110 |
// create srcset and sizes attributes if we are in the the_content filter and in WordPress 4.4
|
111 |
+
if ( isset( $wp_current_filter )
|
112 |
+
&& in_array( 'the_content', $wp_current_filter, true )
|
113 |
+
&& ! defined( 'ADVADS_DISABLE_RESPONSIVE_IMAGES' ) ) {
|
114 |
+
if ( function_exists( 'wp_get_attachment_image_srcset' ) ) {
|
115 |
$srcset = wp_get_attachment_image_srcset( $attachment_id, 'full' );
|
116 |
}
|
117 |
+
if ( function_exists( 'wp_get_attachment_image_sizes' ) ) {
|
118 |
$sizes = wp_get_attachment_image_sizes( $attachment_id, 'full' );
|
119 |
}
|
120 |
if ( $srcset && $sizes ) {
|
131 |
}
|
132 |
|
133 |
// add css rule to be able to center the ad.
|
134 |
+
if ( isset( $ad->output['position'] ) && 'center' === $ad->output['position'] ) {
|
135 |
+
$style .= 'display: inline-block;';
|
136 |
}
|
137 |
|
138 |
$style = apply_filters( 'advanced-ads-ad-image-tag-style', $style );
|
140 |
|
141 |
$more_attributes = apply_filters( 'advanced-ads-ad-image-tag-attributes', $more_attributes );
|
142 |
|
143 |
+
//phpcs:ignore
|
144 |
+
echo rtrim( "<img $hwstring" ) . " src='$src' alt='$alt' $more_attributes $style/>";
|
145 |
}
|
146 |
}
|
147 |
|
148 |
/**
|
149 |
+
* Render image icon for overview pages
|
150 |
*
|
151 |
+
* @param int $attachment_id post id of the image.
|
|
|
152 |
*/
|
153 |
+
public function create_image_icon( $attachment_id ) {
|
154 |
|
155 |
$image = wp_get_attachment_image_src( $attachment_id, 'medium', true );
|
156 |
if ( $image ) {
|
157 |
list( $src, $width, $height ) = $image;
|
158 |
|
159 |
// scale down width or height to max 100px
|
160 |
+
if ( $width > $height ) {
|
161 |
+
$height = absint( $height / ( $width / 100 ) );
|
162 |
+
$width = 100;
|
163 |
} else {
|
164 |
+
$width = absint( $width / ( $height / 100 ) );
|
165 |
+
$height = 100;
|
166 |
}
|
167 |
|
168 |
+
$hwstring = trim( image_hwstring( $width, $height ) );
|
169 |
+
$attachment = get_post( $attachment_id );
|
170 |
+
$alt = trim( wp_strip_all_tags( get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ) ) );
|
171 |
|
172 |
+
//phpcs:ignore
|
173 |
echo "<img $hwstring src='$src' alt='$alt' />";
|
174 |
}
|
175 |
}
|
176 |
|
177 |
/**
|
178 |
+
* Prepare the ads frontend output by adding <object> tags
|
179 |
*
|
180 |
+
* @param Advanced_Ads_Ad $ad ad object.
|
181 |
+
* @return string $content ad content prepared for frontend output
|
|
|
182 |
*/
|
183 |
+
public function prepare_output( $ad ) {
|
184 |
|
185 |
+
$id = ( isset( $ad->output['image_id'] ) ) ? absint( $ad->output['image_id'] ) : '';
|
186 |
+
$url = ( isset( $ad->url ) ) ? esc_url( $ad->url ) : '';
|
187 |
// get general target setting
|
188 |
+
$options = Advanced_Ads::get_instance()->options();
|
189 |
+
$target_blank = ! empty( $options['target-blank'] ) ? ' target="_blank"' : '';
|
190 |
|
191 |
ob_start();
|
192 |
+
if ( ! defined( 'AAT_VERSION' ) && $url ) {
|
193 |
+
echo '<a href="' . esc_url( $url ) . '"' . esc_attr( $target_blank ) . '>'; }
|
194 |
echo $this->create_image_tag( $id, $ad );
|
195 |
+
if ( ! defined( 'AAT_VERSION' ) && $url ) {
|
196 |
+
echo '</a>'; }
|
197 |
|
198 |
return ob_get_clean();
|
199 |
}
|
202 |
* Generate a string with the original image size for output in the backend
|
203 |
* Only show, if different from entered image sizes
|
204 |
*
|
205 |
+
* @param Advanced_Ads_Ad $ad ad object.
|
206 |
+
* @return string empty, if the entered size is the same as the original size
|
207 |
*/
|
208 |
+
public static function show_original_image_size( $ad ) {
|
209 |
|
210 |
$attachment_id = ( isset( $ad->output['image_id'] ) ) ? absint( $ad->output['image_id'] ) : '';
|
211 |
|
213 |
|
214 |
if ( $image ) {
|
215 |
list( $src, $width, $height ) = $image;
|
216 |
+
?>
|
217 |
+
<p class="description">
|
218 |
+
<?php
|
219 |
+
if ( ( isset( $ad->width ) && $ad->width !== $width )
|
220 |
+
|| ( isset( $ad->height ) && $ad->height !== $height ) ) {
|
221 |
+
printf(
|
222 |
/**
|
|
|
223 |
* This string shows up on the ad edit page of image ads if the size entered for the ad is different from the size of the uploaded image.
|
224 |
*/
|
225 |
+
// translators: $s is a size string like "728 x 90".
|
226 |
+
esc_attr__( 'Original size: %s', 'advanced-ads' ),
|
227 |
+
esc_html( $width ) . ' x ' . esc_html( $height )
|
228 |
+
);
|
229 |
+
?>
|
230 |
+
</p>
|
231 |
+
<?php
|
232 |
}
|
233 |
}
|
234 |
|
classes/ad_type_plain.php
CHANGED
@@ -12,21 +12,18 @@
|
|
12 |
* Class containing information about the plain text/code ad type
|
13 |
*
|
14 |
* see ad-type-content.php for a better sample on ad type
|
15 |
-
*
|
16 |
*/
|
17 |
class Advanced_Ads_Ad_Type_Plain extends Advanced_Ads_Ad_Type_Abstract {
|
18 |
|
19 |
/**
|
20 |
* ID - internal type of the ad type
|
21 |
*
|
22 |
-
* @
|
23 |
*/
|
24 |
public $ID = 'plain';
|
25 |
|
26 |
/**
|
27 |
* Set basic attributes
|
28 |
-
*
|
29 |
-
* @since 1.0.0
|
30 |
*/
|
31 |
public function __construct() {
|
32 |
$this->title = __( 'Plain Text and Code', 'advanced-ads' );
|
@@ -44,14 +41,12 @@ class Advanced_Ads_Ad_Type_Plain extends Advanced_Ads_Ad_Type_Abstract {
|
|
44 |
* name parameters must be in the "advanced_ads" array
|
45 |
*
|
46 |
* @param object $ad Advanced_Ads_Ad.
|
47 |
-
*
|
48 |
-
* @since 1.0.0
|
49 |
*/
|
50 |
public function render_parameters( $ad ) {
|
51 |
-
//
|
52 |
$content = ( isset( $ad->content ) ) ? $ad->content : '';
|
53 |
|
54 |
-
?><p class="description"><?php
|
55 |
<textarea id="advads-ad-content-plain" cols="40" rows="10" name="advanced_ad[content]"
|
56 |
onkeyup="Advanced_Ads_Admin.check_ad_source();"><?php echo esc_textarea( $content ); ?></textarea>
|
57 |
<?php include ADVADS_BASE_PATH . 'admin/views/ad-info-after-textarea.php'; ?>
|
@@ -62,7 +57,8 @@ class Advanced_Ads_Ad_Type_Plain extends Advanced_Ads_Ad_Type_Abstract {
|
|
62 |
$this->render_php_allow( $ad );
|
63 |
$this->render_shortcodes_allow( $ad );
|
64 |
?>
|
65 |
-
<script>jQuery( function () { Advanced_Ads_Admin.check_ad_source() } )</script
|
|
|
66 |
}
|
67 |
|
68 |
/**
|
@@ -77,7 +73,7 @@ class Advanced_Ads_Ad_Type_Plain extends Advanced_Ads_Ad_Type_Abstract {
|
|
77 |
|
78 |
$content = ( isset( $ad->content ) ) ? $ad->content : '';
|
79 |
|
80 |
-
//
|
81 |
if ( isset( $ad->output['allow_php'] ) ) {
|
82 |
$allow_php = absint( $ad->output['allow_php'] );
|
83 |
} else {
|
@@ -92,16 +88,24 @@ class Advanced_Ads_Ad_Type_Plain extends Advanced_Ads_Ad_Type_Abstract {
|
|
92 |
}
|
93 |
}
|
94 |
?>
|
95 |
-
<label class="label" for="advads-parameters-php"><?php
|
96 |
<div>
|
97 |
<input id="advads-parameters-php" type="checkbox" name="advanced_ad[output][allow_php]"
|
98 |
value="1" <?php checked( 1, $allow_php ); ?>
|
99 |
-
onChange="Advanced_Ads_Admin.check_ad_source();"
|
100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
<div class="advads-error-message" id="advads-parameters-php-warning"
|
102 |
-
style="display:none;"><?php
|
103 |
</div>
|
104 |
-
<hr
|
|
|
105 |
|
106 |
}
|
107 |
|
@@ -114,17 +118,22 @@ class Advanced_Ads_Ad_Type_Plain extends Advanced_Ads_Ad_Type_Abstract {
|
|
114 |
$allow_shortcodes = ! empty( $ad->output['allow_shortcodes'] );
|
115 |
?>
|
116 |
<label class="label"
|
117 |
-
for="advads-parameters-shortcodes"><?php
|
118 |
<div>
|
119 |
<input id="advads-parameters-shortcodes" type="checkbox" name="advanced_ad[output][allow_shortcodes]"
|
120 |
-
value="1"
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
|
|
124 |
<div class="advads-error-message" id="advads-parameters-shortcodes-warning"
|
125 |
-
style="display:none;"><?php
|
126 |
</div>
|
127 |
-
<hr
|
|
|
128 |
}
|
129 |
|
130 |
/**
|
@@ -137,10 +146,10 @@ class Advanced_Ads_Ad_Type_Plain extends Advanced_Ads_Ad_Type_Abstract {
|
|
137 |
*/
|
138 |
public function prepare_output( $ad ) {
|
139 |
|
140 |
-
//
|
141 |
if ( ! defined( 'ADVANCED_ADS_DISALLOW_PHP' ) && ( ! isset( $ad->output['allow_php'] ) || $ad->output['allow_php'] ) ) {
|
142 |
ob_start();
|
143 |
-
//
|
144 |
eval( '?>' . $ad->content );
|
145 |
$content = ob_get_clean();
|
146 |
} else {
|
12 |
* Class containing information about the plain text/code ad type
|
13 |
*
|
14 |
* see ad-type-content.php for a better sample on ad type
|
|
|
15 |
*/
|
16 |
class Advanced_Ads_Ad_Type_Plain extends Advanced_Ads_Ad_Type_Abstract {
|
17 |
|
18 |
/**
|
19 |
* ID - internal type of the ad type
|
20 |
*
|
21 |
+
* @var string $ID ad type id.
|
22 |
*/
|
23 |
public $ID = 'plain';
|
24 |
|
25 |
/**
|
26 |
* Set basic attributes
|
|
|
|
|
27 |
*/
|
28 |
public function __construct() {
|
29 |
$this->title = __( 'Plain Text and Code', 'advanced-ads' );
|
41 |
* name parameters must be in the "advanced_ads" array
|
42 |
*
|
43 |
* @param object $ad Advanced_Ads_Ad.
|
|
|
|
|
44 |
*/
|
45 |
public function render_parameters( $ad ) {
|
46 |
+
// Load content.
|
47 |
$content = ( isset( $ad->content ) ) ? $ad->content : '';
|
48 |
|
49 |
+
?><p class="description"><?php esc_html_e( 'Insert plain text or code into this field.', 'advanced-ads' ); ?></p>
|
50 |
<textarea id="advads-ad-content-plain" cols="40" rows="10" name="advanced_ad[content]"
|
51 |
onkeyup="Advanced_Ads_Admin.check_ad_source();"><?php echo esc_textarea( $content ); ?></textarea>
|
52 |
<?php include ADVADS_BASE_PATH . 'admin/views/ad-info-after-textarea.php'; ?>
|
57 |
$this->render_php_allow( $ad );
|
58 |
$this->render_shortcodes_allow( $ad );
|
59 |
?>
|
60 |
+
<script>jQuery( function () { Advanced_Ads_Admin.check_ad_source() } )</script>
|
61 |
+
<?php
|
62 |
}
|
63 |
|
64 |
/**
|
73 |
|
74 |
$content = ( isset( $ad->content ) ) ? $ad->content : '';
|
75 |
|
76 |
+
// Check if php is allowed.
|
77 |
if ( isset( $ad->output['allow_php'] ) ) {
|
78 |
$allow_php = absint( $ad->output['allow_php'] );
|
79 |
} else {
|
88 |
}
|
89 |
}
|
90 |
?>
|
91 |
+
<label class="label" for="advads-parameters-php"><?php esc_html_e( 'Allow PHP', 'advanced-ads' ); ?></label>
|
92 |
<div>
|
93 |
<input id="advads-parameters-php" type="checkbox" name="advanced_ad[output][allow_php]"
|
94 |
value="1" <?php checked( 1, $allow_php ); ?>
|
95 |
+
onChange="Advanced_Ads_Admin.check_ad_source();"/>
|
96 |
+
<?php
|
97 |
+
echo wp_kses(
|
98 |
+
__( 'Execute PHP code (wrapped in <code><?php ?></code>)', 'advanced-ads' ),
|
99 |
+
array(
|
100 |
+
'code' => array(),
|
101 |
+
)
|
102 |
+
);
|
103 |
+
?>
|
104 |
<div class="advads-error-message" id="advads-parameters-php-warning"
|
105 |
+
style="display:none;"><?php esc_html_e( 'No PHP tag detected in your code.', 'advanced-ads' ); ?><?php esc_html_e( 'Uncheck this checkbox for improved performance.', 'advanced-ads' ); ?></div>
|
106 |
</div>
|
107 |
+
<hr/>
|
108 |
+
<?php
|
109 |
|
110 |
}
|
111 |
|
118 |
$allow_shortcodes = ! empty( $ad->output['allow_shortcodes'] );
|
119 |
?>
|
120 |
<label class="label"
|
121 |
+
for="advads-parameters-shortcodes"><?php esc_html_e( 'Allow shortcodes', 'advanced-ads' ); ?></label>
|
122 |
<div>
|
123 |
<input id="advads-parameters-shortcodes" type="checkbox" name="advanced_ad[output][allow_shortcodes]"
|
124 |
+
value="1"
|
125 |
+
<?php
|
126 |
+
checked( 1, $allow_shortcodes );
|
127 |
+
?>
|
128 |
+
onChange="Advanced_Ads_Admin.check_ad_source();"/>
|
129 |
+
<?php
|
130 |
+
esc_html_e( 'Execute shortcodes', 'advanced-ads' );
|
131 |
+
?>
|
132 |
<div class="advads-error-message" id="advads-parameters-shortcodes-warning"
|
133 |
+
style="display:none;"><?php esc_html_e( 'No shortcode detected in your code.', 'advanced-ads' ); ?><?php esc_html_e( 'Uncheck this checkbox for improved performance.', 'advanced-ads' ); ?></div>
|
134 |
</div>
|
135 |
+
<hr/>
|
136 |
+
<?php
|
137 |
}
|
138 |
|
139 |
/**
|
146 |
*/
|
147 |
public function prepare_output( $ad ) {
|
148 |
|
149 |
+
// Evaluate the code as PHP if setting was never saved or is allowed.
|
150 |
if ( ! defined( 'ADVANCED_ADS_DISALLOW_PHP' ) && ( ! isset( $ad->output['allow_php'] ) || $ad->output['allow_php'] ) ) {
|
151 |
ob_start();
|
152 |
+
// This code only runs if the "Allow PHP" option for plain text ads was enabled.
|
153 |
eval( '?>' . $ad->content );
|
154 |
$content = ob_get_clean();
|
155 |
} else {
|
classes/frontend_checks.php
CHANGED
@@ -869,7 +869,7 @@ class Advanced_Ads_Frontend_Checks {
|
|
869 |
}
|
870 |
<?php endif;
|
871 |
/**
|
872 |
-
*
|
873 |
*/
|
874 |
$privacy_state = Advanced_Ads_Privacy::get_instance()->get_state();
|
875 |
if( 'not_needed' !== $privacy_state ) :
|
869 |
}
|
870 |
<?php endif;
|
871 |
/**
|
872 |
+
* Code to check if current user gave consent to show ads
|
873 |
*/
|
874 |
$privacy_state = Advanced_Ads_Privacy::get_instance()->get_state();
|
875 |
if( 'not_needed' !== $privacy_state ) :
|
classes/plugin.php
CHANGED
@@ -449,6 +449,17 @@ class Advanced_Ads_Plugin {
|
|
449 |
$this->options = get_option( ADVADS_SLUG, array() );
|
450 |
}
|
451 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
return $this->options;
|
453 |
}
|
454 |
|
@@ -806,4 +817,14 @@ class Advanced_Ads_Plugin {
|
|
806 |
|
807 |
return $url;
|
808 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
809 |
}
|
449 |
$this->options = get_option( ADVADS_SLUG, array() );
|
450 |
}
|
451 |
|
452 |
+
// default options for new users
|
453 |
+
if ( array() === $this->options ) {
|
454 |
+
// disable the shortcode button by default for users who never stored the settings.
|
455 |
+
if ( ! isset( $this->options['disable-shortcode-button'] ) ) {
|
456 |
+
$this->options['disable-shortcode-button'] = true;
|
457 |
+
}
|
458 |
+
}
|
459 |
+
|
460 |
+
// allow to change options dynamically
|
461 |
+
$this->options = apply_filters( 'advanced-ads-options', $this->options );
|
462 |
+
|
463 |
return $this->options;
|
464 |
}
|
465 |
|
817 |
|
818 |
return $url;
|
819 |
}
|
820 |
+
|
821 |
+
/**
|
822 |
+
* Return Advanced Ads logo in base64 format for use in WP Admin menu.
|
823 |
+
*
|
824 |
+
* @return string
|
825 |
+
*/
|
826 |
+
public static function get_icon_svg() {
|
827 |
+
return 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE4LjEuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJFYmVuZV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgdmlld0JveD0iMCAwIDY0Ljk5MyA2NS4wMjQiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDY0Ljk5MyA2NS4wMjQ7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIHN0eWxlPSJmaWxsOiNFNEU0RTQ7IiBkPSJNNDYuNTcxLDI3LjY0MXYyMy4xMzNIMTQuMjVWMTguNDUzaDIzLjExOGMtMC45NTYtMi4xODMtMS40OTQtNC41OS0xLjQ5NC03LjEyNg0KCWMwLTIuNTM1LDAuNTM4LTQuOTQyLDEuNDk0LTcuMTI0aC02Ljk1N0gwdjQ5LjQ5M2wxLjYxOCwxLjYxOEwwLDUzLjY5NmMwLDYuMjU2LDUuMDY4LDExLjMyNiwxMS4zMjQsMTEuMzI4djBoMTkuMDg3aDMwLjQxMlYyNy42MTENCgljLTIuMTkxLDAuOTY0LTQuNjA5LDEuNTA5LTcuMTU3LDEuNTA5QzUxLjE0MiwyOS4xMiw0OC43NDYsMjguNTg4LDQ2LjU3MSwyNy42NDF6Ii8+DQo8Y2lyY2xlIHN0eWxlPSJmaWxsOiM5ODk4OTg7IiBjeD0iNTMuNjY2IiBjeT0iMTEuMzI4IiByPSIxMS4zMjgiLz4NCjwvc3ZnPg0K';
|
828 |
+
}
|
829 |
+
|
830 |
}
|
classes/upgrades.php
CHANGED
@@ -26,7 +26,7 @@ class Advanced_Ads_Upgrades {
|
|
26 |
if( ! empty( $internal_options['version'] ) ) {
|
27 |
|
28 |
/**
|
29 |
-
*
|
30 |
* this is no longer valid
|
31 |
*/
|
32 |
/*
|
26 |
if( ! empty( $internal_options['version'] ) ) {
|
27 |
|
28 |
/**
|
29 |
+
* Example of how to use an update
|
30 |
* this is no longer valid
|
31 |
*/
|
32 |
/*
|
includes/array_ad_conditions.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
-
*
|
5 |
* I don’t like huge arrays like this to clutter my classes
|
6 |
* and anyway, this might be needed on multiple places
|
7 |
*
|
1 |
<?php
|
2 |
|
3 |
/**
|
4 |
+
* Conditions under which to (not) show an ad
|
5 |
* I don’t like huge arrays like this to clutter my classes
|
6 |
* and anyway, this might be needed on multiple places
|
7 |
*
|
includes/functions.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
*/
|
6 |
|
7 |
/**
|
8 |
-
*
|
9 |
*
|
10 |
* @since 1.0.0
|
11 |
* @param int $id id of the ad (post)
|
@@ -20,7 +20,7 @@ function get_ad($id = 0, $args = array()){
|
|
20 |
}
|
21 |
|
22 |
/**
|
23 |
-
*
|
24 |
*
|
25 |
* @since 1.0.0
|
26 |
* @param int $id id of the ad (post)
|
@@ -31,7 +31,7 @@ function the_ad($id = 0, $args = array()){
|
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
-
*
|
35 |
*
|
36 |
* @since 1.0.0
|
37 |
* @param int $id id of the ad group (taxonomy)
|
@@ -45,7 +45,7 @@ function get_ad_group( $id = 0, $args = array() ) {
|
|
45 |
}
|
46 |
|
47 |
/**
|
48 |
-
*
|
49 |
*
|
50 |
* @since 1.0.0
|
51 |
* @param int $id id of the ad (post)
|
@@ -55,7 +55,7 @@ function the_ad_group($id = 0){
|
|
55 |
}
|
56 |
|
57 |
/**
|
58 |
-
*
|
59 |
*
|
60 |
* @since 1.1.0
|
61 |
* @param string $id slug of the ad placement
|
@@ -69,7 +69,7 @@ function get_ad_placement( $id = '', $args = array() ) {
|
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
-
*
|
73 |
*
|
74 |
* @since 1.1.0
|
75 |
* @param string $id slug of the ad placement
|
@@ -79,7 +79,7 @@ function the_ad_placement($id = ''){
|
|
79 |
}
|
80 |
|
81 |
/**
|
82 |
-
*
|
83 |
*
|
84 |
* @since 1.4.9
|
85 |
* @return bool, true if ads can be displayed
|
5 |
*/
|
6 |
|
7 |
/**
|
8 |
+
* Return ad content
|
9 |
*
|
10 |
* @since 1.0.0
|
11 |
* @param int $id id of the ad (post)
|
20 |
}
|
21 |
|
22 |
/**
|
23 |
+
* Echo an ad
|
24 |
*
|
25 |
* @since 1.0.0
|
26 |
* @param int $id id of the ad (post)
|
31 |
}
|
32 |
|
33 |
/**
|
34 |
+
* Return an ad from an ad group based on ad weight
|
35 |
*
|
36 |
* @since 1.0.0
|
37 |
* @param int $id id of the ad group (taxonomy)
|
45 |
}
|
46 |
|
47 |
/**
|
48 |
+
* Echo an ad from an ad group
|
49 |
*
|
50 |
* @since 1.0.0
|
51 |
* @param int $id id of the ad (post)
|
55 |
}
|
56 |
|
57 |
/**
|
58 |
+
* Return content of an ad placement
|
59 |
*
|
60 |
* @since 1.1.0
|
61 |
* @param string $id slug of the ad placement
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
+
* Return content of an ad placement
|
73 |
*
|
74 |
* @since 1.1.0
|
75 |
* @param string $id slug of the ad placement
|
79 |
}
|
80 |
|
81 |
/**
|
82 |
+
* Return true if ads can be displayed
|
83 |
*
|
84 |
* @since 1.4.9
|
85 |
* @return bool, true if ads can be displayed
|
languages/advanced-ads.pot
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
# This file is distributed under the same license as the Advanced Ads plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Advanced Ads 1.
|
6 |
-
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads
|
7 |
"Last-Translator: Thomas Maier <post@webzunft.de>\n"
|
8 |
"Language-Team: webgilde <support@wpadvancedads.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2020-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: advanced-ads\n"
|
@@ -122,7 +122,7 @@ msgstr ""
|
|
122 |
#. translators: %s is a list of PHP extensions.
|
123 |
#. translators: %s is a name of a module.
|
124 |
#: admin/includes/ad-health-notices.php:54
|
125 |
-
#: admin/views/placements.php:
|
126 |
msgid "Missing PHP extensions could cause issues. Please ask your hosting provider to enable them: %s"
|
127 |
msgstr ""
|
128 |
|
@@ -227,7 +227,6 @@ msgstr ""
|
|
227 |
|
228 |
#. translators: %s is a service or plugin name.
|
229 |
#: admin/includes/ad-health-notices.php:267
|
230 |
-
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:196
|
231 |
msgid "%s detected."
|
232 |
msgstr ""
|
233 |
|
@@ -318,7 +317,7 @@ msgstr ""
|
|
318 |
#: modules/import-export/classes/import.php:146
|
319 |
#: modules/import-export/classes/import.php:186
|
320 |
#: modules/import-export/classes/import.php:564
|
321 |
-
#: public/class-advanced-ads.php:
|
322 |
msgid "Edit"
|
323 |
msgstr ""
|
324 |
|
@@ -395,48 +394,48 @@ msgstr[0] ""
|
|
395 |
msgstr[1] ""
|
396 |
|
397 |
#. Translators: %s is the time the ad was first saved.
|
398 |
-
#: admin/includes/class-ad-type.php:
|
399 |
msgid "Ad created on %s"
|
400 |
msgstr ""
|
401 |
|
402 |
-
#: admin/includes/class-ad-type.php:
|
403 |
-
#: admin/includes/class-ad-type.php:
|
404 |
msgid "Ad updated."
|
405 |
msgstr ""
|
406 |
|
407 |
#. translators: %s: date and time of the revision
|
408 |
-
#: admin/includes/class-ad-type.php:
|
409 |
msgid "Ad restored to revision from %s"
|
410 |
msgstr ""
|
411 |
|
412 |
-
#: admin/includes/class-ad-type.php:
|
413 |
-
#: admin/includes/class-ad-type.php:
|
414 |
msgid "Ad saved."
|
415 |
msgstr ""
|
416 |
|
417 |
-
#: admin/includes/class-ad-type.php:
|
418 |
msgid "Ad submitted."
|
419 |
msgstr ""
|
420 |
|
421 |
#. translators: %1$s is a date.
|
422 |
-
#: admin/includes/class-ad-type.php:
|
423 |
msgid "Ad scheduled for: <strong>%1$s</strong>."
|
424 |
msgstr ""
|
425 |
|
426 |
#. translators: Publish box date format, see http://php.net/date.
|
427 |
-
#: admin/includes/class-ad-type.php:
|
428 |
msgid "M j, Y @ G:i"
|
429 |
msgstr ""
|
430 |
|
431 |
-
#: admin/includes/class-ad-type.php:
|
432 |
msgid "Ad draft updated."
|
433 |
msgstr ""
|
434 |
|
435 |
-
#: admin/includes/class-ad-type.php:
|
436 |
msgid "You don’t have access to ads. Please deactivate and re-enable Advanced Ads again to fix this."
|
437 |
msgstr ""
|
438 |
|
439 |
-
#: admin/includes/class-ad-type.php:
|
440 |
#: classes/frontend_checks.php:434
|
441 |
msgid "Get help"
|
442 |
msgstr ""
|
@@ -554,19 +553,19 @@ msgstr ""
|
|
554 |
#: classes/widget.php:129
|
555 |
#: modules/gutenberg/includes/class-gutenberg.php:79
|
556 |
#: modules/import-export/views/page.php:23
|
557 |
-
#: public/class-advanced-ads.php:
|
558 |
msgid "Ads"
|
559 |
msgstr ""
|
560 |
|
561 |
#: admin/includes/class-menu.php:112
|
562 |
-
#: public/class-advanced-ads.php:
|
563 |
msgid "Add New Ad"
|
564 |
msgstr ""
|
565 |
|
566 |
#: admin/includes/class-menu.php:113
|
567 |
#: admin/views/ad-group-list-ads.php:36
|
568 |
-
#: public/class-advanced-ads.php:
|
569 |
-
#: public/class-advanced-ads.php:
|
570 |
msgid "New Ad"
|
571 |
msgstr ""
|
572 |
|
@@ -633,13 +632,13 @@ msgid "Layout / Output"
|
|
633 |
msgstr ""
|
634 |
|
635 |
#: admin/includes/class-meta-box.php:104
|
636 |
-
#: admin/views/placements.php:
|
637 |
#: classes/ad-debug.php:152
|
638 |
msgid "Display Conditions"
|
639 |
msgstr ""
|
640 |
|
641 |
#: admin/includes/class-meta-box.php:112
|
642 |
-
#: admin/views/placements.php:
|
643 |
#: classes/ad-debug.php:239
|
644 |
msgid "Visitor Conditions"
|
645 |
msgstr ""
|
@@ -938,7 +937,7 @@ msgid "Priority of content injection filter"
|
|
938 |
msgstr ""
|
939 |
|
940 |
#: admin/includes/class-settings.php:163
|
941 |
-
#: classes/ad_placements.php:
|
942 |
msgid "Disable level limitation"
|
943 |
msgstr ""
|
944 |
|
@@ -1163,7 +1162,7 @@ msgstr ""
|
|
1163 |
#: classes/ad-debug.php:118
|
1164 |
#: classes/ad-debug.php:167
|
1165 |
#: classes/ad-debug.php:169
|
1166 |
-
#: public/class-advanced-ads.php:
|
1167 |
msgid "Ad"
|
1168 |
msgstr ""
|
1169 |
|
@@ -1813,115 +1812,115 @@ msgstr ""
|
|
1813 |
msgid "Save New Placement"
|
1814 |
msgstr ""
|
1815 |
|
1816 |
-
#: admin/views/placement-injection-top.php:
|
1817 |
msgid "Congratulations! Your ad is now visible in the frontend."
|
1818 |
msgstr ""
|
1819 |
|
1820 |
-
#: admin/views/placement-injection-top.php:
|
1821 |
msgid "Adjust the placement options"
|
1822 |
msgstr ""
|
1823 |
|
1824 |
#. translators: %s is a URL.
|
1825 |
-
#: admin/views/placement-injection-top.php:
|
1826 |
msgid "Ad not showing up? Take a look <a href=\"%s\" target=\"_blank\">here</a>"
|
1827 |
msgstr ""
|
1828 |
|
1829 |
-
#: admin/views/placement-injection-top.php:
|
1830 |
msgid "Where do you want to display the ad?"
|
1831 |
msgstr ""
|
1832 |
|
1833 |
#. translators: %s is a URL.
|
1834 |
#. Translators: %s is a URL.
|
1835 |
-
#: admin/views/placement-injection-top.php:
|
1836 |
#: modules/gadsense/admin/admin.php:237
|
1837 |
msgid "The AdSense verification and Auto ads code is already activated in the <a href=\"%s\">AdSense settings</a>."
|
1838 |
msgstr ""
|
1839 |
|
1840 |
-
#: admin/views/placement-injection-top.php:
|
1841 |
#: modules/gadsense/admin/admin.php:240
|
1842 |
msgid "No need to add the code manually here, unless you want to include it into certain pages only."
|
1843 |
msgstr ""
|
1844 |
|
1845 |
-
#: admin/views/placement-injection-top.php:
|
1846 |
msgid "Click on the button below to add the Auto ads code to the header of your site."
|
1847 |
msgstr ""
|
1848 |
|
1849 |
-
#: admin/views/placement-injection-top.php:
|
1850 |
msgid "inject Auto ads"
|
1851 |
msgstr ""
|
1852 |
|
1853 |
-
#: admin/views/placement-injection-top.php:
|
1854 |
msgid "New placement"
|
1855 |
msgstr ""
|
1856 |
|
1857 |
-
#: admin/views/placement-injection-top.php:
|
1858 |
#: classes/ad_placements.php:67
|
1859 |
msgid "Before Content"
|
1860 |
msgstr ""
|
1861 |
|
1862 |
-
#: admin/views/placement-injection-top.php:
|
1863 |
#: classes/ad_placements.php:89
|
1864 |
msgid "Content"
|
1865 |
msgstr ""
|
1866 |
|
1867 |
-
#: admin/views/placement-injection-top.php:
|
1868 |
#: classes/ad_placements.php:78
|
1869 |
msgid "After Content"
|
1870 |
msgstr ""
|
1871 |
|
1872 |
-
#: admin/views/placement-injection-top.php:
|
1873 |
msgid "PHP or Shortcode"
|
1874 |
msgstr ""
|
1875 |
|
1876 |
-
#: admin/views/placement-injection-top.php:
|
1877 |
msgid "Manage Sidebar"
|
1878 |
msgstr ""
|
1879 |
|
1880 |
-
#: admin/views/placement-injection-top.php:
|
1881 |
msgid "Header (Manual)"
|
1882 |
msgstr ""
|
1883 |
|
1884 |
-
#: admin/views/placement-injection-top.php:
|
1885 |
-
#: admin/views/placement-injection-top.php:
|
1886 |
#: admin/views/upgrades/pro-placements.php:24
|
1887 |
msgid "Custom Position"
|
1888 |
msgstr ""
|
1889 |
|
1890 |
-
#: admin/views/placement-injection-top.php:
|
1891 |
msgid "Show Pro Places"
|
1892 |
msgstr ""
|
1893 |
|
1894 |
-
#: admin/views/placement-injection-top.php:
|
1895 |
msgid "AdSense In-feed"
|
1896 |
msgstr ""
|
1897 |
|
1898 |
-
#: admin/views/placement-injection-top.php:
|
1899 |
msgid "Show Sticky Places"
|
1900 |
msgstr ""
|
1901 |
|
1902 |
-
#: admin/views/placement-injection-top.php:
|
1903 |
msgid "Show PopUp"
|
1904 |
msgstr ""
|
1905 |
|
1906 |
-
#: admin/views/placement-injection-top.php:
|
1907 |
msgid "PopUp & Layer"
|
1908 |
msgstr ""
|
1909 |
|
1910 |
-
#: admin/views/placement-injection-top.php:
|
1911 |
msgid "see all…"
|
1912 |
msgstr ""
|
1913 |
|
1914 |
-
#: admin/views/placement-injection-top.php:
|
1915 |
msgid "Existing placement"
|
1916 |
msgstr ""
|
1917 |
|
1918 |
#. translators: %s is some HTML.
|
1919 |
-
#: admin/views/placement-injection-top.php:
|
1920 |
msgid "Or use the shortcode %s to insert the ad into the content manually."
|
1921 |
msgstr ""
|
1922 |
|
1923 |
#. translators: %s is a URL.
|
1924 |
-
#: admin/views/placement-injection-top.php:
|
1925 |
msgid "Learn more about your choices to display an ad in the <a href=\"%s\" target=\"_blank\">manual</a>."
|
1926 |
msgstr ""
|
1927 |
|
@@ -1943,15 +1942,11 @@ msgstr ""
|
|
1943 |
msgid "disabled"
|
1944 |
msgstr ""
|
1945 |
|
1946 |
-
#: admin/views/placements-content-index.php:
|
1947 |
-
msgid "
|
1948 |
-
msgstr ""
|
1949 |
-
|
1950 |
-
#: admin/views/placements-content-index.php:10
|
1951 |
-
msgid "before"
|
1952 |
msgstr ""
|
1953 |
|
1954 |
-
#: admin/views/placements-content-index.php:
|
1955 |
msgid "start counting from bottom"
|
1956 |
msgstr ""
|
1957 |
|
@@ -1964,12 +1959,12 @@ msgid "Placements updated"
|
|
1964 |
msgstr ""
|
1965 |
|
1966 |
#: admin/views/placements.php:22
|
1967 |
-
#: admin/views/placements.php:
|
1968 |
msgid "Create a new placement"
|
1969 |
msgstr ""
|
1970 |
|
1971 |
#: admin/views/placements.php:23
|
1972 |
-
#: admin/views/placements.php:
|
1973 |
msgid "New Placement"
|
1974 |
msgstr ""
|
1975 |
|
@@ -2004,62 +1999,70 @@ msgstr ""
|
|
2004 |
msgid "Item"
|
2005 |
msgstr ""
|
2006 |
|
2007 |
-
#: admin/views/placements.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008 |
msgid "position"
|
2009 |
msgstr ""
|
2010 |
|
2011 |
-
#: admin/views/placements.php:
|
2012 |
msgid "Important Notice"
|
2013 |
msgstr ""
|
2014 |
|
2015 |
-
#: admin/views/placements.php:
|
2016 |
msgid "ad label"
|
2017 |
msgstr ""
|
2018 |
|
2019 |
-
#: admin/views/placements.php:
|
2020 |
msgid "Use display conditions for placements."
|
2021 |
msgstr ""
|
2022 |
|
2023 |
-
#: admin/views/placements.php:
|
2024 |
-
#: admin/views/placements.php:
|
2025 |
msgid "The free version provides conditions on the ad edit page."
|
2026 |
msgstr ""
|
2027 |
|
2028 |
-
#: admin/views/placements.php:
|
2029 |
msgid "Use visitor conditions for placements."
|
2030 |
msgstr ""
|
2031 |
|
2032 |
-
#: admin/views/placements.php:
|
2033 |
msgid "Minimum Content Length"
|
2034 |
msgstr ""
|
2035 |
|
2036 |
-
#: admin/views/placements.php:
|
2037 |
msgid "Minimum length of content before automatically injected ads are allowed in them."
|
2038 |
msgstr ""
|
2039 |
|
2040 |
-
#: admin/views/placements.php:
|
2041 |
msgid "Words Between Ads"
|
2042 |
msgstr ""
|
2043 |
|
2044 |
-
#: admin/views/placements.php:
|
2045 |
msgid "A minimum amount of words between automatically injected ads."
|
2046 |
msgstr ""
|
2047 |
|
2048 |
-
#: admin/views/placements.php:
|
2049 |
msgid "show all options"
|
2050 |
msgstr ""
|
2051 |
|
2052 |
#. translators: %s is a URL.
|
2053 |
-
#: admin/views/placements.php:
|
2054 |
msgid "Tutorial: <a href=\"%s\" target=\"_blank\">How to place visible ads in the header of your website</a>."
|
2055 |
msgstr ""
|
2056 |
|
2057 |
-
#: admin/views/placements.php:
|
2058 |
msgctxt "checkbox to remove placement"
|
2059 |
msgid "delete"
|
2060 |
msgstr ""
|
2061 |
|
2062 |
-
#: admin/views/placements.php:
|
2063 |
msgid "Save Placements"
|
2064 |
msgstr ""
|
2065 |
|
@@ -2402,6 +2405,10 @@ msgstr ""
|
|
2402 |
msgid "See all features and pricing"
|
2403 |
msgstr ""
|
2404 |
|
|
|
|
|
|
|
|
|
2405 |
#: admin/views/upgrades/tracking.php:4
|
2406 |
msgid "track impressions and click on your ads"
|
2407 |
msgstr ""
|
@@ -2455,7 +2462,7 @@ msgid "main query"
|
|
2455 |
msgstr ""
|
2456 |
|
2457 |
#: classes/ad-debug.php:121
|
2458 |
-
#: public/class-advanced-ads.php:
|
2459 |
msgctxt "ad group singular name"
|
2460 |
msgid "Ad Group"
|
2461 |
msgstr ""
|
@@ -2520,32 +2527,76 @@ msgid "Create a sidebar widget with an ad. Can be placed and used like any other
|
|
2520 |
msgstr ""
|
2521 |
|
2522 |
#. translators: %s is an html tag.
|
2523 |
-
#: classes/ad_placements.php:
|
2524 |
msgid "paragraph (%s)"
|
2525 |
msgstr ""
|
2526 |
|
2527 |
#. translators: %s is an html tag.
|
2528 |
-
#: classes/ad_placements.php:
|
2529 |
msgid "paragraph without image (%s)"
|
2530 |
msgstr ""
|
2531 |
|
2532 |
#. translators: %s is an html tag.
|
2533 |
-
#: classes/ad_placements.php:
|
2534 |
msgid "headline 2 (%s)"
|
2535 |
msgstr ""
|
2536 |
|
2537 |
#. translators: %s is an html tag.
|
2538 |
-
#: classes/ad_placements.php:
|
2539 |
msgid "headline 3 (%s)"
|
2540 |
msgstr ""
|
2541 |
|
2542 |
#. translators: %s is an html tag.
|
2543 |
-
#: classes/ad_placements.php:
|
2544 |
msgid "headline 4 (%s)"
|
2545 |
msgstr ""
|
2546 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2547 |
#. translators: %s stands for the name of the "Disable level limitation" option and automatically translated as well
|
2548 |
-
#: classes/ad_placements.php:
|
2549 |
msgid "Set <em>%s</em> to show more ads"
|
2550 |
msgstr ""
|
2551 |
|
@@ -2566,7 +2617,7 @@ msgid "Uses a simple placeholder ad for quick testing."
|
|
2566 |
msgstr ""
|
2567 |
|
2568 |
#: classes/ad_type_dummy.php:45
|
2569 |
-
#: classes/ad_type_image.php:
|
2570 |
msgid "URL"
|
2571 |
msgstr ""
|
2572 |
|
@@ -2578,76 +2629,77 @@ msgstr ""
|
|
2578 |
msgid "ad group"
|
2579 |
msgstr ""
|
2580 |
|
2581 |
-
#: classes/ad_type_image.php:
|
2582 |
msgid "Image Ad"
|
2583 |
msgstr ""
|
2584 |
|
2585 |
-
#: classes/ad_type_image.php:
|
2586 |
msgid "Ads in various image formats."
|
2587 |
msgstr ""
|
2588 |
|
2589 |
-
#: classes/ad_type_image.php:
|
2590 |
msgid "Insert File"
|
2591 |
msgstr ""
|
2592 |
|
2593 |
-
#: classes/ad_type_image.php:
|
2594 |
msgid "Insert"
|
2595 |
msgstr ""
|
2596 |
|
2597 |
-
#: classes/ad_type_image.php:
|
2598 |
msgid "select image"
|
2599 |
msgstr ""
|
2600 |
|
2601 |
-
#: classes/ad_type_image.php:
|
2602 |
msgid "edit"
|
2603 |
msgstr ""
|
2604 |
|
2605 |
-
#: classes/ad_type_image.php:
|
2606 |
msgid "Link to target site including http(s)"
|
2607 |
msgstr ""
|
2608 |
|
2609 |
-
|
|
|
2610 |
msgid "Original size: %s"
|
2611 |
msgstr ""
|
2612 |
|
2613 |
-
#: classes/ad_type_plain.php:
|
2614 |
msgid "Plain Text and Code"
|
2615 |
msgstr ""
|
2616 |
|
2617 |
-
#: classes/ad_type_plain.php:
|
2618 |
msgid "Any ad network, Amazon, customized AdSense codes, shortcodes, and code like JavaScript, HTML or PHP."
|
2619 |
msgstr ""
|
2620 |
|
2621 |
-
#: classes/ad_type_plain.php:
|
2622 |
msgid "Insert plain text or code into this field."
|
2623 |
msgstr ""
|
2624 |
|
2625 |
-
#: classes/ad_type_plain.php:
|
2626 |
msgid "Allow PHP"
|
2627 |
msgstr ""
|
2628 |
|
2629 |
-
#: classes/ad_type_plain.php:
|
2630 |
msgid "Execute PHP code (wrapped in <code><?php ?></code>)"
|
2631 |
msgstr ""
|
2632 |
|
2633 |
-
#: classes/ad_type_plain.php:
|
2634 |
msgid "No PHP tag detected in your code."
|
2635 |
msgstr ""
|
2636 |
|
2637 |
-
#: classes/ad_type_plain.php:
|
2638 |
-
#: classes/ad_type_plain.php:
|
2639 |
msgid "Uncheck this checkbox for improved performance."
|
2640 |
msgstr ""
|
2641 |
|
2642 |
-
#: classes/ad_type_plain.php:
|
2643 |
msgid "Allow shortcodes"
|
2644 |
msgstr ""
|
2645 |
|
2646 |
-
#: classes/ad_type_plain.php:
|
2647 |
msgid "Execute shortcodes"
|
2648 |
msgstr ""
|
2649 |
|
2650 |
-
#: classes/ad_type_plain.php:
|
2651 |
msgid "No shortcode detected in your code."
|
2652 |
msgstr ""
|
2653 |
|
@@ -2837,11 +2889,11 @@ msgstr ""
|
|
2837 |
msgid "There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s."
|
2838 |
msgstr ""
|
2839 |
|
2840 |
-
#: classes/EDD_SL_Plugin_Updater.php:
|
2841 |
msgid "You do not have permission to install plugin updates"
|
2842 |
msgstr ""
|
2843 |
|
2844 |
-
#: classes/EDD_SL_Plugin_Updater.php:
|
2845 |
msgid "Error"
|
2846 |
msgstr ""
|
2847 |
|
@@ -3132,7 +3184,7 @@ msgid "Ad blocker fix"
|
|
3132 |
msgstr ""
|
3133 |
|
3134 |
#: modules/ad-blocker/admin/admin.php:150
|
3135 |
-
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:
|
3136 |
msgid "Unable to connect to the filesystem. Please confirm your credentials."
|
3137 |
msgstr ""
|
3138 |
|
@@ -3231,42 +3283,37 @@ msgstr ""
|
|
3231 |
msgid "The file was not created."
|
3232 |
msgstr ""
|
3233 |
|
3234 |
-
|
3235 |
-
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:197
|
3236 |
-
msgid "Find the solution here"
|
3237 |
-
msgstr ""
|
3238 |
-
|
3239 |
-
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:208
|
3240 |
msgid "Import & Replace"
|
3241 |
msgstr ""
|
3242 |
|
3243 |
-
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:
|
3244 |
msgid "Move the content of the existing ads.txt file into Advanced Ads and remove it."
|
3245 |
msgstr ""
|
3246 |
|
3247 |
-
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:
|
3248 |
#: modules/ads-txt/admin/views/setting-additional-content.php:4
|
3249 |
msgid "An error occured: %s."
|
3250 |
msgstr ""
|
3251 |
|
3252 |
#. translators: %s the line that may need to be added manually
|
3253 |
-
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:
|
3254 |
msgid "If your site is located on a subdomain, you need to add the following line to the ads.txt file of the root domain: %s"
|
3255 |
msgstr ""
|
3256 |
|
3257 |
-
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:
|
3258 |
msgid "The ads.txt is now managed with Advanced Ads."
|
3259 |
msgstr ""
|
3260 |
|
3261 |
-
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:
|
3262 |
msgid "Not the main blog"
|
3263 |
msgstr ""
|
3264 |
|
3265 |
-
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:
|
3266 |
msgid "Could not delete the existing ads.txt file"
|
3267 |
msgstr ""
|
3268 |
|
3269 |
-
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:
|
3270 |
msgid "Could not find the existing ads.txt file"
|
3271 |
msgstr ""
|
3272 |
|
@@ -3912,7 +3959,7 @@ msgid "When you click the button below Advanced Ads will create an XML file for
|
|
3912 |
msgstr ""
|
3913 |
|
3914 |
#: modules/import-export/views/page.php:24
|
3915 |
-
#: public/class-advanced-ads.php:
|
3916 |
msgid "Groups"
|
3917 |
msgstr ""
|
3918 |
|
@@ -3997,76 +4044,76 @@ msgstr ""
|
|
3997 |
msgid "Advanced Ads Error: %s"
|
3998 |
msgstr ""
|
3999 |
|
4000 |
-
#: public/class-advanced-ads.php:
|
4001 |
msgctxt "ad group general name"
|
4002 |
msgid "Ad Groups & Rotations"
|
4003 |
msgstr ""
|
4004 |
|
4005 |
-
#: public/class-advanced-ads.php:
|
4006 |
msgid "Search Ad Groups"
|
4007 |
msgstr ""
|
4008 |
|
4009 |
-
#: public/class-advanced-ads.php:
|
4010 |
msgid "All Ad Groups"
|
4011 |
msgstr ""
|
4012 |
|
4013 |
-
#: public/class-advanced-ads.php:
|
4014 |
msgid "Parent Ad Groups"
|
4015 |
msgstr ""
|
4016 |
|
4017 |
-
#: public/class-advanced-ads.php:
|
4018 |
msgid "Parent Ad Groups:"
|
4019 |
msgstr ""
|
4020 |
|
4021 |
-
#: public/class-advanced-ads.php:
|
4022 |
msgid "Edit Ad Group"
|
4023 |
msgstr ""
|
4024 |
|
4025 |
-
#: public/class-advanced-ads.php:
|
4026 |
msgid "Update Ad Group"
|
4027 |
msgstr ""
|
4028 |
|
4029 |
-
#: public/class-advanced-ads.php:
|
4030 |
msgid "Add New Ad Group"
|
4031 |
msgstr ""
|
4032 |
|
4033 |
-
#: public/class-advanced-ads.php:
|
4034 |
msgid "New Ad Groups Name"
|
4035 |
msgstr ""
|
4036 |
|
4037 |
-
#: public/class-advanced-ads.php:
|
4038 |
msgid "No Ad Group found"
|
4039 |
msgstr ""
|
4040 |
|
4041 |
-
#: public/class-advanced-ads.php:
|
4042 |
msgid "Edit Ad"
|
4043 |
msgstr ""
|
4044 |
|
4045 |
-
#: public/class-advanced-ads.php:
|
4046 |
msgid "View"
|
4047 |
msgstr ""
|
4048 |
|
4049 |
-
#: public/class-advanced-ads.php:
|
4050 |
msgid "View the Ad"
|
4051 |
msgstr ""
|
4052 |
|
4053 |
-
#: public/class-advanced-ads.php:
|
4054 |
msgid "Search Ads"
|
4055 |
msgstr ""
|
4056 |
|
4057 |
-
#: public/class-advanced-ads.php:
|
4058 |
msgid "No Ads found"
|
4059 |
msgstr ""
|
4060 |
|
4061 |
-
#: public/class-advanced-ads.php:
|
4062 |
msgid "No Ads found in Trash"
|
4063 |
msgstr ""
|
4064 |
|
4065 |
-
#: public/class-advanced-ads.php:
|
4066 |
msgid "Parent Ad"
|
4067 |
msgstr ""
|
4068 |
|
4069 |
-
#: public/class-advanced-ads.php:
|
4070 |
msgctxt "label above ads"
|
4071 |
msgid "Advertisements"
|
4072 |
msgstr ""
|
2 |
# This file is distributed under the same license as the Advanced Ads plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Advanced Ads 1.18.0\n"
|
6 |
+
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/advanced-ads/\n"
|
7 |
"Last-Translator: Thomas Maier <post@webzunft.de>\n"
|
8 |
"Language-Team: webgilde <support@wpadvancedads.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2020-06-10T08:01:44+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.4.0\n"
|
15 |
"X-Domain: advanced-ads\n"
|
122 |
#. translators: %s is a list of PHP extensions.
|
123 |
#. translators: %s is a name of a module.
|
124 |
#: admin/includes/ad-health-notices.php:54
|
125 |
+
#: admin/views/placements.php:179
|
126 |
msgid "Missing PHP extensions could cause issues. Please ask your hosting provider to enable them: %s"
|
127 |
msgstr ""
|
128 |
|
227 |
|
228 |
#. translators: %s is a service or plugin name.
|
229 |
#: admin/includes/ad-health-notices.php:267
|
|
|
230 |
msgid "%s detected."
|
231 |
msgstr ""
|
232 |
|
317 |
#: modules/import-export/classes/import.php:146
|
318 |
#: modules/import-export/classes/import.php:186
|
319 |
#: modules/import-export/classes/import.php:564
|
320 |
+
#: public/class-advanced-ads.php:740
|
321 |
msgid "Edit"
|
322 |
msgstr ""
|
323 |
|
394 |
msgstr[1] ""
|
395 |
|
396 |
#. Translators: %s is the time the ad was first saved.
|
397 |
+
#: admin/includes/class-ad-type.php:658
|
398 |
msgid "Ad created on %s"
|
399 |
msgstr ""
|
400 |
|
401 |
+
#: admin/includes/class-ad-type.php:846
|
402 |
+
#: admin/includes/class-ad-type.php:847
|
403 |
msgid "Ad updated."
|
404 |
msgstr ""
|
405 |
|
406 |
#. translators: %s: date and time of the revision
|
407 |
+
#: admin/includes/class-ad-type.php:848
|
408 |
msgid "Ad restored to revision from %s"
|
409 |
msgstr ""
|
410 |
|
411 |
+
#: admin/includes/class-ad-type.php:849
|
412 |
+
#: admin/includes/class-ad-type.php:850
|
413 |
msgid "Ad saved."
|
414 |
msgstr ""
|
415 |
|
416 |
+
#: admin/includes/class-ad-type.php:851
|
417 |
msgid "Ad submitted."
|
418 |
msgstr ""
|
419 |
|
420 |
#. translators: %1$s is a date.
|
421 |
+
#: admin/includes/class-ad-type.php:854
|
422 |
msgid "Ad scheduled for: <strong>%1$s</strong>."
|
423 |
msgstr ""
|
424 |
|
425 |
#. translators: Publish box date format, see http://php.net/date.
|
426 |
+
#: admin/includes/class-ad-type.php:856
|
427 |
msgid "M j, Y @ G:i"
|
428 |
msgstr ""
|
429 |
|
430 |
+
#: admin/includes/class-ad-type.php:858
|
431 |
msgid "Ad draft updated."
|
432 |
msgstr ""
|
433 |
|
434 |
+
#: admin/includes/class-ad-type.php:914
|
435 |
msgid "You don’t have access to ads. Please deactivate and re-enable Advanced Ads again to fix this."
|
436 |
msgstr ""
|
437 |
|
438 |
+
#: admin/includes/class-ad-type.php:915
|
439 |
#: classes/frontend_checks.php:434
|
440 |
msgid "Get help"
|
441 |
msgstr ""
|
553 |
#: classes/widget.php:129
|
554 |
#: modules/gutenberg/includes/class-gutenberg.php:79
|
555 |
#: modules/import-export/views/page.php:23
|
556 |
+
#: public/class-advanced-ads.php:736
|
557 |
msgid "Ads"
|
558 |
msgstr ""
|
559 |
|
560 |
#: admin/includes/class-menu.php:112
|
561 |
+
#: public/class-advanced-ads.php:739
|
562 |
msgid "Add New Ad"
|
563 |
msgstr ""
|
564 |
|
565 |
#: admin/includes/class-menu.php:113
|
566 |
#: admin/views/ad-group-list-ads.php:36
|
567 |
+
#: public/class-advanced-ads.php:738
|
568 |
+
#: public/class-advanced-ads.php:742
|
569 |
msgid "New Ad"
|
570 |
msgstr ""
|
571 |
|
632 |
msgstr ""
|
633 |
|
634 |
#: admin/includes/class-meta-box.php:104
|
635 |
+
#: admin/views/placements.php:219
|
636 |
#: classes/ad-debug.php:152
|
637 |
msgid "Display Conditions"
|
638 |
msgstr ""
|
639 |
|
640 |
#: admin/includes/class-meta-box.php:112
|
641 |
+
#: admin/views/placements.php:228
|
642 |
#: classes/ad-debug.php:239
|
643 |
msgid "Visitor Conditions"
|
644 |
msgstr ""
|
937 |
msgstr ""
|
938 |
|
939 |
#: admin/includes/class-settings.php:163
|
940 |
+
#: classes/ad_placements.php:996
|
941 |
msgid "Disable level limitation"
|
942 |
msgstr ""
|
943 |
|
1162 |
#: classes/ad-debug.php:118
|
1163 |
#: classes/ad-debug.php:167
|
1164 |
#: classes/ad-debug.php:169
|
1165 |
+
#: public/class-advanced-ads.php:737
|
1166 |
msgid "Ad"
|
1167 |
msgstr ""
|
1168 |
|
1812 |
msgid "Save New Placement"
|
1813 |
msgstr ""
|
1814 |
|
1815 |
+
#: admin/views/placement-injection-top.php:13
|
1816 |
msgid "Congratulations! Your ad is now visible in the frontend."
|
1817 |
msgstr ""
|
1818 |
|
1819 |
+
#: admin/views/placement-injection-top.php:14
|
1820 |
msgid "Adjust the placement options"
|
1821 |
msgstr ""
|
1822 |
|
1823 |
#. translators: %s is a URL.
|
1824 |
+
#: admin/views/placement-injection-top.php:21
|
1825 |
msgid "Ad not showing up? Take a look <a href=\"%s\" target=\"_blank\">here</a>"
|
1826 |
msgstr ""
|
1827 |
|
1828 |
+
#: admin/views/placement-injection-top.php:35
|
1829 |
msgid "Where do you want to display the ad?"
|
1830 |
msgstr ""
|
1831 |
|
1832 |
#. translators: %s is a URL.
|
1833 |
#. Translators: %s is a URL.
|
1834 |
+
#: admin/views/placement-injection-top.php:46
|
1835 |
#: modules/gadsense/admin/admin.php:237
|
1836 |
msgid "The AdSense verification and Auto ads code is already activated in the <a href=\"%s\">AdSense settings</a>."
|
1837 |
msgstr ""
|
1838 |
|
1839 |
+
#: admin/views/placement-injection-top.php:58
|
1840 |
#: modules/gadsense/admin/admin.php:240
|
1841 |
msgid "No need to add the code manually here, unless you want to include it into certain pages only."
|
1842 |
msgstr ""
|
1843 |
|
1844 |
+
#: admin/views/placement-injection-top.php:61
|
1845 |
msgid "Click on the button below to add the Auto ads code to the header of your site."
|
1846 |
msgstr ""
|
1847 |
|
1848 |
+
#: admin/views/placement-injection-top.php:72
|
1849 |
msgid "inject Auto ads"
|
1850 |
msgstr ""
|
1851 |
|
1852 |
+
#: admin/views/placement-injection-top.php:78
|
1853 |
msgid "New placement"
|
1854 |
msgstr ""
|
1855 |
|
1856 |
+
#: admin/views/placement-injection-top.php:79
|
1857 |
#: classes/ad_placements.php:67
|
1858 |
msgid "Before Content"
|
1859 |
msgstr ""
|
1860 |
|
1861 |
+
#: admin/views/placement-injection-top.php:80
|
1862 |
#: classes/ad_placements.php:89
|
1863 |
msgid "Content"
|
1864 |
msgstr ""
|
1865 |
|
1866 |
+
#: admin/views/placement-injection-top.php:81
|
1867 |
#: classes/ad_placements.php:78
|
1868 |
msgid "After Content"
|
1869 |
msgstr ""
|
1870 |
|
1871 |
+
#: admin/views/placement-injection-top.php:82
|
1872 |
msgid "PHP or Shortcode"
|
1873 |
msgstr ""
|
1874 |
|
1875 |
+
#: admin/views/placement-injection-top.php:83
|
1876 |
msgid "Manage Sidebar"
|
1877 |
msgstr ""
|
1878 |
|
1879 |
+
#: admin/views/placement-injection-top.php:84
|
1880 |
msgid "Header (Manual)"
|
1881 |
msgstr ""
|
1882 |
|
1883 |
+
#: admin/views/placement-injection-top.php:88
|
1884 |
+
#: admin/views/placement-injection-top.php:92
|
1885 |
#: admin/views/upgrades/pro-placements.php:24
|
1886 |
msgid "Custom Position"
|
1887 |
msgstr ""
|
1888 |
|
1889 |
+
#: admin/views/placement-injection-top.php:88
|
1890 |
msgid "Show Pro Places"
|
1891 |
msgstr ""
|
1892 |
|
1893 |
+
#: admin/views/placement-injection-top.php:97
|
1894 |
msgid "AdSense In-feed"
|
1895 |
msgstr ""
|
1896 |
|
1897 |
+
#: admin/views/placement-injection-top.php:103
|
1898 |
msgid "Show Sticky Places"
|
1899 |
msgstr ""
|
1900 |
|
1901 |
+
#: admin/views/placement-injection-top.php:109
|
1902 |
msgid "Show PopUp"
|
1903 |
msgstr ""
|
1904 |
|
1905 |
+
#: admin/views/placement-injection-top.php:113
|
1906 |
msgid "PopUp & Layer"
|
1907 |
msgstr ""
|
1908 |
|
1909 |
+
#: admin/views/placement-injection-top.php:118
|
1910 |
msgid "see all…"
|
1911 |
msgstr ""
|
1912 |
|
1913 |
+
#: admin/views/placement-injection-top.php:155
|
1914 |
msgid "Existing placement"
|
1915 |
msgstr ""
|
1916 |
|
1917 |
#. translators: %s is some HTML.
|
1918 |
+
#: admin/views/placement-injection-top.php:168
|
1919 |
msgid "Or use the shortcode %s to insert the ad into the content manually."
|
1920 |
msgstr ""
|
1921 |
|
1922 |
#. translators: %s is a URL.
|
1923 |
+
#: admin/views/placement-injection-top.php:176
|
1924 |
msgid "Learn more about your choices to display an ad in the <a href=\"%s\" target=\"_blank\">manual</a>."
|
1925 |
msgstr ""
|
1926 |
|
1942 |
msgid "disabled"
|
1943 |
msgstr ""
|
1944 |
|
1945 |
+
#: admin/views/placements-content-index.php:43
|
1946 |
+
msgid "use xpath, e.g. `p[not(parent::blockquote)]`"
|
|
|
|
|
|
|
|
|
1947 |
msgstr ""
|
1948 |
|
1949 |
+
#: admin/views/placements-content-index.php:50
|
1950 |
msgid "start counting from bottom"
|
1951 |
msgstr ""
|
1952 |
|
1959 |
msgstr ""
|
1960 |
|
1961 |
#: admin/views/placements.php:22
|
1962 |
+
#: admin/views/placements.php:307
|
1963 |
msgid "Create a new placement"
|
1964 |
msgstr ""
|
1965 |
|
1966 |
#: admin/views/placements.php:23
|
1967 |
+
#: admin/views/placements.php:309
|
1968 |
msgid "New Placement"
|
1969 |
msgstr ""
|
1970 |
|
1999 |
msgid "Item"
|
2000 |
msgstr ""
|
2001 |
|
2002 |
+
#: admin/views/placements.php:155
|
2003 |
+
msgid "after"
|
2004 |
+
msgstr ""
|
2005 |
+
|
2006 |
+
#: admin/views/placements.php:156
|
2007 |
+
msgid "before"
|
2008 |
+
msgstr ""
|
2009 |
+
|
2010 |
+
#: admin/views/placements.php:169
|
2011 |
msgid "position"
|
2012 |
msgstr ""
|
2013 |
|
2014 |
+
#: admin/views/placements.php:175
|
2015 |
msgid "Important Notice"
|
2016 |
msgstr ""
|
2017 |
|
2018 |
+
#: admin/views/placements.php:208
|
2019 |
msgid "ad label"
|
2020 |
msgstr ""
|
2021 |
|
2022 |
+
#: admin/views/placements.php:221
|
2023 |
msgid "Use display conditions for placements."
|
2024 |
msgstr ""
|
2025 |
|
2026 |
+
#: admin/views/placements.php:222
|
2027 |
+
#: admin/views/placements.php:231
|
2028 |
msgid "The free version provides conditions on the ad edit page."
|
2029 |
msgstr ""
|
2030 |
|
2031 |
+
#: admin/views/placements.php:230
|
2032 |
msgid "Use visitor conditions for placements."
|
2033 |
msgstr ""
|
2034 |
|
2035 |
+
#: admin/views/placements.php:237
|
2036 |
msgid "Minimum Content Length"
|
2037 |
msgstr ""
|
2038 |
|
2039 |
+
#: admin/views/placements.php:239
|
2040 |
msgid "Minimum length of content before automatically injected ads are allowed in them."
|
2041 |
msgstr ""
|
2042 |
|
2043 |
+
#: admin/views/placements.php:245
|
2044 |
msgid "Words Between Ads"
|
2045 |
msgstr ""
|
2046 |
|
2047 |
+
#: admin/views/placements.php:247
|
2048 |
msgid "A minimum amount of words between automatically injected ads."
|
2049 |
msgstr ""
|
2050 |
|
2051 |
+
#: admin/views/placements.php:257
|
2052 |
msgid "show all options"
|
2053 |
msgstr ""
|
2054 |
|
2055 |
#. translators: %s is a URL.
|
2056 |
+
#: admin/views/placements.php:278
|
2057 |
msgid "Tutorial: <a href=\"%s\" target=\"_blank\">How to place visible ads in the header of your website</a>."
|
2058 |
msgstr ""
|
2059 |
|
2060 |
+
#: admin/views/placements.php:298
|
2061 |
msgctxt "checkbox to remove placement"
|
2062 |
msgid "delete"
|
2063 |
msgstr ""
|
2064 |
|
2065 |
+
#: admin/views/placements.php:305
|
2066 |
msgid "Save Placements"
|
2067 |
msgstr ""
|
2068 |
|
2405 |
msgid "See all features and pricing"
|
2406 |
msgstr ""
|
2407 |
|
2408 |
+
#: admin/views/upgrades/repeat-the-position.php:1
|
2409 |
+
msgid "repeat the position"
|
2410 |
+
msgstr ""
|
2411 |
+
|
2412 |
#: admin/views/upgrades/tracking.php:4
|
2413 |
msgid "track impressions and click on your ads"
|
2414 |
msgstr ""
|
2462 |
msgstr ""
|
2463 |
|
2464 |
#: classes/ad-debug.php:121
|
2465 |
+
#: public/class-advanced-ads.php:701
|
2466 |
msgctxt "ad group singular name"
|
2467 |
msgid "Ad Group"
|
2468 |
msgstr ""
|
2527 |
msgstr ""
|
2528 |
|
2529 |
#. translators: %s is an html tag.
|
2530 |
+
#: classes/ad_placements.php:292
|
2531 |
msgid "paragraph (%s)"
|
2532 |
msgstr ""
|
2533 |
|
2534 |
#. translators: %s is an html tag.
|
2535 |
+
#: classes/ad_placements.php:294
|
2536 |
msgid "paragraph without image (%s)"
|
2537 |
msgstr ""
|
2538 |
|
2539 |
#. translators: %s is an html tag.
|
2540 |
+
#: classes/ad_placements.php:296
|
2541 |
msgid "headline 2 (%s)"
|
2542 |
msgstr ""
|
2543 |
|
2544 |
#. translators: %s is an html tag.
|
2545 |
+
#: classes/ad_placements.php:298
|
2546 |
msgid "headline 3 (%s)"
|
2547 |
msgstr ""
|
2548 |
|
2549 |
#. translators: %s is an html tag.
|
2550 |
+
#: classes/ad_placements.php:300
|
2551 |
msgid "headline 4 (%s)"
|
2552 |
msgstr ""
|
2553 |
|
2554 |
+
#. translators: %s is an html tag.
|
2555 |
+
#: classes/ad_placements.php:302
|
2556 |
+
msgid "any headline (%s)"
|
2557 |
+
msgstr ""
|
2558 |
+
|
2559 |
+
#. translators: %s is an html tag.
|
2560 |
+
#: classes/ad_placements.php:304
|
2561 |
+
msgid "image (%s)"
|
2562 |
+
msgstr ""
|
2563 |
+
|
2564 |
+
#. translators: %s is an html tag.
|
2565 |
+
#: classes/ad_placements.php:306
|
2566 |
+
msgid "table (%s)"
|
2567 |
+
msgstr ""
|
2568 |
+
|
2569 |
+
#. translators: %s is an html tag.
|
2570 |
+
#: classes/ad_placements.php:308
|
2571 |
+
msgid "list item (%s)"
|
2572 |
+
msgstr ""
|
2573 |
+
|
2574 |
+
#. translators: %s is an html tag.
|
2575 |
+
#: classes/ad_placements.php:310
|
2576 |
+
msgid "quote (%s)"
|
2577 |
+
msgstr ""
|
2578 |
+
|
2579 |
+
#. translators: %s is an html tag.
|
2580 |
+
#: classes/ad_placements.php:312
|
2581 |
+
msgid "iframe (%s)"
|
2582 |
+
msgstr ""
|
2583 |
+
|
2584 |
+
#. translators: %s is an html tag.
|
2585 |
+
#: classes/ad_placements.php:314
|
2586 |
+
msgid "container (%s)"
|
2587 |
+
msgstr ""
|
2588 |
+
|
2589 |
+
#: classes/ad_placements.php:316
|
2590 |
+
msgid "any element"
|
2591 |
+
msgstr ""
|
2592 |
+
|
2593 |
+
#: classes/ad_placements.php:318
|
2594 |
+
msgctxt "for the \"custom\" content placement option"
|
2595 |
+
msgid "custom"
|
2596 |
+
msgstr ""
|
2597 |
+
|
2598 |
#. translators: %s stands for the name of the "Disable level limitation" option and automatically translated as well
|
2599 |
+
#: classes/ad_placements.php:995
|
2600 |
msgid "Set <em>%s</em> to show more ads"
|
2601 |
msgstr ""
|
2602 |
|
2617 |
msgstr ""
|
2618 |
|
2619 |
#: classes/ad_type_dummy.php:45
|
2620 |
+
#: classes/ad_type_image.php:69
|
2621 |
msgid "URL"
|
2622 |
msgstr ""
|
2623 |
|
2629 |
msgid "ad group"
|
2630 |
msgstr ""
|
2631 |
|
2632 |
+
#: classes/ad_type_image.php:29
|
2633 |
msgid "Image Ad"
|
2634 |
msgstr ""
|
2635 |
|
2636 |
+
#: classes/ad_type_image.php:30
|
2637 |
msgid "Ads in various image formats."
|
2638 |
msgstr ""
|
2639 |
|
2640 |
+
#: classes/ad_type_image.php:50
|
2641 |
msgid "Insert File"
|
2642 |
msgstr ""
|
2643 |
|
2644 |
+
#: classes/ad_type_image.php:52
|
2645 |
msgid "Insert"
|
2646 |
msgstr ""
|
2647 |
|
2648 |
+
#: classes/ad_type_image.php:52
|
2649 |
msgid "select image"
|
2650 |
msgstr ""
|
2651 |
|
2652 |
+
#: classes/ad_type_image.php:59
|
2653 |
msgid "edit"
|
2654 |
msgstr ""
|
2655 |
|
2656 |
+
#: classes/ad_type_image.php:73
|
2657 |
msgid "Link to target site including http(s)"
|
2658 |
msgstr ""
|
2659 |
|
2660 |
+
#. translators: $s is a size string like "728 x 90".
|
2661 |
+
#: classes/ad_type_image.php:226
|
2662 |
msgid "Original size: %s"
|
2663 |
msgstr ""
|
2664 |
|
2665 |
+
#: classes/ad_type_plain.php:29
|
2666 |
msgid "Plain Text and Code"
|
2667 |
msgstr ""
|
2668 |
|
2669 |
+
#: classes/ad_type_plain.php:30
|
2670 |
msgid "Any ad network, Amazon, customized AdSense codes, shortcodes, and code like JavaScript, HTML or PHP."
|
2671 |
msgstr ""
|
2672 |
|
2673 |
+
#: classes/ad_type_plain.php:49
|
2674 |
msgid "Insert plain text or code into this field."
|
2675 |
msgstr ""
|
2676 |
|
2677 |
+
#: classes/ad_type_plain.php:91
|
2678 |
msgid "Allow PHP"
|
2679 |
msgstr ""
|
2680 |
|
2681 |
+
#: classes/ad_type_plain.php:98
|
2682 |
msgid "Execute PHP code (wrapped in <code><?php ?></code>)"
|
2683 |
msgstr ""
|
2684 |
|
2685 |
+
#: classes/ad_type_plain.php:105
|
2686 |
msgid "No PHP tag detected in your code."
|
2687 |
msgstr ""
|
2688 |
|
2689 |
+
#: classes/ad_type_plain.php:105
|
2690 |
+
#: classes/ad_type_plain.php:133
|
2691 |
msgid "Uncheck this checkbox for improved performance."
|
2692 |
msgstr ""
|
2693 |
|
2694 |
+
#: classes/ad_type_plain.php:121
|
2695 |
msgid "Allow shortcodes"
|
2696 |
msgstr ""
|
2697 |
|
2698 |
+
#: classes/ad_type_plain.php:130
|
2699 |
msgid "Execute shortcodes"
|
2700 |
msgstr ""
|
2701 |
|
2702 |
+
#: classes/ad_type_plain.php:133
|
2703 |
msgid "No shortcode detected in your code."
|
2704 |
msgstr ""
|
2705 |
|
2889 |
msgid "There is a new version of %1$s available. %2$sView version %3$s details%4$s or %5$supdate now%6$s."
|
2890 |
msgstr ""
|
2891 |
|
2892 |
+
#: classes/EDD_SL_Plugin_Updater.php:514
|
2893 |
msgid "You do not have permission to install plugin updates"
|
2894 |
msgstr ""
|
2895 |
|
2896 |
+
#: classes/EDD_SL_Plugin_Updater.php:514
|
2897 |
msgid "Error"
|
2898 |
msgstr ""
|
2899 |
|
3184 |
msgstr ""
|
3185 |
|
3186 |
#: modules/ad-blocker/admin/admin.php:150
|
3187 |
+
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:362
|
3188 |
msgid "Unable to connect to the filesystem. Please confirm your credentials."
|
3189 |
msgstr ""
|
3190 |
|
3283 |
msgid "The file was not created."
|
3284 |
msgstr ""
|
3285 |
|
3286 |
+
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:198
|
|
|
|
|
|
|
|
|
|
|
3287 |
msgid "Import & Replace"
|
3288 |
msgstr ""
|
3289 |
|
3290 |
+
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:200
|
3291 |
msgid "Move the content of the existing ads.txt file into Advanced Ads and remove it."
|
3292 |
msgstr ""
|
3293 |
|
3294 |
+
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:207
|
3295 |
#: modules/ads-txt/admin/views/setting-additional-content.php:4
|
3296 |
msgid "An error occured: %s."
|
3297 |
msgstr ""
|
3298 |
|
3299 |
#. translators: %s the line that may need to be added manually
|
3300 |
+
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:220
|
3301 |
msgid "If your site is located on a subdomain, you need to add the following line to the ads.txt file of the root domain: %s"
|
3302 |
msgstr ""
|
3303 |
|
3304 |
+
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:335
|
3305 |
msgid "The ads.txt is now managed with Advanced Ads."
|
3306 |
msgstr ""
|
3307 |
|
3308 |
+
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:380
|
3309 |
msgid "Not the main blog"
|
3310 |
msgstr ""
|
3311 |
|
3312 |
+
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:409
|
3313 |
msgid "Could not delete the existing ads.txt file"
|
3314 |
msgstr ""
|
3315 |
|
3316 |
+
#: modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php:412
|
3317 |
msgid "Could not find the existing ads.txt file"
|
3318 |
msgstr ""
|
3319 |
|
3959 |
msgstr ""
|
3960 |
|
3961 |
#: modules/import-export/views/page.php:24
|
3962 |
+
#: public/class-advanced-ads.php:710
|
3963 |
msgid "Groups"
|
3964 |
msgstr ""
|
3965 |
|
4044 |
msgid "Advanced Ads Error: %s"
|
4045 |
msgstr ""
|
4046 |
|
4047 |
+
#: public/class-advanced-ads.php:700
|
4048 |
msgctxt "ad group general name"
|
4049 |
msgid "Ad Groups & Rotations"
|
4050 |
msgstr ""
|
4051 |
|
4052 |
+
#: public/class-advanced-ads.php:702
|
4053 |
msgid "Search Ad Groups"
|
4054 |
msgstr ""
|
4055 |
|
4056 |
+
#: public/class-advanced-ads.php:703
|
4057 |
msgid "All Ad Groups"
|
4058 |
msgstr ""
|
4059 |
|
4060 |
+
#: public/class-advanced-ads.php:704
|
4061 |
msgid "Parent Ad Groups"
|
4062 |
msgstr ""
|
4063 |
|
4064 |
+
#: public/class-advanced-ads.php:705
|
4065 |
msgid "Parent Ad Groups:"
|
4066 |
msgstr ""
|
4067 |
|
4068 |
+
#: public/class-advanced-ads.php:706
|
4069 |
msgid "Edit Ad Group"
|
4070 |
msgstr ""
|
4071 |
|
4072 |
+
#: public/class-advanced-ads.php:707
|
4073 |
msgid "Update Ad Group"
|
4074 |
msgstr ""
|
4075 |
|
4076 |
+
#: public/class-advanced-ads.php:708
|
4077 |
msgid "Add New Ad Group"
|
4078 |
msgstr ""
|
4079 |
|
4080 |
+
#: public/class-advanced-ads.php:709
|
4081 |
msgid "New Ad Groups Name"
|
4082 |
msgstr ""
|
4083 |
|
4084 |
+
#: public/class-advanced-ads.php:711
|
4085 |
msgid "No Ad Group found"
|
4086 |
msgstr ""
|
4087 |
|
4088 |
+
#: public/class-advanced-ads.php:741
|
4089 |
msgid "Edit Ad"
|
4090 |
msgstr ""
|
4091 |
|
4092 |
+
#: public/class-advanced-ads.php:743
|
4093 |
msgid "View"
|
4094 |
msgstr ""
|
4095 |
|
4096 |
+
#: public/class-advanced-ads.php:744
|
4097 |
msgid "View the Ad"
|
4098 |
msgstr ""
|
4099 |
|
4100 |
+
#: public/class-advanced-ads.php:745
|
4101 |
msgid "Search Ads"
|
4102 |
msgstr ""
|
4103 |
|
4104 |
+
#: public/class-advanced-ads.php:746
|
4105 |
msgid "No Ads found"
|
4106 |
msgstr ""
|
4107 |
|
4108 |
+
#: public/class-advanced-ads.php:747
|
4109 |
msgid "No Ads found in Trash"
|
4110 |
msgstr ""
|
4111 |
|
4112 |
+
#: public/class-advanced-ads.php:748
|
4113 |
msgid "Parent Ad"
|
4114 |
msgstr ""
|
4115 |
|
4116 |
+
#: public/class-advanced-ads.php:887
|
4117 |
msgctxt "label above ads"
|
4118 |
msgid "Advertisements"
|
4119 |
msgstr ""
|
lib/composer/autoload_real.php
CHANGED
@@ -13,6 +13,9 @@ class ComposerAutoloaderInit_advanced_ads
|
|
13 |
}
|
14 |
}
|
15 |
|
|
|
|
|
|
|
16 |
public static function getLoader()
|
17 |
{
|
18 |
if (null !== self::$loader) {
|
13 |
}
|
14 |
}
|
15 |
|
16 |
+
/**
|
17 |
+
* @return \AdvancedAds\Autoload\ClassLoader
|
18 |
+
*/
|
19 |
public static function getLoader()
|
20 |
{
|
21 |
if (null !== self::$loader) {
|
modules/ad-blocker/admin/admin.php
CHANGED
@@ -9,21 +9,21 @@ class Advanced_Ads_Ad_Blocker_Admin
|
|
9 |
protected static $instance;
|
10 |
|
11 |
/**
|
12 |
-
*
|
13 |
*
|
14 |
* @var array (if loaded)
|
15 |
*/
|
16 |
protected $options;
|
17 |
|
18 |
/**
|
19 |
-
*
|
20 |
*
|
21 |
* @var string
|
22 |
*/
|
23 |
protected $search_file_pattern = '/(css|js|png|gif)$/';
|
24 |
|
25 |
/**
|
26 |
-
*
|
27 |
*
|
28 |
* @var string
|
29 |
*/
|
@@ -558,7 +558,7 @@ class Advanced_Ads_Ad_Blocker_Admin
|
|
558 |
}
|
559 |
|
560 |
/**
|
561 |
-
*
|
562 |
*/
|
563 |
function clear_assets() {
|
564 |
$advads_options = Advanced_Ads::get_instance()->options();
|
9 |
protected static $instance;
|
10 |
|
11 |
/**
|
12 |
+
* Module options
|
13 |
*
|
14 |
* @var array (if loaded)
|
15 |
*/
|
16 |
protected $options;
|
17 |
|
18 |
/**
|
19 |
+
* Pattern to search assets using preg_match. The string ends with .css/.js/.png/.gif
|
20 |
*
|
21 |
* @var string
|
22 |
*/
|
23 |
protected $search_file_pattern = '/(css|js|png|gif)$/';
|
24 |
|
25 |
/**
|
26 |
+
* Pattern to exclide directories from search. The string does not contain 'vendor/composer' or '/admin/' or /node_modules/
|
27 |
*
|
28 |
* @var string
|
29 |
*/
|
558 |
}
|
559 |
|
560 |
/**
|
561 |
+
* Clear assets (on uninstall)
|
562 |
*/
|
563 |
function clear_assets() {
|
564 |
$advads_options = Advanced_Ads::get_instance()->options();
|
modules/ad-blocker/classes/plugin.php
CHANGED
@@ -9,14 +9,14 @@ class Advanced_Ads_Ad_Blocker
|
|
9 |
protected static $instance;
|
10 |
|
11 |
/**
|
12 |
-
*
|
13 |
*
|
14 |
* @var array (if loaded)
|
15 |
*/
|
16 |
protected $options;
|
17 |
|
18 |
/**
|
19 |
-
*
|
20 |
*
|
21 |
* @var string
|
22 |
*/
|
9 |
protected static $instance;
|
10 |
|
11 |
/**
|
12 |
+
* Module options
|
13 |
*
|
14 |
* @var array (if loaded)
|
15 |
*/
|
16 |
protected $options;
|
17 |
|
18 |
/**
|
19 |
+
* Plugins directory URL
|
20 |
*
|
21 |
* @var string
|
22 |
*/
|
modules/ads-txt/admin/class-advanced-ads-ads-txt-admin.php
CHANGED
@@ -189,16 +189,6 @@ class Advanced_Ads_Ads_Txt_Admin {
|
|
189 |
) );
|
190 |
} else {
|
191 |
$notices[] = array( '', esc_html__( 'The file was not created.', 'advanced-ads' ) );
|
192 |
-
if ( Advanced_Ads_Checks::wp_engine_hosting() ) {
|
193 |
-
$notices[] = array( '',
|
194 |
-
sprintf(
|
195 |
-
// translators: %s is a service or plugin name.
|
196 |
-
'<strong>' . __( '%s detected.', 'advanced-ads' ) . '</strong>'
|
197 |
-
. ' <a href="' . ADVADS_URL . 'wp-engine-and-ads/#adstxt_not_showing_up">' . __( 'Find the solution here', 'advanced-ads' ) . '</a>',
|
198 |
-
'WP Engine'
|
199 |
-
)
|
200 |
-
);
|
201 |
-
}
|
202 |
}
|
203 |
|
204 |
if ( $file['is_third_party'] ) {
|
189 |
) );
|
190 |
} else {
|
191 |
$notices[] = array( '', esc_html__( 'The file was not created.', 'advanced-ads' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
192 |
}
|
193 |
|
194 |
if ( $file['is_third_party'] ) {
|
modules/gadsense/includes/class-adsense-report.php
CHANGED
@@ -19,7 +19,7 @@ class Advanced_Ads_Adsense_Dimensional_Data{
|
|
19 |
|
20 |
}
|
21 |
/**
|
22 |
-
*
|
23 |
* after a report has been requested
|
24 |
* this holds all the plot & trace info
|
25 |
*/
|
@@ -29,7 +29,7 @@ class Advanced_Ads_Adsense_Report_Response{
|
|
29 |
|
30 |
class Advanced_Ads_AdSense_Report_Builder{
|
31 |
/**
|
32 |
-
*
|
33 |
* of the adsense server will be valid.
|
34 |
*/
|
35 |
const TRANSIENT_VALIDITY = HOUR_IN_SECONDS;
|
@@ -78,7 +78,7 @@ class Advanced_Ads_AdSense_Report_Builder{
|
|
78 |
return $url;
|
79 |
}
|
80 |
/**
|
81 |
-
*
|
82 |
*/
|
83 |
public function getIdentifier(){
|
84 |
$id = "advanced_ads_adsense_report_";
|
@@ -200,7 +200,7 @@ class Advanced_Ads_AdSense_Report_Builder{
|
|
200 |
}
|
201 |
|
202 |
/**
|
203 |
-
*
|
204 |
*/
|
205 |
public static function createDashboardSummary($secondary_dimension_name = "DOMAIN_NAME", $filter_value = null, $overwrite_dt_identifier = null, $optional_dimension_names = null, $force_refresh = false, $allow_refresh = true){
|
206 |
$builder = new Advanced_Ads_AdSense_Report_Builder();
|
19 |
|
20 |
}
|
21 |
/**
|
22 |
+
* Represents the response that will be sent to the javascript frontend
|
23 |
* after a report has been requested
|
24 |
* this holds all the plot & trace info
|
25 |
*/
|
29 |
|
30 |
class Advanced_Ads_AdSense_Report_Builder{
|
31 |
/**
|
32 |
+
* This determines the time in seconds a transient or option representing the response
|
33 |
* of the adsense server will be valid.
|
34 |
*/
|
35 |
const TRANSIENT_VALIDITY = HOUR_IN_SECONDS;
|
78 |
return $url;
|
79 |
}
|
80 |
/**
|
81 |
+
* Generate an identifier that will be used to store and retrieve transients.
|
82 |
*/
|
83 |
public function getIdentifier(){
|
84 |
$id = "advanced_ads_adsense_report_";
|
200 |
}
|
201 |
|
202 |
/**
|
203 |
+
* A quick way to create a dashboard summary.
|
204 |
*/
|
205 |
public static function createDashboardSummary($secondary_dimension_name = "DOMAIN_NAME", $filter_value = null, $overwrite_dt_identifier = null, $optional_dimension_names = null, $force_refresh = false, $allow_refresh = true){
|
206 |
$builder = new Advanced_Ads_AdSense_Report_Builder();
|
modules/gadsense/includes/class-mapi.php
CHANGED
@@ -956,7 +956,7 @@ class Advanced_Ads_AdSense_MAPI {
|
|
956 |
}
|
957 |
} else {
|
958 |
/**
|
959 |
-
*
|
960 |
*/
|
961 |
$response = $units;
|
962 |
}
|
@@ -1377,7 +1377,7 @@ class Advanced_Ads_AdSense_MAPI {
|
|
1377 |
}
|
1378 |
|
1379 |
/**
|
1380 |
-
*
|
1381 |
*/
|
1382 |
public static function save_token_from_data( $token, $details, $args = array() ) {
|
1383 |
|
@@ -1553,7 +1553,7 @@ class Advanced_Ads_AdSense_MAPI {
|
|
1553 |
}
|
1554 |
|
1555 |
/**
|
1556 |
-
*
|
1557 |
* @param $reason string the reason from the response's error
|
1558 |
* @return string|void if there is a hint for this reason, a string containing the hint will be returned.
|
1559 |
*/
|
956 |
}
|
957 |
} else {
|
958 |
/**
|
959 |
+
* Return the error info [arr]
|
960 |
*/
|
961 |
$response = $units;
|
962 |
}
|
1377 |
}
|
1378 |
|
1379 |
/**
|
1380 |
+
* Save token obtained from confirmation code
|
1381 |
*/
|
1382 |
public static function save_token_from_data( $token, $details, $args = array() ) {
|
1383 |
|
1553 |
}
|
1554 |
|
1555 |
/**
|
1556 |
+
* Get a hint for an error object that was received from AdSense
|
1557 |
* @param $reason string the reason from the response's error
|
1558 |
* @return string|void if there is a hint for this reason, a string containing the hint will be returned.
|
1559 |
*/
|
modules/gadsense/public/public.php
CHANGED
@@ -63,7 +63,7 @@ class Advanced_Ads_AdSense_Public {
|
|
63 |
}
|
64 |
|
65 |
/**
|
66 |
-
*
|
67 |
*
|
68 |
* @since 1.6.9
|
69 |
*/
|
63 |
}
|
64 |
|
65 |
/**
|
66 |
+
* Inject page-level header code
|
67 |
*
|
68 |
* @since 1.6.9
|
69 |
*/
|
modules/gutenberg/includes/class-gutenberg.php
CHANGED
@@ -27,7 +27,7 @@ class Advanced_Ads_Gutenberg {
|
|
27 |
}
|
28 |
|
29 |
/**
|
30 |
-
*
|
31 |
*/
|
32 |
public function register_scripts() {
|
33 |
if ( !function_exists( 'register_block_type' ) ) {
|
27 |
}
|
28 |
|
29 |
/**
|
30 |
+
* Register back end scripts
|
31 |
*/
|
32 |
public function register_scripts() {
|
33 |
if ( !function_exists( 'register_block_type' ) ) {
|
modules/import-export/classes/export.php
CHANGED
@@ -6,7 +6,7 @@ class Advanced_Ads_Export {
|
|
6 |
private static $instance;
|
7 |
|
8 |
/**
|
9 |
-
*
|
10 |
*/
|
11 |
private $messages = array();
|
12 |
|
6 |
private static $instance;
|
7 |
|
8 |
/**
|
9 |
+
* Status messages
|
10 |
*/
|
11 |
private $messages = array();
|
12 |
|
modules/import-export/classes/import.php
CHANGED
@@ -6,17 +6,17 @@ class Advanced_Ads_Import {
|
|
6 |
private static $instance;
|
7 |
|
8 |
/**
|
9 |
-
*
|
10 |
*/
|
11 |
private $import_id;
|
12 |
|
13 |
/**
|
14 |
-
*
|
15 |
*/
|
16 |
private $messages = array();
|
17 |
|
18 |
/**
|
19 |
-
*
|
20 |
*/
|
21 |
public $imported_data = array(
|
22 |
'ads' => array(),
|
@@ -30,7 +30,7 @@ class Advanced_Ads_Import {
|
|
30 |
private $created_groups = array();
|
31 |
|
32 |
/**
|
33 |
-
*
|
34 |
*/
|
35 |
private $created_attachments = array();
|
36 |
|
6 |
private static $instance;
|
7 |
|
8 |
/**
|
9 |
+
* Uploaded XML file path
|
10 |
*/
|
11 |
private $import_id;
|
12 |
|
13 |
/**
|
14 |
+
* Status messages
|
15 |
*/
|
16 |
private $messages = array();
|
17 |
|
18 |
/**
|
19 |
+
* Imported data mapped with previous data, e.g. ['ads'][ new_ad_id => old_ad_id (or null if does not exist) ]
|
20 |
*/
|
21 |
public $imported_data = array(
|
22 |
'ads' => array(),
|
30 |
private $created_groups = array();
|
31 |
|
32 |
/**
|
33 |
+
* Attachments, created for Image Ads and images in ad content
|
34 |
*/
|
35 |
private $created_attachments = array();
|
36 |
|
modules/import-export/views/page.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
*
|
4 |
*/
|
5 |
|
6 |
class_exists( 'Advanced_Ads', false ) || exit();
|
1 |
<?php
|
2 |
/**
|
3 |
+
* The view for the import & export page
|
4 |
*/
|
5 |
|
6 |
class_exists( 'Advanced_Ads', false ) || exit();
|
modules/privacy/admin/admin.php
CHANGED
@@ -10,7 +10,7 @@ class Advanced_Ads_Privacy_Admin
|
|
10 |
protected static $instance;
|
11 |
|
12 |
/**
|
13 |
-
*
|
14 |
*
|
15 |
* @var array (if loaded)
|
16 |
*/
|
@@ -47,7 +47,7 @@ class Advanced_Ads_Privacy_Admin
|
|
47 |
}
|
48 |
|
49 |
/**
|
50 |
-
*
|
51 |
*
|
52 |
* @since 1.8.30
|
53 |
* @param arr $tabs existing setting tabs
|
@@ -67,7 +67,7 @@ class Advanced_Ads_Privacy_Admin
|
|
67 |
}
|
68 |
|
69 |
/**
|
70 |
-
*
|
71 |
*
|
72 |
* @param string $hook settings page hook
|
73 |
*/
|
@@ -102,7 +102,7 @@ class Advanced_Ads_Privacy_Admin
|
|
102 |
|
103 |
|
104 |
/**
|
105 |
-
*
|
106 |
*/
|
107 |
public function render_settings_section() {
|
108 |
|
@@ -131,7 +131,7 @@ class Advanced_Ads_Privacy_Admin
|
|
131 |
}
|
132 |
|
133 |
/**
|
134 |
-
*
|
135 |
*
|
136 |
* @param obj $ad ad object
|
137 |
* @param arr $types ad types
|
10 |
protected static $instance;
|
11 |
|
12 |
/**
|
13 |
+
* Module options
|
14 |
*
|
15 |
* @var array (if loaded)
|
16 |
*/
|
47 |
}
|
48 |
|
49 |
/**
|
50 |
+
* Add tracking settings tab
|
51 |
*
|
52 |
* @since 1.8.30
|
53 |
* @param arr $tabs existing setting tabs
|
67 |
}
|
68 |
|
69 |
/**
|
70 |
+
* Add settings to settings page
|
71 |
*
|
72 |
* @param string $hook settings page hook
|
73 |
*/
|
102 |
|
103 |
|
104 |
/**
|
105 |
+
* Render settings section
|
106 |
*/
|
107 |
public function render_settings_section() {
|
108 |
|
131 |
}
|
132 |
|
133 |
/**
|
134 |
+
* Add options to ad edit page
|
135 |
*
|
136 |
* @param obj $ad ad object
|
137 |
* @param arr $types ad types
|
modules/privacy/classes/plugin.php
CHANGED
@@ -9,14 +9,14 @@ class Advanced_Ads_Privacy
|
|
9 |
protected static $instance;
|
10 |
|
11 |
/**
|
12 |
-
*
|
13 |
*
|
14 |
* @var array (if loaded)
|
15 |
*/
|
16 |
protected $options;
|
17 |
|
18 |
/**
|
19 |
-
*
|
20 |
*
|
21 |
* @const array
|
22 |
*/
|
9 |
protected static $instance;
|
10 |
|
11 |
/**
|
12 |
+
* Module options
|
13 |
*
|
14 |
* @var array (if loaded)
|
15 |
*/
|
16 |
protected $options;
|
17 |
|
18 |
/**
|
19 |
+
* Option key
|
20 |
*
|
21 |
* @const array
|
22 |
*/
|
public/class-advanced-ads.php
CHANGED
@@ -483,6 +483,11 @@ class Advanced_Ads {
|
|
483 |
return $content;
|
484 |
}
|
485 |
|
|
|
|
|
|
|
|
|
|
|
486 |
// check if admin allows injection in all places.
|
487 |
if ( ! isset( $options['content-injection-everywhere'] ) || 0 === $options['content-injection-everywhere'] ) {
|
488 |
// check if this is a singular page within the loop or an AMP page.
|
483 |
return $content;
|
484 |
}
|
485 |
|
486 |
+
// Do not inject on admin pages.
|
487 |
+
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) {
|
488 |
+
return $content;
|
489 |
+
}
|
490 |
+
|
491 |
// check if admin allows injection in all places.
|
492 |
if ( ! isset( $options['content-injection-everywhere'] ) || 0 === $options['content-injection-everywhere'] ) {
|
493 |
// check if this is a singular page within the loop or an AMP page.
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: ads, ad manager, ad rotation, adsense, banner
|
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 5.4
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -96,7 +96,7 @@ serve ads by conditions based on the visitor. [List of all visitor conditions](h
|
|
96 |
|
97 |
Placements to insert ads in pre-defined positions in your theme and content. [List of all placements](https://wpadvancedads.com/manual/placements/)
|
98 |
|
99 |
-
* ads after any given paragraph or
|
100 |
* ads at the top or bottom of the post content
|
101 |
* ads before closing `</head>` tag
|
102 |
* ads in the footer
|
@@ -305,6 +305,16 @@ Yes. Advanced Ads is built on WordPress standards and therefore easily customiza
|
|
305 |
|
306 |
== Changelog ==
|
307 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
= 1.17.12 =
|
309 |
|
310 |
* set default name for ads where none was given
|
@@ -405,294 +415,4 @@ Yes. Advanced Ads is built on WordPress standards and therefore easily customiza
|
|
405 |
* fixed missing index issue on 404 pages for logged-in admins
|
406 |
* fixed AJAX/PHP error 403 on Settings page
|
407 |
* fixed layout issue that happened when "If>So Dynamic Content" plugin was active
|
408 |
-
* prevented Ad label from taking height of fixed sized AdSense ads
|
409 |
-
|
410 |
-
= 1.15 =
|
411 |
-
|
412 |
-
* please enable the new content injection method under Advanced Ads > Settings > General > Content Injection > Use new injection logic
|
413 |
-
* rewritten content injection to prevent HTML markup modifications
|
414 |
-
* rewritten code for Display and Visitor Condition form fields on ad edit pages
|
415 |
-
* allow to replace existing ads.txt file with the option provided by Advanced Ads
|
416 |
-
* prevented duplicated SQL query when a group contains no ads
|
417 |
-
* added warning for WP AutoTerms plugin, which prevents ads from showing on category archive pages
|
418 |
-
|
419 |
-
= 1.14.11 =
|
420 |
-
|
421 |
-
* moved placement form above the list of existing placements
|
422 |
-
* made "ads.txt" file available before the Settings page is saved
|
423 |
-
* removed leading and trailing spaces from privacy options to prevent accidental misconfiguration
|
424 |
-
* implementing coding standards in a few backend files
|
425 |
-
* fixed welcome panel not showing up
|
426 |
-
* fix for plugins using the "pre_option_upload_path" or "pre_option_upload_url_path" filters
|
427 |
-
|
428 |
-
= 1.14.10 =
|
429 |
-
|
430 |
-
* creating unique slugs for the ad post type in order to prevent conflicts like found with Beaver Builder
|
431 |
-
* added option to disable AdSense stats in the backend
|
432 |
-
* fixed conflicts when $ (jQuery) was not available
|
433 |
-
* fixed potential JS conflict in Wizard script
|
434 |
-
* added a warning suggesting to install "dom" extension in order to use "Content" placement
|
435 |
-
|
436 |
-
= 1.14.9 =
|
437 |
-
|
438 |
-
* fixed deprecated notices causing a warning
|
439 |
-
* fixed possible missing class error
|
440 |
-
* replaced AdSense in widgets with dummy ads on Elementor preview pages to prevent issues
|
441 |
-
* removed unneeded warning about early called `advads_is_amp` function
|
442 |
-
|
443 |
-
= 1.14.8 =
|
444 |
-
|
445 |
-
* replaced AdSense with dummy ads on Customizer and Elementor preview pages to prevent issues
|
446 |
-
* make text fields in Advanced Ads settings fully resizable
|
447 |
-
* removed unneeded ads.txt warning on com.br domains
|
448 |
-
|
449 |
-
= 1.14.7 =
|
450 |
-
|
451 |
-
* allow "Footer code" and "Sidebar Widget" placements on AMP pages created by the official AMP plugin
|
452 |
-
* prevented AMP warnings on XMLRPC requests
|
453 |
-
* removed unused debug function
|
454 |
-
|
455 |
-
= 1.14.6 =
|
456 |
-
|
457 |
-
* fixed frontend issue showing for admins if the HEAD placement is used
|
458 |
-
|
459 |
-
= 1.14.5 =
|
460 |
-
|
461 |
-
* sanitize Container ID option on save and warn about wrong format
|
462 |
-
* made Placements page work when another plugin includes Twitter Bootstrap
|
463 |
-
* updated missing ads.txt warning
|
464 |
-
* disabled Privacy module on AMP pages so that the Google AMP cache shows them
|
465 |
-
* fixed warnings for some features on AMP pages
|
466 |
-
* fixed suggestion to switch Auto ads code in plain text ad type to AdSense ad type
|
467 |
-
|
468 |
-
= 1.14.4 =
|
469 |
-
|
470 |
-
* fixed JavaScript issue on ad edit pages
|
471 |
-
|
472 |
-
= 1.14.3 =
|
473 |
-
|
474 |
-
* allow adding ads to newsletter emails created in MailPoet using the shortcode `[custom:ad:AD_ID]` in the email template
|
475 |
-
* prevented error when Piklist plugin is used
|
476 |
-
* fixed JS error on post edit pages that had no real consequences
|
477 |
-
* minor fixes to licensing settings (Pro only)
|
478 |
-
|
479 |
-
= 1.14.2 =
|
480 |
-
|
481 |
-
* preparations for [Advanced Ads Pro](https://wpadvancedads.com/add-ons/advanced-ads-pro/) 2.4.2
|
482 |
-
* fixed time zone difference in AdSense reporting
|
483 |
-
* fixed script dependency in the backend
|
484 |
-
|
485 |
-
= 1.14.1 =
|
486 |
-
|
487 |
-
* fixed issue with PHP 5.2 (please update to PHP 5.6.20 since it is the minimum requirement of WordPress)
|
488 |
-
* fixed potential conflict with ClassiPress ad categories
|
489 |
-
* prevented user interface from looking broken when Twitter Bootstrap is added by another source
|
490 |
-
|
491 |
-
= 1.14 =
|
492 |
-
|
493 |
-
* rewrite of AdSense code logic. Please reach out through https://wpadvancedads.com/support/ if you discover any issues
|
494 |
-
* show AdSense revenue in WP Admin
|
495 |
-
* removed parent ad group option since it was never used by Advanced Ads
|
496 |
-
* made newly installed Advanced Ads work correctly with Q2W3 Fixed Widget
|
497 |
-
|
498 |
-
= 1.13.8 =
|
499 |
-
|
500 |
-
* prevented warning about missing ads.txt file when the file exists
|
501 |
-
* added a hint about solving ads.txt issue on WP Engine platform
|
502 |
-
* allow to translate Ad Label option if WPML String Translation is used
|
503 |
-
* fixed Ad Health notices showing also ignored issues when adding a new notice
|
504 |
-
* inject ads in the outermost `the_content` when they may have been injected in an inner `the_content`
|
505 |
-
* added chain of nested `the_content` filters to `debug.log` to allow reasoning about possible issues
|
506 |
-
|
507 |
-
= 1.13.7 =
|
508 |
-
|
509 |
-
* set `ADVANCED_ADS_DISABLE_EDIT_BAR` to disable frontend edit bar
|
510 |
-
* set better default data for new AdSense ads
|
511 |
-
* when `the_content` filters are nested, use the outermost one to inject ads
|
512 |
-
* hide certain notices for a longer period even if they stay valid
|
513 |
-
* removed notice about plugin updates since WP 5.2 handles this now
|
514 |
-
* removed notice about website being hosted on wp.com
|
515 |
-
* honor "Hide ads for user roles" and "Hide ads from bots" settings when displaying AdSense verification code & Auto ads
|
516 |
-
* prevented some attachment pages containing ads from being indexed
|
517 |
-
|
518 |
-
= 1.13.6 =
|
519 |
-
|
520 |
-
* fixed missing index issue raised when Tracking settings never were saved
|
521 |
-
|
522 |
-
= 1.13.5 =
|
523 |
-
|
524 |
-
* option to hide ads by user role does now show all registered roles
|
525 |
-
* prevented possible JavaScript error in Ad Health
|
526 |
-
* updated minimum PHP version check to warn below PHP 5.6.20
|
527 |
-
* exclude LiteSpeed Cache bot from bot detection
|
528 |
-
* fixed Ad Health notices with invalid ID
|
529 |
-
|
530 |
-
= 1.13.4 =
|
531 |
-
|
532 |
-
* improved compatibility with WPML
|
533 |
-
* improved errors given when no ad units were found in the AdSense account
|
534 |
-
* improved UI when hiding ad health notices
|
535 |
-
* fixed issue when logging the AdSense Hidden problem
|
536 |
-
* fixed issue on ad filter list when two terms with the same slug exist
|
537 |
-
* fixed unlikely case of an SQL error on ad overview page
|
538 |
-
* fixed issue with Ad Health bar in frontend when jQuery was not found
|
539 |
-
* added a link to ads.txt settings from AdSense warning about missing ads.txt file
|
540 |
-
* removed unneeded ads.txt warning on com.au domains
|
541 |
-
|
542 |
-
= 1.13.3 =
|
543 |
-
|
544 |
-
* added link to get help in some error notices
|
545 |
-
* fixed error caused by ads.txt module on multisites that use WordPress lower then 5.1
|
546 |
-
* fixed compatibility with Gutenberg plugin
|
547 |
-
|
548 |
-
= 1.13.2 =
|
549 |
-
|
550 |
-
* added AdSense ad slot ID to "AdSense hidden" warning
|
551 |
-
* improved ads.txt test for existing files and other problems
|
552 |
-
* fixed broken link preventing the Privacy settings from working
|
553 |
-
|
554 |
-
= 1.13.1 =
|
555 |
-
|
556 |
-
* fixed issue with PHP 7.1 and higher
|
557 |
-
|
558 |
-
= 1.13 =
|
559 |
-
|
560 |
-
* added support for 'ads.txt'
|
561 |
-
* added option to disable Google Auto ads anchor ads at the top of the page
|
562 |
-
* prevented attachment content from being shown next to Rich Content ads on attachment pages
|
563 |
-
* allow to hide "Ads are disabled" warning
|
564 |
-
* added AdSense connection errors to notifications
|
565 |
-
* remove hidden notices if resolved
|
566 |
-
* load notices box without JavaScript
|
567 |
-
* stop content injection into wp_router pages when ads are disabled on secondary queries
|
568 |
-
* introduced `advanced-ads-max-ad-weight` filter to allow manipulating the available ad weight
|
569 |
-
|
570 |
-
= 1.12 =
|
571 |
-
|
572 |
-
* new ad health notification logic in WP Admin to show notifications and critical issues at one place
|
573 |
-
* disable Ad Health in frontend and backend using the existing "Disable Notices" option, now called "Disable Ad Health and other notices"
|
574 |
-
* prevented ad injection into excerpts
|
575 |
-
* reordered settings page
|
576 |
-
|
577 |
-
= 1.11.2 =
|
578 |
-
|
579 |
-
* removed "Limit to 3 AdSense ads" option for users who don‘t have it enabled since AdSense no longer has such a rule
|
580 |
-
* fixed filtering by ad groups on the ad list
|
581 |
-
* hide ad blocker checking code when not needed
|
582 |
-
|
583 |
-
= 1.11.1 =
|
584 |
-
|
585 |
-
* fixed AdSense code field not working if AdSense connection is missing
|
586 |
-
|
587 |
-
= 1.11 =
|
588 |
-
|
589 |
-
* improved the AdSense onboarding process
|
590 |
-
* hide idle ads in the ads list loaded from the AdSense server
|
591 |
-
* don’t inject ads into content when ads are disabled on Secondary Queries (problem caused by Similar Posts plugin)
|
592 |
-
* limited Edit-button in the frontend to ads with a container around them
|
593 |
-
* fixed issue caused by browsers with a default ad blocker
|
594 |
-
* fixed ad group filter on the ad overview page not appearing
|
595 |
-
* fixed "Ad block counter" being needed to display ads for ad blockers
|
596 |
-
* compatibility with the "Render Blocking JS" option of the WP Fastest Cache plugin
|
597 |
-
* added clearfix option to fix possible layout issue with all types of AdSense responsive ads
|
598 |
-
* use same URL field for Tracking and basic plugin
|
599 |
-
* Sticky Ads: fixed incorrect centering when parent element begins lower
|
600 |
-
|
601 |
-
= 1.10.12 =
|
602 |
-
|
603 |
-
* added function that allows Advanced Ads Pro to prevent script optimizing plugins to break ad codes
|
604 |
-
* fixed JS conflict for plain text ads using PHP or shortcodes
|
605 |
-
|
606 |
-
= 1.10.11 =
|
607 |
-
|
608 |
-
* added `advanced-ads-frontend-prefix` to adjust the frontend prefix dynamically
|
609 |
-
* placement position set to center does cause selected ad to be placed to the left
|
610 |
-
* fix ads within multiple groups not being saved
|
611 |
-
* made compatible with improved cache-busting in Advanced Ads Pro 2.3
|
612 |
-
|
613 |
-
= 1.10.10 =
|
614 |
-
|
615 |
-
* new ad block works with WordPress 5.0
|
616 |
-
* show hint when shortcode or PHP options are enabled, but not needed
|
617 |
-
* fixed long group pages not being saved
|
618 |
-
|
619 |
-
= 1.10.9 =
|
620 |
-
|
621 |
-
* fixed AdSense Auto ads check in the Ad Health bar giving false positives
|
622 |
-
|
623 |
-
= 1.10.8 =
|
624 |
-
|
625 |
-
* show hint if Auto ads are enabled
|
626 |
-
* allow responsive Adsense ads with custom sizes to be floated
|
627 |
-
* show an advice if user does not have permissions to edit ads
|
628 |
-
* fixed AdSense key overlay not accepting copy&paste in Safari and Firefox
|
629 |
-
|
630 |
-
= 1.10.7 =
|
631 |
-
|
632 |
-
* reverted code optimization that broke some forms
|
633 |
-
|
634 |
-
= 1.10.6 =
|
635 |
-
|
636 |
-
* fixed HTML issue with paragraph index when saving the placement page
|
637 |
-
|
638 |
-
= 1.10.5 =
|
639 |
-
|
640 |
-
* improved list of ads imported from AdSense account
|
641 |
-
* use width and height ad settings for image ads if they differ from the entered sizes
|
642 |
-
* added option column with shortcode to the ad list. It is optional. Go to "Screen Options" at the top right of the ad list page to enable it
|
643 |
-
* show warning if AdSense Auto ads code is used in ad code field
|
644 |
-
* added a warning if Advanced Ads constants are enabled
|
645 |
-
* prevented possible JavaScript error created by the Privacy module
|
646 |
-
* extended "Transparent Background" option for AdSense to fix a border they have in some themes
|
647 |
-
* removed ad block counter code when not used
|
648 |
-
* updated add-on updater class
|
649 |
-
* added a warning about floated responsive AdSense ads
|
650 |
-
|
651 |
-
= 1.10.4 =
|
652 |
-
|
653 |
-
* fixed posts instead of ads showing up on the ad overview list caused by 15zine theme
|
654 |
-
* fixed translation issue that caused Italian sites to not save ads properly
|
655 |
-
* removed unneeded language files since they are now hosted on wp.org
|
656 |
-
|
657 |
-
= 1.10.3 =
|
658 |
-
|
659 |
-
* removed filter for paginated ad list since it was unintentionally broken by third-party plugins
|
660 |
-
* fixed compatibility with Q2W3 Fixed Widget that gone missing with last update
|
661 |
-
|
662 |
-
= 1.10.2 =
|
663 |
-
|
664 |
-
* fixed issue with JNews theme which produced a widget ID that is blockable by ad blockers
|
665 |
-
* fixed second page on ads overview showing the same results as the first
|
666 |
-
* fixed issue that caused some items to vanish on admin pages without screen ID
|
667 |
-
|
668 |
-
= 1.10.1 =
|
669 |
-
|
670 |
-
* fixed issue caused by wrongly registered third party taxonomies
|
671 |
-
* fixed conflict on ad list with plugins going an extra query, e.g., Elementor
|
672 |
-
* added PHP version check to new AdSense connector (5.4)
|
673 |
-
|
674 |
-
= 1.10 =
|
675 |
-
|
676 |
-
* added AdSense integration
|
677 |
-
* added sub menus to setting pages
|
678 |
-
* added name to taxonomies in Display Conditions if the same label is repeated
|
679 |
-
* added clearfix option to fix possible layout issue with AdSense responsive ads
|
680 |
-
* removed title attribute from image ads
|
681 |
-
* plugin update warning now only appears for Advanced Ads plugin and add-ons
|
682 |
-
* rewritten filters on ad list to work with all ads not just those on the current page
|
683 |
-
* allowed to create new placement with same name
|
684 |
-
* fixed issue with license activations on sites using the Multilanguage by BestWebSoft plugin
|
685 |
-
* fixed duplicate queries in backend
|
686 |
-
* fixed possible conflict between assets created by the Ad Blocker module
|
687 |
-
* WP Rocket: compatibility with the recent version of deferred JavaScript
|
688 |
-
|
689 |
-
[Changelog Archive](https://wpadvancedads.com/codex/changelog-archive/)
|
690 |
-
|
691 |
-
== Upgrade Notice ==
|
692 |
-
|
693 |
-
= 1.15 =
|
694 |
-
|
695 |
-
We have rewritten the content injection method. For the next weeks, new users opt in by default, existing ones need to opt in manually.
|
696 |
-
As existing user, please enable the new content injection method under Advanced Ads > Settings > General > Content Injection > Use new injection logic.
|
697 |
-
|
698 |
-
Please report any issues.
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 5.4
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 1.18.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
96 |
|
97 |
Placements to insert ads in pre-defined positions in your theme and content. [List of all placements](https://wpadvancedads.com/manual/placements/)
|
98 |
|
99 |
+
* ads after any given paragraph, headline, image, or other HTML element
|
100 |
* ads at the top or bottom of the post content
|
101 |
* ads before closing `</head>` tag
|
102 |
* ads in the footer
|
305 |
|
306 |
== Changelog ==
|
307 |
|
308 |
+
= 1.18.0 =
|
309 |
+
|
310 |
+
* inject ads automatically based on div, table, quotes, iframe, and other HTML tags
|
311 |
+
* define your own injection rules using the new "custom" option for the Content placement
|
312 |
+
* hide Shortcode button in TinyMCE editor by default for new users
|
313 |
+
* added `advanced-ads-options` filter for main plugin options
|
314 |
+
* prevent automatic ad injection into paragraphs within blockquotes
|
315 |
+
* hide placement options after publishing an ad translated with WPML
|
316 |
+
* disallowed ad insertion into the header of the WP File Manager's admin page
|
317 |
+
|
318 |
= 1.17.12 =
|
319 |
|
320 |
* set default name for ads where none was given
|
415 |
* fixed missing index issue on 404 pages for logged-in admins
|
416 |
* fixed AJAX/PHP error 403 on Settings page
|
417 |
* fixed layout issue that happened when "If>So Dynamic Content" plugin was active
|
418 |
+
* prevented Ad label from taking height of fixed sized AdSense ads
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|