Plugin Directory

Changeset 3326414


Ignore:
Timestamp:
07/11/2025 04:30:09 PM (9 months ago)
Author:
bplugins
Message:

Release 1.0.1

Location:
voice-feedback
Files:
121 added
3 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • voice-feedback/trunk/readme.txt

    r3325499 r3326414  
    1 === Voice Feedback – Voice Recorder Plugin for Audio Feedback ===
    2 Contributors: bplugins, abuhayat, shehabulislam, freemius 
     1=== Voice Feedback – Voice Recorder for Audio Feedback ===
     2Contributors: bplugins, abuhayat, shehabulislam, taninrahman, freemius 
    33Tags: voice message, voice recording, user feedback, audio feedback
    44Requires at least: 6.5+
    5 Tested up to: 6.8.1
    6 Stable tag: 1.0.0
     5Tested up to: 6.8
     6Stable tag: 1.0.1
    77Requires PHP: 7.1
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     10
    1011Let users record and send voice feedback on your WordPress site. A simple voice recorder plugin with playback, re-record, and admin voice library.
     12
    1113== Description ==
     14
    1215**Voice Feedback – #1 Voice Recorder Plugin for Collecting Audio Feedback in WordPress**
     16
    1317[Voice Feedback](https://bplugins.com/products/voice-feedback/) | [Pricing](https://bplugins.com/products/voice-feedback/#pricing) | [Support](https://bplugins.com/support/)
    14 https://youtu.be/Z7yfMWb4jAI
     18
     19https://youtu.be/1stL_ku63FM
     20
    1521[Voice Feedback](https://bplugins.com/products/voice-feedback/) makes it easy for visitors to leave audio feedback on your WordPress site. They can simply record their voice—no login or personal details needed.
     22
    1623The plugin adds a voice recording field to your site using a floating drawer, block, or shortcode. All voice messages are saved in the admin panel, where you can listen to them, manage, or delete as needed.
     24
    1725Perfect for blogs, portfolios, education sites, product pages, or any website where collecting user feedback matters.
     26
    1827=== Key Features ===
     28
    1929- **Voice Recording Field for Users** – Visitors can record their voice directly from your site without needing an account.
     30
    2031- **Review Before Submit** – Users can play back their message before sending and re-record if needed.
     32
    2133- **Voice Library (Admin Panel)** – All submitted voice messages are stored in an organized dashboard.
     34
    2235- **Playback and Management** – Admins can listen to each voice recording and delete them if necessary.
     36
    2337- **Customizable UI** – Modify drawer appearance with options for typography, padding, border radius, and more.
     38
    2439- **Multiple Display Options** – Automatically shows a voice feedback drawer site-wide, or add specific instances via block or shortcode.
     40
    2541- **Lightweight and Secure** – No personal data is collected; focused only on voice-based user interaction.
     42
    2643=== Embed Options ===
     44
    2745- **Global Drawer Button** – Appears on all pages by default. Easily toggle on/off via the settings page.
     46
    2847- **Gutenberg Block** – Add a “Voice Feedback” block to any post or page.
     48
    2949- **Shortcode Support** – Generate shortcodes for custom placement. Create and manage them from the Voice Library menu.
     50
    3051=== Settings & Controls===
     52
    3153- Drawer visibility toggle
     54
    3255- Drawer button customization (text, padding, typography)
     56
    3357- Responsive design for mobile and desktop
     58
    3459- Easy-to-use admin interface
     60
    3561=== Ideal Use Cases ===
     62
    3663- Collect **user voice feedback** and suggestions
     64
    3765- Add **audio comment** or  **voice comments** capability to blog posts
     66
    3867- Enable clients to send **quick voice updates**
     68
    3969- Get spoken UX feedback or testimonials
     70
    4071- Use as a **voice feedback generator** tool
     72
    4173- Receive spoken suggestions or bug reports
     74
    4275=== Upcoming Features ===
     76
    4377- Contact form integration with voice field
    4478- Integration with project/task management tools
     79
    4580=== Check out our other WordPress Plugins ===
    4681- [HTML5 Audio Player](https://bplugins.com/products/html5-audio-player/) – Best audio player plugin for WordPress.
     82
    4783- [PDF Poster](https://bplugins.com/products/pdf-poster/) – A fully-featured PDF Viewer Plugin for WordPress.
     84
    4885- [StreamCast](https://bplugins.com/products/streamcast-radio-player/) – A fully-featured Radio Player Plugin for WordPress.
     86
    4987- [3D Viewer](https://bplugins.com/products/3d-viewer/) – Display interactive 3D models on the webs.
     88
    5089== Installation ==
     90
    51911. Upload the plugin folder to the `/wp-content/plugins/` directory, or install from the Plugins directory.
     92
    52932. Activate the plugin.
     94
    53953. A voice feedback drawer will appear automatically on your site.
     96
    54974. Visit **Voice Library → Settings** to customize or disable the drawer.
     98
    55995. Use the **Gutenberg block** or generate a **shortcode** from the admin to place on specific pages.
     100
    56101== Frequently Asked Questions ==
     102
    57103= Does this plugin collect personal data? = 
    58104No. It only records the voice message. No name, email, or contact information is collected.
     105
    59106= Where can I access submitted recordings? = 
    60107All voice recordings are stored in the **Voice Library** admin menu, where you can play or delete them.
     108
    61109= Can I turn off the floating voice drawer? = 
    62110Yes. Go to **Voice Library → Settings** and disable the drawer with a single toggle.
     111
    63112= How do I add the voice feedback to a specific post or page? = 
    64113Use the **Voice Feedback** block in Gutenberg or copy the shortcode from **Voice Library → Voice Feedbacks**.
     114
    65115= Is it compatible with all WordPress themes? = 
    66116Yes. It works with all modern, well-coded themes.
     117
    67118== Screenshots ==
     119
    681201. Voice Feedback drawer on frontend 
    691212. User voice recording interface 
     
    711234. Block editor showing Voice Feedback block 
    721245. Settings panel for customization 
     125
    73126== Changelog ==
     127
     128= 1.0.1 =
     129* Updated with new features
     130
    74131= 1.0.0 = 
    75132* Initial release with core features: drawer, block, shortcode, admin library, and basic customization.
     133
    76134== Upgrade Notice ==
     135
     136= 1.0.1 = 
     137Updated with new features
     138
    77139= 1.0.0 = 
    78140First release. Enables site visitors to record and submit voice feedback.
  • voice-feedback/trunk/voice-feedback.php

    r3325491 r3326414  
    11<?php
    2 /*
    3 Plugin Name: Voice Feedback
    4 Description: Send Voice feedback to the site admin on the go. User can embed the voice feedback form in the contact form by shortcode.
    5 Version: 1.0
    6 Author: bPlugins
    7 License:           GPL v2 or later
    8 Text Domain:       voice-feedback
    9 License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
    10 */
    112
    12 if (! defined('ABSPATH')) exit; // Exit if accessed directly
    13 
    14 define('VOICE_FEEDBACK_PLUGIN_DIR', plugin_dir_path(__FILE__));
    15 define('VOICE_FEEDBACK_PLUGIN_URL', plugin_dir_url(__FILE__));
    16 define('VOICE_FEEDBACK_PLUGIN_VERSION', time());
    17 
    18 // Register scripts and styles
    19 add_action('wp_enqueue_scripts', function () {
    20     wp_register_script('wavesurfer', VOICE_FEEDBACK_PLUGIN_URL . 'assets/js/wavesurfer.min.js', [], '7.9.4', true);
    21     wp_register_script('voice-feedback', plugin_dir_url(__FILE__) . 'voice-recorder.js', ['wavesurfer'], VOICE_FEEDBACK_PLUGIN_VERSION, true);
    22     wp_register_style('voice-feedback-css', plugin_dir_url(__FILE__) . 'voice-recorder.css', [], VOICE_FEEDBACK_PLUGIN_VERSION);
    23 
    24     wp_localize_script('voice-feedback', 'voiceRecorder', [
    25         'ajaxUrl' => admin_url('admin-ajax.php'),
    26         'nonce' => wp_create_nonce('voice_feedback_nonce')
    27     ]);
    28 });
    29 
    30 add_shortcode('voice_feedback', function () {
    31     wp_enqueue_script('voice-feedback');
    32     wp_enqueue_style('voice-feedback-css');
    33     return '
    34 <div id="voice-feedback-wrapper">
    35     <div id="waveform"></div>
    36     <div class="feedback-buttons">
    37         <button id="startBtn" class="rec-btn">🎙️ Tap to Record</button>
    38         <button id="stopBtn" class="rec-btn" disabled>⏹️ Stop</button>
    39         <button id="playBtn" class="rec-btn" disabled>▶️ Play</button>
    40         <button id="sendBtn" class="rec-btn" disabled>📤 Send</button>
    41     </div>
    42     <audio id="audioPlayback" controls style="display:none;"></audio>
    43 </div>
    44 ';
    45 });
    46 
    47 // Handle audio upload via AJAX
    48 add_action('wp_ajax_nopriv_save_audio', 'voice_feedback_handle_upload');
    49 add_action('wp_ajax_save_audio', 'voice_feedback_handle_upload');
    50 
    51 function voice_feedback_handle_upload()
    52 {
    53     if (
    54         !isset($_POST['nonce']) ||
    55         !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'voice_feedback_nonce')
    56     ) {
    57         wp_send_json_error('Invalid nonce.');
    58     }
    59 
    60     if (!isset($_FILES['audio']) || !isset($_FILES['audio']['error']) || $_FILES['audio']['error'] !== UPLOAD_ERR_OK) {
    61         wp_send_json_error('No audio file uploaded or file error.'); // Send JSON error response and exit the functio
    62     }
    63 
    64     // Include WordPress file handling functions
    65     require_once ABSPATH . 'wp-admin/includes/file.php';
    66 
    67 
    68 
    69 
    70     $file = [
    71         'name'     => isset($_FILES['audio']['name']) ? sanitize_file_name($_FILES['audio']['name']) : '',
    72         'type'     => isset($_FILES['audio']['type']) ? sanitize_text_field($_FILES['audio']['type']) : '',
    73         'tmp_name' => isset($_FILES['audio']['tmp_name']) ? sanitize_text_field($_FILES['audio']['tmp_name']) : '',
    74         'error'    => isset($_FILES['audio']['error']) ? sanitize_text_field($_FILES['audio']['error']) : '',
    75         'size'     => isset($_FILES['audio']['size']) ? (int) $_FILES['audio']['size'] : 0,
    76     ];
    77 
    78 
    79     // Validate MIME type (optional for added security)
    80     $allowed_types = array('audio/mpeg', 'audio/wav', 'audio/mp3', 'audio/x-wav', 'video/webm', 'audio/webm');
    81     $file_type     = mime_content_type($file['tmp_name']);
    82 
    83     // wp_send_json_error([$file, $file_type]);
    84 
    85     if (!in_array($file_type, $allowed_types, true)) {
    86         wp_send_json_error('Invalid audio file type.');
    87     }
    88 
    89     // Handle upload using WordPress API
    90     $upload_overrides = array(
    91         'test_form' => false,
    92         'mimes'     => array(
    93             'webm' => 'video/webm'
    94         ),
    95     );
    96 
    97     $uploaded = wp_handle_upload($file, $upload_overrides);
    98 
    99     if (isset($uploaded['file'])) {
    100         $file_url = esc_url($uploaded['url']);
    101 
    102         // User info
    103         if (is_user_logged_in()) {
    104             $current_user = wp_get_current_user();
    105             $user_info = sprintf(
    106                 "Username: %s\nEmail: %s\nUser ID: %d\nDisplay Name: %s",
    107                 $current_user->user_login,
    108                 $current_user->user_email,
    109                 $current_user->ID,
    110                 $current_user->display_name
    111             );
    112         } else {
    113             $user_info = sprintf(
    114                 "Guest IP: %s\nUser Agent: %s",
    115                 sanitize_text_field(wp_unslash($_SERVER['REMOTE_ADDR'] ?? 'N/A')),
    116                 sanitize_text_field(wp_unslash($_SERVER['HTTP_USER_AGENT'] ?? 'N/A'))
    117             );
     3/**
     4 * Plugin Name:   Voice Feedback
     5 * Description:   Send Voice feedback to the site admin on the go. User can embed the voice feedback form in the contact form by shortcode.
     6 * Version:       1.0.1
     7 * Author:        bPlugins
     8 * Author URI:    https://bplugins.com
     9 * License:       GPLv3
     10 * License URI:   https://www.gnu.org/licenses/gpl-3.0.txt
     11 * Text Domain:   voice-feedback
     12 * @fs_free_only, bsdk_config.json, /bplugins_sdk
     13 */
     14if ( !defined( 'ABSPATH' ) ) {
     15    exit;
     16}
     17// Exit if accessed directly
     18if ( function_exists( 'vf_fs' ) ) {
     19    register_activation_hook( __FILE__, function () {
     20        if ( is_plugin_active( 'voice_feedback/voice_feedback.php' ) ) {
     21            deactivate_plugins( 'voice_feedback/voice_feedback.php' );
     22        }
     23        if ( is_plugin_active( 'voice_feedback-pro/voice_feedback.php' ) ) {
     24            deactivate_plugins( 'voice_feedback-pro/voice_feedback.php' );
     25        }
     26    } );
     27} else {
     28    define( 'BPLVF_DIR_PATH', plugin_dir_path( __FILE__ ) );
     29    define( 'BPLVF_DIR_URL', plugin_dir_url( __FILE__ ) );
     30    define( 'BPLVF_VERSION', "1.0.1" );
     31    define( 'BPLVF_HAS_FREE', 'voice-feedback/voice-feedback.php' === plugin_basename( __FILE__ ) );
     32    define( 'BPLVF_HAS_PRO', 'voice-feedback-pro/voice-feedback.php' === plugin_basename( __FILE__ ) );
     33    if ( !function_exists( 'vf_fs' ) ) {
     34        // Create a helper function for easy SDK access.
     35        function vf_fs() {
     36            global $vf_fs;
     37            if ( !isset( $vf_fs ) ) {
     38                $fsStartPath = dirname( __FILE__ ) . '/freemius/start.php';
     39                $bSDKInitPath = dirname( __FILE__ ) . '/bplugins_sdk/init.php';
     40                if ( BPLVF_HAS_PRO && file_exists( $fsStartPath ) ) {
     41                    require_once $fsStartPath;
     42                } else {
     43                    if ( BPLVF_HAS_FREE && file_exists( $bSDKInitPath ) ) {
     44                        require_once $bSDKInitPath;
     45                    }
     46                }
     47                $bplvfConfig = [
     48                    'id'                  => '19712',
     49                    'slug'                => 'voice-feedback',
     50                    'premium_slug'        => 'voice-feedback-pro',
     51                    'type'                => 'plugin',
     52                    'public_key'          => 'pk_e2acd90aa2e40812def1d0880deae',
     53                    'is_premium'          => true,
     54                    'premium_suffix'      => 'Pro',
     55                    'has_premium_version' => true,
     56                    'has_addons'          => false,
     57                    'has_paid_plans'      => true,
     58                    'trial'               => array(
     59                        'days'               => 7,
     60                        'is_require_payment' => false,
     61                    ),
     62                    'menu'                => array(
     63                        'slug'       => 'edit.php?post_type=voice_recording&page=dashboard#/settings',
     64                        'first-path' => 'edit.php?post_type=voice_recording&page=dashboard#/settings',
     65                        'support'    => false,
     66                    ),
     67                ];
     68                $vf_fs = ( BPLVF_HAS_PRO && file_exists( $fsStartPath ) ? fs_dynamic_init( $bplvfConfig ) : fs_lite_dynamic_init( $bplvfConfig ) );
     69            }
     70            return $vf_fs;
    11871        }
    11972
    120         // Insert custom post
    121         $post_id = wp_insert_post(array(
    122             'post_title'  => 'Voice Recording - ' . current_time('mysql'),
    123             'post_type'   => 'voice_recording',
    124             'post_status' => 'publish',
    125         ));
    126 
    127         if (!is_wp_error($post_id)) {
    128             update_post_meta($post_id, 'voice_file_url', $file_url);
    129             update_post_meta($post_id, 'voice_user_info', sanitize_textarea_field($user_info));
    130             wp_send_json_success('Audio saved and added to voice library.');
    131         } else {
    132             wp_send_json_error($post_id->get_error_message());
    133         }
    134     } else {
    135         wp_send_json_error('Failed to upload audio.');
     73        // Init Freemius.
     74        vf_fs();
     75        // Signal that SDK was initiated.
     76        do_action( 'vf_fs_loaded' );
    13677    }
    137 
    138     wp_die();
     78    // Load Main Plugin Class
     79    require_once BPLVF_DIR_PATH . 'includes/class-bplvfVoiceFeedback.php';
     80    // Initialize the plugin
     81    new BPLVFVoiceFeedback();
    13982}
    140 
    141 // Register custom post type
    142 add_action('init', function () {
    143     register_post_type('voice_recording', [
    144         'labels' => [
    145             'name' => 'Voice Library',
    146             'singular_name' => 'Voice Recording'
    147         ],
    148         'public' => false,
    149         'show_ui' => true,
    150         'menu_icon' => 'dashicons-microphone',
    151         'supports' => ['title'],
    152     ]);
    153 });
    154 
    155 // Backend metaboxes
    156 add_action('add_meta_boxes', function () {
    157     add_meta_box('voice_recording_metabox', 'Voice Playback', 'voice_recording_metabox_callback', 'voice_recording', 'normal', 'default');
    158     add_meta_box('voice_recording_userinfo', 'User Info', 'voice_recording_userinfo_callback', 'voice_recording', 'side', 'default');
    159 });
    160 
    161 
    162 
    163 function voice_recording_metabox_callback($post)
    164 {
    165     $audio_url = get_post_meta($post->ID, 'voice_file_url', true);
    166     if ($audio_url) {
    167         echo '<audio controls style="width: 100%;"><source src="' . esc_url($audio_url) . '" type="audio/webm"></audio>';
    168     } else {
    169         echo '<p>No audio recording found for this entry.</p>';
    170     }
    171 }
    172 
    173 function voice_recording_userinfo_callback($post)
    174 {
    175     $info = get_post_meta($post->ID, 'voice_user_info', true);
    176     echo '<pre style="white-space: pre-wrap; word-wrap: break-word;">' . esc_html($info ?: 'No user info available.') . '</pre>';
    177 }
Note: See TracChangeset for help on using the changeset viewer.