Title: Cannot redeclare twig_cycle()
Last modified: April 6, 2021

---

# Cannot redeclare twig_cycle()

 *  Resolved [wadih](https://wordpress.org/support/users/wadih/)
 * (@wadih)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/cannot-redeclare-twig_cycle/)
 * Hi,
 * The error just started now, getting this:
 * Une erreur de type E_COMPILE_ERROR a été causée dans la ligne 331 du fichier /
   var/www/xxxxxxxxxxx.com/wp-content/plugins/matomo/app/vendor/twig/twig/src/Extension/
   CoreExtension.php. Message d’erreur : Cannot redeclare twig_cycle() (previously
   declared in /var/www/xxxxxxxxxxx.com/wp-content/plugins/sitepress-multilingual-
   cms/vendor/twig/twig/lib/Twig/Extension/Core.php:288)
 * Looks like it’s conflicting with twig’s usage in WPML, which indeed is an older
   version, however I can’t rush upgrading WPML because it’s always a hit or miss
   when you update WPML. But was hoping to use Matomo in the meantime.
 * I’m wondering, is it a common thing that plugin authors use the global namespace
   for their dependencies? Why not isolate the namespaces so that these types of
   issues don’t happen?
 * I’m a big fan of matomo, love the plugin.
 * Thanks,
    Wadih

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Thomas](https://wordpress.org/support/users/tsteur/)
 * (@tsteur)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/cannot-redeclare-twig_cycle/#post-14284972)
 * Hi [@wadih](https://wordpress.org/support/users/wadih/)
 * thanks for creating this issue. As far as a I know the issue is fixed in the 
   latest WPML release. In case you have a testing or staging environment it may
   be good to test a newer version to see if the update works for you. Hoping it’s
   a hit rather than a miss. There’s no other workaround unfortunately.
 * We generally have an issue for isolating namespaces in [https://github.com/matomo-org/wp-matomo/issues/233](https://github.com/matomo-org/wp-matomo/issues/233)
   but it’s unfortunately not trivial and we’ll aim to do this as part of the Matomo
   5 release. We can’t do this any earlier as it would be breaking APIs for Matomo
   plugins.
 * Thanks for your understanding. I’ll mark this for now as resolved as we heard
   from other users that the latest update fixes the issues but feel free to comment
   should you run into any issues after giving their update a try. Hope this helps
   [@wadih](https://wordpress.org/support/users/wadih/)
 *  [StickyPixels](https://wordpress.org/support/users/stickypixels/)
 * (@stickypixels)
 * [5 years ago](https://wordpress.org/support/topic/cannot-redeclare-twig_cycle/#post-14342392)
 * Unfortanately I have to confirm it doesn’t seem to be resolved by WPML. I’m new
   to Matomo and I get the same error.
    I am using the latest version of WPML + 
   addons. Deactivating these made the issue go away, but that is not an option.
 * Hope it can be resolved.
    Thanks, Leo
 *  Plugin Author [Thomas](https://wordpress.org/support/users/tsteur/)
 * (@tsteur)
 * [5 years ago](https://wordpress.org/support/topic/cannot-redeclare-twig_cycle/#post-14344124)
 * Thanks for the feedback [@stickypixels](https://wordpress.org/support/users/stickypixels/).
   Could you maybe check if the issue is maybe with a specific WPML addon? As it
   last time worked for me without an issue. Or maybe could you let me know what
   exact error you are getting? I assume with “same error” you mean the same error
   as in the initial post?
 *  Thread Starter [wadih](https://wordpress.org/support/users/wadih/)
 * (@wadih)
 * [5 years ago](https://wordpress.org/support/topic/cannot-redeclare-twig_cycle/#post-14344376)
 * It’s working for me now after the WPML updates. Here are my WPML versions:
 * WPML Multilingual CMS 4.4.10
    String Translation 3.1.8 Translation Management
   2.10.6 Yoast SEO Multilingual 1.3.0 Sticky Links 1.5.4
 * And Matomo: 4.2.0
 *  Plugin Author [Thomas](https://wordpress.org/support/users/tsteur/)
 * (@tsteur)
 * [5 years ago](https://wordpress.org/support/topic/cannot-redeclare-twig_cycle/#post-14344397)
 * Great, glad to hear it works now [@wadih](https://wordpress.org/support/users/wadih/)
 *  [StickyPixels](https://wordpress.org/support/users/stickypixels/)
 * (@stickypixels)
 * [5 years ago](https://wordpress.org/support/topic/cannot-redeclare-twig_cycle/#post-14351863)
 * I’m sorry, my bac: reading [@wadih](https://wordpress.org/support/users/wadih/)’
   s reply I realised I don’t have the latest WPML versions installed. For some 
   reason my WordPress install doesn’t show update notifications for WPML.
 * I will update the lot and run some tests.
    Sorry again for the misunderstanding.
   Cheers, Leo

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Cannot redeclare twig_cycle()’ is closed to new replies.

 * ![](https://ps.w.org/matomo/assets/icon-256x256.png?rev=2309115)
 * [Matomo Analytics - Powerful, Privacy-First Insights for WordPress](https://wordpress.org/plugins/matomo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/matomo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/matomo/)
 * [Active Topics](https://wordpress.org/support/plugin/matomo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/matomo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/matomo/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [StickyPixels](https://wordpress.org/support/users/stickypixels/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/cannot-redeclare-twig_cycle/#post-14351863)
 * Status: resolved