14 Commits

Author SHA1 Message Date
wpdev fa356a63b1 fix(bootstrap): 舊外掛互斥偵測改查 active_plugins
Anti-EAV Lint + Quality Gate / anti-eav-lint (push) Successful in 8s
Tests / Unit Tests (push) Successful in 10s
Tests / Integration Tests (push) Successful in 33s
Tests / PHP Lint (push) Successful in 8s
Tests / PHPCS (push) Successful in 20s
Tests / PHPStan (push) Successful in 22s
Release / Test Gate (lint + phpcs + phpstan + unit + integration) (push) Successful in 1m2s
Release / release (push) Successful in 11s
WPDO_VERSION 由 class-tmdo-back-compat.php 自行 define 為 TMDO_VERSION,
兩者永遠相等,admin notice 從未觸發;PHPStan L6 認出 notIdentical.alwaysFalse
並卡掉 main run #8 與 v1.0.0 tag 的 Test Gate。改查 active_plugins basename,
與 HP AddOn detector 的偵測方式一致。
2026-07-31 09:50:23 +08:00
wpdev fbe41e2130 release: v1.0.0 — 取代 wp-data-optimizer v3.4.6
Anti-EAV Lint + Quality Gate / anti-eav-lint (push) Successful in 9s
Tests / Unit Tests (push) Successful in 10s
Tests / Integration Tests (push) Successful in 33s
Tests / PHP Lint (push) Successful in 8s
Tests / PHPCS (push) Successful in 20s
Tests / PHPStan (push) Failing after 25s
Release / Test Gate (lint + phpcs + phpstan + unit + integration) (push) Failing after 36s
Release / release (push) Has been skipped
版本 0.1.0 → 1.0.0(含 TMDO_VERSION / TWO_MEET_DATA_OPTIMIZER_VERSION /
WP_DATA_OPTIMIZER_VERSION 與 unit bootstrap)。姊妹外掛只在診斷 CLI 顯示
WP_DATA_OPTIMIZER_VERSION、無版本比較,故報 1.0.0 安全。

wp-data-optimizer 退休:兩站台已停用,本機三個目錄改名為 *.retired
(wp-data-optimizer / -v3.1.1 / _audit),git 歷史保留在 gitea。

CHANGELOG 記錄本次 backport 全貌與 4 項 ABI/行為變更。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 09:45:22 +08:00
wpdev bc4fad3b86 fix(ci): packaging 步驟不可在每次 push 執行
Anti-EAV Lint + Quality Gate / anti-eav-lint (push) Successful in 10s
Tests / Unit Tests (push) Successful in 13s
Tests / Integration Tests (push) Successful in 35s
Tests / PHP Lint (push) Successful in 9s
Tests / PHPCS (push) Successful in 24s
Tests / PHPStan (push) Successful in 26s
package-plugin.sh 依 SLUG 解析到 wp-content/plugins 下的固定路徑,打包的是
線上工作副本而非 CI 的 checkout,且會在該目錄跑 composer install --no-dev
→ 每次 push 都會把開發機的 vendor/bin 清掉(本 session 中發生兩次)。

- anti-eav-lint.yml:移除 packaging 步驟,只保留 lint
- ci-package.sh:委派共用腳本後補跑 composer install 還原 dev 依賴

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 09:31:09 +08:00
wpdev c712bf6e0a ci: 觸發首次完整 CI(secret 設定後)
Anti-EAV Lint + Quality Gate / anti-eav-lint (push) Has been cancelled
Tests / Unit Tests (push) Successful in 9s
Tests / Integration Tests (push) Successful in 33s
Tests / PHP Lint (push) Successful in 9s
Tests / PHPCS (push) Successful in 21s
Tests / PHPStan (push) Successful in 24s
首次 push 早於 TMDO_TEST_DB_PASS secret 建立,integration job 的 DB
preflight 因此拿不到密碼。此空 commit 用於驗證 secret 生效後全綠。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 09:29:14 +08:00
wpdev 5e11c882aa docs(plan): 記錄 AddOn 測試基建與全家族測試現況
Anti-EAV Lint + Quality Gate / anti-eav-lint (push) Successful in 19s
Tests / Unit Tests (push) Successful in 12s
Tests / Integration Tests (push) Failing after 10s
Tests / PHP Lint (push) Successful in 11s
Tests / PHPCS (push) Successful in 23s
Tests / PHPStan (push) Failing after 11s
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 09:21:07 +08:00
wpdev c300d56aef docs(plan): 記錄打包後需重跑 composer install 的踩坑
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 09:13:14 +08:00
wpdev e246c9539e docs(plan): 更新 CI 與測試補齊進度
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 09:11:35 +08:00
wpdev 77b4501682 ci: 移植 gitea workflows + ci-package.sh(PR-I 後半)
.gitea/workflows/
- test.yml:unit / integration / lint / phpcs,外加 A 從未有過的 phpstan job。
  env 改 TMDO_TEST_DB_*(bootstrap 仍相容 WPDO_TEST_DB_*),host-mode runner
  直連本機 MariaDB,保留 A v3.4.6 的 DB preflight(區分 INFRA 失敗與測試失敗)
- anti-eav-lint.yml:TMDO_HOST 指向 dev30、改用 wp tmdo lint、slug 換成
  2meet-data-optimizer
- release.yml:v* tag 觸發,test-gate 加跑 phpstan

scripts/ci-package.sh
  依專案規範委派給共用的 scripts/package-plugin.sh(10 項終檢、統一排除清單、
  輸出 wp-local-dev/dist/),而不是自帶一份排除邏輯;找不到共用腳本時才走
  最小 fallback 並明確警告該路徑跳過終檢。

實測:bash scripts/ci-package.sh → 10 項終檢全 PASS
(552 KB / 185 entries、schema drift 34 CREATE vs 34 DROP 對齊)

