Schema & Structured Data for WP & AMP - Version 1.8.9

Version Description

(08 July 2019) =

  • Added: Translation panel. User can add own text for List of labels which is being output in content #361
  • Added: compatibility with DWQA Pro version plugin ( https://wordpress.org/plugins/dw-question-answer ) #372
  • Added: Social fields in local business schema type
  • Added: Error message should be shown if custom schema markup is not valid
  • Bug Fixed: Defragmentation is not working for BlogPost schema type #367
  • Bug Fixed: Schema title attributes show invalid title when yoast compatibility is enabled , like this (%%title%%%page%%sep) #364
  • Bug Fixed: Description and Article body have same data #363
  • Bug Fixed: Debug Warning & notices #362
  • Bug Fixed: Micro data clean up is not working properly. #359
Download this release

Release Info

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

Code changes from version 1.8.8 to 1.8.9

admin_section/add-schema/add_new.php CHANGED
@@ -1,4 +1,17 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  //compatible with the Blackbar plugin starts here
3
  if( in_array( filter_input( INPUT_GET, 'page' ), array( 'saswp-setup-wizard', 'saswp_add_new_data_type' ))) {
4
  add_filter( 'blackbar/enabled', '__return_false' );
@@ -81,22 +94,19 @@ $saswp_add_data_type_config = array(
81
  $step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : $saswp_add_data_type_config['start_steps'];
82
  $title = $saswp_add_data_type_config['steps'][$step]['title'];
83
  $saswp_add_data_type_config['current_step']['step_id'] = $step;
84
-
85
- // Use minified libraries if dev mode is turned on.
86
- $suffix = '';
87
-
88
  wp_enqueue_media ();
89
 
90
  // Enqueue styles.
91
- wp_enqueue_style( 'saswp-timepicker-js', SASWP_PLUGIN_URL. $saswp_add_data_type_config['installer_dir']. '/css/jquery.timepicker' . $suffix . '.css' , array( 'wp-admin' ), '0.1');
92
  // Enqueue javascript.
93
- wp_enqueue_script( 'saswp-timepicker-css', SASWP_PLUGIN_URL. $saswp_add_data_type_config['installer_dir']. '/js/jquery.timepicker' . $suffix . '.js' , array( 'jquery-core' ), '0.1' );
94
 
95
 
96
  // Enqueue styles.
97
- wp_enqueue_style( 'saswp_add_new', SASWP_PLUGIN_URL. $saswp_add_data_type_config['installer_dir']. '/css/saswp-add-new.min' . $suffix . '.css' , array( 'wp-admin' ), '0.1');
98
  // Enqueue javascript.
99
- wp_enqueue_script( 'saswp_add_new', SASWP_PLUGIN_URL. $saswp_add_data_type_config['installer_dir']. '/js/saswp-add-new.min' . $suffix . '.js' , array( 'jquery-core' ), '0.1' );
100
 
101
  //Enque datepicker
102
  wp_enqueue_script( 'jquery-ui-datepicker' );
@@ -104,7 +114,7 @@ $saswp_add_data_type_config = array(
104
  wp_enqueue_style( 'jquery-ui' );
105
 
106
 
107
- wp_enqueue_script( 'structure_admin', SASWP_PLUGIN_URL. $saswp_add_data_type_config['installer_dir']. '/js/structure_admin.min' . $suffix . '.js' , array( 'jquery' ), '0.1' );
108
 
109
  wp_localize_script( 'structure_admin', 'saswp_app_object', array(
110
  'ajax_url' => admin_url( 'admin-ajax.php' ),
@@ -202,8 +212,8 @@ $saswp_add_data_type_config = array(
202
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
203
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
204
  </svg>
205
-
206
- <h1><?php echo esc_attr($stepDetails['title']); ?></h1>
207
 
208
  <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
209
 
@@ -222,7 +232,6 @@ $saswp_add_data_type_config = array(
222
 
223
  </ul>
224
 
225
-
226
  <footer class="merlin__content__footer">
227
  <?php saswp_add_new_skip_button(); ?>
228
 
@@ -251,8 +260,8 @@ $saswp_add_data_type_config = array(
251
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
252
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
253
  </svg>
254
-
255
- <h1><?php echo esc_attr($stepDetails['title']); ?></h1>
256
  <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
257
  </div>
258
 
@@ -322,8 +331,8 @@ $saswp_add_data_type_config = array(
322
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
323
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
324
  </svg>
325
-
326
- <h1><?php echo esc_attr($stepDetails['title']); ?></h1>
327
 
328
  <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
329
 
@@ -396,11 +405,12 @@ $saswp_add_data_type_config = array(
396
 
397
  if(isset($_POST['data_group_array']) && isset($_POST['saswp_post_id'])){
398
 
399
- $post_id = sanitize_text_field($_POST['saswp_post_id']);
400
  $post_data_group_array = array();
401
  $temp_condition_array = array();
402
  $show_globally = false;
403
- $post_data_group_array = $_POST['data_group_array'];
 
404
  if(is_array($post_data_group_array)){
405
 
406
  foreach($post_data_group_array as $groups){
@@ -425,7 +435,9 @@ $saswp_add_data_type_config = array(
425
 
426
  $post_data_group_array['group-0']['data_array'] = $temp_condition_array;
427
 
428
- }
 
 
429
 
430
  update_post_meta(
431
  $post_id,
1
  <?php
2
+ /**
3
+ * Merlin WP
4
+ * Better WordPress Theme Onboarding
5
+ *
6
+ * The following code is a derivative work from the
7
+ * Envato WordPress Theme Setup Wizard by David Baker.
8
+
9
+ * @link https://merlinwp.com/
10
+ * @author Richard Tabor, from ThemeBeans.com
11
+ * @copyright Copyright (c) 2017, Merlin WP of Inventionn LLC
12
+ * @license Licensed GPLv3 for open source use
13
+ */
14
+
15
  //compatible with the Blackbar plugin starts here
16
  if( in_array( filter_input( INPUT_GET, 'page' ), array( 'saswp-setup-wizard', 'saswp_add_new_data_type' ))) {
17
  add_filter( 'blackbar/enabled', '__return_false' );
94
  $step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : $saswp_add_data_type_config['start_steps'];
95
  $title = $saswp_add_data_type_config['steps'][$step]['title'];
96
  $saswp_add_data_type_config['current_step']['step_id'] = $step;
97
+
 
 
 
98
  wp_enqueue_media ();
99
 
100
  // Enqueue styles.
101
+ wp_enqueue_style( 'saswp-timepicker-js', SASWP_PLUGIN_URL. $saswp_add_data_type_config['installer_dir']. '/css/jquery.timepicker.css' , array( 'wp-admin' ), '0.1');
102
  // Enqueue javascript.
103
+ wp_enqueue_script( 'saswp-timepicker-css', SASWP_PLUGIN_URL. $saswp_add_data_type_config['installer_dir']. '/js/jquery.timepicker.js' , array( 'jquery-core' ), '0.1' );
104
 
105
 
106
  // Enqueue styles.
107
+ wp_enqueue_style( 'saswp_add_new', SASWP_PLUGIN_URL. $saswp_add_data_type_config['installer_dir']. '/css/saswp-add-new.min.css' , array( 'wp-admin' ), '0.1');
108
  // Enqueue javascript.
109
+ wp_enqueue_script( 'saswp_add_new', SASWP_PLUGIN_URL. $saswp_add_data_type_config['installer_dir']. '/js/saswp-add-new.min.js' , array( 'jquery-core' ), '0.1' );
110
 
111
  //Enque datepicker
112
  wp_enqueue_script( 'jquery-ui-datepicker' );
114
  wp_enqueue_style( 'jquery-ui' );
115
 
116
 
117
+ wp_enqueue_script( 'structure_admin', SASWP_PLUGIN_URL. $saswp_add_data_type_config['installer_dir']. '/js/structure_admin.min.js' , array( 'jquery' ), '0.1' );
118
 
119
  wp_localize_script( 'structure_admin', 'saswp_app_object', array(
120
  'ajax_url' => admin_url( 'admin-ajax.php' ),
212
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
213
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
214
  </svg>
215
+ <!--Escaping has been done above while adding to array ref array $saswp_installer_config-->
216
+ <h1><?php echo $stepDetails['title']; ?></h1>
217
 
218
  <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
219
 
232
 
233
  </ul>
234
 
 
235
  <footer class="merlin__content__footer">
236
  <?php saswp_add_new_skip_button(); ?>
237
 
260
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
261
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
262
  </svg>
263
+ <!--Escaping has been done above while adding to array ref array $saswp_installer_config-->
264
+ <h1><?php echo $stepDetails['title']; ?></h1>
265
  <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
266
  </div>
267
 
331
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
332
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
333
  </svg>
334
+ <!--Escaping has been done above while adding to array ref array $saswp_installer_config-->
335
+ <h1><?php echo $stepDetails['title']; ?></h1>
336
 
337
  <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
338
 
405
 
406
  if(isset($_POST['data_group_array']) && isset($_POST['saswp_post_id'])){
407
 
408
+ $post_id = intval($_POST['saswp_post_id']);
409
  $post_data_group_array = array();
410
  $temp_condition_array = array();
411
  $show_globally = false;
412
+ $post_data_group_array = (array) $_POST['data_group_array'];
413
+
414
  if(is_array($post_data_group_array)){
415
 
416
  foreach($post_data_group_array as $groups){
435
 
436
  $post_data_group_array['group-0']['data_array'] = $temp_condition_array;
437
 
438
+ }
439
+
440
+ $post_data_group_array = saswp_sanitize_multi_array($post_data_group_array, 'data_array');
441
 
442
  update_post_meta(
443
  $post_id,
admin_section/ajax-selectbox.php CHANGED
@@ -1,5 +1,23 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  add_action('wp_ajax_create_ajax_select_sdwp','saswp_ajax_select_creator');
 
 
 
3
  function saswp_ajax_select_creator($data = '', $saved_data= '', $current_number = '', $current_group_number ='') {
4
 
5
  $response = $data;
@@ -15,10 +33,10 @@ function saswp_ajax_select_creator($data = '', $saved_data= '', $current_number
15
  $response = sanitize_text_field(wp_unslash($_POST["id"]));
16
  }
17
  if ( isset( $_POST["number"] ) ) {
18
- $current_number = intval($_POST["number"]);
19
  }
20
  if ( isset( $_POST["group_number"] ) ) {
21
- $current_group_number = intval($_POST["group_number"]);
22
  }
23
 
24
  }else{
@@ -118,11 +136,16 @@ function saswp_ajax_select_creator($data = '', $saved_data= '', $current_number
118
 
119
  $templates = get_page_templates();
120
 
121
- foreach($templates as $k => $v){
 
 
122
 
123
- $choices[$v] = $k;
124
 
 
 
125
  }
 
126
 
127
  break;
128
 
@@ -277,13 +300,16 @@ function saswp_ajax_select_creator($data = '', $saved_data= '', $current_number
277
  // endif;
278
 
279
  }
280
- // Generate Proper Post Taxonomy for select and to add data.
 
 
 
 
281
  function saswp_post_taxonomy_generator(){
282
 
283
  $taxonomies = '';
284
  $choices = array();
285
-
286
-
287
  $taxonomies = get_taxonomies( array('public' => true), 'objects' );
288
 
289
  if($taxonomies){
@@ -305,9 +331,14 @@ function saswp_post_taxonomy_generator(){
305
 
306
  return $choices;
307
  }
308
-
309
- add_action('wp_ajax_create_ajax_select_sdwp_taxonomy','saswp_create_ajax_select_taxonomy');
310
-
 
 
 
 
 
311
  function saswp_create_ajax_select_taxonomy($selectedParentValue = '',$selectedValue='', $current_number ='', $current_group_number = ''){
312
 
313
  $is_ajax = false;
@@ -315,9 +346,11 @@ function saswp_create_ajax_select_taxonomy($selectedParentValue = '',$selectedVa
315
  if( $_SERVER['REQUEST_METHOD']=='POST'){
316
 
317
  $is_ajax = true;
 
318
  if(! current_user_can( 'manage_options' ) ) {
319
  exit;
320
  }
 
321
  if(wp_verify_nonce($_POST["saswp_call_nonce"],'saswp_select_action_nonce')){
322
 
323
  if(isset($_POST['id'])){
@@ -325,16 +358,19 @@ function saswp_create_ajax_select_taxonomy($selectedParentValue = '',$selectedVa
325
  $selectedParentValue = sanitize_text_field(wp_unslash($_POST['id']));
326
 
327
  }
 
328
  if(isset($_POST['number'])){
329
 
330
- $current_number = intval($_POST['number']);
331
 
332
  }
 
333
  if ( isset( $_POST["group_number"] ) ) {
334
 
335
- $current_group_number = intval($_POST["group_number"]);
336
 
337
  }
 
338
  }else{
339
 
340
  exit;
@@ -358,22 +394,26 @@ function saswp_create_ajax_select_taxonomy($selectedParentValue = '',$selectedVa
358
 
359
  $choices = '<option value="all">'.esc_html__('All','schema-and-structured-data-for-wp').'</option>';
360
 
361
- foreach($taxonomies as $taxonomy) {
 
 
362
 
363
- $sel="";
364
 
365
- if($selectedValue == $taxonomy->slug){
366
 
367
- $sel = "selected";
368
 
369
- }
370
- $choices .= '<option value="'.esc_attr($taxonomy->slug).'" '.esc_attr($sel).'>'.esc_html__($taxonomy->name,'schema-and-structured-data-for-wp').'</option>';
371
 
372
  }
373
 
374
  $allowed_html = saswp_expanded_allowed_tags();
375
 
376
  echo '<select class="widefat ajax-output-child" name="data_group_array[group-'. esc_attr($current_group_number) .'][data_array]['.esc_attr($current_number).'][key_4]">'. wp_kses($choices, $allowed_html).'</select>';
 
 
377
 
378
  if($is_ajax){
379
  die;
1
  <?php
2
+ /**
3
+ * Ajax Selectbox Page
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path admin_section/ajax-selectbox
8
+ * @version 1.1
9
+ */
10
+
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ /**
15
+ * List of hooks used in this context
16
+ */
17
  add_action('wp_ajax_create_ajax_select_sdwp','saswp_ajax_select_creator');
18
+ add_action('wp_ajax_create_ajax_select_sdwp_taxonomy','saswp_create_ajax_select_taxonomy');
19
+
20
+
21
  function saswp_ajax_select_creator($data = '', $saved_data= '', $current_number = '', $current_group_number ='') {
22
 
23
  $response = $data;
33
  $response = sanitize_text_field(wp_unslash($_POST["id"]));
34
  }
35
  if ( isset( $_POST["number"] ) ) {
36
+ $current_number = intval(sanitize_text_field($_POST["number"]));
37
  }
38
  if ( isset( $_POST["group_number"] ) ) {
39
+ $current_group_number = intval(sanitize_text_field($_POST["group_number"]));
40
  }
41
 
42
  }else{
136
 
137
  $templates = get_page_templates();
138
 
139
+ if($templates){
140
+
141
+ foreach($templates as $k => $v){
142
 
143
+ $choices[$v] = $k;
144
 
145
+ }
146
+
147
  }
148
+
149
 
150
  break;
151
 
300
  // endif;
301
 
302
  }
303
+ /**
304
+ * Function to Generate Proper Post Taxonomy for select and to add data.
305
+ * @return type array
306
+ * @since version 1.0
307
+ */
308
  function saswp_post_taxonomy_generator(){
309
 
310
  $taxonomies = '';
311
  $choices = array();
312
+
 
313
  $taxonomies = get_taxonomies( array('public' => true), 'objects' );
314
 
315
  if($taxonomies){
331
 
332
  return $choices;
333
  }
334
+ /**
335
+ * Function to create taxonomy
336
+ * @param type $selectedParentValue
337
+ * @param type $selectedValue
338
+ * @param type $current_number
339
+ * @param type $current_group_number
340
+ * @since version 1.0
341
+ */
342
  function saswp_create_ajax_select_taxonomy($selectedParentValue = '',$selectedValue='', $current_number ='', $current_group_number = ''){
343
 
344
  $is_ajax = false;
346
  if( $_SERVER['REQUEST_METHOD']=='POST'){
347
 
348
  $is_ajax = true;
349
+
350
  if(! current_user_can( 'manage_options' ) ) {
351
  exit;
352
  }
353
+
354
  if(wp_verify_nonce($_POST["saswp_call_nonce"],'saswp_select_action_nonce')){
355
 
356
  if(isset($_POST['id'])){
358
  $selectedParentValue = sanitize_text_field(wp_unslash($_POST['id']));
359
 
360
  }
361
+
362
  if(isset($_POST['number'])){
363
 
364
+ $current_number = intval(sanitize_text_field($_POST['number']));
365
 
366
  }
367
+
368
  if ( isset( $_POST["group_number"] ) ) {
369
 
370
+ $current_group_number = intval(sanitize_text_field($_POST["group_number"]));
371
 
372
  }
373
+
374
  }else{
375
 
376
  exit;
394
 
395
  $choices = '<option value="all">'.esc_html__('All','schema-and-structured-data-for-wp').'</option>';
396
 
397
+ if(!empty($taxonomies)){
398
+
399
+ foreach($taxonomies as $taxonomy) {
400
 
401
+ $sel="";
402
 
403
+ if($selectedValue == $taxonomy->slug){
404
 
405
+ $sel = "selected";
406
 
407
+ }
408
+ $choices .= '<option value="'.esc_attr($taxonomy->slug).'" '.esc_attr($sel).'>'.esc_html__($taxonomy->name,'schema-and-structured-data-for-wp').'</option>';
409
 
410
  }
411
 
412
  $allowed_html = saswp_expanded_allowed_tags();
413
 
414
  echo '<select class="widefat ajax-output-child" name="data_group_array[group-'. esc_attr($current_group_number) .'][data_array]['.esc_attr($current_number).'][key_4]">'. wp_kses($choices, $allowed_html).'</select>';
415
+
416
+ }
417
 
418
  if($is_ajax){
419
  die;
admin_section/common-function.php CHANGED
@@ -1,30 +1,91 @@
1
  <?php
 
 
 
 
 
 
 
 
 
2
  // Exit if accessed directly
3
  if ( ! defined('ABSPATH') ) exit;
4
- /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  * We are here fetching all schema and its settings from backup files
6
  * note: Transaction is applied on this function, if any error occure all the data will be rollbacked
7
  * @global type $wpdb
8
  * @return boolean
9
- */
10
- add_action('admin_init', 'saswp_import_all_settings_and_schema',9);
11
  function saswp_import_all_settings_and_schema(){
 
 
 
 
12
 
13
- $url = get_option('saswp-file-upload_url');
14
  global $wpdb;
15
- $result = '';
16
- $errorDesc = array();
17
-
 
 
 
 
18
  if($url){
19
 
20
  $json_data = file_get_contents($url);
21
- $json_array = json_decode($json_data, true);
22
- $all_schema_post = $json_array['posts'];
23
-
24
- $sd_data = $json_array['sd_data'];
 
 
 
 
 
 
25
  $schema_post = array();
26
 
27
- if($all_schema_post){
28
  // begin transaction
29
  $wpdb->query('START TRANSACTION');
30
 
@@ -36,49 +97,89 @@ if ( ! defined('ABSPATH') ) exit;
36
  $wpdb->query("UPDATE ".$wpdb->prefix."posts SET guid ='".esc_sql($guid)."' WHERE ID ='".esc_sql($post_id)."'");
37
 
38
  if ( isset( $schema_post['schema_type'] ) ){
39
- update_post_meta( $post_id, 'schema_type', esc_attr( $schema_post['schema_type'] ) );
40
  }
41
 
42
  if ( isset( $schema_post['saswp_business_type'] ) ){
43
- update_post_meta( $post_id, 'saswp_business_type', $schema_post['saswp_business_type'] );
44
  }
45
 
46
  if ( isset( $schema_post['saswp_business_name'] ) ){
47
- update_post_meta( $post_id, 'saswp_business_name', $schema_post['saswp_business_name'] );
48
  }
49
 
50
  if ( isset( $schema_post['saswp_local_business_details'] ) ){
51
- update_post_meta( $post_id, 'saswp_local_business_details', $schema_post['saswp_local_business_details'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
 
53
  if ( isset( $schema_post['data_group_array'] ) ){
54
- update_post_meta( $post_id, 'data_group_array', $schema_post['data_group_array'] );
 
55
  }
56
  if(is_wp_error($result)){
57
  $errorDesc[] = $result->get_error_message();
58
  }
59
- }
60
- }
61
- update_option('sd_data', $sd_data);
 
 
 
 
 
 
 
62
  update_option('saswp-file-upload_url','');
 
 
 
63
 
64
- if ( count($errorDesc) ){
65
- echo implode("\n<br/>", $errorDesc);
66
- $wpdb->query('ROLLBACK');
67
- }else{
68
- $wpdb->query('COMMIT');
69
- return true;
70
- }
71
 
72
- }
73
 
74
  }
75
- /**
76
  * We are here exporting all schema types and its settings as a backup file
77
  * @global type $wpdb
78
  * @return boolean
79
  */
80
  function saswp_export_all_settings_and_schema(){
81
 
 
 
 
 
 
 
 
 
 
 
 
82
  $export_data = array();
83
  $export_data_all = array();
84
  $schema_post = array();
@@ -94,7 +195,9 @@ if ( ! defined('ABSPATH') ) exit;
94
 
95
  );
96
 
97
- if($all_schema_post){
 
 
98
 
99
  foreach($all_schema_post as $schema){
100
 
@@ -144,10 +247,10 @@ if ( ! defined('ABSPATH') ) exit;
144
  $export_data[$schema->ID]['data_group_array'] = $data_group_array;
145
  $export_data[$schema->ID]['saswp_local_business_details'] = $local_business_details;
146
  }
 
 
 
147
 
148
- $get_sd_data = get_option('sd_data');
149
- $export_data_all['posts'] =$export_data;
150
- $export_data_all['sd_data'] =$get_sd_data;
151
  header('Content-type: application/json');
152
  header('Content-disposition: attachment; filename=structuredatabackup.json');
153
  echo json_encode($export_data_all);
@@ -160,9 +263,8 @@ if ( ! defined('ABSPATH') ) exit;
160
 
161
  }
162
  wp_die();
163
- }
164
- add_action( 'wp_ajax_saswp_export_all_settings_and_schema', 'saswp_export_all_settings_and_schema');
165
- /**
166
  * We are here fetching all schema and its settings from schema plugin
167
  * note: Transaction is applied on this function, if any error occure all the data will be rollbacked
168
  * @global type $wpdb
@@ -178,8 +280,8 @@ if ( ! defined('ABSPATH') ) exit;
178
  $all_schema_post = get_posts(
179
  array(
180
  'post_type' => 'schema',
181
- 'posts_per_page' => -1,
182
- 'post_status' => 'any',
183
  )
184
  );
185
 
@@ -214,7 +316,8 @@ if ( ! defined('ABSPATH') ) exit;
214
  'comment_count' => $schema->comment_count,
215
  'filter' => $schema->filter,
216
 
217
- );
 
218
  $post_id = wp_insert_post($schema_post);
219
  $result = $post_id;
220
  $guid = get_option('siteurl') .'/?post_type=saswp&p='.$post_id;
@@ -254,9 +357,9 @@ if ( ! defined('ABSPATH') ) exit;
254
  $schema_article_type = $schema_post_meta['_schema_article_type'][0];
255
  }
256
  $saswp_meta_key = array(
257
- 'schema_type' => $schema_article_type,
258
- 'data_group_array'=>$data_group_array,
259
- 'imported_from' => 'schema'
260
  );
261
 
262
  foreach ($saswp_meta_key as $key => $val){
@@ -275,11 +378,11 @@ if ( ! defined('ABSPATH') ) exit;
275
 
276
  $saswp_plugin_options = array(
277
  'sd_logo' => array(
278
- 'url' =>$schema_plugin_options['logo'],
279
- 'id' =>$custom_logo_id,
280
- 'height' =>'600',
281
- 'width' =>'60',
282
- 'thumbnail' =>$schema_plugin_options['logo']
283
  ),
284
  'saswp_kb_contact_1' => 0,
285
  //AMP Block
@@ -490,11 +593,11 @@ if ( ! defined('ABSPATH') ) exit;
490
  $image_details = wp_get_attachment_image_src($settings['seop_home_logo'], 'full');
491
 
492
  $local_business_details['local_business_logo'] = array(
493
- 'url' =>$image_details[0],
494
- 'id' =>$settings['site_image'],
495
- 'height' =>$image_details[1],
496
- 'width' =>$image_details[2],
497
- 'thumbnail' =>$image_details[0]
498
  );
499
  }
500
 
@@ -654,23 +757,23 @@ if ( ! defined('ABSPATH') ) exit;
654
 
655
  }
656
 
657
- if(isset($settings['person']['name'])){
658
- $saswp_plugin_options['sd-person-name'] = $settings['person']['name'];
659
- }
660
-
661
- if(isset($settings['person']['jobTitle'])){
662
- $saswp_plugin_options['sd-person-job-title'] = $settings['person']['jobTitle'];
663
- }
664
-
665
- if(isset($settings['person']['image'])){
666
- $image_details = wp_get_attachment_image_src($settings['person']['image'], 'full');
667
-
668
- $saswp_plugin_options['sd-person-image'] = array(
669
- 'url' =>$image_details[0],
670
- 'id' =>$settings['organization_logo'],
671
- 'height' =>$image_details[1],
672
- 'width' =>$image_details[2],
673
- 'thumbnail' =>$image_details[0]
674
  );
675
  }
676
 
@@ -678,11 +781,11 @@ if ( ! defined('ABSPATH') ) exit;
678
  $image_details = wp_get_attachment_image_src($settings['organization_logo'], 'full');
679
 
680
  $saswp_plugin_options['sd_logo'] = array(
681
- 'url' =>$image_details[0],
682
- 'id' =>$settings['organization_logo'],
683
- 'height' =>$image_details[1],
684
- 'width' =>$image_details[2],
685
- 'thumbnail' =>$image_details[0]
686
  );
687
  }
688
  if(isset($settings['contact']['contactType'])){
@@ -714,6 +817,7 @@ if ( ! defined('ABSPATH') ) exit;
714
 
715
 
716
  }
 
717
  function saswp_import_schema_pro_plugin_data(){
718
 
719
  $schema_post = array();
@@ -1116,264 +1220,271 @@ if ( ! defined('ABSPATH') ) exit;
1116
  }
1117
  }
1118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1119
  }
1120
 
 
1121
 
1122
- //Function to expand html tags form allowed html tags in wordpress
1123
- function saswp_expanded_allowed_tags() {
1124
- $my_allowed = wp_kses_allowed_html( 'post' );
1125
- // form fields - input
1126
- $my_allowed['input'] = array(
1127
- 'class' => array(),
1128
- 'id' => array(),
1129
- 'name' => array(),
1130
- 'value' => array(),
1131
- 'type' => array(),
1132
- 'style' => array(),
1133
- 'placeholder' => array(),
1134
- 'maxlength' => array(),
1135
- 'checked' => array(),
1136
- 'readonly' => array(),
1137
- 'disabled' => array(),
1138
- 'width' => array(),
1139
- 'data-id' => array(),
1140
- 'checked' => array()
1141
- );
1142
- $my_allowed['hidden'] = array(
1143
- 'id' => array(),
1144
- 'name' => array(),
1145
- 'value' => array(),
1146
- 'type' => array(),
1147
- 'data-id' => array(),
1148
- );
1149
- //number
1150
- $my_allowed['number'] = array(
1151
- 'class' => array(),
1152
- 'id' => array(),
1153
- 'name' => array(),
1154
- 'value' => array(),
1155
- 'type' => array(),
1156
- 'style' => array(),
1157
- 'width' => array(),
1158
- );
1159
- //textarea
1160
- $my_allowed['textarea'] = array(
1161
- 'class' => array(),
1162
- 'id' => array(),
1163
- 'name' => array(),
1164
- 'value' => array(),
1165
- 'type' => array(),
1166
- 'style' => array(),
1167
- 'rows' => array(),
1168
- );
1169
- // select
1170
- $my_allowed['select'] = array(
1171
- 'class' => array(),
1172
- 'id' => array(),
1173
- 'name' => array(),
1174
- 'value' => array(),
1175
- 'type' => array(),
1176
- );
1177
- // checkbox
1178
- $my_allowed['checkbox'] = array(
1179
- 'class' => array(),
1180
- 'id' => array(),
1181
- 'name' => array(),
1182
- 'value' => array(),
1183
- 'type' => array(),
1184
- 'disabled'=> array(),
1185
- );
1186
- // options
1187
- $my_allowed['option'] = array(
1188
- 'selected' => array(),
1189
- 'value' => array(),
1190
- );
1191
- // style
1192
- $my_allowed['style'] = array(
1193
- 'types' => array(),
1194
- );
1195
- return $my_allowed;
1196
- }
1197
- function saswp_admin_link($tab = '', $args = array()){
1198
-
1199
- $page = 'structured_data_options';
1200
-
1201
- if ( ! is_multisite() ) {
1202
- $link = admin_url( 'admin.php?page=' . $page );
1203
- }
1204
- else {
1205
- $link = admin_url( 'admin.php?page=' . $page );
1206
- }
1207
 
1208
- if ( $tab ) {
1209
- $link .= '&tab=' . $tab;
1210
  }
 
 
 
 
 
 
 
1211
 
1212
- if ( $args ) {
1213
- foreach ( $args as $arg => $value ) {
1214
- $link .= '&' . $arg . '=' . urlencode( $value );
1215
- }
1216
- }
1217
 
1218
- return esc_url($link);
1219
- }
1220
- function saswp_get_tab( $default = '', $available = array() ) {
1221
 
1222
- $tab = isset( $_GET['tab'] ) ? sanitize_text_field(wp_unslash($_GET['tab'])) : $default;
1223
- if ( ! in_array( $tab, $available ) ) {
1224
- $tab = $default;
1225
- }
1226
 
1227
- return $tab;
1228
- }
1229
 
1230
- add_action('plugins_loaded', 'saswp_defaultSettings' );
 
1231
 
1232
-
1233
- function saswp_defaultSettings(){
1234
-
1235
- global $sd_data;
1236
- $sd_name = 'default';
1237
- $logo = array();
1238
- $bloginfo = get_bloginfo('name', 'display');
1239
-
1240
- if($bloginfo){
1241
-
1242
- $sd_name =$bloginfo;
1243
-
1244
- }
1245
-
1246
- $current_url = get_home_url();
1247
- $custom_logo_id = get_theme_mod( 'custom_logo' );
1248
-
1249
- if($custom_logo_id){
1250
- $logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
1251
- }
1252
-
1253
- $user_id = get_current_user_id();
1254
- $username = '';
1255
-
1256
- if($user_id>0){
1257
-
1258
- $user_info = get_userdata($user_id);
1259
- $username = $user_info->data->display_name;
1260
-
1261
- }
1262
- $defaults = array(
1263
- //General Block
1264
- 'sd_about_page' => '',
1265
- 'sd_contact_page' => '',
1266
- //knowledge Block
1267
- 'saswp_kb_type' => 'Organization',
1268
- 'sd_name' => $sd_name,
1269
- 'sd_alt_name' => $sd_name,
1270
- 'sd_url' => $current_url,
1271
- 'sd-person-name' => $username,
1272
- 'sd-person-job-title'=> '',
1273
- 'sd-person-url' => $current_url,
1274
- 'sd-person-image' => array(
1275
- 'url' =>'',
1276
- 'id' =>'',
1277
- 'height' =>'',
1278
- 'width' =>'',
1279
- 'thumbnail' =>''
1280
- ),
1281
- 'sd-person-phone-number' => '',
1282
- 'saswp_kb_telephone' => '',
1283
- 'saswp_contact_type' => '',
1284
- 'saswp_kb_contact_1' => 0,
1285
- //Social
1286
- 'sd_facebook' => '',
1287
- 'sd_twitter' => '',
1288
- 'sd_instagram' => '',
1289
- 'sd_youtube' => '',
1290
- 'sd_linkedin' => '',
1291
- 'sd_pinterest' => '',
1292
- 'sd_soundcloud' => '',
1293
- 'sd_tumblr' => '',
1294
 
1295
- //AMP Block
1296
- 'saswp-for-amp' => 1,
1297
- 'saswp-for-wordpress' => 1,
1298
- 'saswp-yoast' => 1,
1299
- 'saswp-logo-width' => '60',
1300
- 'saswp-logo-height' => '60',
1301
- 'sd_initial_wizard_status' => 1,
1302
 
1303
- );
1304
-
1305
- if(is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')){
1306
-
1307
- $defaults['saswp-yoast'] = 1;
1308
-
1309
- }
1310
-
1311
- if(is_array($logo)){
1312
-
1313
- $defaults['sd_logo'] = array(
1314
- 'url' => array_key_exists(0, $logo)? $logo[0]:'',
1315
- 'id' => $custom_logo_id,
1316
- 'height' => array_key_exists(2, $logo)? $logo[2]:'',
1317
- 'width' => array_key_exists(1, $logo)? $logo[1]:'',
1318
- 'thumbnail' => array_key_exists(0, $logo)? $logo[0]:''
1319
- );
1320
-
1321
- $defaults['sd-data-logo-ampforwp'] = array(
1322
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1323
  'url' => array_key_exists(0, $logo)? $logo[0]:'',
1324
  'id' => $custom_logo_id,
1325
  'height' => array_key_exists(2, $logo)? $logo[2]:'',
1326
  'width' => array_key_exists(1, $logo)? $logo[1]:'',
1327
  'thumbnail' => array_key_exists(0, $logo)? $logo[0]:''
1328
-
1329
- );
1330
-
1331
- $defaults['sd_default_image'] = array(
1332
- 'url' => array_key_exists(0, $logo)? $logo[0]:'',
1333
- 'id' => $custom_logo_id,
1334
- 'height' => array_key_exists(2, $logo)? $logo[2]:'',
1335
- 'width' => array_key_exists(1, $logo)? $logo[1]:'',
1336
- 'thumbnail' => array_key_exists(0, $logo)? $logo[0]:''
1337
- );
1338
-
1339
- $defaults['sd_default_image_width'] = array_key_exists(1, $logo)? $logo[1]:'';
1340
- $defaults['sd_default_image_height'] = array_key_exists(2, $logo)? $logo[2]:'';
1341
  }
1342
-
1343
- $sd_data = get_option( 'sd_data', $defaults);
1344
-
1345
- return $sd_data;
1346
-
1347
- }
1348
- function saswp_frontend_enqueue(){
1349
-
1350
- global $sd_data;
1351
-
1352
-
1353
- if(isset($sd_data['saswp-review-module']) && $sd_data['saswp-review-module'] == 1){
1354
-
1355
- $review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
1356
-
1357
- if(isset($review_details['saswp-review-item-enable'])){
1358
-
1359
- wp_enqueue_style( 'saswp-style', SASWP_PLUGIN_URL . 'admin_section/css/saswp-style.min.css', false , SASWP_VERSION );
1360
-
1361
- }
1362
-
1363
- }
1364
-
1365
- if(isset($sd_data['saswp-google-review']) && $sd_data['saswp-google-review'] == 1 ){
1366
-
1367
- wp_enqueue_style( 'saswp-style', SASWP_PLUGIN_URL . 'admin_section/css/saswp-style.min.css', false , SASWP_VERSION );
1368
-
1369
- }
1370
-
1371
-
1372
- }
1373
-
1374
- add_action( 'wp_enqueue_scripts', 'saswp_frontend_enqueue' );
1375
-
1376
- function saswp_enque_amp_script(){
1377
 
1378
  global $sd_data;
1379
  $saswp_review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
@@ -1656,22 +1767,29 @@ function saswp_frontend_enqueue(){
1656
 
1657
 
1658
  }
1659
- add_action('amp_post_template_css','saswp_enque_amp_script');
1660
-
 
 
1661
  function saswp_get_the_author_name(){
1662
 
1663
- $author_id = get_the_author_meta('ID');
1664
- $aurthor_name = get_the_author();
1665
-
1666
- if(!$aurthor_name){
1667
-
1668
- $author_id = get_post_field ('post_author', get_the_ID());
1669
- $aurthor_name = get_the_author_meta( 'display_name' , $author_id );
1670
-
1671
- }
1672
- return $aurthor_name;
1673
  }
1674
-
 
 
 
 
 
1675
  function saswp_get_attachment_details($attachments, $post_id = null) {
1676
 
1677
  $response = array();
@@ -1709,132 +1827,200 @@ function saswp_frontend_enqueue(){
1709
  return $cached_data;
1710
 
1711
  }
1712
- /**
1713
- * Here we are modifying the default excerpt
1714
- * @global type $post
1715
- * @return type string
1716
- */
1717
- function saswp_get_the_excerpt() {
1718
-
1719
- global $post;
1720
- global $sd_data;
1721
- $excerpt = '';
1722
- if(is_object($post)){
1723
-
1724
- $excerpt = $post->post_excerpt;
1725
-
1726
- if(empty($excerpt)){
1727
-
1728
- $excerpt_length = apply_filters( 'excerpt_length', 55 );
1729
 
1730
- $excerpt_more = '';
1731
- $excerpt = wp_trim_words( $post->post_content, $excerpt_length, $excerpt_more );
1732
  }
1733
-
1734
- if(strpos($excerpt, "<p>")!==false){
1735
-
1736
- $regex = '/<p>(.*?)<\/p>/';
1737
- preg_match_all($regex, $excerpt, $matches);
1738
-
1739
- if(is_array($matches[1])){
1740
- $excerpt = implode(" ", $matches[1]);
 
 
 
 
 
 
 
 
 
 
 
 
1741
  }
1742
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1743
  }
1744
-
1745
- $excerpt = wp_strip_all_tags(strip_shortcodes($excerpt));
1746
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1747
  }
1748
-
1749
- if(saswp_global_option() && saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') == 1){
1750
-
1751
- $yoast_meta_des = get_post_meta($post->ID, '_yoast_wpseo_metadesc', true);
1752
-
1753
- if($yoast_meta_des){
1754
-
1755
- $excerpt = $yoast_meta_des;
1756
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1757
  }
1758
-
 
 
1759
  }
1760
-
1761
- return $excerpt;
1762
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1763
 
1764
- /**
1765
- * since @1.8.7
1766
- * Here we are modifying the default title
1767
- * @global type $post
1768
- * @return type string
1769
- */
1770
- function saswp_get_the_title(){
1771
-
1772
- global $post;
1773
- global $sd_data;
1774
-
1775
- if(saswp_global_option() && saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') == 1){
1776
-
1777
- if(is_object($post)){
1778
-
1779
- $yoast_title = get_post_meta($post->ID, '_yoast_wpseo_title', true);
1780
-
1781
  }
1782
-
1783
- if($yoast_title){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1784
 
1785
- $title = $yoast_title;
1786
 
1787
- }else{
 
 
 
 
 
 
 
 
 
1788
 
1789
- $title = get_the_title();
1790
 
1791
  }
1792
 
1793
- }else{
1794
-
1795
- $title = get_the_title();
1796
- }
1797
-
1798
- return $title;
1799
-
1800
- }
1801
- /**
1802
- * since @1.8.7
1803
- * Get the author details
1804
- * @global type $post
1805
- * @return type array
1806
- */
1807
- function saswp_get_author_details(){
1808
-
1809
- global $post;
1810
-
1811
- $author_details = array();
1812
-
1813
- $author_id = get_the_author_meta('ID');
1814
- $author_name = get_the_author();
1815
- $author_desc = get_the_author_meta( 'user_description' );
1816
-
1817
- if(!$author_name && is_object($post)){
1818
-
1819
- $author_id = get_post_field ('post_author', $post->ID);
1820
- $author_name = get_the_author_meta( 'display_name' , $author_id );
1821
-
1822
  }
1823
 
1824
- $author_image = get_avatar_data($author_id);
1825
-
1826
- $author_details['@type'] = 'Person';
1827
- $author_details['name'] = esc_attr($author_name);
1828
- $author_details['description'] = esc_attr($author_desc);
1829
-
1830
- if(isset($author_image['url']) && isset($author_image['height']) && isset($author_image['width'])){
1831
-
1832
- $author_details['image']['@type'] = 'ImageObject';
1833
- $author_details['image']['url'] = $author_image['url'];
1834
- $author_details['image']['height'] = $author_image['height'];
1835
- $author_details['image']['width'] = $author_image['width'];
1836
-
1837
- }
1838
-
1839
- return $author_details;
1840
- }
1
  <?php
2
+ /**
3
+ * Common function file
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path admin_section/common-function
8
+ * @version 1.1
9
+ */
10
+
11
  // Exit if accessed directly
12
  if ( ! defined('ABSPATH') ) exit;
13
+
14
+ /**
15
+ * List of hooks used in this context
16
+ */
17
+ add_action('admin_init', 'saswp_import_all_settings_and_schema',9);
18
+ add_action( 'wp_ajax_saswp_export_all_settings_and_schema', 'saswp_export_all_settings_and_schema');
19
+ add_action('plugins_loaded', 'saswp_defaultSettings' );
20
+ add_action( 'wp_enqueue_scripts', 'saswp_frontend_enqueue' );
21
+ add_action('amp_post_template_css','saswp_enqueue_amp_script');
22
+
23
+
24
+ //global variable to store List of labels starts here
25
+ $translation_labels = array(
26
+ 'translation-pros' => 'Pros',
27
+ 'translation-cons' => 'Cons',
28
+ 'translation-review-overview' => 'Review Overview',
29
+ 'translation-overall-score' => 'Overall Score',
30
+ );
31
+ //global variable to store List of labels ends here
32
+
33
+ /**
34
+ * Function to get manual translated text
35
+ * @global array $translation_labels
36
+ * @global type $sd_data
37
+ * @param type $label_key
38
+ * @return string
39
+ */
40
+ function saswp_label_text($label_key){
41
+
42
+ global $translation_labels;
43
+ global $sd_data;
44
+
45
+ if(isset($sd_data[$label_key]) && $sd_data[$label_key] !=''){
46
+ return $sd_data[$label_key];
47
+ }else{
48
+ return $translation_labels[$label_key];
49
+ }
50
+
51
+ }
52
+
53
+ /**
54
  * We are here fetching all schema and its settings from backup files
55
  * note: Transaction is applied on this function, if any error occure all the data will be rollbacked
56
  * @global type $wpdb
57
  * @return boolean
58
+ */
 
59
  function saswp_import_all_settings_and_schema(){
60
+
61
+ if ( ! current_user_can( 'manage_options' ) ) {
62
+ return;
63
+ }
64
 
 
65
  global $wpdb;
66
+
67
+ $result = '';
68
+ $errorDesc = array();
69
+ $all_schema_post = array();
70
+
71
+ $url = get_option('saswp-file-upload_url');
72
+
73
  if($url){
74
 
75
  $json_data = file_get_contents($url);
76
+
77
+ if($json_data){
78
+
79
+ $json_array = json_decode($json_data, true);
80
+ if(array_key_exists('posts', $json_array)){
81
+
82
+ $all_schema_post = $json_array['posts'];
83
+
84
+ }
85
+
86
  $schema_post = array();
87
 
88
+ if($all_schema_post && is_array($all_schema_post)){
89
  // begin transaction
90
  $wpdb->query('START TRANSACTION');
91
 
97
  $wpdb->query("UPDATE ".$wpdb->prefix."posts SET guid ='".esc_sql($guid)."' WHERE ID ='".esc_sql($post_id)."'");
98
 
99
  if ( isset( $schema_post['schema_type'] ) ){
100
+ update_post_meta( $post_id, 'schema_type', sanitize_text_field($schema_post['schema_type']) );
101
  }
102
 
103
  if ( isset( $schema_post['saswp_business_type'] ) ){
104
+ update_post_meta( $post_id, 'saswp_business_type', sanitize_text_field($schema_post['saswp_business_type']) );
105
  }
106
 
107
  if ( isset( $schema_post['saswp_business_name'] ) ){
108
+ update_post_meta( $post_id, 'saswp_business_name', sanitize_text_field($schema_post['saswp_business_name']) );
109
  }
110
 
111
  if ( isset( $schema_post['saswp_local_business_details'] ) ){
112
+
113
+ $local_data = $schema_post['saswp_local_business_details'];
114
+
115
+ if($local_data){
116
+
117
+ foreach($local_data as $key => $local){
118
+
119
+ if($key == 'local_business_logo'){
120
+
121
+ $local_data[$key] = array_map('sanitize_text_field', $local);
122
+ }else{
123
+ $local_data[$key] = sanitize_text_field($local);
124
+ }
125
+
126
+ }
127
+ }
128
+
129
+ update_post_meta( $post_id, 'saswp_local_business_details', $local_data );
130
  }
131
+
132
  if ( isset( $schema_post['data_group_array'] ) ){
133
+ $data_array = saswp_sanitize_multi_array($schema_post['data_group_array'], 'data_array');
134
+ update_post_meta( $post_id, 'data_group_array', $data_array );
135
  }
136
  if(is_wp_error($result)){
137
  $errorDesc[] = $result->get_error_message();
138
  }
139
+ }
140
+
141
+ }
142
+
143
+ if(array_key_exists('sd_data', $json_array)){
144
+
145
+ $sd_data = array_map( 'sanitize_text_field' ,$json_array['sd_data']);
146
+ update_option('sd_data', $sd_data);
147
+ }
148
+
149
  update_option('saswp-file-upload_url','');
150
+
151
+ }
152
+
153
 
154
+ if ( count($errorDesc) ){
155
+ echo implode("\n<br/>", $errorDesc);
156
+ $wpdb->query('ROLLBACK');
157
+ }else{
158
+ $wpdb->query('COMMIT');
159
+ return true;
160
+ }
161
 
162
+ }
163
 
164
  }
165
+ /**
166
  * We are here exporting all schema types and its settings as a backup file
167
  * @global type $wpdb
168
  * @return boolean
169
  */
170
  function saswp_export_all_settings_and_schema(){
171
 
172
+ if ( ! current_user_can( 'manage_options' ) ) {
173
+ return;
174
+ }
175
+ if ( ! isset( $_GET['_wpnonce'] ) ){
176
+ return;
177
+ }
178
+
179
+ if ( !wp_verify_nonce( $_GET['_wpnonce'], '_wpnonce' ) ){
180
+ return;
181
+ }
182
+
183
  $export_data = array();
184
  $export_data_all = array();
185
  $schema_post = array();
195
 
196
  );
197
 
198
+ $get_sd_data = get_option('sd_data');
199
+
200
+ if($all_schema_post || $get_sd_data){
201
 
202
  foreach($all_schema_post as $schema){
203
 
247
  $export_data[$schema->ID]['data_group_array'] = $data_group_array;
248
  $export_data[$schema->ID]['saswp_local_business_details'] = $local_business_details;
249
  }
250
+
251
+ $export_data_all['posts'] = $export_data;
252
+ $export_data_all['sd_data'] = $get_sd_data;
253
 
 
 
 
254
  header('Content-type: application/json');
255
  header('Content-disposition: attachment; filename=structuredatabackup.json');
256
  echo json_encode($export_data_all);
263
 
264
  }
265
  wp_die();
266
+ }
267
+ /**
 
268
  * We are here fetching all schema and its settings from schema plugin
269
  * note: Transaction is applied on this function, if any error occure all the data will be rollbacked
270
  * @global type $wpdb
280
  $all_schema_post = get_posts(
281
  array(
282
  'post_type' => 'schema',
283
+ 'posts_per_page' => -1,
284
+ 'post_status' => 'any',
285
  )
286
  );
287
 
316
  'comment_count' => $schema->comment_count,
317
  'filter' => $schema->filter,
318
 
319
+ );
320
+
321
  $post_id = wp_insert_post($schema_post);
322
  $result = $post_id;
323
  $guid = get_option('siteurl') .'/?post_type=saswp&p='.$post_id;
357
  $schema_article_type = $schema_post_meta['_schema_article_type'][0];
358
  }
359
  $saswp_meta_key = array(
360
+ 'schema_type' => $schema_article_type,
361
+ 'data_group_array' => $data_group_array,
362
+ 'imported_from' => 'schema'
363
  );
364
 
365
  foreach ($saswp_meta_key as $key => $val){
378
 
379
  $saswp_plugin_options = array(
380
  'sd_logo' => array(
381
+ 'url' => $schema_plugin_options['logo'],
382
+ 'id' => $custom_logo_id,
383
+ 'height' => '600',
384
+ 'width' => '60',
385
+ 'thumbnail' => $schema_plugin_options['logo']
386
  ),
387
  'saswp_kb_contact_1' => 0,
388
  //AMP Block
593
  $image_details = wp_get_attachment_image_src($settings['seop_home_logo'], 'full');
594
 
595
  $local_business_details['local_business_logo'] = array(
596
+ 'url' => $image_details[0],
597
+ 'id' => $settings['site_image'],
598
+ 'height' => $image_details[1],
599
+ 'width' => $image_details[2],
600
+ 'thumbnail' => $image_details[0]
601
  );
602
  }
603
 
757
 
758
  }
759
 
760
+ if(isset($settings['person']['name'])){
761
+ $saswp_plugin_options['sd-person-name'] = $settings['person']['name'];
762
+ }
763
+
764
+ if(isset($settings['person']['jobTitle'])){
765
+ $saswp_plugin_options['sd-person-job-title'] = $settings['person']['jobTitle'];
766
+ }
767
+
768
+ if(isset($settings['person']['image'])){
769
+ $image_details = wp_get_attachment_image_src($settings['person']['image'], 'full');
770
+
771
+ $saswp_plugin_options['sd-person-image'] = array(
772
+ 'url' => $image_details[0],
773
+ 'id' => $settings['organization_logo'],
774
+ 'height' => $image_details[1],
775
+ 'width' => $image_details[2],
776
+ 'thumbnail' => $image_details[0]
777
  );
778
  }
779
 
781
  $image_details = wp_get_attachment_image_src($settings['organization_logo'], 'full');
782
 
783
  $saswp_plugin_options['sd_logo'] = array(
784
+ 'url' => $image_details[0],
785
+ 'id' => $settings['organization_logo'],
786
+ 'height' => $image_details[1],
787
+ 'width' => $image_details[2],
788
+ 'thumbnail' => $image_details[0]
789
  );
790
  }
791
  if(isset($settings['contact']['contactType'])){
817
 
818
 
819
  }
820
+
821
  function saswp_import_schema_pro_plugin_data(){
822
 
823
  $schema_post = array();
1220
  }
1221
  }
1222
 
1223
+ }
1224
+ //Function to expand html tags form allowed html tags in wordpress
1225
+ function saswp_expanded_allowed_tags() {
1226
+ $my_allowed = wp_kses_allowed_html( 'post' );
1227
+ // form fields - input
1228
+ $my_allowed['input'] = array(
1229
+ 'class' => array(),
1230
+ 'id' => array(),
1231
+ 'name' => array(),
1232
+ 'value' => array(),
1233
+ 'type' => array(),
1234
+ 'style' => array(),
1235
+ 'placeholder' => array(),
1236
+ 'maxlength' => array(),
1237
+ 'checked' => array(),
1238
+ 'readonly' => array(),
1239
+ 'disabled' => array(),
1240
+ 'width' => array(),
1241
+ 'data-id' => array(),
1242
+ 'checked' => array()
1243
+ );
1244
+ $my_allowed['hidden'] = array(
1245
+ 'id' => array(),
1246
+ 'name' => array(),
1247
+ 'value' => array(),
1248
+ 'type' => array(),
1249
+ 'data-id' => array(),
1250
+ );
1251
+ //number
1252
+ $my_allowed['number'] = array(
1253
+ 'class' => array(),
1254
+ 'id' => array(),
1255
+ 'name' => array(),
1256
+ 'value' => array(),
1257
+ 'type' => array(),
1258
+ 'style' => array(),
1259
+ 'width' => array(),
1260
+ );
1261
+ //textarea
1262
+ $my_allowed['textarea'] = array(
1263
+ 'class' => array(),
1264
+ 'id' => array(),
1265
+ 'name' => array(),
1266
+ 'value' => array(),
1267
+ 'type' => array(),
1268
+ 'style' => array(),
1269
+ 'rows' => array(),
1270
+ );
1271
+ // select
1272
+ $my_allowed['select'] = array(
1273
+ 'class' => array(),
1274
+ 'id' => array(),
1275
+ 'name' => array(),
1276
+ 'value' => array(),
1277
+ 'type' => array(),
1278
+ );
1279
+ // checkbox
1280
+ $my_allowed['checkbox'] = array(
1281
+ 'class' => array(),
1282
+ 'id' => array(),
1283
+ 'name' => array(),
1284
+ 'value' => array(),
1285
+ 'type' => array(),
1286
+ 'disabled'=> array(),
1287
+ );
1288
+ // options
1289
+ $my_allowed['option'] = array(
1290
+ 'selected' => array(),
1291
+ 'value' => array(),
1292
+ );
1293
+ // style
1294
+ $my_allowed['style'] = array(
1295
+ 'types' => array(),
1296
+ );
1297
+ return $my_allowed;
1298
+ }
1299
+
1300
+ function saswp_admin_link($tab = '', $args = array()){
1301
+
1302
+ $page = 'structured_data_options';
1303
+
1304
+ if ( ! is_multisite() ) {
1305
+ $link = admin_url( 'admin.php?page=' . $page );
1306
+ }
1307
+ else {
1308
+ $link = admin_url( 'admin.php?page=' . $page );
1309
+ }
1310
+
1311
+ if ( $tab ) {
1312
+ $link .= '&tab=' . $tab;
1313
+ }
1314
+
1315
+ if ( $args ) {
1316
+ foreach ( $args as $arg => $value ) {
1317
+ $link .= '&' . $arg . '=' . urlencode( $value );
1318
+ }
1319
+ }
1320
+
1321
+ return esc_url($link);
1322
  }
1323
 
1324
+ function saswp_get_tab( $default = '', $available = array() ) {
1325
 
1326
+ $tab = isset( $_GET['tab'] ) ? sanitize_text_field(wp_unslash($_GET['tab'])) : $default;
1327
+ if ( ! in_array( $tab, $available ) ) {
1328
+ $tab = $default;
1329
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1330
 
1331
+ return $tab;
 
1332
  }
1333
+ /**
1334
+ * Function to get schema settings
1335
+ * @global type $sd_data
1336
+ * @return type array
1337
+ * @since version 1.0
1338
+ */
1339
+ function saswp_defaultSettings(){
1340
 
1341
+ global $sd_data;
1342
+ $sd_name = 'default';
1343
+ $logo = array();
1344
+ $bloginfo = get_bloginfo('name', 'display');
 
1345
 
1346
+ if($bloginfo){
 
 
1347
 
1348
+ $sd_name =$bloginfo;
 
 
 
1349
 
1350
+ }
 
1351
 
1352
+ $current_url = get_home_url();
1353
+ $custom_logo_id = get_theme_mod( 'custom_logo' );
1354
 
1355
+ if($custom_logo_id){
1356
+ $logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
1357
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1358
 
1359
+ $user_id = get_current_user_id();
1360
+ $username = '';
 
 
 
 
 
1361
 
1362
+ if($user_id>0){
1363
+
1364
+ $user_info = get_userdata($user_id);
1365
+ $username = $user_info->data->display_name;
1366
+
1367
+ }
1368
+ $defaults = array(
1369
+ //General Block
1370
+ 'sd_about_page' => '',
1371
+ 'sd_contact_page' => '',
1372
+ //knowledge Block
1373
+ 'saswp_kb_type' => 'Organization',
1374
+ 'sd_name' => $sd_name,
1375
+ 'sd_alt_name' => $sd_name,
1376
+ 'sd_url' => $current_url,
1377
+ 'sd-person-name' => $username,
1378
+ 'sd-person-job-title'=> '',
1379
+ 'sd-person-url' => $current_url,
1380
+ 'sd-person-image' => array(
1381
+ 'url' =>'',
1382
+ 'id' =>'',
1383
+ 'height' =>'',
1384
+ 'width' =>'',
1385
+ 'thumbnail' =>''
1386
+ ),
1387
+ 'sd-person-phone-number' => '',
1388
+ 'saswp_kb_telephone' => '',
1389
+ 'saswp_contact_type' => '',
1390
+ 'saswp_kb_contact_1' => 0,
1391
+ //Social
1392
+ 'sd_facebook' => '',
1393
+ 'sd_twitter' => '',
1394
+ 'sd_instagram' => '',
1395
+ 'sd_youtube' => '',
1396
+ 'sd_linkedin' => '',
1397
+ 'sd_pinterest' => '',
1398
+ 'sd_soundcloud' => '',
1399
+ 'sd_tumblr' => '',
1400
+
1401
+ //AMP Block
1402
+ 'saswp-for-amp' => 1,
1403
+ 'saswp-for-wordpress' => 1,
1404
+ 'saswp-yoast' => 1,
1405
+ 'saswp-logo-width' => '60',
1406
+ 'saswp-logo-height' => '60',
1407
+ 'sd_initial_wizard_status' => 1,
1408
+
1409
+ );
1410
+
1411
+ if(is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php')){
1412
+
1413
+ $defaults['saswp-yoast'] = 1;
1414
+
1415
+ }
1416
+
1417
+ if(is_array($logo)){
1418
+
1419
+ $defaults['sd_logo'] = array(
1420
+ 'url' => array_key_exists(0, $logo)? $logo[0]:'',
1421
+ 'id' => $custom_logo_id,
1422
+ 'height' => array_key_exists(2, $logo)? $logo[2]:'',
1423
+ 'width' => array_key_exists(1, $logo)? $logo[1]:'',
1424
+ 'thumbnail' => array_key_exists(0, $logo)? $logo[0]:''
1425
+ );
1426
+
1427
+ $defaults['sd-data-logo-ampforwp'] = array(
1428
+
1429
+ 'url' => array_key_exists(0, $logo)? $logo[0]:'',
1430
+ 'id' => $custom_logo_id,
1431
+ 'height' => array_key_exists(2, $logo)? $logo[2]:'',
1432
+ 'width' => array_key_exists(1, $logo)? $logo[1]:'',
1433
+ 'thumbnail' => array_key_exists(0, $logo)? $logo[0]:''
1434
+
1435
+ );
1436
+
1437
+ $defaults['sd_default_image'] = array(
1438
  'url' => array_key_exists(0, $logo)? $logo[0]:'',
1439
  'id' => $custom_logo_id,
1440
  'height' => array_key_exists(2, $logo)? $logo[2]:'',
1441
  'width' => array_key_exists(1, $logo)? $logo[1]:'',
1442
  'thumbnail' => array_key_exists(0, $logo)? $logo[0]:''
1443
+ );
1444
+
1445
+ $defaults['sd_default_image_width'] = array_key_exists(1, $logo)? $logo[1]:'';
1446
+ $defaults['sd_default_image_height'] = array_key_exists(2, $logo)? $logo[2]:'';
1447
+ }
1448
+
1449
+ $sd_data = get_option( 'sd_data', $defaults);
1450
+
1451
+ return $sd_data;
1452
+
 
 
 
1453
  }
1454
+ /**
1455
+ * Function to enqueue css and js in frontend
1456
+ * @global type $sd_data
1457
+ */
1458
+ function saswp_frontend_enqueue(){
1459
+
1460
+ global $sd_data;
1461
+
1462
+
1463
+ if(isset($sd_data['saswp-review-module']) && $sd_data['saswp-review-module'] == 1){
1464
+
1465
+ $review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
1466
+
1467
+ if(isset($review_details['saswp-review-item-enable'])){
1468
+
1469
+ wp_enqueue_style( 'saswp-style', SASWP_PLUGIN_URL . 'admin_section/css/saswp-style.min.css', false , SASWP_VERSION );
1470
+
1471
+ }
1472
+
1473
+ }
1474
+
1475
+ if(isset($sd_data['saswp-google-review']) && $sd_data['saswp-google-review'] == 1 ){
1476
+
1477
+ wp_enqueue_style( 'saswp-style', SASWP_PLUGIN_URL . 'admin_section/css/saswp-style.min.css', false , SASWP_VERSION );
1478
+
1479
+ }
1480
+
1481
+
1482
+ }
1483
+ /**
1484
+ * Function to enqueue css in amp version
1485
+ * @global type $sd_data
1486
+ */
1487
+ function saswp_enqueue_amp_script(){
 
1488
 
1489
  global $sd_data;
1490
  $saswp_review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
1767
 
1768
 
1769
  }
1770
+ /**
1771
+ * Function to get author name
1772
+ * @return type string
1773
+ */
1774
  function saswp_get_the_author_name(){
1775
 
1776
+ $author_id = get_the_author_meta('ID');
1777
+ $aurthor_name = get_the_author();
1778
+
1779
+ if(!$aurthor_name){
1780
+
1781
+ $author_id = get_post_field ('post_author', get_the_ID());
1782
+ $aurthor_name = get_the_author_meta( 'display_name' , $author_id );
1783
+
1784
+ }
1785
+ return $aurthor_name;
1786
  }
1787
+ /**
1788
+ * Function to get post attachement details by attachement url or id
1789
+ * @param type $attachments
1790
+ * @param type $post_id
1791
+ * @return type array
1792
+ */
1793
  function saswp_get_attachment_details($attachments, $post_id = null) {
1794
 
1795
  $response = array();
1827
  return $cached_data;
1828
 
1829
  }
1830
+ /**
1831
+ * Here we are getting article full body content
1832
+ * @global type $post
1833
+ * @return type string
1834
+ */
1835
+ function saswp_get_the_content(){
1836
+
1837
+ global $post;
1838
+ $content = '';
1839
+ if(is_object($post)){
1840
+ $content = get_post_field('post_content', $post->ID);
1841
+ }
1842
+
1843
+ return $content;
 
 
 
1844
 
 
 
1845
  }
1846
+ /**
1847
+ * Here we are modifying the default excerpt
1848
+ * @global type $post
1849
+ * @return type string
1850
+ */
1851
+ function saswp_get_the_excerpt() {
1852
+
1853
+ global $post;
1854
+ global $sd_data;
1855
+ $excerpt = '';
1856
+ if(is_object($post)){
1857
+
1858
+ $excerpt = $post->post_excerpt;
1859
+
1860
+ if(empty($excerpt)){
1861
+
1862
+ $excerpt_length = apply_filters( 'excerpt_length', 55 );
1863
+
1864
+ $excerpt_more = '';
1865
+ $excerpt = wp_trim_words( $post->post_content, $excerpt_length, $excerpt_more );
1866
  }
1867
+
1868
+ if(strpos($excerpt, "<p>")!==false){
1869
+
1870
+ $regex = '/<p>(.*?)<\/p>/';
1871
+ preg_match_all($regex, $excerpt, $matches);
1872
+
1873
+ if(is_array($matches[1])){
1874
+ $excerpt = implode(" ", $matches[1]);
1875
+ }
1876
+
1877
+ }
1878
+
1879
+ $excerpt = wp_strip_all_tags(strip_shortcodes($excerpt));
1880
+
1881
+ }
1882
+
1883
+ if(saswp_global_option() && saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') == 1){
1884
+
1885
+ $yoast_meta_des = saswp_convert_yoast_metafields($post->ID, 'metadesc');
1886
+
1887
+ if($yoast_meta_des){
1888
+
1889
+ $excerpt = $yoast_meta_des;
1890
+
1891
+ }
1892
+
1893
+ }
1894
+
1895
+ return $excerpt;
1896
  }
1897
+ /**
1898
+ * since @1.8.9
1899
+ * Here, we are getting meta fields value from yoast seo
1900
+ * @global type $post
1901
+ * @return type string
1902
+ */
1903
+ function saswp_convert_yoast_metafields ($post_id, $field) {
1904
+
1905
+ if(class_exists('WPSEO_Meta') && class_exists('WPSEO_Replace_Vars')){
1906
+
1907
+ $string = WPSEO_Meta::get_value( $field, $post_id );
1908
+ if ($string !== '') {
1909
+ $replacer = new WPSEO_Replace_Vars();
1910
+
1911
+ return $replacer->replace( $string, get_post($post_id) );
1912
+ }
1913
+
1914
+ }
1915
+ return '';
1916
  }
1917
+ /**
1918
+ * since @1.8.7
1919
+ * Here we are modifying the default title
1920
+ * @global type $post
1921
+ * @return type string
1922
+ */
1923
+ function saswp_get_the_title(){
1924
+
1925
+ global $post;
1926
+ global $sd_data;
1927
+
1928
+ if(saswp_global_option() && saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') == 1){
1929
+
1930
+ if(is_object($post)){
1931
+
1932
+ $yoast_title = saswp_convert_yoast_metafields($post->ID, 'title');
1933
+
1934
+ }
1935
+
1936
+ if($yoast_title){
1937
+
1938
+ $title = $yoast_title;
1939
+
1940
+ }else{
1941
+
1942
+ $title = get_the_title();
1943
+
1944
+ }
1945
+
1946
+ }else{
1947
+
1948
+ $title = get_the_title();
1949
  }
1950
+
1951
+ return $title;
1952
+
1953
  }
1954
+ /**
1955
+ * since @1.8.7
1956
+ * Get the author details
1957
+ * @global type $post
1958
+ * @return type array
1959
+ */
1960
+ function saswp_get_author_details(){
1961
+
1962
+ global $post;
1963
+
1964
+ $author_details = array();
1965
+
1966
+ $author_id = get_the_author_meta('ID');
1967
+ $author_name = get_the_author();
1968
+ $author_desc = get_the_author_meta( 'user_description' );
1969
+
1970
+ if(!$author_name && is_object($post)){
1971
+
1972
+ $author_id = get_post_field ('post_author', $post->ID);
1973
+ $author_name = get_the_author_meta( 'display_name' , $author_id );
1974
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1975
  }
1976
+
1977
+ $author_image = get_avatar_data($author_id);
1978
+
1979
+ $author_details['@type'] = 'Person';
1980
+ $author_details['name'] = esc_attr($author_name);
1981
+ $author_details['description'] = esc_attr($author_desc);
1982
+
1983
+ if(isset($author_image['url']) && isset($author_image['height']) && isset($author_image['width'])){
1984
+
1985
+ $author_details['image']['@type'] = 'ImageObject';
1986
+ $author_details['image']['url'] = $author_image['url'];
1987
+ $author_details['image']['height'] = $author_image['height'];
1988
+ $author_details['image']['width'] = $author_image['width'];
1989
+
1990
+ }
1991
+
1992
+ return $author_details;
1993
+ }
1994
+ /**
1995
+ * Function to sanitize display condition and user targeting
1996
+ * @param type $array
1997
+ * @param type $type
1998
+ * @return type array
1999
+ */
2000
+ function saswp_sanitize_multi_array($array, $type){
2001
+
2002
+ if($array){
2003
+
2004
+ foreach($array as $group => $condition){
2005
 
2006
+ $group_condition = $condition[$type];
2007
 
2008
+ foreach ($group_condition as $con_key => $con_val){
2009
+
2010
+ foreach($con_val as $key => $val){
2011
+
2012
+ $con_val[$key] = sanitize_text_field($val);
2013
+
2014
+ }
2015
+
2016
+ $group_condition[$con_key] = $con_val;
2017
+ }
2018
 
2019
+ $array[$group] = $condition;
2020
 
2021
  }
2022
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2023
  }
2024
 
2025
+ return $array;
2026
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin_section/css/main-style.css CHANGED
@@ -639,6 +639,12 @@ Compatibility tab css ends
639
  #saswp-global-tabs{
640
  padding-left: 5px;
641
  }
 
 
 
 
 
 
642
  .saswp-need-help {
643
  padding-left: 60px;
644
  }
639
  #saswp-global-tabs{
640
  padding-left: 5px;
641
  }
642
+ #saswp-tools-tabs a{
643
+ cursor: pointer;
644
+ }
645
+ #saswp-tools-tabs{
646
+ padding-left: 5px;
647
+ }
648
  .saswp-need-help {
649
  padding-left: 60px;
650
  }
admin_section/css/main-style.min.css CHANGED
@@ -1 +1,1030 @@
1
- .saswp_hide{display:none}.saswp-general table th{width:auto;font-weight:600;padding:0}.saswp-general table{margin-top:0}.saswp-general table td{padding:5px}.saswp-knowledge table th{width:auto;padding:0}.saswp-knowledge table{margin-top:0}.saswp-knowledge table td{padding:5px}.saswp-schema table th{width:auto;padding:0}.saswp-schema table{margin-top:0}.saswp-schema table td{padding:5px}.saswp-amp table th{width:auto;padding:0}.saswp-amp table{margin-top:0}.saswp-amp table td{padding:5px}.saswp-help table th{width:auto;padding:0}.saswp-support table th{width:auto;padding:0}.saswp-review table th{width:auto;padding:0}.saswp-help table{margin-top:0}.saswp-help table td{padding:5px}.saswp-settings-list{display:inline-block;width:100%}.saswp-settings-list li{padding-left:0}.saswp-settings-list li div label{font-weight:600}.saswp-general h2{margin-bottom:0}.saswp-knowledge h2{margin-bottom:0}.saswp-schema h2{margin-bottom:0}.saswp-help h2{margin-bottom:0}.saswp-settings-form p.submit{margin-top:0}.saswp_qanda_p{font-weight:500}.saswp-display-none{display:none!important}.saswp-placement-groups{border:1px solid #e5e5e5}.saswp-query-success{color:#060}.saswp-query-error{color:#bf3322}.saswp-tools table th{width:auto;padding:0}.saswp-tools table{margin-top:0}.saswp-tools table td{padding:5px}.saswp-tools-field-title strong{padding-right:130px}.saswp-tools .saswp-tooltip{width:230px}.saswp-tools .saswp-knowledge-label{float:left}.saswp-error{color:red!important}.saswp-tooltip{position:relative;display:inline-block}.saswp-tooltip .saswp-tooltiptext{visibility:hidden;width:200px;background-color:#000;color:#fff;text-align:center;border-radius:6px;padding:5px 0;position:absolute;z-index:1;bottom:100%;left:50%;margin-left:-25px}.saswp-tooltiptext::after{content:"";position:absolute;top:100%;left:10%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#000 transparent transparent transparent}.saswp-knowledge-base .saswp-knowledge-label{width:200px;float:left;clear:both}.saswp-knowledge-base .saswp-knowledge-field{width:75%;float:right}.saswp-social-fileds ul{display:grid;grid-template-columns:26.5% 1fr}.saswp-social-fileds li{display:flex}.saswp-social-fileds .saswp-knowledge-field{width:100%;margin-left:10px}.saswp-social-fileds .saswp-knowledge-field input{float:right;margin:inherit}.saswp-schema-type-fields .saswp-knowledge-label{width:200px;float:left;clear:both}.saswp-schema-type-fields .saswp-knowledge-field{width:75%;float:right}.saswp-settings-first-div{width:70%}.saswp-settings-container{display:inline-flex;width:100%}.saswp-settings-second-div{float:right;position:relative;top:20px;margin-right:30px;margin-top:37px}.saswp-feedback-panel{height:200px;width:280px;background:#fff;position:relative}.saswp-start-quck-setup{position:relative;float:inherit;top:7px;left:15px}.saswp-feedback-panel ul{list-style-type:circle;list-style:decimal;padding-left:30px;font-size:15px}.saswp-feedback-panel a{text-decoration:none}.saswp-feedback-panel h2{text-align:center;padding-top:18px}.saswp-social-sharing-buttons{text-align:center;padding-top:20px}.saswp-facebook-share{background:#3b5998;box-shadow:0 0 0 #1b95e0!important;color:#fff!important;line-height:20px!important;height:21px!important;border-radius:3px;margin-right:5px}.saswp-social-sharing-buttons a{text-align:center;padding:8px}.twitter-share-button{background:#1b95e0!important;box-shadow:0 0 0 #1b95e0!important;color:#fff!important;line-height:20px!important;height:21px!important;border-radius:3px;margin-left:5px}.saswp-placement-button{padding:3px 10px;color:#0d0d0d;font-size:14px;border:1px solid #aaa;border-radius:2px;background:linear-gradient(#ededed,#fff)}.saswp-placement-table td{padding:5px 10px!important}.saswp-archive-div .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-archive-div .saswp-knowledge-label{float:left;clear:both}.saswp-amp .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-amp .saswp-knowledge-label{float:left;clear:both}.saswp-review .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-review .saswp-knowledge-label{float:left;clear:both}.saswp-compativility-div .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-compativility-div .saswp-knowledge-label{float:left;clear:both}.saswp-compativility-div li{display:inline-flex}.saswp-seller-div .saswp-knowledge-label{float:left;clear:both}.saswp-seller-div .saswp-knowledge-field{float:left;width:70%}.saswp-post-specific-tab-wrapper{display:inline-block;width:25%;vertical-align:top;box-sizing:border-box;padding-right:10px}.saswp-post-specific-container{display:inline-block;width:calc(75% - 1px);border-left:1px solid #eee}.saswp-post-specific-wrapper{padding:10px}.saswp-tab a.selected{background-color:#ccc}.saswp-tab-links{display:block;background-color:inherit;color:#000;padding:6px 10px;outline:0;text-align:left;cursor:pointer;transition:.3s;font-size:15px;width:130px;overflow:hidden;margin-right:10px}.saswp-star-rating{cursor:pointer}.saswp-post-specific-wrapper select{width:100%}.saswp-review-tables{width:100%}.saswp-over-all-raring{float:right}.saswp-review-pros-and-cons{position:relative;clear:both}.saswp-review-pros-and-cons>div:first{padding-left:10px}.saswp-review-pros-and-cons>div{width:49%;display:inline-block}.saswp-review-pros-and-cons>div:nth-child(2){padding-left:12px}.saswp-wp-ediot-desc{margin-bottom:-23px;display:block}.saswp-review-description{margin-top:40px;padding-top:10px;border-top:1px solid #eee}.saswp-review-pros-and-cons{margin-top:40px;padding-top:10px;border-top:1px solid #eee}.saspw-review-item-list{margin-top:20px;border-top:1px solid #eee}.saswp-review-item-list-table{padding-bottom:10px}#sasw-review input[type=text]{width:180px}#sasw-review input[type=number]{width:180px}#saswp-review-item-enable{width:10px}.saswp-enable-review-on-post{padding-bottom:10px}.saswp-enable-review-on-post label{font-weight:500}.saswp-compatibility table th{width:auto;padding:0}.saswp-compatibility .saswp-knowledge-label{float:left;clear:both}.saswp-tools .saswp-knowledge-label{float:left;clear:both}.saswp-tools .saswp-knowledge-field{float:right;width:69%;padding-bottom:10px}.saswp_kg_logo,.saswp_person_fields{background-color:#fff!important}.saswp_image_thumbnail{padding-top:5px}.saswp-compatibility .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-job-posting-note,.saswp-schem-type-note{color:#d2691e}.saswp-custom-fields-name{border:1px solid #aaa;border-radius:4px}.saswp-option-table-class p{margin:auto;font-style:italic;color:#666}.saswp-switch{position:relative;display:inline-block;width:40px;height:22px;border:20px}.saswp-switch input{opacity:0;width:0;height:0}.saswp-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#5a6783;transition:.4s;border-radius:20px}.saswp-slider:before{position:absolute;content:"";height:15px;width:15px;left:4px;bottom:4px;background-color:#fff;transition:.4s;border-radius:20px}input:checked+.saswp-slider{background-color:#61bd3b;border-radius:30px}input:focus+.saswp-slider{box-shadow:0 0 1px #2196f3}input:checked+.saswp-slider:before{transform:translateX(15px)}.saswp-slider.saswp-round{border-radius:34px}.saswp-slider.saswp-round:before{border-radius:50%}.saswp-tab-nav li{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;border-bottom:1px solid #eee}.saswp-tab-nav .selected{background-color:#ccc}.saswp-single-post-restore .saswp-switch{height:28px}.saswp-single-post-restore .saswp-slider:before{height:20px}.saswp-wdi-rate-stars{display:inline-block;color:#ffb900;position:relative;top:3px}.saswp-wdi-rate-stars svg{fill:#ffb900}.saswp-wdi-rate-stars svg:hover{fill:#ffb900}.saswp-wdi-rate-stars svg:hover~svg{fill:none}.option-table-class{width:100%}.option-table-class tr td{padding:10px 10px 10px 10px}.option-table-class tr>td{width:30%}.option-table-class tr td:last-child{width:60%}.saswp-option-table-class input[type=text],.saswp-option-table-class select{width:100%}.saswp-paywall-table-class input[type=text],.saswp-paywall-table-class select{width:100%}.saswp-custom-fields-table select{width:100%}.saswp-email_schema table th{width:auto;padding:0}.saswp-email_schema .saswp-knowledge-label{float:left;clear:both}.saswp-email_schema .saswp-knowledge-field{float:right;width:75%;padding-bottom:10px}.saswp-add-on-plugin label{margin-top:10px}.saswp-add-on-plugin span{width:250px;display:inline-block}.saswp-knowledge-label label[for=saswp_search_box_schema_checkbox]{padding-left:10px}.saswp-knowledge-label label[for=saswp-woocommerce-booking-checkbox]{padding-left:10px}.saswp-knowledge-label label[for=saswp-woocommerce-membership-checkbox]{padding-left:10px}.saswp-global-selected{color:#000;font-weight:500}#saswp-global-tabs a{cursor:pointer}#saswp-global-tabs{padding-left:5px}.saswp-need-help{padding-left:60px}.saswp-heading{display:inline-flex;align-items:baseline}.saswp-heading h2{margin-bottom:0}.saswp-view-docs a{margin-right:5px!important;margin-top:10px!important}.saswp-tabs .nav-tab{margin-left:4px}.saswp-panel{padding:7px 18px;background-color:#fff;box-shadow:0 0 20px 1px #d2cccc}.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}.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-input-fields select{width:100%}.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}.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-str{display:inline-block;width:100%;vertical-align:middle}.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}.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}.saswp-premium_features table th,.saswp-services table th{width:auto;padding:0}.saswp-features-blocks{display:inline-grid;grid-template-columns:1fr 1fr;grid-gap:20px}.saswp-features-blocks li{background:#fff;padding:25px;border:1px solid #d8d8d8}.saswp-features-blocks li a{text-decoration:none}.saswp-ele-ic{border-radius:256px;display:inline-block;padding:8px 10px 8px 10px;width:70px;margin-right:20px;float:left}.saswp-ele-ic img{width:100%}.saswp-ele-1{background:#96588a}.saswp-ele-2{background:#00a97e}.saswp-ele-3{background:#cacaca}.saswp-ele-4{background:#9c56cc}.saswp-ele-tlt h3{margin:0;font-size:18px;line-height:1.4}.saswp-ele-tlt p{margin-top:10px}.saswp-sts-btn{box-sizing:border-box;height:52px;margin-top:20px;padding:6px 15px;border:1px solid #e5e5e5;border-radius:3px;display:flex;align-items:center;justify-content:space-between}.saswp-d-btn{background:#d2150a;padding:6px 18px;border-radius:30px;font-size:14px;color:#fff}.form-wrap .saswp-sts-txt{font-size:16px;color:#000}.saswp-sts-txt span{color:#bebfc0;padding-left:5px}.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}.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}.saswp-g-review-header div{margin-top:10px}.saswp-upgrade-pro{background:#fff;padding:25px;border:1px solid #d8d8d8;display:inline-block;margin-top:10px;width:81%}.saswp-upgrade-pro h2{font-size:20px;margin:0;color:#23282d;font-weight:600;text-align:center}.saswp-upgrade-pro ul{margin:25px 0 20px 0;display:inline-block}.saswp-upgrade-pro ul li{position:relative;padding-left:30px;font-size:14px;line-height:1.4;margin-bottom:10px}.saswp-upgrade-pro ul li:before{content:"";background-image:url(../images/check.png);background-repeat:no-repeat;background-size:20px;width:20px;height:20px;position:absolute;left:2px;top:2px}.saswp-upgrade-pro a{background:#d2150a;padding:10px 0;display:block;text-align:center;color:#fff;text-decoration:none;font-size:16px;font-weight:600;letter-spacing:1px;border-radius:5px}.saswp_image_prev{max-width:200px;max-height:200px;float:left;padding-left:2px}.saswp_prev_close{position:relative;width:30px;height:30px;top:12px;font-size:20px;top:-5px;text-decoration:none}.saswp-add-custom-schema-div{margin-top:10px;border-top:1px solid #eee;padding-top:5px}.saswp-nav-menu-list label{padding-left:10px}.saswp-how-to-step-table-div,.saswp-how-to-supply-table-div,.saswp-how-to-tool-table-div,.saswp-mc-cause-table-div,.saswp-mc-risk_factor-table-div,.saswp-mc-symptom-table-div,.saswp-trip-itinerary-table-div,.saswp-tvseries-actor-table-div,.saswp-tvseries-season-table-div{border:1px solid #aaa;margin-top:5px;margin-bottom:5px}.saswp-table-close{float:right;cursor:pointer}.saswp-table-create-onajax table td,.saswp-table-create-onajax table th{padding:5px}.saswp-table-create-onajax select{width:98%}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ To change this license header, choose License Headers in Project Properties.
3
+ To change this template file, choose Tools | Templates
4
+ and open the template in the editor.
5
+ */
6
+ /*
7
+ Created on : Jul 27, 2018, 5:36:26 PM
8
+ Author : Magazine3
9
+ */
10
+ .saswp_hide{
11
+ display: none;
12
+ }
13
+ .saswp-general table th{
14
+ width: auto;
15
+ font-weight: 600;
16
+ padding: 0px;
17
+ }
18
+ .saswp-general table{
19
+ margin-top: 0px;
20
+ }
21
+ .saswp-general table td{
22
+ padding: 5px;
23
+ }
24
+ .saswp-knowledge table th{
25
+ width: auto;
26
+ padding: 0px;
27
+ }
28
+ .saswp-knowledge table{
29
+ margin-top: 0px;
30
+ }
31
+ .saswp-knowledge table td{
32
+ padding: 5px;
33
+ }
34
+ .saswp-schema table th{
35
+ width: auto;
36
+ padding: 0px;
37
+ }
38
+ .saswp-schema table{
39
+ margin-top: 0px;
40
+ }
41
+ .saswp-schema table td{
42
+ padding: 5px;
43
+ }
44
+ .saswp-amp table th{
45
+ width: auto;
46
+ padding: 0px;
47
+ }
48
+ .saswp-amp table{
49
+ margin-top: 0px;
50
+ }
51
+ .saswp-amp table td{
52
+ padding: 5px;
53
+ }
54
+ .saswp-help table th{
55
+ width: auto;
56
+ padding: 0px;
57
+ }
58
+ .saswp-support table th{
59
+ width: auto;
60
+ padding: 0px;
61
+ }
62
+ .saswp-review table th{
63
+ width: auto;
64
+ padding: 0px;
65
+ }
66
+ .saswp-help table{
67
+ margin-top: 0px;
68
+ }
69
+ .saswp-help table td{
70
+ padding: 5px;
71
+ }
72
+ .saswp-settings-list{
73
+ display:inline-block;
74
+ width:100%
75
+ }
76
+ .saswp-settings-list li{
77
+ padding-left:0px;
78
+ }
79
+ .saswp-settings-list li div label{
80
+ font-weight: 600;
81
+ }
82
+ .saswp-general h2{
83
+ margin-bottom: 0px;
84
+ }
85
+ .saswp-knowledge h2{
86
+ margin-bottom: 0px;
87
+ }
88
+ .saswp-schema h2{
89
+ margin-bottom: 0px;
90
+ }
91
+ .saswp-help h2{
92
+ margin-bottom: 0px;
93
+ }
94
+ .saswp-settings-form p.submit{
95
+ margin-top:0px;
96
+ }
97
+ .saswp_qanda_p{
98
+ font-weight: 500;
99
+ }
100
+ .saswp-display-none{
101
+ display: none !important;
102
+ }
103
+ .saswp-placement-groups{
104
+ border: 1px solid #e5e5e5;
105
+ }
106
+ .saswp-query-success{
107
+ color: #006600;
108
+ }
109
+ .saswp-query-error{
110
+ color: #bf3322;
111
+ }
112
+ .saswp-tools table th{
113
+ width: auto;
114
+ padding: 0px;
115
+ }
116
+ .saswp-tools table{
117
+ margin-top: 0px;
118
+ }
119
+ .saswp-tools table td{
120
+ padding: 5px;
121
+ }
122
+ .saswp-tools-field-title strong{
123
+ padding-right: 130px;
124
+ }
125
+ .saswp-tools .saswp-tooltip{
126
+ width: 230px;
127
+ }
128
+ .saswp-tools .saswp-knowledge-label {
129
+ float: left;
130
+ }
131
+ .saswp-error{
132
+ color: #ff0000 !important;
133
+ }
134
+ /*
135
+ Tooltip css starts here
136
+
137
+ */
138
+ .saswp-tooltip {
139
+ position: relative;
140
+ display: inline-block;
141
+ }
142
+ .saswp-tooltip .saswp-tooltiptext {
143
+ visibility: hidden;
144
+ width: 200px;
145
+ background-color: black;
146
+ color: #fff;
147
+ text-align: center;
148
+ border-radius: 6px;
149
+ padding: 5px 0;
150
+
151
+ /* Position the tooltip */
152
+ position: absolute;
153
+ z-index: 1;
154
+ bottom: 100%;
155
+ left: 50%;
156
+ margin-left: -25px;
157
+ }
158
+ /*.saswp-tooltip:hover .saswp-tooltiptext {
159
+ visibility: visible;
160
+ }*/
161
+
162
+ .saswp-tooltiptext::after {
163
+ content: "";
164
+ position: absolute;
165
+ top: 100%;
166
+ left: 10%;
167
+ margin-left: -5px;
168
+ border-width: 5px;
169
+ border-style: solid;
170
+ border-color: black transparent transparent transparent;
171
+ }
172
+
173
+ /*
174
+ Tooltip css ends here
175
+
176
+ */
177
+ .saswp-knowledge-base .saswp-knowledge-label{
178
+ width:200px;
179
+ float:left;
180
+ clear: both;
181
+
182
+ }
183
+ .saswp-knowledge-base .saswp-knowledge-field{
184
+ width:75%;
185
+ float:right;
186
+ }
187
+
188
+ .saswp-social-fileds ul{
189
+ display: grid;
190
+ grid-template-columns: 26.5% 1fr;
191
+ }
192
+ .saswp-social-fileds li{
193
+ display: flex;
194
+ }
195
+ .saswp-social-fileds .saswp-knowledge-field{
196
+ width: 100%;
197
+ margin-left: 10px;
198
+ }
199
+ .saswp-social-fileds .saswp-knowledge-field input{
200
+ float: right;
201
+ margin: inherit;
202
+ }
203
+ .saswp-schema-type-fields .saswp-knowledge-label{
204
+ width:200px;
205
+ float:left;
206
+ clear: both;
207
+ }
208
+ .saswp-schema-type-fields .saswp-knowledge-field{
209
+ width:75%;
210
+ float:right;
211
+ }
212
+ .saswp-settings-first-div{
213
+ width: 70%;
214
+ }
215
+ .saswp-settings-container{
216
+ display: inline-flex;
217
+ width: 100%;
218
+ }
219
+ .saswp-settings-second-div{
220
+ float: right;
221
+ position: relative;
222
+ top: 20px;
223
+ margin-right: 30px;
224
+ margin-top: 37px;
225
+ }
226
+ .saswp-feedback-panel{
227
+ height: 200px;
228
+ width: 280px;
229
+ background: #ffffff;
230
+ position: relative;
231
+
232
+ }
233
+ .saswp-start-quck-setup{
234
+ position: relative;
235
+ float: inherit;
236
+ top: 7px;
237
+ left:15px;
238
+ }
239
+ .saswp-feedback-panel ul{
240
+ list-style-type: circle;
241
+ list-style:decimal;
242
+ padding-left: 30px;
243
+ font-size: 15px;
244
+
245
+ }
246
+ .saswp-feedback-panel a{
247
+ text-decoration: none;
248
+
249
+ }
250
+ .saswp-feedback-panel h2{
251
+ text-align: center;
252
+ padding-top: 18px;
253
+
254
+ }
255
+ .saswp-social-sharing-buttons {
256
+ text-align: center;
257
+ padding-top: 20px;
258
+
259
+
260
+ }
261
+ .saswp-facebook-share{
262
+ background: #3B5998;
263
+ box-shadow: 0 0px 0 #1b95e0 !important;
264
+ color: #fff !important;
265
+ line-height: 20px !important;
266
+ height: 21px !important;
267
+ border-radius: 3px;
268
+ margin-right: 5px;
269
+ }
270
+ .saswp-social-sharing-buttons a{
271
+ text-align: center;
272
+ padding: 8px;
273
+
274
+
275
+ }
276
+ .twitter-share-button{
277
+ background: #1b95e0 !important;
278
+ box-shadow: 0 0px 0 #1b95e0 !important;
279
+ color:#fff !important;
280
+ line-height: 20px !important;
281
+ height: 21px !important;
282
+ border-radius: 3px;
283
+ margin-left: 5px;
284
+
285
+ }
286
+ .saswp-placement-button{
287
+ padding: 3px 10px;
288
+ color: #0d0d0d;
289
+ font-size: 14px;
290
+ border: 1px solid #aaa;
291
+ border-radius: 2px;
292
+ background: linear-gradient(#ededed, #ffffff);
293
+ }
294
+ .saswp-placement-table td {
295
+ padding: 5px 10px !important;
296
+ }
297
+ .saswp-archive-div .saswp-knowledge-field{
298
+ float: right;
299
+ width: 75%;
300
+ padding-bottom: 10px;
301
+ }
302
+ .saswp-archive-div .saswp-knowledge-label{
303
+ float:left;
304
+ clear: both;
305
+ }
306
+
307
+ .saswp-amp .saswp-knowledge-field{
308
+ float: right;
309
+ width: 75%;
310
+ padding-bottom: 10px;
311
+ }
312
+ .saswp-amp .saswp-knowledge-label{
313
+ float:left;
314
+ clear: both;
315
+ }
316
+
317
+ .saswp-review .saswp-knowledge-field{
318
+ float: right;
319
+ width: 75%;
320
+ padding-bottom: 10px;
321
+ }
322
+ .saswp-review .saswp-knowledge-label{
323
+ float:left;
324
+ clear: both;
325
+ }
326
+
327
+ .saswp-compativility-div .saswp-knowledge-field{
328
+ float: right;
329
+ width: 75%;
330
+ padding-bottom: 10px;
331
+ }
332
+ .saswp-compativility-div .saswp-knowledge-label{
333
+ float:left;
334
+ clear: both;
335
+ }
336
+ .saswp-compativility-div li {
337
+ display: inline-flex;
338
+ }
339
+ .saswp-seller-div .saswp-knowledge-label{
340
+ float: left;
341
+
342
+ clear: both;
343
+ }
344
+ .saswp-seller-div .saswp-knowledge-field{
345
+ float: left;
346
+ width: 70%;
347
+ }
348
+ .saswp-post-specific-tab-wrapper{
349
+ display: inline-block;
350
+ width: 25%;
351
+ vertical-align: top;
352
+ box-sizing: border-box;
353
+ padding-right:10px;
354
+ }
355
+ .saswp-post-specific-container{
356
+ display: inline-block;
357
+ width: calc(75% - 1px );
358
+ border-left: 1px solid #eee;
359
+ }
360
+ .saswp-post-specific-wrapper{
361
+ padding: 10px;
362
+ }
363
+ .saswp-tab a.selected {
364
+ background-color: #ccc;
365
+ }
366
+ .saswp-tab-links{
367
+ display: block;
368
+ background-color: inherit;
369
+ color: black;
370
+ padding: 6px 10px;
371
+ outline: none;
372
+ text-align: left;
373
+ cursor: pointer;
374
+ transition: 0.3s;
375
+ font-size: 15px;
376
+ width: 130px;
377
+ overflow: hidden;
378
+ margin-right: 10px;
379
+ }
380
+ .saswp-star-rating{
381
+ cursor: pointer;
382
+ }
383
+ .saswp-post-specific-wrapper select{
384
+ width: 100%;
385
+ }
386
+ .saswp-review-tables{
387
+ width: 100%;
388
+ }
389
+ .saswp-over-all-raring{
390
+ float: right;
391
+ }
392
+
393
+ .saswp-review-pros-and-cons{
394
+ position: relative;
395
+ clear:both;
396
+ }
397
+ .saswp-review-pros-and-cons > div:first{
398
+ padding-left: 10px;
399
+ }
400
+ .saswp-review-pros-and-cons > div{
401
+ width: 49%;
402
+ display: inline-block;
403
+ }
404
+ .saswp-review-pros-and-cons > div:nth-child(2){
405
+ padding-left: 12px;
406
+ }
407
+ .saswp-wp-ediot-desc{
408
+ margin-bottom: -23px;
409
+ display: block;
410
+ }
411
+ .saswp-review-description{
412
+ margin-top: 40px;
413
+ padding-top: 10px;
414
+ border-top: 1px solid #eee;
415
+ }
416
+ .saswp-review-pros-and-cons{
417
+ margin-top: 40px;
418
+ padding-top: 10px;
419
+ border-top: 1px solid #eee;
420
+ }
421
+ .saspw-review-item-list{
422
+ margin-top: 20px;
423
+ border-top: 1px solid #eee;
424
+ }
425
+ .saswp-review-item-list-table{
426
+ padding-bottom: 10px;
427
+ }
428
+ #sasw-review input[type=text] {
429
+ width: 180px;
430
+ }
431
+ #sasw-review input[type=number] {
432
+ width: 180px;
433
+ }
434
+ #saswp-review-item-enable{
435
+ width: 10px;
436
+ }
437
+ .saswp-enable-review-on-post{
438
+ padding-bottom: 10px;
439
+ }
440
+ .saswp-enable-review-on-post label{
441
+ font-weight: 500;
442
+ }
443
+ /*
444
+ Compatibility tab css starts here
445
+ */
446
+ .saswp-compatibility table th{
447
+ width: auto;
448
+ padding: 0px;
449
+ }
450
+ .saswp-compatibility .saswp-knowledge-label {
451
+ float: left;
452
+ clear: both;
453
+ }
454
+ .saswp-tools .saswp-knowledge-label {
455
+ float: left;
456
+ clear: both;
457
+ }
458
+ .saswp-tools .saswp-knowledge-field {
459
+ float: right;
460
+ width: 69%;
461
+ padding-bottom: 10px;
462
+ }
463
+ .saswp_kg_logo, .saswp_person_fields{
464
+ background-color: #fff !important;
465
+ }
466
+ .saswp_image_thumbnail{
467
+ padding-top: 5px;
468
+ }
469
+ .saswp-compatibility .saswp-knowledge-field {
470
+ float: right;
471
+ width: 75%;
472
+ padding-bottom: 10px;
473
+ }
474
+ .saswp-schem-type-note, .saswp-job-posting-note{
475
+ color: chocolate;
476
+ }
477
+ .saswp-custom-fields-name{
478
+ border: 1px solid #aaa;
479
+ border-radius: 4px;
480
+ }
481
+ /*
482
+ Compatibility tab css ends
483
+ */
484
+ .saswp-option-table-class p{
485
+ margin: auto;
486
+ font-style: italic;
487
+ color: #666;
488
+ }
489
+ /*
490
+ On/Off Buttons starts here
491
+ */
492
+ .saswp-switch {
493
+ position: relative;
494
+ display: inline-block;
495
+ width: 40px;
496
+ height: 22px;
497
+ border: 20px;
498
+ }
499
+
500
+ .saswp-switch input {
501
+ opacity: 0;
502
+ width: 0;
503
+ height: 0;
504
+ }
505
+
506
+ .saswp-slider {
507
+ position: absolute;
508
+ cursor: pointer;
509
+ top: 0;
510
+ left: 0;
511
+ right: 0;
512
+ bottom: 0;
513
+ background-color: #5a6783;
514
+ transition: .4s;
515
+ border-radius: 20px;
516
+ }
517
+
518
+ .saswp-slider:before {
519
+ position: absolute;
520
+ content: "";
521
+ height: 15px;
522
+ width: 15px;
523
+ left: 4px;
524
+ bottom: 4px;
525
+ background-color: white;
526
+ transition: .4s;
527
+ border-radius: 20px;
528
+ }
529
+
530
+ input:checked + .saswp-slider {
531
+ background-color: #61bd3b;
532
+ border-radius: 30px;
533
+ }
534
+
535
+ input:focus + .saswp-slider {
536
+ box-shadow: 0 0 1px #2196F3;
537
+ }
538
+
539
+ input:checked + .saswp-slider:before {
540
+
541
+ transform: translateX(15px);
542
+ }
543
+
544
+ /* Rounded sliders */
545
+ .saswp-slider.saswp-round {
546
+ border-radius: 34px;
547
+ }
548
+
549
+ .saswp-slider.saswp-round:before {
550
+ border-radius: 50%;
551
+ }
552
+
553
+ .saswp-tab-nav li{
554
+ display: flex;
555
+ align-items: center;
556
+ justify-content: space-between;
557
+ margin-bottom:10px;
558
+ border-bottom: 1px solid #eee;
559
+ }
560
+
561
+ .saswp-tab-nav .selected{
562
+ background-color: #ccc;
563
+ }
564
+ .saswp-single-post-restore .saswp-switch{
565
+ height: 28px;
566
+ }
567
+ .saswp-single-post-restore .saswp-slider:before{
568
+ height: 20px;
569
+ }
570
+ /*
571
+ On/Off Buttons ends here
572
+ */
573
+ .saswp-wdi-rate-stars{display:inline-block;color:#ffb900;position:relative;top:3px;}
574
+ .saswp-wdi-rate-stars svg{fill:#ffb900;}
575
+ .saswp-wdi-rate-stars svg:hover{fill:#ffb900}
576
+ .saswp-wdi-rate-stars svg:hover ~ svg{fill:none;}
577
+
578
+ .option-table-class {width:100%;}
579
+ .option-table-class tr td {padding: 10px 10px 10px 10px ;}
580
+ .option-table-class tr > td{width: 30%;}
581
+ .option-table-class tr td:last-child{width: 60%;}
582
+
583
+ .saswp-option-table-class input[type="text"], .saswp-option-table-class select{
584
+ width:100%;
585
+ }
586
+ .saswp-paywall-table-class input[type="text"], .saswp-paywall-table-class select{
587
+ width:100%;
588
+ }
589
+
590
+ .saswp-custom-fields-table select{
591
+ width: 100%;
592
+ }
593
+
594
+ /*
595
+ Compatibility tab css starts here
596
+ */
597
+ .saswp-email_schema table th{
598
+ width: auto;
599
+ padding: 0px;
600
+ }
601
+ .saswp-email_schema .saswp-knowledge-label {
602
+ float: left;
603
+ clear: both;
604
+ }
605
+ .saswp-email_schema .saswp-knowledge-field {
606
+ float: right;
607
+ width: 75%;
608
+ padding-bottom: 10px;
609
+ }
610
+ /*
611
+ Compatibility tab css ends
612
+ */
613
+ .saswp-add-on-plugin label{
614
+ margin-top: 10px;
615
+ }
616
+ .saswp-add-on-plugin span{
617
+ width: 250px;
618
+ display: inline-block;
619
+ }
620
+ .saswp-knowledge-label label[for="saswp_search_box_schema_checkbox"] {
621
+ padding-left: 10px;
622
+ }
623
+
624
+ .saswp-knowledge-label label[for="saswp-woocommerce-booking-checkbox"] {
625
+ padding-left: 10px;
626
+ }
627
+
628
+ .saswp-knowledge-label label[for="saswp-woocommerce-membership-checkbox"] {
629
+ padding-left: 10px;
630
+ }
631
+
632
+ .saswp-global-selected{
633
+ color: #000000;
634
+ font-weight: 500;
635
+ }
636
+ #saswp-global-tabs a{
637
+ cursor: pointer;
638
+ }
639
+ #saswp-global-tabs{
640
+ padding-left: 5px;
641
+ }
642
+ #saswp-tools-tabs a{
643
+ cursor: pointer;
644
+ }
645
+ #saswp-tools-tabs{
646
+ padding-left: 5px;
647
+ }
648
+ .saswp-need-help {
649
+ padding-left: 60px;
650
+ }
651
+ .saswp-heading{
652
+ display: inline-flex;
653
+ align-items: baseline;
654
+ }
655
+ .saswp-heading h2{
656
+ margin-bottom: 0px;
657
+ }
658
+ .saswp-view-docs a{
659
+ margin-right: 5px !important;
660
+ margin-top: 10px !important;
661
+ }
662
+ .saswp-tabs .nav-tab{
663
+ margin-left: 4px;
664
+ }
665
+
666
+ /*
667
+ Google review module starts here
668
+ */
669
+ .saswp-panel {
670
+ padding: 7px 18px;
671
+ background-color: white;
672
+ box-shadow: 0px 0px 20px 1px #d2cccc;
673
+ }
674
+
675
+ /*** Review Design CSS ****/
676
+ .saswp-g-review-header{
677
+ margin-top: 50px;
678
+ }
679
+ .saswp-g-review-body{
680
+ display:inline-grid;
681
+ grid-template-columns: 1fr 300px;
682
+ grid-gap:30px;
683
+ margin-top:30px;
684
+ }
685
+ .saswp-review-list{}
686
+ .saswp-channel-list{
687
+ margin-right: 15px;
688
+ }
689
+ .saswp-input-fields{
690
+ display: inline-flex;
691
+ align-items: center;
692
+ margin-bottom: 8px;
693
+ width: 100%;
694
+ }
695
+ .saswp-input-fields label{
696
+ width: 130px;
697
+ }
698
+ .saswp-input-fields select{
699
+ width:100%;
700
+ }
701
+ .saswp-panel h3{
702
+ font-size: 20px;
703
+ line-height: 1.4;
704
+ color: #222;
705
+ text-align: center;
706
+ margin: 10px 0px 20px 0px;
707
+ }
708
+ .saswp-input-fields a.button-primary{
709
+ margin-top:10px;
710
+ }
711
+ .saswp-glg-review-body{
712
+ display: grid;
713
+ grid-template-columns: 100px 1fr;
714
+ grid-gap: 20px;
715
+ background: #fff;
716
+ padding: 20px;
717
+ box-shadow: 0px 0px 20px 1px #d2cccc;
718
+ margin-bottom: 30px;
719
+ }
720
+ .saswp-g-plus{
721
+ float: right;
722
+ font-size: 15px;
723
+ }
724
+ .saswp-rtng{
725
+ padding-left: 5px;
726
+ font-size: 14px;
727
+ }
728
+ .saswp-pt-dt {
729
+ font-size: 12px;
730
+ color: #999;
731
+ font-weight: 600;
732
+ margin-top: 5px;
733
+ display: inline-block;
734
+ }
735
+ .saswp-str{
736
+ display: inline-block;
737
+ width: 100%;
738
+ vertical-align: middle;
739
+ }
740
+ .saswp-athr{
741
+ font-size: 15px;
742
+ line-height: 1.4;
743
+ color: #000;
744
+ font-weight: bold;
745
+ display: inline-block;
746
+ vertical-align: middle;
747
+ }
748
+ .saswp-str-rtng .saswp-rvw-str{
749
+ display: inline-block;
750
+ vertical-align: middle;
751
+ padding-left: 10px;
752
+ width: auto;
753
+ }
754
+ .saswp-rv-cnt p{
755
+ font-size: 16px;
756
+ line-height: 1.6;
757
+ color: #000;
758
+ margin: 10px 0px 0px 0px;
759
+ }
760
+ .saswp-rv-img img{
761
+ max-width:100px;
762
+ }
763
+ /*
764
+ Google review module ends here
765
+ */
766
+
767
+ /** Premium Feature CSS **/
768
+ .saswp-premium_features table th, .saswp-services table th{
769
+ width: auto;
770
+ padding: 0px;
771
+ }
772
+ .saswp-features-blocks{
773
+ display: inline-grid;
774
+ grid-template-columns: 1fr 1fr;
775
+ grid-gap: 20px;
776
+ }
777
+ .saswp-features-blocks li{
778
+ background:#fff;
779
+ padding: 25px;
780
+ border: 1px solid #d8d8d8;
781
+ }
782
+ .saswp-features-blocks li a{
783
+ text-decoration: none;
784
+ }
785
+ .saswp-ele-ic{
786
+ border-radius: 256px;
787
+ display: inline-block;
788
+ padding:8px 10px 8px 10px;
789
+ width: 70px;
790
+ margin-right: 20px;
791
+ float: left;
792
+ }
793
+ .saswp-ele-ic img{
794
+ width:100%;
795
+ }
796
+ .saswp-ele-1{
797
+ background: #96588a;
798
+ }
799
+ .saswp-ele-2{
800
+ background: #00a97e;
801
+ }
802
+ .saswp-ele-3{
803
+ background: #cacaca;
804
+ }.saswp-ele-4{
805
+ background: #9c56cc;
806
+ }
807
+ .saswp-ele-tlt h3{
808
+ margin:0;
809
+ font-size: 18px;
810
+ line-height: 1.4;
811
+ }
812
+ .saswp-ele-tlt p{
813
+ margin-top:10px;
814
+ }
815
+ .saswp-sts-btn{
816
+ box-sizing: border-box;
817
+ height: 52px;
818
+ margin-top: 20px;
819
+ padding: 6px 15px;
820
+ border: 1px solid #e5e5e5;
821
+ border-radius: 3px;
822
+ display: flex;
823
+ align-items: center;
824
+ justify-content: space-between;
825
+ }
826
+ .saswp-d-btn{
827
+ background: #d2150a;
828
+ padding: 6px 18px;
829
+ border-radius: 30px;
830
+ font-size: 14px;
831
+ color: #fff;
832
+ }
833
+ .form-wrap .saswp-sts-txt{
834
+ font-size: 16px;
835
+ color:#000;
836
+ }
837
+ .saswp-sts-txt span{
838
+ color:#bebfc0;
839
+ padding-left:5px;
840
+ }
841
+
842
+ /** star rating Feature CSS **/
843
+
844
+ .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}
845
+ .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==)}
846
+ /*** Review Design CSS ****/
847
+ .saswp-g-review-header{
848
+ margin-top: 50px;
849
+ }
850
+ .saswp-g-review-body{
851
+ display:inline-grid;
852
+ grid-template-columns: 1fr 300px;
853
+ grid-gap:30px;
854
+ margin-top:30px;
855
+ width:100%;
856
+ }
857
+ .saswp-review-list{}
858
+ .saswp-channel-list{
859
+ margin-right: 15px;
860
+ }
861
+ .saswp-input-fields{
862
+ display: inline-flex;
863
+ align-items: center;
864
+ margin-bottom: 8px;
865
+ width: 100%;
866
+ }
867
+ .saswp-input-fields label{
868
+ width: 130px;
869
+ }
870
+ .saswp-panel h3{
871
+ font-size: 20px;
872
+ line-height: 1.4;
873
+ color: #222;
874
+ text-align: center;
875
+ margin: 10px 0px 20px 0px;
876
+ }
877
+ .saswp-input-fields a.button-primary{
878
+ margin-top:10px;
879
+ }
880
+ .saswp-glg-review-body{
881
+ display: grid;
882
+ grid-template-columns: 100px 1fr;
883
+ grid-gap: 20px;
884
+ background: #fff;
885
+ padding: 20px;
886
+ box-shadow: 0px 0px 20px 1px #d2cccc;
887
+ margin-bottom: 30px;
888
+ }
889
+ .saswp-g-plus{
890
+ float: right;
891
+ font-size: 15px;
892
+ width: 20px;
893
+ height: 20px;
894
+ }
895
+ .saswp-g-plus img{
896
+ width:100%;
897
+ }
898
+ .saswp-rtng{
899
+ padding-left: 5px;
900
+ font-size: 14px;
901
+ }
902
+ .saswp-pt-dt {
903
+ font-size: 12px;
904
+ color: #999;
905
+ font-weight: 600;
906
+ margin-top: 5px;
907
+ display: inline-block;
908
+ }
909
+ .saswp-athr{
910
+ font-size: 15px;
911
+ line-height: 1.4;
912
+ color: #000;
913
+ font-weight: bold;
914
+ }
915
+ .saswp-rv-cnt p{
916
+ font-size: 16px;
917
+ line-height: 1.6;
918
+ color: #000;
919
+ margin: 10px 0px 0px 0px;
920
+ }
921
+ .saswp-rv-img img{
922
+ max-width:100px;
923
+ }
924
+ .saswp-g-review-header div{
925
+ margin-top:10px;
926
+ }
927
+
928
+ /*** Upgrade Pro CSS ***/
929
+ .saswp-upgrade-pro{
930
+ background: #fff;
931
+ padding: 25px;
932
+ border: 1px solid #d8d8d8;
933
+ display: inline-block;
934
+ margin-top: 10px;
935
+ width: 81%;
936
+ }
937
+ .saswp-upgrade-pro h2{
938
+ font-size: 20px;
939
+ margin: 0;
940
+ color: #23282d;
941
+ font-weight: 600;
942
+ text-align: center;
943
+ }
944
+ .saswp-upgrade-pro ul{
945
+ margin: 25px 0px 20px 0px;
946
+ display: inline-block;
947
+ }
948
+ .saswp-upgrade-pro ul li{
949
+ position: relative;
950
+ padding-left: 30px;
951
+ font-size: 14px;
952
+ line-height: 1.4;
953
+ margin-bottom: 10px;
954
+ }
955
+ .saswp-upgrade-pro ul li:before {
956
+ content: "";
957
+ background-image: url(../images/check.png);
958
+ background-repeat: no-repeat;
959
+ background-size: 20px;
960
+ width: 20px;
961
+ height: 20px;
962
+ position: absolute;
963
+ left: 2px;
964
+ top: 2px;
965
+ }
966
+ .saswp-upgrade-pro a{
967
+ background: #d2150a;
968
+ padding: 10px 0px;
969
+ display: block;
970
+ text-align: center;
971
+ color: #fff;
972
+ text-decoration: none;
973
+ font-size: 16px;
974
+ font-weight: 600;
975
+ letter-spacing: 1px;
976
+ border-radius: 5px;
977
+ }
978
+ .saswp_image_prev{
979
+ max-width: 200px;
980
+ max-height: 200px;
981
+ float: left;
982
+ padding-left:2px;
983
+ }
984
+ .saswp_prev_close {
985
+ position: relative;
986
+ width:30px;
987
+ height:30px;
988
+ top: 12px;
989
+ font-size: 20px;
990
+ top: -5px;
991
+ text-decoration:none;
992
+ }
993
+ .saswp-add-custom-schema-div{
994
+ margin-top: 10px;
995
+ border-top: 1px solid #eee;
996
+ padding-top: 5px;
997
+ }
998
+
999
+ .saswp-nav-menu-list label{
1000
+ padding-left: 10px;
1001
+ }
1002
+ /*** How to schema css starts here ***/
1003
+
1004
+ .saswp-how-to-supply-table-div,
1005
+ .saswp-how-to-tool-table-div,
1006
+ .saswp-how-to-step-table-div,
1007
+ .saswp-tvseries-actor-table-div,
1008
+ .saswp-tvseries-season-table-div,
1009
+ .saswp-mc-symptom-table-div,
1010
+ .saswp-mc-risk_factor-table-div,
1011
+ .saswp-trip-itinerary-table-div,
1012
+ .saswp-mc-cause-table-div
1013
+ {
1014
+ border: 1px solid #aaa;
1015
+ margin-top: 5px;
1016
+ margin-bottom: 5px;
1017
+
1018
+ }
1019
+ .saswp-table-close{
1020
+ float: right;
1021
+ cursor: pointer;
1022
+ }
1023
+ .saswp-table-create-onajax table th, .saswp-table-create-onajax table td{
1024
+ padding: 5px;
1025
+ }
1026
+ .saswp-table-create-onajax select{
1027
+ width: 98%;
1028
+ }
1029
+
1030
+ /*** How to schema css ends here ***/
admin_section/fields-generator.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  /*
3
  Metabox to show ads type such as custom and adsense
4
  */
@@ -20,6 +32,13 @@ class saswp_fields_generator {
20
 
21
  return $tooltip_message;
22
  }
 
 
 
 
 
 
 
23
  public function saswp_field_generator( $meta_fields, $settings, $field_type = null ) {
24
 
25
  $output = '';
@@ -72,19 +91,22 @@ class saswp_fields_generator {
72
 
73
  }
74
 
75
-
 
 
 
 
 
 
 
 
 
 
 
76
  switch ( $meta_field['type'] ) {
77
 
78
  case 'media':
79
-
80
- $attribute_str ='';
81
-
82
- foreach ($attribute as $key => $attr ){
83
-
84
- $attribute_str .=''.$key.'="'.$attr.'"';
85
-
86
- }
87
-
88
  $mediavalue = array();
89
 
90
  if(isset($settings[$meta_field['id']])){
@@ -125,13 +147,6 @@ class saswp_fields_generator {
125
  break;
126
  case 'checkbox':
127
 
128
- $attribute_str ='';
129
-
130
- foreach ($attribute as $key => $attr ){
131
-
132
- $attribute_str .=''.$key.'="'.$attr.'"';
133
-
134
- }
135
  $hiddenvalue ="";
136
 
137
  if(array_key_exists('id', $hidden) && isset($settings[$hidden['id']])){
@@ -197,13 +212,14 @@ class saswp_fields_generator {
197
  }
198
 
199
  $input = sprintf(
200
- '<input class="%s" %s id="%s" name="%s" type="%s" value="%s">',
201
  $class,
202
  $meta_field['type'] !== 'color' ? 'style="width: 100%"' : '',
203
  esc_attr(saswp_remove_warnings($meta_field, 'id', 'saswp_string')),
204
  esc_attr(saswp_remove_warnings($meta_field, 'name', 'saswp_string')),
205
  esc_attr(saswp_remove_warnings($meta_field, 'type', 'saswp_string')),
206
- esc_attr($stng_meta_field)
 
207
  );
208
 
209
  }
1
  <?php
2
+ /**
3
+ * Field Generator class
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path google_review/google_review
8
+ * @Version 1.8
9
+ */
10
+
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
  /*
15
  Metabox to show ads type such as custom and adsense
16
  */
32
 
33
  return $tooltip_message;
34
  }
35
+ /**
36
+ * Function to generate html element from the given elements array
37
+ * @param type $meta_fields
38
+ * @param type $settings
39
+ * @param type $field_type
40
+ * @since version 1.0
41
+ */
42
  public function saswp_field_generator( $meta_fields, $settings, $field_type = null ) {
43
 
44
  $output = '';
91
 
92
  }
93
 
94
+ $attribute_str ='';
95
+
96
+ if(!empty($attribute)){
97
+
98
+ foreach ($attribute as $key => $attr ){
99
+
100
+ $attribute_str .=''.esc_attr($key).'="'.esc_attr($attr).'"';
101
+
102
+ }
103
+
104
+ }
105
+
106
  switch ( $meta_field['type'] ) {
107
 
108
  case 'media':
109
+
 
 
 
 
 
 
 
 
110
  $mediavalue = array();
111
 
112
  if(isset($settings[$meta_field['id']])){
147
  break;
148
  case 'checkbox':
149
 
 
 
 
 
 
 
 
150
  $hiddenvalue ="";
151
 
152
  if(array_key_exists('id', $hidden) && isset($settings[$hidden['id']])){
212
  }
213
 
214
  $input = sprintf(
215
+ '<input class="%s" %s id="%s" name="%s" type="%s" value="%s" %s>',
216
  $class,
217
  $meta_field['type'] !== 'color' ? 'style="width: 100%"' : '',
218
  esc_attr(saswp_remove_warnings($meta_field, 'id', 'saswp_string')),
219
  esc_attr(saswp_remove_warnings($meta_field, 'name', 'saswp_string')),
220
  esc_attr(saswp_remove_warnings($meta_field, 'type', 'saswp_string')),
221
+ esc_attr($stng_meta_field),
222
+ $attribute_str
223
  );
224
 
225
  }
admin_section/js/main-script.js CHANGED
@@ -10,6 +10,94 @@ function getParameterByName(name, url) {
10
  return decodeURIComponent(results[2].replace(/\+/g, " "));
11
  }
12
  jQuery(document).ready(function($){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  $(".saswp-tabs a").click(function(e){
14
  var href = $(this).attr('href');
15
  var currentTab = getParameterByName('tab',href);
@@ -1060,6 +1148,24 @@ jQuery(document).ready(function($){
1060
  }
1061
  });
1062
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1063
  //Importer from schema plugin ends here
1064
 
1065
  //custom fields modify schema starts here
10
  return decodeURIComponent(results[2].replace(/\+/g, " "));
11
  }
12
  jQuery(document).ready(function($){
13
+
14
+ /* Newletters js starts here */
15
+
16
+ if(saswp_localize_data.do_tour){
17
+
18
+ var content = '<h3>Thanks for using Structured Data!</h3>';
19
+ content += '<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>';
20
+ content += '<style type="text/css">';
21
+ content += '.wp-pointer-buttons{ padding:0; overflow: hidden; }';
22
+ content += '.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} #afw_mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }';
23
+ content += '</style>';
24
+ content += '<div id="afw_mc_embed_signup">';
25
+ content += '<form action="//app.mailerlite.com/webforms/submit/o1s7u3" data-id="258182" data-code="o1s7u3" method="POST" target="_blank">';
26
+ content += '<div id="afw_mc_embed_signup_scroll">';
27
+ content += '<div class="afw-mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">';
28
+ content += '<input type="text" name="fields[name]" class="form-control" placeholder="Name" hidden value="'+saswp_localize_data.current_user_name+'" style="display:none">';
29
+ content += '<input type="text" value="'+saswp_localize_data.current_user_email+'" name="fields[email]" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">';
30
+ content += '<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+'">';
31
+ content += '<input type="hidden" name="ml-submit" value="1" />';
32
+ content += '</div>';
33
+ content += '<div id="mce-responses">';
34
+ content += '<div class="response" id="mce-error-response" style="display:none"></div>';
35
+ content += '<div class="response" id="mce-success-response" style="display:none"></div>';
36
+ content += '</div>';
37
+ content += '<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>';
38
+ content += '<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;">';
39
+ content += '</div>';
40
+ content += '</form>';
41
+ content += '</div>';
42
+
43
+ var setup;
44
+ var wp_pointers_tour_opts = {
45
+ content:content,
46
+ position:{
47
+ edge:"top",
48
+ align:"left"
49
+ }
50
+ };
51
+
52
+ wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
53
+ buttons: function (event, t) {
54
+ button= jQuery ('<a id="pointer-close" class="button-secondary">' + saswp_localize_data.button1 + '</a>');
55
+ button_2= jQuery ('#pointer-close.button');
56
+ button.bind ('click.pointer', function () {
57
+ t.element.pointer ('close');
58
+ });
59
+ button_2.on('click', function() {
60
+ t.element.pointer ('close');
61
+ } );
62
+ return button;
63
+ },
64
+ close: function () {
65
+ $.post (saswp_localize_data.ajax_url, {
66
+ pointer: 'saswp_subscribe_pointer222',
67
+ action: 'dismiss-wp-pointer'
68
+ });
69
+ },
70
+ show: function(event, t){
71
+ t.pointer.css({'left':'170px', 'top':'160px'});
72
+ }
73
+ });
74
+ setup = function () {
75
+ $(saswp_localize_data.displayID).pointer(wp_pointers_tour_opts).pointer('open');
76
+ if (saswp_localize_data.button2) {
77
+ jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + saswp_localize_data.button2+ '</a>');
78
+ jQuery ('#pointer-primary').click (function () {
79
+ saswp_localize_data.function_name;
80
+ });
81
+ jQuery ('#pointer-close').click (function () {
82
+ $.post (saswp_localize_data.ajax_url, {
83
+ pointer: 'saswp_subscribe_pointer222',
84
+ action: 'dismiss-wp-pointer'
85
+ });
86
+ });
87
+ }
88
+ };
89
+ if (wp_pointers_tour_opts.position && wp_pointers_tour_opts.position.defer_loading) {
90
+ $(window).bind('load.wp-pointers', setup);
91
+ }
92
+ else {
93
+ setup ();
94
+ }
95
+
96
+ }
97
+
98
+ /* Newletters js ends here */
99
+
100
+
101
  $(".saswp-tabs a").click(function(e){
102
  var href = $(this).attr('href');
103
  var currentTab = getParameterByName('tab',href);
1148
  }
1149
  });
1150
 
1151
+
1152
+ $('#saswp-tools-tabs a:first').addClass('saswp-global-selected');
1153
+ $('.saswp-tools-container').hide();
1154
+ $('.saswp-tools-container:first').show();
1155
+
1156
+ $('#saswp-tools-tabs a').click(function(){
1157
+ var t = $(this).attr('data-id');
1158
+
1159
+ if(!$(this).hasClass('saswp-global-selected')){
1160
+ $('#saswp-tools-tabs a').removeClass('saswp-global-selected');
1161
+ $(this).addClass('saswp-global-selected');
1162
+
1163
+ $('.saswp-tools-container').hide();
1164
+ $('#'+t).show();
1165
+ }
1166
+ });
1167
+
1168
+
1169
  //Importer from schema plugin ends here
1170
 
1171
  //custom fields modify schema starts here
admin_section/js/main-script.min.js CHANGED
@@ -1 +1,1701 @@
1
- function getParameterByName(s,a){a||(a=window.location.href),s=s.replace(/[\[\]]/g,"\\$&");var e=new RegExp("[?&]"+s+"(=([^&#]*)|&|#|$)").exec(a);return e?e[2]?decodeURIComponent(e[2].replace(/\+/g," ")):"":null}jQuery(document).ready(function(s){function a(a,e){var t=e.replace("-checkbox",""),i=s("#"+t).next("p").text();a.is(":checked")&&""!==i?s("#"+t).next("p").removeClass("saswp_hide"):1==s("#"+t).next("p").attr("data-id")?s("#"+t).next("p").text("This feature is only available in pro version"):s("#"+t).next("p").addClass("saswp_hide")}function e(){s(".saswp-item-reviewed").change(function(a){a.preventDefault();var e="";if(s("select#schema_type option:selected").val()&&(e=s("select#schema_type option:selected").val()),s(".saswp-tab-links.selected").attr("saswp-schema-type")&&(e=s(".saswp-tab-links.selected").attr("saswp-schema-type")),"Review"===e){var t=s(this),i=s(this).val(),o=saswp_localize_data.post_id,p=s(t).attr("data-id"),c=s(t).attr("post-specific");s.get(ajaxurl,{action:"saswp_get_item_reviewed_fields",schema_id:p,post_specific:c,item:i,post_id:o,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(a){s(t).parent().parent().nextAll().remove(".saswp-review-tr"),s(t).parent().parent().after(a)})}}).change()}function t(){s(".saswp-local-schema-datepicker-picker").datepicker({dateFormat:"yy-mm-dd",minDate:0})}function i(){"saswp"!=saswp_localize_data.post_type&&"saswp"!=saswp_localize_data.page_now||"saswp_page_structured_data_options"==saswp_localize_data.page_now||s(".saswp-custom-fields-select2").select2({ajax:{type:"POST",url:ajaxurl,dataType:"json",delay:250,data:function(s){return{saswp_security_nonce:saswp_localize_data.saswp_security_nonce,q:s.term,action:"saswp_get_custom_meta_fields"}},processResults:function(s){return{results:s}},cache:!0},minimumInputLength:2})}function o(){var a="";s("select#schema_type option:selected").val()&&(a=s("select#schema_type option:selected").val()),s(".saswp-tab-links.selected").attr("saswp-schema-type")&&(a=s(".saswp-tab-links.selected").attr("saswp-schema-type")),a&&s(".saswp-enable-rating-review-"+a.toLowerCase()).change(function(){s(this).is(":checked")?s(this).parent().parent().siblings(".saswp-rating-review-"+a.toLowerCase()).show():s(this).parent().parent().siblings(".saswp-rating-review-"+a.toLowerCase()).hide()}).change()}s(".saswp-tabs a").click(function(a){var e=s(this).attr("href"),t=getParameterByName("tab",e);return t||(t="general"),s(this).siblings().removeClass("nav-tab-active"),s(this).addClass("nav-tab-active"),s(".form-wrap").find(".saswp-"+t).siblings().hide(),s(".form-wrap .saswp-"+t).show(),window.history.pushState("","",e),!1}),s(".saswp-schame-type-select").change(function(){s(".saswp-custom-fields-table").html("");var a=s(this).val();s(".saswp-option-table-class tr").each(function(a,e){a>0&&(s(this).hide(),s(this).find("select").attr("disabled",!0))}),"TechArticle"==a||"Article"==a||"Blogposting"==a||"NewsArticle"==a||"WebPage"==a?s(".saswp-enable-speakable").parent().parent().show():s(".saswp-enable-speakable").parent().parent().hide(),"local_business"==a&&(s(".saswp-option-table-class tr").eq(1).show(),s(".saswp-business-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1),s(".select-post-type").val("show_globally").trigger("change")),"Service"==a&&(s(".saswp-service-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Review"==a&&(s(".saswp-review-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1),e()),"Product"==a&&(s(".saswp-product-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"Event"==a&&(s(".saswp-event-text-field-tr").show(),s(".saswp-option-table-class tr").find("select").attr("disabled",!1)),"AudioObject"==a&&s(".saswp-audio-text-field-tr").show(),"SoftwareApplication"==a&&s(".saswp-softwareapplication-text-field-tr").show(),s(".saswp-schem-type-note").addClass("saswp_hide"),"qanda"==a&&s(".saswp-schem-type-note").removeClass("saswp_hide"),s(".saswp-job-posting-note").addClass("saswp_hide"),o()}),s("#saswp_business_type").change(function(){var a=s(this).val(),e=s(".saswp-schame-type-select").val();s(".saswp-option-table-class tr").each(function(a,e){a>1&&(s(this).hide(),s(this).find("select").attr("disabled",!0))}),"TechArticle"==e||"Article"==e||"Blogposting"==e||"NewsArticle"==e||"WebPage"==e?s(".saswp-enable-speakable").parent().parent().show():s(".saswp-enable-speakable").parent().parent().hide(),"local_business"==e&&(s(".saswp-"+a+"-tr").show(),s(".saswp-business-text-field-tr").show(),s(".saswp-"+a+"-tr").find("select").attr("disabled",!1)),"Service"==e&&(s(".saswp-service-text-field-tr").show(),s(".saswp-service-text-field-tr").find("select").attr("disabled",!1)),"Product"==e&&(s(".saswp-product-text-field-tr").show(),s(".saswp-product-text-field-tr").find("select").attr("disabled",!1)),"AudioObject"==e&&s(".saswp-audio-text-field-tr").show(),"SoftwareApplication"==e&&s(".saswp-softwareapplication-text-field-tr").show(),"Review"==e&&(s(".saswp-review-text-field-tr").show(),s(".saswp-review-text-field-tr").find("select").attr("disabled",!1)),"Event"==e&&(s(".saswp-event-text-field-tr").show(),s(".saswp-event-text-field-tr").find("select").attr("disabled",!1)),o()}).change(),s(".saswp-checkbox").change(function(){var e=s(this).attr("id"),t=s(this);switch(e){case"saswp-for-wordpress-checkbox":s(this).is(":checked")?s("#saswp-for-wordpress").val(1):s("#saswp-for-wordpress").val(0);break;case"saswp-facebook-enable-checkbox":s(this).is(":checked")?(s("#saswp-facebook-enable").val(1),s("#sd_facebook").show()):(s("#saswp-facebook-enable").val(0),s("#sd_facebook").hide());break;case"saswp-twitter-enable-checkbox":s(this).is(":checked")?(s("#saswp-twitter-enable").val(1),s("#sd_twitter").show()):(s("#saswp-twitter-enable").val(0),s("#sd_twitter").hide());break;case"saswp-google-plus-enable-checkbox":s(this).is(":checked")?(s("#saswp-google-plus-enable").val(1),s("#sd_google_plus").show()):(s("#saswp-google-plus-enable").val(0),s("#sd_google_plus").hide());break;case"saswp-instagram-enable-checkbox":s(this).is(":checked")?(s("#saswp-instagram-enable").val(1),s("#sd_instagram").show()):(s("#saswp-instagram-enable").val(0),s("#sd_instagram").hide());break;case"saswp-youtube-enable-checkbox":s(this).is(":checked")?(s("#sd_youtube").show(),s("#saswp-youtube-enable").val(1)):(s("#saswp-youtube-enable").val(0),s("#sd_youtube").hide());break;case"saswp-linkedin-enable-checkbox":s(this).is(":checked")?(s("#saswp-linkedin-enable").val(1),s("#sd_linkedin").show()):(s("#saswp-linkedin-enable").val(0),s("#sd_linkedin").hide());break;case"saswp-pinterest-enable-checkbox":s(this).is(":checked")?(s("#saswp-pinterest-enable").val(1),s("#sd_pinterest").show()):(s("#saswp-pinterest-enable").val(0),s("#sd_pinterest").hide());break;case"saswp-soundcloud-enable-checkbox":s(this).is(":checked")?(s("#saswp-soundcloud-enable").val(1),s("#sd_soundcloud").show()):(s("#saswp-soundcloud-enable").val(0),s("#sd_soundcloud").hide());break;case"saswp-tumblr-enable-checkbox":s(this).is(":checked")?(s("#saswp-tumblr-enable").val(1),s("#sd_tumblr").show()):(s("#saswp-tumblr-enable").val(0),s("#sd_tumblr").hide());break;case"saswp-for-amp-checkbox":s(this).is(":checked")?s("#saswp-for-amp").val(1):s("#saswp-for-amp").val(0);break;case"saswp_kb_contact_1_checkbox":s(this).is(":checked")?(s("#saswp_kb_contact_1").val(1),s("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").removeClass("saswp-display-none")):(s("#saswp_kb_contact_1").val(0),s("#saswp_kb_telephone, #saswp_contact_type").parent().parent("li").addClass("saswp-display-none"));break;case"saswp-logo-dimensions-check":s(this).is(":checked")?(s("#saswp-logo-dimensions").val(1),s("#saswp-logo-width, #saswp-logo-height").parent().parent("li").show()):(s("#saswp-logo-dimensions").val(0),s("#saswp-logo-width, #saswp-logo-height").parent().parent("li").hide());break;case"saswp_archive_schema_checkbox":s(this).is(":checked")?(s("#saswp_archive_schema").val(1),s(".saswp_archive_schema_type_class").parent().parent().show()):(s("#saswp_archive_schema").val(0),s(".saswp_archive_schema_type_class").parent().parent().hide());break;case"saswp_website_schema_checkbox":s(this).is(":checked")?(s("#saswp_website_schema").val(1),s("#saswp_search_box_schema").parent().parent().show()):(s("#saswp_website_schema").val(0),s("#saswp_search_box_schema").parent().parent().hide());break;case"saswp_search_box_schema_checkbox":s(this).is(":checked")?s("#saswp_search_box_schema").val(1):s("#saswp_search_box_schema").val(0);break;case"saswp_breadcrumb_schema_checkbox":s(this).is(":checked")?s("#saswp_breadcrumb_schema").val(1):s("#saswp_breadcrumb_schema").val(0);break;case"saswp_site_navigation_menu_checkbox":s(this).is(":checked")?(s("#saswp_site_navigation_menu").val(1),s(".saswp-nav-menu-list").show()):(s("#saswp_site_navigation_menu").val(0),s(".saswp-nav-menu-list").hide());break;case"saswp_comments_schema_checkbox":s(this).is(":checked")?s("#saswp_comments_schema").val(1):s("#saswp_comments_schema").val(0);break;case"saswp-compativility-checkbox":s(this).is(":checked")?s("#saswp-flexmlx-compativility").val(1):s("#saswp-flexmlx-compativility").val(0);break;case"saswp-review-module-checkbox":s(this).is(":checked")?s("#saswp-review-module").val(1):s("#saswp-review-module").val(0);break;case"saswp-kk-star-raring-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-kk-star-raring").val(1):s("#saswp-kk-star-raring").val(0);break;case"saswp-woocommerce-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-woocommerce").val(1):s("#saswp-woocommerce").val(0);break;case"saswp-extra-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-extra").val(1):s("#saswp-extra").val(0);break;case"saswp-dw-question-answer-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-dw-question-answer").val(1):s("#saswp-dw-question-answer").val(0);break;case"saswp-wp-job-manager-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-wp-job-manager").val(1):s("#saswp-wp-job-manager").val(0);break;case"saswp-yoast-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-yoast").val(1):s("#saswp-yoast").val(0);break;case"saswp-rankmath-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-rankmath").val(1):s("#saswp-rankmath").val(0);break;case"saswp-tagyeem-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-tagyeem").val(1):s("#saswp-tagyeem").val(0);break;case"saswp-the-events-calendar-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-the-events-calendar").val(1):s("#saswp-the-events-calendar").val(0);break;case"saswp-woocommerce-booking-checkbox":a(t,e),s(this).is(":checked")?(s("#saswp-woocommerce-booking").val(1),s("#saswp-woocommerce-booking-main").val(1)):(s("#saswp-woocommerce-booking").val(0),s("#saswp-woocommerce-booking-main").val(0));break;case"saswp-woocommerce-booking-main-checkbox":a(t,e),s(this).is(":checked")?(s("#saswp-woocommerce-booking-main").val(1),s("#saswp-woocommerce-booking").val(1)):(s("#saswp-woocommerce-booking-main").val(0),s("#saswp-woocommerce-booking").val(0));break;case"saswp-woocommerce-membership-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-woocommerce-membership").val(1):s("#saswp-woocommerce-membership").val(0);break;case"saswp-defragment-checkbox":s(this).is(":checked")?s("#saswp-defragment").val(1):s("#saswp-defragment").val(0);break;case"saswp-cooked-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-cooked").val(1):s("#saswp-cooked").val(0);break;case"saswp-flexmlx-compativility-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-flexmlx-compativility").val(1):s("#saswp-flexmlx-compativility").val(0);break;case"saswp-google-review-checkbox":s(this).is(":checked")?(s("#saswp-google-review").val(1),s("#saswp_google_place_api_key").parent().parent().show()):(s("#saswp-google-review").val(0),s("#saswp_google_place_api_key").parent().parent().hide());break;case"saswp-markup-footer-checkbox":s(this).is(":checked")?s("#saswp-markup-footer").val(1):s("#saswp-markup-footer").val(0);break;case"saswp-pretty-print-checkbox":s(this).is(":checked")?s("#saswp-pretty-print").val(1):s("#saswp-pretty-print").val(0);break;case"saswp-wppostratings-raring-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-wppostratings-raring").val(1):s("#saswp-wppostratings-raring").val(0);break;case"saswp-bbpress-checkbox":a(t,e),s(this).is(":checked")?s("#saswp-bbpress").val(1):s("#saswp-bbpress").val(0);break;case"saswp-microdata-cleanup-checkbox":s(this).is(":checked")?s("#saswp-microdata-cleanup").val(1):s("#saswp-microdata-cleanup").val(0)}}).change(),s("#saswp_kb_type").change(function(){var a=s(this).val();s(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass("saswp_hide"),s(".saswp_kg_logo").parent().parent().parent().addClass("saswp_hide"),s("#sd-person-image").parent().parent().parent().addClass("saswp_hide"),"Organization"==a&&(s(".saswp_org_fields").parent().parent().removeClass("saswp_hide"),s(".saswp_person_fields").parent().parent().addClass("saswp_hide"),s(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),s("#sd-person-image").parent().parent().parent().addClass("saswp_hide")),"Person"==a&&(s(".saswp_org_fields").parent().parent().addClass("saswp_hide"),s(".saswp_person_fields").parent().parent().removeClass("saswp_hide"),s(".saswp_kg_logo").parent().parent().parent().removeClass("saswp_hide"),s("#sd-person-image").parent().parent().parent().removeClass("saswp_hide"))}).change(),s(document).on("click","input[data-id=media]",function(a){a.preventDefault();var e=s(this),t=e.attr("id").replace("_button",""),i=wp.media({title:"Application Icon",button:{text:"Select Icon"},multiple:!1,library:{type:"image"}}).on("select",function(){var a=i.state().get("selection").first().toJSON();s("#"+t).val(a.url),s("input[data-id='"+t+"_id']").val(a.id),s("input[data-id='"+t+"_height']").val(a.height),s("input[data-id='"+t+"_width']").val(a.width),s("input[data-id='"+t+"_thumbnail']").val(a.url),"sd_default_image_button"===e.attr("id")&&(s("#sd_default_image_width").val(a.width),s("#sd_default_image_height").val(a.height)),s(".saswp_image_div_"+t).html('<div class="saswp_image_thumbnail"><img class="saswp_image_prev" src="'+a.url+'"/><a data-id="'+t+'" href="#" class="saswp_prev_close">X</a></div>')}).open()}),s(document).on("click",".saswp_prev_close",function(a){a.preventDefault();var e=s(this).attr("data-id");console.log(e),s(this).parent().remove(),s("#"+e).val(""),s("input[data-id='"+e+"_id']").val(""),s("input[data-id='"+e+"_height']").val(""),s("input[data-id='"+e+"_width']").val(""),s("input[data-id='"+e+"_thumbnail']").val(""),"sd_default_image"===e&&(s("#sd_default_image_width").val(""),s("#sd_default_image_height").val(""))}),s(document).on("change",".saswp-schema-type-toggle",function(a){var e=s(this).attr("data-schema-id"),t=s(this).attr("data-post-id");if(s(this).is(":checked"))var i=1;else i=0;s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_enable_disable_schema_on_post",status:i,schema_id:e,post_id:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){},error:function(s){console.log(s)}})}),s(document).on("click",".saswp-reset-data",function(a){a.preventDefault(),1==confirm("Are you sure?")&&s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_reset_all_settings",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){setTimeout(function(){location.reload()},1e3)},error:function(s){console.log(s)}})}),s(document).on("click",".saswp_license_activation",function(a){a.preventDefault();var e=s(this).attr("license-status"),t=s(this).attr("add-on"),i=s("#"+t+"_addon_license_key").val();e&&t&&i&&s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_license_status_check",license_key:i,license_status:e,add_on:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(a){s("#"+t+"_addon_license_key_status").val(a.status),"active"==a.status?(s(".saswp-"+t+"-dashicons").addClass("dashicons-yes"),s(".saswp-"+t+"-dashicons").removeClass("dashicons-no-alt"),s(".saswp-"+t+"-dashicons").css("color","green"),s(".saswp_license_activation[add-on='"+t+"']").attr("license-status","inactive"),s(".saswp_license_activation[add-on='"+t+"']").text("Deactivate"),s(".saswp_license_status_msg[add-on='"+t+"']").text("Activated"),s(".saswp_license_status_msg[add-on='"+t+"']").css("color","green"),s(".saswp_license_status_msg[add-on='"+t+"']").text(a.message)):(s(".saswp-"+t+"-dashicons").addClass("dashicons-no-alt"),s(".saswp-"+t+"-dashicons").removeClass("dashicons-yes"),s(".saswp-"+t+"-dashicons").css("color","red"),s(".saswp_license_activation[add-on='"+t+"']").attr("license-status","active"),s(".saswp_license_activation[add-on='"+t+"']").text("Activate"),s(".saswp_license_status_msg[add-on='"+t+"']").css("color","red"),s(".saswp_license_status_msg[add-on='"+t+"']").text(a.message))},error:function(s){console.log(s)}})}),s(".saswp-send-query").on("click",function(a){a.preventDefault();var e=s("#saswp_query_message").val();""!=s.trim(e)?s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_send_query_message",message:e,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(a){"t"==a.status?(s(".saswp-query-success").show(),s(".saswp-query-error").hide()):(console.log("dd"),s(".saswp-query-success").hide(),s(".saswp-query-error").show())},error:function(s){console.log(s)}}):alert("Please enter the message")}),s(".saswp-import-plugins").on("click",function(a){a.preventDefault();var e=s(this);e.addClass("updating-message");var t=s(this).attr("data-id");s.get(ajaxurl,{action:"saswp_import_plugin_data",plugin_name:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(a){"t"==a.status?(s(e).parent().find(".saswp-imported-message").text(a.message),s(e).parent().find(".saswp-imported-message").removeClass("saswp-error"),setTimeout(function(){location.reload()},2e3)):(s(e).parent().find(".saswp-imported-message").addClass("saswp-error"),s(e).parent().find(".saswp-imported-message").text(a.message)),e.removeClass("updating-message")},"json")}),s(".saswp-feedback-no-thanks").on("click",function(a){a.preventDefault(),s.get(ajaxurl,{action:"saswp_feeback_no_thanks"},function(a){"t"==a.status&&s(".saswp-feedback-notice").hide()},"json")}),s(".saswp-feedback-remindme").on("click",function(a){a.preventDefault(),s.get(ajaxurl,{action:"saswp_feeback_remindme"},function(a){"t"==a.status&&s(".saswp-feedback-notice").hide()},"json")}),s(document).on("change",".saswp-local-business-type-select",function(a){a.preventDefault();var e=s(this),t=s(this).val();s.get(ajaxurl,{action:"saswp_get_sub_business_ajax",business_type:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(a){if("t"==a.status){s(".saswp-local-business-name-select").parents("tr").remove();var t=e.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+'">',s.each(a.result,function(s,a){i+='<option value="'+s+'">'+a+"</option>"}),i+="</select></td>",i+="</tr>",e.parents(".form-table tr:first").after(i)}else s(".saswp-local-business-name-select").parents("tr").remove()},"json")}),e(),s(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"}),s(document).on("click",".saswp-add-custom-schema",function(a){a.preventDefault(),s(".saswp-add-custom-schema-field").removeClass("saswp_hide"),s(this).hide()}),s(document).on("click",".saswp-delete-custom-schema",function(a){a.preventDefault(),s("#saswp_custom_schema_field").val(""),s(".saswp-add-custom-schema-field").addClass("saswp_hide"),s(".saswp-add-custom-schema").show()}),s(".saswp-modify_schema_post_enable").on("click",function(a){var i=s(this);i.addClass("updating-message"),a.preventDefault(),s.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(a){i.remove(),s(".saswp-add-custom-schema-div").remove(),s("#post_specific .inside").append(a),i.removeClass("updating-message"),s(".saswp-local-schema-time-picker").timepicker({timeFormat:"H:i:s"}),t(),o(),e()})}),t(),s(document).on("click",".saswp-add-more-item",function(a){a.preventDefault();var e=s(".saswp-review-item-list-table tr").length;console.log(e);s(".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>')}),s(document).on("click",".saswp-remove-review-item",function(a){a.preventDefault(),s(this).parent().parent("tr").remove()}),s(document).on("focusout",".saswp-review-item-tr input[type=number]",function(a){a.preventDefault();var e=0,t=s(".saswp-review-item-tr input[type=number]").length;s(".saswp-review-item-tr input[type=number]").each(function(a,t){""==s(t).val()?e+=parseFloat(0):e+=parseFloat(s(t).val())});var i=e/t;s("#saswp-review-item-over-all").val(i)}),s("#saswp-review-location").change(function(){var a=s(this).val();s(".saswp-review-shortcode").addClass("saswp_hide"),3==a&&s(".saswp-review-shortcode").removeClass("saswp_hide")}).change(),s("#saswp-review-item-enable").change(function(){s(this).is(":checked")?s(".saswp-review-fields").show():s(".saswp-review-fields").hide()}).change(),s(document).on("click",".saswp-restore-post-schema",function(a){a.preventDefault();var e=s(this);if(e.addClass("updating-message"),s(".saswp-post-specific-schema-ids").val())var t=JSON.parse(s(".saswp-post-specific-schema-ids").val());s.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(s){"t"==s.status?setTimeout(function(){location.reload()},1e3):(alert(s.msg),setTimeout(function(){location.reload()},1e3)),e.removeClass("updating-message")},"json")}),s(document).on("click","div.saswp-tab ul.saswp-tab-nav a",function(a){a.preventDefault();var e=s(this).attr("data-id");s(".saswp-post-specific-wrapper").hide(),s("#"+e).show(),s("div.saswp-tab ul.saswp-tab-nav a").removeClass("selected"),s("div.saswp-tab ul.saswp-tab-nav li").removeClass("selected"),s(this).addClass("selected"),s(this).parent().addClass("selected"),o()}),s("#saswp-global-tabs a:first").addClass("saswp-global-selected"),s(".saswp-global-container").hide(),s(".saswp-global-container:first").show(),s("#saswp-global-tabs a").click(function(){var a=s(this).attr("data-id");s(this).hasClass("saswp-global-selected")||(s("#saswp-global-tabs a").removeClass("saswp-global-selected"),s(this).addClass("saswp-global-selected"),s(".saswp-global-container").hide(),s("#"+a).show())}),s('a[href="'+saswp_localize_data.new_url_selector+'"]').attr("href",saswp_localize_data.new_url_href),s("#saswp_enable_custom_field").change(function(){s(this).is(":checked")?s(".saswp-custom-fields-div").show():s(".saswp-custom-fields-div").hide()}),s(document).on("change",".saswp-custom-fields-name",function(){s(this).parent().parent("tr").find("td:eq(1)").html("");var a="";a+='<select class="saswp-custom-fields-select2" name="saswp_custom_fields['+s(this).val()+']">',a+="</select>",s(this).parent().parent("tr").find("td:eq(1)").html(a),i()}),s(document).on("click",".saswp-skip-button",function(a){a.preventDefault(),s(this).parent().parent().hide(),s.post(ajaxurl,{action:"saswp_skip_wizard",saswp_security_nonce:saswp_localize_data.saswp_security_nonce},function(s){},"json")}),s(document).on("click",".saswp-trip-itinerary",function(a){a.preventDefault();var e=s(this).attr("data-id"),t=s(".saswp-trip-itinerary-table-div").length,i=s(".saswp-trip-itinerary-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-trip-itinerary-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-trip-itinerary-table"><tr><th>Itinerary Type</th><td><select id="saswp_trip_itinerary_type_'+i+"_"+e+'" name="trip_itinerary_'+e+"["+i+'][saswp_trip_itinerary_type]"><option value="City">City</option><option value="LandmarksOrHistoricalBuildings">LandmarksOrHistoricalBuildings</option><option value="AdministrativeArea">AdministrativeArea</option><option value="LakeBodyOfWater">LakeBodyOfWater</option></select></td></tr><tr><th>Itinerary Name</th><td><input style="width:100%" type="text" id="saswp_trip_itinerary_name_'+i+"_"+e+'" name="trip_itinerary_'+e+"["+i+'][saswp_trip_itinerary_name]"></td></tr><tr><th>Itinerary Description</th><td><textarea placeholder="Description" style="width: 100%" id="saswp_trip_itinerary_description_'+i+"_"+e+'" name="trip_itinerary_'+e+"["+i+'][saswp_trip_itinerary_description]" rows="5"></textarea></td></tr><tr><th>Itinerary URL</th><td><input style="width:100%" type="text" id="saswp_trip_itinerary_url_'+i+"_"+e+'" name="trip_itinerary_'+e+"["+i+'][saswp_trip_itinerary_url]"></td></tr></table></div>')&&s('.saswp-trip-itinerary-section[data-id="'+e+'"]').append(o)}),s(document).on("click",".saswp-tvseries-actor",function(a){a.preventDefault();var e=s(this).attr("data-id"),t=s(".saswp-tvseries-actor-table-div").length,i=s(".saswp-tvseries-actor-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-tvseries-actor-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-tvseries-actor-table"><tr><th>Actor Name</th><td><input style="width:100%" type="text" id="saswp_tvseries_actor_name_'+i+"_"+e+'" name="tvseries_actor_'+e+"["+i+'][saswp_tvseries_actor_name]"></td></tr></table></div>')&&s('.saswp-tvseries-actor-section[data-id="'+e+'"]').append(o)}),s(document).on("click",".saswp-tvseries-season",function(a){a.preventDefault();var e=s(this).attr("data-id"),i=s(".saswp-tvseries-season-table-div").length,o=s(".saswp-tvseries-season-table-div:nth-child("+i+")").attr("data-id");(o=++o)||(o=0);var p="";(p+='<div class="saswp-tvseries-season-table-div" data-id="'+o+'"><a class="saswp-table-close">X</a><table class="form-table saswp-tvseries-season-table"><tr><th>Season</th><td><input style="width:100%" type="text" id="saswp_tvseries_season_name_'+o+"_"+e+'" name="tvseries_season_'+e+"["+o+'][saswp_tvseries_season_name]"></td></tr><tr><th>Season Published Date</th><td><input class="saswp-local-schema-datepicker-picker" style="width:100%" type="text" id="saswp_tvseries_season_published_date_'+o+"_"+e+'" name="tvseries_season_'+e+"["+o+'][saswp_tvseries_season_published_date]"></td></tr><tr><th>Number Of Episodes</th><td><input style="width:100%" type="text" id="saswp_tvseries_season_episodes_'+o+"_"+e+'" name="tvseries_season_'+e+"["+o+'][saswp_tvseries_season_episodes]"></td></tr></table></div>')&&(s('.saswp-tvseries-season-section[data-id="'+e+'"]').append(p),t())}),s(document).on("click",".saswp-mc-cause",function(a){a.preventDefault();var e=s(this).attr("data-id"),t=s(".saswp-mc-cause-table-div").length,i=s(".saswp-mc-cause-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-mc-cause-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-mc-cause-table"><tr><th>Cause</th><td><input style="width:100%" type="text" id="saswp_mc_cause_name_'+i+"_"+e+'" name="mc_cause_'+e+"["+i+'][saswp_mc_cause_name]"></td></tr></table></div>')&&s('.saswp-mc-cause-section[data-id="'+e+'"]').append(o)}),s(document).on("click",".saswp-mc-symptom",function(a){a.preventDefault();var e=s(this).attr("data-id"),t=s(".saswp-mc-symptom-table-div").length,i=s(".saswp-mc-symptom-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-mc-symptom-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-mc-symptom-table"><tr><th>Symptom Name</th><td><input style="width:100%" type="text" id="saswp_mc_symptom_name_'+i+"_"+e+'" name="mc_symptom_'+e+"["+i+'][saswp_mc_symptom_name]"></td></tr></table></div>')&&s('.saswp-mc-symptom-section[data-id="'+e+'"]').append(o)}),s(document).on("click",".saswp-mc-risk_factor",function(a){a.preventDefault();var e=s(this).attr("data-id"),t=s(".saswp-mc-risk_factor-table-div").length,i=s(".saswp-mc-risk_factor-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-mc-risk_factor-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-mc-risk_factor-table"><tr><th>Risk Factor Name</th><td><input style="width:100%" type="text" id="saswp_mc_risk_factor_name_'+i+"_"+e+'" name="mc_risk_factor_'+e+"["+i+'][saswp_mc_risk_factor_name]"></td></tr></table></div>')&&s('.saswp-mc-risk_factor-section[data-id="'+e+'"]').append(o)}),s(document).on("click",".saswp-how-to-supply",function(a){a.preventDefault();var e=s(this).attr("data-id"),t=s(".saswp-how-to-supply-table-div").length,i=s(".saswp-how-to-supply-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-how-to-supply-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-how-to-supply-table"><tr><th>Supply Name</th><td><input style="width:100%" type="text" id="saswp_howto_supply_name_'+i+"_"+e+'" name="howto_supply_'+e+"["+i+'][saswp_howto_supply_name]"></td></tr><tr><th>Supply Image</th><td><fieldset><input style="width:80%" type="text" id="saswp_howto_supply_image_'+i+"_"+e+'" name="saswp_howto_supply_image_'+i+"_"+e+'"><input type="hidden" data-id="saswp_howto_supply_image_'+i+"_"+e+'_id" name="howto_supply_'+e+"["+i+'][saswp_howto_supply_image_id]" id="saswp_howto_supply_image_'+i+"_"+e+'_id"><input data-id="media" style="width: 19%" class="button" id="saswp_howto_supply_image_'+i+"_"+e+'_button" name="saswp_howto_supply_image_'+i+"_"+e+'_button" type="button" value="Upload"><div class="saswp_image_div_saswp_howto_supply_image_'+i+"_"+e+'"></div></fieldset></td></tr></table></div>')&&s('.saswp-how-to-supply-section[data-id="'+e+'"]').append(o)}),s(document).on("click",".saswp-how-to-tool",function(a){a.preventDefault();var e=s(this).attr("data-id"),t=s(".saswp-how-to-tool-table-div").length,i=s(".saswp-how-to-tool-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-how-to-tool-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-how-to-tool-table"><tr><th>Tool Name</th><td><input style="width:100%" type="text" id="saswp_howto_tool_name_'+i+"_"+e+'" name="howto_tool_'+e+"["+i+'][saswp_howto_tool_name]"></td></tr><tr><th>Tool Image</th><td><fieldset><input style="width:80%" type="text" id="saswp_howto_tool_image_'+i+"_"+e+'" name="saswp_howto_tool_image_'+i+"_"+e+'"><input type="hidden" data-id="saswp_howto_tool_image_'+i+"_"+e+'_id" name="howto_tool_'+e+"["+i+'][saswp_howto_tool_image_id]" id="saswp_howto_tool_image_'+i+"_"+e+'_id"><input data-id="media" style="width: 19%" class="button" id="saswp_howto_tool_image_'+i+"_"+e+'_button" name="saswp_howto_tool_image_'+i+"_"+e+'_button" type="button" value="Upload"><div class="saswp_image_div_saswp_howto_tool_image_'+i+"_"+e+'"></div></fieldset></td></tr></table></div>')&&s('.saswp-how-to-tool-section[data-id="'+e+'"]').append(o)}),s(document).on("click",".saswp-how-to-step",function(a){a.preventDefault();var e=s(this).attr("data-id"),t=s(".saswp-how-to-step-table-div").length,i=s(".saswp-how-to-step-table-div:nth-child("+t+")").attr("data-id");(i=++i)||(i=0);var o="";(o+='<div class="saswp-how-to-step-table-div" data-id="'+i+'"><a class="saswp-table-close">X</a><table class="form-table saswp-how-to-step-table"><tr><th>Step Name</th><td><input style="width:100%" type="text" id="saswp_howto_step_name_'+i+"_"+e+'" name="howto_step_'+e+"["+i+'][saswp_howto_step_name]" ></td></tr><tr><th>HowToDirection Text</th><td><input style="width:100%" type="text" id="saswp_howto_direction_text_'+i+"_"+e+'" name="howto_step_'+e+"["+i+'][saswp_howto_direction_text]"></td></tr><tr><th>HowToTip Text</th><td><input style="width:100%" type="text" id="saswp_howto_tip_text_'+i+"_"+e+'" name="howto_step_'+e+"["+i+'][saswp_howto_tip_text]"></td></tr><tr><th>Step Image</th><td><fieldset><input style="width:80%" type="text" id="saswp_howto_step_image_'+i+"_"+e+'" name="saswp_howto_step_image_'+e+"["+i+']"><input type="hidden" data-id="saswp_howto_step_image_'+i+"_"+e+'_id" name="howto_step_'+e+"["+i+'][saswp_howto_step_image_id]" id="saswp_howto_step_image_'+i+"_"+e+'_id"><input data-id="media" style="width: 19%" class="button" id="saswp_howto_step_image_'+i+"_"+e+'_button" name="saswp_howto_step_image_'+i+"_"+e+'_button" type="button" value="Upload"><div class="saswp_image_div_saswp_howto_step_image_'+i+"_"+e+'"></div></fieldset></td></tr></table></div>')&&s('.saswp-how-to-step-section[data-id="'+e+'"]').append(o)}),s(document).on("click",".saswp-table-close",function(){s(this).parent().remove()}),s(document).on("click",".saswp-add-custom-fields",function(){var a=s("select#schema_type option:selected").val(),e=s("#post_ID").val();""!=a&&s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_get_schema_type_fields",post_id:e,schema_type:a,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(a){if(0!=a.length){var e=0,t="",o="<tr>";o+="<td>",o+='<select class="saswp-custom-fields-name">',s.each(a,function(s,a){0==e&&(t=s),o+='<option value="'+s+'">'+a+"</option>",e++}),o+="</select>",o+="</td>",o+="<td>",o+='<select class="saswp-custom-fields-select2" name="saswp_custom_fields['+t+']">',o+="</select>",o+="</td>",o+="</tr>",s(".saswp-custom-fields-table").append(o),i()}},error:function(s){console.log(s)}})}),i(),o(),s('a[href="'+saswp_localize_data.collection_post_add_url+'"]').attr("href",saswp_localize_data.collection_post_add_new_url),s(document).on("click",".saswp_coonect_google_place",function(){var a=s("#saswp_google_place_id").val(),e=s("#saswp_language_list").val(),t=s("#saswp_googel_api").val();""!=a&&s.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"saswp_connect_google_place",place_id:a,language:e,google_api:t,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},success:function(s){console.log(s.status)},error:function(s){console.log(s)}})}),"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>")});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function getParameterByName(name, url) {
2
+ if (!url){
3
+ url = window.location.href;
4
+ }
5
+ name = name.replace(/[\[\]]/g, "\\$&");
6
+ var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
7
+ results = regex.exec(url);
8
+ if (!results) return null;
9
+ if (!results[2]) return "";
10
+ return decodeURIComponent(results[2].replace(/\+/g, " "));
11
+ }
12
+ jQuery(document).ready(function($){
13
+
14
+ /* Newletters js starts here */
15
+
16
+ if(saswp_localize_data.do_tour){
17
+
18
+ var content = '<h3>Thanks for using Structured Data!</h3>';
19
+ content += '<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>';
20
+ content += '<style type="text/css">';
21
+ content += '.wp-pointer-buttons{ padding:0; overflow: hidden; }';
22
+ content += '.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} #afw_mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }';
23
+ content += '</style>';
24
+ content += '<div id="afw_mc_embed_signup">';
25
+ content += '<form action="//app.mailerlite.com/webforms/submit/o1s7u3" data-id="258182" data-code="o1s7u3" method="POST" target="_blank">';
26
+ content += '<div id="afw_mc_embed_signup_scroll">';
27
+ content += '<div class="afw-mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">';
28
+ content += '<input type="text" name="fields[name]" class="form-control" placeholder="Name" hidden value="'+saswp_localize_data.current_user_name+'" style="display:none">';
29
+ content += '<input type="text" value="'+saswp_localize_data.current_user_email+'" name="fields[email]" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">';
30
+ content += '<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+'">';
31
+ content += '<input type="hidden" name="ml-submit" value="1" />';
32
+ content += '</div>';
33
+ content += '<div id="mce-responses">';
34
+ content += '<div class="response" id="mce-error-response" style="display:none"></div>';
35
+ content += '<div class="response" id="mce-success-response" style="display:none"></div>';
36
+ content += '</div>';
37
+ content += '<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>';
38
+ content += '<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;">';
39
+ content += '</div>';
40
+ content += '</form>';
41
+ content += '</div>';
42
+
43
+ var setup;
44
+ var wp_pointers_tour_opts = {
45
+ content:content,
46
+ position:{
47
+ edge:"top",
48
+ align:"left"
49
+ }
50
+ };
51
+
52
+ wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
53
+ buttons: function (event, t) {
54
+ button= jQuery ('<a id="pointer-close" class="button-secondary">' + saswp_localize_data.button1 + '</a>');
55
+ button_2= jQuery ('#pointer-close.button');
56
+ button.bind ('click.pointer', function () {
57
+ t.element.pointer ('close');
58
+ });
59
+ button_2.on('click', function() {
60
+ t.element.pointer ('close');
61
+ } );
62
+ return button;
63
+ },
64
+ close: function () {
65
+ $.post (saswp_localize_data.ajax_url, {
66
+ pointer: 'saswp_subscribe_pointer222',
67
+ action: 'dismiss-wp-pointer'
68
+ });
69
+ },
70
+ show: function(event, t){
71
+ t.pointer.css({'left':'170px', 'top':'160px'});
72
+ }
73
+ });
74
+ setup = function () {
75
+ $(saswp_localize_data.displayID).pointer(wp_pointers_tour_opts).pointer('open');
76
+ if (saswp_localize_data.button2) {
77
+ jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + saswp_localize_data.button2+ '</a>');
78
+ jQuery ('#pointer-primary').click (function () {
79
+ saswp_localize_data.function_name;
80
+ });
81
+ jQuery ('#pointer-close').click (function () {
82
+ $.post (saswp_localize_data.ajax_url, {
83
+ pointer: 'saswp_subscribe_pointer222',
84
+ action: 'dismiss-wp-pointer'
85
+ });
86
+ });
87
+ }
88
+ };
89
+ if (wp_pointers_tour_opts.position && wp_pointers_tour_opts.position.defer_loading) {
90
+ $(window).bind('load.wp-pointers', setup);
91
+ }
92
+ else {
93
+ setup ();
94
+ }
95
+
96
+ }
97
+
98
+ /* Newletters js ends here */
99
+
100
+
101
+ $(".saswp-tabs a").click(function(e){
102
+ var href = $(this).attr('href');
103
+ var currentTab = getParameterByName('tab',href);
104
+ if(!currentTab){
105
+ currentTab = "general";
106
+ }
107
+ $(this).siblings().removeClass("nav-tab-active");
108
+ $(this).addClass("nav-tab-active");
109
+ $(".form-wrap").find(".saswp-"+currentTab).siblings().hide();
110
+ $(".form-wrap .saswp-"+currentTab).show();
111
+ window.history.pushState("", "", href);
112
+ return false;
113
+ });
114
+
115
+ $(".saswp-schame-type-select").change(function(){
116
+ $(".saswp-custom-fields-table").html('');
117
+ var schematype = $ (this).val();
118
+
119
+ $(".saswp-option-table-class tr").each(function(index,value){
120
+ if(index>0){
121
+ $(this).hide();
122
+ $(this).find('select').attr('disabled', true);
123
+ }
124
+ });
125
+ if(schematype == 'TechArticle' || schematype == 'Article' || schematype == 'Blogposting' || schematype == 'NewsArticle' || schematype == 'WebPage'){
126
+
127
+ $(".saswp-enable-speakable").parent().parent().show();
128
+ }else{
129
+ $(".saswp-enable-speakable").parent().parent().hide();
130
+ }
131
+
132
+ if(schematype == 'local_business'){
133
+ $(".saswp-option-table-class tr").eq(1).show();
134
+ $(".saswp-business-text-field-tr").show();
135
+ $(".saswp-option-table-class tr").find('select').attr('disabled', false);
136
+ // $("#saswp_dayofweek").attr('disabled', false);
137
+ $('.select-post-type').val('show_globally').trigger('change');
138
+ }
139
+ if(schematype == 'Service'){
140
+ $(".saswp-service-text-field-tr").show();
141
+ $(".saswp-option-table-class tr").find('select').attr('disabled', false);
142
+ }
143
+ if(schematype == 'Review'){
144
+ $(".saswp-review-text-field-tr").show();
145
+ $(".saswp-option-table-class tr").find('select').attr('disabled', false);
146
+ saswp_item_reviewed_call();
147
+ }
148
+ if(schematype == 'Product'){
149
+ $(".saswp-product-text-field-tr").show();
150
+ $(".saswp-option-table-class tr").find('select').attr('disabled', false);
151
+ }
152
+ if(schematype == 'Event'){
153
+ $(".saswp-event-text-field-tr").show();
154
+ $(".saswp-option-table-class tr").find('select').attr('disabled', false);
155
+ }
156
+ if(schematype == 'AudioObject'){
157
+ $(".saswp-audio-text-field-tr").show();
158
+ }
159
+ if(schematype == 'SoftwareApplication'){
160
+ $(".saswp-softwareapplication-text-field-tr").show();
161
+ }
162
+
163
+ $(".saswp-schem-type-note").addClass('saswp_hide');
164
+ if(schematype == 'qanda'){
165
+ $(".saswp-schem-type-note").removeClass('saswp_hide');
166
+ }
167
+
168
+ $(".saswp-job-posting-note").addClass('saswp_hide');
169
+
170
+ // if(schematype == 'JobPosting'){
171
+ // $(".saswp-job-posting-note").removeClass('saswp_hide');
172
+ // }
173
+
174
+ saswp_enable_rating_review();
175
+ });
176
+
177
+ $("#saswp_business_type").change(function(){
178
+ var businesstype = $ (this).val();
179
+ var schematype = $(".saswp-schame-type-select").val();
180
+
181
+ $(".saswp-option-table-class tr").each(function(index,value){
182
+ if(index>1){
183
+ $(this).hide();
184
+ $(this).find('select').attr('disabled', true);
185
+ }
186
+ });
187
+
188
+ if(schematype == 'TechArticle' || schematype == 'Article' || schematype == 'Blogposting' || schematype == 'NewsArticle' || schematype == 'WebPage'){
189
+
190
+ $(".saswp-enable-speakable").parent().parent().show();
191
+ }else{
192
+ $(".saswp-enable-speakable").parent().parent().hide();
193
+ }
194
+
195
+ if(schematype == 'local_business'){
196
+ $(".saswp-"+businesstype+'-tr').show();
197
+ $(".saswp-business-text-field-tr").show();
198
+ $(".saswp-"+businesstype+'-tr').find('select').attr('disabled', false);
199
+ // $("#saswp_dayofweek").attr('disabled', false);
200
+ }
201
+ if(schematype == 'Service'){
202
+ $(".saswp-service-text-field-tr").show();
203
+ $(".saswp-service-text-field-tr").find('select').attr('disabled', false);
204
+ }
205
+ if(schematype == 'Product'){
206
+ $(".saswp-product-text-field-tr").show();
207
+ $(".saswp-product-text-field-tr").find('select').attr('disabled', false);
208
+ }
209
+ if(schematype == 'AudioObject'){
210
+ $(".saswp-audio-text-field-tr").show();
211
+ }
212
+ if(schematype == 'SoftwareApplication'){
213
+ $(".saswp-softwareapplication-text-field-tr").show();
214
+ }
215
+
216
+ if(schematype == 'Review'){
217
+ $(".saswp-review-text-field-tr").show();
218
+ $(".saswp-review-text-field-tr").find('select').attr('disabled', false);
219
+ }
220
+ if(schematype == 'Event'){
221
+ $(".saswp-event-text-field-tr").show();
222
+ $(".saswp-event-text-field-tr").find('select').attr('disabled', false);
223
+ }
224
+ saswp_enable_rating_review();
225
+ }).change();
226
+
227
+
228
+ //Settings page jquery starts here
229
+
230
+
231
+ function saswp_compatibliy_notes(current, id){
232
+
233
+ var plugin_name = id.replace('-checkbox','');
234
+ var text = $("#"+plugin_name).next('p').text();
235
+
236
+ if (current.is(':checked') && text !=='') {
237
+ $("#"+plugin_name).next('p').removeClass('saswp_hide');
238
+ }else{
239
+
240
+ if($("#"+plugin_name).next('p').attr('data-id') == 1){
241
+ $("#"+plugin_name).next('p').text('This feature is only available in pro version');
242
+ }else{
243
+ $("#"+plugin_name).next('p').addClass('saswp_hide');
244
+ }
245
+ }
246
+
247
+ }
248
+
249
+
250
+ $(".saswp-checkbox").change(function(){
251
+
252
+ var id = $(this).attr("id");
253
+ var current = $(this);
254
+
255
+
256
+ switch(id){
257
+ case 'saswp-for-wordpress-checkbox':
258
+
259
+ if ($(this).is(':checked')) {
260
+ $("#saswp-for-wordpress").val(1);
261
+ }else{
262
+ $("#saswp-for-wordpress").val(0);
263
+ }
264
+ break;
265
+ case 'saswp-facebook-enable-checkbox':
266
+
267
+ if ($(this).is(':checked')) {
268
+ $("#saswp-facebook-enable").val(1);
269
+ $("#sd_facebook").show();
270
+ }else{
271
+ $("#saswp-facebook-enable").val(0);
272
+ $("#sd_facebook").hide();
273
+ }
274
+ break;
275
+ case 'saswp-twitter-enable-checkbox':
276
+
277
+ if ($(this).is(':checked')) {
278
+ $("#saswp-twitter-enable").val(1);
279
+ $("#sd_twitter").show();
280
+ }else{
281
+ $("#saswp-twitter-enable").val(0);
282
+ $("#sd_twitter").hide();
283
+ }
284
+ break;
285
+ case 'saswp-google-plus-enable-checkbox':
286
+
287
+ if ($(this).is(':checked')) {
288
+ $("#saswp-google-plus-enable").val(1);
289
+ $("#sd_google_plus").show();
290
+ }else{
291
+ $("#saswp-google-plus-enable").val(0);
292
+ $("#sd_google_plus").hide();
293
+ }
294
+ break;
295
+ case 'saswp-instagram-enable-checkbox':
296
+
297
+ if ($(this).is(':checked')) {
298
+ $("#saswp-instagram-enable").val(1);
299
+ $("#sd_instagram").show();
300
+ }else{
301
+ $("#saswp-instagram-enable").val(0);
302
+ $("#sd_instagram").hide();
303
+ }
304
+ break;
305
+ case 'saswp-youtube-enable-checkbox':
306
+
307
+ if ($(this).is(':checked')) {
308
+ $("#sd_youtube").show();
309
+ $("#saswp-youtube-enable").val(1);
310
+ }else{
311
+ $("#saswp-youtube-enable").val(0);
312
+ $("#sd_youtube").hide();
313
+ }
314
+ break;
315
+ case 'saswp-linkedin-enable-checkbox':
316
+
317
+ if ($(this).is(':checked')) {
318
+ $("#saswp-linkedin-enable").val(1);
319
+ $("#sd_linkedin").show();
320
+ }else{
321
+ $("#saswp-linkedin-enable").val(0);
322
+ $("#sd_linkedin").hide();
323
+ }
324
+ break;
325
+ case 'saswp-pinterest-enable-checkbox':
326
+
327
+ if ($(this).is(':checked')) {
328
+ $("#saswp-pinterest-enable").val(1);
329
+ $("#sd_pinterest").show();
330
+ }else{
331
+ $("#saswp-pinterest-enable").val(0);
332
+ $("#sd_pinterest").hide();
333
+ }
334
+ break;
335
+ case 'saswp-soundcloud-enable-checkbox':
336
+
337
+ if ($(this).is(':checked')) {
338
+ $("#saswp-soundcloud-enable").val(1);
339
+ $("#sd_soundcloud").show();
340
+ }else{
341
+ $("#saswp-soundcloud-enable").val(0);
342
+ $("#sd_soundcloud").hide();
343
+ }
344
+ break;
345
+ case 'saswp-tumblr-enable-checkbox':
346
+
347
+ if ($(this).is(':checked')) {
348
+ $("#saswp-tumblr-enable").val(1);
349
+ $("#sd_tumblr").show();
350
+ }else{
351
+ $("#saswp-tumblr-enable").val(0);
352
+ $("#sd_tumblr").hide();
353
+ }
354
+ break;
355
+ case 'saswp-for-amp-checkbox':
356
+
357
+ if ($(this).is(':checked')) {
358
+ $("#saswp-for-amp").val(1);
359
+ }else{
360
+ $("#saswp-for-amp").val(0);
361
+ }
362
+ break;
363
+ case 'saswp_kb_contact_1_checkbox':
364
+
365
+ if ($(this).is(':checked')) {
366
+ $("#saswp_kb_contact_1").val(1);
367
+ $("#saswp_kb_telephone, #saswp_contact_type").parent().parent('li').removeClass("saswp-display-none");
368
+ }else{
369
+ $("#saswp_kb_contact_1").val(0);
370
+ $("#saswp_kb_telephone, #saswp_contact_type").parent().parent('li').addClass("saswp-display-none");
371
+ }
372
+ break;
373
+ case 'saswp-logo-dimensions-check':
374
+
375
+ if ($(this).is(':checked')) {
376
+ $("#saswp-logo-dimensions").val(1);
377
+ $("#saswp-logo-width, #saswp-logo-height").parent().parent('li').show();
378
+ }else{
379
+ $("#saswp-logo-dimensions").val(0);
380
+ $("#saswp-logo-width, #saswp-logo-height").parent().parent('li').hide();
381
+ }
382
+ break;
383
+ case 'saswp_archive_schema_checkbox':
384
+
385
+ if ($(this).is(':checked')) {
386
+ $("#saswp_archive_schema").val(1);
387
+ $(".saswp_archive_schema_type_class").parent().parent().show();
388
+ }else{
389
+ $("#saswp_archive_schema").val(0);
390
+ $(".saswp_archive_schema_type_class").parent().parent().hide();
391
+ }
392
+ break;
393
+
394
+ case 'saswp_website_schema_checkbox':
395
+
396
+ if ($(this).is(':checked')) {
397
+ $("#saswp_website_schema").val(1);
398
+ $("#saswp_search_box_schema").parent().parent().show();
399
+ }else{
400
+ $("#saswp_website_schema").val(0);
401
+ $("#saswp_search_box_schema").parent().parent().hide();
402
+ }
403
+ break;
404
+
405
+ case 'saswp_search_box_schema_checkbox':
406
+
407
+ if ($(this).is(':checked')) {
408
+ $("#saswp_search_box_schema").val(1);
409
+ }else{
410
+ $("#saswp_search_box_schema").val(0);
411
+ }
412
+ break;
413
+
414
+ case 'saswp_breadcrumb_schema_checkbox':
415
+
416
+ if ($(this).is(':checked')) {
417
+ $("#saswp_breadcrumb_schema").val(1);
418
+ }else{
419
+ $("#saswp_breadcrumb_schema").val(0);
420
+ }
421
+ break;
422
+
423
+ case 'saswp_site_navigation_menu_checkbox':
424
+
425
+ if ($(this).is(':checked')) {
426
+ $("#saswp_site_navigation_menu").val(1);
427
+ $(".saswp-nav-menu-list").show();
428
+ }else{
429
+ $("#saswp_site_navigation_menu").val(0);
430
+ $(".saswp-nav-menu-list").hide();
431
+ }
432
+ break;
433
+
434
+ case 'saswp_comments_schema_checkbox':
435
+
436
+ if ($(this).is(':checked')) {
437
+ $("#saswp_comments_schema").val(1);
438
+ }else{
439
+ $("#saswp_comments_schema").val(0);
440
+ }
441
+ break;
442
+
443
+ case 'saswp-compativility-checkbox':
444
+
445
+ if ($(this).is(':checked')) {
446
+ $("#saswp-flexmlx-compativility").val(1);
447
+ }else{
448
+ $("#saswp-flexmlx-compativility").val(0);
449
+ }
450
+ break;
451
+
452
+ case 'saswp-review-module-checkbox':
453
+
454
+ if ($(this).is(':checked')) {
455
+ $("#saswp-review-module").val(1);
456
+ }else{
457
+ $("#saswp-review-module").val(0);
458
+ }
459
+ break;
460
+
461
+ case 'saswp-kk-star-raring-checkbox':
462
+
463
+ saswp_compatibliy_notes(current, id);
464
+ if ($(this).is(':checked')) {
465
+ $("#saswp-kk-star-raring").val(1);
466
+ }else{
467
+ $("#saswp-kk-star-raring").val(0);
468
+ }
469
+ break;
470
+ case 'saswp-woocommerce-checkbox':
471
+ saswp_compatibliy_notes(current, id);
472
+ if ($(this).is(':checked')) {
473
+ $("#saswp-woocommerce").val(1);
474
+ }else{
475
+ $("#saswp-woocommerce").val(0);
476
+ }
477
+ break;
478
+
479
+ case 'saswp-extra-checkbox':
480
+ saswp_compatibliy_notes(current, id);
481
+ if ($(this).is(':checked')) {
482
+ $("#saswp-extra").val(1);
483
+ }else{
484
+ $("#saswp-extra").val(0);
485
+ }
486
+ break;
487
+
488
+ case 'saswp-dw-question-answer-checkbox':
489
+ saswp_compatibliy_notes(current, id);
490
+ if ($(this).is(':checked')) {
491
+ $("#saswp-dw-question-answer").val(1);
492
+ }else{
493
+ $("#saswp-dw-question-answer").val(0);
494
+ }
495
+ break;
496
+
497
+ case 'saswp-wp-job-manager-checkbox':
498
+ saswp_compatibliy_notes(current, id);
499
+ if ($(this).is(':checked')) {
500
+ $("#saswp-wp-job-manager").val(1);
501
+ }else{
502
+ $("#saswp-wp-job-manager").val(0);
503
+ }
504
+ break;
505
+
506
+ case 'saswp-yoast-checkbox':
507
+ saswp_compatibliy_notes(current, id);
508
+ if ($(this).is(':checked')) {
509
+ $("#saswp-yoast").val(1);
510
+ }else{
511
+ $("#saswp-yoast").val(0);
512
+ }
513
+ break;
514
+
515
+ case 'saswp-rankmath-checkbox':
516
+ saswp_compatibliy_notes(current, id);
517
+ if ($(this).is(':checked')) {
518
+ $("#saswp-rankmath").val(1);
519
+ }else{
520
+ $("#saswp-rankmath").val(0);
521
+ }
522
+ break;
523
+
524
+ case 'saswp-tagyeem-checkbox':
525
+ saswp_compatibliy_notes(current, id);
526
+ if ($(this).is(':checked')) {
527
+ $("#saswp-tagyeem").val(1);
528
+ }else{
529
+ $("#saswp-tagyeem").val(0);
530
+ }
531
+ break;
532
+
533
+ case 'saswp-the-events-calendar-checkbox':
534
+ saswp_compatibliy_notes(current, id);
535
+ if ($(this).is(':checked')) {
536
+ $("#saswp-the-events-calendar").val(1);
537
+ }else{
538
+ $("#saswp-the-events-calendar").val(0);
539
+ }
540
+ break;
541
+
542
+
543
+ case 'saswp-woocommerce-booking-checkbox':
544
+ saswp_compatibliy_notes(current, id);
545
+ if ($(this).is(':checked')) {
546
+ $("#saswp-woocommerce-booking").val(1);
547
+ $("#saswp-woocommerce-booking-main").val(1);
548
+ }else{
549
+ $("#saswp-woocommerce-booking").val(0);
550
+ $("#saswp-woocommerce-booking-main").val(0);
551
+ }
552
+ break;
553
+
554
+ case 'saswp-woocommerce-booking-main-checkbox':
555
+ saswp_compatibliy_notes(current, id);
556
+ if ($(this).is(':checked')) {
557
+ $("#saswp-woocommerce-booking-main").val(1);
558
+ $("#saswp-woocommerce-booking").val(1);
559
+ }else{
560
+ $("#saswp-woocommerce-booking-main").val(0);
561
+ $("#saswp-woocommerce-booking").val(0);
562
+ }
563
+ break;
564
+
565
+ case 'saswp-woocommerce-membership-checkbox':
566
+ saswp_compatibliy_notes(current, id);
567
+ if ($(this).is(':checked')) {
568
+ $("#saswp-woocommerce-membership").val(1);
569
+ }else{
570
+ $("#saswp-woocommerce-membership").val(0);
571
+ }
572
+ break;
573
+
574
+ case 'saswp-defragment-checkbox':
575
+
576
+ if ($(this).is(':checked')) {
577
+ $("#saswp-defragment").val(1);
578
+ }else{
579
+ $("#saswp-defragment").val(0);
580
+ }
581
+ break;
582
+
583
+ case 'saswp-cooked-checkbox':
584
+ saswp_compatibliy_notes(current, id);
585
+ if ($(this).is(':checked')) {
586
+ $("#saswp-cooked").val(1);
587
+ }else{
588
+ $("#saswp-cooked").val(0);
589
+ }
590
+ break;
591
+
592
+ case 'saswp-flexmlx-compativility-checkbox':
593
+ saswp_compatibliy_notes(current, id);
594
+ if ($(this).is(':checked')) {
595
+ $("#saswp-flexmlx-compativility").val(1);
596
+ }else{
597
+ $("#saswp-flexmlx-compativility").val(0);
598
+ }
599
+ break;
600
+
601
+ case 'saswp-google-review-checkbox':
602
+
603
+ if ($(this).is(':checked')) {
604
+ $("#saswp-google-review").val(1);
605
+ $("#saswp_google_place_api_key").parent().parent().show();
606
+ }else{
607
+ $("#saswp-google-review").val(0);
608
+ $("#saswp_google_place_api_key").parent().parent().hide();
609
+ }
610
+ break;
611
+
612
+ case 'saswp-markup-footer-checkbox':
613
+
614
+ if ($(this).is(':checked')) {
615
+ $("#saswp-markup-footer").val(1);
616
+ }else{
617
+ $("#saswp-markup-footer").val(0);
618
+ }
619
+ break;
620
+
621
+ case 'saswp-pretty-print-checkbox':
622
+
623
+ if ($(this).is(':checked')) {
624
+ $("#saswp-pretty-print").val(1);
625
+ }else{
626
+ $("#saswp-pretty-print").val(0);
627
+ }
628
+ break;
629
+
630
+ case 'saswp-wppostratings-raring-checkbox':
631
+ saswp_compatibliy_notes(current, id);
632
+ if ($(this).is(':checked')) {
633
+ $("#saswp-wppostratings-raring").val(1);
634
+ }else{
635
+ $("#saswp-wppostratings-raring").val(0);
636
+ }
637
+ break;
638
+
639
+ case 'saswp-bbpress-checkbox':
640
+ saswp_compatibliy_notes(current, id);
641
+ if ($(this).is(':checked')) {
642
+ $("#saswp-bbpress").val(1);
643
+ }else{
644
+ $("#saswp-bbpress").val(0);
645
+ }
646
+ break;
647
+
648
+ case 'saswp-microdata-cleanup-checkbox':
649
+
650
+ if ($(this).is(':checked')) {
651
+ $("#saswp-microdata-cleanup").val(1);
652
+ }else{
653
+ $("#saswp-microdata-cleanup").val(0);
654
+ }
655
+ break;
656
+
657
+
658
+ default:
659
+ break;
660
+ }
661
+
662
+ }).change();
663
+
664
+ $("#saswp_kb_type").change(function(){
665
+
666
+ var datatype = $(this).val();
667
+
668
+ $(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass('saswp_hide');
669
+ $(".saswp_kg_logo").parent().parent().parent().addClass('saswp_hide');
670
+ $("#sd-person-image").parent().parent().parent().addClass('saswp_hide');
671
+
672
+
673
+ if(datatype == 'Organization'){
674
+
675
+ $(".saswp_org_fields").parent().parent().removeClass('saswp_hide');
676
+ $(".saswp_person_fields").parent().parent().addClass('saswp_hide');
677
+ $(".saswp_kg_logo").parent().parent().parent().removeClass('saswp_hide');
678
+ $("#sd-person-image").parent().parent().parent().addClass('saswp_hide');
679
+ }
680
+ if(datatype == 'Person'){
681
+
682
+ $(".saswp_org_fields").parent().parent().addClass('saswp_hide');
683
+ $(".saswp_person_fields").parent().parent().removeClass('saswp_hide');
684
+ $(".saswp_kg_logo").parent().parent().parent().removeClass('saswp_hide');
685
+ $("#sd-person-image").parent().parent().parent().removeClass('saswp_hide');
686
+ }
687
+
688
+ }).change();
689
+
690
+ $(document).on("click", "input[data-id=media]" ,function(e) { // Application Icon upload
691
+ e.preventDefault();
692
+ var current = $(this);
693
+ var button = current;
694
+ var id = button.attr('id').replace('_button', '');
695
+ var saswpMediaUploader = wp.media({
696
+ title: "Application Icon",
697
+ button: {
698
+ text: "Select Icon"
699
+ },
700
+ multiple: false, // Set this to true to allow multiple files to be selected
701
+ library:{type : 'image'}
702
+ })
703
+ .on("select", function() {
704
+ var attachment = saswpMediaUploader.state().get('selection').first().toJSON();
705
+
706
+ $("#"+id).val(attachment.url);
707
+ $("input[data-id='"+id+"_id']").val(attachment.id);
708
+ $("input[data-id='"+id+"_height']").val(attachment.height);
709
+ $("input[data-id='"+id+"_width']").val(attachment.width);
710
+ $("input[data-id='"+id+"_thumbnail']").val(attachment.url);
711
+
712
+ if(current.attr('id') === 'sd_default_image_button'){
713
+
714
+ $("#sd_default_image_width").val(attachment.width);
715
+ $("#sd_default_image_height").val(attachment.height);
716
+
717
+ }
718
+ $(".saswp_image_div_"+id).html('<div class="saswp_image_thumbnail"><img class="saswp_image_prev" src="'+attachment.url+'"/><a data-id="'+id+'" href="#" class="saswp_prev_close">X</a></div>');
719
+
720
+ })
721
+ .open();
722
+ });
723
+
724
+ $(document).on("click", ".saswp_prev_close", function(e){
725
+ e.preventDefault();
726
+
727
+ var id = $(this).attr('data-id');
728
+ console.log(id);
729
+ $(this).parent().remove();
730
+ $("#"+id).val('');
731
+ $("input[data-id='"+id+"_id']").val('');
732
+ $("input[data-id='"+id+"_height']").val('');
733
+ $("input[data-id='"+id+"_width']").val('');
734
+ $("input[data-id='"+id+"_thumbnail']").val('');
735
+
736
+ if(id === 'sd_default_image'){
737
+
738
+ $("#sd_default_image_width").val('');
739
+ $("#sd_default_image_height").val('');
740
+
741
+ }
742
+
743
+
744
+ });
745
+
746
+ //Settings page jquery ends here
747
+
748
+
749
+ $(document).on("change",".saswp-schema-type-toggle", function(e){
750
+ var schema_id = $(this).attr("data-schema-id");
751
+ var post_id = $(this).attr("data-post-id");
752
+ if($(this).is(':checked')){
753
+ var status = 1;
754
+ }else{
755
+ var status = 0;
756
+ }
757
+ $.ajax({
758
+ type: "POST",
759
+ url:ajaxurl,
760
+ dataType: "json",
761
+ data:{action:"saswp_enable_disable_schema_on_post",status:status, schema_id:schema_id, post_id:post_id, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
762
+ success:function(response){
763
+ },
764
+ error: function(response){
765
+ console.log(response);
766
+ }
767
+ });
768
+
769
+ });
770
+
771
+
772
+ $(document).on("click",".saswp-reset-data", function(e){
773
+ e.preventDefault();
774
+
775
+ var saswp_confirm = confirm("Are you sure?");
776
+
777
+ if(saswp_confirm == true){
778
+
779
+ $.ajax({
780
+ type: "POST",
781
+ url:ajaxurl,
782
+ dataType: "json",
783
+ data:{action:"saswp_reset_all_settings", saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
784
+ success:function(response){
785
+ setTimeout(function(){ location.reload(); }, 1000);
786
+ },
787
+ error: function(response){
788
+ console.log(response);
789
+ }
790
+ });
791
+
792
+ }
793
+
794
+
795
+ });
796
+
797
+ //Licensing jquery starts here
798
+ $(document).on("click",".saswp_license_activation", function(e){
799
+ e.preventDefault();
800
+
801
+ var license_status = $(this).attr('license-status');
802
+ var add_on = $(this).attr('add-on');
803
+ var license_key = $("#"+add_on+"_addon_license_key").val();
804
+
805
+ if(license_status && add_on && license_key){
806
+
807
+ $.ajax({
808
+ type: "POST",
809
+ url:ajaxurl,
810
+ dataType: "json",
811
+ data:{action:"saswp_license_status_check",license_key:license_key,license_status:license_status, add_on:add_on, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
812
+ success:function(response){
813
+
814
+ $("#"+add_on+"_addon_license_key_status").val(response['status']);
815
+
816
+ if(response['status'] =='active'){
817
+ $(".saswp-"+add_on+"-dashicons").addClass('dashicons-yes');
818
+ $(".saswp-"+add_on+"-dashicons").removeClass('dashicons-no-alt');
819
+ $(".saswp-"+add_on+"-dashicons").css("color", "green");
820
+
821
+ $(".saswp_license_activation[add-on='" + add_on + "']").attr("license-status", "inactive");
822
+ $(".saswp_license_activation[add-on='" + add_on + "']").text("Deactivate");
823
+
824
+ $(".saswp_license_status_msg[add-on='" + add_on + "']").text('Activated');
825
+
826
+ $(".saswp_license_status_msg[add-on='" + add_on + "']").css("color", "green");
827
+ $(".saswp_license_status_msg[add-on='" + add_on + "']").text(response['message']);
828
+
829
+ }else{
830
+
831
+ $(".saswp-"+add_on+"-dashicons").addClass('dashicons-no-alt');
832
+ $(".saswp-"+add_on+"-dashicons").removeClass('dashicons-yes');
833
+ $(".saswp-"+add_on+"-dashicons").css("color", "red");
834
+
835
+ $(".saswp_license_activation[add-on='" + add_on + "']").attr("license-status", "active");
836
+ $(".saswp_license_activation[add-on='" + add_on + "']").text("Activate");
837
+
838
+ $(".saswp_license_status_msg[add-on='" + add_on + "']").css("color", "red");
839
+ $(".saswp_license_status_msg[add-on='" + add_on + "']").text(response['message']);
840
+ }
841
+
842
+ },
843
+ error: function(response){
844
+ console.log(response);
845
+ }
846
+ });
847
+
848
+ }
849
+
850
+ });
851
+ //Licensing jquery ends here
852
+ //query form send starts here
853
+
854
+ $(".saswp-send-query").on("click", function(e){
855
+ e.preventDefault();
856
+ var message = $("#saswp_query_message").val();
857
+ if($.trim(message) !=''){
858
+ $.ajax({
859
+ type: "POST",
860
+ url:ajaxurl,
861
+ dataType: "json",
862
+ data:{action:"saswp_send_query_message", message:message, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
863
+ success:function(response){
864
+ if(response['status'] =='t'){
865
+ $(".saswp-query-success").show();
866
+ $(".saswp-query-error").hide();
867
+ }else{
868
+ console.log('dd');
869
+ $(".saswp-query-success").hide();
870
+ $(".saswp-query-error").show();
871
+ }
872
+ },
873
+ error: function(response){
874
+ console.log(response);
875
+ }
876
+ });
877
+ }else{
878
+ alert('Please enter the message');
879
+ }
880
+
881
+ });
882
+
883
+ //Importer from schema plugin starts here
884
+
885
+ $(".saswp-import-plugins").on("click", function(e){
886
+ e.preventDefault();
887
+ var current_selection = $(this);
888
+ current_selection.addClass('updating-message');
889
+ var plugin_name = $(this).attr('data-id');
890
+ $.get(ajaxurl,
891
+ { action:"saswp_import_plugin_data", plugin_name:plugin_name, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
892
+ function(response){
893
+ if(response['status'] =='t'){
894
+ $(current_selection).parent().find(".saswp-imported-message").text(response['message']);
895
+ $(current_selection).parent().find(".saswp-imported-message").removeClass('saswp-error');
896
+ setTimeout(function(){ location.reload(); }, 2000);
897
+ }else{
898
+ $(current_selection).parent().find(".saswp-imported-message").addClass('saswp-error');
899
+ $(current_selection).parent().find(".saswp-imported-message").text(response['message']);
900
+ }
901
+ current_selection.removeClass('updating-message');
902
+ },'json');
903
+ });
904
+
905
+
906
+ $(".saswp-feedback-no-thanks").on("click", function(e){
907
+ e.preventDefault();
908
+ $.get(ajaxurl,
909
+ { action:"saswp_feeback_no_thanks"},
910
+ function(response){
911
+ if(response['status'] =='t'){
912
+ $(".saswp-feedback-notice").hide();
913
+ }
914
+ },'json');
915
+ });
916
+
917
+ $(".saswp-feedback-remindme").on("click", function(e){
918
+ e.preventDefault();
919
+ $.get(ajaxurl,
920
+ { action:"saswp_feeback_remindme"},
921
+ function(response){
922
+ if(response['status'] =='t'){
923
+ $(".saswp-feedback-notice").hide();
924
+ }
925
+ },'json');
926
+ });
927
+
928
+ $(document).on("change",'.saswp-local-business-type-select', function(e){
929
+ e.preventDefault();
930
+ var current = $(this);
931
+ var business_type = $(this).val();
932
+ $.get(ajaxurl,
933
+ { action:"saswp_get_sub_business_ajax", business_type:business_type, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
934
+ function(response){
935
+
936
+ if(response['status'] =='t'){
937
+ $(".saswp-local-business-name-select").parents('tr').remove();
938
+ var schema_id = current.parents('.saswp-post-specific-wrapper').attr('data-id');
939
+ var html ='<tr><th><label for="saswp_business_name_'+schema_id+'">Sub Business Type</label></th>';
940
+ html +='<td><select class="saswp-local-business-name-select" id="saswp_business_name_'+schema_id+'" name="saswp_business_name_'+schema_id+'">';
941
+ $.each(response['result'], function(index, element){
942
+ html +='<option value="'+index+'">'+element+'</option>';
943
+ });
944
+ html +='</select></td>';
945
+ html +='</tr>';
946
+ current.parents('.form-table tr:first').after(html);
947
+ }else{
948
+ $(".saswp-local-business-name-select").parents('tr').remove();
949
+ }
950
+ },'json');
951
+ });
952
+
953
+
954
+ function saswp_item_reviewed_call(){
955
+
956
+ $(".saswp-item-reviewed").change(function(e){
957
+ e.preventDefault();
958
+ var schema_type ="";
959
+
960
+ if($('select#schema_type option:selected').val()){
961
+ schema_type = $('select#schema_type option:selected').val();
962
+ }
963
+ if($(".saswp-tab-links.selected").attr('saswp-schema-type')){
964
+ schema_type = $(".saswp-tab-links.selected").attr('saswp-schema-type');
965
+ }
966
+
967
+ if(schema_type === 'Review'){
968
+
969
+ var current = $(this);
970
+ var item = $(this).val();
971
+ var post_id = saswp_localize_data.post_id;
972
+ var schema_id = $(current).attr('data-id');
973
+ var post_specific = $(current).attr('post-specific');
974
+ $.get(ajaxurl,
975
+ { action:"saswp_get_item_reviewed_fields",schema_id:schema_id, post_specific:post_specific ,item:item, post_id:post_id, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
976
+ function(response){
977
+
978
+ $(current).parent().parent().nextAll().remove(".saswp-review-tr");
979
+ $(current).parent().parent().after(response);
980
+
981
+ });
982
+
983
+ }
984
+
985
+
986
+ }).change();
987
+
988
+ }
989
+ saswp_item_reviewed_call();
990
+
991
+ function saswpAddTimepicker(){
992
+ $('.saswp-local-schema-time-picker').timepicker({ 'timeFormat': 'H:i:s'});
993
+ }
994
+ $('.saswp-local-schema-time-picker').timepicker({ 'timeFormat': 'H:i:s'});
995
+
996
+ $(document).on("click",".saswp-add-custom-schema", function(e){
997
+
998
+ e.preventDefault();
999
+
1000
+ $(".saswp-add-custom-schema-field").removeClass('saswp_hide');
1001
+ $(this).hide();
1002
+
1003
+ });
1004
+
1005
+ $(document).on("click", ".saswp-delete-custom-schema", function(e){
1006
+
1007
+ e.preventDefault();
1008
+
1009
+ $("#saswp_custom_schema_field").val('');
1010
+ $(".saswp-add-custom-schema-field").addClass('saswp_hide');
1011
+ $(".saswp-add-custom-schema").show();
1012
+
1013
+ });
1014
+
1015
+ $(".saswp-modify_schema_post_enable").on("click", function(e){
1016
+ var current = $(this);
1017
+ current.addClass('updating-message');
1018
+ e.preventDefault();
1019
+ $.get(ajaxurl,
1020
+ { action:"saswp_modify_schema_post_enable", post_id: saswp_localize_data.post_id,saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
1021
+ function(response){
1022
+ current.remove();
1023
+ $(".saswp-add-custom-schema-div").remove();
1024
+ $("#post_specific .inside").append(response);
1025
+ current.removeClass('updating-message');
1026
+ saswpAddTimepicker();
1027
+ saswp_schema_datepicker();
1028
+ saswp_enable_rating_review();
1029
+ saswp_item_reviewed_call();
1030
+ });
1031
+
1032
+ });
1033
+ saswp_schema_datepicker();
1034
+ function saswp_schema_datepicker(){
1035
+
1036
+ $('.saswp-local-schema-datepicker-picker').datepicker({
1037
+ dateFormat: "yy-mm-dd",
1038
+ minDate: 0
1039
+ });
1040
+ }
1041
+
1042
+
1043
+
1044
+ //Review js starts here
1045
+
1046
+ $(document).on("click", ".saswp-add-more-item",function(e){
1047
+ e.preventDefault();
1048
+ var rows = $('.saswp-review-item-list-table tr').length;
1049
+ console.log(rows);
1050
+ var html = '<tr class="saswp-review-item-tr">';
1051
+ html += '<td>Review Item Feature</td>';
1052
+ html += '<td><input type="text" name="saswp-review-item-feature[]"></td>';
1053
+ html += '<td>Rating</td>';
1054
+ html += '<td><input step="0.1" min="0" max="5" type="number" name="saswp-review-item-star-rating[]"></td>';
1055
+ html += '<td><a type="button" class="saswp-remove-review-item button">x</a></td>';
1056
+ html += '</tr>';
1057
+ $(".saswp-review-item-list-table").append(html);
1058
+
1059
+ });
1060
+
1061
+ $(document).on("click", ".saswp-remove-review-item", function(e){
1062
+ e.preventDefault();
1063
+ $(this).parent().parent('tr').remove();
1064
+ });
1065
+
1066
+ $(document).on("focusout", ".saswp-review-item-tr input[type=number]", function(e){
1067
+ e.preventDefault();
1068
+ var total_rating = 0;
1069
+ var element_count = $(".saswp-review-item-tr input[type=number]").length;
1070
+ $(".saswp-review-item-tr input[type=number]").each(function(index, element){
1071
+ if($(element).val() ==''){
1072
+ total_rating += parseFloat(0);
1073
+ }else{
1074
+ total_rating += parseFloat($(element).val());
1075
+ }
1076
+
1077
+ });
1078
+ var over_all_rating = total_rating / element_count;
1079
+ $("#saswp-review-item-over-all").val(over_all_rating);
1080
+ });
1081
+
1082
+ $("#saswp-review-location").change(function(){
1083
+ var location = $(this).val();
1084
+ $(".saswp-review-shortcode").addClass('saswp_hide');
1085
+ if(location == 3){
1086
+ $(".saswp-review-shortcode").removeClass('saswp_hide');
1087
+ }
1088
+ }).change();
1089
+
1090
+ $("#saswp-review-item-enable").change(function(){
1091
+ if ($(this).is(':checked')) {
1092
+ $(".saswp-review-fields").show();
1093
+ }else{
1094
+ $(".saswp-review-fields").hide();
1095
+ }
1096
+ }).change();
1097
+
1098
+ $(document).on("click", ".saswp-restore-post-schema", function(e){
1099
+ e.preventDefault();
1100
+ var current = $(this);
1101
+ current.addClass('updating-message');
1102
+
1103
+ if($(".saswp-post-specific-schema-ids").val()){
1104
+ var schema_ids = JSON.parse($(".saswp-post-specific-schema-ids").val());
1105
+ }
1106
+
1107
+ $.post(ajaxurl,
1108
+ { action:"saswp_restore_schema", schema_ids:schema_ids,post_id: saswp_localize_data.post_id, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
1109
+ function(response){
1110
+ if(response['status'] =='t'){
1111
+ setTimeout(function(){ location.reload(); }, 1000);
1112
+ }else{
1113
+ alert(response['msg']);
1114
+ setTimeout(function(){ location.reload(); }, 1000);
1115
+ }
1116
+ current.removeClass('updating-message');
1117
+ },'json');
1118
+ });
1119
+
1120
+ //Review js ends here
1121
+
1122
+ $(document).on("click","div.saswp-tab ul.saswp-tab-nav a", function(e){
1123
+ e.preventDefault();
1124
+ var attr = $(this).attr('data-id');
1125
+ $(".saswp-post-specific-wrapper").hide();
1126
+ $("#"+attr).show();
1127
+ $('div.saswp-tab ul.saswp-tab-nav a').removeClass('selected');
1128
+ $('div.saswp-tab ul.saswp-tab-nav li').removeClass('selected');
1129
+ $(this).addClass('selected');
1130
+ $(this).parent().addClass('selected');
1131
+ saswp_enable_rating_review();
1132
+ });
1133
+
1134
+
1135
+ $('#saswp-global-tabs a:first').addClass('saswp-global-selected');
1136
+ $('.saswp-global-container').hide();
1137
+ $('.saswp-global-container:first').show();
1138
+
1139
+ $('#saswp-global-tabs a').click(function(){
1140
+ var t = $(this).attr('data-id');
1141
+
1142
+ if(!$(this).hasClass('saswp-global-selected')){
1143
+ $('#saswp-global-tabs a').removeClass('saswp-global-selected');
1144
+ $(this).addClass('saswp-global-selected');
1145
+
1146
+ $('.saswp-global-container').hide();
1147
+ $('#'+t).show();
1148
+ }
1149
+ });
1150
+
1151
+ //Importer from schema plugin ends here
1152
+
1153
+ //custom fields modify schema starts here
1154
+
1155
+ //Changing the url of add new schema type
1156
+ $('a[href="'+saswp_localize_data.new_url_selector+'"]').attr( 'href', saswp_localize_data.new_url_href);
1157
+
1158
+
1159
+ $("#saswp_enable_custom_field").change(function(){
1160
+ if ($(this).is(':checked')) {
1161
+ $(".saswp-custom-fields-div").show();
1162
+ }else{
1163
+ $(".saswp-custom-fields-div").hide();
1164
+ }
1165
+ });
1166
+ $(document).on('change','.saswp-custom-fields-name',function(){
1167
+
1168
+ $(this).parent().parent('tr').find("td:eq(1)").html('');
1169
+ var field_name = $(this).val();
1170
+ var html = '';
1171
+ html += '<select class="saswp-custom-fields-select2" name="saswp_custom_fields['+field_name+']">';
1172
+ html += '</select>';
1173
+ $(this).parent().parent('tr').find("td:eq(1)").html(html);
1174
+ saswpCustomSelect2();
1175
+ } );
1176
+
1177
+
1178
+ $(document).on("click", '.saswp-skip-button', function(e){
1179
+ e.preventDefault();
1180
+ $(this).parent().parent().hide();
1181
+
1182
+ $.post(ajaxurl,
1183
+ { action:"saswp_skip_wizard", saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
1184
+ function(response){
1185
+
1186
+ },'json');
1187
+
1188
+ });
1189
+
1190
+
1191
+
1192
+ //Trip schema starts here
1193
+
1194
+ $(document).on("click", ".saswp-trip-itinerary", function(e){
1195
+ e.preventDefault();
1196
+
1197
+ var schema_id = $(this).attr('data-id');
1198
+ var count = $(".saswp-trip-itinerary-table-div").length;
1199
+ var index = $( ".saswp-trip-itinerary-table-div:nth-child("+count+")" ).attr('data-id');
1200
+ index = ++index;
1201
+
1202
+ if(!index){
1203
+ index = 0;
1204
+ }
1205
+
1206
+ var html = '';
1207
+
1208
+ html += '<div class="saswp-trip-itinerary-table-div" data-id="'+index+'">'
1209
+ + '<a class="saswp-table-close">X</a>'
1210
+ + '<table class="form-table saswp-trip-itinerary-table">'
1211
+
1212
+ + '<tr>'
1213
+ + '<th>Itinerary Type</th>'
1214
+ + '<td>'
1215
+ + '<select id="saswp_trip_itinerary_type_'+index+'_'+schema_id+'" name="trip_itinerary_'+schema_id+'['+index+'][saswp_trip_itinerary_type]">'
1216
+ + '<option value="City">City</option>'
1217
+ + '<option value="LandmarksOrHistoricalBuildings">LandmarksOrHistoricalBuildings</option>'
1218
+ + '<option value="AdministrativeArea">AdministrativeArea</option>'
1219
+ + '<option value="LakeBodyOfWater">LakeBodyOfWater</option>'
1220
+ + '</select></td>'
1221
+ + '</tr>'
1222
+
1223
+ + '<tr>'
1224
+ + '<th>Itinerary Name</th><td><input style="width:100%" type="text" id="saswp_trip_itinerary_name_'+index+'_'+schema_id+'" name="trip_itinerary_'+schema_id+'['+index+'][saswp_trip_itinerary_name]"></td>'
1225
+ + '</tr>'
1226
+
1227
+ + '<tr>'
1228
+ + '<th>Itinerary Description</th><td><textarea placeholder="Description" style="width: 100%" id="saswp_trip_itinerary_description_'+index+'_'+schema_id+'" name="trip_itinerary_'+schema_id+'['+index+'][saswp_trip_itinerary_description]" rows="5"></textarea></td>'
1229
+ + '</tr>'
1230
+
1231
+ + '<tr>'
1232
+ + '<th>Itinerary URL</th><td><input style="width:100%" type="text" id="saswp_trip_itinerary_url_'+index+'_'+schema_id+'" name="trip_itinerary_'+schema_id+'['+index+'][saswp_trip_itinerary_url]"></td>'
1233
+ + '</tr>'
1234
+
1235
+ + '</table>'
1236
+ + '</div>';
1237
+ if(html){
1238
+ $('.saswp-trip-itinerary-section[data-id="'+schema_id+'"]').append(html);
1239
+ }
1240
+
1241
+
1242
+ });
1243
+
1244
+ //Trip schema ends here
1245
+
1246
+ //TvSeries schema starts here
1247
+
1248
+ $(document).on("click", ".saswp-tvseries-actor", function(e){
1249
+ e.preventDefault();
1250
+
1251
+ var schema_id = $(this).attr('data-id');
1252
+ var count = $(".saswp-tvseries-actor-table-div").length;
1253
+ var index = $( ".saswp-tvseries-actor-table-div:nth-child("+count+")" ).attr('data-id');
1254
+ index = ++index;
1255
+
1256
+ if(!index){
1257
+ index = 0;
1258
+ }
1259
+
1260
+ var html = '';
1261
+
1262
+ html += '<div class="saswp-tvseries-actor-table-div" data-id="'+index+'">'
1263
+ + '<a class="saswp-table-close">X</a>'
1264
+ + '<table class="form-table saswp-tvseries-actor-table">'
1265
+ + '<tr>'
1266
+ + '<th>Actor Name</th><td><input style="width:100%" type="text" id="saswp_tvseries_actor_name_'+index+'_'+schema_id+'" name="tvseries_actor_'+schema_id+'['+index+'][saswp_tvseries_actor_name]"></td>'
1267
+ + '</tr>'
1268
+ + '</table>'
1269
+ + '</div>';
1270
+ if(html){
1271
+ $('.saswp-tvseries-actor-section[data-id="'+schema_id+'"]').append(html);
1272
+ }
1273
+
1274
+
1275
+ });
1276
+
1277
+ $(document).on("click", ".saswp-tvseries-season", function(e){
1278
+ e.preventDefault();
1279
+
1280
+ var schema_id = $(this).attr('data-id');
1281
+ var count = $(".saswp-tvseries-season-table-div").length;
1282
+ var index = $( ".saswp-tvseries-season-table-div:nth-child("+count+")" ).attr('data-id');
1283
+ index = ++index;
1284
+
1285
+ if(!index){
1286
+ index = 0;
1287
+ }
1288
+
1289
+ var html = '';
1290
+
1291
+ html += '<div class="saswp-tvseries-season-table-div" data-id="'+index+'">'
1292
+ + '<a class="saswp-table-close">X</a>'
1293
+ + '<table class="form-table saswp-tvseries-season-table">'
1294
+ + '<tr>'
1295
+ + '<th>Season</th><td><input style="width:100%" type="text" id="saswp_tvseries_season_name_'+index+'_'+schema_id+'" name="tvseries_season_'+schema_id+'['+index+'][saswp_tvseries_season_name]"></td>'
1296
+ + '</tr>'
1297
+ + '<tr>'
1298
+ + '<th>Season Published Date</th><td><input class="saswp-local-schema-datepicker-picker" style="width:100%" type="text" id="saswp_tvseries_season_published_date_'+index+'_'+schema_id+'" name="tvseries_season_'+schema_id+'['+index+'][saswp_tvseries_season_published_date]"></td>'
1299
+ + '</tr>'
1300
+ + '<tr>'
1301
+ + '<th>Number Of Episodes</th><td><input style="width:100%" type="text" id="saswp_tvseries_season_episodes_'+index+'_'+schema_id+'" name="tvseries_season_'+schema_id+'['+index+'][saswp_tvseries_season_episodes]"></td>'
1302
+ + '</tr>'
1303
+ + '</table>'
1304
+ + '</div>';
1305
+ if(html){
1306
+
1307
+ $('.saswp-tvseries-season-section[data-id="'+schema_id+'"]').append(html);
1308
+ saswp_schema_datepicker();
1309
+
1310
+ }
1311
+
1312
+
1313
+ });
1314
+
1315
+ //TvSeries schema ends here
1316
+
1317
+ //Medical condition schema starts here
1318
+
1319
+ $(document).on("click", ".saswp-mc-cause", function(e){
1320
+ e.preventDefault();
1321
+
1322
+ var schema_id = $(this).attr('data-id');
1323
+ var count = $(".saswp-mc-cause-table-div").length;
1324
+ var index = $( ".saswp-mc-cause-table-div:nth-child("+count+")" ).attr('data-id');
1325
+ index = ++index;
1326
+
1327
+ if(!index){
1328
+ index = 0;
1329
+ }
1330
+
1331
+ var html = '';
1332
+
1333
+ html += '<div class="saswp-mc-cause-table-div" data-id="'+index+'">'
1334
+ + '<a class="saswp-table-close">X</a>'
1335
+ + '<table class="form-table saswp-mc-cause-table">'
1336
+ + '<tr>'
1337
+ + '<th>Cause</th><td><input style="width:100%" type="text" id="saswp_mc_cause_name_'+index+'_'+schema_id+'" name="mc_cause_'+schema_id+'['+index+'][saswp_mc_cause_name]"></td>'
1338
+ + '</tr>'
1339
+ + '</table>'
1340
+ + '</div>';
1341
+ if(html){
1342
+ $('.saswp-mc-cause-section[data-id="'+schema_id+'"]').append(html);
1343
+ }
1344
+
1345
+
1346
+ });
1347
+
1348
+ $(document).on("click", ".saswp-mc-symptom", function(e){
1349
+ e.preventDefault();
1350
+
1351
+ var schema_id = $(this).attr('data-id');
1352
+ var count = $(".saswp-mc-symptom-table-div").length;
1353
+ var index = $( ".saswp-mc-symptom-table-div:nth-child("+count+")" ).attr('data-id');
1354
+ index = ++index;
1355
+
1356
+ if(!index){
1357
+ index = 0;
1358
+ }
1359
+
1360
+ var html = '';
1361
+
1362
+ html += '<div class="saswp-mc-symptom-table-div" data-id="'+index+'">'
1363
+ + '<a class="saswp-table-close">X</a>'
1364
+ + '<table class="form-table saswp-mc-symptom-table">'
1365
+ + '<tr>'
1366
+ + '<th>Symptom Name</th><td><input style="width:100%" type="text" id="saswp_mc_symptom_name_'+index+'_'+schema_id+'" name="mc_symptom_'+schema_id+'['+index+'][saswp_mc_symptom_name]"></td>'
1367
+ + '</tr>'
1368
+ + '</table>'
1369
+ + '</div>';
1370
+ if(html){
1371
+ $('.saswp-mc-symptom-section[data-id="'+schema_id+'"]').append(html);
1372
+ }
1373
+
1374
+
1375
+ });
1376
+
1377
+ $(document).on("click", ".saswp-mc-risk_factor", function(e){
1378
+ e.preventDefault();
1379
+
1380
+ var schema_id = $(this).attr('data-id');
1381
+ var count = $(".saswp-mc-risk_factor-table-div").length;
1382
+ var index = $( ".saswp-mc-risk_factor-table-div:nth-child("+count+")" ).attr('data-id');
1383
+ index = ++index;
1384
+
1385
+ if(!index){
1386
+ index = 0;
1387
+ }
1388
+
1389
+ var html = '';
1390
+
1391
+ html += '<div class="saswp-mc-risk_factor-table-div" data-id="'+index+'">'
1392
+ + '<a class="saswp-table-close">X</a>'
1393
+ + '<table class="form-table saswp-mc-risk_factor-table">'
1394
+ + '<tr>'
1395
+ + '<th>Risk Factor Name</th><td><input style="width:100%" type="text" id="saswp_mc_risk_factor_name_'+index+'_'+schema_id+'" name="mc_risk_factor_'+schema_id+'['+index+'][saswp_mc_risk_factor_name]"></td>'
1396
+ + '</tr>'
1397
+ + '</table>'
1398
+ + '</div>';
1399
+ if(html){
1400
+ $('.saswp-mc-risk_factor-section[data-id="'+schema_id+'"]').append(html);
1401
+ }
1402
+
1403
+
1404
+ });
1405
+
1406
+ //Medical condition schema ends here
1407
+
1408
+ //How to schema js starts here
1409
+
1410
+ $(document).on("click", ".saswp-how-to-supply", function(e){
1411
+ e.preventDefault();
1412
+
1413
+ var schema_id = $(this).attr('data-id');
1414
+ var count = $(".saswp-how-to-supply-table-div").length;
1415
+ var index = $( ".saswp-how-to-supply-table-div:nth-child("+count+")" ).attr('data-id');
1416
+ index = ++index;
1417
+
1418
+ if(!index){
1419
+ index = 0;
1420
+ }
1421
+
1422
+ var html = '';
1423
+
1424
+ html += '<div class="saswp-how-to-supply-table-div" data-id="'+index+'">'
1425
+ + '<a class="saswp-table-close">X</a>'
1426
+ + '<table class="form-table saswp-how-to-supply-table">'
1427
+ + '<tr>'
1428
+ + '<th>Supply Name</th><td><input style="width:100%" type="text" id="saswp_howto_supply_name_'+index+'_'+schema_id+'" name="howto_supply_'+schema_id+'['+index+'][saswp_howto_supply_name]"></td>'
1429
+ + '</tr>'
1430
+ + '<tr>'
1431
+ + '<th>Supply Image</th>'
1432
+ + '<td>'
1433
+ + '<fieldset>'
1434
+ + '<input style="width:80%" type="text" id="saswp_howto_supply_image_'+index+'_'+schema_id+'" name="saswp_howto_supply_image_'+index+'_'+schema_id+'">'
1435
+ + '<input type="hidden" data-id="saswp_howto_supply_image_'+index+'_'+schema_id+'_id" name="howto_supply_'+schema_id+'['+index+'][saswp_howto_supply_image_id]" id="saswp_howto_supply_image_'+index+'_'+schema_id+'_id">'
1436
+ + '<input data-id="media" style="width: 19%" class="button" id="saswp_howto_supply_image_'+index+'_'+schema_id+'_button" name="saswp_howto_supply_image_'+index+'_'+schema_id+'_button" type="button" value="Upload">'
1437
+ + '<div class="saswp_image_div_saswp_howto_supply_image_'+index+'_'+schema_id+'">'
1438
+ + '</div>'
1439
+ + '</fieldset>'
1440
+ + '</td>'
1441
+ + '</tr>'
1442
+ + '</table>'
1443
+ + '</div>';
1444
+ if(html){
1445
+ $('.saswp-how-to-supply-section[data-id="'+schema_id+'"]').append(html);
1446
+ }
1447
+
1448
+
1449
+ });
1450
+
1451
+ $(document).on("click", ".saswp-how-to-tool", function(e){
1452
+ e.preventDefault();
1453
+
1454
+ var schema_id = $(this).attr('data-id');
1455
+ var count = $(".saswp-how-to-tool-table-div").length;
1456
+ var index = $( ".saswp-how-to-tool-table-div:nth-child("+count+")" ).attr('data-id');
1457
+ index = ++index;
1458
+
1459
+ if(!index){
1460
+ index = 0;
1461
+ }
1462
+
1463
+ var html = '';
1464
+
1465
+ html += '<div class="saswp-how-to-tool-table-div" data-id="'+index+'">'
1466
+ + '<a class="saswp-table-close">X</a>'
1467
+ + '<table class="form-table saswp-how-to-tool-table">'
1468
+ + '<tr>'
1469
+ + '<th>Tool Name</th><td><input style="width:100%" type="text" id="saswp_howto_tool_name_'+index+'_'+schema_id+'" name="howto_tool_'+schema_id+'['+index+'][saswp_howto_tool_name]"></td>'
1470
+ + '</tr>'
1471
+ + '<tr>'
1472
+ + '<th>Tool Image</th>'
1473
+ + '<td>'
1474
+ + '<fieldset>'
1475
+ + '<input style="width:80%" type="text" id="saswp_howto_tool_image_'+index+'_'+schema_id+'" name="saswp_howto_tool_image_'+index+'_'+schema_id+'">'
1476
+ + '<input type="hidden" data-id="saswp_howto_tool_image_'+index+'_'+schema_id+'_id" name="howto_tool_'+schema_id+'['+index+'][saswp_howto_tool_image_id]" id="saswp_howto_tool_image_'+index+'_'+schema_id+'_id">'
1477
+ + '<input data-id="media" style="width: 19%" class="button" id="saswp_howto_tool_image_'+index+'_'+schema_id+'_button" name="saswp_howto_tool_image_'+index+'_'+schema_id+'_button" type="button" value="Upload">'
1478
+ + '<div class="saswp_image_div_saswp_howto_tool_image_'+index+'_'+schema_id+'">'
1479
+ + '</div>'
1480
+ + '</fieldset>'
1481
+ + '</td>'
1482
+ + '</tr>'
1483
+ + '</table>'
1484
+ + '</div>';
1485
+ if(html){
1486
+ $('.saswp-how-to-tool-section[data-id="'+schema_id+'"]').append(html);
1487
+ }
1488
+
1489
+
1490
+ });
1491
+
1492
+ $(document).on("click", ".saswp-how-to-step", function(e){
1493
+ e.preventDefault();
1494
+
1495
+ var schema_id = $(this).attr('data-id');
1496
+ var count = $(".saswp-how-to-step-table-div").length;
1497
+ var index = $( ".saswp-how-to-step-table-div:nth-child("+count+")" ).attr('data-id');
1498
+ index = ++index;
1499
+
1500
+ if(!index){
1501
+ index = 0;
1502
+ }
1503
+
1504
+ var html = '';
1505
+
1506
+ html+='<div class="saswp-how-to-step-table-div" data-id="'+index+'">'
1507
+ + '<a class="saswp-table-close">X</a>'
1508
+ + '<table class="form-table saswp-how-to-step-table">'
1509
+ + '<tr>'
1510
+ + '<th>Step Name</th><td><input style="width:100%" type="text" id="saswp_howto_step_name_'+index+'_'+schema_id+'" name="howto_step_'+schema_id+'['+index+'][saswp_howto_step_name]" ></td>'
1511
+ + '</tr>'
1512
+ + '<tr>'
1513
+ + '<th>HowToDirection Text</th><td><input style="width:100%" type="text" id="saswp_howto_direction_text_'+index+'_'+schema_id+'" name="howto_step_'+schema_id+'['+index+'][saswp_howto_direction_text]"></td>'
1514
+ + '</tr>'
1515
+ + '<tr>'
1516
+ + '<th>HowToTip Text</th><td><input style="width:100%" type="text" id="saswp_howto_tip_text_'+index+'_'+schema_id+'" name="howto_step_'+schema_id+'['+index+'][saswp_howto_tip_text]"></td>'
1517
+ + '</tr>'
1518
+ + '<tr>'
1519
+ + '<th>Step Image</th>'
1520
+ + '<td>'
1521
+ + '<fieldset>'
1522
+ + '<input style="width:80%" type="text" id="saswp_howto_step_image_'+index+'_'+schema_id+'" name="saswp_howto_step_image_'+schema_id+'['+index+']">'
1523
+ + '<input type="hidden" data-id="saswp_howto_step_image_'+index+'_'+schema_id+'_id" name="howto_step_'+schema_id+'['+index+'][saswp_howto_step_image_id]" id="saswp_howto_step_image_'+index+'_'+schema_id+'_id">'
1524
+ + '<input data-id="media" style="width: 19%" class="button" id="saswp_howto_step_image_'+index+'_'+schema_id+'_button" name="saswp_howto_step_image_'+index+'_'+schema_id+'_button" type="button" value="Upload">'
1525
+ + '<div class="saswp_image_div_saswp_howto_step_image_'+index+'_'+schema_id+'">'
1526
+ + '</div>'
1527
+ + '</fieldset>'
1528
+ + '</td>'
1529
+ + '</tr>'
1530
+ + '</table>'
1531
+ + '</div>';
1532
+
1533
+ if(html){
1534
+ $('.saswp-how-to-step-section[data-id="'+schema_id+'"]').append(html);
1535
+ }
1536
+
1537
+
1538
+ });
1539
+
1540
+ $(document).on("click", ".saswp-table-close", function(){
1541
+ $(this).parent().remove();
1542
+ });
1543
+
1544
+ //How to schema js ends here
1545
+
1546
+ $(document).on("click", '.saswp-add-custom-fields', function(){
1547
+ var schema_type = $('select#schema_type option:selected').val();
1548
+ var post_id = $('#post_ID').val();
1549
+ if(schema_type !=''){
1550
+ $.ajax({
1551
+ type: "POST",
1552
+ url:ajaxurl,
1553
+ dataType: "json",
1554
+ data:{action:"saswp_get_schema_type_fields",post_id:post_id, schema_type:schema_type, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
1555
+ success:function(response){
1556
+
1557
+ if(response.length !=0){
1558
+ var i =0;
1559
+ var name ='';
1560
+ var html = '<tr>';
1561
+ html += '<td>';
1562
+
1563
+ html += '<select class="saswp-custom-fields-name">';
1564
+ $.each(response, function(key,value){
1565
+ if(i==0){
1566
+ name = key;
1567
+ }
1568
+ html += '<option value="'+key+'">'+value+'</option>';
1569
+ i++;
1570
+ });
1571
+ html += '</select>';
1572
+
1573
+ html += '</td>';
1574
+ html += '<td>';
1575
+ html += '<select class="saswp-custom-fields-select2" name="saswp_custom_fields['+name+']">';
1576
+ html += '</select>';
1577
+ html += '</td>';
1578
+ html += '</tr>';
1579
+ $(".saswp-custom-fields-table").append(html);
1580
+ saswpCustomSelect2();
1581
+ }
1582
+ },
1583
+ error: function(response){
1584
+ console.log(response);
1585
+ }
1586
+ });
1587
+ }
1588
+ });
1589
+ saswpCustomSelect2();
1590
+ function saswpCustomSelect2(){
1591
+ if((saswp_localize_data.post_type == 'saswp' || saswp_localize_data.page_now =='saswp') && saswp_localize_data.page_now !='saswp_page_structured_data_options'){
1592
+
1593
+ $('.saswp-custom-fields-select2').select2({
1594
+ ajax: {
1595
+ type: "POST",
1596
+ url: ajaxurl, // AJAX URL is predefined in WordPress admin
1597
+ dataType: 'json',
1598
+ delay: 250, // delay in ms while typing when to perform a AJAX search
1599
+ data: function (params) {
1600
+ return {
1601
+ saswp_security_nonce: saswp_localize_data.saswp_security_nonce,
1602
+ q: params.term, // search query
1603
+ action: 'saswp_get_custom_meta_fields' // AJAX action for admin-ajax.php
1604
+ };
1605
+ },
1606
+ processResults: function( data ) {
1607
+ return {
1608
+ results: data
1609
+ };
1610
+ },
1611
+ cache: true
1612
+ },
1613
+ minimumInputLength: 2 // the minimum of symbols to input before perform a search
1614
+ });
1615
+
1616
+ }
1617
+
1618
+ }
1619
+
1620
+ function saswp_enable_rating_review(){
1621
+ var schema_type ="";
1622
+ if($('select#schema_type option:selected').val()){
1623
+ schema_type = $('select#schema_type option:selected').val();
1624
+ }
1625
+ if($(".saswp-tab-links.selected").attr('saswp-schema-type')){
1626
+ schema_type = $(".saswp-tab-links.selected").attr('saswp-schema-type');
1627
+ }
1628
+
1629
+ if(schema_type){
1630
+ $(".saswp-enable-rating-review-"+schema_type.toLowerCase()).change(function(){
1631
+
1632
+ if($(this).is(':checked')){
1633
+ $(this).parent().parent().siblings('.saswp-rating-review-'+schema_type.toLowerCase()).show();
1634
+ }else{
1635
+ $(this).parent().parent().siblings('.saswp-rating-review-'+schema_type.toLowerCase()).hide();
1636
+ }
1637
+
1638
+ }).change();
1639
+ }
1640
+
1641
+ }
1642
+ saswp_enable_rating_review();
1643
+
1644
+ //custom fields modify schema ends here
1645
+
1646
+
1647
+ //Google review js starts here
1648
+
1649
+ $('a[href="'+saswp_localize_data.collection_post_add_url+'"]').attr( 'href', saswp_localize_data.collection_post_add_new_url);
1650
+
1651
+
1652
+
1653
+ $(document).on("click", '.saswp_coonect_google_place', function(){
1654
+
1655
+ var place_id = $("#saswp_google_place_id").val();
1656
+ var language = $("#saswp_language_list").val();
1657
+ var google_api = $("#saswp_googel_api").val();
1658
+
1659
+ if(place_id !=''){
1660
+ $.ajax({
1661
+ type: "POST",
1662
+ url:ajaxurl,
1663
+ dataType: "json",
1664
+ data:{action:"saswp_connect_google_place",place_id:place_id, language:language, google_api:google_api, saswp_security_nonce:saswp_localize_data.saswp_security_nonce},
1665
+ success:function(response){
1666
+ console.log(response['status']);
1667
+ },
1668
+ error: function(response){
1669
+ console.log(response);
1670
+ }
1671
+ });
1672
+ }
1673
+ });
1674
+
1675
+ //google review js ends here
1676
+
1677
+ //Adding settings button beside add schema type button on schema type list page
1678
+
1679
+ if ('saswp' == saswp_localize_data.post_type && saswp_localize_data.page_now == 'edit.php') {
1680
+
1681
+ jQuery(jQuery(".wrap a")[0]).after("<a href='"+saswp_localize_data.saswp_settings_url+"' id='' class='page-title-action'>Settings</a>");
1682
+
1683
+ }
1684
+
1685
+ $('#saswp-tools-tabs a:first').addClass('saswp-global-selected');
1686
+ $('.saswp-tools-container').hide();
1687
+ $('.saswp-tools-container:first').show();
1688
+
1689
+ $('#saswp-tools-tabs a').click(function(){
1690
+ var t = $(this).attr('data-id');
1691
+
1692
+ if(!$(this).hasClass('saswp-global-selected')){
1693
+ $('#saswp-tools-tabs a').removeClass('saswp-global-selected');
1694
+ $(this).addClass('saswp-global-selected');
1695
+
1696
+ $('.saswp-tools-container').hide();
1697
+ $('#'+t).show();
1698
+ }
1699
+ });
1700
+
1701
+ });
admin_section/newsletter.php CHANGED
@@ -1,134 +1,56 @@
1
- <?php class saswp_newsletter {
2
- const DISPLAY_VERSION = 'v1.0';
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  function __construct () {
4
- add_action('admin_enqueue_scripts', array($this, 'saswp_admin_enqueue_scripts'));
5
- }
6
- function saswp_admin_enqueue_scripts () {
7
- $dismissed = explode (',', get_user_meta (wp_get_current_user ()->ID, 'dismissed_wp_pointers', true));
8
- $do_tour = !in_array ('saswp_subscribe_pointer', $dismissed);
9
- if ($do_tour) {
10
- wp_enqueue_style ('wp-pointer');
11
- wp_enqueue_script ('wp-pointer');
12
- add_action('admin_print_footer_scripts', array($this, 'saswp_admin_print_footer_scripts'));
13
- add_action('admin_head', array($this, 'saswp_admin_head')); // Hook to admin head
14
- }
15
  }
16
- function saswp_admin_head () {
 
17
 
18
- ?>
19
- <style type="text/css" media="screen"> #pointer-primary { margin: 0 5px 0 0; } </style>
20
- <?php
 
 
 
 
 
 
 
 
 
 
21
 
22
- }
23
- function saswp_admin_print_footer_scripts () {
24
-
25
- global $pagenow;
26
- global $current_user;
27
- $tour = array ();
28
- $tab = isset($_GET['tab']) ? $_GET['tab'] : '';
29
- $function = '';
30
- $button2 = '';
31
- $options = array ();
32
- $show_pointer = false;
33
-
34
- if (!array_key_exists($tab, $tour)) {
35
- $show_pointer = true;
36
- $displayID = '#menu-posts-saswp'; // Define ID used on page html element where we want to display pointer
37
- $content = '<h3>' . sprintf (esc_html__('Thanks for using Structured Data!', 'schema-and-structured-data-for-wp'), self::DISPLAY_VERSION) . '</h3>';
38
- $content .= '<p>'.esc_html__('Do you want the latest on','schema-and-structured-data-for-wp').' <b>'.esc_html__('Structured Data update','schema-and-structured-data-for-wp').'</b> '.esc_html__('before others and some best resources on monetization in a single email? - Free just for users of Structured Data!', 'schema-and-structured-data-for-wp').'</p>';
39
- $content .= '
40
- <style type="text/css">
41
- .wp-pointer-buttons{ padding:0; overflow: hidden; }
42
- .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} #afw_mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }
43
- </style>
44
- <div id="afw_mc_embed_signup">
45
- <form class="ml-block-form" action="https://app.mailerlite.com/webforms/submit/z7t4b8" data-code="z7t4b8" method="post" target="_blank">
46
- <div id="afw_mc_embed_signup_scroll">
47
- <div class="afw-mc-field-group" style=" margin-left: 15px; width: 195px; float: left;">
48
- <input type="text" name="fields[name]" class="form-control" placeholder="Name" hidden value="' . esc_attr( $current_user->display_name ) . '" style="display:none">
49
-
50
- <input type="text" value="' . esc_attr( $current_user->user_email ) . '" name="fields[email]" class="form-control" placeholder="Email*" style=" width: 180px; padding: 6px 5px;">
51
-
52
- <input type="text" name="fields[company]" class="form-control" placeholder="Website" hidden style=" display:none; width: 168px; padding: 6px 5px;" value="' . esc_attr( get_home_url() ) . '">
53
-
54
- <input type="hidden" name="ml-submit" value="1" />
55
- </div>
56
- <div id="mce-responses">
57
- <div class="response" id="mce-error-response" style="display:none"></div>
58
- <div class="response" id="mce-success-response" style="display:none"></div>
59
- </div>
60
- <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
61
- <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a631df13442f19caede5a5baf_c9a71edce6" tabindex="-1" value=""></div>
62
- <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;">
63
- </div>
64
- </form>
65
- </div>';
66
- $options = array (
67
- 'content' => $content,
68
- 'position' => array ('edge' => 'left', 'align' => 'left')
69
- );
70
  }
71
- if ($show_pointer) {
72
- $this->saswp_pointer_script ($displayID, $options, esc_html__('No Thanks', 'schema-and-structured-data-for-wp'), $button2, $function);
73
- }
74
- }
75
- function saswp_get_admin_url($page, $tab) {
76
- $url = admin_url();
77
- $url .= $page.'?tab='.$tab;
78
- return $url;
79
- }
80
- function saswp_pointer_script ($displayID, $options, $button1, $button2=false, $function='') {
81
- ?>
82
- <script type="text/javascript">
83
- (function ($) {
84
- var wp_pointers_tour_opts = <?php echo json_encode ($options); ?>, setup;
85
- wp_pointers_tour_opts = $.extend (wp_pointers_tour_opts, {
86
- buttons: function (event, t) {
87
- button= jQuery ('<a id="pointer-close" class="button-secondary">' + '<?php echo esc_attr($button1); ?>' + '</a>');
88
- button_2= jQuery ('#pointer-close.button');
89
- button.bind ('click.pointer', function () {
90
- t.element.pointer ('close');
91
- });
92
- button_2.on('click', function() {
93
- t.element.pointer ('close');
94
- } );
95
- return button;
96
- },
97
- close: function () {
98
- $.post (ajaxurl, {
99
- pointer: 'saswp_subscribe_pointer',
100
- action: 'dismiss-wp-pointer'
101
- });
102
- },
103
- show: function(event, t){
104
- t.pointer.css({'left':'170px', 'top':'197px', 'position':'fixed'});
105
- }
106
- });
107
- setup = function () {
108
- $('<?php echo esc_attr($displayID); ?>').pointer(wp_pointers_tour_opts).pointer('open');
109
- <?php if ($button2) { ?>
110
- jQuery ('#pointer-close').after ('<a id="pointer-primary" class="button-primary">' + '<?php echo esc_attr($button2); ?>' + '</a>');
111
- jQuery ('#pointer-primary').click (function () {
112
- <?php echo $function; ?>
113
- });
114
- jQuery ('#pointer-close').click (function () {
115
- $.post (ajaxurl, {
116
- pointer: 'saswp_subscribe_pointer',
117
- action: 'dismiss-wp-pointer'
118
- });
119
- })
120
- <?php } ?>
121
- };
122
- if (wp_pointers_tour_opts.position && wp_pointers_tour_opts.position.defer_loading) {
123
- $(window).bind('load.wp-pointers', setup);
124
- }
125
- else {
126
- setup ();
127
- }
128
- }) (jQuery);
129
- </script>
130
- <?php
131
- }
132
  }
133
- $saswp_newsletter = new saswp_newsletter();
134
  ?>
1
+ <?php
2
+ /**
3
+ * Newsletter class
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path admin_section/newsletter
8
+ * @Version 1.0
9
+ */
10
+
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ class saswp_ads_newsletter {
15
+
16
  function __construct () {
17
+
18
+ add_filter( 'saswp_localize_filter',array($this,'saswp_add_localize_footer_data'),10,2);
 
 
 
 
 
 
 
 
 
19
  }
20
+
21
+ function saswp_add_localize_footer_data($object, $object_name){
22
 
23
+ $dismissed = explode (',', get_user_meta (wp_get_current_user ()->ID, 'dismissed_wp_pointers', true));
24
+ $do_tour = !in_array ('saswp_subscribe_pointer222', $dismissed);
25
+
26
+ if ($do_tour) {
27
+ wp_enqueue_style ('wp-pointer');
28
+ wp_enqueue_script ('wp-pointer');
29
+ }
30
+
31
+ if($object_name == 'saswp_localize_data'){
32
+
33
+ global $current_user;
34
+ $tour = array ();
35
+ $tab = isset($_GET['tab']) ? esc_attr($_GET['tab']) : '';
36
 
37
+ if (!array_key_exists($tab, $tour)) {
38
+
39
+ $object['do_tour'] = $do_tour;
40
+ $object['get_home_url'] = get_home_url();
41
+ $object['current_user_email'] = $current_user->user_email;
42
+ $object['current_user_name'] = $current_user->display_name;
43
+ $object['displayID'] = '#menu-posts-saswp';
44
+ $object['button1'] = esc_html__('No Thanks', 'ads-for-wp');
45
+ $object['button2'] = false;
46
+ $object['function_name'] = '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
+
49
+ }
50
+ return $object;
51
+
52
+ }
53
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
+ $saswp_ads_newsletter = new saswp_ads_newsletter();
56
  ?>
admin_section/plugin-installer/install.php CHANGED
@@ -91,13 +91,11 @@
91
  $step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : $saswp_installer_config['start_steps'];
92
  $title = $saswp_installer_config['steps'][$step]['title'];
93
  $saswp_installer_config['current_step']['step_id'] = $step;
94
-
95
- // Use minified libraries if dev mode is turned on.
96
- $suffix = '';
97
  // Enqueue styles.
98
- wp_enqueue_style( 'saswp_install', SASWP_PLUGIN_URL. '/admin_section/css/saswp-install.min' . $suffix . '.css' , array( 'wp-admin' ), SASWP_VERSION );
99
  // Enqueue javascript.
100
- wp_enqueue_script( 'saswp_install', SASWP_PLUGIN_URL. '/admin_section/js/saswp-install.min' . $suffix . '.js' , array( 'jquery-core' ), SASWP_VERSION );
101
 
102
  wp_localize_script( 'saswp_install', 'saswp_install_params', array(
103
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
@@ -162,7 +160,7 @@
162
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
163
  </svg>
164
 
165
- <h1><?php echo esc_attr($stepDetails['title']); ?></h1>
166
 
167
  <p><?php echo esc_html__( 'This Installation Wizard helps you to setup the necessary options for schema & structured data. It is optional & should take only a few minutes.', 'schema-and-structured-data-for-wp' ); ?></p>
168
 
@@ -190,10 +188,10 @@
190
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
191
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
192
  </svg>
193
-
194
- <h1><?php echo esc_attr($stepDetails['title']); ?></h1>
195
 
196
- <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
197
 
198
  </div>
199
  <form action="" method="post">
@@ -235,8 +233,8 @@
235
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
236
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
237
  </svg>
238
-
239
- <h1><?php echo esc_attr($stepDetails['title']); ?></h1>
240
 
241
  <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
242
 
@@ -280,10 +278,10 @@
280
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
281
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
282
  </svg>
283
-
284
- <h1><?php echo esc_attr($stepDetails['title']); ?></h1>
285
 
286
- <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
287
  </div>
288
  <form action="" method="post">
289
 
@@ -295,7 +293,6 @@
295
  </li>
296
  </ul>
297
 
298
-
299
  <footer class="merlin__content__footer">
300
  <?php saswp_skip_button(); ?>
301
 
@@ -324,13 +321,11 @@
324
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
325
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
326
  </svg>
327
-
328
- <h1><?php echo esc_attr($stepDetails['title']); ?></h1>
329
 
330
- <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
331
-
332
-
333
-
334
  </div>
335
  <form action="" method="post">
336
 
@@ -356,17 +351,11 @@
356
  <?php
357
  }
358
 
359
-
360
-
361
-
362
-
363
-
364
-
365
-
366
  function saswp_save_steps_data(){
367
- if(! current_user_can( 'manage_options' ) ) {
368
- return ;
369
- }
 
370
  if ( ! isset( $_POST['wpnonce'] ) ){
371
  return;
372
  }
@@ -375,9 +364,9 @@
375
  }
376
  if(isset($_POST['sd_data'])){
377
 
378
- $pre_sd_data = get_option('sd_data');
379
- $pre_sd_data['sd_initial_wizard_status'] =1;
380
- $sd_data = $_POST['sd_data'];
381
 
382
  if($pre_sd_data){
383
 
@@ -394,8 +383,8 @@
394
 
395
  foreach ($checkbox as $key => $value) {
396
 
397
- $postType = $_POST['sd_data_create__post_schema'][$key]['posttype'];
398
- $schemaType = $_POST['sd_data_create__post_schema'][$key]['schema_type'];
399
 
400
  $postarr = array(
401
  'post_type' => 'saswp',
@@ -420,7 +409,7 @@
420
  )
421
 
422
  );
423
-
424
  $schema_options_array = array('isAccessibleForFree'=>False,'notAccessibleForFree'=>0,'paywall_class_name'=>'');
425
  update_post_meta( $insertedPageId, 'data_group_array', $data_group_array);
426
  update_post_meta( $insertedPageId, 'schema_type', $schemaType);
@@ -432,8 +421,6 @@
432
  }
433
  /**/
434
 
435
-
436
-
437
  }
438
  wp_send_json(
439
  array(
@@ -772,9 +759,9 @@ function saswp_select_schema_fields_callback(){
772
  foreach ($post_types as $key => $value) {
773
 
774
  $returnHtml .= '<li class="merlin__drawer--import-content__list-item status post-type-fields">
775
- <input type="checkbox" name="sd_data_create__post_schema_checkbox['.$key.']" id="sd_data_create__post_schema_'.$key.'" class="checkbox" value="1" >
776
- <label for="sd_data_create__post_schema_'.$key.'"><i></i><span>'.ucfirst($value).'</span></label>
777
- <input type="hidden" name="sd_data_create__post_schema['.$key.'][posttype]" class="checkbox" value="'.$key.'" >
778
 
779
  <select id="schema_type" name="sd_data_create__post_schema['.$key.'][schema_type]">
780
  <option value="">'.esc_html__('Select Schema Type', 'schema-and-structured-data-for-wp').'</option>
91
  $step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : $saswp_installer_config['start_steps'];
92
  $title = $saswp_installer_config['steps'][$step]['title'];
93
  $saswp_installer_config['current_step']['step_id'] = $step;
94
+
 
 
95
  // Enqueue styles.
96
+ wp_enqueue_style( 'saswp_install', SASWP_PLUGIN_URL. '/admin_section/css/saswp-install.min.css' , array( 'wp-admin' ), SASWP_VERSION );
97
  // Enqueue javascript.
98
+ wp_enqueue_script( 'saswp_install', SASWP_PLUGIN_URL. '/admin_section/js/saswp-install.min.js' , array( 'jquery-core' ), SASWP_VERSION );
99
 
100
  wp_localize_script( 'saswp_install', 'saswp_install_params', array(
101
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
160
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
161
  </svg>
162
 
163
+ <h1><?php echo $stepDetails['title']; ?></h1>
164
 
165
  <p><?php echo esc_html__( 'This Installation Wizard helps you to setup the necessary options for schema & structured data. It is optional & should take only a few minutes.', 'schema-and-structured-data-for-wp' ); ?></p>
166
 
188
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
189
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
190
  </svg>
191
+ <!--Escaping has been done above while adding to array ref array $saswp_installer_config-->
192
+ <h1><?php echo $stepDetails['title']; ?></h1>
193
 
194
+ <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
195
 
196
  </div>
197
  <form action="" method="post">
233
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
234
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
235
  </svg>
236
+ <!--Escaping has been done above while adding to array ref array $saswp_installer_config-->
237
+ <h1><?php echo $stepDetails['title']; ?></h1>
238
 
239
  <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
240
 
278
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
279
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
280
  </svg>
281
+ <!--Escaping has been done above while adding to array ref array $saswp_installer_config-->
282
+ <h1><?php echo $stepDetails['title']; ?></h1>
283
 
284
+ <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
285
  </div>
286
  <form action="" method="post">
287
 
293
  </li>
294
  </ul>
295
 
 
296
  <footer class="merlin__content__footer">
297
  <?php saswp_skip_button(); ?>
298
 
321
  <svg class="icon icon--checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52">
322
  <circle class="icon--checkmark__circle" cx="26" cy="26" r="25" fill="none"/><path class="icon--checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/>
323
  </svg>
324
+ <!--Escaping has been done above while adding to array ref array $saswp_installer_config-->
325
+ <h1><?php echo $stepDetails['title']; ?></h1>
326
 
327
+ <p><?php echo isset($stepDetails['description'])? $stepDetails['description'] : ''; ?></p>
328
+
 
 
329
  </div>
330
  <form action="" method="post">
331
 
351
  <?php
352
  }
353
 
 
 
 
 
 
 
 
354
  function saswp_save_steps_data(){
355
+
356
+ if(! current_user_can( 'manage_options' ) ) {
357
+ return ;
358
+ }
359
  if ( ! isset( $_POST['wpnonce'] ) ){
360
  return;
361
  }
364
  }
365
  if(isset($_POST['sd_data'])){
366
 
367
+ $pre_sd_data = get_option('sd_data');
368
+ $pre_sd_data['sd_initial_wizard_status'] = 1;
369
+ $sd_data = array_map('sanitize_text_field', $_POST['sd_data']);
370
 
371
  if($pre_sd_data){
372
 
383
 
384
  foreach ($checkbox as $key => $value) {
385
 
386
+ $postType = sanitize_text_field($_POST['sd_data_create__post_schema'][$key]['posttype']);
387
+ $schemaType = sanitize_text_field($_POST['sd_data_create__post_schema'][$key]['schema_type']);
388
 
389
  $postarr = array(
390
  'post_type' => 'saswp',
409
  )
410
 
411
  );
412
+ $data_group_array = saswp_sanitize_multi_array($data_group_array, 'data_array');
413
  $schema_options_array = array('isAccessibleForFree'=>False,'notAccessibleForFree'=>0,'paywall_class_name'=>'');
414
  update_post_meta( $insertedPageId, 'data_group_array', $data_group_array);
415
  update_post_meta( $insertedPageId, 'schema_type', $schemaType);
421
  }
422
  /**/
423
 
 
 
424
  }
425
  wp_send_json(
426
  array(
759
  foreach ($post_types as $key => $value) {
760
 
761
  $returnHtml .= '<li class="merlin__drawer--import-content__list-item status post-type-fields">
762
+ <input type="checkbox" name="sd_data_create__post_schema_checkbox['.esc_attr($key).']" id="sd_data_create__post_schema_'.esc_attr($key).'" class="checkbox" value="1" >
763
+ <label for="sd_data_create__post_schema_'.esc_attr($key).'"><i></i><span>'.esc_html(ucfirst($value)).'</span></label>
764
+ <input type="hidden" name="sd_data_create__post_schema['.esc_attr($key).'][posttype]" class="checkbox" value="'.esc_attr($key).'" >
765
 
766
  <select id="schema_type" name="sd_data_create__post_schema['.$key.'][schema_type]">
767
  <option value="">'.esc_html__('Select Schema Type', 'schema-and-structured-data-for-wp').'</option>
admin_section/settings.php CHANGED
@@ -1,4 +1,15 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Admin Settings
4
  * Function saswp_add_menu_links
@@ -111,6 +122,12 @@ function saswp_admin_interface_render(){
111
  echo "</div>";
112
 
113
  echo "<div class='saswp-tools' ".( $tab != 'tools' ? 'style="display:none;"' : '').">";
 
 
 
 
 
 
114
  // Status
115
 
116
  do_settings_sections( 'saswp_tools_section' ); // Page slug
@@ -170,17 +187,17 @@ function saswp_admin_interface_render(){
170
  </div>
171
  <div class="saswp-view-docs">
172
 
173
- <p style="float: left;">Need Help?</p> <a style="float: right;" class="button button-default" target="_blank" href="http://structured-data-for-wp.com/docs/">View Documentation</a>
174
 
175
  </div>
176
  <div class="saswp-upgrade-pro">
177
- <h2>Upgrade to Pro!</h2>
178
  <ul>
179
- <li>Premium features</li>
180
- <li>Dedicated Schema Support</li>
181
- <li>Active Development</li>
182
  </ul>
183
- <a target="_blank" href="http://structured-data-for-wp.com/pricing/">UPGRADE</a>
184
  </div>
185
  </div>
186
  </div>
@@ -304,15 +321,23 @@ function saswp_custom_upload_mimes($mimes = array()) {
304
  add_action('upload_mimes', 'saswp_custom_upload_mimes');
305
 
306
  function saswp_handle_file_upload($option){
 
 
 
 
307
 
308
- if(!empty($_FILES["saswp_import_backup"]["tmp_name"])){
309
-
310
- $urls = wp_handle_upload($_FILES["saswp_import_backup"], array('test_form' => FALSE));
311
- $url = $urls["url"];
312
- update_option('saswp-file-upload_url',esc_url($url));
313
 
314
- }
 
 
315
 
 
 
 
 
 
 
316
  return $option;
317
 
318
  }
@@ -327,8 +352,8 @@ function saswp_premium_features_callback(){ ?>
327
  <img src="<?php echo SASWP_PLUGIN_URL; ?>/admin_section/images/woocommerce-icon.png">
328
  </div>
329
  <div class="saswp-ele-tlt">
330
- <h3>WooCommerce Compatibility for Schema</h3>
331
- <p>WooCommerce Compatibility extension is the number one solution to enhance your store with the right structured data.</p>
332
  </div>
333
  </div>
334
  <div class="saswp-sts-btn">
@@ -339,11 +364,10 @@ function saswp_premium_features_callback(){ ?>
339
  echo '<label class="saswp-sts-txt">Status :<span>Active</span></label>';
340
  }else{
341
  echo '<label class="saswp-sts-txt">Status :<span>Inactive</span></label>';
 
342
  }
343
 
344
- ?>
345
-
346
- <span class="saswp-d-btn">Download</span>
347
  </div>
348
  </a></li>
349
  <li><a target="_blank" href="http://structured-data-for-wp.com/extensions/cooked-compatibility-for-schema/">
@@ -352,8 +376,8 @@ function saswp_premium_features_callback(){ ?>
352
  <img src="<?php echo SASWP_PLUGIN_URL; ?>/admin_section/images/cooked-schema-wp.png">
353
  </div>
354
  <div class="saswp-ele-tlt">
355
- <h3>Cooked Compatibility for Schema</h3>
356
- <p>This extension will be able to take all the proper recipe data and integrate it with the schema & structured data in AMP & non-AMP.</p>
357
  </div>
358
  </div>
359
  <div class="saswp-sts-btn">
@@ -364,12 +388,10 @@ function saswp_premium_features_callback(){ ?>
364
  echo '<label class="saswp-sts-txt">Status :<span>Active</span></label>';
365
  }else{
366
  echo '<label class="saswp-sts-txt">Status :<span>Inactive</span></label>';
 
367
  }
368
 
369
- ?>
370
-
371
-
372
- <span class="saswp-d-btn">Download</span>
373
  </div>
374
  </a></li>
375
  </ul>
@@ -387,13 +409,13 @@ function saswp_services_callback(){ ?>
387
  <img src="<?php echo SASWP_PLUGIN_URL; ?>/admin_section/images/news.png">
388
  </div>
389
  <div class="saswp-ele-tlt">
390
- <h3>Google News Schema Setup</h3>
391
- <p>Get quick approval to Google News with our service. Our structured data experts will set up the Google News schema properly on your website.</p>
392
  </div>
393
  </div>
394
  <div class="saswp-sts-btn">
395
- <label class="saswp-sts-txt">Staus:<span>Inactive</span></label>
396
- <span class="saswp-d-btn">Download</span>
397
  </div>
398
  </a></li>
399
  <li><a target="_blank" href="http://structured-data-for-wp.com/services/structured-data-setup-error-clean-up/">
@@ -402,13 +424,13 @@ function saswp_services_callback(){ ?>
402
  <img src="<?php echo SASWP_PLUGIN_URL; ?>/admin_section/images/schema-setup-icon.png">
403
  </div>
404
  <div class="saswp-ele-tlt">
405
- <h3>Structured Data Setup & Error Clean Up</h3>
406
- <p>We will help you setup Schema and Structured data on your website as per your requirements and as per recommendation by our expert developers.</p>
407
  </div>
408
  </div>
409
  <div class="saswp-sts-btn">
410
- <label class="saswp-sts-txt">Staus:<span>Inactive</span></label>
411
- <span class="saswp-d-btn">Download</span>
412
  </div>
413
  </a></li>
414
  </ul>
@@ -462,7 +484,7 @@ function saswp_amp_page_callback(){
462
  echo '<div class="saswp-heading">';
463
  echo '<h2>'.esc_html__('Enable On','schema-and-structured-data-for-wp').'</h2>';
464
  echo '</div>';
465
- echo '<p>Using this option, one can hide and show schema markup on AMP and Non AMP</p>';
466
 
467
  $field_objs->saswp_field_generator($meta_fields, $settings);
468
  }
@@ -559,7 +581,6 @@ function saswp_general_page_callback(){
559
  }
560
  ?>
561
 
562
-
563
  <div class="saswp-global-container" id="saswp-general-container">
564
 
565
  <div class="saswp-settings-list">
@@ -567,7 +588,7 @@ function saswp_general_page_callback(){
567
  <div class="saswp-heading">
568
  <h2><?php echo esc_html__('General Settings','schema-and-structured-data-for-wp'); ?></h2>
569
  </div>
570
- <p>This is a global schema settings, to display about, contact, website, archive, breadcrumbs, comments and site navigation schema type. <a target="_blank" href="http://structured-data-for-wp.com/docs/article/what-is-general-settings-in-schema/">Learn More</a></p>
571
  <ul><li><div style="float:left;clear: both;"><label class="saswp-tooltip">
572
  <?php echo esc_html__('About','schema-and-structured-data-for-wp') ?>
573
  <span class="saswp-tooltiptext"><?php echo esc_html__('Set the about page of of your website','schema-and-structured-data-for-wp') ?></span>
@@ -584,7 +605,7 @@ function saswp_general_page_callback(){
584
  'echo' => 0,
585
  'show_option_none' => esc_html__( 'Select an item', 'schema-and-structured-data-for-wp' ),
586
  'option_none_value' => '',
587
- 'selected' => isset($settings['sd_about_page']) ? $settings['sd_about_page'] : '',
588
  )); ?>
589
  </label>
590
  </div>
@@ -605,7 +626,7 @@ function saswp_general_page_callback(){
605
  'echo' => 0,
606
  'show_option_none' => esc_html( 'Select an item', 'schema-and-structured-data-for-wp' ),
607
  'option_none_value' => '',
608
- 'selected' => isset($settings['sd_contact_page']) ? $settings['sd_contact_page'] : '',
609
  )); ?>
610
  </label>
611
  </div>
@@ -616,8 +637,6 @@ function saswp_general_page_callback(){
616
 
617
  <?php
618
 
619
-
620
-
621
  echo '<div class="saswp-archive-div">';
622
  $field_objs->saswp_field_generator($meta_fields_default, $settings, 'general');
623
  echo '</div>';
@@ -648,6 +667,9 @@ function saswp_general_page_callback(){
648
  'name' => 'sd_data[sd_name]',
649
  'class' => 'regular-text saswp_org_fields',
650
  'type' => 'text',
 
 
 
651
  ),
652
 
653
  array(
@@ -656,6 +678,9 @@ function saswp_general_page_callback(){
656
  'name' => 'sd_data[sd_url]',
657
  'class' => 'regular-text saswp_org_fields',
658
  'type' => 'text',
 
 
 
659
  ),
660
  array(
661
  'label' => 'Contact Type',
@@ -676,7 +701,7 @@ function saswp_general_page_callback(){
676
  'baggage tracking' => 'Baggage Tracking',
677
  'roadside assistance' => 'Roadside Assistance',
678
  'package tracking' => 'Package Tracking',
679
- )
680
  ),
681
  array(
682
  'label' => 'Contact Number',
@@ -684,6 +709,9 @@ function saswp_general_page_callback(){
684
  'name' => 'sd_data[saswp_kb_telephone]',
685
  'class' => 'regular-text saswp_org_fields',
686
  'type' => 'text',
 
 
 
687
  ),
688
  array(
689
  'label' => 'Contact URL',
@@ -691,6 +719,9 @@ function saswp_general_page_callback(){
691
  'name' => 'sd_data[saswp_kb_contact_url]',
692
  'class' => 'regular-text saswp_org_fields',
693
  'type' => 'text',
 
 
 
694
  ),
695
 
696
  array(
@@ -699,6 +730,9 @@ function saswp_general_page_callback(){
699
  'name' => 'sd_data[sd-person-name]',
700
  'class' => 'regular-text saswp_person_fields',
701
  'type' => 'text',
 
 
 
702
  ),
703
  array(
704
  'label' => 'Job Title',
@@ -706,6 +740,9 @@ function saswp_general_page_callback(){
706
  'name' => 'sd_data[sd-person-job-title]',
707
  'class' => 'regular-text saswp_person_fields',
708
  'type' => 'text',
 
 
 
709
  ),
710
  array(
711
  'label' => 'Image',
@@ -723,6 +760,9 @@ function saswp_general_page_callback(){
723
  'name' => 'sd_data[sd-person-phone-number]',
724
  'class' => 'regular-text saswp_person_fields',
725
  'type' => 'text',
 
 
 
726
  ),
727
  array(
728
  'label' => 'URL',
@@ -730,6 +770,9 @@ function saswp_general_page_callback(){
730
  'name' => 'sd_data[sd-person-url]',
731
  'class' => 'regular-text saswp_person_fields',
732
  'type' => 'text',
 
 
 
733
  ),
734
  array(
735
  'label' => 'Logo',
@@ -739,7 +782,7 @@ function saswp_general_page_callback(){
739
  'type' => 'media',
740
  'note' => 'According to google validation tool, Logo size must be 160*50 or 600*60',
741
  'attributes' => array(
742
- 'readonly' => 'readonly'
743
  )
744
  ),
745
 
@@ -748,7 +791,7 @@ function saswp_general_page_callback(){
748
  echo '<div class="saswp-heading">';
749
  echo '<h2>'.esc_html__('Knowledge Graph','schema-and-structured-data-for-wp').'</h2>';
750
  echo '</div>';
751
- echo '<p>The Knowledge Graph is a knowledge base used by Google and its services to enhance its search engine\'s results. <a target="_blank" href="http://structured-data-for-wp.com/docs/article/how-to-setup-knowledge-graph-in-schema-in-wordpress/">Learn More</a> </p>';
752
  echo '<div class="saswp-knowledge-base">';
753
  $field_objs->saswp_field_generator($meta_fields, $settings);
754
  echo '</div>';
@@ -774,7 +817,7 @@ function saswp_general_page_callback(){
774
  'class' => 'regular-text',
775
  'type' => 'text',
776
  'attributes' => array(
777
- 'placeholder' => 'https://'
778
  )
779
  ),
780
  array(
@@ -795,7 +838,7 @@ function saswp_general_page_callback(){
795
  'class' => 'regular-text',
796
  'type' => 'text',
797
  'attributes' => array(
798
- 'placeholder' => 'https://'
799
  )
800
  ),
801
  array(
@@ -816,7 +859,7 @@ function saswp_general_page_callback(){
816
  'class' => 'regular-text',
817
  'type' => 'text',
818
  'attributes' => array(
819
- 'placeholder' => 'https://'
820
  )
821
  ),
822
  array(
@@ -837,7 +880,7 @@ function saswp_general_page_callback(){
837
  'class' => 'regular-text',
838
  'type' => 'text',
839
  'attributes' => array(
840
- 'placeholder' => 'https://'
841
  )
842
  ),
843
  array(
@@ -858,7 +901,7 @@ function saswp_general_page_callback(){
858
  'class' => 'regular-text',
859
  'type' => 'text',
860
  'attributes' => array(
861
- 'placeholder' => 'https://'
862
  )
863
  ),
864
  array(
@@ -879,7 +922,7 @@ function saswp_general_page_callback(){
879
  'class' => 'regular-text',
880
  'type' => 'text',
881
  'attributes' => array(
882
- 'placeholder' => 'https://'
883
  )
884
  ),
885
  array(
@@ -900,7 +943,7 @@ function saswp_general_page_callback(){
900
  'class' => 'regular-text',
901
  'type' => 'text',
902
  'attributes' => array(
903
- 'placeholder' => 'https://'
904
  )
905
  ),
906
  array(
@@ -921,7 +964,7 @@ function saswp_general_page_callback(){
921
  'class' => 'regular-text',
922
  'type' => 'text',
923
  'attributes' => array(
924
- 'placeholder' => 'https://'
925
  )
926
  ),
927
 
@@ -929,18 +972,14 @@ function saswp_general_page_callback(){
929
  echo '<div class="saswp-social-fileds">';
930
  $field_objs->saswp_field_generator($social_meta_fields, $settings);
931
  echo '</div>';
932
-
933
-
934
  ?>
935
-
936
-
937
-
938
  </div>
939
  <div class="saswp-global-container" id="saswp-default-container">
940
 
941
  <?php
942
-
943
-
944
  $meta_fields_default = array(
945
  array(
946
  'label' => 'Default Image',
@@ -962,12 +1001,13 @@ function saswp_general_page_callback(){
962
  'name' => 'sd_data[sd_default_image_height]',
963
  'class' => 'regular-text',
964
  'type' => 'text',
 
965
  )
966
  );
967
  echo '<div class="saswp-heading">';
968
  echo '<h2>'.esc_html__('Default Data','schema-and-structured-data-for-wp').'</h2>';
969
  echo '</div>';
970
- echo '<p>If schema markup doest not have image, it adds this image to validate schema markup. <a target="_blank" href="http://structured-data-for-wp.com/docs/article/how-to-set-up-the-default-structured-data-values/">Learn More</a></p>';
971
  echo '<div class="saswp-schema-type-fields">';
972
  $field_objs->saswp_field_generator($meta_fields_default, $settings);
973
  echo '</div>';
@@ -997,10 +1037,7 @@ function saswp_check_data_imported_from($plugin_post_type_name){
997
  function saswp_import_callback(){
998
 
999
  global $sd_data;
1000
-
1001
-
1002
- echo '<h2>'.esc_html__('Advanced Settings','schema-and-structured-data-for-wp').'</h2>';
1003
-
1004
  $settings = saswp_defaultSettings();
1005
  $field_objs = new saswp_fields_generator();
1006
  $meta_fields = array(
@@ -1054,18 +1091,12 @@ function saswp_import_callback(){
1054
  ),
1055
 
1056
  );
1057
- $field_objs->saswp_field_generator($meta_fields, $settings);
1058
 
1059
- ?>
1060
-
1061
-
1062
 
1063
-
 
1064
  <?php
1065
-
1066
-
1067
-
1068
-
1069
  $message = 'This plugin\'s data already has been imported. Do you want to import again?. click on button above button.';
1070
  $schema_message = '';
1071
  $schema_pro_message = '';
@@ -1095,9 +1126,15 @@ function saswp_import_callback(){
1095
 
1096
  $wp_seo_schema_message = $message;
1097
 
1098
- }
1099
-
1100
- echo '<h2>'.esc_html__('Migration','schema-and-structured-data-for-wp').'</h2>';
 
 
 
 
 
 
1101
  ?>
1102
  <ul>
1103
  <li><div class="saswp-tools-field-title"><div class="saswp-tooltip"><span class="saswp-tooltiptext"><?php echo esc_html__('All the settings and data you can import from this plugin when you click start importing','schema-and-structured-data-for-wp') ?></span><strong><?php echo esc_html__('Schema Plugin','schema-and-structured-data-for-wp'); ?></strong></div><button data-id="schema" class="button saswp-import-plugins"><?php echo esc_html__('Import','schema-and-structured-data-for-wp'); ?></button>
@@ -1124,7 +1161,7 @@ function saswp_import_callback(){
1124
  </ul>
1125
  <?php
1126
  echo '<h2>'.esc_html__('Import / Export','schema-and-structured-data-for-wp').'</h2>';
1127
- $url = admin_url('admin-ajax.php?action=saswp_export_all_settings_and_schema');
1128
  ?>
1129
  <ul>
1130
  <li>
@@ -1148,11 +1185,8 @@ function saswp_import_callback(){
1148
  </li>
1149
 
1150
  </ul>
1151
-
1152
-
1153
  <?php
1154
-
1155
-
1156
  $add_on = array();
1157
 
1158
  if(is_plugin_active('cooked-compatibility-for-schema/cooked-compatibility-for-schema.php')){
@@ -1236,8 +1270,46 @@ function saswp_import_callback(){
1236
  echo '</ul>';
1237
 
1238
  }
1239
-
1240
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1241
 
1242
  <?php
1243
 
@@ -1282,8 +1354,7 @@ function saswp_review_page_callback(){
1282
  )
1283
 
1284
  );
1285
- $field_objs->saswp_field_generator($meta_fields, $settings);
1286
-
1287
  }
1288
 
1289
  function saswp_email_schema_callback(){
@@ -1313,8 +1384,7 @@ function saswp_email_schema_callback(){
1313
  $woocommerce['note'] = esc_html__('This feature requires','schema-and-structured-data-for-wp').' <a target="_blank" href="http://structured-data-for-wp.com/woocommerce-compatibility-for-schema/">WooCommerce Addon</a>';
1314
 
1315
  }
1316
-
1317
-
1318
  $field_objs = new saswp_fields_generator();
1319
  $meta_fields = array(
1320
  $woocommerce,
@@ -1561,7 +1631,7 @@ function saswp_compatibility_page_callback(){
1561
 
1562
  }
1563
 
1564
- if(!is_plugin_active('dw-question-answer/dw-question-answer.php')){
1565
 
1566
  $dwquestiton['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/dw-question-answer/">DW Question Answer</a>';
1567
 
@@ -1571,13 +1641,7 @@ function saswp_compatibility_page_callback(){
1571
 
1572
  $wppostratings['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/wp-postratings/">WP-PostRatings</a>';
1573
 
1574
- }
1575
-
1576
- // if(!is_plugin_active('wp-job-manager/wp-job-manager.php')){
1577
- //
1578
- // $wpjobmanager['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
1579
- //
1580
- // }
1581
 
1582
  if(!is_plugin_active('the-events-calendar/the-events-calendar.php')){
1583
 
@@ -1700,10 +1764,7 @@ function saswp_compatibility_page_callback(){
1700
  $field_objs->saswp_field_generator($meta_fields_text, $settings);
1701
 
1702
  echo '</div>';
1703
- }
1704
-
1705
-
1706
-
1707
 
1708
  }
1709
 
@@ -1771,6 +1832,7 @@ function saswp_enqueue_style_js( $hook ) {
1771
  'saswp_settings_url' => esc_url(admin_url('edit.php?post_type=saswp&page=structured_data_options'))
1772
  );
1773
 
 
1774
  // Color picker CSS
1775
  // @refer https://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/
1776
  wp_enqueue_style( 'wp-color-picker' );
1
  <?php
2
+ /**
3
+ * Settings Page
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path admin_section/settings
8
+ * @version 1.0
9
+ */
10
+
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
  /**
14
  * Admin Settings
15
  * Function saswp_add_menu_links
122
  echo "</div>";
123
 
124
  echo "<div class='saswp-tools' ".( $tab != 'tools' ? 'style="display:none;"' : '').">";
125
+
126
+ echo '<div id="saswp-tools-tabs" style="margin-top: 10px;">';
127
+
128
+ echo '<a data-id="saswp-tools-advanced-container">'.esc_html__('Advanced','schema-and-structured-data-for-wp').'</a> | <a data-id="saswp-tools-translation-container">'.esc_html__('Translation Panel','schema-and-structured-data-for-wp').'</a>';
129
+
130
+ echo'</div> ';
131
  // Status
132
 
133
  do_settings_sections( 'saswp_tools_section' ); // Page slug
187
  </div>
188
  <div class="saswp-view-docs">
189
 
190
+ <p style="float: left;"><?php echo esc_html__('Need Help?','schema-and-structured-data-for-wp') ?></p> <a style="float: right;" class="button button-default" target="_blank" href="http://structured-data-for-wp.com/docs/"><?php echo esc_html__('View Documentation','schema-and-structured-data-for-wp') ?></a>
191
 
192
  </div>
193
  <div class="saswp-upgrade-pro">
194
+ <h2><?php echo esc_html__('Upgrade to Pro!','schema-and-structured-data-for-wp') ?></h2>
195
  <ul>
196
+ <li><?php echo esc_html__('Premium features','schema-and-structured-data-for-wp') ?></li>
197
+ <li><?php echo esc_html__('Dedicated Schema Support','schema-and-structured-data-for-wp') ?></li>
198
+ <li><?php echo esc_html__('Active Development','schema-and-structured-data-for-wp') ?></li>
199
  </ul>
200
+ <a target="_blank" href="http://structured-data-for-wp.com/pricing/"><?php echo esc_html__('UPGRADE','schema-and-structured-data-for-wp') ?></a>
201
  </div>
202
  </div>
203
  </div>
321
  add_action('upload_mimes', 'saswp_custom_upload_mimes');
322
 
323
  function saswp_handle_file_upload($option){
324
+
325
+ if ( ! current_user_can( 'upload_files' ) ) {
326
+ return $option;
327
+ }
328
 
329
+ $fileInfo = wp_check_filetype(basename($_FILES['saswp_import_backup']['name']));
 
 
 
 
330
 
331
+ if (!empty($fileInfo['ext']) && $fileInfo['ext'] == 'json') {
332
+
333
+ if(!empty($_FILES["saswp_import_backup"]["tmp_name"])){
334
 
335
+ $urls = wp_handle_upload($_FILES["saswp_import_backup"], array('test_form' => FALSE));
336
+ $url = $urls["url"];
337
+ update_option('saswp-file-upload_url',esc_url($url));
338
+
339
+ }
340
+ }
341
  return $option;
342
 
343
  }
352
  <img src="<?php echo SASWP_PLUGIN_URL; ?>/admin_section/images/woocommerce-icon.png">
353
  </div>
354
  <div class="saswp-ele-tlt">
355
+ <h3><?php echo esc_html__('WooCommerce Compatibility for Schema','schema-and-structured-data-for-wp') ?></h3>
356
+ <p><?php echo esc_html__('WooCommerce Compatibility extension is the number one solution to enhance your store with the right structured data.','schema-and-structured-data-for-wp') ?></p>
357
  </div>
358
  </div>
359
  <div class="saswp-sts-btn">
364
  echo '<label class="saswp-sts-txt">Status :<span>Active</span></label>';
365
  }else{
366
  echo '<label class="saswp-sts-txt">Status :<span>Inactive</span></label>';
367
+ echo '<span class="saswp-d-btn">Download</span>';
368
  }
369
 
370
+ ?>
 
 
371
  </div>
372
  </a></li>
373
  <li><a target="_blank" href="http://structured-data-for-wp.com/extensions/cooked-compatibility-for-schema/">
376
  <img src="<?php echo SASWP_PLUGIN_URL; ?>/admin_section/images/cooked-schema-wp.png">
377
  </div>
378
  <div class="saswp-ele-tlt">
379
+ <h3><?php echo esc_html__('Cooked Compatibility for Schema','schema-and-structured-data-for-wp') ?></h3>
380
+ <p><?php echo esc_html__('This extension will be able to take all the proper recipe data and integrate it with the schema & structured data in AMP & non-AMP.','schema-and-structured-data-for-wp') ?></p>
381
  </div>
382
  </div>
383
  <div class="saswp-sts-btn">
388
  echo '<label class="saswp-sts-txt">Status :<span>Active</span></label>';
389
  }else{
390
  echo '<label class="saswp-sts-txt">Status :<span>Inactive</span></label>';
391
+ echo '<span class="saswp-d-btn">Download</span>';
392
  }
393
 
394
+ ?>
 
 
 
395
  </div>
396
  </a></li>
397
  </ul>
409
  <img src="<?php echo SASWP_PLUGIN_URL; ?>/admin_section/images/news.png">
410
  </div>
411
  <div class="saswp-ele-tlt">
412
+ <h3><?php echo esc_html__('Google News Schema Setup','schema-and-structured-data-for-wp') ?></h3>
413
+ <p><?php echo esc_html__('Get quick approval to Google News with our service. Our structured data experts will set up the Google News schema properly on your website.','schema-and-structured-data-for-wp') ?></p>
414
  </div>
415
  </div>
416
  <div class="saswp-sts-btn">
417
+ <label class="saswp-sts-txt"><?php echo esc_html__('Staus:','schema-and-structured-data-for-wp') ?><span><?php echo esc_html__('Inactive','schema-and-structured-data-for-wp') ?></span></label>
418
+ <span class="saswp-d-btn"><?php echo esc_html__('Download','schema-and-structured-data-for-wp') ?></span>
419
  </div>
420
  </a></li>
421
  <li><a target="_blank" href="http://structured-data-for-wp.com/services/structured-data-setup-error-clean-up/">
424
  <img src="<?php echo SASWP_PLUGIN_URL; ?>/admin_section/images/schema-setup-icon.png">
425
  </div>
426
  <div class="saswp-ele-tlt">
427
+ <h3><?php echo esc_html__('Structured Data Setup & Error Clean Up','schema-and-structured-data-for-wp') ?></h3>
428
+ <p><?php echo esc_html__('We will help you setup Schema and Structured data on your website as per your requirements and as per recommendation by our expert developers.','schema-and-structured-data-for-wp') ?></p>
429
  </div>
430
  </div>
431
  <div class="saswp-sts-btn">
432
+ <label class="saswp-sts-txt"><?php echo esc_html__('Staus:','schema-and-structured-data-for-wp') ?><span><?php echo esc_html__('Inactive','schema-and-structured-data-for-wp') ?></span></label>
433
+ <span class="saswp-d-btn"><?php echo esc_html__('Download','schema-and-structured-data-for-wp') ?></span>
434
  </div>
435
  </a></li>
436
  </ul>
484
  echo '<div class="saswp-heading">';
485
  echo '<h2>'.esc_html__('Enable On','schema-and-structured-data-for-wp').'</h2>';
486
  echo '</div>';
487
+ echo '<p>'.esc_html__('Using this option, one can hide and show schema markup on AMP and Non AMP','schema-and-structured-data-for-wp').'</p>';
488
 
489
  $field_objs->saswp_field_generator($meta_fields, $settings);
490
  }
581
  }
582
  ?>
583
 
 
584
  <div class="saswp-global-container" id="saswp-general-container">
585
 
586
  <div class="saswp-settings-list">
588
  <div class="saswp-heading">
589
  <h2><?php echo esc_html__('General Settings','schema-and-structured-data-for-wp'); ?></h2>
590
  </div>
591
+ <p><?php echo esc_html__('This is a global schema settings, to display about, contact, website, archive, breadcrumbs, comments and site navigation schema type.','schema-and-structured-data-for-wp') ?> <a target="_blank" href="http://structured-data-for-wp.com/docs/article/what-is-general-settings-in-schema/"><?php echo esc_html__('Learn More','schema-and-structured-data-for-wp') ?></a></p>
592
  <ul><li><div style="float:left;clear: both;"><label class="saswp-tooltip">
593
  <?php echo esc_html__('About','schema-and-structured-data-for-wp') ?>
594
  <span class="saswp-tooltiptext"><?php echo esc_html__('Set the about page of of your website','schema-and-structured-data-for-wp') ?></span>
605
  'echo' => 0,
606
  'show_option_none' => esc_html__( 'Select an item', 'schema-and-structured-data-for-wp' ),
607
  'option_none_value' => '',
608
+ 'selected' => isset($settings['sd_about_page']) ? esc_attr($settings['sd_about_page']) : '',
609
  )); ?>
610
  </label>
611
  </div>
626
  'echo' => 0,
627
  'show_option_none' => esc_html( 'Select an item', 'schema-and-structured-data-for-wp' ),
628
  'option_none_value' => '',
629
+ 'selected' => isset($settings['sd_contact_page']) ? esc_attr($settings['sd_contact_page']) : '',
630
  )); ?>
631
  </label>
632
  </div>
637
 
638
  <?php
639
 
 
 
640
  echo '<div class="saswp-archive-div">';
641
  $field_objs->saswp_field_generator($meta_fields_default, $settings, 'general');
642
  echo '</div>';
667
  'name' => 'sd_data[sd_name]',
668
  'class' => 'regular-text saswp_org_fields',
669
  'type' => 'text',
670
+ 'attributes' => array(
671
+ 'placeholder' => 'Organization Name'
672
+ )
673
  ),
674
 
675
  array(
678
  'name' => 'sd_data[sd_url]',
679
  'class' => 'regular-text saswp_org_fields',
680
  'type' => 'text',
681
+ 'attributes' => array(
682
+ 'placeholder' => 'https://www.example.com'
683
+ )
684
  ),
685
  array(
686
  'label' => 'Contact Type',
701
  'baggage tracking' => 'Baggage Tracking',
702
  'roadside assistance' => 'Roadside Assistance',
703
  'package tracking' => 'Package Tracking',
704
+ )
705
  ),
706
  array(
707
  'label' => 'Contact Number',
709
  'name' => 'sd_data[saswp_kb_telephone]',
710
  'class' => 'regular-text saswp_org_fields',
711
  'type' => 'text',
712
+ 'attributes' => array(
713
+ 'placeholder' => '+1-012-012-0124'
714
+ )
715
  ),
716
  array(
717
  'label' => 'Contact URL',
719
  'name' => 'sd_data[saswp_kb_contact_url]',
720
  'class' => 'regular-text saswp_org_fields',
721
  'type' => 'text',
722
+ 'attributes' => array(
723
+ 'placeholder' => 'https://www.example.com/contact'
724
+ )
725
  ),
726
 
727
  array(
730
  'name' => 'sd_data[sd-person-name]',
731
  'class' => 'regular-text saswp_person_fields',
732
  'type' => 'text',
733
+ 'attributes' => array(
734
+ 'placeholder' => 'Name'
735
+ )
736
  ),
737
  array(
738
  'label' => 'Job Title',
740
  'name' => 'sd_data[sd-person-job-title]',
741
  'class' => 'regular-text saswp_person_fields',
742
  'type' => 'text',
743
+ 'attributes' => array(
744
+ 'placeholder' => 'Job Title'
745
+ )
746
  ),
747
  array(
748
  'label' => 'Image',
760
  'name' => 'sd_data[sd-person-phone-number]',
761
  'class' => 'regular-text saswp_person_fields',
762
  'type' => 'text',
763
+ 'attributes' => array(
764
+ 'placeholder' => '+1-012-012-0124'
765
+ )
766
  ),
767
  array(
768
  'label' => 'URL',
770
  'name' => 'sd_data[sd-person-url]',
771
  'class' => 'regular-text saswp_person_fields',
772
  'type' => 'text',
773
+ 'attributes' => array(
774
+ 'placeholder' => 'https://www.example.com/person'
775
+ )
776
  ),
777
  array(
778
  'label' => 'Logo',
782
  'type' => 'media',
783
  'note' => 'According to google validation tool, Logo size must be 160*50 or 600*60',
784
  'attributes' => array(
785
+ 'readonly' => 'readonly'
786
  )
787
  ),
788
 
791
  echo '<div class="saswp-heading">';
792
  echo '<h2>'.esc_html__('Knowledge Graph','schema-and-structured-data-for-wp').'</h2>';
793
  echo '</div>';
794
+ echo '<p>'.esc_html__('The Knowledge Graph is a knowledge base used by Google and its services to enhance its search engine\'s results.','schema-and-structured-data-for-wp').' <a target="_blank" href="http://structured-data-for-wp.com/docs/article/how-to-setup-knowledge-graph-in-schema-in-wordpress/">'.esc_html__('Learn More','schema-and-structured-data-for-wp').'</a> </p>';
795
  echo '<div class="saswp-knowledge-base">';
796
  $field_objs->saswp_field_generator($meta_fields, $settings);
797
  echo '</div>';
817
  'class' => 'regular-text',
818
  'type' => 'text',
819
  'attributes' => array(
820
+ 'placeholder' => 'https://facebook.com'
821
  )
822
  ),
823
  array(
838
  'class' => 'regular-text',
839
  'type' => 'text',
840
  'attributes' => array(
841
+ 'placeholder' => 'https://twitter.com'
842
  )
843
  ),
844
  array(
859
  'class' => 'regular-text',
860
  'type' => 'text',
861
  'attributes' => array(
862
+ 'placeholder' => 'https://instagram.com'
863
  )
864
  ),
865
  array(
880
  'class' => 'regular-text',
881
  'type' => 'text',
882
  'attributes' => array(
883
+ 'placeholder' => 'https://youtube.com'
884
  )
885
  ),
886
  array(
901
  'class' => 'regular-text',
902
  'type' => 'text',
903
  'attributes' => array(
904
+ 'placeholder' => 'https://linkedin.com'
905
  )
906
  ),
907
  array(
922
  'class' => 'regular-text',
923
  'type' => 'text',
924
  'attributes' => array(
925
+ 'placeholder' => 'https://pinterest.com'
926
  )
927
  ),
928
  array(
943
  'class' => 'regular-text',
944
  'type' => 'text',
945
  'attributes' => array(
946
+ 'placeholder' => 'https://soundcloud.com'
947
  )
948
  ),
949
  array(
964
  'class' => 'regular-text',
965
  'type' => 'text',
966
  'attributes' => array(
967
+ 'placeholder' => 'https://tumblr.com'
968
  )
969
  ),
970
 
972
  echo '<div class="saswp-social-fileds">';
973
  $field_objs->saswp_field_generator($social_meta_fields, $settings);
974
  echo '</div>';
975
+
 
976
  ?>
977
+
 
 
978
  </div>
979
  <div class="saswp-global-container" id="saswp-default-container">
980
 
981
  <?php
982
+
 
983
  $meta_fields_default = array(
984
  array(
985
  'label' => 'Default Image',
1001
  'name' => 'sd_data[sd_default_image_height]',
1002
  'class' => 'regular-text',
1003
  'type' => 'text',
1004
+ 'note' => esc_html__('According to google validation tool, Image size must be greater than or equal to 1200*728','schema-and-structured-data-for-wp')
1005
  )
1006
  );
1007
  echo '<div class="saswp-heading">';
1008
  echo '<h2>'.esc_html__('Default Data','schema-and-structured-data-for-wp').'</h2>';
1009
  echo '</div>';
1010
+ echo '<p>'.esc_html__('If schema markup doest not have image, it adds this image to validate schema markup.','schema-and-structured-data-for-wp').' <a target="_blank" href="http://structured-data-for-wp.com/docs/article/how-to-set-up-the-default-structured-data-values/">'.esc_html__('Learn More','schema-and-structured-data-for-wp').'</a></p>';
1011
  echo '<div class="saswp-schema-type-fields">';
1012
  $field_objs->saswp_field_generator($meta_fields_default, $settings);
1013
  echo '</div>';
1037
  function saswp_import_callback(){
1038
 
1039
  global $sd_data;
1040
+
 
 
 
1041
  $settings = saswp_defaultSettings();
1042
  $field_objs = new saswp_fields_generator();
1043
  $meta_fields = array(
1091
  ),
1092
 
1093
  );
 
1094
 
 
 
 
1095
 
1096
+ ?>
1097
+
1098
  <?php
1099
+
 
 
 
1100
  $message = 'This plugin\'s data already has been imported. Do you want to import again?. click on button above button.';
1101
  $schema_message = '';
1102
  $schema_pro_message = '';
1126
 
1127
  $wp_seo_schema_message = $message;
1128
 
1129
+ }
1130
+
1131
+ ?>
1132
+ <div class="saswp-tools-container" id="saswp-tools-advanced-container">
1133
+
1134
+ <?php
1135
+ echo '<h2>'.esc_html__('Advanced Settings','schema-and-structured-data-for-wp').'</h2>';
1136
+ $field_objs->saswp_field_generator($meta_fields, $settings);
1137
+ echo '<h2>'.esc_html__('Migration','schema-and-structured-data-for-wp').'</h2>';
1138
  ?>
1139
  <ul>
1140
  <li><div class="saswp-tools-field-title"><div class="saswp-tooltip"><span class="saswp-tooltiptext"><?php echo esc_html__('All the settings and data you can import from this plugin when you click start importing','schema-and-structured-data-for-wp') ?></span><strong><?php echo esc_html__('Schema Plugin','schema-and-structured-data-for-wp'); ?></strong></div><button data-id="schema" class="button saswp-import-plugins"><?php echo esc_html__('Import','schema-and-structured-data-for-wp'); ?></button>
1161
  </ul>
1162
  <?php
1163
  echo '<h2>'.esc_html__('Import / Export','schema-and-structured-data-for-wp').'</h2>';
1164
+ $url = wp_nonce_url(admin_url('admin-ajax.php?action=saswp_export_all_settings_and_schema'), '_wpnonce');
1165
  ?>
1166
  <ul>
1167
  <li>
1185
  </li>
1186
 
1187
  </ul>
 
 
1188
  <?php
1189
+
 
1190
  $add_on = array();
1191
 
1192
  if(is_plugin_active('cooked-compatibility-for-schema/cooked-compatibility-for-schema.php')){
1270
  echo '</ul>';
1271
 
1272
  }
1273
+
1274
+ ?>
1275
+
1276
+ </div>
1277
+ <div class="saswp-tools-container" id="saswp-tools-translation-container">
1278
+ <?php
1279
+ echo '<h2>'.esc_html__('Translation Panel','schema-and-structured-data-for-wp').'</h2>';
1280
+
1281
+ global $translation_labels;
1282
+
1283
+ ?>
1284
+ <table>
1285
+
1286
+ <?php
1287
+ if(is_array($translation_labels)){
1288
+
1289
+ foreach($translation_labels as $key => $val){
1290
+ if(isset($settings[$key]) && $settings[$key] !='' ){
1291
+ $translation = $settings[$key];
1292
+ }else{
1293
+ $translation = $val;
1294
+ }
1295
+
1296
+ echo '<tr>'
1297
+ . '<td><strong>'.esc_attr($val).'</strong></td>'
1298
+ . '<td><input class="regular-text" type="text" name="sd_data['.esc_attr($key).']" value="'. esc_attr($translation).'"></td>'
1299
+ . '</tr>';
1300
+ }
1301
+
1302
+ }
1303
+
1304
+ ?>
1305
+
1306
+ </table>
1307
+ <?php
1308
+ ?>
1309
+
1310
+ </div>
1311
+
1312
+
1313
 
1314
  <?php
1315
 
1354
  )
1355
 
1356
  );
1357
+ $field_objs->saswp_field_generator($meta_fields, $settings);
 
1358
  }
1359
 
1360
  function saswp_email_schema_callback(){
1384
  $woocommerce['note'] = esc_html__('This feature requires','schema-and-structured-data-for-wp').' <a target="_blank" href="http://structured-data-for-wp.com/woocommerce-compatibility-for-schema/">WooCommerce Addon</a>';
1385
 
1386
  }
1387
+
 
1388
  $field_objs = new saswp_fields_generator();
1389
  $meta_fields = array(
1390
  $woocommerce,
1631
 
1632
  }
1633
 
1634
+ if(!is_plugin_active('dw-question-answer/dw-question-answer.php') && !is_plugin_active('dw-question-answer-pro/dw-question-answer.php')){
1635
 
1636
  $dwquestiton['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/dw-question-answer/">DW Question Answer</a>';
1637
 
1641
 
1642
  $wppostratings['note'] = esc_html__('Requires','schema-and-structured-data-for-wp').' <a target="_blank" href="https://wordpress.org/plugins/wp-postratings/">WP-PostRatings</a>';
1643
 
1644
+ }
 
 
 
 
 
 
1645
 
1646
  if(!is_plugin_active('the-events-calendar/the-events-calendar.php')){
1647
 
1764
  $field_objs->saswp_field_generator($meta_fields_text, $settings);
1765
 
1766
  echo '</div>';
1767
+ }
 
 
 
1768
 
1769
  }
1770
 
1832
  'saswp_settings_url' => esc_url(admin_url('edit.php?post_type=saswp&page=structured_data_options'))
1833
  );
1834
 
1835
+ $data = apply_filters('saswp_localize_filter',$data,'saswp_localize_data');
1836
  // Color picker CSS
1837
  // @refer https://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/
1838
  wp_enqueue_style( 'wp-color-picker' );
admin_section/structure_admin.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  function saswp_skip_wizard(){
3
 
4
  if ( ! isset( $_POST['saswp_security_nonce'] ) ){
@@ -88,12 +100,17 @@ add_action( 'untrash_saswp', 'saswp_update_ids_on_untrash' );
88
 
89
  function saswp_reset_all_settings(){
90
 
 
 
 
 
91
  if ( ! isset( $_POST['saswp_security_nonce'] ) ){
92
  return;
93
  }
94
  if ( !wp_verify_nonce( $_POST['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
95
  return;
96
- }
 
97
  $result = '';
98
 
99
  update_option( 'sd_data', array());
@@ -830,7 +847,7 @@ add_action( 'wp_print_scripts', 'saswp_dequeue_script', 100 );
830
 
831
  if(isset($_POST['data_group_array'])){
832
 
833
- $post_data_group_array = $_POST['data_group_array'];
834
 
835
  foreach($post_data_group_array as $groups){
836
 
@@ -854,6 +871,8 @@ add_action( 'wp_print_scripts', 'saswp_dequeue_script', 100 );
854
  }
855
  if(isset($_POST['data_group_array'])){
856
 
 
 
857
  update_post_meta(
858
  $post_id,
859
  'data_group_array',
@@ -1246,6 +1265,10 @@ add_action('wp_ajax_saswp_send_query_message', 'saswp_send_query_message');
1246
  */
1247
  function saswp_import_plugin_data(){
1248
 
 
 
 
 
1249
  if ( ! isset( $_GET['saswp_security_nonce'] ) ){
1250
  return;
1251
  }
@@ -1397,7 +1420,7 @@ function saswp_license_status($add_on, $license_status, $license_key){
1397
  $message = __( 'Your license is not active for this URL.' );
1398
  break;
1399
  case 'item_name_mismatch' :
1400
- $message = sprintf( __( 'This appears to be an invalid license key for %s.' ), EDD_SAMPLE_ITEM_NAME );
1401
  break;
1402
  case 'no_activations_left':
1403
  $message = __( 'Your license key has reached its activation limit.' );
@@ -1446,7 +1469,9 @@ function saswp_license_status($add_on, $license_status, $license_key){
1446
 
1447
  function saswp_license_status_check(){
1448
 
1449
-
 
 
1450
  if ( ! isset( $_POST['saswp_security_nonce'] ) ){
1451
  return;
1452
  }
1
  <?php
2
+ /**
3
+ * Structure admin page
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path admin_section/structure_admin
8
+ * @version 1.0
9
+ */
10
+
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
  function saswp_skip_wizard(){
15
 
16
  if ( ! isset( $_POST['saswp_security_nonce'] ) ){
100
 
101
  function saswp_reset_all_settings(){
102
 
103
+ if ( ! current_user_can( 'manage_options' ) ) {
104
+ return;
105
+ }
106
+
107
  if ( ! isset( $_POST['saswp_security_nonce'] ) ){
108
  return;
109
  }
110
  if ( !wp_verify_nonce( $_POST['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
111
  return;
112
+ }
113
+
114
  $result = '';
115
 
116
  update_option( 'sd_data', array());
847
 
848
  if(isset($_POST['data_group_array'])){
849
 
850
+ $post_data_group_array = (array) $_POST['data_group_array'];
851
 
852
  foreach($post_data_group_array as $groups){
853
 
871
  }
872
  if(isset($_POST['data_group_array'])){
873
 
874
+ $post_data_group_array = saswp_sanitize_multi_array($post_data_group_array, 'data_array');
875
+
876
  update_post_meta(
877
  $post_id,
878
  'data_group_array',
1265
  */
1266
  function saswp_import_plugin_data(){
1267
 
1268
+ if ( ! current_user_can( 'manage_options' ) ) {
1269
+ return;
1270
+ }
1271
+
1272
  if ( ! isset( $_GET['saswp_security_nonce'] ) ){
1273
  return;
1274
  }
1420
  $message = __( 'Your license is not active for this URL.' );
1421
  break;
1422
  case 'item_name_mismatch' :
1423
+ $message = __( 'This appears to be an invalid license key.' );
1424
  break;
1425
  case 'no_activations_left':
1426
  $message = __( 'Your license key has reached its activation limit.' );
1469
 
1470
  function saswp_license_status_check(){
1471
 
1472
+ if ( ! current_user_can( 'manage_options' ) ) {
1473
+ return;
1474
+ }
1475
  if ( ! isset( $_POST['saswp_security_nonce'] ) ){
1476
  return;
1477
  }
google_review/google_review.php CHANGED
@@ -1,4 +1,14 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
 
4
  class saswp_google_review{
@@ -6,6 +16,10 @@ class saswp_google_review{
6
  public function __construct() {
7
 
8
  }
 
 
 
 
9
  public function saswp_google_review_hooks(){
10
 
11
  add_action( 'init', array($this, 'saswp_add_google_review_menu_links'),20);
@@ -40,7 +54,10 @@ class saswp_google_review{
40
 
41
  }
42
  }
43
-
 
 
 
44
  public function saswp_add_google_review_menu_links() {
45
 
46
  $collection_post_type = array(
@@ -63,7 +80,11 @@ class saswp_google_review{
63
  register_post_type( 'saswp-google-review', $collection_post_type );
64
 
65
  }
66
-
 
 
 
 
67
  public function saswp_fetch_all_google_review_post(){
68
 
69
  $all_post = get_posts(
@@ -76,8 +97,12 @@ class saswp_google_review{
76
 
77
  return $all_post;
78
  }
79
-
80
-
 
 
 
 
81
  public function saswp_google_review_shortcode($attr){
82
 
83
  $post_id = $attr['id'];
@@ -99,7 +124,15 @@ class saswp_google_review{
99
  }
100
 
101
  }
102
-
 
 
 
 
 
 
 
 
103
  public function saswp_get_google_review_schema_markup($post_id){
104
 
105
  global $wpdb;
@@ -165,7 +198,13 @@ class saswp_google_review{
165
 
166
  return $html;
167
  }
168
-
 
 
 
 
 
 
169
  public function saswp_google_review_front_output($post_id){
170
 
171
  global $wpdb;
@@ -181,15 +220,12 @@ class saswp_google_review{
181
  if($place->id){
182
 
183
  $reviews = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "saswp_google_review WHERE google_place_id = %d ORDER BY time DESC", $place->id));
184
-
185
- }
186
-
187
- }
188
-
189
- foreach ($reviews as $review){
190
-
191
-
192
- $review_rating = $review->rating;
193
 
194
  $starating = '';
195
 
@@ -245,12 +281,17 @@ class saswp_google_review{
245
  </div>';
246
 
247
  }
 
 
 
 
 
 
248
 
249
  return $output;
250
 
251
  }
252
-
253
-
254
  }
255
 
256
  if (class_exists('saswp_google_review')) {
1
  <?php
2
+ /**
3
+ * Google Review Class
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path google_review/google_review
8
+ * @Version 1.8
9
+ */
10
+
11
+ // Exit if accessed directly.
12
  if ( ! defined( 'ABSPATH' ) ) exit;
13
 
14
  class saswp_google_review{
16
  public function __construct() {
17
 
18
  }
19
+ /**
20
+ * List of hooks used in google review class
21
+ * since @version 1.8
22
+ */
23
  public function saswp_google_review_hooks(){
24
 
25
  add_action( 'init', array($this, 'saswp_add_google_review_menu_links'),20);
54
 
55
  }
56
  }
57
+ /**
58
+ * Function to register google review post type
59
+ * @since version 1.8
60
+ */
61
  public function saswp_add_google_review_menu_links() {
62
 
63
  $collection_post_type = array(
80
  register_post_type( 'saswp-google-review', $collection_post_type );
81
 
82
  }
83
+ /**
84
+ * Function to fetch all the google place post
85
+ * @return type array
86
+ * @since version 1.8
87
+ */
88
  public function saswp_fetch_all_google_review_post(){
89
 
90
  $all_post = get_posts(
97
 
98
  return $all_post;
99
  }
100
+ /**
101
+ * Function to get google review list by using shortcode
102
+ * @param type $attr
103
+ * @return string
104
+ * @since @version 1.8
105
+ */
106
  public function saswp_google_review_shortcode($attr){
107
 
108
  $post_id = $attr['id'];
124
  }
125
 
126
  }
127
+ /**
128
+ * Function to generate google review schema markup
129
+ * @global type $wpdb
130
+ * @global type $sd_data
131
+ * @param type $post_id
132
+ * @return string
133
+ * @since Version 1.8
134
+ *
135
+ */
136
  public function saswp_get_google_review_schema_markup($post_id){
137
 
138
  global $wpdb;
198
 
199
  return $html;
200
  }
201
+ /**
202
+ * Function to show google review list at user end
203
+ * @global type $wpdb
204
+ * @param type $post_id
205
+ * @return string
206
+ * @since version 1.8
207
+ */
208
  public function saswp_google_review_front_output($post_id){
209
 
210
  global $wpdb;
220
  if($place->id){
221
 
222
  $reviews = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "saswp_google_review WHERE google_place_id = %d ORDER BY time DESC", $place->id));
223
+
224
+ if($reviews){
225
+
226
+ foreach ($reviews as $review){
227
+
228
+ $review_rating = $review->rating;
 
 
 
229
 
230
  $starating = '';
231
 
281
  </div>';
282
 
283
  }
284
+
285
+ }
286
+
287
+ }
288
+
289
+ }
290
 
291
  return $output;
292
 
293
  }
294
+
 
295
  }
296
 
297
  if (class_exists('saswp_google_review')) {
google_review/google_review_page.php CHANGED
@@ -1,8 +1,22 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
 
4
  add_action('admin_init', 'saswp_add_google_places');
5
 
 
 
 
 
6
  function saswp_add_google_places(){
7
 
8
  if(!function_exists('wp_get_current_user')) {
@@ -59,7 +73,11 @@ class saswp_google_review_page{
59
  add_action( 'wp_ajax_saswp_connect_google_place', array($this,'saswp_connect_google_place'));
60
 
61
  }
62
-
 
 
 
 
63
  public function saswp_connect_google_place(){
64
 
65
  if ( ! isset( $_POST['saswp_security_nonce'] ) ){
@@ -113,7 +131,11 @@ class saswp_google_review_page{
113
  array($this, 'saswp_admin_google_review_interface_render'));
114
 
115
  }
116
-
 
 
 
 
117
  public function saswp_admin_google_review_interface_render(){
118
 
119
  global $wpdb;
@@ -199,7 +221,8 @@ class saswp_google_review_page{
199
 
200
  if(isset($_GET['post_id'])){
201
 
202
- $post_id = $_GET['post_id'];
 
203
 
204
  $post_meta = get_post_meta($post_id, $key='', true );
205
 
@@ -245,9 +268,7 @@ class saswp_google_review_page{
245
  <div class="saswp-g-review-body">
246
 
247
  <div class="saswp-review-list">
248
-
249
-
250
-
251
  <?php
252
 
253
  if($reviews){
@@ -259,6 +280,7 @@ class saswp_google_review_page{
259
  $starating = '';
260
 
261
  $starating .= '<div class="saswp-rvw-str">';
 
262
  for($j=0; $j<5; $j++){
263
 
264
  if($review_rating >$j){
@@ -292,12 +314,12 @@ class saswp_google_review_page{
292
  echo '<div class="saswp-g-review-panel">
293
  <div class="saswp-glg-review-body">
294
  <div class="saswp-rv-img">
295
- <img src="'.esc_url($review->profile_photo_url).'" alt="'.$review->author_name.'">
296
  </div>
297
  <div class="saswp-rv-cnt">
298
  <div class="saswp-str-rtng">
299
  <div class="saswp-str">
300
- <span class="saswp-athr">'.$review->author_name.'</span>
301
  '.$starating.'
302
  </div>
303
  <span class="saswp-g-plus">
1
  <?php
2
+ /**
3
+ * Google Review Page
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path google_review/google_review_page
8
+ * @Version 1.8
9
+ */
10
+
11
+ // Exit if accessed directly.
12
  if ( ! defined( 'ABSPATH' ) ) exit;
13
 
14
  add_action('admin_init', 'saswp_add_google_places');
15
 
16
+ /**
17
+ * Function to save google place review by place id
18
+ * Since @version 1.8
19
+ */
20
  function saswp_add_google_places(){
21
 
22
  if(!function_exists('wp_get_current_user')) {
73
  add_action( 'wp_ajax_saswp_connect_google_place', array($this,'saswp_connect_google_place'));
74
 
75
  }
76
+ /**
77
+ * Ajax Function to connect google place api with place id
78
+ * @return type json
79
+ * Since @version 1.8
80
+ */
81
  public function saswp_connect_google_place(){
82
 
83
  if ( ! isset( $_POST['saswp_security_nonce'] ) ){
131
  array($this, 'saswp_admin_google_review_interface_render'));
132
 
133
  }
134
+ /**
135
+ * Function to create google review page in admin area
136
+ * @global type $wpdb
137
+ * Since @version 1.8
138
+ */
139
  public function saswp_admin_google_review_interface_render(){
140
 
141
  global $wpdb;
221
 
222
  if(isset($_GET['post_id'])){
223
 
224
+ $post_id = intval($_GET['post_id']);
225
+
226
 
227
  $post_meta = get_post_meta($post_id, $key='', true );
228
 
268
  <div class="saswp-g-review-body">
269
 
270
  <div class="saswp-review-list">
271
+
 
 
272
  <?php
273
 
274
  if($reviews){
280
  $starating = '';
281
 
282
  $starating .= '<div class="saswp-rvw-str">';
283
+
284
  for($j=0; $j<5; $j++){
285
 
286
  if($review_rating >$j){
314
  echo '<div class="saswp-g-review-panel">
315
  <div class="saswp-glg-review-body">
316
  <div class="saswp-rv-img">
317
+ <img src="'.esc_url($review->profile_photo_url).'" alt="'.esc_attr($review->author_name).'">
318
  </div>
319
  <div class="saswp-rv-cnt">
320
  <div class="saswp-str-rtng">
321
  <div class="saswp-str">
322
+ <span class="saswp-athr">'.esc_attr($review->author_name).'</span>
323
  '.$starating.'
324
  </div>
325
  <span class="saswp-g-plus">
google_review/google_review_setup.php CHANGED
@@ -1,10 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
 
4
  add_action('admin_init', 'saswp_create_database_for_existing_users');
 
5
 
 
 
 
 
 
6
  function saswp_create_database_for_existing_users(){
7
-
 
 
 
8
  $status = get_option('saswp-database-on-first-load');
9
 
10
  if($status != 'enable'){
@@ -15,10 +34,11 @@ function saswp_create_database_for_existing_users(){
15
  }
16
 
17
  }
18
-
19
- add_action('the_post', 'saswp_create_database_for_existing_users');
20
-
21
-
 
22
  function saswp_google_review_database_install() {
23
 
24
  global $wpdb;
@@ -83,7 +103,13 @@ function saswp_google_review_database_install() {
83
  }
84
 
85
  }
86
-
 
 
 
 
 
 
87
  function saswp_get_google_review_data($place_id, $language=null){
88
 
89
  if($language){
@@ -107,7 +133,13 @@ function saswp_get_google_review_data($place_id, $language=null){
107
  }
108
 
109
  }
110
-
 
 
 
 
 
 
111
  function saswp_save_google_reviews($place) {
112
 
113
  global $wpdb;
@@ -183,8 +215,13 @@ function saswp_save_google_reviews($place) {
183
 
184
  return $response;
185
  }
186
-
187
-
 
 
 
 
 
188
  function saswp_business_image($result_json) {
189
 
190
  global $sd_data;
1
  <?php
2
+ /**
3
+ * Google Review Setup Page
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path google_review/google_review_setup
8
+ * @Version 1.8
9
+ */
10
+
11
+ // Exit if accessed directly.
12
  if ( ! defined( 'ABSPATH' ) ) exit;
13
 
14
  add_action('admin_init', 'saswp_create_database_for_existing_users');
15
+ add_action('the_post', 'saswp_create_database_for_existing_users');
16
 
17
+ /**
18
+ * Function to initiate database installation
19
+ * @return type null
20
+ * @Since version 1.8
21
+ */
22
  function saswp_create_database_for_existing_users(){
23
+
24
+ if ( ! current_user_can( 'manage_options' ) ) {
25
+ return;
26
+ }
27
  $status = get_option('saswp-database-on-first-load');
28
 
29
  if($status != 'enable'){
34
  }
35
 
36
  }
37
+ /**
38
+ * Function to install database tables for google review
39
+ * @global type $wpdb
40
+ * @Since version 1.8
41
+ */
42
  function saswp_google_review_database_install() {
43
 
44
  global $wpdb;
103
  }
104
 
105
  }
106
+ /**
107
+ * Function to retrive google review data from google with maps api
108
+ * @param type $place_id
109
+ * @param string $language
110
+ * @return type array
111
+ * @Since version 1.8
112
+ */
113
  function saswp_get_google_review_data($place_id, $language=null){
114
 
115
  if($language){
133
  }
134
 
135
  }
136
+ /**
137
+ * Function to save retrived google review data from google place
138
+ * @global type $wpdb
139
+ * @param type $place
140
+ * @return type string
141
+ * @Since version 1.8
142
+ */
143
  function saswp_save_google_reviews($place) {
144
 
145
  global $wpdb;
215
 
216
  return $response;
217
  }
218
+ /**
219
+ * Function to retrive image from google place
220
+ * @global type $sd_data
221
+ * @param type $result_json
222
+ * @return type string
223
+ * @Since version 1.8
224
+ */
225
  function saswp_business_image($result_json) {
226
 
227
  global $sd_data;
google_review/google_review_widget.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  /*
3
  * To change this license header, choose License Headers in Project Properties.
4
  * To change this template file, choose Tools | Templates
@@ -99,8 +111,7 @@ class Saswp_Google_Review_Widget extends WP_Widget {
99
  */
100
  public function update( $new_instance, $old_instance ) {
101
 
102
- $instance = array();
103
- //$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? sanitize_text_field( $new_instance['title'] ) : '';
104
  $instance['g_review'] = ( ! empty( $new_instance['g_review'] ) ) ? sanitize_text_field( $new_instance['g_review'] ) : '';
105
  return $instance;
106
 
1
  <?php
2
+ /**
3
+ * Google Review Widget Class
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path google_review/google_review_widget
8
+ * @Version 1.8
9
+ */
10
+
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
  /*
15
  * To change this license header, choose License Headers in Project Properties.
16
  * To change this template file, choose Tools | Templates
111
  */
112
  public function update( $new_instance, $old_instance ) {
113
 
114
+ $instance = array();
 
115
  $instance['g_review'] = ( ! empty( $new_instance['g_review'] ) ) ? sanitize_text_field( $new_instance['g_review'] ) : '';
116
  return $instance;
117
 
output/flexmls.php CHANGED
@@ -1,4 +1,13 @@
1
  <?php
 
 
 
 
 
 
 
 
 
2
  // Exit if accessed directly.
3
  if ( ! defined( 'ABSPATH' ) ) exit;
4
 
1
  <?php
2
+ /**
3
+ * Flexmls Class
4
+ *
5
+ * @author Magazine3
6
+ * @category Frontend
7
+ * @path output/flexmls
8
+ * @Version 1.0.7
9
+ */
10
+
11
  // Exit if accessed directly.
12
  if ( ! defined( 'ABSPATH' ) ) exit;
13
 
output/function.php CHANGED
@@ -1,4 +1,13 @@
1
  <?php
 
 
 
 
 
 
 
 
 
2
  // Exit if accessed directly.
3
  if ( ! defined( 'ABSPATH' ) ) exit;
4
 
@@ -8,7 +17,7 @@ add_action( 'init', 'saswp_schema_markup_hook_on_init');
8
  function saswp_schema_markup_hook_on_init() {
9
 
10
  if(!is_admin()){
11
-
12
  global $sd_data;
13
 
14
  if(isset($sd_data['saswp-markup-footer']) && $sd_data['saswp-markup-footer'] == 1){
@@ -120,7 +129,7 @@ function saswp_schema_markup_output() {
120
 
121
  $output_schema_type_id[] = $soutput['@type'];
122
 
123
- if($soutput['@type'] == 'Blogposting'|| $soutput['@type'] == 'Article' || $soutput['@type'] == 'TechArticle' || $soutput['@type'] == 'NewsArticle'){
124
 
125
 
126
  $final_output = array();
@@ -204,7 +213,7 @@ function saswp_schema_markup_output() {
204
 
205
  }
206
  }
207
- if(in_array('Blogposting', $output_schema_type_id) || in_array('Article', $output_schema_type_id) || in_array('TechArticle', $output_schema_type_id) || in_array('NewsArticle', $output_schema_type_id) ){
208
  }else{
209
  if(!empty($kb_website_output)){
210
 
@@ -259,8 +268,7 @@ function saswp_schema_markup_output() {
259
 
260
  }
261
 
262
- if($custom_markup){
263
-
264
  $result = json_decode($custom_markup);
265
 
266
  if($result != false){
@@ -837,10 +845,10 @@ function saswp_remove_microdata($content){
837
 
838
  if(saswp_global_option()){
839
 
840
- $content = preg_replace("/itemscope itemtype=(\"?)http(s?):\/\/schema.org\/(Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject)(\"?)/", "", $content);
841
- $content = preg_replace("/itemscope=(\"?)itemscope(\"?) itemtype=(\"?)http(s?):\/\/schema.org\/(Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject)(\"?)/", "", $content);
842
- $content = preg_replace("/itemscope=(\"?)itemprop(\"?) itemType=(\"?)http(s?):\/\/schema.org\/(Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject)(\"?)/", "", $content);
843
- $content = preg_replace("/itemscope itemprop=\"(.*?)\" itemType=(\"?)http(s?):\/\/schema.org\/(Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject)(\"?)/", "", $content);
844
  $content = preg_replace("/vcard/", "", $content);
845
  $content = preg_replace("/hentry/", "", $content);
846
  }
1
  <?php
2
+ /**
3
+ * Function Page
4
+ *
5
+ * @author Magazine3
6
+ * @category Frontend
7
+ * @path output/function
8
+ * @Version 1.0
9
+ */
10
+
11
  // Exit if accessed directly.
12
  if ( ! defined( 'ABSPATH' ) ) exit;
13
 
17
  function saswp_schema_markup_hook_on_init() {
18
 
19
  if(!is_admin()){
20
+
21
  global $sd_data;
22
 
23
  if(isset($sd_data['saswp-markup-footer']) && $sd_data['saswp-markup-footer'] == 1){
129
 
130
  $output_schema_type_id[] = $soutput['@type'];
131
 
132
+ if($soutput['@type'] == 'BlogPosting'|| $soutput['@type'] == 'Article' || $soutput['@type'] == 'TechArticle' || $soutput['@type'] == 'NewsArticle'){
133
 
134
 
135
  $final_output = array();
213
 
214
  }
215
  }
216
+ if(in_array('BlogPosting', $output_schema_type_id) || in_array('Article', $output_schema_type_id) || in_array('TechArticle', $output_schema_type_id) || in_array('NewsArticle', $output_schema_type_id) ){
217
  }else{
218
  if(!empty($kb_website_output)){
219
 
268
 
269
  }
270
 
271
+ if($custom_markup){
 
272
  $result = json_decode($custom_markup);
273
 
274
  if($result != false){
845
 
846
  if(saswp_global_option()){
847
 
848
+ $content = preg_replace("/itemscope itemtype=(\"?)http(s?):\/\/schema.org\/(Person|Mosque|Church|HinduTemple|LandmarksOrHistoricalBuildings|TouristDestination|TouristAttraction|Place|LocalBusiness|MedicalCondition|VideoObject|AudioObject|Trip|Service|JobPosting|VideoGame|Game|TechArticle|SoftwareApplication|TVSeries|Recipe|Review|HowTo|DiscussionForumPosting|Course|SingleFamilyResidence|House|Apartment|Event|Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject|UserComments|WPHeader|WPSideBar|WPFooter|WPAdBlock|SiteNavigationElement)(\"?)/", "", $content);
849
+ $content = preg_replace("/itemscope=(\"?)itemscope(\"?) itemtype=(\"?)http(s?):\/\/schema.org\/(Person|Mosque|Church|HinduTemple|LandmarksOrHistoricalBuildings|TouristDestination|TouristAttraction|Place|LocalBusiness|MedicalCondition|VideoObject|AudioObject|Trip|Service|JobPosting|VideoGame|Game|TechArticle|SoftwareApplication|TVSeries|Recipe|Review|HowTo|DiscussionForumPosting|Course|SingleFamilyResidence|House|Apartment|Event|Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject|UserComments|WPHeader|WPSideBar|WPFooter|WPAdBlock|SiteNavigationElement)(\"?)/", "", $content);
850
+ $content = preg_replace("/itemscope=(\"?)itemprop(\"?) itemType=(\"?)http(s?):\/\/schema.org\/(Person|Mosque|Church|HinduTemple|LandmarksOrHistoricalBuildings|TouristDestination|TouristAttraction|Place|LocalBusiness|MedicalCondition|VideoObject|AudioObject|Trip|Service|JobPosting|VideoGame|Game|TechArticle|SoftwareApplication|TVSeries|Recipe|Review|HowTo|DiscussionForumPosting|Course|SingleFamilyResidence|House|Apartment|Event|Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject|UserComments|WPHeader|WPSideBar|WPFooter|WPAdBlock|SiteNavigationElement)(\"?)/", "", $content);
851
+ $content = preg_replace("/itemscope itemprop=\"(.*?)\" itemType=(\"?)http(s?):\/\/schema.org\/(Person|Mosque|Church|HinduTemple|LandmarksOrHistoricalBuildings|TouristDestination|TouristAttraction|Place|LocalBusiness|MedicalCondition|VideoObject|AudioObject|Trip|Service|JobPosting|VideoGame|Game|TechArticle|SoftwareApplication|TVSeries|Recipe|Review|HowTo|DiscussionForumPosting|Course|SingleFamilyResidence|House|Apartment|Event|Article|BlogPosting|Blog|BreadcrumbList|AggregateRating|WebPage|Person|Organization|NewsArticle|Product|CreativeWork|ImageObject|UserComments|WPHeader|WPSideBar|WPFooter|WPAdBlock|SiteNavigationElement)(\"?)/", "", $content);
852
  $content = preg_replace("/vcard/", "", $content);
853
  $content = preg_replace("/hentry/", "", $content);
854
  }
output/output.php CHANGED
@@ -1,4 +1,12 @@
1
  <?php
 
 
 
 
 
 
 
 
2
  if (! defined('ABSPATH') ) exit;
3
  /**
4
  * Function generates knowledge graph schema
@@ -418,6 +426,7 @@ function saswp_schema_output() {
418
  'mainEntityOfPage' => get_permalink(),
419
  'headline' => saswp_get_the_title(),
420
  'description' => saswp_get_the_excerpt(),
 
421
  'name' => saswp_get_the_title(),
422
  'url' => get_permalink(),
423
  'datePublished' => esc_html($date),
@@ -848,7 +857,7 @@ function saswp_schema_output() {
848
  'dateModified' => esc_html($modified_date),
849
  'description' => saswp_get_the_excerpt(),
850
  'articleSection' => $article_section,
851
- 'articleBody' => saswp_get_the_excerpt(),
852
  'name' => saswp_get_the_title(),
853
  'thumbnailUrl' => saswp_remove_warnings($image_details, 0, 'saswp_string'),
854
  'wordCount' => saswp_remove_warnings($word_count, 'word_count', 'saswp_string'),
@@ -992,6 +1001,7 @@ function saswp_schema_output() {
992
  'keywords' => tie_get_plain_terms( get_the_ID(), 'post_tag' ),
993
  'url' => get_permalink(),
994
  'description' => saswp_get_the_excerpt(),
 
995
  'copyrightYear' => get_the_time( 'Y' ),
996
  'author' => saswp_get_author_details()
997
 
@@ -1308,7 +1318,7 @@ function saswp_schema_output() {
1308
  '@id' => get_permalink().'/#'. strtolower(esc_attr($local_business)),
1309
  'name' => saswp_remove_warnings($business_details, 'local_business_name', 'saswp_string'),
1310
  'url' => get_permalink(),
1311
- 'description' => saswp_get_the_excerpt(),
1312
  'image' => array(
1313
  '@type' => 'ImageObject',
1314
  'url' => isset($business_details['local_business_logo']) ? esc_url($business_details['local_business_logo']['url']):'',
@@ -1373,6 +1383,40 @@ function saswp_schema_output() {
1373
  $input1['hasMap'] = esc_url($business_details['local_hasmap']);
1374
  }
1375
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1376
 
1377
  if(isset($business_details['local_latitude']) && isset($business_details['local_longitude'])){
1378
 
@@ -3476,6 +3520,40 @@ function saswp_post_specific_schema_output() {
3476
  $input1['servesCuisine'] = esc_attr($all_post_meta['local_serves_cuisine_'.$schema_id][0]);
3477
  }
3478
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3479
  if(isset($all_post_meta['local_menu_'.$schema_id][0])){
3480
  $input1['hasMenu'] = esc_url($all_post_meta['local_menu_'.$schema_id][0]);
3481
  }
1
  <?php
2
+ /**
3
+ * Output Page
4
+ *
5
+ * @author Magazine3
6
+ * @category Frontend
7
+ * @path output/output
8
+ * @version 1.0
9
+ */
10
  if (! defined('ABSPATH') ) exit;
11
  /**
12
  * Function generates knowledge graph schema
426
  'mainEntityOfPage' => get_permalink(),
427
  'headline' => saswp_get_the_title(),
428
  'description' => saswp_get_the_excerpt(),
429
+ 'articleBody' => saswp_get_the_content(),
430
  'name' => saswp_get_the_title(),
431
  'url' => get_permalink(),
432
  'datePublished' => esc_html($date),
857
  'dateModified' => esc_html($modified_date),
858
  'description' => saswp_get_the_excerpt(),
859
  'articleSection' => $article_section,
860
+ 'articleBody' => saswp_get_the_content(),
861
  'name' => saswp_get_the_title(),
862
  'thumbnailUrl' => saswp_remove_warnings($image_details, 0, 'saswp_string'),
863
  'wordCount' => saswp_remove_warnings($word_count, 'word_count', 'saswp_string'),
1001
  'keywords' => tie_get_plain_terms( get_the_ID(), 'post_tag' ),
1002
  'url' => get_permalink(),
1003
  'description' => saswp_get_the_excerpt(),
1004
+ 'articleBody' => saswp_get_the_content(),
1005
  'copyrightYear' => get_the_time( 'Y' ),
1006
  'author' => saswp_get_author_details()
1007
 
1318
  '@id' => get_permalink().'/#'. strtolower(esc_attr($local_business)),
1319
  'name' => saswp_remove_warnings($business_details, 'local_business_name', 'saswp_string'),
1320
  'url' => get_permalink(),
1321
+ 'description' => saswp_remove_warnings($business_details, 'local_business_description', 'saswp_string'),
1322
  'image' => array(
1323
  '@type' => 'ImageObject',
1324
  'url' => isset($business_details['local_business_logo']) ? esc_url($business_details['local_business_logo']['url']):'',
1383
  $input1['hasMap'] = esc_url($business_details['local_hasmap']);
1384
  }
1385
 
1386
+ //social fields starts here
1387
+
1388
+ $local_social = array();
1389
+
1390
+ if(isset($business_details['local_facebook']) && $business_details['local_facebook'] !=''){
1391
+ $local_social[] = esc_url($business_details['local_facebook']);
1392
+ }
1393
+ if(isset($business_details['local_twitter']) && $business_details['local_twitter'] !=''){
1394
+ $local_social[] = esc_url($business_details['local_twitter']);
1395
+ }
1396
+ if(isset($business_details['local_instagram']) && $business_details['local_instagram'] !=''){
1397
+ $local_social[] = esc_url($business_details['local_instagram']);
1398
+ }
1399
+ if(isset($business_details['local_pinterest']) && $business_details['local_pinterest'] !=''){
1400
+ $local_social[] = esc_url($business_details['local_pinterest']);
1401
+ }
1402
+ if(isset($business_details['local_linkedin']) && $business_details['local_linkedin'] !=''){
1403
+ $local_social[] = esc_url($business_details['local_linkedin']);
1404
+ }
1405
+ if(isset($business_details['local_soundcloud']) && $business_details['local_soundcloud'] !=''){
1406
+ $local_social[] = esc_url($business_details['local_soundcloud']);
1407
+ }
1408
+ if(isset($business_details['local_tumblr']) && $business_details['local_tumblr'] !=''){
1409
+ $local_social[] = esc_url($business_details['local_tumblr']);
1410
+ }
1411
+ if(isset($business_details['local_youtube']) && $business_details['local_youtube'] !=''){
1412
+ $local_social[] = esc_url($business_details['local_youtube']);
1413
+ }
1414
+
1415
+ if(!empty($local_social)){
1416
+ $input1['sameAs'] = $local_social;
1417
+ }
1418
+ //social fields ends here
1419
+
1420
 
1421
  if(isset($business_details['local_latitude']) && isset($business_details['local_longitude'])){
1422
 
3520
  $input1['servesCuisine'] = esc_attr($all_post_meta['local_serves_cuisine_'.$schema_id][0]);
3521
  }
3522
 
3523
+ //social fields starts here
3524
+
3525
+ $local_social = array();
3526
+
3527
+ if(isset($all_post_meta['local_facebook_'.$schema_id][0]) && $all_post_meta['local_facebook_'.$schema_id][0] !=''){
3528
+ $local_social[] = esc_url($all_post_meta['local_facebook_'.$schema_id][0]);
3529
+ }
3530
+ if(isset($all_post_meta['local_twitter_'.$schema_id][0]) && $all_post_meta['local_twitter_'.$schema_id][0] !=''){
3531
+ $local_social[] = esc_url($all_post_meta['local_twitter_'.$schema_id][0]);
3532
+ }
3533
+ if(isset($all_post_meta['local_instagram_'.$schema_id][0]) && $all_post_meta['local_instagram_'.$schema_id][0] !=''){
3534
+ $local_social[] = esc_url($all_post_meta['local_instagram_'.$schema_id][0]);
3535
+ }
3536
+ if(isset($all_post_meta['local_pinterest_'.$schema_id][0]) && $all_post_meta['local_pinterest_'.$schema_id][0] !=''){
3537
+ $local_social[] = esc_url($all_post_meta['local_pinterest_'.$schema_id][0]);
3538
+ }
3539
+ if(isset($all_post_meta['local_linkedin_'.$schema_id][0]) && $all_post_meta['local_linkedin_'.$schema_id][0] !=''){
3540
+ $local_social[] = esc_url($all_post_meta['local_linkedin_'.$schema_id][0]);
3541
+ }
3542
+ if(isset($all_post_meta['local_soundcloud_'.$schema_id][0]) && $all_post_meta['local_soundcloud_'.$schema_id][0] !=''){
3543
+ $local_social[] = esc_url($all_post_meta['local_soundcloud_'.$schema_id][0]);
3544
+ }
3545
+ if(isset($all_post_meta['local_tumblr_'.$schema_id][0]) && $all_post_meta['local_tumblr_'.$schema_id][0] !=''){
3546
+ $local_social[] = esc_url($all_post_meta['local_tumblr_'.$schema_id][0]);
3547
+ }
3548
+ if(isset($all_post_meta['local_youtube_'.$schema_id][0]) && $all_post_meta['local_youtube_'.$schema_id][0] !=''){
3549
+ $local_social[] = esc_url($all_post_meta['local_youtube_'.$schema_id][0]);
3550
+ }
3551
+
3552
+ if(!empty($local_social)){
3553
+ $input1['sameAs'] = $local_social;
3554
+ }
3555
+ //social fields ends here
3556
+
3557
  if(isset($all_post_meta['local_menu_'.$schema_id][0])){
3558
  $input1['hasMenu'] = esc_url($all_post_meta['local_menu_'.$schema_id][0]);
3559
  }
output/review-output.php CHANGED
@@ -1,8 +1,19 @@
1
  <?php
 
 
 
 
 
 
 
 
2
  // Exit if accessed directly.
3
  if ( ! defined( 'ABSPATH' ) ) exit;
 
4
  Class saswp_review_output{
5
-
 
 
6
  public function saswp_review_hooks(){
7
 
8
  add_filter('the_content', array($this, 'saswp_display_review_box'));
@@ -10,7 +21,11 @@ Class saswp_review_output{
10
  add_action('amp_post_template_head', array($this, 'saswp_display_review_box_schema'));
11
 
12
  }
13
-
 
 
 
 
14
  public function saswp_review_display_via_shortcode($attr){
15
 
16
  $review_id = $attr['id'];
@@ -23,7 +38,11 @@ Class saswp_review_output{
23
  }
24
 
25
  }
26
-
 
 
 
 
27
  public function saswp_display_review_box_schema(){
28
 
29
  global $sd_data;
@@ -32,7 +51,7 @@ Class saswp_review_output{
32
 
33
  $saswp_review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
34
 
35
- if(isset($saswp_review_details['saswp-review-item-enable'])){
36
 
37
  $author_id = get_the_author_meta('ID');
38
 
@@ -116,7 +135,10 @@ Class saswp_review_output{
116
  }
117
 
118
  }
119
-
 
 
 
120
  public function saswp_get_review_box_content(){
121
 
122
  $saswp_review_details = array();
@@ -155,11 +177,11 @@ Class saswp_review_output{
155
  $boxdata .='
156
  <div class="saswp-pc-wrap">
157
  <div class="saswp-lst">
158
- <span>'.esc_html__('Pros', 'schema-and-structured-data-for-wp').'</span><br>
159
  '.wpautop( stripslashes ( $saswp_review_props ) ).'
160
  </div>
161
  <div class="saswp-lst">
162
- <span>'.esc_html__('Cons', 'schema-and-structured-data-for-wp').'</span><br>
163
  '.wpautop( stripslashes ( $saswp_review_cons ) ).'
164
  </div>
165
  </div>';
@@ -171,7 +193,7 @@ Class saswp_review_output{
171
  $boxdata.='<table class="saswp-rvw">
172
  <tbody>
173
  <div class="saswp-rvw-hd">
174
- <span>'.esc_html__('REVIEW OVERVIEW', 'schema-and-structured-data-for-wp').'</span>
175
  </div>';
176
 
177
  if(isset($saswp_review_item_feature)){
@@ -259,7 +281,7 @@ Class saswp_review_output{
259
 
260
  }
261
 
262
- $boxdata.='</div><span class="ovs">'.esc_html__('OVERALL SCORE', 'schema-and-structured-data-for-wp').'</span>';
263
  }
264
  $boxdata.=' </div>
265
  </td>
@@ -270,8 +292,13 @@ Class saswp_review_output{
270
 
271
  return $boxdata;
272
 
273
- }
274
-
 
 
 
 
 
275
  public function saswp_display_review_box($content){
276
 
277
  global $sd_data;
1
  <?php
2
+ /**
3
+ * Review Output Class
4
+ *
5
+ * @author Magazine3
6
+ * @category Frontend
7
+ * @path output/review-output
8
+ */
9
+
10
  // Exit if accessed directly.
11
  if ( ! defined( 'ABSPATH' ) ) exit;
12
+
13
  Class saswp_review_output{
14
+ /**
15
+ * All the hooks list which are used in review module
16
+ */
17
  public function saswp_review_hooks(){
18
 
19
  add_filter('the_content', array($this, 'saswp_display_review_box'));
21
  add_action('amp_post_template_head', array($this, 'saswp_display_review_box_schema'));
22
 
23
  }
24
+ /**
25
+ * Display the review box via shortcode
26
+ * @param type $attr
27
+ * @return type string
28
+ */
29
  public function saswp_review_display_via_shortcode($attr){
30
 
31
  $review_id = $attr['id'];
38
  }
39
 
40
  }
41
+ /**
42
+ * Generate and add the schema markup for review box
43
+ * @global type $sd_data
44
+ * echo string
45
+ */
46
  public function saswp_display_review_box_schema(){
47
 
48
  global $sd_data;
51
 
52
  $saswp_review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
53
 
54
+ if(isset($saswp_review_details['saswp-review-item-enable'])){
55
 
56
  $author_id = get_the_author_meta('ID');
57
 
135
  }
136
 
137
  }
138
+ /**
139
+ * Generate the review box html with its dynamic data
140
+ * @return string
141
+ */
142
  public function saswp_get_review_box_content(){
143
 
144
  $saswp_review_details = array();
177
  $boxdata .='
178
  <div class="saswp-pc-wrap">
179
  <div class="saswp-lst">
180
+ <span>'.saswp_label_text('translation-pros').'</span><br>
181
  '.wpautop( stripslashes ( $saswp_review_props ) ).'
182
  </div>
183
  <div class="saswp-lst">
184
+ <span>'.saswp_label_text('translation-cons').'</span><br>
185
  '.wpautop( stripslashes ( $saswp_review_cons ) ).'
186
  </div>
187
  </div>';
193
  $boxdata.='<table class="saswp-rvw">
194
  <tbody>
195
  <div class="saswp-rvw-hd">
196
+ <span>'.saswp_label_text('translation-review-overview').'</span>
197
  </div>';
198
 
199
  if(isset($saswp_review_item_feature)){
281
 
282
  }
283
 
284
+ $boxdata.='</div><span class="ovs">'.saswp_label_text('translation-overall-score').'</span>';
285
  }
286
  $boxdata.=' </div>
287
  </td>
292
 
293
  return $boxdata;
294
 
295
+ }
296
+ /**
297
+ * Display the review box
298
+ * @global type $sd_data
299
+ * @param type $content
300
+ * @return string
301
+ */
302
  public function saswp_display_review_box($content){
303
 
304
  global $sd_data;
output/service.php CHANGED
@@ -1,4 +1,12 @@
1
  <?php
 
 
 
 
 
 
 
 
2
  // Exit if accessed directly.
3
  if ( ! defined( 'ABSPATH' ) ) exit;
4
 
@@ -1102,7 +1110,7 @@ Class saswp_output_service{
1102
 
1103
  $post_type = get_post_type($post_id);
1104
 
1105
- if($post_type =='dwqa-question' && isset($sd_data['saswp-dw-question-answer']) && $sd_data['saswp-dw-question-answer'] ==1 && is_plugin_active('dw-question-answer/dw-question-answer.php')){
1106
 
1107
  $post_meta = get_post_meta($post_id, $key='', true);
1108
 
@@ -1609,6 +1617,7 @@ Class saswp_output_service{
1609
  'mainEntityOfPage' => get_permalink(),
1610
  'headline' => saswp_get_the_title(),
1611
  'description' => saswp_get_the_excerpt(),
 
1612
  'datePublished' => esc_html($date),
1613
  'dateModified' => esc_html($modified_date),
1614
  'author' => saswp_get_author_details(),
@@ -1636,6 +1645,7 @@ Class saswp_output_service{
1636
  'mainEntityOfPage' => get_permalink(),
1637
  'headline' => saswp_get_the_title(),
1638
  'description' => saswp_get_the_excerpt(),
 
1639
  'datePublished' => esc_html($date),
1640
  'dateModified' => esc_html($modified_date),
1641
  'author' => saswp_get_author_details(),
@@ -1673,6 +1683,7 @@ Class saswp_output_service{
1673
  'image' => esc_url($image_details[0]),
1674
  'headline' => saswp_get_the_title(),
1675
  'description' => saswp_get_the_excerpt(),
 
1676
  'datePublished' => esc_html($date),
1677
  'dateModified' => esc_html($modified_date),
1678
  'author' => saswp_get_author_details(),
@@ -1877,15 +1888,15 @@ Class saswp_output_service{
1877
  */
1878
  public function saswp_get_publisher($d_logo = null){
1879
 
1880
- global $sd_data;
1881
-
1882
  $publisher = array();
1883
  $default_logo = array();
1884
  $custom_logo = array();
1885
 
1886
- $logo = isset($sd_data['sd_logo']) ? $sd_data['sd_logo']['url']:'';
1887
- $height = isset($sd_data['sd_logo']) ? $sd_data['sd_logo']['height']:'';
1888
- $width = isset($sd_data['sd_logo']) ? $sd_data['sd_logo']['width']:'';
1889
  $site_name = isset($sd_data['sd_name']) && $sd_data['sd_name'] !='' ? $sd_data['sd_name']:get_bloginfo();
1890
 
1891
  if($logo =='' && $height =='' && $width ==''){
1
  <?php
2
+ /**
3
+ * Service Class
4
+ *
5
+ * @author Magazine3
6
+ * @category Frontend
7
+ * @path output/service
8
+ */
9
+
10
  // Exit if accessed directly.
11
  if ( ! defined( 'ABSPATH' ) ) exit;
12
 
1110
 
1111
  $post_type = get_post_type($post_id);
1112
 
1113
+ if($post_type =='dwqa-question' && isset($sd_data['saswp-dw-question-answer']) && $sd_data['saswp-dw-question-answer'] ==1 && (is_plugin_active('dw-question-answer/dw-question-answer.php') || is_plugin_active('dw-question-answer-pro/dw-question-answer.php')) ){
1114
 
1115
  $post_meta = get_post_meta($post_id, $key='', true);
1116
 
1617
  'mainEntityOfPage' => get_permalink(),
1618
  'headline' => saswp_get_the_title(),
1619
  'description' => saswp_get_the_excerpt(),
1620
+ 'articleBody' => saswp_get_the_content(),
1621
  'datePublished' => esc_html($date),
1622
  'dateModified' => esc_html($modified_date),
1623
  'author' => saswp_get_author_details(),
1645
  'mainEntityOfPage' => get_permalink(),
1646
  'headline' => saswp_get_the_title(),
1647
  'description' => saswp_get_the_excerpt(),
1648
+ 'articleBody' => saswp_get_the_content(),
1649
  'datePublished' => esc_html($date),
1650
  'dateModified' => esc_html($modified_date),
1651
  'author' => saswp_get_author_details(),
1683
  'image' => esc_url($image_details[0]),
1684
  'headline' => saswp_get_the_title(),
1685
  'description' => saswp_get_the_excerpt(),
1686
+ 'articleBody' => saswp_get_the_content(),
1687
  'datePublished' => esc_html($date),
1688
  'dateModified' => esc_html($modified_date),
1689
  'author' => saswp_get_author_details(),
1888
  */
1889
  public function saswp_get_publisher($d_logo = null){
1890
 
1891
+ global $sd_data;
1892
+
1893
  $publisher = array();
1894
  $default_logo = array();
1895
  $custom_logo = array();
1896
 
1897
+ $logo = isset($sd_data['sd_logo']['url']) ? $sd_data['sd_logo']['url']:'';
1898
+ $height = isset($sd_data['sd_logo']['height']) ? $sd_data['sd_logo']['height']:'';
1899
+ $width = isset($sd_data['sd_logo']['width']) ? $sd_data['sd_logo']['width']:'';
1900
  $site_name = isset($sd_data['sd_name']) && $sd_data['sd_name'] !='' ? $sd_data['sd_name']:get_bloginfo();
1901
 
1902
  if($logo =='' && $height =='' && $width ==''){
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.8.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -82,6 +82,12 @@ We try our best to provide support on WordPress.org forums. However, We have a s
82
 
83
  Bug reports for Schema & Structured Data for WP & AMP are [welcomed on GitHub](https://github.com/ahmedkaludi/schema-and-structured-data-for-wp/issues). Please note GitHub is not a support forum, and issues that aren't properly qualified as bugs will be closed.
84
 
 
 
 
 
 
 
85
 
86
  == Frequently Asked Questions ==
87
 
@@ -103,6 +109,18 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
103
 
104
  == Changelog ==
105
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  = 1.8.8 (22 June 2019) =
107
  * Bug Fixed: Uncaught Error: Class 'saswp_google_review' not found. #351
108
 
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.8.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
82
 
83
  Bug reports for Schema & Structured Data for WP & AMP are [welcomed on GitHub](https://github.com/ahmedkaludi/schema-and-structured-data-for-wp/issues). Please note GitHub is not a support forum, and issues that aren't properly qualified as bugs will be closed.
84
 
85
+ ### Credits
86
+
87
+ Merlin WP used https://github.com/richtabor/MerlinWP - License URI: https://github.com/richtabor/MerlinWP/blob/master/LICENSE,
88
+ jquery-timepicker used https://github.com/jonthornton/jquery-timepicker
89
+
90
+
91
 
92
  == Frequently Asked Questions ==
93
 
109
 
110
  == Changelog ==
111
 
112
+ = 1.8.9 (08 July 2019) =
113
+
114
+ * Added: Translation panel. User can add own text for List of labels which is being output in content #361
115
+ * Added: compatibility with DWQA Pro version plugin ( https://wordpress.org/plugins/dw-question-answer ) #372
116
+ * Added: Social fields in local business schema type
117
+ * Added: Error message should be shown if custom schema markup is not valid
118
+ * Bug Fixed: Defragmentation is not working for BlogPost schema type #367
119
+ * Bug Fixed: Schema title attributes show invalid title when yoast compatibility is enabled , like this (%%title%%%page%%sep) #364
120
+ * Bug Fixed: Description and Article body have same data #363
121
+ * Bug Fixed: Debug Warning & notices #362
122
+ * Bug Fixed: Micro data clean up is not working properly. #359
123
+
124
  = 1.8.8 (22 June 2019) =
125
  * Bug Fixed: Uncaught Error: Class 'saswp_google_review' not found. #351
126
 
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.8.8
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.8.8');
17
  define('SASWP_DIR_NAME_FILE', __FILE__ );
18
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
19
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
@@ -23,6 +23,7 @@ if(! defined('SASWP_ITEM_FOLDER_NAME')){
23
  define( 'SASWP_ITEM_FOLDER_NAME', $folderName );
24
  }
25
  define('SASWP_PLUGIN_URL', plugin_dir_url( __FILE__ ));
 
26
  define('SASWP_EDD_STORE_URL', 'http://structured-data-for-wp.com/');
27
  // including the output file
28
  require_once SASWP_DIR_NAME .'/output/function.php';
@@ -42,10 +43,12 @@ if ( ! function_exists('saswp_non_amp') ){
42
 
43
  $non_amp = true;
44
 
45
- if(function_exists('ampforwp_is_amp_endpoint') && ampforwp_is_amp_endpoint() ) {
46
 
47
- $non_amp = false;
48
-
 
 
49
  }
50
 
51
  return $non_amp;
@@ -184,7 +187,7 @@ add_filter('plugin_row_meta' , 'saswp_add_plugin_meta_links', 10, 2);
184
 
185
  function saswp_add_plugin_meta_links($meta_fields, $file) {
186
 
187
- if ( plugin_basename(__FILE__) == $file ) {
188
 
189
  $plugin_url = "https://wordpress.org/support/plugin/schema-and-structured-data-for-wp";
190
  $hire_url = "https://ampforwp.com/hire/";
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.8.9
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.8.9');
17
  define('SASWP_DIR_NAME_FILE', __FILE__ );
18
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
19
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
23
  define( 'SASWP_ITEM_FOLDER_NAME', $folderName );
24
  }
25
  define('SASWP_PLUGIN_URL', plugin_dir_url( __FILE__ ));
26
+ define('SASWP_PLUGIN_BASENAME', plugin_basename(__FILE__));
27
  define('SASWP_EDD_STORE_URL', 'http://structured-data-for-wp.com/');
28
  // including the output file
29
  require_once SASWP_DIR_NAME .'/output/function.php';
43
 
44
  $non_amp = true;
45
 
46
+ if(function_exists('ampforwp_is_amp_endpoint')) {
47
 
48
+ if(ampforwp_is_amp_endpoint()){
49
+ $non_amp = false;
50
+ }
51
+
52
  }
53
 
54
  return $non_amp;
187
 
188
  function saswp_add_plugin_meta_links($meta_fields, $file) {
189
 
190
+ if ( SASWP_PLUGIN_BASENAME == $file ) {
191
 
192
  $plugin_url = "https://wordpress.org/support/plugin/schema-and-structured-data-for-wp";
193
  $hire_url = "https://ampforwp.com/hire/";
view/help.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  /*
3
  * To change this license header, choose License Headers in Project Properties.
4
  * To change this template file, choose Tools | Templates
1
  <?php
2
+ /**
3
+ * Help page
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path view/help
8
+ * @version 1.0
9
+ */
10
+
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
  /*
15
  * To change this license header, choose License Headers in Project Properties.
16
  * To change this template file, choose Tools | Templates
view/paywall.php CHANGED
@@ -1,4 +1,16 @@
1
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  add_action( 'add_meta_boxes', 'saswp_schema_options_add_meta_box' ) ;
3
  add_action( 'save_post', 'saswp_schema_options_add_meta_box_save' ) ;
4
 
@@ -103,7 +115,7 @@
103
  echo $option;
104
  echo '</select></td>';
105
 
106
- echo '<td><select class="saswp-custom-fields-select2" name="saswp_custom_fields['.$fieldkey.']">';
107
  echo '<option value="'.esc_attr($fieldval).'">'.preg_replace( '/^_/', '', esc_html( str_replace( '_', ' ', $fieldval ) ) ).'</option>';
108
  echo '</select></td>';
109
 
@@ -156,7 +168,7 @@
156
  'notAccessibleForFree' => $notAccessibleForFree,
157
  'paywall_class_name' => $paywall_class_name,
158
  'enable_custom_field' => $enable_custom_field
159
- );
160
 
161
  update_post_meta( $post_id, 'schema_options', $saswp_schema_options);
162
  update_post_meta( $post_id, 'saswp_custom_fields', $custom_fields);
1
+ <?php
2
+ /**
3
+ * Paywall page
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path view/paywall
8
+ * @version 1.0
9
+ */
10
+
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
  add_action( 'add_meta_boxes', 'saswp_schema_options_add_meta_box' ) ;
15
  add_action( 'save_post', 'saswp_schema_options_add_meta_box_save' ) ;
16
 
115
  echo $option;
116
  echo '</select></td>';
117
 
118
+ echo '<td><select class="saswp-custom-fields-select2" name="saswp_custom_fields['.esc_attr($fieldkey).']">';
119
  echo '<option value="'.esc_attr($fieldval).'">'.preg_replace( '/^_/', '', esc_html( str_replace( '_', ' ', $fieldval ) ) ).'</option>';
120
  echo '</select></td>';
121
 
168
  'notAccessibleForFree' => $notAccessibleForFree,
169
  'paywall_class_name' => $paywall_class_name,
170
  'enable_custom_field' => $enable_custom_field
171
+ );
172
 
173
  update_post_meta( $post_id, 'schema_options', $saswp_schema_options);
174
  update_post_meta( $post_id, 'saswp_custom_fields', $custom_fields);
view/post_specific.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  class saswp_post_specific {
3
 
4
  private $screen = array();
@@ -7,7 +19,9 @@ class saswp_post_specific {
7
  protected $options_response = array();
8
  protected $modify_schema_post_enable = false;
9
 
10
-
 
 
11
  public function saswp_post_specific_hooks(){
12
 
13
  add_action( 'admin_init', array( $this, 'saswp_get_all_schema_list' ) );
@@ -23,7 +37,9 @@ class saswp_post_specific {
23
  add_action( 'wp_ajax_saswp_enable_disable_schema_on_post', array($this,'saswp_enable_disable_schema_on_post'));
24
 
25
  }
26
-
 
 
27
  public function saswp_enable_disable_schema_on_post(){
28
 
29
  if ( ! isset( $_POST['saswp_security_nonce'] ) ){
@@ -34,8 +50,8 @@ class saswp_post_specific {
34
  }
35
 
36
  $schema_enable = array();
37
- $post_id = sanitize_text_field($_POST['post_id']);
38
- $schema_id = sanitize_text_field($_POST['schema_id']);
39
  $status = sanitize_text_field($_POST['status']);
40
 
41
 
@@ -100,9 +116,12 @@ class saswp_post_specific {
100
 
101
  $show_post_types = get_post_types();
102
  unset($show_post_types['adsforwp'],$show_post_types['saswp'],$show_post_types['attachment'], $show_post_types['revision'], $show_post_types['nav_menu_item'], $show_post_types['user_request'], $show_post_types['custom_css']);
 
103
  $this->screen = $show_post_types;
104
-
105
- foreach ( $this->screen as $single_screen ) {
 
 
106
  $post_title = '';
107
  if($schema_count == 1 && $custom_option !='enable'){
108
  $all_schemas = $this->all_schema;
@@ -119,6 +138,8 @@ class saswp_post_specific {
119
  );
120
 
121
  }
 
 
122
  }
123
  }
124
 
@@ -336,17 +357,17 @@ class saswp_post_specific {
336
 
337
  $img_prev = '<div class="saswp_image_thumbnail">'
338
  . '<img class="saswp_image_prev" src="'.esc_url($src).'">'
339
- . '<a data-id="'.$name.'" href="#" class="saswp_prev_close">X</a>'
340
  . '</div>';
341
 
342
  }
343
 
344
-
345
  $input = '<fieldset>
346
- <input style="width:79%" type="text" id="'.$name.'" name="'.$name.'" value="'.esc_url($src).'">
347
- <input type="hidden" data-id="'.$name.'_id" name="'.$meta_name.'_'.$schema_id.'['.$index.']['.$meta_field['name'].'_id]'.'" id="'.$name.'_id" value="'.esc_attr($data[$meta_field['name'].'_id']).'">
348
- <input data-id="media" style="width: 19%" class="button" id="'.$name.'_button" name="'.$name.'_button" type="button" value="Upload">
349
- <div class="saswp_image_div_'.$name.'">'.$img_prev.'</div>
350
  </fieldset>';
351
 
352
 
@@ -356,9 +377,9 @@ class saswp_post_specific {
356
  case 'textarea':
357
  $input = sprintf(
358
  '<textarea style="width: 100%%" id="%s" name="%s" rows="5">%s</textarea>',
359
- $meta_field['name'].'_'.$index.'_'.$schema_id,
360
- $meta_name.'_'.$schema_id.'['.$index.']['.$meta_field['name'].']',
361
- $data[$meta_field['name']]
362
  );
363
 
364
  break;
@@ -367,8 +388,8 @@ class saswp_post_specific {
367
 
368
  $input = sprintf(
369
  '<select id="%s" name="%s">',
370
- $meta_field['name'].'_'.$index.'_'.$schema_id,
371
- $meta_name.'_'.$schema_id.'['.$index.']['.$meta_field['name'].']'
372
  );
373
  foreach ( $meta_field['options'] as $key => $value ) {
374
 
@@ -395,19 +416,19 @@ class saswp_post_specific {
395
  $input = sprintf(
396
  '<input %s style="width:100%%" id="%s" name="%s" type="%s" value="%s">',
397
  $class,
398
- $meta_field['name'].'_'.$index.'_'.$schema_id,
399
- $meta_name.'_'.$schema_id.'['.$index.']['.$meta_field['name'].']',
400
- $meta_field['type'],
401
- $data[$meta_field['name']]
402
  );
403
 
404
 
405
  }
406
-
407
  $output .= '<tr><th>'.$label.'</th><td>'.$input.'</td></tr>';
408
  }
409
 
410
-
411
  $response = '<table class="form-table">'.$output.'</table>';
412
  return $response;
413
 
@@ -482,6 +503,7 @@ class saswp_post_specific {
482
 
483
  $tabs_fields .= '<div data-id="'.esc_attr($schema->ID).'" id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-post-specific-wrapper">';
484
  $tabs_fields .= '<div class="saswp-table-create-onload">';
 
485
  $tabs_fields .= '<table class="form-table"><tbody>' . $output . '</tbody></table>';
486
  $tabs_fields .= '</div>';
487
 
@@ -520,7 +542,7 @@ class saswp_post_specific {
520
 
521
  }
522
  $tabs_fields .= '</div>';
523
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-how-to-supply">Add HowTo Supply</a>';
524
  $tabs_fields .= '</div>';
525
  //supply section ends here here
526
 
@@ -551,7 +573,7 @@ class saswp_post_specific {
551
 
552
  }
553
  $tabs_fields .= '</div>';
554
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-how-to-tool">Add HowTo Tool</a>';
555
  $tabs_fields .= '</div>';
556
  //tool section ends here here
557
 
@@ -582,7 +604,7 @@ class saswp_post_specific {
582
 
583
  }
584
  $tabs_fields .= '</div>';
585
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-how-to-step">Add HowTo Step</a>';
586
  $tabs_fields .= '</div>';
587
  //step section ends here here
588
 
@@ -628,7 +650,7 @@ class saswp_post_specific {
628
 
629
  }
630
  $tabs_fields .= '</div>';
631
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-cause">Add MC Cause</a>';
632
  $tabs_fields .= '</div>';
633
 
634
  //cause section ends here here
@@ -660,7 +682,7 @@ class saswp_post_specific {
660
 
661
  }
662
  $tabs_fields .= '</div>';
663
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-symptom">Add MC Symptom</a>';
664
  $tabs_fields .= '</div>';
665
  //symptom section ends here
666
 
@@ -691,7 +713,7 @@ class saswp_post_specific {
691
 
692
  }
693
  $tabs_fields .= '</div>';
694
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-risk_factor">Add MC Risk Factor</a>';
695
  $tabs_fields .= '</div>';
696
  //risk factor ends here
697
 
@@ -734,7 +756,7 @@ class saswp_post_specific {
734
 
735
  }
736
  $tabs_fields .= '</div>';
737
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-tvseries-actor">Add TVSeries Actor</a>';
738
  $tabs_fields .= '</div>';
739
  //actor section ends here here
740
 
@@ -767,7 +789,7 @@ class saswp_post_specific {
767
 
768
  }
769
  $tabs_fields .= '</div>';
770
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-tvseries-season">Add TVSeries Season</a>';
771
  $tabs_fields .= '</div>';
772
 
773
  //season section ends here
@@ -814,7 +836,7 @@ class saswp_post_specific {
814
 
815
  }
816
  $tabs_fields .= '</div>';
817
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-trip-itinerary">Add Trip Itinerary</a>';
818
  $tabs_fields .= '</div>';
819
 
820
  //itinerary section ends here
@@ -874,7 +896,7 @@ class saswp_post_specific {
874
 
875
  }
876
  $tabs_fields .= '</div>';
877
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-how-to-supply">Add HowTo Supply</a>';
878
  $tabs_fields .= '</div>';
879
  //supply section ends here here
880
 
@@ -905,7 +927,7 @@ class saswp_post_specific {
905
 
906
  }
907
  $tabs_fields .= '</div>';
908
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-how-to-tool">Add HowTo Tool</a>';
909
  $tabs_fields .= '</div>';
910
  //tool section ends here here
911
 
@@ -936,7 +958,7 @@ class saswp_post_specific {
936
 
937
  }
938
  $tabs_fields .= '</div>';
939
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-how-to-step">Add HowTo Step</a>';
940
  $tabs_fields .= '</div>';
941
  //step section ends here here
942
 
@@ -1014,7 +1036,7 @@ class saswp_post_specific {
1014
 
1015
  }
1016
  $tabs_fields .= '</div>';
1017
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-symptom">Add MC Symptom</a>';
1018
  $tabs_fields .= '</div>';
1019
  //symptom section ends here
1020
 
@@ -1045,7 +1067,7 @@ class saswp_post_specific {
1045
 
1046
  }
1047
  $tabs_fields .= '</div>';
1048
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-risk_factor">Add MC Risk Factor</a>';
1049
  $tabs_fields .= '</div>';
1050
  //risk factor ends here
1051
 
@@ -1088,7 +1110,7 @@ class saswp_post_specific {
1088
 
1089
  }
1090
  $tabs_fields .= '</div>';
1091
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-tvseries-actor">Add TVSeries Actor</a>';
1092
  $tabs_fields .= '</div>';
1093
  //actor section ends here here
1094
 
@@ -1121,7 +1143,7 @@ class saswp_post_specific {
1121
 
1122
  }
1123
  $tabs_fields .= '</div>';
1124
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-tvseries-season">Add TVSeries Season</a>';
1125
  $tabs_fields .= '</div>';
1126
 
1127
  //season section ends here
@@ -1167,7 +1189,7 @@ class saswp_post_specific {
1167
 
1168
  }
1169
  $tabs_fields .= '</div>';
1170
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-trip-itinerary">Add Trip Itinerary</a>';
1171
  $tabs_fields .= '</div>';
1172
 
1173
  //itinerary section ends here
@@ -1216,6 +1238,9 @@ class saswp_post_specific {
1216
  echo '<textarea style="margin-left:5px;" placeholder="{ Json Markup }" id="saswp_custom_schema_field" name="saswp_custom_schema_field" rows="5" cols="100">'
1217
  . $custom_markup
1218
  . '</textarea>';
 
 
 
1219
  echo '</div>';
1220
  echo '</div>';
1221
 
@@ -1316,7 +1341,7 @@ class saswp_post_specific {
1316
  //supply section ends here here
1317
 
1318
  //tool section starts here
1319
- $tabs_fields .= '<div class="saswp-how-to-tool-section-main">';
1320
  $tabs_fields .= '<div class="saswp-how-to-tool-section" data-id="'.esc_attr($schema_id).'">';
1321
  if(isset($howto_data['howto_tool_'.$schema_id])){
1322
 
@@ -1388,8 +1413,7 @@ class saswp_post_specific {
1388
  $schema_id = $schema->ID;
1389
 
1390
  $tabs_fields .= '<div class="saswp-table-create-onajax">';
1391
-
1392
-
1393
  //cause section starts here
1394
 
1395
  $tabs_fields .= '<div class="saswp-mc-cause-section-main">';
@@ -1451,7 +1475,7 @@ class saswp_post_specific {
1451
 
1452
  }
1453
  $tabs_fields .= '</div>';
1454
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-symptom">Add MC Symptom</a>';
1455
  $tabs_fields .= '</div>';
1456
  //symptom section ends here
1457
 
@@ -1482,7 +1506,7 @@ class saswp_post_specific {
1482
 
1483
  }
1484
  $tabs_fields .= '</div>';
1485
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-risk_factor">Add MC Risk Factor</a>';
1486
  $tabs_fields .= '</div>';
1487
  //risk factor ends here
1488
 
@@ -1525,7 +1549,7 @@ class saswp_post_specific {
1525
 
1526
  }
1527
  $tabs_fields .= '</div>';
1528
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-tvseries-actor">Add TVSeries Actor</a>';
1529
  $tabs_fields .= '</div>';
1530
  //actor section ends here here
1531
 
@@ -1558,7 +1582,7 @@ class saswp_post_specific {
1558
 
1559
  }
1560
  $tabs_fields .= '</div>';
1561
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-tvseries-season">Add TVSeries Season</a>';
1562
  $tabs_fields .= '</div>';
1563
 
1564
  //season section ends here
@@ -1604,7 +1628,7 @@ class saswp_post_specific {
1604
 
1605
  }
1606
  $tabs_fields .= '</div>';
1607
- $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-trip-itinerary">Add Trip Itinerary</a>';
1608
  $tabs_fields .= '</div>';
1609
 
1610
  //itinerary section ends here
@@ -1690,7 +1714,11 @@ class saswp_post_specific {
1690
  }
1691
 
1692
  }
1693
-
 
 
 
 
1694
  public function saswp_restore_schema(){
1695
 
1696
  if ( ! isset( $_POST['saswp_security_nonce'] ) ){
@@ -1701,7 +1729,7 @@ class saswp_post_specific {
1701
  }
1702
 
1703
  $result = '';
1704
- $post_id = sanitize_text_field($_POST['post_id']);
1705
  $schema_ids = array_map( 'sanitize_text_field', $_POST['schema_ids'] );
1706
 
1707
  if($schema_ids){
@@ -1734,8 +1762,11 @@ class saswp_post_specific {
1734
  }
1735
  wp_die();
1736
  }
1737
-
1738
-
 
 
 
1739
  public function saswp_modify_schema_post_enable(){
1740
 
1741
  if ( ! isset( $_GET['saswp_security_nonce'] ) ){
@@ -1745,7 +1776,7 @@ class saswp_post_specific {
1745
  return;
1746
  }
1747
 
1748
- $post_id = sanitize_text_field($_GET['post_id']);
1749
  update_option('modify_schema_post_enable_'.$post_id, 'enable');
1750
 
1751
  $args = array(
@@ -1778,7 +1809,7 @@ class saswp_post_specific {
1778
 
1779
  if(empty($image_details[0]) || $image_details[0] === NULL ){
1780
 
1781
- if(isset($sd_data['sd_logo'])){
1782
  $image_details[0] = $sd_data['sd_logo']['url'];
1783
  }
1784
 
@@ -1808,7 +1839,7 @@ class saswp_post_specific {
1808
 
1809
  foreach ($meta_field['attributes'] as $key => $attr ){
1810
 
1811
- $attributes .=''.$key.'="'.$attr.'"';
1812
  }
1813
 
1814
  }
@@ -2118,7 +2149,12 @@ class saswp_post_specific {
2118
  }
2119
  return $output;
2120
  }
2121
-
 
 
 
 
 
2122
  public function saswp_post_specific_save_fields( $post_id ) {
2123
 
2124
  if ( ! isset( $_POST['post_specific_nonce'] ) )
@@ -2132,8 +2168,7 @@ class saswp_post_specific {
2132
  return $post_id;
2133
 
2134
  $option = get_option('modify_schema_post_enable_'.$post_id);
2135
-
2136
-
2137
  $custom_schema = sanitize_textarea_field($_POST['saswp_custom_schema_field']);
2138
  update_post_meta( $post_id, 'saswp_custom_schema_field', $custom_schema );
2139
 
@@ -2193,9 +2228,9 @@ class saswp_post_specific {
2193
  }
2194
  }
2195
 
2196
- update_post_meta( $post_id, 'howto_step_'.$schema->ID, $howto_step);
2197
- update_post_meta( $post_id, 'howto_tool_'.$schema->ID, $howto_tool);
2198
- update_post_meta( $post_id, 'howto_supply_'.$schema->ID, $howto_supply);
2199
 
2200
  //How to schema ends here
2201
 
@@ -2233,9 +2268,9 @@ class saswp_post_specific {
2233
  }
2234
  }
2235
 
2236
- update_post_meta( $post_id, 'mc_cause_'.$schema->ID, $mc_cause);
2237
- update_post_meta( $post_id, 'mc_symptom_'.$schema->ID, $mc_symptom);
2238
- update_post_meta( $post_id, 'mc_risk_factor_'.$schema->ID, $mc_r_factor);
2239
 
2240
  //MedicalCondition schema ends here
2241
 
@@ -2264,8 +2299,8 @@ class saswp_post_specific {
2264
  }
2265
 
2266
 
2267
- update_post_meta( $post_id, 'tvseries_actor_'.$schema->ID, $tv_actor);
2268
- update_post_meta( $post_id, 'tvseries_season_'.$schema->ID, $tv_season);
2269
 
2270
  //TVSeries schema ends here
2271
 
@@ -2319,6 +2354,8 @@ class saswp_post_specific {
2319
  case 'text':
2320
  $post_meta[ $meta_field['id'] ] = sanitize_text_field( $post_meta[ $meta_field['id'] ] );
2321
  break;
 
 
2322
 
2323
  }
2324
  update_post_meta( $post_id, $meta_field['id'], $post_meta[ $meta_field['id'] ] );
@@ -2351,7 +2388,12 @@ class saswp_post_specific {
2351
  }
2352
  wp_die();
2353
  }
2354
-
 
 
 
 
 
2355
  public function saswp_get_sub_business_array($business_type){
2356
 
2357
  $sub_business_options = array();
@@ -2501,7 +2543,14 @@ class saswp_post_specific {
2501
  }
2502
  return $sub_business_options;
2503
  }
2504
-
 
 
 
 
 
 
 
2505
  public function saswp_get_fields_by_schema_type( $schema_id ) {
2506
 
2507
  global $post;
@@ -2519,7 +2568,7 @@ class saswp_post_specific {
2519
 
2520
  if(empty($image_details[0]) || $image_details[0] === NULL ){
2521
 
2522
- if(isset($sd_data['sd_logo'])){
2523
  $image_details[0] = $sd_data['sd_logo']['url'];
2524
  }
2525
 
@@ -2741,7 +2790,55 @@ class saswp_post_specific {
2741
  'id' => 'local_serves_cuisine_'.$schema_id,
2742
  'type' => 'text',
2743
  'default' => $business_details['local_serves_cuisine']
2744
- ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2745
  array(
2746
  'label' => 'Aggregate Rating',
2747
  'id' => 'local_enable_rating_'.$schema_id,
1
  <?php
2
+ /**
3
+ * Post Specific Class
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path view/post_specific
8
+ * @version 1.0.4
9
+ */
10
+
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
  class saswp_post_specific {
15
 
16
  private $screen = array();
19
  protected $options_response = array();
20
  protected $modify_schema_post_enable = false;
21
 
22
+ /**
23
+ * List of hooks used in this context
24
+ */
25
  public function saswp_post_specific_hooks(){
26
 
27
  add_action( 'admin_init', array( $this, 'saswp_get_all_schema_list' ) );
37
  add_action( 'wp_ajax_saswp_enable_disable_schema_on_post', array($this,'saswp_enable_disable_schema_on_post'));
38
 
39
  }
40
+ /**
41
+ *
42
+ */
43
  public function saswp_enable_disable_schema_on_post(){
44
 
45
  if ( ! isset( $_POST['saswp_security_nonce'] ) ){
50
  }
51
 
52
  $schema_enable = array();
53
+ $post_id = intval($_POST['post_id']);
54
+ $schema_id = intval($_POST['schema_id']);
55
  $status = sanitize_text_field($_POST['status']);
56
 
57
 
116
 
117
  $show_post_types = get_post_types();
118
  unset($show_post_types['adsforwp'],$show_post_types['saswp'],$show_post_types['attachment'], $show_post_types['revision'], $show_post_types['nav_menu_item'], $show_post_types['user_request'], $show_post_types['custom_css']);
119
+
120
  $this->screen = $show_post_types;
121
+
122
+ if($this->screen){
123
+
124
+ foreach ( $this->screen as $single_screen ) {
125
  $post_title = '';
126
  if($schema_count == 1 && $custom_option !='enable'){
127
  $all_schemas = $this->all_schema;
138
  );
139
 
140
  }
141
+ }
142
+
143
  }
144
  }
145
 
357
 
358
  $img_prev = '<div class="saswp_image_thumbnail">'
359
  . '<img class="saswp_image_prev" src="'.esc_url($src).'">'
360
+ . '<a data-id="'.esc_attr($name).'" href="#" class="saswp_prev_close">X</a>'
361
  . '</div>';
362
 
363
  }
364
 
365
+ //$img_prev is already escapped
366
  $input = '<fieldset>
367
+ <input style="width:79%" type="text" id="'.esc_attr($name).'" name="'.esc_attr($name).'" value="'.esc_url($src).'">
368
+ <input type="hidden" data-id="'.esc_attr($name).'_id" name="'.esc_attr($meta_name).'_'.esc_attr($schema_id).'['.esc_attr($index).']['.esc_attr($meta_field['name']).'_id]'.'" id="'.esc_attr($name).'_id" value="'.esc_attr($data[$meta_field['name'].'_id']).'">
369
+ <input data-id="media" style="width: 19%" class="button" id="'.esc_attr($name).'_button" name="'.esc_attr($name).'_button" type="button" value="Upload">
370
+ <div class="saswp_image_div_'.esc_attr($name).'">'.$img_prev.'</div>
371
  </fieldset>';
372
 
373
 
377
  case 'textarea':
378
  $input = sprintf(
379
  '<textarea style="width: 100%%" id="%s" name="%s" rows="5">%s</textarea>',
380
+ esc_attr($meta_field['name']).'_'.esc_attr($index).'_'.esc_attr($schema_id),
381
+ esc_attr($meta_name).'_'.esc_attr($schema_id).'['.esc_attr($index).']['.esc_attr($meta_field['name']).']',
382
+ esc_html($data[$meta_field['name']])
383
  );
384
 
385
  break;
388
 
389
  $input = sprintf(
390
  '<select id="%s" name="%s">',
391
+ esc_attr($meta_field['name']).'_'.esc_attr($index).'_'.esc_attr($schema_id),
392
+ esc_attr($meta_name).'_'.esc_attr($schema_id).'['.esc_attr($index).']['.esc_attr($meta_field['name']).']'
393
  );
394
  foreach ( $meta_field['options'] as $key => $value ) {
395
 
416
  $input = sprintf(
417
  '<input %s style="width:100%%" id="%s" name="%s" type="%s" value="%s">',
418
  $class,
419
+ esc_attr($meta_field['name']).'_'.esc_attr($index).'_'.esc_attr($schema_id),
420
+ esc_attr($meta_name).'_'.esc_attr($schema_id).'['.esc_attr($index).']['.esc_attr($meta_field['name']).']',
421
+ esc_attr($meta_field['type']),
422
+ esc_attr($data[$meta_field['name']])
423
  );
424
 
425
 
426
  }
427
+ //$lable and $input has been escapped while create this variable
428
  $output .= '<tr><th>'.$label.'</th><td>'.$input.'</td></tr>';
429
  }
430
 
431
+ //$output has been escapped while create this variable
432
  $response = '<table class="form-table">'.$output.'</table>';
433
  return $response;
434
 
503
 
504
  $tabs_fields .= '<div data-id="'.esc_attr($schema->ID).'" id="saswp_specific_'.esc_attr($schema->ID).'" class="saswp-post-specific-wrapper">';
505
  $tabs_fields .= '<div class="saswp-table-create-onload">';
506
+ //varible $output has been escapped while creating it
507
  $tabs_fields .= '<table class="form-table"><tbody>' . $output . '</tbody></table>';
508
  $tabs_fields .= '</div>';
509
 
542
 
543
  }
544
  $tabs_fields .= '</div>';
545
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-how-to-supply">'.esc_html__( 'Add HowTo Supply', 'schema-and-structured-data-for-wp' ).'</a>';
546
  $tabs_fields .= '</div>';
547
  //supply section ends here here
548
 
573
 
574
  }
575
  $tabs_fields .= '</div>';
576
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-how-to-tool">'.esc_html__( 'Add HowTo Tool', 'schema-and-structured-data-for-wp' ).'</a>';
577
  $tabs_fields .= '</div>';
578
  //tool section ends here here
579
 
604
 
605
  }
606
  $tabs_fields .= '</div>';
607
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-how-to-step">'.esc_html__( 'Add HowTo Step', 'schema-and-structured-data-for-wp' ).'</a>';
608
  $tabs_fields .= '</div>';
609
  //step section ends here here
610
 
650
 
651
  }
652
  $tabs_fields .= '</div>';
653
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-cause">'.esc_html__( 'Add MC Cause', 'schema-and-structured-data-for-wp' ).'</a>';
654
  $tabs_fields .= '</div>';
655
 
656
  //cause section ends here here
682
 
683
  }
684
  $tabs_fields .= '</div>';
685
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-symptom">'.esc_html__( 'Add MC Symptom', 'schema-and-structured-data-for-wp' ).'</a>';
686
  $tabs_fields .= '</div>';
687
  //symptom section ends here
688
 
713
 
714
  }
715
  $tabs_fields .= '</div>';
716
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-risk_factor">'.esc_html__( 'Add MC Risk Factor', 'schema-and-structured-data-for-wp' ).'</a>';
717
  $tabs_fields .= '</div>';
718
  //risk factor ends here
719
 
756
 
757
  }
758
  $tabs_fields .= '</div>';
759
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-tvseries-actor">'.esc_html__( 'Add TVSeries Actor', 'schema-and-structured-data-for-wp' ).'</a>';
760
  $tabs_fields .= '</div>';
761
  //actor section ends here here
762
 
789
 
790
  }
791
  $tabs_fields .= '</div>';
792
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-tvseries-season">'.esc_html__( 'Add TVSeries Season', 'schema-and-structured-data-for-wp' ).'</a>';
793
  $tabs_fields .= '</div>';
794
 
795
  //season section ends here
836
 
837
  }
838
  $tabs_fields .= '</div>';
839
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-trip-itinerary">'.esc_html__( 'Add Trip Itinerary', 'schema-and-structured-data-for-wp' ).'</a>';
840
  $tabs_fields .= '</div>';
841
 
842
  //itinerary section ends here
896
 
897
  }
898
  $tabs_fields .= '</div>';
899
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-how-to-supply">'.esc_html__( 'Add HowTo Supply', 'schema-and-structured-data-for-wp' ).'</a>';
900
  $tabs_fields .= '</div>';
901
  //supply section ends here here
902
 
927
 
928
  }
929
  $tabs_fields .= '</div>';
930
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-how-to-tool">'.esc_html__( 'Add HowTo Tool', 'schema-and-structured-data-for-wp' ).'</a>';
931
  $tabs_fields .= '</div>';
932
  //tool section ends here here
933
 
958
 
959
  }
960
  $tabs_fields .= '</div>';
961
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-how-to-step">'.esc_html__( 'Add HowTo Step', 'schema-and-structured-data-for-wp' ).'</a>';
962
  $tabs_fields .= '</div>';
963
  //step section ends here here
964
 
1036
 
1037
  }
1038
  $tabs_fields .= '</div>';
1039
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-symptom">'.esc_html__( 'Add MC Symptom', 'schema-and-structured-data-for-wp' ).'</a>';
1040
  $tabs_fields .= '</div>';
1041
  //symptom section ends here
1042
 
1067
 
1068
  }
1069
  $tabs_fields .= '</div>';
1070
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-risk_factor">'.esc_html__( 'Add MC Risk Factor', 'schema-and-structured-data-for-wp' ).'</a>';
1071
  $tabs_fields .= '</div>';
1072
  //risk factor ends here
1073
 
1110
 
1111
  }
1112
  $tabs_fields .= '</div>';
1113
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-tvseries-actor">'.esc_html__( 'Add TVSeries Actor', 'schema-and-structured-data-for-wp' ).'</a>';
1114
  $tabs_fields .= '</div>';
1115
  //actor section ends here here
1116
 
1143
 
1144
  }
1145
  $tabs_fields .= '</div>';
1146
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-tvseries-season">'.esc_html__( 'Add TVSeries Season', 'schema-and-structured-data-for-wp' ).'</a>';
1147
  $tabs_fields .= '</div>';
1148
 
1149
  //season section ends here
1189
 
1190
  }
1191
  $tabs_fields .= '</div>';
1192
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-trip-itinerary">'.esc_html__( 'Add Trip Itinerary', 'schema-and-structured-data-for-wp' ).'</a>';
1193
  $tabs_fields .= '</div>';
1194
 
1195
  //itinerary section ends here
1238
  echo '<textarea style="margin-left:5px;" placeholder="{ Json Markup }" id="saswp_custom_schema_field" name="saswp_custom_schema_field" rows="5" cols="100">'
1239
  . $custom_markup
1240
  . '</textarea>';
1241
+ if(json_decode($custom_markup) == false){
1242
+ echo '<p style="text-align:center;color:red;margin-top:0px;">'.esc_html__( 'Not a valid json', 'schema-and-structured-data-for-wp' ).'</p>';
1243
+ }
1244
  echo '</div>';
1245
  echo '</div>';
1246
 
1341
  //supply section ends here here
1342
 
1343
  //tool section starts here
1344
+ $tabs_fields .= '<div class="saswp-how-to-tool-section-main">';
1345
  $tabs_fields .= '<div class="saswp-how-to-tool-section" data-id="'.esc_attr($schema_id).'">';
1346
  if(isset($howto_data['howto_tool_'.$schema_id])){
1347
 
1413
  $schema_id = $schema->ID;
1414
 
1415
  $tabs_fields .= '<div class="saswp-table-create-onajax">';
1416
+
 
1417
  //cause section starts here
1418
 
1419
  $tabs_fields .= '<div class="saswp-mc-cause-section-main">';
1475
 
1476
  }
1477
  $tabs_fields .= '</div>';
1478
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-symptom">'.esc_html__( 'Add MC Symptom', 'schema-and-structured-data-for-wp' ).'</a>';
1479
  $tabs_fields .= '</div>';
1480
  //symptom section ends here
1481
 
1506
 
1507
  }
1508
  $tabs_fields .= '</div>';
1509
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-mc-risk_factor">'.esc_html__( 'Add MC Risk Factor', 'schema-and-structured-data-for-wp' ).'</a>';
1510
  $tabs_fields .= '</div>';
1511
  //risk factor ends here
1512
 
1549
 
1550
  }
1551
  $tabs_fields .= '</div>';
1552
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-tvseries-actor">'.esc_html__( 'Add TVSeries Actor', 'schema-and-structured-data-for-wp' ).'</a>';
1553
  $tabs_fields .= '</div>';
1554
  //actor section ends here here
1555
 
1582
 
1583
  }
1584
  $tabs_fields .= '</div>';
1585
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-tvseries-season">'.esc_html__( 'Add TVSeries Season', 'schema-and-structured-data-for-wp' ).'</a>';
1586
  $tabs_fields .= '</div>';
1587
 
1588
  //season section ends here
1628
 
1629
  }
1630
  $tabs_fields .= '</div>';
1631
+ $tabs_fields .= '<a data-id="'.esc_attr($schema_id).'" class="button saswp-trip-itinerary">'.esc_html__( 'Add Trip Itinerary', 'schema-and-structured-data-for-wp' ).'</a>';
1632
  $tabs_fields .= '</div>';
1633
 
1634
  //itinerary section ends here
1714
  }
1715
 
1716
  }
1717
+ /**
1718
+ * Function to restoere all the post specific schema on a particular post/page
1719
+ * @return type string
1720
+ * @since version 1.0.4
1721
+ */
1722
  public function saswp_restore_schema(){
1723
 
1724
  if ( ! isset( $_POST['saswp_security_nonce'] ) ){
1729
  }
1730
 
1731
  $result = '';
1732
+ $post_id = intval($_POST['post_id']);
1733
  $schema_ids = array_map( 'sanitize_text_field', $_POST['schema_ids'] );
1734
 
1735
  if($schema_ids){
1762
  }
1763
  wp_die();
1764
  }
1765
+ /**
1766
+ * Generate the post specific metabox html with dynamic values on ajax call
1767
+ * @return type string
1768
+ * @since version 1.0.4
1769
+ */
1770
  public function saswp_modify_schema_post_enable(){
1771
 
1772
  if ( ! isset( $_GET['saswp_security_nonce'] ) ){
1776
  return;
1777
  }
1778
 
1779
+ $post_id = intval($_GET['post_id']);
1780
  update_option('modify_schema_post_enable_'.$post_id, 'enable');
1781
 
1782
  $args = array(
1809
 
1810
  if(empty($image_details[0]) || $image_details[0] === NULL ){
1811
 
1812
+ if(isset($sd_data['sd_logo']['url'])){
1813
  $image_details[0] = $sd_data['sd_logo']['url'];
1814
  }
1815
 
1839
 
1840
  foreach ($meta_field['attributes'] as $key => $attr ){
1841
 
1842
+ $attributes .=''.esc_attr($key).'="'.esc_attr($attr).'"';
1843
  }
1844
 
1845
  }
2149
  }
2150
  return $output;
2151
  }
2152
+ /**
2153
+ * Function to save post specific metabox fields value
2154
+ * @param type $post_id
2155
+ * @return type null
2156
+ * @since version 1.0.4
2157
+ */
2158
  public function saswp_post_specific_save_fields( $post_id ) {
2159
 
2160
  if ( ! isset( $_POST['post_specific_nonce'] ) )
2168
  return $post_id;
2169
 
2170
  $option = get_option('modify_schema_post_enable_'.$post_id);
2171
+
 
2172
  $custom_schema = sanitize_textarea_field($_POST['saswp_custom_schema_field']);
2173
  update_post_meta( $post_id, 'saswp_custom_schema_field', $custom_schema );
2174
 
2228
  }
2229
  }
2230
 
2231
+ update_post_meta( $post_id, 'howto_step_'.intval($schema->ID), $howto_step);
2232
+ update_post_meta( $post_id, 'howto_tool_'.intval($schema->ID), $howto_tool);
2233
+ update_post_meta( $post_id, 'howto_supply_'.intval($schema->ID), $howto_supply);
2234
 
2235
  //How to schema ends here
2236
 
2268
  }
2269
  }
2270
 
2271
+ update_post_meta( $post_id, 'mc_cause_'.intval($schema->ID), $mc_cause);
2272
+ update_post_meta( $post_id, 'mc_symptom_'.intval($schema->ID), $mc_symptom);
2273
+ update_post_meta( $post_id, 'mc_risk_factor_'.intval($schema->ID), $mc_r_factor);
2274
 
2275
  //MedicalCondition schema ends here
2276
 
2299
  }
2300
 
2301
 
2302
+ update_post_meta( $post_id, 'tvseries_actor_'.intval($schema->ID), $tv_actor);
2303
+ update_post_meta( $post_id, 'tvseries_season_'.intval($schema->ID), $tv_season);
2304
 
2305
  //TVSeries schema ends here
2306
 
2354
  case 'text':
2355
  $post_meta[ $meta_field['id'] ] = sanitize_text_field( $post_meta[ $meta_field['id'] ] );
2356
  break;
2357
+ default:
2358
+ $post_meta[ $meta_field['id'] ] = sanitize_text_field( $post_meta[ $meta_field['id'] ] );
2359
 
2360
  }
2361
  update_post_meta( $post_id, $meta_field['id'], $post_meta[ $meta_field['id'] ] );
2388
  }
2389
  wp_die();
2390
  }
2391
+ /**
2392
+ * Function to get fields as an array of sub business(LocalBusiness Schema)
2393
+ * @param type $business_type
2394
+ * @return array
2395
+ * @since version 1.0.4
2396
+ */
2397
  public function saswp_get_sub_business_array($business_type){
2398
 
2399
  $sub_business_options = array();
2543
  }
2544
  return $sub_business_options;
2545
  }
2546
+ /**
2547
+ * Function to get the fields of a particular schema type as an array
2548
+ * @global type $post
2549
+ * @global type $sd_data
2550
+ * @param type $schema_id
2551
+ * @return array
2552
+ * @since version 1.0.4
2553
+ */
2554
  public function saswp_get_fields_by_schema_type( $schema_id ) {
2555
 
2556
  global $post;
2568
 
2569
  if(empty($image_details[0]) || $image_details[0] === NULL ){
2570
 
2571
+ if(isset($sd_data['sd_logo']['url'])){
2572
  $image_details[0] = $sd_data['sd_logo']['url'];
2573
  }
2574
 
2790
  'id' => 'local_serves_cuisine_'.$schema_id,
2791
  'type' => 'text',
2792
  'default' => $business_details['local_serves_cuisine']
2793
+ ),
2794
+ array(
2795
+ 'label' => 'Facebook',
2796
+ 'id' => 'local_facebook_'.$schema_id,
2797
+ 'type' => 'text',
2798
+ 'default' => $business_details['local_facebook']
2799
+ ),
2800
+ array(
2801
+ 'label' => 'Twitter',
2802
+ 'id' => 'local_twitter_'.$schema_id,
2803
+ 'type' => 'text',
2804
+ 'default' => $business_details['local_twitter']
2805
+ ),
2806
+ array(
2807
+ 'label' => 'Instagram',
2808
+ 'id' => 'local_instagram_'.$schema_id,
2809
+ 'type' => 'text',
2810
+ 'default' => $business_details['local_instagram']
2811
+ ),
2812
+ array(
2813
+ 'label' => 'Pinterest',
2814
+ 'id' => 'local_pinterest_'.$schema_id,
2815
+ 'type' => 'text',
2816
+ 'default' => $business_details['local_pinterest']
2817
+ ),
2818
+ array(
2819
+ 'label' => 'Linkedin',
2820
+ 'id' => 'local_linkedin_'.$schema_id,
2821
+ 'type' => 'text',
2822
+ 'default' => $business_details['local_linkedin']
2823
+ ),
2824
+ array(
2825
+ 'label' => 'Soundcloud',
2826
+ 'id' => 'local_soundcloud_'.$schema_id,
2827
+ 'type' => 'text',
2828
+ 'default' => $business_details['local_soundcloud']
2829
+ ),
2830
+ array(
2831
+ 'label' => 'local_tumblr',
2832
+ 'id' => 'local_tumblr_'.$schema_id,
2833
+ 'type' => 'text',
2834
+ 'default' => $business_details['local_tumblr']
2835
+ ),
2836
+ array(
2837
+ 'label' => 'Youtube',
2838
+ 'id' => 'local_youtube_'.$schema_id,
2839
+ 'type' => 'text',
2840
+ 'default' => $business_details['local_youtube']
2841
+ ),
2842
  array(
2843
  'label' => 'Aggregate Rating',
2844
  'id' => 'local_enable_rating_'.$schema_id,
view/review.php CHANGED
@@ -1,4 +1,16 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
2
  class saswp_metaboxes_review {
3
 
4
  private $screen = array();
@@ -27,8 +39,10 @@ class saswp_metaboxes_review {
27
  $show_post_types = get_post_types();
28
  unset($show_post_types['adsforwp'],$show_post_types['saswp'],$show_post_types['attachment'], $show_post_types['revision'], $show_post_types['nav_menu_item'], $show_post_types['user_request'], $show_post_types['custom_css']);
29
  $this->screen = $show_post_types;
30
-
31
- foreach ( $this->screen as $single_screen ) {
 
 
32
 
33
  add_meta_box(
34
  'sasw-review',
@@ -39,8 +53,8 @@ class saswp_metaboxes_review {
39
  'default'
40
  );
41
 
42
- }
43
-
44
  }
45
  }
46
  function saswp_review_get_meta( $value ) {
1
  <?php
2
+ /**
3
+ * Review Class
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path view/review
8
+ * @Version 1.0
9
+ */
10
+
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
  class saswp_metaboxes_review {
15
 
16
  private $screen = array();
39
  $show_post_types = get_post_types();
40
  unset($show_post_types['adsforwp'],$show_post_types['saswp'],$show_post_types['attachment'], $show_post_types['revision'], $show_post_types['nav_menu_item'], $show_post_types['user_request'], $show_post_types['custom_css']);
41
  $this->screen = $show_post_types;
42
+
43
+ if($this->screen){
44
+
45
+ foreach ( $this->screen as $single_screen ) {
46
 
47
  add_meta_box(
48
  'sasw-review',
53
  'default'
54
  );
55
 
56
+ }
57
+ }
58
  }
59
  }
60
  function saswp_review_get_meta( $value ) {
view/schema_type.php CHANGED
@@ -1,1568 +1,1645 @@
1
  <?php
2
- function saswp_item_reviewed_fields($item, $post_specific = null, $schema_id = null){
3
-
4
- $post_fix = '';
5
-
6
- if($post_specific == 1 && isset($schema_id)){
7
-
8
- $post_fix = '_'.esc_attr($schema_id);
9
-
10
- }
11
-
12
- $reviewed_field = array(
13
- array(
14
- 'label' => 'Name',
15
- 'id' => 'saswp_review_schema_name'.$post_fix,
16
- 'type' => 'text',
17
- 'default' => '',
18
- 'attributes' => array(
19
- 'placeholder' => 'Name'
20
- )
21
-
22
- ),
23
- array(
24
- 'label' => 'Review Body',
25
- 'id' => 'saswp_review_schema_description'.$post_fix,
26
- 'type' => 'textarea',
27
- 'default' => '',
28
- 'attributes' => array(
29
- 'placeholder' => 'Review Body'
30
- )
31
- ),
32
- array(
33
- 'label' => 'Image',
34
- 'id' => 'saswp_review_schema_image'.$post_fix,
35
- 'type' => 'media',
36
- 'default' => '',
37
- 'attributes' => array(
38
- 'placeholder' => 'Image'
39
- )
40
- ),
41
- array(
42
- 'label' => 'Author',
43
- 'id' => 'saswp_review_schema_author'.$post_fix,
44
- 'type' => 'text',
45
- 'default' => '',
46
- 'attributes' => array(
47
- 'placeholder' => 'Author'
48
- )
49
- ),
50
- array(
51
- 'label' => 'Price Range',
52
- 'id' => 'saswp_review_schema_price_range'.$post_fix,
53
- 'type' => 'text',
54
- 'default' => '',
55
- 'attributes' => array(
56
- 'placeholder' => '$$$ or 55$-100$'
57
- )
58
- ),
59
- array(
60
- 'label' => 'Street Address',
61
- 'id' => 'saswp_review_schema_street_address'.$post_fix,
62
- 'type' => 'text',
63
- 'default' => '',
64
- 'attributes' => array(
65
- 'placeholder' => 'Street Address'
66
- )
67
- ),
68
- array(
69
- 'label' => 'Address Locality',
70
- 'id' => 'saswp_review_schema_locality'.$post_fix,
71
- 'type' => 'text',
72
- 'default' => '',
73
- 'attributes' => array(
74
- 'placeholder' => 'Address Locality'
75
- )
76
- ),
77
- array(
78
- 'label' => 'Address Region',
79
- 'id' => 'saswp_review_schema_region'.$post_fix,
80
- 'type' => 'text',
81
- 'default' => '',
82
- 'attributes' => array(
83
- 'placeholder' => 'Address Region'
84
- )
85
- ),
86
- array(
87
- 'label' => 'Postal Code',
88
- 'id' => 'saswp_review_schema_postal_code'.$post_fix,
89
- 'type' => 'text',
90
- 'default' => '',
91
- 'attributes' => array(
92
- 'placeholder' => 'Postal Code'
93
- )
94
- ),
95
- array(
96
- 'label' => 'Address Country',
97
- 'id' => 'saswp_review_schema_country'.$post_fix,
98
- 'type' => 'text',
99
- 'default' => '',
100
- 'attributes' => array(
101
- 'placeholder' => 'Country'
102
- )
103
- ),
104
- array(
105
- 'label' => 'Telephone',
106
- 'id' => 'saswp_review_schema_telephone'.$post_fix,
107
- 'type' => 'text',
108
- 'default' => '',
109
- 'attributes' => array(
110
- 'placeholder' => '123456789'
111
- )
112
- ),
113
-
114
- );
115
-
116
- switch ($item) {
117
-
118
- case 'Article':
119
-
120
- $reviewed_field = array();
121
-
122
- break;
123
- case 'Adultentertainment':
124
-
125
- $reviewed_field;
126
-
127
- break;
128
- case 'Blog':
129
-
130
- $reviewed_field = array(
131
- array(
132
- 'label' => 'Name',
133
- 'id' => 'saswp_review_schema_name'.$post_fix,
134
- 'type' => 'text',
135
- 'default' => $site_name = get_bloginfo()
136
- ),
137
- array(
138
- 'label' => 'Url',
139
- 'id' => 'saswp_review_schema_url'.$post_fix,
140
- 'type' => 'text',
141
- 'default' => get_site_url()
142
- )
143
- );
144
-
145
- break;
146
- case 'Book':
147
-
148
- $reviewed_field = array(
149
- array(
150
- 'label' => 'Name',
151
- 'id' => 'saswp_review_schema_name'.$post_fix,
152
- 'type' => 'text',
153
- 'default' => '',
154
- 'attributes' => array(
155
- 'placeholder' => 'Name'
156
- )
157
- ),
158
- array(
159
- 'label' => 'Author',
160
- 'id' => 'saswp_review_schema_author'.$post_fix,
161
- 'type' => 'text',
162
- 'default' => '',
163
- 'attributes' => array(
164
- 'placeholder' => 'Author'
165
- )
166
- ),
167
- array(
168
- 'label' => 'ISBN',
169
- 'id' => 'saswp_review_schema_isbn'.$post_fix,
170
- 'type' => 'text',
171
- 'default' => '',
172
- 'attributes' => array(
173
- 'placeholder' => 'ISBN'
174
- )
175
- ),
176
- array(
177
- 'label' => 'URL',
178
- 'id' => 'saswp_review_schema_author_sameas'.$post_fix,
179
- 'type' => 'text',
180
- 'default' => '',
181
- 'attributes' => array(
182
- 'placeholder' => 'URL'
183
- )
184
- ),
185
- array(
186
- 'label' => 'Review Body',
187
- 'id' => 'saswp_review_schema_description'.$post_fix,
188
- 'type' => 'textarea',
189
- 'default' => '',
190
- 'attributes' => array(
191
- 'placeholder' => 'Review Body'
192
- )
193
- )
194
-
195
- );
196
-
197
- break;
198
- case 'casino':
199
-
200
- $reviewed_field = $reviewed_field;
201
-
202
- break;
203
- case 'Diet':
204
-
205
- $reviewed_field = array();
206
-
207
- break;
208
- case 'Episode':
209
-
210
- $reviewed_field = array();
211
-
212
- break;
213
- case 'ExercisePlan':
214
- $reviewed_field = array();
215
- break;
216
- case 'Game':
217
- $reviewed_field = array();
218
- break;
219
- case 'Movie':
220
- $reviewed_field = array(
221
- array(
222
- 'label' => 'Name',
223
- 'id' => 'saswp_review_schema_name'.$post_fix,
224
- 'type' => 'text',
225
- 'default' => '',
226
- 'attributes' => array(
227
- 'placeholder' => 'Name'
228
- )
229
- ),
230
- array(
231
- 'label' => 'Date Created',
232
- 'id' => 'saswp_review_schema_date_created'.$post_fix,
233
- 'type' => 'text',
234
- 'default' => '',
235
- 'attributes' => array(
236
- 'placeholder' => '2017-05-17'
237
- )
238
- ),
239
- array(
240
- 'label' => 'Image',
241
- 'id' => 'saswp_review_schema_image'.$post_fix,
242
- 'type' => 'media',
243
- 'default' => '',
244
- 'attributes' => array(
245
- 'placeholder' => 'Image'
246
- )
247
- ),
248
- array(
249
- 'label' => 'Director',
250
- 'id' => 'saswp_review_schema_director'.$post_fix,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  'type' => 'text',
252
  'default' => '',
253
  'attributes' => array(
254
- 'placeholder' => 'Director'
255
- )
256
- ),
257
- array(
258
- 'label' => 'URL',
259
- 'id' => 'saswp_review_schema_itemreviewed_sameas'.$post_fix,
260
  'type' => 'text',
261
  'default' => '',
262
  'attributes' => array(
263
- 'placeholder' => 'URL'
264
- )
265
- ),
266
- array(
267
- 'label' => 'Review Body',
268
- 'id' => 'saswp_review_schema_description'.$post_fix,
269
- 'type' => 'textarea',
270
- 'default' => '',
271
- 'attributes' => array(
272
- 'placeholder' => 'Review Body'
273
- )
274
- )
275
-
276
- );
277
- break;
278
- case 'MusicPlaylist':
279
- $reviewed_field = array();
280
- break;
281
- case 'MusicRecording':
282
- $reviewed_field = array();
283
- break;
284
- case 'Photograph':
285
- $reviewed_field = array();
286
- break;
287
- case 'Recipe':
288
- $reviewed_field = array();
289
- break;
290
- case 'Restaurant':
291
- $reviewed_field[] = array(
292
- 'label' => 'Serves Cuisine',
293
- 'id' => 'saswp_review_schema_servescuisine'.$post_fix,
294
- 'type' => 'text',
295
- 'default' => '',
296
- 'attributes' => array(
297
- 'placeholder' => 'Serves Cuisine'
298
- )
299
- );
300
- $reviewed_field[] = array(
301
- 'label' => 'Menu',
302
- 'id' => 'saswp_review_schema_menu'.$post_fix,
303
- 'type' => 'text',
304
- 'default' => '',
305
- 'attributes' => array(
306
- 'placeholder' => 'https://example.com/menu'
307
- )
308
- );
309
- break;
310
- case 'Series':
311
- $reviewed_field = array();
312
- break;
313
- case 'SoftwareApplication':
314
- $reviewed_field = array();
315
- break;
316
- case 'VisualArtwork':
317
- $reviewed_field = array();
318
- break;
319
- case 'WebPage':
320
- $reviewed_field = array();
321
- break;
322
- case 'WebSite':
323
- $reviewed_field = array(
324
- array(
325
- 'label' => 'Name',
326
- 'id' => 'saswp_review_schema_name'.$post_fix,
327
- 'type' => 'text',
328
- 'default' => $site_name = get_bloginfo()
329
- ),
330
- array(
331
- 'label' => 'Url',
332
- 'id' => 'saswp_review_schema_url'.$post_fix,
333
- 'type' => 'text',
334
- 'default' => get_site_url()
335
- )
336
- );
337
- break;
338
-
339
- default:
340
- break;
341
- }
342
-
343
- return $reviewed_field;
344
-
345
- }
346
-
347
- add_action( 'wp_ajax_saswp_get_item_reviewed_fields', 'saswp_get_item_reviewed_fields' ) ;
348
-
349
- function saswp_get_item_reviewed_fields(){
350
-
351
- if ( ! isset( $_GET['saswp_security_nonce'] ) ){
352
- return;
353
- }
354
- if ( !wp_verify_nonce( $_GET['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
355
- return;
356
- }
357
-
358
- $post_specific = '';
359
- $output = '';
360
- $item = sanitize_text_field($_GET['item']);
361
- $schema_id = sanitize_text_field($_GET['schema_id']);
362
- $post_id = sanitize_text_field($_GET['post_id']);
363
-
364
- if(isset($_GET['post_specific'])){
365
- $post_specific = sanitize_text_field($_GET['post_specific']);
366
  }
367
-
368
- $meta_fields = saswp_item_reviewed_fields($item, $post_specific, $schema_id);
369
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
 
371
- foreach ($meta_fields as $meta_field){
372
-
373
-
374
- $attributes ='';
375
-
376
- if(isset($meta_field['attributes'])){
377
-
378
- foreach ($meta_field['attributes'] as $key => $attr ){
379
-
380
- $attributes .=''.$key.'="'.$attr.'"';
381
-
382
- }
383
- }
384
-
385
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  if($post_specific == 1){
387
-
388
- $meta_value = get_post_meta( $post_id, $meta_field['id'], true );
389
-
390
-
391
- if(!$meta_value){
392
-
393
- $schema_data = get_post_meta( $schema_id, 'saswp_review_schema_details', true );
394
-
395
- $meta_value = $schema_data[chop($meta_field['id'], '_'.$schema_id)];
396
- }
397
-
398
  }else{
399
-
400
- $schema_data = get_post_meta( $schema_id, 'saswp_review_schema_details', true );
401
- $meta_value = $schema_data[$meta_field['id']];
402
-
403
  }
404
-
405
-
406
-
407
-
408
- if ( empty( $meta_value ) ) {
409
-
410
- $meta_value = $meta_field['default'];
411
-
412
- }
413
-
414
- switch ($meta_field['type']) {
415
-
416
- case 'media':
417
-
418
- $media_value = array();
419
- $media_key = $meta_field['id'].'_detail';
420
-
421
- if($post_specific == 1){
422
-
423
- $media_value_meta = get_post_meta( $post_id, $media_key, true );
424
-
425
- if(empty($media_value_meta)){
426
-
427
- $media_key = chop($meta_field['id'], '_'.$schema_id).'_detail';
428
- $media_value_meta = $schema_data[$media_key];
429
-
430
- }
431
-
432
- }else{
433
-
434
- $media_value_meta = $schema_data[$media_key];
435
-
436
- }
437
-
438
-
439
- if(!empty($media_value_meta)){
440
-
441
- $media_value = $media_value_meta;
442
-
443
- }
444
-
445
- $input = sprintf(
446
- ' <input style="width: 80%%" id="%s" name="%s" type="text" value="%s" readonly>'
447
- . '<input type="hidden" data-id="'.esc_attr($meta_field['id']).'_height" class="upload-height" name="'.esc_attr($meta_field['id']).'_height" id="'.esc_attr($meta_field['id']).'_height" value="'.$media_value['height'].'">'
448
- . '<input type="hidden" data-id="'.esc_attr($meta_field['id']).'_width" class="upload-width" name="'.esc_attr($meta_field['id']).'_width" id="'.esc_attr($meta_field['id']).'_width" value="'.$media_value['width'].'">'
449
- . '<input type="hidden" data-id="'.esc_attr($meta_field['id']).'_thumbnail" class="upload-thumbnail" name="'.esc_attr($meta_field['id']).'_thumbnail" id="'.esc_attr($meta_field['id']).'_thumbnail" value="'.$media_value['thumbnail'].'">'
450
- . '<input data-id="media" style="width: 19%%" class="button" id="%s_button" name="%s_button" type="button" value="Upload" />',
451
- $meta_field['id'],
452
- $meta_field['id'],
453
- $meta_value,
454
- $meta_field['id'],
455
- $meta_field['id']
456
- );
457
-
458
-
459
- break;
460
-
461
- case 'textarea':
462
- $input = sprintf(
463
- '<textarea %s style="width: 100%%" id="%s" name="%s" rows="5">%s</textarea>',
464
- $attributes,
465
- esc_attr($meta_field['id']),
466
- esc_attr($meta_field['id']),
467
- $meta_value
468
- );
469
- break;
470
-
471
- default:
472
-
473
- $input = sprintf(
474
- '<input %s %s id="%s" name="%s" type="%s" value="%s">',
475
- $attributes,
476
- $meta_field['type'] !== 'color' ? 'style="width: 100%"' : '',
477
- esc_attr(saswp_remove_warnings($meta_field, 'id', 'saswp_string')),
478
- esc_attr(saswp_remove_warnings($meta_field, 'id', 'saswp_string')),
479
- esc_attr(saswp_remove_warnings($meta_field, 'type', 'saswp_string')),
480
- $meta_value
481
- );
482
-
483
- break;
484
-
485
- }
486
-
487
- $output .= '<tr class="saswp-review-tr">'
488
- . '<td>'.esc_html__($meta_field['label'], 'schema-and-structured-data-for-wp' ).'</td>'
489
- . '<td>'.$input.'</td>'
490
- . '</tr>';
491
-
492
- }
493
-
494
- echo $output;
495
-
496
- wp_die();
497
- }
498
-
499
- add_action( 'add_meta_boxes', 'saswp_schema_type_add_meta_box' ) ;
500
-
501
- function saswp_schema_type_add_meta_box() {
502
-
503
- add_meta_box(
504
- 'schema_type',
505
- esc_html__( 'Schema Type', 'schema-and-structured-data-for-wp' ),
506
- 'saswp_schema_type_meta_box_callback',
507
- 'saswp',
508
- 'advanced',
509
- 'high'
510
- );
511
-
512
- }
513
-
514
- function saswp_schema_type_get_meta( $value ) {
515
-
516
- global $post;
517
-
518
- $field = get_post_meta( $post->ID, $value, true );
519
-
520
- if ( ! empty( $field ) ) {
521
- return is_array( $field ) ? stripslashes_deep( $field ) : stripslashes( wp_kses_decode_entities( $field ) );
522
- } else {
523
- return false;
524
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
525
  }
526
-
527
- function saswp_schema_type_meta_box_callback( $post) {
528
-
529
- wp_nonce_field( 'saswp_schema_type_nonce', 'saswp_schema_type_nonce' );
530
-
531
- $style_business_type = '';
532
- $style_business_name = '';
533
- $style_service_name = '';
534
- $style_review_name = '';
535
- $business_name = '';
536
- $schema_type = '';
537
- $business_type = '';
538
- $custom_logo_id = '';
539
- $speakable = '';
540
-
541
- $business_details = array();
542
- $logo = array();
543
- $service_details = array();
544
- $review_details = array();
545
- $product_details = array();
546
- $event_details = array();
547
-
548
- if($post){
549
-
550
- $schema_type = esc_sql ( get_post_meta($post->ID, 'schema_type', true) );
551
-
552
- switch ($schema_type) {
553
-
554
- case 'AudioObject':
555
-
556
- $audio_details = esc_sql ( get_post_meta($post->ID, 'saswp_audio_schema_details', true) );
557
 
558
- break;
559
-
560
- case 'SoftwareApplication':
561
-
562
- $software_details = esc_sql ( get_post_meta($post->ID, 'saswp_software_schema_details', true) );
563
-
564
- break;
565
-
566
- case 'local_business':
567
-
568
- $business_type = esc_sql ( get_post_meta($post->ID, 'saswp_business_type', true) );
569
- $business_name = esc_sql ( get_post_meta($post->ID, 'saswp_business_name', true) );
570
- $business_details = esc_sql ( get_post_meta($post->ID, 'saswp_local_business_details', true) );
571
- $dayoftheweek = get_post_meta($post->ID, 'saswp_dayofweek', true);
572
-
573
- break;
574
-
575
- case 'Product':
576
-
577
- $product_details = esc_sql ( get_post_meta($post->ID, 'saswp_product_schema_details', true) );
578
 
579
- break;
580
-
581
- case 'Service':
582
-
583
- $service_details = esc_sql ( get_post_meta($post->ID, 'saswp_service_schema_details', true) );
584
 
585
- break;
586
-
587
- case 'Review':
588
 
589
- $review_details = esc_sql ( get_post_meta($post->ID, 'saswp_review_schema_details', true) );
590
-
591
- break;
592
-
593
- case 'Event':
 
 
 
 
 
 
594
 
595
- $event_details = esc_sql ( get_post_meta($post->ID, 'saswp_event_schema_details', true) );
596
-
597
- break;
 
 
 
598
 
599
- default:
600
-
601
- $speakable = esc_sql ( get_post_meta($post->ID, 'saswp_enable_speakable_schema', true) );
602
-
603
- break;
604
- }
605
-
606
- $custom_logo_id = get_theme_mod( 'custom_logo' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
 
608
- if($custom_logo_id){
609
-
610
- $logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
 
611
 
612
- }
 
 
 
613
 
614
- if($schema_type != 'local_business'){
615
-
616
- $style_business_type = 'style="display:none"';
617
- $style_business_name = 'style="display:none"';
618
-
619
- }
620
- }
621
-
622
- $provider_type = array(
623
- 'Airline' => 'Airline',
624
- 'Corporation' => 'Corporation',
625
- 'EducationalOrganization' => 'Educational Organization',
626
- 'GovernmentOrganization' => 'Government Organization',
627
- 'LocalBusiness' => 'Local Business',
628
- 'MedicalOrganization' => 'Medical Organization',
629
- 'NGO' => 'NGO',
630
- 'PerformingGroup' => 'Performing Group',
631
- 'SportsOrganization' => 'Sports Organization',
632
- );
633
-
634
- $availability = array(
635
- 'InStock' => 'In Stock',
636
- 'OutOfStock' => 'Out Of Stock',
637
- 'Discontinued' => 'Discontinued',
638
- 'PreOrder' => 'Pre Order',
639
- );
640
-
641
- $item_condition = array(
642
- 'NewCondition' => 'New',
643
- 'UsedCondition' => 'Used',
644
- 'RefurbishedCondition' => 'Refurbished',
645
- 'DamagedCondition' => 'Damaged',
646
- );
647
-
648
- $item_reviewed = array(
649
- 'Article' => 'Article',
650
- 'Adultentertainment' => 'Adult Entertainment',
651
- 'Blog' => 'Blog',
652
- 'Book' => 'Book',
653
- 'Casino' => 'Casino',
654
- 'Diet' => 'Diet',
655
- 'Episode' => 'Episode',
656
- 'ExercisePlan' => 'Exercise Plan',
657
- 'Game' => 'Game',
658
- 'Movie' => 'Movie',
659
- 'MusicPlaylist' => 'Music Playlist',
660
- 'MusicRecording' => 'MusicRecording',
661
- 'Photograph' => 'Photograph',
662
- 'Restaurant' => 'Restaurant',
663
- 'Series' => 'Series',
664
- 'VisualArtwork' => 'Visual Artwork',
665
- 'WebPage' => 'WebPage',
666
- 'WebSite' => 'WebSite',
667
- );
668
 
669
- $all_schema_array = array(
670
-
671
- 'Accommodation' => array(
672
- 'Apartment' => 'Apartment',
673
- 'House' => 'House',
674
- 'SingleFamilyResidence' => 'SingleFamilyResidence',
675
- ),
676
- 'CreativeWork' => array(
677
- 'Article' => 'Article',
678
- 'Blogposting' => 'Blogposting',
679
- 'Course' => 'Course',
680
- 'DiscussionForumPosting' => 'DiscussionForumPosting',
681
- 'HowTo' => 'HowTo',
682
- 'NewsArticle' => 'NewsArticle',
683
- 'qanda' => 'Q&A',
684
- 'Review' => 'Review',
685
- 'Recipe' => 'Recipe',
686
- 'TVSeries' => 'TVSeries',
687
- 'SoftwareApplication' => 'SoftwareApplication',
688
- 'TechArticle' => 'TechArticle',
689
- 'WebPage' => 'WebPage'
690
- ),
691
- 'Event' => array(
692
- 'Event' => 'Event',
693
- ),
694
- 'Game' => array(
695
- 'VideoGame' => 'VideoGame'
696
- ),
697
- 'Intangible' => array(
698
- 'JobPosting' => 'JobPosting',
699
- 'Service' => 'Service',
700
- 'Trip' => 'Trip',
701
-
702
- ),
703
- 'Media' => array(
704
- 'AudioObject' => 'AudioObject',
705
- 'VideoObject' => 'VideoObject'
706
- ),
707
- 'Medical' => array(
708
- 'MedicalCondition' => 'MedicalCondition',
709
- ),
710
- 'Organization' => array(
711
- 'local_business' => 'Local Business',
712
- ),
713
- 'Product' => array(
714
- 'Product' => 'Product',
715
- ),
716
- 'Place' => array(
717
- 'TouristAttraction' => 'TouristAttraction',
718
- 'TouristDestination' => 'TouristDestination',
719
- 'LandmarksOrHistoricalBuildings' => 'LandmarksOrHistoricalBuildings',
720
- ),
721
- 'PlaceOfWorship' => array(
722
- 'HinduTemple' => 'HinduTemple',
723
- 'Church' => 'Church',
724
- 'Mosque' => 'Mosque',
725
- ),
726
- 'Thing' => array(
727
- 'Person' => 'Person',
728
- )
729
- );
730
- $all_business_type = array(
731
- 'animalshelter' => 'Animal Shelter',
732
- 'automotivebusiness' => 'Automotive Business',
733
- 'childcare' => 'ChildCare',
734
- 'dentist' => 'Dentist',
735
- 'drycleaningorlaundry' => 'Dry Cleaning Or Laundry',
736
- 'emergencyservice' => 'Emergency Service',
737
- 'employmentagency' => 'Employment Agency',
738
- 'entertainmentbusiness' => 'Entertainment Business',
739
- 'financialservice' => 'Financial Service',
740
- 'foodestablishment' => 'Food Establishment',
741
- 'governmentoffice' => 'Government Office',
742
- 'healthandbeautybusiness' => 'Health And Beauty Business',
743
- 'homeandconstructionbusiness' => 'Home And Construction Business',
744
- 'internetcafe' => 'Internet Cafe',
745
- 'legalservice' => 'Legal Service',
746
- 'library' => 'Library',
747
- 'lodgingbusiness' => 'Lodging Business',
748
- 'professionalservice' => 'Professional Service',
749
- 'radiostation' => 'Radio Station',
750
- 'realestateagent' => 'Real Estate Agent',
751
- 'recyclingcenter' => 'Recycling Center',
752
- 'selfstorage' => 'Self Storage',
753
- 'shoppingcenter' => 'Shopping Center',
754
- 'sportsactivitylocation' => 'Sports Activity Location',
755
- 'store' => 'Store',
756
- 'televisionstation' => 'Television Station',
757
- 'touristinformationcenter' => 'Tourist Information Center',
758
- 'travelagency' => 'Travel Agency',
759
- );
760
 
761
- $all_automotive_array = array(
762
- 'autobodyshop' => 'Auto Body Shop',
763
- 'autodealer' => 'Auto Dealer',
764
- 'autopartsstore' => 'Auto Parts Store',
765
- 'autorental' => 'Auto Rental',
766
- 'autorepair' => 'Auto Repair',
767
- 'autowash' => 'Auto Wash',
768
- 'gasstation' => 'Gas Station',
769
- 'motorcycledealer' => 'Motorcycle Dealer',
770
- 'motorcyclerepair' => 'Motorcycle Repair'
771
- );
772
-
773
- $all_emergency_array = array(
774
- 'firestation' => 'Fire Station',
775
- 'hospital' => 'Hospital',
776
- 'policestation' => 'Police Station',
777
- );
778
- $all_entertainment_array = array(
779
- 'adultentertainment' => 'Adult Entertainment',
780
- 'amusementpark' => 'Amusement Park',
781
- 'artgallery' => 'Art Gallery',
782
- 'casino' => 'Casino',
783
- 'comedyclub' => 'Comedy Club',
784
- 'movietheater' => 'Movie Theater',
785
- 'nightclub' => 'Night Club',
786
-
787
- );
788
- $all_financial_array = array(
789
- 'accountingservice' => 'Accounting Service',
790
- 'automatedteller' => 'Automated Teller',
791
- 'bankorcredit_union' => 'Bank Or Credit Union',
792
- 'insuranceagency' => 'Insurance Agency',
793
-
794
- );
795
-
796
- $all_food_establishment_array = array(
797
- 'bakery' => 'Bakery',
798
- 'barorpub' => 'Bar Or Pub',
799
- 'brewery' => 'Brewery',
800
- 'cafeorcoffee_shop' => 'Cafe Or Coffee Shop',
801
- 'fastfoodrestaurant' => 'Fast Food Restaurant',
802
- 'icecreamshop' => 'Ice Cream Shop',
803
- 'restaurant' => 'Restaurant',
804
- 'winery' => 'Winery',
805
-
806
- );
807
- $all_health_and_beauty_array = array(
808
- 'beautysalon' => 'Beauty Salon',
809
- 'dayspa' => 'DaySpa',
810
- 'hairsalon' => 'Hair Salon',
811
- 'healthclub' => 'Health Club',
812
- 'nailsalon' => 'Nail Salon',
813
- 'tattooparlor' => 'Tattoo Parlor',
814
- );
815
-
816
- $all_home_and_construction_array = array(
817
- 'electrician' => 'Electrician',
818
- 'generalcontractor' => 'General Contractor',
819
- 'hvacbusiness' => 'HVAC Business',
820
- 'locksmith' => 'Locksmith',
821
- 'movingcompany' => 'Moving Company',
822
- 'plumber' => 'Plumber',
823
- 'roofingcontractor' => 'Roofing Contractor',
824
- 'housepainter' => 'House Painter',
825
- );
826
-
827
- $all_legal_service_array = array(
828
- 'attorney' => 'Attorney',
829
- 'notary' => 'Notary',
830
- );
831
-
832
- $all_lodging_array = array(
833
- 'bedandbreakfast' => 'Bed And Breakfast',
834
- 'campground' => 'Campground',
835
- 'hostel' => 'Hostel',
836
- 'hotel' => 'Hotel',
837
- 'motel' => 'Motel',
838
- 'resort' => 'Resort',
839
- );
840
-
841
- $all_sports_activity_location = array(
842
- 'bowlingalley' => 'Bowling Alley',
843
- 'exercisegym' => 'Exercise Gym',
844
- 'golfcourse' => 'Golf Course',
845
- 'healthclub' => 'Health Club',
846
- 'publicswimming_pool' => 'Public Swimming Pool',
847
- 'skiresort' => 'Ski Resort',
848
- 'sportsclub' => 'Sports Club',
849
- 'stadiumorarena' => 'Stadium Or Arena',
850
- 'tenniscomplex' => 'Tennis Complex'
851
- );
852
- $all_store = array(
853
- 'autopartsstore' => 'Auto Parts Store',
854
- 'bikestore' => 'Bike Store',
855
- 'bookstore' => 'Book Store',
856
- 'clothingstore' => 'Clothing Store',
857
- 'computerstore' => 'Computer Store',
858
- 'conveniencestore' => 'Convenience Store',
859
- 'departmentstore' => 'Department Store',
860
- 'electronicsstore' => 'Electronics Store',
861
- 'florist' => 'Florist',
862
- 'furniturestore' => 'Furniture Store',
863
- 'gardenstore' => 'Garden Store',
864
- 'grocerystore' => 'Grocery Store',
865
- 'hardwarestore' => 'Hardware Store',
866
- 'hobbyshop' => 'Hobby Shop',
867
- 'homegoodsstore' => 'HomeGoods Store',
868
- 'jewelrystore' => 'Jewelry Store',
869
- 'liquorstore' => 'Liquor Store',
870
- 'mensclothingstore' => 'Mens Clothing Store',
871
- 'mobilephonestore' => 'Mobile Phone Store',
872
- 'movierentalstore' => 'Movie Rental Store',
873
- 'musicstore' => 'Music Store',
874
- 'officeequipmentstore' => 'Office Equipment Store',
875
- 'outletstore' => 'Outlet Store',
876
- 'pawnshop' => 'Pawn Shop',
877
- 'petstore' => 'Pet Store',
878
- 'shoestore' => 'Shoe Store',
879
- 'sportinggoodsstore' => 'Sporting Goods Store',
880
- 'tireshop' => 'Tire Shop',
881
- 'toystore' => 'Toy Store',
882
- 'wholesalestore' => 'Wholesale Store'
883
- );
884
- ?>
885
- <div class="misc-pub-section">
886
- <table class="option-table-class saswp-option-table-class">
887
- <tr>
888
- <td><label for="schema_type"><?php echo esc_html__( 'Schema Type' ,'schema-and-structured-data-for-wp');?></label></td>
889
- <td><select class="saswp-schame-type-select" id="schema_type" name="schema_type">
890
- <?php
891
-
892
- if(!empty($all_schema_array)){
893
-
894
- foreach ($all_schema_array as $parent_type => $type) {
895
-
896
- $option_html = '';
897
-
898
- foreach($type as $key => $value){
899
- $sel = '';
900
- if($schema_type == $key){
901
- $sel = 'selected';
902
- }
903
- $option_html.= "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
904
-
905
- }
906
-
907
- echo '<optgroup label="'.$parent_type.'">';
908
- echo $option_html;
909
- echo '</optgroup>';
910
- }
911
-
912
- }
913
- ?>
914
- </select>
915
-
916
- <?php if($schema_type == 'qanda') { ?>
917
- <span class="saswp-schem-type-note"><?php echo esc_html__('Note: Currently supported with DW Question & Answer', 'schema-and-structured-data-for-wp' ); ?> <a target="_blank" href="https://wordpress.org/plugins/dw-question-answer/"><?php echo esc_html__('Link', 'schema-and-structured-data-for-wp' ); ?></a></span>
918
- <?php }else{ ?>
919
- <span class="saswp-schem-type-note saswp_hide"><?php echo esc_html__('Note: Currently supported with DW Question & Answer', 'schema-and-structured-data-for-wp' ); ?> <a target="_blank" href="https://wordpress.org/plugins/dw-question-answer/"><?php echo esc_html__('Link', 'schema-and-structured-data-for-wp' ); ?></a></span>
920
- <?php } ?>
921
-
922
- </td>
923
- </tr>
924
- <tr class="saswp-business-type-tr" <?php echo $style_business_type; ?>>
925
- <td>
926
- <?php echo esc_html__('Business Type', 'schema-and-structured-data-for-wp' ); ?>
927
- </td>
928
- <td>
929
- <select id="saswp_business_type" name="saswp_business_type">
930
- <?php
931
-
932
-
933
- foreach ($all_business_type as $key => $value) {
934
- $sel = '';
935
- if($business_type==$key){
936
- $sel = 'selected';
937
- }
938
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
939
- }
940
- ?>
941
- </select>
942
- </td>
943
- </tr>
944
- <tr class="saswp-automotivebusiness-tr" <?php if(!array_key_exists($business_name, $all_automotive_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
945
- <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
946
- <td>
947
- <select id="saswp_automotive" name="saswp_business_name">
948
- <?php
949
-
950
- foreach ($all_automotive_array as $key => $value) {
951
- $sel = '';
952
- if($business_name==$key){
953
- $sel = 'selected';
954
- }
955
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
956
- }
957
- ?>
958
- </select>
959
- </td>
960
-
961
- </tr>
962
- <tr class="saswp-emergencyservice-tr" <?php if(!array_key_exists($business_name, $all_emergency_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
963
- <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
964
- <td>
965
- <select id="saswp_emergency_service" name="saswp_business_name">
966
- <?php
967
-
968
- foreach ($all_emergency_array as $key => $value) {
969
- $sel = '';
970
- if($business_name==$key){
971
- $sel = 'selected';
972
- }
973
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
974
- }
975
- ?>
976
- </select>
977
- </td>
978
- </tr>
979
- <tr class="saswp-entertainmentbusiness-tr" <?php if(!array_key_exists($business_name, $all_entertainment_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
980
- <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
981
- <td>
982
- <select id="saswp_entertainment" name="saswp_business_name">
983
- <?php
984
-
985
-
986
- foreach ($all_entertainment_array as $key => $value) {
987
- $sel = '';
988
- if($business_name == $key){
989
- $sel = 'selected';
990
- }
991
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
992
- }
993
- ?>
994
- </select>
995
- </td>
996
- </tr>
997
- <tr class="saswp-financialservice-tr" <?php if(!array_key_exists($business_name, $all_financial_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
998
- <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
999
- <td>
1000
- <select id="saswp_financial_service" name="saswp_business_name">
1001
- <?php
1002
-
1003
-
1004
- foreach ($all_financial_array as $key => $value) {
1005
- $sel = '';
1006
- if($business_name == $key){
1007
- $sel = 'selected';
1008
- }
1009
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1010
- }
1011
- ?>
1012
- </select>
1013
- </td>
1014
- </tr>
1015
- <tr class="saswp-foodestablishment-tr" <?php if(!array_key_exists($business_name, $all_food_establishment_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1016
- <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1017
- <td>
1018
- <select id="saswp_food_establishment" name="saswp_business_name">
1019
- <?php
1020
-
1021
- foreach ($all_food_establishment_array as $key => $value) {
1022
- $sel = '';
1023
- if($business_name==$key){
1024
- $sel = 'selected';
1025
- }
1026
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1027
- }
1028
- ?>
1029
- </select>
1030
- </td>
1031
- </tr>
1032
- <tr class="saswp-healthandbeautybusiness-tr" <?php if(!array_key_exists($business_name, $all_health_and_beauty_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1033
- <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1034
- <td>
1035
- <select id="saswp_health_and_beauty" name="saswp_business_name">
1036
- <?php
1037
-
1038
-
1039
- foreach ($all_health_and_beauty_array as $key => $value) {
1040
- $sel = '';
1041
- if($business_name==$key){
1042
- $sel = 'selected';
1043
- }
1044
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1045
- }
1046
- ?>
1047
- </select>
1048
- </td>
1049
- </tr>
1050
- <tr class="saswp-homeandconstructionbusiness-tr" <?php if(!array_key_exists($business_name, $all_home_and_construction_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1051
- <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1052
- <td>
1053
- <select id="saswp_home_and_construction" name="saswp_business_name">
1054
- <?php
1055
-
1056
- foreach ($all_home_and_construction_array as $key => $value) {
1057
- $sel = '';
1058
- if($business_name==$key){
1059
- $sel = 'selected';
1060
- }
1061
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1062
- }
1063
- ?>
1064
- </select>
1065
- </td>
1066
- </tr>
1067
- <tr class="saswp-legalservice-tr" <?php if(!array_key_exists($business_name, $all_legal_service_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1068
- <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1069
- <td>
1070
- <select id="saswp_legal_service" name="saswp_business_name">
1071
- <?php
1072
-
1073
- foreach ($all_legal_service_array as $key => $value) {
1074
- $sel = '';
1075
- if($business_name==$key){
1076
- $sel = 'selected';
1077
- }
1078
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1079
- }
1080
- ?>
1081
- </select>
1082
- </td>
1083
- </tr>
1084
- <tr class="saswp-lodgingbusiness-tr" <?php if(!array_key_exists($business_name, $all_lodging_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1085
- <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1086
- <td>
1087
- <select id="saswp_lodging" name="saswp_business_name">
1088
- <?php
1089
-
1090
- foreach ($all_lodging_array as $key => $value) {
1091
- $sel = '';
1092
- if($business_name==$key){
1093
- $sel = 'selected';
1094
- }
1095
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1096
- }
1097
- ?>
1098
- </select>
1099
- </td>
1100
- </tr>
1101
- <tr class="saswp-sportsactivitylocation-tr" <?php if(!array_key_exists($business_name, $all_sports_activity_location)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1102
- <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1103
- <td>
1104
- <select id="saswp_sports_activity_location" name="saswp_business_name">
1105
- <?php
1106
-
1107
- foreach ($all_sports_activity_location as $key => $value) {
1108
- $sel = '';
1109
- if($business_name==$key){
1110
- $sel = 'selected';
1111
- }
1112
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1113
- }
1114
- ?>
1115
- </select>
1116
- </td>
1117
- </tr>
1118
- <tr class="saswp-store-tr" <?php if(!array_key_exists($business_name, $all_store)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1119
- <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1120
- <td>
1121
- <select id="saswp_store" name="saswp_business_name">
1122
- <?php
1123
-
1124
-
1125
- foreach ($all_store as $key => $value) {
1126
- $sel = '';
1127
- if($business_name==$key){
1128
- $sel = 'selected';
1129
- }
1130
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1131
- }
1132
- ?>
1133
- </select>
1134
- </td>
1135
- </tr>
1136
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1137
- <td><?php echo esc_html__('Business Name', 'schema-and-structured-data-for-wp' ); ?></td>
1138
- <td><input value="<?php if(isset($business_details['local_business_name'])) { echo esc_attr($business_details['local_business_name']); } ?>" type="text" name="local_business_name" placeholder="<?php echo esc_html__('Business Name', 'schema-and-structured-data-for-wp' ); ?>"></td>
1139
- </tr>
1140
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1141
- <td><?php echo esc_html__('Street Address', 'schema-and-structured-data-for-wp' ); ?></td>
1142
- <td><input value="<?php if(isset($business_details['local_street_address'])) { echo esc_attr($business_details['local_street_address']); } ?>" type="text" name="local_street_address" placeholder="<?php echo esc_html__('Street Address', 'schema-and-structured-data-for-wp' ); ?>"></td>
1143
- </tr>
1144
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1145
- <td><?php echo esc_html__('City', 'schema-and-structured-data-for-wp' ); ?></td>
1146
- <td><input value="<?php if(isset($business_details['local_city'])){ echo esc_attr($business_details['local_city']);} ?>" type="text" name="local_city" placeholder="<?php echo esc_html__('City', 'schema-and-structured-data-for-wp' ); ?>"></td>
1147
- </tr>
1148
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1149
- <td><?php echo esc_html__('State', 'schema-and-structured-data-for-wp' ); ?></td>
1150
- <td><input value="<?php if(isset($business_details['local_state'])){echo esc_attr($business_details['local_state']);} ?>" type="text" name="local_state" placeholder="<?php echo esc_html__('State', 'schema-and-structured-data-for-wp' ); ?>"></td>
1151
- </tr>
1152
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1153
- <td><?php echo esc_html__('Postal Code', 'schema-and-structured-data-for-wp' ); ?></td>
1154
- <td><input value="<?php if(isset($business_details['local_postal_code'])) {echo esc_attr($business_details['local_postal_code']); } ?>" type="text" name="local_postal_code" placeholder="<?php echo esc_html__('Postal Code', 'schema-and-structured-data-for-wp' ); ?>"></td>
1155
- </tr>
1156
-
1157
-
1158
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1159
- <td><?php echo esc_html__('Latitude', 'schema-and-structured-data-for-wp' ); ?></td>
1160
- <td><input value="<?php if(isset($business_details['local_latitude'])) {echo esc_attr($business_details['local_latitude']); } ?>" type="text" name="local_latitude" placeholder="<?php echo esc_html__('40.761293', 'schema-and-structured-data-for-wp' ); ?>"></td>
1161
- </tr>
1162
-
1163
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1164
- <td><?php echo esc_html__('Longitude', 'schema-and-structured-data-for-wp' ); ?></td>
1165
- <td><input value="<?php if(isset($business_details['local_longitude'])) {echo esc_attr($business_details['local_longitude']); } ?>" type="text" name="local_longitude" placeholder="<?php echo esc_html__('-73.982294', 'schema-and-structured-data-for-wp' ); ?>"></td>
1166
- </tr>
1167
-
1168
-
1169
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1170
- <td><?php echo esc_html__('Phone', 'schema-and-structured-data-for-wp' ); ?></td>
1171
- <td><input value="<?php if(isset($business_details['local_phone'])){echo esc_attr($business_details['local_phone']); } ?>" type="text" name="local_phone" placeholder="<?php echo esc_html__('Phone', 'schema-and-structured-data-for-wp' ); ?>"></td>
1172
- </tr>
1173
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1174
- <td><?php echo esc_html__('Website', 'schema-and-structured-data-for-wp' ); ?></td>
1175
- <td><input value="<?php if(isset($business_details['local_website'])){echo esc_attr($business_details['local_website']); }else{ echo site_url();} ?>" type="text" name="local_website" placeholder="<?php echo esc_html__('Website', 'schema-and-structured-data-for-wp' ); ?>"></td>
1176
- </tr>
1177
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1178
- <td><?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?></td>
1179
- <td style="display: flex; width: 97%">
1180
- <input value="<?php if(isset($business_details['local_business_logo'])) { echo esc_url($business_details['local_business_logo']['url']);} else { echo esc_url(saswp_remove_warnings($logo, 0, 'saswp_string')); } ?>" id="local_business_logo" type="text" name="local_business_logo[url]" placeholder="<?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?>" readonly="readonly" style="background: #FFF;">
1181
- <input value="<?php if(isset($business_details['local_business_logo'])) { echo esc_attr($business_details['local_business_logo']['id']);} else { echo esc_attr($custom_logo_id); }?>" data-id="local_business_logo_id" type="hidden" name="local_business_logo[id]">
1182
- <input value="<?php if(isset($business_details['local_business_logo'])) { echo esc_attr($business_details['local_business_logo']['width']);} else { echo esc_attr(saswp_remove_warnings($logo, 1, 'saswp_string')); } ?>" data-id="local_business_logo_width" type="hidden" name="local_business_logo[width]">
1183
- <input value="<?php if(isset($business_details['local_business_logo'])) { echo esc_attr($business_details['local_business_logo']['height']);} else { echo esc_attr(saswp_remove_warnings($logo, 2, 'saswp_string')); } ?>" data-id="local_business_logo_height" type="hidden" name="local_business_logo[height]">
1184
- <input data-id="media" class="button" id="local_business_logo_button" type="button" value="Upload"></td>
1185
- </tr>
1186
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1187
- <td><?php echo esc_html__('Operation Days', 'schema-and-structured-data-for-wp' ); ?></td>
1188
- <td>
1189
- <textarea id="saswp_dayofweek" placeholder="Mo-Sa 11:00-14:30 <?="\n"?>Mo-Th 17:00-21:30 <?="\n"?>Fr-Sa 17:00-22:00" rows="5" cols="70" name="saswp_dayofweek"><?php if(isset($dayoftheweek)){echo $dayoftheweek; } ?></textarea>
1190
- <p><?php echo esc_html__( 'Note: Enter days and time in given format', 'schema-and-structured-data-for-wp' ); ?></p>
1191
- </td>
1192
- </tr>
1193
-
1194
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1195
- <td><?php echo esc_html__('Price Range', 'schema-and-structured-data-for-wp' ); ?></td>
1196
- <td><input value="<?php if(isset($business_details['local_price_range'])){echo esc_attr($business_details['local_price_range']); } ?>" type="text" name="local_price_range" placeholder="<?php echo esc_html__('$10-$50 or $$$ ', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1197
- </tr>
1198
-
1199
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1200
- <td><?php echo esc_html__('Menu', 'schema-and-structured-data-for-wp' ); ?></td>
1201
- <td><input value="<?php if(isset($business_details['local_menu'])){echo esc_attr($business_details['local_menu']); } ?>" type="text" name="local_menu" placeholder="<?php echo esc_html__('http://www.example.com/menu', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1202
- </tr>
1203
-
1204
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1205
- <td><?php echo esc_html__('HasMap', 'schema-and-structured-data-for-wp' ); ?></td>
1206
- <td><input value="<?php if(isset($business_details['local_hasmap'])){echo esc_attr($business_details['local_hasmap']); } ?>" type="text" name="local_hasmap" placeholder="https://goo.gl/maps/tb9hzMLNp942" ></td>
1207
- </tr>
1208
-
1209
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1210
- <td><?php echo esc_html__('Serves Cuisine ', 'schema-and-structured-data-for-wp' ); ?></td>
1211
- <td><input value="<?php isset($business_details['local_serves_cuisine'])? esc_attr($business_details['local_serves_cuisine']): ''; ?>" type="text" name="local_serves_cuisine" placeholder="<?php echo esc_html__('American, Chinese', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1212
- </tr>
1213
-
1214
-
1215
- <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1216
- <td><?php echo esc_html__('Aggregate Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1217
- <td>
1218
- <input class="saswp-enable-rating-review-local_business" type="checkbox" name="local_enable_rating" value="1" <?php if(isset($business_details['local_enable_rating'])){echo 'checked'; }else{ echo ''; } ?>>
1219
- </td>
1220
- </tr>
1221
- <tr class="saswp-business-text-field-tr saswp-rating-review-local_business">
1222
- <td><?php echo esc_html__('Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1223
- <td><input value="<?php if(isset($business_details['local_rating'])){echo esc_attr($business_details['local_rating']); } ?>" type="text" name="local_rating" placeholder="<?php echo esc_html__('5.0', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1224
- </tr>
1225
- <tr class="saswp-business-text-field-tr saswp-rating-review-local_business" <?php echo $style_business_type; ?>>
1226
- <td><?php echo esc_html__('Number of Reviews', 'schema-and-structured-data-for-wp' ); ?></td>
1227
- <td><input value="<?php if(isset($business_details['local_review_count'])){echo esc_attr($business_details['local_review_count']); } ?>" type="text" name="local_review_count" placeholder="<?php echo esc_html__('10', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1228
- </tr>
1229
-
1230
- <!-- Service Schema type starts here -->
1231
-
1232
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1233
- <td><?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?></td>
1234
- <td><input value="<?php if(isset($service_details['saswp_service_schema_name'])){echo esc_attr($service_details['saswp_service_schema_name']); } ?>" type="text" name="saswp_service_schema_name" placeholder="<?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1235
- </tr>
1236
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1237
- <td><?php echo esc_html__('Service Type', 'schema-and-structured-data-for-wp' ); ?></td>
1238
- <td>
1239
- <input value="<?php if(isset($service_details['saswp_service_schema_type'])){echo esc_attr($service_details['saswp_service_schema_type']); } ?>" type="text" name="saswp_service_schema_type" placeholder="<?php echo esc_html__('Service Type', 'schema-and-structured-data-for-wp' ); ?>" >
1240
- <p><?php echo esc_html__('The type of service being offered, e.g. veterans benefits, emergency relief, etc.', 'schema-and-structured-data-for-wp' ); ?></p>
1241
- </td>
1242
- </tr>
1243
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1244
- <td><?php echo esc_html__('Provider Name', 'schema-and-structured-data-for-wp' ); ?></td>
1245
- <td><input value="<?php if(isset($service_details['saswp_service_schema_provider_name'])){echo esc_attr($service_details['saswp_service_schema_provider_name']); } ?>" type="text" name="saswp_service_schema_provider_name" placeholder="<?php echo esc_html__('Provider Name', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1246
- </tr>
1247
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1248
- <td><?php echo esc_html__('Provider Type', 'schema-and-structured-data-for-wp' ); ?></td>
1249
- <td>
1250
- <select name="saswp_service_schema_provider_type">
1251
- <?php
1252
-
1253
- foreach ($provider_type as $key => $value) {
1254
-
1255
- $sel = '';
1256
- if(saswp_remove_warnings($service_details, 'saswp_service_schema_provider_type', 'saswp_string')==$key){
1257
- $sel = 'selected';
1258
- }
1259
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1260
-
1261
- }
1262
- ?>
1263
- </select>
1264
-
1265
- </td>
1266
- </tr>
1267
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1268
- <td><?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?></td>
1269
- <td style="display: flex; width: 97%">
1270
- <input value="<?php if(isset($service_details['saswp_service_schema_image'])) { echo esc_url($service_details['saswp_service_schema_image']['url']);} else { echo esc_url(saswp_remove_warnings($logo, 0, 'saswp_string')); } ?>" id="saswp_service_schema_image" type="text" name="saswp_service_schema_image[url]" placeholder="<?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?>" readonly="readonly" style="background: #FFF;">
1271
- <input value="<?php if(isset($service_details['saswp_service_schema_image'])) { echo esc_attr($service_details['saswp_service_schema_image']['id']);} else { echo esc_attr($custom_logo_id); }?>" data-id="saswp_service_schema_image_id" type="hidden" name="saswp_service_schema_image[id]">
1272
- <input value="<?php if(isset($service_details['saswp_service_schema_image'])) { echo esc_attr($service_details['saswp_service_schema_image']['width']);} else { echo esc_attr(saswp_remove_warnings($logo, 1, 'saswp_string')); } ?>" data-id="saswp_service_schema_image_width" type="hidden" name="saswp_service_schema_image[width]">
1273
- <input value="<?php if(isset($service_details['saswp_service_schema_image'])) { echo esc_attr($service_details['saswp_service_schema_image']['height']);} else { echo esc_attr(saswp_remove_warnings($logo, 2, 'saswp_string')); } ?>" data-id="saswp_service_schema_image_height" type="hidden" name="saswp_service_schema_image[height]">
1274
- <input data-id="media" class="button" id="saswp_service_schema_image_button" type="button" value="Upload"></td>
1275
- </tr>
1276
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1277
- <td><?php echo esc_html__('Locality', 'schema-and-structured-data-for-wp' ); ?></td>
1278
- <td><input value="<?php if(isset($service_details['saswp_service_schema_locality'])){echo esc_attr($service_details['saswp_service_schema_locality']); } ?>" type="text" name="saswp_service_schema_locality" placeholder="<?php echo esc_html__('Locality', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1279
- </tr>
1280
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1281
- <td><?php echo esc_html__('PostalCode', 'schema-and-structured-data-for-wp' ); ?></td>
1282
- <td><input value="<?php if(isset($service_details['saswp_service_schema_postal_code'])){echo esc_attr($service_details['saswp_service_schema_postal_code']); } ?>" type="text" name="saswp_service_schema_postal_code" placeholder="<?php echo esc_html__('Postal Code', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1283
- </tr>
1284
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1285
- <td><?php echo esc_html__('Telephone', 'schema-and-structured-data-for-wp' ); ?></td>
1286
- <td><input value="<?php if(isset($service_details['saswp_service_schema_telephone'])){echo esc_attr($service_details['saswp_service_schema_telephone']); } ?>" type="text" name="saswp_service_schema_telephone" placeholder="<?php echo esc_html__('Telephone', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1287
- </tr>
1288
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1289
- <td><?php echo esc_html__('Price Range', 'schema-and-structured-data-for-wp' ); ?></td>
1290
- <td><input value="<?php if(isset($service_details['saswp_service_schema_price_range'])){echo esc_attr($service_details['saswp_service_schema_price_range']); } ?>" type="text" name="saswp_service_schema_price_range" placeholder="<?php echo esc_html__('$10-$50 or $$$ ', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1291
- </tr>
1292
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1293
- <td><?php echo esc_html__('Description', 'schema-and-structured-data-for-wp' ); ?></td>
1294
- <td><textarea placeholder="Description" rows="3" cols="70" name="saswp_service_schema_description"><?php if(isset($service_details['saswp_service_schema_description'])){echo esc_attr($service_details['saswp_service_schema_description']); } ?></textarea></td>
1295
- </tr>
1296
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1297
- <td><?php echo esc_html__('Area Served (City)', 'schema-and-structured-data-for-wp' ); ?></td>
1298
- <td><textarea placeholder="New York, Los Angeles" rows="3" cols="70" name="saswp_service_schema_area_served"><?php if(isset($service_details['saswp_service_schema_area_served'])){echo esc_attr($service_details['saswp_service_schema_area_served']); } ?></textarea><p>Note: Enter all the City name in comma separated</p></td>
1299
- </tr>
1300
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1301
- <td><?php echo esc_html__('Service Offer', 'schema-and-structured-data-for-wp' ); ?></td>
1302
- <td><textarea placeholder="Apartment light cleaning, Carpet cleaning" rows="3" cols="70" name="saswp_service_schema_service_offer"><?php if(isset($service_details['saswp_service_schema_service_offer'])){echo esc_attr($service_details['saswp_service_schema_service_offer']); } ?></textarea><p>Note: Enter all the service offer in comma separated</p></td>
1303
- </tr>
1304
-
1305
-
1306
-
1307
- <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1308
- <td><?php echo esc_html__('Aggregate Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1309
- <td>
1310
- <input class="saswp-enable-rating-review-service" type="checkbox" name="saswp_service_schema_enable_rating" value="1" <?php if(isset($service_details['saswp_service_schema_enable_rating'])){echo 'checked'; }else{ echo ''; } ?>>
1311
- </td>
1312
- </tr>
1313
-
1314
- <tr class="saswp-service-text-field-tr saswp-rating-review-service" <?php echo $style_service_name; ?>>
1315
- <td><?php echo esc_html__('Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1316
- <td><input value="<?php if(isset($service_details['saswp_service_schema_rating'])){echo esc_attr($service_details['saswp_service_schema_rating']); } ?>" type="text" name="saswp_service_schema_rating" placeholder="<?php echo esc_html__('5.0', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1317
- </tr>
1318
- <tr class="saswp-service-text-field-tr saswp-rating-review-service" <?php echo $style_business_type; ?>>
1319
- <td><?php echo esc_html__('Number of Reviews', 'schema-and-structured-data-for-wp' ); ?></td>
1320
- <td><input value="<?php if(isset($service_details['saswp_service_schema_review_count'])){echo esc_attr($service_details['saswp_service_schema_review_count']); } ?>" type="text" name="saswp_service_schema_review_count" placeholder="<?php echo esc_html__('10', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1321
- </tr>
1322
-
1323
-
1324
- <!-- Service Schema type ends here -->
1325
-
1326
- <!-- Review Schema type starts here -->
1327
- <tr class="saswp-review-text-field-tr" <?php echo $style_review_name; ?>>
1328
- <td><?php echo esc_html__('Item Reviewed Type', 'schema-and-structured-data-for-wp' ); ?></td>
1329
- <td>
1330
-
1331
- <select data-id="<?php if(is_object($post)){ echo esc_attr($post->ID); } ?>" name="saswp_review_schema_item_type" class="saswp-item-reviewed">
1332
- <?php
1333
- foreach ($item_reviewed as $key => $value) {
1334
- $sel = '';
1335
- if(saswp_remove_warnings($review_details, 'saswp_review_schema_item_type', 'saswp_string')==$key){
1336
- $sel = 'selected';
1337
- }
1338
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1339
- }
1340
- ?>
1341
- </select>
1342
- </td>
1343
- </tr>
1344
-
1345
- <tr class="saswp-review-text-field-tr" <?php echo $style_review_name; ?>>
1346
- <td><?php echo esc_html__('Review Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1347
- <td>
1348
- <input class="saswp-enable-rating-review-review" type="checkbox" name="saswp_review_schema_enable_rating" value="1" <?php if(isset($review_details['saswp_review_schema_enable_rating'])){echo 'checked'; }else{ echo ''; } ?>>
1349
- </td>
1350
- </tr>
1351
- <tr class="saswp-review-text-field-tr saswp-rating-review-review" <?php echo $style_review_name; ?>>
1352
- <td><?php echo esc_html__('Rating Value', 'schema-and-structured-data-for-wp' ); ?></td>
1353
- <td><input value="<?php if(isset($review_details['saswp_review_schema_rating'])){echo esc_attr($review_details['saswp_review_schema_rating']); } ?>" type="text" name="saswp_review_schema_rating" placeholder="<?php echo esc_html__('5.0', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1354
- </tr>
1355
- <tr class="saswp-review-text-field-tr saswp-rating-review-review" <?php echo $style_business_type; ?>>
1356
- <td><?php echo esc_html__('Best Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1357
- <td><input value="<?php if(isset($review_details['saswp_review_schema_review_count'])){echo esc_attr($review_details['saswp_review_schema_review_count']); } ?>" type="text" name="saswp_review_schema_review_count" placeholder="<?php echo esc_html__('5.0', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1358
- </tr>
1359
-
1360
-
1361
- <!-- Review Schema type ends here -->
1362
-
1363
- <!-- AudioObject Schema type starts here -->
1364
-
1365
- <tr class="saswp-audio-text-field-tr">
1366
- <td><?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?></td>
1367
- <td><input value="<?php if(isset($audio_details['saswp_audio_schema_name'])){echo esc_attr($audio_details['saswp_audio_schema_name']); } ?>" type="text" name="saswp_audio_schema_name" placeholder="<?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1368
- </tr>
1369
-
1370
- <tr class="saswp-audio-text-field-tr">
1371
- <td><?php echo esc_html__('Description', 'schema-and-structured-data-for-wp' ); ?></td>
1372
- <td>
1373
- <textarea placeholder="Description" rows="5" cols="70" name="saswp_audio_schema_description"><?php if(isset($audio_details['saswp_audio_schema_description'])){echo $audio_details['saswp_audio_schema_description']; } ?></textarea>
1374
- </td>
1375
- </tr>
1376
-
1377
- <tr class="saswp-audio-text-field-tr">
1378
- <td><?php echo esc_html__('Content Url', 'schema-and-structured-data-for-wp' ); ?></td>
1379
- <td><input value="<?php if(isset($audio_details['saswp_audio_schema_contenturl'])){echo esc_attr($audio_details['saswp_audio_schema_contenturl']); } ?>" type="text" name="saswp_audio_schema_contenturl" placeholder="<?php echo esc_html__('Content Url', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1380
- </tr>
1381
-
1382
- <tr class="saswp-audio-text-field-tr">
1383
- <td><?php echo esc_html__('Duration', 'schema-and-structured-data-for-wp' ); ?></td>
1384
- <td><input value="<?php if(isset($audio_details['saswp_audio_schema_duration'])){echo esc_attr($audio_details['saswp_audio_schema_duration']); } ?>" type="text" name="saswp_audio_schema_duration" placeholder="<?php echo esc_html__('T0M15S', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1385
- </tr>
1386
-
1387
- <tr class="saswp-audio-text-field-tr">
1388
- <td><?php echo esc_html__('Encoding Format', 'schema-and-structured-data-for-wp' ); ?></td>
1389
- <td><input value="<?php if(isset($audio_details['saswp_audio_schema_encoding_format'])){echo esc_attr($audio_details['saswp_audio_schema_encoding_format']); } ?>" type="text" name="saswp_audio_schema_encoding_format" placeholder="<?php echo esc_html__('audio/mpeg', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1390
- </tr>
1391
-
1392
- <!-- AudioObject Schema type ends here -->
1393
-
1394
- <!-- SoftwareApplication Schema type starts here -->
1395
-
1396
- <tr class="saswp-softwareapplication-text-field-tr">
1397
- <td><?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?></td>
1398
- <td><input value="<?php if(isset($software_details['saswp_software_schema_name'])){echo esc_attr($software_details['saswp_software_schema_name']); } ?>" type="text" name="saswp_software_schema_name" placeholder="<?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1399
- </tr>
1400
-
1401
- <tr class="saswp-softwareapplication-text-field-tr">
1402
- <td><?php echo esc_html__('Description', 'schema-and-structured-data-for-wp' ); ?></td>
1403
- <td>
1404
- <textarea placeholder="Description" rows="5" cols="70" name="saswp_software_schema_description"><?php if(isset($software_details['saswp_software_schema_description'])){echo $software_details['saswp_software_schema_description']; } ?></textarea>
1405
- </td>
1406
- </tr>
1407
-
1408
- <tr class="saswp-softwareapplication-text-field-tr">
1409
- <td><?php echo esc_html__('Operating System', 'schema-and-structured-data-for-wp' ); ?></td>
1410
- <td><input value="<?php if(isset($software_details['saswp_software_schema_operating_system'])){echo esc_attr($software_details['saswp_software_schema_operating_system']); } ?>" type="text" name="saswp_software_schema_operating_system" placeholder="<?php echo esc_html__('eg. ANDROID', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1411
- </tr>
1412
-
1413
- <tr class="saswp-softwareapplication-text-field-tr">
1414
- <td><?php echo esc_html__('Application Category', 'schema-and-structured-data-for-wp' ); ?></td>
1415
- <td><input value="<?php if(isset($software_details['saswp_software_schema_application_category'])){echo esc_attr($software_details['saswp_software_schema_application_category']); } ?>" type="text" name="saswp_software_schema_application_category" placeholder="<?php echo esc_html__('eg. https://schema.org/GameApplication', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1416
- </tr>
1417
-
1418
- <tr class="saswp-softwareapplication-text-field-tr">
1419
- <td><?php echo esc_html__('Price', 'schema-and-structured-data-for-wp' ); ?></td>
1420
- <td><input value="<?php if(isset($software_details['saswp_software_schema_price'])){echo esc_attr($software_details['saswp_software_schema_price']); } ?>" type="text" name="saswp_software_schema_price" placeholder="<?php echo esc_html__('1.00', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1421
- </tr>
1422
-
1423
- <tr class="saswp-softwareapplication-text-field-tr">
1424
- <td><?php echo esc_html__('Price Currency', 'schema-and-structured-data-for-wp' ); ?></td>
1425
- <td><input value="<?php if(isset($software_details['saswp_software_schema_price_currency'])){echo esc_attr($software_details['saswp_software_schema_price_currency']); } ?>" type="text" name="saswp_software_schema_price_currency" placeholder="<?php echo esc_html__('USD', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1426
- </tr>
1427
-
1428
- <tr class="saswp-softwareapplication-text-field-tr">
1429
- <td><?php echo esc_html__('Aggregate Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1430
- <td>
1431
- <input class="saswp-enable-rating-review-softwareapplication" type="checkbox" name="saswp_software_schema_enable_rating" value="1" <?php if(isset($software_details['saswp_software_schema_enable_rating'])){echo 'checked'; }else{ echo ''; } ?>>
1432
- </td>
1433
- </tr>
1434
-
1435
- <tr class="saswp-softwareapplication-text-field-tr saswp-rating-review-softwareapplication">
1436
- <td><?php echo esc_html__('Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1437
- <td><input value="<?php if(isset($software_details['saswp_software_schema_rating'])){echo esc_attr($software_details['saswp_software_schema_rating']); } ?>" type="text" name="saswp_software_schema_rating" placeholder="<?php echo esc_html__('4.6', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1438
- </tr>
1439
- <tr class="saswp-softwareapplication-text-field-tr saswp-rating-review-softwareapplication">
1440
- <td><?php echo esc_html__('Rating Count', 'schema-and-structured-data-for-wp' ); ?></td>
1441
- <td><input value="<?php if(isset($software_details['saswp_software_schema_rating_count'])){echo esc_attr($software_details['saswp_software_schema_rating_count']); } ?>" type="text" name="saswp_software_schema_rating_count" placeholder="<?php echo esc_html__('8864', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1442
- </tr>
1443
-
1444
- <!-- SoftwareApplication Schema type ends here -->
1445
-
1446
- <!-- Event Schema type starts here -->
1447
-
1448
- <tr class="saswp-event-text-field-tr">
1449
- <td><?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?></td>
1450
- <td><input value="<?php if(isset($event_details['saswp_event_schema_name'])){echo esc_attr($event_details['saswp_event_schema_name']); } ?>" type="text" name="saswp_event_schema_name" placeholder="<?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1451
- </tr>
1452
- <tr class="saswp-event-text-field-tr">
1453
- <td><?php echo esc_html__('Description', 'schema-and-structured-data-for-wp' ); ?></td>
1454
- <td>
1455
- <textarea placeholder="Description" rows="5" cols="70" name="saswp_event_schema_description"><?php if(isset($event_details['saswp_event_schema_description'])){echo $event_details['saswp_event_schema_description']; } ?></textarea>
1456
- </td>
1457
- </tr>
1458
- <tr class="saswp-event-text-field-tr">
1459
- <td><?php echo esc_html__('Location Name', 'schema-and-structured-data-for-wp' ); ?></td>
1460
- <td><input value="<?php if(isset($event_details['saswp_event_schema_location_name'])){echo esc_attr($event_details['saswp_event_schema_location_name']); } ?>" type="text" name="saswp_event_schema_location_name" placeholder="<?php echo esc_html__('Location Name', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1461
- </tr>
1462
-
1463
- <tr class="saswp-event-text-field-tr">
1464
- <td><?php echo esc_html__('Location Street Address', 'schema-and-structured-data-for-wp' ); ?></td>
1465
- <td><input value="<?php if(isset($event_details['saswp_event_schema_location_streetaddress'])){echo esc_attr($event_details['saswp_event_schema_location_streetaddress']); } ?>" type="text" name="saswp_event_schema_location_streetaddress" placeholder="<?php echo esc_html__('Location Street Address', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1466
- </tr>
1467
-
1468
- <tr class="saswp-event-text-field-tr">
1469
- <td><?php echo esc_html__('Location Locality', 'schema-and-structured-data-for-wp' ); ?></td>
1470
- <td><input value="<?php if(isset($event_details['saswp_event_schema_location_locality'])){echo esc_attr($event_details['saswp_event_schema_location_locality']); } ?>" type="text" name="saswp_event_schema_location_locality" placeholder="<?php echo esc_html__('Location Locality', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1471
- </tr>
1472
-
1473
- <tr class="saswp-event-text-field-tr">
1474
- <td><?php echo esc_html__('Location Region', 'schema-and-structured-data-for-wp' ); ?></td>
1475
- <td><input value="<?php if(isset($event_details['saswp_event_schema_location_region'])){echo esc_attr($event_details['saswp_event_schema_location_region']); } ?>" type="text" name="saswp_event_schema_location_region" placeholder="<?php echo esc_html__('Location Region', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1476
- </tr>
1477
-
1478
- <tr class="saswp-event-text-field-tr">
1479
- <td><?php echo esc_html__('Location PostalCode', 'schema-and-structured-data-for-wp' ); ?></td>
1480
- <td><input value="<?php if(isset($event_details['saswp_event_schema_location_postalcode'])){echo esc_attr($event_details['saswp_event_schema_location_postalcode']); } ?>" type="text" name="saswp_event_schema_location_postalcode" placeholder="<?php echo esc_html__('PostalCode', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1481
- </tr>
1482
-
1483
- <tr class="saswp-event-text-field-tr">
1484
- <td><?php echo esc_html__('Start Date', 'schema-and-structured-data-for-wp' ); ?></td>
1485
- <td><input class="saswp-local-schema-datepicker-picker" value="<?php if(isset($event_details['saswp_event_schema_start_date'])){echo esc_attr($event_details['saswp_event_schema_start_date']); } ?>" type="text" name="saswp_event_schema_start_date" placeholder="<?php echo esc_html__('2018-12-12', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1486
- </tr>
1487
-
1488
- <tr class="saswp-event-text-field-tr">
1489
- <td><?php echo esc_html__('End Date', 'schema-and-structured-data-for-wp' ); ?></td>
1490
- <td><input class="saswp-local-schema-datepicker-picker" value="<?php if(isset($event_details['saswp_event_schema_end_date'])){echo esc_attr($event_details['saswp_event_schema_end_date']); } ?>" type="text" name="saswp_event_schema_end_date" placeholder="<?php echo esc_html__('2018-12-12', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1491
- </tr>
1492
-
1493
- <tr class="saswp-event-text-field-tr">
1494
- <td><?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?></td>
1495
- <td style="display: flex; width: 97%">
1496
- <input value="<?php if(isset($event_details['saswp_event_schema_image'])) { echo esc_url($event_details['saswp_event_schema_image']['url']);} else { echo esc_url(saswp_remove_warnings($logo, 0, 'saswp_string')); } ?>" id="saswp_event_schema_image" type="text" name="saswp_event_schema_image[url]" placeholder="<?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?>" readonly="readonly" style="background: #FFF;">
1497
- <input value="<?php if(isset($event_details['saswp_event_schema_image'])) { echo esc_attr($event_details['saswp_event_schema_image']['id']);} else { echo esc_attr($custom_logo_id); }?>" data-id="saswp_event_schema_image_id" type="hidden" name="saswp_event_schema_image[id]">
1498
- <input value="<?php if(isset($event_details['saswp_event_schema_image'])) { echo esc_attr($event_details['saswp_event_schema_image']['width']);} else { echo esc_attr(saswp_remove_warnings($logo, 1, 'saswp_string')); } ?>" data-id="saswp_event_schema_image_width" type="hidden" name="saswp_event_schema_image[width]">
1499
- <input value="<?php if(isset($event_details['saswp_event_schema_image'])) { echo esc_attr($event_details['saswp_event_schema_image']['height']);} else { echo esc_attr(saswp_remove_warnings($logo, 2, 'saswp_string')); } ?>" data-id="saswp_event_schema_image_height" type="hidden" name="saswp_event_schema_image[height]">
1500
- <input data-id="media" class="button" id="saswp_event_schema_image_button" type="button" value="Upload">
1501
- </td>
1502
- </tr>
1503
-
1504
- <tr class="saswp-event-text-field-tr">
1505
- <td><?php echo esc_html__('Performer Name', 'schema-and-structured-data-for-wp' ); ?></td>
1506
- <td><input value="<?php if(isset($event_details['saswp_event_schema_performer_name'])){echo esc_attr($event_details['saswp_event_schema_performer_name']); } ?>" type="text" name="saswp_event_schema_performer_name"></td>
1507
- </tr>
1508
-
1509
- <tr class="saswp-event-text-field-tr">
1510
- <td><?php echo esc_html__('Price', 'schema-and-structured-data-for-wp' ); ?></td>
1511
- <td><input value="<?php if(isset($event_details['saswp_event_schema_price'])){echo esc_attr($event_details['saswp_event_schema_price']); } ?>" type="number" name="saswp_event_schema_price"></td>
1512
- </tr>
1513
-
1514
- <tr class="saswp-event-text-field-tr">
1515
- <td><?php echo esc_html__('Price currency', 'schema-and-structured-data-for-wp' ); ?></td>
1516
- <td><input value="<?php if(isset($event_details['saswp_event_schema_price_currency'])){echo esc_attr($event_details['saswp_event_schema_price_currency']); } ?>" type="text" name="saswp_event_schema_price_currency"></td>
1517
- </tr>
1518
- <tr class="saswp-event-text-field-tr">
1519
- <td><?php echo esc_html__('Availability', 'schema-and-structured-data-for-wp' ); ?></td>
1520
- <td>
1521
- <select name="saswp_event_schema_availability">
1522
- <?php
1523
-
1524
- foreach ($availability as $key => $value) {
1525
- $sel = '';
1526
- if(saswp_remove_warnings($event_details, 'saswp_event_schema_availability', 'saswp_string')==$key){
1527
- $sel = 'selected';
1528
- }
1529
- echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1530
- }
1531
- ?>
1532
- </select>
1533
- </td>
1534
- </tr>
1535
-
1536
- <tr class="saswp-event-text-field-tr">
1537
- <td><?php echo esc_html__('Valid From', 'schema-and-structured-data-for-wp' ); ?></td>
1538
- <td><input class="saswp-local-schema-datepicker-picker" value="<?php if(isset($event_details['saswp_event_schema_validfrom'])){echo esc_attr($event_details['saswp_event_schema_validfrom']); } ?>" type="text" name="saswp_event_schema_validfrom"></td>
1539
- </tr>
1540
-
1541
- <tr class="saswp-event-text-field-tr">
1542
- <td><?php echo esc_html__('URL', 'schema-and-structured-data-for-wp' ); ?></td>
1543
- <td><input value="<?php if(isset($event_details['saswp_event_schema_url'])){echo esc_attr($event_details['saswp_event_schema_url']); } ?>" type="text" name="saswp_event_schema_url"></td>
1544
- </tr>
1545
-
1546
- <!-- Event Schema type ends here -->
1547
-
1548
-
1549
- <tr>
1550
- <td>
1551
- <label for="saswp-speakable"><?php echo esc_html__( 'Speakable ' ,'schema-and-structured-data-for-wp');?></label>
1552
- </td>
1553
- <td>
1554
- <input class="saswp-enable-speakable" type="checkbox" name="saswp_enable_speakable_schema" value="1" <?php if(isset($speakable) && $speakable == 1){echo 'checked'; }else{ echo ''; } ?>>
1555
- </td>
1556
- </tr>
1557
- </table>
1558
-
1559
- </div>
1560
- <?php
1561
- }
1562
-
1563
- add_action( 'save_post', 'saswp_schema_type_add_meta_box_save' ) ;
1564
-
1565
- function saswp_schema_type_add_meta_box_save( $post_id ) {
1566
 
1567
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
1568
  if ( ! isset( $_POST['saswp_schema_type_nonce'] ) || ! wp_verify_nonce( $_POST['saswp_schema_type_nonce'], 'saswp_schema_type_nonce' ) ) return;
@@ -1585,9 +1662,15 @@
1585
  }
1586
 
1587
  $local_business_details = array();
 
1588
  if ( isset( $_POST['local_business_name'] ) ){
1589
  $local_business_details['local_business_name'] = sanitize_text_field($_POST['local_business_name']);
1590
  }
 
 
 
 
 
1591
  if ( isset( $_POST['local_street_address'] ) ){
1592
  $local_business_details['local_street_address'] = sanitize_text_field($_POST['local_street_address']);
1593
  }
@@ -1641,6 +1724,34 @@
1641
  $local_business_details['local_serves_cuisine'] = sanitize_text_field($_POST['local_serves_cuisine']);
1642
  }
1643
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1644
  if ( isset( $_POST['local_enable_rating'] ) ){
1645
  $local_business_details['local_enable_rating'] = sanitize_text_field($_POST['local_enable_rating']);
1646
  }
@@ -1720,16 +1831,17 @@
1720
 
1721
  if($schema_type =='Review'){
1722
 
1723
- if ( !isset( $_POST['saswp_review_schema_item_type'] ) ){
1724
- return;
1725
- }
1726
 
1727
- $item = sanitize_text_field($_POST['saswp_review_schema_item_type']);
1728
  $meta_fields = saswp_item_reviewed_fields($item);
1729
 
1730
  foreach ( $meta_fields as $meta_field ) {
1731
 
1732
  if ( isset( $_POST[ $meta_field['id'] ] ) ) {
 
1733
  switch ( $meta_field['type'] ) {
1734
 
1735
  case 'media':
@@ -1754,6 +1866,9 @@
1754
  case 'text':
1755
  $_POST[ $meta_field['id'] ] = sanitize_text_field( $_POST[ $meta_field['id'] ] );
1756
  break;
 
 
 
1757
  }
1758
  $review_schema_details[$meta_field['id']] = $_POST[ $meta_field['id'] ];
1759
 
1
  <?php
2
+ /**
3
+ * Schema Type Page
4
+ *
5
+ * @author Magazine3
6
+ * @category Admin
7
+ * @path view/schema_type
8
+ */
9
+
10
+ // Exit if accessed directly.
11
+ if ( ! defined( 'ABSPATH' ) ) exit;
12
+ /**
13
+ * List of hooks used in this file
14
+ */
15
+ add_action( 'wp_ajax_saswp_get_item_reviewed_fields', 'saswp_get_item_reviewed_fields' ) ;
16
+ add_action( 'save_post', 'saswp_schema_type_add_meta_box_save' ) ;
17
+ add_action( 'add_meta_boxes', 'saswp_schema_type_add_meta_box' ) ;
18
+
19
+ /**
20
+ * Function to get review schema type fields as an array
21
+ * @param type $item
22
+ * @param type $post_specific
23
+ * @param type $schema_id
24
+ * @return array
25
+ * @since 1.0.8
26
+ */
27
+ function saswp_item_reviewed_fields($item, $post_specific = null, $schema_id = null){
28
+
29
+ $post_fix = '';
30
+
31
+ if($post_specific == 1 && isset($schema_id)){
32
+
33
+ $post_fix = '_'.esc_attr($schema_id);
34
+
35
+ }
36
+
37
+ $reviewed_field = array(
38
+ array(
39
+ 'label' => 'Name',
40
+ 'id' => 'saswp_review_schema_name'.$post_fix,
41
+ 'type' => 'text',
42
+ 'default' => '',
43
+ 'attributes' => array(
44
+ 'placeholder' => 'Name'
45
+ )
46
+
47
+ ),
48
+ array(
49
+ 'label' => 'Review Body',
50
+ 'id' => 'saswp_review_schema_description'.$post_fix,
51
+ 'type' => 'textarea',
52
+ 'default' => '',
53
+ 'attributes' => array(
54
+ 'placeholder' => 'Review Body'
55
+ )
56
+ ),
57
+ array(
58
+ 'label' => 'Image',
59
+ 'id' => 'saswp_review_schema_image'.$post_fix,
60
+ 'type' => 'media',
61
+ 'default' => '',
62
+ 'attributes' => array(
63
+ 'placeholder' => 'Image'
64
+ )
65
+ ),
66
+ array(
67
+ 'label' => 'Author',
68
+ 'id' => 'saswp_review_schema_author'.$post_fix,
69
+ 'type' => 'text',
70
+ 'default' => '',
71
+ 'attributes' => array(
72
+ 'placeholder' => 'Author'
73
+ )
74
+ ),
75
+ array(
76
+ 'label' => 'Price Range',
77
+ 'id' => 'saswp_review_schema_price_range'.$post_fix,
78
+ 'type' => 'text',
79
+ 'default' => '',
80
+ 'attributes' => array(
81
+ 'placeholder' => '$$$ or 55$-100$'
82
+ )
83
+ ),
84
+ array(
85
+ 'label' => 'Street Address',
86
+ 'id' => 'saswp_review_schema_street_address'.$post_fix,
87
+ 'type' => 'text',
88
+ 'default' => '',
89
+ 'attributes' => array(
90
+ 'placeholder' => 'Street Address'
91
+ )
92
+ ),
93
+ array(
94
+ 'label' => 'Address Locality',
95
+ 'id' => 'saswp_review_schema_locality'.$post_fix,
96
+ 'type' => 'text',
97
+ 'default' => '',
98
+ 'attributes' => array(
99
+ 'placeholder' => 'Address Locality'
100
+ )
101
+ ),
102
+ array(
103
+ 'label' => 'Address Region',
104
+ 'id' => 'saswp_review_schema_region'.$post_fix,
105
+ 'type' => 'text',
106
+ 'default' => '',
107
+ 'attributes' => array(
108
+ 'placeholder' => 'Address Region'
109
+ )
110
+ ),
111
+ array(
112
+ 'label' => 'Postal Code',
113
+ 'id' => 'saswp_review_schema_postal_code'.$post_fix,
114
+ 'type' => 'text',
115
+ 'default' => '',
116
+ 'attributes' => array(
117
+ 'placeholder' => 'Postal Code'
118
+ )
119
+ ),
120
+ array(
121
+ 'label' => 'Address Country',
122
+ 'id' => 'saswp_review_schema_country'.$post_fix,
123
+ 'type' => 'text',
124
+ 'default' => '',
125
+ 'attributes' => array(
126
+ 'placeholder' => 'Country'
127
+ )
128
+ ),
129
+ array(
130
+ 'label' => 'Telephone',
131
+ 'id' => 'saswp_review_schema_telephone'.$post_fix,
132
+ 'type' => 'text',
133
+ 'default' => '',
134
+ 'attributes' => array(
135
+ 'placeholder' => '123456789'
136
+ )
137
+ ),
138
+
139
+ );
140
+
141
+ switch ($item) {
142
+
143
+ case 'Article':
144
+
145
+ $reviewed_field = array();
146
+
147
+ break;
148
+ case 'Adultentertainment':
149
+
150
+ $reviewed_field;
151
+
152
+ break;
153
+ case 'Blog':
154
+
155
+ $reviewed_field = array(
156
+ array(
157
+ 'label' => 'Name',
158
+ 'id' => 'saswp_review_schema_name'.$post_fix,
159
+ 'type' => 'text',
160
+ 'default' => $site_name = get_bloginfo()
161
+ ),
162
+ array(
163
+ 'label' => 'Url',
164
+ 'id' => 'saswp_review_schema_url'.$post_fix,
165
+ 'type' => 'text',
166
+ 'default' => get_site_url()
167
+ )
168
+ );
169
+
170
+ break;
171
+ case 'Book':
172
+
173
+ $reviewed_field = array(
174
+ array(
175
+ 'label' => 'Name',
176
+ 'id' => 'saswp_review_schema_name'.$post_fix,
177
+ 'type' => 'text',
178
+ 'default' => '',
179
+ 'attributes' => array(
180
+ 'placeholder' => 'Name'
181
+ )
182
+ ),
183
+ array(
184
+ 'label' => 'Author',
185
+ 'id' => 'saswp_review_schema_author'.$post_fix,
186
+ 'type' => 'text',
187
+ 'default' => '',
188
+ 'attributes' => array(
189
+ 'placeholder' => 'Author'
190
+ )
191
+ ),
192
+ array(
193
+ 'label' => 'ISBN',
194
+ 'id' => 'saswp_review_schema_isbn'.$post_fix,
195
+ 'type' => 'text',
196
+ 'default' => '',
197
+ 'attributes' => array(
198
+ 'placeholder' => 'ISBN'
199
+ )
200
+ ),
201
+ array(
202
+ 'label' => 'URL',
203
+ 'id' => 'saswp_review_schema_author_sameas'.$post_fix,
204
+ 'type' => 'text',
205
+ 'default' => '',
206
+ 'attributes' => array(
207
+ 'placeholder' => 'URL'
208
+ )
209
+ ),
210
+ array(
211
+ 'label' => 'Review Body',
212
+ 'id' => 'saswp_review_schema_description'.$post_fix,
213
+ 'type' => 'textarea',
214
+ 'default' => '',
215
+ 'attributes' => array(
216
+ 'placeholder' => 'Review Body'
217
+ )
218
+ )
219
+
220
+ );
221
+
222
+ break;
223
+ case 'casino':
224
+
225
+ $reviewed_field = $reviewed_field;
226
+
227
+ break;
228
+ case 'Diet':
229
+
230
+ $reviewed_field = array();
231
+
232
+ break;
233
+ case 'Episode':
234
+
235
+ $reviewed_field = array();
236
+
237
+ break;
238
+ case 'ExercisePlan':
239
+ $reviewed_field = array();
240
+ break;
241
+ case 'Game':
242
+ $reviewed_field = array();
243
+ break;
244
+ case 'Movie':
245
+ $reviewed_field = array(
246
+ array(
247
+ 'label' => 'Name',
248
+ 'id' => 'saswp_review_schema_name'.$post_fix,
249
+ 'type' => 'text',
250
+ 'default' => '',
251
+ 'attributes' => array(
252
+ 'placeholder' => 'Name'
253
+ )
254
+ ),
255
+ array(
256
+ 'label' => 'Date Created',
257
+ 'id' => 'saswp_review_schema_date_created'.$post_fix,
258
+ 'type' => 'text',
259
+ 'default' => '',
260
+ 'attributes' => array(
261
+ 'placeholder' => '2017-05-17'
262
+ )
263
+ ),
264
+ array(
265
+ 'label' => 'Image',
266
+ 'id' => 'saswp_review_schema_image'.$post_fix,
267
+ 'type' => 'media',
268
+ 'default' => '',
269
+ 'attributes' => array(
270
+ 'placeholder' => 'Image'
271
+ )
272
+ ),
273
+ array(
274
+ 'label' => 'Director',
275
+ 'id' => 'saswp_review_schema_director'.$post_fix,
276
+ 'type' => 'text',
277
+ 'default' => '',
278
+ 'attributes' => array(
279
+ 'placeholder' => 'Director'
280
+ )
281
+ ),
282
+ array(
283
+ 'label' => 'URL',
284
+ 'id' => 'saswp_review_schema_itemreviewed_sameas'.$post_fix,
285
+ 'type' => 'text',
286
+ 'default' => '',
287
+ 'attributes' => array(
288
+ 'placeholder' => 'URL'
289
+ )
290
+ ),
291
+ array(
292
+ 'label' => 'Review Body',
293
+ 'id' => 'saswp_review_schema_description'.$post_fix,
294
+ 'type' => 'textarea',
295
+ 'default' => '',
296
+ 'attributes' => array(
297
+ 'placeholder' => 'Review Body'
298
+ )
299
+ )
300
+
301
+ );
302
+ break;
303
+ case 'MusicPlaylist':
304
+ $reviewed_field = array();
305
+ break;
306
+ case 'MusicRecording':
307
+ $reviewed_field = array();
308
+ break;
309
+ case 'Photograph':
310
+ $reviewed_field = array();
311
+ break;
312
+ case 'Recipe':
313
+ $reviewed_field = array();
314
+ break;
315
+ case 'Restaurant':
316
+ $reviewed_field[] = array(
317
+ 'label' => 'Serves Cuisine',
318
+ 'id' => 'saswp_review_schema_servescuisine'.$post_fix,
319
  'type' => 'text',
320
  'default' => '',
321
  'attributes' => array(
322
+ 'placeholder' => 'Serves Cuisine'
323
+ )
324
+ );
325
+ $reviewed_field[] = array(
326
+ 'label' => 'Menu',
327
+ 'id' => 'saswp_review_schema_menu'.$post_fix,
328
  'type' => 'text',
329
  'default' => '',
330
  'attributes' => array(
331
+ 'placeholder' => 'https://example.com/menu'
332
+ )
333
+ );
334
+ break;
335
+ case 'Series':
336
+ $reviewed_field = array();
337
+ break;
338
+ case 'SoftwareApplication':
339
+ $reviewed_field = array();
340
+ break;
341
+ case 'VisualArtwork':
342
+ $reviewed_field = array();
343
+ break;
344
+ case 'WebPage':
345
+ $reviewed_field = array();
346
+ break;
347
+ case 'WebSite':
348
+ $reviewed_field = array(
349
+ array(
350
+ 'label' => 'Name',
351
+ 'id' => 'saswp_review_schema_name'.$post_fix,
352
+ 'type' => 'text',
353
+ 'default' => $site_name = get_bloginfo()
354
+ ),
355
+ array(
356
+ 'label' => 'Url',
357
+ 'id' => 'saswp_review_schema_url'.$post_fix,
358
+ 'type' => 'text',
359
+ 'default' => get_site_url()
360
+ )
361
+ );
362
+ break;
363
+
364
+ default:
365
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366
  }
367
+
368
+ return $reviewed_field;
369
+
370
+ }
371
+ /**
372
+ * Function to get review schema type html markup
373
+ * @since 1.0.8
374
+ * @return type html string
375
+ */
376
+ function saswp_get_item_reviewed_fields(){
377
+
378
+ if ( ! isset( $_GET['saswp_security_nonce'] ) ){
379
+ return;
380
+ }
381
+ if ( !wp_verify_nonce( $_GET['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
382
+ return;
383
+ }
384
+
385
+ $post_specific = '';
386
+ $output = '';
387
+ $item = sanitize_text_field($_GET['item']);
388
+ $schema_id = sanitize_text_field($_GET['schema_id']);
389
+ $post_id = intval($_GET['post_id']);
390
+
391
+ if(isset($_GET['post_specific'])){
392
+ $post_specific = sanitize_text_field($_GET['post_specific']);
393
+ }
394
+
395
+ $meta_fields = saswp_item_reviewed_fields($item, $post_specific, $schema_id);
396
+
397
+ if($meta_fields){
398
 
399
+ foreach ($meta_fields as $meta_field){
400
+
401
+
402
+ $attributes ='';
403
+
404
+ if(isset($meta_field['attributes'])){
405
+
406
+ foreach ($meta_field['attributes'] as $key => $attr ){
407
+
408
+ $attributes .=''.esc_attr($key).'="'.esc_attr($attr).'"';
409
+
410
+ }
411
+ }
412
+
413
+
414
+ if($post_specific == 1){
415
+
416
+ $meta_value = get_post_meta( $post_id, $meta_field['id'], true );
417
+
418
+
419
+ if(!$meta_value){
420
+
421
+ $schema_data = get_post_meta( $schema_id, 'saswp_review_schema_details', true );
422
+
423
+ $meta_value = $schema_data[chop($meta_field['id'], '_'.$schema_id)];
424
+ }
425
+
426
+ }else{
427
+
428
+ $schema_data = get_post_meta( $schema_id, 'saswp_review_schema_details', true );
429
+ $meta_value = $schema_data[$meta_field['id']];
430
+
431
+ }
432
+
433
+
434
+
435
+
436
+ if ( empty( $meta_value ) ) {
437
+
438
+ $meta_value = $meta_field['default'];
439
+
440
+ }
441
+
442
+ switch ($meta_field['type']) {
443
+
444
+ case 'media':
445
+
446
+ $media_value = array();
447
+ $media_key = $meta_field['id'].'_detail';
448
+
449
  if($post_specific == 1){
450
+
451
+ $media_value_meta = get_post_meta( $post_id, $media_key, true );
452
+
453
+ if(empty($media_value_meta)){
454
+
455
+ $media_key = chop($meta_field['id'], '_'.$schema_id).'_detail';
456
+ $media_value_meta = $schema_data[$media_key];
457
+
458
+ }
459
+
 
460
  }else{
461
+
462
+ $media_value_meta = $schema_data[$media_key];
463
+
 
464
  }
465
+
466
+
467
+ if(!empty($media_value_meta)){
468
+
469
+ $media_value = $media_value_meta;
470
+
471
+ }
472
+
473
+ $input = sprintf(
474
+ ' <input style="width: 80%%" id="%s" name="%s" type="text" value="%s" readonly>'
475
+ . '<input type="hidden" data-id="'.esc_attr($meta_field['id']).'_height" class="upload-height" name="'.esc_attr($meta_field['id']).'_height" id="'.esc_attr($meta_field['id']).'_height" value="'.esc_attr($media_value['height']).'">'
476
+ . '<input type="hidden" data-id="'.esc_attr($meta_field['id']).'_width" class="upload-width" name="'.esc_attr($meta_field['id']).'_width" id="'.esc_attr($meta_field['id']).'_width" value="'.esc_attr($media_value['width']).'">'
477
+ . '<input type="hidden" data-id="'.esc_attr($meta_field['id']).'_thumbnail" class="upload-thumbnail" name="'.esc_attr($meta_field['id']).'_thumbnail" id="'.esc_attr($meta_field['id']).'_thumbnail" value="'.esc_url($media_value['thumbnail']).'">'
478
+ . '<input data-id="media" style="width: 19%%" class="button" id="%s_button" name="%s_button" type="button" value="Upload" />',
479
+ esc_attr($meta_field['id']),
480
+ esc_attr($meta_field['id']),
481
+ esc_url($meta_value),
482
+ esc_attr($meta_field['id']),
483
+ esc_attr($meta_field['id'])
484
+ );
485
+
486
+
487
+ break;
488
+
489
+ case 'textarea':
490
+ $input = sprintf(
491
+ '<textarea %s style="width: 100%%" id="%s" name="%s" rows="5">%s</textarea>',
492
+ $attributes,
493
+ esc_attr($meta_field['id']),
494
+ esc_attr($meta_field['id']),
495
+ $meta_value
496
+ );
497
+ break;
498
+
499
+ default:
500
+
501
+ $input = sprintf(
502
+ '<input %s %s id="%s" name="%s" type="%s" value="%s">',
503
+ $attributes,
504
+ $meta_field['type'] !== 'color' ? 'style="width: 100%"' : '',
505
+ esc_attr(saswp_remove_warnings($meta_field, 'id', 'saswp_string')),
506
+ esc_attr(saswp_remove_warnings($meta_field, 'id', 'saswp_string')),
507
+ esc_attr(saswp_remove_warnings($meta_field, 'type', 'saswp_string')),
508
+ $meta_value
509
+ );
510
+
511
+ break;
512
+
513
+ }
514
+
515
+ $output .= '<tr class="saswp-review-tr">'
516
+ . '<td>'.esc_html__($meta_field['label'], 'schema-and-structured-data-for-wp' ).'</td>'
517
+ . '<td>'.$input.'</td>'
518
+ . '</tr>';
519
+
520
+ }
521
+
522
+ }
523
+
524
+
525
+ echo $output;
526
+
527
+ wp_die();
528
+ }
529
+ /**
530
+ * Register a schema type metabox
531
+ * @return null
532
+ * @since version 1.0
533
+ *
534
+ */
535
+ function saswp_schema_type_add_meta_box() {
536
+
537
+ add_meta_box(
538
+ 'schema_type',
539
+ esc_html__( 'Schema Type', 'schema-and-structured-data-for-wp' ),
540
+ 'saswp_schema_type_meta_box_callback',
541
+ 'saswp',
542
+ 'advanced',
543
+ 'high'
544
+ );
545
+
546
+ }
547
+ /**
548
+ * Function to get schema type meta
549
+ * @global type $post
550
+ * @param type $value
551
+ * @return boolean
552
+ * @since version 1.0
553
+ */
554
+ function saswp_schema_type_get_meta( $value ) {
555
+
556
+ global $post;
557
+
558
+ $field = get_post_meta( $post->ID, $value, true );
559
+
560
+ if ( ! empty( $field ) ) {
561
+ return is_array( $field ) ? stripslashes_deep( $field ) : stripslashes( wp_kses_decode_entities( $field ) );
562
+ } else {
563
+ return false;
564
+ }
565
+ }
566
+ /**
567
+ * Function to generate html markup for schema type metabox
568
+ * @param type $post
569
+ * return null
570
+ * @since version 1.0
571
+ */
572
+ function saswp_schema_type_meta_box_callback( $post) {
573
+
574
+ wp_nonce_field( 'saswp_schema_type_nonce', 'saswp_schema_type_nonce' );
575
+
576
+ $style_business_type = '';
577
+ $style_business_name = '';
578
+ $style_service_name = '';
579
+ $style_review_name = '';
580
+ $business_name = '';
581
+ $schema_type = '';
582
+ $business_type = '';
583
+ $custom_logo_id = '';
584
+ $speakable = '';
585
+
586
+ $business_details = array();
587
+ $logo = array();
588
+ $service_details = array();
589
+ $review_details = array();
590
+ $product_details = array();
591
+ $event_details = array();
592
+
593
+ if($post){
594
+
595
+ $schema_type = esc_sql ( get_post_meta($post->ID, 'schema_type', true) );
596
+
597
+ switch ($schema_type) {
598
+
599
+ case 'AudioObject':
600
+
601
+ $audio_details = esc_sql ( get_post_meta($post->ID, 'saswp_audio_schema_details', true) );
602
+
603
+ break;
604
+
605
+ case 'SoftwareApplication':
606
+
607
+ $software_details = esc_sql ( get_post_meta($post->ID, 'saswp_software_schema_details', true) );
608
+
609
+ break;
610
+
611
+ case 'local_business':
612
+
613
+ $business_type = esc_sql ( get_post_meta($post->ID, 'saswp_business_type', true) );
614
+ $business_name = esc_sql ( get_post_meta($post->ID, 'saswp_business_name', true) );
615
+ $business_details = esc_sql ( get_post_meta($post->ID, 'saswp_local_business_details', true) );
616
+ $dayoftheweek = get_post_meta($post->ID, 'saswp_dayofweek', true);
617
+
618
+ break;
619
+
620
+ case 'Product':
621
+
622
+ $product_details = esc_sql ( get_post_meta($post->ID, 'saswp_product_schema_details', true) );
623
+
624
+ break;
625
+
626
+ case 'Service':
627
+
628
+ $service_details = esc_sql ( get_post_meta($post->ID, 'saswp_service_schema_details', true) );
629
+
630
+ break;
631
+
632
+ case 'Review':
633
+
634
+ $review_details = esc_sql ( get_post_meta($post->ID, 'saswp_review_schema_details', true) );
635
+
636
+ break;
637
+
638
+ case 'Event':
639
+
640
+ $event_details = esc_sql ( get_post_meta($post->ID, 'saswp_event_schema_details', true) );
641
+
642
+ break;
643
+
644
+ default:
645
+
646
+ $speakable = esc_sql ( get_post_meta($post->ID, 'saswp_enable_speakable_schema', true) );
647
+
648
+ break;
649
+ }
650
+
651
+ $custom_logo_id = get_theme_mod( 'custom_logo' );
652
+
653
+ if($custom_logo_id){
654
+
655
+ $logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
656
+
657
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
658
 
659
+ if($schema_type != 'local_business'){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
660
 
661
+ $style_business_type = 'style="display:none"';
662
+ $style_business_name = 'style="display:none"';
 
 
 
663
 
664
+ }
665
+ }
 
666
 
667
+ $provider_type = array(
668
+ 'Airline' => 'Airline',
669
+ 'Corporation' => 'Corporation',
670
+ 'EducationalOrganization' => 'Educational Organization',
671
+ 'GovernmentOrganization' => 'Government Organization',
672
+ 'LocalBusiness' => 'Local Business',
673
+ 'MedicalOrganization' => 'Medical Organization',
674
+ 'NGO' => 'NGO',
675
+ 'PerformingGroup' => 'Performing Group',
676
+ 'SportsOrganization' => 'Sports Organization',
677
+ );
678
 
679
+ $availability = array(
680
+ 'InStock' => 'In Stock',
681
+ 'OutOfStock' => 'Out Of Stock',
682
+ 'Discontinued' => 'Discontinued',
683
+ 'PreOrder' => 'Pre Order',
684
+ );
685
 
686
+ $item_reviewed = array(
687
+ 'Article' => 'Article',
688
+ 'Adultentertainment' => 'Adult Entertainment',
689
+ 'Blog' => 'Blog',
690
+ 'Book' => 'Book',
691
+ 'Casino' => 'Casino',
692
+ 'Diet' => 'Diet',
693
+ 'Episode' => 'Episode',
694
+ 'ExercisePlan' => 'Exercise Plan',
695
+ 'Game' => 'Game',
696
+ 'Movie' => 'Movie',
697
+ 'MusicPlaylist' => 'Music Playlist',
698
+ 'MusicRecording' => 'MusicRecording',
699
+ 'Photograph' => 'Photograph',
700
+ 'Restaurant' => 'Restaurant',
701
+ 'Series' => 'Series',
702
+ 'VisualArtwork' => 'Visual Artwork',
703
+ 'WebPage' => 'WebPage',
704
+ 'WebSite' => 'WebSite',
705
+ );
706
+
707
+ $all_schema_array = array(
708
+
709
+ 'Accommodation' => array(
710
+ 'Apartment' => 'Apartment',
711
+ 'House' => 'House',
712
+ 'SingleFamilyResidence' => 'SingleFamilyResidence',
713
+ ),
714
+ 'CreativeWork' => array(
715
+ 'Article' => 'Article',
716
+ 'Blogposting' => 'Blogposting',
717
+ 'Course' => 'Course',
718
+ 'DiscussionForumPosting' => 'DiscussionForumPosting',
719
+ 'HowTo' => 'HowTo',
720
+ 'NewsArticle' => 'NewsArticle',
721
+ 'qanda' => 'Q&A',
722
+ 'Review' => 'Review',
723
+ 'Recipe' => 'Recipe',
724
+ 'TVSeries' => 'TVSeries',
725
+ 'SoftwareApplication' => 'SoftwareApplication',
726
+ 'TechArticle' => 'TechArticle',
727
+ 'WebPage' => 'WebPage'
728
+ ),
729
+ 'Event' => array(
730
+ 'Event' => 'Event',
731
+ ),
732
+ 'Game' => array(
733
+ 'VideoGame' => 'VideoGame'
734
+ ),
735
+ 'Intangible' => array(
736
+ 'JobPosting' => 'JobPosting',
737
+ 'Service' => 'Service',
738
+ 'Trip' => 'Trip',
739
+
740
+ ),
741
+ 'Media' => array(
742
+ 'AudioObject' => 'AudioObject',
743
+ 'VideoObject' => 'VideoObject'
744
+ ),
745
+ 'Medical' => array(
746
+ 'MedicalCondition' => 'MedicalCondition',
747
+ ),
748
+ 'Organization' => array(
749
+ 'local_business' => 'Local Business',
750
+ ),
751
+ 'Product' => array(
752
+ 'Product' => 'Product',
753
+ ),
754
+ 'Place' => array(
755
+ 'TouristAttraction' => 'TouristAttraction',
756
+ 'TouristDestination' => 'TouristDestination',
757
+ 'LandmarksOrHistoricalBuildings' => 'LandmarksOrHistoricalBuildings',
758
+ ),
759
+ 'PlaceOfWorship' => array(
760
+ 'HinduTemple' => 'HinduTemple',
761
+ 'Church' => 'Church',
762
+ 'Mosque' => 'Mosque',
763
+ ),
764
+ 'Thing' => array(
765
+ 'Person' => 'Person',
766
+ )
767
+ );
768
+ $all_business_type = array(
769
+ 'animalshelter' => 'Animal Shelter',
770
+ 'automotivebusiness' => 'Automotive Business',
771
+ 'childcare' => 'ChildCare',
772
+ 'dentist' => 'Dentist',
773
+ 'drycleaningorlaundry' => 'Dry Cleaning Or Laundry',
774
+ 'emergencyservice' => 'Emergency Service',
775
+ 'employmentagency' => 'Employment Agency',
776
+ 'entertainmentbusiness' => 'Entertainment Business',
777
+ 'financialservice' => 'Financial Service',
778
+ 'foodestablishment' => 'Food Establishment',
779
+ 'governmentoffice' => 'Government Office',
780
+ 'healthandbeautybusiness' => 'Health And Beauty Business',
781
+ 'homeandconstructionbusiness' => 'Home And Construction Business',
782
+ 'internetcafe' => 'Internet Cafe',
783
+ 'legalservice' => 'Legal Service',
784
+ 'library' => 'Library',
785
+ 'lodgingbusiness' => 'Lodging Business',
786
+ 'professionalservice' => 'Professional Service',
787
+ 'radiostation' => 'Radio Station',
788
+ 'realestateagent' => 'Real Estate Agent',
789
+ 'recyclingcenter' => 'Recycling Center',
790
+ 'selfstorage' => 'Self Storage',
791
+ 'shoppingcenter' => 'Shopping Center',
792
+ 'sportsactivitylocation' => 'Sports Activity Location',
793
+ 'store' => 'Store',
794
+ 'televisionstation' => 'Television Station',
795
+ 'touristinformationcenter' => 'Tourist Information Center',
796
+ 'travelagency' => 'Travel Agency',
797
+ );
798
+
799
+ $all_automotive_array = array(
800
+ 'autobodyshop' => 'Auto Body Shop',
801
+ 'autodealer' => 'Auto Dealer',
802
+ 'autopartsstore' => 'Auto Parts Store',
803
+ 'autorental' => 'Auto Rental',
804
+ 'autorepair' => 'Auto Repair',
805
+ 'autowash' => 'Auto Wash',
806
+ 'gasstation' => 'Gas Station',
807
+ 'motorcycledealer' => 'Motorcycle Dealer',
808
+ 'motorcyclerepair' => 'Motorcycle Repair'
809
+ );
810
+
811
+ $all_emergency_array = array(
812
+ 'firestation' => 'Fire Station',
813
+ 'hospital' => 'Hospital',
814
+ 'policestation' => 'Police Station',
815
+ );
816
+ $all_entertainment_array = array(
817
+ 'adultentertainment' => 'Adult Entertainment',
818
+ 'amusementpark' => 'Amusement Park',
819
+ 'artgallery' => 'Art Gallery',
820
+ 'casino' => 'Casino',
821
+ 'comedyclub' => 'Comedy Club',
822
+ 'movietheater' => 'Movie Theater',
823
+ 'nightclub' => 'Night Club',
824
+
825
+ );
826
+ $all_financial_array = array(
827
+ 'accountingservice' => 'Accounting Service',
828
+ 'automatedteller' => 'Automated Teller',
829
+ 'bankorcredit_union' => 'Bank Or Credit Union',
830
+ 'insuranceagency' => 'Insurance Agency',
831
+
832
+ );
833
+
834
+ $all_food_establishment_array = array(
835
+ 'bakery' => 'Bakery',
836
+ 'barorpub' => 'Bar Or Pub',
837
+ 'brewery' => 'Brewery',
838
+ 'cafeorcoffee_shop' => 'Cafe Or Coffee Shop',
839
+ 'fastfoodrestaurant' => 'Fast Food Restaurant',
840
+ 'icecreamshop' => 'Ice Cream Shop',
841
+ 'restaurant' => 'Restaurant',
842
+ 'winery' => 'Winery',
843
+
844
+ );
845
+ $all_health_and_beauty_array = array(
846
+ 'beautysalon' => 'Beauty Salon',
847
+ 'dayspa' => 'DaySpa',
848
+ 'hairsalon' => 'Hair Salon',
849
+ 'healthclub' => 'Health Club',
850
+ 'nailsalon' => 'Nail Salon',
851
+ 'tattooparlor' => 'Tattoo Parlor',
852
+ );
853
+
854
+ $all_home_and_construction_array = array(
855
+ 'electrician' => 'Electrician',
856
+ 'generalcontractor' => 'General Contractor',
857
+ 'hvacbusiness' => 'HVAC Business',
858
+ 'locksmith' => 'Locksmith',
859
+ 'movingcompany' => 'Moving Company',
860
+ 'plumber' => 'Plumber',
861
+ 'roofingcontractor' => 'Roofing Contractor',
862
+ 'housepainter' => 'House Painter',
863
+ );
864
+
865
+ $all_legal_service_array = array(
866
+ 'attorney' => 'Attorney',
867
+ 'notary' => 'Notary',
868
+ );
869
+
870
+ $all_lodging_array = array(
871
+ 'bedandbreakfast' => 'Bed And Breakfast',
872
+ 'campground' => 'Campground',
873
+ 'hostel' => 'Hostel',
874
+ 'hotel' => 'Hotel',
875
+ 'motel' => 'Motel',
876
+ 'resort' => 'Resort',
877
+ );
878
+
879
+ $all_sports_activity_location = array(
880
+ 'bowlingalley' => 'Bowling Alley',
881
+ 'exercisegym' => 'Exercise Gym',
882
+ 'golfcourse' => 'Golf Course',
883
+ 'healthclub' => 'Health Club',
884
+ 'publicswimming_pool' => 'Public Swimming Pool',
885
+ 'skiresort' => 'Ski Resort',
886
+ 'sportsclub' => 'Sports Club',
887
+ 'stadiumorarena' => 'Stadium Or Arena',
888
+ 'tenniscomplex' => 'Tennis Complex'
889
+ );
890
+ $all_store = array(
891
+ 'autopartsstore' => 'Auto Parts Store',
892
+ 'bikestore' => 'Bike Store',
893
+ 'bookstore' => 'Book Store',
894
+ 'clothingstore' => 'Clothing Store',
895
+ 'computerstore' => 'Computer Store',
896
+ 'conveniencestore' => 'Convenience Store',
897
+ 'departmentstore' => 'Department Store',
898
+ 'electronicsstore' => 'Electronics Store',
899
+ 'florist' => 'Florist',
900
+ 'furniturestore' => 'Furniture Store',
901
+ 'gardenstore' => 'Garden Store',
902
+ 'grocerystore' => 'Grocery Store',
903
+ 'hardwarestore' => 'Hardware Store',
904
+ 'hobbyshop' => 'Hobby Shop',
905
+ 'homegoodsstore' => 'HomeGoods Store',
906
+ 'jewelrystore' => 'Jewelry Store',
907
+ 'liquorstore' => 'Liquor Store',
908
+ 'mensclothingstore' => 'Mens Clothing Store',
909
+ 'mobilephonestore' => 'Mobile Phone Store',
910
+ 'movierentalstore' => 'Movie Rental Store',
911
+ 'musicstore' => 'Music Store',
912
+ 'officeequipmentstore' => 'Office Equipment Store',
913
+ 'outletstore' => 'Outlet Store',
914
+ 'pawnshop' => 'Pawn Shop',
915
+ 'petstore' => 'Pet Store',
916
+ 'shoestore' => 'Shoe Store',
917
+ 'sportinggoodsstore' => 'Sporting Goods Store',
918
+ 'tireshop' => 'Tire Shop',
919
+ 'toystore' => 'Toy Store',
920
+ 'wholesalestore' => 'Wholesale Store'
921
+ );
922
+ ?>
923
+ <!-- Below variable $style_business_type is static -->
924
+ <div class="misc-pub-section">
925
+ <table class="option-table-class saswp-option-table-class">
926
+ <tr>
927
+ <td><label for="schema_type"><?php echo esc_html__( 'Schema Type' ,'schema-and-structured-data-for-wp');?></label></td>
928
+ <td><select class="saswp-schame-type-select" id="schema_type" name="schema_type">
929
+ <?php
930
+
931
+ if(!empty($all_schema_array)){
932
+
933
+ foreach ($all_schema_array as $parent_type => $type) {
934
+
935
+ $option_html = '';
936
+
937
+ foreach($type as $key => $value){
938
+ $sel = '';
939
+ if($schema_type == $key){
940
+ $sel = 'selected';
941
+ }
942
+ $option_html.= "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
943
+
944
+ }
945
+
946
+ echo '<optgroup label="'.esc_attr($parent_type).'">';
947
+ //Escaping is done while adding data in this variable
948
+ echo $option_html;
949
+ echo '</optgroup>';
950
+ }
951
+
952
+ }
953
+ ?>
954
+ </select>
955
+
956
+ <?php if($schema_type == 'qanda') { ?>
957
+ <span class="saswp-schem-type-note"><?php echo esc_html__('Note: Currently supported with DW Question & Answer', 'schema-and-structured-data-for-wp' ); ?> <a target="_blank" href="https://wordpress.org/plugins/dw-question-answer/"><?php echo esc_html__('Link', 'schema-and-structured-data-for-wp' ); ?></a></span>
958
+ <?php }else{ ?>
959
+ <span class="saswp-schem-type-note saswp_hide"><?php echo esc_html__('Note: Currently supported with DW Question & Answer', 'schema-and-structured-data-for-wp' ); ?> <a target="_blank" href="https://wordpress.org/plugins/dw-question-answer/"><?php echo esc_html__('Link', 'schema-and-structured-data-for-wp' ); ?></a></span>
960
+ <?php } ?>
961
+
962
+ </td>
963
+ </tr>
964
+ <tr class="saswp-business-type-tr" <?php echo $style_business_type; ?>>
965
+ <td>
966
+ <?php echo esc_html__('Business Type', 'schema-and-structured-data-for-wp' ); ?>
967
+ </td>
968
+ <td>
969
+ <select id="saswp_business_type" name="saswp_business_type">
970
+ <?php
971
+
972
+
973
+ foreach ($all_business_type as $key => $value) {
974
+ $sel = '';
975
+ if($business_type==$key){
976
+ $sel = 'selected';
977
+ }
978
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
979
+ }
980
+ ?>
981
+ </select>
982
+ </td>
983
+ </tr>
984
+ <tr class="saswp-automotivebusiness-tr" <?php if(!array_key_exists($business_name, $all_automotive_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
985
+ <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
986
+ <td>
987
+ <select id="saswp_automotive" name="saswp_business_name">
988
+ <?php
989
+
990
+ foreach ($all_automotive_array as $key => $value) {
991
+ $sel = '';
992
+ if($business_name==$key){
993
+ $sel = 'selected';
994
+ }
995
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
996
+ }
997
+ ?>
998
+ </select>
999
+ </td>
1000
+
1001
+ </tr>
1002
+ <tr class="saswp-emergencyservice-tr" <?php if(!array_key_exists($business_name, $all_emergency_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1003
+ <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1004
+ <td>
1005
+ <select id="saswp_emergency_service" name="saswp_business_name">
1006
+ <?php
1007
+
1008
+ foreach ($all_emergency_array as $key => $value) {
1009
+ $sel = '';
1010
+ if($business_name==$key){
1011
+ $sel = 'selected';
1012
+ }
1013
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1014
+ }
1015
+ ?>
1016
+ </select>
1017
+ </td>
1018
+ </tr>
1019
+ <tr class="saswp-entertainmentbusiness-tr" <?php if(!array_key_exists($business_name, $all_entertainment_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1020
+ <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1021
+ <td>
1022
+ <select id="saswp_entertainment" name="saswp_business_name">
1023
+ <?php
1024
+
1025
+ foreach ($all_entertainment_array as $key => $value) {
1026
+ $sel = '';
1027
+ if($business_name == $key){
1028
+ $sel = 'selected';
1029
+ }
1030
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1031
+ }
1032
+ ?>
1033
+ </select>
1034
+ </td>
1035
+ </tr>
1036
+ <tr class="saswp-financialservice-tr" <?php if(!array_key_exists($business_name, $all_financial_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1037
+ <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1038
+ <td>
1039
+ <select id="saswp_financial_service" name="saswp_business_name">
1040
+ <?php
1041
+
1042
+
1043
+ foreach ($all_financial_array as $key => $value) {
1044
+ $sel = '';
1045
+ if($business_name == $key){
1046
+ $sel = 'selected';
1047
+ }
1048
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1049
+ }
1050
+ ?>
1051
+ </select>
1052
+ </td>
1053
+ </tr>
1054
+ <tr class="saswp-foodestablishment-tr" <?php if(!array_key_exists($business_name, $all_food_establishment_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1055
+ <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1056
+ <td>
1057
+ <select id="saswp_food_establishment" name="saswp_business_name">
1058
+ <?php
1059
+
1060
+ foreach ($all_food_establishment_array as $key => $value) {
1061
+ $sel = '';
1062
+ if($business_name==$key){
1063
+ $sel = 'selected';
1064
+ }
1065
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1066
+ }
1067
+ ?>
1068
+ </select>
1069
+ </td>
1070
+ </tr>
1071
+ <tr class="saswp-healthandbeautybusiness-tr" <?php if(!array_key_exists($business_name, $all_health_and_beauty_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1072
+ <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1073
+ <td>
1074
+ <select id="saswp_health_and_beauty" name="saswp_business_name">
1075
+ <?php
1076
+
1077
+
1078
+ foreach ($all_health_and_beauty_array as $key => $value) {
1079
+ $sel = '';
1080
+ if($business_name==$key){
1081
+ $sel = 'selected';
1082
+ }
1083
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1084
+ }
1085
+ ?>
1086
+ </select>
1087
+ </td>
1088
+ </tr>
1089
+ <tr class="saswp-homeandconstructionbusiness-tr" <?php if(!array_key_exists($business_name, $all_home_and_construction_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1090
+ <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1091
+ <td>
1092
+ <select id="saswp_home_and_construction" name="saswp_business_name">
1093
+ <?php
1094
+
1095
+ foreach ($all_home_and_construction_array as $key => $value) {
1096
+ $sel = '';
1097
+ if($business_name==$key){
1098
+ $sel = 'selected';
1099
+ }
1100
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1101
+ }
1102
+ ?>
1103
+ </select>
1104
+ </td>
1105
+ </tr>
1106
+ <tr class="saswp-legalservice-tr" <?php if(!array_key_exists($business_name, $all_legal_service_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1107
+ <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1108
+ <td>
1109
+ <select id="saswp_legal_service" name="saswp_business_name">
1110
+ <?php
1111
+
1112
+ foreach ($all_legal_service_array as $key => $value) {
1113
+ $sel = '';
1114
+ if($business_name==$key){
1115
+ $sel = 'selected';
1116
+ }
1117
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1118
+ }
1119
+ ?>
1120
+ </select>
1121
+ </td>
1122
+ </tr>
1123
+ <tr class="saswp-lodgingbusiness-tr" <?php if(!array_key_exists($business_name, $all_lodging_array)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1124
+ <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1125
+ <td>
1126
+ <select id="saswp_lodging" name="saswp_business_name">
1127
+ <?php
1128
+
1129
+ foreach ($all_lodging_array as $key => $value) {
1130
+ $sel = '';
1131
+ if($business_name==$key){
1132
+ $sel = 'selected';
1133
+ }
1134
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1135
+ }
1136
+ ?>
1137
+ </select>
1138
+ </td>
1139
+ </tr>
1140
+ <tr class="saswp-sportsactivitylocation-tr" <?php if(!array_key_exists($business_name, $all_sports_activity_location)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1141
+ <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1142
+ <td>
1143
+ <select id="saswp_sports_activity_location" name="saswp_business_name">
1144
+ <?php
1145
+
1146
+ foreach ($all_sports_activity_location as $key => $value) {
1147
+ $sel = '';
1148
+ if($business_name==$key){
1149
+ $sel = 'selected';
1150
+ }
1151
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1152
+ }
1153
+ ?>
1154
+ </select>
1155
+ </td>
1156
+ </tr>
1157
+ <tr class="saswp-store-tr" <?php if(!array_key_exists($business_name, $all_store)){ echo 'style="display:none;"';}else{ echo $style_business_name;} ?>>
1158
+ <td><?php echo esc_html__('Sub Business Type', 'schema-and-structured-data-for-wp' ); ?></td>
1159
+ <td>
1160
+ <select id="saswp_store" name="saswp_business_name">
1161
+ <?php
1162
+
1163
+
1164
+ foreach ($all_store as $key => $value) {
1165
+ $sel = '';
1166
+ if($business_name==$key){
1167
+ $sel = 'selected';
1168
+ }
1169
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1170
+ }
1171
+ ?>
1172
+ </select>
1173
+ </td>
1174
+ </tr>
1175
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1176
+ <td><?php echo esc_html__('Business Name', 'schema-and-structured-data-for-wp' ); ?></td>
1177
+ <td><input value="<?php if(isset($business_details['local_business_name'])) { echo esc_attr($business_details['local_business_name']); } ?>" type="text" name="local_business_name" placeholder="<?php echo esc_html__('Business Name', 'schema-and-structured-data-for-wp' ); ?>"></td>
1178
+ </tr>
1179
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1180
+ <td><?php echo esc_html__('Description', 'schema-and-structured-data-for-wp' ); ?></td>
1181
+ <td><textarea placeholder="Description" rows="3" cols="70" name="local_business_description"><?php if(isset($business_details['local_business_description'])){echo esc_attr($business_details['local_business_description']); } ?></textarea></td>
1182
+ </tr>
1183
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1184
+ <td><?php echo esc_html__('Street Address', 'schema-and-structured-data-for-wp' ); ?></td>
1185
+ <td><input value="<?php if(isset($business_details['local_street_address'])) { echo esc_attr($business_details['local_street_address']); } ?>" type="text" name="local_street_address" placeholder="<?php echo esc_html__('Street Address', 'schema-and-structured-data-for-wp' ); ?>"></td>
1186
+ </tr>
1187
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1188
+ <td><?php echo esc_html__('City', 'schema-and-structured-data-for-wp' ); ?></td>
1189
+ <td><input value="<?php if(isset($business_details['local_city'])){ echo esc_attr($business_details['local_city']);} ?>" type="text" name="local_city" placeholder="<?php echo esc_html__('City', 'schema-and-structured-data-for-wp' ); ?>"></td>
1190
+ </tr>
1191
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1192
+ <td><?php echo esc_html__('State', 'schema-and-structured-data-for-wp' ); ?></td>
1193
+ <td><input value="<?php if(isset($business_details['local_state'])){echo esc_attr($business_details['local_state']);} ?>" type="text" name="local_state" placeholder="<?php echo esc_html__('State', 'schema-and-structured-data-for-wp' ); ?>"></td>
1194
+ </tr>
1195
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1196
+ <td><?php echo esc_html__('Postal Code', 'schema-and-structured-data-for-wp' ); ?></td>
1197
+ <td><input value="<?php if(isset($business_details['local_postal_code'])) {echo esc_attr($business_details['local_postal_code']); } ?>" type="text" name="local_postal_code" placeholder="<?php echo esc_html__('Postal Code', 'schema-and-structured-data-for-wp' ); ?>"></td>
1198
+ </tr>
1199
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1200
+ <td><?php echo esc_html__('Latitude', 'schema-and-structured-data-for-wp' ); ?></td>
1201
+ <td><input value="<?php if(isset($business_details['local_latitude'])) {echo esc_attr($business_details['local_latitude']); } ?>" type="text" name="local_latitude" placeholder="<?php echo esc_html__('40.761293', 'schema-and-structured-data-for-wp' ); ?>"></td>
1202
+ </tr>
1203
+
1204
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1205
+ <td><?php echo esc_html__('Longitude', 'schema-and-structured-data-for-wp' ); ?></td>
1206
+ <td><input value="<?php if(isset($business_details['local_longitude'])) {echo esc_attr($business_details['local_longitude']); } ?>" type="text" name="local_longitude" placeholder="<?php echo esc_html__('-73.982294', 'schema-and-structured-data-for-wp' ); ?>"></td>
1207
+ </tr>
1208
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1209
+ <td><?php echo esc_html__('Phone', 'schema-and-structured-data-for-wp' ); ?></td>
1210
+ <td><input value="<?php if(isset($business_details['local_phone'])){echo esc_attr($business_details['local_phone']); } ?>" type="text" name="local_phone" placeholder="<?php echo esc_html__('Phone', 'schema-and-structured-data-for-wp' ); ?>"></td>
1211
+ </tr>
1212
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1213
+ <td><?php echo esc_html__('Website', 'schema-and-structured-data-for-wp' ); ?></td>
1214
+ <td><input value="<?php if(isset($business_details['local_website'])){echo esc_attr($business_details['local_website']); }else{ echo site_url();} ?>" type="text" name="local_website" placeholder="<?php echo esc_html__('Website', 'schema-and-structured-data-for-wp' ); ?>"></td>
1215
+ </tr>
1216
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1217
+ <td><?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?></td>
1218
+ <td style="display: flex; width: 97%">
1219
+ <input value="<?php if(isset($business_details['local_business_logo'])) { echo esc_url($business_details['local_business_logo']['url']);} else { echo esc_url(saswp_remove_warnings($logo, 0, 'saswp_string')); } ?>" id="local_business_logo" type="text" name="local_business_logo[url]" placeholder="<?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?>" readonly="readonly" style="background: #FFF;">
1220
+ <input value="<?php if(isset($business_details['local_business_logo'])) { echo esc_attr($business_details['local_business_logo']['id']);} else { echo esc_attr($custom_logo_id); }?>" data-id="local_business_logo_id" type="hidden" name="local_business_logo[id]">
1221
+ <input value="<?php if(isset($business_details['local_business_logo'])) { echo esc_attr($business_details['local_business_logo']['width']);} else { echo esc_attr(saswp_remove_warnings($logo, 1, 'saswp_string')); } ?>" data-id="local_business_logo_width" type="hidden" name="local_business_logo[width]">
1222
+ <input value="<?php if(isset($business_details['local_business_logo'])) { echo esc_attr($business_details['local_business_logo']['height']);} else { echo esc_attr(saswp_remove_warnings($logo, 2, 'saswp_string')); } ?>" data-id="local_business_logo_height" type="hidden" name="local_business_logo[height]">
1223
+ <input data-id="media" class="button" id="local_business_logo_button" type="button" value="Upload"></td>
1224
+ </tr>
1225
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1226
+ <td><?php echo esc_html__('Operation Days', 'schema-and-structured-data-for-wp' ); ?></td>
1227
+ <td>
1228
+ <textarea id="saswp_dayofweek" placeholder="Mo-Sa 11:00-14:30 <?="\n"?>Mo-Th 17:00-21:30 <?="\n"?>Fr-Sa 17:00-22:00" rows="5" cols="70" name="saswp_dayofweek"><?php if(isset($dayoftheweek)){echo $dayoftheweek; } ?></textarea>
1229
+ <p><?php echo esc_html__( 'Note: Enter days and time in given format', 'schema-and-structured-data-for-wp' ); ?></p>
1230
+ </td>
1231
+ </tr>
1232
+
1233
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1234
+ <td><?php echo esc_html__('Price Range', 'schema-and-structured-data-for-wp' ); ?></td>
1235
+ <td><input value="<?php if(isset($business_details['local_price_range'])){echo esc_attr($business_details['local_price_range']); } ?>" type="text" name="local_price_range" placeholder="<?php echo esc_html__('$10-$50 or $$$ ', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1236
+ </tr>
1237
+
1238
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1239
+ <td><?php echo esc_html__('Menu', 'schema-and-structured-data-for-wp' ); ?></td>
1240
+ <td><input value="<?php if(isset($business_details['local_menu'])){echo esc_attr($business_details['local_menu']); } ?>" type="text" name="local_menu" placeholder="<?php echo esc_html__('http://www.example.com/menu', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1241
+ </tr>
1242
+
1243
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1244
+ <td><?php echo esc_html__('HasMap', 'schema-and-structured-data-for-wp' ); ?></td>
1245
+ <td><input value="<?php if(isset($business_details['local_hasmap'])){echo esc_attr($business_details['local_hasmap']); } ?>" type="text" name="local_hasmap" placeholder="https://goo.gl/maps/tb9hzMLNp942" ></td>
1246
+ </tr>
1247
+
1248
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1249
+ <td><?php echo esc_html__('Serves Cuisine', 'schema-and-structured-data-for-wp' ); ?></td>
1250
+ <td><input value="<?php echo (isset($business_details['local_serves_cuisine'])? esc_attr($business_details['local_serves_cuisine']): ''); ?>" type="text" name="local_serves_cuisine" placeholder="<?php echo esc_html__('American, Chinese', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1251
+ </tr>
1252
 
1253
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1254
+ <td><?php echo esc_html__('Facebook', 'schema-and-structured-data-for-wp' ); ?></td>
1255
+ <td><input value="<?php echo (isset($business_details['local_facebook'])? esc_attr($business_details['local_facebook']): ''); ?>" type="text" name="local_facebook" placeholder="<?php echo esc_html__('https://facebook.com/examplepage', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1256
+ </tr>
1257
 
1258
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1259
+ <td><?php echo esc_html__('Twitter', 'schema-and-structured-data-for-wp' ); ?></td>
1260
+ <td><input value="<?php echo (isset($business_details['local_twitter'])? esc_attr($business_details['local_twitter']): ''); ?>" type="text" name="local_twitter" placeholder="<?php echo esc_html__('https://twitter.com/examplepage', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1261
+ </tr>
1262
 
1263
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1264
+ <td><?php echo esc_html__('Instagram', 'schema-and-structured-data-for-wp' ); ?></td>
1265
+ <td><input value="<?php echo (isset($business_details['local_instagram'])? esc_attr($business_details['local_instagram']): ''); ?>" type="text" name="local_instagram" placeholder="<?php echo esc_html__('https://instagram.com/examplepage', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1266
+ </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1267
 
1268
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1269
+ <td><?php echo esc_html__('Pinterest', 'schema-and-structured-data-for-wp' ); ?></td>
1270
+ <td><input value="<?php echo (isset($business_details['local_pinterest'])? esc_attr($business_details['local_pinterest']): ''); ?>" type="text" name="local_pinterest" placeholder="<?php echo esc_html__('https://pinterest.com/examplepage', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1271
+ </tr>
1272
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1273
+ <td><?php echo esc_html__('LinkedIn', 'schema-and-structured-data-for-wp' ); ?></td>
1274
+ <td><input value="<?php echo (isset($business_details['local_linkedin'])? esc_attr($business_details['local_linkedin']): ''); ?>" type="text" name="local_linkedin" placeholder="<?php echo esc_html__('https://linkedin.com/examplepage', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1275
+ </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1276
 
1277
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1278
+ <td><?php echo esc_html__('SoundCloud', 'schema-and-structured-data-for-wp' ); ?></td>
1279
+ <td><input value="<?php echo (isset($business_details['local_soundcloud'])? esc_attr($business_details['local_soundcloud']): ''); ?>" type="text" name="local_soundcloud" placeholder="<?php echo esc_html__('https://soundcloud.com//examplepage', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1280
+ </tr>
1281
+
1282
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1283
+ <td><?php echo esc_html__('Tumblr', 'schema-and-structured-data-for-wp' ); ?></td>
1284
+ <td><input value="<?php echo (isset($business_details['local_tumblr'])? esc_attr($business_details['local_tumblr']): ''); ?>" type="text" name="local_tumblr" placeholder="<?php echo esc_html__('https://tumblr.com//examplepage', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1285
+ </tr>
1286
+
1287
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1288
+ <td><?php echo esc_html__('Youtube', 'schema-and-structured-data-for-wp' ); ?></td>
1289
+ <td><input value="<?php echo (isset($business_details['local_youtube'])? esc_attr($business_details['local_youtube']): ''); ?>" type="text" name="local_youtube" placeholder="<?php echo esc_html__('https://youtube.com//examplepage', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1290
+ </tr>
1291
+
1292
+ <tr class="saswp-business-text-field-tr" <?php echo $style_business_type; ?>>
1293
+ <td><?php echo esc_html__('Aggregate Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1294
+ <td>
1295
+ <input class="saswp-enable-rating-review-local_business" type="checkbox" name="local_enable_rating" value="1" <?php if(isset($business_details['local_enable_rating'])){echo 'checked'; }else{ echo ''; } ?>>
1296
+ </td>
1297
+ </tr>
1298
+ <tr class="saswp-business-text-field-tr saswp-rating-review-local_business">
1299
+ <td><?php echo esc_html__('Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1300
+ <td><input value="<?php if(isset($business_details['local_rating'])){echo esc_attr($business_details['local_rating']); } ?>" type="text" name="local_rating" placeholder="<?php echo esc_html__('5.0', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1301
+ </tr>
1302
+ <tr class="saswp-business-text-field-tr saswp-rating-review-local_business" <?php echo $style_business_type; ?>>
1303
+ <td><?php echo esc_html__('Number of Reviews', 'schema-and-structured-data-for-wp' ); ?></td>
1304
+ <td><input value="<?php if(isset($business_details['local_review_count'])){echo esc_attr($business_details['local_review_count']); } ?>" type="text" name="local_review_count" placeholder="<?php echo esc_html__('10', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1305
+ </tr>
1306
+
1307
+ <!-- Service Schema type starts here -->
1308
+
1309
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1310
+ <td><?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?></td>
1311
+ <td><input value="<?php if(isset($service_details['saswp_service_schema_name'])){echo esc_attr($service_details['saswp_service_schema_name']); } ?>" type="text" name="saswp_service_schema_name" placeholder="<?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1312
+ </tr>
1313
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1314
+ <td><?php echo esc_html__('Service Type', 'schema-and-structured-data-for-wp' ); ?></td>
1315
+ <td>
1316
+ <input value="<?php if(isset($service_details['saswp_service_schema_type'])){echo esc_attr($service_details['saswp_service_schema_type']); } ?>" type="text" name="saswp_service_schema_type" placeholder="<?php echo esc_html__('Service Type', 'schema-and-structured-data-for-wp' ); ?>" >
1317
+ <p><?php echo esc_html__('The type of service being offered, e.g. veterans benefits, emergency relief, etc.', 'schema-and-structured-data-for-wp' ); ?></p>
1318
+ </td>
1319
+ </tr>
1320
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1321
+ <td><?php echo esc_html__('Provider Name', 'schema-and-structured-data-for-wp' ); ?></td>
1322
+ <td><input value="<?php if(isset($service_details['saswp_service_schema_provider_name'])){echo esc_attr($service_details['saswp_service_schema_provider_name']); } ?>" type="text" name="saswp_service_schema_provider_name" placeholder="<?php echo esc_html__('Provider Name', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1323
+ </tr>
1324
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1325
+ <td><?php echo esc_html__('Provider Type', 'schema-and-structured-data-for-wp' ); ?></td>
1326
+ <td>
1327
+ <select name="saswp_service_schema_provider_type">
1328
+ <?php
1329
+
1330
+ foreach ($provider_type as $key => $value) {
1331
+
1332
+ $sel = '';
1333
+ if(saswp_remove_warnings($service_details, 'saswp_service_schema_provider_type', 'saswp_string')==$key){
1334
+ $sel = 'selected';
1335
+ }
1336
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1337
+
1338
+ }
1339
+ ?>
1340
+ </select>
1341
+
1342
+ </td>
1343
+ </tr>
1344
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1345
+ <td><?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?></td>
1346
+ <td style="display: flex; width: 97%">
1347
+ <input value="<?php if(isset($service_details['saswp_service_schema_image'])) { echo esc_url($service_details['saswp_service_schema_image']['url']);} else { echo esc_url(saswp_remove_warnings($logo, 0, 'saswp_string')); } ?>" id="saswp_service_schema_image" type="text" name="saswp_service_schema_image[url]" placeholder="<?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?>" readonly="readonly" style="background: #FFF;">
1348
+ <input value="<?php if(isset($service_details['saswp_service_schema_image'])) { echo esc_attr($service_details['saswp_service_schema_image']['id']);} else { echo esc_attr($custom_logo_id); }?>" data-id="saswp_service_schema_image_id" type="hidden" name="saswp_service_schema_image[id]">
1349
+ <input value="<?php if(isset($service_details['saswp_service_schema_image'])) { echo esc_attr($service_details['saswp_service_schema_image']['width']);} else { echo esc_attr(saswp_remove_warnings($logo, 1, 'saswp_string')); } ?>" data-id="saswp_service_schema_image_width" type="hidden" name="saswp_service_schema_image[width]">
1350
+ <input value="<?php if(isset($service_details['saswp_service_schema_image'])) { echo esc_attr($service_details['saswp_service_schema_image']['height']);} else { echo esc_attr(saswp_remove_warnings($logo, 2, 'saswp_string')); } ?>" data-id="saswp_service_schema_image_height" type="hidden" name="saswp_service_schema_image[height]">
1351
+ <input data-id="media" class="button" id="saswp_service_schema_image_button" type="button" value="Upload"></td>
1352
+ </tr>
1353
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1354
+ <td><?php echo esc_html__('Locality', 'schema-and-structured-data-for-wp' ); ?></td>
1355
+ <td><input value="<?php if(isset($service_details['saswp_service_schema_locality'])){echo esc_attr($service_details['saswp_service_schema_locality']); } ?>" type="text" name="saswp_service_schema_locality" placeholder="<?php echo esc_html__('Locality', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1356
+ </tr>
1357
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1358
+ <td><?php echo esc_html__('PostalCode', 'schema-and-structured-data-for-wp' ); ?></td>
1359
+ <td><input value="<?php if(isset($service_details['saswp_service_schema_postal_code'])){echo esc_attr($service_details['saswp_service_schema_postal_code']); } ?>" type="text" name="saswp_service_schema_postal_code" placeholder="<?php echo esc_html__('Postal Code', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1360
+ </tr>
1361
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1362
+ <td><?php echo esc_html__('Telephone', 'schema-and-structured-data-for-wp' ); ?></td>
1363
+ <td><input value="<?php if(isset($service_details['saswp_service_schema_telephone'])){echo esc_attr($service_details['saswp_service_schema_telephone']); } ?>" type="text" name="saswp_service_schema_telephone" placeholder="<?php echo esc_html__('Telephone', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1364
+ </tr>
1365
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1366
+ <td><?php echo esc_html__('Price Range', 'schema-and-structured-data-for-wp' ); ?></td>
1367
+ <td><input value="<?php if(isset($service_details['saswp_service_schema_price_range'])){echo esc_attr($service_details['saswp_service_schema_price_range']); } ?>" type="text" name="saswp_service_schema_price_range" placeholder="<?php echo esc_html__('$10-$50 or $$$ ', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1368
+ </tr>
1369
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1370
+ <td><?php echo esc_html__('Description', 'schema-and-structured-data-for-wp' ); ?></td>
1371
+ <td><textarea placeholder="Description" rows="3" cols="70" name="saswp_service_schema_description"><?php if(isset($service_details['saswp_service_schema_description'])){echo esc_attr($service_details['saswp_service_schema_description']); } ?></textarea></td>
1372
+ </tr>
1373
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1374
+ <td><?php echo esc_html__('Area Served (City)', 'schema-and-structured-data-for-wp' ); ?></td>
1375
+ <td><textarea placeholder="New York, Los Angeles" rows="3" cols="70" name="saswp_service_schema_area_served"><?php if(isset($service_details['saswp_service_schema_area_served'])){echo esc_attr($service_details['saswp_service_schema_area_served']); } ?></textarea><p>Note: Enter all the City name in comma separated</p></td>
1376
+ </tr>
1377
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1378
+ <td><?php echo esc_html__('Service Offer', 'schema-and-structured-data-for-wp' ); ?></td>
1379
+ <td><textarea placeholder="Apartment light cleaning, Carpet cleaning" rows="3" cols="70" name="saswp_service_schema_service_offer"><?php if(isset($service_details['saswp_service_schema_service_offer'])){echo esc_attr($service_details['saswp_service_schema_service_offer']); } ?></textarea><p>Note: Enter all the service offer in comma separated</p></td>
1380
+ </tr>
1381
+
1382
+ <tr class="saswp-service-text-field-tr" <?php echo $style_service_name; ?>>
1383
+ <td><?php echo esc_html__('Aggregate Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1384
+ <td>
1385
+ <input class="saswp-enable-rating-review-service" type="checkbox" name="saswp_service_schema_enable_rating" value="1" <?php if(isset($service_details['saswp_service_schema_enable_rating'])){echo 'checked'; }else{ echo ''; } ?>>
1386
+ </td>
1387
+ </tr>
1388
+
1389
+ <tr class="saswp-service-text-field-tr saswp-rating-review-service" <?php echo $style_service_name; ?>>
1390
+ <td><?php echo esc_html__('Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1391
+ <td><input value="<?php if(isset($service_details['saswp_service_schema_rating'])){echo esc_attr($service_details['saswp_service_schema_rating']); } ?>" type="text" name="saswp_service_schema_rating" placeholder="<?php echo esc_html__('5.0', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1392
+ </tr>
1393
+ <tr class="saswp-service-text-field-tr saswp-rating-review-service" <?php echo $style_business_type; ?>>
1394
+ <td><?php echo esc_html__('Number of Reviews', 'schema-and-structured-data-for-wp' ); ?></td>
1395
+ <td><input value="<?php if(isset($service_details['saswp_service_schema_review_count'])){echo esc_attr($service_details['saswp_service_schema_review_count']); } ?>" type="text" name="saswp_service_schema_review_count" placeholder="<?php echo esc_html__('10', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1396
+ </tr>
1397
+
1398
+ <!-- Service Schema type ends here -->
1399
+
1400
+ <!-- Review Schema type starts here -->
1401
+ <tr class="saswp-review-text-field-tr" <?php echo $style_review_name; ?>>
1402
+ <td><?php echo esc_html__('Item Reviewed Type', 'schema-and-structured-data-for-wp' ); ?></td>
1403
+ <td>
1404
+
1405
+ <select data-id="<?php if(is_object($post)){ echo esc_attr($post->ID); } ?>" name="saswp_review_schema_item_type" class="saswp-item-reviewed">
1406
+ <?php
1407
+ foreach ($item_reviewed as $key => $value) {
1408
+ $sel = '';
1409
+ if(saswp_remove_warnings($review_details, 'saswp_review_schema_item_type', 'saswp_string')==$key){
1410
+ $sel = 'selected';
1411
+ }
1412
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1413
+ }
1414
+ ?>
1415
+ </select>
1416
+ </td>
1417
+ </tr>
1418
+
1419
+ <tr class="saswp-review-text-field-tr" <?php echo $style_review_name; ?>>
1420
+ <td><?php echo esc_html__('Review Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1421
+ <td>
1422
+ <input class="saswp-enable-rating-review-review" type="checkbox" name="saswp_review_schema_enable_rating" value="1" <?php if(isset($review_details['saswp_review_schema_enable_rating'])){echo 'checked'; }else{ echo ''; } ?>>
1423
+ </td>
1424
+ </tr>
1425
+ <tr class="saswp-review-text-field-tr saswp-rating-review-review" <?php echo $style_review_name; ?>>
1426
+ <td><?php echo esc_html__('Rating Value', 'schema-and-structured-data-for-wp' ); ?></td>
1427
+ <td><input value="<?php if(isset($review_details['saswp_review_schema_rating'])){echo esc_attr($review_details['saswp_review_schema_rating']); } ?>" type="text" name="saswp_review_schema_rating" placeholder="<?php echo esc_html__('5.0', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1428
+ </tr>
1429
+ <tr class="saswp-review-text-field-tr saswp-rating-review-review" <?php echo $style_business_type; ?>>
1430
+ <td><?php echo esc_html__('Best Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1431
+ <td><input value="<?php if(isset($review_details['saswp_review_schema_review_count'])){echo esc_attr($review_details['saswp_review_schema_review_count']); } ?>" type="text" name="saswp_review_schema_review_count" placeholder="<?php echo esc_html__('5.0', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1432
+ </tr>
1433
+
1434
+
1435
+ <!-- Review Schema type ends here -->
1436
+
1437
+ <!-- AudioObject Schema type starts here -->
1438
+
1439
+ <tr class="saswp-audio-text-field-tr">
1440
+ <td><?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?></td>
1441
+ <td><input value="<?php if(isset($audio_details['saswp_audio_schema_name'])){echo esc_attr($audio_details['saswp_audio_schema_name']); } ?>" type="text" name="saswp_audio_schema_name" placeholder="<?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1442
+ </tr>
1443
+
1444
+ <tr class="saswp-audio-text-field-tr">
1445
+ <td><?php echo esc_html__('Description', 'schema-and-structured-data-for-wp' ); ?></td>
1446
+ <td>
1447
+ <textarea placeholder="Description" rows="5" cols="70" name="saswp_audio_schema_description"><?php if(isset($audio_details['saswp_audio_schema_description'])){echo $audio_details['saswp_audio_schema_description']; } ?></textarea>
1448
+ </td>
1449
+ </tr>
1450
+
1451
+ <tr class="saswp-audio-text-field-tr">
1452
+ <td><?php echo esc_html__('Content Url', 'schema-and-structured-data-for-wp' ); ?></td>
1453
+ <td><input value="<?php if(isset($audio_details['saswp_audio_schema_contenturl'])){echo esc_attr($audio_details['saswp_audio_schema_contenturl']); } ?>" type="text" name="saswp_audio_schema_contenturl" placeholder="<?php echo esc_html__('Content Url', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1454
+ </tr>
1455
+
1456
+ <tr class="saswp-audio-text-field-tr">
1457
+ <td><?php echo esc_html__('Duration', 'schema-and-structured-data-for-wp' ); ?></td>
1458
+ <td><input value="<?php if(isset($audio_details['saswp_audio_schema_duration'])){echo esc_attr($audio_details['saswp_audio_schema_duration']); } ?>" type="text" name="saswp_audio_schema_duration" placeholder="<?php echo esc_html__('T0M15S', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1459
+ </tr>
1460
+
1461
+ <tr class="saswp-audio-text-field-tr">
1462
+ <td><?php echo esc_html__('Encoding Format', 'schema-and-structured-data-for-wp' ); ?></td>
1463
+ <td><input value="<?php if(isset($audio_details['saswp_audio_schema_encoding_format'])){echo esc_attr($audio_details['saswp_audio_schema_encoding_format']); } ?>" type="text" name="saswp_audio_schema_encoding_format" placeholder="<?php echo esc_html__('audio/mpeg', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1464
+ </tr>
1465
+
1466
+ <!-- AudioObject Schema type ends here -->
1467
+
1468
+ <!-- SoftwareApplication Schema type starts here -->
1469
+
1470
+ <tr class="saswp-softwareapplication-text-field-tr">
1471
+ <td><?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?></td>
1472
+ <td><input value="<?php if(isset($software_details['saswp_software_schema_name'])){echo esc_attr($software_details['saswp_software_schema_name']); } ?>" type="text" name="saswp_software_schema_name" placeholder="<?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1473
+ </tr>
1474
+
1475
+ <tr class="saswp-softwareapplication-text-field-tr">
1476
+ <td><?php echo esc_html__('Description', 'schema-and-structured-data-for-wp' ); ?></td>
1477
+ <td>
1478
+ <textarea placeholder="Description" rows="5" cols="70" name="saswp_software_schema_description"><?php if(isset($software_details['saswp_software_schema_description'])){echo $software_details['saswp_software_schema_description']; } ?></textarea>
1479
+ </td>
1480
+ </tr>
1481
+
1482
+ <tr class="saswp-softwareapplication-text-field-tr">
1483
+ <td><?php echo esc_html__('Operating System', 'schema-and-structured-data-for-wp' ); ?></td>
1484
+ <td><input value="<?php if(isset($software_details['saswp_software_schema_operating_system'])){echo esc_attr($software_details['saswp_software_schema_operating_system']); } ?>" type="text" name="saswp_software_schema_operating_system" placeholder="<?php echo esc_html__('eg. ANDROID', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1485
+ </tr>
1486
+
1487
+ <tr class="saswp-softwareapplication-text-field-tr">
1488
+ <td><?php echo esc_html__('Application Category', 'schema-and-structured-data-for-wp' ); ?></td>
1489
+ <td><input value="<?php if(isset($software_details['saswp_software_schema_application_category'])){echo esc_attr($software_details['saswp_software_schema_application_category']); } ?>" type="text" name="saswp_software_schema_application_category" placeholder="<?php echo esc_html__('eg. https://schema.org/GameApplication', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1490
+ </tr>
1491
+
1492
+ <tr class="saswp-softwareapplication-text-field-tr">
1493
+ <td><?php echo esc_html__('Price', 'schema-and-structured-data-for-wp' ); ?></td>
1494
+ <td><input value="<?php if(isset($software_details['saswp_software_schema_price'])){echo esc_attr($software_details['saswp_software_schema_price']); } ?>" type="text" name="saswp_software_schema_price" placeholder="<?php echo esc_html__('1.00', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1495
+ </tr>
1496
+
1497
+ <tr class="saswp-softwareapplication-text-field-tr">
1498
+ <td><?php echo esc_html__('Price Currency', 'schema-and-structured-data-for-wp' ); ?></td>
1499
+ <td><input value="<?php if(isset($software_details['saswp_software_schema_price_currency'])){echo esc_attr($software_details['saswp_software_schema_price_currency']); } ?>" type="text" name="saswp_software_schema_price_currency" placeholder="<?php echo esc_html__('USD', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1500
+ </tr>
1501
+
1502
+ <tr class="saswp-softwareapplication-text-field-tr">
1503
+ <td><?php echo esc_html__('Aggregate Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1504
+ <td>
1505
+ <input class="saswp-enable-rating-review-softwareapplication" type="checkbox" name="saswp_software_schema_enable_rating" value="1" <?php if(isset($software_details['saswp_software_schema_enable_rating'])){echo 'checked'; }else{ echo ''; } ?>>
1506
+ </td>
1507
+ </tr>
1508
+
1509
+ <tr class="saswp-softwareapplication-text-field-tr saswp-rating-review-softwareapplication">
1510
+ <td><?php echo esc_html__('Rating', 'schema-and-structured-data-for-wp' ); ?></td>
1511
+ <td><input value="<?php if(isset($software_details['saswp_software_schema_rating'])){echo esc_attr($software_details['saswp_software_schema_rating']); } ?>" type="text" name="saswp_software_schema_rating" placeholder="<?php echo esc_html__('4.6', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1512
+ </tr>
1513
+ <tr class="saswp-softwareapplication-text-field-tr saswp-rating-review-softwareapplication">
1514
+ <td><?php echo esc_html__('Rating Count', 'schema-and-structured-data-for-wp' ); ?></td>
1515
+ <td><input value="<?php if(isset($software_details['saswp_software_schema_rating_count'])){echo esc_attr($software_details['saswp_software_schema_rating_count']); } ?>" type="text" name="saswp_software_schema_rating_count" placeholder="<?php echo esc_html__('8864', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1516
+ </tr>
1517
+
1518
+ <!-- SoftwareApplication Schema type ends here -->
1519
+
1520
+ <!-- Event Schema type starts here -->
1521
+
1522
+ <tr class="saswp-event-text-field-tr">
1523
+ <td><?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?></td>
1524
+ <td><input value="<?php if(isset($event_details['saswp_event_schema_name'])){echo esc_attr($event_details['saswp_event_schema_name']); } ?>" type="text" name="saswp_event_schema_name" placeholder="<?php echo esc_html__('Name', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1525
+ </tr>
1526
+ <tr class="saswp-event-text-field-tr">
1527
+ <td><?php echo esc_html__('Description', 'schema-and-structured-data-for-wp' ); ?></td>
1528
+ <td>
1529
+ <textarea placeholder="Description" rows="5" cols="70" name="saswp_event_schema_description"><?php if(isset($event_details['saswp_event_schema_description'])){echo $event_details['saswp_event_schema_description']; } ?></textarea>
1530
+ </td>
1531
+ </tr>
1532
+ <tr class="saswp-event-text-field-tr">
1533
+ <td><?php echo esc_html__('Location Name', 'schema-and-structured-data-for-wp' ); ?></td>
1534
+ <td><input value="<?php if(isset($event_details['saswp_event_schema_location_name'])){echo esc_attr($event_details['saswp_event_schema_location_name']); } ?>" type="text" name="saswp_event_schema_location_name" placeholder="<?php echo esc_html__('Location Name', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1535
+ </tr>
1536
+
1537
+ <tr class="saswp-event-text-field-tr">
1538
+ <td><?php echo esc_html__('Location Street Address', 'schema-and-structured-data-for-wp' ); ?></td>
1539
+ <td><input value="<?php if(isset($event_details['saswp_event_schema_location_streetaddress'])){echo esc_attr($event_details['saswp_event_schema_location_streetaddress']); } ?>" type="text" name="saswp_event_schema_location_streetaddress" placeholder="<?php echo esc_html__('Location Street Address', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1540
+ </tr>
1541
+
1542
+ <tr class="saswp-event-text-field-tr">
1543
+ <td><?php echo esc_html__('Location Locality', 'schema-and-structured-data-for-wp' ); ?></td>
1544
+ <td><input value="<?php if(isset($event_details['saswp_event_schema_location_locality'])){echo esc_attr($event_details['saswp_event_schema_location_locality']); } ?>" type="text" name="saswp_event_schema_location_locality" placeholder="<?php echo esc_html__('Location Locality', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1545
+ </tr>
1546
+
1547
+ <tr class="saswp-event-text-field-tr">
1548
+ <td><?php echo esc_html__('Location Region', 'schema-and-structured-data-for-wp' ); ?></td>
1549
+ <td><input value="<?php if(isset($event_details['saswp_event_schema_location_region'])){echo esc_attr($event_details['saswp_event_schema_location_region']); } ?>" type="text" name="saswp_event_schema_location_region" placeholder="<?php echo esc_html__('Location Region', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1550
+ </tr>
1551
+
1552
+ <tr class="saswp-event-text-field-tr">
1553
+ <td><?php echo esc_html__('Location PostalCode', 'schema-and-structured-data-for-wp' ); ?></td>
1554
+ <td><input value="<?php if(isset($event_details['saswp_event_schema_location_postalcode'])){echo esc_attr($event_details['saswp_event_schema_location_postalcode']); } ?>" type="text" name="saswp_event_schema_location_postalcode" placeholder="<?php echo esc_html__('PostalCode', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1555
+ </tr>
1556
+
1557
+ <tr class="saswp-event-text-field-tr">
1558
+ <td><?php echo esc_html__('Start Date', 'schema-and-structured-data-for-wp' ); ?></td>
1559
+ <td><input class="saswp-local-schema-datepicker-picker" value="<?php if(isset($event_details['saswp_event_schema_start_date'])){echo esc_attr($event_details['saswp_event_schema_start_date']); } ?>" type="text" name="saswp_event_schema_start_date" placeholder="<?php echo esc_html__('2018-12-12', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1560
+ </tr>
1561
+
1562
+ <tr class="saswp-event-text-field-tr">
1563
+ <td><?php echo esc_html__('End Date', 'schema-and-structured-data-for-wp' ); ?></td>
1564
+ <td><input class="saswp-local-schema-datepicker-picker" value="<?php if(isset($event_details['saswp_event_schema_end_date'])){echo esc_attr($event_details['saswp_event_schema_end_date']); } ?>" type="text" name="saswp_event_schema_end_date" placeholder="<?php echo esc_html__('2018-12-12', 'schema-and-structured-data-for-wp' ); ?>" ></td>
1565
+ </tr>
1566
+
1567
+ <tr class="saswp-event-text-field-tr">
1568
+ <td><?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?></td>
1569
+ <td style="display: flex; width: 97%">
1570
+ <input value="<?php if(isset($event_details['saswp_event_schema_image'])) { echo esc_url($event_details['saswp_event_schema_image']['url']);} else { echo esc_url(saswp_remove_warnings($logo, 0, 'saswp_string')); } ?>" id="saswp_event_schema_image" type="text" name="saswp_event_schema_image[url]" placeholder="<?php echo esc_html__('Image', 'schema-and-structured-data-for-wp' ); ?>" readonly="readonly" style="background: #FFF;">
1571
+ <input value="<?php if(isset($event_details['saswp_event_schema_image'])) { echo esc_attr($event_details['saswp_event_schema_image']['id']);} else { echo esc_attr($custom_logo_id); }?>" data-id="saswp_event_schema_image_id" type="hidden" name="saswp_event_schema_image[id]">
1572
+ <input value="<?php if(isset($event_details['saswp_event_schema_image'])) { echo esc_attr($event_details['saswp_event_schema_image']['width']);} else { echo esc_attr(saswp_remove_warnings($logo, 1, 'saswp_string')); } ?>" data-id="saswp_event_schema_image_width" type="hidden" name="saswp_event_schema_image[width]">
1573
+ <input value="<?php if(isset($event_details['saswp_event_schema_image'])) { echo esc_attr($event_details['saswp_event_schema_image']['height']);} else { echo esc_attr(saswp_remove_warnings($logo, 2, 'saswp_string')); } ?>" data-id="saswp_event_schema_image_height" type="hidden" name="saswp_event_schema_image[height]">
1574
+ <input data-id="media" class="button" id="saswp_event_schema_image_button" type="button" value="Upload">
1575
+ </td>
1576
+ </tr>
1577
+
1578
+ <tr class="saswp-event-text-field-tr">
1579
+ <td><?php echo esc_html__('Performer Name', 'schema-and-structured-data-for-wp' ); ?></td>
1580
+ <td><input value="<?php if(isset($event_details['saswp_event_schema_performer_name'])){echo esc_attr($event_details['saswp_event_schema_performer_name']); } ?>" type="text" name="saswp_event_schema_performer_name"></td>
1581
+ </tr>
1582
+
1583
+ <tr class="saswp-event-text-field-tr">
1584
+ <td><?php echo esc_html__('Price', 'schema-and-structured-data-for-wp' ); ?></td>
1585
+ <td><input value="<?php if(isset($event_details['saswp_event_schema_price'])){echo esc_attr($event_details['saswp_event_schema_price']); } ?>" type="number" name="saswp_event_schema_price"></td>
1586
+ </tr>
1587
+
1588
+ <tr class="saswp-event-text-field-tr">
1589
+ <td><?php echo esc_html__('Price currency', 'schema-and-structured-data-for-wp' ); ?></td>
1590
+ <td><input value="<?php if(isset($event_details['saswp_event_schema_price_currency'])){echo esc_attr($event_details['saswp_event_schema_price_currency']); } ?>" type="text" name="saswp_event_schema_price_currency"></td>
1591
+ </tr>
1592
+ <tr class="saswp-event-text-field-tr">
1593
+ <td><?php echo esc_html__('Availability', 'schema-and-structured-data-for-wp' ); ?></td>
1594
+ <td>
1595
+ <select name="saswp_event_schema_availability">
1596
+ <?php
1597
+
1598
+ foreach ($availability as $key => $value) {
1599
+ $sel = '';
1600
+ if(saswp_remove_warnings($event_details, 'saswp_event_schema_availability', 'saswp_string')==$key){
1601
+ $sel = 'selected';
1602
+ }
1603
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
1604
+ }
1605
+ ?>
1606
+ </select>
1607
+ </td>
1608
+ </tr>
1609
+
1610
+ <tr class="saswp-event-text-field-tr">
1611
+ <td><?php echo esc_html__('Valid From', 'schema-and-structured-data-for-wp' ); ?></td>
1612
+ <td><input class="saswp-local-schema-datepicker-picker" value="<?php if(isset($event_details['saswp_event_schema_validfrom'])){echo esc_attr($event_details['saswp_event_schema_validfrom']); } ?>" type="text" name="saswp_event_schema_validfrom"></td>
1613
+ </tr>
1614
+
1615
+ <tr class="saswp-event-text-field-tr">
1616
+ <td><?php echo esc_html__('URL', 'schema-and-structured-data-for-wp' ); ?></td>
1617
+ <td><input value="<?php if(isset($event_details['saswp_event_schema_url'])){echo esc_attr($event_details['saswp_event_schema_url']); } ?>" type="text" name="saswp_event_schema_url"></td>
1618
+ </tr>
1619
+
1620
+ <!-- Event Schema type ends here -->
1621
+
1622
+
1623
+ <tr>
1624
+ <td>
1625
+ <label for="saswp-speakable"><?php echo esc_html__( 'Speakable ' ,'schema-and-structured-data-for-wp');?></label>
1626
+ </td>
1627
+ <td>
1628
+ <input class="saswp-enable-speakable" type="checkbox" name="saswp_enable_speakable_schema" value="1" <?php if(isset($speakable) && $speakable == 1){echo 'checked'; }else{ echo ''; } ?>>
1629
+ </td>
1630
+ </tr>
1631
+ </table>
1632
+
1633
+ </div>
1634
+ <?php
1635
+ }
1636
+ /**
1637
+ * Function to save schema type metabox value
1638
+ * @param type $post_id
1639
+ * @return type null
1640
+ * @since version 1.0
1641
+ */
1642
+ function saswp_schema_type_add_meta_box_save( $post_id ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1643
 
1644
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
1645
  if ( ! isset( $_POST['saswp_schema_type_nonce'] ) || ! wp_verify_nonce( $_POST['saswp_schema_type_nonce'], 'saswp_schema_type_nonce' ) ) return;
1662
  }
1663
 
1664
  $local_business_details = array();
1665
+
1666
  if ( isset( $_POST['local_business_name'] ) ){
1667
  $local_business_details['local_business_name'] = sanitize_text_field($_POST['local_business_name']);
1668
  }
1669
+
1670
+ if ( isset( $_POST['local_business_description'] ) ){
1671
+ $local_business_details['local_business_description'] = sanitize_textarea_field($_POST['local_business_description']);
1672
+ }
1673
+
1674
  if ( isset( $_POST['local_street_address'] ) ){
1675
  $local_business_details['local_street_address'] = sanitize_text_field($_POST['local_street_address']);
1676
  }
1724
  $local_business_details['local_serves_cuisine'] = sanitize_text_field($_POST['local_serves_cuisine']);
1725
  }
1726
 
1727
+ //social fields starts here
1728
+
1729
+ if ( isset( $_POST['local_facebook'] ) ){
1730
+ $local_business_details['local_facebook'] = esc_url_raw($_POST['local_facebook']);
1731
+ }
1732
+ if ( isset( $_POST['local_twitter'] ) ){
1733
+ $local_business_details['local_twitter'] = esc_url_raw($_POST['local_twitter']);
1734
+ }
1735
+ if ( isset( $_POST['local_instagram'] ) ){
1736
+ $local_business_details['local_instagram'] = esc_url_raw($_POST['local_instagram']);
1737
+ }
1738
+ if ( isset( $_POST['local_pinterest'] ) ){
1739
+ $local_business_details['local_pinterest'] = esc_url_raw($_POST['local_pinterest']);
1740
+ }
1741
+ if ( isset( $_POST['local_linkedin'] ) ){
1742
+ $local_business_details['local_linkedin'] = esc_url_raw($_POST['local_linkedin']);
1743
+ }
1744
+ if ( isset( $_POST['local_soundcloud'] ) ){
1745
+ $local_business_details['local_soundcloud'] = esc_url_raw($_POST['local_soundcloud']);
1746
+ }
1747
+ if ( isset( $_POST['local_tumblr'] ) ){
1748
+ $local_business_details['local_tumblr'] = esc_url_raw($_POST['local_tumblr']);
1749
+ }
1750
+ if ( isset( $_POST['local_youtube'] ) ){
1751
+ $local_business_details['local_youtube'] = esc_url_raw($_POST['local_youtube']);
1752
+ }
1753
+
1754
+ //social fields ends here
1755
  if ( isset( $_POST['local_enable_rating'] ) ){
1756
  $local_business_details['local_enable_rating'] = sanitize_text_field($_POST['local_enable_rating']);
1757
  }
1831
 
1832
  if($schema_type =='Review'){
1833
 
1834
+ if ( !isset( $_POST['saswp_review_schema_item_type'] ) ){
1835
+ return;
1836
+ }
1837
 
1838
+ $item = sanitize_text_field($_POST['saswp_review_schema_item_type']);
1839
  $meta_fields = saswp_item_reviewed_fields($item);
1840
 
1841
  foreach ( $meta_fields as $meta_field ) {
1842
 
1843
  if ( isset( $_POST[ $meta_field['id'] ] ) ) {
1844
+
1845
  switch ( $meta_field['type'] ) {
1846
 
1847
  case 'media':
1866
  case 'text':
1867
  $_POST[ $meta_field['id'] ] = sanitize_text_field( $_POST[ $meta_field['id'] ] );
1868
  break;
1869
+ default:
1870
+ $_POST[ $meta_field['id'] ] = sanitize_text_field( $_POST[ $meta_field['id'] ] );
1871
+ break;
1872
  }
1873
  $review_schema_details[$meta_field['id']] = $_POST[ $meta_field['id'] ];
1874