WPTwins-Detective

By msheikha1984

0+ active installationsVersion 0.3.9

Evidence for performance investigations, update comparisons and client reports.

Description

WPTwins is an independent publisher. This plugin is not affiliated with or endorsed by the WordPress Foundation or the WordPress project.

A free diagnostic tool. All included features work without a WPTwins account, license key or purchase. It measures and explains; it does not automatically optimize, update, restore or roll back the site. Optional Google API checks require your own provider configuration.

  • Opt-in PHP sampling: 15 minutes, maximum 200 samples, median/p95 duration, memory and query count. Public anonymous requests only; excludes ordinary WooCommerce requests and TurboCache hits.
  • Investigate: one signed anonymous GET of a public page, product, category, cart or checkout. Actual query timing aggregated by calling component, plugin loading intervals, remote HTTP host timings, PHP duration and memory.
  • Update Checks: same configured public paths, three HTTP runs each, median duration, HTTP status and component inventory comparison. Cache-state differences and unstable status are flagged instead of declaring a performance regression.
  • Reports & Alerts: thresholds, repeated findings, 30-entry history, JSON and printable HTML reports that can be saved as PDF. Optional WP-Cron comparison after WordPress upgrader update events against an administrator-captured baseline. No email notifications.
  • Browser Performance: manual Google PageSpeed Insights jobs for mobile and desktop. LCP, CLS, TBT, FCP, Speed Index, score and optimization opportunities. Separate CrUX p75 field data for mobile/desktop including INP, where available.
  • Clear, readable reports with contextual guidance and a magnifier/pulse identity.

Start here

  1. Capture a baseline under Update Checks before making changes.
  2. Update on staging and run a comparison. Three requests per path, up to five paths, eight-second timeout per run. Keep a verified backup separately.
  3. Use Investigate for a suspected slow page. Compare like-for-like measurements; profiling adds overhead.
  4. Reports & Alerts controls optional post-update comparisons and the Google API key.
  5. Browser Performance explicitly sends the chosen public URL to Google. Checks run sequentially through WP-Cron; a working cron and site traffic are required. Errors and unavailable data are shown, not replaced by invented scores.

Google connection

Create a project in Google Cloud, enable PageSpeed Insights API and Chrome UX Report API, create an API key, restrict it to these APIs and (when appropriate) your server IP, and enter it in Reports & Alerts. The key is stored in a non-autoloaded WordPress option and is excluded from exports. Blank input preserves the key; Remove stored API key removes it.
PageSpeed quotas may require a key. CrUX requires a configured key and sufficient eligible traffic for that URL/device. No provider charges or paid plan are activated by this plugin. Your Google project/provider quotas apply.
Documentation: https://developers.google.com/speed/docs/insights/v5/get-started
Field data: https://developer.chrome.com/docs/crux/api
Privacy: https://policies.google.com/privacy
Terms: https://policies.google.com/terms

Measurement limits

A slowdown near an update is correlation, not proof of cause. Server-to-server response time is not browser load time. A three-run median reduces noise but is not a controlled load test.
Plugin loading intervals cover only plugins observed after Detective begins loading; they are not full per-plugin runtime or exclusive function profiling. Query attribution is by the first observed plugin/theme caller. Earlier bootstrap work, MU plugins, drop-ins, raw cURL and direct database connections may be outside coverage. At most 5,000 queries are aggregated and 100 HTTP calls retained per profile. SAVEQUERIES is enabled only in the signed probe request if it was not explicitly disabled by the site; SQL may exist transiently in PHP memory, never in Detective’s stored reports. No wp-config.php changes are made.
WooCommerce investigations use an empty anonymous session, read-only GET, no cookies and no submitted order data. Checkout can redirect to an empty cart. They do not validate purchases, payment providers, logged-in customers or shipping integrations. Public browser checks exclude customer and transaction routes.
Passive sampling still uses a bounded option and can lose simultaneous samples under concurrency. Deep profiles bypass compatible caches, but an upstream cache/firewall may prevent a profile; this is reported as unavailable.
Lighthouse is lab data. CrUX is aggregate real-user data for Google’s reported period, not a real-time visitor monitor. Lack of field data does not mean good or bad performance.

Privacy, permissions and lifecycle

Actions require POST, manage_options and valid WordPress nonces. Probe tokens are random, short-lived, path-scoped and not stored in reports. Reports never retain SQL, visitor IPs, cookies or query strings. Configured public paths, component names, remote host names and performance aggregates can appear in reports; keep exported reports private. API keys are not exported.
History displays up to 30 entries from the last 30 days; expired history is pruned on history access/write. Other latest reports and baselines remain until cleared or uninstalled. Deactivation stops collection and scheduled jobs but preserves settings/reports. WordPress uninstall removes this plugin’s options and jobs. Expiring probe transients follow WordPress transient cleanup.
Former UpdateGuard settings are copied once without overwriting Detective data; legacy source options are retained.

Artwork and trademarks

Bundled code and artwork are licensed under GPL-2.0-or-later. This copyright license does not grant trademark rights. See ASSETS-LICENSE.txt and TRADEMARKS.txt.

