<?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>高パフォーマンス注文ストレージ &#8211; WordPress Memo</title>
	<atom:link href="https://blog.riverforest-wp.info/tag/%E9%AB%98%E3%83%91%E3%83%95%E3%82%A9%E3%83%BC%E3%83%9E%E3%83%B3%E3%82%B9%E6%B3%A8%E6%96%87%E3%82%B9%E3%83%88%E3%83%AC%E3%83%BC%E3%82%B8/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.riverforest-wp.info</link>
	<description>WordPress に関する覚え書き</description>
	<lastBuildDate>Fri, 09 May 2025 12:48:52 +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>高パフォーマンス注文ストレージ &#8211; WordPress Memo</title>
	<link>https://blog.riverforest-wp.info</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>WooCommerce の高パフォーマンス注文ストレージ (COT)への対応方法</title>
		<link>https://blog.riverforest-wp.info/woocommerce-hpos/</link>
		
		<dc:creator><![CDATA[Katsushi Kawamori]]></dc:creator>
		<pubDate>Sat, 05 Aug 2023 00:31:10 +0000</pubDate>
				<category><![CDATA[WooCommerce]]></category>
		<category><![CDATA[COT]]></category>
		<category><![CDATA[HPOS]]></category>
		<category><![CDATA[高パフォーマンス注文ストレージ]]></category>
		<guid isPermaLink="false">https://blog.riverforest-wp.info/?p=3355</guid>

					<description><![CDATA[はじめに WooCommerce が2023年8月8日に、Version 8.0 になり、「高パフォーマンス注文ストレージ (COT)」というのを採用します。簡単にいうと、注文のデータベースが専用設計のものになります。今 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">はじめに</h3>



<p>WooCommerce が2023年8月8日に、Version 8.0 になり、<strong>「高パフォーマンス注文ストレージ (COT)」</strong>というのを採用します。簡単にいうと、<strong>注文</strong>のデータベースが専用設計のものになります。今までは、注文データベースへのアクセスは WordPress の投稿クラス（<strong>WP_Post</strong>）を利用する場合と、独自のクラス（<strong>WC_Order</strong>）を介して行う場合があったのですが、今後、独自のクラス（<strong>WC_Order</strong>）のみになります。そのため高パフォーマンスになるという事です。Version 8.0 以降も、しばらくは併用できるようですが、近いうちに WordPress の投稿クラス（<strong>WP_Post</strong>）の利用は廃止されるので、以下の対応をとるべきです。</p>



<p>追記：この記事を書いた前日に、Version 8.0 からは見送られ、Version 8.2 からになりました。</p>



<style>
.simpleblogcard_img_blockf01352970b67571f82963f9ceba4a29e {
  float: right;
  padding: 10px;
}
.simpleblogcard_borderf01352970b67571f82963f9ceba4a29e {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_titlef01352970b67571f82963f9ceba4a29e {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_descriptionf01352970b67571f82963f9ceba4a29e {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://developer.woocommerce.com/2022/09/14/high-performance-order-storage-progress-report/?_gl=1*jcexyw*_gcl_au*MjAyNzg3OTI3NS4xNjg0NjI1NjQ2*_ga*MTg2MzUwODQ4MC4xNjU3MzIxMzMz*_ga_98K30SHWB2*MTY5MTE5MDE4Ni4yMi4xLjE2OTExOTA3NjguMC4wLjA.&#038;_ga=2.202022225.1939805894.1691190187-1863508480.1657321333>
				<figure class="simpleblogcard_img_blockf01352970b67571f82963f9ceba4a29e">
			<img decoding="async" style="border-radius: 5px; width: 100px; height: 56px;" src="https://developer.woocommerce.com/wp-content/uploads/sites/2/2025/02/brandvar2.png" alt="High-Performance Order Storage: progress report – The WooCommerce Developer Blog" />
		</figure>
		<div class="simpleblogcard_inner">
		<div class="simpleblogcard_borderf01352970b67571f82963f9ceba4a29e">
			developer.woocommerce.com			<div class="simpleblogcard_titlef01352970b67571f82963f9ceba4a29e">
				High-Performance Order Storage: progress report – The WooCommerce Developer Blog			</div>
							<div class="simpleblogcard_descriptionf01352970b67571f82963f9ceba4a29e">
					In January, we published the initial plan for the Custom Order Tables feature and since th&#8230;				</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>



<h3 class="wp-block-heading">独自プラグインへの対応方法</h3>



<p>対応していないと以下の様な表示が出て、機能を有効化できません。</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69cc637022c0a&quot;}" data-wp-interactive="core/image" data-wp-key="69cc637022c0a" class="wp-block-image aligncenter size-large wp-lightbox-container"><img fetchpriority="high" loading="eager" decoding="async" width="1024" height="637" 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/20230805/screenshot1-1024x637.png" alt="" class="wp-image-3369" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20230805/screenshot1-1024x637.png 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20230805/screenshot1-300x187.png 300w, https://blog.riverforest-wp.info/wp-content/uploads/20230805/screenshot1-768x477.png 768w, https://blog.riverforest-wp.info/wp-content/uploads/20230805/screenshot1.png 1031w" sizes="(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><strong>対応方法</strong></p>



<p>自プラグインのコード内をエディターにより以下の正規表現で検索します。</p>



<pre class="prism line-numbers"><code class="language-php language-html">wpdb|get_post|get_post_field|get_post_status|get_post_type|get_post_type_object|get_posts|metadata_exists|get_post_meta|get_metadata|get_metadata_raw|get_metadata_default|get_metadata_by_mid|wp_insert_post|add_metadata|add_post_meta|wp_update_post|update_post_meta|update_metadata|update_metadata_by_mid|delete_metadata|delete_post_meta|delete_metadata_by_mid|delete_post_meta_by_key|wp_delete_post|wp_trash_post|wp_untrash_post|wp_transition_post_status|clean_post_cache|update_post_caches|update_postmeta_cache|post_exists|wp_count_post|shop_order</code></pre>



<p>もし上記が発見されなければ、プラグインのメインファイルに以下のコードを貼り、COT に対応している事を宣言します。こうするだけで上記の表示は消えて、COT を有効化できます。発見されても、<strong>注文</strong>関連でなければ同様です。</p>



<pre class="prism line-numbers"><code class="language-php language-html">add_action(
	'before_woocommerce_init',
	function() {
		if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
			\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
		}
	}
);</code></pre>



<p>逆に<strong>注文</strong>関連で発見された場合には、修正が必要になります。簡単に言うと、<strong>WP_Post</strong> クラスを使用したものを、<strong>WC_Order</strong> クラスを使用したものに置き換えます。</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">
<style>
.simpleblogcard_img_block02b65da95fbc91f7ca8909f04fb0dfab {
  float: right;
  padding: 10px;
}
.simpleblogcard_border02b65da95fbc91f7ca8909f04fb0dfab {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_title02b65da95fbc91f7ca8909f04fb0dfab {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_description02b65da95fbc91f7ca8909f04fb0dfab {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://developer.wordpress.org/reference/classes/wp_post/>
				<figure class="simpleblogcard_img_block02b65da95fbc91f7ca8909f04fb0dfab">
			<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_Post – Class | Developer.WordPress.org" />
		</figure>
		<div class="simpleblogcard_inner">
		<div class="simpleblogcard_border02b65da95fbc91f7ca8909f04fb0dfab">
			developer.wordpress.org			<div class="simpleblogcard_title02b65da95fbc91f7ca8909f04fb0dfab">
				WP_Post – Class | Developer.WordPress.org			</div>
							<div class="simpleblogcard_description02b65da95fbc91f7ca8909f04fb0dfab">
					Core class used to implement the WP_Post object.				</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<style>
.simpleblogcard_img_block97da42adbf4dffd5a6373b4829ffdb32 {
  float: right;
  padding: 10px;
}
.simpleblogcard_border97da42adbf4dffd5a6373b4829ffdb32 {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_title97da42adbf4dffd5a6373b4829ffdb32 {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_description97da42adbf4dffd5a6373b4829ffdb32 {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://woocommerce.github.io/code-reference/classes/WC-Order.html>
			<div class="simpleblogcard_inner">
		<div class="simpleblogcard_border97da42adbf4dffd5a6373b4829ffdb32">
			woocommerce.github.io			<div class="simpleblogcard_title97da42adbf4dffd5a6373b4829ffdb32">
				WooCommerce Code Reference			</div>
							<div class="simpleblogcard_description97da42adbf4dffd5a6373b4829ffdb32">
									</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>
</div>
</div>



<p>詳細は以下を参考にしてください。</p>



<style>
.simpleblogcard_img_block97eb7c85e2582a8a51629bf1971c3ac5 {
  float: right;
  padding: 10px;
}
.simpleblogcard_border97eb7c85e2582a8a51629bf1971c3ac5 {
  border-left: solid 8px #cd162c;
  padding: 0.25em 0.25em;
  background: transparent;
}
.simpleblogcard_title97eb7c85e2582a8a51629bf1971c3ac5 {
  line-height: 155%;
  font-weight: bold;
  display: block;
}
.simpleblogcard_description97eb7c85e2582a8a51629bf1971c3ac5 {
  line-height: 155%;
  color: #333;
}
</style>
<div class="simpleblogcard_wrap">
			<a style="text-decoration: none;" href=https://github.com/woocommerce/woocommerce/wiki/High-Performance-Order-Storage-Upgrade-Recipe-Book>
				<figure class="simpleblogcard_img_block97eb7c85e2582a8a51629bf1971c3ac5">
			<img decoding="async" style="border-radius: 5px; width: 100px; height: 50px;" src="https://opengraph.githubassets.com/7f732f0e74b05bfa21effee738d254e34a9fda4f69110edfef0d13cd0fbef360/woocommerce/woocommerce" alt="High Performance Order Storage Upgrade Recipe Book · woocommerce/woocommerce Wiki · GitHub" />
		</figure>
		<div class="simpleblogcard_inner">
		<div class="simpleblogcard_border97eb7c85e2582a8a51629bf1971c3ac5">
			github.com			<div class="simpleblogcard_title97eb7c85e2582a8a51629bf1971c3ac5">
				High Performance Order Storage Upgrade Recipe Book · woocommerce/woocommerce Wiki · GitHub			</div>
							<div class="simpleblogcard_description97eb7c85e2582a8a51629bf1971c3ac5">
					A customizable, open-source ecommerce platform built on WordPress. Build any commerce solu&#8230;				</div>
					</div>
	</div>
	<div style="clear: both;"></div>
	</a>
</div>



<h2 class="wp-block-heading">対応後</h2>



<p>以下の様な表示に切り替わるので、チェックを入れて「変更を保存」します。</p>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69cc637024e21&quot;}" data-wp-interactive="core/image" data-wp-key="69cc637024e21" class="wp-block-image size-large wp-lightbox-container"><img loading="lazy" decoding="async" width="1024" height="672" 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/20230805/screenshot2-1024x672.png" alt="" class="wp-image-3370" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20230805/screenshot2-1024x672.png 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20230805/screenshot2-300x197.png 300w, https://blog.riverforest-wp.info/wp-content/uploads/20230805/screenshot2-768x504.png 768w, https://blog.riverforest-wp.info/wp-content/uploads/20230805/screenshot2.png 1033w" 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>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69cc637025745&quot;}" data-wp-interactive="core/image" data-wp-key="69cc637025745" class="wp-block-image size-large wp-lightbox-container"><img loading="lazy" decoding="async" width="1024" height="564" 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/20230805/screenshot3-1024x564.png" alt="" class="wp-image-3371" srcset="https://blog.riverforest-wp.info/wp-content/uploads/20230805/screenshot3-1024x564.png 1024w, https://blog.riverforest-wp.info/wp-content/uploads/20230805/screenshot3-300x165.png 300w, https://blog.riverforest-wp.info/wp-content/uploads/20230805/screenshot3-768x423.png 768w, https://blog.riverforest-wp.info/wp-content/uploads/20230805/screenshot3.png 1132w" 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>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