註:B 目前沒有 git remote,workflow 檔案就緒但要推上 gitea 才會實際執行。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 09:11:04 +08:00
wpdev cd03d66151 test: 補 HookBus 與 audit 寫入的 integration 回歸網(PR-I)
HookBusIntegrationTest(14 tests,自 A 移植)
  integration bootstrap 原本只載入 hook-bus-bridge、沒載入 hook-bus 本體,
  所以連 WPDO_Hook_Bus alias 都建不出來 — 一併補 auto-promoter 與 hook-bus。

AuditLoggerIntegrationTest(4 tests,新寫)
  直接鎖住上一個 commit 修掉的 fatal:
  - after_write 必須寫出一列 audit(覆蓋 Logger::trace_id() 缺失)
  - group_name / action 兩欄必須有值(SCHEMA_VERSION 2.1.0 新增)
  - trace_id 必須是 UUIDv4 且同一 request 內共用
  - 未註冊的 key 不得寫入
  tearDownAfterClass 卸掉 listener 而非 drop 表,否則後續測試類的受管寫入
  會打到不存在的表;integration bootstrap 連帶補 remove_action() stub。

註:TermCommentBackfillTest 未移植 — 它 require HP AddOn 的
class-*-hivepress-term-comment-fields.php,屬 HP AddOn 測試套件而非核心。

unit 451 / integration 416 GREEN、PHPCS 0/0

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 08:55:12 +08:00
wpdev d8e7a7190a docs(plan): 記錄 dev30 實機驗證結果
A 33 OK + 15 WC MISSING → B 49 OK / All checks passed。
alias / CLI 雙命名空間 / anti-EAV 寫入 / audit 欄位 / REST allowlist
逐項實測通過;brandcards 的 doctor_callback 在新 ABI 下仍正常。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 08:30:52 +08:00
wpdev ae99820bbc fix(logger): 補回 TMDO_Logger::trace_id()(實機驗證抓到的 fatal)
TMDO_Audit_Logger::write_row() 第 160 行呼叫 TMDO_Logger::trace_id(),
但 B 提煉時漏掉了這個方法(A 有,class-wpdo-logger.php:35-47)。
先前 Audit_Logger::init() 從未被註冊,所以這個 fatal 一直藏著;
A12 把它掛上之後,任何一次受管 meta 寫入都會炸。

PHPUnit 沒有覆蓋 audit 寫入路徑,是在 dev30 實機跑
WPDO_API::set_entity() 時才暴露的。

