Get WP CLI to hide debug warnings and notices in JSON output, same setting as website

A quick manual solution is to direct all error output to a log file somewhere or even to /dev/null. With your command this would look like this: wp plugin list –fields=name,status,update,version,update_version,title –format=json 2> ./cli-command.err.log If you totally don’t care about the errors, warnings and notices, you could send it to /dev/null like this: wp plugin … Read more

Redirect one of two domains on one WordPress installation

You could check the contents of the $_SERVER[‘REQUEST_URI’] array when the site is loaded, by placing the conditional checking logic in your header.php file of your site and then redirect the user to the appropriate language from there. For example in header.php add: $incomingUrl = $_SERVER[‘REQUEST_URI’]; if($incomingUrl == ‘mydomain.dk’) { wp_redirect(URL FOR THIS LANGUAGE); exit; … Read more

register_theme_directory somehow “fails” when folder is outside of WP-Folder

While I cannot speak to your specific white-screen issue, registered theme directories must be within the Apache document root, at minimum. Many files in themes, such as CSS, JS, images, etc, are served directly by the webserver, not via calls to WordPress. So having a theme directory that is not directly accessible and serve-able by … Read more

Prevent WordPress updates from overriding custom language translations?

Modify your installation such that your custom Farsi language files are associated with a non-standard WPLANG value. For example, instead of the standard ‘fa_IR’, maybe try something non-standard like ‘farsi_IR’ (or even ‘myCustomFarsi_IR’). This way, when new WordPress versions are released for the “official” Farsi version, you will no longer get updated.

wp-config.php being deleted

The problem turned out to be that wp-config was infected with some sort of code. Typical of what you see at the top of infected .php files. I have cxs running on the server and it was, quite rightly, detecting the malicious (I assume) code and quarantining the file. When I restored the file, because … Read more

What should be disabled to run on an internal network with no access to the Internet?

After more fruitless searching, I stumbled across this article from WP Tavern which mentioned a plugin then called “WP Local Dev Environment,” now called Airplane Mode. The plugin blocks a long list of things that WordPress does which require checking something from the Internet. While it is intended to be toggled on or off depending … Read more