Schema & Structured Data for WP & AMP - Version 1.0.4.1

Version Description

(17 November 2018) =

  • Bug Fixed: Load review css only when review is enable for that post. #67
  • Menified review css in amp to put under amp css limitation.
Download this release

Release Info

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

Code changes from version 1.0.4 to 1.0.4.1

admin_section/common-function.php CHANGED
@@ -9,6 +9,7 @@
9
  function saswp_import_all_settings_and_schema(){
10
  $url = get_option('saswp-file-upload_url');
11
  global $wpdb;
 
12
  if($url){
13
  $json_data = file_get_contents($url);
14
  $json_array = json_decode($json_data, true);
@@ -884,145 +885,153 @@ function saswp_frontend_enqueue(){
884
  }
885
  add_action( 'wp_enqueue_scripts', 'saswp_frontend_enqueue' );
886
 
887
- function saswp_enque_amp_script(){ ?>
888
- .saswp-pc-wrap{
889
- background-color: #004f74;
890
- padding: 15px;
891
- color: #fff;
892
- display: flex;
893
- width:auto;
894
- flex-wrap: wrap;
895
- margin-bottom: 20px;
896
- }
897
- .saswp-pc-wrap .saswp-lst span{
898
- font-size: 18px;
899
- font-weight: 500;
900
- margin-bottom: 10px;
901
- display: inline-block;
902
- line-height: 1.3;
903
- }
904
- .saswp-pc-wrap .saswp-lst{
905
- flex:1 0 42%;
906
- }
907
- .saswp-pc-wrap .saswp-lst ul{
908
- margin:0;
909
- }
910
- .saswp-pc-wrap .saswp-lst p{
911
- list-style-type: none;
912
- font-size: 15px;
913
- font-weight: lighter;
914
- line-height: 1.2;
915
- margin-bottom: 10px;
916
- position: relative;
917
- padding-left: 20px;
918
- color:#eee;
919
- }
920
- .saswp-pc-wrap .saswp-lst p:before{
921
- content: '';
922
- position: absolute;
923
- width: 8px;
924
- height: 8px;
925
- background-color: #ccc;
926
- left: 0px;
927
- top: 6px;
928
- border-radius: 10px;
929
- }
930
- .sgl .saswp-rvw {
931
- width: 100%;
932
- margin-bottom: 34px;
933
- font-size: 13px;
934
- border-bottom: 1px solid #ededed;
935
- }
936
- .saswp-rvw-hd span {
937
- background-color: #222;
938
- color: #fff;
939
- display: inline-block;
940
- font-size: 15px;
941
- line-height: 1.4;
942
- padding: 8px 12px 6px;
943
- margin: 26px 0px;
944
- }
945
- .saswp-rvw tbody{
946
- width:100%;
947
- display:inline-block;
948
- }
949
- .saswp-rvw td {
950
- padding: 7px 14px;
951
- }
952
- .sgl table td, .saswp-rvw td {
953
- border: 1px solid #ededed;
954
- }
955
- .saswp-rvw-sm span{
956
- background-color: #222;
957
- color: #fff;
958
- display: inline-block;
959
- padding: 8px 12px 6px;
960
- margin-bottom: 13px;
961
- position: relative;
962
- font-size: 15px;
963
- line-height: 1.2;
964
- }
965
- .saswp-rvw-fs {
966
- line-height: 1.5;
967
- font-size: 48px;
968
- font-weight: 600;
969
- margin-bottom: 5px;
970
- }
971
- .saswp-rvw-ov .ovs {
972
- font-size: 11px;
973
- font-weight:600;
974
- }
975
- .sgl .saswp-rvw tr td{
976
- background:#fff;
977
- width:100%;
978
- }
979
- .sgl .saswp-rvw tr:hover td {
980
- background-color: #fcfcfc;
981
- }
982
- .saswp-rvw .saswp-rvw-sm {
983
- padding: 21px 14px;
984
- }
985
- .str-ic{
986
- font-size: 18px;
987
- line-height: 1.2;
988
- }
989
- .saswp-rvw-str{
990
- display: inline-flex;
991
- width: 100%;
992
- }
993
- .saswp-rvw-ov{
994
- text-align:center;
995
- }
996
- .saswp-rvw-str .half-str{
997
- display:inline-block;
998
- width: 20px;
999
- height: 16px;
1000
- background-repeat: no-repeat;
1001
- background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA0ODIuMjA3IDQ4Mi4yMDciIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDQ4Mi4yMDcgNDgyLjIwNzsiIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIxNnB4IiBoZWlnaHQ9IjE2cHgiPgo8cGF0aCBkPSJNNDgyLjIwNywxODYuOTczbC0xNTkuNjk5LTMzLjcwNUwyNDEuMTA0LDExLjgwM2wtODEuNDA0LDE0MS40NjVMMCwxODYuOTczbDEwOS4zODgsMTIxLjEzNEw5Mi4wOTQsNDcwLjQwNGwxNDkuMDEtNjYuNiAgbDE0OS4wMSw2Ni42bC0xNy4yOTQtMTYyLjI5Nkw0ODIuMjA3LDE4Ni45NzN6IE0yNDEuMTA0LDM3MC45NDNWNzEuOTUzbDYyLjA5LDEwNy45TDQyNSwyMDUuNTYxbC04My40MzMsOTIuMzkzbDEzLjE5MSwxMjMuNzg4ICBMMjQxLjEwNCwzNzAuOTQzeiIgZmlsbD0iI2ZmZDcwMCIvPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);
1002
- }
1003
- .saswp-rvw-str .str-ic{
1004
- display:inline-block;
1005
- width: 20px;
1006
- height: 16px;
1007
- background-repeat: no-repeat;
1008
- 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==);
1009
- }
1010
- .saswp-rvw-str .df-clr{
1011
- display:inline-block;
1012
- width: 20px;
1013
- height: 16px;
1014
- background-repeat: no-repeat;
1015
- background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2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- margin-bottom:20px;
1023
- }
1024
- }
1025
- <?php
1026
-
 
 
 
 
 
 
 
 
1027
  }
