Skip to content

Commit d4337b1

Browse files
committed
Merge branch 'develop' into trunk
2 parents ce1f83d + 44504c3 commit d4337b1

File tree

7 files changed

+46
-17
lines changed

7 files changed

+46
-17
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file, per [the Ke
44

55
## [Unreleased] - TBD
66

7+
## [1.0.4] - 2021-03-24
8+
### Fixed
9+
- `initializeSlotData()` now correctly receives an event instead of a `Slot` (props [@darylldoyle](https://github.com/darylldoyle) via [#39](https://github.com/10up/Ad-Refresh-Control/pull/39)).
10+
- `isEligible()` prevents Uncaught TypeError by checking if `event.size` exists before attempting to access it (props [@darylldoyle](https://github.com/darylldoyle) via [#39](https://github.com/10up/Ad-Refresh-Control/pull/39)).
11+
12+
### Security
13+
- Bump `elliptic` from 6.5.3 to 6.5.4 (props [@dependabot](https://github.com/apps/dependabot) via [#37](https://github.com/10up/Ad-Refresh-Control/pull/37)).
14+
715
## [1.0.3] - 2021-03-09
816
### Added
917
- Custom callback and `avc_refresh_callback` filter to be used when an ad slot is ready for refresh (props [@darylldoyle](https://github.com/darylldoyle) via [#34](https://github.com/10up/Ad-Refresh-Control/pull/34)).
@@ -50,6 +58,7 @@ All notable changes to this project will be documented in this file, per [the Ke
5058
- Initial public release! 🎉
5159

5260
[Unreleased]: https://github.com/10up/Ad-Refresh-Control/compare/trunk...develop
61+
[1.0.4]: https://github.com/10up/Ad-Refresh-Control/compare/1.0.3...1.0.4
5362
[1.0.3]: https://github.com/10up/Ad-Refresh-Control/compare/1.0.2...1.0.3
5463
[1.0.2]: https://github.com/10up/Ad-Refresh-Control/compare/1.0.1...1.0.2
5564
[1.0.1]: https://github.com/10up/Ad-Refresh-Control/compare/v1.0.0...1.0.1

ad-refresh-control.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Ad Refresh Control
44
* Plugin URI: https://github.com/10up/Ad-Refresh-Control
55
* Description: Enable Active View refresh for Google Ad Manager ads without needing to modify any code.
6-
* Version: 1.0.3
6+
* Version: 1.0.4
77
* Requires at least: 4.9
88
* Requires PHP: 7.0
99
* Author: 10up
@@ -17,7 +17,7 @@
1717
*/
1818

1919
// Useful global constants.
20-
define( 'AD_REFRESH_CONTROL_VERSION', '1.0.3' );
20+
define( 'AD_REFRESH_CONTROL_VERSION', '1.0.4' );
2121
define( 'AD_REFRESH_CONTROL_URL', plugin_dir_url( __FILE__ ) );
2222
define( 'AD_REFRESH_CONTROL_PATH', plugin_dir_path( __FILE__ ) );
2323
define( 'AD_REFRESH_CONTROL_INC', AD_REFRESH_CONTROL_PATH . 'includes/' );

assets/js/frontend/components/gpt-active-view-refresh.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const impressionViewableHandler = ( event ) => {
5858
return;
5959
}
6060
if ( 'undefined' === typeof adsData[ slotID ] ) {
61-
initializeSlotData( event.slot );
61+
initializeSlotData( event );
6262
}
6363
adsData[ slotID ].viewable = true;
6464
};
@@ -144,7 +144,8 @@ const isEligible = ( event ) => {
144144
return false;
145145
}
146146

147-
let slotSize = event.size.toString();
147+
// The size property only exists within the googletag.events.SlotRenderEndedEvent so we need to check it's there before accessing it.
148+
let slotSize = 'size' in event ? event.size.toString() : false;
148149

149150
const slotSizes = slot.getSizes();
150151
const slotID = slot.getSlotElementId();

dist/js/frontend.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 24 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@10up/ad-refresh-control",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "Ad Refresh Control",
55
"license": "GPL-2.0-or-later",
66
"homepage": "https://github.com/10up/ad-refresh-control",

readme.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: google, ad manager
44
Requires at least: 4.9
55
Tested up to: 5.7
66
Requires PHP: 7.0
7-
Stable tag: 1.0.3
7+
Stable tag: 1.0.4
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -43,6 +43,11 @@ __Excluded Advertiser IDs__: Prevent ad refreshes for specific advertiser IDs in
4343

4444
== Changelog ==
4545

46+
= 1.0.4 =
47+
* **Fixed:** `initializeSlotData()` now correctly receives an event instead of a `Slot` (props [@enshrined](https://profiles.wordpress.org/enshrined/)).
48+
* **Fixed:** `isEligible()` prevents Uncaught TypeError by checking if `event.size` exists before attempting to access it (props [@enshrined](https://profiles.wordpress.org/enshrined/)).
49+
* **Security:** Bump `elliptic` from 6.5.3 to 6.5.4 (props [@enshrined](https://profiles.wordpress.org/enshrined/)).
50+
4651
= 1.0.3 =
4752
* **Added:** Custom callback and `avc_refresh_callback` filter to be used when an ad slot is ready for refresh (props [@enshrined](https://profiles.wordpress.org/enshrined/)).
4853
* **Added:** Linting and testing GitHub Actions (props [@jeffpaul](https://profiles.wordpress.org/jeffpaul/), [@dinhtungdu](https://profiles.wordpress.org/dinhtungdu/)).

0 commit comments

Comments
 (0)