Skip to content

Commit f73e00d

Browse files
authored
Merge pull request #89 from INN/83-tag-0.3
Version bump to 0.3 and docs scrub
2 parents bf4fcb5 + bd2d2a3 commit f73e00d

File tree

11 files changed

+100
-20
lines changed

11 files changed

+100
-20
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dfp",
3-
"version": "0.2.1",
3+
"version": "0.3",
44
"homepage": "https://github.com/INN/DoubleClick-for-WordPress",
55
"authors": [
66

dfw-options.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,25 @@ function dfw_breakpoints_input() {
143143
while ( $i < 5 ) {
144144
$identifier = ( isset( $breakpoints[ $i ]['identifier'] ) )? $breakpoints[ $i ]['identifier'] : '';
145145
$min_width = ( isset( $breakpoints[ $i ]['min-width'] ) )? $breakpoints[ $i ]['min-width'] : '';
146-
$max_width = ( isset( $breakpoints[ $i ]['max-width'] ) )? $breakpoints[ $i ]['max-width'] : ''; ?>
146+
$max_width = ( isset( $breakpoints[ $i ]['max-width'] ) )? $breakpoints[ $i ]['max-width'] : '';
147+
148+
// fallbacks for post-https://github.com/INN/doubleclick-for-wp/pull/46 compatibility.
149+
if ( empty( $min_width ) && isset( $breakpoints[ $i ][ 'minWidth' ] ) ) {
150+
$min_width = ( isset( $breakpoints[ $i ]['minWidth'] ) )? $breakpoints[ $i ]['minWidth'] : '';
151+
}
152+
if ( empty( $max_width ) && isset( $breakpoints[ $i ][ 'maxWidth' ] ) ) {
153+
$max_width = ( isset( $breakpoints[ $i ]['maxWidth'] ) )? $breakpoints[ $i ]['maxWidth'] : '';
154+
}
155+
156+
// fallbacks, continued.
157+
if ( empty( $min_width ) && isset( $breakpoints[ $i ][ 'min-width' ] ) ) {
158+
$min_width = ( isset( $breakpoints[ $i ]['min-width'] ) )? $breakpoints[ $i ]['min-width'] : '';
159+
}
160+
if ( empty( $max_width ) && isset( $breakpoints[ $i ][ 'max-width' ] ) ) {
161+
$max_width = ( isset( $breakpoints[ $i ]['max-width'] ) )? $breakpoints[ $i ]['max-width'] : '';
162+
}
163+
164+
?>
147165
<input value="<?php echo esc_attr( $identifier ); ?>"
148166
placeholder="Name"
149167
name="dfw_breakpoints[]"

dfw.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
/*
33
Plugin Name: DoubleClick for WordPress
44
Description: A simple way to serve DoubleClick ads in WordPress.
5-
Version: 0.2
5+
Version: 0.3
66
Author: innlabs, Will Haynes for INN
77
Author URI: https://labs.inn.org/
88
License: GPL Version 2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1010
Text Domain: dfw
1111
*/
1212

13-
define( 'DFP_VERSION', '0.2.0' );
13+
define( 'DFP_VERSION', '0.3.0' );
1414

1515
$includes = array(
1616
'/inc/class-doubleclick.php',

docs/Developer-API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ __$identifier__
4444

4545
__$args__
4646

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

4949
* * *
5050

docs/dev-release-checklist.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Release checklist
2+
3+
See also https://github.com/INN/docs/blob/master/projects/wordpress-plugins/release.sh.md
4+
5+
- [ ] Are we on the latest version of `jquery.dfp.js`? See [related docs for updating that dependency](./dev-update-dependencies.md)
6+
7+
## Testing before release:
8+
9+
Plugin settings:
10+
11+
- [ ] Does the settings page work?
12+
- [ ] Do settings saved in a previous version of this plugin work?
13+
14+
Frontend tests:
15+
16+
- [ ] `window.dfw` contains`dfpID` and `network_code`, which are the same value, which is that of `get_option('dfw_network_code')`
17+
- [ ] a filter modifying `dfw_js_data` has its modifications output in the frontend `window.dfw` object
18+
19+
Widget tests
20+
21+
- [ ] A widget's breakpoints are reflected in the widget's corresponding `mapping*` entry in `window.dfw`
22+
- [ ] A widget outputs its HTML, and the widget's settings are added to `window.dfw`
23+
- [ ] Do settings saved in a previous version of this plugin work?
24+
25+
Gutenberg tests
26+
27+
- [ ] the block, when inserted, has controls
28+
- [ ] the block renders on the frontend as a widget does
29+
- [ ] on a site with Gutenberg not installed, the plugin functions
30+
- [ ] on a 4.9 site with Gutenberg installed, the plugin functions
31+
- [ ] on a 5.0 site, the plugin functions
32+
- [ ] Do settings saved in a previous version of this plugin work?
33+
34+
Plugin metadata:
35+
36+
- [ ] Does the minimum PHP required version need to be updated in `readme.txt`?
37+
- [ ] 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.

inc/block.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Register all block assets so they can be enqueued through Gutenberg in the corresponding context
1010
*
1111
* @link https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/#enqueuing-block-scripts
12+
* @since 0.3
1213
*/
1314
function dfw_block_init() {
1415
if( ! function_exists( 'register_block_type' ) ) {
@@ -109,6 +110,7 @@ function dfw_block_init() {
109110
* - provide classes
110111
*
111112
* @param Array $args The widget/thing arguments
113+
* @since 0.3
112114
*/
113115
function dfw_block_render_callback( $instance=array(), $content='', $tag='' ) {
114116
/*

inc/class-doubleclickbreakpoint.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,27 @@ class DoubleClickBreakpoint {
3636
public $option;
3737

3838
public function __construct( $identifier, $args = null ) {
39+
// specify all the options because there has been come confusion, historically
3940
if ( isset( $args['min_width'] ) ) {
4041
$this->min_width = $args['min_width'];
42+
} else if ( isset( $args['minWidth'] ) ) {
43+
$this->min_width = $args['minWidth'];
44+
} else if ( isset( $args['min-width'] ) ) {
45+
$this->max_width = $args['min-width'];
4146
}
4247

4348
if ( isset( $args['max_width'] ) ) {
4449
$this->max_width = $args['max_width'];
50+
} else if ( isset( $args['maxWidth'] ) ) {
51+
$this->max_width = $args['maxWidth'];
52+
} else if ( isset( $args['max-width'] ) ) {
53+
$this->max_width = $args['max-width'];
4554
}
4655

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

51-
52-
// Same, but with different spelling
53-
if ( isset( $args['max-width'] ) ) {
54-
$this->max_width = $args['max-width'];
55-
}
56-
if ( isset( $args['min-width'] ) ) {
57-
$this->min_width = $args['min-width'];
58-
}
59-
6060
$this->identifier = $identifier;
6161
}
6262

js/block.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
alignwide: true,
5555
anchor: false,
5656
customClassName: true,
57-
className: false,
57+
className: true,
5858
inserter: true,
5959
multuple: true,
6060
},

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ Serve DoubleClick ads natively in WordPress. Built to make serving responsive ad
44

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

7-
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/).
7+
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`.

0 commit comments

Comments
 (0)