Installation

  1. Upload the plugin ZIP through Plugins > Add New > Upload Plugin, then activate it.
  2. Open the plugin menu in the WordPress dashboard. Controls are opt-in.
  3. Test configuration changes on staging and keep a verified backup.

FAQ

Is this plugin free?

Yes. All included features are available without payment, registration or a license key.

Do I need TurboCache?

No. TurboCache is a separate paid product. The optional recommendation can be hidden per administrator. No referral identifiers, tracking requests, automatic installation or external update service are used. A normal link opens the product website only when clicked. When TurboCache is already active, the card links to its local settings instead.

Where are updates delivered?

The intended distribution channel is WordPress.org, subject to directory approval. This package contains no custom update server. Before listing approval, updates must be installed manually from WPTwins.

Does Detective automatically speed up my site?

No. It collects evidence and suggests next steps. It does not minify assets, change cache rules, disable plugins, update software or roll back your site. Test one targeted change on staging, then measure again.

How do I start an investigation?

Start a 15-minute recording session and visit public pages in a private window. Use Investigate for a deeper measurement of one local path. Capture an Update Checks baseline before making changes, then compare the same paths afterward.

Can it identify a slow plugin?

It groups measured database work by the observed caller and reports observed plugin loading intervals and remote HTTP host timings. These are clues, not complete per-plugin execution times or proof of causation. Early bootstrap work and calls outside WordPress APIs may not be visible.

Does it work alongside a cache plugin?

Yes, but cached responses and PHP measurements describe different work. TurboCache hits are excluded from passive sampling. Signed investigations request an uncached response; an upstream cache or firewall can prevent profiling. Unavailable results are shown explicitly.

Do I need a Google API key?

Local diagnostics do not need one. Configure your own key for reliable PageSpeed Insights access and CrUX field data. Browser checks send the selected public URL to Google only when requested. See Google connection above for setup, privacy and provider terms.

Why are Google results or real-user data missing?

API configuration, quotas, network failures or insufficient eligible CrUX traffic can leave results unavailable. Browser checks use WP-Cron, which needs a working schedule and site traffic. Missing data is not a passing score.

Can I investigate a WooCommerce store?

Yes. Investigations are anonymous read-only requests with an empty session. They do not test logged-in accounts, purchases, payment processing or shipping. An empty checkout may redirect. Browser checks exclude private customer and transaction routes.

Does a regression prove an update caused a problem?

No. Comparisons use three requests per configured path and flag unstable responses or cache differences. Server load and other changes can affect timing. Repeat a suspected regression on staging before attributing it to an update.

What information is stored or exported?

Local reports can contain aggregate timings, configured public paths, component names and remote host names. They exclude SQL, visitor IPs, cookies, query strings and Google API keys. Keep exported reports private. JSON and printable reports are available; printable HTML can be saved as PDF in your browser.

What happens when I deactivate or uninstall it?

Deactivation stops collection and scheduled jobs while preserving settings and reports. WordPress uninstall removes plugin options and jobs. Expiring probe transients follow normal WordPress cleanup.

Screenshots

Changelog

0.3.9

  • Generate printable report styles through the WordPress Styles API while preserving offline viewing.
  • Complete the exported HTML document structure.

0.3.8

  • Version logo URLs in the admin menu and header so updates request fresh artwork automatically.

0.3.7

  • Keep open product icons and text-only by WPTwins attribution.
  • Remove WPTwins and TurboCache brand artwork from directory packages; preserve Explore TurboCache link.

0.3.6

  • Restored original logos with explicit GPL artwork licensing and separate trademark notice.

0.3.4

  • New navy, cobalt and yellow visual system matching WPTwins, refined controls and subtle motion effects.
  • Reduced-motion support; functional settings and stored data are unchanged.

0.3.3

  • Free distribution without a license or purchase requirement.
  • Optional, dismissible TurboCache suggestion based on a recent slow public-page profile; existing diagnostics are unchanged.

0.3.2

  • Add prioritized, evidence-based findings with recommended actions and verification steps in Investigate, Reports and exports.
  • Compare the previous profile on the same path without claiming single-run causation.
  • Distinguish background HTTP dispatch from failure; old HTTP 0 is marked unknown.

0.3.1

  • Redesign the complete Detective interface with grouped top navigation, a blue/white diagnostics workspace, accessible controls and responsive data tables. Existing diagnostics and settings are preserved.

0.3.0

  • Add signed request investigations, caller-attributed database aggregates, observed plugin loading and remote HTTP timings.
  • Add safe anonymous WooCommerce request investigations.
  • Add three-run update comparisons, regression thresholds, repeated dashboard alerts and opt-in post-update jobs.
  • Add investigation history, JSON and printable client reports.
  • Add sequential mobile/desktop PageSpeed integration and separate CrUX field data with explicit unavailable/error states.
  • Add provider key management, POST-only actions and new DETECTIVE by WPTwins branding.

0.2.0

  • Incorporate former UpdateGuard baseline, inventory, public checks and update history.

0.1.0

  • First local PHP diagnostics preview.