<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wordpress &#8211; Everything is Broken</title>
	<atom:link href="https://play.datalude.com/blog/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>https://play.datalude.com/blog</link>
	<description>Efficiency vs. Inefficiency, in a no-holds barred fight.</description>
	<lastBuildDate>Mon, 21 Apr 2025 05:39:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.3</generator>
	<item>
		<title>Error reporting settings in php-fpm not recognized</title>
		<link>https://play.datalude.com/blog/2025/04/error-reporting-settings-in-php-fpm-not-recognized/</link>
					<comments>https://play.datalude.com/blog/2025/04/error-reporting-settings-in-php-fpm-not-recognized/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 21 Apr 2025 05:39:52 +0000</pubDate>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://play.datalude.com/blog/?p=739</guid>

					<description><![CDATA[I've been frustrated by this one several times. If you run an nginx server with php-fpm you'll be used to setting php values in the php-fpm pool file. That should supercede any values in php.ini So with some values this works: These all work fine. But if you look anywhere on the internet, it tells ... <a title="Error reporting settings in php-fpm not recognized" class="read-more" href="https://play.datalude.com/blog/2025/04/error-reporting-settings-in-php-fpm-not-recognized/" aria-label="Read more about Error reporting settings in php-fpm not recognized">Read more</a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I've been frustrated by this one several times. If you run an nginx server with php-fpm you'll be used to setting php values in the php-fpm pool file. That should supercede any values in php.ini<br><br>So with some values this works:</p>



<pre class="wp-block-code"><code>;;; php settings
php_flag&#91;display_errors] = off
php_admin_value&#91;error_log] = /home/bobthebuilder/logs/phpfpm.log
php_admin_flag&#91;log_errors] = on
</code></pre>



<p class="wp-block-paragraph">These all work fine. But if you look anywhere on the internet, it tells you you can also set error_logging there. It confidently tells you to use</p>



<pre class="wp-block-code"><code>php_admin_value&#91;error_reporting] = E_ALL &amp; ~E_WARNING &amp; ~E_NOTICE &amp; ~E_DEPRECATED &amp; ~E_USER_DEPRECATED
</code></pre>



<p class="wp-block-paragraph">&#8230;for example. But this doesn't work! You check and re-check the log files which are scrolling past at nausea-inducing rates. You try altering the values in php.ini, wordpress config files, anywhere you can try. But when you load up phpinfo, it just tells you you're wasting your time. You shout at google gemini a bit, but it tells you the same thing. Maybe you have some formatting errors, it suggests?<br><br>The trick, it seems is to use the numeric values. This works in your phpfpm pool file instead of the command above.</p>



<pre class="wp-block-code"><code>php_admin_value&#91;error_reporting] = 8181</code></pre>



<p class="wp-block-paragraph">That's it. And there's a pretty handy page for calculating the masks <a href="https://maximivanov.github.io/php-error-reporting-calculator/">here</a>. <br><br>Now wouldn't it be nice if PHP had pre-set log levels so all you have to do is put error_log_level = 3 instead of invoking a bitmask calculator &#8230;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://play.datalude.com/blog/2025/04/error-reporting-settings-in-php-fpm-not-recognized/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Updraft Backup settings for Hetzner S3 storage</title>
		<link>https://play.datalude.com/blog/2025/02/updraft-backup-settings-for-hetzner-s3-storage/</link>
					<comments>https://play.datalude.com/blog/2025/02/updraft-backup-settings-for-hetzner-s3-storage/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 01 Feb 2025 08:18:20 +0000</pubDate>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://play.datalude.com/blog/?p=736</guid>

					<description><![CDATA[Just a quick one, as I couldn't find the answer around the internet. That's it. Hit Test, and away you go. Backing up from US to Hetzner Germany took about 20 mins for 1.2Gb backup. Slow, but it completed without error.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Just a quick one, as I couldn't find the answer around the internet. </p>



<ul class="wp-block-list">
<li>In Updraft, chose <strong>S3-Compatible (generic)</strong> storage option</li>



<li><strong>S3 Access key</strong> and <strong>S3 Secret Key</strong> are obvious enough and are as given by Hetzner. Access Key is the smaller of the two. </li>



<li>In <strong>S3 Location</strong>, you just need the bucket name, so that it reads s3generic://mybucketname (i.e. just type mybucketname in the box)</li>



<li>In the <strong>S3 endpoint </strong>box, you want just the domain name of the storage server, eg fsn1.your-objectstorage.com<br></li>
</ul>



<p class="wp-block-paragraph">That's it. Hit Test, and away you go. </p>



<p class="wp-block-paragraph">Backing up from US to Hetzner Germany took about 20 mins for 1.2Gb backup. Slow, but it completed without error. </p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://play.datalude.com/blog/2025/02/updraft-backup-settings-for-hetzner-s3-storage/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>php-fpm monitoring for single domain</title>
		<link>https://play.datalude.com/blog/2023/06/php-fpm-monitoring-for-single-domain/</link>
					<comments>https://play.datalude.com/blog/2023/06/php-fpm-monitoring-for-single-domain/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 14 Jun 2023 10:05:35 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[script]]></category>
		<guid isPermaLink="false">https://play.datalude.com/blog/?p=709</guid>

					<description><![CDATA[Ran into this one recently and the solution came out of left field, so I thought I'd throw it out to the internet at large. I've got a server which is running php-fpm and nginx. However it has several websites running on it, each of which has its own php-fpm/pool.d/ profile. We were having a ... <a title="php-fpm monitoring for single domain" class="read-more" href="https://play.datalude.com/blog/2023/06/php-fpm-monitoring-for-single-domain/" aria-label="Read more about php-fpm monitoring for single domain">Read more</a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Ran into this one recently and the solution came out of left field, so I thought I'd throw it out to the internet at large. I've got a server which is running php-fpm and nginx. However it has several websites running on it, each of which has its own php-fpm/pool.d/ profile. We were having a problem with one of the websites, which got a lot more traffic than the others, so we needed a way to monitor its php-fpm performance.<br><br>Setting up php monitoring is not hard. There are many guides around the internet. You put the line </p>



<pre class="wp-block-code"><code>pm.status_path = /status</code></pre>



<p class="wp-block-paragraph">in your fpm pool file, then add a block to your nginx config so that it can only be accessed by certain IP addresses. </p>



<span id="more-709"></span>



<pre class="wp-block-code"><code>        location ~ ^/status {
         access_log off;
         allow 127.0.0.1;    # localhost
         allow 12.23.34.45;   # my remote IP
         deny all;  
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         fastcgi_index index.php;
         include fastcgi_params;
         fastcgi_pass unix:/run/php/php-fpm-mysite.sock;
        }
</code></pre>



<p class="wp-block-paragraph">You access the URL mysite.com/status and all is good. </p>



<p class="wp-block-paragraph">Things get more complicated when you have a server where each domain has its own fpm pool file. The /status line in this case is just referring to that domain. If you access the mydomain.com/status URL from an external browser, the domain name resolves and nginx picks the correct php-fpm pool file, and you see the stats. </p>



<p class="wp-block-paragraph">Now consider using curl from localhost. </p>



<pre class="wp-block-code"><code> # On a server where there's only one pool file, this works. But when there are multiple pool files it doesn't know which one to use
curl http://127.0.0.1/status
# Can we resolve it with a Host header? No
 curl -H "Host: mysite.com" http://127.0.0.1/status
# Resolve looks hopeful, but actually it doesn't work with SSL
 curl --resolve 'mysite.com:443:127.0.0.1' https://127.0.0.1/status
# Maybe --insecure will help? No
 curl --resolve 'mysite.com:443:127.0.0.1' https://127.0.0.1/status --insecure
# Wait, maybe we can connect directly to the socket, and target the website that way! Nope.
curl --unix-socket /var/run/php/php-fpm-mysite.sock http://status/</code></pre>



<p class="wp-block-paragraph">After exhausting the Internet's wisdom on this, there didn't seem to be a way to get curl to fetch the information. It was needed locally so that it could be incorporated into a monitoring script, so allowing a remote IP to gather the info was not a desirable solution, although rapidly looking like the only option. </p>



<p class="wp-block-paragraph">Salvation came in the form of a program called cgi-fcgi which talks pure cgi-ese to the fpm socket. Or something like that. (apt install libfcgi-bin or yum install fcgi). Once installed, we can ask it for the information like this:</p>



<pre class="wp-block-code"><code>SCRIPT_NAME=/status SCRIPT_FILENAME=/status REQUEST_METHOD=GET cgi-fcgi -bind -connect /var/run/php/php-fpm-mysite.sock</code></pre>



<p class="wp-block-paragraph">So, incorporating that into a script we can monitor our website's fpm usage. I guess this could also be used in telegraf, zabbix and other monitoring solutions. And you can have a different status URL for each site/pool on the server. </p>
]]></content:encoded>
					
					<wfw:commentRss>https://play.datalude.com/blog/2023/06/php-fpm-monitoring-for-single-domain/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Mysql 8 Binary Logs ON by default</title>
		<link>https://play.datalude.com/blog/2023/06/mysql-8-binary-logs-on-by-default/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 08 Jun 2023 04:41:01 +0000</pubDate>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://play.datalude.com/blog/?p=707</guid>

					<description><![CDATA[I'm not sure how typing this in my quiet corner of the internet will be effective in broadcasting the message, but this is a Big Deal for server administrators. Previously binary logging was disabled by default, but now, with the default settings, if you have a busy database server, pretty soon you'll have a hefty ... <a title="Mysql 8 Binary Logs ON by default" class="read-more" href="https://play.datalude.com/blog/2023/06/mysql-8-binary-logs-on-by-default/" aria-label="Read more about Mysql 8 Binary Logs ON by default">Read more</a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I'm not sure how typing this in my quiet corner of the internet will be effective in broadcasting the message, but this is a Big Deal for server administrators. Previously binary logging was disabled by default, but now, with the default settings, if  you have a busy database server, pretty soon you'll have a hefty chunk of your disk eaten up by binary logs. And if you've ever run out of disk space on a server, you'll know this is not a good thing. </p>



<p class="wp-block-paragraph">Luckily its pretty easy to fix. Check if its enabled with <br></p>



<pre class="wp-block-code"><code>mysql -e "show variables like 'log_bin';"</code></pre>



<p class="wp-block-paragraph"><br>Or, just look in your data directory and see a hoarde of binlog files, of course. You can disable it altogether with </p>



<pre class="wp-block-code"><code>skip-log-bin</code></pre>



<p class="wp-block-paragraph">in your mysql ini file (which one you set it in depends on your server version and OS). Or you can just limit the number of seconds it keeps with the following, which will let it keep one day's worth of binlogs, down from the default 2592000 seconds which is 30 days, and, in my opinion a little high for a default value! </p>



<pre class="wp-block-code"><code>binlog_expire_logs_seconds = 86400</code></pre>



<p class="wp-block-paragraph">If you're not sure whether or not you need binlogs, you probably don't need them. They are used it  you're replicating the database to another one, and need to hold enough data so they can sync up in the event of a disconnection. You can also use them to roll the db back or forward to a specific point in time, but that's the province of database ninjas. </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>wp-cli &quot;Connection refused&quot; error</title>
		<link>https://play.datalude.com/blog/2022/11/wp-cli-connection-refused-error/</link>
					<comments>https://play.datalude.com/blog/2022/11/wp-cli-connection-refused-error/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 22 Nov 2022 08:11:08 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-cli]]></category>
		<guid isPermaLink="false">https://play.datalude.com/blog/?p=690</guid>

					<description><![CDATA[Couldn't find anything about this with a few google searches so I decided to note it here. Weird problem: whenever I ran any wp-cli command, I'd get a list of 100+ lines of "Connection refused" before it actually did what I wanted. I tried a few things to figure it out, including So on a ... <a title="wp-cli &#34;Connection refused&#34; error" class="read-more" href="https://play.datalude.com/blog/2022/11/wp-cli-connection-refused-error/" aria-label="Read more about wp-cli &#34;Connection refused&#34; error">Read more</a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Couldn't find anything about this with a few google searches so I decided to note it here. Weird problem: whenever I ran any wp-cli command, I'd get a list of 100+ lines of "Connection refused" before it actually did what I wanted. <br><br>I tried a few things to figure it out, including </p>



<ul class="wp-block-list">
<li>Searching the site for malware pointing to a blocked URL (no)</li>



<li>Checking the firewall logs (nothing)</li>



<li>Checking the db config, running performance tools on it to see that it wasn't exceeding max connections. (no) </li>



<li>Running tcpdump to see where wp-cli was trying to connect to (it wasn't)</li>



<li>Updating all plugins, themes,  (good to do anyway)</li>



<li>Checking db.php, which I found in wp-includes &#8230; which, hmmm, belongs to W3 Total Cache. </li>
</ul>



<p class="wp-block-paragraph">So on a hunch I tried </p>



<pre class="wp-block-code"><code>&gt; wp-cli plugin deactivate w3-total-cache 
Connection refused
Connection refused

... plus 200 more lines 

Connection refused
Connection refused
Connection refused
Plugin 'w3-total-cache' deactivated.

</code></pre>



<p class="wp-block-paragraph">&#8230; after which all wp-cli operations worked again. </p>



<p class="wp-block-paragraph">After some further digging, I enabled w3 Total Cache again, and found that it was configured to use redis, which wasn't running on the server. So the connection attempts were failing to connect to that. Pretty easy to sort out after that &#8230; </p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://play.datalude.com/blog/2022/11/wp-cli-connection-refused-error/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Troubleshooting postfix using bcc to local user</title>
		<link>https://play.datalude.com/blog/2022/11/troubleshooting-postfix-using-bcc-to-local-user/</link>
					<comments>https://play.datalude.com/blog/2022/11/troubleshooting-postfix-using-bcc-to-local-user/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 17 Nov 2022 03:35:13 +0000</pubDate>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[postfix]]></category>
		<guid isPermaLink="false">https://play.datalude.com/blog/?p=685</guid>

					<description><![CDATA[After routing mail through postfix to an external relay server (in this case gmail's smtp relay), all the mail from a server was routing correctly. Except after a couple of days I noticed a couple of strange bounces. Authentication at the gmail end was by IP address and domain, so any address xxxxx@domain.com could be ... <a title="Troubleshooting postfix using bcc to local user" class="read-more" href="https://play.datalude.com/blog/2022/11/troubleshooting-postfix-using-bcc-to-local-user/" aria-label="Read more about Troubleshooting postfix using bcc to local user">Read more</a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">After routing mail through postfix to an external relay server (in this case gmail's smtp relay), all the mail from a  server was routing correctly. Except after a couple of days I noticed a couple of strange bounces. Authentication at the gmail end was by IP address and domain, so any address xxxxx@domain.com could be used to send email. But these were coming from yyyy@otherdomain.com so were being rejected with a helpful message by gmail. </p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><code>The IP address you've 550-5.7.1 registered in your G Suite SMTP Relay service doesn't match domain of 550-5.7.1 the account this email is being sent from. If you are trying to relay 550-5.7.1 mail from a domain that isn't registered under your G Suite account 550-5.7.1 or has empty envelope-from, you must configure your mail server 550-5.7.1 either to use SMTP AUTH to identify the sending domain or to present 550-5.7.1 one of your domain names in the HELO or EHLO command. For more 550-5.7.1 information, please visit 550 5.7.1 <a rel="noreferrer noopener" href="https://support.google.com/a/answer/6140680#invalidcred" target="_blank">https://support.google.com/a/answer/6140680</a></code></p>
</blockquote>



<p class="wp-block-paragraph">Pretty helpful as messages go. Less helpful was the fact that there were several websites on the server and a couple of other apps, and I didn't have access to the admin panels of any of them. The mails, once bounced, were removed from postfix's queue, never to be seen again. Time for some detective work.  </p>



<span id="more-685"></span>



<p class="wp-block-paragraph">I found that the mails were heading for zzzz@domain.com so I figured if I could make those appear locally I'd be able to look at the source and see what had created them. This is not so hard to do in postfix. First of all you need a line in your main.cf </p>



<pre class="wp-block-code"><code># Added to troubleshoot rejection by gmail smtp           
# Need to add addresses to the file and run postmap on it 
recipient_bcc_maps = regexp:/etc/postfix/recipient_bcc_maps</code></pre>



<p class="wp-block-paragraph">Then  you need to add entries in your /etc/postfix/recipient_bcc_maps</p>



<pre class="wp-block-code"><code># run postmap recipient_bcc_maps after editing
/zzzz\@domain.com/  ubuntu
</code></pre>



<p class="wp-block-paragraph">After that run postmap recipient_bcc_maps and restart postfix for good measure. So now any mail headed to zzzz@domain.com will also be bcced to the local ubuntu user, were we can pick it up in /var/spool/mail/ubuntu </p>



<p class="wp-block-paragraph">All good. I waited. And waited. Then got bored of waiting and made a quick bash one liner to alert me when the ubuntu user's mail file changed. </p>



<pre class="wp-block-code"><code>while true; do if ls -hal "/var/spool/mail/ubuntu" | grep -q "Nov 15 07:14" ; then sleep 5 ; else mutt -s "changed" me@mydomain.com &lt;/dev/null ; break ; fi ; done
</code></pre>



<p class="wp-block-paragraph">So this is pretty crude but it works. Every 5 seconds it checks the date and time of the mail spool file (you'd need to change to the actual date of the file, of course), and if it changes it emails to me@mydomain.com. I ran that under 'screen' and two days later I got a notification, from which I was able to figure out which script on which domain had fired off the email. </p>



<p class="wp-block-paragraph">Maybe that one liner makes more sense as a script:</p>



<pre class="wp-block-code"><code>#!/bin/bash

FILE=/var/spool/mail/ubuntu
PATTERN="Oct 17 10:44"

while true;
do 
	if ls -hal "$FILE" | grep -q "$PATTERN" ; then 
		# Do nothing. 
		sleep 5
	else
		# echo "changed"
                # play fanfare.mp3
		mutt -s "changed" me@mydomain.com &lt;/dev/null
		break;
	fi 
done</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://play.datalude.com/blog/2022/11/troubleshooting-postfix-using-bcc-to-local-user/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Using wp-cli to edit a WordPress options array</title>
		<link>https://play.datalude.com/blog/2020/09/using-wp-cli-to-edit-wordpress-options-array/</link>
					<comments>https://play.datalude.com/blog/2020/09/using-wp-cli-to-edit-wordpress-options-array/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 04 Sep 2020 06:15:37 +0000</pubDate>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://play.datalude.com/blog/?p=606</guid>

					<description><![CDATA[So you probably know that you can change WordPress options directly in the database with an SQL query, and maybe you've come across the /wp-admin/options.php page where you can edit them directly from WordPress. But if the options are held as serialized data, then it gets a bit more tricky. Luckily wp-cli can help. I'll ... <a title="Using wp-cli to edit a WordPress options array" class="read-more" href="https://play.datalude.com/blog/2020/09/using-wp-cli-to-edit-wordpress-options-array/" aria-label="Read more about Using wp-cli to edit a WordPress options array">Read more</a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">So you probably know that you can change WordPress options directly in the database with an SQL query, and maybe you've come across the <a href="https://play.datalude.com/blog/2017/02/secret-wordpress-options-page/" data-type="post" data-id="383">/wp-admin/options.php</a> page where you can edit them directly from WordPress. But if the options are held as serialized data, then it gets a bit more tricky. Luckily wp-cli can help. </p>



<p class="wp-block-paragraph">I'll assume you can figure out how to download and install wp-cli yourselves. On this occasion I was trying to get rid of the annoying pop-up screen of Really Simple SSL plugin. It should disappear, never to return, when you click the x in the corner of the message, but in my case it was coming back <em>every time I loaded every single page</em>. Which was irritating, to say the least, and it takes up a fair chunk of space at the top of the screen. So I decided to nail it for once and for all. I found out on Google that the key was altering the <strong>rlrsssl_options => ssl_success_message_shown</strong> option. </p>



<p class="wp-block-paragraph">So if you use wp-cli to get the option value it looks like this:</p>



<pre class="wp-block-code"><code>wp-cli option get rlrsssl_options
array (
  'site_has_ssl' => true,
  'hsts' => false,
  'htaccess_warning_shown' => false,
  'review_notice_shown' => false,
  'ssl_success_message_shown' => false,
  'autoreplace_insecure_links' => true,
  'plugin_db_version' => '3.3.5',
  'debug' => false,
  'do_not_edit_htaccess' => false,
  'htaccess_redirect' => true,
  'ssl_enabled' => true,
  'javascript_redirect' => false,
  'wp_redirect' => true,
  'switch_mixed_content_fixer_hook' => false,
  'dismiss_all_notices' => false,
  'dismiss_review_notice' => false,
)
</code></pre>



<p class="wp-block-paragraph">There is also the option to display that as json, which is what we need, so lets do that, and pipe it out to a text file. </p>



<pre class="wp-block-code"><code>wp-cli option get rlrsssl_options --format=json > ssl.txt

cat ssl.txt 
{"site_has_ssl":true,"hsts":false,"htaccess_warning_shown":false,"review_notice_shown":false,"ssl_success_message_shown":false,"autoreplace_insecure_links":true,"plugin_db_version":"3.3.5","debug":false,"do_not_edit_htaccess":false,"htaccess_redirect":true,"ssl_enabled":true,"javascript_redirect":false,"wp_redirect":true,"switch_mixed_content_fixer_hook":false,"dismiss_all_notices":false,"dismiss_review_notice":false}
</code></pre>



<p class="wp-block-paragraph">So now we edit the ssl.txt file and change this bit from false to true.</p>



<pre id="block-e88dfd60-88c4-4e0b-a0aa-c088a9cdaebf" class="wp-block-code"><code>"ssl_success_message_shown":true</code></pre>



<p class="wp-block-paragraph">Then we can just send that json file back into the database with the following:</p>



<pre class="wp-block-code"><code>wp-cli option update rlrsssl_options --format=json &lt; ssl.txt</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://play.datalude.com/blog/2020/09/using-wp-cli-to-edit-wordpress-options-array/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Command to find all image files which are not really image files!</title>
		<link>https://play.datalude.com/blog/2017/05/command-to-find-all-image-files-which-are-not-really-image-files/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 11 May 2017 06:34:03 +0000</pubDate>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://play.datalude.com/blog/?p=396</guid>

					<description><![CDATA[Quick one this &#8230; so you've got a compromised webserver and you want to check the files on it. Many scanning tools will ignore images, but an image might not always be what it seems! Check them all with this command: find /path/to/dir -regex ".*\.\(jpg\&#124;png\&#124;gif\)" -exec file {} \; &#124; grep -i -v "image data" ... <a title="Command to find all image files which are not really image files!" class="read-more" href="https://play.datalude.com/blog/2017/05/command-to-find-all-image-files-which-are-not-really-image-files/" aria-label="Read more about Command to find all image files which are not really image files!">Read more</a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Quick one this &#8230; so you've got a compromised webserver and you want to check the files on it. Many scanning tools will ignore images, but an image might not always be what it seems! Check them all with this command:</p>



<pre class="wp-block-preformatted">find /path/to/dir -regex ".*\.\(jpg\|png\|gif\)" -exec file {} \; | grep -i -v "image data"</pre>



<p class="wp-block-paragraph">If all is good, you won't get any output. If your server is seriously borked, then you might see things like this &#8230;</p>



<p class="wp-block-paragraph">./wp-content/uploads/2011/01/22.jpg: HTML document, ASCII text</p>



<p class="wp-block-paragraph">This is a flag that the image is in fact a PHP file. Investigate!</p>



<p class="wp-block-paragraph">If you get this kind of thing,<br>./wp-content/uploads/2011/01/221.jpg: Minix filesystem, V2, 46909 zones</p>



<p class="wp-block-paragraph">its probably a bug in an old version of <em>file,</em> so check your OS version, copy the file to a more recent OS and try again.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Secret WordPress Options Page</title>
		<link>https://play.datalude.com/blog/2017/02/secret-wordpress-options-page/</link>
					<comments>https://play.datalude.com/blog/2017/02/secret-wordpress-options-page/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 02 Feb 2017 03:52:44 +0000</pubDate>
				<category><![CDATA[General IT]]></category>
		<category><![CDATA[Wordpress]]></category>
		<guid isPermaLink="false">https://play.datalude.com/blog/?p=383</guid>

					<description><![CDATA[OK, so maybe its not a complete secret, but after around 10 years of running WordPress I only just found out about it. Here it is. After you've logged in as admin, go to the following URL. i.e. type options.php into the URL of your site: Obviously you have to be logged in as admin. ... <a title="Secret WordPress Options Page" class="read-more" href="https://play.datalude.com/blog/2017/02/secret-wordpress-options-page/" aria-label="Read more about Secret WordPress Options Page">Read more</a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">OK, so maybe its not a complete secret, but after around 10 years of running WordPress I only just found out about it. Here it is. After you've logged in as admin, go to the following URL. i.e. type options.php into the URL of your site:</p>



<pre class="wp-block-code"><code>https:&#47;&#47;yourdomain.com/wp-admin/options.php</code></pre>



<p class="wp-block-paragraph">Obviously you have to be logged in as admin. This basically gives you access to the wp_options table without having to go to a separate database management app, or do some mysql command line ninja.</p>



<p class="wp-block-paragraph">Who knew? Its not on a menu, probably to hide it from fat fingers, but hey, I wish I'd known about this earlier. Would have saved me a few hours over the course of my work life.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://play.datalude.com/blog/2017/02/secret-wordpress-options-page/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
