Changeset 3836821
- Timestamp:
- 12/01/2026 07:15:35 AM (63 minutes ago)
- Location:
- wpinterface-product-reviews
- Files:
-
- 2 added
- 16 edited
- 1 copied
-
tags/1.0.4 (copied) (copied from wpinterface-product-reviews/trunk )
-
tags/1.0.4/languages/wpinterface-product-reviews.pot (modified) (8 diffs)
-
tags/1.0.4/package.json (modified) (1 diff)
-
tags/1.0.4/readme.txt (modified) (4 diffs)
-
tags/1.0.4/src/Admin/Product/ProductMetaBox.php (modified) (3 diffs)
-
tags/1.0.4/src/Frontend/ReviewsRenderer.php (modified) (10 diffs)
-
tags/1.0.4/src/Requests/ReviewLinks.php (modified) (2 diffs)
-
tags/1.0.4/src/Reviews/ReviewMeta.php (modified) (1 diff)
-
tags/1.0.4/src/Reviews/ReviewsLocation.php (added)
-
tags/1.0.4/wpinterface-product-reviews.php (modified) (2 diffs)
-
trunk/languages/wpinterface-product-reviews.pot (modified) (8 diffs)
-
trunk/package.json (modified) (1 diff)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/src/Admin/Product/ProductMetaBox.php (modified) (3 diffs)
-
trunk/src/Frontend/ReviewsRenderer.php (modified) (10 diffs)
-
trunk/src/Requests/ReviewLinks.php (modified) (2 diffs)
-
trunk/src/Reviews/ReviewMeta.php (modified) (1 diff)
-
trunk/src/Reviews/ReviewsLocation.php (added)
-
trunk/wpinterface-product-reviews.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpinterface-product-reviews/tags/1.0.4/languages/wpinterface-product-reviews.pot
r3791721 r3836821 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WPInterface Product Reviews for WooCommerce 1.0. 2\n"5 "Project-Id-Version: WPInterface Product Reviews for WooCommerce 1.0.4\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpinterface-product-reviews\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-11- 07T11:47:53+00:00\n"12 "POT-Creation-Date: 2026-11-30T02:00:52+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 37 37 #: src/Admin/AdminApps.php:64 38 38 #: src/Admin/Menu.php:165 39 #: src/Admin/Product/ProductMetaBox.php: 6939 #: src/Admin/Product/ProductMetaBox.php:70 40 40 #: src/Collection/Account/MyReviews.php:108 41 41 #: assets/src/admin/import/index.js:828 … … 136 136 137 137 #. translators: 1: average rating, 2: number of ratings. 138 #: src/Admin/Product/ProductMetaBox.php:9 5138 #: src/Admin/Product/ProductMetaBox.php:96 139 139 #, php-format 140 140 msgid "Rated %1$s out of 5 from %2$s rating" … … 143 143 msgstr[1] "" 144 144 145 #: src/Admin/Product/ProductMetaBox.php:9 8145 #: src/Admin/Product/ProductMetaBox.php:99 146 146 msgid "No ratings yet." 147 147 msgstr "" 148 148 149 #: src/Admin/Product/ProductMetaBox.php:10 2149 #: src/Admin/Product/ProductMetaBox.php:103 150 150 msgid "Manage this product’s reviews" 151 151 msgstr "" 152 152 153 153 #. translators: %s: number of reviews. 154 #: src/Admin/Product/ProductMetaBox.php:11 6154 #: src/Admin/Product/ProductMetaBox.php:117 155 155 #, php-format 156 156 msgid "%s waiting for approval" … … 159 159 msgstr[1] "" 160 160 161 #: src/Admin/Product/ProductMetaBox.php:12 2161 #: src/Admin/Product/ProductMetaBox.php:123 162 162 msgid "Show the rating breakdown from" 163 163 msgstr "" 164 164 165 #: src/Admin/Product/ProductMetaBox.php:12 3165 #: src/Admin/Product/ProductMetaBox.php:124 166 166 msgid "store default" 167 167 msgstr "" 168 168 169 #: src/Admin/Product/ProductMetaBox.php:12 4169 #: src/Admin/Product/ProductMetaBox.php:125 170 170 msgid "ratings" 171 171 msgstr "" 172 172 173 #: src/Admin/Product/ProductMetaBox.php:12 6173 #: src/Admin/Product/ProductMetaBox.php:127 174 174 msgid "Leave empty to use the store’s setting. Turn reviews on or off for this product under Product data → Advanced." 175 msgstr "" 176 177 #: src/Admin/Product/ProductMetaBox.php:129 178 msgid "Reviews page" 179 msgstr "" 180 181 #: src/Admin/Product/ProductMetaBox.php:130 182 msgid "This product’s page" 183 msgstr "" 184 185 #. translators: %s: shortcode. 186 #: src/Admin/Product/ProductMetaBox.php:135 187 #, php-format 188 msgid "Show this product’s reviews on another page of your site? Add %s to that page and enter its address here. Review request emails and rating links will then go there." 175 189 msgstr "" 176 190 … … 911 925 912 926 #: src/Admin/Tools/Health.php:287 913 msgid "The chosen CAPTCHA comes with Pro, so the form runs without one. Choose Cloudflare Turnstile, or none."927 msgid "The chosen CAPTCHA is not available on this site, so the form runs without one. Choose another CAPTCHA, or none." 914 928 msgstr "" 915 929 … … 1811 1825 msgstr[1] "" 1812 1826 1813 #: src/Frontend/ReviewsRenderer.php:2 391827 #: src/Frontend/ReviewsRenderer.php:240 1814 1828 msgid "Ratings & reviews" 1815 1829 msgstr "" 1816 1830 1817 #: src/Frontend/ReviewsRenderer.php:5 351831 #: src/Frontend/ReviewsRenderer.php:552 1818 1832 msgid "Reviews marked “Verified buyer” come from customers whose order for this product we confirmed. Other reviews are not verified." 1819 1833 msgstr "" 1820 1834 1821 #: src/Frontend/ReviewsRenderer.php:5 361835 #: src/Frontend/ReviewsRenderer.php:553 1822 1836 msgid "We publish positive and negative reviews alike. We only remove reviews that break our review guidelines, such as spam, abuse or personal information." 1823 1837 msgstr "" 1824 1838 1825 #: src/Frontend/ReviewsRenderer.php:5 371839 #: src/Frontend/ReviewsRenderer.php:554 1826 1840 msgid "The overall rating is the average of every published star rating." 1827 1841 msgstr "" 1828 1842 1829 #: src/Frontend/ReviewsRenderer.php:5 381843 #: src/Frontend/ReviewsRenderer.php:555 1830 1844 msgid "Reviews written in exchange for a reward are labelled “Incentivised review”. Rewards never depend on the rating." 1831 1845 msgstr "" 1832 1846 1833 #: src/Frontend/ReviewsRenderer.php:5 561847 #: src/Frontend/ReviewsRenderer.php:573 1834 1848 msgid "No reviews match these filters." 1835 1849 msgstr "" 1836 1850 1837 #: src/Frontend/ReviewsRenderer.php:5 571851 #: src/Frontend/ReviewsRenderer.php:574 1838 1852 msgid "There are no reviews yet." 1839 1853 msgstr "" 1840 1854 1841 1855 #. translators: 1: first review number, 2: last review number, 3: total reviews. 1842 #: src/Frontend/ReviewsRenderer.php:5 611856 #: src/Frontend/ReviewsRenderer.php:578 1843 1857 #, php-format 1844 1858 msgid "Showing %1$s–%2$s of %3$s review" -
wpinterface-product-reviews/tags/1.0.4/package.json
r3791721 r3836821 1 1 { 2 2 "name": "wpinterface-product-reviews", 3 "version": "1.0. 3",3 "version": "1.0.4", 4 4 "private": true, 5 5 "description": "Ratings and reviews for WooCommerce, built for block and classic themes.", -
wpinterface-product-reviews/tags/1.0.4/readme.txt
r3791721 r3836821 3 3 Tags: reviews, product reviews, photo reviews, review request, woocommerce 4 4 Requires at least: 6.9 5 Tested up to: 7. 15 Tested up to: 7.2 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 76 76 It works with block themes and classic themes. The system report on Reviews → Tools shows which way the reviews are added to your product pages. You can copy any template into your theme's `wpinterface-product-reviews` folder to change it. 77 77 78 = I build my pages with Elementor or another page builder. Which shortcodes are there? = 79 80 `[wpipr_reviews product_id="123"]` shows a product's whole reviews section, review form included (`form="no"` leaves the form out). There are also `[wpipr_summary product_id="123"]`, `[wpipr_rating product_id="123"]`, `[wpipr_reviews_list products="12,15"]` and `[wpipr_store_rating]`. In Elementor, put them in a Shortcode widget. The product id is shown under the product's name in Products. To send review request emails to that page instead of the product page, enter its address under Reviews page in the product's Reviews box. 81 78 82 = Does it work with page caching? = 79 83 … … 121 125 == Changelog == 122 126 127 = 1.0.4 = 128 * New: a "Reviews page" for each product. Show a product's reviews on another page of your site, such as an Elementor page with the [wpipr_reviews] shortcode, and review request emails and rating links go there instead of the product page. The review still counts as a verified purchase. 129 * The reviews shortcode on a page other than the product page brings reviewers back to that page after they submit. 130 * "Write a review" is hidden when the reviews section shows no form. 131 * The FAQ lists the shortcodes for page builders. 132 * Tested with WordPress 7.2. 133 123 134 = 1.0.3 = 124 135 * Security: reviews of private, draft or password-protected products, and reviews that are not approved, can no longer be reported, and the answer no longer shows whether they exist. Shortcodes, blocks and forms show nothing for products the visitor cannot see. … … 136 147 == Upgrade Notice == 137 148 149 = 1.0.4 = 150 Adds a per-product "Reviews page" for stores that show reviews on page-builder pages. 151 138 152 = 1.0.3 = 139 153 Fixes from the third WordPress.org review: hidden reviews can no longer be reported. -
wpinterface-product-reviews/tags/1.0.4/src/Admin/Product/ProductMetaBox.php
r3791721 r3836821 14 14 use WPInterface\ProductReviews\Reviews\Aggregates; 15 15 use WPInterface\ProductReviews\Reviews\ReviewMeta; 16 use WPInterface\ProductReviews\Reviews\ReviewsLocation; 16 17 17 18 defined( 'ABSPATH' ) || exit; … … 125 126 </p> 126 127 <p class="description"><?php esc_html_e( 'Leave empty to use the store’s setting. Turn reviews on or off for this product under Product data → Advanced.', 'wpinterface-product-reviews' ); ?></p> 128 <p> 129 <label for="wpipr-review-page"><?php esc_html_e( 'Reviews page', 'wpinterface-product-reviews' ); ?></label> 130 <input type="url" class="widefat" id="wpipr-review-page" name="wpipr_review_page" value="<?php echo esc_attr( ReviewsLocation::custom( $id ) ); ?>" placeholder="<?php esc_attr_e( 'This product’s page', 'wpinterface-product-reviews' ); ?>"> 131 </p> 132 <p class="description"> 133 <?php 134 /* translators: %s: shortcode. */ 135 echo esc_html( sprintf( __( 'Show this product’s reviews on another page of your site? Add %s to that page and enter its address here. Review request emails and rating links will then go there.', 'wpinterface-product-reviews' ), '[wpipr_reviews product_id="' . $id . '"]' ) ); 136 ?> 137 </p> 127 138 <?php 128 139 /** … … 155 166 } 156 167 168 $page = isset( $_POST['wpipr_review_page'] ) ? ReviewsLocation::sanitize( esc_url_raw( wp_unslash( $_POST['wpipr_review_page'] ) ) ) : ''; 169 if ( '' === $page ) { 170 delete_post_meta( $post_id, ReviewMeta::REVIEW_PAGE ); 171 } else { 172 update_post_meta( $post_id, ReviewMeta::REVIEW_PAGE, $page ); 173 } 174 157 175 /** 158 176 * Fires after the Reviews box's fields were saved. -
wpinterface-product-reviews/tags/1.0.4/src/Frontend/ReviewsRenderer.php
r3791721 r3836821 22 22 use WPInterface\ProductReviews\Reviews\Query\ReviewRequest; 23 23 use WPInterface\ProductReviews\Reviews\ReviewMeta; 24 use WPInterface\ProductReviews\Reviews\ReviewsLocation; 24 25 use WPInterface\ProductReviews\Reviews\Summary; 25 26 use WPInterface\ProductReviews\Reviews\View\MediaStrip; … … 230 231 231 232 $title = (string) $this->options->get( 'display', 'section_title' ); 233 $form = $args['show_form'] ? $this->form_html( $product, $summary, $this->form_return_url( $product_id ) ) : ''; 232 234 233 235 $html = $this->templates->render( … … 244 246 'anchor' => $anchor, 245 247 ), 246 'summary' => $this->summary_html( $product, $summary, $query, $base_url, $anchor ), 248 // "Write a review" jumps to the form, so it is left out when the section has none. 249 'summary' => $this->summary_html( $product, $summary, $query, $base_url, $anchor, '' === $form ? '' : '#review_form' ), 247 250 'media' => $this->media_html( $product_id, $section_id ), 248 251 'toolbar' => $summary->review_count > 0 ? $this->toolbar_html( $query, $summary, $base_url, $anchor, $section_id ) : '', 249 252 'results' => $this->results_html( $page, $base_url, $anchor ), 250 'form' => $ args['show_form'] ? $this->form_html( $product, $summary ) : '',253 'form' => $form, 251 254 'lightbox' => $this->templates->render( 'reviews/lightbox.php', array( 'section_id' => $section_id ) ), 252 255 'review_count' => $summary->review_count, … … 320 323 * @param string $base_url Page URL. 321 324 * @param string $anchor Section anchor. 322 * @param string $cta_url "Write a review" link; the form on this page by default .325 * @param string $cta_url "Write a review" link; the form on this page by default, '' for no button. 323 326 */ 324 327 public function summary_html( \WC_Product $product, Summary $summary, ReviewQuery $query, string $base_url, string $anchor, string $cta_url = '#review_form' ): string { … … 334 337 'cta_text' => (string) $this->options->get( 'display', 'cta_text' ), 335 338 'cta_url' => $cta_url, 336 'can_review' => $product->get_reviews_allowed() && comments_open( $product->get_id() ),339 'can_review' => '' !== $cta_url && $product->get_reviews_allowed() && comments_open( $product->get_id() ), 337 340 'disclosure' => $this->options->get( 'display', 'show_disclosure' ) ? $this->disclosure_html() : '', 338 341 ) … … 515 518 * Review form. Phase 1 keeps WooCommerce's own form so reviews can still be submitted. 516 519 * 517 * @param \WC_Product $product Product. 518 * @param Summary $summary Summary. 519 */ 520 public function form_html( \WC_Product $product, Summary $summary ): string { 521 return null === $this->form ? '' : $this->form->render( $product, $summary ); 520 * @param \WC_Product $product Product. 521 * @param Summary $summary Summary. 522 * @param string $redirect_to Where the no-JavaScript form returns; '' for the product page. 523 */ 524 public function form_html( \WC_Product $product, Summary $summary, string $redirect_to = '' ): string { 525 return null === $this->form ? '' : $this->form->render( $product, $summary, $redirect_to ); 526 } 527 528 /** 529 * Where the no-JavaScript form returns after posting: this page when the section is shown 530 * on a page other than the product's own (a shortcode on a landing page), so the 531 * reviewer is not sent to a product page the store may redirect elsewhere. 532 * 533 * @param int $product_id Product id. 534 */ 535 private function form_return_url( int $product_id ): string { 536 if ( ! is_singular() || ( is_singular( 'product' ) && (int) get_queried_object_id() === $product_id ) ) { 537 return ''; 538 } 539 $url = get_permalink( get_queried_object_id() ); 540 return is_string( $url ) ? $url : ''; 522 541 } 523 542 … … 577 596 } 578 597 $this->enqueue(); 579 $permalink = (string) $product->get_permalink(); 580 $on_page = is_singular( 'product' ) && (int) get_queried_object_id() === $product_id; 598 $url = ReviewsLocation::url( $product ); 581 599 582 600 return '<div class="wpipr wpipr-summary-card">' . $this->summary_html( … … 584 602 $this->aggregates->display( $product_id ), 585 603 $this->query( array( $product_id ), array() ), 586 $ permalink,587 'reviews',588 $on_page ? '#review_form' : $permalink. '#review_form'604 $url, 605 self::anchor( $product ), 606 ReviewsLocation::is_current( $product ) ? '#review_form' : $url . '#review_form' 589 607 ) . '</div>'; 590 608 } … … 603 621 } 604 622 $this->assets->enqueue_style( Assets::FRONTEND_STYLE ); 605 $ on_page = is_singular( 'product' ) && (int) get_queried_object_id() === $product_id;623 $anchor = '#' . self::anchor( $product ); 606 624 607 625 return $this->templates->render( … … 610 628 'summary' => $this->aggregates->display( $product_id ), 611 629 'show_count' => $show_count, 612 'link' => $link ? ( $on_page ? '#reviews' : (string) $product->get_permalink() . '#reviews') : '',630 'link' => $link ? ( ReviewsLocation::is_current( $product ) ? $anchor : ReviewsLocation::url( $product ) . $anchor ) : '', 613 631 ) 614 632 ); 633 } 634 635 /** 636 * Element id of the product's reviews section on its reviews page: "reviews" on the 637 * product page, the section's own id on a page set as its "Reviews page". 638 * 639 * @param \WC_Product $product Product. 640 */ 641 private static function anchor( \WC_Product $product ): string { 642 $on_product = is_singular( 'product' ) && (int) get_queried_object_id() === $product->get_id(); 643 return $on_product || '' === ReviewsLocation::custom( $product->get_id() ) ? 'reviews' : 'wpipr-reviews-' . $product->get_id(); 615 644 } 616 645 -
wpinterface-product-reviews/tags/1.0.4/src/Requests/ReviewLinks.php
r3791721 r3836821 10 10 namespace WPInterface\ProductReviews\Requests; 11 11 12 use WPInterface\ProductReviews\Reviews\ReviewsLocation; 13 12 14 defined( 'ABSPATH' ) || exit; 13 15 14 16 /** 15 * Lite links each product to its own page , where the token marks the review as written for16 * t he order. Pro links to the "Review your order" page, where every item can be reviewed at17 * once. Star links pre-select the rating.17 * Lite links each product to its own page (or the "Reviews page" set for it), where the 18 * token marks the review as written for the order. Pro links to the "Review your order" 19 * page, where every item can be reviewed at once. Star links pre-select the rating. 18 20 */ 19 21 final class ReviewLinks { … … 57 59 } 58 60 59 $url = (string) $product->get_permalink();61 $url = ReviewsLocation::url( $product ); 60 62 $args = array(); 61 63 if ( '' !== $token ) { -
wpinterface-product-reviews/tags/1.0.4/src/Reviews/ReviewMeta.php
r3791721 r3836821 70 70 public const MIN_RATINGS = '_wpipr_min_ratings'; 71 71 72 // Product meta: page on this site where the product's reviews and form are shown, when 73 // not the product page (empty: the product page). See ReviewsLocation. 74 public const REVIEW_PAGE = '_wpipr_review_page'; 75 72 76 /** 73 77 * Comment meta keys whose change affects a product's summary. -
wpinterface-product-reviews/tags/1.0.4/wpinterface-product-reviews.php
r3791721 r3836821 4 4 * Plugin URI: https://wpinterface.com/plugins/wpinterface-product-reviews/ 5 5 * Description: Photo reviews, review request emails and a faster, clearer reviews section for WooCommerce, for block and classic themes. 6 * Version: 1.0. 36 * Version: 1.0.4 7 7 * Author: WPInterface 8 8 * Author URI: https://wpinterface.com/ … … 78 78 } 79 79 80 define( 'WPIPR_VERSION', '1.0. 3' );80 define( 'WPIPR_VERSION', '1.0.4' ); 81 81 define( 'WPIPR_PLUGIN_FILE', __FILE__ ); 82 82 define( 'WPIPR_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); -
wpinterface-product-reviews/trunk/languages/wpinterface-product-reviews.pot
r3791721 r3836821 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WPInterface Product Reviews for WooCommerce 1.0. 2\n"5 "Project-Id-Version: WPInterface Product Reviews for WooCommerce 1.0.4\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wpinterface-product-reviews\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-11- 07T11:47:53+00:00\n"12 "POT-Creation-Date: 2026-11-30T02:00:52+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 37 37 #: src/Admin/AdminApps.php:64 38 38 #: src/Admin/Menu.php:165 39 #: src/Admin/Product/ProductMetaBox.php: 6939 #: src/Admin/Product/ProductMetaBox.php:70 40 40 #: src/Collection/Account/MyReviews.php:108 41 41 #: assets/src/admin/import/index.js:828 … … 136 136 137 137 #. translators: 1: average rating, 2: number of ratings. 138 #: src/Admin/Product/ProductMetaBox.php:9 5138 #: src/Admin/Product/ProductMetaBox.php:96 139 139 #, php-format 140 140 msgid "Rated %1$s out of 5 from %2$s rating" … … 143 143 msgstr[1] "" 144 144 145 #: src/Admin/Product/ProductMetaBox.php:9 8145 #: src/Admin/Product/ProductMetaBox.php:99 146 146 msgid "No ratings yet." 147 147 msgstr "" 148 148 149 #: src/Admin/Product/ProductMetaBox.php:10 2149 #: src/Admin/Product/ProductMetaBox.php:103 150 150 msgid "Manage this product’s reviews" 151 151 msgstr "" 152 152 153 153 #. translators: %s: number of reviews. 154 #: src/Admin/Product/ProductMetaBox.php:11 6154 #: src/Admin/Product/ProductMetaBox.php:117 155 155 #, php-format 156 156 msgid "%s waiting for approval" … … 159 159 msgstr[1] "" 160 160 161 #: src/Admin/Product/ProductMetaBox.php:12 2161 #: src/Admin/Product/ProductMetaBox.php:123 162 162 msgid "Show the rating breakdown from" 163 163 msgstr "" 164 164 165 #: src/Admin/Product/ProductMetaBox.php:12 3165 #: src/Admin/Product/ProductMetaBox.php:124 166 166 msgid "store default" 167 167 msgstr "" 168 168 169 #: src/Admin/Product/ProductMetaBox.php:12 4169 #: src/Admin/Product/ProductMetaBox.php:125 170 170 msgid "ratings" 171 171 msgstr "" 172 172 173 #: src/Admin/Product/ProductMetaBox.php:12 6173 #: src/Admin/Product/ProductMetaBox.php:127 174 174 msgid "Leave empty to use the store’s setting. Turn reviews on or off for this product under Product data → Advanced." 175 msgstr "" 176 177 #: src/Admin/Product/ProductMetaBox.php:129 178 msgid "Reviews page" 179 msgstr "" 180 181 #: src/Admin/Product/ProductMetaBox.php:130 182 msgid "This product’s page" 183 msgstr "" 184 185 #. translators: %s: shortcode. 186 #: src/Admin/Product/ProductMetaBox.php:135 187 #, php-format 188 msgid "Show this product’s reviews on another page of your site? Add %s to that page and enter its address here. Review request emails and rating links will then go there." 175 189 msgstr "" 176 190 … … 911 925 912 926 #: src/Admin/Tools/Health.php:287 913 msgid "The chosen CAPTCHA comes with Pro, so the form runs without one. Choose Cloudflare Turnstile, or none."927 msgid "The chosen CAPTCHA is not available on this site, so the form runs without one. Choose another CAPTCHA, or none." 914 928 msgstr "" 915 929 … … 1811 1825 msgstr[1] "" 1812 1826 1813 #: src/Frontend/ReviewsRenderer.php:2 391827 #: src/Frontend/ReviewsRenderer.php:240 1814 1828 msgid "Ratings & reviews" 1815 1829 msgstr "" 1816 1830 1817 #: src/Frontend/ReviewsRenderer.php:5 351831 #: src/Frontend/ReviewsRenderer.php:552 1818 1832 msgid "Reviews marked “Verified buyer” come from customers whose order for this product we confirmed. Other reviews are not verified." 1819 1833 msgstr "" 1820 1834 1821 #: src/Frontend/ReviewsRenderer.php:5 361835 #: src/Frontend/ReviewsRenderer.php:553 1822 1836 msgid "We publish positive and negative reviews alike. We only remove reviews that break our review guidelines, such as spam, abuse or personal information." 1823 1837 msgstr "" 1824 1838 1825 #: src/Frontend/ReviewsRenderer.php:5 371839 #: src/Frontend/ReviewsRenderer.php:554 1826 1840 msgid "The overall rating is the average of every published star rating." 1827 1841 msgstr "" 1828 1842 1829 #: src/Frontend/ReviewsRenderer.php:5 381843 #: src/Frontend/ReviewsRenderer.php:555 1830 1844 msgid "Reviews written in exchange for a reward are labelled “Incentivised review”. Rewards never depend on the rating." 1831 1845 msgstr "" 1832 1846 1833 #: src/Frontend/ReviewsRenderer.php:5 561847 #: src/Frontend/ReviewsRenderer.php:573 1834 1848 msgid "No reviews match these filters." 1835 1849 msgstr "" 1836 1850 1837 #: src/Frontend/ReviewsRenderer.php:5 571851 #: src/Frontend/ReviewsRenderer.php:574 1838 1852 msgid "There are no reviews yet." 1839 1853 msgstr "" 1840 1854 1841 1855 #. translators: 1: first review number, 2: last review number, 3: total reviews. 1842 #: src/Frontend/ReviewsRenderer.php:5 611856 #: src/Frontend/ReviewsRenderer.php:578 1843 1857 #, php-format 1844 1858 msgid "Showing %1$s–%2$s of %3$s review" -
wpinterface-product-reviews/trunk/package.json
r3791721 r3836821 1 1 { 2 2 "name": "wpinterface-product-reviews", 3 "version": "1.0. 3",3 "version": "1.0.4", 4 4 "private": true, 5 5 "description": "Ratings and reviews for WooCommerce, built for block and classic themes.", -
wpinterface-product-reviews/trunk/readme.txt
r3791721 r3836821 3 3 Tags: reviews, product reviews, photo reviews, review request, woocommerce 4 4 Requires at least: 6.9 5 Tested up to: 7. 15 Tested up to: 7.2 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 76 76 It works with block themes and classic themes. The system report on Reviews → Tools shows which way the reviews are added to your product pages. You can copy any template into your theme's `wpinterface-product-reviews` folder to change it. 77 77 78 = I build my pages with Elementor or another page builder. Which shortcodes are there? = 79 80 `[wpipr_reviews product_id="123"]` shows a product's whole reviews section, review form included (`form="no"` leaves the form out). There are also `[wpipr_summary product_id="123"]`, `[wpipr_rating product_id="123"]`, `[wpipr_reviews_list products="12,15"]` and `[wpipr_store_rating]`. In Elementor, put them in a Shortcode widget. The product id is shown under the product's name in Products. To send review request emails to that page instead of the product page, enter its address under Reviews page in the product's Reviews box. 81 78 82 = Does it work with page caching? = 79 83 … … 121 125 == Changelog == 122 126 127 = 1.0.4 = 128 * New: a "Reviews page" for each product. Show a product's reviews on another page of your site, such as an Elementor page with the [wpipr_reviews] shortcode, and review request emails and rating links go there instead of the product page. The review still counts as a verified purchase. 129 * The reviews shortcode on a page other than the product page brings reviewers back to that page after they submit. 130 * "Write a review" is hidden when the reviews section shows no form. 131 * The FAQ lists the shortcodes for page builders. 132 * Tested with WordPress 7.2. 133 123 134 = 1.0.3 = 124 135 * Security: reviews of private, draft or password-protected products, and reviews that are not approved, can no longer be reported, and the answer no longer shows whether they exist. Shortcodes, blocks and forms show nothing for products the visitor cannot see. … … 136 147 == Upgrade Notice == 137 148 149 = 1.0.4 = 150 Adds a per-product "Reviews page" for stores that show reviews on page-builder pages. 151 138 152 = 1.0.3 = 139 153 Fixes from the third WordPress.org review: hidden reviews can no longer be reported. -
wpinterface-product-reviews/trunk/src/Admin/Product/ProductMetaBox.php
r3791721 r3836821 14 14 use WPInterface\ProductReviews\Reviews\Aggregates; 15 15 use WPInterface\ProductReviews\Reviews\ReviewMeta; 16 use WPInterface\ProductReviews\Reviews\ReviewsLocation; 16 17 17 18 defined( 'ABSPATH' ) || exit; … … 125 126 </p> 126 127 <p class="description"><?php esc_html_e( 'Leave empty to use the store’s setting. Turn reviews on or off for this product under Product data → Advanced.', 'wpinterface-product-reviews' ); ?></p> 128 <p> 129 <label for="wpipr-review-page"><?php esc_html_e( 'Reviews page', 'wpinterface-product-reviews' ); ?></label> 130 <input type="url" class="widefat" id="wpipr-review-page" name="wpipr_review_page" value="<?php echo esc_attr( ReviewsLocation::custom( $id ) ); ?>" placeholder="<?php esc_attr_e( 'This product’s page', 'wpinterface-product-reviews' ); ?>"> 131 </p> 132 <p class="description"> 133 <?php 134 /* translators: %s: shortcode. */ 135 echo esc_html( sprintf( __( 'Show this product’s reviews on another page of your site? Add %s to that page and enter its address here. Review request emails and rating links will then go there.', 'wpinterface-product-reviews' ), '[wpipr_reviews product_id="' . $id . '"]' ) ); 136 ?> 137 </p> 127 138 <?php 128 139 /** … … 155 166 } 156 167 168 $page = isset( $_POST['wpipr_review_page'] ) ? ReviewsLocation::sanitize( esc_url_raw( wp_unslash( $_POST['wpipr_review_page'] ) ) ) : ''; 169 if ( '' === $page ) { 170 delete_post_meta( $post_id, ReviewMeta::REVIEW_PAGE ); 171 } else { 172 update_post_meta( $post_id, ReviewMeta::REVIEW_PAGE, $page ); 173 } 174 157 175 /** 158 176 * Fires after the Reviews box's fields were saved. -
wpinterface-product-reviews/trunk/src/Frontend/ReviewsRenderer.php
r3791721 r3836821 22 22 use WPInterface\ProductReviews\Reviews\Query\ReviewRequest; 23 23 use WPInterface\ProductReviews\Reviews\ReviewMeta; 24 use WPInterface\ProductReviews\Reviews\ReviewsLocation; 24 25 use WPInterface\ProductReviews\Reviews\Summary; 25 26 use WPInterface\ProductReviews\Reviews\View\MediaStrip; … … 230 231 231 232 $title = (string) $this->options->get( 'display', 'section_title' ); 233 $form = $args['show_form'] ? $this->form_html( $product, $summary, $this->form_return_url( $product_id ) ) : ''; 232 234 233 235 $html = $this->templates->render( … … 244 246 'anchor' => $anchor, 245 247 ), 246 'summary' => $this->summary_html( $product, $summary, $query, $base_url, $anchor ), 248 // "Write a review" jumps to the form, so it is left out when the section has none. 249 'summary' => $this->summary_html( $product, $summary, $query, $base_url, $anchor, '' === $form ? '' : '#review_form' ), 247 250 'media' => $this->media_html( $product_id, $section_id ), 248 251 'toolbar' => $summary->review_count > 0 ? $this->toolbar_html( $query, $summary, $base_url, $anchor, $section_id ) : '', 249 252 'results' => $this->results_html( $page, $base_url, $anchor ), 250 'form' => $ args['show_form'] ? $this->form_html( $product, $summary ) : '',253 'form' => $form, 251 254 'lightbox' => $this->templates->render( 'reviews/lightbox.php', array( 'section_id' => $section_id ) ), 252 255 'review_count' => $summary->review_count, … … 320 323 * @param string $base_url Page URL. 321 324 * @param string $anchor Section anchor. 322 * @param string $cta_url "Write a review" link; the form on this page by default .325 * @param string $cta_url "Write a review" link; the form on this page by default, '' for no button. 323 326 */ 324 327 public function summary_html( \WC_Product $product, Summary $summary, ReviewQuery $query, string $base_url, string $anchor, string $cta_url = '#review_form' ): string { … … 334 337 'cta_text' => (string) $this->options->get( 'display', 'cta_text' ), 335 338 'cta_url' => $cta_url, 336 'can_review' => $product->get_reviews_allowed() && comments_open( $product->get_id() ),339 'can_review' => '' !== $cta_url && $product->get_reviews_allowed() && comments_open( $product->get_id() ), 337 340 'disclosure' => $this->options->get( 'display', 'show_disclosure' ) ? $this->disclosure_html() : '', 338 341 ) … … 515 518 * Review form. Phase 1 keeps WooCommerce's own form so reviews can still be submitted. 516 519 * 517 * @param \WC_Product $product Product. 518 * @param Summary $summary Summary. 519 */ 520 public function form_html( \WC_Product $product, Summary $summary ): string { 521 return null === $this->form ? '' : $this->form->render( $product, $summary ); 520 * @param \WC_Product $product Product. 521 * @param Summary $summary Summary. 522 * @param string $redirect_to Where the no-JavaScript form returns; '' for the product page. 523 */ 524 public function form_html( \WC_Product $product, Summary $summary, string $redirect_to = '' ): string { 525 return null === $this->form ? '' : $this->form->render( $product, $summary, $redirect_to ); 526 } 527 528 /** 529 * Where the no-JavaScript form returns after posting: this page when the section is shown 530 * on a page other than the product's own (a shortcode on a landing page), so the 531 * reviewer is not sent to a product page the store may redirect elsewhere. 532 * 533 * @param int $product_id Product id. 534 */ 535 private function form_return_url( int $product_id ): string { 536 if ( ! is_singular() || ( is_singular( 'product' ) && (int) get_queried_object_id() === $product_id ) ) { 537 return ''; 538 } 539 $url = get_permalink( get_queried_object_id() ); 540 return is_string( $url ) ? $url : ''; 522 541 } 523 542 … … 577 596 } 578 597 $this->enqueue(); 579 $permalink = (string) $product->get_permalink(); 580 $on_page = is_singular( 'product' ) && (int) get_queried_object_id() === $product_id; 598 $url = ReviewsLocation::url( $product ); 581 599 582 600 return '<div class="wpipr wpipr-summary-card">' . $this->summary_html( … … 584 602 $this->aggregates->display( $product_id ), 585 603 $this->query( array( $product_id ), array() ), 586 $ permalink,587 'reviews',588 $on_page ? '#review_form' : $permalink. '#review_form'604 $url, 605 self::anchor( $product ), 606 ReviewsLocation::is_current( $product ) ? '#review_form' : $url . '#review_form' 589 607 ) . '</div>'; 590 608 } … … 603 621 } 604 622 $this->assets->enqueue_style( Assets::FRONTEND_STYLE ); 605 $ on_page = is_singular( 'product' ) && (int) get_queried_object_id() === $product_id;623 $anchor = '#' . self::anchor( $product ); 606 624 607 625 return $this->templates->render( … … 610 628 'summary' => $this->aggregates->display( $product_id ), 611 629 'show_count' => $show_count, 612 'link' => $link ? ( $on_page ? '#reviews' : (string) $product->get_permalink() . '#reviews') : '',630 'link' => $link ? ( ReviewsLocation::is_current( $product ) ? $anchor : ReviewsLocation::url( $product ) . $anchor ) : '', 613 631 ) 614 632 ); 633 } 634 635 /** 636 * Element id of the product's reviews section on its reviews page: "reviews" on the 637 * product page, the section's own id on a page set as its "Reviews page". 638 * 639 * @param \WC_Product $product Product. 640 */ 641 private static function anchor( \WC_Product $product ): string { 642 $on_product = is_singular( 'product' ) && (int) get_queried_object_id() === $product->get_id(); 643 return $on_product || '' === ReviewsLocation::custom( $product->get_id() ) ? 'reviews' : 'wpipr-reviews-' . $product->get_id(); 615 644 } 616 645 -
wpinterface-product-reviews/trunk/src/Requests/ReviewLinks.php
r3791721 r3836821 10 10 namespace WPInterface\ProductReviews\Requests; 11 11 12 use WPInterface\ProductReviews\Reviews\ReviewsLocation; 13 12 14 defined( 'ABSPATH' ) || exit; 13 15 14 16 /** 15 * Lite links each product to its own page , where the token marks the review as written for16 * t he order. Pro links to the "Review your order" page, where every item can be reviewed at17 * once. Star links pre-select the rating.17 * Lite links each product to its own page (or the "Reviews page" set for it), where the 18 * token marks the review as written for the order. Pro links to the "Review your order" 19 * page, where every item can be reviewed at once. Star links pre-select the rating. 18 20 */ 19 21 final class ReviewLinks { … … 57 59 } 58 60 59 $url = (string) $product->get_permalink();61 $url = ReviewsLocation::url( $product ); 60 62 $args = array(); 61 63 if ( '' !== $token ) { -
wpinterface-product-reviews/trunk/src/Reviews/ReviewMeta.php
r3791721 r3836821 70 70 public const MIN_RATINGS = '_wpipr_min_ratings'; 71 71 72 // Product meta: page on this site where the product's reviews and form are shown, when 73 // not the product page (empty: the product page). See ReviewsLocation. 74 public const REVIEW_PAGE = '_wpipr_review_page'; 75 72 76 /** 73 77 * Comment meta keys whose change affects a product's summary. -
wpinterface-product-reviews/trunk/wpinterface-product-reviews.php
r3791721 r3836821 4 4 * Plugin URI: https://wpinterface.com/plugins/wpinterface-product-reviews/ 5 5 * Description: Photo reviews, review request emails and a faster, clearer reviews section for WooCommerce, for block and classic themes. 6 * Version: 1.0. 36 * Version: 1.0.4 7 7 * Author: WPInterface 8 8 * Author URI: https://wpinterface.com/ … … 78 78 } 79 79 80 define( 'WPIPR_VERSION', '1.0. 3' );80 define( 'WPIPR_VERSION', '1.0.4' ); 81 81 define( 'WPIPR_PLUGIN_FILE', __FILE__ ); 82 82 define( 'WPIPR_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
Note:
See TracChangeset
for help on using the changeset viewer.