<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="/wp-content/plugins/rss-beauty/pink.xsl"?>
<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>WP Archives - obaby 𝐢‍𝐧⃝ void</title>
	<atom:link href="https://zhongxiaojie.cn/tag/wp/feed/" rel="self" type="application/rss+xml" />
	<link>https://oba.by/tag/wp/</link>
	<description>程序媛 / 独立开发者 / 智商不稳定的女神经</description>
	<lastBuildDate>Sun, 15 Mar 2026 04:07:00 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://zhongxiaojie.cn/wp-content/uploads/2026/01/uugai.com-166111691272754-100x100.png</url>
	<title>WP Archives - obaby 𝐢‍𝐧⃝ void</title>
	<link>https://oba.by/tag/wp/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>开源项目目录📇</title>
		<link>https://zhongxiaojie.cn/2026/03/593/</link>
					<comments>https://zhongxiaojie.cn/2026/03/593/#comments</comments>
		
		<dc:creator><![CDATA[obaby]]></dc:creator>
		<pubDate>Sat, 14 Mar 2026 08:14:31 +0000</pubDate>
				<category><![CDATA[程序媛]]></category>
		<category><![CDATA[gitee]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[微信]]></category>
		<category><![CDATA[插件]]></category>
		<guid isPermaLink="false">https://zhongxiaojie.cn/?p=593</guid>

					<description><![CDATA[部分开源项目源码。 PHP8 探针项目（包含WP插件） 专业的服务器监控和管理工具，提供实时系统监控、性能测试 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="https://zhongxiaojie.cn/wp-content/uploads/2026/03/58603a31.jpg" data-lbwps-width="2127" data-lbwps-height="1080" data-lbwps-srcsmall="https://zhongxiaojie.cn/wp-content/uploads/2026/03/58603a31-665x338.jpg" data-lightbox="gal[593]"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-597" src="https://zhongxiaojie.cn/wp-content/uploads/2026/03/58603a31.jpg" alt="" width="2127" height="1080" srcset="https://zhongxiaojie.cn/wp-content/uploads/2026/03/58603a31.jpg?v=1773476059 2127w, https://zhongxiaojie.cn/wp-content/uploads/2026/03/58603a31-300x152.jpg?v=1773476059 300w, https://zhongxiaojie.cn/wp-content/uploads/2026/03/58603a31-1024x520.jpg?v=1773476059 1024w, https://zhongxiaojie.cn/wp-content/uploads/2026/03/58603a31-150x76.jpg?v=1773476059 150w, https://zhongxiaojie.cn/wp-content/uploads/2026/03/58603a31-768x390.jpg?v=1773476059 768w, https://zhongxiaojie.cn/wp-content/uploads/2026/03/58603a31-1536x780.jpg?v=1773476059 1536w, https://zhongxiaojie.cn/wp-content/uploads/2026/03/58603a31-2048x1040.jpg?v=1773476059 2048w, https://zhongxiaojie.cn/wp-content/uploads/2026/03/58603a31-665x338.jpg?v=1773476059 665w, https://zhongxiaojie.cn/wp-content/uploads/2026/03/58603a31-512x260.jpg?v=1773476059 512w" sizes="(max-width: 2127px) 100vw, 2127px" /></a></p>
<p>部分开源项目源码。</p>
<p><span id="more-593"></span></p>
<h1>PHP8 探针项目（包含WP插件）</h1>
<p>专业的服务器监控和管理工具，提供实时系统监控、性能测试、数据库检测等功能。本项目包含两个版本：独立PHP探针和WordPress插件版本。</p>
<h2> 项目结构</h2>
<div class="markdown-code-block">
<pre><code class="hljs hljs-">php8-probe/
├── phpprobe.php              # 独立PHP探针（可直接访问）
├── php-probe-widget/         # WordPress插件版本
│   ├── php-probe-widget.php  # 主插件文件
│   ├── includes/             # 小组件类
│   ├── css/                  # 前端样式
│   ├── js/                   # 前端脚本
│   └── README.md             # 插件详细文档
├── LICENSE                   # 许可证
└── README.md                 # 本文件
</code></pre>
<div class="markdown-code-block-copy-btn"></div>
</div>
<h2><a id="user-content--快速开始" class="anchor" href="https://gitee.com/obaby/php8-probe#-%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B"></a><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f680.png" alt="🚀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 快速开始</h2>
<h3><a id="user-content-方式一独立php探针" class="anchor" href="https://gitee.com/obaby/php8-probe#%E6%96%B9%E5%BC%8F%E4%B8%80%E7%8B%AC%E7%AB%8Bphp%E6%8E%A2%E9%92%88"></a>方式一：独立PHP探针</h3>
<ol>
<li>将 <code>phpprobe.php</code> 上传到您的Web服务器</li>
<li>通过浏览器访问该文件即可查看服务器信息</li>
<li>支持实时监控、性能测试、数据库检测等功能</li>
</ol>
<p><strong>特点：</strong></p>
<ul>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 无需安装，直接使用</li>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 单文件部署，简单方便</li>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 支持多平台（Linux、Windows、macOS、FreeBSD）</li>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 实时系统监控</li>
</ul>
<h3><a id="user-content-方式二wordpress插件" class="anchor" href="https://gitee.com/obaby/php8-probe#%E6%96%B9%E5%BC%8F%E4%BA%8Cwordpress%E6%8F%92%E4%BB%B6"></a>方式二：WordPress插件</h3>
<ol>
<li>将 <code>php-probe-widget</code> 文件夹复制到 <code>wp-content/plugins/</code> 目录</li>
<li>在WordPress后台激活&#8221;服务器监控探针&#8221;插件</li>
<li>进入 <strong>外观 &gt; 小组件</strong> 页面</li>
<li>将&#8221;服务器监控探针&#8221;小组件拖拽到侧边栏</li>
<li>配置显示选项和主题设置</li>
</ol>
<p><a href="https://gitee.com/obaby/php8-probe" target="_blank" rel="noopener">https://gitee.com/obaby/php8-probe</a></p>
<hr />
<h1>结巴分词HTTP服务</h1>
<p>基于Flask和jieba的本地HTTP分词服务。</p>
<p><a href="https://gitee.com/obaby/baby-jb-server" target="_blank" rel="noopener">https://gitee.com/obaby/baby-jb-server</a></p>
<hr />
<h1>WordPress 博客数据分析工具</h1>
<p>这是一个用于分析 WordPress 博客数据的 Python 工具，可以通过 WordPress REST API 获取并分析博客的文章和评论数据。</p>
<h2><a id="user-content-功能特性" class="anchor" href="https://gitee.com/obaby/baby-wp-data-analysis-tool#%E5%8A%9F%E8%83%BD%E7%89%B9%E6%80%A7"></a>功能特性</h2>
<ul>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4dd.png" alt="📝" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 统计指定年份发布的文章数量（按月统计）</li>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4ac.png" alt="💬" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 统计指定年份的评论数量</li>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f3c6.png" alt="🏆" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 分析评论用户的评论数排行</li>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4be.png" alt="💾" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 将分析结果保存为 JSON 文件</li>
</ul>
<p><a href="https://gitee.com/obaby/baby-wp-data-analysis-tool" target="_blank" rel="noopener">https://gitee.com/obaby/baby-wp-data-analysis-tool</a></p>
<hr />
<h1>微信双开脚本 (WeChat Dual Launch Script)</h1>
<p>一个用于 macOS 系统的微信双开自动化脚本，通过复制微信应用并修改 Bundle ID 实现真正的微信双开功能。</p>
<h2><a id="user-content--功能特性" class="anchor" href="https://gitee.com/obaby/baby-wechat#-%E5%8A%9F%E8%83%BD%E7%89%B9%E6%80%A7"></a><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4cb.png" alt="📋" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 功能特性</h2>
<ul>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <strong>一键双开</strong> &#8211; 自动完成所有设置步骤</li>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <strong>智能检测</strong> &#8211; 自动检测已存在的 WeChat2.app</li>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <strong>安全可靠</strong> &#8211; 完善的错误处理和权限检查</li>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <strong>彩色输出</strong> &#8211; 友好的命令行界面</li>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <strong>进程管理</strong> &#8211; 查看和管理微信进程</li>
<li><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2705.png" alt="✅" class="wp-smiley" style="height: 1em; max-height: 1em;" /> <strong>自动化设置</strong> &#8211; 无需手动执行复杂命令</li>
</ul>
<p><a href="https://github.com/obaby/baby-wechat" target="_blank" rel="noopener">https://github.com/obaby/baby-wechat</a></p>
<hr />
<div class="markdown-heading" dir="auto">
<h1 class="heading-element" dir="auto" tabindex="-1">Baby 足迹地图</h1>
<p>&nbsp;</p>
</div>
<div class="markdown-heading" dir="auto">
<h2 class="heading-element" dir="auto" tabindex="-1">简介：</h2>
<p>&nbsp;</p>
</div>
<p dir="auto">基于百度地图的足迹地图。<br />
启动服务之后，先去后台 地图 key 设置页面，添加百度地图浏览器端 ak！<br />
启动服务之后，先去后台 地图 key 设置页面，添加百度地图浏览器端 ak！<br />
启动服务之后，先去后台 地图 key 设置页面，添加百度地图浏览器端 ak！</p>
<p dir="auto">为了防止 js 地址解析受限，需要同时添加服务端 ak！<br />
为了防止 js 地址解析受限，需要同时添加服务端 ak！<br />
为了防止 js 地址解析受限，需要同时添加服务端 ak！</p>
<p dir="auto">添加之后，访问： <a href="http://127.0.0.1:10099/api/location/process-my-location/" rel="nofollow">http://127.0.0.1:10099/api/location/process-my-location/</a> 地址刷新数据库的地点坐标信息，后续无需再通过 js 接口进行解析！</p>
<p><a href="https://github.com/obaby/BabyFootprintV2" target="_blank" rel="noopener">https://github.com/obaby/BabyFootprintV2</a></p>
<hr />
<h1 class="heading-element" dir="auto" tabindex="-1">Simple microblogging</h1>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">Add a microblog to your site; display the microposts in a widget or using a shortcode. 
增强版优化页面显示，增加分页功能。wp微博插件。</pre>
<p>&nbsp;</p>
<p><a href="https://github.com/obaby/Simple-microblogging-wordpress-plugin" target="_blank" rel="noopener">https://github.com/obaby/Simple-microblogging-wordpress-plugin</a></p>
<hr />
<div class="markdown-heading" dir="auto">
<h1 class="heading-element" dir="auto" tabindex="-1">Baby WP 评论强化拦截插件</h1>
<p>&nbsp;</p>
</div>
<p dir="auto">一个强大的WordPress评论过滤插件，支持字数限制、中文检测、关键词过滤等功能。</p>
<div class="markdown-heading" dir="auto">
<h2 class="heading-element" dir="auto" tabindex="-1">插件信息</h2>
<p>&nbsp;</p>
</div>
<ul dir="auto">
<li><strong>插件名称</strong>: Baby WP 评论强化拦截插件</li>
<li><strong>版本</strong>: 1.0.5</li>
<li><strong>作者</strong>: obaby</li>
<li><strong>作者网址</strong>: <a href="https://h4ck.org.cn/" rel="nofollow">https://h4ck.org.cn</a></li>
<li><strong>许可证</strong>: GPL v2 or later</li>
</ul>
<div class="markdown-heading" dir="auto">
<h2 class="heading-element" dir="auto" tabindex="-1">功能特性</h2>
<p>&nbsp;</p>
</div>
<div class="markdown-heading" dir="auto">
<h3 class="heading-element" dir="auto" tabindex="-1"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f6e1.png" alt="🛡" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 评论过滤功能</h3>
<p>&nbsp;</p>
</div>
<ul dir="auto">
<li><strong>字数限制</strong>: 设置评论的最少和最多字数</li>
<li><strong>中文检测</strong>: 要求评论必须包含中文字符</li>
<li><strong>关键词过滤</strong>: 支持自定义关键词和WordPress设置的关键词</li>
<li><strong>正则表达式支持</strong>: 支持使用正则表达式进行高级匹配</li>
</ul>
<div class="markdown-heading" dir="auto">
<h3 class="heading-element" dir="auto" tabindex="-1"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/2699.png" alt="⚙" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 管理功能</h3>
<p>&nbsp;</p>
</div>
<ul dir="auto">
<li><strong>简单设置界面</strong>: 直观的管理后台设置页面</li>
<li><strong>错误消息自定义</strong>: 可以自定义各种错误提示消息和标题</li>
<li><strong>统计信息</strong>: 记录评论过滤统计信息，支持重置功能</li>
<li><strong>WordPress集成</strong>: 与WordPress讨论设置完美集成，支持实时预览</li>
<li><strong>设置验证</strong>: 完整的输入验证和数据清理机制</li>
</ul>
<div class="markdown-heading" dir="auto">
<h3 class="heading-element" dir="auto" tabindex="-1"><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f527.png" alt="🔧" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 技术特性</h3>
<p>&nbsp;</p>
</div>
<ul dir="auto">
<li><strong>简单架构</strong>: 采用简单的面向对象架构，易于维护</li>
<li><strong>性能优化</strong>: 高效的过滤算法，不影响网站性能</li>
<li><strong>兼容性</strong>: 支持WordPress 5.0+版本，PHP 7.4+</li>
<li><strong>多语言</strong>: 支持多语言环境</li>
<li><strong>数据安全</strong>: 完整的输入验证和清理机制</li>
<li><strong>错误处理</strong>: 完善的错误处理和日志记录</li>
</ul>
<p><a href="https://github.com/obaby/baby-wp-comment-filter" target="_blank" rel="noopener">https://github.com/obaby/baby-wp-comment-filter</a></p>
<hr />
<div class="markdown-heading" dir="auto">
<h1 class="heading-element" dir="auto" tabindex="-1">WinRAR-Keygen</h1>
<p>&nbsp;</p>
</div>
<div class="markdown-heading" dir="auto">
<h2 class="heading-element" dir="auto" tabindex="-1">1. What is WinRAR?</h2>
<p>&nbsp;</p>
</div>
<ul dir="auto">
<li>
<p dir="auto">WinRAR is a trialware file archiver utility for Windows, developed by Eugene Roshal of win.rar GmbH.</p>
</li>
<li>
<p dir="auto">It can create and view archives in RAR or ZIP file formats and unpack numerous archive file formats.</p>
</li>
<li>
<p dir="auto">WinRAR is not a free software. If you want to use it, you should pay to <a href="https://rarlab.com/" rel="nofollow"><strong>RARLAB</strong></a> and then you will get a license file named <code>"rarreg.key"</code>.</p>
</li>
<li>
<p dir="auto">This repository will tell you how WinRAR license file <code>"rarreg.key"</code> is generated.</p>
</li>
</ul>
<div class="markdown-heading" dir="auto">
<h2 class="heading-element" dir="auto" tabindex="-1">2. How is &#8220;rarreg.key&#8221; generated?</h2>
<p>&nbsp;</p>
</div>
<ul dir="auto">
<li>
<p dir="auto">WinRAR uses a signature algorithm, which is a variant of Chinese SM2 digital signature algorithm, to process the user&#8217;s name and the license type he/she got. Save the result to &#8220;rarreg.key&#8221; and add some header info, then a license file is generated.</p>
</li>
</ul>
<p><a href="https://github.com/obaby/winrar-keygen" target="_blank" rel="noopener">https://github.com/obaby/winrar-keygen</a></p>
<hr />
<div class="markdown-heading" dir="auto">
<h1 class="heading-element" dir="auto" tabindex="-1">Baby Device Manager</h1>
<p>&nbsp;</p>
</div>
<p dir="auto">一个功能强大的WordPress设备管理系统插件，支持设备分组管理、设备信息管理、自定义排序、状态跟踪等功能。</p>
<div class="markdown-heading" dir="auto">
<h2 class="heading-element" dir="auto" tabindex="-1">功能特点</h2>
<p>&nbsp;</p>
</div>
<ul dir="auto">
<li>设备分组管理
<ul dir="auto">
<li>创建和管理设备分组</li>
<li>自定义分组排序</li>
<li>分组描述信息</li>
</ul>
</li>
<li>设备管理
<ul dir="auto">
<li>添加/编辑/删除设备</li>
<li>设备状态管理（在售、停售、已售出、维修中、已报废）</li>
<li>设备图片和产品链接</li>
<li>自定义设备排序</li>
<li>设备描述信息</li>
</ul>
</li>
<li>前端展示
<ul dir="auto">
<li>响应式布局</li>
<li>按分组分类显示</li>
<li>支持多种排序方式</li>
<li>美观的界面设计</li>
<li>支持自定义每行显示设备数量（1-6个）</li>
</ul>
</li>
<li>其他功能
<ul dir="auto">
<li>图片管理：支持设备图片上传和显示</li>
<li>产品链接：支持添加产品详情页链接</li>
<li>状态跟踪：支持多种设备状态管理</li>
<li>自定义排序：支持设备分组和设备的自定义排序</li>
</ul>
</li>
</ul>
<p><a href="https://github.com/obaby/Baby-Device-Manager" target="_blank" rel="noopener">https://github.com/obaby/Baby-Device-Manager</a></p>
<hr />
<div class="relative cnb-markdown-heading group">
<h1 class="cnb-markdown-heading-com">RSS Beauty</h1>
<p>&nbsp;</p>
</div>
<p>为 WordPress RSS Feed 提供美观的网页展示样式（基于 <a class="cursor-pointer hover:underline" href="https://cnb.cool/110?url=https%3A%2F%2Frss.beauty" target="_blank" rel="noopener">RSS.Beauty</a> 的 Pink 主题）。</p>
<div class="relative cnb-markdown-heading group">
<h2 class="cnb-markdown-heading-com">项目功能</h2>
<p>&nbsp;</p>
</div>
<ul>
<li><strong>RSS 样式化</strong>：在 Feed 中注入 XSL 样式表，浏览器打开 feed 地址时以 HTML 页面形式展示，而非原始 XML。</li>
<li><strong>Feed Content-Type</strong>：将 feed 的 Content-Type 设为 <code>application/xml</code>，使浏览器按 XML 解析并应用 <code>xml-stylesheet</code>。</li>
<li><strong>XSL 地址</strong>：样式表使用插件目录下的静态文件 <code>pink.xsl</code>。需在 OpenResty/Nginx 中为 <code>.xsl</code> 配置正确的 Content-Type（见下方配置说明），否则浏览器可能不按 XSL 解析。</li>
<li><strong>主题</strong>：内置淡粉色（light pink）页面背景与适配的文字颜色。</li>
</ul>
<p><a href="https://cnb.cool/oba.by/rss-beauty" target="_blank" rel="noopener">https://cnb.cool/oba.by/rss-beauty</a></p>
<hr />
<div class="relative cnb-markdown-heading group">
<h1 class="cnb-markdown-heading-com">WP-UserAgent</h1>
<p>&nbsp;</p>
</div>
<p><strong>Contributors:</strong> obaby<br />
<strong>Donate Link:</strong> <a class="cursor-pointer hover:underline" href="https://cnb.cool/110?url=https%3A%2F%2Foba.by" target="_blank" rel="noopener">https://oba.by</a><br />
<strong>Tags:</strong> useragent, user-agent, user agent, web, browser, web browser, operating system, platform, os, mac, apple, windows, win, linux, phone<br />
<strong>Requires at least:</strong> 2.0<br />
<strong>Tested up to:</strong> 6.3<br />
<strong>Stable tag:</strong> 16.06.99</p>
<div class="relative cnb-markdown-heading group">
<h2 class="cnb-markdown-heading-com">IP 查询方式（归属地）</h2>
<p>&nbsp;</p>
</div>
<p>插件支持四种 IP 查询方式，可在 <strong>设置 → WP-UserAgent</strong> 中选择：</p>
<table>
<thead>
<tr>
<th>方式</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>IP2Location</strong></td>
<td>使用 IP2Location 数据库（需将 BIN 文件放入 <code>show-useragent/ip2location_db/db/</code>），依赖 Composer</td>
</tr>
<tr>
<td><strong>CZDB</strong></td>
<td>使用纯真 CZDB 数据库（需授权与 db 文件放入 <code>show-useragent/czdb/db/</code>），依赖 Composer</td>
</tr>
<tr>
<td><strong>ip2region</strong></td>
<td>使用 ip2region xdb（<strong>仅内置 ip2reginapi，不依赖 Composer</strong>）。需将 xdb 文件放入 <code>show-useragent/ip2region_db/</code>，文件名：<code>ip2region_v4.xdb</code>、<code>ip2region_v6.xdb</code></td>
</tr>
<tr>
<td><strong>纯真QQWRY</strong></td>
<td>使用 qqwry_api（qqwry.dat + ipv6wry.db），无需 Composer。数据文件放入 <code>show-useragent/qqwry_api/ipdata/</code></td>
</tr>
</tbody>
</table>
<p>选择 <strong>ip2region</strong> 或 <strong>纯真QQWRY</strong> 时不会加载 <code>vendor/autoload.php</code>。若选择 IP2Location 或 CZDB 时 vendor 加载失败，插件会自动回退为 ip2region 模式，避免站点白屏。</p>
<div class="relative cnb-markdown-heading group">
<h2 class="cnb-markdown-heading-com">Description</h2>
<p>&nbsp;</p>
</div>
<p><strong>WP-UserAgent</strong> is a simple plugin that allows you to display details about a computer&#8217;s <a class="cursor-pointer hover:underline" href="https://cnb.cool/110?url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FOperating_system" target="_blank" rel="noopener">operating system</a> or <a class="cursor-pointer hover:underline" href="https://cnb.cool/110?url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWeb_browser" target="_blank" rel="noopener">web browser</a> that your visitors comment from.</p>
<p>It uses the comment-&gt;agent property to access the <a class="cursor-pointer hover:underline" href="https://cnb.cool/110?url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FUser_agent" target="_blank" rel="noopener">User-Agent string</a>. Through a series of regular expressions, this plugin is able to detect the operating system and browser which can be integrated in comments or placed in custom places through your template(s).</p>
<p>I&#8217;m adding new web browsers and operating systems frequently, as well as updating and optimizing the source code. Your feedback is very important, new features have been added by request, so if there&#8217;s something you would like to see in <strong>WP-UserAgent</strong>, <a class="cursor-pointer hover:underline" href="https://cnb.cool/110?url=https%3A%2F%2Fwww.kyleabaker.com%2Fgoodies%2Fcoding%2Fwp-useragent%2F" target="_blank" rel="noopener">leave a comment</a>, and I&#8217;ll see what I can do.</p>
<p><strong>WP-UserAgent</strong> was written with Geany &#8211; <a class="cursor-pointer hover:underline" href="https://cnb.cool/110?url=http%3A%2F%2Fwww.geany.org%2F" target="_blank" rel="noopener">http://www.geany.org/</a><br />
Images created with The Gimp &#8211; <a class="cursor-pointer hover:underline" href="https://cnb.cool/110?url=http%3A%2F%2Fwww.gimp.org%2F" target="_blank" rel="noopener">http://www.gimp.org/</a></p>
<blockquote><p><strong>注意：</strong></p>
<ul>
<li>使用 <strong>CZDB</strong> 时：若更新替换纯真数据库，请同步更新 <code>show-useragent/ip2c-text.php</code> 中的 <code>$key = 'n2pf2+PrE1y9I55MjdpLpg==';</code></li>
<li>使用 <strong>ip2region</strong> 时：将 xdb 文件放入 <code>show-useragent/ip2region_db/</code>（<code>ip2region_v4.xdb</code>、<code>ip2region_v6.xdb</code>），无需 Composer。</li>
</ul>
</blockquote>
<p><a href="https://cnb.cool/oba.by/wp-useragent" target="_blank" rel="noopener">https://cnb.cool/oba.by/wp-useragent</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://zhongxiaojie.cn/2026/03/593/feed/</wfw:commentRss>
			<slash:comments>81</slash:comments>
		
		
			</item>
		<item>
		<title>WP-UserAgent [增强版 16.01.01]</title>
		<link>https://zhongxiaojie.cn/2026/01/104/</link>
					<comments>https://zhongxiaojie.cn/2026/01/104/#comments</comments>
		
		<dc:creator><![CDATA[obaby]]></dc:creator>
		<pubDate>Sat, 17 Jan 2026 01:35:37 +0000</pubDate>
				<category><![CDATA[程序媛]]></category>
		<category><![CDATA[IP2Location]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[归属地]]></category>
		<category><![CDATA[纯真]]></category>
		<guid isPermaLink="false">https://zhongxiaojie.cn/?p=104</guid>

					<description><![CDATA[就是为了解决ipv6归属地只显示中国的问题。 集成 IP2Location PHP 模块支持 添加 IP 查询 [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="https://zhongxiaojie.cn/wp-content/uploads/2026/01/Screenshot-2026-01-17-092104.png" data-lbwps-width="2332" data-lbwps-height="1594" data-lbwps-srcsmall="https://zhongxiaojie.cn/wp-content/uploads/2026/01/Screenshot-2026-01-17-092104-665x455.png" data-lightbox="gal[104]"><img decoding="async" class="alignnone size-full wp-image-105" src="https://zhongxiaojie.cn/wp-content/uploads/2026/01/Screenshot-2026-01-17-092104.png" alt="" width="2332" height="1594" srcset="https://zhongxiaojie.cn/wp-content/uploads/2026/01/Screenshot-2026-01-17-092104.png?v=1768613488 2332w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Screenshot-2026-01-17-092104-300x205.png?v=1768613488 300w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Screenshot-2026-01-17-092104-1024x700.png?v=1768613488 1024w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Screenshot-2026-01-17-092104-150x103.png?v=1768613488 150w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Screenshot-2026-01-17-092104-768x525.png?v=1768613488 768w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Screenshot-2026-01-17-092104-1536x1050.png?v=1768613488 1536w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Screenshot-2026-01-17-092104-2048x1400.png?v=1768613488 2048w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Screenshot-2026-01-17-092104-665x455.png?v=1768613488 665w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Screenshot-2026-01-17-092104-380x260.png?v=1768613488 380w" sizes="(max-width: 2332px) 100vw, 2332px" /></a></p>
<p>就是为了解决ipv6归属地只显示中国的问题。</p>
<p><span id="more-104"></span></p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">集成 IP2Location PHP 模块支持
添加 IP 查询方式选择选项（可在插件设置中选择 IP2Location 或 CZDB）
支持从 WordPress 后台设置页面选择 IP 查询方式
实现自动回退机制：如果 IP2Location 模块未安装，自动使用 CZDB 作为备用
优化 IP 查询代码，支持双语国家名称（中文/英文）
添加 getCountryCodeFromIP() 函数，可直接从 IP 获取国家代码
添加中国省份和城市名称翻译功能：当 IP 地址属于中国时，自动将省份（regionName）和城市（cityName）从英文翻译为中文
包含所有34个省级行政区和200+个主要城市的中英文对照表
更新版本号至 16.01.01</pre>
<p>注意：</p>
<p><strong><span style="color: #ff0000;">代码里带的纯真数据库已经过期，需要下载新的数据库，建议直接使用ip2location！</span></strong></p>
<p><strong><span style="color: #ff0000;">代码里带的纯真数据库已经过期，需要下载新的数据库，建议直接使用ip2location！</span></strong></p>
<p><strong><span style="color: #ff0000;">代码里带的纯真数据库已经过期，需要下载新的数据库，建议直接使用ip2location！</span></strong></p>
<p>第一次知道数据库还能过期，尼码，解决这个异常折腾了半天，发现是数据库过期了，艹！ 如果用纯真，请及时更新数据库！！！(2026.01.29)</p>
<p><a href="https://zhongxiaojie.cn/wp-content/uploads/2026/01/Jietu20260129-105838.jpg" data-lbwps-width="1046" data-lbwps-height="98" data-lbwps-srcsmall="https://zhongxiaojie.cn/wp-content/uploads/2026/01/Jietu20260129-105838-665x62.jpg" data-lightbox="gal[104]"><img decoding="async" class="alignnone size-full wp-image-295" src="https://zhongxiaojie.cn/wp-content/uploads/2026/01/Jietu20260129-105838.jpg" alt="" width="1046" height="98" srcset="https://zhongxiaojie.cn/wp-content/uploads/2026/01/Jietu20260129-105838.jpg?v=1769655530 1046w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Jietu20260129-105838-300x28.jpg?v=1769655530 300w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Jietu20260129-105838-1024x96.jpg?v=1769655530 1024w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Jietu20260129-105838-150x14.jpg?v=1769655530 150w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Jietu20260129-105838-768x72.jpg?v=1769655530 768w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/Jietu20260129-105838-665x62.jpg?v=1769655530 665w" sizes="(max-width: 1046px) 100vw, 1046px" /></a></p>
<p>代码地址：</p>
<p><a href="https://cnb.cool/oba.by/wp-useragent" target="_blank" rel="noopener">https://cnb.cool/oba.by/wp-useragent</a></p>
<p>插件地址：</p>
<p><a href="https://cnb.cool/oba.by/wp-useragent/-/releases" target="_blank" rel="noopener">https://cnb.cool/oba.by/wp-useragent/-/releases</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://zhongxiaojie.cn/2026/01/104/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>警告（禁止）	unserialize(): Error at offset 4351 of 4374 bytes</title>
		<link>https://zhongxiaojie.cn/2026/01/73/</link>
					<comments>https://zhongxiaojie.cn/2026/01/73/#comments</comments>
		
		<dc:creator><![CDATA[obaby]]></dc:creator>
		<pubDate>Fri, 16 Jan 2026 02:44:15 +0000</pubDate>
				<category><![CDATA[程序媛]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>
		<guid isPermaLink="false">https://zhongxiaojie.cn/?p=73</guid>

					<description><![CDATA[解决数据库替换 url 导致的错误。 警告（禁止） unserialize(): Error at offse [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="https://zhongxiaojie.cn/wp-content/uploads/2026/01/微信图片_20260116104025_529_42.jpg" data-lbwps-width="1280" data-lbwps-height="1920" data-lbwps-srcsmall="https://zhongxiaojie.cn/wp-content/uploads/2026/01/微信图片_20260116104025_529_42.jpg" data-lightbox="gal[73]"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-74" src="https://zhongxiaojie.cn/wp-content/uploads/2026/01/微信图片_20260116104025_529_42.jpg" alt="" width="1280" height="1920" srcset="https://zhongxiaojie.cn/wp-content/uploads/2026/01/微信图片_20260116104025_529_42.jpg?v=1768531341 1280w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/微信图片_20260116104025_529_42-200x300.jpg?v=1768531341 200w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/微信图片_20260116104025_529_42-683x1024.jpg?v=1768531341 683w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/微信图片_20260116104025_529_42-768x1152.jpg?v=1768531341 768w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/微信图片_20260116104025_529_42-1024x1536.jpg?v=1768531341 1024w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/微信图片_20260116104025_529_42-665x998.jpg?v=1768531341 665w, https://zhongxiaojie.cn/wp-content/uploads/2026/01/微信图片_20260116104025_529_42-173x260.jpg?v=1768531341 173w" sizes="auto, (max-width: 1280px) 100vw, 1280px" /></a></p>
<p>解决数据库替换 url 导致的错误。</p>
<p><span id="more-73"></span></p>
<pre class="EnlighterJSRAW" data-enlighter-language="generic">警告（禁止）	unserialize(): Error at offset 4351 of 4374 bytes	
wp-includes/functions.php:655
unserialize()
wp-includes/functions.php:655
maybe_unserialize()
wp-includes/functions.php:655
array_map()
wp-includes/meta.php:692
get_metadata_raw()
wp-includes/meta.php:602
get_metadata()
wp-includes/post.php:2712
get_post_meta()
wp-admin/includes/class-wp-privacy-policy-content.php:69
WP_Privacy_Policy_Content::text_change_check()
wp-includes/class-wp-hook.php:341
do_action('admin_init')
wp-admin/admin.php:180</pre>
<p>修复代码：</p>
<pre class="EnlighterJSRAW" data-enlighter-language="php">&lt;?php
/**
 * WordPress 序列化数据修复脚本
 * 修复因直接 SQL REPLACE 导致的序列化数据损坏问题
 * 
 * 使用方法：
 * 1. 修改下面的数据库连接信息
 * 2. 在命令行运行: php fix-unserialize-error.php
 * 3. 或者通过浏览器访问（需要配置 web 服务器）
 */

// ========== 配置区域 ==========
define('DB_HOST', '127.0.0.1');
define('DB_NAME', 'zxj');
define('DB_USER', 'root');
define('DB_PASS', 'zxj');
define('DB_PREFIX', 'wp_'); // 表前缀

// 旧 URL 和新 URL（用于修复）
define('OLD_URL', 'http://test.h4ck.org.cn:18888');
define('NEW_URL', 'https://zhongxiaojie.cn');

// ========== 主程序 ==========

// 连接数据库
try {
    $pdo = new PDO(
        "mysql:host=" . DB_HOST . ";dbname=" . DB_NAME . ";charset=utf8mb4",
        DB_USER,
        DB_PASS,
        [
            PDO::ATTR_ERRMODE =&gt; PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE =&gt; PDO::FETCH_ASSOC
        ]
    );
} catch (PDOException $e) {
    die("数据库连接失败: " . $e-&gt;getMessage() . "\n");
}

echo "==========================================\n";
echo "WordPress 序列化数据修复工具\n";
echo "==========================================\n\n";

/**
 * 修复序列化字符串中的 URL
 * 正确更新序列化数据中的长度信息
 */
function fix_serialized_url($serialized, $old_url, $new_url) {
    // 如果不是序列化数据，直接替换
    if (!is_serialized($serialized)) {
        return str_replace($old_url, $new_url, $serialized);
    }
    
    // 尝试反序列化
    $data = @unserialize($serialized);
    
    // 如果反序列化失败，尝试修复
    if ($data === false &amp;&amp; $serialized !== serialize(false)) {
        // 尝试修复常见的序列化问题
        $fixed = fix_broken_serialize($serialized, $old_url, $new_url);
        $data = @unserialize($fixed);
        
        if ($data === false &amp;&amp; $fixed !== serialize(false)) {
            return false; // 无法修复
        }
        
        $serialized = $fixed;
        $data = @unserialize($serialized);
    }
    
    // 递归替换数组或对象中的 URL
    if (is_array($data)) {
        $data = array_map(function($value) use ($old_url, $new_url) {
            if (is_string($value)) {
                return str_replace($old_url, $new_url, $value);
            } elseif (is_array($value)) {
                return array_map(function($v) use ($old_url, $new_url) {
                    return is_string($v) ? str_replace($old_url, $new_url, $v) : $v;
                }, $value);
            }
            return $value;
        }, $data);
    } elseif (is_object($data)) {
        foreach ($data as $key =&gt; $value) {
            if (is_string($value)) {
                $data-&gt;$key = str_replace($old_url, $new_url, $value);
            }
        }
    } elseif (is_string($data)) {
        $data = str_replace($old_url, $new_url, $data);
    }
    
    // 重新序列化
    return serialize($data);
}

/**
 * 检查字符串是否是序列化数据
 */
function is_serialized($data) {
    if (!is_string($data)) {
        return false;
    }
    $data = trim($data);
    if ('N;' == $data) {
        return true;
    }
    if (strlen($data) &lt; 4) {
        return false;
    }
    if (':' !== $data[1]) {
        return false;
    }
    $semi = strpos($data, ';');
    if (false === $semi) {
        return false;
    }
    $token = $data[0];
    switch ($token) {
        case 's':
            if ('"' !== $data[$semi - 1]) {
                return false;
            }
        case 'a':
        case 'O':
            return (bool) preg_match("/^{$token}:[0-9]+:/s", $data);
        case 'b':
        case 'i':
        case 'd':
            return (bool) preg_match("/^{$token}:[0-9.E-]+;/", $data);
    }
    return false;
}

/**
 * 尝试修复损坏的序列化数据
 */
function fix_broken_serialize($serialized, $old_url = null, $new_url = null) {
    // 如果包含旧 URL，先替换
    if ($old_url &amp;&amp; $new_url &amp;&amp; strpos($serialized, $old_url) !== false) {
        $serialized = str_replace($old_url, $new_url, $serialized);
    }
    
    // 尝试修复长度信息
    // 匹配字符串长度模式: s:数字:"内容"
    // 注意：需要处理转义字符和嵌套引号
    $pattern = '/s:(\d+):"((?:[^"\\\\]|\\\\.)*)"/';
    $serialized = preg_replace_callback($pattern, function($matches) {
        // 计算实际字符串长度（考虑转义字符）
        $str = $matches[2];
        $length = strlen($str);
        return 's:' . $length . ':"' . $str . '"';
    }, $serialized);
    
    return $serialized;
}

/**
 * 检测并修复损坏的序列化数据
 */
function detect_and_fix_broken_serialize($serialized) {
    // 如果不是序列化数据，直接返回
    if (!is_serialized($serialized)) {
        return ['fixed' =&gt; false, 'data' =&gt; $serialized, 'error' =&gt; null];
    }
    
    // 清除之前的错误
    @error_clear_last();
    
    // 尝试反序列化
    $data = @unserialize($serialized);
    
    // 检查是否有错误
    $error = error_get_last();
    
    // 如果反序列化成功且没有错误，返回原数据
    if ($data !== false &amp;&amp; ($error === null || strpos($error['message'], 'unserialize') === false)) {
        // 特殊处理：false 的序列化结果是 'b:0;'
        if ($serialized === 'b:0;' || $serialized === serialize(false)) {
            return ['fixed' =&gt; false, 'data' =&gt; $serialized, 'error' =&gt; null];
        }
        return ['fixed' =&gt; false, 'data' =&gt; $serialized, 'error' =&gt; null];
    }
    
    // 反序列化失败，记录错误
    $original_error = $error ? $error['message'] : 'Unserialize failed';
    
    // 尝试修复长度信息
    $fixed = fix_broken_serialize($serialized);
    @error_clear_last();
    $test_data = @unserialize($fixed);
    $test_error = error_get_last();
    
    if ($test_data !== false &amp;&amp; ($test_error === null || strpos($test_error['message'], 'unserialize') === false)) {
        return ['fixed' =&gt; true, 'data' =&gt; $fixed, 'error' =&gt; $original_error];
    }
    
    // 如果还是失败，尝试更激进的修复
    // 修复所有字符串长度（更精确的匹配）
    $fixed2 = preg_replace_callback('/s:(\d+):"((?:[^"\\\\]|\\\\.)*)"/', function($m) {
        $str = $m[2];
        $len = strlen($str);
        return 's:' . $len . ':"' . $str . '"';
    }, $serialized);
    
    @error_clear_last();
    $test_data2 = @unserialize($fixed2);
    $test_error2 = error_get_last();
    
    if ($test_data2 !== false &amp;&amp; ($test_error2 === null || strpos($test_error2['message'], 'unserialize') === false)) {
        return ['fixed' =&gt; true, 'data' =&gt; $fixed2, 'error' =&gt; $original_error];
    }
    
    return ['fixed' =&gt; false, 'data' =&gt; $serialized, 'error' =&gt; $original_error];
}

$fixed_count = 0;
$error_count = 0;
$broken_count = 0;

// 修复 wp_postmeta 表
echo "[1/4] 检查 wp_postmeta 表中的序列化数据...\n";

// 首先查找所有序列化数据
$stmt = $pdo-&gt;prepare("SELECT meta_id, post_id, meta_key, meta_value FROM " . DB_PREFIX . "postmeta WHERE meta_value LIKE 'a:%' OR meta_value LIKE 'O:%' OR meta_value LIKE 's:%' OR meta_value LIKE 'i:%' OR meta_value LIKE 'b:%' OR meta_value LIKE 'd:%'");
$stmt-&gt;execute();
$all_serialized = $stmt-&gt;fetchAll();

echo "找到 " . count($all_serialized) . " 条可能的序列化数据记录\n";
echo "开始检测损坏的数据...\n\n";

$update_stmt = $pdo-&gt;prepare("UPDATE " . DB_PREFIX . "postmeta SET meta_value = ? WHERE meta_id = ?");
$broken_records = [];

foreach ($all_serialized as $row) {
    $result = detect_and_fix_broken_serialize($row['meta_value']);
    
    if ($result['fixed']) {
        $broken_count++;
        $broken_records[] = [
            'meta_id' =&gt; $row['meta_id'],
            'post_id' =&gt; $row['post_id'],
            'meta_key' =&gt; $row['meta_key'],
            'error' =&gt; $result['error']
        ];
        
        try {
            $update_stmt-&gt;execute([$result['data'], $row['meta_id']]);
            $fixed_count++;
            if ($fixed_count % 10 == 0) {
                echo "  已修复 {$fixed_count} 条损坏的记录...\n";
            }
        } catch (PDOException $e) {
            echo "  ✗ 更新失败 meta_id={$row['meta_id']}: " . $e-&gt;getMessage() . "\n";
            $error_count++;
        }
    }
}

if ($broken_count &gt; 0) {
    echo "\n发现并修复了 {$broken_count} 条损坏的序列化数据\n";
    if (count($broken_records) &lt;= 20) {
        echo "\n损坏的记录详情：\n";
        foreach ($broken_records as $rec) {
            echo "  - meta_id={$rec['meta_id']}, post_id={$rec['post_id']}, meta_key={$rec['meta_key']}\n";
        }
    }
} else {
    echo "未发现损坏的序列化数据\n";
}

// 也检查包含旧 URL 的记录（即使已经修复了长度问题，URL 可能还需要更新）
echo "\n检查是否还有包含旧 URL 的记录...\n";
$stmt = $pdo-&gt;prepare("SELECT meta_id, post_id, meta_key, meta_value FROM " . DB_PREFIX . "postmeta WHERE meta_value LIKE ?");
$stmt-&gt;execute(['%' . OLD_URL . '%']);
$url_rows = $stmt-&gt;fetchAll();

if (count($url_rows) &gt; 0) {
    echo "找到 " . count($url_rows) . " 条包含旧 URL 的记录，正在修复...\n";
    foreach ($url_rows as $row) {
        $original = $row['meta_value'];
        $fixed = fix_serialized_url($original, OLD_URL, NEW_URL);
        
        if ($fixed !== false &amp;&amp; $fixed !== $original) {
            try {
                $update_stmt-&gt;execute([$fixed, $row['meta_id']]);
                $fixed_count++;
            } catch (PDOException $e) {
                $error_count++;
            }
        }
    }
}

echo "\n[2/4] 检查 wp_options 表中的序列化数据...\n";

// 检查所有序列化数据
$stmt = $pdo-&gt;prepare("SELECT option_id, option_name, option_value FROM " . DB_PREFIX . "options WHERE option_value LIKE 'a:%' OR option_value LIKE 'O:%' OR option_value LIKE 's:%' OR option_value LIKE 'i:%' OR option_value LIKE 'b:%' OR option_value LIKE 'd:%'");
$stmt-&gt;execute();
$all_options = $stmt-&gt;fetchAll();

echo "找到 " . count($all_options) . " 条可能的序列化选项\n";
echo "开始检测损坏的数据...\n\n";

$update_stmt = $pdo-&gt;prepare("UPDATE " . DB_PREFIX . "options SET option_value = ? WHERE option_id = ?");
$broken_options = [];

foreach ($all_options as $row) {
    // 跳过 siteurl 和 home
    if (in_array($row['option_name'], ['siteurl', 'home'])) {
        continue;
    }
    
    $result = detect_and_fix_broken_serialize($row['option_value']);
    
    if ($result['fixed']) {
        $broken_count++;
        $broken_options[] = [
            'option_id' =&gt; $row['option_id'],
            'option_name' =&gt; $row['option_name'],
            'error' =&gt; $result['error']
        ];
        
        try {
            $update_stmt-&gt;execute([$result['data'], $row['option_id']]);
            $fixed_count++;
        } catch (PDOException $e) {
            $error_count++;
        }
    }
}

if (count($broken_options) &gt; 0) {
    echo "发现并修复了 " . count($broken_options) . " 条损坏的选项\n";
    if (count($broken_options) &lt;= 20) {
        echo "\n损坏的选项详情：\n";
        foreach ($broken_options as $opt) {
            echo "  - option_id={$opt['option_id']}, option_name={$opt['option_name']}\n";
        }
    }
}

// 检查包含旧 URL 的选项
echo "\n检查是否还有包含旧 URL 的选项...\n";
$stmt = $pdo-&gt;prepare("SELECT option_id, option_name, option_value FROM " . DB_PREFIX . "options WHERE option_value LIKE ?");
$stmt-&gt;execute(['%' . OLD_URL . '%']);
$url_options = $stmt-&gt;fetchAll();

if (count($url_options) &gt; 0) {
    echo "找到 " . count($url_options) . " 条包含旧 URL 的选项，正在修复...\n";
    foreach ($url_options as $row) {
        if (in_array($row['option_name'], ['siteurl', 'home'])) {
            continue;
        }
        
        $original = $row['option_value'];
        $fixed = fix_serialized_url($original, OLD_URL, NEW_URL);
        
        if ($fixed !== false &amp;&amp; $fixed !== $original) {
            try {
                $update_stmt-&gt;execute([$fixed, $row['option_id']]);
                $fixed_count++;
            } catch (PDOException $e) {
                $error_count++;
            }
        }
    }
}

echo "\n[3/4] 检查其他元数据表...\n";
$tables = [
    DB_PREFIX . 'usermeta' =&gt; ['umeta_id', 'user_id', 'meta_key', 'meta_value'],
    DB_PREFIX . 'commentmeta' =&gt; ['meta_id', 'comment_id', 'meta_key', 'meta_value'],
    DB_PREFIX . 'termmeta' =&gt; ['meta_id', 'term_id', 'meta_key', 'meta_value']
];

foreach ($tables as $table =&gt; $columns) {
    if (!table_exists($pdo, $table)) {
        continue;
    }
    
    echo "检查 {$table}...\n";
    
    // 检查所有序列化数据
    $stmt = $pdo-&gt;prepare("SELECT {$columns[0]}, {$columns[1]}, {$columns[2]}, {$columns[3]} FROM {$table} WHERE {$columns[3]} LIKE 'a:%' OR {$columns[3]} LIKE 'O:%' OR {$columns[3]} LIKE 's:%' OR {$columns[3]} LIKE 'i:%' OR {$columns[3]} LIKE 'b:%' OR {$columns[3]} LIKE 'd:%'");
    $stmt-&gt;execute();
    $all_rows = $stmt-&gt;fetchAll();
    
    if (count($all_rows) &gt; 0) {
        echo "  找到 " . count($all_rows) . " 条序列化数据，检测中...\n";
        $update_stmt = $pdo-&gt;prepare("UPDATE {$table} SET {$columns[3]} = ? WHERE {$columns[0]} = ?");
        
        foreach ($all_rows as $row) {
            $result = detect_and_fix_broken_serialize($row[$columns[3]]);
            
            if ($result['fixed']) {
                $broken_count++;
                try {
                    $update_stmt-&gt;execute([$result['data'], $row[$columns[0]]]);
                    $fixed_count++;
                } catch (PDOException $e) {
                    $error_count++;
                }
            }
        }
    }
    
    // 也检查包含旧 URL 的记录
    $stmt = $pdo-&gt;prepare("SELECT {$columns[0]}, {$columns[1]}, {$columns[2]}, {$columns[3]} FROM {$table} WHERE {$columns[3]} LIKE ?");
    $stmt-&gt;execute(['%' . OLD_URL . '%']);
    $url_rows = $stmt-&gt;fetchAll();
    
    if (count($url_rows) &gt; 0) {
        echo "  找到 " . count($url_rows) . " 条包含旧 URL 的记录，正在修复...\n";
        $update_stmt = $pdo-&gt;prepare("UPDATE {$table} SET {$columns[3]} = ? WHERE {$columns[0]} = ?");
        
        foreach ($url_rows as $row) {
            $original = $row[$columns[3]];
            $fixed = fix_serialized_url($original, OLD_URL, NEW_URL);
            
            if ($fixed !== false &amp;&amp; $fixed !== $original) {
                try {
                    $update_stmt-&gt;execute([$fixed, $row[$columns[0]]]);
                    $fixed_count++;
                } catch (PDOException $e) {
                    $error_count++;
                }
            }
        }
    }
}

echo "\n[4/4] 查找可能导致错误的特定记录...\n";
echo "根据错误信息 'Error at offset 4351 of 4374 bytes'，查找长度接近的记录...\n";

// 查找长度在 4300-4400 字节之间的序列化数据
$stmt = $pdo-&gt;prepare("SELECT meta_id, post_id, meta_key, meta_value, LENGTH(meta_value) as value_length FROM " . DB_PREFIX . "postmeta WHERE (meta_value LIKE 'a:%' OR meta_value LIKE 'O:%' OR meta_value LIKE 's:%') AND LENGTH(meta_value) BETWEEN 4300 AND 4400 ORDER BY value_length");
$stmt-&gt;execute();
$suspicious = $stmt-&gt;fetchAll();

if (count($suspicious) &gt; 0) {
    echo "找到 " . count($suspicious) . " 条可疑记录（长度在 4300-4400 字节之间）\n";
    echo "这些记录可能是导致错误的原因：\n\n";
    
    $update_stmt = $pdo-&gt;prepare("UPDATE " . DB_PREFIX . "postmeta SET meta_value = ? WHERE meta_id = ?");
    
    foreach ($suspicious as $sus) {
        echo "  - meta_id={$sus['meta_id']}, post_id={$sus['post_id']}, meta_key={$sus['meta_key']}, length={$sus['value_length']}\n";
        
        // 直接尝试反序列化完整数据
        @error_clear_last();
        $test_data = @unserialize($sus['meta_value']);
        $test_error = error_get_last();
        
        // 检查是否有 unserialize 错误
        if ($test_error &amp;&amp; strpos($test_error['message'], 'unserialize') !== false) {
            echo "    ✗ 检测到损坏: {$test_error['message']}\n";
            echo "    正在修复...\n";
            
            // 尝试修复
            $fix_result = detect_and_fix_broken_serialize($sus['meta_value']);
            
            if ($fix_result['fixed']) {
                try {
                    $update_stmt-&gt;execute([$fix_result['data'], $sus['meta_id']]);
                    echo "    ✓ 已修复并更新数据库\n";
                    $fixed_count++;
                    $broken_count++;
                } catch (PDOException $e) {
                    echo "    ✗ 更新失败: " . $e-&gt;getMessage() . "\n";
                    $error_count++;
                }
            } else {
                // 如果自动修复失败，尝试手动修复字符串长度
                echo "    尝试手动修复字符串长度...\n";
                $manual_fixed = preg_replace_callback('/s:(\d+):"((?:[^"\\\\]|\\\\.)*)"/', function($m) {
                    $str = $m[2];
                    $len = strlen($str);
                    if ($len != $m[1]) {
                        return 's:' . $len . ':"' . $str . '"';
                    }
                    return $m[0];
                }, $sus['meta_value']);
                
                @error_clear_last();
                $manual_test = @unserialize($manual_fixed);
                $manual_error = error_get_last();
                
                if ($manual_test !== false &amp;&amp; ($manual_error === null || strpos($manual_error['message'], 'unserialize') === false)) {
                    try {
                        $update_stmt-&gt;execute([$manual_fixed, $sus['meta_id']]);
                        echo "    ✓ 手动修复成功并更新数据库\n";
                        $fixed_count++;
                        $broken_count++;
                    } catch (PDOException $e) {
                        echo "    ✗ 更新失败: " . $e-&gt;getMessage() . "\n";
                        $error_count++;
                    }
                } else {
                    echo "    ✗ 无法修复此记录\n";
                    echo "    建议：如果这个 meta_key 不重要，可以考虑删除\n";
                    echo "    DELETE FROM " . DB_PREFIX . "postmeta WHERE meta_id = {$sus['meta_id']};\n";
                    $error_count++;
                }
            }
        } else {
            echo "    ✓ 数据正常（未检测到错误）\n";
        }
        echo "\n";
    }
}

function table_exists($pdo, $table) {
    try {
        $stmt = $pdo-&gt;query("SHOW TABLES LIKE '{$table}'");
        return $stmt-&gt;rowCount() &gt; 0;
    } catch (PDOException $e) {
        return false;
    }
}

echo "\n==========================================\n";
echo "修复完成！\n";
echo "==========================================\n";
echo "成功修复: {$fixed_count} 条记录\n";
echo "发现损坏: {$broken_count} 条记录\n";
echo "修复失败: {$error_count} 条记录\n";
echo "\n";

if ($fixed_count &gt; 0) {
    echo "✓ 已修复 {$fixed_count} 条损坏的序列化数据\n";
    echo "\n建议：\n";
    echo "1. 清除 WordPress 缓存（对象缓存、页面缓存）\n";
    echo "2. 刷新后台页面，检查错误是否消失\n";
    echo "3. 如果仍有问题，请提供新的错误信息\n";
} else {
    echo "<img src="https://s.w.org/images/core/emoji/17.0.2/72x72/26a0.png" alt="⚠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> 未发现损坏的序列化数据\n";
    echo "\n可能的原因：\n";
    echo "1. 错误来自其他表或数据\n";
    echo "2. 错误是动态生成的（不是数据库中的数据）\n";
    echo "3. 需要查看完整的错误堆栈信息\n";
    echo "\n建议：\n";
    echo "1. 启用 WordPress 调试模式（wp-config.php 中设置 WP_DEBUG = true）\n";
    echo "2. 查看错误日志，找到具体的 meta_id 或 option_id\n";
    echo "3. 检查 wp-includes/functions.php:655 附近的代码\n";
}

echo "\n";
</pre>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://zhongxiaojie.cn/2026/01/73/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
