Changeset 3243698
- Timestamp:
- 02/20/2025 08:10:11 AM (10 months ago)
- Location:
- advanced-ads-adsense-in-feed
- Files:
-
- 4 edited
- 1 copied
-
tags/1.1.4 (copied) (copied from advanced-ads-adsense-in-feed/trunk)
-
tags/1.1.4/advanced-ads-in-feed.php (modified) (6 diffs)
-
tags/1.1.4/readme.txt (modified) (2 diffs)
-
trunk/advanced-ads-in-feed.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-ads-adsense-in-feed/tags/1.1.4/advanced-ads-in-feed.php
r2892716 r3243698 4 4 * Plugin URI: https://wpadvancedads.com 5 5 * Description: Display AdSense In-feed ads between posts 6 * Version: 1.1. 36 * Version: 1.1.4 7 7 * Author: Advanced Ads 8 8 * Author URI: https://wpadvancedads.com … … 17 17 } 18 18 19 define( 'AAIF_FILE', __FILE__ ); 20 define( 'AAIF_VERSION', '1.1.4' ); 21 19 22 /** 20 23 * Class Advanced_Ads_In_Feed … … 44 47 add_action( 'advanced-ads-placement-options-after', array( $this, 'placement_options' ), 11, 2 ); 45 48 } 46 47 49 48 50 /** … … 88 90 * 89 91 * @since 1.0 90 *91 92 */ 92 93 public function inject_in_feed( $post, $wp_query = null ) { 93 if ( ! $wp_query instanceof WP_Query 94 || is_feed() 95 || is_admin() 96 || $wp_query->is_singular() 97 || ! $wp_query->in_the_loop 98 || ! isset( $wp_query->current_post ) 99 || ! $wp_query->is_main_query() ) { 94 if ( 95 ! $wp_query instanceof WP_Query || is_feed() || 96 is_admin() || $wp_query->is_singular() || ! $wp_query->in_the_loop || 97 ! isset( $wp_query->current_post ) || ! $wp_query->is_main_query() 98 ) { 100 99 return; 101 100 } … … 147 146 // load the ad. 148 147 $ad = new Advanced_Ads_Ad( $_item[1] ); 149 if ( isset( $ad->type ) 150 && 'adsense' === $ad->type 151 && isset( $ad->content ) 152 && strpos( $ad->content, 'in-feed' ) ) { 148 if ( 149 isset( $ad->type ) && 'adsense' === $ad->type 150 && isset( $ad->content ) 151 && strpos( $ad->content, 'in-feed' ) 152 ) { 153 153 return true; 154 154 } … … 229 229 } 230 230 } 231 232 231 } 233 232 234 new Advanced_Ads_In_Feed(); 233 /** 234 * Halt code remove with new release. 235 * 236 * @return void 237 */ 238 function wp_advads_in_feed_halt_code() { 239 global $advads_halt_notices; 240 241 // Early bail!! 242 if ( ! defined( 'ADVADS_VERSION' ) ) { 243 return; 244 } 245 246 if ( version_compare( ADVADS_VERSION, '2.0.0', '>=' ) ) { 247 if ( ! isset( $advads_halt_notices ) ) { 248 $advads_halt_notices = []; 249 } 250 $advads_halt_notices[] = __( 'Advanced Ads – Google AdSense In-feed Placement', 'advanced-ads-adsense-in-feed' ); 251 252 add_action( 253 'all_admin_notices', 254 static function () { 255 global $advads_halt_notices; 256 257 // Early bail!! 258 if ( 'plugins' === get_current_screen()->base || empty( $advads_halt_notices ) ) { 259 return; 260 } 261 ?> 262 <div class="notice notice-error"> 263 <h2><?php esc_html_e( 'Important Notice', 'advanced-ads-adsense-in-feed' ); ?></h2> 264 <p> 265 <?php 266 echo wp_kses_post( 267 sprintf( 268 /* translators: %s: Plugin name */ 269 __( 'Your versions of the Advanced Ads addons listed below are incompatible with <strong>Advanced Ads 2.0</strong> and have been deactivated. Please update them to their latest version. If you cannot update, e.g., due to an expired license, you can <a href="%1$s">roll back to a compatible version of the Advanced Ads plugin</a> at any time or <a href="%2$s">renew your license</a>.', 'advanced-ads-adsense-in-feed' ), 270 esc_url( admin_url( 'admin.php?page=advanced-ads-tools&sub_page=version' ) ), 271 'https://wpadvancedads.com/account/#h-licenses' 272 ) 273 ) 274 ?> 275 </p> 276 <h3><?php esc_html_e( 'The following addons are affected:', 'advanced-ads-adsense-in-feed' ); ?></h3> 277 <ul> 278 <?php foreach ( $advads_halt_notices as $notice ) : ?> 279 <li><strong><?php echo esc_html( $notice ); ?></strong></li> 280 <?php endforeach; ?> 281 </ul> 282 </div> 283 <?php 284 $advads_halt_notices = []; 285 } 286 ); 287 288 add_action( 289 'after_plugin_row_' . plugin_basename( __FILE__ ), 290 static function () { 291 echo '<tr class="active"><td colspan="5" class="plugin-update colspanchange">'; 292 wp_admin_notice( 293 sprintf( 294 /* translators: %s: Plugin name */ 295 __( 'Your version of <strong>Advanced Ads – Google AdSense In-feed Placement</strong> is incompatible with <strong>Advanced Ads 2.0</strong> and has been deactivated. Please update the plugin to the latest version. If you cannot update the plugin, e.g., due to an expired license, you can <a href="%1$s">roll back to a compatible version of the Advanced Ads plugin</a> at any time or <a href="%2$s">renew your license</a>.', 'advanced-ads-pro' ), 296 esc_url( admin_url( 'admin.php?page=advanced-ads-tools&sub_page=version' ) ), 297 'https://wpadvancedads.com/account/#h-licenses' 298 ), 299 [ 300 'type' => 'error', 301 'additional_classes' => array( 'notice-alt', 'inline', 'update-message' ), 302 ] 303 ); 304 echo '</td></tr>'; 305 } 306 ); 307 return; 308 } 309 310 // Autoload and activate. 311 new Advanced_Ads_In_Feed(); 312 } 313 314 add_action( 'plugins_loaded', 'wp_advads_in_feed_halt_code', 5 ); -
advanced-ads-adsense-in-feed/tags/1.1.4/readme.txt
r3064742 r3243698 3 3 Tags: adsense, in-feed, in-feed ads, ads, google adsense, loop, post list, post lists, archive pages, category pages, tag pages 4 4 Requires at least: 5.0 5 Tested up to: 6. 56 Stable tag: 1.1. 35 Tested up to: 6.7 6 Stable tag: 1.1.4 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 42 42 == Changelog == 43 43 44 = 1.1.4 = 45 * Improvement: add compatibility code for Advanced Ads 2.0 46 44 47 = 1.1.3 = 45 48 -
advanced-ads-adsense-in-feed/trunk/advanced-ads-in-feed.php
r2892716 r3243698 4 4 * Plugin URI: https://wpadvancedads.com 5 5 * Description: Display AdSense In-feed ads between posts 6 * Version: 1.1. 36 * Version: 1.1.4 7 7 * Author: Advanced Ads 8 8 * Author URI: https://wpadvancedads.com … … 17 17 } 18 18 19 define( 'AAIF_FILE', __FILE__ ); 20 define( 'AAIF_VERSION', '1.1.4' ); 21 19 22 /** 20 23 * Class Advanced_Ads_In_Feed … … 44 47 add_action( 'advanced-ads-placement-options-after', array( $this, 'placement_options' ), 11, 2 ); 45 48 } 46 47 49 48 50 /** … … 88 90 * 89 91 * @since 1.0 90 *91 92 */ 92 93 public function inject_in_feed( $post, $wp_query = null ) { 93 if ( ! $wp_query instanceof WP_Query 94 || is_feed() 95 || is_admin() 96 || $wp_query->is_singular() 97 || ! $wp_query->in_the_loop 98 || ! isset( $wp_query->current_post ) 99 || ! $wp_query->is_main_query() ) { 94 if ( 95 ! $wp_query instanceof WP_Query || is_feed() || 96 is_admin() || $wp_query->is_singular() || ! $wp_query->in_the_loop || 97 ! isset( $wp_query->current_post ) || ! $wp_query->is_main_query() 98 ) { 100 99 return; 101 100 } … … 147 146 // load the ad. 148 147 $ad = new Advanced_Ads_Ad( $_item[1] ); 149 if ( isset( $ad->type ) 150 && 'adsense' === $ad->type 151 && isset( $ad->content ) 152 && strpos( $ad->content, 'in-feed' ) ) { 148 if ( 149 isset( $ad->type ) && 'adsense' === $ad->type 150 && isset( $ad->content ) 151 && strpos( $ad->content, 'in-feed' ) 152 ) { 153 153 return true; 154 154 } … … 229 229 } 230 230 } 231 232 231 } 233 232 234 new Advanced_Ads_In_Feed(); 233 /** 234 * Halt code remove with new release. 235 * 236 * @return void 237 */ 238 function wp_advads_in_feed_halt_code() { 239 global $advads_halt_notices; 240 241 // Early bail!! 242 if ( ! defined( 'ADVADS_VERSION' ) ) { 243 return; 244 } 245 246 if ( version_compare( ADVADS_VERSION, '2.0.0', '>=' ) ) { 247 if ( ! isset( $advads_halt_notices ) ) { 248 $advads_halt_notices = []; 249 } 250 $advads_halt_notices[] = __( 'Advanced Ads – Google AdSense In-feed Placement', 'advanced-ads-adsense-in-feed' ); 251 252 add_action( 253 'all_admin_notices', 254 static function () { 255 global $advads_halt_notices; 256 257 // Early bail!! 258 if ( 'plugins' === get_current_screen()->base || empty( $advads_halt_notices ) ) { 259 return; 260 } 261 ?> 262 <div class="notice notice-error"> 263 <h2><?php esc_html_e( 'Important Notice', 'advanced-ads-adsense-in-feed' ); ?></h2> 264 <p> 265 <?php 266 echo wp_kses_post( 267 sprintf( 268 /* translators: %s: Plugin name */ 269 __( 'Your versions of the Advanced Ads addons listed below are incompatible with <strong>Advanced Ads 2.0</strong> and have been deactivated. Please update them to their latest version. If you cannot update, e.g., due to an expired license, you can <a href="%1$s">roll back to a compatible version of the Advanced Ads plugin</a> at any time or <a href="%2$s">renew your license</a>.', 'advanced-ads-adsense-in-feed' ), 270 esc_url( admin_url( 'admin.php?page=advanced-ads-tools&sub_page=version' ) ), 271 'https://wpadvancedads.com/account/#h-licenses' 272 ) 273 ) 274 ?> 275 </p> 276 <h3><?php esc_html_e( 'The following addons are affected:', 'advanced-ads-adsense-in-feed' ); ?></h3> 277 <ul> 278 <?php foreach ( $advads_halt_notices as $notice ) : ?> 279 <li><strong><?php echo esc_html( $notice ); ?></strong></li> 280 <?php endforeach; ?> 281 </ul> 282 </div> 283 <?php 284 $advads_halt_notices = []; 285 } 286 ); 287 288 add_action( 289 'after_plugin_row_' . plugin_basename( __FILE__ ), 290 static function () { 291 echo '<tr class="active"><td colspan="5" class="plugin-update colspanchange">'; 292 wp_admin_notice( 293 sprintf( 294 /* translators: %s: Plugin name */ 295 __( 'Your version of <strong>Advanced Ads – Google AdSense In-feed Placement</strong> is incompatible with <strong>Advanced Ads 2.0</strong> and has been deactivated. Please update the plugin to the latest version. If you cannot update the plugin, e.g., due to an expired license, you can <a href="%1$s">roll back to a compatible version of the Advanced Ads plugin</a> at any time or <a href="%2$s">renew your license</a>.', 'advanced-ads-pro' ), 296 esc_url( admin_url( 'admin.php?page=advanced-ads-tools&sub_page=version' ) ), 297 'https://wpadvancedads.com/account/#h-licenses' 298 ), 299 [ 300 'type' => 'error', 301 'additional_classes' => array( 'notice-alt', 'inline', 'update-message' ), 302 ] 303 ); 304 echo '</td></tr>'; 305 } 306 ); 307 return; 308 } 309 310 // Autoload and activate. 311 new Advanced_Ads_In_Feed(); 312 } 313 314 add_action( 'plugins_loaded', 'wp_advads_in_feed_halt_code', 5 ); -
advanced-ads-adsense-in-feed/trunk/readme.txt
r3064742 r3243698 3 3 Tags: adsense, in-feed, in-feed ads, ads, google adsense, loop, post list, post lists, archive pages, category pages, tag pages 4 4 Requires at least: 5.0 5 Tested up to: 6. 56 Stable tag: 1.1. 35 Tested up to: 6.7 6 Stable tag: 1.1.4 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 42 42 == Changelog == 43 43 44 = 1.1.4 = 45 * Improvement: add compatibility code for Advanced Ads 2.0 46 44 47 = 1.1.3 = 45 48
Note: See TracChangeset
for help on using the changeset viewer.