doubleclick-for-wp
doubleclick-for-wp copied to clipboard
Fix for non-lazy-load ads not displaying correctly
Changes
- Adds the indexes
sizeMappingandsetTargetingon the globalwindow.dfwto match the parameters required by https://github.com/coop182/jquery.dfp.js#available-options - Moves the initialization of non-lazy-load ads into
jquery.dfw.js, so that the code will hopefully only be loaded whenjquery.dfp.min.jshas been loaded, sincejquery.dfw.jsis listed as havingjquery.dfp.min.jsorjquery.dfp.jsas a dependency. - Removes old copies of
jquery.dfp.jsfrom the repo, for https://github.com/INN/doubleclick-for-wp/issues/94
Why
- Fixes #96, where non-lazy-load ads were being loaded with the wrong settings
- Partially addresses #95, where an automatic optimization plugin was causing
jquery.dfp.jsto be loaded after the plugin function that used functionality defined injquery.dfp.js.jquery.dfpis listed as a dependency ofjquery.dfwin the enqueues, and Autoptimize was allowing lazy-load ads to load, so it seems that Autoptimize was loading ads in correct order. This changeset doesn't fix a potential future issue wherejquery.dfp.jsfinishes loading beforejquery.dfwdoes, but that seems unlikely ifjquery.dfwis loaded later on the page thanjquery.dfp, because they're loaded from the same origin.
For #95 and #96.
Resolves https://github.com/INN/doubleclick-for-wp/issues/94
Testing/Questions
Questions that need to be answered before merging:
- [ ] Does it update the changelog in
readme.txtwith appropriate information?
Steps to test this PR:
- Create a non-lazy-load ad widget in the page, with size mappings.
- With version 0.3, verify that the plugin doesn't request a correct ad size
- With this PR, verify that the plugin does request a correct ad size .
This PR may also address the following issues:
- https://github.com/INN/doubleclick-for-wp/issues/90
- https://wordpress.org/support/topic/do-not-use-version-0-3/
- https://github.com/INN/doubleclick-for-wp/issues/92
Test release of this plugin created: https://github.com/INN/doubleclick-for-wp/archive/v0.3.1-rc1.zip
Submitted to that one wp.org user for testing: https://wordpress.org/support/topic/do-not-use-version-0-3/#post-11181996