<?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>Show-web</title>
	<atom:link href="http://show-web.jp/feed/" rel="self" type="application/rss+xml" />
	<link>http://show-web.jp</link>
	<description></description>
	<lastBuildDate>Tue, 15 May 2012 15:15:35 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=200</generator>
		<item>
		<title>終了したイベントを自動的に過去のイベントにする</title>
		<link>http://show-web.jp/2012/05/14/%E7%B5%82%E4%BA%86%E3%81%97%E3%81%9F%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%82%92%E8%87%AA%E5%8B%95%E7%9A%84%E3%81%AB%E9%81%8E%E5%8E%BB%E3%81%AE%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%81%AB%E3%81%99/</link>
		<comments>http://show-web.jp/2012/05/14/%E7%B5%82%E4%BA%86%E3%81%97%E3%81%9F%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%82%92%E8%87%AA%E5%8B%95%E7%9A%84%E3%81%AB%E9%81%8E%E5%8E%BB%E3%81%AE%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%81%AB%E3%81%99/#comments</comments>
		<pubDate>Mon, 14 May 2012 14:37:21 +0000</pubDate>
		<dc:creator>Sho Doi</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[イベント・勉強会]]></category>
		<category><![CDATA[WordBench]]></category>
		<category><![CDATA[イベント]]></category>

		<guid isPermaLink="false">http://show-web.jp/?p=370</guid>
		<description><![CDATA[2012/05/16追記・修正 @jim0912さんよりご指摘を頂きましたのでhome.phpのソースを修正しております。ありがとうございます。 上記をvar_dumpしたところ確かにdate()だとズレてますね。（20 &#8230; <a href="http://show-web.jp/2012/05/14/%E7%B5%82%E4%BA%86%E3%81%97%E3%81%9F%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%82%92%E8%87%AA%E5%8B%95%E7%9A%84%E3%81%AB%E9%81%8E%E5%8E%BB%E3%81%AE%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%81%AB%E3%81%99/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<section>
	<h1>2012/05/16追記・修正</h1>
	<p><a href="https://twitter.com/#!/jim0912" target="_blank">@jim0912</a>さんよりご指摘を頂きましたのでhome.phpのソースを修正しております。ありがとうございます。</p>
	<!-- tweet id : 202175365601439744 --><style type='text/css'>#bbpBox_202175365601439744 a { text-decoration:none; color:#8F5F24; }#bbpBox_202175365601439744 a:hover { text-decoration:underline; }</style><div id='bbpBox_202175365601439744' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#FFAE00; background-image:url(http://a0.twimg.com/profile_background_images/61323914/bg_tw.png); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#443F2F; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>@<a href="http://twitter.com/intent/user?screen_name=uemera" class="twitter-action">uemera</a> @<a href="http://twitter.com/intent/user?screen_name=show_web" class="twitter-action">show_web</a> <a href="http://twitter.com/search?q=%23wbkobe" title="#wbkobe">#wbkobe</a> WordPress&#12399;&#12289;date&#20351;&#12358;&#12392;&#26178;&#24046;&#20998;&#12378;&#12428;&#12427;&#12398;&#12391;date_i18n&#20351;&#12358;&#12392;&#12424;&#12356;&#12391;&#12377;&#12397;&#12290;</span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://show-web.jp/wp/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 2012年5月15日 08:15' href='http://twitter.com/#!/jim0912/status/202175365601439744' target='_blank'>2012年5月15日 08:15</a> via web<a href='https://twitter.com/intent/tweet?in_reply_to=202175365601439744' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=202175365601439744' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=202175365601439744' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=jim0912'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a0.twimg.com/profile_images/2013446007/s_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=jim0912'>@jim0912</a><div style='margin:0; padding-top:2px'>Hitoshi Omagari</div></div><div style='clear:both'></div></div></div><!-- end of tweet -->
	<br />
	<pre class="brush: php; title: ; notranslate">var_dump(date( 'Y/m/d H:i:s' )); //string '2012/05/15 15:06:01' (length=19)
var_dump(date_i18n( 'Y/m/d H:i:s' )); //string '2012/05/16 00:06:01' (length=19)</pre>
	<br />
	<p>上記をvar_dumpしたところ確かにdate()だとズレてますね。（2012/05/16 0時頃確認）<br />
	というわけでdate_i18n()を使いましょう。<br />
	<a href="http://wpdocs.sourceforge.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/date_i18n" target="_blank">関数リファレンス/date i18n &#8211; WordPress Codex 日本語版</a></p>
</section>
<hr />
<p>先日おじゃました<a href="http://atnd.org/events/27845" target="_blank">WordBench神戸分科会</a>の「案件で詰まっていることを晒してみる」であった以下の質問に答えてみました。<br />
詳細については<a href="http://d.hatena.ne.jp/shigemk2/20120513/1336912520" target="_blank">案件で詰まっていることを晒してみる #wbkobe &#8211; by shigemk2</a>を参照。</p>
<blockquote>トップページにイベントの部分があるけど、終わったら「過去のイベント」に移行したいこれを自動化するにはどうしたらよいのだろうか。</blockquote>
<p>覚えている限りの仕様としては</p>
<ul>
	<li>トップの「開催中のイベント」に&#8221;2012/05/14～2012/06/01 イベント名&#8221;形式で出力</li>
	<li>終了したものに関しては「過去のイベント」部分に同様の形式で出力</li>
</ul>
<p>という訳で思い浮かんだのがカスタムフィールドを用いて開催日・終了日を設定、終了日の値を元に振り分けるというもの。</p>
<section>
	<h1>Custom Field Templateプラグイン設定</h1>
	<p>カスタムフィールドの設定は<a href="http://wordpress.org/extend/plugins/custom-field-template/" target="_blank">Custom Field Template</a>プラグインに任せることに。<br />
	インストール後、&#8221;設定 > カスタムフィールドテンプレート > テンプレートコンテンツ&#8221;に以下を記述。</p>
	<pre class="brush: plain; title: ; notranslate">[start_date]
type = textfield
label = 開始日
date = true
dateFirstDayOfWeek = 0
dateFormat = yyyy/mm/dd
startDate = (new Date()).asString()

[end_date]
type = textfield
label = 終了日
date = true
dateFirstDayOfWeek = 0
dateFormat = yyyy/mm/dd
startDate = (new Date()).asString()</pre>
<p>投稿ページのカスタムフィールドテンプレートに開催日・終了日のDatepickerが追加されたのでイベント日時はここで設定。<br /><img src="http://show-web.jp/wp/wp-content/uploads/2012/05/custom-field-event-manage.png" alt="" title="custom-field-event-manage" width="507" height="178" class="alignnone size-full wp-image-372" /></p>
</section>
<section>
	<h1>home.phpの設定</h1>
	<p>出力部分に関しては以下の通り。meta_queryでカスタムフィールドの値を元に検索しています。meta_queryの使い方に関しては <a href="http://elearn.jp/wpman/column/c20110915_01.html" target="_blank">query_posts（WP_Queryクラス）でカスタムフィールドを使う：WordPress私的マニュアル</a> を参照。</p>
	<pre class="brush: php; title: ; notranslate">&lt;section&gt;
	&lt;h1&gt;開催中のイベント&lt;/h1&gt;
	&lt;?php
	$current_date = date_i18n( 'Y/m/d' );
	$args = array(
		'meta_query' =&gt; array(
			array(
				'key' =&gt; 'end_date',
				'value' =&gt; $current_date,
				'compare' =&gt; '&gt;=',
				'type' =&gt; 'DATE'
			)
		)
	);
	$output = '';
	query_posts( $args );
	if ( have_posts() ) :
		$output .= '&lt;dl&gt;';
		while ( have_posts() ) : the_post();
			$output .= '&lt;dt&gt;' . get_post_meta( $post-&gt;ID, 'start_date', true ) . '～' . get_post_meta( $post-&gt;ID, 'end_date', true ) . '&lt;/dt&gt;';
			$output .= '&lt;dd&gt;' . get_the_title() . '&lt;/dd&gt;';
	endwhile;
		$output .= '&lt;/dl&gt;';
		echo $output;
		wp_reset_query();
	else :
		// イベントがない場合の処理
		echo '&lt;p&gt;イベントないよ～&lt;/p&gt;';
	endif;
	?&gt;
&lt;/section&gt;&lt;!-- /section --&gt;
&lt;section&gt;
	&lt;h1&gt;終了したイベント&lt;/h1&gt;
	&lt;?php
	$current_date = date_i18n( 'Y/m/d' );
	$args = array(
		'meta_query' =&gt; array(
			array(
				'key' =&gt; 'end_date',
				'value' =&gt; $current_date,
				'compare' =&gt; '&lt;',
				'type' =&gt; 'DATE'
			)
		)
	);
	$output = '';
	query_posts( $args );
	if ( have_posts() ) :
		$output .= '&lt;dl&gt;';
		while ( have_posts() ) : the_post();
			$output .= '&lt;dt&gt;' . get_post_meta( $post-&gt;ID, 'start_date', true ) . '～' . get_post_meta( $post-&gt;ID, 'end_date', true ) . '&lt;/dt&gt;';
			$output .= '&lt;dd&gt;' . get_the_title() . '&lt;/dd&gt;';
	endwhile;
		$output .= '&lt;/dl&gt;';
		echo $output;
		wp_reset_query();
	else :
		// イベントがない場合の処理
		echo '&lt;p&gt;イベントないよ～&lt;/p&gt;';
	endif;
	?&gt;
&lt;/section&gt;&lt;!-- /section --&gt;</pre>
<p>ちゃちゃっと書いたのでいろいろ問題あるかもですねー。</p>
</section>]]></content:encoded>
			<wfw:commentRss>http://show-web.jp/2012/05/14/%E7%B5%82%E4%BA%86%E3%81%97%E3%81%9F%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%82%92%E8%87%AA%E5%8B%95%E7%9A%84%E3%81%AB%E9%81%8E%E5%8E%BB%E3%81%AE%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%81%AB%E3%81%99/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Custom Field Templateプラグインでajaxzip3を使う</title>
		<link>http://show-web.jp/2012/05/06/custom-field-template%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%81%A7ajaxzip3%E3%82%92%E4%BD%BF%E3%81%86/</link>
		<comments>http://show-web.jp/2012/05/06/custom-field-template%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%81%A7ajaxzip3%E3%82%92%E4%BD%BF%E3%81%86/#comments</comments>
		<pubDate>Sat, 05 May 2012 18:32:14 +0000</pubDate>
		<dc:creator>Sho Doi</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[ajaxzip3]]></category>
		<category><![CDATA[Custom Field Template]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://show-web.jp/?p=363</guid>
		<description><![CDATA[進めている案件で使うかもしれないのでメモです。（既にありそうなネタだけど） カスタムフィールド拡張プラグイン Custom Field Template と郵便番号検索API ajaxzip3 を使って、投稿のカスタムフ &#8230; <a href="http://show-web.jp/2012/05/06/custom-field-template%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%81%A7ajaxzip3%E3%82%92%E4%BD%BF%E3%81%86/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>進めている案件で使うかもしれないのでメモです。（既にありそうなネタだけど）<br />
カスタムフィールド拡張プラグイン <a href="http://wordpress.org/extend/plugins/custom-field-template/" title="Custom Field Template" target="_blank">Custom Field Template</a> と郵便番号検索API <a href="http://code.google.com/p/ajaxzip3/" title="ajaxzip3" target="_blank">ajaxzip3</a> を使って、投稿のカスタムフィールドに郵便番号を入力したら住所が出るようにします。
それぞれの詳しい使い方については本家を参照下さい。</p>
<section>
	<h1>カスタムフィールドコンテンツ登録</h1>
	<p>&#8220;設定 > カスタムフィールドテンプレート&#8221;のコンテンツ部分に以下を記述します。</p>
	<p>
	<pre class="brush: plain; title: ; notranslate">[zipcode]
type = text
size = 10
label = 郵便番号

[pref]
type = text
size = 10
label = 都道府県

[addr]
type = text
size = 50
label = 市町村区</pre>
	</p>
	<p>投稿に郵便番号・都道府県・市町村区の入力欄が表示されました。<br />
	<img src="http://show-web.jp/wp/wp-content/uploads/2012/05/custom-field-template-ajaxzip3-01.png" alt="" title="custom-field-template-ajaxzip3-01" width="518" height="243" class="alignnone size-full wp-image-364" /><br />
	郵便番号を入力したら自動的に都道府県・市町村区に住所が入力されるようにします。</p>
</section>
<section>
	<h1>ajaxzip3読み込み、JavaScript記述</h1>
	<p>ajaxzip3の設置方法を見ると
	<pre class="brush: jscript; title: ; notranslate">&lt;script src=&quot;http://ajaxzip3.googlecode.com/svn/trunk/ajaxzip3/ajaxzip3.js&quot; charset=&quot;UTF-8&quot;&gt;&lt;/script&gt;</pre>でスクリプトを読み込み<br />
	<pre class="brush: xml; title: ; notranslate">&lt;input type=&quot;text&quot; name=&quot;zip01&quot; size=&quot;10&quot; maxlength=&quot;8&quot; onKeyUp=&quot;AjaxZip3.zip2addr(this,'','pref01','addr01');&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;pref01&quot; size=&quot;20&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;addr01&quot; size=&quot;60&quot;&gt;</pre>のonKeyUpイベント実行時にname属性&#8221;pref01&#8243;,&#8221;addr01&#8243;のフィールドに値を入力しているようなのでJavaScriptを追加する事に。</p>
	<p>JavaScriptの記述箇所は&#8221;設定 > カスタムフィールドテンプレート&#8221;のテンプレートインストラクションになります。<br />
	<img src="http://show-web.jp/wp/wp-content/uploads/2012/05/custom-field-template-ajaxzip3-03.png" alt="" title="custom-field-template-ajaxzip3-03" width="393" height="329" class="alignnone size-full wp-image-368" /></p>
	<p>JavaScriptを記述する前にカスタムフィールドのname値が必要なので投稿ページのソースを見ておきます。<br />
	<pre class="brush: xml; title: ; notranslate">&lt;dl id=&quot;dl_zipcode0_0&quot; class=&quot;dl_text&quot;&gt;
	&lt;dt&gt;&lt;span&gt;&lt;label for=&quot;zipcode0_0&quot;&gt;zipcode&lt;/label&gt;&lt;/span&gt;&lt;/dt&gt;
	&lt;dd&gt;&lt;p class=&quot;label&quot;&gt;郵便番号&lt;/p&gt;&lt;input id=&quot;zipcode0_0&quot; name=&quot;zipcode[0][]&quot; value=&quot;&quot; type=&quot;text&quot; size=&quot;10&quot; /&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl id=&quot;dl_pref1_0&quot; class=&quot;dl_text&quot;&gt;
	&lt;dt&gt;&lt;span&gt;&lt;label for=&quot;pref1_0&quot;&gt;pref&lt;/label&gt;&lt;/span&gt;&lt;/dt&gt;
	&lt;dd&gt;&lt;p class=&quot;label&quot;&gt;都道府県&lt;/p&gt;&lt;input id=&quot;pref1_0&quot; name=&quot;pref[1][]&quot; value=&quot;&quot; type=&quot;text&quot; size=&quot;10&quot; /&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl id=&quot;dl_addr2_0&quot; class=&quot;dl_text&quot;&gt;
	&lt;dt&gt;&lt;span&gt;&lt;label for=&quot;addr2_0&quot;&gt;addr&lt;/label&gt;&lt;/span&gt;&lt;/dt&gt;
	&lt;dd&gt;&lt;p class=&quot;label&quot;&gt;市町村区&lt;/p&gt;&lt;input id=&quot;addr2_0&quot; name=&quot;addr[2][]&quot; value=&quot;&quot; type=&quot;text&quot; size=&quot;50&quot; /&gt;&lt;/dd&gt;
&lt;/dl&gt;</pre>都道府県は&#8221;pref[1][]&#8220;、市町村区は&#8221;addr[2][]&#8220;なので先の設置例の&#8221;pref01&#8243;、&#8221;addr01&#8243;部分を置き換えます。</p>
	<p>また、記述例ではonKeyUpイベントをinput要素に記述していますがCustom Field Templateでの設定方法がよく分からなかったので郵便番号入力フィールドのid、&#8221;zipcode0_0&#8243;を使いjQueryで処理したいと思います。</p>
	<p>というわけでテンプレートインストラクションに以下を記述して完成。</p>
	<p>
	<pre class="brush: jscript; title: ; notranslate">&lt;script src=&quot;http://ajaxzip3.googlecode.com/svn/trunk/ajaxzip3/ajaxzip3.js&quot; charset=&quot;UTF-8&quot;&gt;&lt;/script&gt;
&lt;script&gt;
jQuery(function(){
	jQuery('#zipcode0_0').keyup(function(e){
		AjaxZip3.zip2addr(this,'','pref[1][]','addr[2][]');
	});
});
&lt;/script&gt;</pre>
	</p>
	<p>郵便番号を入力すると無事住所が自動入力されました。<br /><img src="http://show-web.jp/wp/wp-content/uploads/2012/05/custom-field-template-ajaxzip3-02.png" alt="" title="custom-field-template-ajaxzip3-02" width="503" height="246" class="alignnone size-full wp-image-365" /></p>
	<p>出来てしまうと簡単でしたがフィールドへの入力、name属性じゃなくてid属性を使うものと勘違いしてたので &#8220;AjaxZip3.zip2addr(this,&#8221;,&#8217;pref1_0&#8242;,&#8217;addr2_0&#8242;);&#8221; と指定してしまい躓きました…</p>
	</section>
	<section>
		<h1>参考サイト</h1>
		<ul>
			<li><a href="http://php-fan.org/wordpress-contactform7-ajaxzip3.html" title="ワードプレスのContactForm7に郵便番号自動変換-AjaxZip3編 | PHPサンプル実験室" target="_blank">ワードプレスのContactForm7に郵便番号自動変換-AjaxZip3編 | PHPサンプル実験室</a></li>
		</ul>
	</section>]]></content:encoded>
			<wfw:commentRss>http://show-web.jp/2012/05/06/custom-field-template%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%81%A7ajaxzip3%E3%82%92%E4%BD%BF%E3%81%86/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS4で追加予定の:matches()擬似クラスが便利</title>
		<link>http://show-web.jp/2012/04/26/css4%E3%81%A7%E8%BF%BD%E5%8A%A0%E4%BA%88%E5%AE%9A%E3%81%AEmatches%E6%93%AC%E4%BC%BC%E3%82%AF%E3%83%A9%E3%82%B9%E3%81%8C%E4%BE%BF%E5%88%A9/</link>
		<comments>http://show-web.jp/2012/04/26/css4%E3%81%A7%E8%BF%BD%E5%8A%A0%E4%BA%88%E5%AE%9A%E3%81%AEmatches%E6%93%AC%E4%BC%BC%E3%82%AF%E3%83%A9%E3%82%B9%E3%81%8C%E4%BE%BF%E5%88%A9/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 10:34:16 +0000</pubDate>
		<dc:creator>Sho Doi</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Font]]></category>

		<guid isPermaLink="false">http://show-web.jp/?p=359</guid>
		<description><![CDATA[CSS4から追加予定のどれかのセレクタにマッチする擬似クラス:matchesが便利そうです。 既存CSSの冗長な例 CSSをコーディングしていてよくあるのが以下のケース。 INFORMATIONというページのテーブルにの &#8230; <a href="http://show-web.jp/2012/04/26/css4%E3%81%A7%E8%BF%BD%E5%8A%A0%E4%BA%88%E5%AE%9A%E3%81%AEmatches%E6%93%AC%E4%BC%BC%E3%82%AF%E3%83%A9%E3%82%B9%E3%81%8C%E4%BE%BF%E5%88%A9/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>CSS4から追加予定のどれかのセレクタにマッチする擬似クラス:matchesが便利そうです。</p>
<section id="css4-matches-introduction">
	<h1>既存CSSの冗長な例</h1>
	<p>CSSをコーディングしていてよくあるのが以下のケース。</p>
	<ul>
		<li>INFORMATIONというページのテーブルにのみスタイルを指定したい</li>
		<li>thとtdは基本的に共通するスタイル</li>
	</ul>
	<p>CSSだと以下の様になると思います。<br />
	（普段はもう少し省略しますがあえてtable以下を全て書いています）</p>
	<p><pre class="brush: css; title: ; notranslate">
	body#information #content table tbody tr th,
	body#information #content table tbody tr td {
		border: 1px solid #999;
		padding: 1em;
	}
	</pre></p>
	<p>このコードで感じるのが body#information #content table tbody tr が繰り返されていて冗長だなと。2回も同じコード書きたくない…<br />
	CSS3で便利な機能が追加されたのでなにか解決方法あるのではと探しましたが現状では不可でした。<br />
	※後述のブラウザ独自実装で可能ですが現実的ではありません。</p>
</section>
<section id="css4-matches-content">
	<h1>:matches()擬似クラスを使う</h1>
	<p>というわけで現状では使えませんがCSS4で追加予定の:matches()擬似クラスを使うと簡単に記述できます。</p>
	<p><pre class="brush: css; title: ; notranslate">
	body#information #content table tbody tr :matches(th, td) {
		border: 1px solid #999;
		padding: 1em;
	}
	</pre></p>
	<p>上記のように:matches()の引数にセレクタを指定することで先のコードと同様の指定となります。便利ですね！CSS3から実装して欲しかったです！！</p>
