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

<channel>
	<title>WordPress &#8211; WordPress Memo</title>
	<atom:link href="https://blog.riverforest-wp.info/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.riverforest-wp.info</link>
	<description>WordPress に関する覚え書き</description>
	<lastBuildDate>Tue, 20 Jan 2026 00:27:45 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.riverforest-wp.info/wp-content/uploads/2018/05/cropped-icon-256x256-1-32x32.png</url>
	<title>WordPress &#8211; WordPress Memo</title>
	<link>https://blog.riverforest-wp.info</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>ブロックの日本語化に関する補足事項</title>
		<link>https://blog.riverforest-wp.info/block-internationalization/</link>
		
		<dc:creator><![CDATA[Katsushi Kawamori]]></dc:creator>
		<pubDate>Wed, 22 Nov 2023 07:13:30 +0000</pubDate>
				<category><![CDATA[Function]]></category>
		<category><![CDATA[block.json]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[ブロック]]></category>
		<category><![CDATA[国際化]]></category>
		<category><![CDATA[日本語化]]></category>
		<guid isPermaLink="false">https://blog.riverforest-wp.info/?p=3545</guid>

					<description><![CDATA[はじめに 現在、自作ブロックの日本語化を、「ブロックエディターハンドブック／開発ガイド／国際化」に準じて行っていますが、現在の、block.json でスクリプトをロードする方法には適していないので、ここに捕捉事項として [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">はじめに</h3>



<p>現在、自作ブロックの日本語化を、「ブロックエディターハンドブック／開発ガイド／国際化」に準じて行っていますが、現在の、block.json でスクリプトをロードする方法には適していないので、ここに捕捉事項として記す事にします。</p>



<style>
.simpleblogcard_img_block28f6a4b5d98ec09c6e262afca077d663 {
  float: right;
  padding: 10px;
}
.simpleblogcard_border28f6a4b5d98ec09c6e262afca077d663 {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_title28f6a4b5d98ec09c6e262afca077d663 {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_description28f6a4b5d98ec09c6e262afca077d663 {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://ja.wordpress.org/team/handbook/block-editor/how-to-guides/internationalization/>
				<figure class="simpleblogcard_img_block28f6a4b5d98ec09c6e262afca077d663">
			<img decoding="async" style="border-radius: 5px; width: 100px; height: 56px;" src="https://s.w.org/images/home/wordpress-default-ogimage.png" alt="国際化 – Japanese Team – WordPress.org 日本語" />
		</figure>
		<div class="simpleblogcard_inner">
		<div class="simpleblogcard_border28f6a4b5d98ec09c6e262afca077d663">
			ja.wordpress.org			<div class="simpleblogcard_title28f6a4b5d98ec09c6e262afca077d663">
				国際化 – Japanese Team – WordPress.org 日本語			</div>
							<div class="simpleblogcard_description28f6a4b5d98ec09c6e262afca077d663">
					国際化とは何か ? 国際化とはソフトウエア、特にここでは WordPress に対して複数言語のサポートを提供…				</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>



<h3 class="wp-block-heading">ハンドル名の指定</h3>



<p>上記でのハンドル名の指定方法は、以下の様になっています。この方法では、wp_register_script で、ハンドル名 <strong>myguten-script</strong> を指定し、register_block_type の、editor_script で、<strong>myguten-script </strong>を再度指定しています。</p>



<pre class="prism line-numbers"><code class="language-php language-html">&lt;?php
/**
 * Plugin Name: Simple Block
 * Text Domain: myguten
 */
function myguten_simple_block_init() {
    wp_register_script(
        'myguten-script',
        plugins_url( 'block.js', __FILE__ ),
        array( 'wp-blocks', 'wp-element', 'wp-i18n', 'wp-block-editor' )
    );
 
    register_block_type( 'myguten/simple-block', array(
        'api_version' =&gt; 2,
        'editor_script' =&gt; 'myguten-script',
    ) );
}
add_action( 'init', 'myguten_simple_block_init' );</code></pre>



<p>その後に、php で、<strong>wp_set_script_translations</strong> の第一引数に <strong>registrer_block_type</strong> で登録したハンドル名 <strong>myguten-script</strong> を指定する方式です。</p>



<style>
.simpleblogcard_img_block86e2a81a92fece383b34044e1a1031cc {
  float: right;
  padding: 10px;
}
.simpleblogcard_border86e2a81a92fece383b34044e1a1031cc {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_title86e2a81a92fece383b34044e1a1031cc {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_description86e2a81a92fece383b34044e1a1031cc {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://developer.wordpress.org/reference/functions/wp_set_script_translations/>
				<figure class="simpleblogcard_img_block86e2a81a92fece383b34044e1a1031cc">
			<img decoding="async" style="border-radius: 5px; width: 100px; height: 52px;" src="https://developer.wordpress.org/wp-content/themes/wporg-developer-2023/images/opengraph-image.png" alt="wp_set_script_translations() – Function | Developer.WordPress.org" />
		</figure>
		<div class="simpleblogcard_inner">
		<div class="simpleblogcard_border86e2a81a92fece383b34044e1a1031cc">
			developer.wordpress.org			<div class="simpleblogcard_title86e2a81a92fece383b34044e1a1031cc">
				wp_set_script_translations() – Function | Developer.WordPress.org			</div>
							<div class="simpleblogcard_description86e2a81a92fece383b34044e1a1031cc">
					Sets translated strings for a script.				</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>



<pre class="prism line-numbers"><code class="language-php language-html">&lt;?php
function myguten_set_script_translations() {
    wp_set_script_translations( 'myguten-script', 'myguten' );
}
add_action( 'init', 'myguten_set_script_translations' );</code></pre>



<p>上記のやり方を、現在の block.json で読み込む方式に置き換えると以下の様になります。</p>



<pre class="prism line-numbers"><code class="language-php language-html">&lt;?php
/**
 * Plugin Name: Simple Block
 * Text Domain: myguten
 */
function myguten_simple_block_init() {
	register_block_type(
		__DIR__ . '/block/build',
	);
}
add_action( 'init', 'myguten_simple_block_init' );</code></pre>



<p>block.json を置いたディレクトリを検索してそれを読み込むという形です。ここでは、ハンドル名は指定していません。block.json の方を見てみると、editorScript の項目がそれらしいのですが、スクリプトのハンドルという言葉はあるのですが、ファイルへのパスを指定するのが通常の様です。</p>



<style>
.simpleblogcard_img_block65c0ebb6b5d302e1a58572c8530f0ae3 {
  float: right;
  padding: 10px;
}
.simpleblogcard_border65c0ebb6b5d302e1a58572c8530f0ae3 {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_title65c0ebb6b5d302e1a58572c8530f0ae3 {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_description65c0ebb6b5d302e1a58572c8530f0ae3 {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/>
				<figure class="simpleblogcard_img_block65c0ebb6b5d302e1a58572c8530f0ae3">
			<img decoding="async" style="border-radius: 5px; width: 100px; height: 52px;" src="https://developer.wordpress.org/wp-content/themes/wporg-developer-2023/images/opengraph-image.png" alt="Metadata in block.json – Block Editor Handbook | Developer.WordPress.org" />
		</figure>
		<div class="simpleblogcard_inner">
		<div class="simpleblogcard_border65c0ebb6b5d302e1a58572c8530f0ae3">
			developer.wordpress.org			<div class="simpleblogcard_title65c0ebb6b5d302e1a58572c8530f0ae3">
				Metadata in block.json – Block Editor Handbook | Developer.WordPress.org			</div>
							<div class="simpleblogcard_description65c0ebb6b5d302e1a58572c8530f0ae3">
					Starting with the WordPress 5.8 release, we recommend using the block.json metadata file a&#8230;				</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>



<p><strong>register_block_type</strong> では、ハンドル名を渡さずに、WordPress の php の関数 <strong>generate_block_asset_handle</strong> で第１引数にブロック名、第２引数に editorScript を渡したらハンドル名を取得し国際化が上手くいきましたので、以下に示します。</p>



<pre class="prism line-numbers"><code class="language-php language-html">function myguten_set_script_translations() {
　　$script_handle = generate_block_asset_handle( 'myguten/simple-block', 'editorScript' );
　　wp_set_script_translations( $script_handle, 'myguten' );
}
add_action( 'init', 'myguten_set_script_translations' );</code></pre>



<style>
.simpleblogcard_img_block85f52ffa68111402f1bbe6723b0f9943 {
  float: right;
  padding: 10px;
}
.simpleblogcard_border85f52ffa68111402f1bbe6723b0f9943 {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_title85f52ffa68111402f1bbe6723b0f9943 {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_description85f52ffa68111402f1bbe6723b0f9943 {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://developer.wordpress.org/reference/functions/generate_block_asset_handle/>
				<figure class="simpleblogcard_img_block85f52ffa68111402f1bbe6723b0f9943">
			<img decoding="async" style="border-radius: 5px; width: 100px; height: 52px;" src="https://developer.wordpress.org/wp-content/themes/wporg-developer-2023/images/opengraph-image.png" alt="generate_block_asset_handle() – Function | Developer.WordPress.org" />
		</figure>
		<div class="simpleblogcard_inner">
		<div class="simpleblogcard_border85f52ffa68111402f1bbe6723b0f9943">
			developer.wordpress.org			<div class="simpleblogcard_title85f52ffa68111402f1bbe6723b0f9943">
				generate_block_asset_handle() – Function | Developer.WordPress.org			</div>
							<div class="simpleblogcard_description85f52ffa68111402f1bbe6723b0f9943">
					Generates the name for an asset based on the name of the block and the field name provided&#8230;				</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>



<h3 class="wp-block-heading">block.json の日本語化</h3>



<p>ついでにわかりにくい、block.json の日本語化について以下に記します。上記の、<strong>register_block_type</strong> に、配列で翻訳対象を列記します。keywords は複数あるので更なる配列にします。</p>



<pre class="prism line-numbers"><code class="language-php language-html">&lt;?php
/**
 * Plugin Name: Simple Block
 * Text Domain: myguten
 */
function myguten_simple_block_init() {
	register_block_type(
		__DIR__ . '/block/build',
		array(
			'title' =&gt; _x( 'Simple Block', 'block title', 'myguten' ),
			'description' =&gt; _x( 'Example static block scaffolded with Create Block tool.', 'block description', 'myguten' ),
			'keywords' =&gt; array(
				_x( 'simple', 'block keyword', 'myguten' ),
				_x( 'static', 'block keyword', 'myguten' ),
				_x( 'tool', 'block keyword', 'myguten' ),
			),
		)
	);
}
add_action( 'init', 'myguten_simple_block_init' );</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WordPress 6.4 からの Lightbox 追加を一括で行う</title>
		<link>https://blog.riverforest-wp.info/wp64-lightbox-wpcli/</link>
		
		<dc:creator><![CDATA[Katsushi Kawamori]]></dc:creator>
		<pubDate>Sat, 30 Sep 2023 01:48:38 +0000</pubDate>
				<category><![CDATA[Function]]></category>
		<category><![CDATA[Lightbox]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress 6.4]]></category>
		<category><![CDATA[wp-cli]]></category>
		<guid isPermaLink="false">https://blog.riverforest-wp.info/?p=3405</guid>

					<description><![CDATA[はじめに WordPress 6.4 から、Lightbox 機能が追加されます。投稿内の html のコメント部分を変更します。具体的には、wp:image の中に、lightbox&#8221;:{&#8220;en [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">はじめに</h3>



<p>WordPress 6.4 から、Lightbox 機能が追加されます。投稿内の html のコメント部分を変更します。具体的には、wp:image の中に、lightbox&#8221;:{&#8220;enabled&#8221;:true} を加える形式です。</p>



<figure class="wp-block-video aligncenter"><video height="778" style="aspect-ratio: 1458 / 778;" width="1458" controls src="https://blog.riverforest-wp.info/wp-content/uploads/20230930/wp-lightbox.mp4"></video></figure>



<p>以前からのサイトに適用させる場合は、html 内の wp:image にこれを追加すれば良いので、WP-CLI でサイト内の全投稿と全固定ページを一括で変更するものを作ってみました。</p>



<p>WP-CLI が必要です。</p>



<pre class="prism line-numbers"><code class="language-php language-html">/* 第１引数：on で、Lightbox を On。off で、Lightbox を Off */
wp box on
wp box off
/* 第２引数：投稿や画像のID を指定できる */
wp box off 9110 /* 投稿 ID 9110 のみ Off */
wp box on 9031 /* メディア ID 9031 のみ On */</code></pre>



<h3 class="wp-block-heading">コード</h3>



<style>
.simpleblogcard_img_block4631f23bd3735a054ed1c1e5bdc589f7 {
  float: right;
  padding: 10px;
}
.simpleblogcard_border4631f23bd3735a054ed1c1e5bdc589f7 {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_title4631f23bd3735a054ed1c1e5bdc589f7 {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_description4631f23bd3735a054ed1c1e5bdc589f7 {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://github.com/katsushi-kawamori/wp-cli-Lightbox-command-on-off/ target="_blank" rel="noopener">
				<figure class="simpleblogcard_img_block4631f23bd3735a054ed1c1e5bdc589f7">
			<img decoding="async" style="border-radius: 5px; width: 100px; height: 50px;" src="https://opengraph.githubassets.com/c439f0287ec596e32238ea05a8e294d3c51a058e4414b3bbc7456f128902cfda/katsushi-kawamori/wp-cli-Lightbox-command-on-off" alt="GitHub - katsushi-kawamori/wp-cli-Lightbox-command-on-off · GitHub" />
		</figure>
		<div class="simpleblogcard_inner">
		<div class="simpleblogcard_border4631f23bd3735a054ed1c1e5bdc589f7">
			github.com			<div class="simpleblogcard_title4631f23bd3735a054ed1c1e5bdc589f7">
				GitHub &#8211; katsushi-kawamori/wp-cli-Lightbox-command-on-off · GitHub			</div>
							<div class="simpleblogcard_description4631f23bd3735a054ed1c1e5bdc589f7">
					Contribute to katsushi-kawamori/wp-cli-Lightbox-command-on-off development by creating an &#8230;				</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>



<h3 class="wp-block-heading">使い方</h3>



<figure class="wp-block-video aligncenter"><video height="742" style="aspect-ratio: 1412 / 742;" width="1412" controls src="https://blog.riverforest-wp.info/wp-content/uploads/20230930/wp-lightbox-cli-2.mp4"></video></figure>
]]></content:encoded>
					
		
		<enclosure url="https://blog.riverforest-wp.info/wp-content/uploads/20230930/wp-lightbox.mp4" length="25853129" type="video/mp4" />
<enclosure url="https://blog.riverforest-wp.info/wp-content/uploads/20230930/wp-lightbox-cli-2.mp4" length="47912265" type="video/mp4" />

			</item>
		<item>
		<title>ブログの記事の日時を24時間毎にリライトして検索順位を上げる？アドオン</title>
		<link>https://blog.riverforest-wp.info/date-time-random-auto-update/</link>
		
		<dc:creator><![CDATA[Katsushi Kawamori]]></dc:creator>
		<pubDate>Wed, 16 Aug 2023 23:47:53 +0000</pubDate>
				<category><![CDATA[Plugin]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[日時変更]]></category>
		<category><![CDATA[検索順位]]></category>
		<category><![CDATA[自動日時更新]]></category>
		<guid isPermaLink="false">https://blog.riverforest-wp.info/?p=3376</guid>

					<description><![CDATA[はじめに 最近、X(Twitter)や、一部のブログなどで、私のプラグイン Bulk Datetime Change を利用して、１日置きくらいに、数個から数十個の記事の日時を現在の日時に変更して Google の検索順 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">はじめに</h3>



<p>最近、X(Twitter)や、一部のブログなどで、私のプラグイン <strong>Bulk Datetime Change</strong> を利用して、１日置きくらいに、数個から数十個の記事の日時を現在の日時に変更して Google の検索順位を上げる？という事が散見されます。実際、効果をうたっている方もいるようです。皆さん、手動で変更されているようですが、どうせなら自動の方が楽なのではと思い、現在発売中の<strong>アドオン</strong>にその機能を付加しました。</p>



<p>これは<strong>裏技</strong>的な検索順位アップ法です。本来は<strong>コンテンツの内容を充実させる事</strong>が一番だと思います！</p>



<p>本来、この様な目的で作ったプラグインでは無いのですが、ユーザーが増えてくると作者には思いもよらなかった使い方をする方が出てくるので面白いですね。</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<div class="pluginstatsview-card-wrap">
	<div>
		<img decoding="async" src="https://ps.w.org/bulk-datetime-change/assets/icon-256x256.png?rev=2431126" alt="Bulk Datetime Change のアイコン" class="pluginstatsview-card-icon" />
		<div class="pluginstatsview-after-icon">
			<div class="pluginstatsview-bold"><a href="https://wordpress.org/plugins/bulk-datetime-change/" class="pluginstatsview-astyle">Bulk Datetime Change</a></div>
			<div class="pluginstatsview-small">投稿の日時を一括変更します。</div>
			<div class="pluginstatsview-small">作者: <a href="https://profiles.wordpress.org/katsushi-kawamori/">Katsushi Kawamori</a></div>
			<div style="clear: both;"></div>
		</div>
	</div>
	<div style="clear: both;"></div>

	<div class="pluginstatsview-small">
		<span class="pluginstatsview-card-left"><a href="https://wordpress.org/plugins/bulk-datetime-change/#reviews" title="5.0(5点満点中)" class="pluginstatsview-astyle">	<span class="pluginstatsview-stars">
					<span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>
			</span>
	</a>(8)</span>
		<span class="pluginstatsview-card-right">最終更新: 2週間 前</span>
	</div>
	<div class="pluginstatsview-small">
		<span class="pluginstatsview-card-left">7,000以上サイトで有効化中</span>
		<span class="pluginstatsview-card-right">検証済み: 7.0</span>
	</div>
	<div class="pluginstatsview-small">
		<span class="pluginstatsview-card-left">ダウンロード: <a href="https://downloads.wordpress.org/plugin/bulk-datetime-change.1.18.zip" class="dashicons dashicons-download pluginstatsview-download"></a></span>
		<span class="pluginstatsview-card-right">リリース: 2020-12-03</span>
	</div>
	<div class="pluginstatsview-small pluginstatsview-card-center">
		2026-03-31 09:29 時点の統計	</div>
</div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<style>
.simpleblogcard_img_block867d54945b64b86d614536f707d7e36f {
  float: right;
  padding: 10px;
}
.simpleblogcard_border867d54945b64b86d614536f707d7e36f {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_title867d54945b64b86d614536f707d7e36f {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_description867d54945b64b86d614536f707d7e36f {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://shop-jp.riverforest-wp.info/bulk-datetime-change-add-on/>
				<figure class="simpleblogcard_img_block867d54945b64b86d614536f707d7e36f">
			<img decoding="async" style="border-radius: 5px; width: 100px; height: 52px;" src="https://shop-jp.riverforest-wp.info/wordpress/wp-content/uploads/2019/12/Logaster-1-facebook-sharedImage-1200px-300x158.png" alt="Bulk Datetime Change Add On - Riverforest Plugins ショップ" />
		</figure>
		<div class="simpleblogcard_inner">
		<div class="simpleblogcard_border867d54945b64b86d614536f707d7e36f">
			shop-jp.riverforest-wp.info			<div class="simpleblogcard_title867d54945b64b86d614536f707d7e36f">
				Bulk Datetime Change Add On &#8211; Riverforest Plugins ショップ			</div>
							<div class="simpleblogcard_description867d54945b64b86d614536f707d7e36f">
					== 概要 == このアドオンを追加すると「Bulk Datetime Change」に、カスタム投稿タイプの追加とメディアの Exif 時刻 の読み取り機能及び、ランダムないくつ&#8230;				</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>
</div>
</div>



<h3 class="wp-block-heading">仕様</h3>



<p>アドオンを有効化すると、画像の様なメニューが出ます。投稿タイプを選択し、更新数を変更し「変更を保存」を押します。次回実行の日時が出るので、その日時に自動変更を行います。変更を行った後に、２４時間後に再スケジュールします。スケジューリングを停止したい場合は、「更新数」を０にするか、アドオンを無効化してください。</p>



<ul class="wp-block-list">
<li>投稿は指定できません。自動でランダムに選択します。</li>



<li>投稿タイプは、カスタム投稿タイプも選択できます。</li>



<li>更新数は、0～20です。20以上は、Google に不信感をいだかせるかもしれないので制限しています。</li>



<li>更新内容は、プラグイン本体の「設定->変更」の項目（投稿日時と最終更新日時、投稿日時のみ、最終更新日時のみ）の選択したものとなります。</li>



<li>スケジューリングは、WP-Cron で行っています。疑似 Cron （指定した日時の直後から最初にサイトにアクセスがあった時に起動）なので、「次回実行」は正確な日時ではありません。このイベントは、WP-Cron 用のプラグインなどから見ることができ、実行する事もできます。プラグインは、<a href="https://ja.wordpress.org/plugins/wp-crontrol/" target="_blank" rel="noreferrer noopener">WP </a><a href="https://ja.wordpress.org/plugins/wp-crontrol/">Crontrol</a> が良いでしょう。このプラグインの、「ツール -&gt; Cron イベント」から、<strong>bdtc_cron</strong> を探し、「今すぐ実行」を押すと試すことができます。</li>
</ul>



<p></p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69cc6348f21e6&quot;}" data-wp-interactive="core/image" data-wp-key="69cc6348f21e6" class="wp-block-image aligncenter size-full wp-lightbox-container"><img fetchpriority="high" loading="eager" decoding="async" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" width="523" height="262" src="https://blog.riverforest-wp.info/wp-content/uploads/20230817/Screenshot-20230816.png" alt="" class="wp-image-3379" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20230817/Screenshot-20230816.png 523w, https://blog.riverforest-wp.info/wp-content/uploads/20230817/Screenshot-20230816-300x150.png 300w" sizes="(max-width: 523px) 100vw, 523px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="拡大する"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>コンテンツの複製を拒否するシンプルなコード</title>
		<link>https://blog.riverforest-wp.info/contents-no-copy/</link>
		
		<dc:creator><![CDATA[Katsushi Kawamori]]></dc:creator>
		<pubDate>Thu, 20 Apr 2023 04:47:57 +0000</pubDate>
				<category><![CDATA[Function]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[コンテンツコピー]]></category>
		<category><![CDATA[画像コピー]]></category>
		<guid isPermaLink="false">https://blog.riverforest-wp.info/?p=3197</guid>

					<description><![CDATA[はじめに コンテンツの盗用による被害が結構な頻度で見受けられます。それに対応する一番シンプルな方法を以下に記します。以下の方法は、ブラウザや Javascript に少しでも知見のある方なら破れますが、無いよりは良いので [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">はじめに</h3>



<p>コンテンツの盗用による被害が結構な頻度で見受けられます。それに対応する一番シンプルな方法を以下に記します。以下の方法は、ブラウザや Javascript に少しでも知見のある方なら破れますが、無いよりは良いのではないかと思います。</p>



<h3 class="wp-block-heading">コード</h3>



<pre class="prism line-numbers"><code class="language-php language-html">/* スクリプトを読み込みます */
add_action(
	'wp_enqueue_scripts',
	function() {
		/* 管理画面以外で */
		if ( ! is_admin() ) {
			?>
			&lt;script>
			/* ブラウザの右クリックを無効にします */
			 document.oncontextmenu = function () { return false; }
			&lt;/script>
			&lt;style>
			/* タブレットやスマートフォンの長押しを無効にします */
			.nocopy {
			 -webkit-touch-callout: none;
			 -webkit-user-select: none;
			 -khtml-user-select: none;
			 -moz-user-select: none;
			 -ms-user-select: none;
			 user-select: none;
			}
			&lt;/style>
			&lt;?php
		}
	},
	10,
	1
);
/* 上記の 'nocopy' クラスを、body タグに追加します */
add_filter( 'body_class',
	function() {
		/* 管理画面以外で */
		if ( ! is_admin() ) {
			return array( 'nocopy' );
		}
	},
	10,
	1
);</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>WordPress ローカルネットワークでの開発環境構築 ～ Ubuntu 20.04.1</title>
		<link>https://blog.riverforest-wp.info/wordpress-local-ubuntu/</link>
		
		<dc:creator><![CDATA[Katsushi Kawamori]]></dc:creator>
		<pubDate>Mon, 03 May 2021 23:57:37 +0000</pubDate>
				<category><![CDATA[開発環境]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[ローカルネットワーク]]></category>
		<guid isPermaLink="false">https://blog.riverforest-wp.info/?p=2668</guid>

					<description><![CDATA[次ページ：SSH 接続 &#62;&#62; 1構成及び初期設定 2SSH 接続 3Samba のインストールと設定 4LAMP のインストールと設定 5Apache2 を SSL 化 6プロキシサーバーのインストールと設定 [&#8230;]]]></description>
										<content:encoded><![CDATA[<div class="pagebreak-description-next-page-link"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/2/" class="post-page-numbers">次ページ：SSH 接続 &gt;&gt;</a></div><div class="pagebreak-description-pagination"> <span class="cp_tooltip_description"><span class="post-page-numbers current" aria-current="page">1</span><span class="cp_tooltip_description_text">構成及び初期設定</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/2/" class="post-page-numbers">2</a><span class="cp_tooltip_description_text">SSH 接続</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/3/" class="post-page-numbers">3</a><span class="cp_tooltip_description_text">Samba のインストールと設定</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/4/" class="post-page-numbers">4</a><span class="cp_tooltip_description_text">LAMP のインストールと設定</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/5/" class="post-page-numbers">5</a><span class="cp_tooltip_description_text">Apache2 を SSL 化</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/6/" class="post-page-numbers">6</a><span class="cp_tooltip_description_text">プロキシサーバーのインストールと設定</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/7/" class="post-page-numbers">7</a><span class="cp_tooltip_description_text">メールサーバーのインストールと設定</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/8/" class="post-page-numbers">8</a><span class="cp_tooltip_description_text">WordPress のインストール及びその他</span></span></p></div><div class="pagebreak-description-for-over">マウスオーバーか長押しで説明を表示。</div><div class="pagebreak-description-next-page-link"></div>
<h1 class="wp-block-heading">はじめに</h1>



<p>開発環境を再構築しました。備忘録として記します。</p>



<ul class="wp-block-list">
<li>ローカルネットワーク内での SSL アクセス
<ul class="wp-block-list">
<li>ショップサイトのテストの為</li>
</ul>
</li>



<li>ローカルネットワーク内でのメール送受信
<ul class="wp-block-list">
<li>作成したチュートリアル動画をボカシ無しで作成する為</li>
</ul>
</li>



<li>ローカルネットワーク内での GUI でのファイル操作
<ul class="wp-block-list">
<li>プラグイン開発時の省力化</li>
</ul>
</li>



<li>PHP のコマンドラインでの実行
<ul class="wp-block-list">
<li>プラグインのアドオンとしてコマンドラインスクリプトをいくつか作成しているが、その大規模なテストを行いたい為</li>
</ul>
</li>
</ul>



<p>仮想マシン（Virtual Box）や、コンテナ型仮想環境（Docker）でもできるかと思いますが、ストレージやメモリがかなり必要になるのと、以前、Docker で動作させたものが遅かったのもあり、手元に使用してないマシンがあったので、それを使用して構築しました。</p>



<p>※記事更新時の、2024年1月時点で、<strong>WSL2(Windows Subsystem for Linux)</strong> での環境も構築しました。この記事内の方法で、同様に構築できます。</p>



<ul class="wp-block-list">
<li><strong>WSL2</strong> での長所
<ul class="wp-block-list">
<li>１台で全てが済む。</li>



<li>インストール時に、IP アドレスが決まるので設定の必要無し。（各ホスト名は設定の必要あり。）</li>



<li>シェルが立ち上がるので、SSH 関連の設定の必要無し。</li>



<li>エクスプローラーから、ディスクが見えるので、Samba が必要無し。</li>
</ul>
</li>



<li><strong>WSL2</strong> での短所
<ul class="wp-block-list">
<li>現在のバージョンでは、外部端末からの接続が、port を開けるなどの面倒な手順が必要。</li>
</ul>
</li>
</ul>



<style>
.simpleblogcard_img_block6b5d09b948b975fc49f320ef25c66fc1 {
  float: right;
  padding: 10px;
}
.simpleblogcard_border6b5d09b948b975fc49f320ef25c66fc1 {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_title6b5d09b948b975fc49f320ef25c66fc1 {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_description6b5d09b948b975fc49f320ef25c66fc1 {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://learn.microsoft.com/ja-jp/windows/wsl/>
				<figure class="simpleblogcard_img_block6b5d09b948b975fc49f320ef25c66fc1">
			<img decoding="async" style="border-radius: 5px; width: 100px; height: 52px;" src="https://learn.microsoft.com/en-us/media/open-graph-image.png" alt="Windows Subsystem for Linux のドキュメント | Microsoft Learn" />
		</figure>
		<div class="simpleblogcard_inner">
		<div class="simpleblogcard_border6b5d09b948b975fc49f320ef25c66fc1">
			learn.microsoft.com			<div class="simpleblogcard_title6b5d09b948b975fc49f320ef25c66fc1">
				Windows Subsystem for Linux のドキュメント | Microsoft Learn			</div>
							<div class="simpleblogcard_description6b5d09b948b975fc49f320ef25c66fc1">
					Windows Subsystem for Linux のドキュメントの概要。				</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>



<h2 class="wp-block-heading">初期構成</h2>



<ul class="wp-block-list">
<li>Lenovo Yoga Book with Windows
<ul class="wp-block-list">
<li>CPU: Atom 1.44Ghz</li>



<li>メモリ: 4G</li>



<li>ストレージ: 64G</li>
</ul>
</li>
</ul>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69cc6348f3e02&quot;}" data-wp-interactive="core/image" data-wp-key="69cc6348f3e02" class="wp-block-image aligncenter size-large wp-lightbox-container"><img loading="lazy" decoding="async" width="1024" height="768" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://blog.riverforest-wp.info/wp-content/uploads/20210506/ubuntu-1024x768.jpg" alt="" class="wp-image-2725" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20210506/ubuntu-1024x768.jpg 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20210506/ubuntu-300x225.jpg 300w, https://blog.riverforest-wp.info/wp-content/uploads/20210506/ubuntu-768x576.jpg 768w, https://blog.riverforest-wp.info/wp-content/uploads/20210506/ubuntu-1536x1151.jpg 1536w, https://blog.riverforest-wp.info/wp-content/uploads/20210506/ubuntu-1920x1439.jpg 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="拡大する"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<p>現在、Micro USB からの給電のみで、全てメイン機から操作しています。Ubuntu Server で無いのは、Micro USB に繋げた USB ハブが認識されずにキーボードが使えなかったからですが、結果的に良かったです。Ubuntu では、本体のハロキーボード（独特のタッチタイプの光るキーボード）は使えませんが、タッチパネル（GUI の時）は使えます。</p>



<p>ちなみに、後ろに見えるメイン機は、Surface Pro 6 (Windows10)です。</p>



<h2 class="wp-block-heading">インストール</h2>



<p>インストールは、Micro USB にダイレクトに接続できる USB メモリが手元にあったので、そこからブートさせて行いました。電源ボタンと音量の＋ボタンを同時に押すと、Bios が立ち上がりそこで選択できます。</p>



<h2 class="wp-block-heading">現在の構成（実機）</h2>



<p>※記事更新時の、2024年1月時点では、<a href="https://www.intel.co.jp/content/www/jp/ja/products/sku/205033/intel-nuc-11-performance-kit-nuc11pahi3/specifications.html">Intel NUC11PAHI3 </a>を使用しています。サーバーは早い方が良いです！</p>



<ul class="wp-block-list">
<li>Intel NUC11PAHI3
<ul class="wp-block-list">
<li>CPU: Corei3-1115G4</li>



<li>メモリ: 8G</li>



<li>ストレージ: 256G</li>
</ul>
</li>
</ul>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69cc63490018c&quot;}" data-wp-interactive="core/image" data-wp-key="69cc63490018c" class="wp-block-image aligncenter size-large wp-lightbox-container"><img loading="lazy" decoding="async" width="1024" height="639" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://blog.riverforest-wp.info/wp-content/uploads/20210506/win11-ubuntu-riverforest-1024x639.jpg" alt="" class="wp-image-3345" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20210506/win11-ubuntu-riverforest-1024x639.jpg 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20210506/win11-ubuntu-riverforest-300x187.jpg 300w, https://blog.riverforest-wp.info/wp-content/uploads/20210506/win11-ubuntu-riverforest-768x480.jpg 768w, https://blog.riverforest-wp.info/wp-content/uploads/20210506/win11-ubuntu-riverforest-1536x959.jpg 1536w, https://blog.riverforest-wp.info/wp-content/uploads/20210506/win11-ubuntu-riverforest-2048x1279.jpg 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="拡大する"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<h2 class="wp-block-heading">現在の構成（WSL2）</h2>



<p>※記事更新時の、2024年1月時点では、<a href="https://support.microsoft.com/ja-jp/surface/surface-pro-6-%E3%81%A4%E3%81%AE%E4%BB%95%E6%A7%98%E3%81%A8%E6%A9%9F%E8%83%BD-ade5cfc2-e99a-6fd1-abbe-c0e8a8a3942d">Surface Pro 6</a> を使用しています。必要十分の動作速度・安定感です。</p>



<ul class="wp-block-list">
<li>CPU: Core i5-8250U</li>



<li>メモリ: 8G</li>



<li>ストレージ: 256G </li>
</ul>



<h2 class="wp-block-heading">ホストを決める</h2>



<p>IP アドレスを 192.168.179.2 に固定しました。</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69cc634900820&quot;}" data-wp-interactive="core/image" data-wp-key="69cc634900820" class="wp-block-image aligncenter size-large wp-lightbox-container"><img loading="lazy" decoding="async" width="1024" height="832" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://blog.riverforest-wp.info/wp-content/uploads/20210506/ubuntu_settings_ip-1024x832.jpg" alt="" class="wp-image-2727" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20210506/ubuntu_settings_ip-1024x832.jpg 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20210506/ubuntu_settings_ip-300x244.jpg 300w, https://blog.riverforest-wp.info/wp-content/uploads/20210506/ubuntu_settings_ip-768x624.jpg 768w, https://blog.riverforest-wp.info/wp-content/uploads/20210506/ubuntu_settings_ip-1536x1247.jpg 1536w, https://blog.riverforest-wp.info/wp-content/uploads/20210506/ubuntu_settings_ip-1920x1559.jpg 1920w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="拡大する"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<p>そのアドレスに対応するホストを以下の様に決めました。</p>



<pre class="prism line-numbers"><code class="language-php language-html">192.168.179.2	riverforest.test /* メイン */
192.168.179.2	shop.riverforest.test /* 英語専用のショップサイト */
192.168.179.2	shop-jp.riverforest.test /* 日本語専用のショップサイト */
192.168.179.2	mail.riverforest.test /* メールサーバー */
192.168.179.2	compe.riverforest.test /* 競技会採点システムのサイト */
192.168.179.2	bdc.riverforest.test /* ボールルームダンス競技会採点システムのサイト */</code></pre>



<p>名前解決の為に、上記を以下に追記しました。</p>



<ul class="wp-block-list">
<li>Ubuntu: /etc/hosts</li>



<li>Windows10: C:\Windows\System32\drivers\etc\hosts</li>
</ul>



<p>Ubuntu 側は、次の SSH 接続が出来てから編集しました。</p>


<div class="pagebreak-description-next-page-link"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/2/" class="post-page-numbers">次ページ：SSH 接続 &gt;&gt;</a></div><div class="pagebreak-description-pagination"> <span class="cp_tooltip_description"><span class="post-page-numbers current" aria-current="page">1</span><span class="cp_tooltip_description_text">構成及び初期設定</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/2/" class="post-page-numbers">2</a><span class="cp_tooltip_description_text">SSH 接続</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/3/" class="post-page-numbers">3</a><span class="cp_tooltip_description_text">Samba のインストールと設定</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/4/" class="post-page-numbers">4</a><span class="cp_tooltip_description_text">LAMP のインストールと設定</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/5/" class="post-page-numbers">5</a><span class="cp_tooltip_description_text">Apache2 を SSL 化</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/6/" class="post-page-numbers">6</a><span class="cp_tooltip_description_text">プロキシサーバーのインストールと設定</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/7/" class="post-page-numbers">7</a><span class="cp_tooltip_description_text">メールサーバーのインストールと設定</span></span> <span class="cp_tooltip_description"><a href="https://blog.riverforest-wp.info/wordpress-local-ubuntu/8/" class="post-page-numbers">8</a><span class="cp_tooltip_description_text">WordPress のインストール及びその他</span></span></p></div><div class="pagebreak-description-for-over">マウスオーバーか長押しで説明を表示。</div><div class="pagebreak-description-next-page-link"></div>]]></content:encoded>
					
		
		<enclosure url="https://blog.riverforest-wp.info/wp-content/uploads/20210506/ssh_login.mp4" length="556417" type="video/mp4" />

			</item>
		<item>
		<title>RaspbianにImagickをインストールする</title>
		<link>https://blog.riverforest-wp.info/raspbian-imagick/</link>
		
		<dc:creator><![CDATA[Katsushi Kawamori]]></dc:creator>
		<pubDate>Wed, 23 May 2018 01:08:09 +0000</pubDate>
				<category><![CDATA[raspbian]]></category>
		<category><![CDATA[imagick]]></category>
		<category><![CDATA[PECL]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[メディアライブラリ]]></category>
		<guid isPermaLink="false">https://blog.riverforest-wp.info/?p=169</guid>

					<description><![CDATA[はじめに WordPress のプラグイン開発環境で Raspberry Pi 3 Model B を使用しています。昨日、Raspbian を Jessie から Strech に変更（クリーンインストール）しました。 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">はじめに</h2>



<p>WordPress のプラグイン開発環境で Raspberry Pi 3 Model B を使用しています。昨日、Raspbian を Jessie から Strech に変更（クリーンインストール）しました。その際、Jessie の時に Imagick のインストールで苦労したのを思い出したので記述しておきます。今回は以下の方法で楽にインストールできました。</p>



<h2 class="wp-block-heading">なぜImagickをインストール？</h2>



<p>2ヶ月半前、私のプラグインのサポートフォーラムに以下の投稿がありました。</p>



<style>
.simpleblogcard_img_blockfe3bfe5a9cbd6ece9aced4c772fa9f83 {
  float: right;
  padding: 10px;
}
.simpleblogcard_borderfe3bfe5a9cbd6ece9aced4c772fa9f83 {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_titlefe3bfe5a9cbd6ece9aced4c772fa9f83 {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_descriptionfe3bfe5a9cbd6ece9aced4c772fa9f83 {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://wordpress.org/support/topic/pdf-thumbnail-not-moved/>
				<figure class="simpleblogcard_img_blockfe3bfe5a9cbd6ece9aced4c772fa9f83">
			<img decoding="async" style="border-radius: 5px; width: 100px; height: 56px;" src="https://s.w.org/images/home/wordpress-default-ogimage.png" alt="PDF thumbnail not moved | WordPress.org" />
		</figure>
		<div class="simpleblogcard_inner">
		<div class="simpleblogcard_borderfe3bfe5a9cbd6ece9aced4c772fa9f83">
			wordpress.org			<div class="simpleblogcard_titlefe3bfe5a9cbd6ece9aced4c772fa9f83">
				PDF thumbnail not moved | WordPress.org			</div>
							<div class="simpleblogcard_descriptionfe3bfe5a9cbd6ece9aced4c772fa9f83">
					PDF thumbnail not moved Resolved eldb (@przemyslaw-napierala) 8 years ago WP create “.jpg”&#8230;				</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>



<p>メディアライブラリの新規追加時に、PDF ファイルがサムネイルを作成するのを、WordPress 4.7 からサポートしたのですが、それには Imagick が必要になります。現在、借りているレンタルサーバー VALUR SERVER では、Imagick をサポートせず、自分の開発環境 Raspbian にも入れていなかったので、テスト時に気づきませんでした。そのため、インストールする事にしました。</p>



<h2 class="wp-block-heading">インストール</h2>



<p>ImageMagick のインストール
</p>



<p><code class="language-php language-html">sudo apt-get install libmagickwand-dev<br>
sudo apt-get -y install imagemagick</code></p>



<p>PEAR のインストール</p>



<p>php のディレクトリーにおいて<br>
<code class="language-php language-html">cd /usr/bin</code><br>
<code class="language-php language-html">sudo wget http://pear.php.net/go-pear.phar</code><br>
<code class="language-php language-html">sudo php go-pear.phar</code></p>



<p>php.ini に以下を追加<br>
<code class="language-php language-html">include_path=".:/usr/PEAR"</code></p>



<p>pecl スクリプトの編集
</p>



<p><code class="language-php language-html">sudo nano `which pecl`</code></p>



<p>最下行を編集（ <code class="language-php language-html">-n</code> を 削除するだけです）</p>



<p>修正前　<code class="language-php language-html">exec $PHP -C -n -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv="On" $INCDIR/peclcmd.php "$@"</code></p>



<p>修正後　<code class="language-php language-html">exec $PHP -C -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv="On" $INCDIR/peclcmd.php "$@"</code></p>



<p>Imagickのインストール
</p>



<p><code class="language-php language-html">sudo pecl install imagick</code></p>



<p>php.ini に以下を追加<br>
<code class="language-php language-html">extension=imagick.so</code></p>



<h2 class="wp-block-heading">インストールの確認</h2>



<p>phpinfo の画面です。</p>



<figure class="wp-block-image aligncenter"><img loading="lazy" decoding="async" width="1024" height="566" src="https://blog.riverforest-wp.info/wp-content/uploads/20180523/phpinfo-1024x566.png" alt="" class="wp-image-172"/></figure>



<h2 class="wp-block-heading">Imagick有無の違い</h2>



<ul class="wp-block-list">
<li><strong>Imagick 無し</strong></li>
</ul>



<figure class="wp-block-image aligncenter"><img loading="lazy" decoding="async" width="1024" height="482" src="https://blog.riverforest-wp.info/wp-content/uploads/20180523/uploadnonsupport-1024x482.png" alt="" class="wp-image-175" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20180523/uploadnonsupport-1024x482.png 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20180523/uploadnonsupport-300x141.png 300w, https://blog.riverforest-wp.info/wp-content/uploads/20180523/uploadnonsupport-768x362.png 768w, https://blog.riverforest-wp.info/wp-content/uploads/20180523/uploadnonsupport.png 1098w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image aligncenter"><img loading="lazy" decoding="async" width="412" height="272" src="https://blog.riverforest-wp.info/wp-content/uploads/20180523/medianonsupport.png" alt="" class="wp-image-177" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20180523/medianonsupport.png 412w, https://blog.riverforest-wp.info/wp-content/uploads/20180523/medianonsupport-300x198.png 300w" sizes="auto, (max-width: 412px) 100vw, 412px" /></figure>



<ul class="wp-block-list">
<li><strong>Imagick 有</strong></li>
</ul>



<figure class="wp-block-image aligncenter"><img loading="lazy" decoding="async" width="1024" height="502" src="https://blog.riverforest-wp.info/wp-content/uploads/20180523/uploadsupport-1024x502.png" alt="" class="wp-image-176" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20180523/uploadsupport-1024x502.png 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20180523/uploadsupport-300x147.png 300w, https://blog.riverforest-wp.info/wp-content/uploads/20180523/uploadsupport-768x377.png 768w, https://blog.riverforest-wp.info/wp-content/uploads/20180523/uploadsupport.png 1105w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image aligncenter"><img loading="lazy" decoding="async" width="407" height="306" src="https://blog.riverforest-wp.info/wp-content/uploads/20180523/mediasupport.png" alt="" class="wp-image-174" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20180523/mediasupport.png 407w, https://blog.riverforest-wp.info/wp-content/uploads/20180523/mediasupport-300x226.png 300w" sizes="auto, (max-width: 407px) 100vw, 407px" /></figure>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
