New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bw_countdown’s JavaScript ignored by autoptimize #108

Closed
bobbingwide opened this Issue Nov 19, 2018 · 2 comments

Comments

Projects
None yet
1 participant
@bobbingwide
Owner

bobbingwide commented Nov 19, 2018

When the autoptimize plugin is activated then the JavaScript for the bw_countdown function is ineffective.
Initially noticed on cwiccer.com with Gutenberg 4.4.0 and the Countdown block from oik-block.

Workaround

Deactivate autoptimize.

Possible interim solution

Generate the special content that autoptimize uses to disable itself on a post/page
<!-- <xsl:stylesheet -->
See quicktrick to disable autoptimize. https://blog.futtta.be/2018/06/19/quick-trick-to-disable-autoptimize-on-a-page/

Or hook into autoptimize to disable optimisation.

Long term solution

Other solutions should also consider the fact that the current jQuery code may not support multiple countdown timers on the same page. Although it works here for some reason...
https://www.oik-plugins.com/oik_shortcodes/bw_countdown/

@bobbingwide

This comment has been minimized.

Owner

bobbingwide commented Nov 19, 2018

Results of a test with two bw_countdown shortcodes on the same page with autoptimize activated.

  • No countdown timers display
  • There are two meta data sections for one post.
    image
@bobbingwide

This comment has been minimized.

Owner

bobbingwide commented Nov 19, 2018

It works on the oik-shortcodes page since the ID is different for the two timers; one is "countdown", the other is "since".

The two meta data sections are a feature of Twenty Nineteen. No idea if that's intended since I can't find a spec.

bobbingwide added a commit that referenced this issue Nov 19, 2018

Issue #108 - support multiple countdown timers using bw_countdown_id() (
#109)

Trying Squash and merge... but there's only one commit anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment