• 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 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

    (@chesio)

    Another related PHP notice:

    Use of undefined constant ICL_SITEPRESS_VERSION in [...]/wp-store-locator/inc/class-i18n.php on line 87

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Thanks for letting me know, I will look into it 🙂

    Thread Starter Česlav Przywara

    (@chesio)

    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.