Skip Navigation

Resolved

Reported for: WPML Multilingual CMS 4.6.8

Resolved in: WPML 4.6.12

Topic Tags: Bug

Overview of the issue

You will encounter some PHP deprecation messages when running WPML on PHP version 8.2. These messages relate to dynamic property creation in various PHP files within the WPML plugin.

[13-Nov-2023 08:44:04 UTC] PHP Deprecated: Creation of dynamic property Whip_RequirementsChecker::$configuration is deprecated in .../wp-content/plugins/sitepress-multilingual-cms/vendor/yoast/whip/src/Whip_RequirementsChecker.php on line 37
[13-Nov-2023 08:44:04 UTC] PHP Deprecated: Creation of dynamic property Whip_RequirementsChecker::$messageManager is deprecated in .../wp-content/plugins/sitepress-multilingual-cms/vendor/yoast/whip/src/Whip_RequirementsChecker.php on line 38
[13-Nov-2023 08:44:05 UTC] PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in .../wp-content/plugins/sitepress-multilingual-cms/classes/API/REST/class-wpml-ate-proxy.php on line 128

Workaround

Please, keep in mind that WordPress’s compatibility with PHP versions (reference chart) indicates some known incompatibilities with PHP 8.2.
Thus, consider temporarily using an earlier PHP version if the messages are disruptive.

