| @@ -28,24 +28,27 @@ | ||
| 28 | 28 | wplng_option_page_register(); |
| 29 | 29 | return; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | + $is_first = wplng_settings_part_first_use(); | |
| 33 | + $form_css = ''; | |
| 34 | + | |
| 35 | + if ( $is_first ) { | |
| 36 | + $form_css = 'display: none !important;'; | |
| 37 | + } | |
| 38 | + | |
| 32 | 39 | ?> |
| 33 | 40 | |
| 34 | - <h1 class="wplng-option-page-title"><span class="dashicons dashicons-translation"></span> <?php esc_html_e( 'wpLingua - General settings', 'wplingua' ); ?></h1> | |
| 35 | 41 | |
| 36 | 42 | <div class="wrap"> |
| 37 | - <hr class="wp-header-end"> | |
| 38 | - <?php | |
| 39 | 43 | |
| 40 | - $is_first = wplng_settings_part_first_use(); | |
| 41 | - $form_css = ''; | |
| 44 | + <header id="wplng-option-page-header"> | |
| 45 | + <h1 class="wplng-option-page-title"><span class="dashicons dashicons-translation"></span> <?php esc_html_e( 'wpLingua - General settings', 'wplingua' ); ?></h1> | |
| 46 | + <?php echo wplng_option_page_settings_menu( $is_first ); ?> | |
| 47 | + </header> | |
| 42 | 48 | |
| 43 | - if ( $is_first ) { | |
| 44 | - $form_css = 'display: none !important;'; | |
| 45 | - } | |
| 49 | + <hr class="wp-header-end"> | |
| 46 | 50 | |
| 47 | - ?> | |
| 48 | 51 | <form |
| 49 | 52 | method="post" |
| 50 | 53 | action="options.php" |
| 51 | 54 | id="wplng-option-settings-form" |
| @@ -58,15 +61,15 @@ | ||
| 58 | 61 | |
| 59 | 62 | <table class="form-table wplng-form-table"> |
| 60 | 63 | <tr> |
| 61 | 64 | <th scope="row"><span class="dashicons dashicons-location"></span> <?php esc_html_e( 'Website language', 'wplingua' ); ?></th> |
| 62 | - <td> | |
| 65 | + <td class="wplng-flex-container"> | |
| 63 | 66 | <?php wplng_settings_part_language_website(); ?> |
| 64 | 67 | </td> |
| 65 | 68 | </tr> |
| 66 | 69 | <tr> |
| 67 | 70 | <th scope="row"><span class="dashicons dashicons-location-alt"></span> <?php esc_html_e( 'Translated languages', 'wplingua' ); ?></th> |
| 68 | - <td> | |
| 71 | + <td class="wplng-flex-container"> | |
| 69 | 72 | <?php wplng_settings_part_languages_target(); ?> |
| 70 | 73 | </td> |
| 71 | 74 | </tr> |
| 72 | 75 | <tr> |
| @@ -73,23 +76,23 @@ | ||
| 73 | 76 | <th scope="row"><span class="dashicons dashicons-admin-settings"></span> <?php esc_html_e( 'Features', 'wplingua' ); ?></th> |
| 74 | 77 | <td> |
| 75 | 78 | <fieldset> |
| 76 | 79 | <?php wplng_settings_part_features_api(); ?> |
| 77 | - <br><br><hr> | |
| 80 | + <br><hr> | |
| 78 | 81 | <?php wplng_settings_part_features_seo(); ?> |
| 79 | - <br><br><hr> | |
| 82 | + <br><hr> | |
| 80 | 83 | <?php wplng_settings_part_features_more(); ?> |
| 81 | 84 | </fieldset> |
| 82 | 85 | </td> |
| 83 | 86 | </tr> |
| 84 | - <tr> | |
| 85 | - <th scope="row"><span class="dashicons dashicons-admin-network"></span> <?php _e( 'API Key', 'wplingua' ); ?></th> | |
| 87 | + <tr class="wplng-flex-container"> | |
| 88 | + <th scope="row"><span class="dashicons dashicons-admin-network"></span> <?php esc_html_e( 'API Key', 'wplingua' ); ?></th> | |
| 86 | 89 | <td> |
| 87 | 90 | <?php wplng_settings_part_api_key(); ?> |
| 88 | 91 | </td> |
| 89 | 92 | </tr> |
| 90 | 93 | <tr class="wplng-tr-submit"> |
| 91 | - <th scope="row"><span class="dashicons dashicons-yes-alt"></span> <?php _e( 'Save', 'wplingua' ); ?></th> | |
| 94 | + <th scope="row"><span class="dashicons dashicons-yes-alt"></span> <?php esc_html_e( 'Save', 'wplingua' ); ?></th> | |
| 92 | 95 | <td> |
| 93 | 96 | <?php submit_button(); ?> |
| 94 | 97 | </td> |
| 95 | 98 | </tr> |
| @@ -184,9 +187,9 @@ | ||
| 184 | 187 | </h2> |
| 185 | 188 | <p><?php esc_html_e( 'The first time a translated page is loaded, the translations are automatically generated and saved in the database. This may take some time (on first generation only) depending on the size of your content. This is why we advise you to browse your entire website for the first time in order to generate all the multilingual versions.', 'wplingua' ); ?></p> |
| 186 | 189 | <p><?php esc_html_e( 'All translations are editable: open the visual editor from the administration bar and edit them simply by clicking on the texts on your website.', 'wplingua' ); ?></p> |
| 187 | 190 | |
| 188 | - <a href="<?php echo esc_url( $url_front_page_translated ); ?>" target="_blank" class="button button-primary"> | |
| 191 | + <a href="<?php echo esc_url( $url_front_page_translated ); ?>" target="_blank" rel="noopener noreferrer" class="button button-primary"> | |
| 189 | 192 | <?php esc_html_e( 'Visit your multilingual website', 'wplingua' ); ?> |
| 190 | 193 | </a> |
| 191 | 194 | </div> |
| 192 | 195 | <?php |
| @@ -209,15 +212,19 @@ | ||
| 209 | 212 | } else { |
| 210 | 213 | echo '<fieldset>'; |
| 211 | 214 | } |
| 212 | 215 | |
| 213 | - echo '<label for="wplng_website_language" class="wplng-fe-50">'; | |
| 216 | + echo '<div class="wplng-flex-row">'; | |
| 217 | + echo '<div class="wplng-flex-item">'; | |
| 218 | + echo '<label for="wplng_website_language">'; | |
| 214 | 219 | echo '<strong>'; |
| 215 | 220 | esc_html_e( 'Original website language: ', 'wplingua' ); |
| 216 | 221 | echo ' </strong>'; |
| 217 | 222 | echo '</label>'; |
| 223 | + echo '</div>'; // End .wplng-flex-item | |
| 218 | 224 | |
| 219 | - echo '<select id="wplng_website_language" name="wplng_website_language" class="wplng-fe-50">'; | |
| 225 | + echo '<div class="wplng-flex-item">'; | |
| 226 | + echo '<select id="wplng_website_language" name="wplng_website_language" class="wplng-width-full">'; | |
| 220 | 227 | $website_language_saved = true; |
| 221 | 228 | if ( empty( wplng_get_language_website_id() ) ) { |
| 222 | 229 | $website_language_saved = false; |
| 223 | 230 | } else { |
| @@ -242,8 +249,10 @@ | ||
| 242 | 249 | echo '</option>'; |
| 243 | 250 | } |
| 244 | 251 | |
| 245 | 252 | echo '</select>'; |
| 253 | + echo '</div>'; // End .wplng-flex-item | |
| 254 | + echo '</div>'; // End .wplng-flex-row | |
| 246 | 255 | echo '<hr>'; |
| 247 | 256 | echo '</fieldset>'; |
| 248 | 257 | |
| 249 | 258 | if ( 'all' !== $api_language_website ) { |
| @@ -266,15 +275,15 @@ | ||
| 266 | 275 | echo '</div>'; |
| 267 | 276 | } |
| 268 | 277 | ?> |
| 269 | 278 | |
| 270 | - <div id="wplng-flags-radio-original-website-custom"><?php _e( 'Custom', 'wplingua' ); ?></div> | |
| 279 | + <div id="wplng-flags-radio-original-website-custom"><?php esc_html_e( 'Custom', 'wplingua' ); ?></div> | |
| 271 | 280 | |
| 272 | 281 | <div id="wplng-website-language-box"> |
| 273 | 282 | |
| 274 | 283 | <div class="wplng-website-language-displayed"> |
| 275 | 284 | <div id="wplng-website-language" class="wplng-website-language-left"> |
| 276 | - <img src="<?php echo esc_url( wplng_get_language_website_flag() ); ?>" id="wplng-website-flag"><?php echo esc_html( $website_language['name'] ); ?> | |
| 285 | + <img src="<?php echo esc_url( wplng_get_language_website_flag() ); ?>" id="wplng-website-flag"><?php echo isset( $website_language['name'] ) ? esc_html( $website_language['name'] ) : ''; ?> | |
| 277 | 286 | </div> |
| 278 | 287 | <div class="wplng-target-language-right"> |
| 279 | 288 | <a href="javascript:void(0);" id="wplng-website-lang-update-flag"><?php esc_html_e( 'Edit', 'wplingua' ); ?></a> |
| 280 | 289 | </div> |
| @@ -307,24 +316,25 @@ | ||
| 307 | 316 | |
| 308 | 317 | $languages_target = wplng_get_languages_target_simplified(); |
| 309 | 318 | |
| 310 | 319 | ?> |
| 311 | - <fieldset id="fieldset-add-target-language"> | |
| 320 | + <fieldset id="fieldset-add-target-language" class="wplng-flex-row"> | |
| 312 | 321 | |
| 313 | 322 | <div id="wplng_add_new_target_language_message" style="display: none !important;"><?php esc_html_e( 'Important: space out the addition of new languages by at least ten days and browse your site for the first time in the added languages. This promotes better indexing by search engines, reduces the load on your server and minimizes the risk of slowdowns on your site.', 'wplingua' ); ?></div> |
| 314 | 323 | |
| 315 | - <p class="wplng-fe-50"> | |
| 324 | + <div class="wplng-flex-item"> | |
| 316 | 325 | <label for="wplng_add_new_target_language"> |
| 317 | 326 | <strong><?php esc_html_e( 'Add new target Language: ', 'wplingua' ); ?></strong> |
| 318 | 327 | </label> |
| 319 | - </p> | |
| 328 | + </div> | |
| 329 | + | |
| 320 | 330 | |
| 321 | - <p class="wplng-fe-50"> | |
| 331 | + <div class="wplng-flex-item"> | |
| 322 | 332 | <select id="wplng_add_new_target_language" name="wplng_add_new_target_language"></select> |
| 323 | 333 | <a class="button button-primary wplng-icon-button" id="wplng-target-lang-add" title="<?php esc_html_e( 'Add language', 'wplingua' ); ?>" href="javascript:void(0);"> |
| 324 | 334 | <span class="dashicons dashicons-insert"></span> |
| 325 | 335 | </a> |
| 326 | - </p> | |
| 336 | + </div> | |
| 327 | 337 | </fieldset> |
| 328 | 338 | |
| 329 | 339 | <hr id="wplng-languages-target-separator"> |
| 330 | 340 | |
| @@ -353,10 +363,10 @@ | ||
| 353 | 363 | [INPUT] |
| 354 | 364 | </div> |
| 355 | 365 | <hr> |
| 356 | 366 | <fieldset> |
| 357 | - [PRIVATE_INPUT]<label for="wplng-language-private-[LANG]"><strong><?php _e( 'Make this language private', 'wplingua' ); ?></strong></label> | |
| 358 | - <p><?php _e( 'Private languages will only be visible to logged-in users with editing rights. This option allows administrators to pre-generate and correct translations before they are accessible to the public.', 'wplingua' ); ?></p> | |
| 367 | + [PRIVATE_INPUT]<label for="wplng-language-private-[LANG]"><strong><?php esc_html_e( 'Make this language private', 'wplingua' ); ?></strong></label> | |
| 368 | + <p><?php esc_html_e( 'Private languages will only be visible to logged-in users with editing rights. This option allows administrators to pre-generate and correct translations before they are accessible to the public.', 'wplingua' ); ?></p> | |
| 359 | 369 | </fieldset> |
| 360 | 370 | </div> |
| 361 | 371 | </div> |
| 362 | 372 | </div> |
| @@ -368,12 +378,14 @@ | ||
| 368 | 378 | </div> |
| 369 | 379 | |
| 370 | 380 | <hr> |
| 371 | 381 | |
| 372 | - <p><?php esc_html_e( 'Access more target languages by upgrading your API key.', 'wplingua' ); ?></strong> | |
| 373 | - <span title="<?php esc_attr_e( 'Click to expand', 'wplingua' ); ?>" wplng-help-box="#wplng-hb-language-adding"></span></p> | |
| 382 | + <div> | |
| 383 | + <?php esc_html_e( 'Access more target languages by upgrading your API key.', 'wplingua' ); ?> | |
| 384 | + <span title="<?php esc_attr_e( 'Click to expand', 'wplingua' ); ?>" wplng-help-box="#wplng-hb-language-adding"></span> | |
| 385 | + </div> | |
| 374 | 386 | |
| 375 | - <div class="wplng-help-box" id="wplng-hb-language-adding"> | |
| 387 | + <div class="wplng-help-box wplng-spacing-top" id="wplng-hb-language-adding"> | |
| 376 | 388 | <p> |
| 377 | 389 | <?php |
| 378 | 390 | |
| 379 | 391 | echo '<strong>'; |
| @@ -384,9 +396,9 @@ | ||
| 384 | 396 | $languages_all = wplng_get_languages_all(); |
| 385 | 397 | $last_language_key = count( $languages_all ) - 1; |
| 386 | 398 | |
| 387 | 399 | foreach ( $languages_all as $key => $language ) { |
| 388 | - echo $language['name']; | |
| 400 | + echo esc_html( $language['name'] ); | |
| 389 | 401 | if ( $key !== $last_language_key ) { |
| 390 | 402 | echo ' - '; |
| 391 | 403 | } |
| 392 | 404 | } |
| @@ -395,10 +407,10 @@ | ||
| 395 | 407 | |
| 396 | 408 | <hr> |
| 397 | 409 | |
| 398 | 410 | <p> |
| 399 | - <a href="https://wplingua.com/pricing/" target="_blank"> | |
| 400 | - <?php esc_attr_e( 'wplingua.com : Upgrade your API key', 'wplingua' ); ?> | |
| 411 | + <a href="https://wplingua.com/pricing/" target="_blank" rel="noopener noreferrer"> | |
| 412 | + <?php esc_html_e( 'wplingua.com : Upgrade your API key', 'wplingua' ); ?> | |
| 401 | 413 | </a> |
| 402 | 414 | </p> |
| 403 | 415 | </div> |
| 404 | 416 | <?php |
| @@ -424,14 +436,14 @@ | ||
| 424 | 436 | <label for="wplng_commercial_use">PREMIUM - <?php esc_html_e( 'Use wpLingua on commercial website', 'wplingua' ); ?></label> |
| 425 | 437 | <span title="<?php esc_attr_e( 'Click to expand', 'wplingua' ); ?>" wplng-help-box="#wplng-hb-feature-commercial"></span> |
| 426 | 438 | </fieldset> |
| 427 | 439 | |
| 428 | - <div class="wplng-help-box" id="wplng-hb-feature-commercial"> | |
| 440 | + <div class="wplng-help-box wplng-spacing-bottom" id="wplng-hb-feature-commercial"> | |
| 429 | 441 | <p><?php esc_html_e( 'Use of the free wpLingua API keys is reserved for personal blogs and non-profit websites; paid subscriptions are available for companies and commercial websites.', 'wplingua' ); ?></p> |
| 430 | 442 | <hr> |
| 431 | 443 | <p> |
| 432 | - <a href="https://wplingua.com/pricing/" target="_blank"> | |
| 433 | - <?php esc_attr_e( 'wplingua.com : Upgrade your API key', 'wplingua' ); ?> | |
| 444 | + <a href="https://wplingua.com/pricing/" target="_blank" rel="noopener noreferrer"> | |
| 445 | + <?php esc_html_e( 'wplingua.com : Upgrade your API key', 'wplingua' ); ?> | |
| 434 | 446 | </a> |
| 435 | 447 | </p> |
| 436 | 448 | </div> |
| 437 | 449 | |
| @@ -446,10 +458,10 @@ | ||
| 446 | 458 | <hr> |
| 447 | 459 | <p><?php esc_html_e( 'Example: if your website is translated from English to French and you have a post named "Hello". When a French visitor searches for the term "Bonjour" on the website, this feature will translate it on the fly to "Hello" before launching the search. This will allow WordPress to find the post named "Hello" when your visitor has searched for "Bonjour".', 'wplingua' ); ?></p> |
| 448 | 460 | <hr> |
| 449 | 461 | <p> |
| 450 | - <a href="https://wplingua.com/pricing/" target="_blank"> | |
| 451 | - <?php esc_attr_e( 'wplingua.com : Upgrade your API key', 'wplingua' ); ?> | |
| 462 | + <a href="https://wplingua.com/pricing/" target="_blank" rel="noopener noreferrer"> | |
| 463 | + <?php esc_html_e( 'wplingua.com : Upgrade your API key', 'wplingua' ); ?> | |
| 452 | 464 | </a> |
| 453 | 465 | </p> |
| 454 | 466 | |
| 455 | 467 | </div> |
| @@ -474,9 +486,9 @@ | ||
| 474 | 486 | <label for="wplng_hreflang"><?php esc_html_e( 'Add hreflang tags to translated pages', 'wplingua' ); ?></label> |
| 475 | 487 | <span title="<?php esc_attr_e( 'Click to expand', 'wplingua' ); ?>" wplng-help-box="#wplng-hb-feature-hreflang"></span> |
| 476 | 488 | </fieldset> |
| 477 | 489 | |
| 478 | - <div class="wplng-help-box" id="wplng-hb-feature-hreflang"> | |
| 490 | + <div class="wplng-help-box wplng-spacing-bottom" id="wplng-hb-feature-hreflang"> | |
| 479 | 491 | <p><?php esc_html_e( 'This option automatically adds hreflang tags to your pages that are available in multiple languages.', 'wplingua' ); ?></p> |
| 480 | 492 | <hr> |
| 481 | 493 | <p><?php esc_html_e( 'Hreflang tags are HTML metadata used to indicate the URLs of each language version of a page. They are not visible to visitors, but they allow search engines (Google, Bing, etc.) to identify the multilingual structure of the site and display the correct version according to the user\'s language.', 'wplingua' ); ?></p> |
| 482 | 494 | </div> |
| @@ -534,9 +546,9 @@ | ||
| 534 | 546 | <label for="wplng_load_in_progress"><?php esc_html_e( 'Translation progress bar for editors', 'wplingua' ); ?></label> |
| 535 | 547 | <span title="<?php esc_attr_e( 'Click to expand', 'wplingua' ); ?>" wplng-help-box="#wplng-hb-feature-load-in-progress"></span> |
| 536 | 548 | </fieldset> |
| 537 | 549 | |
| 538 | - <div class="wplng-help-box" id="wplng-hb-feature-load-in-progress"> | |
| 550 | + <div class="wplng-help-box wplng-spacing-bottom" id="wplng-hb-feature-load-in-progress"> | |
| 539 | 551 | <p><?php esc_html_e( 'Enable progress bar: Smooth translations loading for editors', 'wplingua' ); ?></p> |
| 540 | 552 | <hr> |
| 541 | 553 | <p><?php esc_html_e( 'Activate a progress bar when a page requires the generation of more than 10 new string translations. This feature only applies to connected editors.', 'wplingua' ); ?></p> |
| 542 | 554 | </div> |
| @@ -620,10 +632,10 @@ | ||
| 620 | 632 | <?php esc_html_e( 'A wpLingua API key consists of 42 characters (uppercase, lowercase and numbers). It is emailed to you when you request it using the form provided when you install the plugin. You must keep this key secret and only communicate it to wplingua.com services.', 'wplingua' ); ?> |
| 621 | 633 | </p> |
| 622 | 634 | <hr> |
| 623 | 635 | <p> |
| 624 | - <a href="https://wplingua.com/pricing/" target="_blank"> | |
| 625 | - <?php esc_attr_e( 'wplingua.com : Upgrade your API key', 'wplingua' ); ?> | |
| 636 | + <a href="https://wplingua.com/pricing/" target="_blank" rel="noopener noreferrer"> | |
| 637 | + <?php esc_html_e( 'wplingua.com : Upgrade your API key', 'wplingua' ); ?> | |
| 626 | 638 | </a> |
| 627 | 639 | </p> |
| 628 | 640 | </div> |
| 629 | 641 | |
| @@ -640,25 +652,42 @@ | ||
| 640 | 652 | |
| 641 | 653 | <?php if ( ! empty( $data['status'] ) ) : ?> |
| 642 | 654 | |
| 643 | 655 | <hr> |
| 644 | - <p class="wplng-fe-50"><?php esc_html_e( 'API key status: ', 'wplingua' ); ?></p> | |
| 656 | + <div class="wplng-flex-row"> | |
| 645 | 657 | |
| 646 | - <?php if ( 'FREE' === $data['status'] ) : ?> | |
| 647 | - <p class="wplng-fe-50" style="text-align: right;"><span class="dashicons dashicons-saved"></span> FREE</p> | |
| 648 | - <?php elseif ( 'PREMIUM' === $data['status'] ) : ?> | |
| 649 | - <p class="wplng-fe-50" style="text-align: right;"><span class="dashicons dashicons-superhero-alt"></span> PREMIUM</p> | |
| 650 | - <?php elseif ( 'VIP' === $data['status'] ) : ?> | |
| 651 | - <p class="wplng-fe-50" style="text-align: right;"><span class="dashicons dashicons-star-empty"></span> VIP</p> | |
| 652 | - <?php endif; ?> | |
| 658 | + <div class="wplng-flex-item"> | |
| 659 | + <p><?php esc_html_e( 'API key status: ', 'wplingua' ); ?></p> | |
| 660 | + </div> | |
| 653 | 661 | |
| 662 | + <div class="wplng-flex-item"> | |
| 663 | + <?php if ( 'FREE' === $data['status'] ) : ?> | |
| 664 | + <p style="text-align: right;"><span class="dashicons dashicons-saved"></span> FREE</p> | |
| 665 | + <?php elseif ( 'PREMIUM' === $data['status'] ) : ?> | |
| 666 | + <p style="text-align: right;"><span class="dashicons dashicons-superhero-alt"></span> PREMIUM</p> | |
| 667 | + <?php elseif ( 'VIP' === $data['status'] ) : ?> | |
| 668 | + <p style="text-align: right;"><span class="dashicons dashicons-star-empty"></span> VIP</p> | |
| 669 | + <?php endif; ?> | |
| 670 | + </div> | |
| 654 | 671 | |
| 672 | + </div> | |
| 673 | + | |
| 655 | 674 | <?php endif; ?> |
| 656 | 675 | |
| 657 | 676 | <?php if ( ! empty( $data['expiration'] ) ) : ?> |
| 658 | 677 | |
| 659 | - <p class="wplng-fe-50"><?php esc_html_e( 'Premium expiration: ', 'wplingua' ); ?></p> | |
| 660 | - <p class="wplng-fe-50" style="text-align: right;"><?php echo esc_html( $data['expiration'] ); ?></p> | |
| 678 | + <hr> | |
| 679 | + <div class="wplng-flex-row"> | |
| 680 | + | |
| 681 | + <div class="wplng-flex-item"> | |
| 682 | + <p><?php esc_html_e( 'Premium expiration: ', 'wplingua' ); ?></p> | |
| 683 | + </div> | |
| 684 | + | |
| 685 | + <div class="wplng-flex-item"> | |
| 686 | + <p style="text-align: right;"><?php echo esc_html( $data['expiration'] ); ?></p> | |
| 687 | + </div> | |
| 688 | + | |
| 689 | + </div> | |
| 661 | 690 | |
| 662 | 691 | <?php endif; ?> |
| 663 | 692 | |
| 664 | 693 | <?php |