Title: Compatibility with Polylang
Last modified: May 22, 2017

---

# Compatibility with Polylang

 *  [Česlav Przywara](https://wordpress.org/support/users/chesio/)
 * (@chesio)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/compatibility-with-polylang-4/)
 * Hi Tijmen,
 * I was happy to see that version 2.2.8 brings in compatibility with Polylang, 
   but I found out there are still some small issues to be resolved.
 * One thing I get in my debug.log is “Use of undefined constant ICL_LANGUAGE_CODE”
   on `line 139` of `wp-store-locator/inc/class-i18n.php`.
 * I dig a bit in the code and this notice is caused by the fact that in `WPSL_i18n::
   wpml_exists()` you determine WPML presence by checking that function `icl_register_string`
   exists. However, this function is also [defined by Polylang](https://github.com/polylang/polylang/blob/master/modules/wpml/wpml-legacy-api.php#L206-L210)
   for compatibility with WPML-aware plugins, but various ICL_* constants are not,
   thus the notice.
 * I know it’s maybe problem on Polylang side, but since your plugin is Polylang
   aware already, I believe it’s an easy one for you to fix.
 * Thanks for great plugin by the way!
    Česlav

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

 *  Thread Starter [Česlav Przywara](https://wordpress.org/support/users/chesio/)
 * (@chesio)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/compatibility-with-polylang-4/#post-9155076)
 * Another related PHP notice:
 * `Use of undefined constant ICL_SITEPRESS_VERSION in [...]/wp-store-locator/inc/
   class-i18n.php on line 87`
    -  This reply was modified 8 years, 11 months ago by [Česlav Przywara](https://wordpress.org/support/users/chesio/).
 *  Plugin Author [Tijmen Smit](https://wordpress.org/support/users/tijmensmit/)
 * (@tijmensmit)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/compatibility-with-polylang-4/#post-9158338)
 * Thanks for letting me know, I will look into it 🙂
 *  Thread Starter [Česlav Przywara](https://wordpress.org/support/users/chesio/)
 * (@chesio)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/compatibility-with-polylang-4/#post-9315640)
 * Hi,
 * I noticed that these issues still haven’t been fixed in version 2.2.9, so I attempted
   to fix them myself.
 * The second PHP notice I mentioned is easy to fix, just check if the `ICL_SITEPRESS_VERSION`
   constant is defined before using it in `version_compare()` in `/wp-store-locator/
   inc/class-i18n.php on line 87`:
 *     ```
       if ( defined( 'ICL_SITEPRESS_VERSION' ) && version_compare( ICL_SITEPRESS_VERSION, 3.2, '>=' ) ) {
       ```
   
 * There are no side-effects, the condition is evaluated the same way as before 
   and the notice is gone.
 * Cheers,
    Česlav

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

The topic ‘Compatibility with Polylang’ is closed to new replies.

 * ![](https://ps.w.org/wp-store-locator/assets/icon-256x256.jpg?rev=1007784)
 * [WP Store Locator](https://wordpress.org/plugins/wp-store-locator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-store-locator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-store-locator/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-store-locator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-store-locator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-store-locator/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Česlav Przywara](https://wordpress.org/support/users/chesio/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/compatibility-with-polylang-4/#post-9315640)
 * Status: not resolved