Support » Plugin: Cyclone Slider » Fatal Error After Update

  • Resolved smalldetails

    (@smalldetails)


    Hi, I’ve been happy with the Cyclone Slider but today after updating it I received an error that caused me to have to remove the plugin thru FTP since I could no longer navigate to the dashboard. The website itself was displaying only this error msg too. The error: “Fatal error: Class ‘ZipArchive’ not found in /home/(user)/public_html/wp-content/plugins/cyclone-slider-2/cyclone-slider.php line 403”. (User=website acct user on server). The website is: http://www.statelineliquors.com. I’ve since replaced the slider with another plugin but as I said, I was happy with your plugin. Any idea what might’ve caused this?

    https://wordpress.org/plugins/cyclone-slider-2/

Viewing 15 replies - 16 through 30 (of 38 total)
  • I have the same error with every site in Cpanel servers, but I have no problem on servers with other technology

    It happens on systems where php is compiled without the zip archive extension.

    For a quick fix, comment out line 403 In cyclone-slider.php as below:

    function cycloneslider_service_zip_archive( $plugin ){
    // return new ZipArchive;
    }

    This will break the importer/exporter functionality but at least prevents the fatal error which locks you out of the dashboard and will get the slideshows working again in 2.10.

    Getting same error here too

    PHP Fatal error: Class ‘ZipArchive’ not found in /public_html/wp-content/plugins/cyclone-slider-2/cyclone-slider.php on line 403

    louverture, thanks for the details on commenting out that line. I had tried that which made it work again, but I wasn’t sure how important having that line in was. That fixed the problem on the one site that it didn’t work on for us.

    Same problem here – just want to advise that it looks like a common problem

    I had a backup which I rolled back to but now, I am running old version of software.

    WP version: 4.2.2
    PHP Version: 5.3.29
    MySQL Version: 5.5.42

    SurfSD

    (@surfsd)

    For a quick fix, comment out line 403 In cyclone-slider.php as below

    I know this is an old post, I encountered this slider with a theme (that I’m on my third week of cleaning up) and got to this issue. Surprised it’s still going on.

    Just an FYI, the half correct way to remove the code that includes the ZipArchive class is to change line 403 to this:

    function cycloneslider_service_zip_archive( $plugin ){
    	if (class_exists('ZipArchive')) {
    		return new ZipArchive;
    	}
    }

    That way if the class exists it will still function.

    The fully correct way would be to throw an exception and inform the user what is actually wrong so they can install the extension. I don’t think I’ll put that much work into it, I’ll just recompile PHP and be done with it. 🙂

    SurfSD

    (@surfsd)

    Updated:

    you should probably add

    return null;

    … after the if block to be explicit, even though if not found the function returns void. Which is almost the same thing.

    I recompiled Apache. There is no ZipArchive extension, it is compiled with the Zip extension. I am on WHM so EasyApache makes it pretty painless, just go to Exhaustive List and include Zip in the PHP compile . . .

    Command line add ‘–enable-zip’ to the params. Cyclone Slider 2 works fine without hacking the plugin after that.

    David Borrink

    (@davidborrink)

    SurfSD,

    THANK YOU!!! Your fix works!!

    After moving a site to a new server, suddenly the Slider was giving me a white screen of death. Obviously the new server doesn’t have the ZipArchive support and needed to have those lines changed. I did exactly what you said in both posts and I’ll post it all in full here so someone else can copy-paste the full code to replace on line 403…

    function cycloneslider_service_zip_archive( $plugin ){
    	if (class_exists('ZipArchive')) {
    		return null;
    	}
    }

    Like many others I really like this slider as it’s clean and responsive, and the dashboard interface is excellent. I hope they update this feature for the future versions.

    For now, I’m bookmarking this file for reference. Looks like we’ll have to use a hacked version for now.

    SurfSD

    (@surfsd)

    I think you misunderstand the logic . . . look . . . .

    The original: something somewhere (we don’t care what) calls the function cycloneslider_service_zip_archive and it originally just assumes the class exists and returns an instance of the object.

    function cycloneslider_service_zip_archive( $plugin ){
    	return new ZipArchive;
    }

    That is the source of the error if the class isn’t compiled with PHP. what the below code does says “only return the class if it DOES exist.” The advantage is that if the Zip class does get installed it will work normally. (Note I’ve added the extra “return” line I mentioned.)

    function cycloneslider_service_zip_archive( $plugin ){
    	if (class_exists('ZipArchive')) {
    		return new ZipArchive;
    	}
    	return null;
    }

    Line 1: Call the function to **attempt** to include ZipArchive
    Line 2: Ask PHP to see if this class exists
    Line 3: If it does, return instance of the object.
    Line 4: end of logic block; if it has returned it will go no further.
    Line 5, If the Zip class is not installed, as in your case, lines 2-4 are skipped and NOW we return null; there is no ZipArchive object.

    What you’ve done there is return null in any case, which is the same as commenting it out:

    function cycloneslider_service_zip_archive( $plugin ){
    	// return new ZipArchive;
    }
    David Borrink

    (@davidborrink)

    Thanks for clarifying. I’ll use that instead.

    Author released version 2.10.2 recently, claims this is fixed, but I’ve already re-compiled PHP with Zip so I can’t verify. Anyone without Zip compiled in PHP willing to install the new version and let us know if it’s fixed? Looks to me like it might cause the same problem, lines 402 – 404 of cyclone-slider.php:

    function cycloneslider_service_zip_archive( $plugin ){
        return new ZipArchive;
    }

    If it’s still broken for you, see code above which first checks if the class exists before instantiating it.

    I updated it yesterday and it worked fine without having to re-edit.

    Plugin Author kosinix

    (@kosinix)

    Hello guys,

    First I apologize for the very late reply and thank you for your patience.

    The problem was caused by missing ZipArchive class in some PHP installations. This will depend on your webhost. ZipArchive is used by the Export/Import functionality.

    This problem is now addressed in version 2.10.3, please backup and update your plugin copy.

    Best regards

    Thanks very much kosinx. I only have one host that I have no control over and it did not have that zip archive so this is so much better that I don’t have to go manual edit so the site isn’t down there.

    Plugin Author kosinix

    (@kosinix)

    Your welcome Dzynit I’m happy to help.

    PS: I’m not marking this thread as resolved yet and wait for the other users feedback to see if their problem is resolved. Thanks

Viewing 15 replies - 16 through 30 (of 38 total)
  • The topic ‘Fatal Error After Update’ is closed to new replies.