Skip to content

Commit

Permalink
chore(release): merge in release v3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
matticbot committed Aug 19, 2024
2 parents 06caaec + 25c128f commit 8846daf
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [3.0.2](https://github.com/Automattic/newspack-ads/compare/v3.0.1...v3.0.2) (2024-08-19)


### Bug Fixes

* add 1x1 size to all viewports for ad units that supports it ([#891](https://github.com/Automattic/newspack-ads/issues/891)) ([0b26934](https://github.com/Automattic/newspack-ads/commit/0b2693481ca54e1e7ecf19aeac0c4e85f639062a))

## [3.0.1](https://github.com/Automattic/newspack-ads/compare/v3.0.0...v3.0.1) (2024-08-15)


Expand Down
12 changes: 5 additions & 7 deletions includes/providers/gam/class-gam-model.php
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,11 @@ public static function get_responsive_size_map( $sizes, $width_diff_ratio = 0.3,
$size_map = [];
foreach ( $viewports as $viewport_width ) {
foreach ( $sizes as $size ) {
// If size is 1x1, we want it in all viewports.
if ( 1 === $size[0] && 1 === $size[1] ) {
$size_map[ $viewport_width ][] = $size;
continue;
}
$is_in_viewport = $size[0] <= $viewport_width;
$is_above_threshold = false !== $width_threshold && $width_threshold <= $size[0];
if ( 0 === $size[0] ) {
Expand Down Expand Up @@ -875,13 +880,6 @@ public static function get_ad_unit_size_map( $ad_unit, $sizes = [] ) {

$size_map = self::get_responsive_size_map( $sizes, $width_diff_ratio, $width_threshold );

// Add 1x1 size to all viewports.
foreach ( $size_map as $viewport => $sizes ) {
if ( ! in_array( [ 1, 1 ], $sizes, true ) ) {
array_unshift( $size_map[ $viewport ], [ 1, 1 ] );
}
}

/**
* Filters the ad unit size map rules.
*
Expand Down
2 changes: 1 addition & 1 deletion newspack-ads.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Ad services integration.
* Author: Automattic
* License: GPL2
* Version: 3.0.1
* Version: 3.0.2
*
* @package Newspack
*/
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "newspack-ads",
"version": "3.0.1",
"version": "3.0.2",
"author": "Automattic",
"private": true,
"scripts": {
Expand Down

0 comments on commit 8846daf

Please sign in to comment.