plugin not working after WP update to 4.4.2 – JavaScript error with Cycle plugin
-
I updated WordPress from 4.1.10 to 4.4.2 and Meteor Slides stopped working. I suspect it’s something to do with the jQuery Cycle plugin. I’m getting this JavaScript error:
[cycle] terminating; zero elements found by selector
http://www.harmonyproject.co.uk/wp-content/plugins/meteor-slides/js/jquery.cycle.all.js?ver=4.4.2Thanks for any help with this.
-
That’s not an error, it’s just a notice stating that the slideshow script isn’t running because no slides were found. This is because the slideshow is missing, how and where did you add the slideshow?
Josh, thanks for the reply. Sorry for mistakenly calling it an error.
This is one of the pages containing one of the slideshows:
http://www.harmonyproject.co.uk/gallery/family-action-wandsworth/I can still see the images in the Slides posts in the back end.
It’s all been working perfectly since July 2014. I’ve just recently noticed this issue.
It looks like the slideshow shortcodes were corrupted somehow, maybe you have a plugin that is replacing the default quote marks with fancy ones?
When I look at the source code the shortcode looks like this:
[meteor_slideshow slideshow=”gallery-family-action-wandsworth”]Try to replace the shortcode back to the default quotes and see if that fixes it:
[meteor_slideshow slideshow="gallery-family-action-wandsworth"]Ah yes, that does look like it’s probably the problem. Thanks for spotting that.
The WP post editor is still showing straight quotes (not curly quotes). And, even if I type them in again as straight quotes and update, they are somehow changed to curly quotes at some point and so still show in the source code as
[meteor_slideshow slideshow=”gallery-family-action-wandsworth”]I have 3 other plugins installed and activated. I deactivated them one by one and did the test above. However, the problem is still there.
By the way, I’m doing the above testing on my localhost version of the site which has exactly the same problem.
Just to say again, I noticed this happening as soon as I updated WordPress if that’s any help.
I’ve just added this to functions.php :
add_filter( 'run_wptexturize', '__return_false' );This successfully preserves the straight quotes and now the shortcode in the source code is this:
[meteor_slideshow slideshow="gallery-family-action-wandsworth"]But, the slideshow still doesn’t appear.
Just to be clear, I’ve done the above on my localhost site only.
Does it display just the shortcode after you did that, or does the shortcode disappear?
It shouldn’t be running the smart quotes filter on quotes within shortcodes. I can take a look if you want to send me a login.
After I added that filter, it still displays the shortcode in the page.
I have not added that filter to the production site
http://www.harmonyproject.co.uk/Thanks for offering to take a look. I’ll send you a login to the production site shortly.
I took a look at your site and everything looks good, I can’t find anything in there that would be causing the shortcode quotes to be filtered like this.
I would recommend trying to narrow down the issue on your local install. Deactivate the other plugins, they seem to be fine, but one less issue to worry about. Then switch your theme from the child to the parent theme and test the slideshow to see if it is something on the child theme. Finally, switch from the current parent theme to the latest default theme, Twenty Sixteen and test that.
Beyond those factors, do you have any “must use” plugins or anything else going on with this WordPress install that is non-standard?
Thanks for taking a look at the site. I ran all your suggested tests on my local site, but unfortunately it still doesn’t work.
No, I don’t have any other plugins involved and I can’t think of any unusual customisation I’ve done.
The displayed shortcode is in curly quotes once again (although earlier when I modified it to use straight ones it didn’t make any difference anyway).
Could it be a server config thing? e.g. PHP version? My local site is on PHP 5.3.13
Having said that, on the production, I tried switching to the following PHP versions:
5.3
5.4
5.5
5.6
and none of them solved the problem.Hmmm….
Sorry, I’m at a loss as to what is causing that. It doesn’t seem like something that would be caused by a server setting, this is something that WordPress is doing. Just to be clear, it is doing this on both your local and live WordPress installs?
Ok.
Yes, I have the same problem on my local site and the production site at
http://www.harmonyproject.co.uk/gallery/family-action-wandsworth/I also have a staging site where exactly the same problem is happening.
Thanks again for trying to solve this. I’ll just need to have a think about what to do.
That really is strange! If you would like to send me a login for the staging site, I can take a closer look on that site where I can be a little more experimental without breaking your live site!
I got the slideshow working here: http://www.harmonyproject.co.uk/gallery/family-action-wandsworth/
I’m still not really sure why it was using smart quotes for that shortcode. What I did was delete the shortcode completely, add the regular shortcode:
[meteor_slideshow]And then add the slideshow variable back into it and get the slideshow slug from the slideshow categories. After updating the post it works.
Josh, I followed your advice and have now fixed all the problem pages in the same way. Well, maybe a slightly different way. Here’s what I did:
I deleted the slideshow variable from the shortcode, so for example I amended
[meteor_slideshow slideshow="gallery-croydon-young-carers"]
to
[meteor_slideshow]Then I updated the post.
Then I typed the variable back into the shortcode i.e. I typed in:
slideshow=“gallery-croydon-young-carers”
Then I updated the post.The slideshow displayed and it was the correct one.
Weirdly, however, if I tried to use cut and paste instead of manually typing, i.e. if I cut:
slideshow=“gallery-croydon-young-carers”
Update post
Then paste (what I had just cut), i.e. the following, back in:
slideshow=“gallery-croydon-young-carers”
Then update, it just didn’t work.That just seems really weird! But, hey, I now have a solution.
Thanks for your help with this.
The topic ‘plugin not working after WP update to 4.4.2 – JavaScript error with Cycle plugin’ is closed to new replies.