Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dfp",
"version": "0.3",
"version": "0.3.1",
"homepage": "https://github.com/INN/DoubleClick-for-WordPress",
"authors": [
"nerds@inn.org"
Expand Down
8 changes: 4 additions & 4 deletions dfw.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php
/*
Plugin Name: DoubleClick for WordPress
Description: A simple way to serve DoubleClick ads in WordPress.
Version: 0.3
Plugin Name: Super Cool Ad Manager Plugin
Description: A simple way to serve DoubleClick and Google Ad Manager ads in WordPress.
Version: 0.3.1-rc1
Author: innlabs, Will Haynes for INN
Author URI: https://labs.inn.org/
License: GPL Version 2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dfw
*/

define( 'DFP_VERSION', '0.3.0' );
define( 'DFP_VERSION', '0.3.1-rc1' );

$includes = array(
'/inc/class-doubleclick.php',
Expand Down
24 changes: 6 additions & 18 deletions inc/class-doubleclick.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ public function __construct( $network_code = null ) {
$this::$enqueued = true;
}

add_action( 'wp_print_footer_scripts', array( $this, 'footer_script' ) );

$breakpoints = maybe_unserialize( get_option( 'dfw_breakpoints' ) );

if ( ! empty( $breakpoints ) ) :
Expand Down Expand Up @@ -158,6 +156,9 @@ public function enqueue_scripts() {

$data = array(
'dfpID' => $this->network_code(),
'sizeMapping' => $mappings,
'setTargeting' => $this->targeting(),
// The following are legacy support for pre-0.3.1 user code
'network_code' => $this->network_code(),
'mappings' => $mappings,
'targeting' => $this->targeting(),
Expand All @@ -170,9 +171,10 @@ public function enqueue_scripts() {
* @link https://github.com/INN/doubleclick-for-wp/issues/63#issuecomment-393342611
* @param Array $data An associative array of things. The default is:
* array(
* 'dfpID' => the option from the plugin settings
* 'network_code' => the option from the plugin settings
* 'mappings' => an array of ad mappings; not sure exactly what this is supposed to be
* 'targeting' => the ad targeting data appropriate to this page
* 'sizeMapping' => an array of ad mappings; not sure exactly what this is supposed to be
* 'setTargeting' => the ad targeting data appropriate to this page
* )
*/
$data = apply_filters( 'dfw_js_data', $data );
Expand All @@ -199,20 +201,6 @@ private function network_code() {
return ( isset( $this->network_code ) && ! empty( $this->network_code ) ) ? $this->network_code : get_option( 'dfw_network_code','xxxxxx' );
}

public function footer_script() {
if ( ! $this->debug ) {
$mappings = array();
foreach ( $this->ad_slots as $ad ) {
if ( $ad->has_mapping() ) {
$mappings[ "mapping{$ad->id}" ] = $ad->mapping();
}
} ?>
<script type="text/javascript">
jQuery('.dfw-unit:not(.dfw-lazy-load)').dfp( window.dfw );
</script>
<?php }
}

private function targeting() {
global $wp_query;
/** @see http://codex.wordpress.org/Conditional_Tags */
Expand Down
8 changes: 0 additions & 8 deletions js/jquery.dfp.min.js

This file was deleted.

6 changes: 2 additions & 4 deletions js/jquery.dfw.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@
// if we have some ads, then load 'em!
if (toLoad.length > 0) {
dfp_options = Object.assign( dfw, {
"collapseEmptyDivs": false,
"sizeMapping": dfw.mappings,
"setTargeting": dfw.targeting
"collapseEmptyDivs": false
});
window.dfp_options = dfp_options;
$( toLoad ).dfp( dfp_options ).addClass( 'dfw-loaded' );
}
};
Expand All @@ -50,5 +47,6 @@

// Run lazyLoad once on DOM ready to load any ads in view
lazyLoad();
$('.dfw-unit:not(.dfw-lazy-load)').dfp( window.dfw );
});
})();
8 changes: 0 additions & 8 deletions js/vendor/jquery.dfp.min.js

This file was deleted.

11 changes: 11 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ For more advanced documentation for developers and advanced users see [the offic

== Changelog ==

= 0.3.1 =

Fixes:

- Fixes an issue where non-lazy-loaded ads were not being loaded with the correct mappings, leading to ads requesting creatives with sizes that matched the size of the ad condainer, such as 1090x0. [Pull request #97](https://github.com/INN/doubleclick-for-wp/pull/97) for issues [#96](https://github.com/INN/doubleclick-for-wp/issues/96), [#95](https://github.com/INN/doubleclick-for-wp/issues/95).
- Fixes an issue where [Autoptimize](https://wordpress.org/plugins/autoptimize/) was breaking non-lazy-load ads. [Pull request #97](https://github.com/INN/doubleclick-for-wp/pull/97) for issue [#95](https://github.com/INN/doubleclick-for-wp/issues/95).

Cleanup:

- Removes some antiquated copied of jquery.dfp.js that were kept in the plugin, despite not being referenced. [Pull request #97](https://github.com/INN/doubleclick-for-wp/pull/97) for issue [#94](https://github.com/INN/doubleclick-for-wp/issues/94).

= 0.3 =

Thanks to WordPress.org user [onlineforbusiness](https://wordpress.org/support/users/onlineforbusiness/) and GitHub users [dbeniaminov](https://github.com/dbeniaminov) and [tienvooracht](https://github.com/tienvooracht) for their contributions to this release.
Expand Down