@@ -10,13 +10,13 @@ public function __construct(){
1010
1111 add_action (
1212 'admin_menu ' ,
13- array ($ this , 'menu ' )
13+ array ( $ this , 'menu ' )
1414 );
1515
1616
1717 add_action (
1818 'admin_init ' ,
19- array ($ this , 'save ' )
19+ array ( $ this , 'save ' )
2020 );
2121
2222 }
@@ -27,15 +27,15 @@ public function menu(){
2727
2828 add_options_page (
2929
30- 'StackVerify Connection ' ,
30+ esc_html__ ( 'StackVerify Connection ' , ' stackverify-connector ' ) ,
3131
32- 'StackVerify ' ,
32+ esc_html__ ( 'StackVerify ' , ' stackverify-connector ' ) ,
3333
3434 'manage_options ' ,
3535
3636 'stackverify ' ,
3737
38- array ($ this ,'page ' )
38+ array ( $ this , 'page ' )
3939
4040 );
4141
@@ -55,61 +55,29 @@ public function page(){
5555
5656 <div class="wrap" style="max-width: 800px; margin-top: 20px;">
5757
58- <!-- Saved Confirmation Notice -->
5958 <?php if ( isset ( $ _GET ['settings-updated ' ] ) && $ _GET ['settings-updated ' ] === 'true ' ) : ?>
6059 <div class="notice notice-success is-dismissible" style="margin: 0 0 20px 0; border-radius: 6px;">
61- <p>StackVerify connection saved successfully.</p>
60+ <p><?php echo esc_html__ ( ' StackVerify connection saved successfully. ' , ' stackverify-connector ' ); ?> </p>
6261 </div>
6362 <?php endif ; ?>
6463
65- <!-- Header Banner -->
66- <div style="
67- background: #ffffff;
68- padding: 24px 30px;
69- border-radius: 8px;
70- margin-bottom: 20px;
71- border: 1px solid #e2e8f0;
72- ">
73- <h1 style="
74- color: #1e293b;
75- margin: 0 0 8px 0;
76- font-size: 24px;
77- font-weight: 600;
78- ">
79- StackVerify Connector
64+ <div style="background: #ffffff; padding: 24px 30px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #e2e8f0;">
65+ <h1 style="color: #1e293b; margin: 0 0 8px 0; font-size: 24px; font-weight: 600;">
66+ <?php echo esc_html__ ( 'StackVerify Connector ' , 'stackverify-connector ' ); ?>
8067 </h1>
81-
82- <p style="
83- font-size: 14px;
84- color: #64748b;
85- margin: 0;
86- line-height: 1.5;
87- ">
88- Connect WordPress forms with StackVerify using WP Webhooks.
89- This connector adds StackVerify support while keeping your existing WP Webhooks setup unchanged.
68+ <p style="font-size: 14px; color: #64748b; margin: 0; line-height: 1.5;">
69+ <?php echo esc_html__ ( 'Connect WordPress forms with StackVerify using WP Webhooks. This connector adds StackVerify support while keeping your existing WP Webhooks setup unchanged. ' , 'stackverify-connector ' ); ?>
9070 </p>
9171 </div>
9272
93- <!-- Main Form Card -->
94- <div style="
95- background: #ffffff;
96- padding: 30px;
97- border-radius: 8px;
98- border: 1px solid #e2e8f0;
99- box-shadow: 0 1px 3px rgba(0,0,0,0.05);
100- ">
73+ <div style="background: #ffffff; padding: 30px; border-radius: 8px; border: 1px solid #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.05);">
10174
102- <h2 style="
103- font-size: 18px;
104- font-weight: 600;
105- color: #0f172a;
106- margin: 0 0 8px 0;
107- ">
108- Connection Settings
75+ <h2 style="font-size: 18px; font-weight: 600; color: #0f172a; margin: 0 0 8px 0;">
76+ <?php echo esc_html__ ( 'Connection Settings ' , 'stackverify-connector ' ); ?>
10977 </h2>
11078
11179 <p style="color: #64748b; font-size: 14px; margin-bottom: 24px;">
112- Enter your StackVerify Form ID to automatically send incoming form submissions to your StackVerify workflows.
80+ <?php echo esc_html__ ( ' Enter your StackVerify Form ID to automatically send incoming form submissions to your StackVerify workflows. ' , ' stackverify-connector ' ); ?>
11381 </p>
11482
11583 <form method="post" action="">
@@ -123,20 +91,20 @@ public function page(){
12391
12492 <div style="margin-bottom: 24px;">
12593 <label style="
126- display: block;
127- font-weight: 500;
128- color: #334155;
94+ display: block;
95+ font-weight: 500;
96+ color: #334155;
12997 margin-bottom: 8px;
13098 font-size: 14px;
13199 ">
132- StackVerify Form ID
100+ <?php echo esc_html__ ( ' StackVerify Form ID ' , ' stackverify-connector ' ); ?>
133101 </label>
134102
135- <input
136- type="text"
137- name="stackverify_form_id"
138- value="<?php echo esc_attr ($ form_id ); ?> "
139- placeholder="frm_ERex6qDoGF"
103+ <input
104+ type="text"
105+ name="stackverify_form_id"
106+ value="<?php echo esc_attr ( $ form_id ); ?> "
107+ placeholder="<?php echo esc_attr__ ( ' frm_ERex6qDoGF ' , ' stackverify-connector ' ); ?> "
140108 style="
141109 padding: 10px 14px;
142110 width: 100%;
@@ -151,13 +119,16 @@ public function page(){
151119 >
152120
153121 <p class="description" style="margin-top: 6px; color: #94a3b8; font-size: 12px;">
154- Example: <code>frm_ERex6qDoGF</code>
122+ <?php printf (
123+ esc_html__ ( 'Example: %s ' , 'stackverify-connector ' ),
124+ '<code>frm_ERex6qDoGF</code> '
125+ ); ?>
155126 </p>
156127 </div>
157128
158129 <?php
159130 submit_button (
160- 'Save StackVerify Connection ' ,
131+ esc_html__ ( 'Save StackVerify Connection ' , ' stackverify-connector ' ) ,
161132 'primary ' ,
162133 'submit ' ,
163134 true ,
@@ -171,7 +142,6 @@ public function page(){
171142
172143 </div>
173144
174- <!-- How It Works Section -->
175145 <div style="
176146 margin-top: 20px;
177147 padding: 24px;
@@ -185,20 +155,20 @@ public function page(){
185155 color: #1e293b;
186156 margin: 0 0 12px 0;
187157 ">
188- How StackVerify Connector Works
158+ <?php echo esc_html__ ( ' How StackVerify Connector Works ' , ' stackverify-connector ' ); ?>
189159 </h3>
190160
191161 <ol style="
192- margin: 0;
193- padding-left: 20px;
194- color: #475569;
162+ margin: 0;
163+ padding-left: 20px;
164+ color: #475569;
195165 font-size: 13px;
196166 line-height: 1.8;
197167 ">
198- <li>Your visitor submits a WordPress form.</li>
199- <li>WP Webhooks receives the form submission.</li>
200- <li>StackVerify Connector forwards the data to StackVerify.</li>
201- <li>StackVerify processes the submission and sends notifications.</li>
168+ <li><?php echo esc_html__ ( ' Your visitor submits a WordPress form. ' , ' stackverify-connector ' ); ?> </li>
169+ <li><?php echo esc_html__ ( ' WP Webhooks receives the form submission. ' , ' stackverify-connector ' ); ?> </li>
170+ <li><?php echo esc_html__ ( ' StackVerify Connector forwards the data to StackVerify. ' , ' stackverify-connector ' ); ?> </li>
171+ <li><?php echo esc_html__ ( ' StackVerify processes the submission and sends notifications. ' , ' stackverify-connector ' ); ?> </li>
202172 </ol>
203173 </div>
204174
@@ -215,28 +185,19 @@ public function save(){
215185
216186
217187 if (
218- !isset ($ _POST ['stackverify_nonce ' ])
188+ ! isset ( $ _POST ['stackverify_nonce ' ] )
219189 ){
220190 return ;
221191 }
222192
223193
224194
225- if (
226- !wp_verify_nonce (
227- sanitize_text_field ($ _POST ['stackverify_nonce ' ]),
228- 'stackverify_save '
229- )
230- ){
231-
232- return ;
233-
234- }
195+ check_admin_referer ( 'stackverify_save ' , 'stackverify_nonce ' );
235196
236197
237198
238199 if (
239- !current_user_can ('manage_options ' )
200+ ! current_user_can ( 'manage_options ' )
240201 ){
241202
242203 return ;
@@ -246,7 +207,7 @@ public function save(){
246207
247208
248209 if (
249- isset ($ _POST ['stackverify_form_id ' ])
210+ isset ( $ _POST ['stackverify_form_id ' ] )
250211 ){
251212
252213 update_option (
@@ -259,7 +220,6 @@ public function save(){
259220
260221 );
261222
262- // Redirect back to settings page with update confirmation argument
263223 wp_redirect (
264224 add_query_arg (
265225 array ( 'page ' => 'stackverify ' , 'settings-updated ' => 'true ' ),
0 commit comments