Changeset 1671125
- Timestamp:
- 06/05/2017 03:52:15 PM (9 years ago)
- Location:
- sf-move-login/trunk
- Files:
-
- 5 added
- 18 edited
-
. (modified) (1 prop)
-
assets (added)
-
assets/js (added)
-
assets/js/settings.js (added)
-
assets/js/settings.min.js (added)
-
inc/activate.php (modified) (3 diffs)
-
inc/admin.php (modified) (2 diffs)
-
inc/ajax.php (added)
-
inc/classes/class-sfml-options.php (modified) (15 diffs)
-
inc/classes/class-sfml-singleton.php (modified) (1 diff)
-
inc/functions/compat.php (modified) (3 diffs)
-
inc/functions/deprecated.php (modified) (2 diffs)
-
inc/functions/rewrite.php (modified) (8 diffs)
-
inc/functions/settings-page.php (modified) (15 diffs)
-
inc/functions/utilities.php (modified) (5 diffs)
-
inc/redirections-and-dies.php (modified) (3 diffs)
-
inc/url-filters.php (modified) (2 diffs)
-
languages/sf-move-login-fr_FR.mo (modified) (previous)
-
languages/sf-move-login-fr_FR.po (modified) (4 diffs)
-
languages/sf-move-login.pot (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
sf-move-login.php (modified) (5 diffs)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sf-move-login/trunk
- Property svn:ignore
-
old new 1 node_modules 2 .jshintrc 3 gruntfile.js 4 package.json 1 5 phpcs.xml
-
- Property svn:ignore
-
sf-move-login/trunk/inc/activate.php
r1664767 r1671125 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 die( 'Cheatin\' uh?' ); 4 } 2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); 5 3 6 4 /*------------------------------------------------------------------------------------------------*/ … … 47 45 48 46 $dies = array_filter( array_map( 'sfml_notice_message', $dies ) ); 49 /* * Translators: 1 is the plugin name. */47 /* translators: 1 is the plugin name. */ 50 48 $dies = sprintf( __( '%s has not been activated.', 'sf-move-login' ), '<strong>Move Login</strong>' ) . '<br/>' . implode( '<br/>', $dies ); 51 49 … … 112 110 113 111 $messages = array( 114 /* * Translators: 1 is the plugin name. */112 /* translators: 1 is the plugin name. */ 115 113 'error_no_request_uri' => sprintf( __( 'It seems your server configuration prevents the plugin to work properly. %s won\'t work.', 'sf-move-login' ), '<strong>Move Login</strong>' ), 116 /* * Translators: 1 is the plugin name. */114 /* translators: 1 is the plugin name. */ 117 115 'error_no_mod_rewrite' => sprintf( __( 'It seems the url rewrite module is not activated on your server. %s won\'t work.', 'sf-move-login' ), '<strong>Move Login</strong>' ), 118 /* * Translators: 1, 2, and 3 are server technologies (Apache, Nginx, IIS7), 4 is the plugin name. */116 /* translators: 1, 2, and 3 are server technologies (Apache, Nginx, IIS7), 4 is the plugin name. */ 119 117 'error_unknown_server_conf' => sprintf( __( 'It seems your server does not use %1$s, %2$s, nor %3$s. %4$s won\'t work.', 'sf-move-login' ), '<i>Apache</i>', '<i>Nginx</i>', '<i>IIS7</i>', '<strong>Move Login</strong>' ), 120 /* * Translators: 1 is the plugin name, 2 is a file name, 3 is a "Move Login" link. */118 /* translators: 1 is the plugin name, 2 is a file name, 3 is a "Move Login" link. */ 121 119 'error_file_not_writable' => sprintf( __( '%1$s needs access to the %2$s file. Please visit the %3$s settings page and copy/paste the given code into the %2$s file.', 'sf-move-login' ), '<strong>Move Login</strong>', $file, $link ), 122 /* * Translators: 1 is a server technology (Nginx), 2 is a "Move Login" link, 3 is the plugin name. */120 /* translators: 1 is a server technology (Nginx), 2 is a "Move Login" link, 3 is the plugin name. */ 123 121 'updated_is_nginx' => sprintf( __( 'It seems your server uses a %1$ system. You have to edit the rewrite rules by yourself in the configuration file. Please visit the %2$s settings page and take a look at the rewrite rules. %3$s is running but won\'t work correctly until you deal with those rewrite rules.', 'sf-move-login' ), '<i>Nginx</i>', $link, '<strong>Move Login</strong>' ), 124 122 ); -
sf-move-login/trunk/inc/admin.php
r1664767 r1671125 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 die( 'Cheatin\' uh?' ); 4 } 2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); 5 3 6 4 /*------------------------------------------------------------------------------------------------*/ … … 63 61 } 64 62 63 /* translators: %s is a person name. But you don't care, you don't have to translate it. */ 65 64 $links = sprintf( __( 'By %s' ), wp_sprintf( '%l', $links ) ); 66 65 -
sf-move-login/trunk/inc/classes/class-sfml-options.php
r1664767 r1671125 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 die( 'Cheatin\' uh?' ); 4 } 2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); 5 3 6 4 /** … … 74 72 75 73 $new_whitelist_options = isset( $new_whitelist_options ) && is_array( $new_whitelist_options ) ? $new_whitelist_options : array(); // WPCS: override ok. 76 $new_whitelist_options[ static::OPTION_GROUP ] = isset( $new_whitelist_options[ static::OPTION_GROUP ] ) && is_array( $new_whitelist_options[ static::OPTION_GROUP ] ) ? $new_whitelist_options[ static::OPTION_GROUP ] : array(); 77 $new_whitelist_options[ static::OPTION_GROUP ][] = static::OPTION_NAME; 74 $new_whitelist_options[ static::OPTION_GROUP ] = isset( $new_whitelist_options[ static::OPTION_GROUP ] ) && is_array( $new_whitelist_options[ static::OPTION_GROUP ] ) ? $new_whitelist_options[ static::OPTION_GROUP ] : array(); // WPCS: override ok. 75 $new_whitelist_options[ static::OPTION_GROUP ][] = static::OPTION_NAME; // WPCS: override ok. 78 76 } elseif ( is_admin() ) { 79 77 $whitelist = sfml_cache_data( 'new_whitelist_network_options' ); … … 108 106 // Default slugs. 109 107 $this->options_default = array( 110 'slugs.postpass' => 'postpass',111 108 'slugs.logout' => 'logout', 112 109 'slugs.lostpassword' => 'lostpassword', … … 231 228 232 229 /** 233 * Get the slugs .230 * Get the slugs that will be rewritten. 234 231 * 235 232 * @return (array) … … 238 235 $this->maybe_clear_options_cache(); 239 236 240 if ( ! isset( $this->slugs ) ) { 241 $this->slugs = static::get_sub_options( 'slugs', $this->get_options() ); 242 } 237 if ( isset( $this->slugs ) ) { 238 return $this->slugs; 239 } 240 241 $this->slugs = array_merge( 242 $this->get_non_customizable_actions(), 243 static::get_sub_options( 'slugs', $this->get_options() ) 244 ); 243 245 244 246 return $this->slugs; … … 246 248 247 249 248 /** 249 * Get sub-options. 250 * 251 * For example: 252 * static::get_sub_options( 'foo', array( 253 * 'option1' => 'value1', 254 * 'foo.option2' => 'value2', 255 * 'foo.option3' => 'value3', 256 * ) ); 257 * Will return: 258 * array( 259 * 'option2' => 'value2', 260 * 'option3' => 'value3', 261 * ) 262 * 263 * @param (string) $name The sub-option name. 264 * @param (array) $options Array of options. 265 * 266 * @return (array) 267 */ 268 public static function get_sub_options( $name, $options ) { 269 if ( ! $options || ! $name ) { 270 return array(); 271 } 272 273 $options = (array) $options; 274 275 if ( isset( $options[ $name ] ) ) { 276 return $options[ $name ]; 277 } 278 279 $group = array(); 280 $name = rtrim( $name, '.' ) . '.'; 281 282 foreach ( $options as $k => $v ) { 283 if ( 0 === strpos( $k, $name ) ) { 284 $group[ substr( $k, strlen( $name ) ) ] = $v; 285 } 286 } 287 288 return ! empty( $group ) ? $group : null; 289 } 290 291 292 /*--------------------------------------------------------------------------------------------*/ 293 /* !FIELD LABELS ==========+++=============================================================== */ 250 /*--------------------------------------------------------------------------------------------*/ 251 /* !FIELD LABELS ============================================================================ */ 294 252 /*--------------------------------------------------------------------------------------------*/ 295 253 … … 297 255 * Get the possible choices for a specific option. 298 256 * 299 * @since 1.5.2257 * @since 2.5.2 300 258 * 301 259 * @param (string) $option The option name. … … 397 355 */ 398 356 public function sanitize_options( $options = array() ) { 399 $sanitized_options = array(); 400 $old_options = get_site_option( static::OPTION_NAME ); 401 $errors = array( 'forbidden' => array(), 'duplicates' => array() ); 357 $old_options = get_site_option( static::OPTION_NAME ); 402 358 403 359 // Add and sanitize slugs. 404 $default_slugs = $this->get_default_options(); 405 $default_slugs = static::get_sub_options( 'slugs', $default_slugs ); 406 $exclude = $this->get_other_actions(); 407 408 foreach ( $default_slugs as $slug_key => $default_slug ) { 409 410 if ( isset( $exclude[ $slug_key ] ) ) { 411 $sanitized_options[ 'slugs.' . $slug_key ] = $exclude[ $slug_key ]; 412 continue; 413 } 414 415 $sanitized_options[ 'slugs.' . $slug_key ] = false; 416 417 if ( ! empty( $options[ 'slugs.' . $slug_key ] ) ) { 418 $tmp_slug = sanitize_title( $options[ 'slugs.' . $slug_key ], $default_slug ); 419 420 // 'postpass', 'retrievepassword' and 'rp' are forbidden. 421 if ( in_array( $tmp_slug, $exclude, true ) ) { 422 $errors['forbidden'][] = $tmp_slug; 423 } 424 // Make sure the slug is not already set for another action. 425 elseif ( in_array( $tmp_slug, $sanitized_options, true ) ) { 426 $errors['duplicates'][] = $tmp_slug; 427 } 428 // Yay! 429 else { 430 $sanitized_options[ 'slugs.' . $slug_key ] = $tmp_slug; 431 } 432 } 433 434 // Fallback to old value or default value. 435 if ( ! $sanitized_options[ 'slugs.' . $slug_key ] ) { 436 if ( ! isset( $exclude[ $slug_key ] ) && ! empty( $old_options[ 'slugs.' . $slug_key ] ) ) { 437 $sanitized_options[ 'slugs.' . $slug_key ] = sanitize_title( $old_options[ 'slugs.' . $slug_key ], $default_slug ); 438 } else { 439 $sanitized_options[ 'slugs.' . $slug_key ] = $default_slug; 440 } 441 } 442 } 360 $sanitized_options = $this->sanitize_slugs( $options ); 361 $errors = $sanitized_options['errors']; 362 $sanitized_options = $sanitized_options['slugs']; 443 363 444 364 // Add and sanitize other options. … … 446 366 447 367 foreach ( $default_options as $option_name => $default_value ) { 448 449 368 if ( isset( $options[ $option_name ] ) ) { 369 // Yay! 450 370 $sanitized_options[ $option_name ] = (int) $options[ $option_name ]; 451 371 } elseif ( isset( $old_options[ $option_name ] ) ) { 372 // Old value. 452 373 $sanitized_options[ $option_name ] = (int) $old_options[ $option_name ]; 453 374 } else { 375 // Default value. 454 376 $sanitized_options[ $option_name ] = $default_value; 455 377 continue; … … 459 381 460 382 if ( ! isset( $choices[ $sanitized_options[ $option_name ] ] ) ) { 383 // Oh no. 461 384 $sanitized_options[ $option_name ] = $default_value; 462 385 } … … 494 417 495 418 if ( $nbr_forbidden = count( $errors['forbidden'] ) ) { 496 /* * Translators: %s is an URL slug name. */419 /* translators: %s is an URL slug name. */ 497 420 add_settings_error( 'sfml_settings', 'forbidden-slugs', sprintf( _n( 'The slug %s is forbidden.', 'The slugs %s are forbidden.', $nbr_forbidden, 'sf-move-login' ), wp_sprintf( '<code>%l</code>', $errors['forbidden'] ) ) ); 498 421 } … … 506 429 507 430 431 /** 432 * Sanitize slugs. 433 * 434 * @param (array) $raw_slugs Slugs to sanitize. 435 * 436 * @return (array) An array containing the sanitized slugs and possible errors. 437 */ 438 public function sanitize_slugs( $raw_slugs = array() ) { 439 $default_slugs = static::get_sub_options( 'slugs', $this->get_default_options() ); 440 $old_slugs = get_site_option( static::OPTION_NAME ); 441 $old_slugs = is_array( $old_slugs ) && $old_slugs ? static::get_sub_options( 'slugs', $old_slugs ) : array(); 442 $old_slugs = array_merge( $default_slugs, $old_slugs ); 443 $exclude = $this->get_other_actions(); 444 $raw_slugs = $raw_slugs && is_array( $raw_slugs ) ? array_map( 'trim', $raw_slugs ) : array(); 445 $output = array( 446 'slugs' => array(), 447 'errors' => array( 448 'forbidden' => array(), 449 'duplicates' => array(), 450 ), 451 ); 452 453 // First, sanitize the old slugs. 454 foreach ( $old_slugs as $action => $old_slug ) { 455 $old_slug = sanitize_title( $old_slug ); 456 $old_slugs[ $action ] = $old_slug ? $old_slug : $default_slugs[ $action ]; 457 } 458 459 // Then, make sure there are no duplicates within the old slugs. 460 $slugs_count = count( $old_slugs ); 461 $unique_slugs_count = count( array_unique( $old_slugs ) ); 462 463 while ( $unique_slugs_count < $slugs_count ) { 464 $tmp_old_slugs = $old_slugs; 465 466 foreach ( $old_slugs as $action => $old_slug ) { 467 $other_slugs = $old_slugs; 468 unset( $other_slugs[ $action ] ); 469 470 if ( ! in_array( $slug, $other_slugs, true ) ) { 471 // Not a duplicate. 472 $tmp_old_slugs[ $action ] = $old_slug; 473 } else { 474 // Use the default slug (we know it is unique within the default slugs). 475 $tmp_old_slugs[ $action ] = $default_slugs[ $action ]; 476 } 477 } 478 479 $old_slugs = $tmp_old_slugs; 480 $slugs_count = count( $old_slugs ); 481 $unique_slugs_count = count( array_unique( $old_slugs ) ); 482 } 483 484 // Sanitize the new slugs and make sure they are not forbidden. 485 foreach ( $default_slugs as $action => $default_slug ) { 486 $input_name = 'slugs.' . $action; 487 488 // First, determinate a fallback. 489 if ( empty( $raw_slugs[ $input_name ] ) ) { 490 // If the field was left empty, fallback to the default slug. 491 $fallback = $default_slug; 492 } else { 493 // Use the previous slug (or the default one). 494 $fallback = $old_slugs[ $action ]; 495 } 496 497 $new_slug = sanitize_title( $raw_slugs[ 'slugs.' . $action ], $fallback ); 498 499 $output['slugs'][ 'slugs.' . $action ] = $new_slug ? $new_slug : $fallback; 500 501 // 'postpass', 'retrievepassword' and 'rp' are forbidden by default. 502 if ( isset( $exclude[ $new_slug ] ) ) { 503 $output['errors']['forbidden'][ $action ] = $new_slug; 504 $output['slugs'][ 'slugs.' . $action ] = $fallback; 505 } 506 } 507 508 // Look for duplicates. 509 $slugs_count = count( $output['slugs'] ); 510 $unique_slugs_count = count( array_unique( $output['slugs'] ) ); 511 512 while ( $unique_slugs_count < $slugs_count ) { 513 $new_slugs = $output['slugs']; 514 515 foreach ( $output['slugs'] as $input_name => $slug ) { 516 $other_slugs = $output['slugs']; 517 unset( $other_slugs[ $input_name ] ); 518 519 if ( ! in_array( $slug, $other_slugs, true ) ) { 520 // Not a duplicate. 521 $new_slugs[ $input_name ] = $slug; 522 continue; 523 } 524 525 $action = str_replace( 'slugs.', '', $input_name ); 526 527 // Use the previous slug (we know it is unique within the old slugs). 528 $new_slugs[ $input_name ] = $old_slugs[ $action ]; 529 $output['errors']['duplicates'][ $action ] = $old_slugs[ $action ]; 530 } 531 532 $output['slugs'] = $new_slugs; 533 $slugs_count = count( $output['slugs'] ); 534 $unique_slugs_count = count( array_unique( $output['slugs'] ) ); 535 } 536 537 return $output; 538 } 539 540 508 541 /*--------------------------------------------------------------------------------------------*/ 509 542 /* !VARIOUS ================================================================================= */ … … 511 544 512 545 /** 513 * Return the "other" original login actions: not the ones listed in our settings. 546 * Get the original login actions that are not listed in the settings page. 547 * Plugins can add them to the settings page though. 514 548 * 515 549 * @return (array) … … 517 551 public function get_other_actions() { 518 552 return array_diff_key( array( 519 'retrievepassword' => 'retrievepassword', 520 'rp' => 'rp', 553 'postpass' => 'postpass', // Not customizable. 554 'retrievepassword' => 'retrievepassword', // Alias for lostpassword, not used by WP. 555 'rp' => 'rp', // Alias for resetpass, not used by WP. 556 ), $this->get_slug_field_labels() ); 557 } 558 559 560 /** 561 * Get the original login actions that will be rewritten but are not listed in the settings page. 562 * Those actions don't redirect to other login actions (and the visitors don't see them), so there's no need to bother the user with a useless setting. 563 * Plugins can add them to the settings page though. 564 * 565 * @since 2.5.3 566 * 567 * @return (array) 568 */ 569 public function get_non_customizable_actions() { 570 return array_diff_key( array( 571 'postpass' => 'postpass', 521 572 ), $this->get_slug_field_labels() ); 522 573 } … … 543 594 } 544 595 } 596 597 598 /** 599 * Get sub-options. 600 * 601 * For example: 602 * static::get_sub_options( 'foo', array( 603 * 'option1' => 'value1', 604 * 'foo.option2' => 'value2', 605 * 'foo.option3' => 'value3', 606 * ) ); 607 * Will return: 608 * array( 609 * 'option2' => 'value2', 610 * 'option3' => 'value3', 611 * ) 612 * 613 * @param (string) $name The sub-option name. 614 * @param (array) $options Array of options. 615 * 616 * @return (array) 617 */ 618 public static function get_sub_options( $name, $options ) { 619 if ( ! $options || ! $name ) { 620 return array(); 621 } 622 623 $options = (array) $options; 624 625 if ( isset( $options[ $name ] ) ) { 626 return $options[ $name ]; 627 } 628 629 $group = array(); 630 $name = rtrim( $name, '.' ) . '.'; 631 632 foreach ( $options as $k => $v ) { 633 if ( 0 === strpos( $k, $name ) ) { 634 $group[ substr( $k, strlen( $name ) ) ] = $v; 635 } 636 } 637 638 return ! empty( $group ) ? $group : null; 639 } 545 640 } -
sf-move-login/trunk/inc/classes/class-sfml-singleton.php
r1566761 r1671125 1 1 <?php 2 defined( 'ABSPATH' ) ordie( 'Cheatin\' uh?' );2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); 3 3 4 4 /** -
sf-move-login/trunk/inc/functions/compat.php
r1664767 r1671125 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 die( 'Cheatin\' uh?' ); 4 } 2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); 5 3 6 4 if ( ! function_exists( 'set_url_scheme' ) ) : … … 75 73 return win_is_writable( $path ); 76 74 } 77 return @ is_writable($path );75 return @call_user_func( 'is_writable', $path ); 78 76 } 79 77 endif; … … 124 122 } 125 123 126 $parts = @ parse_url($url );124 $parts = @call_user_func( 'parse_url', $url ); 127 125 128 126 if ( false === $parts ) { -
sf-move-login/trunk/inc/functions/deprecated.php
r1653817 r1671125 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 die( 'Cheatin\' uh?' ); 4 } 2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); 5 3 6 4 … … 18 16 19 17 // If it's not the administration area, or if it's an ajax call, no need to go further. 20 if ( ! ( is_admin() && ! ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ( 'admin-post.php' === $pagenow && ! empty( $_REQUEST['action'] ) ) ) ) ) { 18 if ( ! ( is_admin() && ! ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ( 'admin-post.php' === $pagenow && ! empty( $_REQUEST['action'] ) ) ) ) ) { // WPCS: CSRF ok. 21 19 return; 22 20 } -
sf-move-login/trunk/inc/functions/rewrite.php
r1664767 r1671125 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 die( 'Cheatin\' uh?' ); 4 } 2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); 5 3 6 4 /*------------------------------------------------------------------------------------------------*/ … … 26 24 if ( ! $actions || ! is_array( $actions ) ) { 27 25 $actions = sfml_get_slugs(); 26 } else { 27 $actions = array_merge( SFML_Options::get_instance()->get_non_customizable_actions(), $actions ); 28 28 } 29 29 … … 103 103 } 104 104 105 $base = parse_url( trailingslashit( get_option( 'home' ) ), PHP_URL_PATH ); 105 $base = wp_parse_url( trailingslashit( get_option( 'home' ) ) ); 106 $base = $base['path']; 106 107 $wp_dir = sfml_get_wp_directory(); // WP in its own directory. 107 108 $is_sub = sfml_is_subfolder_install(); // MultiSite by sub-folders. … … 109 110 110 111 $bases = array( 111 'base' => $base, // '/' or '/sub-dir/'.112 'wp_dir' => $wp_dir, // '' or '/wp-dir/'.113 'site_dir' => $site_dir, // '/', '/wp-dir/', '/sub-dir/', or '/sub-dir/wp-dir/'.114 'is_sub' => $is_sub, // True or false.112 'base' => $base, // Possible values: '/' or '/sub-dir/'. 113 'wp_dir' => $wp_dir, // Possible values: '' or '/wp-dir/'. 114 'site_dir' => $site_dir, // Possible values: '/', '/wp-dir/', '/sub-dir/', or '/sub-dir/wp-dir/'. 115 'is_sub' => $is_sub, // Possible values: true or false. 115 116 ); 116 117 … … 303 304 } 304 305 306 $filesystem = sfml_get_filesystem(); 305 307 $htaccess_file = sfml_get_home_path() . '.htaccess'; 306 $has_htaccess = file_exists( $htaccess_file );308 $has_htaccess = $filesystem->exists( $htaccess_file ); 307 309 308 310 if ( ! $rules ) { … … 327 329 $marker = 'SF Move Login'; 328 330 // Current htaccess content. 329 $content = $has_htaccess ? file_get_contents( $htaccess_file ) : '';331 $content = $has_htaccess ? $filesystem->get_contents( $htaccess_file ) : ''; 330 332 // Remove the SF Move Login marker. 331 333 $content = preg_replace( "/# BEGIN $marker.*# END $marker\n*/is", '', $content ); … … 337 339 338 340 // Update the `.htaccess` file. 339 $filesystem = sfml_get_filesystem();340 341 return (bool) $filesystem->put_contents( $htaccess_file , $content ); 341 342 } … … 364 365 365 366 foreach ( $rules as $slug => $rule ) { 366 $out[] = $space . '<rule name="SF Move Login Rule ' . $rule_i . '" stopProcessing="true">' . "\n" 367 . $space . ' <match url="^' . $bases['site_from'] . $slug . '/?$" ignoreCase="false" />' . "\n" 368 . $space . ' <action type="Redirect" url="' . $bases['site_dir'] . $rule . '" redirectType="Permanent" />' . "\n" 369 . $space . '</rule>'; 367 $full_rule = $space . '<rule name="SF Move Login Rule ' . $rule_i . '" stopProcessing="true">' . "\n"; 368 $full_rule .= $space . ' <match url="^' . $bases['site_from'] . $slug . '/?$" ignoreCase="false" />' . "\n"; 369 $full_rule .= $space . ' <action type="Redirect" url="' . $bases['site_dir'] . $rule . '" redirectType="Permanent" />' . "\n"; 370 $full_rule .= $space . '</rule>'; 371 372 $out[] = $full_rule; 370 373 $rule_i++; 371 374 } -
sf-move-login/trunk/inc/functions/settings-page.php
r1664767 r1671125 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 die( 'Cheatin\' uh?' ); 4 } 2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); 3 4 /*------------------------------------------------------------------------------------------------*/ 5 /* !ASSETS ====================================================================================== */ 6 /*------------------------------------------------------------------------------------------------*/ 7 8 add_action( 'admin_enqueue_scripts', 'sfml_enqueue_settings_assets' ); 9 /** 10 * Enqueue assets for the settings page. 11 * 12 * @since 2.5.3 13 */ 14 function sfml_enqueue_settings_assets() { 15 $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; 16 $version = $suffix ? SFML_VERSION : time(); 17 18 wp_enqueue_script( 'move-login-settings', plugin_dir_url( SFML_FILE ) . 'assets/js/settings' . $suffix . '.js', array( 'jquery' ), $version, true ); 19 20 wp_localize_script( 'move-login-settings', 'sfml', array( 21 'nonce' => wp_create_nonce( 'sfml_sanitize_slug' ), 22 'error' => __( 'Error', 'sf-move-login' ), 23 'errorReload' => __( 'Error. Please reload the page.', 'sf-move-login' ), 24 /* translators: %s is an URL slug name. */ 25 'forbidden' => _n( 'The slug %s is forbidden.', 'The slugs %s are forbidden.', 1, 'sf-move-login' ), 26 'duplicate' => _x( 'Duplicate.', 'adjective', 'sf-move-login' ), 27 ) ); 28 } 29 30 31 add_action( 'admin_print_scripts-settings_page_move-login', 'sfml_print_settings_css' ); 32 /** 33 * Print some CSS on the settings page. 34 * 35 * @since 2.5.3 36 */ 37 function sfml_print_settings_css() { 38 echo '<style>.dynamic-login-url-slug-error, .sfml-warning { color: red; }</style>'; 39 } 40 5 41 6 42 /*------------------------------------------------------------------------------------------------*/ … … 12 48 */ 13 49 function sfml_settings_fields() { 14 $instance = SFML_Options::get_instance(); 15 $labels = $instance->get_field_labels( 'slugs' ); 16 $defaults = sfml_get_default_options(); 17 $options = sfml_get_options(); 50 $instance = SFML_Options::get_instance(); 51 $labels = $instance->get_field_labels( 'slugs' ); 52 $defaults = sfml_get_default_options(); 53 $options = sfml_get_options(); 54 $login_url = site_url( '%%slug%%', 'login' ); 18 55 19 56 // Sections. … … 35 72 'slugs', 36 73 array( 37 'label_for' => 'slugs-' . $slug, 38 'name' => 'slugs.' . $slug, 39 'value' => $options[ 'slugs.' . $slug ], 40 'default' => $slug, 41 'attributes' => array( 42 'pattern' => '[0-9a-z_-]*', 43 'title' => __( 'Only lowercase letters, digits, - and _', 'sf-move-login' ), 74 'label_for' => 'slugs-' . $slug, 75 'name' => 'slugs.' . $slug, 76 'value' => $options[ 'slugs.' . $slug ], 77 'default' => $slug, 78 'default_hidden' => true, 79 'after' => " \n" . '<em class="hide-if-no-js">' . str_replace( '%%slug%%', '<strong id="dynamic-login-url-slug-' . $slug . '" class="dynamic-login-url-slug">' . $options[ 'slugs.' . $slug ] . '</strong>', $login_url ) . '</em> <span id="dynamic-login-url-slug-error-' . $slug . '" class="dynamic-login-url-slug-error"></span>', 80 'attributes' => array( 81 'class' => 'slug-field', 82 'title' => __( 'Only lowercase letters, digits, - and _', 'sf-move-login' ), 83 'placeholder' => $slug, 44 84 ), 45 85 ) … … 91 131 global $parent_file; 92 132 // Prevent wp-admin/options-head.php to be included. 93 $parent_file .= '#sfml'; 133 $parent_file .= '#sfml'; // WPCS: override ok. 94 134 } 95 135 … … 107 147 echo '<h1>Move Login</h1>'; 108 148 } else { 109 screen_icon('tools' );149 call_user_func( 'screen_icon', 'tools' ); 110 150 echo '<h2>Move Login</h2>'; 111 151 } … … 137 177 */ 138 178 function sfml_text_field( $args ) { 139 $name = ! empty( $args['name'] ) ? esc_attr( $args['name'] ) : ( ! empty( $args['label_for'] ) ? esc_attr( $args['label_for'] ) : false );140 179 $id = ! empty( $args['label_for'] ) ? esc_attr( $args['label_for'] ) : false; 180 $name = ! empty( $args['name'] ) ? esc_attr( $args['name'] ) : $id; 141 181 $value = isset( $args['value'] ) ? esc_attr( $args['value'] ) : ''; 142 182 $default = isset( $args['default'] ) ? esc_attr( $args['default'] ) : null; 143 183 $atts = ! empty( $args['attributes'] ) ? sfml_build_html_atts( $args['attributes'] ) : ''; 184 $after = ! empty( $args['after'] ) ? $args['after'] : ''; 144 185 145 186 if ( ! $name ) { … … 156 197 157 198 if ( isset( $default ) ) { 158 /** Translators: %s is an option value. */ 159 echo ' <span class="description">' . sprintf( _x( '(default: %s)', 'default value', 'sf-move-login' ), $default ) . '</span>'; 160 } 199 $class = ! empty( $args['default_hidden'] ) ? 'screen-reader-text' : 'description'; 200 /* translators: %s is a default option value. */ 201 echo ' <span class="' . $class . '">' . sprintf( _x( '(default: %s)', 'default value', 'sf-move-login' ), $default ) . '</span>'; 202 } 203 204 echo $after; 161 205 } 162 206 … … 168 212 */ 169 213 function sfml_radio_field( $args ) { 170 $name = ! empty( $args['name'] ) ? esc_attr( $args['name'] ) : ( ! empty( $args['label_for'] ) ? esc_attr( $args['label_for'] ) : false ); 171 $id = ! empty( $args['label_for'] ) ? esc_attr( $args['label_for'] ) : 'radio-' . $name; 172 $value = isset( $args['value'] ) ? $args['value'] : ''; 173 $values = isset( $args['values'] ) ? $args['values'] : false; 174 $default = isset( $args['default'] ) ? $args['default'] : null; 175 $label = isset( $args['label'] ) ? $args['label'] : ''; 214 $label_for = ! empty( $args['label_for'] ) ? esc_attr( $args['label_for'] ) : false; 215 $name = ! empty( $args['name'] ) ? esc_attr( $args['name'] ) : $label_for; 216 $id = $label_for ? $label_for : 'radio-' . $name; 217 $value = isset( $args['value'] ) ? $args['value'] : ''; 218 $values = isset( $args['values'] ) ? $args['values'] : false; 219 $default = isset( $args['default'] ) ? $args['default'] : null; 220 $label = isset( $args['label'] ) ? $args['label'] : ''; 176 221 177 222 if ( ! $name || ! $values || ! is_array( $values ) ) { … … 199 244 200 245 if ( isset( $default ) && isset( $values[ $default ] ) ) { 201 /** Translators: %s is an option value. */ 202 echo '<span class="description">' . sprintf( _x( '(default: %s)', 'default value', 'sf-move-login' ), $values[ $default ] ) . '</span>'; 246 $class = ! empty( $args['default_hidden'] ) ? 'screen-reader-text' : 'description'; 247 /* translators: %s is a default option value. */ 248 echo ' <span class="' . $class . '">' . sprintf( _x( '(default: %s)', 'default value', 'sf-move-login' ), $values[ $default ] ) . '</span>'; 203 249 } 204 250 } … … 214 260 215 261 // Message. 216 $base = parse_url( trailingslashit( get_option( 'home' ) ), PHP_URL_PATH ); 262 $base = wp_parse_url( trailingslashit( get_option( 'home' ) ) ); 263 $base = $base['path']; 217 264 $document_root_fix = str_replace( '\\', '/', realpath( $_SERVER['DOCUMENT_ROOT'] ) ); 218 265 $abspath_fix = str_replace( '\\', '/', ABSPATH ); … … 226 273 $height = 20; 227 274 $content = sprintf( 228 /* * Translators: 1 is a file name, 2 is a file path, 3 and 4 are small parts of code. */275 /* translators: 1 is a file name, 2 is a file path, 3 and 4 are small parts of code. */ 229 276 __( 'If the plugin fails to add the new rewrite rules to your %1$s file, add the following to your %1$s file in %2$s, replacing other %3$s rules if they exist, <strong>above</strong> the line reading %4$s:', 'sf-move-login' ), 230 277 "<code>$file</code>", … … 240 287 241 288 $height = substr_count( $file_content, "\n" ); 242 $content = '<span style="color:red">' . sprintf(243 /* * Translators: 1 is a file name, 2 is a small part of code. */289 $content = '<span class="sfml-warning">' . sprintf( 290 /* translators: 1 is a file name, 2 is a small part of code. */ 244 291 __( 'The plugin can\'t add the new rewrite rules to your %1$s file by itself, you will need to add them manually inside the %2$s block.', 'sf-move-login' ), 245 292 "<code>$file</code>", … … 258 305 $height = substr_count( $file_content, "\n" ); 259 306 $content = sprintf( 260 /* * Translators: 1 is a file name, 2 is a file path, 3 and 4 are small parts of code. */307 /* translators: 1 is a file name, 2 is a file path, 3 and 4 are small parts of code. */ 261 308 __( 'If the plugin fails to add the new rewrite rules to your %1$s file, add the following to your %1$s file in %2$s, replacing other %3$s rules if they exist, <strong>above</strong> the line reading %4$s:', 'sf-move-login' ), 262 309 "<code>$file</code>", … … 273 320 // Add a warning if the file is not writable. 274 321 if ( $home_path && $file && ! wp_is_writable( $home_path . $file ) ) { 275 $content .= '</p><p style="color:red">' . sprintf(276 /* * Translators: %s is a file name. */322 $content .= '</p><p class="sfml-warning">' . sprintf( 323 /* translators: %s is a file name. */ 277 324 __( 'Your %s file is not writable.', 'sf-move-login' ), 278 325 "<code>$file</code>" … … 282 329 // Add a warning if the plugin is bypassed. 283 330 if ( defined( 'SFML_ALLOW_LOGIN_ACCESS' ) && SFML_ALLOW_LOGIN_ACCESS ) { 284 /* * Translators: 1 is a constant name, 2 is a constant value. */331 /* translators: 1 is a constant name, 2 is a constant value. */ 285 332 $content .= '</p><p class="description">' . sprintf( __( 'The constant %1$s is defined to %2$s, the settings below won\'t take effect.', 'sf-move-login' ), '<code>SFML_ALLOW_LOGIN_ACCESS</code>', '<code>true</code>' ); 286 333 } -
sf-move-login/trunk/inc/functions/utilities.php
r1664767 r1671125 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 die( 'Cheatin\' uh?' ); 4 } 2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); 5 3 6 4 /*------------------------------------------------------------------------------------------------*/ … … 117 115 * @param (bool) $is True if the server runs Apache. False otherwize. 118 116 */ 119 return apply_filters( 'sfml_is_apache', $is ); 117 $is = apply_filters( 'sfml_is_apache', $is ); 118 119 // `$is` must be set before being returned (aka don't return the filter result directly or the static var won't keep the right value). 120 return $is; 120 121 } 121 122 … … 150 151 * @param (bool) $is True if the server runs IIS7. False otherwize. 151 152 */ 152 return apply_filters( 'sfml_is_iis7', $is ); 153 $is = apply_filters( 'sfml_is_iis7', $is ); 154 155 // `$is` must be set before being returned (aka don't return the filter result directly or the static var won't keep the right value). 156 return $is; 153 157 } 154 158 … … 180 184 * @param (bool) $is True if the server runs Nginx. False otherwize. 181 185 */ 182 return apply_filters( 'sfml_is_nginx', $is ); 186 $is = apply_filters( 'sfml_is_nginx', $is ); 187 188 // `$is` must be set before being returned (aka don't return the filter result directly or the static var won't keep the right value). 189 return $is; 183 190 } 184 191 … … 235 242 $url = str_replace( $home, '', $url ); 236 243 return trim( $url, '/' ); 237 default :244 default: 238 245 $url = explode( '?', $url, 2 ); 239 246 return reset( $url ); -
sf-move-login/trunk/inc/redirections-and-dies.php
r1664767 r1671125 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 die( 'Cheatin\' uh?' ); 4 } 2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); 5 3 6 4 /*------------------------------------------------------------------------------------------------*/ … … 132 130 */ 133 131 function sfml_maybe_deny_login_redirect( $location ) { 132 global $pagenow; 133 134 if ( 'wp-login.php' === $pagenow ) { 135 return $location; 136 } 137 134 138 if ( is_user_logged_in() ) { 139 return $location; 140 } 141 142 if ( wp_get_referer() === $location ) { 143 return $location; 144 } 145 146 if ( sfml_cache_data( 'allow_redirection' ) ) { 147 // This can be used by 3rd party plugins. 148 sfml_cache_data( 'allow_redirection', null ); 135 149 return $location; 136 150 } … … 194 208 195 209 210 211 212 /*------------------------------------------------------------------------------------------------*/ 213 /* !TOOLS ======================================================================================= */ 214 /*------------------------------------------------------------------------------------------------*/ 215 196 216 /** 197 217 * Trigger a 404 error if headers have not been sent yet. -
sf-move-login/trunk/inc/url-filters.php
r1566761 r1671125 1 1 <?php 2 if ( ! defined( 'ABSPATH' ) ) { 3 die( 'Cheatin\' uh?' ); 4 } 2 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); 5 3 6 4 /*------------------------------------------------------------------------------------------------*/ … … 154 152 155 153 // Get the action. 156 $parsed_path = parse_url( $path );154 $parsed_path = wp_parse_url( $path ); 157 155 158 156 if ( ! empty( $parsed_path['query'] ) ) { -
sf-move-login/trunk/languages/sf-move-login-fr_FR.po
r1664767 r1671125 5 5 "Project-Id-Version: SF Move Login\n" 6 6 "Report-Msgid-Bugs-To: Grégory Viguier <i18n@screenfeed.fr>\n" 7 "POT-Creation-Date: 2017-0 5-25 15:27+0200\n"8 "PO-Revision-Date: 2017-0 5-25 16:09+0200\n"7 "POT-Creation-Date: 2017-06-05 17:13+0200\n" 8 "PO-Revision-Date: 2017-06-05 17:24+0200\n" 9 9 "Last-Translator: Grégory Viguier <i18n@screenfeed.fr>\n" 10 10 "Language-Team: Grégory Viguier <i18n@screenfeed.fr>\n" … … 23 23 "X-Poedit-SearchPathExcluded-0: *.js\n" 24 24 25 #. Translators: 1 is the plugin name.26 #: inc/activate.php: 5025 #. translators: 1 is the plugin name. 26 #: inc/activate.php:48 27 27 #, php-format 28 28 msgid "%s has not been activated." 29 29 msgstr "%s n’a pas été activé." 30 30 31 #: inc/activate.php:5 231 #: inc/activate.php:50 inc/functions/settings-page.php:22 32 32 msgid "Error" 33 33 msgstr "Erreur" 34 34 35 #. Translators: 1 is the plugin name.36 #: inc/activate.php:11 535 #. translators: 1 is the plugin name. 36 #: inc/activate.php:113 37 37 #, php-format 38 38 msgid "It seems your server configuration prevents the plugin to work properly. %s won't work." 39 39 msgstr "Il semble que votre configuration serveur empêche l’extension de fonctionner correctement. %s ne pourra pas fonctionner." 40 40 41 #. Translators: 1 is the plugin name.42 #: inc/activate.php:11 741 #. translators: 1 is the plugin name. 42 #: inc/activate.php:115 43 43 #, php-format 44 44 msgid "It seems the url rewrite module is not activated on your server. %s won't work." 45 45 msgstr "Il semble que le module de réécriture d’url n’est pas activé sur votre serveur. %s ne pourra pas fonctionner." 46 46 47 #. Translators: 1, 2, and 3 are server technologies (Apache, Nginx, IIS7), 4 is the plugin name.48 #: inc/activate.php:11 947 #. translators: 1, 2, and 3 are server technologies (Apache, Nginx, IIS7), 4 is the plugin name. 48 #: inc/activate.php:117 49 49 #, php-format 50 50 msgid "It seems your server does not use %1$s, %2$s, nor %3$s. %4$s won't work." 51 51 msgstr "Il semble que votre serveur n’utilise ni %1$s, %2$s, ou %3$s. %4$s ne pourra pas fonctionner." 52 52 53 #. Translators: 1 is the plugin name, 2 is a file name, 3 is a "Move Login" link.54 #: inc/activate.php:1 2153 #. translators: 1 is the plugin name, 2 is a file name, 3 is a "Move Login" link. 54 #: inc/activate.php:119 55 55 #, php-format 56 56 msgid "%1$s needs access to the %2$s file. Please visit the %3$s settings page and copy/paste the given code into the %2$s file." 57 57 msgstr "%1$s a besoin d’accéder au fichier %2$s. Veuillez vous rendre sur la page de réglages de %3$s et veuillez copier/coller le code fourni dans le fichier %2$s." 58 58 59 #. Translators: 1 is a server technology (Nginx), 2 is a "Move Login" link, 3 is the plugin name.60 #: inc/activate.php:12 359 #. translators: 1 is a server technology (Nginx), 2 is a "Move Login" link, 3 is the plugin name. 60 #: inc/activate.php:121 61 61 #, php-format 62 62 msgid "It seems your server uses a %1$ system. You have to edit the rewrite rules by yourself in the configuration file. Please visit the %2$s settings page and take a look at the rewrite rules. %3$s is running but won't work correctly until you deal with those rewrite rules." 63 63 msgstr "Il semble que votre serveur utilise un système %1$s. Vous devez éditer les règles de réécriture par vous-même dans le fichier de configuration. Veuillez vous rendre sur la page de réglages de %2$s et jetez un œil aux règles de réécriture. %3$s fonctionne mais ne pourra pas le faire correctement tant que vous ne vous serez pas occupé de ces règles." 64 64 65 #: inc/admin.php:15 2 inc/functions/deprecated.php:8766 #: inc/redirections-and-dies.php:1 8165 #: inc/admin.php:151 inc/functions/deprecated.php:85 66 #: inc/redirections-and-dies.php:195 67 67 msgid "Cheatin’ uh?" 68 68 msgstr "Alors, on triche ?" 69 69 70 #: inc/classes/class-sfml-options.php: 31271 #: inc/classes/class-sfml-options.php: 31970 #: inc/classes/class-sfml-options.php:270 71 #: inc/classes/class-sfml-options.php:277 72 72 msgid "Display an error message" 73 73 msgstr "Afficher un message d'erreur" 74 74 75 #: inc/classes/class-sfml-options.php: 31376 #: inc/classes/class-sfml-options.php: 32075 #: inc/classes/class-sfml-options.php:271 76 #: inc/classes/class-sfml-options.php:278 77 77 msgid "Trigger a «Page not found» error" 78 78 msgstr "Déclencher une erreur « Page non trouvée »" 79 79 80 #: inc/classes/class-sfml-options.php: 31481 #: inc/classes/class-sfml-options.php: 32180 #: inc/classes/class-sfml-options.php:272 81 #: inc/classes/class-sfml-options.php:279 82 82 msgid "Redirect to a \"WordPress\" «Page not found» error page" 83 83 msgstr "Rediriger vers une page d’erreur « Page non trouvée » de WordPress" 84 84 85 #: inc/classes/class-sfml-options.php: 31586 #: inc/classes/class-sfml-options.php: 32285 #: inc/classes/class-sfml-options.php:273 86 #: inc/classes/class-sfml-options.php:280 87 87 msgid "Redirect to the home page" 88 88 msgstr "Rediriger vers la page d’accueil" 89 89 90 #: inc/classes/class-sfml-options.php: 31890 #: inc/classes/class-sfml-options.php:276 91 91 msgid "Do nothing, redirect to the new login page (not recommended)" 92 92 msgstr "Ne rien faire, rediriger vers la nouvelle page de connexion (non recommandé)" 93 93 94 #. Translators: %s is an URL slug name.95 #: inc/classes/class-sfml-options.php:4 9794 #. translators: %s is an URL slug name. 95 #: inc/classes/class-sfml-options.php:420 inc/functions/settings-page.php:25 96 96 #, php-format 97 97 msgid "The slug %s is forbidden." … … 100 100 msgstr[1] "Les identifiants %s sont interdits." 101 101 102 #: inc/classes/class-sfml-options.php: 500102 #: inc/classes/class-sfml-options.php:423 103 103 msgid "The links can't have the same slugs." 104 104 msgstr "Les liens ne peuvent pas avoir les mêmes identifiants." 105 105 106 #. Translators: 1: WordPress hook name, 2: version number, 3: alternative hook name. 107 #: inc/functions/compat.php:285 106 #: inc/functions/compat.php:283 108 107 #, php-format 109 108 msgid "%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead." 110 109 msgstr "%1$s est <strong>déprécié</strong> depuis la version %2$s ! Utilisez %3$s à la place." 111 110 112 #. Translators: 1: WordPress hook name, 2: version number. 113 #: inc/functions/compat.php:288 111 #: inc/functions/compat.php:286 114 112 #, php-format 115 113 msgid "%1$s is <strong>deprecated</strong> since version %2$s with no alternative available." 116 114 msgstr "%1$s est <strong>déprécié</strong> depuis la version %2$s, aucune alternative n’est disponible." 117 115 118 #: inc/functions/deprecated.php:8 7 inc/redirections-and-dies.php:112119 #: inc/redirections-and-dies.php:1 81116 #: inc/functions/deprecated.php:85 inc/redirections-and-dies.php:110 117 #: inc/redirections-and-dies.php:195 120 118 msgid "Nope :)" 121 119 msgstr "Raté :)" 122 120 123 #: inc/functions/settings-page.php:20 121 #: inc/functions/settings-page.php:23 122 msgid "Error. Please reload the page." 123 msgstr "Erreur. Veuillez recharger la page." 124 125 #: inc/functions/settings-page.php:26 126 msgctxt "adjective" 127 msgid "Duplicate." 128 msgstr "Doublon." 129 130 #: inc/functions/settings-page.php:57 124 131 msgid "Choose your new URLs" 125 132 msgstr "Choisissez vos nouvelles adresses" 126 133 127 #: inc/functions/settings-page.php: 21134 #: inc/functions/settings-page.php:58 128 135 msgid "Access" 129 136 msgstr "Accès" 130 137 131 #: inc/functions/settings-page.php: 43138 #: inc/functions/settings-page.php:82 132 139 msgid "Only lowercase letters, digits, - and _" 133 140 msgstr "Seulement des lettres minuscules, chiffres, - et _" 134 141 135 #: inc/functions/settings-page.php: 61142 #: inc/functions/settings-page.php:101 136 143 msgid "When a logged out user attempts to access the old login page." 137 144 msgstr "Quand un utilisateur non connecté tente d'accéder à l'ancienne page de connexion." 138 145 139 #: inc/functions/settings-page.php: 68146 #: inc/functions/settings-page.php:108 140 147 msgctxt "noun" 141 148 msgid "Redirects" 142 149 msgstr "Redirections" 143 150 144 #: inc/functions/settings-page.php: 77151 #: inc/functions/settings-page.php:117 145 152 msgid "Instead of redirecting a logged out user to the new login page:" 146 153 msgstr "Plutôt que de rediriger un utilisateur non connecté vers la nouvelle page de connexion :" 147 154 148 #. Translators: %s is anoption value.149 #: inc/functions/settings-page.php: 159 inc/functions/settings-page.php:202155 #. translators: %s is a default option value. 156 #: inc/functions/settings-page.php:201 inc/functions/settings-page.php:248 150 157 #, php-format 151 158 msgctxt "default value" … … 153 160 msgstr "(défaut : %s)" 154 161 155 #. Translators: 1 is a file name, 2 is a file path, 3 and 4 are small parts of code.156 #: inc/functions/settings-page.php:2 29 inc/functions/settings-page.php:261162 #. translators: 1 is a file name, 2 is a file path, 3 and 4 are small parts of code. 163 #: inc/functions/settings-page.php:276 inc/functions/settings-page.php:308 157 164 #, php-format 158 165 msgid "If the plugin fails to add the new rewrite rules to your %1$s file, add the following to your %1$s file in %2$s, replacing other %3$s rules if they exist, <strong>above</strong> the line reading %4$s:" 159 166 msgstr "Si l’extension ne peut ajouter les nouvelles règles de réécriture à votre fichier %1$s, ajoutez les lignes suivantes à votre fichier %1$s dans %2$s, en remplacement des autres règles liées à %3$s si elles existent, <strong>au-dessus</strong> de la ligne %4$s :" 160 167 161 #. Translators: 1 is a file name, 2 is a small part of code.162 #: inc/functions/settings-page.php:2 44168 #. translators: 1 is a file name, 2 is a small part of code. 169 #: inc/functions/settings-page.php:291 163 170 #, php-format 164 171 msgid "The plugin can't add the new rewrite rules to your %1$s file by itself, you will need to add them manually inside the %2$s block." 165 172 msgstr "L’extension ne peut ajouter les nouvelles règles de réécriture à votre fichier %1$s, vous devrez les ajouter manuellement à l’intérieur du bloc %2$s." 166 173 167 #. Translators: %s is a file name.168 #: inc/functions/settings-page.php: 277174 #. translators: %s is a file name. 175 #: inc/functions/settings-page.php:324 169 176 #, php-format 170 177 msgid "Your %s file is not writable." 171 178 msgstr "Votre fichier %s n’est pas inscriptible." 172 179 173 #. Translators: 1 is a constant name, 2 is a constant value.174 #: inc/functions/settings-page.php: 285180 #. translators: 1 is a constant name, 2 is a constant value. 181 #: inc/functions/settings-page.php:332 175 182 #, php-format 176 183 msgid "The constant %1$s is defined to %2$s, the settings below won't take effect." 177 184 msgstr "La constante %1$s est définie à %2$s, les réglages ci-dessous ne prendront pas effet." 178 185 179 #: inc/redirections-and-dies.php:11 2186 #: inc/redirections-and-dies.php:110 180 187 msgid "No no no, the login form is not here." 181 188 msgstr "Non non non, le formulaire de connexion ne se trouve pas ici." 182 189 183 #. Translators: Description of the plugin/theme184 190 #. Description of the plugin/theme 185 #: sf-move-login.php:93186 191 msgid "Change your login URL." 187 192 msgstr "Changez l’url de votre page de connexion." -
sf-move-login/trunk/languages/sf-move-login.pot
r1664767 r1671125 3 3 msgstr "" 4 4 "Project-Id-Version: SF Move Login\n" 5 "POT-Creation-Date: 2017-0 5-25 15:27+0200\n"5 "POT-Creation-Date: 2017-06-05 17:17+0200\n" 6 6 "PO-Revision-Date: 2017-05-25 15:27+0200\n" 7 7 "Last-Translator: Grégory Viguier <i18n@screenfeed.fr>\n" … … 15 15 "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 16 16 "X-Poedit-SourceCharset: UTF-8\n" 17 "X-Textdomain-Support: yes\n" 17 18 "X-Poedit-WPHeader: sf-move-login.php\n" 18 19 "X-Poedit-SearchPath-0: .\n" 19 20 "X-Poedit-SearchPathExcluded-0: *.js\n" 20 21 21 #. Translators: 1 is the plugin name.22 #: inc/activate.php: 5022 #. translators: 1 is the plugin name. 23 #: inc/activate.php:48 23 24 #, php-format 24 25 msgid "%s has not been activated." 25 26 msgstr "" 26 27 27 #: inc/activate.php:5 228 #: inc/activate.php:50 inc/functions/settings-page.php:22 28 29 msgid "Error" 29 30 msgstr "" 30 31 31 #. Translators: 1 is the plugin name.32 #: inc/activate.php:11 532 #. translators: 1 is the plugin name. 33 #: inc/activate.php:113 33 34 #, php-format 34 35 msgid "It seems your server configuration prevents the plugin to work properly. %s won't work." 35 36 msgstr "" 36 37 37 #. Translators: 1 is the plugin name.38 #: inc/activate.php:11 738 #. translators: 1 is the plugin name. 39 #: inc/activate.php:115 39 40 #, php-format 40 41 msgid "It seems the url rewrite module is not activated on your server. %s won't work." 41 42 msgstr "" 42 43 43 #. Translators: 1, 2, and 3 are server technologies (Apache, Nginx, IIS7), 4 is the plugin name.44 #: inc/activate.php:11 944 #. translators: 1, 2, and 3 are server technologies (Apache, Nginx, IIS7), 4 is the plugin name. 45 #: inc/activate.php:117 45 46 #, php-format 46 47 msgid "It seems your server does not use %1$s, %2$s, nor %3$s. %4$s won't work." 47 48 msgstr "" 48 49 49 #. Translators: 1 is the plugin name, 2 is a file name, 3 is a "Move Login" link.50 #: inc/activate.php:1 2150 #. translators: 1 is the plugin name, 2 is a file name, 3 is a "Move Login" link. 51 #: inc/activate.php:119 51 52 #, php-format 52 53 msgid "%1$s needs access to the %2$s file. Please visit the %3$s settings page and copy/paste the given code into the %2$s file." 53 54 msgstr "" 54 55 55 #. Translators: 1 is a server technology (Nginx), 2 is a "Move Login" link, 3 is the plugin name.56 #: inc/activate.php:12 356 #. translators: 1 is a server technology (Nginx), 2 is a "Move Login" link, 3 is the plugin name. 57 #: inc/activate.php:121 57 58 #, php-format 58 59 msgid "It seems your server uses a %1$ system. You have to edit the rewrite rules by yourself in the configuration file. Please visit the %2$s settings page and take a look at the rewrite rules. %3$s is running but won't work correctly until you deal with those rewrite rules." 59 60 msgstr "" 60 61 61 #: inc/admin.php:15 2 inc/functions/deprecated.php:8762 #: inc/redirections-and-dies.php:1 8162 #: inc/admin.php:151 inc/functions/deprecated.php:85 63 #: inc/redirections-and-dies.php:195 63 64 msgid "Cheatin’ uh?" 64 65 msgstr "" 65 66 66 #: inc/classes/class-sfml-options.php: 31267 #: inc/classes/class-sfml-options.php: 31967 #: inc/classes/class-sfml-options.php:270 68 #: inc/classes/class-sfml-options.php:277 68 69 msgid "Display an error message" 69 70 msgstr "" 70 71 71 #: inc/classes/class-sfml-options.php: 31372 #: inc/classes/class-sfml-options.php: 32072 #: inc/classes/class-sfml-options.php:271 73 #: inc/classes/class-sfml-options.php:278 73 74 msgid "Trigger a «Page not found» error" 74 75 msgstr "" 75 76 76 #: inc/classes/class-sfml-options.php: 31477 #: inc/classes/class-sfml-options.php: 32177 #: inc/classes/class-sfml-options.php:272 78 #: inc/classes/class-sfml-options.php:279 78 79 msgid "Redirect to a \"WordPress\" «Page not found» error page" 79 80 msgstr "" 80 81 81 #: inc/classes/class-sfml-options.php: 31582 #: inc/classes/class-sfml-options.php: 32282 #: inc/classes/class-sfml-options.php:273 83 #: inc/classes/class-sfml-options.php:280 83 84 msgid "Redirect to the home page" 84 85 msgstr "" 85 86 86 #: inc/classes/class-sfml-options.php: 31887 #: inc/classes/class-sfml-options.php:276 87 88 msgid "Do nothing, redirect to the new login page (not recommended)" 88 89 msgstr "" 89 90 90 #. Translators: %s is an URL slug name.91 #: inc/classes/class-sfml-options.php:4 9791 #. translators: %s is an URL slug name. 92 #: inc/classes/class-sfml-options.php:420 inc/functions/settings-page.php:25 92 93 #, php-format 93 94 msgid "The slug %s is forbidden." … … 96 97 msgstr[1] "" 97 98 98 #: inc/classes/class-sfml-options.php: 50099 #: inc/classes/class-sfml-options.php:423 99 100 msgid "The links can't have the same slugs." 100 101 msgstr "" 101 102 102 #. Translators: 1: WordPress hook name, 2: version number, 3: alternative hook name. 103 #: inc/functions/compat.php:285 103 #: inc/functions/compat.php:283 104 104 #, php-format 105 105 msgid "%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead." 106 106 msgstr "" 107 107 108 #. Translators: 1: WordPress hook name, 2: version number. 109 #: inc/functions/compat.php:288 108 #: inc/functions/compat.php:286 110 109 #, php-format 111 110 msgid "%1$s is <strong>deprecated</strong> since version %2$s with no alternative available." 112 111 msgstr "" 113 112 114 #: inc/functions/deprecated.php:8 7 inc/redirections-and-dies.php:112115 #: inc/redirections-and-dies.php:1 81113 #: inc/functions/deprecated.php:85 inc/redirections-and-dies.php:110 114 #: inc/redirections-and-dies.php:195 116 115 msgid "Nope :)" 117 116 msgstr "" 118 117 119 #: inc/functions/settings-page.php:20 118 #: inc/functions/settings-page.php:23 119 msgid "Error. Please reload the page." 120 msgstr "" 121 122 #: inc/functions/settings-page.php:26 123 msgctxt "adjective" 124 msgid "Duplicate." 125 msgstr "" 126 127 #: inc/functions/settings-page.php:57 120 128 msgid "Choose your new URLs" 121 129 msgstr "" 122 130 123 #: inc/functions/settings-page.php: 21131 #: inc/functions/settings-page.php:58 124 132 msgid "Access" 125 133 msgstr "" 126 134 127 #: inc/functions/settings-page.php: 43135 #: inc/functions/settings-page.php:82 128 136 msgid "Only lowercase letters, digits, - and _" 129 137 msgstr "" 130 138 131 #: inc/functions/settings-page.php: 61139 #: inc/functions/settings-page.php:101 132 140 msgid "When a logged out user attempts to access the old login page." 133 141 msgstr "" 134 142 135 #: inc/functions/settings-page.php: 68143 #: inc/functions/settings-page.php:108 136 144 msgctxt "noun" 137 145 msgid "Redirects" 138 146 msgstr "" 139 147 140 #: inc/functions/settings-page.php: 77148 #: inc/functions/settings-page.php:117 141 149 msgid "Instead of redirecting a logged out user to the new login page:" 142 150 msgstr "" 143 151 144 #. Translators: %s is anoption value.145 #: inc/functions/settings-page.php: 159 inc/functions/settings-page.php:202152 #. translators: %s is a default option value. 153 #: inc/functions/settings-page.php:201 inc/functions/settings-page.php:248 146 154 #, php-format 147 155 msgctxt "default value" … … 149 157 msgstr "" 150 158 151 #. Translators: 1 is a file name, 2 is a file path, 3 and 4 are small parts of code.152 #: inc/functions/settings-page.php:2 29 inc/functions/settings-page.php:261159 #. translators: 1 is a file name, 2 is a file path, 3 and 4 are small parts of code. 160 #: inc/functions/settings-page.php:276 inc/functions/settings-page.php:308 153 161 #, php-format 154 162 msgid "If the plugin fails to add the new rewrite rules to your %1$s file, add the following to your %1$s file in %2$s, replacing other %3$s rules if they exist, <strong>above</strong> the line reading %4$s:" 155 163 msgstr "" 156 164 157 #. Translators: 1 is a file name, 2 is a small part of code.158 #: inc/functions/settings-page.php:2 44165 #. translators: 1 is a file name, 2 is a small part of code. 166 #: inc/functions/settings-page.php:291 159 167 #, php-format 160 168 msgid "The plugin can't add the new rewrite rules to your %1$s file by itself, you will need to add them manually inside the %2$s block." 161 169 msgstr "" 162 170 163 #. Translators: %s is a file name.164 #: inc/functions/settings-page.php: 277171 #. translators: %s is a file name. 172 #: inc/functions/settings-page.php:324 165 173 #, php-format 166 174 msgid "Your %s file is not writable." 167 175 msgstr "" 168 176 169 #. Translators: 1 is a constant name, 2 is a constant value.170 #: inc/functions/settings-page.php: 285177 #. translators: 1 is a constant name, 2 is a constant value. 178 #: inc/functions/settings-page.php:332 171 179 #, php-format 172 180 msgid "The constant %1$s is defined to %2$s, the settings below won't take effect." 173 181 msgstr "" 174 182 175 #: inc/redirections-and-dies.php:11 2183 #: inc/redirections-and-dies.php:110 176 184 msgid "No no no, the login form is not here." 177 185 msgstr "" 178 186 179 #. Translators: Description of the plugin/theme180 187 #. Description of the plugin/theme 181 #: sf-move-login.php:93182 188 msgid "Change your login URL." 183 189 msgstr "" -
sf-move-login/trunk/readme.txt
r1664767 r1671125 4 4 Tags: login, logout, url, security 5 5 Requires at least: 3.1 6 Tested up to: 4.7. 46 Tested up to: 4.7.5 7 7 Stable tag: trunk 8 8 License: GPLv3 … … 68 68 == Changelog == 69 69 70 = 2.5.3 = 71 72 * 2017/06/05 73 * New: preview your URLs while typing. 74 * New: you can leave a field empty to set its default value. 75 * Improved URL duplicates detection. 76 * Fixed the "Lost Password" redirection (and others). 77 * Dev stuff: fixed the filters in `sfml_is_apache()`, `sfml_is_iis7()`, and `sfml_is_nginx()`. 78 * Nerd stuff: improved the whole plugin code quality by updating the Coding Standard rules and applying new ones. Changed a few things in the class `SFML_Options`. 79 70 80 = 2.5.2 = 71 81 72 82 * 2017/05/25 73 * New: a new option is available. Instead of redirecting to the a "WordPress" 404 error page, you can choose to directly trigger the 404 error. Pro: the user is not directed, the URL doesn't change. Con: the user sees the browser error page, it probably is ugly(but do we really care?).83 * New: a new option is available. Instead of redirecting to the a "WordPress" 404 error page, you can choose to directly trigger the 404 error. Pro: the user is not directed, the URL doesn't change. Con: the user sees the browser error page, it probably is a simple white page (but do we really care?). 74 84 * Fixed the blank page that was displaying instead of redirecting the user to the new login URL. 75 * Dev stuff: in case the plugin has trouble determining your server technology, take a look at `sfml_is_apache()`, `sfml_is_iis7()`, and `sfml_is_nginx()`: returned values can be filtered with a MU plugin. 85 * Dev stuff: you can now add custom options to the two existing radio groups. 86 * Nerd stuff: in case the plugin has trouble determining your server technology, take a look at `sfml_is_apache()`, `sfml_is_iis7()`, and `sfml_is_nginx()`: returned values can be filtered with a MU plugin. 76 87 77 88 = 2.5.1 = -
sf-move-login/trunk/sf-move-login.php
r1664767 r1671125 4 4 * Plugin URI: https://www.screenfeed.fr/plugin-wp/move-login/ 5 5 * Description: Change your login URL. 6 * Version: 2.5. 26 * Version: 2.5.3 7 7 * Author: Grégory Viguier 8 8 * Author URI: https://www.screenfeed.fr/ … … 14 14 */ 15 15 16 if ( ! defined( 'ABSPATH' ) ) { 17 die( 'Cheatin\' uh?' ); 18 } 16 defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' ); 19 17 20 18 if ( empty( $GLOBALS['wp_version'] ) || version_compare( $GLOBALS['wp_version'], '3.1' ) < 0 || version_compare( phpversion(), '5.3' ) < 0 ) { … … 26 24 /*------------------------------------------------------------------------------------------------*/ 27 25 28 define( 'SFML_VERSION', '2.5. 2' );26 define( 'SFML_VERSION', '2.5.3' ); 29 27 define( 'SFML_FILE', __FILE__ ); 30 28 define( 'SFML_PLUGIN_BASENAME', plugin_basename( SFML_FILE ) ); … … 56 54 57 55 // Administration. 58 if ( is_admin() && ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { 59 include_once( SFML_PLUGIN_DIR . 'inc/admin.php' ); 56 if ( is_admin() ) { 57 if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { 58 include_once( SFML_PLUGIN_DIR . 'inc/ajax.php' ); 59 } else { 60 include_once( SFML_PLUGIN_DIR . 'inc/admin.php' ); 61 } 60 62 } 61 63 … … 88 90 89 91 load_plugin_textdomain( 'sf-move-login', false, dirname( plugin_basename( SFML_FILE ) ) . '/languages' ); 90 91 // Make sure Poedit keeps our plugin headers.92 /** Translators: Description of the plugin/theme */93 __( 'Change your login URL.', 'sf-move-login' );94 92 } -
sf-move-login/trunk/uninstall.php
r1622279 r1671125 1 1 <?php 2 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 3 die(); 4 } 2 defined( 'WP_UNINSTALL_PLUGIN' ) || die( 'Cheatin\' uh?' ); 5 3 6 4
Note: See TracChangeset
for help on using the changeset viewer.