iThemes Security (formerly Better WP Security)
[resolved] Infinite Scrolling and "Load More Posts" not working (4 posts)

  1. Keezie
    Posted 3 years ago #

    I am using the wordpress 2012 theme with no modifications. When the Better WP Security plugin is activated the jetpack infinite scrolling and "load more posts" at the bottom of the page just will not work. upon deactivating this plugin, they work fine. i tried disabling most of the checkboxes in the "tweaks" section to no avail

    any help is appreciated. thanks!


  2. gabrewat
    Posted 3 years ago #

    Same problem as Keezie with Jetpack's Infinite Scroll enabled.

    I disabled BWS with a global mu-plugin I created just for the sites that use Infinite Scroll in the theme and scrolling worked again.

    The only problem is that because BWS was now disabled for those sites, they didn't get login protection and therefore started getting lots on automated login attempts.

    I hope this can be fixed as I really like Infinite Scrolling feature of Jetpack.

  3. gabrewat
    Posted 3 years ago #

    After a little investigating and testing, was able to make Infinite Scrolling work by disabling one of Better WP Security's Tweaks. Look under Tweaks tab to bottom (Other Tweaks) and disable "Prevent long URL strings" setting.

    Infinite Scrolling generates a 500-600 character URL string which exceeds BWS max URL string length (255) when this "tweak" is enabled.

    I've made changes to inc/secure.php of the BWS plugin source to allow for Infinite Scroll longer URL string:

    //ban extra-long urls if turned on
                                    if ( $bwpsoptions['st_longurl'] == 1 && ! is_admin() ) {
                                            if ( strlen( $_SERVER['REQUEST_URI'] ) > 255 ||
                                                    strpos( $_SERVER['REQUEST_URI'], "eval(" ) ||
                                                    strpos( $_SERVER['REQUEST_URI'], "CONCAT" ) ||
                                                    strpos( $_SERVER['REQUEST_URI'], "UNION+SELECT" ) ||
                                                    strpos( $_SERVER['REQUEST_URI'], "base64" ) ) {
    if ( strpos( $_SERVER['REQUEST_URI'], "action=infinite_scroll" ) == 0 ) {
                                                    @header( 'HTTP/1.1 414 Request-URI Too Long' );
                                                    @header( 'Status: 414 Request-URI Too Long' );
                                                    @header( 'Cache-Control: no-cache, must-revalidate' );
                                                    @header( 'Expires: Thu, 22 Jun 1978 00:28:00 GMT' );
                                                    @header( 'Connection: Close' );

    Perhaps the BWS plugin should allow for exceptions to be added to allow longer URL strings for offending plugins.

  4. Keezie
    Posted 3 years ago #

    thank you so much! that did the trick. i'd much rather untick that one little box than have to disable the entire plugin. you're the man!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.