<?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>2718.us blog &#187; wordpress plugin</title>
	<atom:link href="http://2718.us/blog/tag/wordpress-plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://2718.us/blog</link>
	<description>Miscellaneous Technological Geekery</description>
	<lastBuildDate>Tue, 18 May 2010 02:42:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Hiding the WordPress Dashboard</title>
		<link>http://2718.us/blog/2008/07/10/hiding-the-wordpress-dashboard/</link>
		<comments>http://2718.us/blog/2008/07/10/hiding-the-wordpress-dashboard/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 20:34:55 +0000</pubDate>
		<dc:creator>2718.us</dc:creator>
				<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[deepwave]]></category>
		<category><![CDATA[hide]]></category>
		<category><![CDATA[hide dashboard]]></category>
		<category><![CDATA[hide dashboard plugin]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress plugin]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[wp plugin]]></category>

		<guid isPermaLink="false">http://2718.us/blog/?p=48</guid>
		<description><![CDATA[I use WordPress as the backbone of a site I run, including using it for user authentication.  This means a lot of people who aren&#8217;t invovled in running the site are logging in and could see the dashboard.  Now, it&#8217;s not that there&#8217;s anything really secret there, but it makes things look a lot less [...]]]></description>
			<content:encoded><![CDATA[<p>I use WordPress as the backbone of a site I run, including <a href="http://2718.us/blog/2008/04/12/using-wordpress-for-user-authentication/">using it for user authentication</a>.  This means a lot of people who aren&#8217;t invovled in running the site are logging in and could see the dashboard.  Now, it&#8217;s not that there&#8217;s anything really secret there, but it makes things look a lot less &#8220;finished&#8221; to have users deposited on a page that has no relevance to them.  This is where the <a href="http://www.deepwave.net/articles/hide_dashboard/">Hide Dashboard plugin</a> from <a href="http://www.deepwave.net/">Patrick/DeepWave</a> comes in.  It does a nice job of getting users to their profile page and generally hiding most of the dashboard things that regular users don&#8217;t need to see.</p>
<p>I, however, wanted a little more.  I wanted to make sure that regular users who might be, well, &#8220;curious&#8221; about the inner workings of the site and who have some knowledge of wp-admin URL structure to be unable to get at anything but their profile page.  To this end, I added a little to the code:</p>
<div class="geshi no php">
<ol>
<li class="li1">
<div class="de1"><span class="co1">// add after line 41, which reads: &nbsp;if(!current_user_can(&#39;level_10&#39;)){</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">strpos</span><span class="br0">&#40;</span><span class="re1">$_SERVER</span><span class="br0">&#91;</span><span class="st0">&#39;REQUEST_URI&#39;</span><span class="br0">&#93;</span><span class="sy0">,</span><span class="st0">&#39;/wp-admin&#39;</span><span class="br0">&#41;</span> <span class="sy0">!==</span> <span class="kw2">FALSE</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; and <span class="kw3">strpos</span><span class="br0">&#40;</span><span class="re1">$_SERVER</span><span class="br0">&#91;</span><span class="st0">&#39;REQUEST_URI&#39;</span><span class="br0">&#93;</span><span class="sy0">,</span><span class="st0">&#39;/wp-admin/profile.php&#39;</span><span class="br0">&#41;</span> <span class="sy0">!==</span> <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; wp_safe_redirect<span class="br0">&#40;</span><span class="st0">&#39;/wp-admin/profile.php&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>This should redirect any non-admin user off of any /wp-admin* page to /wp-admin/profile.php. This might, however, cause issues for mid-level users (i.e. authors/editors/etc may not be able to access needed functions) and I haven’t tested it thoroughly and there might be a better way to do this. YMMV.  See also some comment-discussion on these changes at the plugin&#8217;s own page: <a href="http://www.deepwave.net/articles/hide_dashboard/#comment-22042">me</a> <a href="http://www.deepwave.net/articles/hide_dashboard/#comment-23750">Patrick</a> <a href="http://www.deepwave.net/articles/hide_dashboard/#comment-23751">me</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://2718.us/blog/2008/07/10/hiding-the-wordpress-dashboard/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Oh, so *that&#8217;s* why the WordPress.com stats plugin said I had no traffic&#8230;</title>
		<link>http://2718.us/blog/2008/05/01/oh-so-thats-why-the-wordpresscom-stats-plugin-said-i-had-no-traffic/</link>
		<comments>http://2718.us/blog/2008/05/01/oh-so-thats-why-the-wordpresscom-stats-plugin-said-i-had-no-traffic/#comments</comments>
		<pubDate>Thu, 01 May 2008 20:38:24 +0000</pubDate>
		<dc:creator>2718.us</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[footer.php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[stats plugin]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress 2.5]]></category>
		<category><![CDATA[wordpress plugin]]></category>
		<category><![CDATA[wordpress.com stats]]></category>
		<category><![CDATA[wordpress.com stats plugin]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[wp plugin]]></category>
		<category><![CDATA[wp stats]]></category>
		<category><![CDATA[wp2.5]]></category>
		<category><![CDATA[wp_footer]]></category>

		<guid isPermaLink="false">http://2718.us/blog/?p=32</guid>
		<description><![CDATA[It seems that some themes that I&#8217;d used as the bases for my own themes on my WordPress installs (other than this one) didn&#8217;t have &#60;?php wp_footer(); ?&#62; in the footer.php file, like they should, I guess, since that seems to be what the WordPress.com stats plugin needs to register hits.  I had been wondering [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that some themes that I&#8217;d used as the bases for my own themes on my WordPress installs (other than this one) didn&#8217;t have</p>
<pre lang="php">&lt;?php wp_footer(); ?&gt;
</pre>
<p>in the footer.php file, like they should, I guess, since that seems to be what the WordPress.com stats plugin needs to register hits.  I had been wondering why the numbers on my dashboards didn&#8217;t even remotely match my awstats numbers.</p>
]]></content:encoded>
			<wfw:commentRss>http://2718.us/blog/2008/05/01/oh-so-thats-why-the-wordpresscom-stats-plugin-said-i-had-no-traffic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

