• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Forwarded to devs WordPress Toolkit - PHP warning - Deprecated: implode(): Passing glue string after array is deprecated.

Visnet

Basic Pleskian
Username: Visnet

TITLE

WordPress Toolkit - PHP warning - Deprecated: implode(): Passing glue string after array is deprecated.

PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE

Plesk Obsidian 18.0.31.1
CentOS 7.9.2009 x86_64

PROBLEM DESCRIPTION

Using PHP 7.4.12 as the primary PHP version for all websites, the Plesk WordPress Toolkit (5.1.1-4424) throws the following PHP warning:
Code:
Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters
in file /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php in WP_CLI\DocParser::get_longdesc (line 75)

Fragment:
Code:
                    break;
                }
                $lines[] = $line;
            }
            $longdesc = trim( implode( $lines, "\n" ) );
            return $longdesc;
        }
        /**

The warning occurred almost 1000 times in less than 2 months now.

Please fix!

STEPS TO REPRODUCE

  1. Install Plesk Obsidian 18.0.x
  2. Install the WordPress Toolkit extension
  3. I guess the error occurs when the WordPress toolkit is checking the WordPress installations in the background

ACTUAL RESULT

The deprecated use of implode() is throwing a PHP warning:
Code:
Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters
in file /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php in WP_CLI\DocParser::get_longdesc (line 75)

EXPECTED RESULT

Prevent the PHP deprecated warning.

ANY ADDITIONAL INFORMATION



YOUR EXPECTATIONS FROM PLESK SERVICE TEAM


Confirm and fix bug
 
Last edited:
Interestingly enough, the version of WP-CLI bundled with the WordPress Toolkit extension is at version 1.4.0 (released Oct 17, 2017):
Code:
# cat /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/VERSION
1.4.0

Although at the moment of writing this, the current stable version of WP-CLI is actually at 2.4.0.

The deprecated use of implode() was fixed in PHP 7.4 Compatibility: Update `implode()` calls. · wp-cli/wp-cli@cefbd63 (see pull) and looks to be included in WP-CLI 2.4.0.

So to prevent this deprecated warning with PHP 7.4, the WordPress Toolkit needs to update its bundled WP-CLI bundle to 2.4.0.
 
Last edited:
Thanks for your report, we faced with this error too.

We have been updating WP-CLI to v2 and it will be available in the next release of WordPress Toolkit (5.2.3).
 
Thanks for your report, we faced with this error too.

We have been updating WP-CLI to v2 and it will be available in the next release of WordPress Toolkit (5.2.3).

Hi, WordPress Toolkit 5.2.3 was released on DFec 9, but still using WP-CLI 1.4.0?

What's the ETA for for Plesk Obsidian including WP-CLI 2.x?

Thanks.
 
WP-CLI will be updated in the nearest release of WordPress Toolkit, version 5.2.4. We are working hard on it right now, so we expect to release it soon. I can not give you a specific date, but you can expect it at the beginning of next week.
 
PHP Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php on line 75
This warning appears more than 2000 times whitin 24 hours in wp debug log.
To find that you keep using outdated technologies made me feel unsure about the dependability of WP Toolkit and Plesk in general.
:(
 
WP-CLI will be updated in the nearest release of WordPress Toolkit, version 5.2.4. We are working hard on it right now, so we expect to release it soon. I can not give you a specific date, but you can expect it at the beginning of next week.
WordPress Toolkit 5.2.4 was released on 23 December 2020 as per Plesk cahnge log.
I am using version 5.2.4-4641 on Plesk Obsidian 18.0.32 #2 running on CentOS Linux 7.9.2009
I have 3 websites with WP 5.6, PHP 7.4.13 (7.4.13-1centos.7.201126.1815)
I also have PHP 7.3.25 (7.3.25-1centos.7.201126.1815) and PHP 8.0 (8.0.0-1centos.7.201130.1749) installed but not used by any websites.
When I click on the refresh icon next to the WP sites on the WordPress Toolkit page the following entries are added to the WP debug log in less than 10 seconds:
450 times:
PHP Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/php/WP_CLI/DocParser.php on line 75

60 times:
PHP Notice: Trying to access array offset on value of type null in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 622

60 times:
PHP Notice: Trying to access array offset on value of type null in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 623

24 times:
PHP Notice: Trying to access array offset on value of type null in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/vendor/mustache/mustache/src/Mustache/Parser.php on line 278

6 times:
PHP Notice: Trying to access array offset on value of type null in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/vendor/wp-cli/extension-command/src/Theme_Command.php on line 440

6 times:
PHP Notice: Trying to access array offset on value of type null in /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wp-cli/vendor/wp-cli/extension-command/src/Theme_Command.php on line 441
That is over 600 lines of warnings and notices! In just 8 seconds... I don't think this is the way it should be normally.
I have checked WP CLI version using the below command:
plesk ext wp-toolkit --wp-cli -instance-id 1 -- cli version
The result is: WP-CLI 1.4.0

The latest release of WP-CLI is 2.4.0 which was released over a year ago but in Plesk WordPress Toolkit we are stuck with a 3 years old "solution".

Please do release an update ASAP!

Thank you.
 
Thank you for the information and detailed explanation of the severity of the problem. We are still working on an update of WordPress Toolkit that will include WP-CLI 2.4.0. It will be released as soon as we can.
 
Back
Top