Throttle and optimize `/wp-json/optml/v1/optimizations` REST API endpoint execution and validation
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript, php, wordpress
- 領域
- api, backend, performance
調査の方向性
Start by locating the registration of the /wp-json/optml/v1/optimizations REST route and the client script that POSTs the optimization reports. Read the callback for the route to see which mandatory fields are consumed and where heavy profiling or database writes begin, then check the client dispatch path to find where debounce/rate-limit logic belongs. Done means the client sends at most one throttled report per page session and invalid payloads return 400 before any heavy service is initialized; no linked tests or files are named in the issue, so confirm the expected behaviour with a maintainer first.
索引モデルが issue の本文から書いたものです。
説明
Impact: 80 · Confidence: 90 · Complexity: 50
Description
Problem
The Optimole frontend script triggers high volumes of POST requests to /wp-json/optml/v1/optimizations (e.g., 500+ requests over 6 hours), with a high percentage (~21%) failing with HTTP 400 Bad Request while still instantiating full WordPress PHP processes and consuming substantial CPU time (e.g. 391 seconds across 525 requests).
Desired Behavior
Optimole should debounce/throttle client-side optimization report payloads, restrict redundant API dispatches, and perform lightweight request validation early in REST API execution to return HTTP 400 responses with minimal PHP processing overhead.
Acceptance Criteria
- Client-side script debounces and rate-limits POST dispatches to
/wp-json/optml/v1/optimizationsper page session. - Server-side REST endpoint performs early validation of mandatory fields before executing heavy profiling logic or database writes.
- High-frequency invalid payloads (HTTP 400) exit early without executing unnecessary internal routines.
Customer Context
A paid subscriber reported server resource exhaustion (391s of PHP processing time across 525 requests in 6 hours; 4,969 requests over 3 days) driven by /wp-json/optml/v1/optimizations, with over 20% returning HTTP 400 bad request errors.
Root Cause Analysis
The customer experiences high PHP usage due to continuous background REST calls to /wp-json/optml/v1/optimizations and wants a way to rate-limit or protect the endpoint. The underlying problem is unthrottled client-side profiler beacons combined with heavyweight processing on invalid payload requests (HTTP 400). Rather than expecting customers to add external rate-limiting rules, Optimole should improve its own beacon frequency, client-side debouncing, and server-side early rejection routines.
Alternative Suggestions
Debounce page profiling network requests on the client side, implement client-side check to skip sending empty/invalid optimization payloads, and add early parameter schema validation on /wp-json/optml/v1/optimizations before initializing heavy services.
Source: HelpScout #3524196151
Generated by feature-request-triage workflow (ID: feature-request-triage_6b0599ff05a6a1.02374250)
- 主要言語
- PHP
- スター
- 74
- フォーク
- 14
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 35
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Codeinwp/optimole-wp のほかの issue
-
Lazyload SVG placeholder runs uncached attachment lookups with JSON-escaped URLs on REST responsesオープンcustomer report
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Codeinwp/optimole-wp#1253 ·
メンテナーはふだん 1 日以内に返信
-
customer report feature-request-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Codeinwp/optimole-wp#1239 ·
メンテナーはふだん 1 日以内に返信
-
Page profiler never stores above-the-fold background images: `b` is always sent with empty selector maps対応中かも @girishpanchal30 が 19 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
Codeinwp/optimole-wp#1216 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Cache `attachment_url_to_postid()` lookups in `Optml_Lazyload_Replacer` to reduce database overheadオープンcustomer report feature-request-triage
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
Codeinwp/optimole-wp#1249 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
customer report feature-request-triage
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
Codeinwp/optimole-wp#1231 ·
メンテナーはふだん 1 日以内に返信
Codeinwp/optimole-wp の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
HE-Arc/le-panier-du-coin#49 ·
メンテナーはふだん 1 日以内に返信
-
15.0
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
bug: juros do parcelamento travados em 1x no gateway Rede Débito e Crédito 3DS (woo-rede 5.6.0)オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
LinkNacional/woo-rede#367 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信