Schema & Structured Data for WP & AMP - Version 1.8

Version Description

(08 May 2019) =

  • New Feature: Google Reviews and its schema markup (Users can list their business reviews from google reviews using place id) #61
  • Added: New docs link in the plugin and everywhere #202
  • Added: Review Module Schema markup has been added #205
  • Added: Defragment Schema (Merge all the schema markup in one markup) #223
  • Added: "Need Help" label in default data
  • Added: Option to to add schema markup in (header or footer) #165
  • Changes: PRE Release Checklist (Settings panel has many improvement with new tabs) #236
  • Bug Fixed: Missing Field mainEntity.author in Q&A schema after Update #191
  • Bug Fixed: The property aggregateRating is not recognised by Google for an object of type Thing in course schema type #194
  • Bug Fixed: The description is required for VideoObject schema type on homepage #195
  • Bug Fixed: Review Module Schema is not generating in the backend #205
  • Bug Fixed: Missing attributes have been added for the product schema generating from WooCommerce #205
  • Bug Fixed: Error in Article schema automatically generate by Yoast SEO in non-amp #231
  • Bug Fixed: Issue in the selecting the organisation type as twice, generating an error. #234
  • Bug Fixed: Debug errors after Version 1.7 #240
  • Bug Fixed: In AMP's Home page Breadcrumb scheme markup is generating two item list #244
  • Bug Fixed: Remove shortcode from schema markup description #250
  • Bug Fixed: Notification Improvements #239
  • Bug Fixed: The Support tab Email changes #238
Download this release

Release Info

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

Code changes from version 1.7 to 1.8

admin_section/common-function.php CHANGED
@@ -1258,20 +1258,13 @@ function saswp_defaultSettings(){
1258
  }
1259
  $defaults = array(
1260
  //General Block
1261
- 'sd_about_page' => '',
1262
- 'sd_contact_page' => '',
1263
  //knowledge Block
1264
- 'saswp_kb_type' => 'Organization',
1265
- 'sd_name' => $sd_name,
1266
- 'sd_alt_name' => $sd_name,
1267
- 'sd_url' => $current_url,
1268
- 'sd_logo' => array(
1269
- 'url' => array_key_exists(0, $logo)? $logo[0]:'',
1270
- 'id' => $custom_logo_id,
1271
- 'height' => array_key_exists(2, $logo)? $logo[2]:'',
1272
- 'width' => array_key_exists(1, $logo)? $logo[1]:'',
1273
- 'thumbnail' => array_key_exists(0, $logo)? $logo[0]:''
1274
- ),
1275
  'sd-person-name' => $username,
1276
  'sd-person-job-title'=> '',
1277
  'sd-person-url' => $current_url,
@@ -1288,44 +1281,55 @@ function saswp_defaultSettings(){
1288
  'saswp_kb_contact_1' => 0,
1289
  //Social
1290
  'sd_facebook' => '',
1291
- 'sd_twitter' => '',
1292
- 'sd_google_plus' => '',
1293
  'sd_instagram' => '',
1294
  'sd_youtube' => '',
1295
  'sd_linkedin' => '',
1296
  'sd_pinterest' => '',
1297
  'sd_soundcloud' => '',
1298
- 'sd_tumblr' => '',
1299
 
 
 
 
 
 
 
1300
 
1301
- 'sd-data-logo-ampforwp' => array(
 
 
 
 
 
 
 
 
 
 
 
 
1302
 
1303
- 'url' => array_key_exists(0, $logo)? $logo[0]:'',
1304
- 'id' => $custom_logo_id,
1305
- 'height' => array_key_exists(2, $logo)? $logo[2]:'',
1306
- 'width' => array_key_exists(1, $logo)? $logo[1]:'',
1307
- 'thumbnail' => array_key_exists(0, $logo)? $logo[0]:''
1308
 
1309
- ),
1310
-
1311
- //AMP Block
1312
- 'saswp-for-amp' => 1,
1313
- 'saswp-for-wordpress' => 1,
1314
- 'saswp-logo-width' => '60',
1315
- 'saswp-logo-height' => '60',
1316
-
1317
- 'sd_default_image' => array(
1318
  'url' => array_key_exists(0, $logo)? $logo[0]:'',
1319
  'id' => $custom_logo_id,
1320
  'height' => array_key_exists(2, $logo)? $logo[2]:'',
1321
  'width' => array_key_exists(1, $logo)? $logo[1]:'',
1322
  'thumbnail' => array_key_exists(0, $logo)? $logo[0]:''
1323
- ),
1324
- 'sd_default_image_width' => array_key_exists(1, $logo)? $logo[1]:'',
1325
- 'sd_default_image_height' => array_key_exists(2, $logo)? $logo[2]:'',
1326
- 'sd_initial_wizard_status' => 1,
1327
-
1328
- );
1329
  $sd_data = $settings = get_option( 'sd_data', $defaults);
1330
 
1331
  return $settings;
@@ -1340,17 +1344,17 @@ function saswp_frontend_enqueue(){
1340
  function saswp_enque_amp_script(){
1341
 
1342
  global $sd_data;
1343
- $saswp_review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
1344
 
1345
- $saswp_review_item_enable = 0;
1346
 
1347
- if(isset($saswp_review_details['saswp-review-item-enable'])){
1348
 
1349
- $saswp_review_item_enable = $saswp_review_details['saswp-review-item-enable'];
1350
 
1351
- }
1352
 
1353
- if($sd_data['saswp-review-module']== 1 && $saswp_review_item_enable == 1){
1354
  ?>
1355
  .saswp-pc-wrap{
1356
  background-color: #004f74;
@@ -1489,7 +1493,127 @@ function saswp_frontend_enqueue(){
1489
  margin-bottom:20px;
1490
  }
1491
  }
 
1492
  <?php
1493
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1494
  }
1495
- add_action('amp_post_template_css','saswp_enque_amp_script');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1258
  }
1259
  $defaults = array(
1260
  //General Block
1261
+ 'sd_about_page' => '',
1262
+ 'sd_contact_page' => '',
1263
  //knowledge Block
1264
+ 'saswp_kb_type' => 'Organization',
1265
+ 'sd_name' => $sd_name,
1266
+ 'sd_alt_name' => $sd_name,
1267
+ 'sd_url' => $current_url,
 
 
 
 
 
 
 
1268
  'sd-person-name' => $username,
1269
  'sd-person-job-title'=> '',
1270
  'sd-person-url' => $current_url,
1281
  'saswp_kb_contact_1' => 0,
1282
  //Social
1283
  'sd_facebook' => '',
1284
+ 'sd_twitter' => '',
 
1285
  'sd_instagram' => '',
1286
  'sd_youtube' => '',
1287
  'sd_linkedin' => '',
1288
  'sd_pinterest' => '',
1289
  'sd_soundcloud' => '',
1290
+ 'sd_tumblr' => '',
1291
 
1292
+ //AMP Block
1293
+ 'saswp-for-amp' => 1,
1294
+ 'saswp-for-wordpress' => 1,
1295
+ 'saswp-logo-width' => '60',
1296
+ 'saswp-logo-height' => '60',
1297
+ 'sd_initial_wizard_status' => 1,
1298
 
1299
+ );
1300
+
1301
+ if(is_array($logo)){
1302
+
1303
+ $defaults['sd_logo'] = array(
1304
+ 'url' => array_key_exists(0, $logo)? $logo[0]:'',
1305
+ 'id' => $custom_logo_id,
1306
+ 'height' => array_key_exists(2, $logo)? $logo[2]:'',
1307
+ 'width' => array_key_exists(1, $logo)? $logo[1]:'',
1308
+ 'thumbnail' => array_key_exists(0, $logo)? $logo[0]:''
1309
+ );
1310
+
1311
+ $defaults['sd-data-logo-ampforwp'] = array(
1312
 
1313
+ 'url' => array_key_exists(0, $logo)? $logo[0]:'',
1314
+ 'id' => $custom_logo_id,
1315
+ 'height' => array_key_exists(2, $logo)? $logo[2]:'',
1316
+ 'width' => array_key_exists(1, $logo)? $logo[1]:'',
1317
+ 'thumbnail' => array_key_exists(0, $logo)? $logo[0]:''
1318
 
1319
+ );
1320
+
1321
+ $defaults['sd_default_image'] = array(
 
 
 
 
 
 
1322
  'url' => array_key_exists(0, $logo)? $logo[0]:'',
1323
  'id' => $custom_logo_id,
1324
  'height' => array_key_exists(2, $logo)? $logo[2]:'',
1325
  'width' => array_key_exists(1, $logo)? $logo[1]:'',
1326
  'thumbnail' => array_key_exists(0, $logo)? $logo[0]:''
1327
+ );
1328
+
1329
+ $defaults['sd_default_image_width'] = array_key_exists(1, $logo)? $logo[1]:'';
1330
+ $defaults['sd_default_image_height'] = array_key_exists(2, $logo)? $logo[2]:'';
1331
+ }
1332
+
1333
  $sd_data = $settings = get_option( 'sd_data', $defaults);
1334
 
1335
  return $settings;
1344
  function saswp_enque_amp_script(){
1345
 
1346
  global $sd_data;
1347
+ $saswp_review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
1348
 
1349
+ $saswp_review_item_enable = 0;
1350
 
1351
+ if(isset($saswp_review_details['saswp-review-item-enable'])){
1352
 
1353
+ $saswp_review_item_enable = $saswp_review_details['saswp-review-item-enable'];
1354
 
1355
+ }
1356
 
1357
+ if($sd_data['saswp-review-module']== 1 && $saswp_review_item_enable == 1){
1358
  ?>
1359
  .saswp-pc-wrap{
1360
  background-color: #004f74;
1493
  margin-bottom:20px;
1494
  }
1495
  }
1496
+
1497
  <?php
1498
  }
1499
+
1500
+
1501
+ if((has_shortcode( get_the_content(), 'saswp_google_review') || is_active_widget( false, false, 'saswp_google_review_widget',true )) && isset($sd_data['saswp-google-review']) && $sd_data['saswp-google-review'] == 1 ){
1502
+ ?>
1503
+
1504
+ /*** Review Design CSS ****/
1505
+ .saswp-g-review-header{
1506
+ margin-top: 50px;
1507
+ }
1508
+ .saswp-g-review-body{
1509
+ display:inline-grid;
1510
+ grid-template-columns: 1fr 300px;
1511
+ grid-gap:30px;
1512
+ margin-top:30px;
1513
+ width:100%;
1514
+ }
1515
+ .saswp-review-list{}
1516
+ .saswp-channel-list{
1517
+ margin-right: 15px;
1518
+ }
1519
+ .saswp-input-fields{
1520
+ display: inline-flex;
1521
+ align-items: center;
1522
+ margin-bottom: 8px;
1523
+ width: 100%;
1524
+ }
1525
+ .saswp-input-fields label{
1526
+ width: 130px;
1527
+ }
1528
+ .saswp-panel h3{
1529
+ font-size: 20px;
1530
+ line-height: 1.4;
1531
+ color: #222;
1532
+ text-align: center;
1533
+ margin: 10px 0px 20px 0px;
1534
+ }
1535
+ .saswp-input-fields a.button-primary{
1536
+ margin-top:10px;
1537
+ }
1538
+ .saswp-glg-review-body{
1539
+ display: grid;
1540
+ grid-template-columns: 100px 1fr;
1541
+ grid-gap: 20px;
1542
+ background: #fff;
1543
+ padding: 20px;
1544
+ box-shadow: 0px 0px 20px 1px #d2cccc;
1545
+ margin-bottom: 30px;
1546
+ }
1547
+ .saswp-g-plus{
1548
+ float: right;
1549
+ font-size: 15px;
1550
+ width: 20px;
1551
+ height: 20px;
1552
+ }
1553
+ .saswp-g-plus amp-img{
1554
+ width:100%;
1555
+ }
1556
+ .saswp-rtng{
1557
+ padding-left: 5px;
1558
+ font-size: 14px;
1559
+ }
1560
+ .saswp-pt-dt {
1561
+ font-size: 12px;
1562
+ color: #999;
1563
+ font-weight: 600;
1564
+ margin-top: 5px;
1565
+ display: inline-block;
1566
+ }
1567
+ .saswp-athr{
1568
+ font-size: 15px;
1569
+ line-height: 1.4;
1570
+ color: #000;
1571
+ font-weight: bold;
1572
+ display: inline-block;
1573
+ vertical-align: middle;
1574
+ }
1575
+ .saswp-str-rtng .saswp-rvw-str{
1576
+ display: inline-block;
1577
+ vertical-align: middle;
1578
+ padding-left: 10px;
1579
+ width: auto;
1580
+ }
1581
+ .amp-sidebar .saswp-str-rtng .saswp-rvw-str{padding:5px 0px 0px 0px;}
1582
+ .saswp-rv-cnt p{
1583
+ font-size: 16px;
1584
+ line-height: 1.6;
1585
+ color: #000;
1586
+ margin: 10px 0px 0px 0px;
1587
+ }
1588
+ .amp-sidebar .saswp-rv-img amp-img{max-width:50px;}
1589
+ .amp-sidebar .saswp-glg-review-body {
1590
+ display: inline-block;
1591
+ width:100%;
1592
+ }
1593
+ .amp-sidebar .saswp-rv-img{
1594
+ width:60px;
1595
+ float:left;
1596
+ }
1597
+ .amp-sidebar .saswp-rtng{display:block;}
1598
+
1599
+
1600
+ <?php
1601
+ }
1602
+
1603
+
1604
  }
1605
+ add_action('amp_post_template_css','saswp_enque_amp_script');
1606
+
1607
+ function saswp_get_the_author_name(){
1608
+
1609
+ $author_id = get_the_author_meta('ID');
1610
+ $aurthor_name = get_the_author();
1611
+
1612
+ if(!$aurthor_name){
1613
+
1614
+ $author_id = get_post_field ('post_author', get_the_ID());
1615
+ $aurthor_name = get_the_author_meta( 'display_name' , $author_id );
1616
+
1617
+ }
1618
+ return $aurthor_name;
1619
+ }
admin_section/css/main-style.css CHANGED
@@ -125,6 +125,9 @@ display: none !important;
125
  .saswp-tools .saswp-tooltip{
126
  width: 230px;
127
  }
 
 
 
128
  .saswp-error{
129
  color: #ff0000 !important;
130
  }
@@ -596,3 +599,369 @@ Compatibility tab css ends
596
  width: 250px;
597
  display: inline-block;
598
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
  }
599
  width: 250px;
600
  display: inline-block;
601
  }
602
+ .saswp-knowledge-label label[for="saswp_search_box_schema_checkbox"] {
603
+ padding-left: 10px;
604
+ }
605
+
606
+ .saswp-knowledge-label label[for="saswp-woocommerce-booking-checkbox"] {
607
+ padding-left: 10px;
608
+ }
609
+
610
+ .saswp-knowledge-label label[for="saswp-woocommerce-membership-checkbox"] {
611
+ padding-left: 10px;
612
+ }
613
+
614
+ .saswp-global-selected{
615
+ color: #000000;
616
+ font-weight: 500;
617
+ }
618
+ #saswp-global-tabs a{
619
+ cursor: pointer;
620
+ }
621
+ #saswp-global-tabs{
622
+ padding-left: 5px;
623
+ }
624
+ .saswp-need-help {
625
+ padding-left: 60px;
626
+ }
627
+ .saswp-heading{
628
+ display: inline-flex;
629
+ align-items: baseline;
630
+ }
631
+ .saswp-view-docs a{
632
+ margin-right: 5px !important;
633
+ margin-top: 10px !important;
634
+ }
635
+ .saswp-tabs .nav-tab{
636
+ margin-left: 4px;
637
+ }
638
+
639
+ /*
640
+ Google review module starts here
641
+ */
642
+ .saswp-accordion {
643
+ background-color: #eee;
644
+ color: #444;
645
+ cursor: pointer;
646
+ padding: 6px;
647
+ width: 100%;
648
+ border: none;
649
+ text-align: left;
650
+ outline: none;
651
+ font-size: 15px;
652
+ transition: 0.4s;
653
+ }
654
+
655
+ .active, .saswp-accordion:hover {
656
+ background-color: #ccc;
657
+ }
658
+
659
+ .saswp-panel {
660
+ padding: 7px 18px;
661
+ background-color: white;
662
+ box-shadow: 0px 0px 20px 1px #d2cccc;
663
+ }
664
+
665
+ /*** Review Design CSS ****/
666
+ .saswp-g-review-header{
667
+ margin-top: 50px;
668
+ }
669
+ .saswp-g-review-body{
670
+ display:inline-grid;
671
+ grid-template-columns: 1fr 300px;
672
+ grid-gap:30px;
673
+ margin-top:30px;
674
+ }
675
+ .saswp-review-list{}
676
+ .saswp-channel-list{
677
+ margin-right: 15px;
678
+ }
679
+ .saswp-input-fields{
680
+ display: inline-flex;
681
+ align-items: center;
682
+ margin-bottom: 8px;
683
+ width: 100%;
684
+ }
685
+ .saswp-input-fields label{
686
+ width: 130px;
687
+ }
688
+ .saswp-input-fields select{
689
+ width:100%;
690
+ }
691
+ .saswp-panel h3{
692
+ font-size: 20px;
693
+ line-height: 1.4;
694
+ color: #222;
695
+ text-align: center;
696
+ margin: 10px 0px 20px 0px;
697
+ }
698
+ .saswp-input-fields a.button-primary{
699
+ margin-top:10px;
700
+ }
701
+ .saswp-glg-review-body{
702
+ display: grid;
703
+ grid-template-columns: 100px 1fr;
704
+ grid-gap: 20px;
705
+ background: #fff;
706
+ padding: 20px;
707
+ box-shadow: 0px 0px 20px 1px #d2cccc;
708
+ margin-bottom: 30px;
709
+ }
710
+ .saswp-g-plus{
711
+ float: right;
712
+ font-size: 15px;
713
+ }
714
+ .saswp-rtng{
715
+ padding-left: 5px;
716
+ font-size: 14px;
717
+ }
718
+ .saswp-pt-dt {
719
+ font-size: 12px;
720
+ color: #999;
721
+ font-weight: 600;
722
+ margin-top: 5px;
723
+ display: inline-block;
724
+ }
725
+ .saswp-str{
726
+ display: inline-block;
727
+ width: 100%;
728
+ vertical-align: middle;
729
+ }
730
+ .saswp-athr{
731
+ font-size: 15px;
732
+ line-height: 1.4;
733
+ color: #000;
734
+ font-weight: bold;
735
+ display: inline-block;
736
+ vertical-align: middle;
737
+ }
738
+ .saswp-str-rtng .saswp-rvw-str{
739
+ display: inline-block;
740
+ vertical-align: middle;
741
+ padding-left: 10px;
742
+ width: auto;
743
+ }
744
+ .saswp-rv-cnt p{
745
+ font-size: 16px;
746
+ line-height: 1.6;
747
+ color: #000;
748
+ margin: 10px 0px 0px 0px;
749
+ }
750
+ .saswp-rv-img img{
751
+ max-width:100px;
752
+ }
753
+ /*
754
+ Google review module ends here
755
+ */
756
+
757
+ /** Premium Feature CSS **/
758
+ .saswp-premium_features table th, .saswp-services table th{
759
+ width: auto;
760
+ padding: 0px;
761
+ }
762
+ .saswp-features-blocks{
763
+ display: inline-grid;
764
+ grid-template-columns: 1fr 1fr;
765
+ grid-gap: 20px;
766
+ }
767
+ .saswp-features-blocks li{
768
+ background:#fff;
769
+ padding: 25px;
770
+ border: 1px solid #d8d8d8;
771
+ }
772
+ .saswp-features-blocks li a{
773
+ text-decoration: none;
774
+ }
775
+ .saswp-ele-ic{
776
+ border-radius: 256px;
777
+ display: inline-block;
778
+ padding:8px 10px 8px 10px;
779
+ width: 70px;
780
+ margin-right: 20px;
781
+ float: left;
782
+ }
783
+ .saswp-ele-ic img{
784
+ width:100%;
785
+ }
786
+ .saswp-ele-1{
787
+ background: #96588a;
788
+ }
789
+ .saswp-ele-2{
790
+ background: #00a97e;
791
+ }
792
+ .saswp-ele-3{
793
+ background: #cacaca;
794
+ }.saswp-ele-4{
795
+ background: #9c56cc;
796
+ }
797
+ .saswp-ele-tlt h3{
798
+ margin:0;
799
+ font-size: 18px;
800
+ line-height: 1.4;
801
+ }
802
+ .saswp-ele-tlt p{
803
+ margin-top:10px;
804
+ }
805
+ .saswp-sts-btn{
806
+ box-sizing: border-box;
807
+ height: 52px;
808
+ margin-top: 20px;
809
+ padding: 6px 15px;
810
+ border: 1px solid #e5e5e5;
811
+ border-radius: 3px;
812
+ display: flex;
813
+ align-items: center;
814
+ justify-content: space-between;
815
+ }
816
+ .saswp-d-btn{
817
+ background: #d2150a;
818
+ padding: 6px 18px;
819
+ border-radius: 30px;
820
+ font-size: 14px;
821
+ color: #fff;
822
+ }
823
+ .form-wrap .saswp-sts-txt{
824
+ font-size: 16px;
825
+ color:#000;
826
+ }
827
+ .saswp-sts-txt span{
828
+ color:#bebfc0;
829
+ padding-left:5px;
830
+ }
831
+
832
+ /** star rating Feature CSS **/
833
+
834
+ .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}
835
+ .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==)}
836
+ /*** Review Design CSS ****/
837
+ .saswp-g-review-header{
838
+ margin-top: 50px;
839
+ }
840
+ .saswp-g-review-body{
841
+ display:inline-grid;
842
+ grid-template-columns: 1fr 300px;
843
+ grid-gap:30px;
844
+ margin-top:30px;
845
+ width:100%;
846
+ }
847
+ .saswp-review-list{}
848
+ .saswp-channel-list{
849
+ margin-right: 15px;
850
+ }
851
+ .saswp-input-fields{
852
+ display: inline-flex;
853
+ align-items: center;
854
+ margin-bottom: 8px;
855
+ width: 100%;
856
+ }
857
+ .saswp-input-fields label{
858
+ width: 130px;
859
+ }
860
+ .saswp-panel h3{
861
+ font-size: 20px;
862
+ line-height: 1.4;
863
+ color: #222;
864
+ text-align: center;
865
+ margin: 10px 0px 20px 0px;
866
+ }
867
+ .saswp-input-fields a.button-primary{
868
+ margin-top:10px;
869
+ }
870
+ .saswp-glg-review-body{
871
+ display: grid;
872
+ grid-template-columns: 100px 1fr;
873
+ grid-gap: 20px;
874
+ background: #fff;
875
+ padding: 20px;
876
+ box-shadow: 0px 0px 20px 1px #d2cccc;
877
+ margin-bottom: 30px;
878
+ }
879
+ .saswp-g-plus{
880
+ float: right;
881
+ font-size: 15px;
882
+ width: 20px;
883
+ height: 20px;
884
+ }
885
+ .saswp-g-plus img{
886
+ width:100%;
887
+ }
888
+ .saswp-rtng{
889
+ padding-left: 5px;
890
+ font-size: 14px;
891
+ }
892
+ .saswp-pt-dt {
893
+ font-size: 12px;
894
+ color: #999;
895
+ font-weight: 600;
896
+ margin-top: 5px;
897
+ display: inline-block;
898
+ }
899
+ .saswp-athr{
900
+ font-size: 15px;
901
+ line-height: 1.4;
902
+ color: #000;
903
+ font-weight: bold;
904
+ }
905
+ .saswp-rv-cnt p{
906
+ font-size: 16px;
907
+ line-height: 1.6;
908
+ color: #000;
909
+ margin: 10px 0px 0px 0px;
910
+ }
911
+ .saswp-rv-img img{
912
+ max-width:100px;
913
+ }
914
+ .saswp-g-review-header div{
915
+ margin-top:10px;
916
+ }
917
+
918
+ /*** Upgrade Pro CSS ***/
919
+ .saswp-upgrade-pro{
920
+ background: #fff;
921
+ padding: 25px;
922
+ border: 1px solid #d8d8d8;
923
+ display: inline-block;
924
+ margin-top: 10px;
925
+ width: 81%;
926
+ }
927
+ .saswp-upgrade-pro h2{
928
+ font-size: 20px;
929
+ margin: 0;
930
+ color: #23282d;
931
+ font-weight: 600;
932
+ text-align: center;
933
+ }
934
+ .saswp-upgrade-pro ul{
935
+ margin: 25px 0px 20px 0px;
936
+ display: inline-block;
937
+ }
938
+ .saswp-upgrade-pro ul li{
939
+ position: relative;
940
+ padding-left: 30px;
941
+ font-size: 14px;
942
+ line-height: 1.4;
943
+ margin-bottom: 10px;
944
+ }
945
+ .saswp-upgrade-pro ul li:before {
946
+ content: "";
947
+ background-image: url(../images/check.png);
948
+ background-repeat: no-repeat;
949
+ background-size: 20px;
950
+ width: 20px;
951
+ height: 20px;
952
+ position: absolute;
953
+ left: 2px;
954
+ top: 2px;
955
+ }
956
+ .saswp-upgrade-pro a{
957
+ background: #d2150a;
958
+ padding: 10px 0px;
959
+ display: block;
960
+ text-align: center;
961
+ color: #fff;
962
+ text-decoration: none;
963
+ font-size: 16px;
964
+ font-weight: 600;
965
+ letter-spacing: 1px;
966
+ border-radius: 5px;
967
+ }
admin_section/css/saswp-style.css CHANGED
@@ -1 +1,97 @@
1
- .saswp-pc-wrap{background-color:#004f74;padding:15px 15px 15px 30px;color:#fff;display:inline-flex;width:100%;flex-wrap:wrap;margin-bottom:20px}.saswp-pc-wrap .saswp-lst span{font-size:18px;font-weight:500;margin-bottom:10px;display:inline-block;line-height:1.3}.saswp-pc-wrap .saswp-lst{flex:1 0 42%}.saswp-pc-wrap .saswp-lst ul{margin:0}.saswp-pc-wrap .saswp-lst p{list-style-type:none;font-size:15px;font-weight:lighter;line-height:1.2;margin-bottom:10px;position:relative;padding-left:20px;color:#eee}.saswp-pc-wrap .saswp-lst p:before{content:'';position:absolute;width:8px;height:8px;background-color:#ccc;left:0;top:6px;border-radius:10px}.sgl .saswp-rvw{width:100%;margin-bottom:34px;font-size:13px;border-bottom:1px solid #ededed}.saswp-rvw-hd span,.saswp-rvw-sm span{background-color:#222;color:#fff;display:inline-block;font-size:15px}.saswp-rvw-hd span{line-height:1.4;padding:8px 12px 6px;margin:26px 0}.saswp-rvw td{padding:7px 14px}.saswp-rvw td,.sgl table td{border:1px solid #ededed}.saswp-rvw tbody{width:100%}.saswp-rvw-sm span{padding:8px 12px 6px;margin-bottom:13px;position:relative;line-height:1.2}.saswp-rvw-fs{line-height:1.5;font-size:48px;font-weight:600;margin-bottom:5px}.saswp-rvw-ov .ovs{font-size:11px;font-weight:600}.sgl .saswp-rvw tr td{background:#fff;width:100%}.sgl .saswp-rvw tr:hover td{background-color:#fcfcfc}.saswp-rvw .saswp-rvw-sm{padding:21px 14px}.str-ic{font-size:18px;line-height:1.2}.saswp-rvw-str{display:inline-flex;width:100%}.saswp-rvw-str .df-clr,.saswp-rvw-str .half-str,.saswp-rvw-str .str-ic{display:inline-block;width:20px;height:16px;background-repeat:no-repeat}.saswp-rvw-ov{text-align:center}.saswp-rvw-str .half-str{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cGF0aCBkPSJNNDgyLjIwNywxODYuOTczbC0xNTkuNjk5LTMzLjcwNUwyNDEuMTA0LDExLjgwM2wtODEuNDA0LDE0MS40NjVMMCwxODYuOTczbDEwOS4zODgsMTIxLjEzNEw5Mi4wOTQsNDcwLjQwNGwxNDkuMDEtNjYuNiAgbDE0OS4wMSw2Ni42bC0xNy4yOTQtMTYyLjI5Nkw0ODIuMjA3LDE4Ni45NzN6IE0yNDEuMTA0LDM3MC45NDNWNzEuOTUzbDYyLjA5LDEwNy45TDQyNSwyMDUuNTYxbC04My40MzMsOTIuMzkzbDEzLjE5MSwxMjMuNzg4ICBMMjQxLjEwNCwzNzAuOTQzeiIgZmlsbD0iI2ZmZDcwMCIvPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K)}.saswp-rvw-str .str-ic{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiNmZmQ3MDAiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}.saswp-rvw-str .df-clr{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiM2MzVlNjMiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .saswp-pc-wrap{background-color:#004f74;padding:15px 15px 15px 30px;color:#fff;display:inline-flex;width:100%;flex-wrap:wrap;margin-bottom:20px}.saswp-pc-wrap .saswp-lst span{font-size:18px;font-weight:500;margin-bottom:10px;display:inline-block;line-height:1.3}.saswp-pc-wrap .saswp-lst{flex:1 0 42%}.saswp-pc-wrap .saswp-lst ul{margin:0}.saswp-pc-wrap .saswp-lst p{list-style-type:none;font-size:15px;font-weight:lighter;line-height:1.2;margin-bottom:10px;position:relative;padding-left:20px;color:#eee}.saswp-pc-wrap .saswp-lst p:before{content:'';position:absolute;width:8px;height:8px;background-color:#ccc;left:0;top:6px;border-radius:10px}.sgl .saswp-rvw{width:100%;margin-bottom:34px;font-size:13px;border-bottom:1px solid #ededed}.saswp-rvw-hd span,.saswp-rvw-sm span{background-color:#222;color:#fff;display:inline-block;font-size:15px}.saswp-rvw-hd span{line-height:1.4;padding:8px 12px 6px;margin:26px 0}.saswp-rvw td{padding:7px 14px}.saswp-rvw td,.sgl table td{border:1px solid #ededed}.saswp-rvw tbody{width:100%}.saswp-rvw-sm span{padding:8px 12px 6px;margin-bottom:13px;position:relative;line-height:1.2}.saswp-rvw-fs{line-height:1.5;font-size:48px;font-weight:600;margin-bottom:5px}.saswp-rvw-ov .ovs{font-size:11px;font-weight:600}.sgl .saswp-rvw tr td{background:#fff;width:100%}.sgl .saswp-rvw tr:hover td{background-color:#fcfcfc}.saswp-rvw .saswp-rvw-sm{padding:21px 14px}.str-ic{font-size:18px;line-height:1.2}.saswp-rvw-str{display:inline-flex;width:100%}.saswp-rvw-str .df-clr,.saswp-rvw-str .half-str,.saswp-rvw-str .str-ic{display:inline-block;width:20px;height:16px;background-repeat:no-repeat}.saswp-rvw-ov{text-align:center}.saswp-rvw-str .half-str{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cGF0aCBkPSJNNDgyLjIwNywxODYuOTczbC0xNTkuNjk5LTMzLjcwNUwyNDEuMTA0LDExLjgwM2wtODEuNDA0LDE0MS40NjVMMCwxODYuOTczbDEwOS4zODgsMTIxLjEzNEw5Mi4wOTQsNDcwLjQwNGwxNDkuMDEtNjYuNiAgbDE0OS4wMSw2Ni42bC0xNy4yOTQtMTYyLjI5Nkw0ODIuMjA3LDE4Ni45NzN6IE0yNDEuMTA0LDM3MC45NDNWNzEuOTUzbDYyLjA5LDEwNy45TDQyNSwyMDUuNTYxbC04My40MzMsOTIuMzkzbDEzLjE5MSwxMjMuNzg4ICBMMjQxLjEwNCwzNzAuOTQzeiIgZmlsbD0iI2ZmZDcwMCIvPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K)}.saswp-rvw-str .str-ic{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiNmZmQ3MDAiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}.saswp-rvw-str .df-clr{background-image:url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cG9seWdvbiBwb2ludHM9IjQ4Mi4yMDcsMTg2Ljk3MyAzMjIuNTA4LDE1My4yNjkgMjQxLjEwNCwxMS44MDMgMTU5LjY5OSwxNTMuMjY5IDAsMTg2Ljk3MyAxMDkuMzg4LDMwOC4xMDggOTIuMDk0LDQ3MC40MDQgICAyNDEuMTA0LDQwMy44MDMgMzkwLjExMyw0NzAuNDA0IDM3Mi44MTgsMzA4LjEwOCAiIGZpbGw9IiM2MzVlNjMiLz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPGc+CjwvZz4KPC9zdmc+Cg==)}
2
+ /*** Review Design CSS ****/
3
+ .saswp-g-review-header{
4
+ margin-top: 50px;
5
+ }
6
+ .saswp-g-review-body{
7
+ display:inline-grid;
8
+ grid-template-columns: 1fr 300px;
9
+ grid-gap:30px;
10
+ margin-top:30px;
11
+ width:100%;
12
+ }
13
+ .saswp-review-list{}
14
+ .saswp-channel-list{
15
+ margin-right: 15px;
16
+ }
17
+ .saswp-input-fields{
18
+ display: inline-flex;
19
+ align-items: center;
20
+ margin-bottom: 8px;
21
+ width: 100%;
22
+ }
23
+ .saswp-input-fields label{
24
+ width: 130px;
25
+ }
26
+ .saswp-panel h3{
27
+ font-size: 20px;
28
+ line-height: 1.4;
29
+ color: #222;
30
+ text-align: center;
31
+ margin: 10px 0px 20px 0px;
32
+ }
33
+ .saswp-input-fields a.button-primary{
34
+ margin-top:10px;
35
+ }
36
+ .saswp-glg-review-body{
37
+ display: grid;
38
+ grid-template-columns: 100px 1fr;
39
+ grid-gap: 20px;
40
+ background: #fff;
41
+ padding: 20px;
42
+ box-shadow: 0px 0px 20px 1px #d2cccc;
43
+ margin-bottom: 30px;
44
+ }
45
+ .saswp-g-plus{
46
+ float: right;
47
+ font-size: 15px;
48
+ width: 20px;
49
+ height: 20px;
50
+ }
51
+ .saswp-g-plus img{
52
+ width:100%;
53
+ }
54
+ .saswp-rtng{
55
+ padding-left: 5px;
56
+ font-size: 14px;
57
+ }
58
+ .saswp-pt-dt {
59
+ font-size: 12px;
60
+ color: #999;
61
+ font-weight: 600;
62
+ margin-top: 5px;
63
+ display: inline-block;
64
+ }
65
+ .saswp-athr{
66
+ font-size: 15px;
67
+ line-height: 1.4;
68
+ color: #000;
69
+ font-weight: bold;
70
+ display: inline-block;
71
+ vertical-align: middle;
72
+ }
73
+ .saswp-str-rtng .saswp-rvw-str{
74
+ display: inline-block;
75
+ vertical-align: middle;
76
+ padding-left: 10px;
77
+ width: auto;
78
+ }
79
+ .widget-area .saswp-str-rtng .saswp-rvw-str{padding:10px 0px 0px 0px;}
80
+ .saswp-rv-cnt p{
81
+ font-size: 16px;
82
+ line-height: 1.6;
83
+ color: #000;
84
+ margin: 10px 0px 0px 0px;
85
+ }
86
+ .saswp-rv-img img{
87
+ max-width:100px;
88
+ }
89
+ .widget-area .saswp-rv-img img{max-width:50px;}
90
+ .widget-area .saswp-glg-review-body {
91
+ display: inline-block;
92
+ width:100%;
93
+ }
94
+ .widget-area .saswp-rv-img{
95
+ width:60px;
96
+ float:left;
97
+ }
admin_section/fields-generator.php CHANGED
@@ -197,11 +197,12 @@ class saswp_fields_generator {
197
 
198
  $allowed_html = saswp_expanded_allowed_tags();
199
 
200
- if($note =='' || $proversion == 1){
201
- $output .= '<li><div class="saswp-knowledge-label">'.$label.'</div><div class="saswp-knowledge-field">'.$input.'<p data-id="'.esc_attr($proversion).'">'.esc_html__($note,'schema-and-structured-data-for-wp').'</p></div></li>';
202
- }else{
203
- $output .= '<li><div class="saswp-knowledge-label">'.$label.'</div><div class="saswp-knowledge-field">'.$input.'<p class="">'.esc_html__($note,'schema-and-structured-data-for-wp').'</p></div></li>';
204
- }
 
205
 
206
  }
207
  echo '<div><div class="saswp-settings-list"><ul>' . wp_kses($output, $allowed_html) . '</ul></div></div>';
197
 
198
  $allowed_html = saswp_expanded_allowed_tags();
199
 
200
+ $output .= '<li><div class="saswp-knowledge-label">'.$label.'</div><div class="saswp-knowledge-field">'.$input.'<p class="">'.$note.'</p></div></li>';
201
+ // if($note =='' || $proversion == 1){
202
+ // $output .= '<li><div class="saswp-knowledge-label">'.$label.'</div><div class="saswp-knowledge-field">'.$input.'<p data-id="'.esc_attr($proversion).'">'.$note.'</p></div></li>';
203
+ // }else{
204
+ // $output .= '<li><div class="saswp-knowledge-label">'.$label.'</div><div class="saswp-knowledge-field">'.$input.'<p class="">'.$note.'</p></div></li>';
205
+ // }
206
 
207
  }