trace_id() 產生 request-scoped UUIDv4,讓同一次請求寫出的所有 audit
row 共用同一個關聯 id。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 08:29:08 +08:00
wpdev 5385d72346 docs(plan): 標記階段 5-7 進度、列出 follow-up 與 ABI 變更
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 06:22:36 +08:00
wpdev f524ea3f16 build: 移植 PHPCS + PHPStan L6 品質 gate(PR-I 前半)
- phpcs.xml(自 A 移植):ruleset 改名、*/tools/* 例外換成 */back-compat/*、
  中文註解全域排除 Squiz.Commenting.InlineComment.InvalidEndChar、
  interface 別名檔排除 OneObjectStructurePerFile
- 檔頭正規化:16 個檔案的 declare(strict_types=1) 與前導 // 註解移到
  file docblock 之後,並移除 <?php 後多餘空行(phpcbf 另自動修 190 處)
- phpstan.neon + .phpstan/stubs.php(TMDO_ 與 WPDO_ 兩套常數)+
  重新產生的 phpstan-baseline.neon(710 errors,A 的 3877 行 baseline
  因前綴與路徑不同無法沿用)

現況:PHPCS 0 errors / 0 warnings、PHPStan L6 No errors、
unit 451 / integration 398 GREEN

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 06:22:00 +08:00
wpdev 76c01e44df refactor: 全部 128 個生產檔加入 declare(strict_types=1)(PR-H)
對齊 A v3.2.0。型別強制會把隱式轉換變成 TypeError,所以一次全檔加入
並跑完整測試(unit 451 / integration 398 全綠,無迴歸)。

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
2026-07-31 06:13:33 +08:00
143 changed files with 5615 additions and 318 deletions
+61
View File
@@ -0,0 +1,61 @@
name: Anti-EAV Lint + Quality Gate
on:
push:
branches: [main, master, develop]
pull_request:
branches: [main, master]
concurrency:
group: ${{ gitea.workflow }}-${{ gitea.ref }}
cancel-in-progress: true
jobs:
anti-eav-lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Composer install (no-dev)
run: |
if [ -f composer.json ]; then
composer install --no-dev --optimize-autoloader --no-interaction
fi
- name: PHP syntax lint
run: |
set -e
FAILED=$(find . -name '*.php' \
-not -path './vendor/*' \
-not -path './node_modules/*' \
-not -path './e2e/*' \
-not -path './tests/*' \
-exec php -l {} \; 2>&1 | grep -v 'No syntax errors' || true)
if [ -n "$FAILED" ]; then
echo "PHP syntax errors detected:"
echo "$FAILED"
exit 1
fi
- name: Anti-EAV strict lint
run: |
if ! command -v wp >/dev/null 2>&1; then
echo "wp-cli not available; skipping anti-eav lint"
exit 0
fi
# dev30 hosts the plugin family this repo belongs to.
TMDO_HOST="/var/www/Studio/wp-local-dev30"
if [ -d "$TMDO_HOST" ]; then
wp --path="$TMDO_HOST" tmdo lint --plugin="${GITHUB_WORKSPACE}" --strict
else
echo "TMDO_HOST not found; skipping anti-eav lint"
fi
# NOTE: no packaging audit here on purpose.
# The shared package-plugin.sh resolves the plugin by SLUG to a fixed path
# under wp-content/plugins — it does NOT package the CI checkout. Running it
# from a job therefore rebuilds (and `composer install --no-dev`s) the live
# working copy, wiping the developer's vendor/bin. Packaging belongs to the
# release workflow / a manual run, not to every push.
+87
View File
@@ -0,0 +1,87 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
test-gate:
name: Test Gate (lint + phpcs + phpstan + unit + integration)
runs-on: ubuntu-latest
# Host-mode runner: no service containers. Uses the host MariaDB, same as
# the Tests workflow.
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: PHP Lint
run: |
find . -name "*.php" \
! -path "./vendor/*" \
! -path "./tests/*" \
-print0 | xargs -0 -n1 php -l
echo "PHP syntax OK"
- name: PHPCS
run: vendor/bin/phpcs --standard=phpcs.xml --report=checkstyle -q .
- name: PHPStan
run: vendor/bin/phpstan analyse --no-progress --error-format=github
- name: Unit Tests
run: php vendor/bin/phpunit --configuration phpunit.xml --testdox
- name: Integration Tests
env:
TMDO_TEST_DB_HOST: 127.0.0.1
TMDO_TEST_DB_USER: dbo
TMDO_TEST_DB_PASS: ${{ secrets.TMDO_TEST_DB_PASS }}
TMDO_TEST_DB_NAME: wp_wpdo_test
run: php vendor/bin/phpunit --configuration phpunit-integration.xml --testdox
release:
needs: [test-gate]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build ZIP
run: bash scripts/ci-package.sh
- name: Create Gitea Release
env:
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GITEA_URL: ${{ vars.RELEASE_GITEA_URL }}
run: |
set -euo pipefail
VERSION="${{ gitea.ref_name }}"
ZIP=$(ls dist/*.zip | head -1)
ZIP_NAME=$(basename "$ZIP")
MD5=$(md5sum "$ZIP" | awk '{print $1}')
# Create the release
RELEASE_ID=$(curl -s -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
"${GITEA_URL}/api/v1/repos/${{ gitea.repository }}/releases" \
-d "{
\"tag_name\": \"${VERSION}\",
\"name\": \"${VERSION}\",
\"body\": \"MD5: \`${MD5}\`\",
\"draft\": false,
\"prerelease\": false
}" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*')
# Upload ZIP asset
curl -s -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/zip" \
"${GITEA_URL}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets?name=${ZIP_NAME}" \
--data-binary "@${ZIP}"
echo "Released ${VERSION} — asset: ${ZIP_NAME} (MD5: ${MD5})"
+111
View File
@@ -0,0 +1,111 @@
name: Tests
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
jobs:
unit:
name: Unit Tests
runs-on: ubuntu-latest
# Host-mode gitea runner (label `ubuntu-latest:host`) uses the host PHP
# toolchain (currently 8.3). `shivammathur/setup-php` cannot provision
# alternate PHP versions in host mode, so there is no 8.1/8.2/8.3 matrix.
# (Restore one if the runner ever moves to container mode.)
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run unit tests
run: php vendor/bin/phpunit --configuration phpunit.xml --testdox
integration:
name: Integration Tests
runs-on: ubuntu-latest
# Host-mode runner: service containers are NOT started, so connect to the
# host MariaDB at 127.0.0.1:3306 directly. The password comes from the repo
# secret TMDO_TEST_DB_PASS (test DB `wp_wpdo_test` and user `dbo` already
# exist on the host). The bootstrap also accepts the legacy WPDO_TEST_DB_*
# names, so an existing secret of either name works.
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
# Preflight: a DB outage or a rotated secret would otherwise surface as an
# opaque PHPUnit bootstrap error. Fail fast with an INFRA-vs-test
# distinction so a red integration job is diagnosable.
- name: DB preflight (host MariaDB reachable?)
env:
TMDO_TEST_DB_HOST: 127.0.0.1
TMDO_TEST_DB_USER: dbo
TMDO_TEST_DB_PASS: ${{ secrets.TMDO_TEST_DB_PASS }}
TMDO_TEST_DB_NAME: wp_wpdo_test
run: |
php -r '
mysqli_report(MYSQLI_REPORT_OFF);
$c = @mysqli_connect(getenv("TMDO_TEST_DB_HOST"), getenv("TMDO_TEST_DB_USER"), getenv("TMDO_TEST_DB_PASS"), getenv("TMDO_TEST_DB_NAME"), 3306);
if (!$c) {
fwrite(STDERR, "::error::Integration DB unreachable at " . getenv("TMDO_TEST_DB_HOST") . ":3306 db=" . getenv("TMDO_TEST_DB_NAME") . " user=" . getenv("TMDO_TEST_DB_USER") . " — host MariaDB down or TMDO_TEST_DB_PASS secret stale/rotated. This is an INFRA failure, not a test failure: " . mysqli_connect_error() . "\n");
exit(1);
}
echo "DB preflight OK: connected to " . getenv("TMDO_TEST_DB_NAME") . " on " . getenv("TMDO_TEST_DB_HOST") . "\n";
'
- name: Run integration tests
env:
TMDO_TEST_DB_HOST: 127.0.0.1
TMDO_TEST_DB_USER: dbo
TMDO_TEST_DB_PASS: ${{ secrets.TMDO_TEST_DB_PASS }}
TMDO_TEST_DB_NAME: wp_wpdo_test
run: php vendor/bin/phpunit --configuration phpunit-integration.xml --testdox
lint:
name: PHP Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check PHP syntax
run: |
find . -name "*.php" \
! -path "./vendor/*" \
! -path "./tests/*" \
-print0 | xargs -0 -n1 php -l
echo "PHP syntax OK"
phpcs:
name: PHPCS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run PHPCS
run: vendor/bin/phpcs --standard=phpcs.xml --report=checkstyle -q .
phpstan:
name: PHPStan
runs-on: ubuntu-latest
# A never ran static analysis in CI; the baseline is committed, so new code
# is checked at level 6 while existing debt stays silent.
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run PHPStan (level 6, baselined)
run: vendor/bin/phpstan analyse --no-progress --error-format=github
+1
View File
@@ -14,3 +14,4 @@ Thumbs.db
.playwright-mcp/
.claude/
dist/
.phpcs-cache
+34
View File
@@ -0,0 +1,34 @@
<?php
/**
* PHPStan bootstrap stubs — plugin constants defined at runtime.
*
* PHPStan cannot see define()'d constants, so it reports "undefined constant"
* for every one of them. Stubbing them here keeps level 6 signal-to-noise high.
*
* TMDO_IS_SQLITE / TMDO_IS_MYSQL (and their WPDO_ aliases) are intentionally
* NOT stubbed to avoid literal-narrowing "always true/false" false positives
* on runtime-dynamic values.
*
* @package TMDO
*/
declare(strict_types=1);
define( 'TMDO_VERSION', '0.0.0' );
define( 'TMDO_DB_VERSION', '0.0.0' );
define( 'TMDO_PATH', '/' );
define( 'TMDO_URL', 'https://example.test/wp-content/plugins/2meet-data-optimizer/' );
define( 'TMDO_FILE', '/2meet-data-optimizer.php' );
define( 'TMDO_TABLE_PREFIX', 'wpdo_' );
define( 'TMDO_CACHE_GROUP', 'wpdo' );
define( 'TMDO_MIN_PHP', '8.1' );
define( 'TMDO_MIN_WP', '6.0' );
// Back-compat aliases exposed by class-tmdo-back-compat.php.
define( 'WPDO_VERSION', '0.0.0' );
define( 'WPDO_DB_VERSION', '0.0.0' );
define( 'WPDO_PLUGIN_DIR', '/' );
define( 'WPDO_PLUGIN_URL', 'https://example.test/wp-content/plugins/2meet-data-optimizer/' );
define( 'WPDO_PLUGIN_FILE', '/2meet-data-optimizer.php' );
define( 'WPDO_TABLE_PREFIX', 'wpdo_' );
define( 'WPDO_CACHE_GROUP', 'wpdo' );
+11 -5
View File
@@ -3,7 +3,7 @@
* Plugin Name: 2meet Data Optimizer
* Plugin URI: https://2meet.io/2meet-data-optimizer
* Description: 通用 WordPress 反 EAV 引擎:將 postmeta / usermeta / termmeta / commentmeta 自動分流至四象限扁平表(Hot / Warm / Cold / Archive),大幅提升搜尋與篩選效能。從 wp-data-optimizer v2.16.0 提煉的純核心,整合層交給 11 個 AddOn。
* Version: 0.1.0
* Version: 1.0.0
* Requires at least: 6.0
* Tested up to: 6.9.4
* Requires PHP: 8.1
@@ -19,12 +19,14 @@
* @package TMDO
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// ── Constants ──────────────────────────────────────────────────────────────
define( 'TMDO_VERSION', '0.1.0' );
define( 'TMDO_VERSION', '1.0.0' );
define( 'TMDO_DB_VERSION', '2.1.0' );
define( 'TMDO_PATH', plugin_dir_path( __FILE__ ) );
define( 'TMDO_URL', plugin_dir_url( __FILE__ ) );
@@ -50,12 +52,12 @@ define(
define( 'TMDO_IS_MYSQL', ! TMDO_IS_SQLITE );
// ── 跨外掛偵測訊號(dual-fire 對外保留 wp-data-optimizer 訊號)────────────
const TWO_MEET_DATA_OPTIMIZER_VERSION = '0.1.0';
const TWO_MEET_DATA_OPTIMIZER_VERSION = '1.0.0';
const TWO_MEET_DATA_OPTIMIZER_FILE = __FILE__;
const TWO_MEET_DATA_OPTIMIZER_DB_VERSION = '1.2.0';
// 向後相容:對外 sister plugins 仍以 WP_DATA_OPTIMIZER_VERSION 偵測。
if ( ! defined( 'WP_DATA_OPTIMIZER_VERSION' ) ) {
define( 'WP_DATA_OPTIMIZER_VERSION', '0.1.0' );
define( 'WP_DATA_OPTIMIZER_VERSION', '1.0.0' );
}
if ( ! defined( 'WP_DATA_OPTIMIZER_FILE' ) ) {
define( 'WP_DATA_OPTIMIZER_FILE', __FILE__ );
@@ -86,7 +88,11 @@ if ( version_compare( PHP_VERSION, TMDO_MIN_PHP, '<' ) ) {
add_action(
'admin_notices',
static function () {
if ( defined( 'WPDO_VERSION' ) && WPDO_VERSION !== TMDO_VERSION ) {
// Deliberately not a WPDO_VERSION comparison: this plugin defines that
// constant itself (includes/class-tmdo-back-compat.php), so the two
// would always match and the notice could never fire.
$tmdo_legacy = 'wp-data-optimizer/wp-data-optimizer.php';
if ( in_array( $tmdo_legacy, (array) get_option( 'active_plugins', array() ), true ) ) {
echo '<div class="notice notice-error"><p>';
esc_html_e( '⚠ 偵測到舊版 wp-data-optimizer 已啟用。請停用舊外掛以避免 hook 雙觸發。', '2meet-data-optimizer' );
echo '</p></div>';
+59
View File
@@ -7,6 +7,65 @@ Versioning follows [Semantic Versioning](https://semver.org/).
---
## [1.0.0] — 2026-07-31 — 取代 wp-data-optimizer v3.4.6
本版把 `wp-data-optimizer` v3.0.1v3.4.692 個 commit)全數 backport 進來,
`wp-data-optimizer` 自此退休:兩個站台皆已停用它,本機目錄改名為
`wp-data-optimizer.retired`,其 git 歷史保留在 gitea。
### 🔒 Security / 正確性
- **7 處 `Logger::error()` 參數不足**array 傳給 string `$hook`)修正 —— 4 個 stress
tester、auto-promoter、conflict-detector、hook-bus,皆為 TypeError fatal
- **`Logger::trace_id()` 補回**`Audit_Logger::write_row()` 一直呼叫它,但提煉時漏了;
`Audit_Logger::init()` 從未註冊所以隱藏至今 —— 實機驗證才暴露
- REST 4 個公開端點加上 `show_in_rest` 欄位 allowlistCVSS 5.3
- 13 個破壞性 admin 動作由 GET 改 POST + nonce
- DDL 型別白名單(19 型別)、CLI 表名守衛
- 整欄清空改 `wpdo_allow_mass_column_clear` opt-in(原本 >500 列才擋)
- audit 表補 `group_name` / `action` 欄並註冊 `Audit_Logger::init()`
- `known_login_ips` 註冊(spoke-sso 實際寫入的欄位,先前落 `wp_usermeta`
### ⚡ 並發
- warm 表 `UNIQUE KEY ui_post_meta`(缺它 `ON DUPLICATE KEY UPDATE` 不生效)
- Zone_Cold 改 `JSON_MERGE_PATCH` / `JSON_REMOVE`、Zone_Warm 原子 `increment()`
hook-bus `write_to_flat` 改 upsert
### 🏗 架構
- 回填 `TMDO_Zone_Router` + `TMDO_Routing_Predicate`Sync_Bridge 400→269 行)
- 回填 Migration Phase Strategyinterface + base + 11 個 phase 類別,
orchestrator 1107→640 行,公開介面不變
- 核心新增 `TMDO_Standard_Post_Interceptor`HP AddOn 4 個 interceptor 573→344 行
### 🔌 相容性
- hook 橋改**雙向**:核心一律 `do_action('wpdo_*')`,原本單向轉發使所有
`tmdo_*` 契約收不到事件
- 57 個 AddOn 類別補 `WPDO_*` alias(核心 alias 表在 `plugins_loaded:4` 執行,
涵蓋不到 `:6` 才載入的 AddOn
- 38 個 CLI 子指令補 `wp tmdo` 命名空間
- 選單 slug 統一回 `wp-data-optimizer`(B 內部 10+ 處連結本來就指向它)
- HP adapter 介面改為 `TMDO_ extends WPDO_`,讓 `instanceof WPDO_HivePress_Adapter` 成立
### ✅ 品質
- 128 個生產檔 `declare(strict_types=1)`
- PHPCS 0 errors / PHPStan level 6baseline 710
- 測試:核心 unit 451 / integration 416、hivepress-addon 145、woocommerce-addon 10
- gitea CI:核心 6 個 job 全綠 + 11 個 AddOn workflow + branch protection
### ⚠️ ABI / 行為變更
- `doctor_callback` 由 3 參數改為 1 參數(表名)
- `wpdo_capture_before_value` 預設 `true``false`;需要 `value_before`
消費者(audit log)要 `add_filter( 'wpdo_capture_before_value', '__return_true' )`
- `wpdo_allow_mass_column_clear` 現為 opt-in,整欄清空預設被拒
- `SCHEMA_VERSION` 2.0.0 → 2.1.0audit 表 ALTER
---
## [0.1.0] — 2026-05-15 (initial release, Phase 0-5 完成)
### Phase 5 hotfix(同日完成)
+54 -4
View File
@@ -207,10 +207,59 @@
| 2 | DDL 與並發 B1B4warm UNIQUE KEY → Zone_Cold save_patch → Zone_Warm increment | ✅ 2026-07-31 |
| 3 | 架構回填(Zone_Router + Routing_Predicate13 個 Migration Phase 類別) | ✅ 2026-07-31 |
| 4 | 相容層 E1E7(雙向 hook 橋、57 個 AddOn alias、38 個 CLI 子指令、選單 slug | ✅ 2026-07-31 |
| 5 | AddOn 同步 F1F5Standard_Post_Interceptor、HP detector v3.4.5、WC | |
| 6 | 功能與診斷 PR-Gcrypto 健檢、doctor_callback ABI、15 個 usermeta 欄位…) | |
| 7 | 全域清理與 CIstrict_types、phpcs.xml、phpstan + baseline、gitea workflows | |
| 退休 | 兩站台切到 B、移除 A、B 升 1.0.0 | |
| 5 | AddOn 同步 F1F5Standard_Post_Interceptor、HP detector v3.4.5、WC | ✅ 2026-07-31 |
| 6 | 功能與診斷 PR-Gcrypto 健檢、doctor_callback ABI、15 個 usermeta 欄位…) | ✅ 2026-07-31**Settings 分區 AJAX 未做**,見下) |
| 7 | 全域清理與 CIstrict_types、phpcs.xml、phpstan + baseline、gitea workflows | 🔶 strict_types / PHPCS / PHPStan / 3 個 workflow / ci-package.sh ✅;**測試補齊(剩 36 檔,多為 HP/WC)、文件移植未做** |
| 退休 | 兩站台切到 B、移除 A、B 升 1.0.0 | 🔶 dev30 已切換並驗證通過;dev 未切、A 未移除、版本未升 |
### dev30 實機驗證結果(2026-07-31
環境:`2meet-brandcards` 1.8.3 / `2meet-hub-core` 1.16.0 / `2meet-spoke-sso` 1.15.0 同時啟用;HivePress / WooCommerce 未安裝,故只啟用核心 + hub-addon + spoke-addon。
| 項目 | A v3.0.0(切換前) | B v0.1.0(切換後) |
|---|---|---|
| `doctor` | 33 個 `[OK]` + 15 個 WC 表 MISSING 警告 | **49 個 `[OK]`、All checks passed** |
| 姊妹外掛自訂表 | 36 張 OK | 36 張 OK(含 brandcards 的 `doctor_callback` 回傳訊息) |
| 新健檢 | 無 | `Backup dir blocked (HTTP 404)``Crypto key derivable` 皆 OK |
逐項確認:
- **alias**15 個核心類別 + trait + interface + `wpdo_run()` + `WPDO_VERSION` 全部可用
- **CLI**`wp tmdo bridge-status / crypto-status / mode-audit``wp wpdo *` 兩條路徑都通(38 個子指令)
- **anti-EAV 寫入**`WPDO_API::set_entity()``wp_wpdo_user_sso.known_login_ips` 寫入成功(A14 生效)
- **audit**`wp_wpdo_audit``group_name` / `action` / `trace_id`UUIDv4)皆有值(A11/A12 生效)
- **REST allowlist**:註冊 `show_in_rest => false` 的欄位不出現在 `get_rest_visible_hot_columns()`A5/A6 生效)
- **doctor_callback ABI 變更**brandcards 既有 callback 在 1 參數簽章下仍正常
- 前台 HTTP 200`_load_textdomain_just_in_time` notice 僅出現在 `wp plugin activate` 當下(啟用鉤子早於 `init`),一般請求與前台皆無
**實機才抓到的 fatal**`TMDO_Logger::trace_id()` 在 B 提煉時遺漏,而 `Audit_Logger::write_row()` 會呼叫它。A12 把 Audit_Logger 掛上後,任何一次受管 meta 寫入都會 fatal。PHPUnit 沒有覆蓋 audit 寫入路徑 → 這類「跨模組才會踩到」的缺口只有實機能發現。
### 尚未完成(follow-up
1. **Settings 分區 AJAX 儲存**A v3.0.2):`ajax_save_settings_section()` + 7 個 `save_section_*()` + `admin/assets/wpdo-settings.js`。B 目前是一次存全部的 inline `update_option` 巨塊,功能可用,屬 UX 改善。其中 `save_section_hp_transient` / `save_section_wc_term_count` 對應 AddOn 已移除的設定,移植時要拆掉或加 `class_exists` 守衛。
2. ~~CI workflow~~ ✅ 三個檔已建,但 **B 沒有 git remote**,要推上 gitea 才會實際執行;推上去後還需設 repo secret `TMDO_TEST_DB_PASS`、var `RELEASE_GITEA_URL`、secret `RELEASE_TOKEN`,並開 main branch protection。11 個 AddOn 的 CI 仍未建。
3. ~~`scripts/ci-package.sh`~~ ✅(委派共用 `package-plugin.sh`,實測 10 項終檢全 PASS
4. ~~補測試檔~~ ✅ 核心補 `HookBusIntegrationTest`14+ 新寫 `AuditLoggerIntegrationTest`4);HP AddOn 建 phpunit 基建並移植 25 檔(145 tests);WC AddOn 建基建並移植 1 檔(10 tests)。11 個 AddOn 皆有 CI workflowHP/WC 跑 lint+unit,其餘 9 個薄註冊層只跑 lint)。
- 仍缺:`TermCommentBackfillTest`require HP AddOn 的 term-comment-fields,可移入 HP AddOn 套件)、`ListingStatsTest`(同上)、HP/WC 的 integration 測試(`HivepressIntegrationTest` ×3、`WCTermCountFilterTest``ListingMetaInterceptorTest`)——這些需要 AddOn 端的 integration bootstrap。
### 全家族測試現況(2026-07-31
| 套件 | 結果 |
|---|---|
| 核心 unit | 451 tests / 889 assertions |
| 核心 integration | 416 tests / 1165 assertions |
| hivepress-addon unit | 145 tests / 357 assertions |
| woocommerce-addon unit | 10 tests / 33 assertions |
AddOn 測試 bootstrap 直接 `require` 核心 plugin 的 `tests/bootstrap.php`(避免複製 ~700 行 WP stub),因此 **AddOn 的 CI job 必須同時 checkout 核心 plugin**workflow 已如此設定。
5. **文件移植**`readme.txt``CONTEXT.md``docs/`ENTITY_ADAPTER_COOKBOOK、INTEGRATION_PATTERN_DECISION、2 篇 ADR)。
6. **實機驗證與退休切換**:兩站台目前仍跑 Adev = v3.4.6、dev30 = v3.0.0),B 家族 12 個外掛全 inactive,尚未做過 `wp tmdo doctor` 實機驗證。
### ABI / 行為變更(升級須知)
- `doctor_callback` 由 3 參數改為 1 參數(表名)——AddOn 若註冊過該 callback 需同步。
- `wpdo_capture_before_value` 預設 `true``false`,每次受管寫入省一次 DB read;需要 `value_before` 的消費者(audit log)要 `add_filter( 'wpdo_capture_before_value', '__return_true' )`
- `wpdo_allow_mass_column_clear` 現為 opt-in`delete_all=true` 的整欄清空預設被拒。
- 選單 slug 由 `2meet-data-optimizer` 改回 `wp-data-optimizer`
### Lessons learnedbackport
@@ -218,6 +267,7 @@
- `composer update` 後 autoload 出現 `WPDO_Entity_Adapter_Interface` 三重宣告警告(`includes/adapters/interface-entity-adapter.php``back-compat/interface-wpdo-entity-adapter-alias.php``back-compat/trait-wpdo-anti-eav-aware-alias.php`)→ 階段 4 E2 要刪掉重複的那一份。
- `TMDO_FSM_GUARD_DISABLED` 兩個 test bootstrap 原本都沒 define,但 `class-tmdo-feature-flags.php:128` 會檢查它 → 強制 FSM 轉換的測試會被 guard 擋掉(A 在 v3.4.6 踩過同一個坑)。
- integration 測試需要 `TMDO_TEST_DB_PASS`(或 `WPDO_TEST_DB_PASS`)環境變數,DB 為本機 `wp_wpdo_test`
- **跑完 `scripts/ci-package.sh``package-plugin.sh` 後要重跑 `composer install`**:打包流程內含 `composer install --no-dev`,會把 `vendor/bin/{phpunit,phpcs,phpstan}` 移掉,之後任何測試指令都會 "No such file or directory"。
- **A 不是照抄對象,有兩處自身缺陷不可照搬**:
1. `A/includes/engine/class-wpdo-hook-bus.php:511,522` 傳 3 個 string 給 `Logger::warning( string $event, array $context )` → A 有 `strict_types`mass-clear 路徑必炸。B 用正確簽章。
2. `A/admin/class-wpdo-dashboard-widget.php:191``wpdo_postmeta_cleanup` 仍是 `wp_nonce_url` GET 連結,但其 handler 已只收 POST → 該按鈕在 A 是壞的。B 改成 form。
+4 -1
View File
@@ -1,11 +1,14 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform admin UI: native meta queries for management dashboard
/**
* WP Data Optimizer admin UI class.
*
* @package WP_Data_Optimizer
*/
// phpcs:ignore WPDO.AntiEAV -- platform admin UI: native meta queries for management dashboard
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+4 -1
View File
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform admin UI: native postmeta count for dashboard widget
/**
* TMDO_Dashboard_Widget — wp-admin home dashboard widget (v2.4.0 M9).
*
@@ -15,6 +14,10 @@
* @package WP_Data_Optimizer
*/
// phpcs:ignore WPDO.AntiEAV -- platform admin UI: native postmeta count for dashboard widget
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -15,6 +15,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -14,6 +14,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+4 -1
View File
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform admin UI: postmeta inventory for setup wizard
/**
* TMDO_Setup_Wizard — First-run onboarding wizard (v2.3.0 M5).
*
@@ -20,6 +19,10 @@
* @package WP_Data_Optimizer
*/
// phpcs:ignore WPDO.AntiEAV -- platform admin UI: postmeta inventory for setup wizard
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+4 -1
View File
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform admin UI: stress test SQL example display
/**
* Comment Stress Test template (v2.13.1).
*
@@ -16,6 +15,10 @@
* @package WP_Data_Optimizer
*/
// phpcs:ignore WPDO.AntiEAV -- platform admin UI: stress test SQL example display
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -10,6 +10,8 @@
* @since 2.8.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -13,6 +13,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -16,6 +16,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+4 -1
View File
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform admin UI: stress test SQL example display
/**
* Term Stress Test template (v2.13.0).
*
@@ -16,6 +15,10 @@
* @package WP_Data_Optimizer
*/
// phpcs:ignore WPDO.AntiEAV -- platform admin UI: stress test SQL example display
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+4 -1
View File
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform CLI inspector tool: raw meta queries needed for diagnostics
/**
* TMDO_CLI_Member — Member flat-table CLI subcommands.
*
@@ -17,6 +16,10 @@
* @since 2.5.5
*/
// phpcs:ignore WPDO.AntiEAV -- platform CLI inspector tool: raw meta queries needed for diagnostics
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+4 -1
View File
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform CLI inspector tool: raw meta queries needed for diagnostics
/**
* TMDO_CLI_Post — Post entity CLI subcommands (v2.9.0+).
*
@@ -16,6 +15,10 @@
* @since 2.9.0
*/
// phpcs:ignore WPDO.AntiEAV -- platform CLI inspector tool: raw meta queries needed for diagnostics
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+4 -1
View File
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform CLI inspector tool: raw meta queries needed for diagnostics
/**
* TMDO_CLI_Term_Comment — Term + Comment entity CLI subcommands (v2.12.0+).
*
@@ -19,6 +18,10 @@
* @since 2.12.0
*/
// phpcs:ignore WPDO.AntiEAV -- platform CLI inspector tool: raw meta queries needed for diagnostics
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -19,6 +19,8 @@
* @since 2.0.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -8,6 +8,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
+4 -1
View File
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform diagnostic: raw meta inspection for FSM state advisor
/**
* TMDO_FSM_Advisor — Recommends the next FSM state per module (v2.4.0 M12).
*
@@ -22,6 +21,10 @@
* @package WP_Data_Optimizer
*/
// phpcs:ignore WPDO.AntiEAV -- platform diagnostic: raw meta inspection for FSM state advisor
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -20,6 +20,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -18,6 +18,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -17,6 +17,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -14,6 +14,8 @@
* @since 0.1.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -14,6 +14,8 @@
* @since 0.1.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -19,6 +19,8 @@
* @since 2.0.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -9,6 +9,8 @@
* @package TMDO
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -20,6 +20,8 @@
* @since 2.14.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform stress tester: intentional raw meta SQL for baseline comparison
/**
* TMDO_Comment_Stress_Tester — Async stress fixture generator for comment entity (v2.13.1).
*
@@ -21,6 +20,10 @@
* @since 2.13.1
*/
// phpcs:ignore WPDO.AntiEAV -- platform stress tester: intentional raw meta SQL for baseline comparison
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -20,6 +20,8 @@
* @since 2.12.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -18,6 +18,8 @@
* @since 2.0.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -28,6 +28,8 @@
* @since 2.15.0 (v2 GCM, AEAD authentication)
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -15,6 +15,8 @@
* @since 2.0.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -19,6 +19,8 @@
* @since 2.0.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+31
View File
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -14,6 +16,35 @@ if ( ! defined( 'ABSPATH' ) ) {
*/
class TMDO_Logger {
/**
* Request-scoped correlation id, lazily generated.
*
* @var string|null
*/
private static ?string $trace_id = null;
/**
* Request-scoped UUIDv4 correlation id.
*
* Every audit row written during one request shares this value so a single
* update_*_meta() call can be traced across entity groups.
*
* @return string UUIDv4.
*/
public static function trace_id(): string {
if ( null === self::$trace_id ) {
try {
$bytes = random_bytes( 16 );
} catch ( \Throwable $e ) {
$bytes = pack( 'H*', md5( (string) microtime( true ) . wp_generate_password( 16, false ) ) );
}
$bytes[6] = chr( ( ord( $bytes[6] ) & 0x0f ) | 0x40 );
$bytes[8] = chr( ( ord( $bytes[8] ) & 0x3f ) | 0x80 );
self::$trace_id = vsprintf( '%s%s-%s-%s-%s-%s%s%s', str_split( bin2hex( $bytes ), 4 ) );
}
return self::$trace_id;
}
/**
* Log an INFO-level event (event-based signature, used by v2.0.0 engine code).
*
+4 -1
View File
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform shadow verifier: must read raw meta to verify zone correctness
/**
* TMDO_Post_Shadow_Verifier — Sample-and-compare flat vs wp_postmeta (v2.10.3).
*
@@ -22,6 +21,10 @@
* @since 2.10.3
*/
// phpcs:ignore WPDO.AntiEAV -- platform shadow verifier: must read raw meta to verify zone correctness
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+4 -1
View File
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform stress tester: intentional raw meta SQL for baseline comparison
/**
* TMDO_Post_Stress_Tester — Bulk fixture generator for post entity migration (v2.9.4).
*
@@ -26,6 +25,10 @@
* @since 2.9.4
*/
// phpcs:ignore WPDO.AntiEAV -- platform stress tester: intentional raw meta SQL for baseline comparison
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -19,6 +19,8 @@
* @since 2.9.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -15,6 +15,8 @@
* @since 0.2.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -19,6 +19,8 @@
* @since 2.13.3
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -46,6 +46,8 @@
* @since 2.12.6
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -22,6 +22,8 @@
* @since 2.12.5
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+4 -1
View File
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform stress tester: intentional raw meta SQL for baseline comparison
/**
* TMDO_Term_Stress_Tester — Async stress fixture generator for term entity (v2.13.0).
*
@@ -22,6 +21,10 @@
* @since 2.13.0
*/
// phpcs:ignore WPDO.AntiEAV -- platform stress tester: intentional raw meta SQL for baseline comparison
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -20,6 +20,8 @@
* @since 2.12.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+4 -1
View File
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform stress tester: intentional raw meta SQL for baseline comparison
/**
* TMDO_User_Stress_Tester — User entity 壓力測試 / Benchmark 工具
*
@@ -16,6 +15,10 @@
* @since 2.6.7
*/
// phpcs:ignore WPDO.AntiEAV -- platform stress tester: intentional raw meta SQL for baseline comparison
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare,Generic.CodeAnalysis.UnusedFunctionParameter,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.PHP.YodaConditions,WordPress.WP.AlternativeFunctions.rand_mt_rand,WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize -- 測試工具:mt_rand 用於杜撰測試資料;serialize() 為 WP capabilities 標準格式
defined( 'ABSPATH' ) || exit;
+2
View File
@@ -21,6 +21,8 @@
* @since 2.0.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
+2
View File
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -21,6 +21,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -17,6 +17,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform diagnostic: raw meta inspection for site health
/**
* TMDO_Site_Health — WordPress Site Health integration (v2.2.0 M3).
*
@@ -17,6 +16,10 @@
* @package WP_Data_Optimizer
*/
// phpcs:ignore WPDO.AntiEAV -- platform diagnostic: raw meta inspection for site health
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -19,6 +19,8 @@
* @since 2.6.2
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -17,6 +17,8 @@
* @since 1.3.0
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -20,6 +20,8 @@
* @since 1.5.0
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -10,6 +10,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -19,6 +19,8 @@
* @since 1.1.2
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -14,6 +14,8 @@
* @since 2.6.6
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions -- inherits engine coding standard.
defined( 'ABSPATH' ) || exit;
@@ -14,6 +14,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -10,6 +10,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
+2
View File
@@ -10,6 +10,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -31,6 +31,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -10,6 +10,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -11,6 +11,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -16,6 +16,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -11,6 +11,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting,Generic.Commenting,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.ReplacementsWrongNumber,Generic.CodeAnalysis.UnusedFunctionParameter,Generic.CodeAnalysis.EmptyStatement,Squiz.PHP.DisallowMultipleAssignments,Squiz.PHP.DisallowSizeFunctionsInLoops,WordPress.WP.I18n.MissingTranslatorsComment,WordPress.PHP.NoSilencedErrors,WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents,Squiz.PHP.CommentedOutCode,Universal.NamingConventions.NoReservedKeywordParameterNames,WordPress.PHP.YodaConditions,Squiz.Commenting.InlineComment.InvalidEndChar -- PR-1 ported from UAE; cleanup PR scheduled.
@@ -9,6 +9,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -20,6 +20,8 @@
* @since 2.0.0
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -8,6 +8,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -32,6 +32,8 @@
* @since 2.9.1
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -37,6 +37,8 @@
* @since 2.12.1
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -54,6 +54,8 @@
* @since 2.12.4
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -16,6 +16,8 @@
* @since 3.0.1
*/
declare(strict_types=1);
// phpcs:disable WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Table name from TMDO_DB::table(); column validated by subclass FIELD_MAP constant.
if ( ! defined( 'ABSPATH' ) ) {
@@ -5,6 +5,8 @@
* @package TMDO
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -5,6 +5,8 @@
* @package WP_Data_Optimizer
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@@ -14,6 +14,8 @@
* @since 2.8.0
*/
declare(strict_types=1);
// phpcs:ignore WPDO.AntiEAV -- platform migration tool: WPDO v1->v2 legacy meta orchestration
if ( ! defined( 'ABSPATH' ) ) {
@@ -6,6 +6,8 @@
* @since 3.0.1
*/
declare(strict_types=1);
// phpcs:disable Squiz.Commenting.FunctionComment,WordPress.DB.PreparedSQL.NotPrepared,WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.PHP.YodaConditions,WordPress.Security.EscapeOutput.OutputNotEscaped -- Internal helpers; SQL composed from registry-validated identifiers; exception messages not echoed.
if ( ! defined( 'ABSPATH' ) ) {
@@ -1,5 +1,4 @@
<?php
// phpcs:ignore WPDO.AntiEAV -- platform migration tool: WPDO v1->v2 legacy post meta migration
/**
* TMDO_Post_Migration Post entity migration core (v2.9.3).
*
@@ -33,6 +32,10 @@
* @since 2.9.3
*/
// phpcs:ignore WPDO.AntiEAV -- platform migration tool: WPDO v1->v2 legacy post meta migration
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}

Some files were not shown because too many files have changed in this diff Show More