boolesrings / Simple-Mathjax-wordpress-plugin

15 stars 9 forks source link

PHP warning messages when updating #25

Closed kebekus closed 4 years ago

kebekus commented 4 years ago

Thank you for this wonderful plugin.

A while ago I started to see error messages whenever I try to check for updates. More precisely, the command 'wp plugin update --all' returns the following:

PHP Warning: array_merge(): Argument #1 is not an array in /var/www/html/wp-content/plugins/simple-mathjax/simple-mathjax.php on line 29 Warning: array_merge(): Argument #1 is not an array in /var/www/html/wp-content/plugins/simple-mathjax/simple-mathjax.php on line 29 PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/html/wp-content/plugins/simple-mathjax/simple-mathjax.php on line 46 Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/html/wp-content/plugins/simple-mathjax/simple-mathjax.php on line 46 PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/html/wp-content/plugins/simple-mathjax/simple-mathjax.php on line 46 Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/html/wp-content/plugins/simple-mathjax/simple-mathjax.php on line 46 PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/html/wp-content/plugins/simple-mathjax/simple-mathjax.php on line 46 Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/html/wp-content/plugins/simple-mathjax/simple-mathjax.php on line 46 PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/html/wp-content/plugins/simple-mathjax/simple-mathjax.php on line 46 Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/html/wp-content/plugins/simple-mathjax/simple-mathjax.php on line 46 PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/html/wp-content/plugins/simple-mathjax/simple-mathjax.php on line 46 Warning: array_key_exists() expects parameter 2 to be array, null given in /var/www/html/wp-content/plugins/simple-mathjax/simple-mathjax.php on line 46 Success: Plugin already updated.

pkra commented 4 years ago

Thanks for the report.

@christianp do you have time to take a look?

christianp commented 4 years ago

I've rearranged the code so that everything is under a SimpleMathJax namespace. Can you pull the latest version from GitHub and let me know if that's any better?

kebekus commented 4 years ago

Hi, thanks for your very quick response. I puller version 2a5aa9e from GitHub a few minutes ago, and

christianp commented 4 years ago

Fab! You caught me at the right time.

pkra commented 4 years ago

Thanks @christianp!

toddpfaff commented 4 years ago

I need this fix as well. Is it expected that I am not getting this in the most up-to-date version of the simple-mathjax plugin found via wp-cli? wp-cli is telling me that I have version 2.0 and no update is available. Do I have to pull it via git for the time being?

pkra commented 4 years ago

Hm. Looks like the plugin registry is still at 2.0.

ping @christianp @scoskey do you happen to have access to the Wordpress SVN to push a release? I'm unable to get on at the moment.

christianp commented 4 years ago

I had changed the Stable tag field in readme.txt as the wordpress docs said, but it seems that I actually needed to change the Version line in simple-mathjax.php.

The wordpress.org plugin page now says that the current version is 2.0.1, so hopefully that has sorted it. @toddpfaff can you tell me if you get the right version now?

toddpfaff commented 4 years ago

I'm not seeing a change yet in wp-cli output. Maybe we have to wait a while?

+------------------------------+----------+-----------+---------+ | name | status | update | version | +------------------------------+----------+-----------+---------+ | akismet | active | none | 4.1.6 | | clean-my-archives | inactive | none | 1.2.0 | | jquery-collapse-o-matic | active | none | 1.7.13 | | enable-oembed-discovery | active | none | 1.0.0 | | gutenberg | inactive | available | 8.8.0 | | jetpack | active | none | 8.9 | | pods | active | none | 2.7.22 | | recent-posts-widget-extended | active | none | 0.9.9.7 | | simple-mathjax | active | none | 2.0 | | simple-yearly-archive | active | none | 2.1.2 | | user-role-editor | active | none | 4.56 | | wordpress-importer | inactive | none | 0.7 | +------------------------------+----------+-----------+---------+

pkra commented 4 years ago

@toddpaff let us know if the problem persists.

toddpfaff commented 4 years ago

Problem resolved!

wp-cli --path=. plugin list +------------------------------+----------+-----------+---------+ | name | status | update | version | +------------------------------+----------+-----------+---------+ | simple-mathjax | active | none | 2.0.1 | +------------------------------+----------+-----------+---------+

Thanks!

pkra commented 4 years ago

Thanks for following up with us.