All In One Schema Rich Snippets - Version 1.4.2

Version Description

  • Improvement: Added company/organization and address in people schema.
  • Improvement: Added nutrition & ingredients in recipe schema.
  • Improvement: Added software image & operating system in software application schema.
  • Improvement: Added video description in software application schema.
  • Improvement: Added author, publisher - organization and publisher logo in article schema.
  • Improvement: Added provider location, provider location image, and telephone in service schema.
  • Improvement: Changes admin bar test rich snippet redirect link to the structured data testing tool.
  • Fix: removed all error in schema according to structured data testing tool.
Download this release

Release Info

Developer Nikschavan
Plugin Icon 128x128 All In One Schema Rich Snippets
Version 1.4.2
Comparing to
See all releases

Code changes from version 1.4.1 to 1.4.2

Files changed (8) hide show
  1. README.md +15 -2
  2. admin/index.php +48 -8
  3. css/style.css +2 -2
  4. functions.php +226 -128
  5. index.php +5 -9
  6. meta-boxes.php +75 -62
  7. readme.txt +13 -3
  8. settings.php +16 -12
README.md CHANGED
@@ -3,8 +3,8 @@
3
  **Donate link:** https://www.brainstormforce.com
4
  **Tags:** Review, Event, People, Product, Recipe, Software Application, Video, Article, rdfa, rich snippet, schema.org, schema, microdata, microformat, SERP, Google, Yahoo, Bing
5
  **Requires at least:** 3.7
6
- **Tested up to:** 4.7
7
- **Stable tag:** 1.4.1
8
  **License:** GPLv2 or later
9
  **License URI:** http://www.gnu.org/licenses/gpl-2.0.html
10
  Boost CTR. Improve SEO & Rankings. Supports most of the content type. Works perfectly with Google, Bing, Yahoo & Facebook.
@@ -72,6 +72,19 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et
72
 
73
  ## Changelog ##
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  ### 1.4.0 ###
76
  * Added new service schema
77
  * Minor CSS fixes
3
  **Donate link:** https://www.brainstormforce.com
4
  **Tags:** Review, Event, People, Product, Recipe, Software Application, Video, Article, rdfa, rich snippet, schema.org, schema, microdata, microformat, SERP, Google, Yahoo, Bing
5
  **Requires at least:** 3.7
6
+ **Tested up to:** 4.7.3
7
+ **Stable tag:** 1.4.2
8
  **License:** GPLv2 or later
9
  **License URI:** http://www.gnu.org/licenses/gpl-2.0.html
10
  Boost CTR. Improve SEO & Rankings. Supports most of the content type. Works perfectly with Google, Bing, Yahoo & Facebook.
72
 
73
  ## Changelog ##
74
 
75
+ ### 1.4.2 ###
76
+ * Improvement: Added company/organization and address in people schema.
77
+ * Improvement: Added nutrition & ingredients in recipe schema.
78
+ * Improvement: Added software image & operating system in software application schema.
79
+ * Improvement: Added video description in software application schema.
80
+ * Improvement: Added author, publisher - organization and publisher logo in article schema.
81
+ * Improvement: Added provider location, provider location image, and telephone in service schema.
82
+ * Improvement: Changes admin bar test rich snippet redirect link to the structured data testing tool.
83
+ * Fix: removed all error in schema according to structured data testing tool.
84
+
85
+ ### 1.4.1 ###
86
+ * Fix: Compatibility fix WordPress 4.7.
87
+
88
  ### 1.4.0 ###
89
  * Added new service schema
90
  * Minor CSS fixes
admin/index.php CHANGED
@@ -7,14 +7,11 @@ if ( is_admin() )
7
  }
8
  //enqueues the scripts and styles in admin dashboard
9
  function bsf_admin_styles() {
10
- // wp_enqueue_style( 'ui_style' );
11
  wp_enqueue_style( 'star_style' );
12
  wp_enqueue_style( 'meta_style' );
13
  wp_enqueue_script( 'bsf_jquery' );
14
- if(!function_exists('vc_map'))
15
- wp_enqueue_script( 'bsf_jquery_ui' );
16
  wp_enqueue_script( 'bsf_jquery_star' );
17
- /// wp_enqueue_script( 'postbox' );
18
  }
