Schema & Structured Data for WP & AMP - Version 1.9.12

Version Description

(9 Oct 2019) =

  • Added: Custom Taxonomy in modify schema output #533
  • Added: Coordinates fields(latitude, longitude) for real estate schema #525
  • Added: Real Estate Schema Box in Premium Features tab #472
  • Enhancement: Review for Schema improvements #534
Download this release

Release Info

Developer magazine3
Plugin Icon 128x128 Schema & Structured Data for WP & AMP
Version 1.9.12
Comparing to
See all releases

Code changes from version 1.9.11 to 1.9.12

admin_section/common-function.php CHANGED
@@ -151,8 +151,7 @@ if ( ! defined('ABSPATH') ) exit;
151
  update_option('saswp-file-upload_url','');
152
 
153
  }
154
-
155
-
156
  if ( count($errorDesc) ){
157
  echo implode("\n<br/>", $errorDesc);
158
  $wpdb->query('ROLLBACK');
@@ -2693,4 +2692,24 @@ function saswp_get_permalink(){
2693
  }
2694
 
2695
  return $url;
2696
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  update_option('saswp-file-upload_url','');
152
 
153
  }
154
+
 
155
  if ( count($errorDesc) ){
156
  echo implode("\n<br/>", $errorDesc);
157
  $wpdb->query('ROLLBACK');
2692
  }
2693
 
2694
  return $url;