1028
  add_action('amp_post_template_css','saswp_enque_amp_script');
9
  function saswp_import_all_settings_and_schema(){
10
  $url = get_option('saswp-file-upload_url');
11
  global $wpdb;
12
+ $result ='';
13
  if($url){
14
  $json_data = file_get_contents($url);
15
  $json_array = json_decode($json_data, true);
885
  }
886
  add_action( 'wp_enqueue_scripts', 'saswp_frontend_enqueue' );
887
 
888
+ function saswp_enque_amp_script(){
889
+ global $sd_data;
890
+ $saswp_review_details = esc_sql ( get_post_meta(get_the_ID(), 'saswp_review_details', true));
891
+ $saswp_review_item_enable = 0;
892
+ if(isset($saswp_review_details['saswp-review-item-enable'])){
893
+ $saswp_review_item_enable = $saswp_review_details['saswp-review-item-enable'];
894
+ }
895
+ if($sd_data['saswp-review-module']==1 && $saswp_review_item_enable ==1){
896
+ ?>
897
+ .saswp-pc-wrap{
898
+ background-color: #004f74;
899
+ padding: 15px;
900
+ color: #fff;
901
+ display: flex;
902
+ width:auto;
903
+ flex-wrap: wrap;
904
+ margin-bottom: 20px;
905
+ }
906
+ .saswp-pc-wrap .saswp-lst span{
907
+ font-size: 18px;
908
+ font-weight: 500;
909
+ margin-bottom: 10px;
910
+ display: inline-block;
911
+ line-height: 1.3;
912
+ }
913
+ .saswp-pc-wrap .saswp-lst{
914
+ flex:1 0 42%;
915
+ }
916
+ .saswp-pc-wrap .saswp-lst ul{
917
+ margin:0;
918
+ }
919
+ .saswp-pc-wrap .saswp-lst p{
920
+ list-style-type: none;
921
+ font-size: 15px;
922
+ font-weight: lighter;
923
+ line-height: 1.2;
924
+ margin-bottom: 10px;
925
+ position: relative;
926
+ padding-left: 20px;
927
+ color:#eee;
928
+ }
929
+ .saswp-pc-wrap .saswp-lst p:before{
930
+ content: '';
931
+ position: absolute;
932
+ width: 8px;
933
+ height: 8px;
934
+ background-color: #ccc;
935
+ left: 0px;
936
+ top: 6px;
937
+ border-radius: 10px;
938
+ }
939
+ .sgl .saswp-rvw {
940
+ width: 100%;
941
+ margin-bottom: 34px;
942
+ font-size: 13px;
943
+ border-bottom: 1px solid #ededed;
944
+ }
945
+ .saswp-rvw-hd span {
946
+ background-color: #222;
947
+ color: #fff;
948
+ display: inline-block;
949
+ font-size: 15px;
950
+ line-height: 1.4;
951
+ padding: 8px 12px 6px;
952
+ margin: 26px 0px;
953
+ }
954
+ .saswp-rvw tbody{
955
+ width:100%;
956
+ display:inline-block;
957
+ }
958
+ .saswp-rvw td {
959
+ padding: 7px 14px;
960
+ }
961
+ .sgl table td, .saswp-rvw td {
962
+ border: 1px solid #ededed;
963
+ }
964
+ .saswp-rvw-sm span{
965
+ background-color: #222;
966
+ color: #fff;
967
+ display: inline-block;
968
+ padding: 8px 12px 6px;
969
+ margin-bottom: 13px;
970
+ position: relative;
971
+ font-size: 15px;
972
+ line-height: 1.2;
973
+ }
974
+ .saswp-rvw-fs {
975
+ line-height: 1.5;
976
+ font-size: 48px;
977
+ font-weight: 600;
978
+ margin-bottom: 5px;
979
+ }
980
+ .saswp-rvw-ov .ovs {
981
+ font-size: 11px;
982
+ font-weight:600;
983
+ }
984
+ .sgl .saswp-rvw tr td{
985
+ background:#fff;
986
+ width:100%;
987
+ }
988
+ .sgl .saswp-rvw tr:hover td {
989
+ background-color: #fcfcfc;
990
+ }
991
+ .saswp-rvw .saswp-rvw-sm {
992
+ padding: 21px 14px;
993
+ }
994
+ .str-ic{
995
+ font-size: 18px;
996
+ line-height: 1.2;
997
+ }
998
+ .saswp-rvw-str{
999
+ display: inline-flex;
1000
+ width: 100%;
1001
+ }
1002
+ .saswp-rvw-ov{
1003
+ text-align:center;
1004
+ }
1005
+ .saswp-rvw-str .half-str{
1006
+ display:inline-block;
1007
+ width: 20px;
1008
+ height: 16px;
1009
+ background-repeat: no-repeat;
1010
+ background-image: url(<?php echo SASWP_DIR_URI.'/admin_section/images/half_star.png'; ?>);
1011
+ }
1012
+ .saswp-rvw-str .str-ic{
1013
+ display:inline-block;
1014
+ width: 20px;
1015
+ height: 16px;
1016
+ background-repeat: no-repeat;
1017
+ background-image: url(<?php echo SASWP_DIR_URI.'/admin_section/images/full_star.png'; ?>);
1018
+ }
1019
+ .saswp-rvw-str .df-clr{
1020
+ display:inline-block;
1021
+ width: 20px;
1022
+ height: 16px;
1023
+ background-repeat: no-repeat;
1024
+ background-image: url(<?php echo SASWP_DIR_URI.'/admin_section/images/blank_star.png'; ?>);
1025
+ }
1026
+ @media(max-width:500px){
1027
+ .saswp-pc-wrap{
1028
+ display:block;
1029
+ }
1030
+ .saswp-pc-wrap .saswp-lst{
1031
+ margin-bottom:20px;
1032
+ }
1033
+ }
1034
+ <?php
1035
+ }
1036
  }
1037
  add_action('amp_post_template_css','saswp_enque_amp_script');
admin_section/images/blank_star.png ADDED
Binary file
admin_section/images/full_star.png ADDED
Binary file
admin_section/images/half_star.png ADDED
Binary file
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mohammed_kaludi, ahmedkaludi, ampforwp
3
  Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
4
  Requires at least: 3.0
5
  Tested up to: 4.9.8
6
- Stable tag: 1.0.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -65,6 +65,11 @@ You can contact us from [here](http://structured-data-for-wp.com/contact-us/)
65
 
66
  == Changelog ==
67
 
 
 
 
 
 
68
  = 1.0.4 (16 November 2018) =
69
  * Major Feature: Post Specific Meta boxes to override the schemas on posts
70
  * Major Feature: Rich Snippets for Reviews and Ratings
3
  Tags: Schema, Structured Data, Google Snippets, Rich Snippets, Schema.org, SEO, AMP
4
  Requires at least: 3.0
5
  Tested up to: 4.9.8
6
+ Stable tag: 1.0.4.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
65
 
66
  == Changelog ==
67
 
68
+ = 1.0.4.1 (17 November 2018) =
69
+
70
+ * Bug Fixed: Load review css only when review is enable for that post. #67
71
+ * Menified review css in amp to put under amp css limitation.
72
+
73
  = 1.0.4 (16 November 2018) =
74
  * Major Feature: Post Specific Meta boxes to override the schemas on posts
75
  * Major Feature: Rich Snippets for Reviews and Ratings
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.0.4
6
  Text Domain: schema-and-structured-data-for-wp
7
  Author: Mohammed Kaludi, Ahmed Kaludi
8
  Author URI: http://structured-data-for-wp.com/
@@ -12,7 +12,7 @@ License: GPL2
12
  // Exit if accessed directly.
13
  if ( ! defined( 'ABSPATH' ) ) exit;
14
 
15
- define('SASWP_VERSION', '1.0.4');
16
  define('SASWP_DIR_NAME_FILE', __FILE__ );
17
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
18
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));
2
  /*
3
  Plugin Name: Schema & Structured Data for WP
4
  Description: Schema & Structured Data adds Google Rich Snippets markup according to Schema.org guidelines to structure your site for SEO. (AMP Compatible)
5
+ Version: 1.0.4.1
6
  Text Domain: schema-and-structured-data-for-wp
7
  Author: Mohammed Kaludi, Ahmed Kaludi
8
  Author URI: http://structured-data-for-wp.com/
12
  // Exit if accessed directly.
13
  if ( ! defined( 'ABSPATH' ) ) exit;
14
 
15
+ define('SASWP_VERSION', '1.0.4.1');
16
  define('SASWP_DIR_NAME_FILE', __FILE__ );
17
  define('SASWP_DIR_NAME', dirname( __FILE__ ));
18
  define('SASWP_DIR_URI', plugin_dir_url(__FILE__));