19
  function add_the_script() {
20
  wp_enqueue_script('postbox');
@@ -33,7 +30,34 @@ function rich_snippet_dashboard() {
33
  $args_video = get_option('bsf_video');
34
  $args_article = get_option('bsf_article');
35
  $args_service = get_option('bsf_service');
36
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  $args_color = get_option('bsf_custom');
38
  echo '<div class="wrap">';
39
  echo '<div id="star-icons-32" class="icon32"></div><h2>'.__("All in One Schema.org Rich Snippets - Dashboard","rich-snippets").'</h2>';
@@ -120,6 +144,10 @@ function rich_snippet_dashboard() {
120
  <td align="right"><strong><label>'.__("End Time :","rich-snippets").'</label></strong></td>
121
  <td><input class="bsf_text_medium" type="text" name="end_time" value="'.$args_event["end_time"].'"/></td>
122
  </tr>
 
 
 
 
123
  <tr>
124
  <td align="right"><strong><label>'.__("Ticket Promotion :","rich-snippets").'</label></strong></td>
125
  <td><input class="bsf_text_medium" type="text" name="events_price" value="'.$args_event["events_price"].'"/></td>
@@ -248,6 +276,10 @@ function rich_snippet_dashboard() {
248
  <td align="right"><strong><label>'.__("Recipe Name :","rich-snippets").'</label></strong></td>
249
  <td><input class="bsf_text_medium" type="text" name="recipe_name" value="'.$args_recipe["recipe_name"].'"/></td>
250
  </tr>
 
 
 
 
251
  <tr>
252
  <td align="right"><strong><label>'.__("Published On : ","rich-snippets").'</label></strong></td>
253
  <td><input class="bsf_text_medium" type="text" name="recipe_pub" value="'.$args_recipe["recipe_pub"].'"/></td>
@@ -264,6 +296,10 @@ function rich_snippet_dashboard() {
264
  <td align="right"><strong><label>'.__("Total Time :","rich-snippets").'</label></strong></td>
265
  <td><input class="bsf_text_medium" type="text" name="recipe_time" value="'.$args_recipe["recipe_time"].'"/></td>
266
  </tr>
 
 
 
 
267
  <tr>
268
  <td align="right"><strong><label>'.__("Average Rating:","rich-snippets").'</label></strong></td>
269
  <td><input class="bsf_text_medium" type="text" name="recipe_rating" value="'.$args_recipe["recipe_rating"].'"/></td>
@@ -446,6 +482,10 @@ function rich_snippet_dashboard() {
446
  <td align="right"><strong><label>'.__("Provider Name :","rich-snippets").'</label></strong></td>
447
  <td><input class="bsf_text_medium" type="text" name="service_provider_name" value="'.$args_service["service_provider_name"].'"/></td>
448
  </tr>
 
 
 
 
449
  <tr>
450
  <td align="right"><strong><label>'.__("URL :","rich-snippets").'</label></strong></td>
451
  <td><input class="bsf_text_medium" type="text" name="service_channel" value="'.$args_service["service_channel"].'"/></td>
@@ -617,7 +657,7 @@ if(isset($_POST['item_submit']))
617
  }
618
  if(isset($_POST['event_submit']))
619
  {
620
- foreach(array('snippet_title','event_title','event_location','start_time','end_time','events_price') as $option)
621
  {
622
  if(isset($_POST[$option]))
623
  {
@@ -653,7 +693,7 @@ if(isset($_POST['product_submit']))
653
  }
654
  if(isset($_POST['recipe_submit']))
655
  {
656
- foreach(array('snippet_title','recipe_name','recipe_pub','recipe_prep','recipe_cook','recipe_time','recipe_rating') as $option)
657
  {
658
  if(isset($_POST[$option]))
659
  {
@@ -701,7 +741,7 @@ if(isset($_POST['article_submit']))
701
  }
702
  if(isset($_POST['service_submit']))
703
  {
704
- foreach(array('snippet_title','service_type','service_area','service_desc','service_provider_name','service_rating','service_channel','service_url_link') as $option)
705
  {
706
  if(isset($_POST[$option]))
707
  {
7
  }
8
  //enqueues the scripts and styles in admin dashboard
9
  function bsf_admin_styles() {
 
10
  wp_enqueue_style( 'star_style' );
11
  wp_enqueue_style( 'meta_style' );
12
  wp_enqueue_script( 'bsf_jquery' );
13
+ wp_enqueue_script( 'jquery-ui-core' );
 
14
  wp_enqueue_script( 'bsf_jquery_star' );
 
15
  }
16
  function add_the_script() {
17
  wp_enqueue_script('postbox');
30
  $args_video = get_option('bsf_video');
31
  $args_article = get_option('bsf_article');
32
  $args_service = get_option('bsf_service');
33
+ if(isset($args_event["event_desc"]) ) {
34
+ $event_desc = $args_event["event_desc"];
35
+ }
36
+ else {
37
+ $event_desc = null;
38
+ }
39
+
40
+ if(isset($args_recipe["author_name"])) {
41
+ $author_name = $args_recipe["author_name"];
42
+ }
43
+ else {
44
+ $author_name = null;
45
+ }
46
+
47
+ if(isset($args_recipe["recipe_desc"])) {
48
+ $recipe_desc = $args_recipe["recipe_desc"];
49
+ }
50
+ else {
51
+ $recipe_desc = null;
52
+ }
53
+
54
+ if(isset($args_service["provider_location"])) {
55
+ $provider_location = $args_service["provider_location"];
56
+ }
57
+ else {
58
+ $provider_location = null;
59
+ }
60
+
61
  $args_color = get_option('bsf_custom');
62
  echo '<div class="wrap">';
63
  echo '<div id="star-icons-32" class="icon32"></div><h2>'.__("All in One Schema.org Rich Snippets - Dashboard","rich-snippets").'</h2>';
144
  <td align="right"><strong><label>'.__("End Time :","rich-snippets").'</label></strong></td>
145
  <td><input class="bsf_text_medium" type="text" name="end_time" value="'.$args_event["end_time"].'"/></td>
146
  </tr>
147
+ <tr>
148
+ <td align="right"><strong><label>'.__("Description :","rich-snippets").'</label></strong></td>
149
+ <td><input class="bsf_text_medium" type="text" name="event_desc" value="'.$event_desc.'"/></td>
150
+ </tr>
151
  <tr>
152
  <td align="right"><strong><label>'.__("Ticket Promotion :","rich-snippets").'</label></strong></td>
153
  <td><input class="bsf_text_medium" type="text" name="events_price" value="'.$args_event["events_price"].'"/></td>
276
  <td align="right"><strong><label>'.__("Recipe Name :","rich-snippets").'</label></strong></td>
277
  <td><input class="bsf_text_medium" type="text" name="recipe_name" value="'.$args_recipe["recipe_name"].'"/></td>
278
  </tr>
279
+ <tr>
280
+ <td align="right"><strong><label>'.__("Author Name :","rich-snippets").'</label></strong></td>
281
+ <td><input class="bsf_text_medium" type="text" name="author_name" value="'.$author_name.'"/></td>
282
+ </tr>
283
  <tr>
284
  <td align="right"><strong><label>'.__("Published On : ","rich-snippets").'</label></strong></td>
285
  <td><input class="bsf_text_medium" type="text" name="recipe_pub" value="'.$args_recipe["recipe_pub"].'"/></td>
296
  <td align="right"><strong><label>'.__("Total Time :","rich-snippets").'</label></strong></td>
297
  <td><input class="bsf_text_medium" type="text" name="recipe_time" value="'.$args_recipe["recipe_time"].'"/></td>
298
  </tr>
299
+ <tr>
300
+ <td align="right"><strong><label>'.__("Description :","rich-snippets").'</label></strong></td>
301
+ <td><input class="bsf_text_medium" type="text" name="recipe_desc" value="'.$recipe_desc.'"/></td>
302
+ </tr>
303
  <tr>
304
  <td align="right"><strong><label>'.__("Average Rating:","rich-snippets").'</label></strong></td>
305
  <td><input class="bsf_text_medium" type="text" name="recipe_rating" value="'.$args_recipe["recipe_rating"].'"/></td>
482
  <td align="right"><strong><label>'.__("Provider Name :","rich-snippets").'</label></strong></td>
483
  <td><input class="bsf_text_medium" type="text" name="service_provider_name" value="'.$args_service["service_provider_name"].'"/></td>
484
  </tr>
485
+ <tr>
486
+ <td align="right"><strong><label>'.__("Provider Location :","rich-snippets").'</label></strong></td>
487
+ <td><input class="bsf_text_medium" type="text" name="provider_location" value="'.$provider_location.'"/></td>
488
+ </tr>
489
  <tr>
490
  <td align="right"><strong><label>'.__("URL :","rich-snippets").'</label></strong></td>
491
  <td><input class="bsf_text_medium" type="text" name="service_channel" value="'.$args_service["service_channel"].'"/></td>
657
  }
658
  if(isset($_POST['event_submit']))
659
  {
660
+ foreach(array('snippet_title','event_title','event_location','event_performer','start_time','end_time','event_desc','events_price') as $option)
661
  {
662
  if(isset($_POST[$option]))
663
  {
693
  }
694
  if(isset($_POST['recipe_submit']))
695
  {
696
+ foreach(array('snippet_title','recipe_name','author_name','recipe_pub','recipe_prep','recipe_cook','recipe_time','recipe_desc','recipe_rating') as $option)
697
  {
698
  if(isset($_POST[$option]))
699
  {
741
  }
742
  if(isset($_POST['service_submit']))
743
  {
744
+ foreach(array('snippet_title','service_type','service_area','service_desc','service_provider_name','provider_location','service_rating','service_channel','service_url_link') as $option)
745
  {
746
  if(isset($_POST[$option]))
747
  {
css/style.css CHANGED
@@ -56,7 +56,7 @@ td .tbl-bdf-td{
56
  border-bottom: 1px solid #ACACAC;
57
  clear: both;
58
  padding: 0.5em 0 0.5em 1%;
59
- width: 99%;
60
  float: left;
61
  }
62
  .snippet-label {
@@ -187,4 +187,4 @@ td .tbl-bdf-td{
187
  }
188
  @media (max-width: 320px)
189
  {
190
- }
56
  border-bottom: 1px solid #ACACAC;
57
  clear: both;
58
  padding: 0.5em 0 0.5em 1%;
59
+ width: 100%;
60
  float: left;
61
  }
62
  .snippet-label {
187
  }
188
  @media (max-width: 320px)
189
  {
190
+ }
functions.php CHANGED
@@ -25,12 +25,18 @@ add_action( 'wp_head', 'add_ajax_library' );
25
  /* FUNCTION to check for posts having snippets */
26
  add_action('wp','check_snippet_existence','',7);
27
  function check_snippet_existence(){
28
- global $post;
 
 
 
 
 
29
  $type = get_post_meta($post->ID, '_bsf_post_type', true);
30
  if($type){
31
  add_action( 'wp_head', 'frontend_style' );
32
  add_action('wp_enqueue_scripts', 'enque');
33
- }
 
34
  }
35
  function enque() {
36
  wp_enqueue_style('rating_style', plugin_dir_url(__FILE__) . 'css/jquery.rating.css');
@@ -51,12 +57,13 @@ function display_rich_snippet($content) {
51
  $args_color = get_option('bsf_custom');
52
  $id = $post->ID;
53
  $type = get_post_meta($id, '_bsf_post_type', true);
 
54
  if($type == '1')
55
  {
56
  global $post;
57
 
58
  $args_review = get_option('bsf_review');
59
- $review = $content;
60
  $review .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
61
 
62
  if($args_review['review_title'] != "")
@@ -88,32 +95,38 @@ function display_rich_snippet($content) {
88
  if(trim($rating) != "")
89
  {
90
  if( $args_review['item_rating'] != "")
91
- //$review .= '<span itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">';
92
  $review .= "<div class='snippet-label'>".$args_review['item_rating']."</div>";
93
 
94
  $review .= "<div class='snippet-data'> <span itemprop='reviewRating' itemscope itemtype='http://schema.org/Rating'><span class='rating-value' itemprop='ratingValue'>".$rating."</span></span><span class='star-img'>";
95
  for($i = 1; $i<=ceil($rating); $i++)
96
  {
97
- $review .= '<img src="'.plugin_dir_url(__FILE__) .'images/1star.png">';
98
  }
99
  for($j = 0; $j<=5-ceil($rating); $j++)
100
  {
101
  if($j)
102
- $review .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png">';
103
  }
104
  $review .= '</span></div>';
105
  }
106
  $review .= "</div>
107
  </div><div style='clear:both;'></div>";
108
 
109
- return ( is_single() || is_page() ) ? $review : $content;
 
 
 
 
 
 
 
110
  }
111
  else if($type == '2')
112
  {
113
  global $post;
114
  $args_event = get_option('bsf_event');
115
 
116
- $event = $content;
117
 
118
  $event .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
119
 
@@ -126,19 +139,18 @@ function display_rich_snippet($content) {
126
  $event_local = get_post_meta( $post->ID, '_bsf_event_local', true );
127
  $event_region = get_post_meta( $post->ID, '_bsf_event_region', true );
128
  $event_postal_code = get_post_meta( $post->ID, '_bsf_event_postal_code', true );
 
 
129
  $event_start_date = get_post_meta( $post->ID, '_bsf_event_start_date', true );
130
  $event_end_date = get_post_meta( $post->ID, '_bsf_event_end_date', true );
131
-
132
  $event_ticket_url = get_post_meta( $post->ID, '_bsf_event_ticket_url', true );
133
  $event_price = get_post_meta( $post->ID, '_bsf_event_price', true );
134
- $event_cur = get_post_meta( $post->ID, '_bsf_event_cur', true );
135
 
136
- //$event_geo_latitude = get_post_meta( $post->ID, '_bsf_event_geo_latitude', true );
137
- //$event_geo_longitude = get_post_meta( $post->ID, '_bsf_event_geo_longitude', true );
138
- /*$event_photo = get_post_meta( $post->ID, '_bsf_event_photo', true );
139
- if(trim($event_photo) != "")
140
  {
141
- $event .= '<div class="snippet-image"><img width="180" itemprop="photo" src="'.$event_photo.'"></div>';
142
  }
143
  else
144
  {
@@ -147,14 +159,16 @@ function display_rich_snippet($content) {
147
  jQuery(".snippet-label-img").addClass("snippet-clear");
148
  });
149
  </script>';
150
- }*/
151
  $event .= '<div class="aio-info">';
152
 
153
  if(trim($event_title) != "")
154
  {
155
  if( $args_event['event_title'])
156
  $event .= '<div class="snippet-label-img">'.$args_event['event_title'].'</div>';
157
- $event .=' <div class="snippet-data-img">​<span itemprop="name">'.$event_title.'</span></div><div class="snippet-clear"></div>';
 
 
158
  }
159
  if(trim($event_org) != "")
160
  {
@@ -172,17 +186,12 @@ function display_rich_snippet($content) {
172
  if(trim($event_region) != "")
173
  $event .= '<span itemprop="addressRegion">'.$event_region.'</span>';
174
  if(trim($event_postal_code) != "")
175
- $event .= '<span itemprop="postalCode">'.$event_postal_code.'</span>';
176
  $event .= '</span>';
177
- //$event .= ' <span itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">';
178
- //if(trim($event_geo_latitude) != "")
179
- // $event .= '<meta itemprop="latitude" content="'.$event_geo_latitude.'" />';
180
- //if(trim($event_geo_longitude) != "")
181
-
182
- // $event .= '<meta itemprop="longitude" content="'.$event_geo_longitude.'" />';
183
- //$event .= '</span>';
184
  $event .='</span>
185
  </div><div class="snippet-clear"></div>';
 
186
  if(trim($event_start_date) != "")
187
  {
188
  if( $args_event['start_time'] != "")
@@ -197,23 +206,40 @@ function display_rich_snippet($content) {
197
  $event .= ' <div class="snippet-data-img"> <span itemprop="endDate" datetime="'.$event_end_date.'T00:00-00:00">'.$event_end_date.'</span></div><div class="snippet-clear"></div>';
198
  }
199
 
 
 
 
 
 
 
 
200
  if(trim($event_price) != "")
201
  {
202
  if($args_event['events_price'] != "")
203
  $event .= '<div class="snippet-label-img">'.$args_event['events_price'].'</div>';
204
  $event .= '<div class="snippet-data-img"> <span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
205
  <span itemprop="priceCurrency">'.$event_cur.'</span><span itemprop="price">'.' '.$event_price.'</span><br><a itemprop="url" href="'.$event_ticket_url.'">Buy Tickets</a></div><div class="snippet-clear"></div>';
206
- //$event .= '<a itemprop="url" href="'.$event_ticket_url.'">Buy Tickets</a>';
207
  }
208
 
209
  $event .= '</div>
210
- </div></div><div class="snippet-clear"></div>';
211
- return ( is_single() || is_page() ) ? $event : $content;
 
 
 
 
 
 
 
 
 
 
 
212
  }
213
  else if($type == '4')
214
  {
215
  global $post;
216
- $organization = $content;
217
  $organization .= '<div class="snippet-title">Organization Brief :</div>';
218
  $organization .= '<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Organization">';
219
  $org_name = get_post_meta( $post->ID,'_bsf_organization_name', true );
@@ -257,7 +283,16 @@ function display_rich_snippet($content) {
257
  </span>
258
  </span>';
259
  $organization .= '</div><div style="clear:both;"></div>';
260
- return ( is_single() || is_page() ) ? $organization : $content;
 
 
 
 
 
 
 
 
 
261
  }
262
  else if($type == '5')
263
  {
@@ -265,7 +300,7 @@ function display_rich_snippet($content) {
265
 
266
  $args_person = get_option('bsf_person');
267
 
268
- $people = $content;
269
 
270
  $people .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
271
 
@@ -335,37 +370,41 @@ function display_rich_snippet($content) {
335
  {
336
  if($args_person['person_address'] != "")
337
  $people .= '<div class="snippet-label-img">'.$args_person['person_address'].'</div> ';
338
- $people .= '<div class="snippet-data-img"> <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
339
- <!--<span typeof="v:Address">-->
340
- <span itemprop="streetAddress">'.$people_street.'</span>,<br>';
341
- }
342
-
343
- if(trim($people_local) != "")
344
- {
345
- //if($args_person['person_address'] != "")
346
- //$people .= '<div class="snippet-label-img">'.$args_person['person_address'].'</div> ';
347
- //$people .= '<!--<div class="snippet-data-img"> <span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <!--<span typeof="v:Address">-->';
348
- $people .= '<span itemprop="addressLocality">'.$people_local.'</span>, ';
349
- }
350
- if(trim($people_region) != "")
351
- {
352
- $people .= '<span itemprop="addressRegion">'.$people_region.'</span>, ';
 
 
 
353
  }
354
- if(trim($people_postal) != "")
355
- {
356
- $people .= '<span itemprop="postalCode">'.$people_postal.'</span>';
357
- }
358
- $people .= '<!--</span>-->
359
- </span></div><div class="snippet-clear"></div>';
360
  $people .= '</div>
361
  </div></div><div class="snippet-clear"></div>';
362
- return ( is_single() || is_page() ) ? $people : $content;
 
 
 
 
 
 
 
363
  }
364
  else if($type == '6')
365
  {
366
  global $post;
367
  $args_product = get_option('bsf_product');
368
- $product = $content;
369
  $product .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
370
  if($args_product['snippet_title'] != "")
371
  $product .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_product['snippet_title'];
@@ -391,7 +430,7 @@ function display_rich_snippet($content) {
391
  $availability = "Pre-Order Only";
392
  if(trim($product_image) != "")
393
  {
394
- $product .= '<div class="snippet-image"><img width="180" src="'.$product_image.'" itemprop="image" /></div>';
395
  }
396
  else
397
  {
@@ -409,12 +448,12 @@ function display_rich_snippet($content) {
409
  $product .= '<div class="snippet-data-img"><span class="star-img">';
410
  for($i = 1; $i<=ceil($product_rating); $i++)
411
  {
412
- $product .= '<img src="'.plugin_dir_url(__FILE__) .'images/1star.png">';
413
  }
414
  for($j = 0; $j<=5-ceil($product_rating); $j++)
415
  {
416
  if($j)
417
- $product .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png">';
418
  }
419
  $product .= '</span></div><div class="snippet-clear"></div>';
420
  }
@@ -458,22 +497,23 @@ function display_rich_snippet($content) {
458
  }
459
  $product .= '</div><div class="snippet-clear"></div>';
460
  }
461
- /*if(trim($product_status) != "")
462
- {
463
- if($args_product['product_avail'] != "")
464
- $product .= '<div class="snippet-label-img">'.$args_product['product_avail'].'</div>';
465
- $product .= ' <div class="snippet-data-img"> <span itemprop="availability" content="'.$product_status.'">'.$availability.'</span></span></div><div class="snippet-clear"></div>';
466
- }*/
467
  $product .= '</div>
468
  </div></div><div class="snippet-clear"></div>';
 
 
 
 
 
 
 
469
 
470
- // $product .= getPostLikeLink($post->ID);
471
- return ( is_single() || is_page() ) ? $product : $content;
472
  }
473
  else if($type == '7')
474
  {
475
  global $post;
476
- $recipe = $content;
477
 
478
  $recipe .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
479
 
@@ -487,17 +527,19 @@ function display_rich_snippet($content) {
487
  $recipe .= '</div>';
488
  $recipe .= '<div itemscope itemtype="http://schema.org/Recipe">';
489
  $recipes_name = get_post_meta( $post->ID, '_bsf_recipes_name', true );
 
490
  $recipes_preptime = get_post_meta( $post->ID, '_bsf_recipes_preptime', true );
491
  $recipes_cooktime = get_post_meta( $post->ID, '_bsf_recipes_cooktime', true );
492
  $recipes_totaltime = get_post_meta( $post->ID, '_bsf_recipes_totaltime', true );
493
  $recipes_photo = get_post_meta( $post->ID, '_bsf_recipes_photo', true );
494
  $recipes_desc = get_post_meta( $post->ID, '_bsf_recipes_desc', true );
 
495
  $recipes_ingredient = get_post_meta( $post->ID, '_bsf_recipes_ingredient', true );
496
  $count = rating_count();
497
  $agregate = average_rating();
498
  if(trim($recipes_photo) != "")
499
  {
500
- $recipe .= '<div class="snippet-image"><img width="180" itemprop="image" src="'.$recipes_photo.'"/></div>';
501
  }
502
  else
503
  {
@@ -513,7 +555,20 @@ function display_rich_snippet($content) {
513
  if($args_recipe['recipe_name'] != "")
514
  $recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_name'].'</div>';
515
 
516
- $recipe .= '<div class="snippet-data-img"><span itemprop="name">'.$recipes_name.'</span></div><div class="snippet-clear"></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
517
  }
518
  $recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_pub'].' </div><div class="snippet-data-img"><time datetime="'.get_the_time( 'c' ).'" itemprop="datePublished">'.get_the_date('Y-m-d').'</time></div><div class="snippet-clear"></div>';
519
  if(trim($recipes_preptime) != "")
@@ -526,36 +581,47 @@ function display_rich_snippet($content) {
526
  {
527
  if($args_recipe['recipe_cook'] != "")
528
  $recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_cook'].'</div>';
529
- $recipe .= '<div class="snippet-data-img"> <time datetime="PT'.$recipes_cooktime.'" itemprop="cookTime">'.$recipes_cooktime.'</span></div><div class="snippet-clear"></div> ';
530
  }
531
  if(trim($recipes_totaltime) != "")
532
  {
533
  if($args_recipe['recipe_time'] != "")
534
  $recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_time'].'</div>';
535
- $recipe .= '<div class="snippet-data-img"> <time datetime="PT'.$recipes_totaltime.'" itemprop="totalTime">'.$recipes_totaltime.'</span></div><div class="snippet-clear"></div>';
536
  }
537
- if($args_recipe['recipe_rating'] != "")
 
538
  $recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_rating'].'</div>';
539
- $recipe .= ' <div class="snippet-data-img"> <span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><span itemprop="ratingValue" class="rating-value">'.$agregate.'</span><span class="star-img">';
540
  for($i = 1; $i<=ceil($agregate); $i++)
541
  {
542
- $recipe .= '<img src="'.plugin_dir_url(__FILE__) .'images/1star.png">';
543
  }
544
  for($j = 0; $j<=5-ceil($agregate); $j++)
545
  {
546
  if($j)
547
- $recipe .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png">';
548
  }
549
- $recipe .= '</span> Based on <span itemprop="reviewCount"><strong>'.$count.'</strong> </span> Review(s)</span></div><div class="snippet-clear"></div>';
 
550
  $recipe .= '</div>
551
  </div></div><div class="snippet-clear"></div>';
552
- return ( is_single() || is_page() ) ? $recipe : $content;
 
 
 
 
 
 
 
 
 
553
  }
554
  else if($type == '8')
555
  {
556
  global $post;
557
  $args_soft = get_option('bsf_software');
558
- $software = $content;
559
 
560
  $software .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
561
  if($args_soft['snippet_title'] != "" )
@@ -578,7 +644,7 @@ function display_rich_snippet($content) {
578
 
579
  if(trim($software_image) != "")
580
  {
581
- $software .= '<div class="snippet-image"><img width="180" src="'.$software_image.'" itemprop="screenshot" /></div>';
582
  }
583
  else
584
  {
@@ -589,56 +655,30 @@ function display_rich_snippet($content) {
589
  </script>';
590
  }
591
  $software .= '<div class="aio-info">';
592
-
593
- //////////////////////////////////////////////////////////////////////
594
 
595
  if(trim($software_rating) != "")
596
  {
597
- //if($args_soft['product_brand'] != "")
598
  $software .= '<div class="snippet-label-img">'.$args_soft['software_rating'].'</div>';
599
  $software .= '<div class="snippet-data-img"><span class="star-img">';
600
  for($i = 1; $i<=ceil($software_rating); $i++)
601
  {
602
- $software .= '<img src="'.plugin_dir_url(__FILE__) .'images/1star.png">';
603
  }
604
  for($j = 0; $j<=5-ceil($software_rating); $j++)
605
  {
606
  if($j)
607
- $software .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png">';
608
  }
609
  $software .= '</span></div><div class="snippet-clear"></div>';
610
  }
611
 
612
 
613
  $software .= '<div class="aggregate_sec" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">';
614
- //if($args_soft['software_agr'] != "")
615
- //{
616
  $software .= '<div class="snippet-label-img">'.$args_soft['software_agr'].'</div>';
617
- //}
618
  $software .= '<div class="snippet-data-img">';
619
  $software .= '<span itemprop="ratingValue">'.average_rating().'</span>';
620
  $software .= ' based on <span class="rating-count" itemprop="reviewCount">'.rating_count().'</span> votes </span></div></div><div class="snippet-clear"></div>';
621
 
622
- //////////////////////////////////////////////////////////////////////
623
-
624
-
625
- /*if(trim($software_rating) != "")
626
- {
627
- if($args_soft['software_rating'] != "")
628
- $software .= '<div class="snippet-label-img">'.$args_soft['software_rating'].'</div>';
629
- $software .= '<div class="snippet-data-img"> <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><span itemprop="ratingValue" class="rating-value">'.$software_rating.'</span></div><span class="star-img">';
630
- for($i = 1; $i<=ceil($software_rating); $i++)
631
- {
632
- $software .= '<img src="'.plugin_dir_url(__FILE__) .'images/1star.png">';
633
- }
634
- for($j = 0; $j<=5-ceil($software_rating); $j++)
635
- {
636
- if($j)
637
- $software .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png">';
638
- }
639
-
640
- $software .= '</span></div><div class="snippet-clear"></div>';
641
- }*/
642
  if(trim($software_name) != "")
643
  {
644
  if($args_soft['software_name'] != "")
@@ -653,7 +693,6 @@ function display_rich_snippet($content) {
653
  }
654
  if(trim($software_cat) != "")
655
  {
656
- //if($args_soft['software_os'] != "")
657
  $software .= '<div class="snippet-label-img">Software Category</div>';
658
  $software .= ' <div class="snippet-data-img"> <span itemprop="applicationCategory">'.$software_cat.'</span></div><div class="snippet-clear"></div>';
659
  }
@@ -679,13 +718,22 @@ function display_rich_snippet($content) {
679
  }
680
  $software .= '</div>
681
  </div></div><div class="snippet-clear"></div>';
682
- return ( is_single() || is_page() ) ? $software : $content;
 
 
 
 
 
 
 
 
 
683
  }
684
  else if($type == '9')
685
  {
686
  global $post;
687
  $args_video = get_option('bsf_video');
688
- $video = $content;
689
 
690
  $video .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
691
 
@@ -743,12 +791,21 @@ function display_rich_snippet($content) {
743
  $video .= '<meta itemprop="uploadDate" content="'.$video_date.'">';
744
  $video .= '</div>
745
  </div></div><div class="snippet-clear"></div>';
746
- return ( is_single() || is_page() ) ? $video : $content;
 
 
 
 
 
 
 
 
 
747
  }
748
  else if($type == '10')
749
  {
750
  global $post;
751
- $article = $content;
752
  $args_article = get_option('bsf_article');
753
  $article_title = get_post_meta( $post->ID, '_bsf_article_title', true );
754
  $article_name = get_post_meta( $post->ID, '_bsf_article_name', true );
@@ -769,7 +826,7 @@ function display_rich_snippet($content) {
769
  if(trim($article_image) != "")
770
  {
771
  $article .= '<div class="snippet-image" itemprop="image" itemscope itemtype="https://schema.org/ImageObject">';
772
- $article .= '<img width="180" src="'.$article_image.'"/>';
773
  $article .= '<meta itemprop="url" content="'.$article_image.'">';
774
  $article .= '<meta itemprop="width" content="800">';
775
  $article .= '<meta itemprop="height" content="800">';
@@ -847,17 +904,35 @@ function display_rich_snippet($content) {
847
 
848
  $article .= '</div>
849
  </div></div><div class="snippet-clear"></div>';
850
- return ( is_single() || is_page() ) ? $article : $content;
 
 
 
 
 
 
 
 
 
 
851
  }else if($type == '11')
852
  {
853
  global $post;
854
- $service = $content;
855
  $args_service = get_option('bsf_service');
856
  $service_type = get_post_meta( $post->ID, '_bsf_service_type', true );
857
  $service_area = get_post_meta( $post->ID, '_bsf_service_area', true );
858
  $service_desc = get_post_meta( $post->ID, '_bsf_service_desc', true );
859
  $service_image = get_post_meta( $post->ID, '_bsf_service_image', true );
860
  $service_provider_name = get_post_meta( $post->ID, '_bsf_service_provider', true );
 
 
 
 
 
 
 
 
861
  $service_rating = get_post_meta( $post->ID, '_bsf_service_rating', true );
862
  $service_rating_switch = get_post_meta( $post->ID, '_bsf_service_rating_switch', true );
863
  $service_channel = get_permalink( $post->ID );
@@ -877,7 +952,7 @@ function display_rich_snippet($content) {
877
  if(trim($service_image) != "")
878
  {
879
  $service .= '<div class="snippet-image">';
880
- $service .= '<img itemprop="image" width="180" src="'.$service_image.'"/>';
881
  $service .= '</div>';
882
  }
883
  else
@@ -918,9 +993,22 @@ function display_rich_snippet($content) {
918
  if($args_service['service_provider_name'] != "")
919
  $service .= '<div class="snippet-label-img">'.$args_service['service_provider_name'].'</div>';
920
 
921
- $service .= '<div class="snippet-data-img" itemprop="provider" itemscope itemtype="https://schema.org/LocalBusiness">
922
- <span itemprop="name">'.$service_provider_name.'</span>
923
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
924
  <div class="snippet-clear"></div>';
925
  }
926
 
@@ -945,23 +1033,37 @@ function display_rich_snippet($content) {
945
  if(trim($service_channel) != "")
946
  {
947
  if($args_service['service_channel'] != "")
948
- $service .= '<div class="snippet-label-img">'.$args_service['service_channel'].'</div>';
949
 
950
  $service .= '<div class="snippet-data-img" itemprop="availableChannel" itemscope itemtype="https://schema.org/ServiceChannel">
951
- <a itemprop="URL" href="'.$service_channel.'">'.$service_url_link.' </a>
 
952
  </div><div class="snippet-clear"></div>';
953
  }
954
 
955
 
956
  $service .= '</div></div></div><div class="snippet-clear"></div>';
957
- return ( is_single() || is_page() ) ? $service : $content;
 
 
 
 
 
 
 
 
 
958
  }
959
  else {
960
  return $content;
961
  }
962
  }
963
- //Filter the content and return with rich snippet output
964
- add_filter('the_content','display_rich_snippet');
 
 
 
 
 
965
  require_once(plugin_dir_path( __FILE__ ).'meta-boxes.php');
966
  function get_the_ip() {
967
  if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
@@ -975,7 +1077,6 @@ function get_the_ip() {
975
  }
976
  }
977
  function average_rating() {
978
- // global $wpdb;
979
  global $post;
980
 
981
  $data = get_post_meta($post->ID, 'post-rating', false);
@@ -1043,7 +1144,7 @@ function bsf_do_rating()
1043
  function get_previous_rating($needle, $haystack, $strict = false) {
1044
  foreach ($haystack as $item) {
1045
  if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && get_previous_rating($needle, $item, $strict))) {
1046
- return @$item['user_rating'];
1047
  }
1048
  }
1049
  return false;
@@ -1058,8 +1159,6 @@ function add_ajax_library() {
1058
  }
1059
  function bsf_add_rating()
1060
  {
1061
- // ob_clean();
1062
-
1063
  if(isset($_POST['star-review']))
1064
  $stars = $_POST['star-review'];
1065
  else
@@ -1076,7 +1175,6 @@ function bsf_add_rating()
1076
  }
1077
  function bsf_update_rating()
1078
  {
1079
- // ob_clean();
1080
  if(isset($_POST['star-review']))
1081
  $stars = $_POST['star-review'];
1082
  else
25
  /* FUNCTION to check for posts having snippets */
26
  add_action('wp','check_snippet_existence','',7);
27
  function check_snippet_existence(){
28
+ global $post;
29
+
30
+ if( !isset( $post->ID ) ) {
31
+ return;
32
+ }
33
+
34
  $type = get_post_meta($post->ID, '_bsf_post_type', true);
35
  if($type){
36
  add_action( 'wp_head', 'frontend_style' );
37
  add_action('wp_enqueue_scripts', 'enque');
38
+ }
39
+
40
  }
41
  function enque() {
42
  wp_enqueue_style('rating_style', plugin_dir_url(__FILE__) . 'css/jquery.rating.css');
57
  $args_color = get_option('bsf_custom');
58
  $id = $post->ID;
59
  $type = get_post_meta($id, '_bsf_post_type', true);
60
+
61
  if($type == '1')
62
  {
63
  global $post;
64
 
65
  $args_review = get_option('bsf_review');
66
+ $review = '';
67
  $review .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
68
 
69
  if($args_review['review_title'] != "")
95
  if(trim($rating) != "")
96
  {
97
  if( $args_review['item_rating'] != "")
 
98
  $review .= "<div class='snippet-label'>".$args_review['item_rating']."</div>";
99
 
100
  $review .= "<div class='snippet-data'> <span itemprop='reviewRating' itemscope itemtype='http://schema.org/Rating'><span class='rating-value' itemprop='ratingValue'>".$rating."</span></span><span class='star-img'>";
101
  for($i = 1; $i<=ceil($rating); $i++)
102
  {
103
+ $review .= '<img src="'.plugin_dir_url(__FILE__) .'images/1star.png" alt="1star">';
104
  }
105
  for($j = 0; $j<=5-ceil($rating); $j++)
106
  {
107
  if($j)
108
+ $review .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png" alt="gray">';
109
  }
110
  $review .= '</span></div>';
111
  }
112
  $review .= "</div>
113
  </div><div style='clear:both;'></div>";
114
 
115
+ if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled() )
116
+ {
117
+ if( is_single() || is_page() )
118
+ {
119
+ echo $review;
120
+ }
121
+ }
122
+ else { return ( is_single() || is_page() ) ? $content.$review : $content; }
123
  }
124
  else if($type == '2')
125
  {
126
  global $post;
127
  $args_event = get_option('bsf_event');
128
 
129
+ $event = '';
130
 
131
  $event .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
132
 
139
  $event_local = get_post_meta( $post->ID, '_bsf_event_local', true );
140
  $event_region = get_post_meta( $post->ID, '_bsf_event_region', true );
141
  $event_postal_code = get_post_meta( $post->ID, '_bsf_event_postal_code', true );
142
+ $event_image = get_post_meta($post->ID, '_bsf_event_image', true);
143
+ //$event_performer = get_post_meta( $post->ID, '_bsf_event_performer', true );
144
  $event_start_date = get_post_meta( $post->ID, '_bsf_event_start_date', true );
145
  $event_end_date = get_post_meta( $post->ID, '_bsf_event_end_date', true );
146
+ $event_description = get_post_meta( $post->ID, '_bsf_event_desc', true );
147
  $event_ticket_url = get_post_meta( $post->ID, '_bsf_event_ticket_url', true );
148
  $event_price = get_post_meta( $post->ID, '_bsf_event_price', true );
149
+ $event_cur = get_post_meta( $post->ID, '_bsf_event_cur', true );
150
 
151
+ if(trim($event_image) != "")
 
 
 
152
  {
153
+ $event .= '<div class="snippet-image"><img width="180" src="'.$event_image.'" itemprop="image" alt="event" /></div>';
154
  }
155
  else
156
  {
159
  jQuery(".snippet-label-img").addClass("snippet-clear");
160
  });
161
  </script>';
162
+ }
163
  $event .= '<div class="aio-info">';
164
 
165
  if(trim($event_title) != "")
166
  {
167
  if( $args_event['event_title'])
168
  $event .= '<div class="snippet-label-img">'.$args_event['event_title'].'</div>';
169
+ $event .=' <div class="snippet-data-img">​<span itemprop="name">'.$event_title.'</span></div>
170
+ <meta itemprop="url" content="'.$event_ticket_url.'">
171
+ <div class="snippet-clear"></div>';
172
  }
173
  if(trim($event_org) != "")
174
  {
186
  if(trim($event_region) != "")
187
  $event .= '<span itemprop="addressRegion">'.$event_region.'</span>';
188
  if(trim($event_postal_code) != "")
189
+ $event .= '-<span itemprop="postalCode">'.$event_postal_code.'</span>';
190
  $event .= '</span>';
191
+
 
 
 
 
 
 
192
  $event .='</span>
193
  </div><div class="snippet-clear"></div>';
194
+
195
  if(trim($event_start_date) != "")
196
  {
197
  if( $args_event['start_time'] != "")
206
  $event .= ' <div class="snippet-data-img"> <span itemprop="endDate" datetime="'.$event_end_date.'T00:00-00:00">'.$event_end_date.'</span></div><div class="snippet-clear"></div>';
207
  }
208
 
209
+ if(trim($event_description) != "")
210
+ {
211
+ if( $args_event['event_desc'] != "")
212
+ $event .= '<div class="snippet-label-img">'.$args_event['event_desc'].'</div>';
213
+ $event .= ' <div class="snippet-data-img"> <span itemprop="description">'.$event_description.'</span></div><div class="snippet-clear"></div>';
214
+ }
215
+
216
  if(trim($event_price) != "")
217
  {
218
  if($args_event['events_price'] != "")
219
  $event .= '<div class="snippet-label-img">'.$args_event['events_price'].'</div>';
220
  $event .= '<div class="snippet-data-img"> <span itemprop="offers" itemscope itemtype="http://schema.org/Offer">
221
  <span itemprop="priceCurrency">'.$event_cur.'</span><span itemprop="price">'.' '.$event_price.'</span><br><a itemprop="url" href="'.$event_ticket_url.'">Buy Tickets</a></div><div class="snippet-clear"></div>';
 
222
  }
223
 
224
  $event .= '</div>
225
+ </div></div>
226
+ <meta itemprop="description" content="Event">
227
+ <div class="snippet-clear"></div>';
228
+
229
+ if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled() )
230
+ {
231
+ if( is_single() || is_page() )
232
+ {
233
+ echo $event;
234
+ }
235
+
236
+ }
237
+ else { return ( is_single() || is_page() ) ? $content.$event : $content; }
238
  }
239
  else if($type == '4')
240
  {
241
  global $post;
242
+ $organization = '';
243
  $organization .= '<div class="snippet-title">Organization Brief :</div>';
244
  $organization .= '<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Organization">';
245
  $org_name = get_post_meta( $post->ID,'_bsf_organization_name', true );
283
  </span>
284
  </span>';
285
  $organization .= '</div><div style="clear:both;"></div>';
286
+
287
+ if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled() )
288
+ {
289
+ if( is_single() || is_page() )
290
+ {
291
+ echo $organization;
292
+ }
293
+
294
+ }
295
+ else { return ( is_single() || is_page() ) ? $content.$organization : $content; }
296
  }
297
  else if($type == '5')
298
  {
300
 
301
  $args_person = get_option('bsf_person');
302
 
303
+ $people = '';
304
 
305
  $people .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
306
 
370
  {
371
  if($args_person['person_address'] != "")
372
  $people .= '<div class="snippet-label-img">'.$args_person['person_address'].'</div> ';
373
+ $people .= '<div class="snippet-data-img">';
374
+ $people .= '<span itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">';
375
+ $people .= '<span itemprop="streetAddress">'.$people_street.'</span>,<br>';
376
+ if(trim($people_local) != "")
377
+ {
378
+ $people .= '<span itemprop="addressLocality">'.$people_local.'</span>, ';
379
+ }
380
+ if(trim($people_region) != "")
381
+ {
382
+ $people .= '<span itemprop="addressRegion">'.$people_region.'</span>, ';
383
+ }
384
+ if(trim($people_postal) != "")
385
+ {
386
+ $people .= '<span itemprop="postalCode">'.$people_postal.'</span>';
387
+ }
388
+ $people .= '</span>';
389
+ $people .= '</div>';
390
+ $people .= '<div class="snippet-clear"></div>';
391
  }
 
 
 
 
 
 
392
  $people .= '</div>
393
  </div></div><div class="snippet-clear"></div>';
394
+ if ( class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled() )
395
+ {
396
+ if( is_single() || is_page() )
397
+ {
398
+ echo $people;
399
+ }
400
+ }
401
+ else { return ( is_single() || is_page() ) ? $content.$people : $content; }
402
  }
403
  else if($type == '6')
404
  {
405
  global $post;
406
  $args_product = get_option('bsf_product');
407
+ $product = '';
408
  $product .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
409
  if($args_product['snippet_title'] != "")
410
  $product .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_product['snippet_title'];
430
  $availability = "Pre-Order Only";
431
  if(trim($product_image) != "")
432
  {
433
+ $product .= '<div class="snippet-image"><img width="180" src="'.$product_image.'" itemprop="image" alt="product image" /></div>';
434
  }
435
  else
436
  {
448
  $product .= '<div class="snippet-data-img"><span class="star-img">';
449
  for($i = 1; $i<=ceil($product_rating); $i++)
450
  {
451
+ $product .= '<img src="'.plugin_dir_url(__FILE__) .'images/1star.png" alt="1star">';
452
  }
453
  for($j = 0; $j<=5-ceil($product_rating); $j++)
454
  {
455
  if($j)
456
+ $product .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png" alt="gray">';
457
  }
458
  $product .= '</span></div><div class="snippet-clear"></div>';
459
  }
497
  }
498
  $product .= '</div><div class="snippet-clear"></div>';
499
  }
 
 
 
 
 
 
500
  $product .= '</div>
501
  </div></div><div class="snippet-clear"></div>';
502
+
503
+ if ( class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled() )
504
+ {
505
+ if( is_single() || is_page() )
506
+ {
507
+ echo $product;
508
+ }
509
 
510
+ }
511
+ else { return ( is_single() || is_page() ) ? $content.$product : $content; }
512
  }
513
  else if($type == '7')
514
  {
515
  global $post;
516
+ $recipe = '';
517
 
518
  $recipe .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
519
 
527
  $recipe .= '</div>';
528
  $recipe .= '<div itemscope itemtype="http://schema.org/Recipe">';
529
  $recipes_name = get_post_meta( $post->ID, '_bsf_recipes_name', true );
530
+ $authors_name = get_post_meta( $post->ID, '_bsf_authors_name', true );
531
  $recipes_preptime = get_post_meta( $post->ID, '_bsf_recipes_preptime', true );
532
  $recipes_cooktime = get_post_meta( $post->ID, '_bsf_recipes_cooktime', true );
533
  $recipes_totaltime = get_post_meta( $post->ID, '_bsf_recipes_totaltime', true );
534
  $recipes_photo = get_post_meta( $post->ID, '_bsf_recipes_photo', true );
535
  $recipes_desc = get_post_meta( $post->ID, '_bsf_recipes_desc', true );
536
+ $recipes_nutrition = get_post_meta( $post->ID, '_bsf_recipes_nutrition', true );
537
  $recipes_ingredient = get_post_meta( $post->ID, '_bsf_recipes_ingredient', true );
538
  $count = rating_count();
539
  $agregate = average_rating();
540
  if(trim($recipes_photo) != "")
541
  {
542
+ $recipe .= '<div class="snippet-image"><img width="180" itemprop="image" src="'.$recipes_photo.'" alt="recipe image"/></div>';
543
  }
544
  else
545
  {
555
  if($args_recipe['recipe_name'] != "")
556
  $recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_name'].'</div>';
557
 
558
+ $recipe .= '<div class="snippet-data-img"><span itemprop="name">'.$recipes_name.'</span></div>
559
+ <meta itemprop="description" content="'.$recipes_desc.'" >
560
+ <meta itemprop="recipeIngredient" content="'.$recipes_ingredient.'" >
561
+ <div itemprop="nutrition"
562
+ itemscope itemtype="http://schema.org/NutritionInformation">
563
+ <meta itemprop="calories" content="'.$recipes_nutrition.'" ></div>
564
+ <div class="snippet-clear"></div>';
565
+ }
566
+ if(trim($authors_name) != "")
567
+ {
568
+ if($args_recipe['author_name'] != "")
569
+ $recipe .= '<div class="snippet-label-img">'.$args_recipe['author_name'].'</div>';
570
+
571
+ $recipe .= '<div class="snippet-data-img"><span itemprop="author">'.$authors_name.'</span></div><div class="snippet-clear"></div>';
572
  }
573
  $recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_pub'].' </div><div class="snippet-data-img"><time datetime="'.get_the_time( 'c' ).'" itemprop="datePublished">'.get_the_date('Y-m-d').'</time></div><div class="snippet-clear"></div>';
574
  if(trim($recipes_preptime) != "")
581
  {
582
  if($args_recipe['recipe_cook'] != "")
583
  $recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_cook'].'</div>';
584
+ $recipe .= '<div class="snippet-data-img"> <time datetime="PT'.$recipes_cooktime.'" itemprop="cookTime">'.$recipes_cooktime.'</time></div><div class="snippet-clear"></div> ';
585
  }
586
  if(trim($recipes_totaltime) != "")
587
  {
588
  if($args_recipe['recipe_time'] != "")
589
  $recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_time'].'</div>';
590
+ $recipe .= '<div class="snippet-data-img"> <time datetime="PT'.$recipes_totaltime.'" itemprop="totalTime">'.$recipes_totaltime.'</time></div><div class="snippet-clear"></div>';
591
  }
592
+ if($args_recipe['recipe_rating'] != "" && $count > 0)
593
+ {
594
  $recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_rating'].'</div>';
595
+ $recipe .= ' <div class="snippet-data-img"> <span itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><span itemprop="ratingValue" class="rating-value">'.$agregate.'</span><span class="star-img">';
596
  for($i = 1; $i<=ceil($agregate); $i++)
597
  {
598
+ $recipe .= '<img src="'.plugin_dir_url(__FILE__) .'images/1star.png" alt="1star">';
599
  }
600
  for($j = 0; $j<=5-ceil($agregate); $j++)
601
  {
602
  if($j)
603
+ $recipe .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png" alt="gray">';
604
  }
605
+ $recipe .= '</span> Based on <span itemprop="reviewCount"><strong>'.$count.'</strong> </span> Review(s)</span></div><div class="snippet-clear"></div>';
606
+ }
607
  $recipe .= '</div>
608
  </div></div><div class="snippet-clear"></div>';
609
+
610
+ if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled() )
611
+ {
612
+ if( is_single() || is_page() )
613
+ {
614
+ echo $recipe;
615
+ }
616
+
617
+ }
618
+ else { return ( is_single() || is_page() ) ? $content.$recipe : $content; }
619
  }
620
  else if($type == '8')
621
  {
622
  global $post;
623
  $args_soft = get_option('bsf_software');
624
+ $software = '';
625
 
626
  $software .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
627
  if($args_soft['snippet_title'] != "" )
644
 
645
  if(trim($software_image) != "")
646
  {
647
+ $software .= '<div class="snippet-image"><img width="180" src="'.$software_image.'" itemprop="screenshot" alt="software image" /></div>';
648
  }
649
  else
650
  {
655
  </script>';
656
  }
657
  $software .= '<div class="aio-info">';
 
 
658
 
659
  if(trim($software_rating) != "")
660
  {
 
661
  $software .= '<div class="snippet-label-img">'.$args_soft['software_rating'].'</div>';
662
  $software .= '<div class="snippet-data-img"><span class="star-img">';
663
  for($i = 1; $i<=ceil($software_rating); $i++)
664
  {
665
+ $software .= '<img src="'.plugin_dir_url(__FILE__) .'images/1star.png" alt="1star">';
666
  }
667
  for($j = 0; $j<=5-ceil($software_rating); $j++)
668
  {
669
  if($j)
670
+ $software .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png" alt="gray">';
671
  }
672
  $software .= '</span></div><div class="snippet-clear"></div>';
673
  }
674
 
675
 
676
  $software .= '<div class="aggregate_sec" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">';
 
 
677
  $software .= '<div class="snippet-label-img">'.$args_soft['software_agr'].'</div>';
 
678
  $software .= '<div class="snippet-data-img">';
679
  $software .= '<span itemprop="ratingValue">'.average_rating().'</span>';
680
  $software .= ' based on <span class="rating-count" itemprop="reviewCount">'.rating_count().'</span> votes </span></div></div><div class="snippet-clear"></div>';
681
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
682
  if(trim($software_name) != "")
683
  {
684
  if($args_soft['software_name'] != "")
693
  }
694
  if(trim($software_cat) != "")
695
  {
 
696
  $software .= '<div class="snippet-label-img">Software Category</div>';
697
  $software .= ' <div class="snippet-data-img"> <span itemprop="applicationCategory">'.$software_cat.'</span></div><div class="snippet-clear"></div>';
698
  }
718
  }
719
  $software .= '</div>
720
  </div></div><div class="snippet-clear"></div>';
721
+
722
+ if (class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled() )
723
+ {
724
+ if( is_single() || is_page() )
725
+ {
726
+ echo $software;
727
+ }
728
+
729
+ }
730
+ else { return ( is_single() || is_page() ) ? $content.$software : $content; }
731
  }
732
  else if($type == '9')
733
  {
734
  global $post;
735
  $args_video = get_option('bsf_video');
736
+ $video = '';
737
 
738
  $video .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
739
 
791
  $video .= '<meta itemprop="uploadDate" content="'.$video_date.'">';
792
  $video .= '</div>
793
  </div></div><div class="snippet-clear"></div>';
794
+
795
+ if ( class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled() )
796
+ {
797
+ if( is_single() || is_page() )
798
+ {
799
+ echo $video;
800
+ }
801
+
802
+ }
803
+ else { return ( is_single() || is_page() ) ? $content.$video : $content; }
804
  }
805
  else if($type == '10')
806
  {
807
  global $post;
808
+ $article = '';
809
  $args_article = get_option('bsf_article');
810
  $article_title = get_post_meta( $post->ID, '_bsf_article_title', true );
811
  $article_name = get_post_meta( $post->ID, '_bsf_article_name', true );
826
  if(trim($article_image) != "")
827
  {
828
  $article .= '<div class="snippet-image" itemprop="image" itemscope itemtype="https://schema.org/ImageObject">';
829
+ $article .= '<img width="180" src="'.$article_image.'" alt="'.$article_name.'"/>';
830
  $article .= '<meta itemprop="url" content="'.$article_image.'">';
831
  $article .= '<meta itemprop="width" content="800">';
832
  $article .= '<meta itemprop="height" content="800">';
904
 
905
  $article .= '</div>
906
  </div></div><div class="snippet-clear"></div>';
907
+
908
+
909
+ if ( class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled() )
910
+ {
911
+ if( is_single() || is_page() )
912
+ {
913
+ echo $article;
914
+ }
915
+ }
916
+
917
+ else { return ( is_single() || is_page() ) ? $content.$article : $content; }
918
  }else if($type == '11')
919
  {
920
  global $post;
921
+ $service = '';
922
  $args_service = get_option('bsf_service');
923
  $service_type = get_post_meta( $post->ID, '_bsf_service_type', true );
924
  $service_area = get_post_meta( $post->ID, '_bsf_service_area', true );
925
  $service_desc = get_post_meta( $post->ID, '_bsf_service_desc', true );
926
  $service_image = get_post_meta( $post->ID, '_bsf_service_image', true );
927
  $service_provider_name = get_post_meta( $post->ID, '_bsf_service_provider', true );
928
+ $service_street = get_post_meta( $post->ID, '_bsf_service_street', true );
929
+ $service_local = get_post_meta( $post->ID, '_bsf_service_local', true );
930
+ $service_region = get_post_meta( $post->ID, '_bsf_service_region', true );
931
+ $service_postal_code = get_post_meta( $post->ID, '_bsf_service_postal_code', true );
932
+ $service_provider_location_image = get_post_meta( $post->ID, '_bsf_provider_location_image', true );
933
+ $service_telephone = get_post_meta( $post->ID, '_bsf_service_telephone', true );
934
+ $service_price = get_post_meta( $post->ID, '_bsf_service_price', true );
935
+ $service_cur = get_post_meta( $post->ID, '_bsf_service_cur', true );
936
  $service_rating = get_post_meta( $post->ID, '_bsf_service_rating', true );
937
  $service_rating_switch = get_post_meta( $post->ID, '_bsf_service_rating_switch', true );
938
  $service_channel = get_permalink( $post->ID );
952
  if(trim($service_image) != "")
953
  {
954
  $service .= '<div class="snippet-image">';
955
+ $service .= '<img itemprop="image" width="180" src="'.$service_image.'" alt="'.$service_type.'"/>';
956
  $service .= '</div>';
957
  }
958
  else
993
  if($args_service['service_provider_name'] != "")
994
  $service .= '<div class="snippet-label-img">'.$args_service['service_provider_name'].'</div>';
995
 
996
+ $service .= '<div class="snippet-data-img" itemprop="provider" itemscope itemtype="http://schema.org/LocalBusiness">
997
+ <meta itemprop="image" content="'.$service_provider_location_image.'"/>
998
+ <span itemprop="name">'.$service_provider_name.'</span>,';
999
+ if(trim($service_street) != "")
1000
+ $service .= '<div itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
1001
+ <span itemprop="streetAddress">'.$service_street.'</span>,';
1002
+ if(trim($service_local) != "")
1003
+ $service .= '<span itemprop="addressLocality">'.$service_local.'</span>,';
1004
+ if(trim($service_region) != "")
1005
+ $service .= '<span itemprop="addressRegion">'.$service_region.'</span>-';
1006
+ if(trim($service_postal_code) != "")
1007
+ $service .= '<span itemprop="postalCode">'.$service_postal_code.'</span>,<br/>';
1008
+ if(trim($service_telephone) != "")
1009
+ $service .= '<span itemprop="telephone"> Telephone No.'.$service_telephone.'</span>';
1010
+ $service .= '</div>';
1011
+ $service .= '</div>
1012
  <div class="snippet-clear"></div>';
1013
  }
1014
 
1033
  if(trim($service_channel) != "")
1034
  {
1035
  if($args_service['service_channel'] != "")
 
1036
 
1037
  $service .= '<div class="snippet-data-img" itemprop="availableChannel" itemscope itemtype="https://schema.org/ServiceChannel">
1038
+
1039
+ <meta itemprop="URL" href="'.$service_channel.'">
1040
  </div><div class="snippet-clear"></div>';
1041
  }
1042
 
1043
 
1044
  $service .= '</div></div></div><div class="snippet-clear"></div>';
1045
+
1046
+ if ( class_exists('FLBuilderModel') && FLBuilderModel::is_builder_enabled() )
1047
+ {
1048
+ if( is_single() || is_page() )
1049
+ {
1050
+ echo $service;
1051
+ }
1052
+
1053
+ }
1054
+ else { return ( is_single() || is_page() ) ? $content.$service : $content; }
1055
  }
1056
  else {
1057
  return $content;
1058
  }
1059
  }
1060
+ if ( class_exists( 'FLBuilderLoader' ) )
1061
+ {
1062
+ add_filter('fl_builder_after_render_content','display_rich_snippet');
1063
+ }
1064
+ else{ add_filter('the_content','display_rich_snippet'); }
1065
+
1066
+
1067
  require_once(plugin_dir_path( __FILE__ ).'meta-boxes.php');
1068
  function get_the_ip() {
1069
  if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
1077
  }
1078
  }
1079
  function average_rating() {
 
1080
  global $post;
1081
 
1082
  $data = get_post_meta($post->ID, 'post-rating', false);
1144
  function get_previous_rating($needle, $haystack, $strict = false) {
1145
  foreach ($haystack as $item) {
1146
  if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && get_previous_rating($needle, $item, $strict))) {
1147
+ return !empty($item['user_rating']) ? $item['user_rating'] : '';
1148
  }
1149
  }
1150
  return false;
1159
  }
1160
  function bsf_add_rating()
1161
  {
 
 
1162
  if(isset($_POST['star-review']))
1163
  $stars = $_POST['star-review'];
1164
  else
1175
  }
1176
  function bsf_update_rating()
1177
  {
 
1178
  if(isset($_POST['star-review']))
1179
  $stars = $_POST['star-review'];
1180
  else
index.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.brainstormforce.com
5
  Author: Brainstorm Force
6
  Author URI: https://www.brainstormforce.com
7
  Description: The All in One Rich Snippets gives the power to the blog author to control the rich snippets to be shown in the search results by the search engines.
8
- Version: 1.4.1
9
  Text Domain: rich-snippets
10
  License: GPL2
11
  */
@@ -28,14 +28,12 @@ if ( !class_exists( "RichSnippets" ) )
28
  function __construct() // Constructor
29
  {
30
  register_activation_hook(__FILE__, array($this, 'register_bsf_settings'));
31
- // add_action( 'admin_notices', array($this, 'display_message') );
32
  add_action( 'admin_head', array( $this, 'star_icons') );
33
  // Add Admin Menu
34
  add_action('admin_menu', array( $this, 'register_custom_menu_page') );
35
  add_action( 'admin_init', array( $this, 'set_styles' ));
36
 
37
  add_action( 'admin_init', array( $this, 'bsf_color_scripts' ));
38
- // add_action( 'init', array( $this, 'register_bsf_settings' ));
39
 
40
  add_filter('plugins_loaded', array( $this, 'rich_snippet_translation'));
41
  add_action( 'admin_enqueue_scripts', array( $this, 'post_enqueue') );
@@ -48,6 +46,7 @@ if ( !class_exists( "RichSnippets" ) )
48
  // Admin bar menu
49
  add_action( 'admin_bar_menu', array( $this, "aiosrs_admin_bar" ),100 );
50
  }
 
51
  // admin bar menu
52
  function aiosrs_admin_bar()
53
  {
@@ -60,7 +59,7 @@ if ( !class_exists( "RichSnippets" ) )
60
  $wp_admin_bar->add_menu( array(
61
  'id' => 'aiosrs',
62
  'title' => 'Test Rich Snippets',
63
- 'href' => 'http://www.google.com/webmasters/tools/richsnippets?q='.$actual_link,
64
  'meta' => array('target' => '_blank'),
65
  ) );
66
  }
@@ -83,7 +82,6 @@ if ( !class_exists( "RichSnippets" ) )
83
  function post_enqueue($hook) {
84
  if( 'post.php' != $hook )
85
  return;
86
- // wp_enqueue_script( 'bsf_jquery' );
87
  wp_enqueue_script( 'jquery' );
88
  wp_enqueue_script( 'bsf_jquery_star' );
89
  wp_enqueue_script( 'bsf_toggle' );
@@ -99,7 +97,6 @@ if ( !class_exists( "RichSnippets" ) )
99
  function post_new_enqueue($hook) {
100
  if('post-new.php' != $hook )
101
  return;
102
- // wp_enqueue_script( 'bsf_jquery' );
103
  wp_enqueue_script( 'jquery' );
104
  wp_enqueue_script( 'bsf_jquery_star' );
105
  wp_enqueue_script( 'bsf_toggle' );
@@ -122,7 +119,6 @@ if ( !class_exists( "RichSnippets" ) )
122
  wp_register_style( 'meta_style', plugins_url('admin/css/style.css', __FILE__) );
123
 
124
  wp_register_style( 'admin_style', plugins_url('admin/css/admin.css', __FILE__) );
125
- wp_register_script( 'bsf_jquery_ui', plugins_url('/js/jquery-ui.js', __FILE__) );
126
  wp_register_script( 'bsf_jquery_star', plugins_url('/js/jquery.rating.min.js', __FILE__) );
127
  wp_register_script( 'bsf_toggle', plugins_url('/js/toggle.js', __FILE__) );
128
  }
@@ -145,6 +141,7 @@ if ( !class_exists( "RichSnippets" ) )
145
  /* Translation */
146
  function rich_snippet_translation()
147
  {
 
148
  // Load Translation File
149
  load_plugin_textdomain('rich-snippets', false, basename( dirname( __FILE__ ) ) . '/lang/' );
150
  }
@@ -163,7 +160,7 @@ if ( !class_exists( "RichSnippets" ) )
163
  }
164
  function submit_request()
165
  {
166
- $to = "Brainstorm Force <contact@brainstormforce.com>";
167
  $from = $_POST['email'];
168
  $site = $_POST['site_url'];
169
  $sub = $_POST['subject'];
@@ -223,7 +220,6 @@ if ( !class_exists( "RichSnippets" ) )
223
  $headers = 'MIME-Version: 1.0' . "\r\n";
224
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
225
  $headers .= 'From:'.$name.'<'.$from.'>' . "\r\n";
226
- $headers .= 'Cc: Sujay Pawar <sujay@brainstormforce.com>, Nitin Yawalkar <nitiny@brainstormforce.com>, Pratik Chaskar <pratikc@brainstormforce.com>, Sandesh Jangam <sandeshj@bsf.io>' . "\r\n";
227
  echo mail($to,$subject,$html,$headers) ? "Thank you!" : "Something went wrong!";
228
 
229
  die();
5
  Author: Brainstorm Force
6
  Author URI: https://www.brainstormforce.com
7
  Description: The All in One Rich Snippets gives the power to the blog author to control the rich snippets to be shown in the search results by the search engines.
8
+ Version: 1.4.2
9
  Text Domain: rich-snippets
10
  License: GPL2
11
  */
28
  function __construct() // Constructor
29
  {
30
  register_activation_hook(__FILE__, array($this, 'register_bsf_settings'));
 
31
  add_action( 'admin_head', array( $this, 'star_icons') );
32
  // Add Admin Menu
33
  add_action('admin_menu', array( $this, 'register_custom_menu_page') );
34
  add_action( 'admin_init', array( $this, 'set_styles' ));
35
 
36
  add_action( 'admin_init', array( $this, 'bsf_color_scripts' ));
 
37
 
38
  add_filter('plugins_loaded', array( $this, 'rich_snippet_translation'));
39
  add_action( 'admin_enqueue_scripts', array( $this, 'post_enqueue') );
46
  // Admin bar menu
47
  add_action( 'admin_bar_menu', array( $this, "aiosrs_admin_bar" ),100 );
48
  }
49
+
50
  // admin bar menu
51
  function aiosrs_admin_bar()
52
  {
59
  $wp_admin_bar->add_menu( array(
60
  'id' => 'aiosrs',
61
  'title' => 'Test Rich Snippets',
62
+ 'href' => 'https://search.google.com/structured-data/testing-tool#url='.$actual_link,
63
  'meta' => array('target' => '_blank'),
64
  ) );
65
  }
82
  function post_enqueue($hook) {
83
  if( 'post.php' != $hook )
84
  return;
 
85
  wp_enqueue_script( 'jquery' );
86
  wp_enqueue_script( 'bsf_jquery_star' );
87
  wp_enqueue_script( 'bsf_toggle' );
97
  function post_new_enqueue($hook) {
98
  if('post-new.php' != $hook )
99
  return;
 
100
  wp_enqueue_script( 'jquery' );
101
  wp_enqueue_script( 'bsf_jquery_star' );
102
  wp_enqueue_script( 'bsf_toggle' );
119
  wp_register_style( 'meta_style', plugins_url('admin/css/style.css', __FILE__) );
120
 
121
  wp_register_style( 'admin_style', plugins_url('admin/css/admin.css', __FILE__) );
 
122
  wp_register_script( 'bsf_jquery_star', plugins_url('/js/jquery.rating.min.js', __FILE__) );
123
  wp_register_script( 'bsf_toggle', plugins_url('/js/toggle.js', __FILE__) );
124
  }
141
  /* Translation */
142
  function rich_snippet_translation()
143
  {
144
+
145
  // Load Translation File
146
  load_plugin_textdomain('rich-snippets', false, basename( dirname( __FILE__ ) ) . '/lang/' );
147
  }
160
  }
161
  function submit_request()
162
  {
163
+ $to = "Brainstorm Force <support@bsf.io>";
164
  $from = $_POST['email'];
165
  $site = $_POST['site_url'];
166
  $sub = $_POST['subject'];
220
  $headers = 'MIME-Version: 1.0' . "\r\n";
221
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
222
  $headers .= 'From:'.$name.'<'.$from.'>' . "\r\n";
 
223
  echo mail($to,$subject,$html,$headers) ? "Thank you!" : "Something went wrong!";
224
 
225
  die();
meta-boxes.php CHANGED
@@ -4,11 +4,12 @@ function bsf_metaboxes( array $meta_boxes ) {
4
  // Start with an underscore to hide fields from custom fields list
5
  $prefix = '_bsf_';
6
  $post_types=get_post_types('','names');
7
-
 
8
  $meta_boxes[] = array(
9
  'id' => 'review_metabox',
10
  'title' => __('Configure Rich Snippet','rich-snippets'),
11
- 'pages' => $post_types, //array( 'post','page' ), // Custom Post types
12
  'context' => 'normal',
13
  'priority' => 'high',
14
  'show_names' => true, // Show field names on the left
@@ -23,8 +24,6 @@ function bsf_metaboxes( array $meta_boxes ) {
23
  array( 'name' => __('Select what this post is about','rich-snippets'), 'value' => '0', ),
24
  array( 'name' => __('Item Review','rich-snippets'), 'value' => '1', ),
25
  array( 'name' => __('Event','rich-snippets'), 'value' => '2', ),
26
- // array( 'name' => __('Music','rich-snippets'), 'value' => '3', ),
27
- // array( 'name' => __('Organization','rich-snippets'), 'value' => '4', ),
28
  array( 'name' => __('People','rich-snippets'), 'value' => '5', ),
29
  array( 'name' => __('Product','rich-snippets'), 'value' => '6', ),
30
  array( 'name' => __('Recipe','rich-snippets'), 'value' => '7', ),
@@ -71,13 +70,6 @@ function bsf_metaboxes( array $meta_boxes ) {
71
  array( 'name' => __('','rich-snippets'), 'value' => '5', ),
72
  ),
73
  ),
74
- /* array(
75
- 'name' => __('','rich-snippets'),
76
- 'desc' => __('Enter the item description here','rich-snippets'),
77
- 'id' => $prefix . 'item_desc',
78
- 'class' => 'review',
79
- 'type' => 'textarea_small1',
80
- ),*/
81
  // Meta Settings for Events
82
  array(
83
  'name' => __('Rich Snippets - Events','rich-snippets'),
@@ -95,7 +87,7 @@ function bsf_metaboxes( array $meta_boxes ) {
95
  ),
96
  array(
97
  'name' => __('Location ','rich-snippets'),
98
- 'desc' => __('Organization Name Here','rich-snippets'),
99
  'id' => $prefix . 'event_organization',
100
  'class' => 'events',
101
  'type' => 'text_medium',
@@ -128,13 +120,13 @@ function bsf_metaboxes( array $meta_boxes ) {
128
  'class' => 'events',
129
  'type' => 'text_medium',
130
  ),
131
- /* array(
132
  'name' => __('Description ','rich-snippets'),
133
  'desc' => __('Describe the event in short.','rich-snippets'),
134
  'id' => $prefix . 'event_desc',
135
  'class' => 'events',
136
  'type' => 'textarea_small',
137
- ),*/
138
  array(
139
  'name' => __('Start Date ','rich-snippets'),
140
  'desc' => __('Provide the Event Start Date.','rich-snippets'),
@@ -170,27 +162,6 @@ function bsf_metaboxes( array $meta_boxes ) {
170
  'class' => 'events',
171
  'type' => 'text',
172
  ),
173
- /*array(
174
- 'name' => __('GEO Location ','rich-snippets'),
175
- 'desc' => __('Enter Latitude. <a href="http://universimmedia.pagesperso-orange.fr/geo/loc.htm" target="_blank">Find Here.</a>','rich-snippets'),
176
- 'id' => $prefix . 'event_geo_latitude',
177
- 'class' => 'events',
178
- 'type' => 'text_medium',
179
- ),
180
- array(
181
- 'name' => __('','rich-snippets'),
182
- 'desc' => __('Enter Longitude','rich-snippets'),
183
- 'id' => $prefix . 'event_geo_longitude',
184
- 'class' => 'events',
185
- 'type' => 'text_medium',
186
- ),
187
- array(
188
- 'name' => __('Event Photo ','rich-snippets'),
189
- 'desc' => __('Upload or Select from media gallery. Medium size is recommended (300px X 300px)','rich-snippets'),
190
- 'id' => $prefix . 'event_photo',
191
- 'class' => 'events',
192
- 'type' => 'file',
193
- ),*/
194
  // Meta Settings for Music
195
  array(
196
  'name' => __('Rich Snippets - Music','rich-snippets'),
@@ -399,13 +370,6 @@ function bsf_metaboxes( array $meta_boxes ) {
399
  'class' => 'product',
400
  'type' => 'file',
401
  ),
402
- /* array(
403
- 'name' => __('Product Category','rich-snippets'),
404
- 'desc' => __('Select the product category.','rich-snippets'),
405
- 'id' => $prefix . 'product_cat',
406
- 'class' => 'product',
407
- 'type' => 'text_medium',
408
- ),*/
409
  array(
410
  'name' => __('Product Price','rich-snippets'),
411
  'desc' => __('Enter the product Price.','rich-snippets'),
@@ -449,6 +413,13 @@ function bsf_metaboxes( array $meta_boxes ) {
449
  'class' => 'recipes',
450
  'type' => 'text_medium',
451
  ),
 
 
 
 
 
 
 
452
  array(
453
  'name' => __('Time Required ','rich-snippets'),
454
  'desc' => __('Preperation time (Format: 1H30M. H - Hours, M - Minutes )','rich-snippets'),
@@ -471,26 +442,33 @@ function bsf_metaboxes( array $meta_boxes ) {
471
  'type' => 'text_small',
472
  ),
473
  array(
474
- 'name' => __('Recipe Photo','rich-snippets'),
475
- 'desc' => __('Upload or Select recipe photo. Medium size is recommended (300px X 300px)','rich-snippets'),
476
- 'id' => $prefix . 'recipes_photo',
477
  'class' => 'recipes',
478
- 'type' => 'file',
479
  ),
480
- /* array(
481
- 'name' => __('','rich-snippets'),
 
 
 
 
 
 
 
482
  'desc' => __('Enter the ingredients used','rich-snippets'),
483
  'id' => $prefix . 'recipes_ingredient',
484
  'class' => 'recipes',
485
- 'type' => 'textarea_small1',
486
  ),
487
  array(
488
- 'name' => __('','rich-snippets'),
489
- 'desc' => __('Describe the recipe in short.','rich-snippets'),
490
- 'id' => $prefix . 'recipes_desc',
491
  'class' => 'recipes',
492
- 'type' => 'textarea_small1',
493
- ),*/
494
  // Meta Settings for Software Application
495
  array(
496
  'name' => __('Rich Snippets - Software Application','rich-snippets'),
@@ -561,14 +539,7 @@ function bsf_metaboxes( array $meta_boxes ) {
561
  'id' => $prefix . 'software_landing',
562
  'class' => 'software',
563
  'type' => 'text',
564
- ),
565
- /*array(
566
- 'name' => __('Software Description','rich-snippets'),
567
- 'desc' => __('Enter the software description.','rich-snippets'),
568
- 'id' => $prefix . 'software_desc',
569
- 'class' => 'software',
570
- 'type' => 'textarea_small',
571
- ),*/
572
  // Meta Settings for Video
573
  array(
574
  'name' => __('Rich Snippets - Videos','rich-snippets'),
@@ -723,6 +694,48 @@ function bsf_metaboxes( array $meta_boxes ) {
723
  'class' => 'service',
724
  'type' => 'text',
725
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
726
  array(
727
  'name' => __('Enable/Disable Rating','rich-snippets'),
728
  'desc' => __('.','rich-snippets'),
4
  // Start with an underscore to hide fields from custom fields list
5
  $prefix = '_bsf_';
6
  $post_types=get_post_types('','names');
7
+ $woocommerce_post_type = array( "product", "product_variation", "shop_order" , "shop_order_refund", "shop_coupon", "shop_webhook" );
8
+ $required_post_type = array_diff( $post_types, $woocommerce_post_type );
9
  $meta_boxes[] = array(
10
  'id' => 'review_metabox',
11
  'title' => __('Configure Rich Snippet','rich-snippets'),
12
+ 'pages' => $required_post_type,//$post_types, //array( 'post','page' ), // Custom Post types
13
  'context' => 'normal',
14
  'priority' => 'high',
15
  'show_names' => true, // Show field names on the left
24
  array( 'name' => __('Select what this post is about','rich-snippets'), 'value' => '0', ),
25
  array( 'name' => __('Item Review','rich-snippets'), 'value' => '1', ),
26
  array( 'name' => __('Event','rich-snippets'), 'value' => '2', ),
 
 
27
  array( 'name' => __('People','rich-snippets'), 'value' => '5', ),
28
  array( 'name' => __('Product','rich-snippets'), 'value' => '6', ),
29
  array( 'name' => __('Recipe','rich-snippets'), 'value' => '7', ),
70
  array( 'name' => __('','rich-snippets'), 'value' => '5', ),
71
  ),
72
  ),
 
 
 
 
 
 
 
73
  // Meta Settings for Events
74
  array(
75
  'name' => __('Rich Snippets - Events','rich-snippets'),
87
  ),
88
  array(
89
  'name' => __('Location ','rich-snippets'),
90
+ 'desc' => __('Location Name Here','rich-snippets'),
91
  'id' => $prefix . 'event_organization',
92
  'class' => 'events',
93
  'type' => 'text_medium',
120
  'class' => 'events',
121
  'type' => 'text_medium',
122
  ),
123
+ array(
124
  'name' => __('Description ','rich-snippets'),
125
  'desc' => __('Describe the event in short.','rich-snippets'),
126
  'id' => $prefix . 'event_desc',
127
  'class' => 'events',
128
  'type' => 'textarea_small',
129
+ ),
130
  array(
131
  'name' => __('Start Date ','rich-snippets'),
132
  'desc' => __('Provide the Event Start Date.','rich-snippets'),
162
  'class' => 'events',
163
  'type' => 'text',
164
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  // Meta Settings for Music
166
  array(
167
  'name' => __('Rich Snippets - Music','rich-snippets'),
370
  'class' => 'product',
371
  'type' => 'file',
372
  ),
 
 
 
 
 
 
 
373
  array(
374
  'name' => __('Product Price','rich-snippets'),
375
  'desc' => __('Enter the product Price.','rich-snippets'),
413
  'class' => 'recipes',
414
  'type' => 'text_medium',
415
  ),
416
+ array(
417
+ 'name' => __('Author Name ','rich-snippets'),
418
+ 'desc' => __('Enter the Author name.','rich-snippets'),
419
+ 'id' => $prefix . 'authors_name',
420
+ 'class' => 'recipes',
421
+ 'type' => 'text_medium',
422
+ ),
423
  array(
424
  'name' => __('Time Required ','rich-snippets'),
425
  'desc' => __('Preperation time (Format: 1H30M. H - Hours, M - Minutes )','rich-snippets'),
442
  'type' => 'text_small',
443
  ),
444
  array(
445
+ 'name' => __('Description','rich-snippets'),
446
+ 'desc' => __('Describe the recipe in short.','rich-snippets'),
447
+ 'id' => $prefix . 'recipes_desc',
448
  'class' => 'recipes',
449
+ 'type' => 'textarea_small',
450
  ),
451
+ array(
452
+ 'name' => __('Nutrition','rich-snippets'),
453
+ 'desc' => __('Nutrition','rich-snippets'),
454
+ 'id' => $prefix . 'recipes_nutrition',
455
+ 'class' => 'recipes',
456
+ 'type' => 'text_medium',
457
+ ),
458
+ array(
459
+ 'name' => __('Ingredients','rich-snippets'),
460
  'desc' => __('Enter the ingredients used','rich-snippets'),
461
  'id' => $prefix . 'recipes_ingredient',
462
  'class' => 'recipes',
463
+ 'type' => 'text_medium',
464
  ),
465
  array(
466
+ 'name' => __('Recipe Photo','rich-snippets'),
467
+ 'desc' => __('Upload or Select recipe photo. Medium size is recommended (300px X 300px)','rich-snippets'),
468
+ 'id' => $prefix . 'recipes_photo',
469
  'class' => 'recipes',
470
+ 'type' => 'file',
471
+ ),
472
  // Meta Settings for Software Application
473
  array(
474
  'name' => __('Rich Snippets - Software Application','rich-snippets'),
539
  'id' => $prefix . 'software_landing',
540
  'class' => 'software',
541
  'type' => 'text',
542
+ ),
 
 
 
 
 
 
 
543
  // Meta Settings for Video
544
  array(
545
  'name' => __('Rich Snippets - Videos','rich-snippets'),
694
  'class' => 'service',
695
  'type' => 'text',
696
  ),
697
+ array(
698
+ 'name' => __('Location','rich-snippets'),
699
+ 'desc' => __('Street Address','rich-snippets'),
700
+ 'id' => $prefix . 'service_street',
701
+ 'class' => 'service',
702
+ 'type' => 'text_medium',
703
+ ),
704
+ array(
705
+ 'name' => __('','rich-snippets'),
706
+ 'desc' => __('Locality','rich-snippets'),
707
+ 'id' => $prefix . 'service_local',
708
+ 'class' => 'service',
709
+ 'type' => 'text_medium',
710
+ ),
711
+ array(
712
+ 'name' => __('','rich-snippets'),
713
+ 'desc' => __('Region','rich-snippets'),
714
+ 'id' => $prefix . 'service_region',
715
+ 'class' => 'service',
716
+ 'type' => 'text_medium',
717
+ ),
718
+ array(
719
+ 'name' => __('','rich-snippets'),
720
+ 'desc' => __('Postal Code','rich-snippets'),
721
+ 'id' => $prefix . 'service_postal_code',
722
+ 'class' => 'service',
723
+ 'type' => 'text_medium',
724
+ ),
725
+ array(
726
+ 'name' => __('Provider Location Image','rich-snippets'),
727
+ 'desc' => __('Upload the provider location image or select from library. Medium size is recommended (300px X 300px)','rich-snippets'),
728
+ 'id' => $prefix . 'provider_location_image',
729
+ 'class' => 'service',
730
+ 'type' => 'file',
731
+ ),
732
+ array(
733
+ 'name' => __('Telephone','rich-snippets'),
734
+ 'desc' => __('Telephone number','rich-snippets'),
735
+ 'id' => $prefix . 'service_telephone',
736
+ 'class' => 'service',
737
+ 'type' => 'text_medium',
738
+ ),
739
  array(
740
  'name' => __('Enable/Disable Rating','rich-snippets'),
741
  'desc' => __('.','rich-snippets'),
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: brainstormforce, yawalkarm
3
  Donate link: https://www.brainstormforce.com
4
  Tags: Review, Event, People, Product, Recipe, Software Application, Video, Article, rdfa, rich snippet, schema.org, schema, microdata, microformat, SERP, Google, Yahoo, Bing
5
  Requires at least: 3.7
6
- Tested up to: 4.7
7
- Stable tag: 1.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Boost CTR. Improve SEO & Rankings. Supports most of the content type. Works perfectly with Google, Bing, Yahoo & Facebook.
@@ -78,6 +78,16 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et
78
 
79
  == Changelog ==
80
 
 
 
 
 
 
 
 
 
 
 
81
  = 1.4.1 =
82
  * Fix: Compatibility fix WordPress 4.7.
83
 
@@ -161,4 +171,4 @@ Review, Event, People, Product, Recipe, Software Application, Video, Articles et
161
  * Initial Release.
162
 
163
  == Upgrade Notice ==
164
- Note: Minor bug fixes. Update the plugin to enjoy bug free blogging!
3
  Donate link: https://www.brainstormforce.com
4
  Tags: Review, Event, People, Product, Recipe, Software Application, Video, Article, rdfa, rich snippet, schema.org, schema, microdata, microformat, SERP, Google, Yahoo, Bing
5
  Requires at least: 3.7
6
+ Tested up to: 4.7.3
7
+ Stable tag: 1.4.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Boost CTR. Improve SEO & Rankings. Supports most of the content type. Works perfectly with Google, Bing, Yahoo & Facebook.
78
 
79
  == Changelog ==
80
 
81
+ = 1.4.2 =
82
+ * Improvement: Added company/organization and address in people schema.
83
+ * Improvement: Added nutrition & ingredients in recipe schema.
84
+ * Improvement: Added software image & operating system in software application schema.
85
+ * Improvement: Added video description in software application schema.
86
+ * Improvement: Added author, publisher - organization and publisher logo in article schema.
87
+ * Improvement: Added provider location, provider location image, and telephone in service schema.
88
+ * Improvement: Changes admin bar test rich snippet redirect link to the structured data testing tool.
89
+ * Fix: removed all error in schema according to structured data testing tool.
90
+
91
  = 1.4.1 =
92
  * Fix: Compatibility fix WordPress 4.7.
93
 
171
  * Initial Release.
172
 
173
  == Upgrade Notice ==
174
+ Note: Minor bug fixes. Update the plugin to enjoy bug free blogging!
settings.php CHANGED
@@ -7,11 +7,11 @@ function add_review_option()
7
  'item_reviewer' => __('Reviewer','rich-snippets'),
8
  'review_date' => __('Review Date','rich-snippets'),
9
  'item_name' => __('Reviewed Item','rich-snippets'),
10
- // 'item_description' => __('Description','rich-snippets'),
11
  'item_rating' => __('Author Rating','rich-snippets')
12
  );
13
- add_option('bsf_review',$review_opt);
14
  }
 
15
  // Function to add event option for settings
16
  function add_event_option()
17
  {
@@ -19,15 +19,14 @@ function add_event_option()
19
  'snippet_title' => __('Summary','rich-snippets'),
20
  'event_title' => __('Event','rich-snippets'),
21
  'event_location' => __('Location','rich-snippets'),
22
- // 'event_desc' => __('Description','rich-snippets'),
23
  'start_time' => __('Starting on','rich-snippets'),
24
  'end_time' => __('Ending on','rich-snippets'),
25
  'events_price' => __('Offer Price','rich-snippets')
26
-
27
- // 'geo_location' => __('GEO Location','rich-snippets')
28
  );
29
  add_option('bsf_event',$event_opt);
30
  }
 
31
  // Function to add person option for settings
32
  function add_person_option()
33
  {
@@ -42,6 +41,7 @@ function add_person_option()
42
  );
43
  add_option('bsf_person',$person_opt);
44
  }
 
45
  // Function to add product option for settings
46
  function add_product_option()
47
  {
@@ -56,22 +56,26 @@ function add_product_option()
56
  );
57
  add_option('bsf_product',$product_opt);
58
  }
 
59
  // Function to add recipe option for settings
60
  function add_recipe_option()
61
  {
62
  $recipe_opt = array(
63
  'snippet_title' => __('Summary','rich-snippets'),
64
  'recipe_name' => __('Recipe Name','rich-snippets'),
 
65
  'recipe_pub' => __('Published On','rich-snippets'),
66
  'recipe_prep' => __('Preparation Time','rich-snippets'),
67
  'recipe_cook' => __('Cook Time','rich-snippets'),
68
  'recipe_time' => __('Total Time','rich-snippets'),
69
- // 'recipe_ingred' => __('Ingredients','rich-snippets'),
70
- // 'recipe_summary' => __('Brief Summary','rich-snippets'),
 
71
  'recipe_rating' => __('Average Rating','rich-snippets')
72
  );
73
  add_option('bsf_recipe',$recipe_opt);
74
  }
 
75
  // Function to add software option for settings
76
  function add_software_option()
77
  {
@@ -83,12 +87,10 @@ function add_software_option()
83
  'software_name' => __('Software Name','rich-snippets'),
84
  'software_os' => __('Operating System','rich-snippets'),
85
  'software_website' => __('Landing Page','rich-snippets'),
86
-
87
-
88
- // 'software_desc' => __('Brief Description','rich-snippets')
89
  );
90
  add_option('bsf_software',$software_opt);
91
  }
 
92
  // Function to add video option for settings
93
  function add_video_option()
94
  {
@@ -127,8 +129,10 @@ function add_service_option()
127
  'service_channel' => __('URL','rich-snippets'),
128
  'service_url_link' => __('Click Here For More Info','rich-snippets'),
129
  'service_rating' => __('User Rating','rich-snippets'),
130
- 'service_provider_name' => __('Provider Name','rich-snippets')
131
-
 
 
132
  );
133
  add_option('bsf_service',$service_opt);
134
  }
7
  'item_reviewer' => __('Reviewer','rich-snippets'),
8
  'review_date' => __('Review Date','rich-snippets'),
9
  'item_name' => __('Reviewed Item','rich-snippets'),
 
10
  'item_rating' => __('Author Rating','rich-snippets')
11
  );
12
+ add_option('bsf_review',$review_opt);
13
  }
14
+
15
  // Function to add event option for settings
16
  function add_event_option()
17
  {
19
  'snippet_title' => __('Summary','rich-snippets'),
20
  'event_title' => __('Event','rich-snippets'),
21
  'event_location' => __('Location','rich-snippets'),
22
+ 'event_desc' => __('Description','rich-snippets'),
23
  'start_time' => __('Starting on','rich-snippets'),
24
  'end_time' => __('Ending on','rich-snippets'),
25
  'events_price' => __('Offer Price','rich-snippets')
 
 
26
  );
27
  add_option('bsf_event',$event_opt);
28
  }
29
+
30
  // Function to add person option for settings
31
  function add_person_option()
32
  {
41
  );
42
  add_option('bsf_person',$person_opt);
43
  }
44
+
45
  // Function to add product option for settings
46
  function add_product_option()
47
  {
56
  );
57
  add_option('bsf_product',$product_opt);
58
  }
59
+
60
  // Function to add recipe option for settings
61
  function add_recipe_option()
62
  {
63
  $recipe_opt = array(
64
  'snippet_title' => __('Summary','rich-snippets'),
65
  'recipe_name' => __('Recipe Name','rich-snippets'),
66
+ 'author_name' => __('Author Name','rich-snippets'),
67
  'recipe_pub' => __('Published On','rich-snippets'),
68
  'recipe_prep' => __('Preparation Time','rich-snippets'),
69
  'recipe_cook' => __('Cook Time','rich-snippets'),
70
  'recipe_time' => __('Total Time','rich-snippets'),
71
+ 'recipe_desc' => __('Description','rich-snippets'),
72
+ 'recipe_nutrition' => __('Nutrition','rich-snippets'),
73
+ 'recipe_ingredient' => __('Ingredients','rich-snippets'),
74
  'recipe_rating' => __('Average Rating','rich-snippets')
75
  );
76
  add_option('bsf_recipe',$recipe_opt);
77
  }
78
+
79
  // Function to add software option for settings
80
  function add_software_option()
81
  {
87
  'software_name' => __('Software Name','rich-snippets'),
88
  'software_os' => __('Operating System','rich-snippets'),
89
  'software_website' => __('Landing Page','rich-snippets'),
 
 
 
90
  );
91
  add_option('bsf_software',$software_opt);
92
  }
93
+
94
  // Function to add video option for settings
95
  function add_video_option()
96
  {
129
  'service_channel' => __('URL','rich-snippets'),
130
  'service_url_link' => __('Click Here For More Info','rich-snippets'),
131
  'service_rating' => __('User Rating','rich-snippets'),
132
+ 'service_provider_name' => __('Provider Name','rich-snippets'),
133
+ 'provider_location' => __('Location','rich-snippets'),
134
+ 'service_telephone' => __('Provider telephone number','rich-snippets'),
135
+ // 'service_price' => __('Price Range','rich-snippets')
136
  );
137
  add_option('bsf_service',$service_opt);
138
  }