2695
+ }
2696
+ function saswp_get_taxonomy_term_list(){
2697
+
2698
+ if ( ! current_user_can( 'manage_options' ) ) {
2699
+ return;
2700
+ }
2701
+ if ( ! isset( $_GET['saswp_security_nonce'] ) ){
2702
+ return;
2703
+ }
2704
+ if ( !wp_verify_nonce( $_GET['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
2705
+ return;
2706
+ }
2707
+
2708
+ $choices = array('all' => esc_html__('All','schema-and-structured-data-for-wp'));
2709
+ $taxonomies = saswp_post_taxonomy_generator();
2710
+ $choices = array_merge($choices, $taxonomies);
2711
+ echo wp_json_encode($choices);
2712
+
2713
+ wp_die();
2714
+ }
2715
+ add_action( 'wp_ajax_saswp_get_taxonomy_term_list', 'saswp_get_taxonomy_term_list');
admin_section/css/saswp-style.min.css CHANGED
@@ -1,119 +1 @@
1
- .saswp-pc-wrap{background-color:#004f74;padding:15px 15px 15px 30px;color:#fff;display:inline-flex;width:100%;flex-wrap:wrap;margin-bottom:20px}.saswp-pc-wrap .saswp-lst span{font-size:18px;font-weight:500;margin-bottom:10px;display:inline-block;line-height:1.3}.saswp-pc-wrap .saswp-lst{flex:1 0 42%}.saswp-pc-wrap .saswp-lst ul{margin:0}.saswp-pc-wrap .saswp-lst p{list-style-type:none;font-size:15px;font-weight:lighter;line-height:1.2;margin-bottom:10px;position:relative;padding-left:20px;color:#eee}.saswp-pc-wrap .saswp-lst p:before{content:'';position:absolute;width:8px;height:8px;background-color:#ccc;left:0;top:6px;border-radius:10px}.sgl .saswp-rvw{width:100%;margin-bottom:34px;font-size:13px;border-bottom:1px solid #ededed}.saswp-rvw-hd span,.saswp-rvw-sm span{background-color:#222;color:#fff;display:inline-block;font-size:15px}.saswp-rvw-hd span{line-height:1.4;padding:8px 12px 6px;margin:26px 0}.saswp-rvw td{padding:7px 14px}.saswp-rvw td,.sgl table td{border:1px solid #ededed}.saswp-rvw tbody{width:100%}.saswp-rvw-sm span{padding:8px 12px 6px;margin-bottom:13px;position:relative;line-height:1.2}.saswp-rvw-fs{line-height:1.5;font-size:48px;font-weight:600;margin-bottom:5px}.saswp-rvw-ov .ovs{font-size:11px;font-weight:600}.sgl .saswp-rvw tr td{background:#fff;width:100%}.sgl .saswp-rvw tr:hover td{background-color:#fcfcfc}.saswp-rvw .saswp-rvw-sm{padding:21px 14px}.str-ic{font-size:18px;line-height:1.2}.saswp-rvw-str{display:inline-flex;width:100%}.saswp-rvw-str .df-clr,.saswp-rvw-str .half-str,.saswp-rvw-str .str-ic{display:inline-block;width:20px;height:16px;background-repeat:no-repeat}.saswp-rvw-ov{text-align:center}.saswp-rvw-str .half-str{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cGF0aCBkPSJNNDgyLjIwNywxODYuOTczbC0xNTkuNjk5LTMzLjcwNUwyNDEuMTA0LDExLjgwM2wtODEuNDA0LDE0MS40NjVMMCwxODYuOTczbDEwOS4zODgsMTIxLjEzNEw5Mi4wOTQsNDcwLjQwNGwxNDkuMDEtNjYuNiAgbDE0OS4wMSw2Ni42bC0xNy4yOTQtMTYyLjI5Nkw0ODIuMjA3LDE4Ni45NzN6IE0yNDEuMTA0LDM3MC45NDNWNzEuOTUzbDYyLjA5LDEwNy45TDQyNSwyMDUuNTYxbC04My40MzMsOTIuMzkzbDEzLjE5MSwxMjMuNzg4ICBMMjQxLjEwNCwzNzAuOTQzeiIgZmlsbD0iI2ZmZDcwMCIvPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K)}.saswp-rvw-str .str-ic{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiNmZmQ3MDAiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}.saswp-rvw-str .df-clr{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiM2MzVlNjMiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}
2
- /*** Review Design CSS ****/
3
- .saswp-g-review-header{
4
- margin-top: 50px;
5
- }
6
- .saswp-g-review-body{
7
- display:inline-grid;
8
- grid-template-columns: 1fr 300px;
9
- grid-gap:30px;
10
- margin-top:30px;
11
- width:100%;
12
- }
13
- .saswp-review-list{}
14
- .saswp-channel-list{
15
- margin-right: 15px;
16
- }
17
- .saswp-input-fields{
18
- display: inline-flex;
19
- align-items: center;
20
- margin-bottom: 8px;
21
- width: 100%;
22
- }
23
- .saswp-input-fields label{
24
- width: 130px;
25
- }
26
- .saswp-panel h3{
27
- font-size: 20px;
28
- line-height: 1.4;
29
- color: #222;
30
- text-align: center;
31
- margin: 10px 0px 20px 0px;
32
- }
33
- .saswp-input-fields a.button-primary{
34
- margin-top:10px;
35
- }
36
- .saswp-glg-review-body{
37
- display: grid;
38
- grid-template-columns: 100px 1fr;
39
- grid-gap: 20px;
40
- background: #fff;
41
- padding: 20px;
42
- box-shadow: 0px 0px 20px 1px #d2cccc;
43
- margin-bottom: 30px;
44
- }
45
- .saswp-g-plus{
46
- float: right;
47
- font-size: 15px;
48
- width: 20px;
49
- height: 20px;
50
- }
51
- .saswp-g-plus img{
52
- width:100%;
53
- }
54
- .saswp-rtng{
55
- padding-left: 5px;
56
- font-size: 14px;
57
- }
58
- .saswp-pt-dt {
59
- font-size: 12px;
60
- color: #999;
61
- font-weight: 600;
62
- margin-top: 5px;
63
- display: inline-block;
64
- }
65
- .saswp-athr{
66
- font-size: 15px;
67
- line-height: 1.4;
68
- color: #000;
69
- font-weight: bold;
70
- display: inline-block;
71
- vertical-align: middle;
72
- }
73
- .saswp-str-rtng .saswp-rvw-str{
74
- display: inline-block;
75
- vertical-align: middle;
76
- padding-left: 10px;
77
- width: auto;
78
- }
79
- .widget-area .saswp-str-rtng .saswp-rvw-str{padding:10px 0px 0px 0px;}
80
- .saswp-rv-cnt p{
81
- font-size: 16px;
82
- line-height: 1.6;
83
- color: #000;
84
- margin: 10px 0px 0px 0px;
85
- }
86
- .saswp-rv-img img{
87
- max-width:100px;
88
- border-radius: 100%;
89
- }
90
- .widget-area .saswp-rv-img img{max-width:50px;}
91
- .widget-area .saswp-glg-review-body {
92
- display: inline-block;
93
- width:100%;
94
- }
95
- .widget-area .saswp-rv-img{
96
- width:60px;
97
- float:left;
98
- }
99
-
100
- @media(max-width:767px){
101
- .saswp-glg-review-body {
102
- grid-template-columns: 50px 1fr;
103
- }
104
- .saswp-rv-img img{
105
- max-width:50px;
106
- }
107
- }
108
-
109
- /** Widgest Reviews CSS **/
110
- .widget .saswp-glg-review-body{
111
- display: inline-block;
112
- width: 100%;
113
- }
114
- .widget .saswp-rv-img{
115
- margin-bottom:12px;
116
- }
117
- .widget .saswp-rv-img img {
118
- max-width: 50px;
119
- }
1
+ .saswp-pc-wrap{background-color:#004f74;padding:15px 15px 15px 30px;color:#fff;display:inline-flex;width:100%;flex-wrap:wrap;margin-bottom:20px}.saswp-pc-wrap .saswp-lst span{font-size:18px;font-weight:500;margin-bottom:10px;display:inline-block;line-height:1.3}.saswp-pc-wrap .saswp-lst{flex:1 0 42%}.saswp-pc-wrap .saswp-lst ul{margin:0}.saswp-pc-wrap .saswp-lst p{list-style-type:none;font-size:15px;font-weight:lighter;line-height:1.2;margin-bottom:10px;position:relative;padding-left:20px;color:#eee}.saswp-pc-wrap .saswp-lst p:before{content:'';position:absolute;width:8px;height:8px;background-color:#ccc;left:0;top:6px;border-radius:10px}.sgl .saswp-rvw{width:100%;margin-bottom:34px;font-size:13px;border-bottom:1px solid #ededed}.saswp-rvw-hd span,.saswp-rvw-sm span{background-color:#222;color:#fff;display:inline-block;font-size:15px}.saswp-rvw-hd span{line-height:1.4;padding:8px 12px 6px;margin:26px 0}.saswp-rvw td{padding:7px 14px}.saswp-rvw td,.sgl table td{border:1px solid #ededed}.saswp-rvw tbody{width:100%}.saswp-rvw-sm span{padding:8px 12px 6px;margin-bottom:13px;position:relative;line-height:1.2}.saswp-rvw-fs{line-height:1.5;font-size:48px;font-weight:600;margin-bottom:5px}.saswp-rvw-ov .ovs{font-size:11px;font-weight:600}.sgl .saswp-rvw tr td{background:#fff;width:100%}.sgl .saswp-rvw tr:hover td{background-color:#fcfcfc}.saswp-rvw .saswp-rvw-sm{padding:21px 14px}.str-ic{font-size:18px;line-height:1.2}.saswp-rvw-str{display:inline-flex;width:100%}.saswp-rvw-str .df-clr,.saswp-rvw-str .half-str,.saswp-rvw-str .str-ic{display:inline-block;width:20px;height:16px;background-repeat:no-repeat}.saswp-rvw-ov{text-align:center}.saswp-rvw-str .half-str{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cGF0aCBkPSJNNDgyLjIwNywxODYuOTczbC0xNTkuNjk5LTMzLjcwNUwyNDEuMTA0LDExLjgwM2wtODEuNDA0LDE0MS40NjVMMCwxODYuOTczbDEwOS4zODgsMTIxLjEzNEw5Mi4wOTQsNDcwLjQwNGwxNDkuMDEtNjYuNiAgbDE0OS4wMSw2Ni42bC0xNy4yOTQtMTYyLjI5Nkw0ODIuMjA3LDE4Ni45NzN6IE0yNDEuMTA0LDM3MC45NDNWNzEuOTUzbDYyLjA5LDEwNy45TDQyNSwyMDUuNTYxbC04My40MzMsOTIuMzkzbDEzLjE5MSwxMjMuNzg4ICBMMjQxLjEwNCwzNzAuOTQzeiIgZmlsbD0iI2ZmZDcwMCIvPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K)}.saswp-rvw-str .str-ic{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiNmZmQ3MDAiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}.saswp-rvw-str .df-clr{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiM2MzVlNjMiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}.saswp-g-review-header{margin-top:50px}.saswp-g-review-body{display:inline-grid;grid-template-columns:1fr 300px;grid-gap:30px;margin-top:30px;width:100%}.saswp-channel-list{margin-right:15px}.saswp-input-fields{display:inline-flex;align-items:center;margin-bottom:8px;width:100%}.saswp-input-fields label{width:130px}.saswp-panel h3{font-size:20px;line-height:1.4;color:#222;text-align:center;margin:10px 0 20px 0}.saswp-input-fields a.button-primary{margin-top:10px}.saswp-glg-review-body{display:grid;grid-template-columns:100px 1fr;grid-gap:20px;background:#fff;padding:20px;box-shadow:0 0 20px 1px #d2cccc;margin-bottom:30px}.saswp-g-plus{float:right;font-size:15px;width:20px;height:20px}.saswp-g-plus img{width:100%}.saswp-rtng{padding-left:5px;font-size:14px}.saswp-pt-dt{font-size:12px;color:#999;font-weight:600;margin-top:5px;display:inline-block}.saswp-athr{font-size:15px;line-height:1.4;color:#000;font-weight:700;display:inline-block;vertical-align:middle}.saswp-str-rtng .saswp-rvw-str{display:inline-block;vertical-align:middle;padding-left:10px;width:auto}.widget-area .saswp-str-rtng .saswp-rvw-str{padding:10px 0 0 0}.saswp-rv-cnt p{font-size:16px;line-height:1.6;color:#000;margin:10px 0 0 0}.saswp-rv-img img{max-width:100px;border-radius:100%}.widget-area .saswp-rv-img img{max-width:50px}.widget-area .saswp-glg-review-body{display:inline-block;width:100%}.widget-area .saswp-rv-img{width:60px;float:left}@media(max-width:767px){.saswp-glg-review-body{grid-template-columns:50px 1fr}.saswp-rv-img img{max-width:50px}}.widget .saswp-glg-review-body{display:inline-block;width:100%}.widget .saswp-rv-img{margin-bottom:12px}.widget .saswp-rv-img img{max-width:50px}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin_section/images/real-estate-schema-wp.png ADDED
Binary file
admin_section/js/main-script.js CHANGED
@@ -1,6 +1,23 @@
1
  var saswp_meta_list = [];
2
  var saswp_meta_fields = [];
3
- var saswp_meta_list_fields = [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  function saswp_enable_rating_review(){
6
  var schema_type = "";
@@ -545,6 +562,31 @@ jQuery(document).ready(function($){
545
  }else{
546
  $(".saswp-enable-speakable").parent().parent().hide();
547
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
548
 
549
  if(schematype == 'local_business'){
550
  $(".saswp-option-table-class tr").eq(1).show();
@@ -586,6 +628,30 @@ jQuery(document).ready(function($){
586
  $(".saswp-enable-speakable").parent().parent().hide();
587
  }
588
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
589
  if(schematype == 'local_business'){
590
  $(".saswp-"+businesstype+'-tr').show();
591
  $(".saswp-business-text-field-tr").show();
@@ -1413,7 +1479,7 @@ jQuery(document).ready(function($){
1413
  $(".saswp-feedback-no-thanks").on("click", function(e){
1414
  e.preventDefault();
1415
  $.get(ajaxurl,
1416
- { action:"saswp_feeback_no_thanks"},
1417
  function(response){
1418
  if(response['status'] =='t'){
1419
  $(".saswp-feedback-notice").hide();
@@ -1424,7 +1490,7 @@ jQuery(document).ready(function($){
1424
  $(".saswp-feedback-remindme").on("click", function(e){
1425
  e.preventDefault();
1426
  $.get(ajaxurl,
1427
- { action:"saswp_feeback_remindme"},
1428
  function(response){
1429
  if(response['status'] =='t'){
1430
  $(".saswp-feedback-notice").hide();
@@ -1732,20 +1798,61 @@ jQuery(document).ready(function($){
1732
 
1733
  $(document).on("change",".saswp-custom-meta-list", function(){
1734
 
 
1735
  var schema_type = $('select#schema_type option:selected').val();
1736
  var meta_val = $(this).val();
1737
  var field_name = $(this).parent().parent('tr').find(".saswp-custom-fields-name").val();
1738
  var html = '';
1739
  var el_id = schema_type.toLowerCase()+'_'+field_name;
1740
  var media_name = 'saswp_fixed_image['+field_name+']';
 
1741
  if(meta_val == 'manual_text'){
1742
  html += '<td><input type="text" name="saswp_fixed_text['+field_name+']"></td>';
1743
  html += '<td><a class="button button-default saswp-rmv-modify_row">X</a></td>';
1744
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1745
  }else if(meta_val == 'custom_field'){
1746
  html += '<td><select class="saswp-custom-fields-select2" name="saswp_custom_meta_field['+field_name+']">';
1747
  html += '</select></td>';
1748
  html += '<td><a class="button button-default saswp-rmv-modify_row">X</a></td>';
 
 
 
 
 
1749
  }else if(meta_val == 'fixed_image'){
1750
  html += '<td>';
1751
  html += '<fieldset>';
@@ -1758,15 +1865,20 @@ jQuery(document).ready(function($){
1758
  html += '</fieldset>';
1759
  html += '</td>';
1760
  html += '<td><a class="button button-default saswp-rmv-modify_row">X</a></td>';
 
 
 
 
1761
  }
1762
  else{
1763
  html += '<td></td>';
1764
  html += '<td><a class="button button-default saswp-rmv-modify_row">X</a></td>';
 
 
 
 
1765
  }
1766
 
1767
- $(this).parent().parent('tr').find("td:gt(1)").remove();
1768
- $(this).parent().parent('tr').append(html);
1769
- saswpCustomSelect2();
1770
 
1771
  });
1772
 
1
  var saswp_meta_list = [];
2
  var saswp_meta_fields = [];
3
+ var saswp_meta_list_fields = [];
4
+ var saswp_taxonomy_term = [];
5
+
6
+ function saswp_taxonomy_term_html(taxonomy, field_name){
7
+
8
+ var html ='';
9
+ html += '<td>';
10
+ html += '<select name="saswp_taxonomy_term['+field_name+']">';
11
+ jQuery.each(taxonomy, function(key, value){
12
+ html += '<option value="'+key+'">'+value+'</option>';
13
+ });
14
+ html += '</select>';
15
+ html += '</td>';
16
+ html += '<td><a class="button button-default saswp-rmv-modify_row">X</a></td>';
17
+
18
+ return html;
19
+
20
+ }
21
 
22
  function saswp_enable_rating_review(){
23
  var schema_type = "";
562
  }else{
563
  $(".saswp-enable-speakable").parent().parent().hide();
564
  }
565
+
566
+ if(schematype == 'Book'
567
+ || schematype == 'Course'
568
+ || schematype == 'HowTo'
569
+ || schematype == 'MusicPlaylist'
570
+ || schematype == 'MusicAlbum'
571
+ || schematype == 'Recipe'
572
+ || schematype == 'TVSeries'
573
+ || schematype == 'SoftwareApplication'
574
+ || schematype == 'Event'
575
+ || schematype == 'VideoGame'
576
+ || schematype == 'Service'
577
+
578
+ || schematype == 'AudioObject'
579
+ || schematype == 'VideoObject'
580
+ || schematype == 'local_business'
581
+ || schematype == 'Product'
582
+
583
+ ){
584
+
585
+ $(".saswp-enable-append-reviews").parent().parent().show();
586
+ }else{
587
+ $(".saswp-enable-append-reviews").parent().parent().hide();
588
+ }
589
+
590
 
591
  if(schematype == 'local_business'){
592
  $(".saswp-option-table-class tr").eq(1).show();
628
  $(".saswp-enable-speakable").parent().parent().hide();
629
  }
630
 
631
+ if(schematype == 'Book'
632
+ || schematype == 'Course'
633
+ || schematype == 'HowTo'
634
+ || schematype == 'MusicPlaylist'
635
+ || schematype == 'MusicAlbum'
636
+ || schematype == 'Recipe'
637
+ || schematype == 'TVSeries'
638
+ || schematype == 'SoftwareApplication'
639
+ || schematype == 'Event'
640
+ || schematype == 'VideoGame'
641
+ || schematype == 'Service'
642
+
643
+ || schematype == 'AudioObject'
644
+ || schematype == 'VideoObject'
645
+ || schematype == 'local_business'
646
+ || schematype == 'Product'
647
+
648
+ ){
649
+
650
+ $(".saswp-enable-append-reviews").parent().parent().show();
651
+ }else{
652
+ $(".saswp-enable-append-reviews").parent().parent().hide();
653
+ }
654
+
655
  if(schematype == 'local_business'){
656
  $(".saswp-"+businesstype+'-tr').show();
657
  $(".saswp-business-text-field-tr").show();
1479
  $(".saswp-feedback-no-thanks").on("click", function(e){
1480
  e.preventDefault();
1481
  $.get(ajaxurl,
1482
+ { action:"saswp_feeback_no_thanks", saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
1483
  function(response){
1484
  if(response['status'] =='t'){
1485
  $(".saswp-feedback-notice").hide();
1490
  $(".saswp-feedback-remindme").on("click", function(e){
1491
  e.preventDefault();
1492
  $.get(ajaxurl,
1493
+ { action:"saswp_feeback_remindme", saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
1494
  function(response){
1495
  if(response['status'] =='t'){
1496
  $(".saswp-feedback-notice").hide();
1798
 
1799
  $(document).on("change",".saswp-custom-meta-list", function(){
1800
 
1801
+ var current = $(this);
1802
  var schema_type = $('select#schema_type option:selected').val();
1803
  var meta_val = $(this).val();
1804
  var field_name = $(this).parent().parent('tr').find(".saswp-custom-fields-name").val();
1805
  var html = '';
1806
  var el_id = schema_type.toLowerCase()+'_'+field_name;
1807
  var media_name = 'saswp_fixed_image['+field_name+']';
1808
+
1809
  if(meta_val == 'manual_text'){
1810
  html += '<td><input type="text" name="saswp_fixed_text['+field_name+']"></td>';
1811
  html += '<td><a class="button button-default saswp-rmv-modify_row">X</a></td>';
1812
 
1813
+ $(this).parent().parent('tr').find("td:gt(1)").remove();
1814
+ $(this).parent().parent('tr').append(html);
1815
+ saswpCustomSelect2();
1816
+
1817
+ }else if(meta_val == 'taxonomy_term'){
1818
+
1819
+ if(!saswp_taxonomy_term['taxonomy']) {
1820
+
1821
+ $.get(ajaxurl,
1822
+ { action:"saswp_get_taxonomy_term_list", saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
1823
+ function(response){
1824
+
1825
+ if(response){
1826
+
1827
+ saswp_taxonomy_term['taxonomy'] = response;
1828
+ html += saswp_taxonomy_term_html(response, field_name);
1829
+
1830
+ current.parent().parent('tr').find("td:gt(1)").remove();
1831
+ current.parent().parent('tr').append(html);
1832
+ saswpCustomSelect2();
1833
+ }
1834
+
1835
+ },'json');
1836
+
1837
+ }else{
1838
+
1839
+ html += saswp_taxonomy_term_html(saswp_taxonomy_term['taxonomy'], field_name);
1840
+
1841
+ current.parent().parent('tr').find("td:gt(1)").remove();
1842
+ current.parent().parent('tr').append(html);
1843
+ saswpCustomSelect2();
1844
+
1845
+ }
1846
+
1847
  }else if(meta_val == 'custom_field'){
1848
  html += '<td><select class="saswp-custom-fields-select2" name="saswp_custom_meta_field['+field_name+']">';
1849
  html += '</select></td>';
1850
  html += '<td><a class="button button-default saswp-rmv-modify_row">X</a></td>';
1851
+
1852
+ $(this).parent().parent('tr').find("td:gt(1)").remove();
1853
+ $(this).parent().parent('tr').append(html);
1854
+ saswpCustomSelect2();
1855
+
1856
  }else if(meta_val == 'fixed_image'){
1857
  html += '<td>';
1858
  html += '<fieldset>';
1865
  html += '</fieldset>';
1866
  html += '</td>';
1867
  html += '<td><a class="button button-default saswp-rmv-modify_row">X</a></td>';
1868
+
1869
+ $(this).parent().parent('tr').find("td:gt(1)").remove();
1870
+ $(this).parent().parent('tr').append(html);
1871
+ saswpCustomSelect2();
1872
  }
1873
  else{
1874
  html += '<td></td>';
1875
  html += '<td><a class="button button-default saswp-rmv-modify_row">X</a></td>';
1876
+
1877
+ $(this).parent().parent('tr').find("td:gt(1)").remove();
1878
+ $(this).parent().parent('tr').append(html);
1879
+ saswpCustomSelect2();
1880
  }
1881
 
 
 
 
1882
 
1883
  });
1884
 
admin_section/js/main-script.min.js CHANGED
@@ -1 +1 @@
1
- var saswp_meta_list=[],saswp_meta_fields=[],saswp_meta_list_fields=[];function saswp_enable_rating_review(){var e="";jQuery("select#schema_type option:selected").val()&&(e=jQuery("select#schema_type option:selected").val()),jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")&&(e=jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")),e&&jQuery(".saswp-enable-rating-review-"+e.toLowerCase()).change(function(){jQuery(this).is(":checked")?jQuery(this).parent().parent().siblings(".saswp-rating-review-"+e.toLowerCase()).show():jQuery(this).parent().parent().siblings(".saswp-rating-review-"+e.toLowerCase()).hide()}).change()}function getParameterByName(e,s){s||(s=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var a=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(s);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null}function saswpCustomSelect2(){"saswp"!=saswp_localize_data.post_type&&"saswp"!=saswp_localize_data.page_now||"saswp_page_structured_data_options"==saswp_localize_data.page_now||jQuery(".saswp-custom-fields-select2").select2({ajax:{type:"POST",url:ajaxurl,dataType:"json",delay:250,data:function(e){return{saswp_security_nonce:saswp_localize_data.saswp_security_nonce,q:e.term,action:"saswp_get_custom_meta_fields"}},processResults:function(e){return{results:e}},cache:!0},minimumInputLength:2})}function saswp_reviews_datepicker(){jQuery(".saswp-reviews-datepicker-picker").datepicker({dateFormat:"yy-mm-dd"})}function saswp_schema_datepicker(){jQuery(".saswp-datepicker-picker").datepicker({dateFormat:"yy-mm-dd"})}function saswpAddTimepicker(){jQuery(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"})}function saswp_item_reviewed_call(){jQuery(".saswp-item-reviewed").change(function(e){e.preventDefault();var s="";if(jQuery("select#schema_type option:selected").val()&&(s=jQuery("select#schema_type option:selected").val()),jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")&&(s=jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")),"Review"===s){var a=jQuery(this),t=jQuery(this).val(),i=saswp_localize_data.post_id,o=jQuery(a).attr("data-id"),p=jQuery(a).attr("post-specific");jQuery.get(ajaxurl,{action:"saswp_get_item_reviewed_fields",schema_id:o,post_specific:p,item:t,post_id:i,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){jQuery(a).parent().parent().nextAll().remove(".saswp-review-tr"),jQuery(a).parent().parent().after(e)})}}).change()}function saswp_compatibliy_notes(e,s){var a=s.replace("-checkbox",""),t=jQuery("#"+a).next("p").text();e.is(":checked")&&""!==t?jQuery("#"+a).next("p").removeClass("saswp_hide"):1==jQuery("#"+a).next("p").attr("data-id")?jQuery("#"+a).next("p").text("This feature is only available in pro version"):jQuery("#"+a).next("p").addClass("saswp_hide")}function saswp_meta_list_html(e,s,a,t,i,o){var p=t;null==p&&(p=Object.keys(a)[0]);var n="";if(n+='<select class="saswp-custom-meta-list" name="saswp_meta_list_val['+p+']">',jQuery.each(s,function(e,s){n+='<optgroup label="'+s.label+'">',jQuery.each(s["meta-list"],function(e,s){n+='<option value="'+e+'">'+s+"</option>"}),n+="</optgroup>"}),n+="</select>",a){var c="<tr>";c+="<td>",c+='<select class="saswp-custom-fields-name">',jQuery.each(a,function(e,s){c+='<option value="'+e+'">'+s+"</option>"}),c+="</select>",c+="</td>",c+="<td>",c+=n,c+="</td>",c+='<td></td><td><a class="button button-default saswp-rmv-modify_row">X</a></td>',c+="</tr>",jQuery(".saswp-custom-fields-table").append(c),null!=e&&e.removeClass("updating-message")}else jQuery(i).html(n),null!=e&&e.removeClass("updating-message")}function saswp_get_meta_list(e,s,a,t,i,o){saswp_meta_list[s]?saswp_meta_list_html(e,saswp_meta_list[s],a,i,t,o):jQuery.get(ajaxurl,{action:"saswp_get_meta_list",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(p){saswp_meta_list[s]=p[s],saswp_meta_list_html(e,saswp_meta_list[s],a,i,t,o)},"json")}function saswp_get_post_specific_schema_fields(e,s,a,t,i,o){if(saswp_meta_fields[o]){var p=saswp_fields_html_generator(s,i,o,t,saswp_meta_fields[o]);p&&(jQuery(".saswp-"+t+'-section[data-id="'+i+'"]').append(p),saswp_schema_datepicker(),e.removeClass("updating-message"))}else jQuery.get(ajaxurl,{action:"saswp_get_schema_dynamic_fields_ajax",meta_name:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(a){saswp_meta_fields[o]=a,console.log(saswp_meta_fields);var p=saswp_fields_html_generator(s,i,o,t,a);p&&(jQuery(".saswp-"+t+'-section[data-id="'+i+'"]').append(p),saswp_schema_datepicker(),e.removeClass("updating-message"))},"json")}function saswp_fields_html_generator(e,s,a,t,i){var o="";return o+='<div class="saswp-'+t+'-table-div saswp-dynamic-properties" data-id="'+e+'"><a class="saswp-table-close">X</a><table class="form-table saswp-'+t+'-table">',jQuery.each(i,function(t,i){var p="";switch("saswp_tvseries_season_published_date"!=i.name&&"saswp_feed_element_date_created"!=i.name&&"saswp_product_reviews_created_date"!=i.name||(p="saswp-datepicker-picker"),i.type){case"number":case"text":o+="<tr><th>"+i.label+'</th><td><input class="'+p+'" style="width:100%" type="'+i.type+'" id="'+i.name+"_"+e+"_"+s+'" name="'+a+s+"["+e+"]["+i.name+']"></td></tr>';break;case"textarea":o+="<tr><th>"+i.label+'</th><td><textarea style="width: 100%" id="'+i.name+"_"+e+"_"+s+'" name="'+a+s+"["+e+"]["+i.name+']" rows="5"></textarea></td></tr>';break;case"select":var n="";jQuery.each(i.options,function(e,s){n+='<option value="'+e+'">'+s+"</option>"}),o+="<tr><th>"+i.label+'</th><td><select id="'+i.name+"_"+e+"_"+s+'" name="'+a+s+"["+e+"]["+i.name+']">'+n+"</select></td></tr>";break;case"media":o+="<tr><th>"+i.label+'</th><td><fieldset><input style="width:80%" type="text" id="'+i.name+"_"+e+"_"+s+'" name="'+i.name+"_"+e+"_"+s+'"><input type="hidden" data-id="'+i.name+"_"+e+"_"+s+'_id" name="'+a+s+"["+e+"]["+i.name+'_id]" id="'+i.name+"_"+e+"_"+s+'_id"><input data-id="media" style="width: 19%" class="button" id="'+i.name+"_"+e+"_"+s+'_button" name="'+i.name+"_"+e+"_"+s+'_button" type="button" value="Upload"><div class="saswp_image_div_'+i.name+"_"+e+"_"+s+'"></div></fieldset></td></tr>'}}),o+="</table></div>"}jQuery(document).ready(function(e){if(e(document).on("click",".saswp-add-g-location-btn",function(s){var a="";a=e("#saswp_google_place_api_key").length?'<input class="saswp-g-blocks-field" name="sd_data[saswp_reviews_location_blocks][]" type="number" min="5" step="5" placeholder="5" disabled="disabled">':'<input class="saswp-g-blocks-field" name="sd_data[saswp_reviews_location_blocks][]" type="number" min="10" step="10" placeholder="10">',s.preventDefault();var t="";(t+='<tr><td style="width:12%;"><strong>Place Id</strong></td><td style="width:20%;"><input class="saswp-g-location-field" name="sd_data[saswp_reviews_location_name][]" type="text" value=""></td><td style="width:10%;"><strong>Reviews</strong></td><td style="width:10%;">'+a+'</td><td style="width:10%;"><a class="button button-default saswp-fetch-g-reviews">Fetch</a></td><td style="width:10%;"><a type="button" class="saswp-remove-review-item button">x</a></td><td style="width:10%;"><p class="saswp-rv-fetched-msg"></p></td></tr>')&&e(".saswp-g-reviews-settings-table").append(t)}),e(document).on("click",".saswp-fetch-g-reviews",function(){var s=e(this),a="free";s.addClass("updating-message");var t=e(this).parent().parent().find(".saswp-g-location-field").val(),i=e(this).parent().parent().find(".saswp-g-blocks-field").val(),o=e("#saswp_google_place_api_key").val(),p=e("#reviews_addon_license_key").val(),n=e("#reviews_addon_license_key_status").val();if("premium"==(a=e("#saswp_google_place_api_key").length?"free":"premium")){if(!(i>0))return alert("Blocks value is zero"),s.removeClass("updating-message"),!1;if(0!=i%10)return s.parent().parent().find(".saswp-rv-fetched-msg").text("Reviews count should be in step of 10"),s.parent().parent().find(".saswp-rv-fetched-msg").css("color","#988f1b"),s.removeClass("updating-message"),!1}""!=t&&(p||o)?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_fetch_google_reviews",reviews_api_status:n,reviews_api:p,location:t,blocks:i,g_api:o,premium_status:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){"t"==e.status?(s.parent().parent().find(".saswp-rv-fetched-msg").text("Success"),s.parent().parent().find(".saswp-rv-fetched-msg").css("color","green")):(s.parent().parent().find(".saswp-rv-fetched-msg").text(e.message),s.parent().parent().find(".saswp-rv-fetched-msg").css("color","#988f1b")),s.removeClass("updating-message")},error:function(e){console.log(e)}}):(""==t&&alert("Please enter place id"),""==o&&alert("Please enter api key"),""==p&&alert("Please enter reviews api key"),s.removeClass("updating-message"))}),saswp_localize_data.do_tour){var s,a="<h3>Thanks for using Structured Data!</h3>";a+="<p>Do you want the latest on <b>Structured Data update</b> before others and some best resources on monetization in a single email? - Free just for users of Structured Data!</p>",a+='<style type="text/css">',a+=".wp-pointer-buttons{ padding:0; overflow: hidden; }",a+=".wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #0085ba;} .wp-pointer-content .button-primary{ display:none}\t#afw_mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }",a+="</style>",a+='<div id="afw_mc_embed_signup">',a+='<form action="//app.mailerlite.com/webforms/submit/z7t4b8" data-id="258182" data-code="z7t4b8" method="POST" target="_blank">',a+='<div id="afw_mc_embed_signup_scroll">',a+='<div class="afw-mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">',a+='<input type="text" name="fields[name]" class="form-control" placeholder="Name" hidden value="'+saswp_localize_data.current_user_name+'" style="display:none">',a+='<input type="text" value="'+saswp_localize_data.current_user_email+'" name="fields[email]" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">',a+='<input type="text" name="fields[company]" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="'+saswp_localize_data.get_home_url+'">',a+='<input type="hidden" name="ml-submit" value="1" />',a+="</div>",a+='<div id="mce-responses">',a+='<div class="response" id="mce-error-response" style="display:none"></div>',a+='<div class="response" id="mce-success-response" style="display:none"></div>',a+="</div>",a+='<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>',a+='<input type="submit" value="Subscribe" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">',a+="</div>",a+="</form>";var t={content:a+="</div>",position:{edge:"top",align:"left"}};s=function(){e(saswp_localize_data.displayID).pointer(t).pointer("open"),saswp_localize_data.button2&&(jQuery("#pointer-close").after('<a id="pointer-primary" class="button-primary">'+saswp_localize_data.button2+"</a>"),jQuery("#pointer-primary").click(function(){saswp_localize_data.function_name}),jQuery("#pointer-close").click(function(){e.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer",action:"dismiss-wp-pointer"})}))},(t=e.extend(t,{buttons:function(e,s){return button=jQuery('<a id="pointer-close" class="button-secondary">'+saswp_localize_data.button1+"</a>"),button_2=jQuery("#pointer-close.button"),button.bind("click.pointer",function(){s.element.pointer("close")}),button_2.on("click",function(){s.element.pointer("close")}),button},close:function(){e.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer",action:"dismiss-wp-pointer"})},show:function(e,s){s.pointer.css({left:"170px",top:"160px"})}})).position&&t.position.defer_loading?e(window).bind("load.wp-pointers",s):s()}e(".saswp-tabs a").click(function(s){var a=e(this).attr("href"),t=getParameterByName("tab",a);return t||(t="general"),e(this).siblings().removeClass("nav-tab-active"),e(this).addClass("nav-tab-active"),e(".form-wrap").find(".saswp-"+t).siblings().hide(),e(".form-wrap .saswp-"+t).show(),window.history.pushState("","",a),!1}),e(".saswp-schame-type-select").change(function(){e(".saswp-custom-fields-table").html("");var s=e(this).val();e(".saswp-option-table-class tr").each(function(s,a){s>0&&(e(this).hide(),e(this).find("select").attr("disabled",!0))}),"TechArticle"==s||"Article"==s||"Blogposting"==s||"NewsArticle"==s||"WebPage"==s?e(".saswp-enable-speakable").parent().parent().show():e(".saswp-enable-speakable").parent().parent().hide(),"local_business"==s&&(e(".saswp-option-table-class tr").eq(1).show(),e(".saswp-business-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1),e(".select-post-type").val("show_globally").trigger("change")),"Service"==s&&(e(".saswp-service-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Event"==s&&(e(".saswp-event-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Review"==s&&(e(".saswp-review-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1),saswp_item_reviewed_call()),saswp_enable_rating_review()}),e("#saswp_business_type").change(function(){var s=e(this).val(),a=e(".saswp-schame-type-select").val();e(".saswp-option-table-class tr").each(function(s,a){s>1&&(e(this).hide(),e(this).find("select").attr("disabled",!0))}),"TechArticle"==a||"Article"==a||"Blogposting"==a||"NewsArticle"==a||"WebPage"==a?e(".saswp-enable-speakable").parent().parent().show():e(".saswp-enable-speakable").parent().parent().hide(),"local_business"==a&&(e(".saswp-"+s+"-tr").show(),e(".saswp-business-text-field-tr").show(),e(".saswp-"+s+"-tr").find("select").attr("disabled",!1)),"Review"==a&&(e(".saswp-review-text-field-tr").show(),e(".saswp-review-text-field-tr").find("select").attr("disabled",!1)),"Event"==a&&(e(".saswp-event-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1)),saswp_enable_rating_review()}).change(),e(".saswp-checkbox").change(function(){var s=e(this).attr("id"),a=e(this);switch(s){case"saswp-the-seo-framework-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-the-seo-framework").val(1):e("#saswp-the-seo-framework").val(0);break;case"saswp-seo-press-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-seo-press").val(1):e("#saswp-seo-press").val(0);break;case"saswp-aiosp-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-aiosp").val(1):e("#saswp-aiosp").val(0);break;case"saswp-smart-crawl-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-smart-crawl").val(1):e("#saswp-smart-crawl").val(0);break;case"saswp-squirrly-seo-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-squirrly-seo").val(1):e("#saswp-squirrly-seo").val(0);break;case"saswp-wp-recipe-maker-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wp-recipe-maker").val(1):e("#saswp-wp-recipe-maker").val(0);break;case"saswp-wpsso-core-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wpsso-core").val(1):e("#saswp-wpsso-core").val(0);break;case"saswp-for-wordpress-checkbox":e(this).is(":checked")?e("#saswp-for-wordpress").val(1):e("#saswp-for-wordpress").val(0);break;case"saswp-facebook-enable-checkbox":e(this).is(":checked")?(e("#saswp-facebook-enable").val(1),e("#sd_facebook").show()):(e("#saswp-facebook-enable").val(0),e("#sd_facebook").hide());break;case"saswp-twitter-enable-checkbox":e(this).is(":checked")?(e("#saswp-twitter-enable").val(1),e("#sd_twitter").show()):(e("#saswp-twitter-enable").val(0),e("#sd_twitter").hide());break;case"saswp-google-plus-enable-checkbox":e(this).is(":checked")?(e("#saswp-google-plus-enable").val(1),e("#sd_google_plus").show()):(e("#saswp-google-plus-enable").val(0),e("#sd_google_plus").hide());break;case"saswp-instagram-enable-checkbox":e(this).is(":checked")?(e("#saswp-instagram-enable").val(1),e("#sd_instagram").show()):(e("#saswp-instagram-enable").val(0),e("#sd_instagram").hide());break;case"saswp-youtube-enable-checkbox":e(this).is(":checked")?(e("#sd_youtube").show(),e("#saswp-youtube-enable").val(1)):(e("#saswp-youtube-enable").val(0),e("#sd_youtube").hide());break;case"saswp-linkedin-enable-checkbox":e(this).is(":checked")?(e("#saswp-linkedin-enable").val(1),e("#sd_linkedin").show()):(e("#saswp-linkedin-enable").val(0),e("#sd_linkedin").hide());break;case"saswp-pinterest-enable-checkbox":e(this).is(":checked")?(e("#saswp-pinterest-enable").val(1),e("#sd_pinterest").show()):(e("#saswp-pinterest-enable").val(0),e("#sd_pinterest").hide());break;case"saswp-soundcloud-enable-checkbox":e(this).is(":checked")?(e("#saswp-soundcloud-enable").val(1),e("#sd_soundcloud").show()):(e("#saswp-soundcloud-enable").val(0),e("#sd_soundcloud").hide());break;case"saswp-tumblr-enable-checkbox":e(this).is(":checked")?(e("#saswp-tumblr-enable").val(1),e("#sd_tumblr").show()):(e("#saswp-tumblr-enable").val(0),e("#sd_tumblr").hide());break;case"saswp-yelp-enable-checkbox":e(this).is(":checked")?(e("#saswp-yelp-enable").val(1),e("#sd_yelp").show()):(e("#saswp-yelp-enable").val(0),e("#sd_yelp").hide());break;case"saswp-for-amp-checkbox":e(this).is(":checked")?e("#saswp-for-amp").val(1):e("#saswp-for-amp").val(0);break;case"saswp_kb_contact_1_checkbox":e(this).is(":checked")?(e("#saswp_kb_contact_1").val(1),e("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").removeClass("saswp-display-none")):(e("#saswp_kb_contact_1").val(0),e("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").addClass("saswp-display-none"));break;case"saswp-logo-dimensions-check":e(this).is(":checked")?(e("#saswp-logo-dimensions").val(1),e("#saswp-logo-width, #saswp-logo-height").parent().parent("li").show()):(e("#saswp-logo-dimensions").val(0),e("#saswp-logo-width, #saswp-logo-height").parent().parent("li").hide());break;case"saswp_archive_schema_checkbox":e(this).is(":checked")?(e("#saswp_archive_schema").val(1),e(".saswp_archive_schema_type_class").parent().parent().show()):(e("#saswp_archive_schema").val(0),e(".saswp_archive_schema_type_class").parent().parent().hide());break;case"saswp_website_schema_checkbox":e(this).is(":checked")?(e("#saswp_website_schema").val(1),e("#saswp_search_box_schema").parent().parent().show()):(e("#saswp_website_schema").val(0),e("#saswp_search_box_schema").parent().parent().hide());break;case"saswp_search_box_schema_checkbox":e(this).is(":checked")?e("#saswp_search_box_schema").val(1):e("#saswp_search_box_schema").val(0);break;case"saswp_breadcrumb_schema_checkbox":e(this).is(":checked")?e("#saswp_breadcrumb_schema").val(1):e("#saswp_breadcrumb_schema").val(0);break;case"saswp_comments_schema_checkbox":e(this).is(":checked")?e("#saswp_comments_schema").val(1):e("#saswp_comments_schema").val(0);break;case"saswp-compativility-checkbox":e(this).is(":checked")?e("#saswp-flexmlx-compativility").val(1):e("#saswp-flexmlx-compativility").val(0);break;case"saswp-review-module-checkbox":e(this).is(":checked")?e("#saswp-review-module").val(1):e("#saswp-review-module").val(0);break;case"saswp-kk-star-raring-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-kk-star-raring").val(1):e("#saswp-kk-star-raring").val(0);break;case"saswp-woocommerce-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-woocommerce").val(1):e("#saswp-woocommerce").val(0);break;case"saswp-extra-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-extra").val(1):e("#saswp-extra").val(0);break;case"saswp-dw-question-answer-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-dw-question-answer").val(1):e("#saswp-dw-question-answer").val(0);break;case"saswp-wp-job-manager-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wp-job-manager").val(1):e("#saswp-wp-job-manager").val(0);break;case"saswp-yoast-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-yoast").val(1):e("#saswp-yoast").val(0);break;case"saswp-rankmath-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-rankmath").val(1):e("#saswp-rankmath").val(0);break;case"saswp-tagyeem-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-tagyeem").val(1):e("#saswp-tagyeem").val(0);break;case"saswp-the-events-calendar-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-the-events-calendar").val(1):e("#saswp-the-events-calendar").val(0);break;case"saswp-homeland-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-homeland").val(1):e("#saswp-homeland").val(0);break;case"saswp-realhomes-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-realhomes").val(1):e("#saswp-realhomes").val(0);break;case"saswp-woocommerce-booking-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?(e("#saswp-woocommerce-booking").val(1),e("#saswp-woocommerce-booking-main").val(1)):(e("#saswp-woocommerce-booking").val(0),e("#saswp-woocommerce-booking-main").val(0));break;case"saswp-woocommerce-booking-main-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?(e("#saswp-woocommerce-booking-main").val(1),e("#saswp-woocommerce-booking").val(1)):(e("#saswp-woocommerce-booking-main").val(0),e("#saswp-woocommerce-booking").val(0));break;case"saswp-woocommerce-membership-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-woocommerce-membership").val(1):e("#saswp-woocommerce-membership").val(0);break;case"saswp-defragment-checkbox":e(this).is(":checked")?e("#saswp-defragment").val(1):e("#saswp-defragment").val(0);break;case"saswp-cooked-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-cooked").val(1):e("#saswp-cooked").val(0);break;case"saswp-flexmlx-compativility-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-flexmlx-compativility").val(1):e("#saswp-flexmlx-compativility").val(0);break;case"saswp-shopper-approved-review-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?(e("#saswp-shopper-approved-review").val(1),e(".saswp-s-reviews-settings-table").parent().parent().parent().show()):(e("#saswp-shopper-approved-review").val(0),e(".saswp-s-reviews-settings-table").parent().parent().parent().hide());break;case"saswp-google-review-checkbox":e(this).is(":checked")?(e("#saswp-google-review").val(1),e("#saswp-google-rv-free-checkbox").length?(e("#saswp-google-review-free").parent().parent().show(),e("#saswp-google-rv-free-checkbox").is(":checked")?e("#saswp_google_place_api_key").parent().parent().show():e("#saswp_google_place_api_key").parent().parent().hide()):e("#saswp_google_place_api_key").parent().parent().show(),e(".saswp-g-reviews-settings-table").parent().parent().parent().show()):(e("#saswp-google-review").val(0),e("#saswp_google_place_api_key").parent().parent().hide(),e(".saswp-g-reviews-settings-table").parent().parent().parent().hide(),e("#saswp-google-rv-free-checkbox").length&&e("#saswp-google-review-free").parent().parent().hide());break;case"saswp-google-rv-free-checkbox":e("#saswp-google-review-checkbox").is(":checked")&&e(this).is(":checked")?(e("#saswp-google-review-free").val(1),e("#saswp_google_place_api_key").parent().parent().show()):(e("#saswp-google-review-free").val(0),e("#saswp_google_place_api_key").parent().parent().hide());break;case"saswp-markup-footer-checkbox":e(this).is(":checked")?e("#saswp-markup-footer").val(1):e("#saswp-markup-footer").val(0);break;case"saswp-pretty-print-checkbox":e(this).is(":checked")?e("#saswp-pretty-print").val(1):e("#saswp-pretty-print").val(0);break;case"saswp-wppostratings-raring-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wppostratings-raring").val(1):e("#saswp-wppostratings-raring").val(0);break;case"saswp-bbpress-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-bbpress").val(1):e("#saswp-bbpress").val(0);break;case"saswp-microdata-cleanup-checkbox":e(this).is(":checked")?e("#saswp-microdata-cleanup").val(1):e("#saswp-microdata-cleanup").val(0)}}).change(),e("#saswp_kb_type").change(function(){var s=e(this).val();e(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass("saswp_hide"),e(".saswp_kg_logo").parent().parent().parent().addClass("saswp_hide"),e("#sd-person-image").parent().parent().parent().addClass("saswp_hide"),"Organization"==s&&(e(".saswp_org_fields").parent().parent().removeClass("saswp_hide"),e(".saswp_person_fields").parent().parent().addClass("saswp_hide"),e(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),e("#sd-person-image").parent().parent().parent().addClass("saswp_hide")),"Person"==s&&(e(".saswp_org_fields").parent().parent().addClass("saswp_hide"),e(".saswp_person_fields").parent().parent().removeClass("saswp_hide"),e(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),e("#sd-person-image").parent().parent().parent().removeClass("saswp_hide"))}).change(),e(document).on("click","input[data-id=media]",function(s){s.preventDefault();var a=e(this),t=a.attr("id").replace("_button",""),i=wp.media({title:"Application Icon",button:{text:"Select Icon"},multiple:!1,library:{type:"image"}}).on("select",function(){var s=i.state().get("selection").first().toJSON();e("#"+t).val(s.url),e("input[data-id='"+t+"_id']").val(s.id),e("input[data-id='"+t+"_height']").val(s.height),e("input[data-id='"+t+"_width']").val(s.width),e("input[data-id='"+t+"_thumbnail']").val(s.url),"sd_default_image_button"===a.attr("id")&&(e("#sd_default_image_width").val(s.width),e("#sd_default_image_height").val(s.height));var o="";"saswp_image_div_"+t=="saswp_image_div_sd_default_image"&&s.height<1200&&(o='<p class="saswp_warning">Image size is smaller than recommended size</p>'),e(".saswp_image_div_"+t).html('<div class="saswp_image_thumbnail"><img class="saswp_image_prev" src="'+s.url+'"/><a data-id="'+t+'" href="#" class="saswp_prev_close">X</a></div>'+o)}).open()}),e(document).on("click",".saswp_prev_close",function(s){s.preventDefault();var a=e(this).attr("data-id");console.log(a),e(this).parent().remove(),e("#"+a).val(""),e("input[data-id='"+a+"_id']").val(""),e("input[data-id='"+a+"_height']").val(""),e("input[data-id='"+a+"_width']").val(""),e("input[data-id='"+a+"_thumbnail']").val(""),"sd_default_image"===a&&(e("#sd_default_image_width").val(""),e("#sd_default_image_height").val(""))}),e(document).on("change",".saswp-schema-type-toggle",function(s){var a=e(this).attr("data-schema-id"),t=e(this).attr("data-post-id");if(e(this).is(":checked"))var i=1;else i=0;e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_enable_disable_schema_on_post",status:i,schema_id:a,post_id:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){},error:function(e){console.log(e)}})}),e(document).on("click",".saswp-reset-data",function(s){s.preventDefault(),1==confirm("Are you sure?")&&e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_reset_all_settings",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){setTimeout(function(){location.reload()},1e3)},error:function(e){console.log(e)}})}),e(document).on("click",".saswp_license_activation",function(s){s.preventDefault();var a=e(this);a.addClass("updating-message");var t=e(this).attr("license-status"),i=e(this).attr("add-on"),o=e("#"+i+"_addon_license_key").val();t&&i&&o?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_license_status_check",license_key:o,license_status:t,add_on:i,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){e("#"+i+"_addon_license_key_status").val(s.status),"active"==s.status?(e(".saswp-"+i+"-dashicons").addClass("dashicons-yes"),e(".saswp-"+i+"-dashicons").removeClass("dashicons-no-alt"),e(".saswp-"+i+"-dashicons").css("color","green"),e(".saswp_license_activation[add-on='"+i+"']").attr("license-status","inactive"),e(".saswp_license_activation[add-on='"+i+"']").text("Deactivate"),e(".saswp_license_status_msg[add-on='"+i+"']").text("Activated"),e(".saswp_license_status_msg[add-on='"+i+"']").css("color","green"),e(".saswp_license_status_msg[add-on='"+i+"']").text(s.message)):(e(".saswp-"+i+"-dashicons").addClass("dashicons-no-alt"),e(".saswp-"+i+"-dashicons").removeClass("dashicons-yes"),e(".saswp-"+i+"-dashicons").css("color","red"),e(".saswp_license_activation[add-on='"+i+"']").attr("license-status","active"),e(".saswp_license_activation[add-on='"+i+"']").text("Activate"),e(".saswp_license_status_msg[add-on='"+i+"']").css("color","red"),e(".saswp_license_status_msg[add-on='"+i+"']").text(s.message)),a.removeClass("updating-message")},error:function(e){console.log(e)}}):(alert("Please enter value license key"),a.removeClass("updating-message"))}),e(".saswp-send-query").on("click",function(s){s.preventDefault();var a=e("#saswp_query_message").val();""!=e.trim(a)?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_send_query_message",message:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){"t"==s.status?(e(".saswp-query-success").show(),e(".saswp-query-error").hide()):(console.log("dd"),e(".saswp-query-success").hide(),e(".saswp-query-error").show())},error:function(e){console.log(e)}}):alert("Please enter the message")}),e(".saswp-import-plugins").on("click",function(s){s.preventDefault();var a=e(this);a.addClass("updating-message");var t=e(this).attr("data-id");e.get(ajaxurl,{action:"saswp_import_plugin_data",plugin_name:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){"t"==s.status?(e(a).parent().find(".saswp-imported-message").text(s.message),e(a).parent().find(".saswp-imported-message").removeClass("saswp-error"),setTimeout(function(){location.reload()},2e3)):(e(a).parent().find(".saswp-imported-message").addClass("saswp-error"),e(a).parent().find(".saswp-imported-message").text(s.message)),a.removeClass("updating-message")},"json")}),e(".saswp-feedback-no-thanks").on("click",function(s){s.preventDefault(),e.get(ajaxurl,{action:"saswp_feeback_no_thanks"},function(s){"t"==s.status&&e(".saswp-feedback-notice").hide()},"json")}),e(".saswp-feedback-remindme").on("click",function(s){s.preventDefault(),e.get(ajaxurl,{action:"saswp_feeback_remindme"},function(s){"t"==s.status&&e(".saswp-feedback-notice").hide()},"json")}),e(document).on("change",".saswp-local-business-type-select",function(s){s.preventDefault();var a=e(this),t=e(this).val();e.get(ajaxurl,{action:"saswp_get_sub_business_ajax",business_type:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){if("t"==s.status){e(".saswp-local-business-name-select").parents("tr").remove();var t=a.parents(".saswp-post-specific-wrapper").attr("data-id"),i='<tr><th><label for="saswp_business_name_'+t+'">Sub Business Type</label></th>';i+='<td><select class="saswp-local-business-name-select" id="saswp_business_name_'+t+'" name="saswp_business_name_'+t+'">',e.each(s.result,function(e,s){i+='<option value="'+e+'">'+s+"</option>"}),i+="</select></td>",i+="</tr>",a.parents(".form-table tr:first").after(i)}else e(".saswp-local-business-name-select").parents("tr").remove()},"json")}),saswp_item_reviewed_call(),e(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"}),e(document).on("click",".saswp-add-custom-schema",function(s){s.preventDefault(),e(".saswp-add-custom-schema-field").removeClass("saswp_hide"),e(this).hide()}),e(document).on("click",".saswp-delete-custom-schema",function(s){s.preventDefault(),e("#saswp_custom_schema_field").val(""),e(".saswp-add-custom-schema-field").addClass("saswp_hide"),e(".saswp-add-custom-schema").show()}),e(".saswp-modify_schema_post_enable").on("click",function(s){var a=e(this);a.addClass("updating-message"),s.preventDefault(),e.get(ajaxurl,{action:"saswp_modify_schema_post_enable",post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){a.remove(),e(".saswp-add-custom-schema-div").remove(),e("#post_specific .inside").append(s),a.removeClass("updating-message"),saswpAddTimepicker(),saswp_schema_datepicker(),saswp_enable_rating_review(),saswp_item_reviewed_call()})}),saswp_schema_datepicker(),saswp_reviews_datepicker(),e(document).on("click",".saswp-add-more-item",function(s){s.preventDefault();var a=e(".saswp-review-item-list-table tr").length;console.log(a);e(".saswp-review-item-list-table").append('<tr class="saswp-review-item-tr"><td>Review Item Feature</td><td><input type="text" name="saswp-review-item-feature[]"></td><td>Rating</td><td><input step="0.1" min="0" max="5" type="number" name="saswp-review-item-star-rating[]"></td><td><a type="button" class="saswp-remove-review-item button">x</a></td></tr>')}),e(document).on("click",".saswp-remove-review-item",function(s){s.preventDefault(),e(this).parent().parent("tr").remove()}),e(document).on("focusout",".saswp-review-item-tr input[type=number]",function(s){s.preventDefault();var a=0,t=e(".saswp-review-item-tr input[type=number]").length;e(".saswp-review-item-tr input[type=number]").each(function(s,t){""==e(t).val()?a+=parseFloat(0):a+=parseFloat(e(t).val())});var i=a/t;e("#saswp-review-item-over-all").val(i)}),e("#saswp-review-location").change(function(){var s=e(this).val();e(".saswp-review-shortcode").addClass("saswp_hide"),3==s&&e(".saswp-review-shortcode").removeClass("saswp_hide")}).change(),e("#saswp-review-item-enable").change(function(){e(this).is(":checked")?e(".saswp-review-fields").show():e(".saswp-review-fields").hide()}).change(),e(document).on("click",".saswp-restore-post-schema",function(s){s.preventDefault();var a=e(this);if(a.addClass("updating-message"),e(".saswp-post-specific-schema-ids").val())var t=JSON.parse(e(".saswp-post-specific-schema-ids").val());e.post(ajaxurl,{action:"saswp_restore_schema",schema_ids:t,post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){"t"==e.status?setTimeout(function(){location.reload()},1e3):(alert(e.msg),setTimeout(function(){location.reload()},1e3)),a.removeClass("updating-message")},"json")}),e(document).on("click","div.saswp-tab ul.saswp-tab-nav a",function(s){s.preventDefault();var a=e(this).attr("data-id");e(".saswp-post-specific-wrapper").hide(),e("#"+a).show(),e("div.saswp-tab ul.saswp-tab-nav a").removeClass("selected"),e("div.saswp-tab ul.saswp-tab-nav li").removeClass("selected"),e(this).addClass("selected"),e(this).parent().addClass("selected"),saswp_enable_rating_review()}),e("#saswp-global-tabs a:first").addClass("saswp-global-selected"),e(".saswp-global-container").hide(),"#saswp-default-container"==window.location.hash?e(".saswp-global-container:eq(2)").show():e(".saswp-global-container:first").show(),e("#saswp-global-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-global-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-global-container").hide(),e("#"+s).show())}),e("#saswp-tools-tabs a:first").addClass("saswp-global-selected"),e(".saswp-tools-container").hide(),e(".saswp-tools-container:first").show(),e("#saswp-tools-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-tools-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-tools-container").hide(),e("#"+s).show())}),e("#saswp-review-tabs a:first").addClass("saswp-global-selected"),e(".saswp-review-container").hide(),e(".saswp-review-container:first").show(),e("#saswp-review-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-review-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-review-container").hide(),e("#"+s).show())}),e('a[href="'+saswp_localize_data.new_url_selector+'"]').attr("href",saswp_localize_data.new_url_href),e("#saswp_enable_custom_field").change(function(){e(this).is(":checked")?e(".saswp-custom-fields-div").show():e(".saswp-custom-fields-div").hide()}),e(document).on("change",".saswp-custom-fields-name",function(){var s="text",a=e(this).parent().parent("tr"),t=e(this).val();-1==t.indexOf("image")&&-1==t.indexOf("logo")||(s="image"),saswp_get_meta_list(null,s,null,e(this).parent().parent("tr").find("td:eq(1)"),t,a)}),e(document).on("click",".saswp-skip-button",function(s){s.preventDefault(),e(this).parent().parent().hide(),e.post(ajaxurl,{action:"saswp_skip_wizard",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){},"json")}),e(document).on("click",".saswp_add_schema_fields_on_fly",function(s){s.preventDefault();var a=e(this);a.addClass("updating-message");var t=e(this).attr("data-id"),i=e(this).attr("fields_type"),o=e(this).attr("div_type"),p=e(".saswp-"+o+"-table-div").length,n=e(".saswp-"+o+"-table-div:nth-child("+p+")").attr("data-id");(n=++n)||(n=0),saswp_get_post_specific_schema_fields(a,n,i,o,t,i+"_")}),e(document).on("click",".saswp-table-close",function(){e(this).parent().remove()}),e(document).on("click",".saswp-rmv-modify_row",function(s){s.preventDefault(),e(this).parent().parent().remove()}),e(document).on("change",".saswp-custom-meta-list",function(){var s=e("select#schema_type option:selected").val(),a=e(this).val(),t=e(this).parent().parent("tr").find(".saswp-custom-fields-name").val(),i="",o=s.toLowerCase()+"_"+t,p="saswp_fixed_image["+t+"]";"manual_text"==a?(i+='<td><input type="text" name="saswp_fixed_text['+t+']"></td>',i+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>'):"custom_field"==a?(i+='<td><select class="saswp-custom-fields-select2" name="saswp_custom_meta_field['+t+']">',i+="</select></td>",i+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>'):"fixed_image"==a?(i+="<td>",i+="<fieldset>",i+='<input data-id="media" style="width: 30%;" class="button" id="'+o+'_button" name="'+o+'_button" type="button" value="Upload" />',i+='<input type="hidden" data-id="'+o+'_height" class="upload-height" name="'+p+'[height]" id="'+o+'_height" value="">',i+='<input type="hidden" data-id="'+o+'_width" class="upload-width" name="'+p+'[width]" id="'+o+'_width" value="">',i+='<input type="hidden" data-id="'+o+'_thumbnail" class="upload-thumbnail" name="'+p+'[thumbnail]" id="'+o+'_thumbnail" value="">',i+='<div class="saswp_image_div_'+o+'">',i+="</div>",i+="</fieldset>",i+="</td>",i+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>'):(i+="<td></td>",i+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>'),e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(i),saswpCustomSelect2()}),e(document).on("change",".saswp-item-reivewed-list",function(){e(".saswp-custom-fields-table").html(""),saswp_meta_list_fields=[]}),e(document).on("click",".saswp-add-custom-fields",function(){var s=e(this);s.addClass("updating-message");var a=e("select#schema_type option:selected").val(),t="";"Review"==a&&(t=e("select.saswp-item-reivewed-list option:selected").val());var i=e("#post_ID").val();""!=a&&(saswp_meta_list_fields[a]?saswp_get_meta_list(s,"text",saswp_meta_list_fields[a],null,null,null):e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_get_schema_type_fields",post_id:i,schema_type:a,schema_subtype:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){saswp_meta_list_fields[a]=e,saswp_get_meta_list(s,"text",saswp_meta_list_fields[a],null,null,null)},error:function(e){console.log(e)}}))}),saswpCustomSelect2(),saswp_enable_rating_review(),e('a[href="'+saswp_localize_data.collection_post_add_url+'"]').attr("href",saswp_localize_data.collection_post_add_new_url),e(document).on("click",".saswp_coonect_google_place",function(){var s=e("#saswp_google_place_id").val(),a=e("#saswp_language_list").val(),t=e("#saswp_googel_api").val();""!=s&&e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_connect_google_place",place_id:s,language:a,google_api:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){console.log(e.status)},error:function(e){console.log(e)}})}),"saswp"==saswp_localize_data.post_type&&"edit.php"==saswp_localize_data.page_now&&jQuery(jQuery(".wrap a")[0]).after("<a href='"+saswp_localize_data.saswp_settings_url+"' id='' class='page-title-action'>Settings</a>"),"undefined"!=typeof saswp_reviews_data&&e(".saswp-rating-div").rateYo({rating:saswp_reviews_data.rating_val,halfStar:!0,readOnly:saswp_reviews_data.readonly,onSet:function(s,a){e(this).next().val(s),console.log(s)}}),e("#sd-person-phone-number, #saswp_kb_telephone").focusout(function(){var s=e(this);s.parent().find(".saswp-phone-validation").remove();var a=e(this).val();/^\+([0-9]{1,3})\)?[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})$/.test(a)?s.parent().find(".saswp-phone-validation").remove():s.after('<span style="color:red;" class="saswp-phone-validation">Invalid Phone Number</span>')})});
1
+ var saswp_meta_list=[],saswp_meta_fields=[],saswp_meta_list_fields=[],saswp_taxonomy_term=[];function saswp_taxonomy_term_html(e,s){var a="";return a+="<td>",a+='<select name="saswp_taxonomy_term['+s+']">',jQuery.each(e,function(e,s){a+='<option value="'+e+'">'+s+"</option>"}),a+="</select>",a+="</td>",a+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>'}function saswp_enable_rating_review(){var e="";jQuery("select#schema_type option:selected").val()&&(e=jQuery("select#schema_type option:selected").val()),jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")&&(e=jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")),e&&jQuery(".saswp-enable-rating-review-"+e.toLowerCase()).change(function(){jQuery(this).is(":checked")?jQuery(this).parent().parent().siblings(".saswp-rating-review-"+e.toLowerCase()).show():jQuery(this).parent().parent().siblings(".saswp-rating-review-"+e.toLowerCase()).hide()}).change()}function getParameterByName(e,s){s||(s=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var a=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(s);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null}function saswpCustomSelect2(){"saswp"!=saswp_localize_data.post_type&&"saswp"!=saswp_localize_data.page_now||"saswp_page_structured_data_options"==saswp_localize_data.page_now||jQuery(".saswp-custom-fields-select2").select2({ajax:{type:"POST",url:ajaxurl,dataType:"json",delay:250,data:function(e){return{saswp_security_nonce:saswp_localize_data.saswp_security_nonce,q:e.term,action:"saswp_get_custom_meta_fields"}},processResults:function(e){return{results:e}},cache:!0},minimumInputLength:2})}function saswp_reviews_datepicker(){jQuery(".saswp-reviews-datepicker-picker").datepicker({dateFormat:"yy-mm-dd"})}function saswp_schema_datepicker(){jQuery(".saswp-datepicker-picker").datepicker({dateFormat:"yy-mm-dd"})}function saswpAddTimepicker(){jQuery(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"})}function saswp_item_reviewed_call(){jQuery(".saswp-item-reviewed").change(function(e){e.preventDefault();var s="";if(jQuery("select#schema_type option:selected").val()&&(s=jQuery("select#schema_type option:selected").val()),jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")&&(s=jQuery(".saswp-tab-links.selected").attr("saswp-schema-type")),"Review"===s){var a=jQuery(this),t=jQuery(this).val(),i=saswp_localize_data.post_id,o=jQuery(a).attr("data-id"),n=jQuery(a).attr("post-specific");jQuery.get(ajaxurl,{action:"saswp_get_item_reviewed_fields",schema_id:o,post_specific:n,item:t,post_id:i,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){jQuery(a).parent().parent().nextAll().remove(".saswp-review-tr"),jQuery(a).parent().parent().after(e)})}}).change()}function saswp_compatibliy_notes(e,s){var a=s.replace("-checkbox",""),t=jQuery("#"+a).next("p").text();e.is(":checked")&&""!==t?jQuery("#"+a).next("p").removeClass("saswp_hide"):1==jQuery("#"+a).next("p").attr("data-id")?jQuery("#"+a).next("p").text("This feature is only available in pro version"):jQuery("#"+a).next("p").addClass("saswp_hide")}function saswp_meta_list_html(e,s,a,t,i,o){var n=t;null==n&&(n=Object.keys(a)[0]);var p="";if(p+='<select class="saswp-custom-meta-list" name="saswp_meta_list_val['+n+']">',jQuery.each(s,function(e,s){p+='<optgroup label="'+s.label+'">',jQuery.each(s["meta-list"],function(e,s){p+='<option value="'+e+'">'+s+"</option>"}),p+="</optgroup>"}),p+="</select>",a){var c="<tr>";c+="<td>",c+='<select class="saswp-custom-fields-name">',jQuery.each(a,function(e,s){c+='<option value="'+e+'">'+s+"</option>"}),c+="</select>",c+="</td>",c+="<td>",c+=p,c+="</td>",c+='<td></td><td><a class="button button-default saswp-rmv-modify_row">X</a></td>',c+="</tr>",jQuery(".saswp-custom-fields-table").append(c),null!=e&&e.removeClass("updating-message")}else jQuery(i).html(p),null!=e&&e.removeClass("updating-message")}function saswp_get_meta_list(e,s,a,t,i,o){saswp_meta_list[s]?saswp_meta_list_html(e,saswp_meta_list[s],a,i,t,o):jQuery.get(ajaxurl,{action:"saswp_get_meta_list",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(n){saswp_meta_list[s]=n[s],saswp_meta_list_html(e,saswp_meta_list[s],a,i,t,o)},"json")}function saswp_get_post_specific_schema_fields(e,s,a,t,i,o){if(saswp_meta_fields[o]){var n=saswp_fields_html_generator(s,i,o,t,saswp_meta_fields[o]);n&&(jQuery(".saswp-"+t+'-section[data-id="'+i+'"]').append(n),saswp_schema_datepicker(),e.removeClass("updating-message"))}else jQuery.get(ajaxurl,{action:"saswp_get_schema_dynamic_fields_ajax",meta_name:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(a){saswp_meta_fields[o]=a,console.log(saswp_meta_fields);var n=saswp_fields_html_generator(s,i,o,t,a);n&&(jQuery(".saswp-"+t+'-section[data-id="'+i+'"]').append(n),saswp_schema_datepicker(),e.removeClass("updating-message"))},"json")}function saswp_fields_html_generator(e,s,a,t,i){var o="";return o+='<div class="saswp-'+t+'-table-div saswp-dynamic-properties" data-id="'+e+'"><a class="saswp-table-close">X</a><table class="form-table saswp-'+t+'-table">',jQuery.each(i,function(t,i){var n="";switch("saswp_tvseries_season_published_date"!=i.name&&"saswp_feed_element_date_created"!=i.name&&"saswp_product_reviews_created_date"!=i.name||(n="saswp-datepicker-picker"),i.type){case"number":case"text":o+="<tr><th>"+i.label+'</th><td><input class="'+n+'" style="width:100%" type="'+i.type+'" id="'+i.name+"_"+e+"_"+s+'" name="'+a+s+"["+e+"]["+i.name+']"></td></tr>';break;case"textarea":o+="<tr><th>"+i.label+'</th><td><textarea style="width: 100%" id="'+i.name+"_"+e+"_"+s+'" name="'+a+s+"["+e+"]["+i.name+']" rows="5"></textarea></td></tr>';break;case"select":var p="";jQuery.each(i.options,function(e,s){p+='<option value="'+e+'">'+s+"</option>"}),o+="<tr><th>"+i.label+'</th><td><select id="'+i.name+"_"+e+"_"+s+'" name="'+a+s+"["+e+"]["+i.name+']">'+p+"</select></td></tr>";break;case"media":o+="<tr><th>"+i.label+'</th><td><fieldset><input style="width:80%" type="text" id="'+i.name+"_"+e+"_"+s+'" name="'+i.name+"_"+e+"_"+s+'"><input type="hidden" data-id="'+i.name+"_"+e+"_"+s+'_id" name="'+a+s+"["+e+"]["+i.name+'_id]" id="'+i.name+"_"+e+"_"+s+'_id"><input data-id="media" style="width: 19%" class="button" id="'+i.name+"_"+e+"_"+s+'_button" name="'+i.name+"_"+e+"_"+s+'_button" type="button" value="Upload"><div class="saswp_image_div_'+i.name+"_"+e+"_"+s+'"></div></fieldset></td></tr>'}}),o+="</table></div>"}jQuery(document).ready(function(e){if(e(document).on("click",".saswp-add-g-location-btn",function(s){var a="";a=e("#saswp_google_place_api_key").length?'<input class="saswp-g-blocks-field" name="sd_data[saswp_reviews_location_blocks][]" type="number" min="5" step="5" placeholder="5" disabled="disabled">':'<input class="saswp-g-blocks-field" name="sd_data[saswp_reviews_location_blocks][]" type="number" min="10" step="10" placeholder="10">',s.preventDefault();var t="";(t+='<tr><td style="width:12%;"><strong>Place Id</strong></td><td style="width:20%;"><input class="saswp-g-location-field" name="sd_data[saswp_reviews_location_name][]" type="text" value=""></td><td style="width:10%;"><strong>Reviews</strong></td><td style="width:10%;">'+a+'</td><td style="width:10%;"><a class="button button-default saswp-fetch-g-reviews">Fetch</a></td><td style="width:10%;"><a type="button" class="saswp-remove-review-item button">x</a></td><td style="width:10%;"><p class="saswp-rv-fetched-msg"></p></td></tr>')&&e(".saswp-g-reviews-settings-table").append(t)}),e(document).on("click",".saswp-fetch-g-reviews",function(){var s=e(this),a="free";s.addClass("updating-message");var t=e(this).parent().parent().find(".saswp-g-location-field").val(),i=e(this).parent().parent().find(".saswp-g-blocks-field").val(),o=e("#saswp_google_place_api_key").val(),n=e("#reviews_addon_license_key").val(),p=e("#reviews_addon_license_key_status").val();if("premium"==(a=e("#saswp_google_place_api_key").length?"free":"premium")){if(!(i>0))return alert("Blocks value is zero"),s.removeClass("updating-message"),!1;if(0!=i%10)return s.parent().parent().find(".saswp-rv-fetched-msg").text("Reviews count should be in step of 10"),s.parent().parent().find(".saswp-rv-fetched-msg").css("color","#988f1b"),s.removeClass("updating-message"),!1}""!=t&&(n||o)?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_fetch_google_reviews",reviews_api_status:p,reviews_api:n,location:t,blocks:i,g_api:o,premium_status:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){"t"==e.status?(s.parent().parent().find(".saswp-rv-fetched-msg").text("Success"),s.parent().parent().find(".saswp-rv-fetched-msg").css("color","green")):(s.parent().parent().find(".saswp-rv-fetched-msg").text(e.message),s.parent().parent().find(".saswp-rv-fetched-msg").css("color","#988f1b")),s.removeClass("updating-message")},error:function(e){console.log(e)}}):(""==t&&alert("Please enter place id"),""==o&&alert("Please enter api key"),""==n&&alert("Please enter reviews api key"),s.removeClass("updating-message"))}),saswp_localize_data.do_tour){var s,a="<h3>Thanks for using Structured Data!</h3>";a+="<p>Do you want the latest on <b>Structured Data update</b> before others and some best resources on monetization in a single email? - Free just for users of Structured Data!</p>",a+='<style type="text/css">',a+=".wp-pointer-buttons{ padding:0; overflow: hidden; }",a+=".wp-pointer-content .button-secondary{ left: -25px;background: transparent;top: 5px; border: 0;position: relative; padding: 0; box-shadow: none;margin: 0;color: #0085ba;} .wp-pointer-content .button-primary{ display:none}\t#afw_mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }",a+="</style>",a+='<div id="afw_mc_embed_signup">',a+='<form action="//app.mailerlite.com/webforms/submit/z7t4b8" data-id="258182" data-code="z7t4b8" method="POST" target="_blank">',a+='<div id="afw_mc_embed_signup_scroll">',a+='<div class="afw-mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">',a+='<input type="text" name="fields[name]" class="form-control" placeholder="Name" hidden value="'+saswp_localize_data.current_user_name+'" style="display:none">',a+='<input type="text" value="'+saswp_localize_data.current_user_email+'" name="fields[email]" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">',a+='<input type="text" name="fields[company]" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="'+saswp_localize_data.get_home_url+'">',a+='<input type="hidden" name="ml-submit" value="1" />',a+="</div>",a+='<div id="mce-responses">',a+='<div class="response" id="mce-error-response" style="display:none"></div>',a+='<div class="response" id="mce-success-response" style="display:none"></div>',a+="</div>",a+='<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>',a+='<input type="submit" value="Subscribe" name="subscribe" id="pointer-close" class="button mc-newsletter-sent" style=" background: #0085ba; border-color: #006799; padding: 0px 16px; text-shadow: 0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799; height: 30px; margin-top: 1px; color: #fff; box-shadow: 0 1px 0 #006799;">',a+="</div>",a+="</form>";var t={content:a+="</div>",position:{edge:"top",align:"left"}};s=function(){e(saswp_localize_data.displayID).pointer(t).pointer("open"),saswp_localize_data.button2&&(jQuery("#pointer-close").after('<a id="pointer-primary" class="button-primary">'+saswp_localize_data.button2+"</a>"),jQuery("#pointer-primary").click(function(){saswp_localize_data.function_name}),jQuery("#pointer-close").click(function(){e.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer",action:"dismiss-wp-pointer"})}))},(t=e.extend(t,{buttons:function(e,s){return button=jQuery('<a id="pointer-close" class="button-secondary">'+saswp_localize_data.button1+"</a>"),button_2=jQuery("#pointer-close.button"),button.bind("click.pointer",function(){s.element.pointer("close")}),button_2.on("click",function(){s.element.pointer("close")}),button},close:function(){e.post(saswp_localize_data.ajax_url,{pointer:"saswp_subscribe_pointer",action:"dismiss-wp-pointer"})},show:function(e,s){s.pointer.css({left:"170px",top:"160px"})}})).position&&t.position.defer_loading?e(window).bind("load.wp-pointers",s):s()}e(".saswp-tabs a").click(function(s){var a=e(this).attr("href"),t=getParameterByName("tab",a);return t||(t="general"),e(this).siblings().removeClass("nav-tab-active"),e(this).addClass("nav-tab-active"),e(".form-wrap").find(".saswp-"+t).siblings().hide(),e(".form-wrap .saswp-"+t).show(),window.history.pushState("","",a),!1}),e(".saswp-schame-type-select").change(function(){e(".saswp-custom-fields-table").html("");var s=e(this).val();e(".saswp-option-table-class tr").each(function(s,a){s>0&&(e(this).hide(),e(this).find("select").attr("disabled",!0))}),"TechArticle"==s||"Article"==s||"Blogposting"==s||"NewsArticle"==s||"WebPage"==s?e(".saswp-enable-speakable").parent().parent().show():e(".saswp-enable-speakable").parent().parent().hide(),"Book"==s||"Course"==s||"HowTo"==s||"MusicPlaylist"==s||"MusicAlbum"==s||"Recipe"==s||"TVSeries"==s||"SoftwareApplication"==s||"Event"==s||"VideoGame"==s||"Service"==s||"AudioObject"==s||"VideoObject"==s||"local_business"==s||"Product"==s?e(".saswp-enable-append-reviews").parent().parent().show():e(".saswp-enable-append-reviews").parent().parent().hide(),"local_business"==s&&(e(".saswp-option-table-class tr").eq(1).show(),e(".saswp-business-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1),e(".select-post-type").val("show_globally").trigger("change")),"Service"==s&&(e(".saswp-service-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Event"==s&&(e(".saswp-event-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Review"==s&&(e(".saswp-review-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1),saswp_item_reviewed_call()),saswp_enable_rating_review()}),e("#saswp_business_type").change(function(){var s=e(this).val(),a=e(".saswp-schame-type-select").val();e(".saswp-option-table-class tr").each(function(s,a){s>1&&(e(this).hide(),e(this).find("select").attr("disabled",!0))}),"TechArticle"==a||"Article"==a||"Blogposting"==a||"NewsArticle"==a||"WebPage"==a?e(".saswp-enable-speakable").parent().parent().show():e(".saswp-enable-speakable").parent().parent().hide(),"Book"==a||"Course"==a||"HowTo"==a||"MusicPlaylist"==a||"MusicAlbum"==a||"Recipe"==a||"TVSeries"==a||"SoftwareApplication"==a||"Event"==a||"VideoGame"==a||"Service"==a||"AudioObject"==a||"VideoObject"==a||"local_business"==a||"Product"==a?e(".saswp-enable-append-reviews").parent().parent().show():e(".saswp-enable-append-reviews").parent().parent().hide(),"local_business"==a&&(e(".saswp-"+s+"-tr").show(),e(".saswp-business-text-field-tr").show(),e(".saswp-"+s+"-tr").find("select").attr("disabled",!1)),"Review"==a&&(e(".saswp-review-text-field-tr").show(),e(".saswp-review-text-field-tr").find("select").attr("disabled",!1)),"Event"==a&&(e(".saswp-event-text-field-tr").show(),e(".saswp-option-table-class tr").find("select").attr("disabled",!1)),saswp_enable_rating_review()}).change(),e(".saswp-checkbox").change(function(){var s=e(this).attr("id"),a=e(this);switch(s){case"saswp-the-seo-framework-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-the-seo-framework").val(1):e("#saswp-the-seo-framework").val(0);break;case"saswp-seo-press-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-seo-press").val(1):e("#saswp-seo-press").val(0);break;case"saswp-aiosp-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-aiosp").val(1):e("#saswp-aiosp").val(0);break;case"saswp-smart-crawl-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-smart-crawl").val(1):e("#saswp-smart-crawl").val(0);break;case"saswp-squirrly-seo-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-squirrly-seo").val(1):e("#saswp-squirrly-seo").val(0);break;case"saswp-wp-recipe-maker-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wp-recipe-maker").val(1):e("#saswp-wp-recipe-maker").val(0);break;case"saswp-wpsso-core-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wpsso-core").val(1):e("#saswp-wpsso-core").val(0);break;case"saswp-for-wordpress-checkbox":e(this).is(":checked")?e("#saswp-for-wordpress").val(1):e("#saswp-for-wordpress").val(0);break;case"saswp-facebook-enable-checkbox":e(this).is(":checked")?(e("#saswp-facebook-enable").val(1),e("#sd_facebook").show()):(e("#saswp-facebook-enable").val(0),e("#sd_facebook").hide());break;case"saswp-twitter-enable-checkbox":e(this).is(":checked")?(e("#saswp-twitter-enable").val(1),e("#sd_twitter").show()):(e("#saswp-twitter-enable").val(0),e("#sd_twitter").hide());break;case"saswp-google-plus-enable-checkbox":e(this).is(":checked")?(e("#saswp-google-plus-enable").val(1),e("#sd_google_plus").show()):(e("#saswp-google-plus-enable").val(0),e("#sd_google_plus").hide());break;case"saswp-instagram-enable-checkbox":e(this).is(":checked")?(e("#saswp-instagram-enable").val(1),e("#sd_instagram").show()):(e("#saswp-instagram-enable").val(0),e("#sd_instagram").hide());break;case"saswp-youtube-enable-checkbox":e(this).is(":checked")?(e("#sd_youtube").show(),e("#saswp-youtube-enable").val(1)):(e("#saswp-youtube-enable").val(0),e("#sd_youtube").hide());break;case"saswp-linkedin-enable-checkbox":e(this).is(":checked")?(e("#saswp-linkedin-enable").val(1),e("#sd_linkedin").show()):(e("#saswp-linkedin-enable").val(0),e("#sd_linkedin").hide());break;case"saswp-pinterest-enable-checkbox":e(this).is(":checked")?(e("#saswp-pinterest-enable").val(1),e("#sd_pinterest").show()):(e("#saswp-pinterest-enable").val(0),e("#sd_pinterest").hide());break;case"saswp-soundcloud-enable-checkbox":e(this).is(":checked")?(e("#saswp-soundcloud-enable").val(1),e("#sd_soundcloud").show()):(e("#saswp-soundcloud-enable").val(0),e("#sd_soundcloud").hide());break;case"saswp-tumblr-enable-checkbox":e(this).is(":checked")?(e("#saswp-tumblr-enable").val(1),e("#sd_tumblr").show()):(e("#saswp-tumblr-enable").val(0),e("#sd_tumblr").hide());break;case"saswp-yelp-enable-checkbox":e(this).is(":checked")?(e("#saswp-yelp-enable").val(1),e("#sd_yelp").show()):(e("#saswp-yelp-enable").val(0),e("#sd_yelp").hide());break;case"saswp-for-amp-checkbox":e(this).is(":checked")?e("#saswp-for-amp").val(1):e("#saswp-for-amp").val(0);break;case"saswp_kb_contact_1_checkbox":e(this).is(":checked")?(e("#saswp_kb_contact_1").val(1),e("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").removeClass("saswp-display-none")):(e("#saswp_kb_contact_1").val(0),e("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").addClass("saswp-display-none"));break;case"saswp-logo-dimensions-check":e(this).is(":checked")?(e("#saswp-logo-dimensions").val(1),e("#saswp-logo-width, #saswp-logo-height").parent().parent("li").show()):(e("#saswp-logo-dimensions").val(0),e("#saswp-logo-width, #saswp-logo-height").parent().parent("li").hide());break;case"saswp_archive_schema_checkbox":e(this).is(":checked")?(e("#saswp_archive_schema").val(1),e(".saswp_archive_schema_type_class").parent().parent().show()):(e("#saswp_archive_schema").val(0),e(".saswp_archive_schema_type_class").parent().parent().hide());break;case"saswp_website_schema_checkbox":e(this).is(":checked")?(e("#saswp_website_schema").val(1),e("#saswp_search_box_schema").parent().parent().show()):(e("#saswp_website_schema").val(0),e("#saswp_search_box_schema").parent().parent().hide());break;case"saswp_search_box_schema_checkbox":e(this).is(":checked")?e("#saswp_search_box_schema").val(1):e("#saswp_search_box_schema").val(0);break;case"saswp_breadcrumb_schema_checkbox":e(this).is(":checked")?e("#saswp_breadcrumb_schema").val(1):e("#saswp_breadcrumb_schema").val(0);break;case"saswp_comments_schema_checkbox":e(this).is(":checked")?e("#saswp_comments_schema").val(1):e("#saswp_comments_schema").val(0);break;case"saswp-compativility-checkbox":e(this).is(":checked")?e("#saswp-flexmlx-compativility").val(1):e("#saswp-flexmlx-compativility").val(0);break;case"saswp-review-module-checkbox":e(this).is(":checked")?e("#saswp-review-module").val(1):e("#saswp-review-module").val(0);break;case"saswp-kk-star-raring-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-kk-star-raring").val(1):e("#saswp-kk-star-raring").val(0);break;case"saswp-woocommerce-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-woocommerce").val(1):e("#saswp-woocommerce").val(0);break;case"saswp-extra-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-extra").val(1):e("#saswp-extra").val(0);break;case"saswp-dw-question-answer-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-dw-question-answer").val(1):e("#saswp-dw-question-answer").val(0);break;case"saswp-wp-job-manager-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wp-job-manager").val(1):e("#saswp-wp-job-manager").val(0);break;case"saswp-yoast-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-yoast").val(1):e("#saswp-yoast").val(0);break;case"saswp-rankmath-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-rankmath").val(1):e("#saswp-rankmath").val(0);break;case"saswp-tagyeem-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-tagyeem").val(1):e("#saswp-tagyeem").val(0);break;case"saswp-the-events-calendar-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-the-events-calendar").val(1):e("#saswp-the-events-calendar").val(0);break;case"saswp-homeland-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-homeland").val(1):e("#saswp-homeland").val(0);break;case"saswp-realhomes-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-realhomes").val(1):e("#saswp-realhomes").val(0);break;case"saswp-woocommerce-booking-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?(e("#saswp-woocommerce-booking").val(1),e("#saswp-woocommerce-booking-main").val(1)):(e("#saswp-woocommerce-booking").val(0),e("#saswp-woocommerce-booking-main").val(0));break;case"saswp-woocommerce-booking-main-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?(e("#saswp-woocommerce-booking-main").val(1),e("#saswp-woocommerce-booking").val(1)):(e("#saswp-woocommerce-booking-main").val(0),e("#saswp-woocommerce-booking").val(0));break;case"saswp-woocommerce-membership-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-woocommerce-membership").val(1):e("#saswp-woocommerce-membership").val(0);break;case"saswp-defragment-checkbox":e(this).is(":checked")?e("#saswp-defragment").val(1):e("#saswp-defragment").val(0);break;case"saswp-cooked-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-cooked").val(1):e("#saswp-cooked").val(0);break;case"saswp-flexmlx-compativility-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-flexmlx-compativility").val(1):e("#saswp-flexmlx-compativility").val(0);break;case"saswp-shopper-approved-review-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?(e("#saswp-shopper-approved-review").val(1),e(".saswp-s-reviews-settings-table").parent().parent().parent().show()):(e("#saswp-shopper-approved-review").val(0),e(".saswp-s-reviews-settings-table").parent().parent().parent().hide());break;case"saswp-google-review-checkbox":e(this).is(":checked")?(e("#saswp-google-review").val(1),e("#saswp-google-rv-free-checkbox").length?(e("#saswp-google-review-free").parent().parent().show(),e("#saswp-google-rv-free-checkbox").is(":checked")?e("#saswp_google_place_api_key").parent().parent().show():e("#saswp_google_place_api_key").parent().parent().hide()):e("#saswp_google_place_api_key").parent().parent().show(),e(".saswp-g-reviews-settings-table").parent().parent().parent().show()):(e("#saswp-google-review").val(0),e("#saswp_google_place_api_key").parent().parent().hide(),e(".saswp-g-reviews-settings-table").parent().parent().parent().hide(),e("#saswp-google-rv-free-checkbox").length&&e("#saswp-google-review-free").parent().parent().hide());break;case"saswp-google-rv-free-checkbox":e("#saswp-google-review-checkbox").is(":checked")&&e(this).is(":checked")?(e("#saswp-google-review-free").val(1),e("#saswp_google_place_api_key").parent().parent().show()):(e("#saswp-google-review-free").val(0),e("#saswp_google_place_api_key").parent().parent().hide());break;case"saswp-markup-footer-checkbox":e(this).is(":checked")?e("#saswp-markup-footer").val(1):e("#saswp-markup-footer").val(0);break;case"saswp-pretty-print-checkbox":e(this).is(":checked")?e("#saswp-pretty-print").val(1):e("#saswp-pretty-print").val(0);break;case"saswp-wppostratings-raring-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-wppostratings-raring").val(1):e("#saswp-wppostratings-raring").val(0);break;case"saswp-bbpress-checkbox":saswp_compatibliy_notes(a,s),e(this).is(":checked")?e("#saswp-bbpress").val(1):e("#saswp-bbpress").val(0);break;case"saswp-microdata-cleanup-checkbox":e(this).is(":checked")?e("#saswp-microdata-cleanup").val(1):e("#saswp-microdata-cleanup").val(0)}}).change(),e("#saswp_kb_type").change(function(){var s=e(this).val();e(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass("saswp_hide"),e(".saswp_kg_logo").parent().parent().parent().addClass("saswp_hide"),e("#sd-person-image").parent().parent().parent().addClass("saswp_hide"),"Organization"==s&&(e(".saswp_org_fields").parent().parent().removeClass("saswp_hide"),e(".saswp_person_fields").parent().parent().addClass("saswp_hide"),e(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),e("#sd-person-image").parent().parent().parent().addClass("saswp_hide")),"Person"==s&&(e(".saswp_org_fields").parent().parent().addClass("saswp_hide"),e(".saswp_person_fields").parent().parent().removeClass("saswp_hide"),e(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),e("#sd-person-image").parent().parent().parent().removeClass("saswp_hide"))}).change(),e(document).on("click","input[data-id=media]",function(s){s.preventDefault();var a=e(this),t=a.attr("id").replace("_button",""),i=wp.media({title:"Application Icon",button:{text:"Select Icon"},multiple:!1,library:{type:"image"}}).on("select",function(){var s=i.state().get("selection").first().toJSON();e("#"+t).val(s.url),e("input[data-id='"+t+"_id']").val(s.id),e("input[data-id='"+t+"_height']").val(s.height),e("input[data-id='"+t+"_width']").val(s.width),e("input[data-id='"+t+"_thumbnail']").val(s.url),"sd_default_image_button"===a.attr("id")&&(e("#sd_default_image_width").val(s.width),e("#sd_default_image_height").val(s.height));var o="";"saswp_image_div_"+t=="saswp_image_div_sd_default_image"&&s.height<1200&&(o='<p class="saswp_warning">Image size is smaller than recommended size</p>'),e(".saswp_image_div_"+t).html('<div class="saswp_image_thumbnail"><img class="saswp_image_prev" src="'+s.url+'"/><a data-id="'+t+'" href="#" class="saswp_prev_close">X</a></div>'+o)}).open()}),e(document).on("click",".saswp_prev_close",function(s){s.preventDefault();var a=e(this).attr("data-id");console.log(a),e(this).parent().remove(),e("#"+a).val(""),e("input[data-id='"+a+"_id']").val(""),e("input[data-id='"+a+"_height']").val(""),e("input[data-id='"+a+"_width']").val(""),e("input[data-id='"+a+"_thumbnail']").val(""),"sd_default_image"===a&&(e("#sd_default_image_width").val(""),e("#sd_default_image_height").val(""))}),e(document).on("change",".saswp-schema-type-toggle",function(s){var a=e(this).attr("data-schema-id"),t=e(this).attr("data-post-id");if(e(this).is(":checked"))var i=1;else i=0;e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_enable_disable_schema_on_post",status:i,schema_id:a,post_id:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){},error:function(e){console.log(e)}})}),e(document).on("click",".saswp-reset-data",function(s){s.preventDefault(),1==confirm("Are you sure?")&&e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_reset_all_settings",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){setTimeout(function(){location.reload()},1e3)},error:function(e){console.log(e)}})}),e(document).on("click",".saswp_license_activation",function(s){s.preventDefault();var a=e(this);a.addClass("updating-message");var t=e(this).attr("license-status"),i=e(this).attr("add-on"),o=e("#"+i+"_addon_license_key").val();t&&i&&o?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_license_status_check",license_key:o,license_status:t,add_on:i,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){e("#"+i+"_addon_license_key_status").val(s.status),"active"==s.status?(e(".saswp-"+i+"-dashicons").addClass("dashicons-yes"),e(".saswp-"+i+"-dashicons").removeClass("dashicons-no-alt"),e(".saswp-"+i+"-dashicons").css("color","green"),e(".saswp_license_activation[add-on='"+i+"']").attr("license-status","inactive"),e(".saswp_license_activation[add-on='"+i+"']").text("Deactivate"),e(".saswp_license_status_msg[add-on='"+i+"']").text("Activated"),e(".saswp_license_status_msg[add-on='"+i+"']").css("color","green"),e(".saswp_license_status_msg[add-on='"+i+"']").text(s.message)):(e(".saswp-"+i+"-dashicons").addClass("dashicons-no-alt"),e(".saswp-"+i+"-dashicons").removeClass("dashicons-yes"),e(".saswp-"+i+"-dashicons").css("color","red"),e(".saswp_license_activation[add-on='"+i+"']").attr("license-status","active"),e(".saswp_license_activation[add-on='"+i+"']").text("Activate"),e(".saswp_license_status_msg[add-on='"+i+"']").css("color","red"),e(".saswp_license_status_msg[add-on='"+i+"']").text(s.message)),a.removeClass("updating-message")},error:function(e){console.log(e)}}):(alert("Please enter value license key"),a.removeClass("updating-message"))}),e(".saswp-send-query").on("click",function(s){s.preventDefault();var a=e("#saswp_query_message").val();""!=e.trim(a)?e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_send_query_message",message:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){"t"==s.status?(e(".saswp-query-success").show(),e(".saswp-query-error").hide()):(console.log("dd"),e(".saswp-query-success").hide(),e(".saswp-query-error").show())},error:function(e){console.log(e)}}):alert("Please enter the message")}),e(".saswp-import-plugins").on("click",function(s){s.preventDefault();var a=e(this);a.addClass("updating-message");var t=e(this).attr("data-id");e.get(ajaxurl,{action:"saswp_import_plugin_data",plugin_name:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){"t"==s.status?(e(a).parent().find(".saswp-imported-message").text(s.message),e(a).parent().find(".saswp-imported-message").removeClass("saswp-error"),setTimeout(function(){location.reload()},2e3)):(e(a).parent().find(".saswp-imported-message").addClass("saswp-error"),e(a).parent().find(".saswp-imported-message").text(s.message)),a.removeClass("updating-message")},"json")}),e(".saswp-feedback-no-thanks").on("click",function(s){s.preventDefault(),e.get(ajaxurl,{action:"saswp_feeback_no_thanks",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){"t"==s.status&&e(".saswp-feedback-notice").hide()},"json")}),e(".saswp-feedback-remindme").on("click",function(s){s.preventDefault(),e.get(ajaxurl,{action:"saswp_feeback_remindme",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){"t"==s.status&&e(".saswp-feedback-notice").hide()},"json")}),e(document).on("change",".saswp-local-business-type-select",function(s){s.preventDefault();var a=e(this),t=e(this).val();e.get(ajaxurl,{action:"saswp_get_sub_business_ajax",business_type:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){if("t"==s.status){e(".saswp-local-business-name-select").parents("tr").remove();var t=a.parents(".saswp-post-specific-wrapper").attr("data-id"),i='<tr><th><label for="saswp_business_name_'+t+'">Sub Business Type</label></th>';i+='<td><select class="saswp-local-business-name-select" id="saswp_business_name_'+t+'" name="saswp_business_name_'+t+'">',e.each(s.result,function(e,s){i+='<option value="'+e+'">'+s+"</option>"}),i+="</select></td>",i+="</tr>",a.parents(".form-table tr:first").after(i)}else e(".saswp-local-business-name-select").parents("tr").remove()},"json")}),saswp_item_reviewed_call(),e(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"}),e(document).on("click",".saswp-add-custom-schema",function(s){s.preventDefault(),e(".saswp-add-custom-schema-field").removeClass("saswp_hide"),e(this).hide()}),e(document).on("click",".saswp-delete-custom-schema",function(s){s.preventDefault(),e("#saswp_custom_schema_field").val(""),e(".saswp-add-custom-schema-field").addClass("saswp_hide"),e(".saswp-add-custom-schema").show()}),e(".saswp-modify_schema_post_enable").on("click",function(s){var a=e(this);a.addClass("updating-message"),s.preventDefault(),e.get(ajaxurl,{action:"saswp_modify_schema_post_enable",post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){a.remove(),e(".saswp-add-custom-schema-div").remove(),e("#post_specific .inside").append(s),a.removeClass("updating-message"),saswpAddTimepicker(),saswp_schema_datepicker(),saswp_enable_rating_review(),saswp_item_reviewed_call()})}),saswp_schema_datepicker(),saswp_reviews_datepicker(),e(document).on("click",".saswp-add-more-item",function(s){s.preventDefault();var a=e(".saswp-review-item-list-table tr").length;console.log(a);e(".saswp-review-item-list-table").append('<tr class="saswp-review-item-tr"><td>Review Item Feature</td><td><input type="text" name="saswp-review-item-feature[]"></td><td>Rating</td><td><input step="0.1" min="0" max="5" type="number" name="saswp-review-item-star-rating[]"></td><td><a type="button" class="saswp-remove-review-item button">x</a></td></tr>')}),e(document).on("click",".saswp-remove-review-item",function(s){s.preventDefault(),e(this).parent().parent("tr").remove()}),e(document).on("focusout",".saswp-review-item-tr input[type=number]",function(s){s.preventDefault();var a=0,t=e(".saswp-review-item-tr input[type=number]").length;e(".saswp-review-item-tr input[type=number]").each(function(s,t){""==e(t).val()?a+=parseFloat(0):a+=parseFloat(e(t).val())});var i=a/t;e("#saswp-review-item-over-all").val(i)}),e("#saswp-review-location").change(function(){var s=e(this).val();e(".saswp-review-shortcode").addClass("saswp_hide"),3==s&&e(".saswp-review-shortcode").removeClass("saswp_hide")}).change(),e("#saswp-review-item-enable").change(function(){e(this).is(":checked")?e(".saswp-review-fields").show():e(".saswp-review-fields").hide()}).change(),e(document).on("click",".saswp-restore-post-schema",function(s){s.preventDefault();var a=e(this);if(a.addClass("updating-message"),e(".saswp-post-specific-schema-ids").val())var t=JSON.parse(e(".saswp-post-specific-schema-ids").val());e.post(ajaxurl,{action:"saswp_restore_schema",schema_ids:t,post_id:saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){"t"==e.status?setTimeout(function(){location.reload()},1e3):(alert(e.msg),setTimeout(function(){location.reload()},1e3)),a.removeClass("updating-message")},"json")}),e(document).on("click","div.saswp-tab ul.saswp-tab-nav a",function(s){s.preventDefault();var a=e(this).attr("data-id");e(".saswp-post-specific-wrapper").hide(),e("#"+a).show(),e("div.saswp-tab ul.saswp-tab-nav a").removeClass("selected"),e("div.saswp-tab ul.saswp-tab-nav li").removeClass("selected"),e(this).addClass("selected"),e(this).parent().addClass("selected"),saswp_enable_rating_review()}),e("#saswp-global-tabs a:first").addClass("saswp-global-selected"),e(".saswp-global-container").hide(),"#saswp-default-container"==window.location.hash?e(".saswp-global-container:eq(2)").show():e(".saswp-global-container:first").show(),e("#saswp-global-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-global-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-global-container").hide(),e("#"+s).show())}),e("#saswp-tools-tabs a:first").addClass("saswp-global-selected"),e(".saswp-tools-container").hide(),e(".saswp-tools-container:first").show(),e("#saswp-tools-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-tools-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-tools-container").hide(),e("#"+s).show())}),e("#saswp-review-tabs a:first").addClass("saswp-global-selected"),e(".saswp-review-container").hide(),e(".saswp-review-container:first").show(),e("#saswp-review-tabs a").click(function(){var s=e(this).attr("data-id");e(this).hasClass("saswp-global-selected")||(e("#saswp-review-tabs a").removeClass("saswp-global-selected"),e(this).addClass("saswp-global-selected"),e(".saswp-review-container").hide(),e("#"+s).show())}),e('a[href="'+saswp_localize_data.new_url_selector+'"]').attr("href",saswp_localize_data.new_url_href),e("#saswp_enable_custom_field").change(function(){e(this).is(":checked")?e(".saswp-custom-fields-div").show():e(".saswp-custom-fields-div").hide()}),e(document).on("change",".saswp-custom-fields-name",function(){var s="text",a=e(this).parent().parent("tr"),t=e(this).val();-1==t.indexOf("image")&&-1==t.indexOf("logo")||(s="image"),saswp_get_meta_list(null,s,null,e(this).parent().parent("tr").find("td:eq(1)"),t,a)}),e(document).on("click",".saswp-skip-button",function(s){s.preventDefault(),e(this).parent().parent().hide(),e.post(ajaxurl,{action:"saswp_skip_wizard",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){},"json")}),e(document).on("click",".saswp_add_schema_fields_on_fly",function(s){s.preventDefault();var a=e(this);a.addClass("updating-message");var t=e(this).attr("data-id"),i=e(this).attr("fields_type"),o=e(this).attr("div_type"),n=e(".saswp-"+o+"-table-div").length,p=e(".saswp-"+o+"-table-div:nth-child("+n+")").attr("data-id");(p=++p)||(p=0),saswp_get_post_specific_schema_fields(a,p,i,o,t,i+"_")}),e(document).on("click",".saswp-table-close",function(){e(this).parent().remove()}),e(document).on("click",".saswp-rmv-modify_row",function(s){s.preventDefault(),e(this).parent().parent().remove()}),e(document).on("change",".saswp-custom-meta-list",function(){var s=e(this),a=e("select#schema_type option:selected").val(),t=e(this).val(),i=e(this).parent().parent("tr").find(".saswp-custom-fields-name").val(),o="",n=a.toLowerCase()+"_"+i,p="saswp_fixed_image["+i+"]";"manual_text"==t?(o+='<td><input type="text" name="saswp_fixed_text['+i+']"></td>',o+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(o),saswpCustomSelect2()):"taxonomy_term"==t?saswp_taxonomy_term.taxonomy?(o+=saswp_taxonomy_term_html(saswp_taxonomy_term.taxonomy,i),s.parent().parent("tr").find("td:gt(1)").remove(),s.parent().parent("tr").append(o),saswpCustomSelect2()):e.get(ajaxurl,{action:"saswp_get_taxonomy_term_list",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(e){e&&(saswp_taxonomy_term.taxonomy=e,o+=saswp_taxonomy_term_html(e,i),s.parent().parent("tr").find("td:gt(1)").remove(),s.parent().parent("tr").append(o),saswpCustomSelect2())},"json"):"custom_field"==t?(o+='<td><select class="saswp-custom-fields-select2" name="saswp_custom_meta_field['+i+']">',o+="</select></td>",o+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(o),saswpCustomSelect2()):"fixed_image"==t?(o+="<td>",o+="<fieldset>",o+='<input data-id="media" style="width: 30%;" class="button" id="'+n+'_button" name="'+n+'_button" type="button" value="Upload" />',o+='<input type="hidden" data-id="'+n+'_height" class="upload-height" name="'+p+'[height]" id="'+n+'_height" value="">',o+='<input type="hidden" data-id="'+n+'_width" class="upload-width" name="'+p+'[width]" id="'+n+'_width" value="">',o+='<input type="hidden" data-id="'+n+'_thumbnail" class="upload-thumbnail" name="'+p+'[thumbnail]" id="'+n+'_thumbnail" value="">',o+='<div class="saswp_image_div_'+n+'">',o+="</div>",o+="</fieldset>",o+="</td>",o+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(o),saswpCustomSelect2()):(o+="<td></td>",o+='<td><a class="button button-default saswp-rmv-modify_row">X</a></td>',e(this).parent().parent("tr").find("td:gt(1)").remove(),e(this).parent().parent("tr").append(o),saswpCustomSelect2())}),e(document).on("change",".saswp-item-reivewed-list",function(){e(".saswp-custom-fields-table").html(""),saswp_meta_list_fields=[]}),e(document).on("click",".saswp-add-custom-fields",function(){var s=e(this);s.addClass("updating-message");var a=e("select#schema_type option:selected").val(),t="";"Review"==a&&(t=e("select.saswp-item-reivewed-list option:selected").val());var i=e("#post_ID").val();""!=a&&(saswp_meta_list_fields[a]?saswp_get_meta_list(s,"text",saswp_meta_list_fields[a],null,null,null):e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_get_schema_type_fields",post_id:i,schema_type:a,schema_subtype:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){saswp_meta_list_fields[a]=e,saswp_get_meta_list(s,"text",saswp_meta_list_fields[a],null,null,null)},error:function(e){console.log(e)}}))}),saswpCustomSelect2(),saswp_enable_rating_review(),e('a[href="'+saswp_localize_data.collection_post_add_url+'"]').attr("href",saswp_localize_data.collection_post_add_new_url),e(document).on("click",".saswp_coonect_google_place",function(){var s=e("#saswp_google_place_id").val(),a=e("#saswp_language_list").val(),t=e("#saswp_googel_api").val();""!=s&&e.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_connect_google_place",place_id:s,language:a,google_api:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(e){console.log(e.status)},error:function(e){console.log(e)}})}),"saswp"==saswp_localize_data.post_type&&"edit.php"==saswp_localize_data.page_now&&jQuery(jQuery(".wrap a")[0]).after("<a href='"+saswp_localize_data.saswp_settings_url+"' id='' class='page-title-action'>Settings</a>"),"undefined"!=typeof saswp_reviews_data&&e(".saswp-rating-div").rateYo({rating:saswp_reviews_data.rating_val,halfStar:!0,readOnly:saswp_reviews_data.readonly,onSet:function(s,a){e(this).next().val(s),console.log(s)}}),e("#sd-person-phone-number, #saswp_kb_telephone").focusout(function(){var s=e(this);s.parent().find(".saswp-phone-validation").remove();var a=e(this).val();/^\+([0-9]{1,3})\)?[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})[-. ]?([0-9]{2,4})$/.test(a)?s.parent().find(".saswp-phone-validation").remove():s.after('<span style="color:red;" class="saswp-phone-validation">Invalid Phone Number</span>')})});
admin_section/settings.php CHANGED
@@ -464,7 +464,38 @@ function saswp_premium_features_callback(){ ?>
464
  <?php echo $cooked_active_text; ?>
465
 
466
  </div>
467
- </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
  </ul>
469
  </div>
470
 
@@ -1379,11 +1410,11 @@ function saswp_import_callback(){
1379
  $add_on[] = 'Woocommerce';
1380
 
1381
  }
1382
- if(is_plugin_active('real-estate-schema/real-estate-schema.php')){
1383
 
1384
  $add_on[] = 'Res';
1385
 
1386
- }
1387
 
1388
  if(!empty($add_on)){
1389
 
464
  <?php echo $cooked_active_text; ?>
465
 
466
  </div>
467
+ </li>
468
+
469
+ <li>
470
+
471
+ <?php
472
+
473
+ $cooked_active_text = '';
474
+
475
+ if(is_plugin_active('real-estate-schema/real-estate-schema.php')){
476
+ $cooked_active_text = '<label class="saswp-sts-txt">Status :<span style="color:green;">Active</span></label>';
477
+ }else{
478
+ $cooked_active_text .='<label class="saswp-sts-txt">Status :<span>Inactive</span></label>';
479
+ $cooked_active_text .='<a target="_blank" href="http://structured-data-for-wp.com/extensions/real-estate-schema/"><span class="saswp-d-btn">Download</span></a>';
480
+ }
481
+
482
+ ?>
483
+
484
+ <div class="saswp-features-ele">
485
+ <div class="saswp-ele-ic" style="background: #ace;">
486
+ <img src="<?php echo SASWP_PLUGIN_URL; ?>/admin_section/images/real-estate-schema-wp.png">
487
+ </div>
488
+ <div class="saswp-ele-tlt">
489
+ <h3><?php echo esc_html__('Real Estate Schema','schema-and-structured-data-for-wp') ?></h3>
490
+ <p><?php echo esc_html__('Real Estate Schema extension is the number one solution to enhance your real estate website with the right structured data.','schema-and-structured-data-for-wp') ?></p>
491
+ </div>
492
+ </div>
493
+ <div class="saswp-sts-btn">
494
+
495
+ <?php echo $cooked_active_text; ?>
496
+
497
+ </div>
498
+ </li>
499
  </ul>
500
  </div>
501
 
1410
  $add_on[] = 'Woocommerce';
1411
 
1412
  }
1413
+ if(is_plugin_active('reviews-for-schema/reviews-for-schema.php')){
1414
 
1415
  $add_on[] = 'Res';
1416
 
1417
+ }
1418
 
1419
  if(!empty($add_on)){
1420
 
admin_section/structure_admin.php CHANGED
@@ -1165,6 +1165,8 @@ function saswp_custom_column_set( $column, $post_id ) {
1165
 
1166
  if($schema_type == 'local_business'){
1167
  echo 'LocalBusiness';
 
 
1168
  }else{
1169
  echo esc_attr($schema_type);
1170
  }
@@ -1366,6 +1368,16 @@ add_action('wp_ajax_saswp_import_plugin_data', 'saswp_import_plugin_data');
1366
 
1367
  function saswp_feeback_no_thanks(){
1368
 
 
 
 
 
 
 
 
 
 
 
1369
  $result = update_option( "saswp_activation_never", 'never');
1370
 
1371
  if($result){
@@ -1386,6 +1398,16 @@ add_action('wp_ajax_saswp_feeback_no_thanks', 'saswp_feeback_no_thanks');
1386
 
1387
  function saswp_feeback_remindme(){
1388
 
 
 
 
 
 
 
 
 
 
 
1389
  $result = update_option( "saswp_activation_date", date("Y-m-d"));
1390
 
1391
  if($result){
1165
 
1166
  if($schema_type == 'local_business'){
1167
  echo 'LocalBusiness';
1168
+ }else if($schema_type == 'qanda'){
1169
+ echo 'Q&A';
1170
  }else{
1171
  echo esc_attr($schema_type);
1172
  }
1368
 
1369
  function saswp_feeback_no_thanks(){
1370
 
1371
+ if ( ! current_user_can( 'manage_options' ) ) {
1372
+ return;
1373
+ }
1374
+ if ( ! isset( $_GET['saswp_security_nonce'] ) ){
1375
+ return;
1376
+ }
1377
+ if ( !wp_verify_nonce( $_GET['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
1378
+ return;
1379
+ }
1380
+
1381
  $result = update_option( "saswp_activation_never", 'never');
1382
 
1383
  if($result){
1398
 
1399
  function saswp_feeback_remindme(){
1400
 
1401
+ if ( ! current_user_can( 'manage_options' ) ) {
1402
+ return;
1403
+ }
1404
+ if ( ! isset( $_GET['saswp_security_nonce'] ) ){
1405
+ return;
1406
+ }
1407
+ if ( !wp_verify_nonce( $_GET['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
1408
+ return;
1409
+ }
1410
+
1411
  $result = update_option( "saswp_activation_date", date("Y-m-d"));
1412
 
1413
  if($result){
core/array-list/meta_list.php CHANGED
@@ -23,6 +23,12 @@ return apply_filters('saswp_modify_post_meta_list',
23
  'post_modified' => __( 'Last Modify Date', 'schema-and-structured-data-for-wp' ),
24
  ),
25
  ),
 
 
 
 
 
 
26
  array(
27
  'label' => __( 'Manual Field', 'schema-and-structured-data-for-wp' ),
28
  'meta-list' => array(
23
  'post_modified' => __( 'Last Modify Date', 'schema-and-structured-data-for-wp' ),
24
  ),
25
  ),
26
+ array(
27
+ 'label' => __( 'Taxonomy Term', 'schema-and-structured-data-for-wp' ),
28
+ 'meta-list' => array(
29
+ 'taxonomy_term' => __( 'Taxonomy Term', 'schema-and-structured-data-for-wp' ),
30
+ ),
31
+ ),
32
  array(
33
  'label' => __( 'Manual Field', 'schema-and-structured-data-for-wp' ),
34
  'meta-list' => array(
output/function.php CHANGED
@@ -642,12 +642,6 @@ function saswp_structure_data_access_scripts($data){
642
 
643
  }
644
 
645
- function sd_is_blog() {
646
-
647
- return ( is_author() || is_category() || is_tag() || is_date() || is_home() || is_single() ) && 'post' == get_post_type();
648
-
649
- }
650
-
651
  /**
652
  * Function to fetch schema's post meta by its id from database using get_post_meta function
653
  * @param type $schema_id
@@ -969,4 +963,51 @@ function saswp_wp_recipe_schema_json($recipe){
969
  }
970
 
971
  return $metadata;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
972
  }
642
 
643
  }
644
 
 
 
 
 
 
 
645
  /**
646
  * Function to fetch schema's post meta by its id from database using get_post_meta function
647
  * @param type $schema_id
963
  }
964
 
965
  return $metadata;
966
+ }
967
+
968
+ function saswp_append_fetched_reviews($input1){
969
+
970
+ global $post;
971
+
972
+ if(is_object($post)){
973
+
974
+ $pattern = get_shortcode_regex();
975
+
976
+ if ( preg_match_all( '/'. $pattern .'/s', $post->post_content, $matches )
977
+ && array_key_exists( 2, $matches )
978
+ && in_array( 'saswp-reviews', $matches[2] ) )
979
+ {
980
+
981
+ $service = new saswp_reviews_service();
982
+
983
+ foreach ($matches[0] as $matche){
984
+
985
+ $mached = rtrim($matche, ']');
986
+ $mached = ltrim($mached, '[');
987
+ $mached = trim($mached);
988
+ $attr = shortcode_parse_atts('['.$mached.' ]');
989
+
990
+ $reviews = $service->saswp_get_reviews_by_attr($attr);
991
+
992
+ if($reviews){
993
+
994
+ $rv_markup = $service->saswp_get_reviews_schema_markup($reviews);
995
+
996
+ if(isset($input1['review'])){
997
+
998
+ $input1['review'] = array_merge($input1['review'], $rv_markup['review']);
999
+
1000
+ }else{
1001
+ $input1 = array_merge($input1, $rv_markup);
1002
+ }
1003
+
1004
+ }
1005
+
1006
+ }
1007
+
1008
+ }
1009
+
1010
+
1011
+ }
1012
+ return $input1;
1013
  }
output/output.php CHANGED
@@ -351,6 +351,8 @@ function saswp_schema_output() {
351
  $input1['author']['@type'] = 'Organization';
352
  $input1['offers']['@type'] = 'Offer';
353
 
 
 
354
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
355
  $service = new saswp_output_service();
356
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -379,7 +381,9 @@ function saswp_schema_output() {
379
  $input1['@type'] = 'TVSeries';
380
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#TVSeries';
381
  $input1['author']['@type'] = 'Person';
382
-
 
 
383
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
384
  $service = new saswp_output_service();
385
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -392,7 +396,9 @@ function saswp_schema_output() {
392
  $input1['@context'] = saswp_context_url();
393
  $input1['@type'] = 'HowTo';
394
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#HowTo';
395
- $input1['estimatedCost']['@type'] = 'MonetaryAmount';
 
 
396
 
397
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
398
  $service = new saswp_output_service();
@@ -464,6 +470,8 @@ function saswp_schema_output() {
464
  $input1['@type'] = 'MusicPlaylist';
465
  $input1['@id'] = trailingslashit(get_permalink()).'#MusicPlaylist';
466
 
 
 
467
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
468
  $service = new saswp_output_service();
469
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -479,6 +487,8 @@ function saswp_schema_output() {
479
  $input1['@type'] = 'Book';
480
  $input1['@id'] = trailingslashit(get_permalink()).'#Book';
481
 
 
 
482
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
483
  $service = new saswp_output_service();
484
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -495,6 +505,8 @@ function saswp_schema_output() {
495
  $input1['@type'] = 'MusicAlbum';
496
  $input1['@id'] = trailingslashit(get_permalink()).'#MusicAlbum';
497
 
 
 
498
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
499
  $service = new saswp_output_service();
500
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
@@ -779,11 +791,7 @@ function saswp_schema_output() {
779
  $input1 = array_merge($input1, $publisher);
780
 
781
  }
782
-
783
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
784
- $service = new saswp_output_service();
785
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
786
- }
787
  if(!empty($aggregateRating)){
788
  $input1['aggregateRating'] = $aggregateRating;
789
  }
@@ -792,7 +800,14 @@ function saswp_schema_output() {
792
  }
793
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
794
  $input1['comment'] = saswp_get_comments(get_the_ID());
795
- }
 
 
 
 
 
 
 
796
 
797
  $input1 = apply_filters('saswp_modify_audio_object_schema_output', $input1 );
798
  }
@@ -821,11 +836,7 @@ function saswp_schema_output() {
821
  $input1['@context'] = saswp_context_url();
822
  $input1['@type'] = $event_type ? $event_type : $schema_type;
823
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#event';
824
-
825
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
826
- $service = new saswp_output_service();
827
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
828
- }
829
  if(!empty($aggregateRating)){
830
  $input1['aggregateRating'] = $aggregateRating;
831
  }
@@ -834,7 +845,14 @@ function saswp_schema_output() {
834
  }
835
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
836
  $input1['comment'] = saswp_get_comments(get_the_ID());
837
- }
 
 
 
 
 
 
 
838
 
839
  }
840
 
@@ -856,15 +874,9 @@ function saswp_schema_output() {
856
  );
857
 
858
 
859
- if(!empty($publisher)){
860
-
861
- $input1 = array_merge($input1, $publisher);
862
-
863
- }
864
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
865
- $service = new saswp_output_service();
866
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
867
- }
868
  if(!empty($aggregateRating)){
869
  $input1['aggregateRating'] = $aggregateRating;
870
  }
@@ -872,9 +884,16 @@ function saswp_schema_output() {
872
  $input1 = array_merge($input1, $extra_theme_review);
873
  }
874
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
875
- $input1['comment'] = saswp_get_comments(get_the_ID());
876
  }
877
 
 
 
 
 
 
 
 
878
  $input1 = apply_filters('saswp_modify_software_application_schema_output', $input1 );
879
  }
880
 
@@ -977,15 +996,9 @@ function saswp_schema_output() {
977
 
978
  );
979
 
980
- if(!empty($publisher)){
981
-
982
- $input1['mainEntity'] = array_merge($input1['mainEntity'], $publisher);
983
-
984
- }
985
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
986
- $service = new saswp_output_service();
987
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
988
- }
989
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
990
  $input1['comment'] = saswp_get_comments(get_the_ID());
991
  }
@@ -996,6 +1009,12 @@ function saswp_schema_output() {
996
  $input1 = array_merge($input1, $extra_theme_review);
997
  }
998
 
 
 
 
 
 
 
999
 
1000
  }
1001
 
@@ -1031,7 +1050,9 @@ function saswp_schema_output() {
1031
 
1032
  $service = new saswp_output_service();
1033
  $input1 = $service->saswp_schema_markup_generator($schema_type);
1034
-
 
 
1035
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1036
 
1037
  $service = new saswp_output_service();
@@ -1104,13 +1125,6 @@ function saswp_schema_output() {
1104
  $input1['@context'] = saswp_context_url();
1105
  $input1['@type'] = $schema_type;
1106
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#service';
1107
-
1108
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] == 1){
1109
-
1110
- $service = new saswp_output_service();
1111
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1112
-
1113
- }
1114
 
1115
  if(!empty($aggregateRating)){
1116
  $input1['aggregateRating'] = $aggregateRating;
@@ -1119,6 +1133,15 @@ function saswp_schema_output() {
1119
  $input1 = array_merge($input1, $extra_theme_review);
1120
  }
1121
 
 
 
 
 
 
 
 
 
 
1122
  $input1 = apply_filters('saswp_modify_service_schema_output', $input1 );
1123
  }
1124
 
@@ -1238,11 +1261,7 @@ function saswp_schema_output() {
1238
 
1239
  $input1 = array_merge($input1, $publisher);
1240
 
1241
- }
1242
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1243
- $service = new saswp_output_service();
1244
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1245
- }
1246
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
1247
  $input1['comment'] = saswp_get_comments(get_the_ID());
1248
  }
@@ -1252,6 +1271,13 @@ function saswp_schema_output() {
1252
  if(!empty($extra_theme_review)){
1253
  $input1 = array_merge($input1, $extra_theme_review);
1254
  }
 
 
 
 
 
 
 
1255
 
1256
  $input1 = apply_filters('saswp_modify_video_object_schema_output', $input1 );
1257
  }
@@ -1279,17 +1305,21 @@ function saswp_schema_output() {
1279
  '@id' => trailingslashit(saswp_get_permalink()).'#'. strtolower(esc_attr($local_business)),
1280
  'url' => trailingslashit(saswp_get_permalink()),
1281
  );
1282
- if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] == 1){
1283
- $service = new saswp_output_service();
1284
- $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1285
- }
1286
  if(!empty($aggregateRating)){
1287
  $input1['aggregateRating'] = $aggregateRating;
1288
  }
1289
  if(!empty($extra_theme_review)){
1290
  $input1 = array_merge($input1, $extra_theme_review);
1291
  }
1292
-
 
 
 
 
 
 
 
1293
  $input1 = apply_filters('saswp_modify_local_business_schema_output', $input1 );
1294
  }
1295
 
351
  $input1['author']['@type'] = 'Organization';
352
  $input1['offers']['@type'] = 'Offer';
353
 
354
+ $input1 = saswp_append_fetched_reviews($input1);
355
+
356
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
357
  $service = new saswp_output_service();
358
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
381
  $input1['@type'] = 'TVSeries';
382
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#TVSeries';
383
  $input1['author']['@type'] = 'Person';
384
+
385
+ $input1 = saswp_append_fetched_reviews($input1);
386
+
387
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
388
  $service = new saswp_output_service();
389
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
396
  $input1['@context'] = saswp_context_url();
397
  $input1['@type'] = 'HowTo';
398
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#HowTo';
399
+ $input1['estimatedCost']['@type'] = 'MonetaryAmount';
400
+
401
+ $input1 = saswp_append_fetched_reviews($input1);
402
 
403
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
404
  $service = new saswp_output_service();
470
  $input1['@type'] = 'MusicPlaylist';
471
  $input1['@id'] = trailingslashit(get_permalink()).'#MusicPlaylist';
472
 
473
+ $input1 = saswp_append_fetched_reviews($input1);
474
+
475
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
476
  $service = new saswp_output_service();
477
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
487
  $input1['@type'] = 'Book';
488
  $input1['@id'] = trailingslashit(get_permalink()).'#Book';
489
 
490
+ $input1 = saswp_append_fetched_reviews($input1);
491
+
492
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
493
  $service = new saswp_output_service();
494
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
505
  $input1['@type'] = 'MusicAlbum';
506
  $input1['@id'] = trailingslashit(get_permalink()).'#MusicAlbum';
507
 
508
+ $input1 = saswp_append_fetched_reviews($input1);
509
+
510
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
511
  $service = new saswp_output_service();
512
  $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
791
  $input1 = array_merge($input1, $publisher);
792
 
793
  }
794
+
 
 
 
 
795
  if(!empty($aggregateRating)){
796
  $input1['aggregateRating'] = $aggregateRating;
797
  }
800
  }
801
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
802
  $input1['comment'] = saswp_get_comments(get_the_ID());
803
+ }
804
+
805
+ $input1 = saswp_append_fetched_reviews($input1);
806
+
807
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
808
+ $service = new saswp_output_service();
809
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
810
+ }
811
 
812
  $input1 = apply_filters('saswp_modify_audio_object_schema_output', $input1 );
813
  }
836
  $input1['@context'] = saswp_context_url();
837
  $input1['@type'] = $event_type ? $event_type : $schema_type;
838
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#event';
839
+
 
 
 
 
840
  if(!empty($aggregateRating)){
841
  $input1['aggregateRating'] = $aggregateRating;
842
  }
845
  }
846
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
847
  $input1['comment'] = saswp_get_comments(get_the_ID());
848
+ }
849
+
850
+ $input1 = saswp_append_fetched_reviews($input1);
851
+
852
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
853
+ $service = new saswp_output_service();
854
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
855
+ }
856
 
857
  }
858
 
874
  );
875
 
876
 
877
+ if(!empty($publisher)){
878
+ $input1 = array_merge($input1, $publisher);
879
+ }
 
 
 
 
 
 
880
  if(!empty($aggregateRating)){
881
  $input1['aggregateRating'] = $aggregateRating;
882
  }
884
  $input1 = array_merge($input1, $extra_theme_review);
885
  }
886
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
887
+ $input1['comment'] = saswp_get_comments(get_the_ID());
888
  }
889
 
890
+ $input1 = saswp_append_fetched_reviews($input1);
891
+
892
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
893
+ $service = new saswp_output_service();
894
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
895
+ }
896
+
897
  $input1 = apply_filters('saswp_modify_software_application_schema_output', $input1 );
898
  }
899
 
996
 
997
  );
998
 
999
+ if(!empty($publisher)){
1000
+ $input1['mainEntity'] = array_merge($input1['mainEntity'], $publisher);
1001
+ }
 
 
 
 
 
 
1002
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
1003
  $input1['comment'] = saswp_get_comments(get_the_ID());
1004
  }
1009
  $input1 = array_merge($input1, $extra_theme_review);
1010
  }
1011
 
1012
+ $input1 = saswp_append_fetched_reviews($input1);
1013
+
1014
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1015
+ $service = new saswp_output_service();
1016
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1017
+ }
1018
 
1019
  }
1020
 
1050
 
1051
  $service = new saswp_output_service();
1052
  $input1 = $service->saswp_schema_markup_generator($schema_type);
1053
+
1054
+ $input1 = saswp_append_fetched_reviews($input1);
1055
+
1056
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1057
 
1058
  $service = new saswp_output_service();
1125
  $input1['@context'] = saswp_context_url();
1126
  $input1['@type'] = $schema_type;
1127
  $input1['@id'] = trailingslashit(saswp_get_permalink()).'#service';
 
 
 
 
 
 
 
1128
 
1129
  if(!empty($aggregateRating)){
1130
  $input1['aggregateRating'] = $aggregateRating;
1133
  $input1 = array_merge($input1, $extra_theme_review);
1134
  }
1135
 
1136
+ $input1 = saswp_append_fetched_reviews($input1);
1137
+
1138
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] == 1){
1139
+
1140
+ $service = new saswp_output_service();
1141
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1142
+
1143
+ }
1144
+
1145
  $input1 = apply_filters('saswp_modify_service_schema_output', $input1 );
1146
  }
1147
 
1261
 
1262
  $input1 = array_merge($input1, $publisher);
1263
 
1264
+ }
 
 
 
 
1265
  if(isset($sd_data['saswp_comments_schema']) && $sd_data['saswp_comments_schema'] ==1){
1266
  $input1['comment'] = saswp_get_comments(get_the_ID());
1267
  }
1271
  if(!empty($extra_theme_review)){
1272
  $input1 = array_merge($input1, $extra_theme_review);
1273
  }
1274
+
1275
+ $input1 = saswp_append_fetched_reviews($input1);
1276
+
1277
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1278
+ $service = new saswp_output_service();
1279
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1280
+ }
1281
 
1282
  $input1 = apply_filters('saswp_modify_video_object_schema_output', $input1 );
1283
  }
1305
  '@id' => trailingslashit(saswp_get_permalink()).'#'. strtolower(esc_attr($local_business)),
1306
  'url' => trailingslashit(saswp_get_permalink()),
1307
  );
1308
+
 
 
 
1309
  if(!empty($aggregateRating)){
1310
  $input1['aggregateRating'] = $aggregateRating;
1311
  }
1312
  if(!empty($extra_theme_review)){
1313
  $input1 = array_merge($input1, $extra_theme_review);
1314
  }
1315
+
1316
+ $input1 = saswp_append_fetched_reviews($input1);
1317
+
1318
+ if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] == 1){
1319
+ $service = new saswp_output_service();
1320
+ $input1 = $service->saswp_replace_with_custom_fields_value($input1, $schema_post_id);
1321
+ }
1322
+
1323
  $input1 = apply_filters('saswp_modify_local_business_schema_output', $input1 );
1324
  }
1325
 
output/output_post_specific.php CHANGED
@@ -251,6 +251,8 @@ function saswp_post_specific_schema_output() {
251
  $input1['track'] = $faq_question_arr;
252
  }
253
 
 
 
254
  }
255
 
256
  if( 'MusicAlbum' === $schema_type){
@@ -302,6 +304,8 @@ function saswp_post_specific_schema_output() {
302
  $input1['track'] = $faq_question_arr;
303
  }
304
 
 
 
305
  }
306
 
307
  if( 'JobPosting' === $schema_type){
@@ -518,7 +522,9 @@ function saswp_post_specific_schema_output() {
518
  $input1['aggregateRating']['ratingValue'] = $all_post_meta['saswp_book_rating_value_'.$schema_id];
519
  $input1['aggregateRating']['ratingCount'] = $all_post_meta['saswp_book_rating_count_'.$schema_id];
520
  }
521
-
 
 
522
  }
523
 
524
  if( 'TouristAttraction' === $schema_type){
@@ -870,6 +876,7 @@ function saswp_post_specific_schema_output() {
870
  }
871
 
872
  $input1['totalTime'] = saswp_remove_warnings($all_post_meta, 'saswp_howto_schema_totaltime_'.$schema_id, 'saswp_array');
 
873
 
874
  }
875
 
@@ -928,7 +935,9 @@ function saswp_post_specific_schema_output() {
928
  }
929
  $input1['containsSeason'] = $tool_arr;
930
  }
931
-
 
 
932
  }
933
 
934
  if( 'MedicalCondition' === $schema_type){
@@ -1056,7 +1065,7 @@ function saswp_post_specific_schema_output() {
1056
 
1057
  }
1058
 
1059
-
1060
 
1061
  }
1062
 
@@ -1209,7 +1218,9 @@ function saswp_post_specific_schema_output() {
1209
  if(!empty($extra_theme_review)){
1210
  $input1 = array_merge($input1, $extra_theme_review);
1211
  }
1212
-
 
 
1213
  }
1214
 
1215
  if( 'DiscussionForumPosting' === $schema_type){
@@ -1367,12 +1378,11 @@ function saswp_post_specific_schema_output() {
1367
  if(!empty($extra_theme_review)){
1368
  $input1 = array_merge($input1, $extra_theme_review);
1369
  }
 
1370
  }
1371
 
1372
  if( 'SoftwareApplication' === $schema_type){
1373
-
1374
-
1375
-
1376
  $input1 = array(
1377
  '@context' => saswp_context_url(),
1378
  '@type' => 'SoftwareApplication',
@@ -1417,6 +1427,7 @@ function saswp_post_specific_schema_output() {
1417
  if(!empty($extra_theme_review)){
1418
  $input1 = array_merge($input1, $extra_theme_review);
1419
  }
 
1420
  }
1421
 
1422
  if( 'WebPage' === $schema_type){
@@ -1733,6 +1744,7 @@ function saswp_post_specific_schema_output() {
1733
  if(!empty($extra_theme_review)){
1734
  $input1 = array_merge($input1, $extra_theme_review);
1735
  }
 
1736
  }
1737
 
1738
  if( 'Product' === $schema_type){
@@ -1855,7 +1867,8 @@ function saswp_post_specific_schema_output() {
1855
 
1856
  }
1857
  $input1['review'] = $reviews;
1858
- }
 
1859
  }
1860
 
1861
  if( 'NewsArticle' === $schema_type ){
@@ -1982,7 +1995,7 @@ function saswp_post_specific_schema_output() {
1982
  if(!empty($extra_theme_review)){
1983
  $input1 = array_merge($input1, $extra_theme_review);
1984
  }
1985
-
1986
  }
1987
 
1988
  if( 'Service' === $schema_type ){
@@ -2048,6 +2061,7 @@ function saswp_post_specific_schema_output() {
2048
  if(!empty($extra_theme_review)){
2049
  $input1 = array_merge($input1, $extra_theme_review);
2050
  }
 
2051
  }
2052
 
2053
  if( 'Review' === $schema_type ){
@@ -2412,7 +2426,7 @@ function saswp_post_specific_schema_output() {
2412
 
2413
  }
2414
 
2415
-
2416
  }
2417
 
2418
  global $without_aggregate;
251
  $input1['track'] = $faq_question_arr;
252
  }
253
 
254
+ $input1 = saswp_append_fetched_reviews($input1);
255
+
256
  }
257
 
258
  if( 'MusicAlbum' === $schema_type){
304
  $input1['track'] = $faq_question_arr;
305
  }
306
 
307
+ $input1 = saswp_append_fetched_reviews($input1);
308
+
309
  }
310
 
311
  if( 'JobPosting' === $schema_type){
522
  $input1['aggregateRating']['ratingValue'] = $all_post_meta['saswp_book_rating_value_'.$schema_id];
523
  $input1['aggregateRating']['ratingCount'] = $all_post_meta['saswp_book_rating_count_'.$schema_id];
524
  }
525
+
526
+ $input1 = saswp_append_fetched_reviews($input1);
527
+
528
  }
529
 
530
  if( 'TouristAttraction' === $schema_type){
876
  }
877
 
878
  $input1['totalTime'] = saswp_remove_warnings($all_post_meta, 'saswp_howto_schema_totaltime_'.$schema_id, 'saswp_array');
879
+ $input1 = saswp_append_fetched_reviews($input1);
880
 
881
  }
882
 
935
  }
936
  $input1['containsSeason'] = $tool_arr;
937
  }
938
+
939
+ $input1 = saswp_append_fetched_reviews($input1);
940
+
941
  }
942
 
943
  if( 'MedicalCondition' === $schema_type){
1065
 
1066
  }
1067
 
1068
+ $input1 = saswp_append_fetched_reviews($input1);
1069
 
1070
  }
1071
 
1218
  if(!empty($extra_theme_review)){
1219
  $input1 = array_merge($input1, $extra_theme_review);
1220
  }
1221
+
1222
+ $input1 = saswp_append_fetched_reviews($input1);
1223
+
1224
  }
1225
 
1226
  if( 'DiscussionForumPosting' === $schema_type){
1378
  if(!empty($extra_theme_review)){
1379
  $input1 = array_merge($input1, $extra_theme_review);
1380
  }
1381
+ $input1 = saswp_append_fetched_reviews($input1);
1382
  }
1383
 
1384
  if( 'SoftwareApplication' === $schema_type){
1385
+
 
 
1386
  $input1 = array(
1387
  '@context' => saswp_context_url(),
1388
  '@type' => 'SoftwareApplication',
1427
  if(!empty($extra_theme_review)){
1428
  $input1 = array_merge($input1, $extra_theme_review);
1429
  }
1430
+ $input1 = saswp_append_fetched_reviews($input1);
1431
  }
1432
 
1433
  if( 'WebPage' === $schema_type){
1744
  if(!empty($extra_theme_review)){
1745
  $input1 = array_merge($input1, $extra_theme_review);
1746
  }
1747
+ $input1 = saswp_append_fetched_reviews($input1);
1748
  }
1749
 
1750
  if( 'Product' === $schema_type){
1867
 
1868
  }
1869
  $input1['review'] = $reviews;
1870
+ }
1871
+ $input1 = saswp_append_fetched_reviews($input1);
1872
  }
1873
 
1874
  if( 'NewsArticle' === $schema_type ){
1995
  if(!empty($extra_theme_review)){
1996
  $input1 = array_merge($input1, $extra_theme_review);
1997
  }
1998
+ $input1 = saswp_append_fetched_reviews($input1);
1999
  }
2000
 
2001
  if( 'Service' === $schema_type ){
2061
  if(!empty($extra_theme_review)){
2062
  $input1 = array_merge($input1, $extra_theme_review);
2063
  }
2064
+ $input1 = saswp_append_fetched_reviews($input1);
2065
  }
2066
 
2067
  if( 'Review' === $schema_type ){
2426
 
2427
  }
2428
 
2429
+ $input1 = saswp_append_fetched_reviews($input1);
2430
  }
2431
 
2432
  global $without_aggregate;
output/service.php CHANGED
@@ -127,10 +127,8 @@ Class saswp_output_service{
127
 
128
  global $post;
129
 
130
- $fixed_image = get_post_meta($schema_post_id, 'saswp_fixed_image', true) ;
131
- $fixed_text = get_post_meta($schema_post_id, 'saswp_fixed_text', true) ;
132
- $cus_field = get_post_meta($schema_post_id, 'saswp_custom_meta_field', true);
133
-
134
  $response = null;
135
 
136
  switch ($field) {
@@ -183,6 +181,8 @@ Class saswp_output_service{
183
  break;
184
  case 'manual_text':
185
 
 
 
186
  if(isset($fixed_text[$key])){
187
 
188
  if (strpos($fixed_text[$key], 'http') !== false) {
@@ -203,8 +203,56 @@ Class saswp_output_service{
203
  }
204
 
205
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  case 'custom_field':
 
 
207
  $response = get_post_meta($post->ID, $cus_field[$key], true);
 
208
  break;
209
  case 'fixed_image':
210
 
@@ -1281,6 +1329,11 @@ Class saswp_output_service{
1281
  if(isset($custom_fields['saswp_ta_schema_postal_code'])){
1282
  $input1['address']['PostalCode'] = $custom_fields['saswp_ta_schema_postal_code'];
1283
  }
 
 
 
 
 
1284
 
1285
  break;
1286
 
@@ -1334,6 +1387,11 @@ Class saswp_output_service{
1334
  if(isset($custom_fields['saswp_td_schema_postal_code'])){
1335
  $input1['address']['PostalCode'] = $custom_fields['saswp_td_schema_postal_code'];
1336
  }
 
 
 
 
 
1337
 
1338
  break;
1339
 
@@ -1372,6 +1430,11 @@ Class saswp_output_service{
1372
  if(isset($custom_fields['saswp_lorh_schema_postal_code'])){
1373
  $input1['address']['PostalCode'] = $custom_fields['saswp_lorh_schema_postal_code'];
1374
  }
 
 
 
 
 
1375
 
1376
  break;
1377
 
@@ -1410,6 +1473,11 @@ Class saswp_output_service{
1410
  if(isset($custom_fields['saswp_hindutemple_schema_postal_code'])){
1411
  $input1['address']['PostalCode'] = $custom_fields['saswp_hindutemple_schema_postal_code'];
1412
  }
 
 
 
 
 
1413
 
1414
  break;
1415
 
@@ -1448,6 +1516,11 @@ Class saswp_output_service{
1448
  if(isset($custom_fields['saswp_church_schema_postal_code'])){
1449
  $input1['address']['PostalCode'] = $custom_fields['saswp_church_schema_postal_code'];
1450
  }
 
 
 
 
 
1451
 
1452
  break;
1453
 
@@ -1486,6 +1559,11 @@ Class saswp_output_service{
1486
  if(isset($custom_fields['saswp_mosque_schema_postal_code'])){
1487
  $input1['address']['PostalCode'] = $custom_fields['saswp_mosque_schema_postal_code'];
1488
  }
 
 
 
 
 
1489
 
1490
  break;
1491
 
@@ -1572,6 +1650,11 @@ Class saswp_output_service{
1572
  if(isset($custom_fields['saswp_apartment_schema_telephone'])){
1573
  $input1['telephone'] = $custom_fields['saswp_apartment_schema_telephone'];
1574
  }
 
 
 
 
 
1575
 
1576
  break;
1577
 
@@ -1607,6 +1690,11 @@ Class saswp_output_service{
1607
  if(isset($custom_fields['saswp_house_schema_telephone'])){
1608
  $input1['telephone'] = $custom_fields['saswp_house_schema_telephone'];
1609
  }
 
 
 
 
 
1610
 
1611
  break;
1612
 
@@ -1645,6 +1733,11 @@ Class saswp_output_service{
1645
  if(isset($custom_fields['saswp_sfr_schema_telephone'])){
1646
  $input1['telephone'] = $custom_fields['saswp_sfr_schema_telephone'];
1647
  }
 
 
 
 
 
1648
 
1649
  break;
1650
 
@@ -2580,7 +2673,9 @@ Class saswp_output_service{
2580
  'saswp_ta_schema_locality' => 'Address Locality',
2581
  'saswp_ta_schema_region' => 'Address Region',
2582
  'saswp_ta_schema_country' => 'Address Country',
2583
- 'saswp_ta_schema_postal_code' => 'Address PostalCode'
 
 
2584
  );
2585
  break;
2586
 
@@ -2594,7 +2689,9 @@ Class saswp_output_service{
2594
  'saswp_td_schema_locality' => 'Address Locality',
2595
  'saswp_td_schema_region' => 'Address Region',
2596
  'saswp_td_schema_country' => 'Address Country',
2597
- 'saswp_td_schema_postal_code' => 'Address PostalCode'
 
 
2598
  );
2599
  break;
2600
 
@@ -2611,7 +2708,9 @@ Class saswp_output_service{
2611
  'saswp_lorh_schema_locality' => 'Address Locality',
2612
  'saswp_lorh_schema_region' => 'Address Region',
2613
  'saswp_lorh_schema_country' => 'Address Country',
2614
- 'saswp_lorh_schema_postal_code' => 'Address PostalCode'
 
 
2615
  );
2616
  break;
2617
 
@@ -2628,7 +2727,9 @@ Class saswp_output_service{
2628
  'saswp_hindutemple_schema_locality' => 'Address Locality',
2629
  'saswp_hindutemple_schema_region' => 'Address Region',
2630
  'saswp_hindutemple_schema_country' => 'Address Country',
2631
- 'saswp_hindutemple_schema_postal_code' => 'Address PostalCode'
 
 
2632
  );
2633
  break;
2634
 
@@ -2645,7 +2746,9 @@ Class saswp_output_service{
2645
  'saswp_church_schema_locality' => 'Address Locality',
2646
  'saswp_church_schema_region' => 'Address Region',
2647
  'saswp_church_schema_country' => 'Address Country',
2648
- 'saswp_church_schema_postal_code' => 'Address PostalCode'
 
 
2649
  );
2650
  break;
2651
 
@@ -2662,7 +2765,9 @@ Class saswp_output_service{
2662
  'saswp_mosque_schema_locality' => 'Address Locality',
2663
  'saswp_mosque_schema_region' => 'Address Region',
2664
  'saswp_mosque_schema_country' => 'Address Country',
2665
- 'saswp_mosque_schema_postal_code' => 'Address PostalCode'
 
 
2666
  );
2667
  break;
2668
 
@@ -2831,6 +2936,8 @@ Class saswp_output_service{
2831
  'saswp_apartment_schema_locality' => 'Locality',
2832
  'saswp_apartment_schema_region' => 'Region',
2833
  'saswp_apartment_schema_postalcode' => 'PostalCode',
 
 
2834
  'saswp_apartment_schema_telephone' => 'Telephone'
2835
  );
2836
  break;
@@ -2884,6 +2991,8 @@ Class saswp_output_service{
2884
  'saswp_house_schema_locality' => 'Locality',
2885
  'saswp_house_schema_region' => 'Region',
2886
  'saswp_house_schema_postalcode' => 'PostalCode',
 
 
2887
  'saswp_house_schema_telephone' => 'Telephone'
2888
  );
2889
  break;
@@ -2901,6 +3010,8 @@ Class saswp_output_service{
2901
  'saswp_sfr_schema_locality' => 'Locality',
2902
  'saswp_sfr_schema_region' => 'Region',
2903
  'saswp_sfr_schema_postalcode' => 'PostalCode',
 
 
2904
  'saswp_sfr_schema_telephone' => 'Telephone'
2905
  );
2906
  break;
127
 
128
  global $post;
129
 
130
+ $fixed_image = get_post_meta($schema_post_id, 'saswp_fixed_image', true) ;
131
+
 
 
132
  $response = null;
133
 
134
  switch ($field) {
181
  break;
182
  case 'manual_text':
183
 
184
+ $fixed_text = get_post_meta($schema_post_id, 'saswp_fixed_text', true) ;
185
+
186
  if(isset($fixed_text[$key])){
187
 
188
  if (strpos($fixed_text[$key], 'http') !== false) {
203
  }
204
 
205
  break;
206
+
207
+ case 'taxonomy_term':
208
+
209
+ $response = '';
210
+
211
+ $taxonomy_term = get_post_meta( $schema_post_id, 'saswp_taxonomy_term', true) ;
212
+
213
+ if($taxonomy_term[$key] == 'all'){
214
+
215
+ $post_taxonomies = get_post_taxonomies( $post->ID );
216
+
217
+ if($post_taxonomies){
218
+
219
+ foreach ($post_taxonomies as $taxonomie ){
220
+
221
+ $terms = get_the_terms( $post->ID, $taxonomie);
222
+
223
+ if($terms){
224
+ foreach ($terms as $term){
225
+ $response .= $term->name.', ';
226
+ }
227
+ }
228
+
229
+ }
230
+
231
+ }
232
+
233
+ }else{
234
+
235
+ $terms = get_the_terms( $post->ID, $taxonomy_term[$key]);
236
+
237
+ if($terms){
238
+ foreach ($terms as $term){
239
+ $response .= $term->name.', ';
240
+ }
241
+ }
242
+
243
+ }
244
+
245
+ if($response){
246
+ $response = substr(trim($response), 0, -1);
247
+ }
248
+
249
+ break;
250
+
251
  case 'custom_field':
252
+
253
+ $cus_field = get_post_meta($schema_post_id, 'saswp_custom_meta_field', true);
254
  $response = get_post_meta($post->ID, $cus_field[$key], true);
255
+
256
  break;
257
  case 'fixed_image':
258
 
1329
  if(isset($custom_fields['saswp_ta_schema_postal_code'])){
1330
  $input1['address']['PostalCode'] = $custom_fields['saswp_ta_schema_postal_code'];
1331
  }
1332
+ if(isset($custom_fields['saswp_ta_schema_latitude']) && isset($custom_fields['saswp_ta_schema_longitude'])){
1333
+ $input1['geo']['@type'] = 'GeoCoordinates';
1334
+ $input1['geo']['latitude'] = $custom_fields['saswp_ta_schema_latitude'];
1335
+ $input1['geo']['longitude'] = $custom_fields['saswp_ta_schema_longitude'];
1336
+ }
1337
 
1338
  break;
1339
 
1387
  if(isset($custom_fields['saswp_td_schema_postal_code'])){
1388
  $input1['address']['PostalCode'] = $custom_fields['saswp_td_schema_postal_code'];
1389
  }
1390
+ if(isset($custom_fields['saswp_td_schema_latitude']) && isset($custom_fields['saswp_td_schema_longitude'])){
1391
+ $input1['geo']['@type'] = 'GeoCoordinates';
1392
+ $input1['geo']['latitude'] = $custom_fields['saswp_td_schema_latitude'];
1393
+ $input1['geo']['longitude'] = $custom_fields['saswp_td_schema_longitude'];
1394
+ }
1395
 
1396
  break;
1397
 
1430
  if(isset($custom_fields['saswp_lorh_schema_postal_code'])){
1431
  $input1['address']['PostalCode'] = $custom_fields['saswp_lorh_schema_postal_code'];
1432
  }
1433
+ if(isset($custom_fields['saswp_lorh_schema_latitude']) && isset($custom_fields['saswp_lorh_schema_longitude'])){
1434
+ $input1['geo']['@type'] = 'GeoCoordinates';
1435
+ $input1['geo']['latitude'] = $custom_fields['saswp_lorh_schema_latitude'];
1436
+ $input1['geo']['longitude'] = $custom_fields['saswp_lorh_schema_longitude'];
1437
+ }
1438
 
1439
  break;
1440
 
1473
  if(isset($custom_fields['saswp_hindutemple_schema_postal_code'])){
1474
  $input1['address']['PostalCode'] = $custom_fields['saswp_hindutemple_schema_postal_code'];
1475
  }
1476
+ if(isset($custom_fields['saswp_hindutemple_schema_latitude']) && isset($custom_fields['saswp_hindutemple_schema_longitude'])){
1477
+ $input1['geo']['@type'] = 'GeoCoordinates';
1478
+ $input1['geo']['latitude'] = $custom_fields['saswp_hindutemple_schema_latitude'];
1479
+ $input1['geo']['longitude'] = $custom_fields['saswp_hindutemple_schema_longitude'];
1480
+ }
1481
 
1482
  break;
1483
 
1516
  if(isset($custom_fields['saswp_church_schema_postal_code'])){
1517
  $input1['address']['PostalCode'] = $custom_fields['saswp_church_schema_postal_code'];
1518
  }
1519
+ if(isset($custom_fields['saswp_church_schema_latitude']) && isset($custom_fields['saswp_church_schema_longitude'])){
1520
+ $input1['geo']['@type'] = 'GeoCoordinates';
1521
+ $input1['geo']['latitude'] = $custom_fields['saswp_church_schema_latitude'];
1522
+ $input1['geo']['longitude'] = $custom_fields['saswp_church_schema_longitude'];
1523
+ }
1524
 
1525
  break;
1526
 
1559
  if(isset($custom_fields['saswp_mosque_schema_postal_code'])){
1560
  $input1['address']['PostalCode'] = $custom_fields['saswp_mosque_schema_postal_code'];
1561
  }
1562
+ if(isset($custom_fields['saswp_mosque_schema_latitude']) && isset($custom_fields['saswp_mosque_schema_longitude'])){
1563
+ $input1['geo']['@type'] = 'GeoCoordinates';
1564
+ $input1['geo']['latitude'] = $custom_fields['saswp_mosque_schema_latitude'];
1565
+ $input1['geo']['longitude'] = $custom_fields['saswp_mosque_schema_longitude'];
1566
+ }
1567
 
1568
  break;
1569
 
1650
  if(isset($custom_fields['saswp_apartment_schema_telephone'])){
1651
  $input1['telephone'] = $custom_fields['saswp_apartment_schema_telephone'];
1652
  }
1653
+ if(isset($custom_fields['saswp_apartment_schema_latitude']) && isset($custom_fields['saswp_apartment_schema_longitude'])){
1654
+ $input1['geo']['@type'] = 'GeoCoordinates';
1655
+ $input1['geo']['latitude'] = $custom_fields['saswp_apartment_schema_latitude'];
1656
+ $input1['geo']['longitude'] = $custom_fields['saswp_apartment_schema_longitude'];
1657
+ }
1658
 
1659
  break;
1660
 
1690
  if(isset($custom_fields['saswp_house_schema_telephone'])){
1691
  $input1['telephone'] = $custom_fields['saswp_house_schema_telephone'];
1692
  }
1693
+ if(isset($custom_fields['saswp_house_schema_latitude']) && isset($custom_fields['saswp_house_schema_longitude'])){
1694
+ $input1['geo']['@type'] = 'GeoCoordinates';
1695
+ $input1['geo']['latitude'] = $custom_fields['saswp_house_schema_latitude'];
1696
+ $input1['geo']['longitude'] = $custom_fields['saswp_house_schema_longitude'];
1697
+ }
1698
 
1699
  break;
1700
 
1733
  if(isset($custom_fields['saswp_sfr_schema_telephone'])){
1734
  $input1['telephone'] = $custom_fields['saswp_sfr_schema_telephone'];
1735
  }
1736
+ if(isset($custom_fields['saswp_sfr_schema_latitude']) && isset($custom_fields['saswp_sfr_schema_longitude'])){
1737
+ $input1['geo']['@type'] = 'GeoCoordinates';
1738
+ $input1['geo']['latitude'] = $custom_fields['saswp_sfr_schema_latitude'];
1739
+ $input1['geo']['longitude'] = $custom_fields['saswp_sfr_schema_longitude'];
1740
+ }
1741
 
1742
  break;
1743
 
2673
  'saswp_ta_schema_locality' => 'Address Locality',
2674
  'saswp_ta_schema_region' => 'Address Region',
2675
  'saswp_ta_schema_country' => 'Address Country',
2676
+ 'saswp_ta_schema_postal_code' => 'Address PostalCode',
2677
+ 'saswp_ta_schema_latitude' => 'Latitude',
2678
+ 'saswp_ta_schema_longitude' => 'Longitude',
2679
  );
2680
  break;
2681
 
2689
  'saswp_td_schema_locality' => 'Address Locality',
2690
  'saswp_td_schema_region' => 'Address Region',
2691
  'saswp_td_schema_country' => 'Address Country',
2692
+ 'saswp_td_schema_postal_code' => 'Address PostalCode',
2693
+ 'saswp_td_schema_latitude' => 'Latitude',
2694
+ 'saswp_td_schema_longitude' => 'Longitude',
2695
  );
2696
  break;
2697
 
2708
  'saswp_lorh_schema_locality' => 'Address Locality',
2709
  'saswp_lorh_schema_region' => 'Address Region',
2710
  'saswp_lorh_schema_country' => 'Address Country',
2711
+ 'saswp_lorh_schema_postal_code' => 'Address PostalCode',
2712
+ 'saswp_lorh_schema_latitude' => 'Latitude',
2713
+ 'saswp_lorh_schema_longitude' => 'Longitude',
2714
  );
2715
  break;
2716
 
2727
  'saswp_hindutemple_schema_locality' => 'Address Locality',
2728
  'saswp_hindutemple_schema_region' => 'Address Region',
2729
  'saswp_hindutemple_schema_country' => 'Address Country',
2730
+ 'saswp_hindutemple_schema_postal_code' => 'Address PostalCode',
2731
+ 'saswp_hindutemple_schema_latitude' => 'Latitude',
2732
+ 'saswp_hindutemple_schema_longitude' => 'Longitude',
2733
  );
2734
  break;
2735
 
2746
  'saswp_church_schema_locality' => 'Address Locality',
2747
  'saswp_church_schema_region' => 'Address Region',
2748
  'saswp_church_schema_country' => 'Address Country',
2749
+ 'saswp_church_schema_postal_code' => 'Address PostalCode',
2750
+ 'saswp_church_schema_latitude' => 'Latitude',
2751
+ 'saswp_church_schema_longitude' => 'Longitude',
2752
  );
2753
  break;
2754
 
2765
  'saswp_mosque_schema_locality' => 'Address Locality',
2766
  'saswp_mosque_schema_region' => 'Address Region',
2767
  'saswp_mosque_schema_country' => 'Address Country',
2768
+ 'saswp_mosque_schema_postal_code' => 'Address PostalCode',
2769
+ 'saswp_mosque_schema_latitude' => 'Latitude',
2770
+ 'saswp_mosque_schema_longitude' => 'Longitude',
2771
  );
2772
  break;
2773
 
2936
  'saswp_apartment_schema_locality' => 'Locality',
2937
  'saswp_apartment_schema_region' => 'Region',
2938
  'saswp_apartment_schema_postalcode' => 'PostalCode',
2939
+ 'saswp_apartment_schema_latitude' => 'Latitude',
2940
+ 'saswp_apartment_schema_longitude' => 'Longitude',
2941
  'saswp_apartment_schema_telephone' => 'Telephone'
2942
  );
2943
  break;
2991
  'saswp_house_schema_locality' => 'Locality',
2992
  'saswp_house_schema_region' => 'Region',
2993
  'saswp_house_schema_postalcode' => 'PostalCode',
2994
+ 'saswp_house_schema_latitude' => 'Latitude',
2995
+ 'saswp_house_schema_longitude' => 'Longitude',
2996
  'saswp_house_schema_telephone' => 'Telephone'
2997
  );
2998
  break;
3010
  'saswp_sfr_schema_locality' => 'Locality',
3011
  'saswp_sfr_schema_region' => 'Region',
3012
  'saswp_sfr_schema_postalcode' => 'PostalCode',
3013
+ 'saswp_sfr_schema_latitude' => 'Latitude',
3014
+ 'saswp_sfr_schema_longitude' => 'Longitude',
3015
  'saswp_sfr_schema_telephone' => 'Telephone'
3016
  );
3017
  break;
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.2
6
- Stable tag: 1.9.11
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -118,6 +118,13 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
118
 
119
  == Changelog ==
120
 
 
 
 
 
 
 
 
121
  = 1.9.11 (5 Oct 2019) =
122
 
123
  * Added: Add support for Event Subcategory schema #418
3
  Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
4
  Requires at least: 3.0
5
  Tested up to: 5.2
6
+ Stable tag: 1.9.12
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
118
 
119
  == Changelog ==
120
 
121
+ = 1.9.12 (9 Oct 2019) =
122
+
123
+ * Added: Custom Taxonomy in modify schema output #533
124
+ * Added: Coordinates fields(latitude, longitude) for real estate schema #525
125
+ * Added: Real Estate Schema Box in Premium Features tab #472
126
+ * Enhancement: Review for Schema improvements #534
127
+
128
  = 1.9.11 (5 Oct 2019) =
129
 
130
  * Added: Add support for Event Subcategory schema #418
reviews/reviews_service.php CHANGED
@@ -27,69 +27,56 @@ class saswp_reviews_service {
27
  * @return string
28
  */
29
  public function saswp_get_reviews_schema_markup($reviews){
30
-
31
- global $sd_data;
32
 
33
  $sumofrating = 0;
34
  $avg_rating = 1;
 
 
35
 
36
  if($reviews){
37
 
38
  foreach($reviews as $rv){
 
39
  $sumofrating += $rv['saswp_review_rating'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
 
42
- if($sumofrating> 0){
43
- $avg_rating = $sumofrating / count($reviews);
44
- }
45
 
46
- }
47
-
48
- $html = '';
49
- $date = get_the_date("Y-m-d\TH:i:s\Z");
50
- $modified_date = get_the_modified_date("Y-m-d\TH:i:s\Z");
51
-
52
- $input1 = array(
53
- '@context' => saswp_context_url(),
54
- '@type' => 'Review',
55
- 'dateCreated' => esc_html($date),
56
- 'datePublished' => esc_html($date),
57
- 'dateModified' => esc_html($modified_date),
58
- 'headline' => saswp_get_the_title(),
59
- 'name' => saswp_get_the_title(),
60
- 'url' => get_permalink(),
61
- 'description' => saswp_get_the_excerpt(),
62
- 'copyrightYear' => get_the_time( 'Y' ),
63
- 'author' => saswp_get_author_details()
64
- );
65
-
66
- $input1['itemReviewed'] = array(
67
- '@type' => 'Organization',
68
- 'name' => saswp_get_the_title(),
69
- );
70
 
71
- $input1['reviewRating'] = array(
72
- '@type' => 'Rating',
73
- 'worstRating' => 1,
74
- 'bestRating' => 5,
75
  'ratingValue' => esc_attr($avg_rating),
76
- );
77
-
78
- if(!empty($input1)){
79
 
80
- $html .= "\n";
81
- $html .= '<!-- Schema & Structured Data For Reviews v'.esc_attr(SASWP_VERSION).' - -->';
82
- $html .= "\n";
83
- $html .= '<script type="application/ld+json" class="saswp-reviews-markup">';
84
- $html .= "\n";
85
- $html .= saswp_json_print_format($input1);
86
- $html .= "\n";
87
- $html .= '</script>';
88
- $html .= "\n\n";
89
-
90
- }
91
-
92
- return $html;
93
  }
94
 
95
  /**
@@ -114,9 +101,6 @@ class saswp_reviews_service {
114
  if(is_object($term)){
115
  $term_slug = $term->slug;
116
  }
117
- if($term_slug == ''){
118
- $term_slug = 'google';
119
- }
120
 
121
  $img_src = SASWP_DIR_URI.'/admin_section/images/default_user.jpg';
122
 
@@ -295,13 +279,7 @@ class saswp_reviews_service {
295
 
296
  }
297
 
298
- /**
299
- * Function to show value using shortcode "saswp-reviews"
300
- * @param type $attr
301
- * @return type
302
- */
303
- public function saswp_reviews_front_output($attr){
304
-
305
 
306
  $arg = array();
307
  $arg['post_type'] = 'saswp_reviews';
@@ -375,7 +353,22 @@ class saswp_reviews_service {
375
  $reviews[] = $review_data;
376
  }
377
  }
378
- $output = $schema_markup = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
 
380
  if($reviews){
381
 
@@ -383,10 +376,27 @@ class saswp_reviews_service {
383
 
384
  if(saswp_global_option()){
385
 
386
- $schema_markup = $this->saswp_get_reviews_schema_markup($reviews);
387
 
388
- if($schema_markup){
389
- $output = $output.$schema_markup;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
 
391
  }
392
 
27
  * @return string
28
  */
29
  public function saswp_get_reviews_schema_markup($reviews){
 
 
30
 
31
  $sumofrating = 0;
32
  $avg_rating = 1;
33
+ $reviews_arr = array();
34
+ $input1 = array();
35
 
36
  if($reviews){
37
 
38
  foreach($reviews as $rv){
39
+
40
  $sumofrating += $rv['saswp_review_rating'];
41
+
42
+ if($rv['saswp_review_rating'] && $rv['saswp_reviewer_name']){
43
+
44
+ $reviews_arr[] = array(
45
+ '@type' => 'Review',
46
+ 'author' => $rv['saswp_reviewer_name'],
47
+ 'datePublished' => $rv['saswp_review_date'],
48
+ 'description' => $rv['saswp_review_text'],
49
+ 'reviewRating' => array(
50
+ '@type' => 'Rating',
51
+ 'bestRating' => 5,
52
+ 'ratingValue' => $rv['saswp_review_rating'],
53
+ 'worstRating' => 1
54
+ ),
55
+ );
56
+
57
+ }
58
+
59
  }
60
 
61
+ if($sumofrating> 0){
62
+ $avg_rating = $sumofrating / count($reviews);
63
+ }
64
 
65
+ if(!empty($reviews_arr)){
66
+
67
+ $input1['review'] = $reviews_arr;
68
+
69
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
+ $input1['aggregateRating'] = array(
72
+ '@type' => 'AggregateRating',
73
+ 'reviewCount' => count($reviews),
 
74
  'ratingValue' => esc_attr($avg_rating),
75
+ );
 
 
76
 
77
+ }
78
+ return $input1;
79
+
 
 
 
 
 
 
 
 
 
 
80
  }
81
 
82
  /**
101
  if(is_object($term)){
102
  $term_slug = $term->slug;
103
  }
 
 
 
104
 
105
  $img_src = SASWP_DIR_URI.'/admin_section/images/default_user.jpg';
106
 
279
 
280
  }
281
 
282
+ public function saswp_get_reviews_by_attr($attr){
 
 
 
 
 
 
283
 
284
  $arg = array();
285
  $arg['post_type'] = 'saswp_reviews';
353
  $reviews[] = $review_data;
354
  }
355
  }
356
+
357
+ return $reviews;
358
+
359
+ }
360
+
361
+ /**
362
+ * Function to show value using shortcode "saswp-reviews"
363
+ * @param type $attr
364
+ * @return type
365
+ */
366
+ public function saswp_reviews_front_output($attr){
367
+
368
+ global $sd_data;
369
+ $reviews = $this->saswp_get_reviews_by_attr($attr);
370
+
371
+ $output = $html = '';
372
 
373
  if($reviews){
374
 
376
 
377
  if(saswp_global_option()){
378
 
379
+ $rv_markup = $this->saswp_get_reviews_schema_markup($reviews);
380
 
381
+ if($rv_markup){
382
+
383
+ $input1['@context'] = saswp_context_url();
384
+ $input1['@type'] = (isset($sd_data['saswp_organization_type']) && $sd_data['saswp_organization_type'] !='' )? $sd_data['saswp_organization_type'] : 'Organization';
385
+ $input1['name'] = (isset($sd_data['sd_name']) && $sd_data['sd_name'] !='' )? $sd_data['sd_name'] : get_bloginfo();
386
+
387
+ $input1 = $input1 + $rv_markup;
388
+
389
+ $html .= "\n";
390
+ $html .= '<!-- Schema & Structured Data For Reviews v'.esc_attr(SASWP_VERSION).' - -->';
391
+ $html .= "\n";
392
+ $html .= '<script type="application/ld+json" class="saswp-reviews-markup">';
393
+ $html .= "\n";
394
+ $html .= saswp_json_print_format($input1);
395
+ $html .= "\n";
396
+ $html .= '</script>';
397
+ $html .= "\n\n";
398
+
399
+ $output = $output.$html;
400
 
401
  }
402
 
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.9.11
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.9.11');
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.9.12
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.9.12');
17
  define('SASWP_DIR_NAME_FILE', __FILE__ );
18
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
19
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
view/paywall.php CHANGED
@@ -89,6 +89,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
89
  $enable_custom_field = '';
90
  $custom_fields = '';
91
  $fixed_text = '';
 
92
  $fixed_image = '';
93
 
94
  if ( isset( $_POST['notAccessibleForFree'] ) )
@@ -103,6 +104,8 @@ if ( ! defined( 'ABSPATH' ) ) exit;
103
  $meta_list = array_map ('sanitize_text_field', $_POST['saswp_meta_list_val']);
104
  if ( isset( $_POST['saswp_fixed_text'] ) )
105
  $fixed_text = array_map ('sanitize_text_field', $_POST['saswp_fixed_text']);
 
 
106
  if ( isset( $_POST['saswp_custom_meta_field'] ) )
107
  $cus_meta_field = array_map ('sanitize_text_field', $_POST['saswp_custom_meta_field']);
108
  if ( isset( $_POST['saswp_fixed_image'] ) )
@@ -118,6 +121,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
118
  update_post_meta( $post_id, 'schema_options', $saswp_schema_options);
119
  update_post_meta( $post_id, 'saswp_meta_list_val', $meta_list);
120
  update_post_meta( $post_id, 'saswp_fixed_text', $fixed_text);
 
121
  update_post_meta( $post_id, 'saswp_fixed_image', $fixed_image);
122
  update_post_meta( $post_id, 'saswp_custom_meta_field', $cus_meta_field);
123
 
89
  $enable_custom_field = '';
90
  $custom_fields = '';
91
  $fixed_text = '';
92
+ $taxonomy_term = '';
93
  $fixed_image = '';
94
 
95
  if ( isset( $_POST['notAccessibleForFree'] ) )
104
  $meta_list = array_map ('sanitize_text_field', $_POST['saswp_meta_list_val']);
105
  if ( isset( $_POST['saswp_fixed_text'] ) )
106
  $fixed_text = array_map ('sanitize_text_field', $_POST['saswp_fixed_text']);
107
+ if ( isset( $_POST['saswp_taxonomy_term'] ) )
108
+ $taxonomy_term = array_map ('sanitize_text_field', $_POST['saswp_taxonomy_term']);
109
  if ( isset( $_POST['saswp_custom_meta_field'] ) )
110
  $cus_meta_field = array_map ('sanitize_text_field', $_POST['saswp_custom_meta_field']);
111
  if ( isset( $_POST['saswp_fixed_image'] ) )
121
  update_post_meta( $post_id, 'schema_options', $saswp_schema_options);
122
  update_post_meta( $post_id, 'saswp_meta_list_val', $meta_list);
123
  update_post_meta( $post_id, 'saswp_fixed_text', $fixed_text);
124
+ update_post_meta( $post_id, 'saswp_taxonomy_term', $taxonomy_term);
125
  update_post_meta( $post_id, 'saswp_fixed_image', $fixed_image);
126
  update_post_meta( $post_id, 'saswp_custom_meta_field', $cus_meta_field);
127
 
view/review.php CHANGED
@@ -201,7 +201,7 @@ class saswp_metaboxes_review {
201
  $saswp_review_details = array();
202
 
203
  if(isset($_POST['saswp-review-item-title'])){
204
- $saswp_review_details['saswp-review-item-title'] = sanitize_text_field($_POST['saswp-review-item-title']);
205
  }
206
  if(isset($_POST['saswp-review-location'])){
207
  $saswp_review_details['saswp-review-location'] = sanitize_text_field($_POST['saswp-review-location']);
@@ -231,7 +231,7 @@ class saswp_metaboxes_review {
231
  update_post_meta( $post_id, 'saswp-review-item-cons', wp_kses_post( wp_unslash( $_POST['saswp-review-item-cons'] )) );
232
  }
233
  if(!empty($saswp_review_details)){
234
- update_post_meta( $post_id, 'saswp_review_details', $saswp_review_details );
235
  }
236
  }
237
  }
201
  $saswp_review_details = array();
202
 
203
  if(isset($_POST['saswp-review-item-title'])){
204
+ $saswp_review_details['saswp-review-item-title'] = sanitize_text_field($_POST['saswp-review-item-title']);
205
  }
206
  if(isset($_POST['saswp-review-location'])){
207
  $saswp_review_details['saswp-review-location'] = sanitize_text_field($_POST['saswp-review-location']);
231
  update_post_meta( $post_id, 'saswp-review-item-cons', wp_kses_post( wp_unslash( $_POST['saswp-review-item-cons'] )) );
232
  }
233
  if(!empty($saswp_review_details)){
234
+ update_post_meta( $post_id, 'saswp_review_details', $saswp_review_details );
235
  }
236
  }
237
  }
view/schema_type.php CHANGED
@@ -542,6 +542,7 @@ function saswp_schema_type_meta_box_callback( $post) {
542
  $business_type = '';
543
  $custom_logo_id = '';
544
  $speakable = '';
 
545
 
546
  $business_details = array();
547
  $logo = array();
@@ -554,9 +555,11 @@ function saswp_schema_type_meta_box_callback( $post) {
554
  $schema_options = get_post_meta($post->ID, 'schema_options', true);
555
  $meta_list = get_post_meta($post->ID, 'saswp_meta_list_val', true);
556
  $fixed_text = get_post_meta($post->ID, 'saswp_fixed_text', true);
 
557
  $fixed_image = get_post_meta($post->ID, 'saswp_fixed_image', true);
558
  $cus_field = get_post_meta($post->ID, 'saswp_custom_meta_field', true);
559
  $schema_type = get_post_meta($post->ID, 'schema_type', true);
 
560
 
561
  switch ($schema_type) {
562
 
@@ -715,7 +718,7 @@ function saswp_schema_type_meta_box_callback( $post) {
715
 
716
  default:
717
 
718
- $speakable = get_post_meta($post->ID, 'saswp_enable_speakable_schema', true);
719
 
720
  break;
721
  }
@@ -1114,6 +1117,17 @@ function saswp_schema_type_meta_box_callback( $post) {
1114
  <input class="saswp-enable-speakable" type="checkbox" name="saswp_enable_speakable_schema" value="1" <?php if(isset($speakable) && $speakable == 1){echo 'checked'; }else{ echo ''; } ?>>
1115
  </td>
1116
  </tr>
 
 
 
 
 
 
 
 
 
 
 
1117
  </table>
1118
 
1119
  </div>
@@ -1217,6 +1231,28 @@ function saswp_schema_type_meta_box_callback( $post) {
1217
 
1218
  if($fieldval == 'manual_text'){
1219
  echo '<td><input type="text" name="saswp_fixed_text['.esc_attr($fieldkey).']" value="'.(isset($fixed_text[$fieldkey]) ? esc_html($fixed_text[$fieldkey]) :'').'"></td>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1220
  }else if($fieldval == 'custom_field'){
1221
  echo '<td><select class="saswp-custom-fields-select2" name="saswp_custom_meta_field['.esc_attr($fieldkey).']">';
1222
  echo '<option value="'.esc_attr($cus_field[$fieldkey]).'">'.preg_replace( '/^_/', '', esc_html( str_replace( '_', ' ', $cus_field[$fieldkey] ) ) ).'</option>';
@@ -1325,6 +1361,16 @@ function saswp_schema_type_add_meta_box_save( $post_id ) {
1325
  update_post_meta( $post_id, 'saswp_enable_speakable_schema', '0' );
1326
 
1327
  }
 
 
 
 
 
 
 
 
 
 
1328
 
1329
  }
1330
 
542
  $business_type = '';
543
  $custom_logo_id = '';
544
  $speakable = '';
545
+ $append_reviews = '';
546
 
547
  $business_details = array();
548
  $logo = array();
555
  $schema_options = get_post_meta($post->ID, 'schema_options', true);
556
  $meta_list = get_post_meta($post->ID, 'saswp_meta_list_val', true);
557
  $fixed_text = get_post_meta($post->ID, 'saswp_fixed_text', true);
558
+ $taxonomy_term = get_post_meta($post->ID, 'saswp_taxonomy_term', true);
559
  $fixed_image = get_post_meta($post->ID, 'saswp_fixed_image', true);
560
  $cus_field = get_post_meta($post->ID, 'saswp_custom_meta_field', true);
561
  $schema_type = get_post_meta($post->ID, 'schema_type', true);
562
+ $append_reviews = get_post_meta($post->ID, 'saswp_enable_append_reviews', true);
563
 
564
  switch ($schema_type) {
565
 
718
 
719
  default:
720
 
721
+ $speakable = get_post_meta($post->ID, 'saswp_enable_speakable_schema', true);
722
 
723
  break;
724
  }
1117
  <input class="saswp-enable-speakable" type="checkbox" name="saswp_enable_speakable_schema" value="1" <?php if(isset($speakable) && $speakable == 1){echo 'checked'; }else{ echo ''; } ?>>
1118
  </td>
1119
  </tr>
1120
+
1121
+ <tr>
1122
+ <td>
1123
+ <label for="saswp-append-reviews"><?php echo esc_html__('Add Reviews' ,'schema-and-structured-data-for-wp');?></label>
1124
+ </td>
1125
+ <td>
1126
+ <input class="saswp-enable-append-reviews" type="checkbox" name="saswp_enable_append_reviews" value="1" <?php if(isset($append_reviews) && $append_reviews == 1){echo 'checked'; }else{ echo ''; } ?>>
1127
+ </td>
1128
+ </tr>
1129
+
1130
+
1131
  </table>
1132
 
1133
  </div>
1231
 
1232
  if($fieldval == 'manual_text'){
1233
  echo '<td><input type="text" name="saswp_fixed_text['.esc_attr($fieldkey).']" value="'.(isset($fixed_text[$fieldkey]) ? esc_html($fixed_text[$fieldkey]) :'').'"></td>';
1234
+ }else if($fieldval == 'taxonomy_term'){
1235
+
1236
+ $choices = array('all' => esc_html__('All','schema-and-structured-data-for-wp'));
1237
+ $taxonomies = saswp_post_taxonomy_generator();
1238
+ $choices = array_merge($choices, $taxonomies);
1239
+
1240
+ echo '<td>';
1241
+
1242
+ if($choices){
1243
+
1244
+ echo '<select name="saswp_taxonomy_term['.esc_attr($fieldkey).']">';
1245
+
1246
+ foreach ($choices as $key => $val){
1247
+
1248
+ echo '<option value="'.esc_attr($key).'" '.((isset($taxonomy_term[$fieldkey]) && $taxonomy_term[$fieldkey] == $key) ? 'selected' :'').'>'.esc_attr($val).'</option>';
1249
+
1250
+ }
1251
+ echo '</select>';
1252
+
1253
+ }
1254
+ echo '</td>';
1255
+
1256
  }else if($fieldval == 'custom_field'){
1257
  echo '<td><select class="saswp-custom-fields-select2" name="saswp_custom_meta_field['.esc_attr($fieldkey).']">';
1258
  echo '<option value="'.esc_attr($cus_field[$fieldkey]).'">'.preg_replace( '/^_/', '', esc_html( str_replace( '_', ' ', $cus_field[$fieldkey] ) ) ).'</option>';
1361
  update_post_meta( $post_id, 'saswp_enable_speakable_schema', '0' );
1362
 
1363
  }
1364
+
1365
+ if ( isset( $_POST['saswp_enable_append_reviews'] ) ){
1366
+
1367
+ update_post_meta( $post_id, 'saswp_enable_append_reviews', sanitize_text_field($_POST['saswp_enable_append_reviews']) );
1368
+
1369
+ }else{
1370
+
1371
+ update_post_meta( $post_id, 'saswp_enable_append_reviews', '0' );
1372
+
1373
+ }
1374
 
1375
  }
1376