=== Voicefic ===
Contributors: pluginfic
Tags: voice feedback, audio feedback, video feedback, screen recording, shortcode
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Collect voice, video, and screen-recorded feedback from your visitors. Every submission is instantly organized in your dashboard.


== Description ==

**Voicefic** gives your visitors a one-click way to share feedback as a voice message, right on your website. Voicefic Pro adds webcam video and full screen recording.

Forget long feedback forms that nobody fills in. A visitor clicks the button, records in seconds, and hits Send. You get the full recording in your admin dashboard along with their browser, device, and page source — everything you need to act on the feedback immediately.

= 🎥 Video Overview = 
https://youtu.be/35rK2jcnlGw

= 🎙 Recording Modes =

* **Audio** — microphone-only recording, the fastest way to leave a quick voice note.
* **Video** *(Pro)* — webcam + microphone recording.
* **Screen** *(Pro)* — screen + microphone recording, so visitors can show you the problem.

= ✨ Key Features =

* **Shortcode builder** — create up to 10 feedback forms (unlimited in Pro), each with its own modes, colors, and dimensions. Embed anywhere with `[voicefic id="X"]`.
* **Voice Entries dashboard** — every submission is listed with a built-in audio/video player. No downloading required.
* **Visitor context** — each entry automatically captures: browser, OS, device type, screen resolution, page title, referrer URL, and (optionally) city / region / country.
* **Stats at a glance** — totals by type, cumulative recording duration, and weekly/monthly submission counts.
* **Appearance settings** — colors, font family, size, weight, border-radius, and widget width — controllable globally or overridden per shortcode.
* **No account required** — visitors record and send without signing up, logging in, or filling in a name or email address.
* **Full-page embed** — each shortcode is also accessible at `/?voicefic=ID` for a dedicated feedback landing page.
* **Developer hook** — `voicefic_feedback_submitted` fires after every successful upload for custom integrations (email alerts, Slack, CRM, etc.).

= 🔧 How It Works =

1. Go to **Voicefic → Shortcodes** and click **Add New**.
2. Give it a title, select which recording modes to enable, and set colors and dimensions.
3. Copy the shortcode (e.g. `[voicefic id="1"]`) and paste it into any post, page, or widget.
4. Visitors click the button, grant mic/camera permission, record their message, and hit **Send**.
5. The recording appears instantly under **Voicefic → Voice Entries**.

= 📋 Shortcode Usage =

`[voicefic id="X"]`

Replace `X` with the ID shown in **Voicefic → Shortcodes**. All appearance and behavior settings are managed in the builder — no extra attributes needed.

= 🔒 Privacy & Security =

* Submissions require no names, email addresses, or account creation.
* All admin actions (create, edit, delete, resolve, star) are protected by a WordPress nonce and require the `manage_options` capability.
* The upload endpoint accepts only whitelisted formats: `mp3`, `m4a`, `mp4`, `webm`, `wav`, `ogv`.
* Recordings are stored in `/wp-content/uploads/voicefic/` — your server, your data.
* All database queries use prepared statements.

= 🌐 Supported Formats =

The widget automatically selects the best format the visitor's browser supports:

* **Audio** → MP4 / M4A, MP3, or WebM
* **Video / Screen** → MP4 or WebM (VP9)

= ⚡ Performance =

Frontend assets are enqueued **only on pages that contain a `[voicefic]` shortcode**, so there is zero impact on the rest of your site.

== External services ==

This plugin connects to external APIs for geolocation information.

**Geolocation Service (ipinfo.io)**
The plugin calls `ipinfo.io` to determine the visitor's geographic location (ip address, location, city, region, country) which is displayed with each feedback entry. This request is sent when a recording is submitted.
- Terms of Service: https://ipinfo.io/terms-of-service
- Privacy Policy: https://ipinfo.io/privacy-policy

== Source Code ==

The JavaScript and CSS in the `assets/` folder are compiled and minified. The uncompiled, human-readable source code is included in the plugin itself:

* `src/js/` — admin app and frontend scripts (React)
* `src/scss/` — stylesheets (SCSS)
* `includes/integrations/block/src/` — Gutenberg block

== Installation ==

1. Upload the `voicefic` folder to `/wp-content/plugins/`, or install it directly from **Plugins → Add New** in your WordPress dashboard.
2. Activate **Voicefic** through the **Plugins** menu.
3. Go to **Voicefic → Shortcodes** and click **Add New** to create your first feedback form.
4. Paste the generated shortcode into any post, page, or widget area.
5. Visit the front end and submit a test recording to confirm everything works.


== Frequently Asked Questions ==

= Do visitors need to create an account to leave feedback? =

No. Anyone who visits the page can record and submit feedback immediately — no sign-up, no login, no email address required.

= How do I add the widget to a specific page? =

Create a shortcode under **Voicefic → Shortcodes**, then paste `[voicefic id="X"]` into the content editor or a shortcode block on the page where you want it to appear.

= Can I have different widgets with different settings on different pages? =

Yes. Create a separate shortcode for each placement. Each one has its own recording modes, colors, and dimensions.

= Is video or screen recording included? =

Voice (audio) recording is included in the free version. Webcam video and screen recording are available in Voicefic Pro.

= What browsers support screen recording? =

Screen capture is supported in Chrome and Edge. Audio and video recording work in all modern browsers: Chrome, Edge, Firefox, and Safari 14.1+.

= Is there a recording time limit? =

The default maximum is 120 seconds (2 minutes). This can be adjusted per shortcode in the builder.

= Where are recordings stored? =

Files are saved to `/wp-content/uploads/voicefic/` on your own server. Entry metadata is stored in the `wp_voicefic_feedback` database table.

= How do I play back a submission? =

Go to **Voicefic → Voice Entries** and click the play icon on any row. Audio and video play directly in the browser — no download needed.

= Can I get an email notification when someone submits feedback? =

Not built-in yet, but the `voicefic_feedback_submitted` action fires after every successful upload, so you can add email or webhook notifications with a small code snippet or a hook-based plugin.

= Will Voicefic slow down my website? =

No. The plugin's JavaScript and CSS are loaded only on pages that contain a `[voicefic]` shortcode. All other pages are unaffected.

= Is there a Pro version? =

Yes. Voicefic Pro adds webcam video and screen recording, five extra widget styles (Sticky, Slide Panel, Badge, Minimal Dock, Toolbar), star and resolve workflows, device targeting, and an embed code for any website. Form integration (Contact Form 7, WPForms and more) is coming soon.


== Screenshots ==

1. Shortcode builder — configure recording modes, colors, and dimensions.
2. Voice Entries dashboard — play back, star, resolve, and filter submissions.
3. Built-in player — listen to any entry without leaving the dashboard.
4. Settings — turn on the site-wide widget and set its style, position, modes, and label.
5. Frontend widget — the recording interface as seen by visitors (idle state).
6. Frontend widget — active recording with live waveform visualizer.


== Changelog ==

= 1.0.0 =
* Initial release.