</section>
<section id="css4-matches-original">
	<h1>ブラウザ独自実装 :any()</h1>
	<p>同機能はFirefoxがversion4から-moz-any()で独自実装していたようです。<br />
	<a href="https://developer.mozilla.org/en/CSS/%3A-moz-any" target="_blank">:any &#8211; MDN</a><br />
	Chromeも-webkit-any()で対応しているみたいですね。</p>
	<p>
	<pre class="brush: css; title: ; notranslate">
	body#information #content table tbody tr :-moz-any(th, td) {
		border: 1px solid #999;
		padding: 1em;
	}
	</pre>
	</p>
	<p>ただ、両方対応させようとしたらベンダープレフィックスを2つ記述する必要がでてくるので本末転倒になってしまいますから現実的ではありません。IEも多分駄目でしょうし。（未確認）<br />
	しかもカンマ区切りが無理だったので以下のようなコードになってしまいます。</p>
	<p>
	<pre class="brush: css; title: ; notranslate">
	body#information #content table tbody tr :-moz-any(th, td) {
		border: 1px solid #999;
		padding: 1em;
	}
	body#information #content table tbody tr :-webkit-any(th, td) {
		border: 1px solid #999;
		padding: 1em;
	}
	</pre>
	</p>
	<p>というわけでCSS4が待ち遠しいですね。</p>
</section>
<section id="css4-matches-reference">
	<h1>参考サイト</h1>
	<ul>
		<li><a href="http://myakura.github.com/n/selectors4.html" target="_blank">CSS4セレクタ (Selectors Level 4) の新機能</a></li>
		<li><a href="http://dev.w3.org/csswg/selectors4/" target="_blank">Selectors Level 4</a></li>
	</ul>
