PluginProbe
Translate and boost SEO – Automatic AI translation – wpLingua / 2.16.8
Translate and boost SEO – Automatic AI translation – wpLingua v2.16.8
2.16.8 2.16.7 2.16.6 2.16.5 2.16.4 2.16.3 2.16.2 2.16.1 2.16.0 2.15.2 2.15.1 2.15.0 2.14.3 2.14.2 2.14.1 2.14.0 2.13.1 2.13.0 2.12.3 2.12.2 2.12.1 trunk 1.0.3 1.0.4 1.0.5 All 113 releases
← All changes | inc/admin/option-page.php +111 -115 2.16.62.16.8 View file →
@@ -51,23 +51,23 @@
51 51 * wpLingua's hidden option pages.
52 52 */
53 53 function wplng_is_wplingua_settings_page() {
54 54
55 - if ( empty( $_GET['page'] ) ) {
56 - return false;
57 - }
55 + if ( empty( $_GET['page'] ) ) {
56 + return false;
57 + }
58 58
59 - return in_array(
60 - sanitize_key( $_GET['page'] ),
61 - array(
62 - 'wplingua-settings',
63 - 'wplingua-switcher',
64 - 'wplingua-exclusions',
65 - 'wplingua-dictionary',
66 - 'wplingua-link-media',
67 - ),
68 - true
69 - );
59 + return in_array(
60 + sanitize_key( $_GET['page'] ),
61 + array(
62 + 'wplingua-settings',
63 + 'wplingua-switcher',
64 + 'wplingua-exclusions',
65 + 'wplingua-dictionary',
66 + 'wplingua-link-media',
67 + ),
68 + true
69 + );
70 70 }
71 71
72 72
73 73 /**
@@ -154,104 +154,101 @@
154 154 * Create wpLingua admin menu.
155 155 */
156 156 function wplng_create_menu() {
157 157
158 - /*
159 - * Main wpLingua menu
160 - */
161 - add_menu_page(
162 - __( 'wpLingua: Settings', 'wplingua' ),
163 - __( 'wpLingua', 'wplingua' ),
164 - 'edit_posts',
165 - 'wplingua-settings',
166 - '',
167 - 'dashicons-translation',
168 - 31
169 - );
158 + /*
159 + * Main wpLingua menu
160 + */
161 + add_menu_page(
162 + __( 'wpLingua: Settings', 'wplingua' ),
163 + __( 'wpLingua', 'wplingua' ),
164 + 'edit_posts',
165 + 'wplingua-settings',
166 + '',
167 + 'dashicons-translation',
168 + 31
169 + );
170 170
171 + /*
172 + * Settings
173 + *
174 + * This is the visible entry used as the parent
175 + * for all wpLingua option pages.
176 + */
177 + add_submenu_page(
178 + 'wplingua-settings',
179 + __( 'wpLingua: Settings', 'wplingua' ),
180 + __( 'Settings', 'wplingua' ),
181 + 'edit_posts',
182 + 'wplingua-settings',
183 + 'wplng_option_page_settings'
184 + );
171 185
172 - /*
173 - * Settings
174 - *
175 - * This is the visible entry used as the parent
176 - * for all wpLingua option pages.
177 - */
178 - add_submenu_page(
179 - 'wplingua-settings',
180 - __( 'wpLingua: Settings', 'wplingua' ),
181 - __( 'Settings', 'wplingua' ),
182 - 'edit_posts',
183 - 'wplingua-settings',
184 - 'wplng_option_page_settings'
185 - );
186 + /*
187 + * Hidden option pages
188 + *
189 + * These pages remain registered as children of
190 + * wplingua-settings, but their menu entries are
191 + * hidden later with CSS.
192 + */
186 193
194 + add_submenu_page(
195 + 'wplingua-settings',
196 + __( 'wpLingua: Switcher', 'wplingua' ),
197 + __( 'Switcher', 'wplingua' ),
198 + 'edit_posts',
199 + 'wplingua-switcher',
200 + 'wplng_option_page_switcher'
201 + );
187 202
188 - /*
189 - * Hidden option pages
190 - *
191 - * These pages remain registered as children of
192 - * wplingua-settings, but their menu entries are
193 - * hidden later with CSS.
194 - */
203 + add_submenu_page(
204 + 'wplingua-settings',
205 + __( 'wpLingua: Exclusion', 'wplingua' ),
206 + __( 'Exclusion', 'wplingua' ),
207 + 'edit_posts',
208 + 'wplingua-exclusions',
209 + 'wplng_option_page_exclusions'
210 + );
195 211
196 - add_submenu_page(
197 - 'wplingua-settings',
198 - __( 'wpLingua: Switcher', 'wplingua' ),
199 - __( 'Switcher', 'wplingua' ),
200 - 'edit_posts',
201 - 'wplingua-switcher',
202 - 'wplng_option_page_switcher'
203 - );
212 + add_submenu_page(
213 + 'wplingua-settings',
214 + __( 'wpLingua: Dictionary', 'wplingua' ),
215 + __( 'Dictionary', 'wplingua' ),
216 + 'edit_posts',
217 + 'wplingua-dictionary',
218 + 'wplng_option_page_dictionary'
219 + );
204 220
205 - add_submenu_page(
206 - 'wplingua-settings',
207 - __( 'wpLingua: Exclusion', 'wplingua' ),
208 - __( 'Exclusion', 'wplingua' ),
209 - 'edit_posts',
210 - 'wplingua-exclusions',
211 - 'wplng_option_page_exclusions'
212 - );
221 + add_submenu_page(
222 + 'wplingua-settings',
223 + __( 'wplingua: Links & Medias', 'wplingua' ),
224 + __( 'Links & Medias', 'wplingua' ),
225 + 'edit_posts',
226 + 'wplingua-link-media',
227 + 'wplng_option_page_link_media'
228 + );
213 229
214 - add_submenu_page(
215 - 'wplingua-settings',
216 - __( 'wpLingua: Dictionary', 'wplingua' ),
217 - __( 'Dictionary', 'wplingua' ),
218 - 'edit_posts',
219 - 'wplingua-dictionary',
220 - 'wplng_option_page_dictionary'
221 - );
230 + /*
231 + * Visible custom post type pages
232 + */
222 233
223 - add_submenu_page(
224 - 'wplingua-settings',
225 - __( 'wplingua: Links & Medias', 'wplingua' ),
226 - __( 'Links & Medias', 'wplingua' ),
227 - 'edit_posts',
228 - 'wplingua-link-media',
229 - 'wplng_option_page_link_media'
230 - );
234 + add_submenu_page(
235 + 'wplingua-settings',
236 + __( 'wpLingua: Website slugs', 'wplingua' ),
237 + __( 'Website slugs', 'wplingua' ),
238 + 'edit_posts',
239 + 'edit.php?post_type=wplng_slug',
240 + false
241 + );
231 242
232 -
233 - /*
234 - * Visible custom post type pages
235 - */
236 -
237 - add_submenu_page(
238 - 'wplingua-settings',
239 - __( 'wpLingua: Website slugs', 'wplingua' ),
240 - __( 'Website slugs', 'wplingua' ),
241 - 'edit_posts',
242 - 'edit.php?post_type=wplng_slug',
243 - false
244 - );
245 -
246 - add_submenu_page(
247 - 'wplingua-settings',
248 - __( 'wpLingua: Translations', 'wplingua' ),
249 - __( 'All translations', 'wplingua' ),
250 - 'edit_posts',
251 - 'edit.php?post_type=wplng_translation',
252 - false
253 - );
243 + add_submenu_page(
244 + 'wplingua-settings',
245 + __( 'wpLingua: Translations', 'wplingua' ),
246 + __( 'All translations', 'wplingua' ),
247 + 'edit_posts',
248 + 'edit.php?post_type=wplng_translation',
249 + false
250 + );
254 251 }
255 252
256 253
257 254 /**
@@ -263,13 +260,13 @@
263 260 * @return string The parent menu file.
264 261 */
265 262 function wplng_option_page_parent_file( $parent_file ) {
266 263
267 - if ( wplng_is_wplingua_settings_page() ) {
268 - return 'wplingua-settings';
269 - }
264 + if ( wplng_is_wplingua_settings_page() ) {
265 + return 'wplingua-settings';
266 + }
270 267
271 - return $parent_file;
268 + return $parent_file;
272 269 }
273 270
274 271
275 272 /**
@@ -281,13 +278,13 @@
281 278 * @return string The submenu file.
282 279 */
283 280 function wplng_option_page_submenu_file( $submenu_file ) {
284 281
285 - if ( wplng_is_wplingua_settings_page() ) {
286 - return 'wplingua-settings';
287 - }
282 + if ( wplng_is_wplingua_settings_page() ) {
283 + return 'wplingua-settings';
284 + }
288 285
289 - return $submenu_file;
286 + return $submenu_file;
290 287 }
291 288
292 289
293 290 /**
@@ -298,9 +295,9 @@
298 295 * and remain correctly associated with the wpLingua menu.
299 296 */
300 297 function wplng_option_page_hide_submenu() {
301 298
302 - $css = '<style>';
299 + $css = '<style>';
303 300 $css .= '#adminmenu .wp-submenu a[href*="page=wplingua-switcher"], ';
304 301 $css .= '#adminmenu .wp-submenu a[href*="page=wplingua-exclusions"], ';
305 302 $css .= '#adminmenu .wp-submenu a[href*="page=wplingua-dictionary"], ';
306 303 $css .= '#adminmenu .wp-submenu a[href*="page=wplingua-link-media"] {';
@@ -843,10 +840,10 @@
843 840 return;
844 841 }
845 842
846 843 $data = wplng_get_api_data();
847 -
848 - if ( empty( $data['status'] )
844 +
845 + if ( empty( $data['status'] )
849 846 || $data['status'] === 'FREE'
850 847 ) {
851 848 return;
852 849 }
@@ -865,12 +862,11 @@
865 862 $html .= '</p>';
866 863 $html .= '<p>';
867 864 $html .= esc_html__( 'Download and install wpLingua PRO to access the features included with your wpLingua plan.', 'wplingua' );
868 865 $html .= '</p>';
869 -
870 866 $html .= '<br>';
871 867 $html .= '<a';
872 - $html .= ' href="https://wplingua.com/download/"';
868 + $html .= ' href="https://wplingua.com/download/#pro"';
873 869 $html .= ' target="_blank"';
874 870 $html .= ' rel="noopener noreferrer"';
875 871 $html .= ' class="button button-primary"';
876 872 $html .= '>';
@@ -878,5 +874,5 @@
878 874 $html .= '</a>';
879 875 $html .= '</div>'; // End .notice
880 876
881 877 echo $html;
882 -}
878 +}