208
  echo '<div><div class="saswp-settings-list"><ul>' . wp_kses($output, $allowed_html) . '</ul></div></div>';
admin_section/images/check.png ADDED
Binary file
admin_section/images/google-img.png ADDED
Binary file
admin_section/js/main-script.js CHANGED
@@ -284,9 +284,11 @@ jQuery(document).ready(function($){
284
  case 'saswp_website_schema_checkbox':
285
 
286
  if ($(this).is(':checked')) {
287
- $("#saswp_website_schema").val(1);
 
288
  }else{
289
  $("#saswp_website_schema").val(0);
 
290
  }
291
  break;
292
 
@@ -455,6 +457,53 @@ jQuery(document).ready(function($){
455
  }
456
  break;
457
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
458
 
459
  default:
460
  break;
@@ -468,6 +517,7 @@ jQuery(document).ready(function($){
468
 
469
  $(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass('saswp_hide');
470
  $(".saswp_kg_logo").parent().parent().parent().addClass('saswp_hide');
 
471
 
472
 
473
  if(datatype == 'Organization'){
@@ -570,8 +620,62 @@ jQuery(document).ready(function($){
570
 
571
 
572
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
573
 
574
-
 
575
  //query form send starts here
576
 
577
  $(".saswp-send-query").on("click", function(e){
@@ -833,6 +937,23 @@ jQuery(document).ready(function($){
833
  saswp_enable_rating_review();
834
  });
835
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
836
  //Importer from schema plugin ends here
837
 
838
  //custom fields modify schema starts here
@@ -859,6 +980,11 @@ jQuery(document).ready(function($){
859
  saswpCustomSelect2();
860
  } );
861
 
 
 
 
 
 
862
  $(document).on("click", '.saswp-add-custom-fields', function(){
863
  var schema_type = $('select#schema_type option:selected').val();
864
  var post_id = $('#post_ID').val();
@@ -960,6 +1086,56 @@ jQuery(document).ready(function($){
960
  //custom fields modify schema ends here
961
 
962
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
963
  //Adding settings button beside add schema type button on schema type list page
964
 
965
  if ('saswp' == saswp_app_object.post_type && saswp_app_object.page_now == 'edit.php') {
284
  case 'saswp_website_schema_checkbox':
285
 
286
  if ($(this).is(':checked')) {
287
+ $("#saswp_website_schema").val(1);
288
+ $("#saswp_search_box_schema").parent().parent().show();
289
  }else{
290
  $("#saswp_website_schema").val(0);
291
+ $("#saswp_search_box_schema").parent().parent().hide();
292
  }
293
  break;
294
 
457
  }
458
  break;
459
 
460
+ case 'saswp-defragment-checkbox':
461
+
462
+ if ($(this).is(':checked')) {
463
+ $("#saswp-defragment").val(1);
464
+ }else{
465
+ $("#saswp-defragment").val(0);
466
+ }
467
+ break;
468
+
469
+ case 'saswp-cooked-checkbox':
470
+
471
+ if ($(this).is(':checked')) {
472
+ $("#saswp-cooked").val(1);
473
+ }else{
474
+ $("#saswp-cooked").val(0);
475
+ }
476
+ break;
477
+
478
+ case 'saswp-flexmlx-compativility-checkbox':
479
+
480
+ if ($(this).is(':checked')) {
481
+ $("#saswp-flexmlx-compativility").val(1);
482
+ }else{
483
+ $("#saswp-flexmlx-compativility").val(0);
484
+ }
485
+ break;
486
+
487
+ case 'saswp-google-review-checkbox':
488
+
489
+ if ($(this).is(':checked')) {
490
+ $("#saswp-google-review").val(1);
491
+ $("#saswp_google_place_api_key").parent().parent().show();
492
+ }else{
493
+ $("#saswp-google-review").val(0);
494
+ $("#saswp_google_place_api_key").parent().parent().hide();
495
+ }
496
+ break;
497
+
498
+ case 'saswp-markup-footer-checkbox':
499
+
500
+ if ($(this).is(':checked')) {
501
+ $("#saswp-markup-footer").val(1);
502
+ }else{
503
+ $("#saswp-markup-footer").val(0);
504
+ }
505
+ break;
506
+
507
 
508
  default:
509
  break;
517
 
518
  $(".saswp_org_fields, .saswp_person_fields").parent().parent().addClass('saswp_hide');
519
  $(".saswp_kg_logo").parent().parent().parent().addClass('saswp_hide');
520
+ $("#sd-person-image").parent().parent().parent().addClass('saswp_hide');
521
 
522
 
523
  if(datatype == 'Organization'){
620
 
621
 
622
  });
623
+
624
+ //Licensing jquery starts here
625
+ $(document).on("click",".saswp_license_activation", function(e){
626
+ e.preventDefault();
627
+
628
+ var license_status = $(this).attr('license-status');
629
+ var add_on = $(this).attr('add-on');
630
+ var license_key = $("#"+add_on+"_addon_license_key").val();
631
+
632
+ if(license_status && add_on && license_key){
633
+
634
+ $.ajax({
635
+ type: "POST",
636
+ url:ajaxurl,
637
+ dataType: "json",
638
+ 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},
639
+ success:function(response){
640
+
641
+ $("#"+add_on+"_addon_license_key_status").val(response['status']);
642
+
643
+ if(response['status'] =='active'){
644
+ $(".saswp-"+add_on+"-dashicons").addClass('dashicons-yes');
645
+ $(".saswp-"+add_on+"-dashicons").removeClass('dashicons-no-alt');
646
+ $(".saswp-"+add_on+"-dashicons").css("color", "green");
647
+
648
+ $(".saswp_license_activation[add-on='" + add_on + "']").attr("license-status", "inactive");
649
+ $(".saswp_license_activation[add-on='" + add_on + "']").text("Deactivate");
650
+
651
+ $(".saswp_license_status_msg[add-on='" + add_on + "']").text('Activated');
652
+
653
+ $(".saswp_license_status_msg[add-on='" + add_on + "']").css("color", "green");
654
+ $(".saswp_license_status_msg[add-on='" + add_on + "']").text(response['message']);
655
+
656
+ }else{
657
+
658
+ $(".saswp-"+add_on+"-dashicons").addClass('dashicons-no-alt');
659
+ $(".saswp-"+add_on+"-dashicons").removeClass('dashicons-yes');
660
+ $(".saswp-"+add_on+"-dashicons").css("color", "red");
661
+
662
+ $(".saswp_license_activation[add-on='" + add_on + "']").attr("license-status", "active");
663
+ $(".saswp_license_activation[add-on='" + add_on + "']").text("Activate");
664
+
665
+ $(".saswp_license_status_msg[add-on='" + add_on + "']").css("color", "red");
666
+ $(".saswp_license_status_msg[add-on='" + add_on + "']").text(response['message']);
667
+ }
668
+
669
+ },
670
+ error: function(response){
671
+ console.log(response);
672
+ }
673
+ });
674
+
675
+ }
676
 
677
+ });
678
+ //Licensing jquery ends here
679
  //query form send starts here
680
 
681
  $(".saswp-send-query").on("click", function(e){
937
  saswp_enable_rating_review();
938
  });
939
 
940
+
941
+ $('#saswp-global-tabs a:first').addClass('saswp-global-selected');
942
+ $('.saswp-global-container').hide();
943
+ $('.saswp-global-container:first').show();
944
+
945
+ $('#saswp-global-tabs a').click(function(){
946
+ var t = $(this).attr('data-id');
947
+
948
+ if(!$(this).hasClass('saswp-global-selected')){
949
+ $('#saswp-global-tabs a').removeClass('saswp-global-selected');
950
+ $(this).addClass('saswp-global-selected');
951
+
952
+ $('.saswp-global-container').hide();
953
+ $('#'+t).show();
954
+ }
955
+ });
956
+
957
  //Importer from schema plugin ends here
958
 
959
  //custom fields modify schema starts here
980
  saswpCustomSelect2();
981
  } );
982
 
983
+
984
+ $(document).on("click", '.saswp-skip-button', function(){
985
+ $(this).parent().parent().hide();
986
+ });
987
+
988
  $(document).on("click", '.saswp-add-custom-fields', function(){
989
  var schema_type = $('select#schema_type option:selected').val();
990
  var post_id = $('#post_ID').val();
1086
  //custom fields modify schema ends here
1087
 
1088
 
1089
+ //Google review js starts here
1090
+
1091
+ // var acc = document.getElementsByClassName("saswp-accordion");
1092
+ // var i;
1093
+ //
1094
+ // for (i = 0; i < acc.length; i++) {
1095
+ // acc[i].addEventListener("click", function() {
1096
+ // this.classList.toggle("active");
1097
+ // var panel = this.nextElementSibling;
1098
+ // if (panel.style.display === "block") {
1099
+ // panel.style.display = "none";
1100
+ // } else {
1101
+ // panel.style.display = "block";
1102
+ // }
1103
+ // });
1104
+ // }
1105
+
1106
+ $('a[href="'+saswp_localize_data.collection_post_add_url+'"]').attr( 'href', saswp_localize_data.collection_post_add_new_url);
1107
+
1108
+
1109
+
1110
+ $(document).on("click", '.saswp_coonect_google_place', function(){
1111
+
1112
+ var place_id = $("#saswp_google_place_id").val();
1113
+ var language = $("#saswp_language_list").val();
1114
+ var google_api = $("#saswp_googel_api").val();
1115
+
1116
+ if(place_id !=''){
1117
+ $.ajax({
1118
+ type: "POST",
1119
+ url:ajaxurl,
1120
+ dataType: "json",
1121
+ 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},
1122
+ success:function(response){
1123
+ console.log(response['status']);
1124
+ },
1125
+ error: function(response){
1126
+ console.log(response);
1127
+ }
1128
+ });
1129
+ }
1130
+ });
1131
+
1132
+
1133
+ //google review js ends here
1134
+
1135
+
1136
+
1137
+
1138
+
1139
  //Adding settings button beside add schema type button on schema type list page
1140
 
1141
  if ('saswp' == saswp_app_object.post_type && saswp_app_object.page_now == 'edit.php') {
admin_section/settings.php CHANGED
@@ -10,7 +10,8 @@ function saswp_plugin_action_links( $links ) {
10
 
11
  $nonce = wp_create_nonce( 'saswp_install_wizard_nonce' );
12
  $links[] = '<a href="' . esc_url( admin_url( 'edit.php?post_type=saswp&page=structured_data_options' ) ) . '">' . esc_html__( 'Settings', 'schema-and-structured-data-for-wp' ) . '</a>';
13
- $links[] = '<a href="'. esc_url( admin_url( 'plugins.php?page=saswp-setup-wizard' ).'&_saswp_nonce='.$nonce).'">' . esc_html__( 'Start setup wizard &raquo;', 'schema-and-structured-data-for-wp' ) . '</a>';
 
14
  return $links;
15
 
16
  }
@@ -36,7 +37,7 @@ function saswp_admin_interface_render(){
36
  $is_amp = true;
37
  }
38
 
39
- $tab = saswp_get_tab('general', array('general','knowledge','schema', 'tools', 'amp','review','compatibility','email_schema','support'));
40
 
41
  ?>
42
  <div class="saswp-settings-container">
@@ -47,71 +48,86 @@ function saswp_admin_interface_render(){
47
 
48
  <?php
49
 
50
- echo '<a href="' . esc_url(saswp_admin_link('general')) . '" class="nav-tab ' . esc_attr( $tab == 'general' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('General','schema-and-structured-data-for-wp') . '</a>';
51
-
52
- echo '<a href="' . esc_url(saswp_admin_link('knowledge')) . '" class="nav-tab ' . esc_attr( $tab == 'knowledge' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Knowledge Graph','schema-and-structured-data-for-wp') . '</a>';
53
-
54
  echo '<a href="' . esc_url(saswp_admin_link('amp')) . '" class="nav-tab ' . esc_attr( $tab == 'amp' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('AMP','schema-and-structured-data-for-wp') . '</a>';
55
-
56
- echo '<a href="' . esc_url(saswp_admin_link('tools')) . '" class="nav-tab ' . esc_attr( $tab == 'tools' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Tools','schema-and-structured-data-for-wp') . '</a>';
57
-
58
- echo '<a href="' . esc_url(saswp_admin_link('schema')) . '" class="nav-tab ' . esc_attr( $tab == 'schema' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Misc','schema-and-structured-data-for-wp') . '</a>';
59
-
60
  echo '<a href="' . esc_url(saswp_admin_link('review')) . '" class="nav-tab ' . esc_attr( $tab == 'review' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Review','schema-and-structured-data-for-wp') . '</a>';
61
 
62
  echo '<a href="' . esc_url(saswp_admin_link('compatibility')) . '" class="nav-tab ' . esc_attr( $tab == 'compatibility' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Compatibility','schema-and-structured-data-for-wp') . '</a>';
63
 
64
- //echo '<a href="' . esc_url(saswp_admin_link('email_schema')) . '" class="nav-tab ' . esc_attr( $tab == 'email_schema' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Email Schema','schema-and-structured-data-for-wp') . '</a>';
 
 
 
 
 
 
65
 
66
  echo '<a href="' . esc_url(saswp_admin_link('support')) . '" class="nav-tab ' . esc_attr( $tab == 'support' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Support','schema-and-structured-data-for-wp') . '</a>';
67
  ?>
68
 
69
  </h2>
 
 
70
  </div>
 
71
  <form action="<?php echo admin_url("options.php") ?>" method="post" enctype="multipart/form-data" class="saswp-settings-form">
72
  <div class="form-wrap saswp-settings-form-wrap">
73
  <?php
74
  // Output nonce, action, and option_page fields for a settings page.
75
  settings_fields( 'sd_data_group' );
76
  echo "<div class='saswp-general' ".( $tab != 'general' ? 'style="display:none;"' : '').">";
77
- // general Application Settings
 
 
 
 
 
 
 
78
  do_settings_sections( 'saswp_general_section' ); // Page slug
79
  echo "</div>";
80
-
81
- echo "<div class='saswp-knowledge' ".( $tab != 'knowledge' ? 'style="display:none;"' : '').">";
82
- // knowledge Application Settings
83
- do_settings_sections( 'saswp_knowledge_section' ); // Page slug
84
- echo "</div>";
85
- echo "<div class='saswp-schema' ".( $tab != 'schema' ? 'style="display:none;"' : '').">";
86
- do_settings_sections( 'saswp_schema_section' ); // Page slug
87
- echo "</div>";
88
-
89
- echo "<div class='saswp-amp' ".( $tab != 'amp' ? 'style="display:none;"' : '').">";
90
- do_settings_sections( 'saswp_amp_section' ); // Page slug
91
- echo "</div>";
92
 
93
- echo "<div class='saswp-tools' ".( $tab != 'tools' ? 'style="display:none;"' : '').">";
94
- // Status
95
- do_settings_sections( 'saswp_tools_section' ); // Page slug
96
  echo "</div>";
97
-
98
  echo "<div class='saswp-review' ".( $tab != 'review' ? 'style="display:none;"' : '').">";
99
- // Status
100
  do_settings_sections( 'saswp_review_section' ); // Page slug
101
  echo "</div>";
102
 
103
  echo "<div class='saswp-compatibility' ".( $tab != 'compatibility' ? 'style="display:none;"' : '').">";
104
  // Status
 
105
  do_settings_sections( 'saswp_compatibility_section' ); // Page slug
106
  echo "</div>";
107
 
108
  echo "<div class='saswp-email_schema' ".( $tab != 'email_schema' ? 'style="display:none;"' : '').">";
109
- // Status
110
  do_settings_sections( 'saswp_email_schema_section' ); // Page slug
111
  echo "</div>";
112
 
113
- echo "<div class='saswp-support' ".( $tab != 'support' ? 'style="display:none;"' : '').">";
114
  // Status
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  do_settings_sections( 'saswp_support_section' ); // Page slug
116
  echo "</div>";
117
 
@@ -150,7 +166,22 @@ function saswp_admin_interface_render(){
150
  <?php echo esc_html__( 'Tweet', 'schema-and-structured-data-for-wp' ); ?>
151
  </a>
152
  </div>
 
153
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  </div>
155
  </div>
156
 
@@ -173,26 +204,7 @@ function saswp_settings_init(){
173
  'saswp_general_section', // Page slug
174
  'saswp_general_section' // Settings Section ID
175
  );
176
-
177
- add_settings_section('saswp_knowledge_section', __return_false(), '__return_false', 'saswp_knowledge_section');
178
-
179
- add_settings_field(
180
- 'knowledge_settings', // ID
181
- '', // Title
182
- 'saswp_knowledge_page_callback', // CB
183
- 'saswp_knowledge_section', // Page slug
184
- 'saswp_knowledge_section' // Settings Section ID
185
- );
186
- add_settings_section('saswp_schema_section', __return_false(), '__return_false', 'saswp_schema_section');
187
-
188
- add_settings_field(
189
- 'saswp_schema_settings', // ID
190
- '', // Title
191
- 'saswp_schema_page_callback', // CB
192
- 'saswp_schema_section', // Page slug
193
- 'saswp_schema_section' // Settings Section ID
194
- );
195
-
196
  add_settings_section('saswp_amp_section', __return_false(), '__return_false', 'saswp_amp_section');
197
 
198
  add_settings_field(
@@ -255,7 +267,29 @@ function saswp_settings_init(){
255
  'saswp_import_callback', // Callback
256
  'saswp_tools_section', // Page slug
257
  'saswp_tools_section' // Settings Section ID
258
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
 
260
 
261
  }
@@ -284,47 +318,82 @@ function saswp_handle_file_upload($option){
284
  }
285
 
286
 
287
- function saswp_schema_page_callback(){
288
- // Get Settings
289
- $settings = saswp_defaultSettings();
290
- $field_objs = new saswp_fields_generator();
291
-
292
- $meta_fields_default = array(
293
- array(
294
- 'label' => 'Default Image',
295
- 'id' => 'sd_default_image',
296
- 'name' => 'sd_data[sd_default_image][url]',
297
- 'class' => 'saswp-sd_default_image',
298
- 'type' => 'media',
299
- ),
300
- array(
301
- 'label' => 'Default Post Image Width',
302
- 'id' => 'sd_default_image_width',
303
- 'name' => 'sd_data[sd_default_image_width]',
304
- 'class' => 'regular-text',
305
- 'type' => 'text',
306
- ),
307
- array(
308
- 'label' => 'Default Post Image Height',
309
- 'id' => 'sd_default_image_height',
310
- 'name' => 'sd_data[sd_default_image_height]',
311
- 'class' => 'regular-text',
312
- 'type' => 'text',
313
- ),
314
- array(
315
- 'label' => 'Default Thumbnail for VideoObject',
316
- 'id' => 'sd_default_video_thumbnail',
317
- 'name' => 'sd_data[sd_default_video_thumbnail][url]',
318
- 'class' => 'saswp-sd_default_video_thumbnail',
319
- 'type' => 'media',
320
- ),
321
- );
322
- echo '<h2>'.esc_html__('Default Values','schema-and-structured-data-for-wp').'</h2>';
323
- echo '<div class="saswp-schema-type-fields">';
324
- $field_objs->saswp_field_generator($meta_fields_default, $settings);
325
- echo '</div>';
326
  }
327
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
328
  function saswp_amp_page_callback(){
329
 
330
  $settings = saswp_defaultSettings();
@@ -376,10 +445,11 @@ function saswp_amp_page_callback(){
376
  function saswp_general_page_callback(){
377
 
378
  $settings = saswp_defaultSettings();
 
379
 
380
  $meta_fields_default = array(
381
  array(
382
- 'label' => 'Website',
383
  'id' => 'saswp_website_schema_checkbox',
384
  'name' => 'saswp_website_schema_checkbox',
385
  'type' => 'checkbox',
@@ -394,8 +464,7 @@ function saswp_general_page_callback(){
394
  'id' => 'saswp_search_box_schema_checkbox',
395
  'name' => 'saswp_search_box_schema_checkbox',
396
  'type' => 'checkbox',
397
- 'class' => 'checkbox saswp-checkbox',
398
- 'note' => 'To use this feature, Firstly enable website schema',
399
  'hidden' => array(
400
  'id' => 'saswp_search_box_schema',
401
  'name' => 'sd_data[saswp_search_box_schema]',
@@ -462,10 +531,15 @@ function saswp_general_page_callback(){
462
  )
463
 
464
  ?>
465
- <div class="saswp-settings-list">
466
- <h2><?php echo esc_html__('Page Schema','schema-and-structured-data-for-wp') ?></h2>
467
- <ul><li><div style="float:left;clear: both;"><label class="saswp-tooltip">
468
- <?php echo esc_html__('About','schema-and-structured-data-for-wp') ?>
 
 
 
 
 
469
  <span class="saswp-tooltiptext"><?php echo esc_html__('Set the about page of of your website','schema-and-structured-data-for-wp') ?></span>
470
  </label>
471
  </div>
@@ -508,20 +582,23 @@ function saswp_general_page_callback(){
508
  </div>
509
  </li>
510
  </ul>
511
- </div>
512
- <?php
 
 
513
 
514
- $field_objs = new saswp_fields_generator();
515
 
516
  echo '<div class="saswp-archive-div">';
517
  $field_objs->saswp_field_generator($meta_fields_default, $settings);
518
  echo '</div>';
519
 
520
- }
521
- function saswp_knowledge_page_callback(){
522
-
523
- $settings = saswp_defaultSettings();
524
- $field_objs = new saswp_fields_generator();
 
 
525
 
526
  $meta_fields = array(
527
  array(
@@ -535,29 +612,28 @@ function saswp_knowledge_page_callback(){
535
  'Person' => 'Person',
536
  )
537
  ),
538
- array(
539
- 'label' => 'Organization Type',
540
- 'id' => 'saswp_organization_type',
541
- 'name' => 'sd_data[saswp_organization_type]',
542
- 'class' => 'saswp_org_fields',
543
- 'type' => 'select',
544
- 'options' => array(
545
- 'Organization' => 'Organization',
546
- 'Airline' => 'Airline',
547
- 'Consortium' => 'Consortium',
548
- 'Corporation' => 'Corporation',
549
- 'EducationalOrganization' => 'EducationalOrganization',
550
- 'GovernmentOrganization' => 'GovernmentOrganization',
551
- 'LibrarySystem' => 'LibrarySystem',
552
- 'LocalBusiness' => 'LocalBusiness',
553
- 'MedicalOrganization' => 'MedicalOrganization',
554
- 'NewsMediaOrganization' => 'NewsMediaOrganization',
555
- 'NGO' => 'NGO',
556
- 'PerformingGroup' => 'PerformingGroup',
557
- 'SportsOrganization' => 'SportsOrganization',
558
- 'WorkersUnion' => 'WorkersUnion',
559
- )
560
- ),
561
  array(
562
  'label' => 'Organization Name',
563
  'id' => 'sd_name',
@@ -660,7 +736,7 @@ function saswp_knowledge_page_callback(){
660
  ),
661
 
662
  );
663
- echo '<h2>'.esc_html__('Knowledge Base','schema-and-structured-data-for-wp').'</h2>';
664
  echo '<div class="saswp-knowledge-base">';
665
  $field_objs->saswp_field_generator($meta_fields, $settings);
666
  echo '</div>';
@@ -840,8 +916,64 @@ function saswp_knowledge_page_callback(){
840
  );
841
  echo '<div class="saswp-social-fileds">';
842
  $field_objs->saswp_field_generator($social_meta_fields, $settings);
843
- echo '</div>';
844
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
845
  }
846
 
847
  function saswp_check_data_imported_from($plugin_post_type_name){
@@ -859,6 +991,51 @@ function saswp_check_data_imported_from($plugin_post_type_name){
859
  }
860
  function saswp_import_callback(){
861
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
862
  $message = 'This plugin\'s data already has been imported. Do you want to import again?. click on button above button.';
863
  $schema_message = '';
864
  $schema_pro_message = '';
@@ -935,12 +1112,103 @@ function saswp_import_callback(){
935
  <ul>
936
  <li>
937
  <div class="saswp-tools-field-title">
938
- <div class="saswp-tooltip"><strong><?php echo esc_html__('Reset Plugin','schema-and-structured-data-for-wp'); ?></strong></div><a href="#"class="button saswp-reset-data"><?php echo esc_html__('Reset','schema-and-structured-data-for-wp'); ?></a>
939
  <p><?php echo esc_html__('This will reset your settings and schema types','schema-and-structured-data-for-wp'); ?></p>
940
  </div>
941
  </li>
942
 
943
  </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
944
  <?php
945
 
946
  }
@@ -960,10 +1228,28 @@ function saswp_review_page_callback(){
960
  'id' => 'saswp-review-module',
961
  'name' => 'sd_data[saswp-review-module]',
962
  )
963
- ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
964
 
965
  );
966
- $field_objs->saswp_field_generator($meta_fields, $settings);
967
 
968
  }
969
 
@@ -989,18 +1275,13 @@ function saswp_email_schema_callback(){
989
 
990
  }
991
 
992
- if(!is_plugin_active('schema-and-structured-data-for-wp-pro/schema-and-structured-data-for-wp-pro.php')){
993
-
994
- $woocommerce['attributes'] = array(
995
- 'disabled' => 'disabled'
996
- );
997
-
998
- $settings['saswp-woocommerce-booking-main'] = 0;
999
- $settings['saswp-woocommerce-booking'] = 0;
1000
- $woocommerce['proversion'] = true;
1001
-
1002
  }
1003
-
 
1004
  $field_objs = new saswp_fields_generator();
1005
  $meta_fields = array(
1006
  $woocommerce,
@@ -1072,6 +1353,19 @@ function saswp_compatibility_page_callback(){
1072
  'name' => 'sd_data[saswp-woocommerce-booking]',
1073
  )
1074
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
1075
  $woocommerce_mem = array(
1076
  'label' => 'Woocommerce Membership',
1077
  'id' => 'saswp-woocommerce-membership-checkbox',
@@ -1145,51 +1439,49 @@ function saswp_compatibility_page_callback(){
1145
 
1146
  }
1147
  if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-bookings/woocommerce-bookings.php')){
1148
-
1149
-
1150
- $woocommerce_bok['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
1151
-
1152
-
 
 
 
 
1153
  }
1154
 
1155
 
 
 
 
 
 
 
 
 
 
 
 
1156
 
1157
 
1158
- if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-memberships/woocommerce-memberships.php')){
1159
-
1160
-
1161
- $woocommerce_mem['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
1162
 
1163
-
1164
- }
1165
-
1166
- if(!is_plugin_active('schema-and-structured-data-for-wp-pro/schema-and-structured-data-for-wp-pro.php')){
1167
-
1168
- $woocommerce_bok['attributes'] = array(
1169
- 'disabled' => 'disabled'
1170
- );
1171
 
1172
- $woocommerce_bok['proversion'] = true;
1173
-
1174
- $settings['saswp-woocommerce-booking'] = 0;
1175
-
1176
- $woocommerce_mem['attributes'] = array(
1177
- 'disabled' => 'disabled'
1178
- );
1179
-
1180
- $settings['saswp-woocommerce-membership'] = 0;
1181
- $woocommerce_mem['proversion'] = true;
1182
-
1183
- }
1184
-
1185
  if(get_template() != 'Extra'){
1186
 
1187
  $extratheme['note'] = esc_html__('Theme is not activated','schema-and-structured-data-for-wp');
1188
 
1189
 
1190
  }
1191
-
1192
-
1193
  if(!is_plugin_active('dw-question-answer/dw-question-answer.php')){
1194
 
1195
  $dwquestiton['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
@@ -1203,19 +1495,20 @@ function saswp_compatibility_page_callback(){
1203
  // }
1204
 
1205
  if(!is_plugin_active('the-events-calendar/the-events-calendar.php')){
1206
-
1207
-
1208
  $the_events_calendar['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
1209
 
1210
  }
 
1211
 
1212
  $field_objs = new saswp_fields_generator();
1213
 
1214
  $meta_fields = array(
1215
  $kk_star,
1216
  $woocommerce,
1217
- // $woocommerce_bok,
1218
- // $woocommerce_mem,
 
1219
  $the_events_calendar,
1220
  $tagyeem,
1221
  $extratheme,
@@ -1326,7 +1619,7 @@ function saswp_support_page_callback(){
1326
 
1327
  ?>
1328
  <div class="saswp_support_div">
1329
- <strong><?php echo esc_html__('If you have any query, please write the query in below box or email us at', 'schema-and-structured-data-for-wp') ?> <a href="mailto:team@magazine3.com">team@magazine3.com</a>. <?php echo esc_html__('We will reply to your email address shortly', 'schema-and-structured-data-for-wp') ?></strong>
1330
 
1331
  <ul>
1332
  <li>
@@ -1341,19 +1634,22 @@ function saswp_support_page_callback(){
1341
  </div>
1342
  <?php
1343
 
1344
- echo '<h1>'.esc_html__( 'Frequently Asked Questions.', 'schema-and-structured-data-for-wp' ).'</h1>
1345
- <br><br>
1346
- <h3>1Q) '.esc_html__( 'How can I setup the Schema and Structured data for individual pages and posts?', 'schema-and-structured-data-for-wp' ).'</h3>
 
 
 
1347
  <p class="saswp_qanda_p">A) '.esc_html__( 'Just with one click on the Structured data option, you will find an add new options window in the structured data option panel. Secondly, you need to write the name of the title where, if you would like to set the individual Page/Post then you can set the Page/Post type equal to the Page/Post(Name).', 'schema-and-structured-data-for-wp' ).'</p>
1348
 
1349
- <h3>2Q) '.esc_html__( 'How can I check the code whether the structured data is working or not?', 'schema-and-structured-data-for-wp' ).'</h3>
1350
- <p class="saswp_qanda_p">A) To check the code, the first step we need to take is to copy the code of a page or post then visit the <a href="https://search.google.com/structured-data/testing-tool" target="_blank">Structured data testing tool</a> by clicking on code snippet. Once we paste the snippet we can run the test.</p>
1351
 
1352
- <h3> 3Q) '.esc_html__( 'How can I check whether the pages or posts are valid or not?', 'schema-and-structured-data-for-wp' ).'</h3>
1353
- <p class="saswp_qanda_p"> A) '.esc_html__( 'To check the page and post validation, please visit the', 'schema-and-structured-data-for-wp' ).' <a href="https://search.google.com/structured-data/testing-tool" target="_blank">'.esc_html__( 'Structured data testing tool', 'schema-and-structured-data-for-wp' ).'</a> '.esc_html__( 'and paste the link of your website.', 'schema-and-structured-data-for-wp' ).' '.esc_html__( 'Once we click on run test we can see the result whether the page or post is a valid one or not.', 'schema-and-structured-data-for-wp' ).'</p>
1354
 
1355
- <h3>4Q) '.esc_html__( 'Where should users contact if they faced any issues?', 'schema-and-structured-data-for-wp' ).'</h3>
1356
- <p class="saswp_qanda_p">A) '.esc_html__( 'We always welcome all our users to share their issues and get them fixed just with one click to the link', 'schema-and-structured-data-for-wp' ).' team@magazine3.com or <a href="https://ampforwp.com/support/" target="_blank">'.esc_html__( 'Support link', 'schema-and-structured-data-for-wp' ).'</a></p><br>';
1357
  }
1358
 
1359
  /**
@@ -1375,7 +1671,10 @@ function saswp_enqueue_style_js( $hook ) {
1375
  'ajax_url' => admin_url( 'admin-ajax.php' ),
1376
  'saswp_security_nonce' => wp_create_nonce('saswp_ajax_check_nonce'),
1377
  'new_url_selector' => esc_url(admin_url()).'post-new.php?post_type=saswp',
1378
- 'new_url_href' => htmlspecialchars_decode(wp_nonce_url(admin_url('index.php?page=saswp_add_new_data_type&'), '_wpnonce'))
 
 
 
1379
  );
1380
 
1381
  wp_localize_script( 'saswp-main-js', 'saswp_localize_data', $data );
10
 
11
  $nonce = wp_create_nonce( 'saswp_install_wizard_nonce' );
12
  $links[] = '<a href="' . esc_url( admin_url( 'edit.php?post_type=saswp&page=structured_data_options' ) ) . '">' . esc_html__( 'Settings', 'schema-and-structured-data-for-wp' ) . '</a>';
13
+ $links[] = '<a href="'. esc_url( admin_url( 'plugins.php?page=saswp-setup-wizard' ).'&_saswp_nonce='.$nonce).'">' . esc_html__( 'Setup Wizard', 'schema-and-structured-data-for-wp' ) . '</a>';
14
+ $links[] = '<a target="_blank" href="http://structured-data-for-wp.com/docs/">' . esc_html__( 'Documentation', 'schema-and-structured-data-for-wp' ) . '</a>';
15
  return $links;
16
 
17
  }
37
  $is_amp = true;
38
  }
39
 
40
+ $tab = saswp_get_tab('general', array('general', 'amp','review','compatibility','email_schema', 'tools', 'tools','premium_features', 'services', 'support'));
41
 
42
  ?>
43
  <div class="saswp-settings-container">
48
 
49
  <?php
50
 
51
+ echo '<a href="' . esc_url(saswp_admin_link('general')) . '" class="nav-tab ' . esc_attr( $tab == 'general' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Global','schema-and-structured-data-for-wp') . '</a>';
52
+
 
 
53
  echo '<a href="' . esc_url(saswp_admin_link('amp')) . '" class="nav-tab ' . esc_attr( $tab == 'amp' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('AMP','schema-and-structured-data-for-wp') . '</a>';
54
+
 
 
 
 
55
  echo '<a href="' . esc_url(saswp_admin_link('review')) . '" class="nav-tab ' . esc_attr( $tab == 'review' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Review','schema-and-structured-data-for-wp') . '</a>';
56
 
57
  echo '<a href="' . esc_url(saswp_admin_link('compatibility')) . '" class="nav-tab ' . esc_attr( $tab == 'compatibility' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Compatibility','schema-and-structured-data-for-wp') . '</a>';
58
 
59
+ echo '<a href="' . esc_url(saswp_admin_link('email_schema')) . '" class="nav-tab ' . esc_attr( $tab == 'email_schema' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Email Schema','schema-and-structured-data-for-wp') . '</a>';
60
+
61
+ echo '<a href="' . esc_url(saswp_admin_link('tools')) . '" class="nav-tab ' . esc_attr( $tab == 'tools' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Advanced','schema-and-structured-data-for-wp') . '</a>';
62
+
63
+ echo '<a href="' . esc_url(saswp_admin_link('premium_features')) . '" class="nav-tab ' . esc_attr( $tab == 'premium_features' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Premium Features','schema-and-structured-data-for-wp') . '</a>';
64
+
65
+ echo '<a href="' . esc_url(saswp_admin_link('services')) . '" class="nav-tab ' . esc_attr( $tab == 'services' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Services','schema-and-structured-data-for-wp') . '</a>';
66
 
67
  echo '<a href="' . esc_url(saswp_admin_link('support')) . '" class="nav-tab ' . esc_attr( $tab == 'support' ? 'nav-tab-active' : '') . '"><span class=""></span> ' . esc_html__('Support','schema-and-structured-data-for-wp') . '</a>';
68
  ?>
69
 
70
  </h2>
71
+
72
+
73
  </div>
74
+
75
  <form action="<?php echo admin_url("options.php") ?>" method="post" enctype="multipart/form-data" class="saswp-settings-form">
76
  <div class="form-wrap saswp-settings-form-wrap">
77
  <?php
78
  // Output nonce, action, and option_page fields for a settings page.
79
  settings_fields( 'sd_data_group' );
80
  echo "<div class='saswp-general' ".( $tab != 'general' ? 'style="display:none;"' : '').">";
81
+
82
+ echo '<div id="saswp-global-tabs" style="margin-top: 10px;">';
83
+
84
+ echo '<a data-id="saswp-general-container">General Settings</a> | <a data-id="saswp-knowledge-container">Knowledge Graph</a> | <a data-id="saswp-default-container" >Default Data</a>';
85
+
86
+ echo'</div> ';
87
+
88
+ // general Application Settings
89
  do_settings_sections( 'saswp_general_section' ); // Page slug
90
  echo "</div>";
91
+
92
+ echo "<div class='saswp-amp' ".( $tab != 'amp' ? 'style="display:none;"' : '').">";
 
 
 
 
 
 
 
 
 
 
93
 
94
+ do_settings_sections( 'saswp_amp_section' ); // Page slug
 
 
95
  echo "</div>";
96
+
97
  echo "<div class='saswp-review' ".( $tab != 'review' ? 'style="display:none;"' : '').">";
98
+ // Status
99
  do_settings_sections( 'saswp_review_section' ); // Page slug
100
  echo "</div>";
101
 
102
  echo "<div class='saswp-compatibility' ".( $tab != 'compatibility' ? 'style="display:none;"' : '').">";
103
  // Status
104
+
105
  do_settings_sections( 'saswp_compatibility_section' ); // Page slug
106
  echo "</div>";
107
 
108
  echo "<div class='saswp-email_schema' ".( $tab != 'email_schema' ? 'style="display:none;"' : '').">";
109
+ // Status
110
  do_settings_sections( 'saswp_email_schema_section' ); // Page slug
111
  echo "</div>";
112
 
113
+ echo "<div class='saswp-tools' ".( $tab != 'tools' ? 'style="display:none;"' : '').">";
114
  // Status
115
+
116
+ do_settings_sections( 'saswp_tools_section' ); // Page slug
117
+ echo "</div>";
118
+
119
+ echo "<div class='saswp-premium_features' ".( $tab != 'premium_features' ? 'style="display:none;"' : '').">";
120
+ // Status
121
+ do_settings_sections( 'saswp_premium_features_section' ); // Page slug
122
+ echo "</div>";
123
+
124
+ echo "<div class='saswp-services' ".( $tab != 'services' ? 'style="display:none;"' : '').">";
125
+ // Status
126
+ do_settings_sections( 'saswp_services_section' ); // Page slug
127
+ echo "</div>";
128
+
129
+ echo "<div class='saswp-support' ".( $tab != 'support' ? 'style="display:none;"' : '').">";
130
+ // Status
131
  do_settings_sections( 'saswp_support_section' ); // Page slug
132
  echo "</div>";
133
 
166
  <?php echo esc_html__( 'Tweet', 'schema-and-structured-data-for-wp' ); ?>
167
  </a>
168
  </div>
169
+
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>
187
 
204
  'saswp_general_section', // Page slug
205
  'saswp_general_section' // Settings Section ID
206
  );
207
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  add_settings_section('saswp_amp_section', __return_false(), '__return_false', 'saswp_amp_section');
209
 
210
  add_settings_field(
267
  'saswp_import_callback', // Callback
268
  'saswp_tools_section', // Page slug
269
  'saswp_tools_section' // Settings Section ID
270
+ );
271
+
272
+ add_settings_section('saswp_premium_features_section', __return_false(), '__return_false', 'saswp_premium_features_section');
273
+
274
+ // the meta_key 'diplay_on_homepage' with the meta_value 'true'
275
+ add_settings_field(
276
+ 'saswp_premium_features_settings', // ID
277
+ '', // Title
278
+ 'saswp_premium_features_callback', // Callback
279
+ 'saswp_premium_features_section', // Page slug
280
+ 'saswp_premium_features_section' // Settings Section ID
281
+ );
282
+
283
+ add_settings_section('saswp_services_section', __return_false(), '__return_false', 'saswp_services_section');
284
+
285
+ // the meta_key 'diplay_on_homepage' with the meta_value 'true'
286
+ add_settings_field(
287
+ 'saswp_services_settings', // ID
288
+ '', // Title
289
+ 'saswp_services_callback', // Callback
290
+ 'saswp_services_section', // Page slug
291
+ 'saswp_services_section' // Settings Section ID
292
+ );
293
 
294
 
295
  }
318
  }
319
 
320
 
321
+ function saswp_premium_features_callback(){ ?>
322
+ <div class="saswp-pre-ftrs-wrap">
323
+ <ul class="saswp-features-blocks">
324
+ <li><a target="_blank" href="http://structured-data-for-wp.com/extensions/woocommerce-compatibility-for-schema/">
325
+ <div class="saswp-features-ele">
326
+ <div class="saswp-ele-ic saswp-ele-1">
327
+ <img src="http://structured-data-for-wp.com/wp-content/uploads/edd/2019/05/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">
335
+ <label class="saswp-sts-txt">Staus:<span>Inactive</span></label>
336
+ <span class="saswp-d-btn">Download</span>
337
+ </div>
338
+ </a></li>
339
+ <li><a target="_blank" href="http://structured-data-for-wp.com/extensions/cooked-compatibility-for-schema/">
340
+ <div class="saswp-features-ele">
341
+ <div class="saswp-ele-ic saswp-ele-2">
342
+ <img src="http://structured-data-for-wp.com/wp-content/uploads/edd/2019/05/cooked-schema-wp.png">
343
+ </div>
344
+ <div class="saswp-ele-tlt">
345
+ <h3>Cooked Compatibility for Schema</h3>
346
+ <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>
347
+ </div>
348
+ </div>
349
+ <div class="saswp-sts-btn">
350
+ <label class="saswp-sts-txt">Staus:<span>Inactive</span></label>
351
+ <span class="saswp-d-btn">Download</span>
352
+ </div>
353
+ </a></li>
354
+ </ul>
355
+ </div>
356
+
357
+ <?php
 
 
358
  }
359
 
360
+ function saswp_services_callback(){ ?>
361
+ <div class="saswp-pre-ftrs-wrap">
362
+ <ul class="saswp-features-blocks">
363
+ <li><a target="_blank" href="http://structured-data-for-wp.com/services/google-news-schema-setup/">
364
+ <div class="saswp-features-ele">
365
+ <div class="saswp-ele-ic saswp-ele-3">
366
+ <img src="http://structured-data-for-wp.com/wp-content/uploads/edd/2019/05/news.png">
367
+ </div>
368
+ <div class="saswp-ele-tlt">
369
+ <h3>Google News Schema Setup</h3>
370
+ <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>
371
+ </div>
372
+ </div>
373
+ <div class="saswp-sts-btn">
374
+ <label class="saswp-sts-txt">Staus:<span>Inactive</span></label>
375
+ <span class="saswp-d-btn">Download</span>
376
+ </div>
377
+ </a></li>
378
+ <li><a target="_blank" href="http://structured-data-for-wp.com/services/structured-data-setup-error-clean-up/">
379
+ <div class="saswp-features-ele">
380
+ <div class="saswp-ele-ic saswp-ele-4">
381
+ <img src="http://structured-data-for-wp.com/wp-content/uploads/edd/2019/05/schema-setup-icon.png">
382
+ </div>
383
+ <div class="saswp-ele-tlt">
384
+ <h3>Structured Data Setup & Error Clean Up</h3>
385
+ <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>
386
+ </div>
387
+ </div>
388
+ <div class="saswp-sts-btn">
389
+ <label class="saswp-sts-txt">Staus:<span>Inactive</span></label>
390
+ <span class="saswp-d-btn">Download</span>
391
+ </div>
392
+ </a></li>
393
+ </ul>
394
+ </div>
395
+
396
+ <?php }
397
  function saswp_amp_page_callback(){
398
 
399
  $settings = saswp_defaultSettings();
445
  function saswp_general_page_callback(){
446
 
447
  $settings = saswp_defaultSettings();
448
+ $field_objs = new saswp_fields_generator();
449
 
450
  $meta_fields_default = array(
451
  array(
452
+ 'label' => 'Website Schema (Global)',
453
  'id' => 'saswp_website_schema_checkbox',
454
  'name' => 'saswp_website_schema_checkbox',
455
  'type' => 'checkbox',
464
  'id' => 'saswp_search_box_schema_checkbox',
465
  'name' => 'saswp_search_box_schema_checkbox',
466
  'type' => 'checkbox',
467
+ 'class' => 'checkbox saswp-checkbox',
 
468
  'hidden' => array(
469
  'id' => 'saswp_search_box_schema',
470
  'name' => 'sd_data[saswp_search_box_schema]',
531
  )
532
 
533
  ?>
534
+
535
+
536
+ <div class="saswp-global-container" id="saswp-general-container">
537
+
538
+ <div class="saswp-settings-list">
539
+ <h2><?php echo esc_html__('Page Schema','schema-and-structured-data-for-wp') ?> </h2>
540
+
541
+ <ul><li><div style="float:left;clear: both;"><label class="saswp-tooltip">
542
+ <?php echo esc_html__('About','schema-and-structured-data-for-wp') ?>
543
  <span class="saswp-tooltiptext"><?php echo esc_html__('Set the about page of of your website','schema-and-structured-data-for-wp') ?></span>
544
  </label>
545
  </div>
582
  </div>
583
  </li>
584
  </ul>
585
+ </div>
586
+
587
+ <?php
588
+
589
 
 
590
 
591
  echo '<div class="saswp-archive-div">';
592
  $field_objs->saswp_field_generator($meta_fields_default, $settings);
593
  echo '</div>';
594
 
595
+ ?>
596
+
597
+ </div>
598
+ <div class="saswp-global-container" id="saswp-knowledge-container">
599
+
600
+ <?php
601
+
602
 
603
  $meta_fields = array(
604
  array(
612
  'Person' => 'Person',
613
  )
614
  ),
615
+ // array(
616
+ // 'label' => 'Organization Type',
617
+ // 'id' => 'saswp_organization_type',
618
+ // 'name' => 'sd_data[saswp_organization_type]',
619
+ // 'class' => 'saswp_org_fields',
620
+ // 'type' => 'select',
621
+ // 'options' => array(
622
+ // 'Organization' => 'Organization',
623
+ // 'Airline' => 'Airline',
624
+ // 'Consortium' => 'Consortium',
625
+ // 'Corporation' => 'Corporation',
626
+ // 'EducationalOrganization' => 'EducationalOrganization',
627
+ // 'GovernmentOrganization' => 'GovernmentOrganization',
628
+ // 'LibrarySystem' => 'LibrarySystem',
629
+ // 'MedicalOrganization' => 'MedicalOrganization',
630
+ // 'NewsMediaOrganization' => 'NewsMediaOrganization',
631
+ // 'NGO' => 'NGO',
632
+ // 'PerformingGroup' => 'PerformingGroup',
633
+ // 'SportsOrganization' => 'SportsOrganization',
634
+ // 'WorkersUnion' => 'WorkersUnion',
635
+ // )
636
+ // ),
 
637
  array(
638
  'label' => 'Organization Name',
639
  'id' => 'sd_name',
736
  ),
737
 
738
  );
739
+ echo '<h2>'.esc_html__('Knowledge Graph','schema-and-structured-data-for-wp').'</h2>';
740
  echo '<div class="saswp-knowledge-base">';
741
  $field_objs->saswp_field_generator($meta_fields, $settings);
742
  echo '</div>';
916
  );
917
  echo '<div class="saswp-social-fileds">';
918
  $field_objs->saswp_field_generator($social_meta_fields, $settings);
919
+ echo '</div>';
920
+
921
+
922
+ ?>
923
+
924
+
925
+
926
+ </div>
927
+ <div class="saswp-global-container" id="saswp-default-container">
928
+
929
+ <?php
930
+
931
+
932
+ $meta_fields_default = array(
933
+ array(
934
+ 'label' => 'Default Image',
935
+ 'id' => 'sd_default_image',
936
+ 'name' => 'sd_data[sd_default_image][url]',
937
+ 'class' => 'saswp-sd_default_image',
938
+ 'type' => 'media',
939
+ ),
940
+ array(
941
+ 'label' => 'Default Post Image Width',
942
+ 'id' => 'sd_default_image_width',
943
+ 'name' => 'sd_data[sd_default_image_width]',
944
+ 'class' => 'regular-text',
945
+ 'type' => 'text',
946
+ ),
947
+ array(
948
+ 'label' => 'Default Post Image Height',
949
+ 'id' => 'sd_default_image_height',
950
+ 'name' => 'sd_data[sd_default_image_height]',
951
+ 'class' => 'regular-text',
952
+ 'type' => 'text',
953
+ ),
954
+ array(
955
+ 'label' => 'Default Thumbnail for VideoObject',
956
+ 'id' => 'sd_default_video_thumbnail',
957
+ 'name' => 'sd_data[sd_default_video_thumbnail][url]',
958
+ 'class' => 'saswp-sd_default_video_thumbnail',
959
+ 'type' => 'media',
960
+ ),
961
+ );
962
+ echo '<div class="saswp-heading">';
963
+ echo '<h2>'.esc_html__('Default Data','schema-and-structured-data-for-wp').'</h2>';
964
+ echo '<span class="saswp-need-help"><a target="_blank" href="http://structured-data-for-wp.com/docs/">Need Help?</a></span>';
965
+ echo '</div>';
966
+ echo '<div class="saswp-schema-type-fields">';
967
+ $field_objs->saswp_field_generator($meta_fields_default, $settings);
968
+ echo '</div>';
969
+
970
+
971
+ ?>
972
+ </div>
973
+
974
+ <?php
975
+
976
+
977
  }
978
 
979
  function saswp_check_data_imported_from($plugin_post_type_name){
991
  }
992
  function saswp_import_callback(){
993
 
994
+ global $sd_data;
995
+
996
+
997
+ echo '<h2>'.esc_html__('Advanced Settings','schema-and-structured-data-for-wp').'</h2>';
998
+
999
+ $settings = saswp_defaultSettings();
1000
+ $field_objs = new saswp_fields_generator();
1001
+ $meta_fields = array(
1002
+ array(
1003
+ 'label' => 'Defragment Schema Markup',
1004
+ 'id' => 'saswp-defragment-checkbox',
1005
+ 'name' => 'saswp-defragment-checkbox',
1006
+ 'type' => 'checkbox',
1007
+ 'class' => 'checkbox saswp-checkbox',
1008
+ 'hidden' => array(
1009
+ 'id' => 'saswp-defragment',
1010
+ 'name' => 'sd_data[saswp-defragment]',
1011
+ )
1012
+ ),
1013
+ array(
1014
+ 'label' => 'Add Schema Markup in footer',
1015
+ 'id' => 'saswp-markup-footer-checkbox',
1016
+ 'name' => 'saswp-markup-footer-checkbox',
1017
+ 'type' => 'checkbox',
1018
+ 'class' => 'checkbox saswp-checkbox',
1019
+ 'note' => 'By default schema markup will be added in header section',
1020
+ 'hidden' => array(
1021
+ 'id' => 'saswp-markup-footer',
1022
+ 'name' => 'sd_data[saswp-markup-footer]',
1023
+ )
1024
+ ),
1025
+
1026
+ );
1027
+ $field_objs->saswp_field_generator($meta_fields, $settings);
1028
+
1029
+ ?>
1030
+
1031
+
1032
+
1033
+
1034
+ <?php
1035
+
1036
+
1037
+
1038
+
1039
  $message = 'This plugin\'s data already has been imported. Do you want to import again?. click on button above button.';
1040
  $schema_message = '';
1041
  $schema_pro_message = '';
1112
  <ul>
1113
  <li>
1114
  <div class="saswp-tools-field-title">
1115
+ <div class="saswp-tooltip"><strong><?php echo esc_html__('Reset Settings','schema-and-structured-data-for-wp'); ?></strong></div><a href="#"class="button saswp-reset-data"><?php echo esc_html__('Reset','schema-and-structured-data-for-wp'); ?></a>
1116
  <p><?php echo esc_html__('This will reset your settings and schema types','schema-and-structured-data-for-wp'); ?></p>
1117
  </div>
1118
  </li>
1119
 
1120
  </ul>
1121
+
1122
+
1123
+ <?php
1124
+
1125
+
1126
+ $add_on = array();
1127
+
1128
+ if(is_plugin_active('cooked-compatibility-for-schema/cooked-compatibility-for-schema.php')){
1129
+
1130
+ $add_on[] = 'Cooked';
1131
+
1132
+ }
1133
+
1134
+ if(is_plugin_active('woocommerce-compatibility-for-schema/woocommerce-compatibility-for-schema.php')){
1135
+
1136
+ $add_on[] = 'Woocommerce';
1137
+
1138
+ }
1139
+
1140
+ if(!empty($add_on)){
1141
+
1142
+ echo '<h2>'.esc_html__('License','schema-and-structured-data-for-wp').'</h2>';
1143
+
1144
+ echo '<ul>';
1145
+
1146
+ foreach($add_on as $on){
1147
+
1148
+ $license_key = '';
1149
+ $license_status = 'inactive';
1150
+ $license_status_msg = '';
1151
+
1152
+ if(isset($sd_data[strtolower($on).'_addon_license_key'])){
1153
+ $license_key = $sd_data[strtolower($on).'_addon_license_key'];
1154
+ }
1155
+
1156
+ if(isset($sd_data[strtolower($on).'_addon_license_key_status'])){
1157
+ $license_status = $sd_data[strtolower($on).'_addon_license_key_status'];
1158
+ }
1159
+
1160
+ if(isset($sd_data[strtolower($on).'_addon_license_key_message'])){
1161
+ $license_status_msg = $sd_data[strtolower($on).'_addon_license_key_message'];
1162
+ }
1163
+
1164
+ echo '<li>';
1165
+ echo '<div class="saswp-tools-field-title">';
1166
+
1167
+ echo '<div class="" style="display:inline-block">';
1168
+ echo '<strong>'.esc_html__(''.$on.' Compatibility For Schema','schema-and-structured-data-for-wp').'</strong>';
1169
+ echo '</div>';
1170
+
1171
+ if($license_status == 'active'){
1172
+
1173
+ echo '<span class="dashicons dashicons-yes saswp-'.strtolower($on).'-dashicons" style="color: #46b450;"></span>';
1174
+
1175
+ }else{
1176
+
1177
+ echo '<span class="dashicons dashicons-no-alt saswp-'.strtolower($on).'-dashicons" style="color: #dc3232;"></span>';
1178
+
1179
+ }
1180
+
1181
+ echo '<input type="text" placeholder="Enter License Key" id="'.strtolower($on).'_addon_license_key" name="sd_data['.strtolower($on).'_addon_license_key]" value="'.esc_attr($license_key).'">';
1182
+
1183
+ echo '<input type="hidden" id="'.strtolower($on).'_addon_license_key_status" name="sd_data['.strtolower($on).'_addon_license_key_status]" value="'.esc_attr($license_status).'">';
1184
+
1185
+ if($license_status == 'active'){
1186
+
1187
+ echo '<a license-status="inactive" add-on="'.strtolower($on).'" class="button button-default saswp_license_activation">'.esc_html__('Deactivate', 'schema-and-structured-data-for-wp').'</a>';
1188
+
1189
+ }else{
1190
+
1191
+ echo '<a license-status="active" add-on="'.strtolower($on).'" class="button button-default saswp_license_activation">'.esc_html__('Activate', 'schema-and-structured-data-for-wp').'</a>';
1192
+
1193
+ }
1194
+
1195
+ if($license_status_msg !='active'){
1196
+ echo '<p style="color:red;" add-on="'.strtolower($on).'" class="saswp_license_status_msg">'.$license_status_msg.'</p>';
1197
+ }
1198
+
1199
+ echo '<p>'.esc_html__('Enter your '.$on.' addon license key to activate updates & support.','schema-and-structured-data-for-wp').'</p>';
1200
+
1201
+ echo '</div>';
1202
+ echo '</li>';
1203
+
1204
+ }
1205
+
1206
+ echo '</ul>';
1207
+
1208
+ }
1209
+
1210
+ ?>
1211
+
1212
  <?php
1213
 
1214
  }
1228
  'id' => 'saswp-review-module',
1229
  'name' => 'sd_data[saswp-review-module]',
1230
  )
1231
+ ),
1232
+ array(
1233
+ 'label' => 'Google Review',
1234
+ 'id' => 'saswp-google-review-checkbox',
1235
+ 'name' => 'saswp-google-review-checkbox',
1236
+ 'type' => 'checkbox',
1237
+ 'class' => 'checkbox saswp-checkbox',
1238
+ 'hidden' => array(
1239
+ 'id' => 'saswp-google-review',
1240
+ 'name' => 'sd_data[saswp-google-review]',
1241
+ )
1242
+ ),
1243
+ array(
1244
+ 'label' => 'Google place API Key',
1245
+ 'id' => 'saswp_google_place_api_key',
1246
+ 'name' => 'sd_data[saswp_google_place_api_key]',
1247
+ 'class' => '',
1248
+ 'type' => 'text',
1249
+ )
1250
 
1251
  );
1252
+ $field_objs->saswp_field_generator($meta_fields, $settings);
1253
 
1254
  }
1255
 
1275
 
1276
  }
1277
 
1278
+ if(!is_plugin_active('woocommerce-compatibility-for-schema/woocommerce-compatibility-for-schema.php')){
1279
+
1280
+ $woocommerce['note'] = esc_html__('This feature requires WooCommerce Addon','schema-and-structured-data-for-wp').' <a target="_blank" href="http://structured-data-for-wp.com/woocommerce-compatibility-for-schema/">Link</a>';
1281
+
 
 
 
 
 
 
1282
  }
1283
+
1284
+
1285
  $field_objs = new saswp_fields_generator();
1286
  $meta_fields = array(
1287
  $woocommerce,
1353
  'name' => 'sd_data[saswp-woocommerce-booking]',
1354
  )
1355
  );
1356
+
1357
+ $cooked = array(
1358
+ 'label' => 'Cooked',
1359
+ 'id' => 'saswp-cooked-checkbox',
1360
+ 'name' => 'saswp-cooked-checkbox',
1361
+ 'type' => 'checkbox',
1362
+ 'class' => 'checkbox saswp-checkbox',
1363
+ 'hidden' => array(
1364
+ 'id' => 'saswp-cooked',
1365
+ 'name' => 'sd_data[saswp-cooked]',
1366
+ )
1367
+ );
1368
+
1369
  $woocommerce_mem = array(
1370
  'label' => 'Woocommerce Membership',
1371
  'id' => 'saswp-woocommerce-membership-checkbox',
1439
 
1440
  }
1441
  if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-bookings/woocommerce-bookings.php')){
1442
+
1443
+ $woocommerce_bok['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
1444
+
1445
+ }
1446
+
1447
+ if(!is_plugin_active('woocommerce/woocommerce.php') || !is_plugin_active('woocommerce-memberships/woocommerce-memberships.php')){
1448
+
1449
+ $woocommerce_mem['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
1450
+
1451
  }
1452
 
1453
 
1454
+ if(!is_plugin_active('woocommerce-compatibility-for-schema/woocommerce-compatibility-for-schema.php')){
1455
+
1456
+ $woocommerce_bok['note'] = esc_html__('This feature requires Woocommerce Booking Addon','schema-and-structured-data-for-wp').' <a target="_blank" href="http://structured-data-for-wp.com/woocommerce-compatibility-for-schema/">Link</a>';
1457
+
1458
+ }
1459
+
1460
+ if(!is_plugin_active('woocommerce-compatibility-for-schema/woocommerce-compatibility-for-schema.php')){
1461
+
1462
+ $woocommerce_mem['note'] = esc_html__('This feature requires Woocommerce Memberships Addon','schema-and-structured-data-for-wp').' <a target="_blank" href="http://structured-data-for-wp.com/woocommerce-compatibility-for-schema/">Link</a>';
1463
+
1464
+ }
1465
 
1466
 
1467
+ if(!is_plugin_active('cooked-compatibility-for-schema/cooked-compatibility-for-schema.php')){
 
 
 
1468
 
1469
+ $cooked['note'] = esc_html__('This feature requires Cooked Addon','schema-and-structured-data-for-wp').' <a target="_blank" href="http://structured-data-for-wp.com/cooked-compatibility-for-schema/">Link</a>';
 
 
 
 
 
 
 
1470
 
1471
+ }
1472
+
1473
+ if(is_plugin_active('cooked/cooked.php') || is_plugin_active('cooked-pro/cooked-pro.php')){
1474
+ }else{
1475
+ $cooked['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
1476
+ }
1477
+
 
 
 
 
 
 
1478
  if(get_template() != 'Extra'){
1479
 
1480
  $extratheme['note'] = esc_html__('Theme is not activated','schema-and-structured-data-for-wp');
1481
 
1482
 
1483
  }
1484
+
 
1485
  if(!is_plugin_active('dw-question-answer/dw-question-answer.php')){
1486
 
1487
  $dwquestiton['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
1495
  // }
1496
 
1497
  if(!is_plugin_active('the-events-calendar/the-events-calendar.php')){
1498
+
 
1499
  $the_events_calendar['note'] = esc_html__('Requires selected plugin','schema-and-structured-data-for-wp');
1500
 
1501
  }
1502
+
1503
 
1504
  $field_objs = new saswp_fields_generator();
1505
 
1506
  $meta_fields = array(
1507
  $kk_star,
1508
  $woocommerce,
1509
+ $woocommerce_bok,
1510
+ $woocommerce_mem,
1511
+ $cooked,
1512
  $the_events_calendar,
1513
  $tagyeem,
1514
  $extratheme,
1619
 
1620
  ?>
1621
  <div class="saswp_support_div">
1622
+ <strong><?php echo esc_html__('If you have any query, please write the query in below box or email us at', 'schema-and-structured-data-for-wp') ?> <a href="mailto:team@ampforwp.com">team@ampforwp.com</a>. <?php echo esc_html__('We will reply to your email address shortly', 'schema-and-structured-data-for-wp') ?></strong>
1623
 
1624
  <ul>
1625
  <li>
1634
  </div>
1635
  <?php
1636
 
1637
+ echo '<h1>'.esc_html__( 'Frequently Asked Questions.', 'schema-and-structured-data-for-wp' ).'</h1>
1638
+ <br>
1639
+ <h3>1Q) '.esc_html__( 'Is there a Documentation Available?', 'schema-and-structured-data-for-wp' ).'</h3>
1640
+ <p class="saswp_qanda_p">A) '.esc_html__( 'The Documentation is always updated and available at ', 'schema-and-structured-data-for-wp' ).'<a href="http://structured-data-for-wp.com/docs/" target="_blank"><strong>http://structured-data-for-wp.com/docs/</strong></a></p>
1641
+
1642
+ <h3>2Q) '.esc_html__( 'How can I setup the Schema and Structured data for individual pages and posts?', 'schema-and-structured-data-for-wp' ).'</h3>
1643
  <p class="saswp_qanda_p">A) '.esc_html__( 'Just with one click on the Structured data option, you will find an add new options window in the structured data option panel. Secondly, you need to write the name of the title where, if you would like to set the individual Page/Post then you can set the Page/Post type equal to the Page/Post(Name).', 'schema-and-structured-data-for-wp' ).'</p>
1644
 
1645
+ <h3>3Q) '.esc_html__( 'How can I check the code whether the structured data is working or not?', 'schema-and-structured-data-for-wp' ).'</h3>
1646
+ <p class="saswp_qanda_p">A) To check the code, the first step we need to take is to copy the code of a page or post then visit the <a href="https://search.google.com/structured-data/testing-tool" target="_blank">Structured data testing tool</a> by clicking on code snippet. Once we paste the snippet we can run the test.</p>
1647
 
1648
+ <h3> 4Q) '.esc_html__( 'How can I check whether the pages or posts are valid or not?', 'schema-and-structured-data-for-wp' ).'</h3>
1649
+ <p class="saswp_qanda_p"> A) '.esc_html__( 'To check the page and post validation, please visit the', 'schema-and-structured-data-for-wp' ).' <a href="https://search.google.com/structured-data/testing-tool" target="_blank">'.esc_html__( 'Structured data testing tool', 'schema-and-structured-data-for-wp' ).'</a> '.esc_html__( 'and paste the link of your website.', 'schema-and-structured-data-for-wp' ).' '.esc_html__( 'Once we click on run test we can see the result whether the page or post is a valid one or not.', 'schema-and-structured-data-for-wp' ).'</p>
1650
 
1651
+ <h3>5Q) '.esc_html__( 'Where should users contact if they faced any issues?', 'schema-and-structured-data-for-wp' ).'</h3>
1652
+ <p class="saswp_qanda_p">A) '.esc_html__( 'We always welcome all our users to share their issues and get them fixed just with one click to the link', 'schema-and-structured-data-for-wp' ).' team@ampforwp.com or <a href="https://ampforwp.com/support/" target="_blank">'.esc_html__( 'Support link', 'schema-and-structured-data-for-wp' ).'</a></p><br>';
1653
  }
1654
 
1655
  /**
1671
  'ajax_url' => admin_url( 'admin-ajax.php' ),
1672
  'saswp_security_nonce' => wp_create_nonce('saswp_ajax_check_nonce'),
1673
  'new_url_selector' => esc_url(admin_url()).'post-new.php?post_type=saswp',
1674
+ 'new_url_href' => htmlspecialchars_decode(wp_nonce_url(admin_url('index.php?page=saswp_add_new_data_type&'), '_wpnonce')),
1675
+
1676
+ 'collection_post_add_url' => esc_url(admin_url()).'post-new.php?post_type=saswp-google-review',
1677
+ 'collection_post_add_new_url' => htmlspecialchars_decode(wp_nonce_url(admin_url('admin.php?page=collection'), '_wpnonce'))
1678
  );
1679
 
1680
  wp_localize_script( 'saswp-main-js', 'saswp_localize_data', $data );
admin_section/structure_admin.php CHANGED
@@ -1170,13 +1170,15 @@ function saswp_send_query_message(){
1170
  $message = sanitize_textarea_field($_POST['message']);
1171
  $user = wp_get_current_user();
1172
 
 
 
1173
  if($user){
1174
 
1175
  $user_data = $user->data;
1176
  $user_email = $user_data->user_email;
1177
  //php mailer variables
1178
  $sendto = 'team@magazine3.com';
1179
- $subject = "Customer Query";
1180
  $headers = 'From: '. esc_attr($user_email) . "\r\n" .
1181
  'Reply-To: ' . esc_attr($user_email) . "\r\n";
1182
  // Load WP components, no themes.
@@ -1295,3 +1297,142 @@ function saswp_feeback_remindme(){
1295
  }
1296
 
1297
  add_action('wp_ajax_saswp_feeback_remindme', 'saswp_feeback_remindme');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1170
  $message = sanitize_textarea_field($_POST['message']);
1171
  $user = wp_get_current_user();
1172
 
1173
+ $message = $message.'\n\n\n'.'Support query from a Schema User';
1174
+
1175
  if($user){
1176
 
1177
  $user_data = $user->data;
1178
  $user_email = $user_data->user_email;
1179
  //php mailer variables
1180
  $sendto = 'team@magazine3.com';
1181
+ $subject = "Schema Customer Query";
1182
  $headers = 'From: '. esc_attr($user_email) . "\r\n" .
1183
  'Reply-To: ' . esc_attr($user_email) . "\r\n";
1184
  // Load WP components, no themes.
1297
  }
1298
 
1299
  add_action('wp_ajax_saswp_feeback_remindme', 'saswp_feeback_remindme');
1300
+
1301
+
1302
+ /**
1303
+ * Licensing code starts here
1304
+ */
1305
+
1306
+
1307
+ function saswp_license_status($add_on, $license_status, $license_key){
1308
+
1309
+ $item_name = array(
1310
+ 'cooked' => 'Cooked compatibility for Schema',
1311
+ 'woocommerce' => 'Woocommerce compatibility for Schema'
1312
+ );
1313
+
1314
+ $edd_action = '';
1315
+ if($license_status =='active'){
1316
+ $edd_action = 'activate_license';
1317
+ }
1318
+
1319
+ if($license_status =='inactive'){
1320
+ $edd_action = 'deactivate_license';
1321
+ }
1322
+ // data to send in our API request
1323
+ $api_params = array(
1324
+ 'edd_action' => $edd_action,
1325
+ 'license' => $license_key,
1326
+ 'item_name' => $item_name[strtolower($add_on)],
1327
+ 'author' => 'Magazine3',
1328
+ 'url' => home_url(),
1329
+ 'beta' => false,
1330
+ );
1331
+ $message = '';
1332
+ $current_status = '';
1333
+ $response = wp_remote_post( SASWP_EDD_STORE_URL, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
1334
+
1335
+ // make sure the response came back okay
1336
+ if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
1337
+ $message = ( is_wp_error( $response ) && ! empty( $response->get_error_message() ) ) ? $response->get_error_message() : __( 'An error occurred, please try again.' );
1338
+ } else {
1339
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
1340
+
1341
+ if ( false === $license_data->success ) {
1342
+
1343
+ $current_status = $license_data->error;
1344
+
1345
+ switch( $license_data->error ) {
1346
+ case 'expired' :
1347
+ $message = sprintf(
1348
+ __( 'Your license key expired on %s.' ),
1349
+ date_i18n( get_option( 'date_format' ), strtotime( $license_data->expires, current_time( 'timestamp' ) ) )
1350
+ );
1351
+ break;
1352
+ case 'revoked' :
1353
+ $message = __( 'Your license key has been disabled.' );
1354
+ break;
1355
+ case 'missing' :
1356
+ $message = __( 'Invalid license.' );
1357
+ break;
1358
+ case 'invalid' :
1359
+ case 'site_inactive' :
1360
+ $message = __( 'Your license is not active for this URL.' );
1361
+ break;
1362
+ case 'item_name_mismatch' :
1363
+ $message = sprintf( __( 'This appears to be an invalid license key for %s.' ), EDD_SAMPLE_ITEM_NAME );
1364
+ break;
1365
+ case 'no_activations_left':
1366
+ $message = __( 'Your license key has reached its activation limit.' );
1367
+ break;
1368
+ default :
1369
+ $message = __( 'An error occurred, please try again.' );
1370
+ break;
1371
+ }
1372
+ }
1373
+ }
1374
+ if($message){
1375
+
1376
+ $license[strtolower($add_on).'_addon_license_key_status'] = $current_status;
1377
+ $license[strtolower($add_on).'_addon_license_key'] = $license_key;
1378
+ $license[strtolower($add_on).'_addon_license_key_message']= $message;
1379
+
1380
+ }else{
1381
+
1382
+ if($license_status == 'active'){
1383
+
1384
+ $license[strtolower($add_on).'_addon_license_key_status'] = 'active';
1385
+ $license[strtolower($add_on).'_addon_license_key'] = $license_key;
1386
+ $license[strtolower($add_on).'_addon_license_key_message'] = 'active';
1387
+ $current_status = 'active';
1388
+ $message = 'Activated';
1389
+ }
1390
+
1391
+ if($license_status == 'inactive'){
1392
+
1393
+ $license[strtolower($add_on).'_addon_license_key_status'] = 'deactivated';
1394
+ $license[strtolower($add_on).'_addon_license_key'] = $license_key;
1395
+ $license[strtolower($add_on).'_addon_license_key_message'] = 'Deactivated';
1396
+ $current_status = 'deactivated';
1397
+ $message = 'Deactivated';
1398
+ }
1399
+
1400
+ }
1401
+
1402
+ $get_options = get_option('sd_data');
1403
+ $merge_options = array_merge($get_options, $license);
1404
+ update_option('sd_data', $merge_options);
1405
+
1406
+ return array('status'=> $current_status, 'message'=> $message);
1407
+
1408
+ }
1409
+
1410
+ function saswp_license_status_check(){
1411
+
1412
+
1413
+ if ( ! isset( $_POST['saswp_security_nonce'] ) ){
1414
+ return;
1415
+ }
1416
+ if ( !wp_verify_nonce( $_POST['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
1417
+ return;
1418
+ }
1419
+
1420
+ $add_on = sanitize_text_field($_POST['add_on']);
1421
+ $license_status = sanitize_text_field($_POST['license_status']);
1422
+ $license_key = sanitize_text_field($_POST['license_key']);
1423
+
1424
+ if($add_on && $license_status && $license_key){
1425
+
1426
+ $result = saswp_license_status($add_on, $license_status, $license_key);
1427
+
1428
+ echo json_encode($result);
1429
+
1430
+ }
1431
+
1432
+ wp_die();
1433
+ }
1434
+
1435
+ add_action('wp_ajax_saswp_license_status_check', 'saswp_license_status_check');
1436
+ /**
1437
+ * Licensing code ends here
1438
+ */
google_review/google_review.php ADDED
@@ -0,0 +1,273 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+
4
+ class saswp_google_review{
5
+
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);
12
+
13
+ add_shortcode('saswp_google_review', array($this,'saswp_google_review_shortcode'));
14
+
15
+ if(is_admin()){
16
+
17
+ add_filter('get_edit_post_link', array($this, 'saswp_get_edit_post_link'), 99, 3);
18
+
19
+ }
20
+
21
+ }
22
+
23
+ public function saswp_get_edit_post_link($link, $post_id, $context){
24
+
25
+ $scr = get_current_screen();
26
+
27
+ if ($scr->id == 'edit-saswp-google-review' && $context == 'display') {
28
+
29
+ return wp_nonce_url(admin_url('admin.php?post_id='.$post_id.'&page=collection'), '_wpnonce');
30
+
31
+ } else {
32
+
33
+ return $link;
34
+
35
+ }
36
+ }
37
+
38
+ public function saswp_add_google_review_menu_links() {
39
+
40
+ $collection_post_type = array(
41
+ 'labels' => array(
42
+ 'name' => esc_html__( 'Google Review', 'schema-and-structured-data-for-wp' ),
43
+ 'add_new' => esc_html__( 'Add Place', 'schema-and-structured-data-for-wp' ),
44
+ 'add_new_item' => esc_html__( 'Edit Collection', 'schema-and-structured-data-for-wp' ),
45
+ 'edit_item' => esc_html__( 'Edit AD','schema-and-structured-data-for-wp'),
46
+ ),
47
+ 'public' => true,
48
+ 'has_archive' => false,
49
+ 'exclude_from_search' => true,
50
+ 'publicly_queryable' => false,
51
+ 'show_in_menu' => 'edit.php?post_type=saswp',
52
+ 'show_ui' => true,
53
+ 'show_in_nav_menus' => false,
54
+ 'show_admin_column' => true,
55
+ 'rewrite' => false,
56
+ );
57
+ register_post_type( 'saswp-google-review', $collection_post_type );
58
+
59
+ }
60
+
61
+ public function saswp_fetch_all_google_review_post(){
62
+
63
+ $all_post = get_posts(
64
+ array(
65
+ 'post_type' => 'saswp-google-review',
66
+ 'posts_per_page' => -1,
67
+ 'post_status' => 'publish',
68
+ )
69
+ );
70
+
71
+ return $all_post;
72
+ }
73
+
74
+
75
+ public function saswp_google_review_shortcode($attr){
76
+
77
+ $post_id = $attr['id'];
78
+
79
+ if($post_id){
80
+
81
+ $schema_markup = $this->saswp_get_google_review_schema_markup($post_id);
82
+ $output = $this->saswp_google_review_front_output($post_id);
83
+
84
+ if($schema_markup){
85
+ $output = $output.$schema_markup;
86
+ }
87
+ return $output;
88
+
89
+ }
90
+
91
+ }
92
+
93
+ public function saswp_get_google_review_schema_markup($post_id){
94
+
95
+ global $wpdb;
96
+ global $sd_data;
97
+ $html = '';
98
+
99
+ $place_id = get_post_meta($post_id, $key='saswp_google_place_id', true );
100
+
101
+ if($place_id){
102
+
103
+ $place = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "saswp_google_place WHERE place_id = %s", $place_id));
104
+
105
+ }
106
+
107
+ $author_id = get_the_author_meta('ID');
108
+
109
+ $author_details = get_avatar_data($author_id);
110
+ $date = get_the_date("Y-m-d\TH:i:s\Z");
111
+ $modified_date = get_the_modified_date("Y-m-d\TH:i:s\Z");
112
+ $aurthor_name = get_the_author();
113
+
114
+ if(!$aurthor_name){
115
+
116
+ $author_id = get_post_field ('post_author', get_the_ID());
117
+ $aurthor_name = get_the_author_meta( 'display_name' , $author_id );
118
+
119
+ }
120
+
121
+
122
+ if($place->rating && isset($sd_data['saswp-google-review']) && $sd_data['saswp-google-review'] == 1){
123
+
124
+ $total_score = esc_attr(number_format((float)$place->rating, 2, '.', ''));
125
+
126
+ $input1 = array(
127
+ '@context' => 'http://schema.org',
128
+ '@type' => 'Review',
129
+ 'dateCreated' => esc_html($date),
130
+ 'datePublished' => esc_html($date),
131
+ 'dateModified' => esc_html($modified_date),
132
+ 'headline' => get_the_title(),
133
+ 'name' => get_the_title(),
134
+ 'url' => get_permalink(),
135
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
136
+ 'copyrightYear' => get_the_time( 'Y' ),
137
+ 'author' => array(
138
+ '@type' => 'Person',
139
+ 'name' => esc_attr($aurthor_name),
140
+ 'image' => array(
141
+ '@type' => 'ImageObject',
142
+ 'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
143
+ 'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
144
+ 'width' => saswp_remove_warnings($author_details, 'width', 'saswp_string')
145
+ ),
146
+ ),
147
+
148
+ );
149
+
150
+ $input1['itemReviewed'] = array(
151
+ '@type' => 'Thing',
152
+ 'name' => get_the_title(),
153
+ );
154
+
155
+ $input1['reviewRating'] = array(
156
+ '@type' => 'Rating',
157
+ 'worstRating' => 1,
158
+ 'bestRating' => 5,
159
+ 'ratingValue' => esc_attr($total_score),
160
+ );
161
+
162
+ if(!empty($input1)){
163
+
164
+ $html .= '<!-- Schema & Structured Data For Google Review v'.esc_attr(SASWP_VERSION).' - -->';
165
+ $html .= "\n";
166
+ $html .= '<script type="application/ld+json">';
167
+ $html .= "\n";
168
+ $html .= json_encode($input1);
169
+ $html .= "\n";
170
+ $html .= '</script>';
171
+ $html .= "\n\n";
172
+
173
+ }
174
+
175
+ }
176
+
177
+ return $html;
178
+ }
179
+
180
+ public function saswp_google_review_front_output($post_id){
181
+
182
+ global $wpdb;
183
+ $reviews = null;
184
+ $output = '';
185
+
186
+ $place_id = get_post_meta($post_id, $key='saswp_google_place_id', true );
187
+
188
+ if($place_id){
189
+
190
+ $place = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "saswp_google_place WHERE place_id = %s", $place_id));
191
+
192
+ if($place->id){
193
+
194
+ $reviews = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "saswp_google_review WHERE google_place_id = %d ORDER BY time DESC", $place->id));
195
+
196
+ }
197
+
198
+ }
199
+
200
+ foreach ($reviews as $review){
201
+
202
+
203
+ $review_rating = $review->rating;
204
+
205
+ $starating = '';
206
+
207
+ $starating .= '<div class="saswp-rvw-str">';
208
+ for($j=0; $j<5; $j++){
209
+
210
+ if($review_rating >$j){
211
+
212
+ $explod = explode('.', $review_rating);
213
+
214
+ if(isset($explod[1])){
215
+
216
+ if($j <$explod[0]){
217
+
218
+ $starating.='<span class="str-ic"></span>';
219
+
220
+ }else{
221
+
222
+ $starating.='<span class="half-str"></span>';
223
+
224
+ }
225
+ }else{
226
+
227
+ $starating.='<span class="str-ic"></span>';
228
+
229
+ }
230
+
231
+ } else{
232
+ $starating.='<span class="df-clr"></span>';
233
+ }
234
+ }
235
+ $starating .= '</div>';
236
+
237
+ $output.= '<div class="saswp-g-review-panel">
238
+ <div class="saswp-glg-review-body">
239
+ <div class="saswp-rv-img">
240
+ <img src="'.esc_url($review->profile_photo_url).'" alt="'.$review->author_name.'">
241
+ </div>
242
+ <div class="saswp-rv-cnt">
243
+ <div class="saswp-str-rtng">
244
+ <div class="saswp-str">
245
+ <span class="saswp-athr">'.$review->author_name.'</span>
246
+ '.$starating.'
247
+ </div>
248
+ <span class="saswp-g-plus">
249
+ <a href="#"><img src="'.SASWP_PLUGIN_URL.'/admin_section/images/google-img.png'.'"></a>
250
+ </span>
251
+ </div>
252
+ <span class="saswp-pt-dt">'.gmdate("H:i d M y", $review->time).'</span>
253
+ <p>'.substr($review->text,0,300).'</p>
254
+ </div>
255
+ </div>
256
+ </div>';
257
+
258
+ }
259
+
260
+ return $output;
261
+
262
+ }
263
+
264
+
265
+ }
266
+
267
+ if (class_exists('saswp_google_review')) {
268
+
269
+ $object = new saswp_google_review;
270
+ $object->saswp_google_review_hooks();
271
+
272
+ };
273
+
google_review/google_review_page.php ADDED
@@ -0,0 +1,376 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) exit;
3
+
4
+ if(!function_exists('wp_get_current_user')) {
5
+ include(ABSPATH . "wp-includes/pluggable.php");
6
+ }
7
+
8
+ if(isset($_POST['sasw_post_ID'])){
9
+
10
+ $post_id = sanitize_text_field($_POST['sasw_post_ID']);
11
+ $post_title = sanitize_text_field($_POST['saswp_g_review_title']);
12
+
13
+ $post = array(
14
+ 'ID' => $post_id,
15
+ 'post_title' => $post_title,
16
+ 'post_status' => 'publish',
17
+ 'post_name' => $post_title,
18
+ 'post_type' => 'saswp-google-review',
19
+ );
20
+
21
+ wp_update_post($post);
22
+
23
+ $post_meta = array();
24
+
25
+ $post_meta['saswp_google_place_id'] = sanitize_text_field($_POST['saswp_google_place_id']);
26
+ $post_meta['saswp_language_list'] = sanitize_text_field($_POST['saswp_language_list']);
27
+ $post_meta['saswp_googel_api'] = sanitize_text_field($_POST['saswp_googel_api']);
28
+
29
+ if(!empty($post_meta)){
30
+
31
+ foreach($post_meta as $meta_key => $meta_val){
32
+
33
+ update_post_meta($post_id, $meta_key, $meta_val);
34
+
35
+ }
36
+
37
+ }
38
+
39
+ if($_POST['saswp-page'] == 'collection'){
40
+
41
+ $current_url = htmlspecialchars_decode(wp_nonce_url(admin_url('admin.php?post_id='.$post_id.'&page=collection'), '_wpnonce'));
42
+ wp_redirect( $current_url );
43
+ exit;
44
+ }
45
+
46
+ }
47
+
48
+ class saswp_google_review_page{
49
+
50
+ public function __construct() {
51
+
52
+ add_action( 'admin_menu', array($this, 'saswp_add_google_review_links'),20);
53
+ add_action( 'wp_ajax_saswp_connect_google_place', array($this,'saswp_connect_google_place'));
54
+
55
+ }
56
+
57
+ public function saswp_connect_google_place(){
58
+
59
+ if ( ! isset( $_POST['saswp_security_nonce'] ) ){
60
+ return;
61
+ }
62
+ if ( !wp_verify_nonce( $_POST['saswp_security_nonce'], 'saswp_ajax_check_nonce' ) ){
63
+ return;
64
+ }
65
+
66
+ $place_id = '';
67
+ $language = '';
68
+ $google_api = '';
69
+
70
+ if(isset($_POST['place_id'])){
71
+ $place_id = sanitize_text_field($_POST['place_id']);
72
+ }
73
+ if(isset($_POST['language'])){
74
+ $language = sanitize_text_field($_POST['language']);
75
+ }
76
+ if(isset($_POST['google_api'])){
77
+ $google_api = sanitize_text_field($_POST['google_api']);
78
+ }
79
+
80
+ if($place_id){
81
+
82
+ $result = saswp_get_google_review_data($place_id, $language);
83
+
84
+ if($result){
85
+
86
+ echo json_encode(array('status' => 't'));
87
+
88
+ }else{
89
+
90
+ echo json_encode(array('status' => 'f'));
91
+
92
+ }
93
+
94
+ }
95
+
96
+ wp_die();
97
+
98
+ }
99
+
100
+ public function saswp_add_google_review_links() {
101
+
102
+ add_submenu_page( 'edit.php?post_type=saswp',
103
+ esc_html__( 'Structured Data', 'schema-and-structured-data-for-wp' ),
104
+ esc_html__( '', 'schema-and-structured-data-for-wp' ),
105
+ 'manage_options',
106
+ 'collection',
107
+ array($this, 'saswp_admin_google_review_interface_render'));
108
+
109
+ }
110
+
111
+ public function saswp_admin_google_review_interface_render(){
112
+
113
+ global $wpdb;
114
+
115
+ $language = array(
116
+ 'af' => 'Afrikanns',
117
+ 'sq' => 'Albanian',
118
+ 'ar' => 'Arabic',
119
+ 'hy' => 'Armenian',
120
+ 'eu' => 'Basque',
121
+ 'bn' => 'Bengali',
122
+ 'bg' => 'Bulgarian',
123
+ 'ca' => 'Catalan',
124
+ 'km' => 'Cambodian',
125
+ 'zh' => 'Chinese (Mandarin)',
126
+ 'hr' => 'Croation',
127
+ 'cs' => 'Czech',
128
+ 'da' => 'Danish',
129
+ 'nl' => 'Dutch',
130
+ 'en' => 'English',
131
+ 'et' => 'Estonian',
132
+ 'fj' => 'Fiji',
133
+ 'fi' => 'Finnish',
134
+ 'fr' => 'French',
135
+ 'ka' => 'Georgian',
136
+ 'de' => 'German',
137
+ 'el' => 'Greek',
138
+ 'gu' => 'Gujarati',
139
+ 'he' => 'Hebrew',
140
+ 'hi' => 'Hindi',
141
+ 'hu' => 'Hungarian',
142
+ 'is' => 'Icelandic',
143
+ 'id' => 'Indonesian',
144
+ 'ga' => 'Irish',
145
+ 'it' => 'Italian',
146
+ 'ja' => 'Japanese',
147
+ 'jw' => 'Javanese',
148
+ 'ko' => 'Korean',
149
+ 'la' => 'Latin',
150
+ 'lv' => 'Latvian',
151
+ 'lt' => 'Lithuanian',
152
+ 'mk' => 'Macedonian',
153
+ 'ms' => 'Malay',
154
+ 'ml' => 'Malayalam',
155
+ 'mt' => 'Maltese',
156
+ 'mi' => 'Maori',
157
+ 'mr' => 'Marathi',
158
+ 'mn' => 'Mongolian',
159
+ 'ne' => 'Nepali',
160
+ 'no' => 'Norwegian',
161
+ 'fa' => 'Persian',
162
+ 'pl' => 'Polish',
163
+ 'pt' => 'Portuguese',
164
+ 'pa' => 'Punjabi',
165
+ 'qu' => 'Quechua',
166
+ 'ro' => 'Romanian',
167
+ 'ru' => 'Russian',
168
+ 'sm' => 'Samoan',
169
+ 'sr' => 'Serbian',
170
+ 'sk' => 'Slovak',
171
+ 'sl' => 'Slovenian',
172
+ 'es' => 'Spanish',
173
+ 'sw' => 'Swahili',
174
+ 'sv' => 'Swedish ',
175
+ 'ta' => 'Tamil',
176
+ 'tt' => 'Tatar',
177
+ 'te' => 'Telugu',
178
+ 'th' => 'Thai',
179
+ 'bo' => 'Tibetan',
180
+ 'to' => 'Tonga',
181
+ 'tr' => 'Turkish',
182
+ 'uk' => 'Ukranian',
183
+ 'ur' => 'Urdu',
184
+ 'uz' => 'Uzbek',
185
+ 'vi' => 'Vietnamese',
186
+ 'cy' => 'Welsh',
187
+ 'xh' => 'Xhosa'
188
+ );
189
+
190
+ $post_meta = array();
191
+ $post_id = '';
192
+ $reviews = null;
193
+
194
+ if(isset($_GET['post_id'])){
195
+
196
+ $post_id = $_GET['post_id'];
197
+
198
+ $post_meta = get_post_meta($post_id, $key='', true );
199
+
200
+
201
+ } else{
202
+
203
+ $post = get_default_post_to_edit( 'saswp-google-review', true );
204
+ $post_id = $post->ID;
205
+ }
206
+
207
+ if(isset($post_meta['saswp_google_place_id'])){
208
+
209
+ $place_id = trim($post_meta['saswp_google_place_id'][0]);
210
+ $place = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "saswp_google_place WHERE place_id = %s", $place_id));
211
+
212
+ if($place->id){
213
+
214
+ $reviews = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "saswp_google_review WHERE google_place_id = %d ORDER BY time DESC", $place->id));
215
+
216
+ }
217
+
218
+ }
219
+
220
+ ?>
221
+ <div class="saswp-heading">
222
+ <h1 class="wp-heading-inline">Google Review </h1><span class="saswp-need-help"><a target="_blank" href="http://structured-data-for-wp.com/docs/">Need Help?</a></span>
223
+ </div>
224
+
225
+ <div class="saswp-g-review-container">
226
+ <form method="post" action="post.php">
227
+ <div class="saswp-g-review-header">
228
+
229
+ <input type="hidden" name="post_type" value="saswp-google-review">
230
+ <input type="hidden" name="saswp-page" value="collection">
231
+ <input type="hidden" id="sasw_post_ID" name="sasw_post_ID" value="<?php echo $post_id; ?>">
232
+ <input type="text" value="<?php if(get_the_title($post_id) == 'Auto Draft'){ echo 'Untitled'; }else{ echo get_the_title($post_id); } ?>" id="saswp_g_review_title" name="saswp_g_review_title" style="width: 30%;">
233
+
234
+ <button type="submit" class="btn btn-success button-primary" > <?php echo esc_html__('Save','schema-and-structured-data-for-wp'); ?> </button>
235
+ <div>Use ShortCode [saswp_google_review id="<?php echo $post_id; ?>"]</div>
236
+
237
+ </div>
238
+
239
+ <div class="saswp-g-review-body">
240
+
241
+ <div class="saswp-review-list">
242
+
243
+
244
+
245
+ <?php
246
+
247
+ if($reviews){
248
+
249
+ foreach ($reviews as $review){
250
+
251
+ $review_rating = $review->rating;
252
+
253
+ $starating = '';
254
+
255
+ $starating .= '<div class="saswp-rvw-str">';
256
+ for($j=0; $j<5; $j++){
257
+
258
+ if($review_rating >$j){
259
+
260
+ $explod = explode('.', $review_rating);
261
+
262
+ if(isset($explod[1])){
263
+
264
+ if($j <$explod[0]){
265
+
266
+ $starating.='<span class="str-ic"></span>';
267
+
268
+ }else{
269
+
270
+ $starating.='<span class="half-str"></span>';
271
+
272
+ }
273
+ }else{
274
+
275
+ $starating.='<span class="str-ic"></span>';
276
+
277
+ }
278
+
279
+ } else{
280
+ $starating.='<span class="df-clr"></span>';
281
+ }
282
+ }
283
+ $starating .= '</div>';
284
+
285
+
286
+ echo '<div class="saswp-g-review-panel">
287
+ <div class="saswp-glg-review-body">
288
+ <div class="saswp-rv-img">
289
+ <img src="'.esc_url($review->profile_photo_url).'" alt="'.$review->author_name.'">
290
+ </div>
291
+ <div class="saswp-rv-cnt">
292
+ <div class="saswp-str-rtng">
293
+ <div class="saswp-str">
294
+ <span class="saswp-athr">'.$review->author_name.'</span>
295
+ '.$starating.'
296
+ </div>
297
+ <span class="saswp-g-plus">
298
+ <a href="#"><img src="'.SASWP_PLUGIN_URL.'/admin_section/images/google-img.png'.'"></a>
299
+ </span>
300
+ </div>
301
+ <span class="saswp-pt-dt">'.gmdate("H:i d M y", $review->time).'</span>
302
+ <p>'.substr($review->text,0,300).'</p>
303
+ </div>
304
+ </div>
305
+ </div>';
306
+
307
+ }
308
+
309
+ }
310
+
311
+ ?>
312
+
313
+ </div>
314
+
315
+ <div class="saswp-channel-list">
316
+
317
+
318
+ <!-- <a class="saswp-accordion">Connect Google</a> -->
319
+
320
+ <div class="saswp-panel">
321
+ <h3>Google Review Settings</h3>
322
+ <div class="saswp-input-fields">
323
+ <label>Google ID:</label><input value="<?php if(isset($post_meta['saswp_google_place_id'])){ echo $post_meta['saswp_google_place_id'][0];} ?>" type="text" id="saswp_google_place_id" name="saswp_google_place_id" placeholder="<?php echo esc_html__('Place Id', 'schema-and-structured-data-for-wp' ); ?>">
324
+ </div>
325
+
326
+ <div class="saswp-input-fields">
327
+ <label>Languages:</label>
328
+ <select name="saswp_language_list" id="saswp_language_list">
329
+ <?php
330
+
331
+ foreach ($language as $key => $value) {
332
+
333
+ $sel = '';
334
+
335
+ if(saswp_remove_warnings($post_meta, 'saswp_language_list', 'saswp_array')==$key){
336
+
337
+ $sel = 'selected';
338
+
339
+ }
340
+
341
+ echo "<option value='".esc_attr($key)."' ".esc_attr($sel).">".esc_html__($value, 'schema-and-structured-data-for-wp' )."</option>";
342
+
343
+ }
344
+ ?>
345
+ </select>
346
+
347
+ </div>
348
+
349
+ <div class="saswp-input-fields">
350
+ <label>Goolge API</label>
351
+ <input value="<?php if(isset($post_meta['saswp_googel_api'])){ echo $post_meta['saswp_googel_api'][0];} ?>" type="text" id="saswp_googel_api" name="saswp_googel_api" placeholder="<?php echo esc_html__('Google API', 'schema-and-structured-data-for-wp' ); ?>">
352
+ </div>
353
+
354
+ <div class="saswp-input-fields">
355
+ <a class="saswp_coonect_google_place btn btn-success button-primary" >Connect Google</a>
356
+ </div>
357
+
358
+ </div>
359
+
360
+ </div>
361
+
362
+
363
+ </div>
364
+
365
+ </form>
366
+ </div>
367
+
368
+ <?php
369
+ }
370
+
371
+ }
372
+
373
+ if (class_exists('saswp_google_review_page')) {
374
+ new saswp_google_review_page;
375
+ };
376
+
google_review/google_review_setup.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) exit;
4
+
5
+ add_action('admin_init', 'saswp_create_database_for_existing_users');
6
+
7
+ function saswp_create_database_for_existing_users(){
8
+
9
+ $status = get_option('saswp-database-on-first-load');
10
+
11
+ if($status != 'enable'){
12
+
13
+ saswp_google_review_database_install();
14
+ update_option('saswp-database-on-first-load', 'enable');
15
+
16
+ }
17
+
18
+ }
19
+
20
+ add_action('the_post', 'saswp_create_database_for_existing_users');
21
+
22
+
23
+ function saswp_google_review_database_install() {
24
+
25
+ global $wpdb;
26
+
27
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
28
+
29
+ $charset_collate = $engine = '';
30
+
31
+
32
+ if(!empty($wpdb->charset)) {
33
+ $charset_collate .= " DEFAULT CHARACTER SET {$wpdb->charset}";
34
+ }
35
+ if($wpdb->has_cap('collation') AND !empty($wpdb->collate)) {
36
+ $charset_collate .= " COLLATE {$wpdb->collate}";
37
+ }
38
+
39
+ $found_engine = $wpdb->get_var("SELECT ENGINE FROM `information_schema`.`TABLES` WHERE `TABLE_SCHEMA` = '".DB_NAME."' AND `TABLE_NAME` = '{$wpdb->prefix}posts';");
40
+
41
+ if(strtolower($found_engine) == 'innodb') {
42
+ $engine = ' ENGINE=InnoDB';
43
+ }
44
+
45
+ $found_tables = $wpdb->get_col("SHOW TABLES LIKE '{$wpdb->prefix}saswp%';");
46
+
47
+ if(!in_array("{$wpdb->prefix}saswp_google_place", $found_tables)) {
48
+
49
+ dbDelta("CREATE TABLE `{$wpdb->prefix}saswp_google_place` (".
50
+ "id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,".
51
+ "place_id VARCHAR(80) NOT NULL,".
52
+ "name VARCHAR(255) NOT NULL,".
53
+ "photo VARCHAR(425),".
54
+ "icon VARCHAR(255),".
55
+ "address VARCHAR(255),".
56
+ "rating DOUBLE PRECISION,".
57
+ "url VARCHAR(255),".
58
+ "website VARCHAR(255),".
59
+ "updated BIGINT(20),".
60
+ "PRIMARY KEY (`id`),".
61
+ "UNIQUE INDEX saswp_place_id (`place_id`)".
62
+ ") ".$charset_collate.$engine.";");
63
+
64
+ }
65
+
66
+ if(!in_array("{$wpdb->prefix}saswp_google_review", $found_tables)) {
67
+
68
+ dbDelta("CREATE TABLE `{$wpdb->prefix}saswp_google_review` (".
69
+ "id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,".
70
+ "google_place_id BIGINT(20) UNSIGNED NOT NULL,".
71
+ "hash VARCHAR(40) NOT NULL,".
72
+ "rating INTEGER NOT NULL,".
73
+ "text VARCHAR(10000),".
74
+ "time INTEGER NOT NULL,".
75
+ "language VARCHAR(10),".
76
+ "author_name VARCHAR(255),".
77
+ "author_url VARCHAR(255),".
78
+ "profile_photo_url VARCHAR(255),".
79
+ "PRIMARY KEY (`id`),".
80
+ "UNIQUE INDEX saswp_google_review_hash (`hash`),".
81
+ "INDEX saswp_google_place_id (`google_place_id`)".
82
+ ") ".$charset_collate.$engine.";");
83
+
84
+ }
85
+
86
+ }
87
+
88
+ function saswp_get_google_review_data($place_id, $language=null){
89
+
90
+ if($language){
91
+
92
+ $language = '&language='.$language;
93
+
94
+ }
95
+
96
+ if($place_id){
97
+
98
+ $result = wp_remote_get('https://maps.googleapis.com/maps/api/place/details/json?placeid='.$place_id.'&key=AIzaSyAQ1j_iD1npoqTRuhrIx-ADeVZjQddUqKs'.$language);
99
+
100
+ if($result){
101
+
102
+ $result = json_decode($result['body']);
103
+ $result->result->business_photo = saswp_business_image($result->result);
104
+ $response = saswp_save_google_reviews($result->result);
105
+ return $response;
106
+ }
107
+
108
+ }
109
+
110
+ }
111
+
112
+ function saswp_save_google_reviews($place) {
113
+
114
+ global $wpdb;
115
+ $response = null;
116
+
117
+ $google_place_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "saswp_google_place WHERE place_id = %s", $place->place_id));
118
+
119
+ if ($google_place_id) {
120
+
121
+ $response = $wpdb->update($wpdb->prefix . 'saswp_google_place', array(
122
+ 'name' => $place->name,
123
+ 'photo' => $place->business_photo,
124
+ 'rating' => $place->rating
125
+ ), array('ID' => $google_place_id));
126
+
127
+ } else {
128
+
129
+ $response = $wpdb->insert($wpdb->prefix . 'saswp_google_place', array(
130
+ 'place_id' => $place->place_id,
131
+ 'name' => $place->name,
132
+ 'photo' => $place->business_photo,
133
+ 'icon' => $place->icon,
134
+ 'address' => $place->formatted_address,
135
+ 'rating' => isset($place->rating) ? $place->rating : null,
136
+ 'url' => isset($place->url) ? $place->url : null,
137
+ 'website' => isset($place->website) ? $place->website : null
138
+ ));
139
+
140
+ $google_place_id = $wpdb->insert_id;
141
+
142
+ }
143
+
144
+ if ($place->reviews) {
145
+
146
+ $reviews = $place->reviews;
147
+
148
+ foreach ($reviews as $review) {
149
+
150
+ $google_review_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM " . $wpdb->prefix . "saswp_google_review WHERE time = %s", $review->time));
151
+
152
+ if ($google_review_id) {
153
+
154
+ $update_params = array(
155
+ 'rating' => $review->rating,
156
+ 'text' => $review->text
157
+ );
158
+
159
+ if (isset($review->profile_photo_url)) {
160
+
161
+ $update_params['profile_photo_url'] = $review->profile_photo_url;
162
+
163
+ }
164
+
165
+ $response = $wpdb->update($wpdb->prefix . 'saswp_google_review', $update_params, array('id' => $google_review_id));
166
+
167
+ } else {
168
+
169
+ $response = $wpdb->insert($wpdb->prefix . 'saswp_google_review', array(
170
+ 'google_place_id' => $google_place_id,
171
+ 'hash' => $review->time,
172
+ 'rating' => $review->rating,
173
+ 'text' => $review->text,
174
+ 'time' => $review->time,
175
+ 'language' => $review->language,
176
+ 'author_name' => $review->author_name,
177
+ 'author_url' => isset($review->author_url) ? $review->author_url : null,
178
+ 'profile_photo_url' => isset($review->profile_photo_url) ? $review->profile_photo_url : null
179
+ ));
180
+
181
+ }
182
+ }
183
+ }
184
+
185
+ return $response;
186
+ }
187
+
188
+
189
+ function saswp_business_image($result_json) {
190
+
191
+ global $sd_data;
192
+
193
+ if (isset($result_json->photos)) {
194
+
195
+ $request_url = add_query_arg(
196
+ array(
197
+ 'photoreference' => $result_json->photos[0]->photo_reference,
198
+ 'key' => $sd_data['google_place_api_key'],
199
+ 'maxwidth' => '300',
200
+ 'maxheight' => '300',
201
+ ),
202
+ 'https://maps.googleapis.com/maps/api/place/photo'
203
+ );
204
+
205
+ return $request_url;
206
+
207
+ }
208
+ return null;
209
+ }
google_review/google_review_widget.php ADDED
@@ -0,0 +1,147 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * To change this license header, choose License Headers in Project Properties.
4
+ * To change this template file, choose Tools | Templates
5
+ * and open the template in the editor.
6
+ */
7
+ /**
8
+ * Adds Saswp_Google_Review_Widget widget.
9
+ */
10
+ class Saswp_Google_Review_Widget extends WP_Widget {
11
+
12
+ /**
13
+ * Register widget with WordPress.
14
+ */
15
+ function __construct() {
16
+ parent::__construct(
17
+ 'saswp_google_review_widget', // Base ID
18
+ esc_html__( 'Schema Google Review', 'schema-and-structured-data-for-wp' ), // Name
19
+ array( 'description' => esc_html__( 'Widget to display google reviews', 'schema-and-structured-data-for-wp' ), ) // Args
20
+ );
21
+ }
22
+
23
+ /**
24
+ * Front-end display of widget.
25
+ *
26
+ * @see WP_Widget::widget()
27
+ *
28
+ * @param array $args Widget arguments.
29
+ * @param array $instance Saved values from database.
30
+ */
31
+ public function widget( $args, $instance ) {
32
+
33
+ echo html_entity_decode(esc_attr($args['before_widget']));
34
+ // if ( ! empty( $instance['title'] ) ) {
35
+ // echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'];
36
+ // }
37
+
38
+ $object = new saswp_google_review();
39
+ $all_ads = $object->saswp_fetch_all_google_review_post();
40
+ $goolge_review_obj = new saswp_google_review();
41
+
42
+ foreach($all_ads as $ad){
43
+
44
+ if($ad->ID == $instance['g_review']){
45
+
46
+ $ad_code = $object->saswp_google_review_front_output($instance['g_review']);
47
+
48
+ $goolge_review = $goolge_review_obj->saswp_get_google_review_schema_markup($instance['g_review']);
49
+
50
+ if($goolge_review){
51
+
52
+ echo $ad_code.$goolge_review;
53
+ }else{
54
+
55
+ echo $ad_code;
56
+ }
57
+
58
+ }
59
+
60
+ }
61
+
62
+ echo html_entity_decode(esc_attr($args['after_widget']));
63
+
64
+ }
65
+
66
+ /**
67
+ * Back-end widget form.
68
+ *
69
+ * @see WP_Widget::form()
70
+ *
71
+ * @param array $instance Previously saved values from database.
72
+ */
73
+ public function form( $instance ) {
74
+
75
+ $title = ! empty( $instance['title'] ) ? $instance['title'] : esc_html__( 'Review Title', 'schema-and-structured-data-for-wp' );
76
+ $ads = ! empty( $instance['g_review'] ) ? $instance['g_review'] : esc_html__( 'review list to be display', 'schema-and-structured-data-for-wp' );
77
+
78
+ ?>
79
+
80
+ <!-- <p>
81
+ <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>">
82
+ <?php esc_attr_e( 'Title:', 'schema-and-structured-data-for-wp' ); ?></label>
83
+ <input
84
+ class="widefat"
85
+ id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"
86
+ name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>"
87
+ type="text"
88
+ value="<?php echo esc_attr( $title ); ?>">
89
+ </p>-->
90
+
91
+ <p>
92
+ <label for="<?php echo esc_attr( $this->get_field_id( 'g_review' ) ); ?>">
93
+ <?php esc_attr_e( 'Places :', 'schema-and-structured-data-for-wp' ); ?>
94
+ </label>
95
+
96
+ <?php
97
+
98
+ $ads_select_html = '';
99
+ $object = new saswp_google_review();
100
+ $all_ads = $object->saswp_fetch_all_google_review_post();
101
+
102
+ foreach($all_ads as $ad){
103
+
104
+ $ads_select_html .= '<option '. esc_attr(selected( $ads, $ad->ID, false)).' value="'.esc_attr($ad->ID).'">'.esc_html__($ad->post_title, 'schema-and-structured-data-for-wp').'</option>';
105
+
106
+ }
107
+
108
+ echo '<select id="'.esc_attr( $this->get_field_id( 'g_review' )).'" name="'.esc_attr( $this->get_field_name( 'g_review' )).'">'
109
+ .$ads_select_html.
110
+ '</select>';
111
+ ?>
112
+
113
+ </p>
114
+
115
+ <?php
116
+ }
117
+
118
+ /**
119
+ * Sanitize widget form values as they are saved.
120
+ *
121
+ * @see WP_Widget::update()
122
+ *
123
+ * @param array $new_instance Values just sent to be saved.
124
+ * @param array $old_instance Previously saved values from database.
125
+ *
126
+ * @return array Updated safe values to be saved.
127
+ */
128
+ public function update( $new_instance, $old_instance ) {
129
+
130
+ $instance = array();
131
+ //$instance['title'] = ( ! empty( $new_instance['title'] ) ) ? sanitize_text_field( $new_instance['title'] ) : '';
132
+ $instance['g_review'] = ( ! empty( $new_instance['g_review'] ) ) ? sanitize_text_field( $new_instance['g_review'] ) : '';
133
+ return $instance;
134
+
135
+ }
136
+
137
+ } // class Adsforwp_Ads_Widget
138
+
139
+
140
+ /**
141
+ * We are registering our widget here in wordpress
142
+ */
143
+ function register_saswp_google_review_widget(){
144
+ register_widget('Saswp_Google_Review_Widget');
145
+ }
146
+
147
+ add_action('widgets_init', 'register_saswp_google_review_widget');
output/function.php CHANGED
@@ -3,21 +3,36 @@ function saswp_remove_amp_default_structure_data($metadata){
3
  return '';
4
  }
5
 
6
- add_filter( 'amp_init', 'saswp_structured_data' );
7
- function saswp_structured_data(){
8
-
9
- add_action( 'amp_post_template_head' , 'saswp_data_generator' );
10
- remove_action( 'amp_post_template_head', 'amp_post_template_add_schemaorg_metadata',99,1);
11
- }
12
- add_action('wp_head', 'saswp_data_generator');
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  /**
16
  * Function to show all the schema markup in the page head
17
  * @global type $sd_data
18
  * @global type json array
19
  */
20
- function saswp_data_generator() {
21
 
22
  global $sd_data;
23
  global $post;
@@ -37,10 +52,13 @@ function saswp_data_generator() {
37
 
38
  $schema_breadcrumb_output = saswp_schema_breadcrumb_output();
39
 
 
40
  if(saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') == 1 && (is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php'))){
41
  }else{
42
  $kb_website_output = saswp_kb_website_output();
43
  $kb_schema_output = saswp_kb_schema_output();
 
 
44
  }
45
 
46
  if(is_singular()){
@@ -67,8 +85,8 @@ function saswp_data_generator() {
67
  if( ( saswp_remove_warnings($sd_data, 'saswp-for-wordpress', 'saswp_string') ==''
68
  || 1 == saswp_remove_warnings($sd_data, 'saswp-for-wordpress', 'saswp_string') && saswp_non_amp() )
69
  || ( 1 == saswp_remove_warnings($sd_data, 'saswp-for-amp', 'saswp_string') && !saswp_non_amp() ) ) {
70
-
71
-
72
  if(!empty($contact_page_output)){
73
 
74
  $output .= json_encode($contact_page_output);
@@ -92,19 +110,135 @@ function saswp_data_generator() {
92
  $output .= json_encode($archive_output);
93
  $output .= ",";
94
  $output .= "\n\n";
95
- }
96
- if(!empty($kb_website_output)){
97
-
98
- $output .= json_encode($kb_website_output);
99
- $output .= ",";
100
- $output .= "\n\n";
101
- }
102
  if(!empty($site_navigation)){
103
 
104
  $output .= json_encode($site_navigation);
105
  $output .= ",";
106
  $output .= "\n\n";
107
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  if(!empty($schema_breadcrumb_output)){
109
 
110
  $output .= json_encode($schema_breadcrumb_output);
@@ -124,19 +258,19 @@ function saswp_data_generator() {
124
  }
125
  if(!empty($kb_schema_output)){
126
 
127
- $output .= json_encode($kb_schema_output);
128
  $output .= ",";
129
- }
 
 
130
 
131
  }
132
-
133
-
134
-
135
  if($output){
136
 
137
  $stroutput = '['. trim($output). ']';
138
- $filter_string = str_replace(',]', ']',$stroutput);
139
-
140
  echo '<!-- Schema & Structured Data For WP v'.esc_attr(SASWP_VERSION).' - -->';
141
  echo "\n";
142
  echo '<script type="application/ld+json">';
@@ -428,11 +562,13 @@ function saswp_list_items_generator(){
428
 
429
  if(is_single()){
430
 
431
- if(isset($bc_titles)){
432
 
433
  for($i=0;$i<sizeof($bc_titles);$i++){
434
 
435
- $breadcrumbslist[] = array(
 
 
436
  '@type' => 'ListItem',
437
  'position' => $j,
438
  'item' => array(
@@ -442,16 +578,23 @@ function saswp_list_items_generator(){
442
  );
443
 
444
  $j++;
 
 
 
 
445
  }
446
 
447
  }
448
 
449
  }
450
  if(is_page()){
451
-
452
- for($i=0;$i<sizeof($bc_titles);$i++){
453
 
454
- $breadcrumbslist[] = array(
 
 
 
 
455
  '@type' => 'ListItem',
456
  'position' => $j,
457
  'item' => array(
@@ -459,17 +602,25 @@ function saswp_list_items_generator(){
459
  'name' => $bc_titles[$i],
460
  ),
461
  );
462
-
463
- $j++;
464
-
465
- }
 
 
 
 
466
 
467
  }
468
  if(is_archive()){
469
 
470
- for($i=0;$i<sizeof($bc_titles);$i++){
471
-
472
- $breadcrumbslist[] = array(
 
 
 
 
473
  '@type' => 'ListItem',
474
  'position' => $j,
475
  'item' => array(
@@ -477,9 +628,13 @@ function saswp_list_items_generator(){
477
  'name' => $bc_titles[$i],
478
  ),
479
  );
480
- $j++;
481
 
 
 
482
  }
 
 
483
  }
484
 
485
  return $breadcrumbslist;
@@ -504,4 +659,34 @@ function saswp_remove_woocommerce_default_structured_data() {
504
 
505
  }
506
 
507
- add_action( 'init', 'saswp_remove_woocommerce_default_structured_data' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  return '';
4
  }
5
 
6
+ add_action('cooked_amp_head', 'saswp_schema_markup_output');
 
 
 
 
 
 
7
 
8
+ add_filter( 'amp_init', 'saswp_schema_markup_hook_on_init' );
9
+ add_action( 'init', 'saswp_schema_markup_hook_on_init');
10
+
11
+ function saswp_schema_markup_hook_on_init() {
12
+
13
+ if(!is_admin()){
14
+
15
+ global $sd_data;
16
+
17
+ if(isset($sd_data['saswp-markup-footer']) && $sd_data['saswp-markup-footer'] == 1){
18
+ add_action('wp_footer', 'saswp_schema_markup_output');
19
+ add_action( 'amp_post_template_footer' , 'saswp_schema_markup_output' );
20
+ }else{
21
+ add_action('wp_head', 'saswp_schema_markup_output');
22
+ add_action( 'amp_post_template_head' , 'saswp_schema_markup_output' );
23
+ }
24
+
25
+ remove_action( 'amp_post_template_head', 'amp_post_template_add_schemaorg_metadata',99,1);
26
+ remove_action( 'amp_post_template_footer', 'amp_post_template_add_schemaorg_metadata',99,1);
27
+ }
28
+ }
29
 
30
  /**
31
  * Function to show all the schema markup in the page head
32
  * @global type $sd_data
33
  * @global type json array
34
  */
35
+ function saswp_schema_markup_output() {
36
 
37
  global $sd_data;
38
  global $post;
52
 
53
  $schema_breadcrumb_output = saswp_schema_breadcrumb_output();
54
 
55
+
56
  if(saswp_remove_warnings($sd_data, 'saswp-yoast', 'saswp_string') == 1 && (is_plugin_active('wordpress-seo/wp-seo.php') || is_plugin_active('wordpress-seo-premium/wp-seo-premium.php'))){
57
  }else{
58
  $kb_website_output = saswp_kb_website_output();
59
  $kb_schema_output = saswp_kb_schema_output();
60
+
61
+
62
  }
63
 
64
  if(is_singular()){
85
  if( ( saswp_remove_warnings($sd_data, 'saswp-for-wordpress', 'saswp_string') ==''
86
  || 1 == saswp_remove_warnings($sd_data, 'saswp-for-wordpress', 'saswp_string') && saswp_non_amp() )
87
  || ( 1 == saswp_remove_warnings($sd_data, 'saswp-for-amp', 'saswp_string') && !saswp_non_amp() ) ) {
88
+
89
+
90
  if(!empty($contact_page_output)){
91
 
92
  $output .= json_encode($contact_page_output);
110
  $output .= json_encode($archive_output);
111
  $output .= ",";
112
  $output .= "\n\n";
113
+ }
 
 
 
 
 
 
114
  if(!empty($site_navigation)){
115
 
116
  $output .= json_encode($site_navigation);
117
  $output .= ",";
118
  $output .= "\n\n";
119
  }
120
+
121
+
122
+
123
+ if(isset($sd_data['saswp-defragment']) && $sd_data['saswp-defragment'] == 1){
124
+
125
+ $output_schema_type_id = array();
126
+
127
+ foreach($schema_output as $soutput){
128
+
129
+ $output_schema_type_id[] = $soutput['@type'];
130
+
131
+ if($soutput['@type'] == 'Blogposting'|| $soutput['@type'] == 'Article' || $soutput['@type'] == 'TechArticle' || $soutput['@type'] == 'NewsArticle'){
132
+
133
+
134
+ $final_output = array();
135
+ $object = new saswp_output_service();
136
+ $webpage = $object->saswp_schema_markup_generator('WebPage');
137
+
138
+ unset($soutput['@context']);
139
+ unset($schema_breadcrumb_output['@context']);
140
+ unset($webpage['mainEntity']);
141
+ unset($kb_schema_output['@context']);
142
+ unset($kb_website_output['@context']);
143
+
144
+
145
+ if($webpage){
146
+
147
+ $soutput['isPartOf'] = array(
148
+ '@id' => $webpage['@id']
149
+ );
150
+
151
+ $webpage['primaryImageOfPage'] = array(
152
+ '@id' => get_permalink().'#primaryimage'
153
+ );
154
+
155
+ }
156
+
157
+ $soutput['mainEntityOfPage'] = $webpage['@id'];
158
+
159
+ if($kb_website_output){
160
+
161
+ $webpage['isPartOf'] = array(
162
+ '@id' => $kb_website_output['@id']
163
+ );
164
+
165
+ }
166
+
167
+ if($schema_breadcrumb_output){
168
+ $webpage['breadcrumb'] = array(
169
+ '@id' => $schema_breadcrumb_output['@id']
170
+ );
171
+ }
172
+
173
+ if($kb_schema_output){
174
+
175
+ $kb_website_output['publisher'] = array(
176
+ '@id' => $kb_schema_output['@id']
177
+ );
178
+
179
+ $soutput['publisher'] = array(
180
+ '@id' => $kb_schema_output['@id']
181
+ );
182
+
183
+ }
184
+
185
+ $final_output['@context'] = 'https://schema.org';
186
+
187
+ $final_output['@graph'][] = $kb_schema_output;
188
+ $final_output['@graph'][] = $kb_website_output;
189
+
190
+ $final_output['@graph'][] = $webpage;
191
+
192
+ $final_output['@graph'][] = $schema_breadcrumb_output;
193
+
194
+ $final_output['@graph'][] = $soutput;
195
+
196
+ $schema = json_encode($final_output);
197
+ $output .= $schema;
198
+ $output .= ",";
199
+ $output .= "\n\n";
200
+
201
+ }else{
202
+
203
+ $schema = json_encode($soutput);
204
+ $output .= $schema;
205
+ $output .= ",";
206
+ $output .= "\n\n";
207
+
208
+ }
209
+
210
+ }
211
+
212
+ 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) ){
213
+ }else{
214
+ if(!empty($kb_website_output)){
215
+
216
+ $output .= json_encode($kb_website_output);
217
+ $output .= ",";
218
+ $output .= "\n\n";
219
+ }
220
+ if(!empty($schema_breadcrumb_output)){
221
+
222
+ $output .= json_encode($schema_breadcrumb_output);
223
+ $output .= ",";
224
+ $output .= "\n\n";
225
+ }
226
+ if(!empty($kb_schema_output)){
227
+
228
+ $output .= json_encode($kb_schema_output);
229
+ $output .= ",";
230
+ }
231
+ }
232
+
233
+
234
+ }else{
235
+
236
+ if(!empty($kb_website_output)){
237
+
238
+ $output .= json_encode($kb_website_output);
239
+ $output .= ",";
240
+ $output .= "\n\n";
241
+ }
242
  if(!empty($schema_breadcrumb_output)){
243
 
244
  $output .= json_encode($schema_breadcrumb_output);
258
  }
259
  if(!empty($kb_schema_output)){
260
 
261
+ $output .= json_encode($kb_schema_output);
262
  $output .= ",";
263
+ }
264
+
265
+ }
266
 
267
  }
268
+
 
 
269
  if($output){
270
 
271
  $stroutput = '['. trim($output). ']';
272
+ $filter_string = str_replace(',]', ']',$stroutput);
273
+ echo "\n";
274
  echo '<!-- Schema & Structured Data For WP v'.esc_attr(SASWP_VERSION).' - -->';
275
  echo "\n";
276
  echo '<script type="application/ld+json">';
562
 
563
  if(is_single()){
564
 
565
+ if(!empty($bc_titles) && !empty($bc_links)){
566
 
567
  for($i=0;$i<sizeof($bc_titles);$i++){
568
 
569
+ if($bc_links[$i] && $bc_titles[$i]){
570
+
571
+ $breadcrumbslist[] = array(
572
  '@type' => 'ListItem',
573
  'position' => $j,
574
  'item' => array(
578
  );
579
 
580
  $j++;
581
+
582
+
583
+ }
584
+
585
  }
586
 
587
  }
588
 
589
  }
590
  if(is_page()){
591
+ if(!empty($bc_titles) && !empty($bc_links)){
 
592
 
593
+ for($i=0;$i<sizeof($bc_titles);$i++){
594
+
595
+ if($bc_links[$i] && $bc_titles[$i]){
596
+
597
+ $breadcrumbslist[] = array(
598
  '@type' => 'ListItem',
599
  'position' => $j,
600
  'item' => array(
602
  'name' => $bc_titles[$i],
603
  ),
604
  );
605
+
606
+ $j++;
607
+
608
+ }
609
+
610
+ }
611
+ }
612
+
613
 
614
  }
615
  if(is_archive()){
616
 
617
+ if(!empty($bc_titles) && !empty($bc_links)){
618
+
619
+ for($i=0;$i<sizeof($bc_titles);$i++){
620
+
621
+ if($bc_links[$i] && $bc_titles[$i]){
622
+
623
+ $breadcrumbslist[] = array(
624
  '@type' => 'ListItem',
625
  'position' => $j,
626
  'item' => array(
628
  'name' => $bc_titles[$i],
629
  ),
630
  );
631
+ $j++;
632
 
633
+ }
634
+
635
  }
636
+
637
+ }
638
  }
639
 
640
  return $breadcrumbslist;
659
 
660
  }
661
 
662
+ add_action( 'init', 'saswp_remove_woocommerce_default_structured_data' );
663
+
664
+
665
+
666
+ /**
667
+ * Here, We are removing all the schema generated by yoast plugin.
668
+ * @param array $data
669
+ * @return array
670
+ */
671
+ function saswp_remove_yoast_json($data){
672
+
673
+ $data = array();
674
+ return $data;
675
+
676
+ }
677
+
678
+ add_filter('wpseo_json_ld_output', 'saswp_remove_yoast_json', 10, 1);
679
+
680
+
681
+ /**
682
+ * Here, We are removing breadcrumb schema generated by seo-by-rank-math.
683
+ * @param array $data
684
+ * @return array
685
+ */
686
+ function saswp_remove_breadcrume_seo_by_rank_math($entry){
687
+
688
+ $entry = array();
689
+ return $entry;
690
+ }
691
+
692
+ add_filter( 'rank_math/snippet/breadcrumb', 'saswp_remove_breadcrume_seo_by_rank_math' );
output/output.php CHANGED
@@ -8,7 +8,8 @@ if (! defined('ABSPATH') ) exit;
8
  function saswp_kb_schema_output() {
9
 
10
  global $sd_data;
11
- $input = array();
 
12
  // Social profile
13
  $sd_social_profile = array();
14
 
@@ -112,7 +113,8 @@ function saswp_kb_schema_output() {
112
 
113
  $input = array(
114
  '@context' =>'http://schema.org',
115
- '@type' => isset($sd_data['saswp_organization_type']) ? esc_attr($sd_data['saswp_organization_type']):'Organization',
 
116
  'name' => saswp_remove_warnings($sd_data, 'sd_name', 'saswp_string'),
117
  'url' => saswp_remove_warnings($sd_data, 'sd_url', 'saswp_string'),
118
  'sameAs' => $platform,
@@ -304,12 +306,19 @@ function saswp_schema_output() {
304
  $extra_theme_review = $service_object->saswp_extra_theme_review_details(get_the_ID());
305
 
306
  if( 'Course' === $schema_type){
 
 
 
 
 
 
307
 
308
  $input1 = array(
309
  '@context' => 'http://schema.org',
310
- '@type' => $schema_type ,
 
311
  'name' => get_the_title(),
312
- 'description' => strip_tags(get_the_excerpt()),
313
  'url' => get_permalink(),
314
  'datePublished' => esc_html($date),
315
  'dateModified' => esc_html($modified_date),
@@ -345,10 +354,10 @@ function saswp_schema_output() {
345
  $input1 = array(
346
  '@context' => 'http://schema.org',
347
  '@type' => 'BlogPosting' ,
348
-
349
  'mainEntityOfPage' => get_permalink(),
350
  'headline' => get_the_title(),
351
- 'description' => strip_tags(get_the_excerpt()),
352
  'name' => get_the_title(),
353
  'url' => get_permalink(),
354
  'datePublished' => esc_html($date),
@@ -390,7 +399,8 @@ function saswp_schema_output() {
390
 
391
  $input1 = array(
392
  '@context' => 'http://schema.org',
393
- '@type' => $schema_type ,
 
394
  'name' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_name', 'saswp_string'),
395
  'description' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_description', 'saswp_string'),
396
  'contentUrl' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_contenturl', 'saswp_string'),
@@ -452,7 +462,8 @@ function saswp_schema_output() {
452
 
453
  $input1 = array(
454
  '@context' => 'http://schema.org',
455
- '@type' => $schema_type ,
 
456
  'name' => saswp_remove_warnings($schema_data, 'saswp_event_schema_name', 'saswp_string'),
457
  'description' => saswp_remove_warnings($schema_data, 'saswp_event_schema_description', 'saswp_string'),
458
  'startDate' => isset($schema_data['saswp_event_schema_start_date']) && $schema_data['saswp_event_schema_start_date'] !='' ? date('Y-m-d\TH:i:s\Z',strtotime($schema_data['saswp_event_schema_start_date'])):'',
@@ -519,7 +530,8 @@ function saswp_schema_output() {
519
 
520
  $input1 = array(
521
  '@context' => 'http://schema.org',
522
- '@type' => $schema_type ,
 
523
  'name' => saswp_remove_warnings($schema_data, 'saswp_software_schema_name', 'saswp_string'),
524
  'description' => saswp_remove_warnings($schema_data, 'saswp_software_schema_description', 'saswp_string'),
525
  'operatingSystem' => saswp_remove_warnings($schema_data, 'saswp_software_schema_operating_system', 'saswp_string'),
@@ -642,11 +654,12 @@ function saswp_schema_output() {
642
  $input1 = array(
643
  '@context' => 'http://schema.org',
644
  '@type' => $schema_type ,
 
645
  'url' => get_permalink(),
646
  'name' => get_the_title(),
647
  'datePublished' => esc_html($date),
648
  'dateModified' => esc_html($modified_date),
649
- 'description' => strip_tags(get_the_excerpt()),
650
  'mainEntity' => array(
651
  '@type' => 'WebPage',
652
  '@id' => get_permalink(),
@@ -714,11 +727,11 @@ function saswp_schema_output() {
714
  $input1 = array(
715
  '@context' => 'http://schema.org',
716
  '@type' => 'Product',
 
717
  'url' => get_permalink(),
718
  'name' => saswp_remove_warnings($product_details, 'product_name', 'saswp_string'),
719
  'sku' => saswp_remove_warnings($product_details, 'product_sku', 'saswp_string'),
720
- 'description' => saswp_remove_warnings($product_details, 'product_description', 'saswp_string'),
721
- 'image' => isset($product_details['product_image'])? $product_details['product_image']:'',
722
  'offers' => array(
723
  '@type' => 'Offer',
724
  'availability' => saswp_remove_warnings($product_details, 'product_availability', 'saswp_string'),
@@ -728,7 +741,12 @@ function saswp_schema_output() {
728
  'priceValidUntil' => saswp_remove_warnings($product_details, 'product_priceValidUntil', 'saswp_string'),
729
  ),
730
 
731
- );
 
 
 
 
 
732
  if(isset($product_details['product_gtin8']) && $product_details['product_gtin8'] !=''){
733
  $input1['gtin8'] = esc_attr($product_details['product_gtin8']);
734
  }
@@ -777,6 +795,7 @@ function saswp_schema_output() {
777
  $input1 = array(
778
  '@context' => 'http://schema.org',
779
  '@type' => 'Product',
 
780
  'url' => get_permalink(),
781
  'name' => saswp_remove_warnings($schema_data, 'saswp_product_schema_name', 'saswp_string'),
782
  'sku' => saswp_remove_warnings($schema_data, 'saswp_product_schema_sku', 'saswp_string'),
@@ -860,15 +879,16 @@ function saswp_schema_output() {
860
  $word_count = saswp_reading_time_and_word_count();
861
  $input1 = array(
862
  '@context' => 'http://schema.org',
863
- '@type' => $schema_type ,
 
864
  'url' => get_permalink(),
865
  'headline' => get_the_title(),
866
  'mainEntityOfPage' => get_the_permalink(),
867
  'datePublished' => esc_html($date),
868
  'dateModified' => esc_html($modified_date),
869
- 'description' => strip_tags(get_the_excerpt()),
870
  'articleSection' => $article_section,
871
- 'articleBody' => strip_tags(get_the_excerpt()),
872
  'name' => get_the_title(),
873
  'thumbnailUrl' => saswp_remove_warnings($image_details, 0, 'saswp_string'),
874
  'wordCount' => saswp_remove_warnings($word_count, 'word_count', 'saswp_string'),
@@ -927,6 +947,7 @@ function saswp_schema_output() {
927
  $input1 = array(
928
  '@context' => 'http://schema.org',
929
  '@type' => $schema_type ,
 
930
  'name' => saswp_remove_warnings($schema_data, 'saswp_service_schema_name', 'saswp_string'),
931
  'serviceType' => saswp_remove_warnings($schema_data, 'saswp_service_schema_type', 'saswp_string'),
932
  'provider' => array(
@@ -1017,6 +1038,7 @@ function saswp_schema_output() {
1017
  $input1 = array(
1018
  '@context' => 'http://schema.org',
1019
  '@type' => 'Review',
 
1020
  'dateCreated' => esc_html($date),
1021
  'datePublished' => esc_html($date),
1022
  'dateModified' => esc_html($modified_date),
@@ -1024,7 +1046,7 @@ function saswp_schema_output() {
1024
  'name' => get_the_title(),
1025
  'keywords' => tie_get_plain_terms( get_the_ID(), 'post_tag' ),
1026
  'url' => get_permalink(),
1027
- 'description' => strip_tags(get_the_excerpt()),
1028
  'copyrightYear' => get_the_time( 'Y' ),
1029
  'author' => array(
1030
  '@type' => 'Person',
@@ -1105,8 +1127,8 @@ function saswp_schema_output() {
1105
  $input1['reviewBody'] = $schema_data['saswp_review_schema_description'];
1106
  $input1['description'] = $schema_data['saswp_review_schema_description'];
1107
  }else {
1108
- $input1['reviewBody'] = strip_tags(get_the_excerpt());
1109
- $input1['description'] = strip_tags(get_the_excerpt());
1110
  }
1111
 
1112
  if(isset($schema_data['saswp_review_schema_item_type'])){
@@ -1277,22 +1299,28 @@ function saswp_schema_output() {
1277
 
1278
  if( 'VideoObject' === $schema_type){
1279
 
1280
- if(empty($image_details[0]) || $image_details[0] === NULL ){
1281
-
1282
- if(isset($sd_data['sd_logo'])){
1283
- $image_details[0] = $sd_data['sd_logo']['url'];
1284
- }
1285
-
1286
- }
1287
-
 
 
 
 
 
1288
  $input1 = array(
1289
  '@context' => 'http://schema.org',
1290
  '@type' => 'VideoObject',
 
1291
  'url' => get_permalink(),
1292
  'headline' => get_the_title(),
1293
  'datePublished' => esc_html($date),
1294
  'dateModified' => esc_html($modified_date),
1295
- 'description' => strip_tags(get_the_excerpt()),
1296
  'name' => get_the_title(),
1297
  'uploadDate' => esc_html($date),
1298
  'thumbnailUrl' => isset($image_details[0]) ? esc_url($image_details[0]):'',
@@ -1311,9 +1339,9 @@ function saswp_schema_output() {
1311
  ),
1312
  )
1313
  );
1314
- if(!empty($publisher)){
1315
 
1316
- $input1 = array_merge($input1, $publisher);
1317
 
1318
  }
1319
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
@@ -1357,9 +1385,10 @@ function saswp_schema_output() {
1357
  $input1 = array(
1358
  '@context' => 'http://schema.org',
1359
  '@type' => esc_attr($local_business),
 
1360
  'name' => saswp_remove_warnings($business_details, 'local_business_name', 'saswp_string'),
1361
  'url' => get_permalink(),
1362
- 'description' => strip_tags(get_the_excerpt()),
1363
  'image' => array(
1364
  '@type' => 'ImageObject',
1365
  'url' => isset($business_details['local_business_logo']) ? esc_url($business_details['local_business_logo']['url']):'',
@@ -1596,6 +1625,7 @@ function saswp_post_specific_schema_output() {
1596
  $input1 = array(
1597
  '@context' => 'http://schema.org',
1598
  '@type' => 'QAPage',
 
1599
  'mainEntity' => array(
1600
  '@type' => 'Question' ,
1601
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_qa_question_title_'.$schema_id, 'saswp_array'),
@@ -1631,7 +1661,8 @@ function saswp_post_specific_schema_output() {
1631
 
1632
  $input1 = array(
1633
  '@context' => 'http://schema.org',
1634
- '@type' => 'Event' ,
 
1635
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_name_'.$schema_id, 'saswp_array'),
1636
  'description' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_description_'.$schema_id, 'saswp_array'),
1637
  'startDate' => isset($all_post_meta['saswp_event_schema_start_date_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_event_schema_start_date_'.$schema_id][0])):'',
@@ -1683,7 +1714,8 @@ function saswp_post_specific_schema_output() {
1683
 
1684
  $input1 = array(
1685
  '@context' => 'http://schema.org',
1686
- '@type' => 'Course' ,
 
1687
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_course_name_'.$schema_id, 'saswp_array'),
1688
  'description' => saswp_remove_warnings($all_post_meta, 'saswp_course_description_'.$schema_id, 'saswp_array'),
1689
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_course_url_'.$schema_id, 'saswp_array'),
@@ -1698,12 +1730,12 @@ function saswp_post_specific_schema_output() {
1698
 
1699
  if(!empty($aggregateRating)){
1700
 
1701
- $input1['mainEntity']['aggregateRating'] = $aggregateRating;
1702
 
1703
  }
1704
  if(!empty($kkstar_aggregateRating)){
1705
 
1706
- $input1['mainEntity']['aggregateRating'] = $kkstar_aggregateRating;
1707
 
1708
  }
1709
  if(!empty($extra_theme_review)){
@@ -1720,7 +1752,7 @@ function saswp_post_specific_schema_output() {
1720
  $input1 = array(
1721
  '@context' => 'http://schema.org',
1722
  '@type' => $schema_type ,
1723
-
1724
  'mainEntityOfPage' => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_main_entity_of_page_'.$schema_id, 'saswp_array'),
1725
  'headline' => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_headline_'.$schema_id, 'saswp_array'),
1726
  'description' => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_description_'.$schema_id, 'saswp_array'),
@@ -1758,7 +1790,8 @@ function saswp_post_specific_schema_output() {
1758
 
1759
  $input1 = array(
1760
  '@context' => 'http://schema.org',
1761
- '@type' => $schema_type,
 
1762
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_audio_schema_name_'.$schema_id, 'saswp_array'),
1763
  'description' => saswp_remove_warnings($all_post_meta, 'saswp_audio_schema_description_'.$schema_id, 'saswp_array'),
1764
  'contentUrl' => saswp_remove_warnings($all_post_meta, 'saswp_audio_schema_contenturl_'.$schema_id, 'saswp_array'),
@@ -1787,7 +1820,8 @@ function saswp_post_specific_schema_output() {
1787
 
1788
  $input1 = array(
1789
  '@context' => 'http://schema.org',
1790
- '@type' => 'SoftwareApplication',
 
1791
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_name_'.$schema_id, 'saswp_array'),
1792
  'description' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_description_'.$schema_id, 'saswp_array'),
1793
  'operatingSystem' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_operating_system_'.$schema_id, 'saswp_array'),
@@ -1828,6 +1862,7 @@ function saswp_post_specific_schema_output() {
1828
  $input1 = array(
1829
  '@context' => 'http://schema.org',
1830
  '@type' => 'WebPage' ,
 
1831
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_webpage_name_'.$schema_id, 'saswp_array'),
1832
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_webpage_url_'.$schema_id, 'saswp_array'),
1833
  'description' => saswp_remove_warnings($all_post_meta, 'saswp_webpage_description_'.$schema_id, 'saswp_array'),
@@ -1880,6 +1915,7 @@ function saswp_post_specific_schema_output() {
1880
  $input1 = array(
1881
  '@context' => 'http://schema.org',
1882
  '@type' => 'Article',
 
1883
  'mainEntityOfPage' => saswp_remove_warnings($all_post_meta, 'saswp_article_main_entity_of_page_'.$schema_id, 'saswp_array'),
1884
  'image' => saswp_remove_warnings($all_post_meta, 'saswp_article_image_'.$schema_id, 'saswp_array'),
1885
  'headline' => saswp_remove_warnings($all_post_meta, 'saswp_article_headline_'.$schema_id, 'saswp_array'),
@@ -1921,6 +1957,7 @@ function saswp_post_specific_schema_output() {
1921
  $input1 = array(
1922
  '@context' => 'http://schema.org',
1923
  '@type' => 'TechArticle',
 
1924
  'mainEntityOfPage' => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_main_entity_of_page_'.$schema_id, 'saswp_array'),
1925
  'image' => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_image_'.$schema_id, 'saswp_array'),
1926
  'headline' => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_headline_'.$schema_id, 'saswp_array'),
@@ -2003,6 +2040,7 @@ function saswp_post_specific_schema_output() {
2003
  $input1 = array(
2004
  '@context' => 'http://schema.org',
2005
  '@type' => $schema_type ,
 
2006
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_url_'.$schema_id, 'saswp_array'),
2007
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_name_'.$schema_id, 'saswp_array'),
2008
  'author' => array(
@@ -2077,6 +2115,7 @@ function saswp_post_specific_schema_output() {
2077
  $input1 = array(
2078
  '@context' => 'http://schema.org',
2079
  '@type' => 'Product',
 
2080
  'url' => get_permalink(),
2081
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_name_'.$schema_id, 'saswp_array'),
2082
  'sku' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_sku_'.$schema_id, 'saswp_array'),
@@ -2167,7 +2206,8 @@ function saswp_post_specific_schema_output() {
2167
 
2168
  $input1 = array(
2169
  '@context' => 'http://schema.org',
2170
- '@type' => 'NewsArticle' ,
 
2171
  'mainEntityOfPage' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_main_entity_of_page_'.$schema_id, 'saswp_array'),
2172
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_URL_'.$schema_id, 'saswp_array'),
2173
  'headline' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_headline_'.$schema_id, 'saswp_array'),
@@ -2221,6 +2261,7 @@ function saswp_post_specific_schema_output() {
2221
  $input1 = array(
2222
  '@context' => 'http://schema.org',
2223
  '@type' => 'VideoObject',
 
2224
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_video_object_url_'.$schema_id, 'saswp_array'),
2225
  'headline' => saswp_remove_warnings($all_post_meta, 'saswp_video_object_headline_'.$schema_id, 'saswp_array'),
2226
  'datePublished' => isset($all_post_meta['saswp_video_object_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_video_object_date_published_'.$schema_id][0])):'',
@@ -2277,6 +2318,7 @@ function saswp_post_specific_schema_output() {
2277
  $input1 = array(
2278
  '@context' => 'http://schema.org',
2279
  '@type' => $schema_type ,
 
2280
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_service_schema_name_'.$schema_id, 'saswp_array'),
2281
  'serviceType' => saswp_remove_warnings($all_post_meta, 'saswp_service_schema_type_'.$schema_id, 'saswp_array'),
2282
  'provider' => array(
@@ -2353,6 +2395,7 @@ function saswp_post_specific_schema_output() {
2353
 
2354
  $input1['@context'] = 'http://schema.org';
2355
  $input1['@type'] = 'Review';
 
2356
  $input1['url'] = get_permalink();
2357
  $input1['datePublished'] = get_the_date("Y-m-d\TH:i:s\Z");
2358
  $input1['dateModified'] = get_the_modified_date("Y-m-d\TH:i:s\Z");
@@ -2386,8 +2429,8 @@ function saswp_post_specific_schema_output() {
2386
  $input1['reviewBody'] = $all_post_meta['saswp_review_schema_description_'.$schema_id][0];
2387
  $input1['description'] = $all_post_meta['saswp_review_schema_description_'.$schema_id][0];
2388
  }else {
2389
- $input1['reviewBody'] = strip_tags(get_the_excerpt());
2390
- $input1['description'] = strip_tags(get_the_excerpt());
2391
  }
2392
 
2393
  if(isset($all_post_meta['saswp_review_schema_item_type_'.$schema_id])){
@@ -2585,6 +2628,7 @@ function saswp_post_specific_schema_output() {
2585
  $input1 = array(
2586
  '@context' => 'http://schema.org',
2587
  '@type' => $local_business ,
 
2588
  'name' => saswp_remove_warnings($all_post_meta, 'local_business_name_'.$schema_id, 'saswp_array'),
2589
  'url' => saswp_remove_warnings($all_post_meta, 'local_business_name_url_'.$schema_id, 'saswp_array'),
2590
  'description' => saswp_remove_warnings($all_post_meta, 'local_business_description_'.$schema_id, 'saswp_array'),
@@ -2689,6 +2733,7 @@ function saswp_schema_breadcrumb_output(){
2689
  $input = array(
2690
  '@context' => 'http://schema.org',
2691
  '@type' => 'BreadcrumbList' ,
 
2692
  'itemListElement' => $bread_crumb_list,
2693
  );
2694
 
@@ -2721,7 +2766,7 @@ function saswp_kb_website_output(){
2721
  $input = array(
2722
  '@context' => 'http://schema.org',
2723
  '@type' => 'WebSite',
2724
- 'id' => '#website',
2725
  'url' => $site_url,
2726
  'name' => $site_name,
2727
  );
@@ -2937,7 +2982,7 @@ function saswp_about_page_output(){
2937
  ),
2938
  "url" => get_permalink(),
2939
  "headline" => get_the_title(),
2940
- 'description' => strip_tags(get_the_excerpt()),
2941
  );
2942
 
2943
  if(!empty($feature_image)){
@@ -2982,7 +3027,7 @@ function saswp_contact_page_output(){
2982
  ),
2983
  "url" => get_permalink(),
2984
  "headline" => get_the_title(),
2985
- 'description' => strip_tags(get_the_excerpt()),
2986
  );
2987
 
2988
  if(!empty($feature_image)){
8
  function saswp_kb_schema_output() {
9
 
10
  global $sd_data;
11
+ $input = array();
12
+ $site_url = get_site_url();
13
  // Social profile
14
  $sd_social_profile = array();
15
 
113
 
114
  $input = array(
115
  '@context' =>'http://schema.org',
116
+ '@type' => 'Organization',
117
+ '@id' => $site_url.'/#Organization',
118
  'name' => saswp_remove_warnings($sd_data, 'sd_name', 'saswp_string'),
119
  'url' => saswp_remove_warnings($sd_data, 'sd_url', 'saswp_string'),
120
  'sameAs' => $platform,
306
  $extra_theme_review = $service_object->saswp_extra_theme_review_details(get_the_ID());
307
 
308
  if( 'Course' === $schema_type){
309
+
310
+ $description = strip_tags(strip_shortcodes(get_the_excerpt()));
311
+
312
+ if(!$description){
313
+ $description = get_bloginfo('description');
314
+ }
315
 
316
  $input1 = array(
317
  '@context' => 'http://schema.org',
318
+ '@type' => $schema_type ,
319
+ '@id' => get_permalink().'/#course',
320
  'name' => get_the_title(),
321
+ 'description' => $description,
322
  'url' => get_permalink(),
323
  'datePublished' => esc_html($date),
324
  'dateModified' => esc_html($modified_date),
354
  $input1 = array(
355
  '@context' => 'http://schema.org',
356
  '@type' => 'BlogPosting' ,
357
+ '@id' => get_permalink().'/#blogposting',
358
  'mainEntityOfPage' => get_permalink(),
359
  'headline' => get_the_title(),
360
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
361
  'name' => get_the_title(),
362
  'url' => get_permalink(),
363
  'datePublished' => esc_html($date),
399
 
400
  $input1 = array(
401
  '@context' => 'http://schema.org',
402
+ '@type' => $schema_type ,
403
+ '@id' => get_permalink().'/#audioobject',
404
  'name' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_name', 'saswp_string'),
405
  'description' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_description', 'saswp_string'),
406
  'contentUrl' => saswp_remove_warnings($schema_data, 'saswp_audio_schema_contenturl', 'saswp_string'),
462
 
463
  $input1 = array(
464
  '@context' => 'http://schema.org',
465
+ '@type' => $schema_type ,
466
+ '@id' => get_permalink().'/#event',
467
  'name' => saswp_remove_warnings($schema_data, 'saswp_event_schema_name', 'saswp_string'),
468
  'description' => saswp_remove_warnings($schema_data, 'saswp_event_schema_description', 'saswp_string'),
469
  'startDate' => isset($schema_data['saswp_event_schema_start_date']) && $schema_data['saswp_event_schema_start_date'] !='' ? date('Y-m-d\TH:i:s\Z',strtotime($schema_data['saswp_event_schema_start_date'])):'',
530
 
531
  $input1 = array(
532
  '@context' => 'http://schema.org',
533
+ '@type' => $schema_type ,
534
+ '@id' => get_permalink().'/#softwareapplication',
535
  'name' => saswp_remove_warnings($schema_data, 'saswp_software_schema_name', 'saswp_string'),
536
  'description' => saswp_remove_warnings($schema_data, 'saswp_software_schema_description', 'saswp_string'),
537
  'operatingSystem' => saswp_remove_warnings($schema_data, 'saswp_software_schema_operating_system', 'saswp_string'),
654
  $input1 = array(
655
  '@context' => 'http://schema.org',
656
  '@type' => $schema_type ,
657
+ '@id' => get_permalink().'/#recipe',
658
  'url' => get_permalink(),
659
  'name' => get_the_title(),
660
  'datePublished' => esc_html($date),
661
  'dateModified' => esc_html($modified_date),
662
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
663
  'mainEntity' => array(
664
  '@type' => 'WebPage',
665
  '@id' => get_permalink(),
727
  $input1 = array(
728
  '@context' => 'http://schema.org',
729
  '@type' => 'Product',
730
+ '@id' => get_permalink().'/#product',
731
  'url' => get_permalink(),
732
  'name' => saswp_remove_warnings($product_details, 'product_name', 'saswp_string'),
733
  'sku' => saswp_remove_warnings($product_details, 'product_sku', 'saswp_string'),
734
+ 'description' => saswp_remove_warnings($product_details, 'product_description', 'saswp_string'),
 
735
  'offers' => array(
736
  '@type' => 'Offer',
737
  'availability' => saswp_remove_warnings($product_details, 'product_availability', 'saswp_string'),
741
  'priceValidUntil' => saswp_remove_warnings($product_details, 'product_priceValidUntil', 'saswp_string'),
742
  ),
743
 
744
+ );
745
+
746
+ if(isset($product_details['product_image'])){
747
+ $input1 = array_merge($input1, $product_details['product_image']);
748
+ }
749
+
750
  if(isset($product_details['product_gtin8']) && $product_details['product_gtin8'] !=''){
751
  $input1['gtin8'] = esc_attr($product_details['product_gtin8']);
752
  }
795
  $input1 = array(
796
  '@context' => 'http://schema.org',
797
  '@type' => 'Product',
798
+ '@id' => get_permalink().'/#product',
799
  'url' => get_permalink(),
800
  'name' => saswp_remove_warnings($schema_data, 'saswp_product_schema_name', 'saswp_string'),
801
  'sku' => saswp_remove_warnings($schema_data, 'saswp_product_schema_sku', 'saswp_string'),
879
  $word_count = saswp_reading_time_and_word_count();
880
  $input1 = array(
881
  '@context' => 'http://schema.org',
882
+ '@type' => $schema_type ,
883
+ '@id' => get_permalink().'/#newsarticle',
884
  'url' => get_permalink(),
885
  'headline' => get_the_title(),
886
  'mainEntityOfPage' => get_the_permalink(),
887
  'datePublished' => esc_html($date),
888
  'dateModified' => esc_html($modified_date),
889
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
890
  'articleSection' => $article_section,
891
+ 'articleBody' => strip_tags(strip_shortcodes(get_the_excerpt())),
892
  'name' => get_the_title(),
893
  'thumbnailUrl' => saswp_remove_warnings($image_details, 0, 'saswp_string'),
894
  'wordCount' => saswp_remove_warnings($word_count, 'word_count', 'saswp_string'),
947
  $input1 = array(
948
  '@context' => 'http://schema.org',
949
  '@type' => $schema_type ,
950
+ '@id' => get_permalink().'/#service',
951
  'name' => saswp_remove_warnings($schema_data, 'saswp_service_schema_name', 'saswp_string'),
952
  'serviceType' => saswp_remove_warnings($schema_data, 'saswp_service_schema_type', 'saswp_string'),
953
  'provider' => array(
1038
  $input1 = array(
1039
  '@context' => 'http://schema.org',
1040
  '@type' => 'Review',
1041
+ '@id' => get_permalink().'/#review',
1042
  'dateCreated' => esc_html($date),
1043
  'datePublished' => esc_html($date),
1044
  'dateModified' => esc_html($modified_date),
1046
  'name' => get_the_title(),
1047
  'keywords' => tie_get_plain_terms( get_the_ID(), 'post_tag' ),
1048
  'url' => get_permalink(),
1049
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
1050
  'copyrightYear' => get_the_time( 'Y' ),
1051
  'author' => array(
1052
  '@type' => 'Person',
1127
  $input1['reviewBody'] = $schema_data['saswp_review_schema_description'];
1128
  $input1['description'] = $schema_data['saswp_review_schema_description'];
1129
  }else {
1130
+ $input1['reviewBody'] = strip_tags(strip_shortcodes(get_the_excerpt()));
1131
+ $input1['description'] = strip_tags(strip_shortcodes(get_the_excerpt()));
1132
  }
1133
 
1134
  if(isset($schema_data['saswp_review_schema_item_type'])){
1299
 
1300
  if( 'VideoObject' === $schema_type){
1301
 
1302
+ if(empty($image_details[0]) || $image_details[0] === NULL ){
1303
+
1304
+ if(isset($sd_data['sd_logo'])){
1305
+ $image_details[0] = $sd_data['sd_logo']['url'];
1306
+ }
1307
+
1308
+ }
1309
+ $description = strip_tags(strip_shortcodes(get_the_excerpt()));
1310
+
1311
+ if(!$description){
1312
+ $description = get_bloginfo('description');
1313
+ }
1314
+
1315
  $input1 = array(
1316
  '@context' => 'http://schema.org',
1317
  '@type' => 'VideoObject',
1318
+ '@id' => get_permalink().'/#videoobject',
1319
  'url' => get_permalink(),
1320
  'headline' => get_the_title(),
1321
  'datePublished' => esc_html($date),
1322
  'dateModified' => esc_html($modified_date),
1323
+ 'description' => $description,
1324
  'name' => get_the_title(),
1325
  'uploadDate' => esc_html($date),
1326
  'thumbnailUrl' => isset($image_details[0]) ? esc_url($image_details[0]):'',
1339
  ),
1340
  )
1341
  );
1342
+ if(!empty($publisher)){
1343
 
1344
+ $input1 = array_merge($input1, $publisher);
1345
 
1346
  }
1347
  if(isset($schema_options['enable_custom_field']) && $schema_options['enable_custom_field'] ==1){
1385
  $input1 = array(
1386
  '@context' => 'http://schema.org',
1387
  '@type' => esc_attr($local_business),
1388
+ '@id' => get_permalink().'/#'. strtolower(esc_attr($local_business)),
1389
  'name' => saswp_remove_warnings($business_details, 'local_business_name', 'saswp_string'),
1390
  'url' => get_permalink(),
1391
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
1392
  'image' => array(
1393
  '@type' => 'ImageObject',
1394
  'url' => isset($business_details['local_business_logo']) ? esc_url($business_details['local_business_logo']['url']):'',
1625
  $input1 = array(
1626
  '@context' => 'http://schema.org',
1627
  '@type' => 'QAPage',
1628
+ '@id' => get_permalink().'/#qapage',
1629
  'mainEntity' => array(
1630
  '@type' => 'Question' ,
1631
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_qa_question_title_'.$schema_id, 'saswp_array'),
1661
 
1662
  $input1 = array(
1663
  '@context' => 'http://schema.org',
1664
+ '@type' => 'Event' ,
1665
+ '@id' => get_permalink().'/#event',
1666
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_name_'.$schema_id, 'saswp_array'),
1667
  'description' => saswp_remove_warnings($all_post_meta, 'saswp_event_schema_description_'.$schema_id, 'saswp_array'),
1668
  'startDate' => isset($all_post_meta['saswp_event_schema_start_date_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_event_schema_start_date_'.$schema_id][0])):'',
1714
 
1715
  $input1 = array(
1716
  '@context' => 'http://schema.org',
1717
+ '@type' => 'Course' ,
1718
+ '@id' => get_permalink().'/#course',
1719
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_course_name_'.$schema_id, 'saswp_array'),
1720
  'description' => saswp_remove_warnings($all_post_meta, 'saswp_course_description_'.$schema_id, 'saswp_array'),
1721
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_course_url_'.$schema_id, 'saswp_array'),
1730
 
1731
  if(!empty($aggregateRating)){
1732
 
1733
+ $input1['aggregateRating'] = $aggregateRating;
1734
 
1735
  }
1736
  if(!empty($kkstar_aggregateRating)){
1737
 
1738
+ $input1['aggregateRating'] = $kkstar_aggregateRating;
1739
 
1740
  }
1741
  if(!empty($extra_theme_review)){
1752
  $input1 = array(
1753
  '@context' => 'http://schema.org',
1754
  '@type' => $schema_type ,
1755
+ '@id' => get_permalink().'/#blogposting',
1756
  'mainEntityOfPage' => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_main_entity_of_page_'.$schema_id, 'saswp_array'),
1757
  'headline' => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_headline_'.$schema_id, 'saswp_array'),
1758
  'description' => saswp_remove_warnings($all_post_meta, 'saswp_blogposting_description_'.$schema_id, 'saswp_array'),
1790
 
1791
  $input1 = array(
1792
  '@context' => 'http://schema.org',
1793
+ '@type' => $schema_type,
1794
+ '@id' => get_permalink().'/#audioobject',
1795
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_audio_schema_name_'.$schema_id, 'saswp_array'),
1796
  'description' => saswp_remove_warnings($all_post_meta, 'saswp_audio_schema_description_'.$schema_id, 'saswp_array'),
1797
  'contentUrl' => saswp_remove_warnings($all_post_meta, 'saswp_audio_schema_contenturl_'.$schema_id, 'saswp_array'),
1820
 
1821
  $input1 = array(
1822
  '@context' => 'http://schema.org',
1823
+ '@type' => 'SoftwareApplication',
1824
+ '@id' => get_permalink().'/#softwareapplication',
1825
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_name_'.$schema_id, 'saswp_array'),
1826
  'description' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_description_'.$schema_id, 'saswp_array'),
1827
  'operatingSystem' => saswp_remove_warnings($all_post_meta, 'saswp_software_schema_operating_system_'.$schema_id, 'saswp_array'),
1862
  $input1 = array(
1863
  '@context' => 'http://schema.org',
1864
  '@type' => 'WebPage' ,
1865
+ '@id' => get_permalink().'/#webpage',
1866
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_webpage_name_'.$schema_id, 'saswp_array'),
1867
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_webpage_url_'.$schema_id, 'saswp_array'),
1868
  'description' => saswp_remove_warnings($all_post_meta, 'saswp_webpage_description_'.$schema_id, 'saswp_array'),
1915
  $input1 = array(
1916
  '@context' => 'http://schema.org',
1917
  '@type' => 'Article',
1918
+ '@id' => get_permalink().'/#article',
1919
  'mainEntityOfPage' => saswp_remove_warnings($all_post_meta, 'saswp_article_main_entity_of_page_'.$schema_id, 'saswp_array'),
1920
  'image' => saswp_remove_warnings($all_post_meta, 'saswp_article_image_'.$schema_id, 'saswp_array'),
1921
  'headline' => saswp_remove_warnings($all_post_meta, 'saswp_article_headline_'.$schema_id, 'saswp_array'),
1957
  $input1 = array(
1958
  '@context' => 'http://schema.org',
1959
  '@type' => 'TechArticle',
1960
+ '@id' => get_permalink().'/#techarticle',
1961
  'mainEntityOfPage' => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_main_entity_of_page_'.$schema_id, 'saswp_array'),
1962
  'image' => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_image_'.$schema_id, 'saswp_array'),
1963
  'headline' => saswp_remove_warnings($all_post_meta, 'saswp_tech_article_headline_'.$schema_id, 'saswp_array'),
2040
  $input1 = array(
2041
  '@context' => 'http://schema.org',
2042
  '@type' => $schema_type ,
2043
+ '@id' => get_permalink().'/#recipe',
2044
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_url_'.$schema_id, 'saswp_array'),
2045
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_recipe_name_'.$schema_id, 'saswp_array'),
2046
  'author' => array(
2115
  $input1 = array(
2116
  '@context' => 'http://schema.org',
2117
  '@type' => 'Product',
2118
+ '@id' => get_permalink().'/#product',
2119
  'url' => get_permalink(),
2120
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_name_'.$schema_id, 'saswp_array'),
2121
  'sku' => saswp_remove_warnings($all_post_meta, 'saswp_product_schema_sku_'.$schema_id, 'saswp_array'),
2206
 
2207
  $input1 = array(
2208
  '@context' => 'http://schema.org',
2209
+ '@type' => 'NewsArticle' ,
2210
+ '@id' => get_permalink().'/#newsarticle',
2211
  'mainEntityOfPage' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_main_entity_of_page_'.$schema_id, 'saswp_array'),
2212
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_URL_'.$schema_id, 'saswp_array'),
2213
  'headline' => saswp_remove_warnings($all_post_meta, 'saswp_newsarticle_headline_'.$schema_id, 'saswp_array'),
2261
  $input1 = array(
2262
  '@context' => 'http://schema.org',
2263
  '@type' => 'VideoObject',
2264
+ '@id' => get_permalink().'/#videoobject',
2265
  'url' => saswp_remove_warnings($all_post_meta, 'saswp_video_object_url_'.$schema_id, 'saswp_array'),
2266
  'headline' => saswp_remove_warnings($all_post_meta, 'saswp_video_object_headline_'.$schema_id, 'saswp_array'),
2267
  'datePublished' => isset($all_post_meta['saswp_video_object_date_published_'.$schema_id])?date('Y-m-d\TH:i:s\Z',strtotime($all_post_meta['saswp_video_object_date_published_'.$schema_id][0])):'',
2318
  $input1 = array(
2319
  '@context' => 'http://schema.org',
2320
  '@type' => $schema_type ,
2321
+ '@id' => get_permalink().'/#service',
2322
  'name' => saswp_remove_warnings($all_post_meta, 'saswp_service_schema_name_'.$schema_id, 'saswp_array'),
2323
  'serviceType' => saswp_remove_warnings($all_post_meta, 'saswp_service_schema_type_'.$schema_id, 'saswp_array'),
2324
  'provider' => array(
2395
 
2396
  $input1['@context'] = 'http://schema.org';
2397
  $input1['@type'] = 'Review';
2398
+ $input1['@id'] = get_permalink().'/#review';
2399
  $input1['url'] = get_permalink();
2400
  $input1['datePublished'] = get_the_date("Y-m-d\TH:i:s\Z");
2401
  $input1['dateModified'] = get_the_modified_date("Y-m-d\TH:i:s\Z");
2429
  $input1['reviewBody'] = $all_post_meta['saswp_review_schema_description_'.$schema_id][0];
2430
  $input1['description'] = $all_post_meta['saswp_review_schema_description_'.$schema_id][0];
2431
  }else {
2432
+ $input1['reviewBody'] = strip_tags(strip_shortcodes(get_the_excerpt()));
2433
+ $input1['description'] = strip_tags(strip_shortcodes(get_the_excerpt()));
2434
  }
2435
 
2436
  if(isset($all_post_meta['saswp_review_schema_item_type_'.$schema_id])){
2628
  $input1 = array(
2629
  '@context' => 'http://schema.org',
2630
  '@type' => $local_business ,
2631
+ '@id' => get_permalink().'/#'. strtolower($local_business),
2632
  'name' => saswp_remove_warnings($all_post_meta, 'local_business_name_'.$schema_id, 'saswp_array'),
2633
  'url' => saswp_remove_warnings($all_post_meta, 'local_business_name_url_'.$schema_id, 'saswp_array'),
2634
  'description' => saswp_remove_warnings($all_post_meta, 'local_business_description_'.$schema_id, 'saswp_array'),
2733
  $input = array(
2734
  '@context' => 'http://schema.org',
2735
  '@type' => 'BreadcrumbList' ,
2736
+ '@id' => get_permalink().'#breadcrumb' ,
2737
  'itemListElement' => $bread_crumb_list,
2738
  );
2739
 
2766
  $input = array(
2767
  '@context' => 'http://schema.org',
2768
  '@type' => 'WebSite',
2769
+ '@id' => $site_url.'/#website',
2770
  'url' => $site_url,
2771
  'name' => $site_name,
2772
  );
2982
  ),
2983
  "url" => get_permalink(),
2984
  "headline" => get_the_title(),
2985
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
2986
  );
2987
 
2988
  if(!empty($feature_image)){
3027
  ),
3028
  "url" => get_permalink(),
3029
  "headline" => get_the_title(),
3030
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
3031
  );
3032
 
3033
  if(!empty($feature_image)){
output/review-output.php CHANGED
@@ -2,8 +2,11 @@
2
  Class saswp_review_output{
3
 
4
  public function saswp_review_hooks(){
5
- add_filter('the_content', array($this, 'saswp_display_review_box'));
6
 
 
 
 
 
7
  }
8
 
9
  public function saswp_review_display_via_shortcode($attr){
@@ -17,6 +20,88 @@ Class saswp_review_output{
17
 
18
  }
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  }
21
 
22
  public function saswp_get_review_box_content(){
2
  Class saswp_review_output{
3
 
4
  public function saswp_review_hooks(){
 
5
 
6
+ add_filter('the_content', array($this, 'saswp_display_review_box'));
7
+ add_action('wp_head', array($this, 'saswp_display_review_box_schema'));
8
+ add_action('amp_post_template_head', array($this, 'saswp_display_review_box_schema'));
9
+
10
  }
11
 
12
  public function saswp_review_display_via_shortcode($attr){
20
 
21
  }
22
 
23
+ }
24
+
25
+ public function saswp_display_review_box_schema(){
26
+
27
+ global $sd_data;
28
+ $author_id = get_the_author_meta('ID');
29
+
30
+ $author_details = get_avatar_data($author_id);
31
+ $date = get_the_date("Y-m-d\TH:i:s\Z");
32
+ $modified_date = get_the_modified_date("Y-m-d\TH:i:s\Z");
33
+ $aurthor_name = get_the_author();
34
+
35
+ if(!$aurthor_name){
36
+
37
+ $author_id = get_post_field ('post_author', get_the_ID());
38
+ $aurthor_name = get_the_author_meta( 'display_name' , $author_id );
39
+
40
+ }
41
+ $saswp_review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
42
+ $overall_rating = null;
43
+ if(isset($saswp_review_details['saswp-review-item-over-all'])){
44
+ $overall_rating = $saswp_review_details['saswp-review-item-over-all'];
45
+ }
46
+
47
+ if($overall_rating && isset($sd_data['saswp-review-module']) && $sd_data['saswp-review-module'] == 1){
48
+
49
+ $total_score = esc_attr(number_format((float)$overall_rating, 2, '.', ''));
50
+
51
+ $input1 = array(
52
+ '@context' => 'http://schema.org',
53
+ '@type' => 'Review',
54
+ 'dateCreated' => esc_html($date),
55
+ 'datePublished' => esc_html($date),
56
+ 'dateModified' => esc_html($modified_date),
57
+ 'headline' => get_the_title(),
58
+ 'name' => get_the_title(),
59
+ 'url' => get_permalink(),
60
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
61
+ 'copyrightYear' => get_the_time( 'Y' ),
62
+ 'author' => array(
63
+ '@type' => 'Person',
64
+ 'name' => esc_attr($aurthor_name),
65
+ 'image' => array(
66
+ '@type' => 'ImageObject',
67
+ 'url' => saswp_remove_warnings($author_details, 'url', 'saswp_string'),
68
+ 'height' => saswp_remove_warnings($author_details, 'height', 'saswp_string'),
69
+ 'width' => saswp_remove_warnings($author_details, 'width', 'saswp_string')
70
+ ),
71
+ ),
72
+
73
+ );
74
+
75
+ $input1['itemReviewed'] = array(
76
+ '@type' => 'Thing',
77
+ 'name' => get_the_title(),
78
+ );
79
+
80
+ $input1['reviewRating'] = array(
81
+ '@type' => 'Rating',
82
+ 'worstRating' => 1,
83
+ 'bestRating' => 5,
84
+ 'ratingValue' => esc_attr($total_score),
85
+ 'description' => strip_tags(get_post_meta( get_the_ID(), 'saswp-review-item-description', true )),
86
+ );
87
+
88
+ if(!empty($input1)){
89
+
90
+ echo '<!-- Schema & Structured Data For WP Review Module v'.esc_attr(SASWP_VERSION).' - -->';
91
+ echo "\n";
92
+ echo '<script type="application/ld+json">';
93
+ echo "\n";
94
+ echo json_encode($input1);
95
+ echo "\n";
96
+ echo '</script>';
97
+ echo "\n\n";
98
+
99
+ }
100
+
101
+
102
+ }
103
+
104
+
105
  }
106
 
107
  public function saswp_get_review_box_content(){
output/service.php CHANGED
@@ -842,8 +842,9 @@ Class saswp_output_service{
842
 
843
  $product_details['product_gtin8'] = $gtin;
844
 
845
- }
846
 
 
847
  $brand = get_post_meta($post_id, $key='hwp_product_brand', true);
848
 
849
  if($brand !=''){
@@ -852,34 +853,94 @@ Class saswp_output_service{
852
 
853
  }
854
 
855
- $product_image_id = $product->get_image_id();
856
-
857
- if($product_image_id){
858
 
859
- $image_details = wp_get_attachment_image_src($product_image_id, 'full');
860
-
861
  }
862
-
863
  $date_on_sale = $product->get_date_on_sale_to();
864
  $product_details['product_name'] = $product->get_title();
865
 
866
- $product_details['product_description'] = $product->get_short_description();
867
-
868
- if(!empty($image_details)){
869
-
870
- $product_details['product_image'] = array(
871
- '@type' => 'ImageObject',
872
- 'url' => $image_details[0],
873
- 'width' => $image_details[1],
874
- 'height' => $image_details[2]
875
- );
876
 
877
  }else{
878
 
879
- $product_details['product_image'] = '';
880
-
881
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
882
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
883
  if(strtolower( $product->get_stock_status() ) == 'onbackorder'){
884
  $product_details['product_availability'] = 'PreOrder';
885
  }else{
@@ -995,9 +1056,7 @@ Class saswp_output_service{
995
  $dw_qa = array();
996
  $qa_page = array();
997
  $best_answer_id = '';
998
-
999
-
1000
-
1001
  $post_type = get_post_type($post_id);
1002
 
1003
  if($post_type =='dwqa-question' && isset($sd_data['saswp-dw-question-answer']) && $sd_data['saswp-dw-question-answer'] ==1 && is_plugin_active('dw-question-answer/dw-question-answer.php')){
@@ -1009,10 +1068,7 @@ Class saswp_output_service{
1009
  $best_answer_id = $post_meta['_dwqa_best_answer'][0];
1010
 
1011
  }
1012
-
1013
- $userid = get_post_field( 'post_author', $post_id );
1014
- $userinfo = get_userdata($userid);
1015
-
1016
  $dw_qa['@type'] = 'Question';
1017
  $dw_qa['name'] = get_the_title();
1018
  $dw_qa['upvoteCount'] = get_post_meta( $post_id, '_dwqa_votes', true );
@@ -1032,14 +1088,12 @@ Class saswp_output_service{
1032
 
1033
  }
1034
 
1035
- $dw_qa['dateCreated'] = get_the_date("Y-m-d\TH:i:s\Z");
1036
-
1037
- if($userinfo){
1038
-
1039
- $dw_qa['author'] = array('@type' => 'Person','name' =>$userinfo->data->user_nicename);
1040
-
1041
- }
1042
-
1043
  $dw_qa['answerCount'] = $post_meta['_dwqa_answers_count'][0];
1044
 
1045
  $args = array(
@@ -1086,10 +1140,8 @@ Class saswp_output_service{
1086
 
1087
  $qa_page['@context'] = 'http://schema.org';
1088
  $qa_page['@type'] = 'QAPage';
1089
- $qa_page['mainEntity'] = $dw_qa;
1090
-
1091
- }
1092
-
1093
  return $qa_page;
1094
  }
1095
 
@@ -1499,9 +1551,10 @@ Class saswp_output_service{
1499
  $input1 = array(
1500
  '@context' => 'http://schema.org',
1501
  '@type' => 'TechArticle',
 
1502
  'mainEntityOfPage' => get_permalink(),
1503
  'headline' => get_the_title(),
1504
- 'description' => strip_tags(get_the_excerpt()),
1505
  'datePublished' => esc_html($date),
1506
  'dateModified' => esc_html($modified_date),
1507
  'author' => array(
@@ -1527,9 +1580,10 @@ Class saswp_output_service{
1527
  $input1 = array(
1528
  '@context' => 'http://schema.org',
1529
  '@type' => 'Article',
 
1530
  'mainEntityOfPage' => get_permalink(),
1531
  'headline' => get_the_title(),
1532
- 'description' => strip_tags(get_the_excerpt()),
1533
  'datePublished' => esc_html($date),
1534
  'dateModified' => esc_html($modified_date),
1535
  'author' => array(
@@ -1560,15 +1614,16 @@ Class saswp_output_service{
1560
  $input1 = array(
1561
  '@context' => 'http://schema.org',
1562
  '@type' => 'WebPage' ,
 
1563
  'name' => get_the_title(),
1564
  'url' => get_permalink(),
1565
- 'description' => strip_tags(get_the_excerpt()),
1566
  'mainEntity' => array(
1567
  '@type' => 'Article',
1568
  'mainEntityOfPage' => get_permalink(),
1569
  'image' => esc_url($image_details[0]),
1570
  'headline' => get_the_title(),
1571
- 'description' => strip_tags(get_the_excerpt()),
1572
  'datePublished' => esc_html($date),
1573
  'dateModified' => esc_html($modified_date),
1574
  'author' => array(
@@ -1620,8 +1675,8 @@ Class saswp_output_service{
1620
  global $sd_data;
1621
  $input2 = array();
1622
  $image_id = get_post_thumbnail_id();
1623
- $image_details = wp_get_attachment_image_src($image_id, 'full');
1624
-
1625
  if( is_array($image_details) ){
1626
 
1627
 
@@ -1637,7 +1692,15 @@ Class saswp_output_service{
1637
 
1638
  if(isset($resize_image[0]) && isset($resize_image[1]) && isset($resize_image[2]) ){
1639
 
 
1640
  $input2['image'][$i]['@type'] = 'ImageObject';
 
 
 
 
 
 
 
1641
  $input2['image'][$i]['url'] = esc_url($resize_image[0]);
1642
  $input2['image'][$i]['width'] = esc_attr($resize_image[1]);
1643
  $input2['image'][$i]['height'] = esc_attr($resize_image[2]);
@@ -1654,17 +1717,38 @@ Class saswp_output_service{
1654
  }
1655
 
1656
  }else{
1657
-
1658
- $input2['image']['@type'] = 'ImageObject';
1659
- $input2['image']['url'] = esc_url($image_details[0]);
1660
- $input2['image']['width'] = esc_attr($image_details[1]);
1661
- $input2['image']['height'] = esc_attr($image_details[2]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1662
 
1663
  }
1664
 
1665
  if(empty($input2)){
1666
 
1667
  $input2['image']['@type'] = 'ImageObject';
 
1668
  $input2['image']['url'] = esc_url($image_details[0]);
1669
  $input2['image']['width'] = esc_attr($image_details[1]);
1670
  $input2['image']['height'] = esc_attr($image_details[2]);
@@ -1677,6 +1761,7 @@ Class saswp_output_service{
1677
  if(isset($sd_data['sd_default_image']['url']) && $sd_data['sd_default_image']['url'] !=''){
1678
 
1679
  $input2['image']['@type'] = 'ImageObject';
 
1680
  $input2['image']['url'] = esc_url($sd_data['sd_default_image']['url']);
1681
  $input2['image']['width'] = esc_attr($sd_data['sd_default_image_width']);
1682
  $input2['image']['height'] = esc_attr($sd_data['sd_default_image_height']);
842
 
843
  $product_details['product_gtin8'] = $gtin;
844
 
845
+ }
846
 
847
+ $brand = '';
848
  $brand = get_post_meta($post_id, $key='hwp_product_brand', true);
849
 
850
  if($brand !=''){
853
 
854
  }
855
 
856
+ if($brand == ''){
857
+
858
+ $product_details['product_brand'] = get_bloginfo();
859
 
 
 
860
  }
861
+
862
  $date_on_sale = $product->get_date_on_sale_to();
863
  $product_details['product_name'] = $product->get_title();
864
 
865
+ if($product->get_short_description()){
866
+
867
+ $product_details['product_description'] = $product->get_short_description();
868
+
869
+ }else if($product->get_description()){
870
+
871
+ $product_details['product_description'] = $product->get_description();
 
 
 
872
 
873
  }else{
874
 
875
+ $product_details['product_description'] = strip_tags(get_the_excerpt());
876
+
877
+ }
878
+
879
+ if($product->get_attributes()){
880
+
881
+ foreach ($product->get_attributes() as $attribute) {
882
+
883
+ if(strtolower($attribute['name']) == 'isbn'){
884
+
885
+ $product_details['product_isbn'] = $attribute['options'][0];
886
+
887
+ }
888
+ if(strtolower($attribute['name']) == 'mpn'){
889
+
890
+ $product_details['product_mpn'] = $attribute['options'][0];
891
+
892
+ }
893
+ if(strtolower($attribute['name']) == 'gtin8'){
894
+
895
+ $product_details['product_gtin8'] = $attribute['options'][0];
896
+
897
+ }
898
+ if(strtolower($attribute['name']) == 'brand'){
899
+
900
+ $product_details['product_brand'] = $attribute['options'][0];
901
+
902
+ }
903
+
904
+ }
905
+
906
+ }
907
+
908
+ $product_image_id = $product->get_image_id();
909
+
910
+ $image_list = array();
911
 
912
+ if($product_image_id){
913
+
914
+ $image_details = wp_get_attachment_image_src($product_image_id, 'full');
915
+
916
+ if(!empty($image_details)){
917
+
918
+ $size_array = array('full', 'large', 'medium', 'thumbnail');
919
+
920
+ for($i =0; $i< count($size_array); $i++){
921
+
922
+ $image_details = wp_get_attachment_image_src($product_image_id, $size_array[$i]);
923
+
924
+ if(!empty($image_details)){
925
+
926
+ $image_list['image'][$i]['@type'] = 'ImageObject';
927
+ $image_list['image'][$i]['url'] = esc_url($image_details[0]);
928
+ $image_list['image'][$i]['width'] = esc_attr($image_details[1]);
929
+ $image_list['image'][$i]['height'] = esc_attr($image_details[2]);
930
+
931
+ }
932
+
933
+ }
934
+
935
+ }
936
+
937
+ }
938
+
939
+ if(!empty($image_list)){
940
+
941
+ $product_details['product_image'] = $image_list;
942
+ }
943
+
944
  if(strtolower( $product->get_stock_status() ) == 'onbackorder'){
945
  $product_details['product_availability'] = 'PreOrder';
946
  }else{
1056
  $dw_qa = array();
1057
  $qa_page = array();
1058
  $best_answer_id = '';
1059
+
 
 
1060
  $post_type = get_post_type($post_id);
1061
 
1062
  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')){
1068
  $best_answer_id = $post_meta['_dwqa_best_answer'][0];
1069
 
1070
  }
1071
+
 
 
 
1072
  $dw_qa['@type'] = 'Question';
1073
  $dw_qa['name'] = get_the_title();
1074
  $dw_qa['upvoteCount'] = get_post_meta( $post_id, '_dwqa_votes', true );
1088
 
1089
  }
1090
 
1091
+ $dw_qa['dateCreated'] = get_the_date("Y-m-d\TH:i:s\Z");
1092
+ $dw_qa['author'] = array(
1093
+ '@type' => 'Person',
1094
+ 'name' =>saswp_get_the_author_name(),
1095
+ );
1096
+
 
 
1097
  $dw_qa['answerCount'] = $post_meta['_dwqa_answers_count'][0];
1098
 
1099
  $args = array(
1140
 
1141
  $qa_page['@context'] = 'http://schema.org';
1142
  $qa_page['@type'] = 'QAPage';
1143
+ $qa_page['mainEntity'] = $dw_qa;
1144
+ }
 
 
1145
  return $qa_page;
1146
  }
1147
 
1551
  $input1 = array(
1552
  '@context' => 'http://schema.org',
1553
  '@type' => 'TechArticle',
1554
+ '@id' => get_permalink().'/#techarticle',
1555
  'mainEntityOfPage' => get_permalink(),
1556
  'headline' => get_the_title(),
1557
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
1558
  'datePublished' => esc_html($date),
1559
  'dateModified' => esc_html($modified_date),
1560
  'author' => array(
1580
  $input1 = array(
1581
  '@context' => 'http://schema.org',
1582
  '@type' => 'Article',
1583
+ '@id' => get_permalink().'/#article',
1584
  'mainEntityOfPage' => get_permalink(),
1585
  'headline' => get_the_title(),
1586
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
1587
  'datePublished' => esc_html($date),
1588
  'dateModified' => esc_html($modified_date),
1589
  'author' => array(
1614
  $input1 = array(
1615
  '@context' => 'http://schema.org',
1616
  '@type' => 'WebPage' ,
1617
+ '@id' => get_permalink().'/#webpage',
1618
  'name' => get_the_title(),
1619
  'url' => get_permalink(),
1620
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
1621
  'mainEntity' => array(
1622
  '@type' => 'Article',
1623
  'mainEntityOfPage' => get_permalink(),
1624
  'image' => esc_url($image_details[0]),
1625
  'headline' => get_the_title(),
1626
+ 'description' => strip_tags(strip_shortcodes(get_the_excerpt())),
1627
  'datePublished' => esc_html($date),
1628
  'dateModified' => esc_html($modified_date),
1629
  'author' => array(
1675
  global $sd_data;
1676
  $input2 = array();
1677
  $image_id = get_post_thumbnail_id();
1678
+ $image_details = wp_get_attachment_image_src($image_id, 'full');
1679
+
1680
  if( is_array($image_details) ){
1681
 
1682
 
1692
 
1693
  if(isset($resize_image[0]) && isset($resize_image[1]) && isset($resize_image[2]) ){
1694
 
1695
+
1696
  $input2['image'][$i]['@type'] = 'ImageObject';
1697
+
1698
+ if($i == 0){
1699
+
1700
+ $input2['image'][$i]['@id'] = get_permalink().'#primaryimage';
1701
+
1702
+ }
1703
+
1704
  $input2['image'][$i]['url'] = esc_url($resize_image[0]);
1705
  $input2['image'][$i]['width'] = esc_attr($resize_image[1]);
1706
  $input2['image'][$i]['height'] = esc_attr($resize_image[2]);
1717
  }
1718
 
1719
  }else{
1720
+
1721
+ $size_array = array('full', 'large', 'medium', 'thumbnail');
1722
+
1723
+ for($i =0; $i< count($size_array); $i++){
1724
+
1725
+ $image_details = wp_get_attachment_image_src($image_id, $size_array[$i]);
1726
+
1727
+ if(!empty($image_details)){
1728
+
1729
+ $input2['image'][$i]['@type'] = 'ImageObject';
1730
+
1731
+ if($i == 0){
1732
+
1733
+ $input2['image'][$i]['@id'] = get_permalink().'#primaryimage';
1734
+
1735
+ }
1736
+
1737
+ $input2['image'][$i]['url'] = esc_url($image_details[0]);
1738
+ $input2['image'][$i]['width'] = esc_attr($image_details[1]);
1739
+ $input2['image'][$i]['height'] = esc_attr($image_details[2]);
1740
+
1741
+ }
1742
+
1743
+
1744
+ }
1745
 
1746
  }
1747
 
1748
  if(empty($input2)){
1749
 
1750
  $input2['image']['@type'] = 'ImageObject';
1751
+ $input2['image']['@id'] = get_permalink().'#primaryimage';
1752
  $input2['image']['url'] = esc_url($image_details[0]);
1753
  $input2['image']['width'] = esc_attr($image_details[1]);
1754
  $input2['image']['height'] = esc_attr($image_details[2]);
1761
  if(isset($sd_data['sd_default_image']['url']) && $sd_data['sd_default_image']['url'] !=''){
1762
 
1763
  $input2['image']['@type'] = 'ImageObject';
1764
+ $input2['image']['@id'] = get_permalink().'#primaryimage';
1765
  $input2['image']['url'] = esc_url($sd_data['sd_default_image']['url']);
1766
  $input2['image']['width'] = esc_attr($sd_data['sd_default_image_width']);
1767
  $input2['image']['height'] = esc_attr($sd_data['sd_default_image_height']);
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: magazine3
3
  Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
4
  Requires at least: 3.0
5
- Tested up to: 5.1
6
- Stable tag: 1.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -66,6 +66,29 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
66
  == Changelog ==
67
 
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  = 1.7 (24 April 2019) =
70
 
71
  * Added: Option to enable and disable website schema markup #225
2
  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
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
66
  == Changelog ==
67
 
68
 
69
+ = 1.8 (08 May 2019) =
70
+
71
+ * New Feature: Google Reviews and its schema markup (Users can list their business reviews from google reviews using place id) #61
72
+ * Added: New docs link in the plugin and everywhere #202
73
+ * Added: Review Module Schema markup has been added #205
74
+ * Added: Defragment Schema (Merge all the schema markup in one markup) #223
75
+ * Added: "Need Help" label in default data
76
+ * Added: Option to to add schema markup in (header or footer) #165
77
+ * Changes: PRE Release Checklist (Settings panel has many improvement with new tabs) #236
78
+ * Bug Fixed: Missing Field “mainEntity.author in Q&A schema after Update #191
79
+ * Bug Fixed: The property aggregateRating is not recognised by Google for an object of type Thing in course schema type #194
80
+ * Bug Fixed: The description is required for VideoObject schema type on homepage #195
81
+ * Bug Fixed: Review Module Schema is not generating in the backend #205
82
+ * Bug Fixed: Missing attributes have been added for the product schema generating from WooCommerce #205
83
+ * Bug Fixed: Error in Article schema automatically generate by Yoast SEO in non-amp #231
84
+ * Bug Fixed: Issue in the selecting the organisation type as twice, generating an error. #234
85
+ * Bug Fixed: Debug errors after Version 1.7 #240
86
+ * Bug Fixed: In AMP's Home page Breadcrumb scheme markup is generating two item list #244
87
+ * Bug Fixed: Remove shortcode from schema markup description #250
88
+ * Bug Fixed: Notification Improvements #239
89
+ * Bug Fixed: The Support tab Email changes #238
90
+
91
+
92
  = 1.7 (24 April 2019) =
93
 
94
  * Added: Option to enable and disable website schema markup #225
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.7
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.7');
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,11 @@ if(! defined('SASWP_ITEM_FOLDER_NAME')){
23
  define( 'SASWP_ITEM_FOLDER_NAME', $folderName );
24
  }
25
  define('SASWP_PLUGIN_URL', plugin_dir_url( __FILE__ ));
 
 
 
 
 
26
  // including the output file
27
  require_once SASWP_DIR_NAME .'/output/function.php';
28
  require_once SASWP_DIR_NAME .'/output/output.php';
@@ -68,7 +73,18 @@ require_once SASWP_DIR_NAME.'/view/post_specific.php';
68
  require_once SASWP_DIR_NAME.'/view/review.php';
69
  require_once SASWP_DIR_NAME.'/output/review-output.php';
70
  require_once SASWP_DIR_NAME.'/output/service.php';
 
 
71
 
 
 
 
 
 
 
 
 
 
72
 
73
  /**
74
  * set user defined message on plugin activate
@@ -85,14 +101,25 @@ function saswp_admin_notice_activation_hook() {
85
  add_action( 'admin_notices', 'saswp_admin_notice' );
86
 
87
  function saswp_admin_notice(){
 
 
 
 
 
 
 
88
 
89
  $nonce = wp_create_nonce( 'saswp_install_wizard_nonce' );
90
 
91
  $setup_notice = '<div class="updated notice is-dismissible message notice notice-alt saswp-setup-notice">'
92
- . '<p><span class="dashicons dashicons-thumbs-up"></span>'
93
- . esc_html__('Thank you for using Schema & Structured Data For WP plugin!', 'schema-and-structured-data-for-wp')
94
- . ' <a href="'.esc_url(admin_url( 'plugins.php?page=saswp-setup-wizard' ).'&_saswp_nonce='.$nonce).'">'
95
- . esc_html__('Start Quick Setup', 'schema-and-structured-data-for-wp')
 
 
 
 
96
  . '</a>'
97
  . '</p>'
98
  . '</div>';
@@ -106,11 +133,11 @@ function saswp_admin_notice(){
106
 
107
  }
108
 
109
- $current_screen = get_Current_screen();
110
  $post_type = get_post_type();
111
  $sd_data = get_option('sd_data');
112
 
113
- if(($post_type == 'saswp' || $current_screen->id =='saswp_page_structured_data_options') && !isset($sd_data['sd_initial_wizard_status'])){
114
 
115
  echo $setup_notice;
116
 
@@ -134,7 +161,7 @@ function saswp_admin_notice(){
134
  <?php
135
  }
136
 
137
- if(isset($sd_data['sd_default_image']['url']) && $sd_data['sd_default_image']['url'] == ''){
138
 
139
  ?>
140
  <div class="updated notice is-dismissible message notice notice-alt saswp-feedback-notice">
@@ -155,9 +182,12 @@ add_filter('plugin_row_meta' , 'saswp_add_plugin_meta_links', 10, 2);
155
  function saswp_add_plugin_meta_links($meta_fields, $file) {
156
 
157
  if ( plugin_basename(__FILE__) == $file ) {
 
158
  $plugin_url = "https://wordpress.org/support/plugin/schema-and-structured-data-for-wp";
159
- $hire_url = "https://ampforwp.com/hire/";
160
- $meta_fields[] = "<a href='" . esc_url($plugin_url) . "' target='_blank'>" . esc_html__('Support Forum', 'schema-and-structured-data-for-wp') . "</a>";
 
 
161
  $meta_fields[] = "<a href='" . esc_url($hire_url) . "' target='_blank'>" . esc_html__('Hire Us', 'schema-and-structured-data-for-wp') . "</a>";
162
  $meta_fields[] = "<a href='" . esc_url($plugin_url) . "/reviews#new-post' target='_blank' title='" . esc_html__('Rate', 'schema-and-structured-data-for-wp') . "'>
163
  <i class='saswp-wdi-rate-stars'>"
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
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');
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
+
27
+ //define('SASWP_EDD_SL_ITEM_ID', plugin_dir_url( __FILE__ ));
28
+ define('SASWP_EDD_STORE_URL', 'http://accounts.structured-data-for-wp.com/');
29
+ //define('SASWP_EDD_DATA_ITEM_NAME', 'Cooked compatibility for Schema' );
30
+
31
  // including the output file
32
  require_once SASWP_DIR_NAME .'/output/function.php';
33
  require_once SASWP_DIR_NAME .'/output/output.php';
73
  require_once SASWP_DIR_NAME.'/view/review.php';
74
  require_once SASWP_DIR_NAME.'/output/review-output.php';
75
  require_once SASWP_DIR_NAME.'/output/service.php';
76
+ //Google Review Files
77
+
78
 
79
+ global $sd_data;
80
+ if(isset($sd_data['saswp-google-review']) && $sd_data['saswp-google-review'] == 1){
81
+
82
+ require_once SASWP_DIR_NAME.'/google_review/google_review.php';
83
+ require_once SASWP_DIR_NAME.'/google_review/google_review_page.php';
84
+ require_once SASWP_DIR_NAME.'/google_review/google_review_setup.php';
85
+ require_once SASWP_DIR_NAME.'/google_review/google_review_widget.php';
86
+
87
+ }
88
 
89
  /**
90
  * set user defined message on plugin activate
101
  add_action( 'admin_notices', 'saswp_admin_notice' );
102
 
103
  function saswp_admin_notice(){
104
+
105
+ $screen_id = '';
106
+ $current_screen = get_current_screen();
107
+
108
+ if(is_object($current_screen)){
109
+ $screen_id = $current_screen->id;
110
+ }
111
 
112
  $nonce = wp_create_nonce( 'saswp_install_wizard_nonce' );
113
 
114
  $setup_notice = '<div class="updated notice is-dismissible message notice notice-alt saswp-setup-notice">'
115
+ . '<p>'
116
+ . '<strong>'.esc_html__('Welcome to Schema & Structured Data For WP', 'schema-and-structured-data-for-wp').'</strong>'
117
+ .' - '.esc_html__('You are almost ready', 'schema-and-structured-data-for-wp')
118
+ . ' <a class="button button-primary" href="'.esc_url(admin_url( 'plugins.php?page=saswp-setup-wizard' ).'&_saswp_nonce='.$nonce).'">'
119
+ . esc_html__('Run the Setup Wizard', 'schema-and-structured-data-for-wp')
120
+ . '</a> '
121
+ .'<a class="button button-primary saswp-skip-button">'
122
+ . esc_html__('Skip Setup', 'schema-and-structured-data-for-wp')
123
  . '</a>'
124
  . '</p>'
125
  . '</div>';
133
 
134
  }
135
 
136
+
137
  $post_type = get_post_type();
138
  $sd_data = get_option('sd_data');
139
 
140
+ if(($post_type == 'saswp' || $screen_id =='saswp_page_structured_data_options') && !isset($sd_data['sd_initial_wizard_status'])){
141
 
142
  echo $setup_notice;
143
 
161
  <?php
162
  }
163
 
164
+ if(isset($sd_data['sd_default_image']['url']) && $sd_data['sd_default_image']['url'] == '' && ($screen_id =='saswp_page_structured_data_options' ||$screen_id == 'plugins' || $screen_id =='edit-saswp' || $screen_id == 'saswp')){
165
 
166
  ?>
167
  <div class="updated notice is-dismissible message notice notice-alt saswp-feedback-notice">
182
  function saswp_add_plugin_meta_links($meta_fields, $file) {
183
 
184
  if ( plugin_basename(__FILE__) == $file ) {
185
+
186
  $plugin_url = "https://wordpress.org/support/plugin/schema-and-structured-data-for-wp";
187
+ $hire_url = "https://ampforwp.com/hire/";
188
+ $forum_url = "http://structured-data-for-wp.com/forum/";
189
+
190
+ $meta_fields[] = "<a href='" . esc_url($forum_url) . "' target='_blank'>" . esc_html__('Support Forum', 'schema-and-structured-data-for-wp') . "</a>";
191
  $meta_fields[] = "<a href='" . esc_url($hire_url) . "' target='_blank'>" . esc_html__('Hire Us', 'schema-and-structured-data-for-wp') . "</a>";
192
  $meta_fields[] = "<a href='" . esc_url($plugin_url) . "/reviews#new-post' target='_blank' title='" . esc_html__('Rate', 'schema-and-structured-data-for-wp') . "'>
193
  <i class='saswp-wdi-rate-stars'>"
view/post_specific.php CHANGED
@@ -10,7 +10,8 @@ class saswp_post_specific {
10
 
11
  public function saswp_post_specific_hooks(){
12
 
13
- $this->saswp_get_all_schema_list();
 
14
  add_action( 'add_meta_boxes', array( $this, 'saswp_post_specifc_add_meta_boxes' ) );
15
  add_action( 'save_post', array( $this, 'saswp_post_specific_save_fields' ) );
16
  add_action( 'wp_ajax_saswp_get_sub_business_ajax', array($this,'saswp_get_sub_business_ajax'));
@@ -61,19 +62,24 @@ class saswp_post_specific {
61
 
62
  public function saswp_get_all_schema_list(){
63
 
64
- if($this->all_schema == null){
 
 
 
 
65
 
66
- $all_schema = get_posts(
67
- array(
68
- 'post_type' => 'saswp',
69
- 'posts_per_page' => -1,
70
- 'post_status' => 'publish',
71
- )
72
- );
73
-
74
- $this->all_schema = $all_schema;
75
- }
76
-
 
77
  }
78
 
79
  public function saswp_post_specifc_add_meta_boxes($post) {
10
 
11
  public function saswp_post_specific_hooks(){
12
 
13
+ add_action( 'admin_init', array( $this, 'saswp_get_all_schema_list' ) );
14
+
15
  add_action( 'add_meta_boxes', array( $this, 'saswp_post_specifc_add_meta_boxes' ) );
16
  add_action( 'save_post', array( $this, 'saswp_post_specific_save_fields' ) );
17
  add_action( 'wp_ajax_saswp_get_sub_business_ajax', array($this,'saswp_get_sub_business_ajax'));
62
 
63
  public function saswp_get_all_schema_list(){
64
 
65
+ global $pagenow;
66
+
67
+ if($pagenow == 'post.php' || $pagenow == 'admin-ajax.php'){
68
+
69
+ if($this->all_schema == null){
70
 
71
+ $all_schema = get_posts(
72
+ array(
73
+ 'post_type' => 'saswp',
74
+ 'posts_per_page' => -1,
75
+ 'post_status' => 'publish',
76
+ )
77
+ );
78
+
79
+ $this->all_schema = $all_schema;
80
+ }
81
+
82
+ }
83
  }
84
 
85
  public function saswp_post_specifc_add_meta_boxes($post) {