Plugin Directory

Changeset 3339402


Ignore:
Timestamp:
08/05/2025 06:10:33 AM (8 months ago)
Author:
norml
Message:

Updated to version 1.1.0

  • Added manual Google Reviews management
  • Added customizable review widget shortcode [review_wall_widget]
  • Improved user experience and fixed minor bugs
Location:
review-wall/trunk
Files:
37 added
12 edited

Legend:

Unmodified
Added
Removed
  • review-wall/trunk/includes/classes/class-review-wall-activation.php

    r3331651 r3339402  
    6464    {
    6565        $default_options = [
    66             'review_wall_logo'               => '',
    67             'review_wall_rating_threshold'   => 3,
    68             'review_wall_default_url'        => '',
    69             'review_wall_title_step_1'       => 'Your thoughts are important to us!',
    70             'review_wall_description_step_1' => 'Thank you for choosing us! Share your impressions of our product and service by clicking on the stars below.',
    71             'review_wall_btn_step_1'         => 'Continue',
    72             'review_wall_title_step_2'       => 'We are very sorry that you were not satisfied :(',
    73             'review_wall_description_step_2' => 'Your assessment shows that something went wrong. Write the details and we will contact you to resolve the issue.',
    74             'review_wall_comment_label'      => 'Your comment',
    75             'review_wall_email_label'        => 'Your email',
    76             'review_wall_btn_step_2'         => 'Leave a review',
    77             'review_wall_title_step_3'       => 'Thank you for your feedback!',
    78             'review_wall_btn_step_3'         => 'Home',
     66            'review_wall_logo'                  => '',
     67            'review_wall_rating_threshold'      => 3,
     68            'review_wall_default_url'           => '',
     69            'review_wall_google_average_rating' => '',
     70            'review_wall_google_total_reviews'  => '',
     71            'review_wall_google_reviews_link'   => '',
     72            'review_wall_title_step_1'          => 'Your thoughts are important to us!',
     73            'review_wall_description_step_1'    => 'Thank you for choosing us! Share your impressions of our product and service by clicking on the stars below.',
     74            'review_wall_btn_step_1'            => 'Continue',
     75            'review_wall_title_step_2'          => 'We are very sorry that you were not satisfied :(',
     76            'review_wall_description_step_2'    => 'Your assessment shows that something went wrong. Write the details and we will contact you to resolve the issue.',
     77            'review_wall_comment_label'         => 'Your comment',
     78            'review_wall_email_label'           => 'Your email',
     79            'review_wall_btn_step_2'            => 'Leave a review',
     80            'review_wall_title_step_3'          => 'Thank you for your feedback!',
     81            'review_wall_btn_step_3'            => 'Home',
    7982        ];
    8083
  • review-wall/trunk/includes/classes/class-review-wall-admin.php

    r3331651 r3339402  
    3535            6
    3636        );
     37
     38        add_submenu_page(
     39            'review-wall',
     40            __('Google Reviews', 'review-wall'),
     41            __('Google Reviews', 'review-wall'),
     42            'manage_options',
     43            'review-wall-google-reviews',
     44            [self::class, 'render_google_reviews_page']
     45        );
    3746    }
    3847
     
    4756            'review_wall_rating_threshold',
    4857            'review_wall_default_url',
     58            'review_wall_google_average_rating',
     59            'review_wall_google_total_reviews',
     60            'review_wall_google_reviews_link',
    4961            'review_wall_title_step_1',
    5062            'review_wall_description_step_1',
     
    7486    public static function render_main_page()
    7587    {
    76         Review_Wall::load_template('/admin/review-wall-page-main.php');
     88        Review_Wall::load_template('/admin/pages/dashboard.php');
     89    }
     90
     91    /**
     92     * Renders the Google Reviews page.
     93     */
     94    public static function render_google_reviews_page()
     95    {
     96        Review_Wall::load_template('/admin/pages/google-reviews.php');
    7797    }
    7898}
  • review-wall/trunk/includes/classes/class-review-wall-assets.php

    r3331651 r3339402  
    2323    /**
    2424     * Enqueues admin-specific styles and scripts.
    25      * 
     25     *
    2626     * @param string $hook Current admin page hook.
    2727     */
     
    2929    {
    3030        // Only load on the Review Wall admin page
    31         if ('toplevel_page_review-wall' == $hook) {
     31        if (strpos($hook, 'review-wall') !== false) {
    3232            // Enqueue the media uploader
    3333            wp_enqueue_media();
    3434
    35             // Enqueue admin styles and scripts
    36             wp_enqueue_style('review-wall-admin-css', REVIEWS_WALL_URL . 'assets/css/admin/review-wall-admin.css', [], '1.0.0');
    37             wp_enqueue_script('review-wall-admin-js', REVIEWS_WALL_URL . 'assets/js/admin/review-wall-admin.js', ['jquery'], '1.0.0', true);
     35            // Enqueue admin styles
     36            wp_enqueue_style('swiper-css', REVIEWS_WALL_URL . 'assets/css/libs/swiper-bundle.min.css', [], REVIEW_WALL_VERSION);
     37            wp_enqueue_style('base-css', REVIEWS_WALL_URL . 'assets/css/admin/base.css', [], REVIEW_WALL_VERSION);
     38            wp_enqueue_style('dashboard-css', REVIEWS_WALL_URL . 'assets/css/admin/pages/dashboard.css', [], REVIEW_WALL_VERSION);
     39            wp_enqueue_style('google-reviews-css', REVIEWS_WALL_URL . 'assets/css/admin/pages/google-reviews.css', [], REVIEW_WALL_VERSION);
     40
     41            // Enqueue admin scripts
     42            wp_enqueue_script(
     43                'swiper-js',
     44                REVIEWS_WALL_URL . 'assets/js/libs/swiper-bundle.min.js',
     45                [],
     46                REVIEW_WALL_VERSION,
     47                true
     48            );
     49
     50            wp_enqueue_script(
     51                'review-wall-admin-common-js',
     52                REVIEWS_WALL_URL . 'assets/js/admin/admin-common.js',
     53                ['jquery'],
     54                REVIEW_WALL_VERSION,
     55                true
     56            );
     57
     58            wp_enqueue_script(
     59                'review-wall-dashboard-js',
     60                REVIEWS_WALL_URL . 'assets/js/admin/pages/dashboard.js',
     61                ['jquery', 'review-wall-admin-common-js'],
     62                REVIEW_WALL_VERSION,
     63                true
     64            );
     65
     66            wp_enqueue_script(
     67                'review-wall-google-reviews-js',
     68                REVIEWS_WALL_URL . 'assets/js/admin/pages/google-reviews.js',
     69                ['jquery', 'swiper-js', 'review-wall-admin-common-js'],
     70                REVIEW_WALL_VERSION,
     71                true
     72            );
     73
     74            // Localize reviewWallParams into main JS file
     75            wp_localize_script('review-wall-admin-common-js', 'reviewWallParams', [
     76                'ajax_url' => admin_url('admin-ajax.php'),
     77                'nonce'    => wp_create_nonce('review_wall_nonce'),
     78            ]);
    3879        }
    3980    }
     
    4485    public static function enqueue_frontend_scripts()
    4586    {
    46         // Enqueue frontend styles and scripts
    47         wp_enqueue_style('review-wall-frontend-css', REVIEWS_WALL_URL . 'assets/css/frontend/review-wall-frontend.css', [], '1.0.0');
    48         wp_enqueue_script('review-wall-frontend-js', REVIEWS_WALL_URL . 'assets/js/frontend/review-wall-frontend.js', ['jquery'], '1.0.0', true);
     87        // Enqueue frontend styles
     88        wp_enqueue_style('swiper-css', REVIEWS_WALL_URL . 'assets/css/libs/swiper-bundle.min.css', [], REVIEW_WALL_VERSION);
     89        wp_enqueue_style('review-wall-page-css', REVIEWS_WALL_URL . 'assets/css/frontend/review-wall-page.css', [], REVIEW_WALL_VERSION);
     90        wp_enqueue_style('review-wall-google-widget-css', REVIEWS_WALL_URL . 'assets/css/frontend/review-wall-google-widget.css', [], REVIEW_WALL_VERSION);
    4991
    50         // Localize script with data
    51         self::localize_script();
    52     }
     92        // Enqueue frontend scripts
     93        wp_enqueue_script(
     94            'swiper-js',
     95            REVIEWS_WALL_URL . 'assets/js/libs/swiper-bundle.min.js',
     96            [],
     97            REVIEW_WALL_VERSION,
     98            true
     99        );
    53100
    54     /**
    55      * Localizes script with nonce and ajax URL.
    56      */
    57     public static function localize_script()
    58     {
    59         wp_localize_script('review-wall-frontend-js', 'reviewWallParams', [
     101        wp_enqueue_script(
     102            'review-wall-frontend-common-js',
     103            REVIEWS_WALL_URL . 'assets/js/frontend/frontend-common.js',
     104            ['jquery'],
     105            REVIEW_WALL_VERSION,
     106            true
     107        );
     108
     109        wp_enqueue_script(
     110            'review-wall-page-js',
     111            REVIEWS_WALL_URL . 'assets/js/frontend/review-wall-page.js',
     112            ['jquery', 'review-wall-frontend-common-js'],
     113            REVIEW_WALL_VERSION,
     114            true
     115        );
     116
     117        wp_enqueue_script(
     118            'review-wall-google-widget-js',
     119            REVIEWS_WALL_URL . 'assets/js/frontend/review-wall-google-widget.js',
     120            ['jquery', 'swiper-js', 'review-wall-frontend-common-js'],
     121            REVIEW_WALL_VERSION,
     122            true
     123        );
     124
     125        // Localize reviewWallParams into main JS file
     126        wp_localize_script('review-wall-frontend-common-js', 'reviewWallParams', [
    60127            'ajax_url' => admin_url('admin-ajax.php'),
    61             'nonce' => wp_create_nonce('review_wall_nonce'),
    62             // 'rating_threshold' => get_option('review_wall_rating_threshold')
     128            'nonce'    => wp_create_nonce('review_wall_nonce'),
    63129        ]);
    64130    }
  • review-wall/trunk/includes/classes/class-review-wall-db.php

    r3331651 r3339402  
    99     * The table name for the URLs.
    1010     */
    11     private $table_name;
     11    private $table_review_wall_urls;
     12
     13    /**
     14     * The table name for the Google reviews.
     15     */
     16    private $table_review_wall_google_reviews;
    1217
    1318    /**
     
    1722    {
    1823        global $wpdb;
    19         $this->table_name = $wpdb->prefix . 'review_wall_urls';
    20     }
    21 
    22     /**
    23      * Create the database table.
     24        $this->table_review_wall_urls    = $wpdb->prefix . 'review_wall_urls';
     25        $this->table_review_wall_google_reviews = $wpdb->prefix . 'review_wall_google_reviews';
     26    }
     27
     28    /**
     29     * Create the database tables.
    2430     */
    2531    public function create_table()
     
    2834        $charset_collate = $wpdb->get_charset_collate();
    2935
    30         $sql = "CREATE TABLE {$this->table_name} (
     36        $sql = "
     37        CREATE TABLE {$this->table_review_wall_urls} (
    3138            id mediumint(9) NOT NULL AUTO_INCREMENT,
    3239            url_name varchar(255) NOT NULL,
     
    3643            PRIMARY KEY (id),
    3744            UNIQUE KEY url_key (url_key)
    38     ) $charset_collate;";
     45        ) $charset_collate;
     46
     47        CREATE TABLE {$this->table_review_wall_google_reviews} (
     48            id mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
     49            review_author varchar(255) NOT NULL,
     50            review_author_photo text DEFAULT NULL,
     51            review_content text NOT NULL,
     52            review_rating tinyint(2) unsigned NOT NULL,
     53            created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
     54            PRIMARY KEY (id)
     55        ) $charset_collate;       
     56        ";
    3957
    4058        require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
    4159        dbDelta($sql);
    42     }
    43 
    44     /**
    45      * Drop the database table.
    46      */
    47     public function drop_table()
    48     {
    49         global $wpdb;
    50 
    51         // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange
    52         $wpdb->query("DROP TABLE IF EXISTS {$this->table_name}");
    5360    }
    5461
     
    6774        // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery
    6875        return $wpdb->insert(
    69             $this->table_name,
     76            $this->table_review_wall_urls,
    7077            array(
    7178                'url_name' => $url_name,
     
    9299        // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
    93100        return $wpdb->update(
    94             $this->table_name,
     101            $this->table_review_wall_urls,
    95102            array(
    96103                'url_name' => $url_name,
     
    116123        // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
    117124        return $wpdb->delete(
    118             $this->table_name,
     125            $this->table_review_wall_urls,
    119126            array('id' => $id),
    120127            array('%d')
     
    132139
    133140        // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
    134         return $wpdb->get_results("SELECT * FROM {$this->table_name} ORDER BY id DESC");
     141        return $wpdb->get_results("SELECT * FROM {$this->table_review_wall_urls} ORDER BY id DESC");
    135142    }
    136143
     
    146153
    147154        // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
    148         return $wpdb->get_row($wpdb->prepare("SELECT * FROM {$this->table_name} WHERE id = %d", $id));
     155        return $wpdb->get_row($wpdb->prepare("SELECT * FROM {$this->table_review_wall_urls} WHERE id = %d", $id));
    149156    }
    150157
     
    160167
    161168        // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
    162         return $wpdb->get_row($wpdb->prepare("SELECT * FROM {$this->table_name} WHERE url_key = %s", $url_key));
     169        return $wpdb->get_row($wpdb->prepare("SELECT * FROM {$this->table_review_wall_urls} WHERE url_key = %s", $url_key));
    163170    }
    164171
     
    184191        return $short_key;
    185192    }
     193
     194    /**
     195     * Add a new Google review.
     196     *
     197     * @param string $name
     198     * @param string $photo
     199     * @param string $text
     200     * @param int    $rating
     201     * @return int|false Inserted row ID on success, false on failure.
     202     */
     203    public function add_review($name, $photo, $text, $rating)
     204    {
     205        global $wpdb;
     206
     207        // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery
     208        $result = $wpdb->insert(
     209            $this->table_review_wall_google_reviews,
     210            array(
     211                'review_author'       => $name,
     212                'review_author_photo' => $photo,
     213                'review_content'      => $text,
     214                'review_rating'       => $rating,
     215            ),
     216            array('%s', '%s', '%s', '%d')
     217        );
     218
     219        return $result ? $wpdb->insert_id : false;
     220    }
     221
     222    /**
     223     * Retrieve all Google reviews ordered by newest first.
     224     *
     225     * @return array|object[] Array of review objects.
     226     */
     227    public function get_google_reviews()
     228    {
     229        global $wpdb;
     230
     231        // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
     232        return $wpdb->get_results("SELECT * FROM {$this->table_review_wall_google_reviews} ORDER BY id DESC");
     233    }
     234
     235    /**
     236     * Delete a Google review by ID.
     237     *
     238     * @param int $id The review ID.
     239     * @return int|false Number of rows deleted or false on failure.
     240     */
     241    public function delete_google_review($id)
     242    {
     243        global $wpdb;
     244
     245        // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
     246        return $wpdb->delete(
     247            $this->table_review_wall_google_reviews,
     248            array('id' => $id),
     249            array('%d')
     250        );
     251    }
    186252}
  • review-wall/trunk/includes/classes/class-review-wall-form-handler.php

    r3331651 r3339402  
    4242            } elseif ($action === 'save_text_settings') {
    4343                self::save_text_settings();
     44            } elseif ($action === 'save_google_reviews_settings') {
     45                self::save_google_reviews_settings();
     46            } elseif ($action === 'add_manual_google_review') {
     47                self::add_manual_google_review($db);
    4448            }
    4549        }
     
    158162        echo '<div class="notice notice-success is-dismissible"><p>' . esc_html__('Text settings saved successfully!', 'review-wall') . '</p></div>';
    159163    }
     164
     165    /**
     166     * Save google reviews settings.
     167     */
     168    private static function save_google_reviews_settings()
     169    {
     170        $settings_to_save = [
     171            'review_wall_google_average_rating' => 'floatval',
     172            'review_wall_google_total_reviews'  => 'intval',
     173            'review_wall_google_reviews_link'   => 'esc_url_raw',
     174        ];
     175
     176        foreach ($settings_to_save as $setting => $sanitize_function) {
     177            if (isset($_POST[$setting])) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
     178                $value = wp_unslash($_POST[$setting]); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
     179                update_option($setting, $sanitize_function($value));
     180            }
     181        }
     182
     183        echo '<div class="notice notice-success is-dismissible"><p>' . esc_html__('Google Reviews settings saved successfully!', 'review-wall') . '</p></div>';
     184    }
     185
     186    /**
     187     * Add a manually entered Google review.
     188     *
     189     * @param Review_Wall_DB $db The database instance.
     190     */
     191    private static function add_manual_google_review($db)
     192    {
     193        $review_author       = isset($_POST['review_author']) ? sanitize_text_field(wp_unslash($_POST['review_author'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
     194        $review_author_photo = isset($_POST['review_author_photo']) ? intval($_POST['review_author_photo']) : null; // phpcs:ignore WordPress.Security.NonceVerification.Missing
     195        $review_content      = isset($_POST['review_content']) ? sanitize_textarea_field(wp_unslash($_POST['review_content'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
     196        $review_rating       = isset($_POST['review_rating']) ? intval($_POST['review_rating']) : 5; // phpcs:ignore WordPress.Security.NonceVerification.Missing
     197
     198        // Validate fields
     199        if (empty($review_author) || empty($review_content) || $review_rating < 1 || $review_rating > 5) {
     200            echo '<div class="notice notice-error is-dismissible"><p>' . esc_html__('Please fill all required fields.', 'review-wall') . '</p></div>';
     201            return;
     202        }
     203
     204        // Save to DB
     205        $db->add_review($review_author, $review_author_photo, $review_content, $review_rating);
     206
     207        echo '<div class="notice notice-success is-dismissible"><p>' . esc_html__('Review added successfully!', 'review-wall') . '</p></div>';
     208    }
    160209}
  • review-wall/trunk/includes/classes/class-review-wall-page-manager.php

    r3331651 r3339402  
    160160        return $post->post_type === 'page' && $post->post_name === self::PAGE_SLUG;
    161161    }
     162
     163    /**
     164     * Returns the permalink of the review wall page.
     165     *
     166     * @return string|false URL if found, false otherwise.
     167     */
     168    public static function get_page_url()
     169    {
     170        $page = self::find_page();
     171
     172        if ($page) {
     173            return get_permalink($page->ID);
     174        }
     175
     176        return false;
     177    }
    162178}
  • review-wall/trunk/includes/classes/class-review-wall-post-type.php

    r3331651 r3339402  
    129129        remove_meta_box('review_rating_meta_box', 'review_wall', 'normal');
    130130    }
    131 
    132     /**
    133      * Deactivation hook callback: Unregisters the post type and flushes rewrite rules.
    134      * This will not delete any data, only make it unavailable in the admin area.
    135      */
    136     public static function deactivate()
    137     {
    138         flush_rewrite_rules();
    139     }
    140 
    141     /**
    142      * Hook for plugin uninstall to delete all data.
    143      */
    144     public static function uninstall()
    145     {
    146         // Get all posts of type 'review_wall'
    147         $reviews = get_posts([
    148             'post_type' => 'review_wall',
    149             'numberposts' => -1,
    150             'post_status' => 'any'
    151         ]);
    152 
    153         // Delete all retrieved posts
    154         foreach ($reviews as $review) {
    155             wp_delete_post($review->ID, true);
    156         }
    157 
    158         // Optionally, delete related meta data or options
    159     }
    160131}
  • review-wall/trunk/includes/classes/class-review-wall-shortcode.php

    r3331651 r3339402  
    1919        // Add review wall shortcode
    2020        add_shortcode('review_wall', [self::class, 'render_review_wall']);
     21
     22        // Add Google Reviews widget shortcode
     23        add_shortcode('review_wall_google_widget', [self::class, 'render_google_reviews_widget']);
    2124    }
    2225
     
    3841        return ob_get_clean();
    3942    }
     43
     44    /**
     45     * Render the Google Reviews slider/widget
     46     *
     47     * @param array $atts Shortcode attributes (e.g., number, order)
     48     * @return string Rendered reviews HTML
     49     */
     50    public static function render_google_reviews_widget($atts = [])
     51    {
     52        ob_start();
     53
     54        // Load template (optional: pass $atts to customize output)
     55        Review_Wall::load_template('/frontend/google-reviews-widget.php', $atts);
     56
     57        return ob_get_clean();
     58    }
    4059}
  • review-wall/trunk/includes/classes/class-review-wall-uninstall.php

    r3331651 r3339402  
    2929
    3030    /**
    31      * Remove the database table.
     31     * Remove the database tables.
    3232     */
    3333    private static function remove_database_table()
    3434    {
    3535        global $wpdb;
    36         $table_name = $wpdb->prefix . 'review_wall_urls';
    37         $wpdb->query("DROP TABLE IF EXISTS {$table_name}"); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange
     36        $table_review_wall_urls = $wpdb->prefix . 'review_wall_urls';
     37        $table_review_wall_google_reviews = $wpdb->prefix . 'review_wall_google_reviews';
     38
     39        // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange
     40        $wpdb->query("DROP TABLE IF EXISTS {$table_review_wall_urls}");
     41
     42        // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.DirectDatabaseQuery.SchemaChange
     43        $wpdb->query("DROP TABLE IF EXISTS {$table_review_wall_google_reviews}");
    3844    }
    3945
     
    4854            'review_wall_rating_threshold',
    4955            'review_wall_default_url',
     56            'review_wall_google_average_rating',
     57            'review_wall_google_total_reviews',
     58            'review_wall_google_reviews_link',
    5059            'review_wall_title_step_1',
    5160            'review_wall_description_step_1',
     
    6473            delete_option($option);
    6574        }
    66 
    67         // Use a query to find and delete any options that might have been added
    68         global $wpdb;
    69         $wpdb->query("DELETE FROM {$wpdb->options} WHERE option_name LIKE 'review_wall_%'"); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
    7075    }
    7176
     
    8691            wp_delete_post($review->ID, true);
    8792        }
    88 
    89         // Also delete any post meta related to the plugin
    90         global $wpdb;
    91         $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE 'review_wall_%'"); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching
    9293    }
    9394
  • review-wall/trunk/includes/classes/class-review-wall.php

    r3331651 r3339402  
    2727        Review_Wall_Ajax_Frontend::init();
    2828
     29        if (is_admin()) {
     30            Review_Wall_Ajax_Admin::init();
     31        }
     32
    2933        // Initialize hooks and filters
    3034        self::init_hooks();
     
    4549        require_once REVIEWS_WALL_PATH . 'includes/classes/class-review-wall-page-manager.php';
    4650        require_once REVIEWS_WALL_PATH . 'includes/classes/class-review-wall-ajax-frontend.php';
     51        require_once REVIEWS_WALL_PATH . 'includes/classes/class-review-wall-ajax-admin.php';
    4752    }
    4853
  • review-wall/trunk/readme.txt

    r3331651 r3339402  
    44Requires at least: 6.0
    55Tested up to: 6.8
    6 Stable tag: 1.0.0
     6Stable tag: 1.1.0
    77Requires PHP: 8.0
    88License: GPL-2.0+
     
    2020- **Captures feedback from unsatisfied customers** on your own website, preventing negative public reviews while still collecting valuable feedback
    2121
     22In addition, you can **manually add Google Reviews** including author, rating, photo, and review text. The plugin uses these reviews along with statistics such as average rating, total reviews, and Google Review link to generate a customizable review widget that can be embedded anywhere on your site.
     23
    2224== Key Features ==
    2325
     
    2830= Capture negative feedback internally to improve your services
    2931= Generate short, easy-to-share URL keys for each review destination
     32= Manually add Google Reviews with author, rating, photo, and review text
     33= Display a customizable review widget via shortcode, featuring a slider with reviews, average rating, total reviews, and a link to your Google Review page
    3034
    3135== Installation ==
     
    5660- In QR codes displayed in your physical location
    5761
    58 The URL format will be: `yourdomain.com/review-wall/?id=your_unique_key`
     62The URL format will be: `yourdomain.com/feedback/?id=your_unique_key`
     63
     64=== Behavior Without URL Parameter ===
     65
     66If the review page is accessed **without the `id` parameter** in the URL (for example, `yourdomain.com/feedback/`) or if the provided `id` does not match any added URL, the plugin will automatically redirect users to the **default Google Review link** specified in the plugin settings.
     67
     68This ensures that you always have a working review collection link even without a unique URL key.
    5969
    6070=== Managing Customer Feedback ===
     
    6474- You can view all captured feedback in the WordPress admin area
    6575- Use the feedback to improve your business operations
     76
     77=== Using the Review Widget Shortcode ===
     78
     79You can manually add Google Reviews in the plugin admin area by specifying the author, rating, photo, review text, Google Review link, average rating, and total reviews.
     80
     81Based on these manually added reviews and statistics, the plugin generates a customizable review widget.
     82
     83Use the shortcode `[review_wall_widget]` to display the widget anywhere on your site.
     84
     85The widget includes:
     86- A slider showcasing the reviews
     87- Average rating display
     88- Total number of reviews
     89- Link to your Google Review page
     90
     91This allows you to showcase your reviews in a professional and interactive format, helping build trust with your visitors.
    6692
    6793== Frequently Asked Questions ==
     
    79105Yes, you can adjust the rating threshold at any time in the plugin settings.
    80106
     107= How do I display the review widget on my site? =
     108Add the shortcode `[review_wall_widget]` to any post, page, or widget area to display the review slider widget with manually added Google Reviews.
     109
    81110== Support ==
    82111
     
    84113
    85114== Changelog ==
     115
     116= 1.1.0 =
     117* Added manual Google Reviews management
     118* Added customizable review widget shortcode `[review_wall_widget]`:
     119  - Interactive slider showing reviews
     120  - Displays author name, rating, photo, review text
     121  - Shows average rating and total number of reviews
     122  - Includes link to your Google Reviews page
     123* Improved user experience and fixed minor bugs
    86124
    87125= 1.0.0 =
  • review-wall/trunk/review-wall.php

    r3331651 r3339402  
    33/**
    44 * Plugin Name: Review Wall
    5  * Description: A smart review management system that automatically directs positive feedback to Google Reviews and captures negative feedback privately on your website. Create multiple custom review collection points with unique URLs for different locations or services, set custom rating thresholds, and improve your online reputation while gathering valuable customer feedback.
    6  * Version:     1.0.0
     5 * Description: A smart plugin to collect and manage Google Reviews effectively.
     6 * Version:     1.1.0
    77 * Author:      Norml Studio
    88 * Author URI:  https://norml.studio/
     
    1616}
    1717
    18 // Define plugin path
     18// Define constants
     19define('REVIEW_WALL_VERSION', '1.1.0');
    1920define('REVIEWS_WALL_PATH', plugin_dir_path(__FILE__));
    2021define('REVIEWS_WALL_URL', plugin_dir_url(__FILE__));
Note: See TracChangeset for help on using the changeset viewer.