Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation inaccurately states redirect loops detection is disabled by default #409

Open
1 task done
mi5t4n opened this issue Nov 27, 2024 · 2 comments
Open
1 task done
Labels
needs:documentation This requires documentation. type:bug Something isn’t working.

Comments

@mi5t4n
Copy link

mi5t4n commented Nov 27, 2024

Describe the bug

The srm_check_for_possible_redirect_loops is enabled by default in code

/**
* Filter whether possible redirect loop checking is enabled or not.
*
* @hook srm_check_for_possible_redirect_loops
* @param {bool} $check_possible_loop Whether to check for redirect loops. Default true.
* @returns {bool} Bool to check for redirect loops.
*/
$possible_loop = apply_filters( 'srm_check_for_possible_redirect_loops', true );

But, in the documentation is it stated that it's disabled by default.

### Redirect loops detection
By default redirect loop detection is disabled. To prevent redirect loops you can filter `srm_check_for_possible_redirect_loops`.
```php
add_filter( 'srm_check_for_possible_redirect_loops', '__return_true' );
```

It seems srm_check_for_possible_redirect_loops default value was changed from false to true in this commit. cfdeb13

Steps to Reproduce

  1. Go to the READ.md

    ### Redirect loops detection
    By default redirect loop detection is disabled. To prevent redirect loops you can filter `srm_check_for_possible_redirect_loops`.
    ```php
    add_filter( 'srm_check_for_possible_redirect_loops', '__return_true' );
    ```

  2. Go to the inc/class-srm-post-type.php file.

    /**
    * Filter whether possible redirect loop checking is enabled or not.
    *
    * @hook srm_check_for_possible_redirect_loops
    * @param {bool} $check_possible_loop Whether to check for redirect loops. Default true.
    * @returns {bool} Bool to check for redirect loops.
    */
    $possible_loop = apply_filters( 'srm_check_for_possible_redirect_loops', true );

  3. You can see the inconsistency.

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mi5t4n mi5t4n added the type:bug Something isn’t working. label Nov 27, 2024
@vikrampm1 vikrampm1 added the needs:documentation This requires documentation. label Nov 27, 2024
@mi5t4n mi5t4n changed the title Documentation Inaccurately States Redirect Loops Detection is Disabled by Default Documentation inaccurately states redirect loops detection is disabled by default Nov 28, 2024
@mi5t4n
Copy link
Author

mi5t4n commented Nov 28, 2024

Duplicate #375

@mi5t4n
Copy link
Author

mi5t4n commented Nov 28, 2024

@vikrampm1 If it's a documentation issue, I will be glad to raise a PR to fix the documentation.

@jeffpaul jeffpaul moved this from Incoming to To Do in Open Source Practice Dec 2, 2024
@jeffpaul jeffpaul added this to the Future Release milestone Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:documentation This requires documentation. type:bug Something isn’t working.
Projects
Status: To Do
Development

No branches or pull requests

3 participants