=== Flick Survey ===
Contributors: rahulsethi, flickidea
Tags: survey, field-survey, mobile-survey, gps, camera
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Production-grade field survey, GPS geotracking, on-site photographic evidence, and offline data collection management system for WordPress.

== Description ==

Flick Survey is an enterprise-grade field data collection and survey operations management plugin engineered specifically for organizations, NGOs, research bodies, government agencies, and field teams managing on-site data gathering campaigns.

Designed to effortlessly coordinate 30+ smartphone field surveyors simultaneously, Flick Survey provides a mobile-optimized multi-step wizard, hardware-accelerated GPS geolocation acquisition, in-browser live camera viewfinder with real-time Indian Standard Time (+05:30) and coordinate watermarking, flexible drag-and-drop form builder, and an administrative review and approval backoffice.

All data, media attachments, and logs are stored exclusively on your own WordPress hosting server inside dedicated high-performance normalized database tables. Flick Survey transmits zero tracking, telemetry, or survey data to external third-party services.

### Core Architecture & Capabilities

* **Live In-App Camera Viewfinder:** Native in-browser WebRTC viewfinder (`getUserMedia`) captures on-site photographs without triggering background tab reloads or memory crashes on mobile browsers.
* **Dual Fallback Image Triggers:** Full support for device system camera applications and photo gallery selection.
* **On-Site Watermarking Engine:** Statically stamps high-contrast verification banners directly into evidence photographs featuring satellite GPS coordinates (Latitude, Longitude, Accuracy), Indian Standard Time (+05:30), and verification seals.
* **Crash-Proof Local Session Recovery:** Automatically synchronizes active form fields and captured photographic evidence to temporary session storage, instantly restoring surveyor progress in the event of accidental tab refresh or device sleep.
* **Hardware GPS Geolocation Fix:** One-touch satellite coordinate capture with real-time accuracy threshold reporting and Google Maps verification deep-links.
* **Strict Role-Based Access Control (RBAC):** Dedicated `Surveyor` WordPress user role locked out of the `/wp-admin/` backoffice and strictly isolated to their own assigned records via authoritative server-side ownership guards.
* **Dynamic Form Builder:** Construct multi-step questionnaire flows with text, number, telephone, dropdown, radio, multi-select checkbox, date, time, yes/no toggle, photo, and PDF upload field types.
* **Streaming CSV Data Export:** Memory-safe chunked export streams survey responses, respondent profiles, GPS coordinates, and dynamic answers directly to Microsoft Excel-compatible CSV files without PHP memory exhaustion.
* **Immutable Audit Trail:** Comprehensive operational logging records survey creation, submission, review transitions, administrator approvals, rejections with reasons, and surveyor credential actions.
* **GDPR & WordPress Privacy Integration:** Includes suggested privacy policy content, core Personal Data Exporter support, and core Personal Data Eraser support.

== Installation ==

### Automatic Installation
1. Log into your WordPress administrative dashboard.
2. Navigate to **Plugins → Add New**.
3. Search for `Flick Survey` and click **Install Now**, then **Activate**.

### Manual Installation via ZIP
1. Download `flick-survey-v1.0.1.zip`.
2. In your WordPress dashboard, navigate to **Plugins → Add New → Upload Plugin**.
3. Choose the downloaded ZIP file and click **Install Now**.
4. Click **Activate Plugin**.

### Post-Activation Configuration
1. Upon activation, Flick Survey provisions dedicated custom database tables prefixed with `{wp_prefix}sf_` and establishes the `Surveyor` user role.
2. Navigate to **Flick Survey → Settings** to review system settings, GPS requirements, and notification emails.
3. Automatically generated frontend pages with pre-configured shortcodes are created:
   * `/survey-dashboard/` – Surveyor Field Operations Dashboard (`[surveyflow_dashboard]`)
   * `/new-survey/` – Multi-Step Field Survey Form (`[surveyflow_new_survey]`)
   * `/my-surveys/` – Surveyor Personal Submissions Directory (`[surveyflow_my_surveys]`)
   * `/survey-login/` – Surveyor Mobile Authentication Portal (`[surveyflow_login]`)

== Frequently Asked Questions ==

= Does Flick Survey use standard WordPress post types or post meta? =
No. Flick Survey is architected with dedicated custom database tables (`wp_sf_surveys`, `wp_sf_survey_fields`, `wp_sf_survey_field_values`, `wp_sf_survey_media`, and `wp_sf_survey_logs`) featuring compound indexes for high performance with tens of thousands of survey records without bloating the `wp_posts` or `wp_postmeta` tables.