43 Responses to “PHP 8.2 - Deprecated: Creation of dynamic property Whip_RequirementsChecker::$configuration is deprecated”

  1. Hi,
    WP 6.1 already had a beta support for PHP 8.2
    it’s WP 6.4.2 and latest update 4.6.9 still does not contain fix for this issue.
    When can we expect for this to be fixed?

    Thank you very much and have a pleasant day.

    • Hello there,
      WPML 4.6.9 doesn’t include a fix for this. However, we can’t provide an ETA as this fix totally depends on the devs roadmap.
      We will keep this erratum updated.

  2. Hi, I checked, it’s literally a forgotten property declaration on the class,
    fix:
    from this

    class Whip_RequirementsChecker {
    ...
    private $requirements;
    // MISSING CODE HERE
    private $textdomain;

    Replace // MISSING CODE HERE with

    private $configuration;
    private $messageManager;

    or this is absolutely safe (as you did not declare the visibility before and PHP has props public by default)

    public $configuration;
    public $messageManager;

    If you give me some git access, I can open a merge/pull request.

    If you installed this automatically, it’s just about updating the whip package – latest whip from yoast already has this fixed! : https://github.com/Yoast/whip/blob/main/src/RequirementsChecker.php

    • Thank you very much for your comment and this information, I’ve passed this information to our devs, I’ll keep you informed.
      Regards

  3. Hi Andrés,

    are there any news on this issue? It still exists in v4.6.9 and PHP v8.2.
    For WordPress v6.4, what was released 4 month ago, it is recommended to use PHP v8.1 or v8.2!

    Thanks.

    Regards,
    Tobias

    • Hello Tobias,
      We are planning a major release for adding fully support for PHP 8.2. However, keep in mind that according to this chart, the latest fully supported version for WP is PHP 7.4. PHP 8.1 is supported with exceptions and 8.2 is in Beta.
      I hope it helps

  4. +1 for expediting this fix, please! We are also seeing similar “dynamic property” deprecation errors being thrown by WPML CMS Navigation 1.5.5.

    WPML is the only thing in our entire WordPress stack (including WP Core) still throwing errors like this. WordPress’s chart notwithstanding, PHP’s own Supported Versions chart at https://www.php.net/supported-versions.php states that active support for PHP 8.1 ended on 25 Nov 2023. (Some major hosting providers like WP Engine will not even support 8.1 any longer.)

    Meanwhile, active support for PHP 8.2 ends on 8 Dec 2024 — only about 8 months from now.

    Thanks!

    • Hello there,
      Currently, we don’t have reports related to our WPML CMS Navigation plugin. I’ll create an internal ticket but it would be really helpful if you could help us creating a report in our assistance channel.
      Thank you very much for your help.
      Andrés

  5. PHP support chat is a great argument – by the end of the year PHP will STOP releasing even the critical security fixes for 8.1!

    @Andrés do you have any information when the major release with complete PHP8.2 support could be?

    • Unfortunately, we can’t provide you an ETA. However, I can assure you that this is in our devs roadmap and it haven’t been forgotten.
      I’ll keep this page updated when I have any news.
      Cheers!

    • PHP 8.2 is still under beta support for WordPress. We will update this link once we have a new version fully compatible.

        • Hello Oliver,
          Currently, we don’t have a patch available. You can temporary hide the errors in the frontend with a code like the following in your wp-config.php file:
          define('WP_DEBUG', false);
          define('WP_DEBUG_DISPLAY', false);
          @ini_set('display_errors', 0);

          I hope it helps.

  6. Since there’s still no fix, here’s a simple solution you can drop in any plugin or just create a new file in /wp-content/mu-plugins/wpml-82-bug.php
    and place that function in there:


    function remove_action_wpml_whip() {
    global $wpml_whip_requirements;
    if ( $wpml_whip_requirements instanceof WPML_Whip_Requirements ) {
    remove_action( 'plugins_loaded', array( $wpml_whip_requirements, 'load_whip' ) );
    }
    }
    add_action( 'plugins_loaded', 'remove_action_wpml_whip', 9, 0 );

    This will fix the notice for Whip and also disable Whip (auto-update,… stuff) which you usually don’t want anyway, since it’s a little performance hog.

    • Thank you for this. Just a warning, though: you’re going to have issues when WPML does get around to updating this because Yoast/whip switched to use namespacing and removed the whip_ prefix. So, once that update makes it over, that class won’t exist. Add a class_exists check, though, and you’ll be fine.

  7. Just tagging onto this that there are deprecation errors in acfml as well.

    Deprecated: Using ${var} in strings is deprecated, use {$var} instead in C:\wamp\www\_clients\kikk-24\wp-content\plugins\acfml\classes\strategy\repeater-shuffle\OptionsPage.php on line 91

    I know you say people are working on it, but this error and the others mentioned elsewhere in this topic are 2 second fixes which are fully backwards-compatible…

    • Thank you for your report! I’ve passed a note to our devs, however, it would be great if you can start a chat in our assistance channel. In that way, we will be able to collect all the required information and fix it in case it is under our radar.
      Thank you again for your help.

      • As in a new forum topic?

        It’s all very related surely – There are 2 or 3 deprecated things that are throughout all of your codebase, but they are all every easy to find (I just had a look for ${ for example and found a few more (such as class-wpml-ate-proxy.php line 128).

        I’m sure it will be fixed in the next major release, but as of now I have no choice but to directly modify the plugin files themselves.
        Surely a hotfix is in possible?

        • Thank you @nathanR-5, no need for a new forum topic. I’ve already created an internal ticket and passed this information to our devs.
          I’ll let you know once we have any news regarding a new release.

    • Thank you for your insights, James. Providing full compatibility for PHP 8.2 is schedule for WPML 4.7.
      We’ll keep this erratum updated.
      Thank you for your understanding.

    • Hello Dylan,
      Yes, providing full compatibility for PHP 8.2 is schedule for WPML 4.7.
      We’ll keep this erratum updated.

    • This depends entirely of our devs and their roadmap. I’ll let you know once we have any news or a beta available.

      • It’s utterly absurd how long this has been sitting out, and the canned responses that have been given. I’m finding it hard to believe that your developers even have a roadmap, otherwise a simple update or estimated date on this ticket wouldn’t be so difficult to extract from you.

        Please provide an estimated release date. It’d be one thing if this were a free plugin, but you guys are running a business and have paying customers asking important questions. Answer them.

        • Hi there, unfortunately we cannot give an ETA, but the fix is already in progress. I have asked our team to increase the priority for this ticket.

  8. I, too, would love to see this primary issue with whip resolved.

    But regarding the third warning of the original post:
    PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in .../wp-content/plugins/sitepress-multilingual-cms/classes/API/REST/class-wpml-ate-proxy.php on line 128

    This would require the most simple of fixes. On line 128:
    header( "Status: ${status_code} ${status_message}" );
    would become:
    header( "Status: {$status_code} {$status_message}" );

    The same proper format is used elsewhere in that same file. It’s a simple mistake with a simple solution. Please pass it on to the devs, and have a great day!

  9. Still waiting for fixing that issue. Still impossible to use PHP > 8.1 along with complementary WPML plugins (i.e. CMS Navigation), given that this is not a free plugin.
    Please hurry up!

    • Hello @christianc-8,
      We totally understand you, this is already in our devs roadmap.
      We will update here once we have any beta or hotfix.

    • Hi there,
      I’m not sure if both issues are related. I recommend you to start a chat in our assistance channel, in that way we will be able to investigate it better.
      Unfortunately we cannot give an ETA, but the fix is already in progress and providing full compatibility for PHP 8.2 is schedule for WPML 4.6.12.
      Regards

  10. Telling people to use a unsupported PHP version that no longer receives security fixes is absurd. You had a volunteer here fix the issue in 3 lines of code back in February already and you guys haven’t been able to push a simple hotfix release out for it, and instead encourage people to forgo security just to make WPML work with their sites, how is this okay?

    • Hi there,
      We cannot give an ETA, but the fix is already in progress and providing full compatibility for PHP 8.2 is schedule for WPML 4.6.12.
      Regards

  11. Hello everyone,
    We are happy to announce that WPML 4.6.12 was released and it should solve the issue here reported.
    Regards