Tags
, ,

WP-CLI Error: PHP Deprecated: implode(): Passing glue string after array is deprecated.

I use WP-CLI to maintain my WordPress sites. It’s simple, it handy, and it works without any issues.

For example, I can updates all my plugins and themes (if updates are available) by executing wp theme update --all and wp plugin update --all. If WordPress core engine is available, I only need to run wp core update.

But there is a problem when I update WordPress plugins recently. Running wp plugin update --all to update all available plugin updates give me an error:

PHP Notice:  Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663
Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php on line 663

But, all updatable plugins were updated successfully. I tried to find the solutions, but I found nothing. I also try to use the nightly version via wp update --nightly, but still no luck.

Here are my wp --info

OS: Linux 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64
Shell: /bin/bash
PHP binary: /usr/bin/php7.4
PHP version: 7.4.3
php.ini used: /etc/php/7.4/cli/php.ini
MySQL binary: /usr/bin/mysql
MySQL version: mysql Ver 8.0.21-0ubuntu0.20.04.4 for Linux on x86_64 ((Ubuntu))
SQL modes:
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: /home/path/to/my/directory/
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.5.0-alpha-068c252

Tags
, , ,

'cannot yet handle MBCS in html_entity_decode' error on WP-DownloadManager

I am currently working on a WordPress-powered site. One of its features is a download section. After comparing some WordPress plugins, I decided to use Lester ‘GaMerZ’ Chan‘s WP-DownloadManager.
When I use that plugin on WordPress 2.5.1, I got an error. It’s something like this:

Warning: cannot yet handle MBCS in html_entity_decode()! in /home/.../wp-downloadmanager.php on line 308

Is it a bug? It seems that I got this error message because this plugin needs PHP 5 (I still use PHP 4). Since many hosts having PHP 5-enabled (even it does not always installed as the default version), it should not be that difficult to solve this issue. All I need to do is making all .php files are treated as PHP 5 files. Okey, this is a straight forward solution: add a new line in your .htaccess file. You should find it in your WordPress directory, if not, just add this line:

AddType application/x-httpd-php5 .php

And, the problem solved.
Update: Put AddType application/x-httpd-php5 .php in the first line in .htaccess file. Here is mine:

AddHandler application/x-httpd-php5 .php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

After that, create a new php file e.g. myphpinfo.php and include this line:

<?php phpinfo(); ?>

This will display about PHP version (affected by .htaccess).

Tags
, , ,

SimplePie Updates

Simplepie Logo
Last week, Geoffrey Sneddon of SimplePie planned to leave his role developing SimplePie. As a reminder, SimplePie is a code library (written in PHP) that can be use to do creative things using RSS and Atom feeds. If you have heard about Magpie RSS, SimplePie does similar actions. Do I use it? Well, when I developed Asia Blogging Network together with the team, I also use SimplePie to display global entry from the network. You can see the action on the frontpage.
Okey, so does SimplePie join the deadpool? It seems not. Ryan Parman — the other developer — took over the development. And another new version of SimplePie (SimplePie 1.1) was released few days ago, with some improvements. Great!