INN / doubleclick-for-wp

WordPress plugin for serving Google Ad Manager ads
https://wordpress.org/plugins/doubleclick-for-wp/
GNU General Public License v2.0
25 stars 11 forks source link

If a site's breakpoints change, the widgets break. #77

Open benlk opened 5 years ago

benlk commented 5 years ago

Here we see an array of options for a widget:

PHP message: array (
  'identifier' => 'cheese',
  'lazyLoad' => '1',
  'breakpoints' => NULL,
  'sizes' => 
  array (
    'mobile' => '',
    'desktop' => '',
  ),
  'size' => NULL,
  'widget_class' => 'default',
  'hidden_desktop' => 0,
  'hidden_tablet' => 0,
  'hidden_phone' => 0,
  'title_link' => '',
)

And here's what happens on the widget form, when the site has gone from using the named breakpoints "mobile" and "desktop" to using the named breakpoints "one" and "two":

PHP message: PHP Notice:  Undefined index: one in /wp-content/plugins/doubleclick-for-wp/dfw-widget.php on line 111
PHP message: PHP Notice:  Undefined index: two in /wp-content/plugins/doubleclick-for-wp/dfw-widget.php on line 111

The form and the widget should check to make sure that the widget breakpoint saved in the widget settings we're trying to get the sizes for exists in the site's breakpoint settings.

Sites are not likely to constantly change their breakpoints, so this is not a high-priority issue.