Skip to content

Commit

Permalink
Merge pull request #89 from INN/83-tag-0.3
Browse files Browse the repository at this point in the history
Version bump to 0.3 and docs scrub
  • Loading branch information
benlk authored Nov 6, 2018
2 parents bf4fcb5 + bd2d2a3 commit f73e00d
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 20 deletions.
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.2.1",
"version": "0.3",
"homepage": "https://github.com/INN/DoubleClick-for-WordPress",
"authors": [
"[email protected]"
Expand Down
20 changes: 19 additions & 1 deletion dfw-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,25 @@ function dfw_breakpoints_input() {
while ( $i < 5 ) {
$identifier = ( isset( $breakpoints[ $i ]['identifier'] ) )? $breakpoints[ $i ]['identifier'] : '';
$min_width = ( isset( $breakpoints[ $i ]['min-width'] ) )? $breakpoints[ $i ]['min-width'] : '';
$max_width = ( isset( $breakpoints[ $i ]['max-width'] ) )? $breakpoints[ $i ]['max-width'] : ''; ?>
$max_width = ( isset( $breakpoints[ $i ]['max-width'] ) )? $breakpoints[ $i ]['max-width'] : '';

// fallbacks for post-https://github.com/INN/doubleclick-for-wp/pull/46 compatibility.
if ( empty( $min_width ) && isset( $breakpoints[ $i ][ 'minWidth' ] ) ) {
$min_width = ( isset( $breakpoints[ $i ]['minWidth'] ) )? $breakpoints[ $i ]['minWidth'] : '';
}
if ( empty( $max_width ) && isset( $breakpoints[ $i ][ 'maxWidth' ] ) ) {
$max_width = ( isset( $breakpoints[ $i ]['maxWidth'] ) )? $breakpoints[ $i ]['maxWidth'] : '';
}

// fallbacks, continued.
if ( empty( $min_width ) && isset( $breakpoints[ $i ][ 'min-width' ] ) ) {
$min_width = ( isset( $breakpoints[ $i ]['min-width'] ) )? $breakpoints[ $i ]['min-width'] : '';
}
if ( empty( $max_width ) && isset( $breakpoints[ $i ][ 'max-width' ] ) ) {
$max_width = ( isset( $breakpoints[ $i ]['max-width'] ) )? $breakpoints[ $i ]['max-width'] : '';
}

?>
<input value="<?php echo esc_attr( $identifier ); ?>"
placeholder="Name"
name="dfw_breakpoints[]"
Expand Down
4 changes: 2 additions & 2 deletions dfw.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
/*
Plugin Name: DoubleClick for WordPress
Description: A simple way to serve DoubleClick ads in WordPress.
Version: 0.2
Version: 0.3
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.2.0' );
define( 'DFP_VERSION', '0.3.0' );

$includes = array(
'/inc/class-doubleclick.php',
Expand Down
2 changes: 1 addition & 1 deletion docs/Developer-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ __$identifier__

__$args__

`Array` An array of properties about the breakpoint. Currently the only keys supported are minWidth and maxWidth.
`Array` An array of properties about the breakpoint. Currently the only keys supported are min_width and max_width.

* * *

Expand Down
37 changes: 37 additions & 0 deletions docs/dev-release-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Release checklist

See also https://github.com/INN/docs/blob/master/projects/wordpress-plugins/release.sh.md

- [ ] Are we on the latest version of `jquery.dfp.js`? See [related docs for updating that dependency](./dev-update-dependencies.md)

## Testing before release:

Plugin settings:

- [ ] Does the settings page work?
- [ ] Do settings saved in a previous version of this plugin work?

Frontend tests:

- [ ] `window.dfw` contains`dfpID` and `network_code`, which are the same value, which is that of `get_option('dfw_network_code')`
- [ ] a filter modifying `dfw_js_data` has its modifications output in the frontend `window.dfw` object

Widget tests

- [ ] A widget's breakpoints are reflected in the widget's corresponding `mapping*` entry in `window.dfw`
- [ ] A widget outputs its HTML, and the widget's settings are added to `window.dfw`
- [ ] Do settings saved in a previous version of this plugin work?

Gutenberg tests

- [ ] the block, when inserted, has controls
- [ ] the block renders on the frontend as a widget does
- [ ] on a site with Gutenberg not installed, the plugin functions
- [ ] on a 4.9 site with Gutenberg installed, the plugin functions
- [ ] on a 5.0 site, the plugin functions
- [ ] Do settings saved in a previous version of this plugin work?

Plugin metadata:

- [ ] Does the minimum PHP required version need to be updated in `readme.txt`?
- [ ] Does the WordPress "Tested up to" version need to be updated? Check with [the phpcs PHPCompatibility rules](https://github.com/PHPCompatibility/PHPCompatibility).
File renamed without changes.
2 changes: 2 additions & 0 deletions inc/block.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Register all block assets so they can be enqueued through Gutenberg in the corresponding context
*
* @link https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
* @since 0.3
*/
function dfw_block_init() {
if( ! function_exists( 'register_block_type' ) ) {
Expand Down Expand Up @@ -109,6 +110,7 @@ function dfw_block_init() {
* - provide classes
*
* @param Array $args The widget/thing arguments
* @since 0.3
*/
function dfw_block_render_callback( $instance=array(), $content='', $tag='' ) {
/*
Expand Down
18 changes: 9 additions & 9 deletions inc/class-doubleclickbreakpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@ class DoubleClickBreakpoint {
public $option;

public function __construct( $identifier, $args = null ) {
// specify all the options because there has been come confusion, historically
if ( isset( $args['min_width'] ) ) {
$this->min_width = $args['min_width'];
} else if ( isset( $args['minWidth'] ) ) {
$this->min_width = $args['minWidth'];
} else if ( isset( $args['min-width'] ) ) {
$this->max_width = $args['min-width'];
}

if ( isset( $args['max_width'] ) ) {
$this->max_width = $args['max_width'];
} else if ( isset( $args['maxWidth'] ) ) {
$this->max_width = $args['maxWidth'];
} else if ( isset( $args['max-width'] ) ) {
$this->max_width = $args['max-width'];
}

if ( isset( $args['_option'] ) && $args['_option'] ) {
$this->option = true;
}


// Same, but with different spelling
if ( isset( $args['max-width'] ) ) {
$this->max_width = $args['max-width'];
}
if ( isset( $args['min-width'] ) ) {
$this->min_width = $args['min-width'];
}

$this->identifier = $identifier;
}

Expand Down
2 changes: 1 addition & 1 deletion js/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
alignwide: true,
anchor: false,
customClassName: true,
className: false,
className: true,
inserter: true,
multuple: true,
},
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Serve DoubleClick ads natively in WordPress. Built to make serving responsive ad

[Read the documentation on GitHub](https://github.com/INN/DoubleClick-for-WordPress/tree/master/docs).

This plugin was named "DoubleClick for WordPress" [until](https://github.com/inn/doubleclick-for-wp/issues/69) Google [renamed DoubleClick for Publishers to Google Ad Manager](https://www.blog.google/products/admanager/introducing-google-ad-manager/).
This plugin was named "DoubleClick for WordPress" [until](https://github.com/inn/doubleclick-for-wp/issues/69) Google [renamed DoubleClick for Publishers to Google Ad Manager](https://www.blog.google/products/admanager/introducing-google-ad-manager/). That's why this GitHub repo is named `INN/doubleclick-for-wp`.
31 changes: 27 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ Contributors: innlabs, willhaynes24
Donate link: https://inn.org/donate
Tags: ads, doubleclick, publishers, news
Requires at least: 4.0.0
Tested up to: 5.0-beta2
Stable tag: 0.2.1
Requires PHP: 5.3
Tested up to: 5.0-beta3
Stable tag: 0.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -18,6 +19,8 @@ Implementing is simple. Configure your network code and input your identifiers.

For more advanced documentation for developers and advanced users see [the official plugin docs](https://github.com/INN/DoubleClick-for-WordPress/blob/master/docs/readme.md).

To contribute to this plugin, please [visit it on GitHub](https://github.com/INN/doubleclick-for-wp/issues), or send us an email at [[email protected]](mailto:[email protected]).


== Installation ==

Expand All @@ -33,20 +36,33 @@ For more advanced documentation for developers and advanced users see [the offic

= 0.3 =

Thanks to WordPress.org user [onlineforbusiness](https://wordpress.org/support/users/onlineforbusiness/) and GitHub user [dbeniaminov](https://github.com/dbeniaminov) for their contributions to this release.
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.

New features:

- Adds a Gutenberg Block for manual insertion of ads in posts. [Pull request #82](https://github.com/INN/doubleclick-for-wp/pull/82) for [issue #70](https://github.com/INN/doubleclick-for-wp/issues/70).
- Adds a PHP filter `'dfw_js_data'`, to allow modification of the `window.dfw` object before it's output on the page. Refactors widgets and blocks to draw all details needed from `window.dfw` instead of separately-enqueued JSON blobs. This should allow you to `setRequestNonPersonalizedAds. [PR #81](https://github.com/INN/doubleclick-for-wp/pull/81) for [issue #63](https://github.com/INN/doubleclick-for-wp/issues/63), with thanks to GitHub user [tienvooracht](https://github.com/tienvooracht) for the idea.
- Tested up to WordPress 5.0-beta3

Changes and fixes:

- Rebrands from "DoubleClick for WordPress" to "Super Cool Ad Manager Plugin", because [Google merged DoubleClick for Publishers into Google Ad Manager](https://www.blog.google/products/admanager/introducing-google-ad-manager/).
- **Potentially-breaking changes**: Renames a number of varibles from `camelCase` to `snake_case` in [pull request #46](https://github.com/INN/doubleclick-for-wp/pull/46) for Wordpress.com VIP compatibility. This includes renaming the global variable `$DoubleClick` to `$doubleclick`, and many of its properties from `$DoubleClick->camelCase` to `$doubleclick->snake_case`. If you modify this plugin's features via filters or actions, or if you call this plugin's functions and methods directly from your code,
- Updates to `jquery.dfp.js` version 2.4.2, adding `setCentering` support. [PR #67](https://github.com/INN/doubleclick-for-wp/pull/67) for [issue #66](https://github.com/INN/doubleclick-for-wp/issues/66)
- Removes 'single' page targeting from post-type archives and from static front pages. [PR #72](https://github.com/INN/doubleclick-for-wp/pull/72) for [issue #61](https://github.com/INN/doubleclick-for-wp/issues/61), thanks to GitHub user [dbeniaminov](https://github.com/dbeniaminov).
- Adds "Category" targeting on category archive. [PR #72](https://github.com/INN/doubleclick-for-wp/pull/72) for [issue #61](https://github.com/INN/doubleclick-for-wp/issues/61).
- Adds "Tag" targeting on tag archive. [PR #74](https://github.com/INN/doubleclick-for-wp/pull/74) for [issue #29](https://github.com/INN/doubleclick-for-wp/issues/29).
- Fixes a number of PHP warnings and errors, including [issue #8](https://github.com/INN/doubleclick-for-wp/issues/8) and [issue #37](https://github.com/INN/doubleclick-for-wp/issues/37) in [PR #76](https://github.com/INN/doubleclick-for-wp/pull/76) and [issue #31](https://github.com/INN/doubleclick-for-wp/issues/31) in [PR #80](https://github.com/INN/doubleclick-for-wp/pull/80/).
- Fixes a targeting problem that occurred when wp_footer ran outside The Loop. ([PR #87](https://github.com/INN/doubleclick-for-wp/pull/87) for [this support topic](https://wordpress.org/support/topic/categories-tags-bug-and-solution/).)

Documentation updates:

- Adds "Ad unit" label to widget settings for the "Identifier" setting, to match Google's language. [PR #73](https://github.com/INN/doubleclick-for-wp/pull/73) for [issue #26](https://github.com/INN/doubleclick-for-wp/issues/26).
- Adds GitHub Pull Request template and Contributing guidelines files.
- Adds a plugin text domain: `dfw`. ([PR #76](https://github.com/INN/doubleclick-for-wp/pull/76))
- Adds the GPL2 license to the plugin header; this plugin has been GPL2 since 2015 but that wasn't marked in a WordPress-accessible way. ([PR #76](https://github.com/INN/doubleclick-for-wp/pull/76))
- Moves the documentation index file from `docs/index.md` to `docs/readme.md` in the GitHub repository, so that the Markdown will display to all who visit [the docs directory](https://github.com/INN/doubleclick-for-wp/tree/master/docs). ([PR #80](https://github.com/INN/doubleclick-for-wp/pull/80))
- Moves plugin functions and files around within the plugin; see [PR #72](https://github.com/INN/doubleclick-for-wp/pull/81) for details.
- Removes 'single' page targeting from post-type archives and from static front pages. [PR #72](https://github.com/INN/doubleclick-for-wp/pull/72) for [issue #61](https://github.com/INN/doubleclick-for-wp/issues/61), thanks to GitHub user [dbeniaminov](https://github.com/dbeniaminov).

= 0.2.1 =

Expand All @@ -64,3 +80,10 @@ Thanks to WordPress.org user [onlineforbusiness](https://wordpress.org/support/u
- Initial beta release.
- Add support for displaying different sizes of ad unit based on the size of the viewport

== Upgrade Notice ==

= 0.3 =

This update adds support for direct insertion of ads in posts via Gutenberg, filter-based modificaiton of ad options, and resolves a number of bugs.

This update renames the global variable `$DoubleClick` to `$doubleclick`, along with many of that class's properties. If you modify this plugin's functionality via filters or custom functionality, check your code before deploying to production.

0 comments on commit f73e00d

Please sign in to comment.