Support » Plugin: CSSable Countdown » plugin activation brakes 2 of my sites: CSSable-Countdown.php on line 154

  • Resolved delta123

    (@delta123)


    There seems to be an issue with your plugin, it broke 2 of my sites multiple times during activation.

    Errors below:
    Fatal error: Cannot redeclare my_enqueue() (previously declared in /home/site1/public_html/mysubdomain/wp-content/plugins/cssable-countdown/CSSable-Countdown.php:154) in /home/site1/public_html/mysubdomain/wp-content/plugins/cssable-countdown/CSSable-Countdown.php on line 154

    Fatal error: Cannot redeclare my_enqueue() (previously declared in /home/site2/public_html/wp-content/plugins/cssable-countdown/CSSable-Countdown.php:154) in /home/site2/public_html/wp-content/plugins/cssable-countdown/CSSable-Countdown.php on line 154

    I had to remove plugin via ftp in order to restore access to sites again.

    Line 154 in my case seems to be a blank line after:
    ‘lang’ => get_bloginfo(‘language’),

    Strange there is no other reports about this as it happens on both sites, I’m wondering if this could be caused by some other plugin.
    for example: Speed Booster Pack or Autoptimize, which tweak around with CSS and JS….

    I would like to try out this plugin, Any ideas how to fix this issue?

    https://wordpress.org/plugins/cssable-countdown/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author dmonnier

    (@dmonnier)

    You are correct, another plugin is conflicting with CSSable Countdown. HOWEVER, the fix is very simple:

    Open CSSable-Countdown.php and search for:

    function my_enqueue($hook)

    Replace my_enqueue($hook) to cssable_countdown_enqueue($hook)

    then a couple lines down:

    add_action( 'admin_enqueue_scripts', 'my_enqueue' );

    change that my_enqueue to cssable_countdown_enqueue.

    Thank you very much for finding this incompatibility! I will fix this in the next release of this plugin and I’ll make sure I name my functions better next time 🙂

    If this solution doesn’t work, please let me know, but I’m pretty sure it will.

    Hi,

    1) Installed plugin but did not activate it.
    2) Edited plugin file via the plugin editor.
    3) Made the changes you recommended and saved it but I’m still getting the exact same error as before.
    4) After recreating issue, I doubled checked that the changes were implement properly by downloading file to my local drive, before i deleted the plugin via ftp.

    Sorry, status of issue is not resolved!

    Plugin Author dmonnier

    (@dmonnier)

    If you changed the name of the function to something unique like the suggested cssable_countdown_enqueue, you should not still be getting the exact same error…

    There are no other instances of my_enqueue, so if the function name change is not working, perhaps try a hard refresh after changing the function name. If it’s still the same error, you have cache issues. Clear the WordPress cache (such as if you’re running WP Total Cache) and your browser’s cache, then try a hard refresh.

    Other than that, try disabling all other plugins and enable them one-by-one until you find the one that conflicts with CSSable Countdown.

    I have setup a Wamp test environment as I could not afford to mess around with the production environments, and I think I been able to pinpoint what other process is causing the conflict, it seems to be my child theme.

    1st i made sure i disabled and removed all other plugins, there was nothing left, not even caching plugins, but issue was still occurring.

    So I changed the theme to Twenty Fourteen and was able to active your plugin, I then attempted to re-activate the affected theme and was able to recreate the issue again while your plugin was active. Using trial and error, i establish that all other themes are fine but the particular child theme is the one that breaks your plugin.

    http://i58.tinypic.com/e8395f.png

    What is strange is that no one else has reported this issue before, so it must be something in your code.

    I did find a post about a similar error:
    http://stackoverflow.com/questions/1953857/getting-a-fatal-error-cannot-redeclare-function-error

    I’m not a developer, so good luck trying to fix the issue.

    By the way, issue is not resolved 🙂

    Hi dmonnier, Not sure if you been following thread…
    when do you think we might see a fix for this issue?

    It seems like the issue occurs with the child theme but bot the parent theme.

    The theme itself seems to already use jQuery elsewhere.
    And one of the options theme offers is the ability to pull jQuery from the google CDN. Also I believe the version in the Google CDN is different from that shipped with the theme. Either way it works with parent theme but not child theme.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘plugin activation brakes 2 of my sites: CSSable-Countdown.php on line 154’ is closed to new replies.