Skip to content

Commit e08346e

Browse files
authored
Merge pull request #82 from n49/slider_v1.1.9
added json schema check and added hidefeed parameter
2 parents 4b99bcc + 5adb8fb commit e08346e

9 files changed

Lines changed: 34 additions & 16 deletions

assets/js/opio-main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function loadMore(business_id) {
138138
}
139139
};
140140
var ent_id = business_id;
141-
var path = `https://op.io/api/entities/mixreviews?entityId=${ent_id}&cache=renew`;
141+
var path = `https://op.io/api/entities/mixreviews?entityId=${ent_id}&cache=renew&hideWidget=true&hideFeed=true`;
142142
xhttp.open("POST", path, true);
143143
var adminApiKey = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOjE2NDQzNDY2MzEsInVzZXJfaWQiOiJrdHN4dzlramxkZ3RzZDNqMSIsImV4cCI6MTI5NzY0NDM0NjYzMX0.FZeMMsZlix1eQ1aJFmQ0MV_L_ezFb4RhrqCIhceTT-w';
144144
xhttp.setRequestHeader("Content-Type", "application/json");

includes/admin-reviews-slider-horizontal-carousel-template.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function isMobileDevice() {
7272
$isMobile = isMobileDevice();
7373

7474
// Make API call to get reviews
75-
$api_url = 'https://op.io/api/entities/reviews-slider?cache=renew&hideWidget=true';
75+
$api_url = 'https://op.io/api/entities/reviews-slider?cache=renew&hideWidget=true&hideFeed=true';
7676

7777
$api_headers = [
7878
'Authorization' => 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOjE2NDQzNDY2MzEsInVzZXJfaWQiOiJrdHN4dzlramxkZ3RzZDNqMSIsImV4cCI6MTI5NzY0NDM0NjYzMX0.FZeMMsZlix1eQ1aJFmQ0MV_L_ezFb4RhrqCIhceTT-w',
@@ -477,7 +477,10 @@ function isMobileDevice() {
477477

478478
<?php if(isset($filteredReviews) && count(array_slice($filteredReviews, 0, 8)) > 3) { ?>
479479

480-
<?php if(isset($feed_object->schema_enabled) && $feed_object->schema_enabled == 'yes') { ?>
480+
<?php if(isset($feed_object->schema_enabled) && $feed_object->schema_enabled == 'yes'
481+
&& isset($business) && !empty($business["name"])
482+
&& isset($aggregateRating) && $aggregateRating > 0
483+
&& isset($totalReviews) && $totalReviews > 0) { ?>
481484

482485
<!-- JSON schema starts-->
483486

includes/admin-reviews-slider-horizontal-template.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function randomColor() {
7272
// Define the function to include the template with parameters
7373

7474
// Make API call to get reviews
75-
$api_url = 'https://op.io/api/entities/reviews-slider?cache=renew&hideWidget=true';
75+
$api_url = 'https://op.io/api/entities/reviews-slider?cache=renew&hideWidget=true&hideFeed=true';
7676

7777
$api_headers = [
7878
'Authorization' => 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOjE2NDQzNDY2MzEsInVzZXJfaWQiOiJrdHN4dzlramxkZ3RzZDNqMSIsImV4cCI6MTI5NzY0NDM0NjYzMX0.FZeMMsZlix1eQ1aJFmQ0MV_L_ezFb4RhrqCIhceTT-w',
@@ -459,7 +459,10 @@ function randomColor() {
459459

460460
<?php if(isset($filteredReviews) && count(array_slice($filteredReviews, 0, 8)) > 3) { ?>
461461

462-
<?php if(isset($feed_object->schema_enabled) && $feed_object->schema_enabled == 'yes') { ?>
462+
<?php if(isset($feed_object->schema_enabled) && $feed_object->schema_enabled == 'yes'
463+
&& isset($business) && !empty($business["name"])
464+
&& isset($aggregateRating) && $aggregateRating > 0
465+
&& isset($totalReviews) && $totalReviews > 0) { ?>
463466

464467
<!-- JSON schema starts-->
465468

includes/admin-reviews-slider-vertical-template.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function randomColor() {
6565
// Define the function to include the template with parameters
6666

6767
// Make API call to get reviews
68-
$api_url = 'https://op.io/api/entities/reviews-slider?cache=renew&hideWidget=true';
68+
$api_url = 'https://op.io/api/entities/reviews-slider?cache=renew&hideWidget=true&hideFeed=true';
6969

7070
$api_headers = [
7171
'Authorization' => 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOjE2NDQzNDY2MzEsInVzZXJfaWQiOiJrdHN4dzlramxkZ3RzZDNqMSIsImV4cCI6MTI5NzY0NDM0NjYzMX0.FZeMMsZlix1eQ1aJFmQ0MV_L_ezFb4RhrqCIhceTT-w',
@@ -327,7 +327,10 @@ function randomColor() {
327327

328328
<?php if(isset($filteredReviews) && count(array_slice($filteredReviews, 0, 7)) > 3) { ?>
329329

330-
<?php if(isset($feed_object->schema_enabled) && $feed_object->schema_enabled == 'yes') { ?>
330+
<?php if(isset($feed_object->schema_enabled) && $feed_object->schema_enabled == 'yes'
331+
&& isset($business) && !empty($business["name"])
332+
&& isset($aggregateRating) && $aggregateRating > 0
333+
&& isset($totalReviews) && $totalReviews > 0) { ?>
331334

332335
<!-- JSON schema starts-->
333336

includes/reviews-slider-horizontal-carousel-template.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function isMobileDevice() {
7777
$isMobile = isMobileDevice();
7878

7979
// Make API call to get reviews
80-
$api_url = 'https://op.io/api/entities/reviews-slider?cache=renew&hideWidget=true';
80+
$api_url = 'https://op.io/api/entities/reviews-slider?cache=renew&hideWidget=true&hideFeed=true';
8181

8282
$api_headers = [
8383
'Authorization' => 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOjE2NDQzNDY2MzEsInVzZXJfaWQiOiJrdHN4dzlramxkZ3RzZDNqMSIsImV4cCI6MTI5NzY0NDM0NjYzMX0.FZeMMsZlix1eQ1aJFmQ0MV_L_ezFb4RhrqCIhceTT-w',
@@ -504,7 +504,10 @@ function isMobileDevice() {
504504
<?php } ?>
505505
</style>
506506

507-
<?php if(isset($feed_object->schema_enabled) && $feed_object->schema_enabled == 'yes') { ?>
507+
<?php if(isset($feed_object->schema_enabled) && $feed_object->schema_enabled == 'yes'
508+
&& isset($business) && !empty($business["name"])
509+
&& isset($aggregateRating) && $aggregateRating > 0
510+
&& isset($totalReviews) && $totalReviews > 0) { ?>
508511

509512
<!-- JSON schema starts-->
510513

includes/reviews-slider-horizontal-template.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function randomColor() {
8181
// Define the function to include the template with parameters
8282

8383
// Make API call to get reviews
84-
$api_url = 'https://op.io/api/entities/reviews-slider?cache=renew&hideWidget=true';
84+
$api_url = 'https://op.io/api/entities/reviews-slider?cache=renew&hideWidget=true&hideFeed=true';
8585

8686
$api_headers = [
8787
'Authorization' => 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOjE2NDQzNDY2MzEsInVzZXJfaWQiOiJrdHN4dzlramxkZ3RzZDNqMSIsImV4cCI6MTI5NzY0NDM0NjYzMX0.FZeMMsZlix1eQ1aJFmQ0MV_L_ezFb4RhrqCIhceTT-w',
@@ -491,7 +491,10 @@ function randomColor() {
491491
<?php } ?>
492492
</style>
493493

494-
<?php if(isset($feed_object->schema_enabled) && $feed_object->schema_enabled == 'yes') { ?>
494+
<?php if(isset($feed_object->schema_enabled) && $feed_object->schema_enabled == 'yes'
495+
&& isset($business) && !empty($business["name"])
496+
&& isset($aggregateRating) && $aggregateRating > 0
497+
&& isset($totalReviews) && $totalReviews > 0) { ?>
495498

496499
<!-- JSON schema starts-->
497500

includes/reviews-slider-vertical-template.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ function randomColor() {
7171
// Define the function to include the template with parameters
7272

7373
// Make API call to get reviews
74-
$api_url = 'https://op.io/api/entities/reviews-slider?cache=renew&hideWidget=true';
74+
$api_url = 'https://op.io/api/entities/reviews-slider?cache=renew&hideWidget=true&hideFeed=true';
7575

7676
$api_headers = [
7777
'Authorization' => 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOjE2NDQzNDY2MzEsInVzZXJfaWQiOiJrdHN4dzlramxkZ3RzZDNqMSIsImV4cCI6MTI5NzY0NDM0NjYzMX0.FZeMMsZlix1eQ1aJFmQ0MV_L_ezFb4RhrqCIhceTT-w',
@@ -347,7 +347,10 @@ function randomColor() {
347347
}
348348
</style>
349349

350-
<?php if(isset($feed_object->schema_enabled) && $feed_object->schema_enabled == 'yes') { ?>
350+
<?php if(isset($feed_object->schema_enabled) && $feed_object->schema_enabled == 'yes'
351+
&& isset($business) && !empty($business["name"])
352+
&& isset($aggregateRating) && $aggregateRating > 0
353+
&& isset($totalReviews) && $totalReviews > 0) { ?>
351354

352355
<!-- JSON schema starts-->
353356

opio.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Widget for OPIO Reviews
44
Plugin URI:
55
Description: Instantly add OPIO Reviews on your website to increase user confidence and SEO.
6-
Version: 1.1.9
6+
Version: 1.1.11
77
Author: Dhiraj Timalsina <dhiraj@n49.com>
88
Text Domain: widget-for-opio-reviews
99
Domain Path: /languages
@@ -22,7 +22,7 @@
2222

2323
require(ABSPATH . 'wp-includes/version.php');
2424

25-
define('OPIO_PLUGIN_VERSION' , '1.1.9');
25+
define('OPIO_PLUGIN_VERSION' , '1.1.11');
2626
define('OPIO_PLUGIN_FILE' , __FILE__);
2727
define('OPIO_PLUGIN_URL' , plugins_url(basename(plugin_dir_path(__FILE__ )), basename(__FILE__)));
2828
define('OPIO_ASSETS_URL' , OPIO_PLUGIN_URL . '/assets/');

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Author: Dhiraj Timalsina
33
Tags: Widget for OPIO Reviews, opio, reviews, rating, widget, google business, testimonials
44
Tested up to: 6.4
5-
Stable tag: 1.1.9
5+
Stable tag: 1.1.11
66
License: GPLv2 or later
77
License URI: http://www.gnu.org/licenses/gpl-2.0.html
88

0 commit comments

Comments
 (0)