DocsOFeedbackScreenshot Capture
Reference

Screenshot Capture

OFeedbackorravo.com/docs/ofeedback/screenshot-capture

Screenshots are captured client-side using html2canvas (loaded from jsDelivr CDN on demand, only when the user clicks "Attach Screenshot"). This avoids any cron dependency.

Process:

  1. User clicks "Attach Screenshot" in the widget or page form.
  2. html2canvas renders the visible page to a <canvas>, excluding the widget panel itself.
  3. The canvas is compressed to JPEG (quality 0.72, max dimension 1280px).
  4. The base64 data URL is uploaded via AJAX to ofb_upload_screenshot.
  5. The server validates magic bytes (JPEG or PNG only), enforces the 2 MB limit, saves to wp-content/uploads/ofb-screenshots/, and returns the public URL.
  6. The URL and server path are stored with the submission on form submit.

Cleanup:

A daily WP-Cron job deletes screenshot files belonging to entries that were archived more than 30 days ago. You can also trigger this immediately from Settings → Screenshot Storage → Run Cleanup Now.

Security:

The ofb-screenshots/ directory is protected by a .htaccess file that disables directory listing and blocks PHP execution.


Screenshot Capture — OFeedback Docs — Orravo