@@ -94,8 +94,9 @@ function rich_snippet_dashboard() {
94
94
<li><a href="#tab-4" class="nav-tab"> ' . esc_html__ ( 'Customization ' , 'rich-snippets ' ) . '</a></li>
95
95
96
96
<li><a href="#tab-3" class="nav-tab"> ' . esc_html__ ( 'FAQs ' , 'rich-snippets ' ) . '</a></li>
97
- <li><a href="#tab-5" class="nav-tab"> ' . esc_html__ ( 'Getting Started ' , 'rich-snippets ' ) . '</a></li>
98
- </ul>
97
+ <li><a href="#tab-5" class="nav-tab"> ' . esc_html__ ( 'Getting Started ' , 'rich-snippets ' ) . '</a></li>
98
+ <li><a href="#tab-6" class="nav-tab"> ' . esc_html__ ( 'Advanced Settings ' , 'rich-snippets ' ) . '</a></li>
99
+ </ul>
99
100
<div class="clear"></div>
100
101
<div class="panel-container bsf-panel">
101
102
<div id="tab-1">
@@ -843,11 +844,38 @@ function rich_snippet_dashboard() {
843
844
</div>
844
845
</div>
845
846
</div>
846
- </div>
847
+ </div>
848
+
849
+ <div id="tab-6">
850
+ <div id="poststuff">
851
+ <div id="postbox-container-18" class="postbox-container">
852
+ <div class="postbox">
853
+ <h3 class="hndle"><span> ' . esc_html__ ( 'Advanced Settings ' , 'rich-snippets ' ) . '</span></h3>
854
+ <div class="inside">
855
+ <form id="aiosrs_advanced_form" method="post">
856
+ <input type="hidden" name="aiosrs_advanced_nonce_field" value=" ' . esc_attr ( wp_create_nonce ( 'aiosrs_advanced_form_action ' ) ) . '" />
857
+ <table class="bsf_metabox">
858
+ <tr>
859
+ <td>
860
+ <label for="aiosrs_analytics_optin"> ' . esc_html__ ( 'Enable feature ' , 'rich-snippets ' ) . '</label>
861
+ <div class="bsf-tooltip"><span class="dashicons dashicons-info"></span><span class="bsf-tooltiptext"> ' . esc_html__ ( 'Share anonymous usage data to help improve the plugin. ' , 'rich-snippets ' ) . '</span></div>
862
+ <input style="margin-left:10px;" type="checkbox" name="aiosrs_analytics_optin" id="aiosrs_analytics_optin" value="yes" ' . checked ( 'yes ' , get_option ( 'aiosrs_analytics_optin ' , 'no ' ), false ) . ' />
863
+ </td>
864
+ </tr>
865
+ <tr>
866
+ <td><input type="submit" class="button-primary" name="aiosrs_advanced_submit" value=" ' . esc_html__ ( 'Save ' , 'rich-snippets ' ) . '" /></td>
867
+ </tr>
868
+ </table>
869
+ </form>
870
+ </div>
871
+ </div>
872
+ </div>
873
+ </div>
874
+ </div>
847
875
848
- </div>
849
- </div>
850
- <div class="postbox-container" id="bsf-postbox-container-1" >
876
+ </div>
877
+ </div>
878
+ <div class="postbox-container" id="bsf-postbox-container-1" >
851
879
<div id="side-sortables" class="meta-box-sortables ui-sortable">
852
880
<div class="postbox bsf-woocommerce-setting closed">
853
881
<button type="button" class="handlediv" aria-expanded="false"><span class="screen-reader-text"> ' . esc_html__ ( 'Toggle panel: Frontend Options ' , 'rich-snippets ' ) . '</span><span class="toggle-indicator" aria-hidden="true"></span></button>
@@ -871,13 +899,13 @@ function rich_snippet_dashboard() {
871
899
</table>
872
900
</form>
873
901
</div>
874
- </div> ' ;
902
+ </div> ' ;
875
903
876
- $ allowed_html = array (
877
- 'div ' => array (
878
- 'class ' => array (),
879
- 'id ' => array (),
880
- ),
904
+ $ allowed_html = array (
905
+ 'div ' => array (
906
+ 'class ' => array (),
907
+ 'id ' => array (),
908
+ ),
881
909
'button ' => array (
882
910
'type ' => array (),
883
911
'class ' => array (),
@@ -945,11 +973,12 @@ function rich_snippet_dashboard() {
945
973
jQuery("#postbox-container-7").css("width","35%");
946
974
jQuery("#postbox-container-8").css("width","35%");
947
975
jQuery("#postbox-container-9").css("width","35%");
948
- jQuery("#postbox-container-10").css("width","35%");
949
- jQuery("#postbox-container-11").css({"width":"87%","padding-right":"2%"});
950
- jQuery(".postbox h3").click( function() {
951
- jQuery(jQuery(this).parent().get(0)).toggleClass("closed");
952
- });
976
+ jQuery("#postbox-container-10").css("width","35%");
977
+ jQuery("#postbox-container-11").css({"width":"87%","padding-right":"2%"});
978
+ jQuery("#postbox-container-18").css({"width":"87%","padding-right":"2%"});
979
+ jQuery(".postbox h3").click( function() {
980
+ jQuery(jQuery(this).parent().get(0)).toggleClass("closed");
981
+ });
953
982
jQuery(".handlediv").click( function() {
954
983
jQuery(jQuery(this).parent().get(0)).toggleClass("closed");
955
984
});
@@ -1112,9 +1141,19 @@ function rich_snippet_dashboard() {
1112
1141
$ args [ $ option ] = sanitize_text_field ( $ _POST [ $ option ] );
1113
1142
}
1114
1143
}
1115
- $ status = update_option ( 'bsf_service ' , $ args );
1116
- display_status ( $ status );
1117
- }
1144
+ $ status = update_option ( 'bsf_service ' , $ args );
1145
+ display_status ( $ status );
1146
+ }
1147
+ }
1148
+ if ( isset ( $ _POST ['aiosrs_advanced_submit ' ] ) ) {
1149
+ if ( ! isset ( $ _POST ['aiosrs_advanced_nonce_field ' ] ) || ! wp_verify_nonce ( $ _POST ['aiosrs_advanced_nonce_field ' ], 'aiosrs_advanced_form_action ' ) || ! current_user_can ( 'manage_options ' ) ) {
1150
+ print 'Sorry, your nonce did not verify. ' ;
1151
+ exit ;
1152
+ } else {
1153
+ $ value = isset ( $ _POST ['aiosrs_analytics_optin ' ] ) ? 'yes ' : 'no ' ;
1154
+ $ status = update_option ( 'aiosrs_analytics_optin ' , $ value );
1155
+ display_status ( $ status );
1156
+ }
1118
1157
}
1119
1158
/**
1120
1159
* Display status.
0 commit comments