Support » Plugin: Constant Contact Forms » Update breaks site

  • ResolvedModerator Bet Hannon

    (@bethannon1)


    Support Team Volunteer Coordinator

    The latest update broke our site. I’ve reverted to the previous plugin version, but here’s the error message:

    An error of type E_ERROR was caused in line 2123 of the file /home/{domain}/public_html/wp-content/themes/ubbc-theme/lib/class-plugin-activation.php. Error message: Cannot redeclare tgmpa() (previously declared in /home/{domain}/public_html/wp-content/plugins/constant-contact-forms/vendor/webdevstudios/wds-shortcodes/vendor/tgmpa/tgm-plugin-activation/class-tgm-plugin-activation.php:1927)

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Constant Contact

    (@constantcontact)

    Hey Bet, can you check the /themes/ubbc-theme/lib/class-plugin-activation.php file to see if the theme is doing any sort of function_exists checks, and if they are checking for a matching function name compared to what they’re ending up using?

    Due to load order, our copy is being loaded first, but apparently the theme is not matching up like needed.

    That said, we are planning to make some changes in a future release to help avoid these conflicts, but the theme needs to be properly avoiding conflicts as well, so it’s not just our plugin.

    Moderator Bet Hannon

    (@bethannon1)

    Support Team Volunteer Coordinator

    This what you are looking for?

    		 */
    		function load_tgm_plugin_activation() {
    			$GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance();
    		}
    	}
    
    	if ( did_action( 'plugins_loaded' ) ) {
    		load_tgm_plugin_activation();
    	} else {
    		add_action( 'plugins_loaded', 'load_tgm_plugin_activation' );
    	}
    }
    Plugin Author Constant Contact

    (@constantcontact)

    No, it’d be something like if ( function_exists( 'something' ) ){ or very similar. If you prefer to just provide the whole file, we can check/confirm as well.

    Moderator Bet Hannon

    (@bethannon1)

    Support Team Volunteer Coordinator

    Here’s the file: https://pastebin.com/ZTqaMWBf

    Plugin Author Constant Contact

    (@constantcontact)

    If you look at line 2113 you’ll see something very close to this:

    if ( ! function_exists( 'kreativ-pro' ) ) {
        /**
         * Helper function to register a collection of required plugins.
         *
         * @since 2.0.0
         * @api
         *
         * @param array $plugins An array of plugin arrays.
         * @param array $config  Optional. An array of configuration values.
         */
        function tgmpa( $plugins, $config = array() ) {
    

    This would be where the issue is coming from on the theme’s side. It should be doing something like this instead, since the tgmpa function is part of a bundled library that many other plugins and themes ship with.

    if ( ! function_exists( 'tgmpa' ) ) {
    

    For the time being, I have to believe that you’ll be fine making that change to help make sure everything can work together, and we’ll make sure to put in the changelog for future releases of our plugin if we’ve addressed issues around TGMPA issues.

    Plugin Author Constant Contact

    (@constantcontact)

    Hey @bethannon1 If you haven’t resolved this one yet, please upgrade to version 1.5.3 which we released earlier this afternoon. It has the fore-mentioned changes around TGMPA on our end.

    Moderator Bet Hannon

    (@bethannon1)

    Support Team Volunteer Coordinator

    I just saw that update! Thanks!

    Plugin Author Constant Contact

    (@constantcontact)

    Bonus points and our thanks if you could confirm that the conflicts go away.

    Have a good day 🙂

    Moderator Bet Hannon

    (@bethannon1)

    Support Team Volunteer Coordinator

    Yay for bonus points!

    Yes! The error notifications have gone away. Thanks!

    Plugin Author Constant Contact

    (@constantcontact)

    Awesome. Thanks.

    *provides all the bonus points*

    Hi guys i will like to ask for some help on this topic i just updated my theme template and now i’m not able to login to WP anymore it shows me the message saying: Tgm already loaded, can you please show me how to fix this with a step by step guide, im not able to login to WP just to remind you thanks…

    Moderator Bet Hannon

    (@bethannon1)

    Support Team Volunteer Coordinator

    Fuegedon, please create a new topic per forum guidelines. If needed, put in the link to this topic, but I think you have a different issue.

    • This reply was modified 6 months, 2 weeks ago by Bet Hannon.
Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Update breaks site’ is closed to new replies.