</section>]]></content:encoded>
			<wfw:commentRss>http://show-web.jp/2012/04/26/css4%E3%81%A7%E8%BF%BD%E5%8A%A0%E4%BA%88%E5%AE%9A%E3%81%AEmatches%E6%93%AC%E4%BC%BC%E3%82%AF%E3%83%A9%E3%82%B9%E3%81%8C%E4%BE%BF%E5%88%A9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>「第3回WordPressお茶会 WordBench香川」を開催しました</title>
		<link>http://show-web.jp/2012/04/24/%E3%80%8C%E7%AC%AC3%E5%9B%9Ewordpress%E3%81%8A%E8%8C%B6%E4%BC%9A-wordbench%E9%A6%99%E5%B7%9D%E3%80%8D%E3%82%92%E9%96%8B%E5%82%AC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F/</link>
		<comments>http://show-web.jp/2012/04/24/%E3%80%8C%E7%AC%AC3%E5%9B%9Ewordpress%E3%81%8A%E8%8C%B6%E4%BC%9A-wordbench%E9%A6%99%E5%B7%9D%E3%80%8D%E3%82%92%E9%96%8B%E5%82%AC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 03:30:59 +0000</pubDate>
		<dc:creator>Sho Doi</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[イベント・勉強会]]></category>
		<category><![CDATA[WordBench]]></category>
		<category><![CDATA[香川]]></category>

		<guid isPermaLink="false">http://show-web.jp/?p=354</guid>
		<description><![CDATA[2012/04/21（土）[13:00～17:30]にデザインラボラトリー蒼様をお借りして「第3回WordPressお茶会 WordBench香川」を開催しました。 リピート参加者、新規ご参加合わせて計11名での開催とな &#8230; <a href="http://show-web.jp/2012/04/24/%E3%80%8C%E7%AC%AC3%E5%9B%9Ewordpress%E3%81%8A%E8%8C%B6%E4%BC%9A-wordbench%E9%A6%99%E5%B7%9D%E3%80%8D%E3%82%92%E9%96%8B%E5%82%AC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>2012/04/21（土）[13:00～17:30]に<a href="http://www.ao-labo.info/" title="デザインラボラトリー蒼" target="_blank">デザインラボラトリー蒼</a>様をお借りして「第3回WordPressお茶会 WordBench香川」を開催しました。</p>
<p>リピート参加者、新規ご参加合わせて計11名での開催となりました。<br />
今回は新規の方が2名いらっしゃったのでコミュニティとしては少しずつですが前進してるかなーと。</p>
<p>前回、WordBench香川は（※土井主催のに関しては）だらだらーでいきましょう、ということに決まったので今回もノーテーマでコーヒーを飲みつつの雑談となりました。<br />
ということで本当に何も決めずの開催だったのですが、いつもながら参加者の皆さんがいろいろと提供してくれるので話題には事欠きませんでした。<br />
覚えている限りでは、WordPressについては、テーマ作成の流れ、運用、カスタム投稿タイプ周り（特に勉強になりました！）等。今回は企業でWordPressを使用されている方が参加されていたのでVPSや運用について聞けて為になりました。</p>
<p>後はbaserCMS、Movable Type、a-blog cms、SOY CMS、concrete5あたりの各種CMSについてやカメラについて盛り上がってたようです。WordPress好きはカメラ好きが多いというのは本当ですね。5D Mark IIだったりD800だったりでD40x所持者としては形見が狭いです…</p>
<p>あと、WordBench神戸さんが<a href="http://it-stamp.jp/" title="IT勉強会スタンプラリー" target="_blank">IT勉強会スタンプラリー</a>に参加する、という情報を<a href="http://wordbench.org" title="WordBench" target="_blank">WordBench</a>で見かけたのでWordBench香川コミュニティも参加してみました。（IT勉強会スタンプラリー詳細についてはリンク先を参照ください。）<br />
ただ、香川では他に参加しているコミュニティが今のところ無いはずなのでスタンプを集めようと思ったら大都会岡山に行くか神戸・大阪に行くかしないのでちょっと難しいですね。というわけで香川でも参加コミュニティ増えて欲しいです。<br />
（スタンプラリー用シール作成に関しては<a href="https://twitter.com/#!/zamojojo" target="_blank">@zamojojo</a>さん、<a href="https://twitter.com/#!/styledesign" target="_blank">@styledesign</a>さんにご協力頂きました。ありがとうございます！！）<br />
<img src="http://show-web.jp/wp/wp-content/uploads/2012/04/wbkagawa-itstamp.jpg" alt="" title="wbkagawa-itstamp" width="500" height="333" class="alignnone size-full wp-image-356" /><br /><small>photo by: <a href="http://www.style-design.jp" target="_blank">style-design</a></small></p>
<p>ちょこっとだけ一人反省会。<br />
いつもノーテーマの雑談だけやってていいのかなーという葛藤はあって、きちんとしたテーマ作成なり、もくもくなり、8時間耐久なりもやったほうがいいのではというのは考えるんだけどスキルが足りなかったり、しゃべるのが苦手だったりで実現するのは難しいですね。（普段の仕事をこなしつつイベント運営されている方凄い！！）<br />
ただ、今回参加者の方からここら近郊でカンファレンス形式のイベントはあるけどお茶会みたいに交流できるイベントがないのでありがたい、と言って頂いたので励みになりました。<br />
というわけでとりあえず「WordPressお茶会」はナンバリングで続けていきたいですね。<br />
コミュニティがもう少し成長したら勉強会っぽいこともたまに出来るようになればいいかな。</p>
<p>あと、今回twitterでハッシュタグつけて実況とか全くしませんでしたが、WordPressお茶会はカンファレンスみたいに喋り手・聞き手が分かれてなくて参加者全員が喋り手であり聞き手で常に忙しいので現実的に実況は無理ですね。<br />
まあ参加者だけが楽しんでしまうクローズド？な集まりになってしまいますが致し方ないですね。</p>
<p>という訳で次回「第4回WordPressお茶会 WordBench香川」の告知ですが、現在のところ2012/6/30（土）を予定しておりますので興味がありましたらご参加頂ければと思います。</p>
<p>* * *</p>
<p><small>WordBench香川に関してご意見・ご要望等ありましたら<a href="http://twitter.com/#!/show_web" target="_blank">@show_web</a>までお願いします。</small></p>]]></content:encoded>
			<wfw:commentRss>http://show-web.jp/2012/04/24/%E3%80%8C%E7%AC%AC3%E5%9B%9Ewordpress%E3%81%8A%E8%8C%B6%E4%BC%9A-wordbench%E9%A6%99%E5%B7%9D%E3%80%8D%E3%82%92%E9%96%8B%E5%82%AC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[自分用]Twenty Eleven表示確認用ブックマークレット</title>
		<link>http://show-web.jp/2012/04/16/%E8%87%AA%E5%88%86%E7%94%A8twenty-eleven%E8%A1%A8%E7%A4%BA%E7%A2%BA%E8%AA%8D%E7%94%A8%E3%83%96%E3%83%83%E3%82%AF%E3%83%9E%E3%83%BC%E3%82%AF%E3%83%AC%E3%83%83%E3%83%88/</link>
		<comments>http://show-web.jp/2012/04/16/%E8%87%AA%E5%88%86%E7%94%A8twenty-eleven%E8%A1%A8%E7%A4%BA%E7%A2%BA%E8%AA%8D%E7%94%A8%E3%83%96%E3%83%83%E3%82%AF%E3%83%9E%E3%83%BC%E3%82%AF%E3%83%AC%E3%83%83%E3%83%88/#comments</comments>
		<pubDate>Sun, 15 Apr 2012 23:11:18 +0000</pubDate>
		<dc:creator>Sho Doi</dc:creator>
				<category><![CDATA[Webサービス]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://show-web.jp/?p=352</guid>
		<description><![CDATA[自分用に適当に作ったので問題ある部分もあるかもしれませんが（保険）せっかくなので公開。 発端はtwitterで見かけた以下@shinichiNさんの発言。 独自テーマを作成していてたまにTwenty Elevenで確認し &#8230; <a href="http://show-web.jp/2012/04/16/%E8%87%AA%E5%88%86%E7%94%A8twenty-eleven%E8%A1%A8%E7%A4%BA%E7%A2%BA%E8%AA%8D%E7%94%A8%E3%83%96%E3%83%83%E3%82%AF%E3%83%9E%E3%83%BC%E3%82%AF%E3%83%AC%E3%83%83%E3%83%88/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>自分用に適当に作ったので問題ある部分もあるかもしれませんが（保険）せっかくなので公開。<br />
発端はtwitterで見かけた以下<a href="https://twitter.com/#!/shinichiN" title="@shinichiNさん" target="_blank">@shinichiNさん</a>の発言。</p>
<!-- tweet id : 186022358505631745 --><style type='text/css'>#bbpBox_186022358505631745 a { text-decoration:none; color:#0084B4; }#bbpBox_186022358505631745 a:hover { text-decoration:underline; }</style><div id='bbpBox_186022358505631745' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#C0DEED; background-image:url(http://a0.twimg.com/images/themes/theme1/bg.png); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#333333; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>WordPress&#12391;URL&#12398;&#26411;&#23614;&#12395; ?preview=1&template=twentyeleven&stylesheet=twentyeleven &#12434;&#20184;&#12369;&#12427;&#12392;twentyeleven&#12434;&#26377;&#21177;&#21270;&#12375;&#12383;&#24863;&#12376;&#12391;&#35211;&#12428;&#12427;&#12290;&#12418;&#12385;&#12429;&#12435;&#12525;&#12464;&#12452;&#12531;&#24517;&#35201;&#12290;</span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://show-web.jp/wp/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 2012年3月31日 18:29' href='http://twitter.com/#!/shinichiN/status/186022358505631745' target='_blank'>2012年3月31日 18:29</a> via <a href="http://sites.google.com/site/yorufukurou/" rel="nofollow" target="blank">YoruFukurou</a><a href='https://twitter.com/intent/tweet?in_reply_to=186022358505631745' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=186022358505631745' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=186022358505631745' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=shinichiN'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a0.twimg.com/profile_images/1017607416/portrait1_normal.jpg' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=shinichiN'>@shinichiN</a><div style='margin:0; padding-top:2px'>Shinichi Nishikawa</div></div><div style='clear:both'></div></div></div><!-- end of tweet -->
<br />
<p>独自テーマを作成していてたまにTwenty Elevenで確認したい時ってあります？よね。<br />
というわけでブックマークレットです。<br />
以下をブックマークバーまでドラッグしてください。<br />
制作中のWordPressサイト表示時にブックマークレットクリックでTwenty Elevenを有効化した場合のページが確認できます。<br />
<strong>※西川さんのツイート内にもありますがWordPressにログインしている必要があります。<br />
またTwenty Elevenテーマが入っていないと当然駄目なはずです。</strong></p>
<div class="wbkagawa-note">
	<h1>Twenty Eleven表示確認ブックマークレットVer0.1</h1>
	<a href="javascript:(function(){function o(u){var t=u+'?preview=true&#038;template=twentyeleven&#038;stylesheet=twentyeleven';window.open(t);}var url=window.location.href;o(url);})();">Twenty Eleven表示確認</a>
	</div>

<aside class="reference">
	<dl>
		<dt>参考サイト</dt>
		<dd><a href="http://www.catch.jp/wiki/?Bookmarklet%A4%CE%BA%EE%A4%EA%CA%FD" title="Bookmarkletの作り方 - catch.jp" target="_blank">Bookmarkletの作り方 &#8211; catch.jp</a></dd>
		<dd><a href="http://blog.bornneet.com/Entry/64/" title="ポップアップしないタイプのブックマークレットを新しいウィンドウで開くようにするやつ（とその逆） - Born Neet" target=_"blank">ポップアップしないタイプのブックマークレットを新しいウィンドウで開くようにするやつ（とその逆） &#8211; Born Neet</a></dd>
	</dl>
</aside>]]></content:encoded>
			<wfw:commentRss>http://show-web.jp/2012/04/16/%E8%87%AA%E5%88%86%E7%94%A8twenty-eleven%E8%A1%A8%E7%A4%BA%E7%A2%BA%E8%AA%8D%E7%94%A8%E3%83%96%E3%83%83%E3%82%AF%E3%83%9E%E3%83%BC%E3%82%AF%E3%83%AC%E3%83%83%E3%83%88/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>wp-includes/pluggable.phpをrequire_onceしちゃ駄目という話</title>
		<link>http://show-web.jp/2012/03/07/wp-includespluggable-php%E3%82%92require_once%E3%81%97%E3%81%A1%E3%82%83%E9%A7%84%E7%9B%AE%E3%81%A8%E3%81%84%E3%81%86%E8%A9%B1/</link>
		<comments>http://show-web.jp/2012/03/07/wp-includespluggable-php%E3%82%92require_once%E3%81%97%E3%81%A1%E3%82%83%E9%A7%84%E7%9B%AE%E3%81%A8%E3%81%84%E3%81%86%E8%A9%B1/#comments</comments>
		<pubDate>Tue, 06 Mar 2012 15:39:42 +0000</pubDate>
		<dc:creator>Sho Doi</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://show-web.jp/?p=350</guid>
		<description><![CDATA[INDEX 前置き 問題となったコード やっちゃ駄目な解決方法 pluggable.phpはオーバーライドできる関数なのでreuqire_onceしちゃ駄目 修正後のコード 前置き WordPress でスニペットを簡単 &#8230; <a href="http://show-web.jp/2012/03/07/wp-includespluggable-php%E3%82%92require_once%E3%81%97%E3%81%A1%E3%82%83%E9%A7%84%E7%9B%AE%E3%81%A8%E3%81%84%E3%81%86%E8%A9%B1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<section>
	<h1>INDEX</h1>
	<ol>
		<li><a href="#pluggable-introduction">前置き</a></li>
		<li><a href="#pluggable-section-01">問題となったコード</a></li>
		<li><a href="#pluggable-section-02">やっちゃ駄目な解決方法</a></li>
		<li><a href="#pluggable-section-03">pluggable.phpはオーバーライドできる関数なのでreuqire_onceしちゃ駄目</a></li>
		<li><a href="#pluggable-section-04">修正後のコード</a></li>
	</ol>
</section>
<section id="pluggable-introduction">
	<h1>前置き</h1>
	<p><a href="http://dogmap.jp/2011/04/19/wordpress-managed-snippet/" title="WordPress でスニペットを簡単に管理する方法 : dogmap.jp" target="_blank">WordPress でスニペットを簡単に管理する方法 : dogmap.jp</a>を参考にこれまでfunctions.phpに記述していたスニペットをプラグインで管理するようにしました。簡潔に説明するとプラグインディレクトリ下にスニペット格納用ディレクトリを設置して、スニペットが必要な時にはその中にphpファイルを保存していく、というものです。</p>
<p>そこでいくつかファイルを放り込んで行ったのですがとある箇所でエラーが発生したのでその解決方法なり原因をシェアします。</p>
</section>
<section id="pluggable-section-01">
	<h1>問題となったコード</h1>
	<p><pre class="brush: php; title: ; notranslate">
	if ( !current_user_can( 'edit_users' ) ) {

		function remove_menus() {
			global $menu;

			unset( $menu[2] ); // ダッシュボード
			unset( $menu[5] ); // 投稿
			// 省略
			unset( $menu[80] ); // 設定
		}

		add_action( 'admin_menu', 'remove_menus' );
	}
	</pre></p>
	<p>エラーが発生したのが上記コードです。<br />
	特定権限ユーザ以下の場合、管理画面のメニューを表示しないというものです。</p>
	<p>エラー内容は次の通り。</p>
	<div class="code-wrap">
	<code>Fatal error: Call to undefined function wp_get_current_user() in C:\xampp\htdocs\wordpress\wp-includes\capabilities.php on line 1187</code>
	</div>
	<p>wp-includes/capabilities.phpの1187行目にあるwp_get_current_user()が未定義とのこと。<br />
	で、wp_get_current_user()はwp-includes/pluggable.phpで定義されているからどうやらpluggable.phpがプラグイン読み込み時に読み込まれていないのが問題らしい。</p>
	<p><pre class="brush: php; first-line: 1186; highlight: [1187]; title: ; notranslate">
	function current_user_can( $capability ) {
	$current_user = wp_get_current_user();

	if ( empty( $current_user ) )
		return false;

	$args = array_slice( func_get_args(), 1 );
	$args = array_merge( array( $capability ), $args );

	return call_user_func_array( array( $current_user, 'has_cap' ), $args );
	}
	</pre></p>
</section>
<section id="pluggable-section-02">
	<h1>やっちゃ駄目な解決方法</h1>
	<p>上記エラー内容で検索を掛けるとよく目にした解決方法がこちら。</p>
	<p><pre class="brush: php; title: ; notranslate">
	// プラグインの先頭でpluggable.phpをrequire_onceする
	require_once ( ABSPATH.WPINC . '/pluggable.php');
	if ( !current_user_can( 'edit_users' ) ) {
		// 省略
	}
	</pre></p>
	<p>これでエラーが出ず処理も問題なく行われるようになったのですが（実際これでしばらく動かしてしまっていました）Ktai Styleプラグインを入れると以下のエラーが出るように。<br />
	auth_redirect()の関数名が重複してしまっているとのこと。<br />
	どうやら上記解決方法は問題がある模様・・・</p>
	<div class="code-wrap">
		<code>Fatal error: Cannot redeclare auth_redirect() (previously declared in C:\xampp\htdocs\wordpress\wp-includes\pluggable.php:731) in C:\xampp\htdocs\wordpress\wp-content\plugins\ktai-style\admin\pluggable-override.php on line 13</code>
	</div>
</section>
<section id="pluggable-section-03">
	<h1>pluggable.phpはオーバーライドできる関数なのでreuqire_onceしちゃ駄目</h1>
	<p>ここらでよくわからなくなったのでtwitterでつぶやいて見ることに。</p>
	<!-- tweet id : 176715860851961856 --><style type='text/css'>#bbpBox_176715860851961856 a { text-decoration:none; color:#0084B4; }#bbpBox_176715860851961856 a:hover { text-decoration:underline; }</style><div id='bbpBox_176715860851961856' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#C0DEED; background-image:url(http://a0.twimg.com/images/themes/theme1/bg.png); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#333333; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>require_once ( ABSPATH.WPINC . '/pluggable.php'); &#12434;&#12503;&#12521;&#12464;&#12452;&#12531;&#20808;&#38957;&#12395;&#12392;&#12356;&#12358;&#12398;&#12434;&#12424;&#12367;&#35211;&#12427;&#12369;&#12393;&#12381;&#12398;&#22580;&#21512;Ktai Style&#12503;&#12521;&#12464;&#12452;&#12531;&#12392;&#31478;&#21512;&#12375;&#12385;&#12419;&#12358;&#12290;</span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://show-web.jp/wp/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 2012年3月6日 02:08' href='http://twitter.com/#!/show_web/status/176715860851961856' target='_blank'>2012年3月6日 02:08</a> via web<a href='https://twitter.com/intent/tweet?in_reply_to=176715860851961856' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=176715860851961856' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=176715860851961856' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=show_web'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a0.twimg.com/profile_images/1656920953/jiji_normal.jpg' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=show_web'>@show_web</a><div style='margin:0; padding-top:2px'>Sho Doi</div></div><div style='clear:both'></div></div></div><!-- end of tweet -->
	<!-- tweet id : 176716235998900225 --><style type='text/css'>#bbpBox_176716235998900225 a { text-decoration:none; color:#8F5F24; }#bbpBox_176716235998900225 a:hover { text-decoration:underline; }</style><div id='bbpBox_176716235998900225' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#FFAE00; background-image:url(http://a0.twimg.com/profile_background_images/61323914/bg_tw.png); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#443F2F; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>@<a href="http://twitter.com/intent/user?screen_name=show_web" class="twitter-action">show_web</a> &#12381;&#12428;&#12480;&#12513;&#65406;&#65438;&#65391;&#65408;&#65394;</span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://show-web.jp/wp/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 2012年3月6日 02:10' href='http://twitter.com/#!/jim0912/status/176716235998900225' target='_blank'>2012年3月6日 02:10</a> via web<a href='https://twitter.com/intent/tweet?in_reply_to=176716235998900225' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=176716235998900225' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=176716235998900225' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=jim0912'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a0.twimg.com/profile_images/1570959634/s_normal.png' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=jim0912'>@jim0912</a><div style='margin:0; padding-top:2px'>Hitoshi Omagari</div></div><div style='clear:both'></div></div></div><!-- end of tweet -->
	<p><a href="https://twitter.com/#!/jim0912" title="まがりん" target="_blank">@jim0912</a>さんからダメとのご意見を頂いたのでやはり問題のある方法みたいだったので更に調べて見ることに。</p>
	<p>そこで参考になったのが以下のサイト。</p>
	<ul>
		<li><a href="http://ja.forums.wordpress.org/topic/330" title="WordPress &#8250; フォーラム &raquo; [Ktai Style]と[Events Calendar]でバッティングが起きる" target="_blank">WordPress &#8250; フォーラム &raquo; [Ktai Style]と[Events Calendar]でバッティングが起きる</a></li>
		<li><a href="http://wpdocs.sourceforge.jp/%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3_API#.E3.82.AA.E3.83.BC.E3.83.90.E3.83.BC.E3.83.A9.E3.82.A4.E3.83.89.E3.81.A7.E3.81.8D.E3.82.8B.E9.96.A2.E6.95.B0" title="オーバーライドできる関数 - プラグイン API - WordPress Codex 日本語版" target="_blank">オーバーライドできる関数 &#8211; プラグイン API &#8211; WordPress Codex 日本語版</a></li>
	</ul>
	<p>要はpluggable.php内の関数はプラグインでの再定義を意図した関数であるから先に定義するなっ、と。<br />
	例えばwp_get_current_user()を例にとると</p>
	<ol>
		<li>プラグインでwp_get_current_user関数を再定義</li>
		<li>pluggable.php読み込み時にwp_get_current_user関数が定義されていれば飛ばし、定義されていなれけばpluggable.php内のwp_get_current_user関数を読み込む</li>
	</ol>
	<p>という流れになります。<br />
	なので先のKtai Styleの場合で、pluggable.phpをrequire_onceしてしまっていると以下のような流れになってバッティングしてしまいます。</p>
	<ol>
		<li>プラグインの先頭でpluggable.phpがrequire_onceされ関数が先に定義されてしまう</li>
		<li>Ktai Styleプラグインが読み込まれpluggable.phpで使用されている関数と同じ物を定義（←バッティング）</li>
	</ol>
</section>
<section id="pluggable-section-04">
	<h1>修正後のコード</h1>
	<p>というわけでフックを使いましょう、というご意見を頂いたので以下の様にしてみました。<br />
	一応問題はないと思いますがフック等の理解がまだ微妙なので合ってるか分かりません・・・</p>
		<p><pre class="brush: php; title: ; notranslate">
		function remove_menus() {
			if ( !current_user_can( 'edit_users' ) ) {
				global $menu;
	
				unset( $menu[2] ); // ダッシュボード
				unset( $menu[5] ); // 投稿
				// 省略
				unset( $menu[80] ); // 設定
			}
		}
		add_action( 'admin_init', 'remove_menus' );
	</pre></p>
</section>]]></content:encoded>
			<wfw:commentRss>http://show-web.jp/2012/03/07/wp-includespluggable-php%E3%82%92require_once%E3%81%97%E3%81%A1%E3%82%83%E9%A7%84%E7%9B%AE%E3%81%A8%E3%81%84%E3%81%86%E8%A9%B1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPressのセキュリティプラグインBetter WP Securityを試してみた</title>
		<link>http://show-web.jp/2012/02/21/wordpress%E3%81%AE%E3%82%BB%E3%82%AD%E3%83%A5%E3%83%AA%E3%83%86%E3%82%A3%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3better-wp-security%E3%82%92%E8%A9%A6%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F/</link>
		<comments>http://show-web.jp/2012/02/21/wordpress%E3%81%AE%E3%82%BB%E3%82%AD%E3%83%A5%E3%83%AA%E3%83%86%E3%82%A3%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3better-wp-security%E3%82%92%E8%A9%A6%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 17:29:08 +0000</pubDate>
		<dc:creator>Sho Doi</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://show-web.jp/?p=317</guid>
		<description><![CDATA[免責事項 当記事の内容を利用される場合には、あくまでご自身の責任に置いてご利用ください。利用の結果生じた損害について、一切責任を負いません。 INDEX 前置き Better WP Securityプラグインインストール &#8230; <a href="http://show-web.jp/2012/02/21/wordpress%E3%81%AE%E3%82%BB%E3%82%AD%E3%83%A5%E3%83%AA%E3%83%86%E3%82%A3%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3better-wp-security%E3%82%92%E8%A9%A6%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<aside class="wbkagawa-note">
<h1>免責事項</h1>
<p>当記事の内容を利用される場合には、あくまでご自身の責任に置いてご利用ください。利用の結果生じた損害について、一切責任を負いません。</p>
</aside>

<section>
	<h1>INDEX</h1>
	<ol>
		<li><a href="#bws-introduction">前置き</a></li>
		<li><a href="#bws-install">Better WP Securityプラグインインストール</a></li>
		<li><a href="#bws-status">ステータス確認</a></li>
		<li><a href="#bws-item01">The admin user still exists</a><br />-ユーザ名&#8221;admin&#8221;が存在している-</li>
		<li><a href="#bws-item02">Your table prefix should not be wp_.</a><br />-データベースのテーブルプレフィックスが&#8221;wp_&#8221;のまま-</li>
		<li><a href="#bws-item03">Your .htaccess file is NOT secured.</a><br />-.htaccessファイルがセキュアではない-</li>
		<li><a href="#bws-item04">Your site is vulnerable to brute force attacks.</a><br />-ブルートフォースアタックに対して脆弱-</li>
		<li><a href="#bws-item05">Your WordPress admin area is available 24/7. Do you really update 24 hours a day?</a><br />-管理画面へのアクセスは常にできる必要はあるか-</li>
		<li><a href="#bws-item06">Your WordPress admin area file is NOT hidden.</a><br />
		-Wordpressの管理領域のファイルが隠されていない-</li>
		<li><a href="#bws-item07">You are not enforcing strong passwords.</a><br />-全てのユーザに対して強力なパスワードが強制されていない-</li>
		<li><a herf="#bws-item08">Your WordPress header is showing too much information to users.</a><br />
		-headerに多くの情報が表示され過ぎている-</li>
		<li><a href="#bws-item09">Non-administrators can see all updates.</a><br />
		-管理者以外が全てのアップデート情報を閲覧出来る-</li>
		<li><a href="#bws-item10">Your installation accepts long (over 255 character) URLS. This can lead to vulnerabilities.</a><br />
		-URLに送信出来る文字数が制限されていないため脆弱性に繋がる-</li>
		<li><a href="#bws-item11">Users may still be able to get version information from various plugins and themes.</a><br />
		-ユーザはプラグインやテーマからバージョン情報を知る事が出来る-</li>
		<li><a href="#bws-item12">Your site is still vulnerable to some XSS attacks.</a><br />
		-いくつかのXSS攻撃に対して脆弱-</li>
		<li><a href="#bws-item13">You are not requiring a secure connection for logins or for the admin area.</a><br />
		-あなたはログインのためのまたは管理エリアの安全な接続を必要とされていません-</li>
		<li><a href="#bws-item14">You are allowing users to edit theme and plugin files from the WordPress backend.</a><br />
		-ユーザーがWordPressのバックエンドからテーマやプラグインファイルを編集することができます-</li>
		<li><a href="#bws-item15">You should rename the wp-content directory of your site.</a><br />
		-&#8221;wp-content&#8221;ディレクトリ名を変更する必要があります-</li>
		<li><a href="#bws-summary">まとめ</a></li>
	</ol>
</section>
<section id="bws-introduction">
<h1>前置き</h1>
<p>ここ半年くらいでWordPressの停止中のプラグインの脆弱性を突いてデータを改竄、wp-login.phpへのブルートフォースアタック（総当たり攻撃）といった記事をいくつか目にしたのでWordPressのセキュリティについて調べてみました。<br />
いくつか調べたうち、Better WP Securityが役立ちそうだったので機能の解説をしてみます。（プラグインが日本語化されていないのでGoogle翻訳及び英語さっぱりな当方によるなんちゃって日本語での解説となります）<br />
なお、Better WP Securityプラグインのみでセキュリティ対策になるという訳ではありません。（悪意あるコードが含まれるテーマ・プラグインを管理者自身が導入といったケースには対応していないはずです）<br />また、私はPHP及びセキュリティは専門ではありませんので上記免責事項にもありますがご自身の責任に置いてご利用ください。</p>
</section>
<section id="bws-install">
<h1>Better WP Securityプラグインインストール</h1>
プラグインのインストールはいつも通り&#8221;管理画面 > プラグイン > 新規追加 > Better WP Security検索 > 一覧よりインストール&#8221;ですので省略します。（2012/02/21現在バージョンは2.18を使用）<br />
インストール完了、有効化でサイドバーにメニューが表示されます。</p>
<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-01.png" alt="" title="bwps-01" width="299" height="303" class="alignnone size-full wp-image-321" />
</section>
<section id="bws-status">
<h1>ステータス確認</h1>
<p>サイドバーの&#8221;Security&#8221;をクリックで現在の</p>
<ul>
	<li>「Better WP Security System Status（現在のセキュリティ情報）」</li>
	<li>「System Information（ユーザ・PHP・データベース・WordPress情報等）」</li>
	<li>「Current .htaccess Contents（現在の.htaccessファイル）」</li>
</ul>
<p>が表示されます。</p>
<p><a href="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-02.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-02-584x532.png" alt="" title="bwps-02" width="584" height="532" class="alignnone size-medium wp-image-323" /></a><br />
上図、ローカル環境でのセキュリティ情報ですが、警告（赤）・注意（黄）だらけなのが確認出来ます。なお問題ない項目は安全（緑）で表示されます。<br />
というわけで各警告・注意の簡単な説明です。（一部分かっていませんが。）</p>
<dl id="status-detail">
	<dt class="warning">The admin user still exists.</dt>
	<dd>ユーザ名&#8221;admin&#8221;が存在している → <a href="#item01">詳細</a></dd>
	<dt class="warning">Your table prefix should not be wp_.</dt>
	<dd>データベースのテーブルプレフィックスが&#8221;wp_&#8221;のまま → <a href="#item02">詳細</a></dd>
	<dt class="warning">Your .htaccess file is NOT secured.</dt>
	<dd>.htaccessファイルがセキュアではない → <a href="#item03">詳細</a></dd>
	<dt class="warning">Your site is vulnerable to brute force attacks.</dt>
	<dd>ブルートフォースアタックに対して脆弱 → <a href="#item04">詳細</a></dd>
	<dt class="caution">Your WordPress admin area is available 24/7. Do you really update 24 hours a day?</dt>
	<dd>管理画面へのアクセスは常にできる必要はあるか → <a href="#item05">詳細</a></dd>
	<dt class="warning">Your WordPress admin area file is NOT hidden.</dt>
	<dd>WordPressの管理領域のファイルが隠されていない（翻訳よくわからない？）たぶんログインURL（wp-login.php）等がデフォルトのままなので変更しなさいい、という警告。 → <a href="#item06">詳細</a></dd>
	<dt class="warning">You are not enforcing strong passwords.</dt>
	<dd>全てのユーザに対して強力なパスワードが強制されていない → <a href="#item07">詳細</a></dd>
	<dt class="warning">Your WordPress header is showing too much information to users.</dt>
	<dd>headerに多くの情報が表示され過ぎている → <a href="#item08">詳細</a></dd>
	<dt class="warning">Non-administrators can see all updates.</dt>
	<dd>管理者以外が全てのアップデート情報を閲覧出来る → <a href="#item09">詳細</a></dd>
	<dt class="warning">Your installation accepts long (over 255 character) URLS. This can lead to vulnerabilities.</dt>
	<dd>URLに送信出来る文字数が制限されていないため脆弱性に繋がる → <a href="#item10">詳細</a></dd>
	<dt class="warning">Users may still be able to get version information from various plugins and themes.</dt>
	<dd>ユーザはプラグインやテーマからバージョン情報を知る事が出来る → <a href="#item11">詳細</a></dd>
	<dt class="warning">Your site is still vulnerable to some XSS attacks.</dt>
	<dd>いくつかのXSS攻撃に対して脆弱 → <a href="#item12">詳細</a></dd>
	<dt class="caution">You are not requiring a secure connection for logins or for the admin area.</dt>
	<dd>あなたはログインのためのまたは管理エリアの安全な接続を必要とされていません → <a href="#item13">詳細</a></dd>
	<dt class="caution">You are allowing users to edit theme and plugin files from the WordPress backend.</dt>
	<dd>ユーザーがWordPressのバックエンドからテーマやプラグインファイルを編集することができます → <a href="#item14">詳細</a></dd>
	<dt class="warning">You should rename the wp-content directory of your site.</dt>
	<dd>&#8220;wp-content&#8221;ディレクトリ名を変更する必要があります → <a href="#item15">詳細</a></dd>
</dl>
<p>それでは上の警告から対策して行きたいと思います。各警告横のリンクまたはサイドメニュー&#8221;Security&#8221;のサブメニューより設定を行います。<br />
<strong>※無理に全ての警告・注意を安全にする必要はないと考えています。<br />
他のセキュリティ情報を調べるとBetter WP Securityプラグインで警告・注意されている項目でも無駄なものもあるようですので。</strong></p>
</section>
<section id="bws-item01">
	<hgroup class="heading">
		<h1>The admin user still exists.</h1>
		<h2>-ユーザ名&#8221;admin&#8221;が存在している-</h2>
	</hgroup>
	<p>ユーザ名で&#8221;admin&#8221;を使用している場合に警告が出ます。<br />
	WordPress3.0からインストール時に任意のユーザ名を設定出来るようになりましたが、3.0まではデフォルトの管理者名が&#8221;admin&#8221;だったため狙われやすい、ということからの警告と思われます。</p>
	<p>&#8220;Security > Admin User&#8221;よりユーザ名を変更する事で安全となります。<br />
	<img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-03.png" alt="" title="bwps-03" width="416" height="222" class="alignnone size-full wp-image-324" /></p>
	<p>ただし、<a href="http://ja.forums.wordpress.org/topic/8056#post-32473" title="WordPress &#8250; フォーラム &raquo; セキリュティについての質問" target="_blank">WordPress &#8250; フォーラム &raquo; セキリュティについての質問</a>にある通り、<a href="http://show-web.jp/?author=1" target="_blank">http://show-web.jp/?author=1</a> とすると、http://show-web.jp/author/admin/ と帰ってくるように、ユーザIDを増やしていくと容易にユーザ名を知る事が出来るのでこちらの設定はあまり意味がないかもしれません。</p>
</section>
<section id="bws-item02">
	<hgroup>
		<h1>Your table prefix should not be wp_.</h1>
		<h2>-データベースのテーブルプレフィックスが&#8221;wp_&#8221;のまま-</h2>
	</hgroup>
	<p>テーブルのプレフィックスがデフォルトの&#8221;wp_&#8221;のままでは推測しやすいので警告が出ます。</p>
	<p>&#8220;Security > Database Prefix&#8221;より変更を行います。<br />
	&#8220;Change Database Table Prefix&#8221;クリックでテーブルプレフィックスが&#8221;wp_&#8221;からランダムな値に変更されます。<strong>※要バックアップ</strong>。
	<img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-04.png" alt="" title="bwps-04" width="411" height="327" class="alignnone size-full wp-image-325" /></p>
	<p>ただ、この項目に関しても<a href="http://ja.forums.wordpress.org/topic/8056#post-32473" title="WordPress &#8250; フォーラム &raquo; セキリュティについての質問" target="_blank">WordPress &#8250; フォーラム &raquo; セキリュティについての質問</a>で解説されているようにWordPressではSQLインジェクションがほとんど起こらないらしいので必要ないかもしれません。</p>
</section>
<section id="bws-item03">
	<hgroup class="heading">
		<h1>Your .htaccess file is NOT secured.</h1>
		<h2>-.htaccessファイルがセキュアではない-</h2>
	</hgroup>
	<p>.htaccessがセキュアな状態ではありません。<br />
	&#8220;Security > .htaccess Protection&#8221;より設定を行います。<br />
	なお、次のケースでは以図の警告が出ます。</p>
	<ol>
		<li>WordPressインストールフォルダに.htaccessがない場合</li>
		<li>.htaccessファイルへの書き込み権限がない場合</li>
	</ol>
	<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-05.png" alt="" title="bwps-05" width="474" height="140" class="alignnone size-full wp-image-326" /></p>
	<ol>
		<li>&#8220;設定 > パーマリンク設定&#8221;で適当なパーマリンクを設定する事で.htaccessファイルを生成</li>
		<li>ファイルパーミッションの設定で.htaccessファイルの書き込み権限付与</li>
	</ol>
	<p>上記を行った後再度&#8221;.htaccess Protection&#8221;設定へ行くと以下の設定画面となります。<br />
	全ての項目の詳細は理解出来ていませんが、readme.htmlやwp-config.phpへのアクセスを拒否したりURLの不審なクエリ文字列を除外したりしてくれているようですので、全てにチェックを入れて保存します。<br />
	<img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-06.png" alt="" title="bwps-06" width="551" height="481" class="alignnone size-full wp-image-327" /></p>
	<p>試しにwp-config.phpがある場所へアクセスしてみると403を返してくれました。<br />
	<a href="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-07.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-07-584x526.png" alt="" title="bwps-07" width="584" height="526" class="alignnone size-medium wp-image-329" /></a></p>
</section>
<section id="bws-item04">
	<hgroup class="heading">
		<h1>Your site is vulnerable to brute force attacks.</h1>
		<h2>-ブルートフォースアタックに対して脆弱-</h2>
	</hgroup>
	<p>ブルートフォースアタック（総当たり攻撃）への対策を行います。<br />
	&#8220;Security > Limit Logins&#8221;より設定を行います。<br />
	設定をOnにすることで、特定ホストからの連続不正アクセス、特定ユーザ名での連続不正アクセスがあった際にそのホスト・ユーザに対して制限を掛ける事が出来ます。<br />
	<a href="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-08.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-08-584x518.png" alt="" title="bwps-08" width="584" height="518" class="alignnone size-medium wp-image-330" /></a></p>
	<p>以下設定内容です（不明な箇所あり）</p>
	<dl>
		<dt>Enable Limit Bad Login Attempts</dt>
		<dd>不正ログインに対して試行回数を制限するか。Onを選択。</dd>
		<dt>Max Login Attempts Per Host</dt>
		<dd>1ホストあたりの最大ログイン回数</dd>
		<dt>Max Login Attempts Per User</dt>
		<dd>1ユーザアカウントへの最大ログイン回数</dt>
		<dt>Login Time Period (minutes)</dt>
		<dd>不明（何の時間？）</dd>
		<dt>Lockout Time Period (minutes)</dt>
		<dd>ロックアウト期間。不正ログインによる試行回数が設定数以上に達した際の閉め出し時間。</dd>
		<dt>Deny All Site Access To Locked Out Hosts.</dt>
		<dd>ロックアウトユーザはサイト全てを閲覧出来なくするかどうか。Onを選択。</dd>
		<dt>Enable Email Notifications.</dt>
		<dd>ロックアウトが発生する度に管理者へメール通知を行う。Onを選択。<dd>
		<dt>Default Error Message</dt>
		<dd>ロックアウトユーザがアクセスした際に表示されるテキスト。</dd>
	</dl>
</section>
<section id="bws-item05">
	<hgroup class="heading">
		<h1>Your WordPress admin area is available 24/7. Do you really update 24 hours a day?</h1>
		<h2>-管理画面へのアクセスは常にできる必要はあるか-</h2>
	</hgroup>
	<p>24/7がよく分からなかったのですがスラングで「いつも・常に」といった意味ですね。<br /><a href="http://www.eigowithluke.com/2011/02/247/" title="24/7の意味　(ネイティブのスラング辞典と英語発音辞典) | 英語 with Luke" target="_blank">24/7の意味　(ネイティブのスラング辞典と英語発音辞典) | 英語 with Luke</a></p>
	<p>という訳で、「WordPress管理画面は常にログイン出来る状態にしておく必要があるのか？」といったところでしょうか。<br />
	確かに企業サイトで営業時間内のみしかブログを更新しないという場合、深夜は管理画面へアクセス出来る必要はありません。</p>
	<p>設定は&#8221;Security > Away Mode&#8221;より。<br />
	<a href="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-09.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-09-584x467.png" alt="" title="bwps-09" width="584" height="467" class="alignnone size-medium wp-image-331" /></a></p>
	<p>以下設定内容。</p>
	<dl>
		<dt>Enable Away Mode</dt>
		<dd>特定の期間管理画面にログイン出来なくする設定のOn/Off</dd>
		<dt>Type of Restriction</dt>
		<dd>制限の種類。Dairy（毎日）、またはOne Time（指定の一定期間）を選択。</dd>
		<dt>Start Date and Time / End Date and Time</dt>
		<dd>制限の種類でDairyを選択した場合、Start Date and Timeで設定した時間からEnd Date and Timeで設定した時間まで管理画面にアクセス出来なくなります。<br />
		同様にOne Timeを選択した場合は、Start Date and Timeで設定した日付・時間からEnd Date and Timeで設定した日付・時間まで管理画面にアクセス出来なくなります。</dd>
	</dl>
	<p>例えばOne TimeでStart Date and Time: February 22nd, 2012 at 12:00 am &#8211; End Date and Time: April 22nd, 2012 at 12:00 amと設定すると、Access Time Ruleの項目に以下の通り表示され、この期間一切管理画面にアクセス出来なくなってしまいますので気を付けてください。</p>
	<dl>
		<dt>Access Time Rule</dt>
		<dd>The backend (administrative section) of this site will be unavailable from Wednesday, February 22nd, 2012 at 12:00 am until Sunday, April 22nd, 2012 at 12:00 am.</dd>
	</dl>
</section>
<section id="bws-item06">
	<hgroup class="heading">
		<h1>Your WordPress admin area file is NOT hidden.</h1>
		<h2>-Wordpressの管理領域のファイルが隠されていない-</h2>
	</hgroup>
	<p><strong class="warning">※私の理解不足の所為ですが、この機能をOnにしたらブログにログイン出来なくなりました。なんとかログイン出来るようにはなりましたが怖いのでこの機能は使用していません。<br />
	詳しい方いらっしゃればアドバイス頂ければ助かります。</strong><p>
	<p>直訳すると「WordPressの管理領域のファイルが隠されていません。」と出て来たけどいまいち分からなかったので設定画面を見てみる事に。<br />
	&#8220;Security > Hide Backend&#8221;へ。</p>
	<p>どうやらwp-login.phpやwp-register.php、wp-admin/へのアクセスを独自のURLに変更してくれてwp-login.php等へのアクセスを404にしてくれるらしい。<br />
	<a href="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-10.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-10-584x414.png" alt="" title="bwps-10" width="584" height="414" class="alignnone size-medium wp-image-332" /></a></p>
	<p>機能をOnにすると.htaccessに以下とデータベースのwp_optionsにそれらしき設定が追加されます。</p>
	<p><pre class="brush: plain; title: ; notranslate">
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /

RewriteRule ^login wp3.3/wp-login.php?2outcx4j6thhy0do0456v [R,L]
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$
RewriteRule ^admin$ wp3.3/wp-login.php?5locztyc3vlytpqcmfcap&amp;redirect_to=/wp-admin/ [R,L]
RewriteRule ^admin$ wp3.3/wp-admin/?2outcx4j6thhy0do0456v [R,L]
RewriteRule ^register$ wp3.3/wp-login.php?2outcx4j6thhy0do0456v&amp;action=register [R,L]
RewriteCond %{HTTP_REFERER} !^(.*)/wp-admin 
RewriteCond %{HTTP_REFERER} !^(.*)/wp-login\.php 
RewriteCond %{HTTP_REFERER} !^(.*)/login 
RewriteCond %{HTTP_REFERER} !^(.*)/admin 
RewriteCond %{HTTP_REFERER} !^(.*)/register 
RewriteCond %{QUERY_STRING} !^2outcx4j6thhy0do0456v 
RewriteCond %{QUERY_STRING} !^action=logout
RewriteCond %{QUERY_STRING} !^action=rp
RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$
RewriteRule ^wp-admin/?|^wp-login\.php not_found [L]
&lt;/IfModule&gt;
</pre></p>
	<p>処理の流れとしては以下の通りでしょうか。</p>
	<ol>
		<li>http://localhost/wp3.3/wp-login.php → 404エラー</li>
		<li>独自で設定したログインURL http://localhost/wp3.3/login にアクセス。</li>
		<li>.htaccessのRewiteRuleにより http://localhost/wp3.3/login.php?2outcx4j6thhy0do0456v へ。（?2outcx4j6thhy0do0456vパラメータがある場合のみログイン画面が表示される）</li>
		<li>通常通りユーザ名・パスワードを入力してログイン</li>
	</ol>
	<p>私の環境では「ユーザ名・パスワードを入力しても再度ログイン画面が表示される」、「間違えたユーザ名・パスワードを入力してもプルプル警告が出ずログイン画面が表示される」となってしまい結局ログイン自体が出来ない状態になってしまいました。</p>
	<p>という訳で、この機能は怖いので使用していません。</p>
</section>
<section id="bws-item07">
	<hgroup class="heading">
		<h1>You are not enforcing strong passwords.</h1>
		<h2>-全てのユーザに対して強力なパスワードが強制されていない-</h2>
	</hgroup>
	<p>ユーザ権限に対して強力なパスワードを強制するように設定します。<br />
	&#8220;Security > System Tweaks > Strong Password Tweaks&#8221;へ。</p>
	<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-11.png" alt="" title="bwps-11" width="543" height="166" class="alignnone size-full wp-image-343" /></p>
	<dl>
		<dt>Enabled strong password enforcement</dt>
		<dd>強力なパスワードの強制をOnにします。</dd>
		<dt>Strong Pass Role</dt>
		<dd>セレクトボックスから権限レベルを選択し、それ以上の権限レベルに対して強力なパスワードを強制します。</dd>
	</dl>
	<p>権限レベルはAdministrator（管理者）, Editor（編集者）, Author（投稿者）, Contributor（寄稿者）, Subscriber（購読者）より選択、Subscriber以外を選択した場合はセキュリティステータスは<span class="caution">You are enforcing strong passwords, but not for all users.</span>の注意となり、Contributor以上の権限レベルに対し強力なパスワードを強制する設定となります。<br />Subscriberの選択で<span class="safety">You are enforcing strong passwords for all users</span>となり全権限レベルに対して強力なパスワードを強制する設定となります。</p>
	<p>弱いパスワードで新規ユーザを追加しようとすると以下のようにエラーが発生します。<br />
	<a href="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-12.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-12-584x85.png" alt="" title="bwps-12" width="584" height="85" class="alignnone size-medium wp-image-334" /></a><br />
	ただ、既存ユーザのパスワードに対しては警告は出ないようです。</p>
</section>
<section id="bws-item08">
	<hgroup class="heading">
		<h1>Your WordPress header is showing too much information to users.</h1>
		<h2>-headerに多くの情報が表示され過ぎている-</h2>
	</hgroup>
	<p>head要素にWordPressのバージョン等の情報が表示され過ぎているという警告。<br />
	&#8220;Security > System Tweaks > Header Tweaks&#8221;より設定。</p>
	<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-13.png" alt="" title="bwps-13" width="542" height="232" class="alignnone size-full wp-image-342" /><br />
	&lt;meta content=&quot;WordPress 3.3.1&quot; name=&quot;generator&quot;&gt;等を削除してくれるそうですがバージョン情報削除するのあんまり意味無いと思うのでどうだろう。全てチェック入れてもマイナス要素はないと思います。</p>
</section>
<section id="bws-item09">
	<hgroup class="heading">
		<h1>Non-administrators can see all updates.</h1>
		<h2>-管理者以外が全てのアップデート情報を閲覧出来る-</h2>
	</hgroup>
	<p>デフォルトでは管理者以外でもコア・テーマ・プラグインのアップデートが閲覧出来るので見えなくします。<br />
	&#8220;Security > System Tweaks > Dashboard Tweaks&#8221;より設定。</p>
	<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-14.png" alt="" title="bwps-14" width="542" height="235" class="alignnone size-full wp-image-341" /><br />
	上より、テーマ、プラグイン、コアアップデートの表示を非管理者へ対して行うかの設定です。<br />
	チェックを入れる事で非管理者はアップデート情報の閲覧が出来なくなります。</p>
</section>
<section id="bws-item10">
	<hgroup class="heading">
		<h1>Your installation accepts long (over 255 character) URLS. This can lead to vulnerabilities.</h1>
		<h2>-URLに送信出来る文字数が制限されていないため脆弱性に繋がる-</h2>
	</hgroup>
	<p>勉強不足ですがハッカーはURLパラメータにSQL文を挿入することでデータベースを操作しようと狙ってくるそうです。そこでURLの文字数制限を行うように設定します。<br />
	&#8220;Security > System Tweaks > Other Tweaks > Prevent long URL strings.&#8221;をチェックして保存で設定完了。</p>
	<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-15.png" alt="" title="bwps-15" width="543" height="65" class="alignnone size-full wp-image-340" /><br />
	試しにURLに長い文字列を入力してみると、ブログは表示されず真っ白な画面が表示されるのみ、となりました。</p>
</section>
<section id="bws-item11">
	<hgroup class="heading">
		<h1>Users may still be able to get version information from various plugins and themes.</h1>
		<h2>-ユーザはプラグインやテーマからバージョン情報を知る事が出来る-</h2>
	</hgroup>
	<p>デフォルトでは以下の様にcss,jsの末尾に&#8221;style.css?ver=3.3.1&#8243;といった具合にパラメータとしてバージョンが表示されます。設定により非管理者からはバージョンが閲覧出来なくします。</p>
	<p><pre class="brush: plain; title: ; notranslate">&lt;link href=&quot;http://localhost/wp3.3/wp-content/themes/Automattic-_s/style.css?ver=3.3.1&quot; rel=&quot;stylesheet&quot; /&gt;</pre></p>
	<p>&#8220;Security > System Tweaks > Other Tweaks > Display random version number to all non-administrative users&#8221;をチェックして保存で設定完了。</p>
	<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-16.png" alt="" title="bwps-16" width="525" height="64" class="alignnone size-full wp-image-339" /><br />
	説明を読む限り非管理者にはランダムなバージョンを見せて分からなくさせるのかな、と思ったのですが一切のバージョン番号が見えなくなるようです。</p>
</section>
<section id="bws-item12">
	<hgroup class="heading">
		<h1>Your site is still vulnerable to some XSS attacks.</h1>
		<h2>-いくつかのXSS攻撃に対して脆弱-</h2>
	</hgroup>
	<p>よく分かっていません。<br />
	設定は&#8221;Security > Intrusion Detection&#8221;でEnable 404 DetectionをOnにすればセキュリティステータスは安全になるのですが具体的に何をしているのか？XSSと404は関係あるのといった感じです。<br />
	少し調べてみたところ、こちらに書いてある事を防ぐ様な設定でしょうか。<br />
	<a href="http://www2.nsknet.or.jp/~azuma/c/c0178.htm" target="_blank">cross-site scripting</a></p>
	<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-17.png" alt="" title="bwps-17" width="580" height="608" class="alignnone size-full wp-image-344" /></p>
</section>
<section id="bws-item13">
	<hgroup class="heading">
		<h1>You are not requiring a secure connection for logins or for the admin area.</h1>
		<h2>-あなたはログインのためのまたは管理エリアの安全な接続を必要とされていません-</h2>
	</hgroup>
	<p>日本語はGoogle翻訳そのままでさっぱりです、がたぶん「管理エリアへの安全な接続」とあるので管理画面へはSSLで接続出来るようにといった注意だと思われます。<br />
	&#8220;Security > System Tweaks > SSL Tweaks&#8221;から設定出来るようですがこの機能を使うにはSSLサーバを契約していなければいけない旨の警告があるので今回は飛ばします。</p>
	<p></p><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-18.png" alt="" title="bwps-18" width="547" height="199" class="alignnone size-full wp-image-345" />
</section>
<section id="bws-item14">
	<hgroup class="heading">
		<h1>You are allowing users to edit theme and plugin files from the WordPress backend.</h1>
		<h2>-ユーザーがWordPressのバックエンドからテーマやプラグインファイルを編集することができます-</h2>
	</hgroup>
	<p>こちらもいまいち分かりません。<br />&#8220;外観 > テーマ編集&#8221;、&#8221;プラグイン > プラグイン編集&#8221;を行えてしまう旨の注意書きかと思われます。<br />
	&#8220;Security > System Tweaks > Other Tweaks > Turn off file editor in WordPress Back-end.&#8221;から設定出来るようですがチェックして保存しても、チェックされていない状態となってしまいます。他ファイルの書き込み権限とかが絡んでるのでしょうか・・・</p>
	<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-19.png" alt="" title="bwps-19" width="537" height="73" class="alignnone size-full wp-image-346" /></p>
</section>
<section id="bws-item15">
	<hgroup class="heading">
		<h1>You should rename the wp-content directory of your site.</h1>
		<h2>-&#8221;wp-content&#8221;ディレクトリ名を変更する必要があります-</h2>
	</hgroup>
	<p>デフォルトの&#8221;wp-content&#8221;ディレクトリ名を変更するように、との警告。<br />
	&#8220;Security > Content Directory&#8221;より変更を行えます。</p>
	<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/bwps-20.png" alt="" title="bwps-20" width="538" height="260" class="alignnone size-full wp-image-347" /><br />
	ただ、&#8221;wp-content&#8221;ディレクトリ名を変更しても記事に画像をアップロードしたらそこからパスが分かってしまうので意味がないような気もします。</p>
</section>
<section id="bws-summary">
	<h1>まとめ</h1>
	<p>というわけでGoogle翻訳に頼ったり、自ら実験台となりBetter WP Securityプラグインを試してみました。<br />
	.htaccessを生成してファイルを保護してくれたり、ブルートフォースアタック対策があるのは便利かなと思えた反面、&#8221;admin&#8221;ユーザや&#8221;wp-content&#8221;ディレクトリ名について警告が出るのは厳しいなと。</p>
	<p>また、記事中に書いていませんが特定ユーザ・ホストをBAN出来たりもするようですので保証は出来かねますが便利なプラグインではないでしょうか。</p>
	<p>ただ、設定次第では自分自身がログイン出来なくなる状態に陥ってしまうので使用の際はあくまで自己責任でお願いします。</p>
	<p>加えて記事中にもありますがプラグインでwp-login.phpへのアクセスを隠蔽する設定が出来なかったので現状wp-login.phpへアクセス出来る状態になっています。<br />
	ですので、<a href="http://okiraku-server.net/server/2011/07/18200.html" title="いまさらながら、WordPressのセキュリティを考えてみた。その１　wp-login.phpを不正アクセスから守る | おきらくサーバー運用メモ" target="_blank">いまさらながら、WordPressのセキュリティを考えてみた。その１　wp-login.phpを不正アクセスから守る | おきらくサーバー運用メモ</a>を参考に.htaccessでwp-login.phpに対して自身のIP（固定IPの場合）のみ許可する設定を記述したほうが良いと思われます。</p>
	<p>あと、適当英語、適当PHP・セキュリティ知識で記事を書いたのでWordPressやセキュリティの偉い人達からツッコミがきたら怖いです・・・</p>
</section>]]></content:encoded>
			<wfw:commentRss>http://show-web.jp/2012/02/21/wordpress%E3%81%AE%E3%82%BB%E3%82%AD%E3%83%A5%E3%83%AA%E3%83%86%E3%82%A3%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3better-wp-security%E3%82%92%E8%A9%A6%E3%81%97%E3%81%A6%E3%81%BF%E3%81%9F/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>NetBeans IDE 7.1でプラグインを無効化したら動かなくなった対処法</title>
		<link>http://show-web.jp/2012/02/13/netbeans-ide-7-1%E3%81%A7%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E7%84%A1%E5%8A%B9%E5%8C%96%E3%81%97%E3%81%9F%E3%82%89%E5%8B%95%E3%81%8B%E3%81%AA%E3%81%8F%E3%81%AA%E3%81%A3%E3%81%9F/</link>
		<comments>http://show-web.jp/2012/02/13/netbeans-ide-7-1%E3%81%A7%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E7%84%A1%E5%8A%B9%E5%8C%96%E3%81%97%E3%81%9F%E3%82%89%E5%8B%95%E3%81%8B%E3%81%AA%E3%81%8F%E3%81%AA%E3%81%A3%E3%81%9F/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 09:36:45 +0000</pubDate>
		<dc:creator>Sho Doi</dc:creator>
				<category><![CDATA[ツール]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://show-web.jp/?p=308</guid>
		<description><![CDATA[NetBeans IDE 7.1は動作が軽いので愛用してるのですが更に軽くできないかと &#8220;ツール > プラグイン > インストール済み&#8221; を見ると有効になっているプラグインがいっぱい。 「PHP  &#8230; <a href="http://show-web.jp/2012/02/13/netbeans-ide-7-1%E3%81%A7%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E7%84%A1%E5%8A%B9%E5%8C%96%E3%81%97%E3%81%9F%E3%82%89%E5%8B%95%E3%81%8B%E3%81%AA%E3%81%8F%E3%81%AA%E3%81%A3%E3%81%9F/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>NetBeans IDE 7.1は動作が軽いので愛用してるのですが更に軽くできないかと &#8220;ツール > プラグイン > インストール済み&#8221; を見ると有効になっているプラグインがいっぱい。<br />
「PHP Smarty フレームワーク」とか使ってないし・・・と不要っぽいプラグインを無効化していったら動かなくなったので対処法を。<br />
<a href="http://show-web.jp/wp/wp-content/uploads/2012/02/netbeans-01.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/netbeans-01-584x348.png" alt="NetBeans IDE 7.1 プラグイン画面" title="netbeans-01" width="584" height="348" class="alignnone size-medium wp-image-309" /></a></p>
<section>
	<h1>起動しても何も表示されないorz</h1>
	<p>プラグインを適当に無効化した後再起動すると下の様な感じに。<br />
	エディターもプロジェクトもメニューすら表示されていません。<br />
	<a href="http://show-web.jp/wp/wp-content/uploads/2012/02/netbeans-02.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/netbeans-02-584x399.png" alt="NetBeans IDE 動作しないよ" title="netbeans-02" width="584" height="399" class="alignnone size-medium wp-image-310" /></a></p>
	<p>右下を見ると何やら赤い警告が。クリックしてみると。<br />
	<a href="http://show-web.jp/wp/wp-content/uploads/2012/02/netbeans-03.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/netbeans-03-584x399.png" alt="エラー警告" title="netbeans-03" width="584" height="399" class="alignnone size-medium wp-image-311" /></a><br />
	更に警告の詳細を見てみる。<br />
	<a href="http://show-web.jp/wp/wp-content/uploads/2012/02/netbeans-04.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/netbeans-04-584x293.png" alt="エラー警告詳細" title="netbeans-04" width="584" height="293" class="alignnone size-medium wp-image-312" /></a><br />
	Javaらしきエラーが表示されているようですがさっぱりわかりません。</p>
	<p>というわけでいつものようにGoogle先生に頼ることに。<br />
	プラグインを無効にしたのだからその設定ファイルがあるはず。ということで辿り着いたのがこちら。<br />
	<a href="http://blog.livedoor.jp/braahmana/archives/1576639.html" title="自分実験室 : netbeansプラグインの有効・無効化を直接切り替える" target="_blank">自分実験室 : netbeansプラグインの有効・無効化を直接切り替える</a></p>
</section>
<section>
	<h1>プラグインの有効・無効を直接切替える</h1>
	<p>プラグインの設定ファイルは &#8220;C:\Users\（ユーザ名）\.netbeans\7.1\config\Modules\&#8221; にxmlファイルで格納されているとのこと。<br />
	<a href="http://show-web.jp/wp/wp-content/uploads/2012/02/netbeans-06.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/netbeans-06-584x288.png" alt="プラグイン設定ファイル郡" title="netbeans-06" width="584" height="288" class="alignnone size-medium wp-image-314" /></a></p>
	<p>これらxmlファイルにプラグインの有効・無効の設定が保存されているので全て有効にしていくことに。<br />
	以下はzencodingプラグイン設定xmlファイルの中身です。</p>
	<p><pre class="brush: plain; highlight: [7]; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE module PUBLIC &quot;-//NetBeans//DTD Module Status 1.0//EN&quot;
                        &quot;http://www.netbeans.org/dtds/module-status-1_0.dtd&quot;&gt;
&lt;module name=&quot;org.lorenzos.zencoding&quot;&gt;
    &lt;param name=&quot;autoload&quot;&gt;false&lt;/param&gt;
    &lt;param name=&quot;eager&quot;&gt;false&lt;/param&gt;
    &lt;param name=&quot;enabled&quot;&gt;false&lt;/param&gt;
    &lt;param name=&quot;jar&quot;&gt;modules/org-lorenzos-zencoding.jar&lt;/param&gt;
    &lt;param name=&quot;reloadable&quot;&gt;false&lt;/param&gt;
&lt;/module&gt;
	</pre></p>
	<p>7行目に有効・無効の設定値enabledがあるので有効にするために値をtrueに変更します。<br />
	動かなくなった原因はコアプラグインを無効化したことだろうけど、どれが原因かわからなかったので取り敢えず全ての設定をtrueに修正しました。</p>
	<p>そしてNetBeans IDEを再起動！<br />
	みごとメニューも表示され問題なく動作もするのですがまだ右下に警告が。<br />
	<a href="http://show-web.jp/wp/wp-content/uploads/2012/02/netbeans-05.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/netbeans-05-584x411.png" alt="" title="netbeans-05" width="584" height="411" class="alignnone size-medium wp-image-316" /></a><br />
	キャッシュがどーとか、ロックが掛かってるとか・・・よくわかりません。<br />
	でも &#8220;C:\Users\（ユーザ名）\.netbeans\7.1\var\cache\&#8221; あたりが原因かな、ということでchcheフォルダをバックアップを取った後削除。<br />
	再度再起動。<br />
	ようやくエラーも表示されず見慣れた画面が表示されました。</p>
	<p>というわけで、設定はあまり弄り過ぎないようにという教訓でした。</p>
</section>]]></content:encoded>
			<wfw:commentRss>http://show-web.jp/2012/02/13/netbeans-ide-7-1%E3%81%A7%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%82%92%E7%84%A1%E5%8A%B9%E5%8C%96%E3%81%97%E3%81%9F%E3%82%89%E5%8B%95%E3%81%8B%E3%81%AA%E3%81%8F%E3%81%AA%E3%81%A3%E3%81%9F/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>「第2回WordPressお茶会 WordBench香川」を開催しました</title>
		<link>http://show-web.jp/2012/02/12/%E3%80%8C%E7%AC%AC2%E5%9B%9Ewordpress%E3%81%8A%E8%8C%B6%E4%BC%9A-wordbench%E9%A6%99%E5%B7%9D%E3%80%8D%E3%82%92%E9%96%8B%E5%82%AC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F/</link>
		<comments>http://show-web.jp/2012/02/12/%E3%80%8C%E7%AC%AC2%E5%9B%9Ewordpress%E3%81%8A%E8%8C%B6%E4%BC%9A-wordbench%E9%A6%99%E5%B7%9D%E3%80%8D%E3%82%92%E9%96%8B%E5%82%AC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 02:49:10 +0000</pubDate>
		<dc:creator>Sho Doi</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[イベント・勉強会]]></category>
		<category><![CDATA[WordBench]]></category>
		<category><![CDATA[香川]]></category>

		<guid isPermaLink="false">http://show-web.jp/?p=304</guid>
		<description><![CDATA[2012/02/11（土）[13:00～17:30]にデザインラボラトリー蒼様をお借りして「第2回WordPressお茶会 WordBench香川」を開催しました。 前回ご参加、新規ご参加合わせて8名+主催者土井の9名で &#8230; <a href="http://show-web.jp/2012/02/12/%E3%80%8C%E7%AC%AC2%E5%9B%9Ewordpress%E3%81%8A%E8%8C%B6%E4%BC%9A-wordbench%E9%A6%99%E5%B7%9D%E3%80%8D%E3%82%92%E9%96%8B%E5%82%AC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>2012/02/11（土）[13:00～17:30]に<a href="http://www.ao-labo.info/" title="デザインラボラトリー蒼" target="_blank">デザインラボラトリー蒼</a>様をお借りして「第2回WordPressお茶会 WordBench香川」を開催しました。</p>
<p>前回ご参加、新規ご参加合わせて8名+主催者土井の9名での開催となりました。</p>
<p>今回は私が忙しかったこともあり何も準備出来なかったのでノーテーマで雑談+<a href="https://twitter.com/#!/dr_cova" target="_blank">@dr_cova</a>さんによる「WordPressのセキュリティ対策について」「スマホでWordPress管理」のLTという内容に。</p>
<p class="alignright"><img src="http://show-web.jp/wp/wp-content/uploads/2012/02/wbkagawa-120211-01.jpg" alt="" title="wbkagawa-120211-01" width="160" height="240" class="size-full wp-image-307" /><br /><small>photo by: <a href="http://www.style-design.jp" target="_blank">style-design</a></small></p>
<p>雑談は特にネタも用意せずだったのですが、さすがにWebな人が集まっているだけあっていろいろ伺うことができました。<br />
途中から島に分かれてだったので分かる範囲になりますが、ユーザビリティや各種CMS、WordPress FAQ、LESS・SCSS（Sass）、うどん、イベント運営、お金の話、等々。<br />
WordBench香川独特のだらだらな流れのせいか@dr_covaさんのLTも片方の島でいつの間にか？というわけできちんと聞けずでした。また別の機会に拝聴する機会があれば。<br />
WordPressサイト構築に関する濃ゆい話もしてたようなのでそれに関してもちょっと聞きたかったです。</p>
<p>今後のWordBench香川の流れについて参加者さんに意見を頂戴したところ、前回・今回みたいなだらだらーな流れで（が？）良いというご意見だったので今後も特に「勉強会」みたいなのではなく、ノーテーマで集まって雑談しましょうみたいになると思います。何かネタがあったらLTでちょこっと話してもいいですし。<br />
というわけで「WordPress勉強会」を求めている方はきちんとされてる他Benchへのご参加をお勧めします。</p>
<p>いつもながら長時間の集まりになってしまいましたが参加者の皆さんありがとうございました。次回もよろしくお願いします。<br />
また、前回に続き場所を提供頂きましたデザインラボラトリー蒼様ありがとうございました。</p>
<p>次回「第3回WordPressお茶会 WordBench香川」は4月予定。<br />
今回の感じだともう少し人入れそうなので次回は13人くらいで開催したいですね。</p>
<p>あと、特に内緒じゃないですけどあれなイベントも是非やりましょう！！</p>
<p>* * *</p>
<p><small>WordBench香川に関してご意見・ご要望等ありましたら<a href="http://twitter.com/#!/show_web" target="_blank">@show_web</a>までお願いします。</small></p>]]></content:encoded>
			<wfw:commentRss>http://show-web.jp/2012/02/12/%E3%80%8C%E7%AC%AC2%E5%9B%9Ewordpress%E3%81%8A%E8%8C%B6%E4%BC%9A-wordbench%E9%A6%99%E5%B7%9D%E3%80%8D%E3%82%92%E9%96%8B%E5%82%AC%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mac OS X Lion環境NetBeans IDEにプログラミング用フォントRicty導入</title>
		<link>http://show-web.jp/2012/01/31/mac-os-x-lion%E7%92%B0%E5%A2%83netbeans-ide%E3%81%AB%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E7%94%A8%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88ricty%E5%B0%8E%E5%85%A5/</link>
		<comments>http://show-web.jp/2012/01/31/mac-os-x-lion%E7%92%B0%E5%A2%83netbeans-ide%E3%81%AB%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E7%94%A8%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88ricty%E5%B0%8E%E5%85%A5/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 00:52:09 +0000</pubDate>
		<dc:creator>Sho Doi</dc:creator>
				<category><![CDATA[Webサービス]]></category>
		<category><![CDATA[Font]]></category>
		<category><![CDATA[FontForge]]></category>
		<category><![CDATA[Homebrew]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[Ricty]]></category>

		<guid isPermaLink="false">http://show-web.jp/?p=293</guid>
		<description><![CDATA[フォントにそこまでこだわりがある訳ではないですがNetBeans IDEのデフォルトの日本語はかなり見難いと感じていたところ、以下ツイートを見てRictyフォントなるものを導入してみようと思ったけど結構苦労したのでそのメ &#8230; <a href="http://show-web.jp/2012/01/31/mac-os-x-lion%E7%92%B0%E5%A2%83netbeans-ide%E3%81%AB%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E7%94%A8%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88ricty%E5%B0%8E%E5%85%A5/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>フォントにそこまでこだわりがある訳ではないですがNetBeans IDEのデフォルトの日本語はかなり見難いと感じていたところ、以下ツイートを見てRictyフォントなるものを導入してみようと思ったけど結構苦労したのでそのメモ。</p>
<!-- tweet id : 158491398436429824 --><style type='text/css'>#bbpBox_158491398436429824 a { text-decoration:none; color:#9D582E; }#bbpBox_158491398436429824 a:hover { text-decoration:underline; }</style><div id='bbpBox_158491398436429824' class='bbpBox' style='padding:20px; margin:5px 0; background-color:#8B542B; background-image:url(http://a1.twimg.com/profile_background_images/119584891/venezia.jpg); background-repeat:no-repeat'><div style='background:#fff; padding:10px; margin:0; min-height:48px; color:#333333; -moz-border-radius:5px; -webkit-border-radius:5px;'><span style='width:100%; font-size:18px; line-height:22px;'>MBA+NetBeans&#12391;&#20351;&#12387;&#12390;&#12414;&#12377;&#12364;&#32080;&#27083;&#35211;&#12420;&#12377;&#12356;&#12391;&#12377;&#12290; RT @<a href="http://twitter.com/intent/user?screen_name=seltzer" class="twitter-action">seltzer</a>: Linux&#21521;&#12369;&#12289;&#38283;&#30330;&#29992;&#12501;&#12522;&#12540;&#12501;&#12457;&#12531;&#12488;&#12391;&#12377;&#12387;&#12390;&#65310;&#12503;&#12525;&#12464;&#12521;&#12511;&#12531;&#12464;&#29992;&#12501;&#12457;&#12531;&#12488; Ricty <a href="http://t.co/RFMbloSz" rel="nofollow">http://t.co/RFMbloSz</a></span><div class='bbp-actions' style='font-size:12px; width:100%; padding:5px 0; margin:0 0 10px 0; border-bottom:1px solid #e6e6e6;'><img align='middle' src='http://show-web.jp/wp/wp-content/plugins/twitter-blackbird-pie//images/bird.png' /><a title='tweeted on 2012年1月15日 19:11' href='http://twitter.com/#!/Stocker_jp/status/158491398436429824' target='_blank'>2012年1月15日 19:11</a> via <a href="http://www.echofon.com/" rel="nofollow" target="blank">Echofon</a><a href='https://twitter.com/intent/tweet?in_reply_to=158491398436429824' class='bbp-action bbp-reply-action' title='Reply'><span><em style='margin-left: 1em;'></em><strong>Reply</strong></span></a><a href='https://twitter.com/intent/retweet?tweet_id=158491398436429824' class='bbp-action bbp-retweet-action' title='Retweet'><span><em style='margin-left: 1em;'></em><strong>Retweet</strong></span></a><a href='https://twitter.com/intent/favorite?tweet_id=158491398436429824' class='bbp-action bbp-favorite-action' title='Favorite'><span><em style='margin-left: 1em;'></em><strong>Favorite</strong></span></a></div><div style='float:left; padding:0; margin:0'><a href='http://twitter.com/intent/user?screen_name=Stocker_jp'><img style='width:48px; height:48px; padding-right:7px; border:none; background:none; margin:0' src='http://a1.twimg.com/profile_images/1413746973/_______4_normal.jpeg' /></a></div><div style='float:left; padding:0; margin:0'><a style='font-weight:bold' href='http://twitter.com/intent/user?screen_name=Stocker_jp'>@Stocker_jp</a><div style='margin:0; padding-top:2px'>&#12394;&#12388;&#12365;</div></div><div style='clear:both'></div></div></div><!-- end of tweet -->
<section>
	<h1>INDEX</h1>
	<ol>
		<li><a href="#ricty-environment">環境</a></li>
		<li><a href="#ricty-introduction">前置き</a></li>
		<li><a href="#ricty-homebrew-install">Homebrewインストール</a></li>
		<li><a href="#ricty-fontforge-install">FontForgeインストール</a>
			<ol style="list-style: decimal;">
				<li><a href="#ricty-fontforge-install01">FontForgeインストールでエラーその1</a></li>
				<li><a href="#ricty-fontforge-install02">FontForgeインストールでエラーその2</a></li>
				<li><a href="#ricty-fontforge-install03">FontForgeインストール成功</a></li>
			</ol>
		</li>
		<li><a href="#ricty-generate">Rictyの生成</a></li>
		<li><a href="#netbeans-setting">NetBeans IDE の設定</a></li>
	</ol>
</section>
<section id="ricty-environment">
	<h1>環境</h1>
	<ul>
		<li>Mac OS X Lion 10.7.2</li>
		<li>Xcode 4.2.1</li>
		<li>NetBeans IDE 7.1</li>
		<li>ターミナル用エディタ nano</li>
	</ul>
</section>
<section id="ricty-introduction">
	<h1>前置き</h1>
	<p>まず、公式の<a href="http://save.sys.t.u-tokyo.ac.jp/~yusa/fonts/ricty.html" title="プログラミング用フォント Ricty" target="_blank">プログラミング用フォント Ricty</a>を見てみると、これまではTrueTypeフォントで配布してたがライセンスの問題から万全を期すために最新版は生成スクリプトのみの配布、そして、生成方法としてFontForgeが必要とのこと。<br />
	FontForgeというのはフォントの作成や編集ができるアプリケーションらしい、というわけでFontForgeのインストール方法を調べてみることに。</p>
</section>
<section id="homebrew-install">
	<h1>Homebrewインストール</h1>
	<p>Google先生に尋ねてみて最初にヒットしたサイトがこちら。<br />
	<a href="http://blog.nyarla.net/2011/10/28/1" title="Cocoa Emacs on OSX LionでRictyフォントを使ってみた！ - 空繰再繰" target="_blank">Cocoa Emacs on OSX LionでRictyフォントを使ってみた！ &#8211; 空繰再繰</a></p>
	<p>参考サイトを見てみるとFontForgeをインストールするにはHomebrewというパッケージマネジメントツールが必要とのこと。</p>
	<p>早速<a href="http://mxcl.github.com/homebrew/" title="Homebrew" target="_blank">Homebrew</a>へ行くと中ほどに&#8221;Install Homebrew Today!&#8221;とあったのでクリック。</p>
	<div id="attachment_294" class="wp-caption alignnone" style="width: 594px"><a href="http://show-web.jp/wp/wp-content/uploads/2012/01/ricty-01.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/01/ricty-01-584x502.png" alt="Homebrew" title="ricty-01" width="584" height="502" class="size-medium wp-image-294" /></a><p class="wp-caption-text">Install Homebrew Today!をクリック</p></div>
	<p><a href="https://github.com/mxcl/homebrew/wiki/installation" target="_blank">githubのHomebrewインストール解説ページ</a>に飛ばされたので解説にある通りターミナルコマンドで以下を入力。</p>
<p><pre class="brush: plain; title: ; notranslate">$ /usr/bin/ruby -e &quot;$(curl -fsSL https://raw.github.com/gist/323731)&quot;</pre></p>
	<p>暫し後インストール完了。<br />
	/usr/local/ にHomebrew含むファイル一式が追加されており試しにバージョン確認してみるときちんと表示されました。</p>
<p><pre class="brush: plain; title: ; notranslate">$ brew -v
0.8.1</pre></p>
</section>
<section id="ricty-fontforge-install">
	<h1>FontForgeインストール</h1>
	<section id="fontforge-install01">
		<h1>FontForgeインストールでエラーその1</h1>
		<p>参考サイトに習ってターミナルよりFontForgeをインストール</p>
		<p><pre class="brush: plain; title: ; notranslate">$ sudo brew install fontforge --use-gcc --without-python</pre></p>
		<p>すると以下のようなエラーが</p>
		<p><pre class="brush: plain; title: ; notranslate">sudo: brew: command not found</pre></p>
		<p>sudo無しで実行すると通ったので /usr/local/ の権限がrootになっていないのが問題のよう。</p>
		<p><pre class="brush: plain; title: ; notranslate">$ sudo chown -R root /usr/local</pre></p>
		<p>で /usr/local/ の権限をrootに変更。<br />
		再度fontforgeインストールしようとすると問題なく brew は実行、しかし別のエラーが。</p>
	</section>
	<section id="ricty-fontforge-install02">
		<h1>FontForgeインストールでエラーその2</h1>
		<p><pre class="brush: plain; title: ; notranslate">Error: GCC could not be found</pre></p>
		<p>上記エラーが発生。GCCなるものが無いとのこと。<br />
		GCCについて調べてみるとフリーのコンパイラでXcodeインストール時に同時にインストールされるらしい。Xcodeはつい最近インストールしたためGCCもインストールされているはず。<br />
		念のため /Applications/Install Xcode から再度インストール。</p>
		<p>エラー・・・</p>
		<p>入っているはずのものが認識されないのでパスが通っていないのかな、ということでMacでパスを通す方法を調べてみることに。<br />
		どうやらホームディレクトリ（/users/ユーザ名/）に不可視ファイルで.bash_profileや.bashrcがあるとのこと。（デフォルトはないみたい）<br />
		というわけでホームディレクリに移動してファイルがあるか確認。</p>
		<p><pre class="brush: plain; title: ; notranslate">
$ cd /users/ユーザ名
$ ls -a
</pre></p>
	<p>ファイルが見つからなかったので新規に作って /usr/local へのパスを追加する事に。</p>
	<p><pre class="brush: plain; title: ; notranslate">$ nano .bashrc</pre></p>
	<p>で.bashrcファイルを作成して以下を記述。</p>
	<p><pre class="brush: plain; title: ; notranslate">export PATH=$PATH:/usr/local</pre></p>
	<p>反映させるためにsourceコマンドを。</p>
	<p><pre class="brush: plain; title: ; notranslate">source ~/.bashrc</pre></p>
	<p>パスも通っただろうし再度FontForgeインストール実行。</p>
	<p><pre class="brush: plain; title: ; notranslate">$ sudo brew install fontforge --use-gcc --without-python</pre></p>
	<p>エラー・・・<br />
	という訳で再びGoogle先生に聞いてみる事に。</p>
	</section>
	<section id="ricty-fontforge-install03">
		<h1>FontForgeインストール成功</h1>
		<p>いろいろ調べてたどり着いたのがこちら。<br />
		<a href="http://blog.hifumi.info/mac/mac-%E3%83%87-homebrew-%E3%83%8E%E3%82%B9%E3%82%B9%E3%83%A1/" title="Mac デ Homebrew ノススメ | CaCi - Takahiro's Kitchen" target="_blank">Mac デ Homebrew ノススメ | CaCi &#8211; Takahiro&#8217;s Kitchen</a><br />
		Xcode4.2+GCCは問題あり、という内容でたどり着いたのですが、HomevrewインストールからFontForgeインストールまでこちらのサイトで事足りる、という程参考になりました。</p>
		<p>まずはパスの設定から。</p>
		<blockquote>
			<p>Homebrewで入れたパッケージを優先的に使うためには/usr/binより/usr/local/binがPATHの前になければなりません。</p></blockquote>
		<p>というわけで、先ほどの.bashrcファイルを編集します。</p>
		<p><pre class="brush: plain; title: ; notranslate">$ nano .bashrc</pre></p>
		<p><pre class="brush: plain; title: ; notranslate">PATH=/usr/local/bin:/usr/local/share:$PATH
export PATH</pre></p>
		<p>続いてGitのインストールとHomebrewアップデート</p>
		<p><pre class="brush: plain; title: ; notranslate">$ sudo install git
$ brew update</pre></p>
		<p>そして問題のGCCは使えないので代替の方法を。（詳しくは参考サイトを）</p>
		<p><pre class="brush: plain; title: ; notranslate">$ sudo brew install --use-clang ffmpeg</pre></p>
		<p>ようやくFontForgeインストール！！</p>
		<p><pre class="brush: plain; title: ; notranslate">$ sudo brew install fontforge --use-clang</pre></p>
		<p>暫し後FontForgeインストール成功。<br />
		/usr/local/Celler/fontforge/ が追加されています。</p>
	</section>
</section>
<section id="ricty-generate">
	<h1>Rictyの生成</h1>
	<p><a href="http://save.sys.t.u-tokyo.ac.jp/~yusa/fonts/ricty.html" title="プログラミング用フォント Ricty" target="_blank">プログラミング用フォント Ricty</a>の「生成スクリプトの配布」より最新バージョンをダウンロード。（2012/01/31現在 version3.1.3）</p>
	<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/01/ricty-02.png" alt="" title="ricty-02" width="500" height="403" class="alignnone size-full wp-image-295" /></p>
	<p><a href="http://levien.com/type/myfonts/inconsolata.html" title="Inconsolata" target="_blank">Inconsolata 公式サイト</a>より OpenType fileをダウンロード。</p>
	<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/01/ricty-03.png" alt="" title="ricty-03" width="530" height="262" class="alignnone size-full wp-image-296" /></p>
	<p><a href="http://mix-mplus-ipa.sourceforge.jp/" title="M+ と IPA の合成フォント" target="_blank">M+ と IPA の合成フォント</a>のダウンロードより&#8221;Migu 1M&#8221;をダウンロード。</p>
	<p><img src="http://show-web.jp/wp/wp-content/uploads/2012/01/ritcy-04-584x160.png" alt="" title="ritcy-04" width="584" height="160" class="alignnone size-medium wp-image-297" /></p>
	<p>それぞれ解凍して1つのフォルダへ。（私はRitcyフォルダに入れました）</p>
	<p>ターミナルでフォルダに移動して以下コマンドで生成。</p>
	<p><pre class="brush: plain; title: ; notranslate">$ ./ricty_generator.sh auto</pre></p>
	<p><a href="http://show-web.jp/wp/wp-content/uploads/2012/01/ricty-05.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/01/ricty-05-584x359.png" alt="" title="ricty-05" width="584" height="359" class="alignnone size-medium wp-image-298" /></a><br />
	無事生成されたので、インストール。</p>
</section>
<section id="netbeans-setting">
	<h1>NetBeans IDE の設定</h1>
	<p>&#8220;NetBeans > 環境設定 > フォントと色&#8221;のフォントでRictyを選択。<br />
	<a href="http://show-web.jp/wp/wp-content/uploads/2012/01/ricty-06.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/01/ricty-06-584x545.png" alt="" title="ricty-06" width="584" height="545" class="alignnone size-medium wp-image-299" /></a></p>
	<p>NetBeans IDEのフォントをRictyに変更出来ました！！<br />
	<a href="http://show-web.jp/wp/wp-content/uploads/2012/01/ricty-07.png"><img src="http://show-web.jp/wp/wp-content/uploads/2012/01/ricty-07-584x491.png" alt="" title="ricty-07" width="584" height="491" class="alignnone size-medium wp-image-300" /></a></p>
</section>]]></content:encoded>
			<wfw:commentRss>http://show-web.jp/2012/01/31/mac-os-x-lion%E7%92%B0%E5%A2%83netbeans-ide%E3%81%AB%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E7%94%A8%E3%83%95%E3%82%A9%E3%83%B3%E3%83%88ricty%E5%B0%8E%E5%85%A5/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