= Can field surveyors see or edit each other's submissions? =
Never. All data access is strictly enforced server-side. Surveyors can only view and edit their own assigned survey records. Direct URL manipulation (IDOR) attacks are blocked by authoritative ownership verification functions.

= Are on-site photographs stored on external servers or clouds? =
No. All photographs and verification documents are saved locally in `/wp-content/uploads/flick-survey/` on your WordPress server. Directory listing is disabled and uploads are protected.

= How does the In-App Live Camera prevent mobile tab crashes? =
Many budget mobile devices running Android Chrome suspend or terminate background browser tabs when the external system camera app launches. Flick Survey provides an in-app live camera modal using `navigator.mediaDevices.getUserMedia` that captures and watermarks photos directly inside the active viewport without switching applications.

= Can Flick Survey be used without an internet connection? =
Flick Survey supports draft saving and temporary session restoration. Surveyors can input responses and capture photographs; once network connectivity is available, tapping Submit uploads the survey record and media attachments to the server.

= What user roles are included? =
Flick Survey introduces the `surveyor` role with capabilities restricted to creating, viewing, and drafting their own surveys. Field surveyors are redirected away from `/wp-admin/` directly to their frontend mobile dashboard.

== Screenshots ==

1. **Surveyor Dashboard**: Mobile-optimized operations dashboard displaying submission statistics, review statuses, and quick action triggers.
2. **Multi-Step Field Survey Wizard**: Five-step surveyor form with touch-friendly fields, satellite GPS hardware acquisition, and dynamic question rendering.
3. **Live Camera Viewfinder**: Real-time in-app camera modal with live GPS coordinates, Indian Standard Time timestamp, and on-screen shutter.
4. **Captured Evidence Grid**: On-site evidence photos stamped with tamper-resistant coordinate and time watermarks.
5. **Administrative Survey Directory**: Centralized backoffice directory featuring multi-compound filtering, quick approval, and rejection modal with audit tracking.
6. **Visual Form Builder**: Interactive form builder allowing administrators to arrange steps and custom questions across steps.
7. **Reports & Analytics**: District aggregation reports, surveyor leaderboard, and one-click streaming CSV exports.

== Changelog ==

= 1.0.1 =
* **Feature:** Added native in-browser WebRTC live camera viewfinder (`getUserMedia`) with real-time video stream, GPS overlay, and instant capture.
* **Feature:** Added dual-source fallback support for system camera app and device photo gallery.
* **Feature:** Added crash-proof `sessionStorage` form data and photo recovery protecting against mobile OS tab reloads.
* **Security:** Added strict server-side MIME detection, magic byte verification, and executable file upload blocking.
* **Security:** Added CSRF nonce protection to all administrative CSV export triggers.
* **Privacy:** Added WordPress core Privacy Policy suggestions, Personal Data Exporter, and Personal Data Eraser integrations.
* **Enhancement:** Upgraded Step 5 Review screen with interactive photographic evidence thumbnail gallery.

= 1.0.0 =
* Initial production release.
* Custom database schema with normalized tables and compound indexes.
* Surveyor role and granular permission management.
* Hardware GPS capture with accuracy threshold calculation.
* Dynamic Form Builder with multi-step question assignment.
* Administrative approval/rejection workflows and immutable audit logs.
* Chunked streaming CSV export engine.

== Upgrade Notice ==

= 1.0.1 =
Upgrades camera hardware triggers with live in-app viewfinder, auto-recovery from mobile tab reloads, and enhanced WordPress privacy tools. Recommended for all installations.

== Privacy & Data Protection ==

Flick Survey respects user and respondent privacy:
* All collected survey records, GPS coordinates, personal details, and photographs remain exclusively on your WordPress server.
* No data is transmitted to Flick Idea Private Limited, Google, or any external analytics service.
* Full integration with WordPress Privacy Tools (Export and Erase Personal Data).

== Support & Contact ==

Flick Survey is developed and maintained by **Flick Idea Private Limited**.
* **Plugin Homepage:** [https://www.flickidea.in/our-innovations/surveyflow-field-survey-management-plugin-for-wordpress/](https://www.flickidea.in/our-innovations/surveyflow-field-survey-management-plugin-for-wordpress/)
* **Author Website:** [https://www.flickidea.in/](https://www.flickidea.in/)
* **Lead Developer:** Rahul Sethi
* **Email Support:** support@flickidea.in
