From fe45534a65b5e25086605bdc6afeb78a472df388 Mon Sep 17 00:00:00 2001
From: Gaurav Khupse <44017457+GauravKhupse@users.noreply.github.com>
Date: Thu, 20 Oct 2022 17:03:19 +0530
Subject: [PATCH 1/3] Fixed image issue in the review prodcut schema
---
functions.php | 11 ++++++++++-
meta-boxes.php | 7 +++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/functions.php b/functions.php
index e8e16f5..ee14e9b 100644
--- a/functions.php
+++ b/functions.php
@@ -95,6 +95,7 @@ function display_rich_snippet( $content ) {
$item_pro_price = get_post_meta( $post->ID, '_bsf_item_pro_price', true );
$item_pro_cur = get_post_meta( $post->ID, '_bsf_item_pro_cur', true );
$item_pro_status = get_post_meta( $post->ID, '_bsf_item_pro_status', true );
+ $item_pro_photo = get_post_meta( $post->ID, '_bsf_item_pro_product_image', true );
$item_recp_name = get_post_meta( $post->ID, '_bsf_item_recipes_name', true );
$item_recp_photo = get_post_meta( $post->ID, '_bsf_item_recipes_photo', true );
$item_soft_name = get_post_meta( $post->ID, '_bsf_item_soft_name', true );
@@ -116,6 +117,11 @@ function display_rich_snippet( $content ) {
$review .= '
 . ')
';
$review .= '';
}
+ if ( 'item_product' == $item_review_type ) {
+ $review .= '
';
+ $review .= '
';
+
+ }
if ( '' != trim( $reviewer ) ) {
if ( '' != $args_review['item_reviewer'] ) {
$review .= '
';
@@ -210,6 +216,9 @@ function display_rich_snippet( $content ) {
$review .= "" . esc_attr( stripslashes( $item_product['product_name'] ) ) . '
';
}
$review .= " " . esc_attr( stripslashes( $item_pro_name ) ) . '
';
+ if ( '' != trim( $item_pro_photo ) ) {
+ $review .= '';
+ }
}
if ( '' != trim( $item_pro_price ) ) {
@@ -416,7 +425,7 @@ function display_rich_snippet( $content ) {
$org_latitude = get_post_meta( $post->ID, '_bsf_organization_latitude', true );
$org_longitude = get_post_meta( $post->ID, '_bsf_organization_longitude', true );
if ( '' != trim( $org_name ) ) {
- $organization .= 'Organization Name : ' . esc_attr( $org_nam ) . '';
+ $organization .= 'Organization Name :
' . esc_attr( $org_name ) . ' ';
}
if ( '' != trim( $org_url ) ) {
$organization .= 'Website : ' . esc_attr( $org_url ) . '';
diff --git a/meta-boxes.php b/meta-boxes.php
index 86374dc..92f6a01 100644
--- a/meta-boxes.php
+++ b/meta-boxes.php
@@ -202,6 +202,13 @@ function bsf_metaboxes( array $meta_boxes ) {
'class' => 'product_item_type',
'type' => 'text',
),
+ array(
+ 'name' => __( 'Product Image', 'all-in-one-schemaorg-rich-snippets' ),
+ 'desc' => __( 'Upload the product image or select from library. Medium size is recommended (300px X 300px)', 'all-in-one-schemaorg-rich-snippets' ),
+ 'id' => $prefix . 'item_pro_product_image',
+ 'class' => 'product_item_type',
+ 'type' => 'file',
+ ),
array(
'name' => __( 'Product Price', 'all-in-one-schemaorg-rich-snippets' ),
'desc' => __( 'Enter the product Price.', 'all-in-one-schemaorg-rich-snippets' ),
From cdcfa513c7a7cf6326d8d9630b756a3de328c305 Mon Sep 17 00:00:00 2001
From: Gaurav Khupse <44017457+GauravKhupse@users.noreply.github.com>
Date: Thu, 20 Oct 2022 17:49:39 +0530
Subject: [PATCH 2/3] Fixed phpcbf issue
---
composer.json | 5 +++++
functions.php | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/composer.json b/composer.json
index 22683e5..c92bce7 100644
--- a/composer.json
+++ b/composer.json
@@ -21,5 +21,10 @@
"post-update-cmd": "vendor/bin/cghooks update",
"format": "phpcbf --standard=phpcs.xml.dist",
"lint": "phpcs --standard=phpcs.xml.dist"
+ },
+ "config": {
+ "allow-plugins": {
+ "dealerdirect/phpcodesniffer-composer-installer": true
+ }
}
}
diff --git a/functions.php b/functions.php
index ee14e9b..803b2e4 100644
--- a/functions.php
+++ b/functions.php
@@ -95,7 +95,7 @@ function display_rich_snippet( $content ) {
$item_pro_price = get_post_meta( $post->ID, '_bsf_item_pro_price', true );
$item_pro_cur = get_post_meta( $post->ID, '_bsf_item_pro_cur', true );
$item_pro_status = get_post_meta( $post->ID, '_bsf_item_pro_status', true );
- $item_pro_photo = get_post_meta( $post->ID, '_bsf_item_pro_product_image', true );
+ $item_pro_photo = get_post_meta( $post->ID, '_bsf_item_pro_product_image', true );
$item_recp_name = get_post_meta( $post->ID, '_bsf_item_recipes_name', true );
$item_recp_photo = get_post_meta( $post->ID, '_bsf_item_recipes_photo', true );
$item_soft_name = get_post_meta( $post->ID, '_bsf_item_soft_name', true );
From f8cf8ce8365bb0020f2cb6f7fd3ed69a1e8ea71d Mon Sep 17 00:00:00 2001
From: Gaurav Khupse <44017457+GauravKhupse@users.noreply.github.com>
Date: Thu, 20 Oct 2022 17:53:39 +0530
Subject: [PATCH 3/3] Added changelog line
---
README.md | 3 +++
package-lock.json | 2 +-
readme.txt | 3 +++
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 6a9efad..65fd111 100644
--- a/README.md
+++ b/README.md
@@ -80,6 +80,9 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et
## Changelog ##
+### 1.6.6 ###
+- Fixed - Added image field in the product review schema.
+
### 1.6.5 ###
- Fixed - Code updated according to coding standard.
diff --git a/package-lock.json b/package-lock.json
index 16ffa51..b83a9db 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "all-in-one-schemaorg-rich-snippets",
- "version": "1.6.4",
+ "version": "1.6.5",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/readme.txt b/readme.txt
index 024b7c2..fb8bf06 100644
--- a/readme.txt
+++ b/readme.txt
@@ -80,6 +80,9 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et
== Changelog ==
+= 1.6.6 =
+- Fixed - Added image field in the product review schema.
+
= 1.6.5 =
- Fixed - Code updated according to coding standard.