Skip to content

Commit c0eae07

Browse files
PR review changes
1 parent 59c5258 commit c0eae07

File tree

1 file changed

+14
-26
lines changed

1 file changed

+14
-26
lines changed

admin/index.php

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ function rich_snippet_dashboard() {
112112
<div class="table">
113113
<p>' . wp_kses_post( __( 'Strings to be displayed on frontend for <strong>Item Review Rich Snippets &mdash;</strong>', 'all-in-one-schemaorg-rich-snippets' ) ) . '</p>
114114
<form id="bsf_review_form" method="post">
115-
' . wp_nonce_field( 'snippet_review_form_action', 'snippet_review_nonce_field' ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
116-
. '
115+
<input type="hidden" id="snippet_review_nonce_field" name="snippet_review_nonce_field" value="' . esc_attr( wp_create_nonce( 'snippet_review_form_action' ) ) . '" />
117116
<table class="bsf_metabox">
118117
<tbody>
119118
<tr>
@@ -154,8 +153,7 @@ function rich_snippet_dashboard() {
154153
<div class="table">
155154
<p>' . wp_kses_post( __( 'Strings to be displayed on frontend for <strong>Events Rich Snippets &mdash;</strong>', 'all-in-one-schemaorg-rich-snippets' ) ) . '</p>
156155
<form id="bsf_event_form" method="post">
157-
' . wp_nonce_field( 'snippet_event_form_action', 'snippet_event_nonce_field' ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
158-
. '
156+
<input type="hidden" id="snippet_event_nonce_field" name="snippet_event_nonce_field" value="' . esc_attr( wp_create_nonce( 'snippet_event_form_action' ) ) . '">
159157
<table class="bsf_metabox">
160158
<tbody>
161159
<tr>
@@ -204,8 +202,7 @@ function rich_snippet_dashboard() {
204202
<div class="table">
205203
<p>' . wp_kses_post( __( "Strings to be displayed on frontend for <strong>Person's Rich Snippets &mdash;</strong>", 'all-in-one-schemaorg-rich-snippets' ) ) . '</p>
206204
<form id="bsf_person_form" method="post">
207-
' . wp_nonce_field( 'snippet_person_form_action', 'snippet_person_nonce_field' ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
208-
. '
205+
<input type="hidden" id="snippet_person_nonce_field" name="snippet_person_nonce_field" value="' . esc_attr( wp_create_nonce( 'snippet_person_form_action' ) ) . '">
209206
<table class="bsf_metabox">
210207
<tbody>
211208
<tr>
@@ -254,8 +251,7 @@ function rich_snippet_dashboard() {
254251
<div class="table">
255252
<p>' . wp_kses_post( __( 'Strings to be displayed on frontend for <strong>Product Rich Snippets &mdash;</strong>', 'all-in-one-schemaorg-rich-snippets' ) ) . '</p>
256253
<form id="bsf_product_form" method="post">
257-
' . wp_nonce_field( 'snippet_product_form_action', 'snippet_product_nonce_field' ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
258-
. '
254+
<input type="hidden" id="snippet_product_nonce_field" name="snippet_product_nonce_field" value="' . esc_attr( wp_create_nonce( 'snippet_product_form_action' ) ) . '">
259255
<table class="bsf_metabox">
260256
<tbody>
261257
<tr>
@@ -304,8 +300,7 @@ function rich_snippet_dashboard() {
304300
<div class="table">
305301
<p>' . wp_kses_post( __( 'Strings to be displayed on frontend for <strong>Recipe Rich Snippets &mdash;</strong>', 'all-in-one-schemaorg-rich-snippets' ) ) . '</p>
306302
<form id="bsf_recipe_form" method="post">
307-
' . wp_nonce_field( 'snippet_recipe_form_action', 'snippet_recipe_nonce_field' ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
308-
. '
303+
<input type="hidden" id="snippet_recipe_nonce_field" name="snippet_recipe_nonce_field" value="' . esc_attr( wp_create_nonce( 'snippet_recipe_form_action' ) ) . '">
309304
<table class="bsf_metabox">
310305
<tbody>
311306
<tr>
@@ -362,8 +357,7 @@ function rich_snippet_dashboard() {
362357
<div class="table">
363358
<p>' . wp_kses_post( __( 'Strings to be displayed on frontend for <strong>Software Application Rich Snippets &mdash;</strong>', 'all-in-one-schemaorg-rich-snippets' ) ) . '</p>
364359
<form id="bsf_software_form" method="post">
365-
' . wp_nonce_field( 'snippet_soft_app_form_action', 'snippet_soft_app_nonce_field' ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
366-
. '
360+
<input type="hidden" id="snippet_soft_app_nonce_field" name="snippet_soft_app_nonce_field" value="' . esc_attr( wp_create_nonce( 'snippet_soft_app_form_action' ) ) . '">
367361
<table class="bsf_metabox">
368362
<tbody>
369363
<tr>
@@ -414,8 +408,7 @@ function rich_snippet_dashboard() {
414408
<div class="table">
415409
<p>' . wp_kses_post( __( 'Strings to be displayed on frontend for <strong>Video Rich Snippets &mdash;</strong>', 'all-in-one-schemaorg-rich-snippets' ) ) . '</p>
416410
<form id="bsf_video_form" method="post">
417-
' . wp_nonce_field( 'snippet_video_form_action', 'snippet_video_nonce_field' )//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
418-
. '
411+
<input type="hidden" id="snippet_video_nonce_field" name="snippet_video_nonce_field" value="' . esc_attr( wp_create_nonce( 'snippet_video_form_action' ) ) . '">
419412
<table class="bsf_metabox">
420413
<tbody>
421414
<tr>
@@ -456,8 +449,7 @@ function rich_snippet_dashboard() {
456449
<div class="table">
457450
<p>' . wp_kses_post( __( 'Strings to be displayed on frontend for <strong>Article Rich Snippets &mdash;</strong>', 'all-in-one-schemaorg-rich-snippets' ) ) . '</p>
458451
<form id="bsf_article_form" method="post">
459-
' . wp_nonce_field( 'snippet_article_form_action', 'snippet_article_nonce_field' ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
460-
. '
452+
<input type="hidden" id="snippet_article_nonce_field" name="snippet_article_nonce_field" value="' . esc_attr( wp_create_nonce( 'snippet_article_form_action' ) ) . '">
461453
<table class="bsf_metabox">
462454
<tbody>
463455
<tr>
@@ -506,8 +498,7 @@ function rich_snippet_dashboard() {
506498
<div class="table">
507499
<p>' . wp_kses_post( __( 'Strings to be displayed on frontend for <strong>Service Rich Snippets &mdash;</strong>', 'all-in-one-schemaorg-rich-snippets' ) ) . '</p>
508500
<form id="bsf_service_form" method="post">
509-
' . wp_nonce_field( 'snippet_service_form_action', 'snippet_service_nonce_field' ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
510-
. '
501+
<input type="hidden" id="snippet_service_nonce_field" name="snippet_service_nonce_field" value="' . esc_attr( wp_create_nonce( 'snippet_service_form_action' ) ) . '">
511502
<table class="bsf_metabox">
512503
<tbody>
513504
<tr>
@@ -815,8 +806,7 @@ function rich_snippet_dashboard() {
815806
. '</h3>
816807
<div class="inside">
817808
<form id="bsf_css_editor" method="post" onsubmit="return false;" action="">
818-
' . wp_nonce_field( 'snippet_color_form_action', 'snippet_color_nonce_field' ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
819-
. '
809+
<input type="hidden" id="snippet_color_nonce_field" name="snippet_color_nonce_field" value="' . esc_attr( wp_create_nonce( 'snippet_color_form_action' ) ) . '">
820810
<table class="bsf_metabox">
821811
<tr>
822812
<th> <label for="snippet_box_bg"> ' . esc_html__( 'Box Background ', 'all-in-one-schemaorg-rich-snippets' ) . ' </label> </th>
@@ -864,8 +854,7 @@ function rich_snippet_dashboard() {
864854
<h3 class="get_in_touch">' . esc_html__( 'WooCommerce Configuration', 'all-in-one-schemaorg-rich-snippets' ) . '</h3>
865855
<div class="inside">
866856
<form id="bsf_css_editor" method="post" action="">
867-
' . wp_nonce_field( 'snippet_woocommerce_form_action', 'snippet_woocommerce_nonce_field' ) //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
868-
. '
857+
<input type="hidden" id="snippet_woocommerce_nonce_field" name="snippet_woocommerce_nonce_field" value="' . esc_attr( wp_create_nonce( 'snippet_woocommerce_form_action' ) ) . '">
869858
<p> ' . esc_html__( 'WooCommerce comes with Schema.org code by default and using our plugin on WooCommerce product pages does will add duplicate schema so it is not recommended. If you could still like to enable our plugin on WooCommerce products, please enable this option.', 'all-in-one-schemaorg-rich-snippets' ) . ' </p>
870859
<table class="bsf_metabox" > <input type="hidden" name="site_url" value="' . esc_url( site_url() ) . '" /> </p>
871860
<tr>
@@ -930,8 +919,7 @@ function rich_snippet_dashboard() {
930919
}
931920
}
932921
if ( isset( $_POST['item_submit'] ) ) {
933-
if ( ! isset( $_POST['snippet_review_nonce_field'] ) || ! wp_verify_nonce( $_POST['snippet_review_nonce_field'], 'snippet_review_form_action' || ! current_user_can( 'manage_options' ) )
934-
) {
922+
if ( ! isset( $_POST['snippet_review_nonce_field'] ) || ! wp_verify_nonce( $_POST['snippet_review_nonce_field'], 'snippet_review_form_action' ) || ! current_user_can( 'manage_options' ) ) {
935923
print 'Sorry, your nonce did not verify.';
936924
exit;
937925
} else {
@@ -1197,8 +1185,8 @@ function get_support() {
11971185
<button type="button" class="handlediv" aria-expanded="false"><span class="screen-reader-text">Toggle panel: Frontend Options</span><span class="toggle-indicator" aria-hidden="true"></span></button>
11981186
<h3 class="get_in_touch">' . esc_html__( 'Get in touch with the Plugin Developers', 'all-in-one-schemaorg-rich-snippets' ) . '</h3>
11991187
<div class="inside">
1200-
<form name="support" id="support_form" action="" method="post" onsubmit="return false;">'
1201-
. wp_nonce_field( 'aiosrs_support_form', 'aiosrs_support_form_nonce' ) . '
1188+
<form name="support" id="support_form" action="" method="post" onsubmit="return false;">
1189+
<input type="hidden" id="aiosrs_support_form_nonce" name="aiosrs_support_form_nonce" value="' . esc_attr( wp_create_nonce( 'aiosrs_support_form' ) ) . '" />
12021190
<p> ' . esc_html__( 'Just fill out the form below and your message will be emailed to the Plugin Developers.', 'all-in-one-schemaorg-rich-snippets' ) . ' </p>
12031191
<table class="bsf_metabox" > <input type="hidden" name="site_url" value="' . site_url() . '" /> </p>
12041192
<tr><td><label for="name"><strong>' . esc_html__( 'Your Name:', 'all-in-one-schemaorg-rich-snippets' ) . '<span style="color:red;"> *</span></strong> </label></td>

0 commit comments

Comments
 (0)