<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
		>
	<channel>
		<title>WordPress Ideas &#187; Topic: Server Admin Email for code-level maintenance notifications</title>
		<link>https://wordpress.org/ideas/topic/server-admin-email-for-code-level-maintenance-notifications</link>
		<description>WordPress Ideas &#187; Topic: Server Admin Email for code-level maintenance notifications</description>
		<language>en-US</language>
		<pubDate>Sat, 10 Jun 2017 11:55:22 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
				<atom:link href="https://wordpress.org/ideas/rss/topic/server-admin-email-for-code-level-maintenance-notifications" rel="self" type="application/rss+xml" />

		<item>
			<title>davidsword on "Server Admin Email for code-level maintenance notifications"</title>
			<link>https://wordpress.org/ideas/topic/server-admin-email-for-code-level-maintenance-notifications#post-31642</link>
			<pubDate>Fri, 24 Mar 2017 16:33:00 +0000</pubDate>
			<dc:creator>davidsword</dc:creator>
			<guid isPermaLink="false">31642@https://wordpress.org/ideas/</guid>
			<description><![CDATA[<p>Typically a full time WP developer is responsible for a WordPress website build, it's environment, and the client is the WordPress <code>admin_email</code> handling things on that side. Especially for WordPress Networks, 1 server_admin with tons of clients who admin their respective WordPress sites.</p>
<p>Over years the Developer may have dozens of sites that s/he does not monitor regularly, and rely on his clients telling him when/if there's an critical error. Typically database and other errors happen silently.</p>
<p>I suggest creating an optional SERVER_ADMIN constant in <code>wp-config.php</code> to help the WP developer be notified of anything critical:</p>
<pre><code>define(&#039;SERVER_ADMIN&#039;, &#039;wpdeveloper@example.com&#039;);</code></pre>
<p>Then on critical code error points, like:</p>
<pre><code>/wp-includes/functions.php:dead_db()</code></pre>
<p>Add in something like:</p>
<pre><code>// tell server admin of the db failure
if (defined( &#039;SERVER_ADMIN&#039; ))
  if (!$already_sent_email_today) // some local write cache file
    mail(SERVER_ADMIN, &#039;Server Database Error&#039;, print_r($_SERVER,true).$wpdb-&#62;error);</code></pre>
<p>Before the silent HTML error page. Notifying the Server Admin of the critical error.</p>
<p>-</p>
<p>An instance where this is handy is if the MySQL database is out of resources. That error occurs silently and sporadically, and will cause a database failure only for a short time, as it's being maxed, the db will run fine again once the requests go down - unbeknown to the server admin (unless monitoring server-side logs).
</p>]]></description>
					</item>

	</channel>
</rss>
