Version Description
(12 April 2019) =
- Added : Option to use URL rather than phone number for contact type in Knowledge Graph #199
- Bug Fixed: Image markup src remains null in AMP despite featured images on post #206
- Bug Fixed: Array (The value provided for image must be a valid URL.) #203
- Bug Fixed: After removing social links from the knowledge graph it still shows up in the markup #200
- Bug Fixed: If schema is not enabled on amp, it still adds blank script #189
- Bug Fixed: Modify schema output for the review schema has no author fields in dropdown #193
- Bug Fixed: Notice: Undefined offset #197
- Bug Fixed: Undefined index #204
Download this release
Release Info
Developer | magazine3 |
Plugin | Schema & Structured Data for WP & AMP |
Version | 1.6 |
Comparing to | |
See all releases |
Code changes from version 1.5 to 1.6
- admin_section/ajax-selectbox.php +7 -1
- admin_section/common-function.php +22 -25
- admin_section/css/main-style.css +28 -1
- admin_section/fields-generator.php +16 -13
- admin_section/js/main-script.js +71 -14
- admin_section/settings.php +236 -169
- admin_section/structure_admin.php +45 -30
- output/flexmls.php +1 -1
- output/function.php +23 -18
- output/output.php +53 -41
- output/service.php +44 -24
- readme.txt +13 -1
- structured-data-for-wp.php +2 -2
- view/post_specific.php +20 -19
admin_section/ajax-selectbox.php
CHANGED
@@ -273,14 +273,20 @@ function saswp_post_taxonomy_generator(){
|
|
273 |
|
274 |
$taxonomies = '';
|
275 |
$choices = array();
|
|
|
|
|
276 |
$taxonomies = get_taxonomies( array('public' => true), 'objects' );
|
277 |
|
|
|
|
|
278 |
foreach($taxonomies as $taxonomy) {
|
279 |
|
280 |
$choices[ $taxonomy->name ] = $taxonomy->labels->name;
|
281 |
|
282 |
}
|
283 |
-
|
|
|
|
|
284 |
// unset post_format (why is this a public taxonomy?)
|
285 |
if( isset($choices['post_format']) ) {
|
286 |
|
273 |
|
274 |
$taxonomies = '';
|
275 |
$choices = array();
|
276 |
+
|
277 |
+
|
278 |
$taxonomies = get_taxonomies( array('public' => true), 'objects' );
|
279 |
|
280 |
+
if($taxonomies){
|
281 |
+
|
282 |
foreach($taxonomies as $taxonomy) {
|
283 |
|
284 |
$choices[ $taxonomy->name ] = $taxonomy->labels->name;
|
285 |
|
286 |
}
|
287 |
+
|
288 |
+
}
|
289 |
+
|
290 |
// unset post_format (why is this a public taxonomy?)
|
291 |
if( isset($choices['post_format']) ) {
|
292 |
|
admin_section/common-function.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
|
11 |
$url = get_option('saswp-file-upload_url');
|
12 |
global $wpdb;
|
13 |
-
$result ='';
|
14 |
$errorDesc = array();
|
15 |
|
16 |
if($url){
|
@@ -21,12 +21,10 @@
|
|
21 |
|
22 |
$sd_data = $json_array['sd_data'];
|
23 |
$schema_post = array();
|
24 |
-
|
25 |
-
|
26 |
if($all_schema_post){
|
27 |
// begin transaction
|
28 |
$wpdb->query('START TRANSACTION');
|
29 |
-
|
30 |
|
31 |
foreach($all_schema_post as $schema_post){
|
32 |
|
@@ -273,20 +271,20 @@
|
|
273 |
$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
|
274 |
|
275 |
$saswp_plugin_options = array(
|
276 |
-
'sd_logo'
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
),
|
283 |
-
'saswp_kb_contact_1'=> 0,
|
284 |
//AMP Block
|
285 |
-
'saswp-for-amp'
|
286 |
-
'saswp-for-wordpress'=>1,
|
287 |
-
'saswp-logo-width'
|
288 |
-
'saswp-logo-height'
|
289 |
-
'sd_initial_wizard_status' =>1,
|
290 |
|
291 |
);
|
292 |
if(isset($schema_plugin_options['facebook'])){
|
@@ -603,12 +601,6 @@
|
|
603 |
if(isset($settings['site_telephone'])){
|
604 |
$local_business_details['local_phone'] = $settings['site_telephone'];
|
605 |
}
|
606 |
-
// if(isset($settings['business_info']['openingHours'])){
|
607 |
-
//
|
608 |
-
// }
|
609 |
-
// if(isset($settings['business_info']['openingHours'])){
|
610 |
-
//
|
611 |
-
// }
|
612 |
if(isset($settings['web_url'])){
|
613 |
$local_business_details['local_website'] = $settings['web_url'];
|
614 |
}
|
@@ -1141,7 +1133,8 @@ function saswp_expanded_allowed_tags() {
|
|
1141 |
'readonly' => array(),
|
1142 |
'disabled' => array(),
|
1143 |
'width' => array(),
|
1144 |
-
'data-id' => array()
|
|
|
1145 |
);
|
1146 |
$my_allowed['hidden'] = array(
|
1147 |
'id' => array(),
|
@@ -1238,6 +1231,7 @@ function saswp_defaultSettings(){
|
|
1238 |
|
1239 |
global $sd_data;
|
1240 |
$sd_name = 'default';
|
|
|
1241 |
$bloginfo = get_bloginfo('name', 'display');
|
1242 |
|
1243 |
if($bloginfo){
|
@@ -1248,8 +1242,11 @@ function saswp_defaultSettings(){
|
|
1248 |
|
1249 |
$current_url = get_home_url();
|
1250 |
$custom_logo_id = get_theme_mod( 'custom_logo' );
|
1251 |
-
|
1252 |
-
|
|
|
|
|
|
|
1253 |
$user_id = get_current_user_id();
|
1254 |
$username = '';
|
1255 |
|
10 |
|
11 |
$url = get_option('saswp-file-upload_url');
|
12 |
global $wpdb;
|
13 |
+
$result = '';
|
14 |
$errorDesc = array();
|
15 |
|
16 |
if($url){
|
21 |
|
22 |
$sd_data = $json_array['sd_data'];
|
23 |
$schema_post = array();
|
24 |
+
|
|
|
25 |
if($all_schema_post){
|
26 |
// begin transaction
|
27 |
$wpdb->query('START TRANSACTION');
|
|
|
28 |
|
29 |
foreach($all_schema_post as $schema_post){
|
30 |
|
271 |
$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
|
272 |
|
273 |
$saswp_plugin_options = array(
|
274 |
+
'sd_logo' => array(
|
275 |
+
'url' =>$schema_plugin_options['logo'],
|
276 |
+
'id' =>$custom_logo_id,
|
277 |
+
'height' =>'600',
|
278 |
+
'width' =>'60',
|
279 |
+
'thumbnail' =>$schema_plugin_options['logo']
|
280 |
),
|
281 |
+
'saswp_kb_contact_1' => 0,
|
282 |
//AMP Block
|
283 |
+
'saswp-for-amp' => 1,
|
284 |
+
'saswp-for-wordpress' => 1,
|
285 |
+
'saswp-logo-width' => '60',
|
286 |
+
'saswp-logo-height' => '60',
|
287 |
+
'sd_initial_wizard_status' => 1,
|
288 |
|
289 |
);
|
290 |
if(isset($schema_plugin_options['facebook'])){
|
601 |
if(isset($settings['site_telephone'])){
|
602 |
$local_business_details['local_phone'] = $settings['site_telephone'];
|
603 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
604 |
if(isset($settings['web_url'])){
|
605 |
$local_business_details['local_website'] = $settings['web_url'];
|
606 |
}
|
1133 |
'readonly' => array(),
|
1134 |
'disabled' => array(),
|
1135 |
'width' => array(),
|
1136 |
+
'data-id' => array(),
|
1137 |
+
'checked' => array()
|
1138 |
);
|
1139 |
$my_allowed['hidden'] = array(
|
1140 |
'id' => array(),
|
1231 |
|
1232 |
global $sd_data;
|
1233 |
$sd_name = 'default';
|
1234 |
+
$logo = array();
|
1235 |
$bloginfo = get_bloginfo('name', 'display');
|
1236 |
|
1237 |
if($bloginfo){
|
1242 |
|
1243 |
$current_url = get_home_url();
|
1244 |
$custom_logo_id = get_theme_mod( 'custom_logo' );
|
1245 |
+
|
1246 |
+
if($custom_logo_id){
|
1247 |
+
$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
|
1248 |
+
}
|
1249 |
+
|
1250 |
$user_id = get_current_user_id();
|
1251 |
$username = '';
|
1252 |
|
admin_section/css/main-style.css
CHANGED
@@ -568,4 +568,31 @@ On/Off Buttons ends here
|
|
568 |
|
569 |
.saswp-custom-fields-table select{
|
570 |
width: 100%;
|
571 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
568 |
|
569 |
.saswp-custom-fields-table select{
|
570 |
width: 100%;
|
571 |
+
}
|
572 |
+
|
573 |
+
/*
|
574 |
+
Compatibility tab css starts here
|
575 |
+
*/
|
576 |
+
.saswp-email_schema table th{
|
577 |
+
width: auto;
|
578 |
+
padding: 0px;
|
579 |
+
}
|
580 |
+
.saswp-email_schema .saswp-knowledge-label {
|
581 |
+
float: left;
|
582 |
+
clear: both;
|
583 |
+
}
|
584 |
+
.saswp-email_schema .saswp-knowledge-field {
|
585 |
+
float: right;
|
586 |
+
width: 75%;
|
587 |
+
padding-bottom: 10px;
|
588 |
+
}
|
589 |
+
/*
|
590 |
+
Compatibility tab css ends
|
591 |
+
*/
|
592 |
+
.saswp-add-on-plugin label{
|
593 |
+
margin-top: 10px;
|
594 |
+
}
|
595 |
+
.saswp-add-on-plugin span{
|
596 |
+
width: 250px;
|
597 |
+
display: inline-block;
|
598 |
+
}
|
admin_section/fields-generator.php
CHANGED
@@ -31,7 +31,8 @@ class saswp_fields_generator {
|
|
31 |
$tooltip_message = $this->saswp_tooltip_message($meta_field['id']);
|
32 |
|
33 |
$class = "";
|
34 |
-
$note = "";
|
|
|
35 |
$hidden = array();
|
36 |
$attribute = array();
|
37 |
|
@@ -39,6 +40,12 @@ class saswp_fields_generator {
|
|
39 |
|
40 |
$class = $meta_field['class'];
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
if(array_key_exists('note', $meta_field)){
|
44 |
|
@@ -132,17 +139,7 @@ class saswp_fields_generator {
|
|
132 |
|
133 |
}
|
134 |
$message ='';
|
135 |
-
|
136 |
-
if (! is_plugin_active('flexmls-idx/flexmls_connect.php')) {
|
137 |
-
|
138 |
-
if($meta_field['id'] =='saswp_compativility_checkbox'){
|
139 |
-
|
140 |
-
$note = esc_html__('Plugin is not activated','schema-and-structured-data-for-wp');
|
141 |
-
|
142 |
-
}
|
143 |
-
|
144 |
-
}
|
145 |
-
|
146 |
$input = sprintf(
|
147 |
'<input class="%s" id="%s" name="%s" type="checkbox" %s %s><p>'.$message.'</p>',
|
148 |
esc_attr($class),
|
@@ -199,7 +196,13 @@ class saswp_fields_generator {
|
|
199 |
}
|
200 |
|
201 |
$allowed_html = saswp_expanded_allowed_tags();
|
202 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
}
|
204 |
echo '<div><div class="saswp-settings-list"><ul>' . wp_kses($output, $allowed_html) . '</ul></div></div>';
|
205 |
}
|
31 |
$tooltip_message = $this->saswp_tooltip_message($meta_field['id']);
|
32 |
|
33 |
$class = "";
|
34 |
+
$note = "";
|
35 |
+
$proversion = false;
|
36 |
$hidden = array();
|
37 |
$attribute = array();
|
38 |
|
40 |
|
41 |
$class = $meta_field['class'];
|
42 |
|
43 |
+
}
|
44 |
+
if(array_key_exists('proversion', $meta_field)){
|
45 |
+
|
46 |
+
$proversion = $meta_field['proversion'];
|
47 |
+
|
48 |
+
|
49 |
}
|
50 |
if(array_key_exists('note', $meta_field)){
|
51 |
|
139 |
|
140 |
}
|
141 |
$message ='';
|
142 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
$input = sprintf(
|
144 |
'<input class="%s" id="%s" name="%s" type="checkbox" %s %s><p>'.$message.'</p>',
|
145 |
esc_attr($class),
|
196 |
}
|
197 |
|
198 |
$allowed_html = saswp_expanded_allowed_tags();
|
199 |
+
|
200 |
+
if($note =='' || $proversion == 1){
|
201 |
+
$output .= '<li><div class="saswp-knowledge-label">'.$label.'</div><div class="saswp-knowledge-field">'.$input.'<p data-id="'.esc_attr($proversion).'">'.esc_html__($note,'schema-and-structured-data-for-wp').'</p></div></li>';
|
202 |
+
}else{
|
203 |
+
$output .= '<li><div class="saswp-knowledge-label">'.$label.'</div><div class="saswp-knowledge-field">'.$input.'<p class="saswp_hide">'.esc_html__($note,'schema-and-structured-data-for-wp').'</p></div></li>';
|
204 |
+
}
|
205 |
+
|
206 |
}
|
207 |
echo '<div><div class="saswp-settings-list"><ul>' . wp_kses($output, $allowed_html) . '</ul></div></div>';
|
208 |
}
|
admin_section/js/main-script.js
CHANGED
@@ -125,8 +125,24 @@ jQuery(document).ready(function($){
|
|
125 |
|
126 |
//Settings page jquery starts here
|
127 |
|
|
|
|
|
128 |
$(".saswp-checkbox").change(function(){
|
129 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
switch(id){
|
131 |
case 'saswp-for-wordpress-checkbox':
|
132 |
|
@@ -291,12 +307,12 @@ jQuery(document).ready(function($){
|
|
291 |
}
|
292 |
break;
|
293 |
|
294 |
-
case '
|
295 |
|
296 |
if ($(this).is(':checked')) {
|
297 |
-
$("#
|
298 |
}else{
|
299 |
-
$("#
|
300 |
}
|
301 |
break;
|
302 |
|
@@ -320,9 +336,9 @@ jQuery(document).ready(function($){
|
|
320 |
case 'saswp-woocommerce-checkbox':
|
321 |
|
322 |
if ($(this).is(':checked')) {
|
323 |
-
$("#saswp-woocommerce").val(1);
|
324 |
}else{
|
325 |
-
$("#saswp-woocommerce").val(0);
|
326 |
}
|
327 |
break;
|
328 |
|
@@ -380,6 +396,46 @@ jQuery(document).ready(function($){
|
|
380 |
}
|
381 |
break;
|
382 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
|
384 |
default:
|
385 |
break;
|
@@ -387,7 +443,8 @@ jQuery(document).ready(function($){
|
|
387 |
|
388 |
}).change();
|
389 |
|
390 |
-
|
|
|
391 |
var datatype = $(this).val();
|
392 |
|
393 |
$(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass('saswp_hide');
|
@@ -747,13 +804,13 @@ jQuery(document).ready(function($){
|
|
747 |
|
748 |
$(document).on("click","div.saswp-tab ul.saswp-tab-nav a", function(e){
|
749 |
e.preventDefault();
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
saswp_enable_rating_review();
|
758 |
});
|
759 |
|
125 |
|
126 |
//Settings page jquery starts here
|
127 |
|
128 |
+
|
129 |
+
|
130 |
$(".saswp-checkbox").change(function(){
|
131 |
+
|
132 |
+
var id = $(this).attr("id");
|
133 |
+
var plugin_name = id.replace('-checkbox','');
|
134 |
+
var text = $("#"+plugin_name).next('p').text();
|
135 |
+
|
136 |
+
if ($(this).is(':checked') && text !=='') {
|
137 |
+
$("#"+plugin_name).next('p').removeClass('saswp_hide');
|
138 |
+
}else{
|
139 |
+
|
140 |
+
if($("#"+plugin_name).next('p').attr('data-id') == 1){
|
141 |
+
$("#"+plugin_name).next('p').text('This feature is only available in pro version');
|
142 |
+
}else{
|
143 |
+
$("#"+plugin_name).next('p').addClass('saswp_hide');
|
144 |
+
}
|
145 |
+
}
|
146 |
switch(id){
|
147 |
case 'saswp-for-wordpress-checkbox':
|
148 |
|
307 |
}
|
308 |
break;
|
309 |
|
310 |
+
case 'saswp-compativility-checkbox':
|
311 |
|
312 |
if ($(this).is(':checked')) {
|
313 |
+
$("#saswp-flexmlx-compativility").val(1);
|
314 |
}else{
|
315 |
+
$("#saswp-flexmlx-compativility").val(0);
|
316 |
}
|
317 |
break;
|
318 |
|
336 |
case 'saswp-woocommerce-checkbox':
|
337 |
|
338 |
if ($(this).is(':checked')) {
|
339 |
+
$("#saswp-woocommerce").val(1);
|
340 |
}else{
|
341 |
+
$("#saswp-woocommerce").val(0);
|
342 |
}
|
343 |
break;
|
344 |
|
396 |
}
|
397 |
break;
|
398 |
|
399 |
+
case 'saswp-the-events-calendar-checkbox':
|
400 |
+
|
401 |
+
if ($(this).is(':checked')) {
|
402 |
+
$("#saswp-the-events-calendar").val(1);
|
403 |
+
}else{
|
404 |
+
$("#saswp-the-events-calendar").val(0);
|
405 |
+
}
|
406 |
+
break;
|
407 |
+
|
408 |
+
case 'saswp-woocommerce-booking-checkbox':
|
409 |
+
|
410 |
+
if ($(this).is(':checked')) {
|
411 |
+
$("#saswp-woocommerce-booking").val(1);
|
412 |
+
$("#saswp-woocommerce-booking-main").val(1);
|
413 |
+
}else{
|
414 |
+
$("#saswp-woocommerce-booking").val(0);
|
415 |
+
$("#saswp-woocommerce-booking-main").val(0);
|
416 |
+
}
|
417 |
+
break;
|
418 |
+
|
419 |
+
case 'saswp-woocommerce-booking-main-checkbox':
|
420 |
+
|
421 |
+
if ($(this).is(':checked')) {
|
422 |
+
$("#saswp-woocommerce-booking-main").val(1);
|
423 |
+
$("#saswp-woocommerce-booking").val(1);
|
424 |
+
}else{
|
425 |
+
$("#saswp-woocommerce-booking-main").val(0);
|
426 |
+
$("#saswp-woocommerce-booking").val(0);
|
427 |
+
}
|
428 |
+
break;
|
429 |
+
|
430 |
+
case 'saswp-woocommerce-membership-checkbox':
|
431 |
+
|
432 |
+
if ($(this).is(':checked')) {
|
433 |
+
$("#saswp-woocommerce-membership").val(1);
|
434 |
+
}else{
|
435 |
+
$("#saswp-woocommerce-membership").val(0);
|
436 |
+
}
|
437 |
+
break;
|
438 |
+
|
439 |
|
440 |
default:
|
441 |
break;
|
443 |
|
444 |
}).change();
|
445 |
|
446 |
+
$("#saswp_kb_type").change(function(){
|
447 |
+
|
448 |
var datatype = $(this).val();
|
449 |
|
450 |
$(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass('saswp_hide');
|
804 |
|
805 |
$(document).on("click","div.saswp-tab ul.saswp-tab-nav a", function(e){
|
806 |
e.preventDefault();
|
807 |
+
var attr = $(this).attr('data-id');
|
808 |
+
$(".saswp-post-specific-wrapper").hide();
|
809 |
+
$("#"+attr).show();
|
810 |
+
$('div.saswp-tab ul.saswp-tab-nav a').removeClass('selected');
|
811 |
+
$('div.saswp-tab ul.saswp-tab-nav li').removeClass('selected');
|
812 |
+
$(this).addClass('selected');
|
813 |
+
$(this).parent().addClass('selected');
|
814 |
saswp_enable_rating_review();
|
815 |
});
|
816 |
|
admin_section/settings.php
CHANGED
@@ -31,12 +31,12 @@ function saswp_admin_interface_render(){
|
|
31 |
if ( isset( $_GET['settings-updated'] ) ) {
|
32 |
settings_errors();
|
33 |
}
|
34 |
-
|
35 |
if ( is_plugin_active('accelerated-mobile-pages/accelerated-moblie-pages.php') || is_plugin_active('amp/amp.php') ) {
|
36 |
-
|
37 |
}
|
38 |
|
39 |
-
$tab = saswp_get_tab('general', array('general','knowledge','schema', 'tools', 'amp','review','compatibility','support'));
|
40 |
|
41 |
?>
|
42 |
<div class="saswp-settings-container">
|
@@ -61,6 +61,8 @@ function saswp_admin_interface_render(){
|
|
61 |
|
62 |
echo '<a href="' . esc_url(saswp_admin_link('compatibility')) . '" class="nav-tab ' . esc_attr( $tab == 'compatibility' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Compatibility','schema-and-structured-data-for-wp') . '</a>';
|
63 |
|
|
|
|
|
64 |
echo '<a href="' . esc_url(saswp_admin_link('support')) . '" class="nav-tab ' . esc_attr( $tab == 'support' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Support','schema-and-structured-data-for-wp') . '</a>';
|
65 |
?>
|
66 |
|
@@ -103,6 +105,11 @@ function saswp_admin_interface_render(){
|
|
103 |
do_settings_sections( 'saswp_compatibility_section' ); // Page slug
|
104 |
echo "</div>";
|
105 |
|
|
|
|
|
|
|
|
|
|
|
106 |
echo "<div class='saswp-support' ".( $tab != 'support' ? 'style="display:none;"' : '').">";
|
107 |
// Status
|
108 |
do_settings_sections( 'saswp_support_section' ); // Page slug
|
@@ -217,6 +224,16 @@ function saswp_settings_init(){
|
|
217 |
'saswp_compatibility_section' // Settings Section ID
|
218 |
);
|
219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
|
221 |
add_settings_section('saswp_support_section', __return_false(), '__return_false', 'saswp_support_section');
|
222 |
|
@@ -275,31 +292,31 @@ function saswp_schema_page_callback(){
|
|
275 |
$meta_fields_default = array(
|
276 |
array(
|
277 |
'label' => 'Default Image',
|
278 |
-
'id'
|
279 |
-
'name'
|
280 |
'class' => 'saswp-sd_default_image',
|
281 |
-
'type'
|
282 |
),
|
283 |
array(
|
284 |
'label' => 'Default Post Image Width',
|
285 |
-
'id'
|
286 |
-
'name'
|
287 |
'class' => 'regular-text',
|
288 |
-
'type'
|
289 |
),
|
290 |
array(
|
291 |
'label' => 'Default Post Image Height',
|
292 |
-
'id'
|
293 |
-
'name'
|
294 |
'class' => 'regular-text',
|
295 |
-
'type'
|
296 |
),
|
297 |
array(
|
298 |
'label' => 'Default Thumbnail for VideoObject',
|
299 |
-
'id'
|
300 |
-
'name'
|
301 |
'class' => 'saswp-sd_default_video_thumbnail',
|
302 |
-
'type'
|
303 |
),
|
304 |
);
|
305 |
echo '<h2>'.esc_html__('Default Values','schema-and-structured-data-for-wp').'</h2>';
|
@@ -314,13 +331,13 @@ function saswp_amp_page_callback(){
|
|
314 |
$field_objs = new saswp_fields_generator();
|
315 |
|
316 |
$non_amp_enable_field = array(
|
317 |
-
'label'
|
318 |
-
'id'
|
319 |
-
'name'
|
320 |
-
'type'
|
321 |
-
'class'
|
322 |
'hidden' => array(
|
323 |
-
'id'
|
324 |
'name' => 'sd_data[saswp-for-amp]',
|
325 |
)
|
326 |
) ;
|
@@ -332,7 +349,7 @@ function saswp_amp_page_callback(){
|
|
332 |
$non_amp_enable_field['attributes'] = array(
|
333 |
'disabled' => 'disabled'
|
334 |
);
|
335 |
-
$non_amp_enable_field['note'] = esc_html__('AMP
|
336 |
$settings['saswp-for-amp'] = 0;
|
337 |
|
338 |
}
|
@@ -340,14 +357,14 @@ function saswp_amp_page_callback(){
|
|
340 |
$meta_fields = array(
|
341 |
$non_amp_enable_field,
|
342 |
array(
|
343 |
-
'label'
|
344 |
-
'id'
|
345 |
-
'name'
|
346 |
-
'type'
|
347 |
-
'class'
|
348 |
-
'note'
|
349 |
'hidden' => array(
|
350 |
-
'id'
|
351 |
'name' => 'sd_data[saswp-for-wordpress]',
|
352 |
)
|
353 |
)
|
@@ -362,22 +379,22 @@ function saswp_general_page_callback(){
|
|
362 |
|
363 |
$meta_fields_default = array(
|
364 |
array(
|
365 |
-
'label'
|
366 |
-
'id'
|
367 |
-
'name'
|
368 |
-
'type'
|
369 |
-
'class'
|
370 |
'hidden' => array(
|
371 |
-
'id'
|
372 |
'name' => 'sd_data[saswp_archive_schema]',
|
373 |
)
|
374 |
),
|
375 |
array(
|
376 |
-
'label'
|
377 |
-
'id'
|
378 |
-
'name'
|
379 |
-
'class'
|
380 |
-
'type'
|
381 |
'options' => array(
|
382 |
'Article' => 'Article',
|
383 |
'Blogposting' => 'Blogposting',
|
@@ -386,35 +403,35 @@ function saswp_general_page_callback(){
|
|
386 |
)
|
387 |
),
|
388 |
array(
|
389 |
-
'label'
|
390 |
-
'id'
|
391 |
-
'name'
|
392 |
-
'type'
|
393 |
-
'class'
|
394 |
'hidden' => array(
|
395 |
-
'id'
|
396 |
'name' => 'sd_data[saswp_breadcrumb_schema]',
|
397 |
)
|
398 |
),
|
399 |
array(
|
400 |
-
'label'
|
401 |
-
'id'
|
402 |
-
'name'
|
403 |
-
'type'
|
404 |
-
'class'
|
405 |
'hidden' => array(
|
406 |
-
'id'
|
407 |
'name' => 'sd_data[saswp_comments_schema]',
|
408 |
)
|
409 |
),
|
410 |
array(
|
411 |
-
'label'
|
412 |
-
'id'
|
413 |
-
'name'
|
414 |
-
'type'
|
415 |
-
'class'
|
416 |
'hidden' => array(
|
417 |
-
'id'
|
418 |
'name' => 'sd_data[saswp_site_navigation_menu]',
|
419 |
)
|
420 |
)
|
@@ -435,12 +452,12 @@ function saswp_general_page_callback(){
|
|
435 |
<label for="sd_about_page-select">
|
436 |
<?php
|
437 |
echo wp_dropdown_pages( array(
|
438 |
-
'name'
|
439 |
-
'id'
|
440 |
-
'echo'
|
441 |
-
'show_option_none'
|
442 |
'option_none_value' => '',
|
443 |
-
'selected'
|
444 |
)); ?>
|
445 |
</label>
|
446 |
</div>
|
@@ -519,7 +536,7 @@ function saswp_knowledge_page_callback(){
|
|
519 |
)
|
520 |
),
|
521 |
array(
|
522 |
-
'label' => 'Name',
|
523 |
'id' => 'sd_name',
|
524 |
'name' => 'sd_data[sd_name]',
|
525 |
'class' => 'regular-text saswp_org_fields',
|
@@ -527,19 +544,12 @@ function saswp_knowledge_page_callback(){
|
|
527 |
),
|
528 |
|
529 |
array(
|
530 |
-
'label' => '
|
531 |
'id' => 'sd_url',
|
532 |
'name' => 'sd_data[sd_url]',
|
533 |
'class' => 'regular-text saswp_org_fields',
|
534 |
'type' => 'text',
|
535 |
-
),
|
536 |
-
array(
|
537 |
-
'label' => 'Telephone Number',
|
538 |
-
'id' => 'saswp_kb_telephone',
|
539 |
-
'name' => 'sd_data[saswp_kb_telephone]',
|
540 |
-
'class' => 'regular-text saswp_org_fields',
|
541 |
-
'type' => 'text',
|
542 |
-
),
|
543 |
array(
|
544 |
'label' => 'Contact Type',
|
545 |
'id' => 'saswp_contact_type',
|
@@ -561,7 +571,21 @@ function saswp_knowledge_page_callback(){
|
|
561 |
'package tracking' => 'Package Tracking',
|
562 |
)
|
563 |
),
|
564 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
565 |
array(
|
566 |
'label' => 'Name',
|
567 |
'id' => 'sd-person-name',
|
@@ -662,28 +686,7 @@ function saswp_knowledge_page_callback(){
|
|
662 |
'attributes' => array(
|
663 |
'placeholder' => 'https://'
|
664 |
)
|
665 |
-
),
|
666 |
-
array(
|
667 |
-
'label' => 'Google+',
|
668 |
-
'id' => 'saswp-google-plus-enable-checkbox',
|
669 |
-
'name' => 'saswp-google-plus-enable-checkbox',
|
670 |
-
'type' => 'checkbox',
|
671 |
-
'class' => 'checkbox saswp-checkbox',
|
672 |
-
'hidden' => array(
|
673 |
-
'id' => 'saswp-google-plus-enable',
|
674 |
-
'name' => 'sd_data[saswp-google-plus-enable]',
|
675 |
-
)
|
676 |
-
),
|
677 |
-
array(
|
678 |
-
'label' => '',
|
679 |
-
'id' => 'sd_google_plus',
|
680 |
-
'name' => 'sd_data[sd_google_plus]',
|
681 |
-
'class' => 'regular-text',
|
682 |
-
'type' => 'text',
|
683 |
-
'attributes' => array(
|
684 |
-
'placeholder' => 'https://'
|
685 |
-
)
|
686 |
-
),
|
687 |
array(
|
688 |
'label' => 'Instagram',
|
689 |
'id' => 'saswp-instagram-enable-checkbox',
|
@@ -919,8 +922,6 @@ function saswp_import_callback(){
|
|
919 |
|
920 |
}
|
921 |
|
922 |
-
|
923 |
-
|
924 |
function saswp_review_page_callback(){
|
925 |
|
926 |
$settings = saswp_defaultSettings();
|
@@ -942,6 +943,50 @@ function saswp_review_page_callback(){
|
|
942 |
$field_objs->saswp_field_generator($meta_fields, $settings);
|
943 |
|
944 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
945 |
function saswp_compatibility_page_callback(){
|
946 |
|
947 |
$settings = saswp_defaultSettings();
|
@@ -993,6 +1038,29 @@ function saswp_compatibility_page_callback(){
|
|
993 |
'name' => 'sd_data[saswp-woocommerce]',
|
994 |
)
|
995 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
996 |
$extratheme = array(
|
997 |
'label' => 'Extra Theme By Elegant',
|
998 |
'id' => 'saswp-extra-checkbox',
|
@@ -1015,19 +1083,7 @@ function saswp_compatibility_page_callback(){
|
|
1015 |
'name' => 'sd_data[saswp-dw-question-answer]',
|
1016 |
)
|
1017 |
);
|
1018 |
-
|
1019 |
-
$wpjobmanager = array(
|
1020 |
-
'label' => 'WP Job Manager',
|
1021 |
-
'id' => 'saswp-wp-job-manager-checkbox',
|
1022 |
-
'name' => 'saswp-wp-job-manager-checkbox',
|
1023 |
-
'type' => 'checkbox',
|
1024 |
-
'class' => 'checkbox saswp-checkbox',
|
1025 |
-
'hidden' => array(
|
1026 |
-
'id' => 'saswp-wp-job-manager',
|
1027 |
-
'name' => 'sd_data[saswp-wp-job-manager]',
|
1028 |
-
)
|
1029 |
-
);
|
1030 |
-
|
1031 |
$yoast = array(
|
1032 |
'label' => 'Yoast SEO Plugin',
|
1033 |
'id' => 'saswp-yoast-checkbox',
|
@@ -1042,93 +1098,106 @@ function saswp_compatibility_page_callback(){
|
|
1042 |
|
1043 |
if(!is_plugin_active('taqyeem/taqyeem.php') || get_template() != 'jannah' ){
|
1044 |
|
1045 |
-
$tagyeem['
|
1046 |
-
|
1047 |
-
);
|
1048 |
-
$tagyeem['note'] = esc_html__('Plugin is not activated','schema-and-structured-data-for-wp');
|
1049 |
-
$settings['saswp-tagyeem'] = 0;
|
1050 |
-
|
1051 |
}
|
1052 |
|
1053 |
|
1054 |
if(!is_plugin_active('wordpress-seo/wp-seo.php') && !is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')){
|
1055 |
|
1056 |
-
$yoast['
|
1057 |
-
|
1058 |
-
);
|
1059 |
-
$yoast['note'] = esc_html__('Plugin is not activated','schema-and-structured-data-for-wp');
|
1060 |
-
$settings['saswp-yoast'] = 0;
|
1061 |
|
1062 |
}
|
1063 |
|
1064 |
if(!is_plugin_active('kk-star-ratings/index.php')){
|
1065 |
|
1066 |
-
$kk_star['
|
1067 |
-
'disabled' => 'disabled'
|
1068 |
-
);
|
1069 |
-
$kk_star['note'] = esc_html__('Plugin is not activated','schema-and-structured-data-for-wp');
|
1070 |
-
$settings['saswp-kk-star-raring'] = 0;
|
1071 |
|
1072 |
}
|
1073 |
-
|
1074 |
-
|
1075 |
if(!is_plugin_active('woocommerce/woocommerce.php')){
|
1076 |
|
1077 |
-
$woocommerce['
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1078 |
'disabled' => 'disabled'
|
1079 |
);
|
1080 |
-
|
1081 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1082 |
|
1083 |
}
|
1084 |
|
1085 |
if(get_template() != 'Extra'){
|
1086 |
-
|
1087 |
-
$extratheme['attributes'] = array(
|
1088 |
-
'disabled' => 'disabled'
|
1089 |
-
);
|
1090 |
$extratheme['note'] = esc_html__('Theme is not activated','schema-and-structured-data-for-wp');
|
1091 |
-
|
1092 |
|
1093 |
}
|
1094 |
|
1095 |
|
1096 |
if(!is_plugin_active('dw-question-answer/dw-question-answer.php')){
|
1097 |
|
1098 |
-
$dwquestiton['
|
1099 |
-
'disabled' => 'disabled'
|
1100 |
-
);
|
1101 |
-
$dwquestiton['note'] = esc_html__('Plugin is not activated','schema-and-structured-data-for-wp');
|
1102 |
-
$settings['saswp-dw-question-answer'] = 0;
|
1103 |
-
}
|
1104 |
-
|
1105 |
-
if(!is_plugin_active('wp-job-manager/wp-job-manager.php')){
|
1106 |
|
1107 |
-
$wpjobmanager['attributes'] = array(
|
1108 |
-
'disabled' => 'disabled'
|
1109 |
-
);
|
1110 |
-
$wpjobmanager['note'] = esc_html__('Plugin is not activated','schema-and-structured-data-for-wp');
|
1111 |
-
$settings['saswp-wp-job-manager'] = 0;
|
1112 |
}
|
1113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1114 |
if(!is_plugin_active('the-events-calendar/the-events-calendar.php')){
|
1115 |
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
$the_events_calendar['note'] = esc_html__('Plugin is not activated','schema-and-structured-data-for-wp');
|
1120 |
-
$settings['saswp-wp-job-manager'] = 0;
|
1121 |
}
|
1122 |
|
1123 |
$field_objs = new saswp_fields_generator();
|
|
|
1124 |
$meta_fields = array(
|
1125 |
$kk_star,
|
1126 |
$woocommerce,
|
|
|
|
|
1127 |
$the_events_calendar,
|
1128 |
$tagyeem,
|
1129 |
$extratheme,
|
1130 |
$dwquestiton,
|
1131 |
-
|
1132 |
$yoast,
|
1133 |
|
1134 |
);
|
@@ -1140,31 +1209,29 @@ function saswp_compatibility_page_callback(){
|
|
1140 |
$meta_fields_default = array(
|
1141 |
array(
|
1142 |
'label' => 'FlexMLS IDX Plugin',
|
1143 |
-
'id' => '
|
1144 |
-
'name' => '
|
1145 |
'type' => 'checkbox',
|
1146 |
'class' => 'checkbox saswp-checkbox',
|
1147 |
'hidden' => array(
|
1148 |
-
'id' => '
|
1149 |
-
'name' => 'sd_data[
|
1150 |
)
|
1151 |
),
|
1152 |
);
|
1153 |
}else{
|
1154 |
-
|
1155 |
$meta_fields_default = array(
|
1156 |
array(
|
1157 |
'label' => 'FlexMLS IDX',
|
1158 |
-
'id' => '
|
1159 |
-
'name' => '
|
1160 |
'type' => 'checkbox',
|
1161 |
-
'class' => 'checkbox saswp-checkbox',
|
1162 |
-
'
|
1163 |
-
'disabled' => 'disabled'
|
1164 |
-
),
|
1165 |
'hidden' => array(
|
1166 |
-
'id' => '
|
1167 |
-
'name' => 'sd_data[
|
1168 |
)
|
1169 |
),
|
1170 |
);
|
31 |
if ( isset( $_GET['settings-updated'] ) ) {
|
32 |
settings_errors();
|
33 |
}
|
34 |
+
$is_amp = false;
|
35 |
if ( is_plugin_active('accelerated-mobile-pages/accelerated-moblie-pages.php') || is_plugin_active('amp/amp.php') ) {
|
36 |
+
$is_amp = true;
|
37 |
}
|
38 |
|
39 |
+
$tab = saswp_get_tab('general', array('general','knowledge','schema', 'tools', 'amp','review','compatibility','email_schema','support'));
|
40 |
|
41 |
?>
|
42 |
<div class="saswp-settings-container">
|
61 |
|
62 |
echo '<a href="' . esc_url(saswp_admin_link('compatibility')) . '" class="nav-tab ' . esc_attr( $tab == 'compatibility' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Compatibility','schema-and-structured-data-for-wp') . '</a>';
|
63 |
|
64 |
+
//echo '<a href="' . esc_url(saswp_admin_link('email_schema')) . '" class="nav-tab ' . esc_attr( $tab == 'email_schema' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Email Schema','schema-and-structured-data-for-wp') . '</a>';
|
65 |
+
|
66 |
echo '<a href="' . esc_url(saswp_admin_link('support')) . '" class="nav-tab ' . esc_attr( $tab == 'support' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Support','schema-and-structured-data-for-wp') . '</a>';
|
67 |
?>
|
68 |
|
105 |
do_settings_sections( 'saswp_compatibility_section' ); // Page slug
|
106 |
echo "</div>";
|
107 |
|
108 |
+
echo "<div class='saswp-email_schema' ".( $tab != 'email_schema' ? 'style="display:none;"' : '').">";
|
109 |
+
// Status
|
110 |
+
do_settings_sections( 'saswp_email_schema_section' ); // Page slug
|
111 |
+
echo "</div>";
|
112 |
+
|
113 |
echo "<div class='saswp-support' ".( $tab != 'support' ? 'style="display:none;"' : '').">";
|
114 |
// Status
|
115 |
do_settings_sections( 'saswp_support_section' ); // Page slug
|
224 |
'saswp_compatibility_section' // Settings Section ID
|
225 |
);
|
226 |
|
227 |
+
add_settings_section('saswp_email_schema_section', __return_false(), '__return_false', 'saswp_email_schema_section');
|
228 |
+
|
229 |
+
add_settings_field(
|
230 |
+
'saswp_email_schema_settings', // ID
|
231 |
+
'', // Title
|
232 |
+
'saswp_email_schema_callback', // CB
|
233 |
+
'saswp_email_schema_section', // Page slug
|
234 |
+
'saswp_email_schema_section' // Settings Section ID
|
235 |
+
);
|
236 |
+
|
237 |
|
238 |
add_settings_section('saswp_support_section', __return_false(), '__return_false', 'saswp_support_section');
|
239 |
|
292 |
$meta_fields_default = array(
|
293 |
array(
|
294 |
'label' => 'Default Image',
|
295 |
+
'id' => 'sd_default_image',
|
296 |
+
'name' => 'sd_data[sd_default_image][url]',
|
297 |
'class' => 'saswp-sd_default_image',
|
298 |
+
'type' => 'media',
|
299 |
),
|
300 |
array(
|
301 |
'label' => 'Default Post Image Width',
|
302 |
+
'id' => 'sd_default_image_width',
|
303 |
+
'name' => 'sd_data[sd_default_image_width]',
|
304 |
'class' => 'regular-text',
|
305 |
+
'type' => 'text',
|
306 |
),
|
307 |
array(
|
308 |
'label' => 'Default Post Image Height',
|
309 |
+
'id' => 'sd_default_image_height',
|
310 |
+
'name' => 'sd_data[sd_default_image_height]',
|
311 |
'class' => 'regular-text',
|
312 |
+
'type' => 'text',
|
313 |
),
|
314 |
array(
|
315 |
'label' => 'Default Thumbnail for VideoObject',
|
316 |
+
'id' => 'sd_default_video_thumbnail',
|
317 |
+
'name' => 'sd_data[sd_default_video_thumbnail][url]',
|
318 |
'class' => 'saswp-sd_default_video_thumbnail',
|
319 |
+
'type' => 'media',
|
320 |
),
|
321 |
);
|
322 |
echo '<h2>'.esc_html__('Default Values','schema-and-structured-data-for-wp').'</h2>';
|
331 |
$field_objs = new saswp_fields_generator();
|
332 |
|
333 |
$non_amp_enable_field = array(
|
334 |
+
'label' => 'Structured Data for AMP',
|
335 |
+
'id' => 'saswp-for-amp-checkbox',
|
336 |
+
'name' => 'saswp-for-amp-checkbox',
|
337 |
+
'type' => 'checkbox',
|
338 |
+
'class' => 'checkbox saswp-checkbox',
|
339 |
'hidden' => array(
|
340 |
+
'id' => 'saswp-for-amp',
|
341 |
'name' => 'sd_data[saswp-for-amp]',
|
342 |
)
|
343 |
) ;
|
349 |
$non_amp_enable_field['attributes'] = array(
|
350 |
'disabled' => 'disabled'
|
351 |
);
|
352 |
+
$non_amp_enable_field['note'] = esc_html__('AMP Requires selected plugin','schema-and-structured-data-for-wp');
|
353 |
$settings['saswp-for-amp'] = 0;
|
354 |
|
355 |
}
|
357 |
$meta_fields = array(
|
358 |
$non_amp_enable_field,
|
359 |
array(
|
360 |
+
'label' => 'Structured Data for Non AMP',
|
361 |
+
'id' => 'saswp-for-wordpress-checkbox',
|
362 |
+
'name' => 'saswp-for-wordpress-checkbox',
|
363 |
+
'type' => 'checkbox',
|
364 |
+
'class' => 'checkbox saswp-checkbox',
|
365 |
+
'note' => '',
|
366 |
'hidden' => array(
|
367 |
+
'id' => 'saswp-for-wordpress',
|
368 |
'name' => 'sd_data[saswp-for-wordpress]',
|
369 |
)
|
370 |
)
|
379 |
|
380 |
$meta_fields_default = array(
|
381 |
array(
|
382 |
+
'label' => 'Archive',
|
383 |
+
'id' => 'saswp_archive_schema_checkbox',
|
384 |
+
'name' => 'saswp_archive_schema_checkbox',
|
385 |
+
'type' => 'checkbox',
|
386 |
+
'class' => 'checkbox saswp-checkbox',
|
387 |
'hidden' => array(
|
388 |
+
'id' => 'saswp_archive_schema',
|
389 |
'name' => 'sd_data[saswp_archive_schema]',
|
390 |
)
|
391 |
),
|
392 |
array(
|
393 |
+
'label' => 'Schema Type',
|
394 |
+
'id' => 'saswp_archive_schema_type',
|
395 |
+
'name' => 'sd_data[saswp_archive_schema_type]',
|
396 |
+
'class' => 'saswp_archive_schema_type_class',
|
397 |
+
'type' => 'select',
|
398 |
'options' => array(
|
399 |
'Article' => 'Article',
|
400 |
'Blogposting' => 'Blogposting',
|
403 |
)
|
404 |
),
|
405 |
array(
|
406 |
+
'label' => 'BreadCrumbs',
|
407 |
+
'id' => 'saswp_breadcrumb_schema_checkbox',
|
408 |
+
'name' => 'saswp_breadcrumb_schema_checkbox',
|
409 |
+
'type' => 'checkbox',
|
410 |
+
'class' => 'checkbox saswp-checkbox',
|
411 |
'hidden' => array(
|
412 |
+
'id' => 'saswp_breadcrumb_schema',
|
413 |
'name' => 'sd_data[saswp_breadcrumb_schema]',
|
414 |
)
|
415 |
),
|
416 |
array(
|
417 |
+
'label' => 'Comments',
|
418 |
+
'id' => 'saswp_comments_schema_checkbox',
|
419 |
+
'name' => 'saswp_comments_schema_checkbox',
|
420 |
+
'type' => 'checkbox',
|
421 |
+
'class' => 'checkbox saswp-checkbox',
|
422 |
'hidden' => array(
|
423 |
+
'id' => 'saswp_comments_schema',
|
424 |
'name' => 'sd_data[saswp_comments_schema]',
|
425 |
)
|
426 |
),
|
427 |
array(
|
428 |
+
'label' => 'Site Navigation Menu',
|
429 |
+
'id' => 'saswp_site_navigation_menu_checkbox',
|
430 |
+
'name' => 'saswp_site_navigation_menu_checkbox',
|
431 |
+
'type' => 'checkbox',
|
432 |
+
'class' => 'checkbox saswp-checkbox',
|
433 |
'hidden' => array(
|
434 |
+
'id' => 'saswp_site_navigation_menu',
|
435 |
'name' => 'sd_data[saswp_site_navigation_menu]',
|
436 |
)
|
437 |
)
|
452 |
<label for="sd_about_page-select">
|
453 |
<?php
|
454 |
echo wp_dropdown_pages( array(
|
455 |
+
'name' => 'sd_data[sd_about_page]',
|
456 |
+
'id' => 'sd_about_page',
|
457 |
+
'echo' => 0,
|
458 |
+
'show_option_none' => esc_html__( 'Select an item', 'schema-and-structured-data-for-wp' ),
|
459 |
'option_none_value' => '',
|
460 |
+
'selected' => isset($settings['sd_about_page']) ? $settings['sd_about_page'] : '',
|
461 |
)); ?>
|
462 |
</label>
|
463 |
</div>
|
536 |
)
|
537 |
),
|
538 |
array(
|
539 |
+
'label' => 'Organization Name',
|
540 |
'id' => 'sd_name',
|
541 |
'name' => 'sd_data[sd_name]',
|
542 |
'class' => 'regular-text saswp_org_fields',
|
544 |
),
|
545 |
|
546 |
array(
|
547 |
+
'label' => 'Organization URL',
|
548 |
'id' => 'sd_url',
|
549 |
'name' => 'sd_data[sd_url]',
|
550 |
'class' => 'regular-text saswp_org_fields',
|
551 |
'type' => 'text',
|
552 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
553 |
array(
|
554 |
'label' => 'Contact Type',
|
555 |
'id' => 'saswp_contact_type',
|
571 |
'package tracking' => 'Package Tracking',
|
572 |
)
|
573 |
),
|
574 |
+
array(
|
575 |
+
'label' => 'Contact Number',
|
576 |
+
'id' => 'saswp_kb_telephone',
|
577 |
+
'name' => 'sd_data[saswp_kb_telephone]',
|
578 |
+
'class' => 'regular-text saswp_org_fields',
|
579 |
+
'type' => 'text',
|
580 |
+
),
|
581 |
+
array(
|
582 |
+
'label' => 'Contact URL',
|
583 |
+
'id' => 'saswp_kb_contact_url',
|
584 |
+
'name' => 'sd_data[saswp_kb_contact_url]',
|
585 |
+
'class' => 'regular-text saswp_org_fields',
|
586 |
+
'type' => 'text',
|
587 |
+
),
|
588 |
+
|
589 |
array(
|
590 |
'label' => 'Name',
|
591 |
'id' => 'sd-person-name',
|
686 |
'attributes' => array(
|
687 |
'placeholder' => 'https://'
|
688 |
)
|
689 |
+
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
690 |
array(
|
691 |
'label' => 'Instagram',
|
692 |
'id' => 'saswp-instagram-enable-checkbox',
|
922 |
|
923 |
}
|
924 |
|
|
|
|
|
925 |
function saswp_review_page_callback(){
|
926 |
|
927 |
$settings = saswp_defaultSettings();
|
943 |
$field_objs->saswp_field_generator($meta_fields, $settings);
|
944 |
|
945 |
}
|
946 |
+
|
947 |
+
function saswp_email_schema_callback(){
|
948 |
+
|
949 |
+
$settings = saswp_defaultSettings();
|
950 |
+
|
951 |
+
$woocommerce = array(
|
952 |
+
'label' => 'Woocommerce Booking',
|
953 |
+
'id' => 'saswp-woocommerce-booking-main-checkbox',
|
954 |
+
'name' => 'saswp-woocommerce-booking-main-checkbox',
|
955 |
+
'type' => 'checkbox',
|
956 |
+
'class' => 'checkbox saswp-checkbox',
|
957 |
+
'hidden' => array(
|
958 |
+
'id' => 'saswp-woocommerce-booking-main',
|
959 |
+
'name' => 'sd_data[saswp-woocommerce-booking-main]',
|
960 |
+
)
|
961 |
+
);
|
962 |
+
|
963 |
+
if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-bookings/woocommerce-bookings.php')){
|
964 |
+
|
965 |
+
$woocommerce['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
|
966 |
+
|
967 |
+
}
|
968 |
+
|
969 |
+
if(!is_plugin_active('schema-and-structured-data-for-wp-pro/schema-and-structured-data-for-wp-pro.php')){
|
970 |
+
|
971 |
+
$woocommerce['attributes'] = array(
|
972 |
+
'disabled' => 'disabled'
|
973 |
+
);
|
974 |
+
|
975 |
+
$settings['saswp-woocommerce-booking-main'] = 0;
|
976 |
+
$settings['saswp-woocommerce-booking'] = 0;
|
977 |
+
$woocommerce['proversion'] = true;
|
978 |
+
|
979 |
+
}
|
980 |
+
|
981 |
+
$field_objs = new saswp_fields_generator();
|
982 |
+
$meta_fields = array(
|
983 |
+
$woocommerce,
|
984 |
+
);
|
985 |
+
|
986 |
+
$field_objs->saswp_field_generator($meta_fields, $settings);
|
987 |
+
|
988 |
+
}
|
989 |
+
|
990 |
function saswp_compatibility_page_callback(){
|
991 |
|
992 |
$settings = saswp_defaultSettings();
|
1038 |
'name' => 'sd_data[saswp-woocommerce]',
|
1039 |
)
|
1040 |
);
|
1041 |
+
$woocommerce_bok = array(
|
1042 |
+
'label' => 'Woocommerce Booking',
|
1043 |
+
'id' => 'saswp-woocommerce-booking-checkbox',
|
1044 |
+
'name' => 'saswp-woocommerce-booking-checkbox',
|
1045 |
+
'type' => 'checkbox',
|
1046 |
+
'class' => 'checkbox saswp-checkbox',
|
1047 |
+
'hidden' => array(
|
1048 |
+
'id' => 'saswp-woocommerce-booking',
|
1049 |
+
'name' => 'sd_data[saswp-woocommerce-booking]',
|
1050 |
+
)
|
1051 |
+
);
|
1052 |
+
$woocommerce_mem = array(
|
1053 |
+
'label' => 'Woocommerce Membership',
|
1054 |
+
'id' => 'saswp-woocommerce-membership-checkbox',
|
1055 |
+
'name' => 'saswp-woocommerce-membership-checkbox',
|
1056 |
+
'type' => 'checkbox',
|
1057 |
+
'class' => 'checkbox saswp-checkbox',
|
1058 |
+
'hidden' => array(
|
1059 |
+
'id' => 'saswp-woocommerce-membership',
|
1060 |
+
'name' => 'sd_data[saswp-woocommerce-membership]',
|
1061 |
+
)
|
1062 |
+
);
|
1063 |
+
|
1064 |
$extratheme = array(
|
1065 |
'label' => 'Extra Theme By Elegant',
|
1066 |
'id' => 'saswp-extra-checkbox',
|
1083 |
'name' => 'sd_data[saswp-dw-question-answer]',
|
1084 |
)
|
1085 |
);
|
1086 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1087 |
$yoast = array(
|
1088 |
'label' => 'Yoast SEO Plugin',
|
1089 |
'id' => 'saswp-yoast-checkbox',
|
1098 |
|
1099 |
if(!is_plugin_active('taqyeem/taqyeem.php') || get_template() != 'jannah' ){
|
1100 |
|
1101 |
+
$tagyeem['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
|
1102 |
+
|
|
|
|
|
|
|
|
|
1103 |
}
|
1104 |
|
1105 |
|
1106 |
if(!is_plugin_active('wordpress-seo/wp-seo.php') && !is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')){
|
1107 |
|
1108 |
+
$yoast['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
|
1109 |
+
|
|
|
|
|
|
|
1110 |
|
1111 |
}
|
1112 |
|
1113 |
if(!is_plugin_active('kk-star-ratings/index.php')){
|
1114 |
|
1115 |
+
$kk_star['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
|
|
|
|
|
|
|
|
|
1116 |
|
1117 |
}
|
1118 |
+
|
|
|
1119 |
if(!is_plugin_active('woocommerce/woocommerce.php')){
|
1120 |
|
1121 |
+
$woocommerce['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
|
1122 |
+
|
1123 |
+
}
|
1124 |
+
if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-bookings/woocommerce-bookings.php')){
|
1125 |
+
|
1126 |
+
|
1127 |
+
$woocommerce_bok['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
|
1128 |
+
|
1129 |
+
|
1130 |
+
}
|
1131 |
+
|
1132 |
+
|
1133 |
+
|
1134 |
+
|
1135 |
+
if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-memberships/woocommerce-memberships.php')){
|
1136 |
+
|
1137 |
+
|
1138 |
+
$woocommerce_mem['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
|
1139 |
+
|
1140 |
+
|
1141 |
+
}
|
1142 |
+
|
1143 |
+
if(!is_plugin_active('schema-and-structured-data-for-wp-pro/schema-and-structured-data-for-wp-pro.php')){
|
1144 |
+
|
1145 |
+
$woocommerce_bok['attributes'] = array(
|
1146 |
'disabled' => 'disabled'
|
1147 |
);
|
1148 |
+
|
1149 |
+
$woocommerce_bok['proversion'] = true;
|
1150 |
+
|
1151 |
+
$settings['saswp-woocommerce-booking'] = 0;
|
1152 |
+
|
1153 |
+
$woocommerce_mem['attributes'] = array(
|
1154 |
+
'disabled' => 'disabled'
|
1155 |
+
);
|
1156 |
+
|
1157 |
+
$settings['saswp-woocommerce-membership'] = 0;
|
1158 |
+
$woocommerce_mem['proversion'] = true;
|
1159 |
|
1160 |
}
|
1161 |
|
1162 |
if(get_template() != 'Extra'){
|
1163 |
+
|
|
|
|
|
|
|
1164 |
$extratheme['note'] = esc_html__('Theme is not activated','schema-and-structured-data-for-wp');
|
1165 |
+
|
1166 |
|
1167 |
}
|
1168 |
|
1169 |
|
1170 |
if(!is_plugin_active('dw-question-answer/dw-question-answer.php')){
|
1171 |
|
1172 |
+
$dwquestiton['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1173 |
|
|
|
|
|
|
|
|
|
|
|
1174 |
}
|
1175 |
|
1176 |
+
// if(!is_plugin_active('wp-job-manager/wp-job-manager.php')){
|
1177 |
+
//
|
1178 |
+
// $wpjobmanager['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
|
1179 |
+
//
|
1180 |
+
// }
|
1181 |
+
|
1182 |
if(!is_plugin_active('the-events-calendar/the-events-calendar.php')){
|
1183 |
|
1184 |
+
|
1185 |
+
$the_events_calendar['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
|
1186 |
+
|
|
|
|
|
1187 |
}
|
1188 |
|
1189 |
$field_objs = new saswp_fields_generator();
|
1190 |
+
|
1191 |
$meta_fields = array(
|
1192 |
$kk_star,
|
1193 |
$woocommerce,
|
1194 |
+
// $woocommerce_bok,
|
1195 |
+
// $woocommerce_mem,
|
1196 |
$the_events_calendar,
|
1197 |
$tagyeem,
|
1198 |
$extratheme,
|
1199 |
$dwquestiton,
|
1200 |
+
//$wpjobmanager,
|
1201 |
$yoast,
|
1202 |
|
1203 |
);
|
1209 |
$meta_fields_default = array(
|
1210 |
array(
|
1211 |
'label' => 'FlexMLS IDX Plugin',
|
1212 |
+
'id' => 'saswp-flexmlx-compativility-checkbox',
|
1213 |
+
'name' => 'saswp-flexmlx-compativility-checkbox',
|
1214 |
'type' => 'checkbox',
|
1215 |
'class' => 'checkbox saswp-checkbox',
|
1216 |
'hidden' => array(
|
1217 |
+
'id' => 'saswp-flexmlx-compativility',
|
1218 |
+
'name' => 'sd_data[saswp-flexmlx-compativility]',
|
1219 |
)
|
1220 |
),
|
1221 |
);
|
1222 |
}else{
|
1223 |
+
|
1224 |
$meta_fields_default = array(
|
1225 |
array(
|
1226 |
'label' => 'FlexMLS IDX',
|
1227 |
+
'id' => 'saswp-flexmlx-compativility-checkbox',
|
1228 |
+
'name' => 'saswp-flexmlx-compativility-checkbox',
|
1229 |
'type' => 'checkbox',
|
1230 |
+
'class' => 'checkbox saswp-checkbox',
|
1231 |
+
'note' => 'Requires selected plugin',
|
|
|
|
|
1232 |
'hidden' => array(
|
1233 |
+
'id' => 'saswp-flexmlx-compativility',
|
1234 |
+
'name' => 'sd_data[saswp-flexmlx-compativility]',
|
1235 |
)
|
1236 |
),
|
1237 |
);
|
admin_section/structure_admin.php
CHANGED
@@ -68,7 +68,7 @@ function saswp_reset_all_settings(){
|
|
68 |
if ( !wp_verify_nonce( $_POST['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
|
69 |
return;
|
70 |
}
|
71 |
-
$result ='';
|
72 |
|
73 |
update_option( 'sd_data', array());
|
74 |
|
@@ -76,7 +76,7 @@ function saswp_reset_all_settings(){
|
|
76 |
|
77 |
foreach ($allposts as $eachpost) {
|
78 |
|
79 |
-
|
80 |
|
81 |
}
|
82 |
|
@@ -119,7 +119,7 @@ function saswp_get_all_schema_posts(){
|
|
119 |
|
120 |
foreach ($schema_id_array as $post_id){
|
121 |
|
122 |
-
$unique_checker ='';
|
123 |
|
124 |
$resultset = saswp_generate_field_data( $post_id );
|
125 |
|
@@ -275,6 +275,7 @@ function saswp_comparison_logic_checker($input){
|
|
275 |
}
|
276 |
}
|
277 |
if ( $comparison == 'not_equal') {
|
|
|
278 |
require_once ABSPATH . 'wp-admin/includes/user.php';
|
279 |
// Get all the registered user roles
|
280 |
$roles = get_editable_roles();
|
@@ -375,12 +376,19 @@ function saswp_comparison_logic_checker($input){
|
|
375 |
// Page Controls ----------------
|
376 |
// Page
|
377 |
case 'page':
|
|
|
378 |
global $redux_builder_amp;
|
|
|
379 |
if(function_exists('ampforwp_is_front_page')){
|
|
|
380 |
if(ampforwp_is_front_page()){
|
381 |
-
|
|
|
|
|
382 |
} else{
|
383 |
-
|
|
|
|
|
384 |
}
|
385 |
}else{
|
386 |
$current_post = $post->ID;
|
@@ -769,13 +777,13 @@ add_action( 'wp_print_scripts', 'saswp_dequeue_script', 100 );
|
|
769 |
|
770 |
function saswp_select_save_data ( $post_id ) {
|
771 |
|
772 |
-
|
773 |
|
774 |
// if our nonce isn't there, or we can't verify it, bail
|
775 |
-
|
776 |
|
777 |
// if our current user can't edit this post, bail
|
778 |
-
|
779 |
|
780 |
$meta_value = get_post_meta( $post_id, null, true );
|
781 |
|
@@ -802,8 +810,8 @@ add_action( 'wp_print_scripts', 'saswp_dequeue_script', 100 );
|
|
802 |
}
|
803 |
if($show_globally){
|
804 |
|
805 |
-
|
806 |
-
|
807 |
|
808 |
}
|
809 |
}
|
@@ -1161,25 +1169,32 @@ function saswp_send_query_message(){
|
|
1161 |
|
1162 |
$message = sanitize_textarea_field($_POST['message']);
|
1163 |
$user = wp_get_current_user();
|
1164 |
-
$user_data = $user->data;
|
1165 |
-
$user_email = $user_data->user_email;
|
1166 |
-
//php mailer variables
|
1167 |
-
$sendto = 'team@magazine3.com';
|
1168 |
-
$subject = "Customer Query";
|
1169 |
-
$headers = 'From: '. esc_attr($user_email) . "\r\n" .
|
1170 |
-
'Reply-To: ' . esc_attr($user_email) . "\r\n";
|
1171 |
-
// Load WP components, no themes.
|
1172 |
-
$sent = wp_mail($sendto, $subject, strip_tags($message), $headers);
|
1173 |
|
1174 |
-
if($
|
1175 |
-
|
1176 |
-
echo json_encode(array('status'=>'t'));
|
1177 |
-
|
1178 |
-
}else{
|
1179 |
|
1180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1181 |
|
1182 |
-
}
|
|
|
|
|
1183 |
wp_die();
|
1184 |
}
|
1185 |
|
@@ -1206,22 +1221,22 @@ function saswp_import_plugin_data(){
|
|
1206 |
|
1207 |
case 'schema':
|
1208 |
if ( is_plugin_active('schema/schema.php')) {
|
1209 |
-
|
1210 |
}
|
1211 |
break;
|
1212 |
|
1213 |
case 'schema_pro':
|
1214 |
if ( is_plugin_active('wp-schema-pro/wp-schema-pro.php')) {
|
1215 |
-
|
1216 |
}
|
1217 |
break;
|
1218 |
case 'wp_seo_schema':
|
1219 |
if ( is_plugin_active('wp-seo-structured-data-schema/wp-seo-structured-data-schema.php')) {
|
1220 |
-
|
1221 |
}
|
1222 |
case 'seo_pressor':
|
1223 |
if ( is_plugin_active('seo-pressor/seo-pressor.php')) {
|
1224 |
-
|
1225 |
}
|
1226 |
break;
|
1227 |
|
68 |
if ( !wp_verify_nonce( $_POST['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
|
69 |
return;
|
70 |
}
|
71 |
+
$result = '';
|
72 |
|
73 |
update_option( 'sd_data', array());
|
74 |
|
76 |
|
77 |
foreach ($allposts as $eachpost) {
|
78 |
|
79 |
+
$result = wp_delete_post( $eachpost->ID, true );
|
80 |
|
81 |
}
|
82 |
|
119 |
|
120 |
foreach ($schema_id_array as $post_id){
|
121 |
|
122 |
+
$unique_checker = '';
|
123 |
|
124 |
$resultset = saswp_generate_field_data( $post_id );
|
125 |
|
275 |
}
|
276 |
}
|
277 |
if ( $comparison == 'not_equal') {
|
278 |
+
|
279 |
require_once ABSPATH . 'wp-admin/includes/user.php';
|
280 |
// Get all the registered user roles
|
281 |
$roles = get_editable_roles();
|
376 |
// Page Controls ----------------
|
377 |
// Page
|
378 |
case 'page':
|
379 |
+
|
380 |
global $redux_builder_amp;
|
381 |
+
|
382 |
if(function_exists('ampforwp_is_front_page')){
|
383 |
+
|
384 |
if(ampforwp_is_front_page()){
|
385 |
+
|
386 |
+
$current_post = $redux_builder_amp['amp-frontpage-select-option-pages'];
|
387 |
+
|
388 |
} else{
|
389 |
+
|
390 |
+
$current_post = $post->ID;
|
391 |
+
|
392 |
}
|
393 |
}else{
|
394 |
$current_post = $post->ID;
|
777 |
|
778 |
function saswp_select_save_data ( $post_id ) {
|
779 |
|
780 |
+
if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
|
781 |
|
782 |
// if our nonce isn't there, or we can't verify it, bail
|
783 |
+
if( !isset( $_POST['saswp_select_name_nonce'] ) || !wp_verify_nonce( $_POST['saswp_select_name_nonce'], 'saswp_select_action_nonce' ) ) return;
|
784 |
|
785 |
// if our current user can't edit this post, bail
|
786 |
+
if( !current_user_can( 'edit_post' ) ) return;
|
787 |
|
788 |
$meta_value = get_post_meta( $post_id, null, true );
|
789 |
|
810 |
}
|
811 |
if($show_globally){
|
812 |
|
813 |
+
unset($post_data_group_array);
|
814 |
+
$post_data_group_array['group-0']['data_array'] = $temp_condition_array;
|
815 |
|
816 |
}
|
817 |
}
|
1169 |
|
1170 |
$message = sanitize_textarea_field($_POST['message']);
|
1171 |
$user = wp_get_current_user();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1172 |
|
1173 |
+
if($user){
|
|
|
|
|
|
|
|
|
1174 |
|
1175 |
+
$user_data = $user->data;
|
1176 |
+
$user_email = $user_data->user_email;
|
1177 |
+
//php mailer variables
|
1178 |
+
$sendto = 'team@magazine3.com';
|
1179 |
+
$subject = "Customer Query";
|
1180 |
+
$headers = 'From: '. esc_attr($user_email) . "\r\n" .
|
1181 |
+
'Reply-To: ' . esc_attr($user_email) . "\r\n";
|
1182 |
+
// Load WP components, no themes.
|
1183 |
+
$sent = wp_mail($sendto, $subject, strip_tags($message), $headers);
|
1184 |
+
|
1185 |
+
if($sent){
|
1186 |
+
|
1187 |
+
echo json_encode(array('status'=>'t'));
|
1188 |
+
|
1189 |
+
}else{
|
1190 |
+
|
1191 |
+
echo json_encode(array('status'=>'f'));
|
1192 |
+
|
1193 |
+
}
|
1194 |
|
1195 |
+
}
|
1196 |
+
|
1197 |
+
|
1198 |
wp_die();
|
1199 |
}
|
1200 |
|
1221 |
|
1222 |
case 'schema':
|
1223 |
if ( is_plugin_active('schema/schema.php')) {
|
1224 |
+
$result = saswp_import_schema_plugin_data();
|
1225 |
}
|
1226 |
break;
|
1227 |
|
1228 |
case 'schema_pro':
|
1229 |
if ( is_plugin_active('wp-schema-pro/wp-schema-pro.php')) {
|
1230 |
+
$result = saswp_import_schema_pro_plugin_data();
|
1231 |
}
|
1232 |
break;
|
1233 |
case 'wp_seo_schema':
|
1234 |
if ( is_plugin_active('wp-seo-structured-data-schema/wp-seo-structured-data-schema.php')) {
|
1235 |
+
$result = saswp_import_wp_seo_schema_plugin_data();
|
1236 |
}
|
1237 |
case 'seo_pressor':
|
1238 |
if ( is_plugin_active('seo-pressor/seo-pressor.php')) {
|
1239 |
+
$result = saswp_import_seo_pressor_plugin_data();
|
1240 |
}
|
1241 |
break;
|
1242 |
|
output/flexmls.php
CHANGED
@@ -226,7 +226,7 @@ class saswp_flexmls_list extends flexmlsConnectPageCore{
|
|
226 |
$sellertelephone = '';
|
227 |
$sellerpricerange = '';
|
228 |
|
229 |
-
if(isset($sd_data['
|
230 |
|
231 |
if(isset($sd_data['sd-seller-name'])){
|
232 |
$sellername =$sd_data['sd-seller-name'];
|
226 |
$sellertelephone = '';
|
227 |
$sellerpricerange = '';
|
228 |
|
229 |
+
if(isset($sd_data['saswp-flexmlx-compativility']) && $sd_data['saswp-flexmlx-compativility'] == 1 && is_plugin_active('flexmls-idx/flexmls_connect.php')){
|
230 |
|
231 |
if(isset($sd_data['sd-seller-name'])){
|
232 |
$sellername =$sd_data['sd-seller-name'];
|
output/function.php
CHANGED
@@ -18,8 +18,7 @@ add_action('wp_head', 'saswp_data_generator');
|
|
18 |
* @global type json array
|
19 |
*/
|
20 |
function saswp_data_generator() {
|
21 |
-
|
22 |
-
|
23 |
global $sd_data;
|
24 |
global $post;
|
25 |
|
@@ -38,11 +37,10 @@ function saswp_data_generator() {
|
|
38 |
|
39 |
$schema_breadcrumb_output = saswp_schema_breadcrumb_output();
|
40 |
|
41 |
-
if(saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string')
|
42 |
-
|
43 |
$kb_website_output = saswp_kb_website_output();
|
44 |
-
$kb_schema_output = saswp_kb_schema_output();
|
45 |
-
|
46 |
}
|
47 |
|
48 |
if(is_singular()){
|
@@ -132,17 +130,24 @@ function saswp_data_generator() {
|
|
132 |
|
133 |
}
|
134 |
|
135 |
-
$stroutput = '['. trim($output). ']';
|
136 |
-
$filter_string = str_replace(',]', ']',$stroutput);
|
137 |
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
}
|
147 |
|
148 |
add_filter('the_content', 'saswp_paywall_data_for_login');
|
@@ -197,7 +202,7 @@ function saswp_paywall_data_for_login($content){
|
|
197 |
|
198 |
$redirect = home_url( $wp->request );
|
199 |
$breakedContent = explode("<!--more-->", $content);
|
200 |
-
$content = $breakedContent[0].'<div class="'.esc_attr($className).'">'
|
201 |
|
202 |
}
|
203 |
|
@@ -284,7 +289,7 @@ function saswp_extract_kk_star_ratings($id){
|
|
284 |
|
285 |
global $sd_data;
|
286 |
|
287 |
-
if(isset($sd_data['saswp-kk-star-raring']) && $sd_data['saswp-kk-star-raring'] == 1){
|
288 |
|
289 |
$best = get_option('kksr_stars');
|
290 |
$score = get_post_meta($id, '_kksr_ratings', true) ? ((int) get_post_meta($id, '_kksr_ratings', true)) : 0;
|
18 |
* @global type json array
|
19 |
*/
|
20 |
function saswp_data_generator() {
|
21 |
+
|
|
|
22 |
global $sd_data;
|
23 |
global $post;
|
24 |
|
37 |
|
38 |
$schema_breadcrumb_output = saswp_schema_breadcrumb_output();
|
39 |
|
40 |
+
if(saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') == 1 && (is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php'))){
|
41 |
+
}else{
|
42 |
$kb_website_output = saswp_kb_website_output();
|
43 |
+
$kb_schema_output = saswp_kb_schema_output();
|
|
|
44 |
}
|
45 |
|
46 |
if(is_singular()){
|
130 |
|
131 |
}
|
132 |
|
|
|
|
|
133 |
|
134 |
+
|
135 |
+
if($output){
|
136 |
+
|
137 |
+
$stroutput = '['. trim($output). ']';
|
138 |
+
$filter_string = str_replace(',]', ']',$stroutput);
|
139 |
+
|
140 |
+
echo '<!-- Schema & Structured Data For WP v'.esc_attr(SASWP_VERSION).' - -->';
|
141 |
+
echo "\n";
|
142 |
+
echo '<script type="application/ld+json">';
|
143 |
+
echo "\n";
|
144 |
+
echo $filter_string;
|
145 |
+
echo "\n";
|
146 |
+
echo '</script>';
|
147 |
+
echo "\n\n";
|
148 |
+
}
|
149 |
+
|
150 |
+
|
151 |
}
|
152 |
|
153 |
add_filter('the_content', 'saswp_paywall_data_for_login');
|
202 |
|
203 |
$redirect = home_url( $wp->request );
|
204 |
$breakedContent = explode("<!--more-->", $content);
|
205 |
+
$content = $breakedContent[0].'<div class="'.esc_attr($className).'">'.$breakedContent[1].'</div>';
|
206 |
|
207 |
}
|
208 |
|
289 |
|
290 |
global $sd_data;
|
291 |
|
292 |
+
if(isset($sd_data['saswp-kk-star-raring']) && $sd_data['saswp-kk-star-raring'] == 1 && is_plugin_active('kk-star-ratings/index.php')){
|
293 |
|
294 |
$best = get_option('kksr_stars');
|
295 |
$score = get_post_meta($id, '_kksr_ratings', true) ? ((int) get_post_meta($id, '_kksr_ratings', true)) : 0;
|
output/output.php
CHANGED
@@ -14,53 +14,48 @@ function saswp_kb_schema_output() {
|
|
14 |
|
15 |
$sd_facebook = array();
|
16 |
|
17 |
-
if(isset($sd_data['sd_facebook']) && !empty($sd_data['sd_facebook'])){
|
18 |
$sd_facebook[] = $sd_data['sd_facebook'];
|
19 |
$sd_social_profile[] = $sd_facebook;
|
20 |
}
|
21 |
$sd_twitter = array();
|
22 |
-
if(isset($sd_data['sd_twitter']) && !empty($sd_data['sd_twitter'])){
|
23 |
$sd_twitter[] = $sd_data['sd_twitter'];
|
24 |
$sd_social_profile[] = $sd_twitter;
|
25 |
}
|
26 |
-
|
27 |
-
$sd_google_plus = array();
|
28 |
-
if(isset($sd_data['sd_google_plus']) && !empty($sd_data['sd_google_plus'])){
|
29 |
-
$sd_google_plus[] = $sd_data['sd_google_plus'];
|
30 |
-
$sd_social_profile[] = $sd_google_plus;
|
31 |
-
}
|
32 |
$sd_instagram = array();
|
33 |
-
if(isset($sd_data['sd_instagram']) && !empty($sd_data['sd_instagram'])){
|
34 |
$sd_instagram[] = $sd_data['sd_instagram'];
|
35 |
$sd_social_profile[] = $sd_instagram;
|
36 |
}
|
37 |
|
38 |
$sd_youtube = array();
|
39 |
-
if(isset($sd_data['sd_youtube']) && !empty($sd_data['sd_youtube'])){
|
40 |
$sd_youtube[] = $sd_data['sd_youtube'];
|
41 |
$sd_social_profile[] = $sd_youtube;
|
42 |
}
|
43 |
|
44 |
$sd_linkedin = array();
|
45 |
-
if(isset($sd_data['sd_linkedin']) && !empty($sd_data['sd_linkedin'])){
|
46 |
$sd_linkedin[] = $sd_data['sd_linkedin'];
|
47 |
$sd_social_profile[] = $sd_linkedin;
|
48 |
}
|
49 |
|
50 |
$sd_pinterest = array();
|
51 |
-
if(isset($sd_data['sd_pinterest']) && !empty($sd_data['sd_pinterest'])){
|
52 |
$sd_pinterest[] = $sd_data['sd_pinterest'];
|
53 |
$sd_social_profile[] = $sd_pinterest;
|
54 |
}
|
55 |
|
56 |
$sd_soundcloud = array();
|
57 |
-
if(isset($sd_data['sd_soundcloud']) && !empty($sd_data['sd_soundcloud'])){
|
58 |
$sd_soundcloud[] = $sd_data['sd_soundcloud'];
|
59 |
$sd_social_profile[] = $sd_soundcloud;
|
60 |
}
|
61 |
|
62 |
$sd_tumblr = array();
|
63 |
-
if(isset($sd_data['sd_tumblr']) && !empty($sd_data['sd_tumblr'])){
|
64 |
$sd_tumblr[] = $sd_data['sd_tumblr'];
|
65 |
$sd_social_profile[] = $sd_tumblr;
|
66 |
}
|
@@ -91,26 +86,29 @@ function saswp_kb_schema_output() {
|
|
91 |
|
92 |
}
|
93 |
|
|
|
|
|
|
|
94 |
$contact_1 = saswp_remove_warnings($sd_data, 'saswp_contact_type', 'saswp_string');
|
95 |
$telephone_1 = saswp_remove_warnings($sd_data, 'saswp_kb_telephone', 'saswp_string');
|
|
|
96 |
|
97 |
-
|
98 |
-
|
99 |
-
}
|
100 |
-
|
101 |
-
if( '' == $telephone_1 && empty($telephone_1) && isset($sd_data['saswp_kb_telephone'])){
|
102 |
-
$telephone_1 = $sd_data['saswp_kb_telephone'];
|
103 |
-
}
|
104 |
|
105 |
-
|
106 |
|
107 |
'contactPoint' => array(
|
108 |
'@type' => 'ContactPoint',
|
109 |
'contactType' => esc_attr($contact_1),
|
110 |
'telephone' => esc_attr($telephone_1),
|
|
|
111 |
)
|
112 |
|
113 |
-
|
|
|
|
|
|
|
114 |
|
115 |
$input = array(
|
116 |
'@context' =>'http://schema.org',
|
@@ -197,8 +195,13 @@ function saswp_schema_output() {
|
|
197 |
$all_schema_output = array();
|
198 |
|
199 |
foreach($Conditionals as $schemaConditionals){
|
200 |
-
|
201 |
-
|
|
|
|
|
|
|
|
|
|
|
202 |
$schema_type = saswp_remove_warnings($schemaConditionals, 'schema_type', 'saswp_string');
|
203 |
$schema_post_id = saswp_remove_warnings($schemaConditionals, 'post_id', 'saswp_string');
|
204 |
|
@@ -706,7 +709,7 @@ function saswp_schema_output() {
|
|
706 |
$service = new saswp_output_service();
|
707 |
$product_details = $service->saswp_woocommerce_product_details(get_the_ID());
|
708 |
|
709 |
-
if((isset($sd_data['saswp-woocommerce']) && $sd_data['saswp-woocommerce'] ==1) && !empty($product_details)){
|
710 |
|
711 |
$input1 = array(
|
712 |
'@context' => 'http://schema.org',
|
@@ -715,14 +718,14 @@ function saswp_schema_output() {
|
|
715 |
'name' => saswp_remove_warnings($product_details, 'product_name', 'saswp_string'),
|
716 |
'sku' => saswp_remove_warnings($product_details, 'product_sku', 'saswp_string'),
|
717 |
'description' => saswp_remove_warnings($product_details, 'product_description', 'saswp_string'),
|
718 |
-
'image' =>
|
719 |
'offers' => array(
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
),
|
727 |
|
728 |
);
|
@@ -1007,7 +1010,7 @@ function saswp_schema_output() {
|
|
1007 |
if( 'Review' === $schema_type ){
|
1008 |
|
1009 |
|
1010 |
-
if(isset($sd_data['saswp-tagyeem']) && $sd_data['saswp-tagyeem'] == 1 ){
|
1011 |
|
1012 |
remove_action( 'TieLabs/after_post_entry', 'tie_article_schemas' );
|
1013 |
|
@@ -1275,7 +1278,11 @@ function saswp_schema_output() {
|
|
1275 |
if( 'VideoObject' === $schema_type){
|
1276 |
|
1277 |
if(empty($image_details[0]) || $image_details[0] === NULL ){
|
1278 |
-
|
|
|
|
|
|
|
|
|
1279 |
}
|
1280 |
|
1281 |
$input1 = array(
|
@@ -1288,7 +1295,7 @@ function saswp_schema_output() {
|
|
1288 |
'description' => strip_tags(get_the_excerpt()),
|
1289 |
'name' => get_the_title(),
|
1290 |
'uploadDate' => esc_html($date),
|
1291 |
-
'thumbnailUrl' => esc_url($image_details[0]),
|
1292 |
'mainEntity' => array(
|
1293 |
'@type' => 'WebPage',
|
1294 |
'@id' => get_permalink(),
|
@@ -1434,8 +1441,8 @@ function saswp_schema_output() {
|
|
1434 |
|
1435 |
}
|
1436 |
}
|
1437 |
-
|
1438 |
-
if(isset($schema_options['notAccessibleForFree']) == 1){
|
1439 |
|
1440 |
add_filter( 'amp_post_template_data', 'saswp_structure_data_access_scripts');
|
1441 |
|
@@ -1449,17 +1456,20 @@ function saswp_schema_output() {
|
|
1449 |
$paywall_class_name = ".".$paywall_class_name;
|
1450 |
|
1451 |
}
|
|
|
1452 |
$paywallData = array("isAccessibleForFree"=> $isAccessibleForFree,
|
1453 |
"hasPart"=>array(
|
1454 |
"@type" => "WebPageElement",
|
1455 |
"isAccessibleForFree" => esc_attr($isAccessibleForFree),
|
1456 |
-
"cssSelector" => esc_attr($paywall_class_name)
|
1457 |
)
|
1458 |
);
|
1459 |
|
1460 |
$input1 = array_merge($input1,$paywallData);
|
1461 |
}
|
1462 |
-
}
|
|
|
|
|
1463 |
|
1464 |
if(!empty($input1)){
|
1465 |
$all_schema_output[] = $input1;
|
@@ -2325,7 +2335,7 @@ function saswp_post_specific_schema_output() {
|
|
2325 |
|
2326 |
if( 'Review' === $schema_type ){
|
2327 |
|
2328 |
-
if(isset($sd_data['saswp-tagyeem']) && $sd_data['saswp-tagyeem'] == 1 ){
|
2329 |
|
2330 |
remove_action( 'TieLabs/after_post_entry', 'tie_article_schemas' );
|
2331 |
|
@@ -2644,6 +2654,8 @@ function saswp_post_specific_schema_output() {
|
|
2644 |
}
|
2645 |
}
|
2646 |
|
|
|
|
|
2647 |
if(!empty($input1)){
|
2648 |
|
2649 |
$all_schema_output[] = $input1;
|
14 |
|
15 |
$sd_facebook = array();
|
16 |
|
17 |
+
if(isset($sd_data['sd_facebook']) && !empty($sd_data['sd_facebook']) && isset($sd_data['saswp-facebook-enable']) && $sd_data['saswp-facebook-enable'] ==1){
|
18 |
$sd_facebook[] = $sd_data['sd_facebook'];
|
19 |
$sd_social_profile[] = $sd_facebook;
|
20 |
}
|
21 |
$sd_twitter = array();
|
22 |
+
if(isset($sd_data['sd_twitter']) && !empty($sd_data['sd_twitter']) && isset($sd_data['saswp-twitter-enable']) && $sd_data['saswp-twitter-enable'] ==1 ){
|
23 |
$sd_twitter[] = $sd_data['sd_twitter'];
|
24 |
$sd_social_profile[] = $sd_twitter;
|
25 |
}
|
26 |
+
|
|
|
|
|
|
|
|
|
|
|
27 |
$sd_instagram = array();
|
28 |
+
if(isset($sd_data['sd_instagram']) && !empty($sd_data['sd_instagram']) && isset($sd_data['saswp-instagram-enable']) && $sd_data['saswp-instagram-enable'] ==1 ){
|
29 |
$sd_instagram[] = $sd_data['sd_instagram'];
|
30 |
$sd_social_profile[] = $sd_instagram;
|
31 |
}
|
32 |
|
33 |
$sd_youtube = array();
|
34 |
+
if(isset($sd_data['sd_youtube']) && !empty($sd_data['sd_youtube']) && isset($sd_data['saswp-youtube-enable']) && $sd_data['saswp-youtube-enable'] ==1){
|
35 |
$sd_youtube[] = $sd_data['sd_youtube'];
|
36 |
$sd_social_profile[] = $sd_youtube;
|
37 |
}
|
38 |
|
39 |
$sd_linkedin = array();
|
40 |
+
if(isset($sd_data['sd_linkedin']) && !empty($sd_data['sd_linkedin']) && isset($sd_data['saswp-linkedin-enable']) && $sd_data['saswp-linkedin-enable'] ==1 ){
|
41 |
$sd_linkedin[] = $sd_data['sd_linkedin'];
|
42 |
$sd_social_profile[] = $sd_linkedin;
|
43 |
}
|
44 |
|
45 |
$sd_pinterest = array();
|
46 |
+
if(isset($sd_data['sd_pinterest']) && !empty($sd_data['sd_pinterest']) && isset($sd_data['saswp-pinterest-enable']) && $sd_data['saswp-pinterest-enable'] ==1){
|
47 |
$sd_pinterest[] = $sd_data['sd_pinterest'];
|
48 |
$sd_social_profile[] = $sd_pinterest;
|
49 |
}
|
50 |
|
51 |
$sd_soundcloud = array();
|
52 |
+
if(isset($sd_data['sd_soundcloud']) && !empty($sd_data['sd_soundcloud']) && isset($sd_data['saswp-soundcloud-enable']) && $sd_data['saswp-soundcloud-enable'] ==1){
|
53 |
$sd_soundcloud[] = $sd_data['sd_soundcloud'];
|
54 |
$sd_social_profile[] = $sd_soundcloud;
|
55 |
}
|
56 |
|
57 |
$sd_tumblr = array();
|
58 |
+
if(isset($sd_data['sd_tumblr']) && !empty($sd_data['sd_tumblr']) && isset($sd_data['saswp-tumblr-enable']) && $sd_data['saswp-tumblr-enable'] ==1){
|
59 |
$sd_tumblr[] = $sd_data['sd_tumblr'];
|
60 |
$sd_social_profile[] = $sd_tumblr;
|
61 |
}
|
86 |
|
87 |
}
|
88 |
|
89 |
+
$contact_info = array();
|
90 |
+
|
91 |
+
|
92 |
$contact_1 = saswp_remove_warnings($sd_data, 'saswp_contact_type', 'saswp_string');
|
93 |
$telephone_1 = saswp_remove_warnings($sd_data, 'saswp_kb_telephone', 'saswp_string');
|
94 |
+
$contact_url = saswp_remove_warnings($sd_data, 'saswp_kb_contact_url', 'saswp_string');
|
95 |
|
96 |
+
|
97 |
+
if($contact_1 && ($telephone_1 || $contact_url)){
|
|
|
|
|
|
|
|
|
|
|
98 |
|
99 |
+
$contact_info = array(
|
100 |
|
101 |
'contactPoint' => array(
|
102 |
'@type' => 'ContactPoint',
|
103 |
'contactType' => esc_attr($contact_1),
|
104 |
'telephone' => esc_attr($telephone_1),
|
105 |
+
'url' => esc_attr($contact_url),
|
106 |
)
|
107 |
|
108 |
+
);
|
109 |
+
|
110 |
+
}
|
111 |
+
|
112 |
|
113 |
$input = array(
|
114 |
'@context' =>'http://schema.org',
|
195 |
$all_schema_output = array();
|
196 |
|
197 |
foreach($Conditionals as $schemaConditionals){
|
198 |
+
|
199 |
+
$schema_options = array();
|
200 |
+
|
201 |
+
if(isset($schemaConditionals['schema_options'])){
|
202 |
+
$schema_options = $schemaConditionals['schema_options'];
|
203 |
+
}
|
204 |
+
|
205 |
$schema_type = saswp_remove_warnings($schemaConditionals, 'schema_type', 'saswp_string');
|
206 |
$schema_post_id = saswp_remove_warnings($schemaConditionals, 'post_id', 'saswp_string');
|
207 |
|
709 |
$service = new saswp_output_service();
|
710 |
$product_details = $service->saswp_woocommerce_product_details(get_the_ID());
|
711 |
|
712 |
+
if((isset($sd_data['saswp-woocommerce']) && $sd_data['saswp-woocommerce'] == 1) && !empty($product_details)){
|
713 |
|
714 |
$input1 = array(
|
715 |
'@context' => 'http://schema.org',
|
718 |
'name' => saswp_remove_warnings($product_details, 'product_name', 'saswp_string'),
|
719 |
'sku' => saswp_remove_warnings($product_details, 'product_sku', 'saswp_string'),
|
720 |
'description' => saswp_remove_warnings($product_details, 'product_description', 'saswp_string'),
|
721 |
+
'image' => isset($product_details['product_image'])? $product_details['product_image']:'',
|
722 |
'offers' => array(
|
723 |
+
'@type' => 'Offer',
|
724 |
+
'availability' => saswp_remove_warnings($product_details, 'product_availability', 'saswp_string'),
|
725 |
+
'price' => saswp_remove_warnings($product_details, 'product_price', 'saswp_string'),
|
726 |
+
'priceCurrency' => saswp_remove_warnings($product_details, 'product_currency', 'saswp_string'),
|
727 |
+
'url' => get_permalink(),
|
728 |
+
'priceValidUntil' => saswp_remove_warnings($product_details, 'product_priceValidUntil', 'saswp_string'),
|
729 |
),
|
730 |
|
731 |
);
|
1010 |
if( 'Review' === $schema_type ){
|
1011 |
|
1012 |
|
1013 |
+
if(isset($sd_data['saswp-tagyeem']) && $sd_data['saswp-tagyeem'] == 1 && (is_plugin_active('taqyeem/taqyeem.php') || get_template() != 'jannah') ){
|
1014 |
|
1015 |
remove_action( 'TieLabs/after_post_entry', 'tie_article_schemas' );
|
1016 |
|
1278 |
if( 'VideoObject' === $schema_type){
|
1279 |
|
1280 |
if(empty($image_details[0]) || $image_details[0] === NULL ){
|
1281 |
+
|
1282 |
+
if(isset($sd_data['sd_logo'])){
|
1283 |
+
$image_details[0] = $sd_data['sd_logo']['url'];
|
1284 |
+
}
|
1285 |
+
|
1286 |
}
|
1287 |
|
1288 |
$input1 = array(
|
1295 |
'description' => strip_tags(get_the_excerpt()),
|
1296 |
'name' => get_the_title(),
|
1297 |
'uploadDate' => esc_html($date),
|
1298 |
+
'thumbnailUrl' => isset($image_details[0]) ? esc_url($image_details[0]):'',
|
1299 |
'mainEntity' => array(
|
1300 |
'@type' => 'WebPage',
|
1301 |
'@id' => get_permalink(),
|
1441 |
|
1442 |
}
|
1443 |
}
|
1444 |
+
|
1445 |
+
if(isset($schema_options['notAccessibleForFree']) && $schema_options['notAccessibleForFree'] == 1){
|
1446 |
|
1447 |
add_filter( 'amp_post_template_data', 'saswp_structure_data_access_scripts');
|
1448 |
|
1456 |
$paywall_class_name = ".".$paywall_class_name;
|
1457 |
|
1458 |
}
|
1459 |
+
|
1460 |
$paywallData = array("isAccessibleForFree"=> $isAccessibleForFree,
|
1461 |
"hasPart"=>array(
|
1462 |
"@type" => "WebPageElement",
|
1463 |
"isAccessibleForFree" => esc_attr($isAccessibleForFree),
|
1464 |
+
"cssSelector" => '.'.esc_attr($paywall_class_name)
|
1465 |
)
|
1466 |
);
|
1467 |
|
1468 |
$input1 = array_merge($input1,$paywallData);
|
1469 |
}
|
1470 |
+
}
|
1471 |
+
|
1472 |
+
$input1 = apply_filters('saswp_modify_woocommerce_membership_schema', $input1);
|
1473 |
|
1474 |
if(!empty($input1)){
|
1475 |
$all_schema_output[] = $input1;
|
2335 |
|
2336 |
if( 'Review' === $schema_type ){
|
2337 |
|
2338 |
+
if(isset($sd_data['saswp-tagyeem']) && $sd_data['saswp-tagyeem'] == 1 && (is_plugin_active('taqyeem/taqyeem.php') || get_template() != 'jannah')){
|
2339 |
|
2340 |
remove_action( 'TieLabs/after_post_entry', 'tie_article_schemas' );
|
2341 |
|
2654 |
}
|
2655 |
}
|
2656 |
|
2657 |
+
$input1 = apply_filters('saswp_modify_woocommerce_membership_schema', $input1);
|
2658 |
+
|
2659 |
if(!empty($input1)){
|
2660 |
|
2661 |
$all_schema_output[] = $input1;
|
output/service.php
CHANGED
@@ -638,7 +638,11 @@ Class saswp_output_service{
|
|
638 |
}
|
639 |
if(isset($custom_fields['saswp_review_schema_telephone'])){
|
640 |
$input1['itemReviewed']['telephone'] = $custom_fields['saswp_review_schema_telephone'];
|
641 |
-
}
|
|
|
|
|
|
|
|
|
642 |
break;
|
643 |
|
644 |
case 'VideoObject':
|
@@ -858,6 +862,7 @@ Class saswp_output_service{
|
|
858 |
|
859 |
$date_on_sale = $product->get_date_on_sale_to();
|
860 |
$product_details['product_name'] = $product->get_title();
|
|
|
861 |
$product_details['product_description'] = $product->get_short_description();
|
862 |
|
863 |
if(!empty($image_details)){
|
@@ -995,7 +1000,7 @@ Class saswp_output_service{
|
|
995 |
|
996 |
$post_type = get_post_type($post_id);
|
997 |
|
998 |
-
if($post_type =='dwqa-question' && isset($sd_data['saswp-dw-question-answer']) && $sd_data['saswp-dw-question-answer'] ==1 ){
|
999 |
|
1000 |
$post_meta = get_post_meta($post_id, $key='', true);
|
1001 |
|
@@ -1324,7 +1329,8 @@ Class saswp_output_service{
|
|
1324 |
'saswp_review_schema_region' => 'Address Region',
|
1325 |
'saswp_review_schema_postal_code' => 'Postal Code',
|
1326 |
'saswp_review_schema_country' => 'Address Country',
|
1327 |
-
'saswp_review_schema_telephone' => 'Telephone',
|
|
|
1328 |
);
|
1329 |
break;
|
1330 |
|
@@ -1612,7 +1618,7 @@ Class saswp_output_service{
|
|
1612 |
public function saswp_get_fetaure_image(){
|
1613 |
|
1614 |
global $sd_data;
|
1615 |
-
$input2
|
1616 |
$image_id = get_post_thumbnail_id();
|
1617 |
$image_details = wp_get_attachment_image_src($image_id, 'full');
|
1618 |
|
@@ -1629,11 +1635,16 @@ Class saswp_output_service{
|
|
1629 |
|
1630 |
$resize_image = ampforwp_aq_resize( $image_details[0], $width[$i], $height[$i], true, false, true );
|
1631 |
|
1632 |
-
$
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
|
|
|
|
|
|
|
|
|
|
1637 |
}
|
1638 |
|
1639 |
}else{
|
@@ -1644,8 +1655,17 @@ Class saswp_output_service{
|
|
1644 |
$input2['image']['height'] = esc_attr($image_details[2]);
|
1645 |
|
1646 |
}
|
1647 |
-
|
1648 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1649 |
}else{
|
1650 |
|
1651 |
if(isset($sd_data['sd_default_image']['url']) && $sd_data['sd_default_image']['url'] !=''){
|
@@ -1699,9 +1719,9 @@ Class saswp_output_service{
|
|
1699 |
|
1700 |
if(isset($custom_logo)){
|
1701 |
|
1702 |
-
$logo = $custom_logo[0];
|
1703 |
-
$height = $custom_logo[1];
|
1704 |
-
$width = $custom_logo[2];
|
1705 |
|
1706 |
}
|
1707 |
|
@@ -1709,16 +1729,16 @@ Class saswp_output_service{
|
|
1709 |
|
1710 |
if($logo !='' && $height !='' && $width !=''){
|
1711 |
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
|
1723 |
}
|
1724 |
|
638 |
}
|
639 |
if(isset($custom_fields['saswp_review_schema_telephone'])){
|
640 |
$input1['itemReviewed']['telephone'] = $custom_fields['saswp_review_schema_telephone'];
|
641 |
+
}
|
642 |
+
if(isset($custom_fields['saswp_review_author_name'])){
|
643 |
+
$input1['author']['name'] = $custom_fields['saswp_review_author_name'];
|
644 |
+
}
|
645 |
+
|
646 |
break;
|
647 |
|
648 |
case 'VideoObject':
|
862 |
|
863 |
$date_on_sale = $product->get_date_on_sale_to();
|
864 |
$product_details['product_name'] = $product->get_title();
|
865 |
+
|
866 |
$product_details['product_description'] = $product->get_short_description();
|
867 |
|
868 |
if(!empty($image_details)){
|
1000 |
|
1001 |
$post_type = get_post_type($post_id);
|
1002 |
|
1003 |
+
if($post_type =='dwqa-question' && isset($sd_data['saswp-dw-question-answer']) && $sd_data['saswp-dw-question-answer'] ==1 && is_plugin_active('dw-question-answer/dw-question-answer.php')){
|
1004 |
|
1005 |
$post_meta = get_post_meta($post_id, $key='', true);
|
1006 |
|
1329 |
'saswp_review_schema_region' => 'Address Region',
|
1330 |
'saswp_review_schema_postal_code' => 'Postal Code',
|
1331 |
'saswp_review_schema_country' => 'Address Country',
|
1332 |
+
'saswp_review_schema_telephone' => 'Telephone',
|
1333 |
+
'saswp_review_author_name' => 'Author Name',
|
1334 |
);
|
1335 |
break;
|
1336 |
|
1618 |
public function saswp_get_fetaure_image(){
|
1619 |
|
1620 |
global $sd_data;
|
1621 |
+
$input2 = array();
|
1622 |
$image_id = get_post_thumbnail_id();
|
1623 |
$image_details = wp_get_attachment_image_src($image_id, 'full');
|
1624 |
|
1635 |
|
1636 |
$resize_image = ampforwp_aq_resize( $image_details[0], $width[$i], $height[$i], true, false, true );
|
1637 |
|
1638 |
+
if(!empty($resize_image)){
|
1639 |
+
|
1640 |
+
$input2['image'][$i]['@type'] = 'ImageObject';
|
1641 |
+
$input2['image'][$i]['url'] = esc_url($resize_image[0]);
|
1642 |
+
$input2['image'][$i]['width'] = esc_attr($resize_image[1]);
|
1643 |
+
$input2['image'][$i]['height'] = esc_attr($resize_image[2]);
|
1644 |
+
|
1645 |
+
}
|
1646 |
+
|
1647 |
+
|
1648 |
}
|
1649 |
|
1650 |
}else{
|
1655 |
$input2['image']['height'] = esc_attr($image_details[2]);
|
1656 |
|
1657 |
}
|
1658 |
+
|
1659 |
+
if(empty($input2)){
|
1660 |
+
|
1661 |
+
$input2['image']['@type'] = 'ImageObject';
|
1662 |
+
$input2['image']['url'] = esc_url($image_details[0]);
|
1663 |
+
$input2['image']['width'] = esc_attr($image_details[1]);
|
1664 |
+
$input2['image']['height'] = esc_attr($image_details[2]);
|
1665 |
+
|
1666 |
+
}
|
1667 |
+
|
1668 |
+
|
1669 |
}else{
|
1670 |
|
1671 |
if(isset($sd_data['sd_default_image']['url']) && $sd_data['sd_default_image']['url'] !=''){
|
1719 |
|
1720 |
if(isset($custom_logo)){
|
1721 |
|
1722 |
+
$logo = array_key_exists(0, $custom_logo)? $custom_logo[0]:'';
|
1723 |
+
$height = array_key_exists(1, $custom_logo)? $custom_logo[1]:'';
|
1724 |
+
$width = array_key_exists(2, $custom_logo)? $custom_logo[2]:'';
|
1725 |
|
1726 |
}
|
1727 |
|
1729 |
|
1730 |
if($logo !='' && $height !='' && $width !=''){
|
1731 |
|
1732 |
+
$publisher['publisher']['@type'] = 'Organization';
|
1733 |
+
$publisher['publisher']['logo']['@type'] = 'ImageObject';
|
1734 |
+
$publisher['publisher']['logo']['url'] = esc_url($logo);
|
1735 |
+
$publisher['publisher']['logo']['width'] = esc_attr($width);
|
1736 |
+
$publisher['publisher']['logo']['height']= esc_attr($height);
|
1737 |
+
$publisher['publisher']['name'] = esc_attr($site_name);
|
1738 |
+
|
1739 |
+
$default_logo['url'] = esc_url($logo);
|
1740 |
+
$default_logo['height'] = esc_attr($height);
|
1741 |
+
$default_logo['width'] = esc_attr($width);
|
1742 |
|
1743 |
}
|
1744 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: magazine3
|
|
3 |
Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.1
|
6 |
-
Stable tag: 1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
@@ -66,6 +66,18 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
|
|
66 |
== Changelog ==
|
67 |
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
= 1.5 (27 March 2019) =
|
70 |
|
71 |
* Bug Fixed: Warning - Missing "review" field in product schema for WooCommerce product page. #179
|
3 |
Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 5.1
|
6 |
+
Stable tag: 1.6
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
66 |
== Changelog ==
|
67 |
|
68 |
|
69 |
+
= 1.6 (12 April 2019) =
|
70 |
+
|
71 |
+
* Added : Option to use URL rather than phone number for contact type in Knowledge Graph #199
|
72 |
+
* Bug Fixed: Image markup src remains null in AMP despite featured images on post #206
|
73 |
+
* Bug Fixed: Array (The value provided for image must be a valid URL.) #203
|
74 |
+
* Bug Fixed: After removing social links from the knowledge graph it still shows up in the markup #200
|
75 |
+
* Bug Fixed: If schema is not enabled on amp, it still adds blank script #189
|
76 |
+
* Bug Fixed: Modify schema output for the review schema has no author fields in dropdown #193
|
77 |
+
* Bug Fixed: Notice: Undefined offset #197
|
78 |
+
* Bug Fixed: Undefined index #204
|
79 |
+
|
80 |
+
|
81 |
= 1.5 (27 March 2019) =
|
82 |
|
83 |
* Bug Fixed: Warning - Missing "review" field in product schema for WooCommerce product page. #179
|
structured-data-for-wp.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Schema & Structured Data for WP
|
4 |
Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
|
5 |
-
Version: 1.
|
6 |
Text Domain: schema-and-structured-data-for-wp
|
7 |
Domain Path: /languages
|
8 |
Author: Magazine3
|
@@ -13,7 +13,7 @@ License: GPL2
|
|
13 |
// Exit if accessed directly.
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
-
define('SASWP_VERSION', '1.
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
2 |
/*
|
3 |
Plugin Name: Schema & Structured Data for WP
|
4 |
Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
|
5 |
+
Version: 1.6
|
6 |
Text Domain: schema-and-structured-data-for-wp
|
7 |
Domain Path: /languages
|
8 |
Author: Magazine3
|
13 |
// Exit if accessed directly.
|
14 |
if ( ! defined( 'ABSPATH' ) ) exit;
|
15 |
|
16 |
+
define('SASWP_VERSION', '1.6');
|
17 |
define('SASWP_DIR_NAME_FILE', __FILE__ );
|
18 |
define('SASWP_DIR_NAME', dirname( __FILE__ ));
|
19 |
define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
|
view/post_specific.php
CHANGED
@@ -89,10 +89,10 @@ class saswp_post_specific {
|
|
89 |
$this->screen = $show_post_types;
|
90 |
|
91 |
foreach ( $this->screen as $single_screen ) {
|
92 |
-
$post_title ='';
|
93 |
-
if(count($this->all_schema)==1){
|
94 |
-
|
95 |
-
|
96 |
}
|
97 |
add_meta_box(
|
98 |
'post_specific',
|
@@ -109,13 +109,12 @@ class saswp_post_specific {
|
|
109 |
|
110 |
public function saswp_post_meta_box_fields($post){
|
111 |
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
if(count($this->all_schema)>1){
|
120 |
|
121 |
foreach($this->all_schema as $key => $schema){
|
@@ -208,7 +207,7 @@ class saswp_post_specific {
|
|
208 |
|
209 |
wp_nonce_field( 'post_specific_data', 'post_specific_nonce' );
|
210 |
global $post;
|
211 |
-
$option = get_option('modify_schema_post_enable_'
|
212 |
|
213 |
if($option == 'enable'){
|
214 |
|
@@ -325,7 +324,7 @@ class saswp_post_specific {
|
|
325 |
$input = '';
|
326 |
$attributes = '';
|
327 |
|
328 |
-
$label = '<label for="' . $meta_field['id'] . '">' . esc_html__( $meta_field['label'], 'schema-and-structured-data-for-wp' ). '</label>';
|
329 |
$meta_value = get_post_meta( $post->ID, $meta_field['id'], true );
|
330 |
|
331 |
if ( empty( $meta_value ) && isset($meta_field['default'])) {
|
@@ -349,19 +348,21 @@ class saswp_post_specific {
|
|
349 |
$media_key = $meta_field['id'].'_detail';
|
350 |
|
351 |
$media_value_meta = get_post_meta( $post->ID, $media_key, true );
|
|
|
352 |
if(!empty($media_value_meta)){
|
353 |
-
|
354 |
-
}
|
|
|
355 |
if (strpos($meta_field['id'], 'author_image') !== false && empty($media_value_meta)) {
|
356 |
-
$media_value['height']
|
357 |
-
$media_value['width']
|
358 |
$media_value['thumbnail'] = $author_details['url'];
|
359 |
}
|
360 |
if (strpos($meta_field['id'], 'organization_logo') !== false && empty($media_value_meta)) {
|
361 |
|
362 |
if(isset($sd_data['sd_logo'])){
|
363 |
-
$media_value['height']
|
364 |
-
$media_value['width']
|
365 |
$media_value['thumbnail'] = $sd_data['sd_logo']['url'];
|
366 |
}
|
367 |
|
89 |
$this->screen = $show_post_types;
|
90 |
|
91 |
foreach ( $this->screen as $single_screen ) {
|
92 |
+
$post_title = '';
|
93 |
+
if(count($this->all_schema) == 1){
|
94 |
+
$all_schemas = $this->all_schema;
|
95 |
+
$post_title = '('.$all_schemas[0]->post_title.')';
|
96 |
}
|
97 |
add_meta_box(
|
98 |
'post_specific',
|
109 |
|
110 |
public function saswp_post_meta_box_fields($post){
|
111 |
|
112 |
+
$tabs = '';
|
113 |
+
$tabs_fields = '';
|
114 |
+
$schema_ids = array();
|
115 |
+
|
116 |
+
$schema_enable = get_post_meta($post->ID, 'saswp_enable_disable_schema', true);
|
117 |
+
|
|
|
118 |
if(count($this->all_schema)>1){
|
119 |
|
120 |
foreach($this->all_schema as $key => $schema){
|
207 |
|
208 |
wp_nonce_field( 'post_specific_data', 'post_specific_nonce' );
|
209 |
global $post;
|
210 |
+
$option = get_option('modify_schema_post_enable_'.esc_attr($post->ID));
|
211 |
|
212 |
if($option == 'enable'){
|
213 |
|
324 |
$input = '';
|
325 |
$attributes = '';
|
326 |
|
327 |
+
$label = '<label for="' . esc_attr($meta_field['id']) . '">' . esc_html__( $meta_field['label'], 'schema-and-structured-data-for-wp' ). '</label>';
|
328 |
$meta_value = get_post_meta( $post->ID, $meta_field['id'], true );
|
329 |
|
330 |
if ( empty( $meta_value ) && isset($meta_field['default'])) {
|
348 |
$media_key = $meta_field['id'].'_detail';
|
349 |
|
350 |
$media_value_meta = get_post_meta( $post->ID, $media_key, true );
|
351 |
+
|
352 |
if(!empty($media_value_meta)){
|
353 |
+
$media_value = $media_value_meta;
|
354 |
+
}
|
355 |
+
|
356 |
if (strpos($meta_field['id'], 'author_image') !== false && empty($media_value_meta)) {
|
357 |
+
$media_value['height'] = $author_details['height'];
|
358 |
+
$media_value['width'] = $author_details['width'];
|
359 |
$media_value['thumbnail'] = $author_details['url'];
|
360 |
}
|
361 |
if (strpos($meta_field['id'], 'organization_logo') !== false && empty($media_value_meta)) {
|
362 |
|
363 |
if(isset($sd_data['sd_logo'])){
|
364 |
+
$media_value['height'] = $sd_data['sd_logo']['height'];
|
365 |
+
$media_value['width'] = $sd_data['sd_logo']['width'];
|
366 |
$media_value['thumbnail'] = $sd_data['sd_logo']['url'];
|
367 |
}
|
368 |
|