PHP warning are displaying when using WP CLI [closed]

The first thing to check for this issue is the WP_DEBUG, WP_DEBUG_LOG and WP_DEBUG_DISPLAY constants in the wp-config.php file. They have to be set to false or be commented out (the default value is false). Else, no matter which global log_errors, display_errors or error_reporting settings you have, you will still see those warnings when running … Read more

WordPress 4.9.5 PHP intermittent warning trim() expects parameter 1 to be string, array given

I ran into this today. It’s a bug. I filed a bug report here: https://core.trac.wordpress.org/ticket/46797 The problem is this line of code: $qv[‘name’] = trim( $qv[‘name’] ); Source: https://github.com/WordPress/wordpress-develop/blob/a0ca5afd8977b5a3857084d9cb1bd345166e2f21/src/wp-includes/class-wp-query.php#L764 A (malicious) user sends a request that looks like: GET /?q=user/password&name[#post_render][]=passthru&name[#type]=markup&name[#markup]=echo ‘Vuln!! patch it Now!’ > vuln.htm; echo ‘Vuln!!’> sites/default/files/vuln.php; echo ‘Vuln!!’> vuln.php; cd sites/default/files/; echo … Read more

How to display warning on post editor when trying to add new term to custom taxonomy?

Whilst this doesn’t show a warning as you are asking for, you could always hide the “add new” link using the admin_head action: function yourprefix_admin_head() { echo ‘<style> #language-add-toggle { display: none; } </style>’; } add_action(‘admin_head’, ‘yourprefix_admin_head’); The element ID is the taxonomy name followed by -add-toggle. This is enough for most cases, unless you … Read more

ftp_nlist() and ftp_pwd() warnings

After all, it was already in the question! Context Both plugins are related to my WordPress site theme (uplift). I can’t understand what it is doing or where, but when it detects that the owner of the files isn’t its executing user (apache), it changes the access method to FTP. This action doesn’t seem logical, … Read more

“Warning: count()” error on php 7.2

Yes, I already knew the cause of what you’re experiencing: The $page and $pages global variable have not been set up and a call to get_the_content or get_the_excerpt would return that error: count(pages) That said, pages global variable is set to null, calling count(pages) triggers that error because a null value cannot be counted. To … Read more

PHP Warning on fresh install (Connection timed out)

The answer is apparently YES, I should worry. After some research, I’ve found that the warning seems to be related to misconfigurations on the server that WordPress is hosted on (ie. a problem with my server, not WordPress). Common misconfigurations: Server doesn’t have DNS, and so it can’t figure out who “example.com” is, even though … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)