• Resolved tezalsec

    (@tezalsec)


    Hi,

    thank you for the plugin. I have this strange thing happening I can not figure out what causes it. Redis is working fine, and it is not active on admin pages.

    However, some actions and links just don’t work, it looks like WP chokes on the urls used by redis. They get redirected to my 404 page. Flushing redis makes no difference. I also do not experience this with other plugins, only with redis-related actions/links.

    WORKING FINE:

    setting page: wp-admin/options-general.php?page=redis-cache
    updating via the plugin page

    NOT WORKING (CRASHING OR SENT TO 404):

    detail link:
    /wp-admin/plugin-install.php?tab=plugin-information&plugin=redis-cache&section=changelog&TB_iframe=true&width=640&height=662

    updating action via the updates page: no visible link, but crashes

    deactivate link
    /wp-admin/plugins.php?action=deactivate&plugin=redis-cache%2Fredis-cache.php&plugin_status=all&paged=1&s&_wpnonce=55fbbf6adb

    Do you have any idea?

    Cheers.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Till Krüss

    (@tillkruess)

    Hi @tezalsec!

    and it is not active on admin pages.

    Can you post your diagnostics, because Redis object cache is either active everywhere, or not at all.

    Have you tried flushing your entire Redis database? redis-cli FLUSHALL

    Thread Starter tezalsec

    (@tezalsec)

    Hi Till,

    the issue I am describing stands apart from what you are describing. Apart from these links/actions not working, Redis is functioning perfectly.

    I flush all the time. And I wrote a little function that withholds redis from certain pages, including the entire admin area (except the redis settings). I’ll paste it here, maybe it helps someone.

    /* 
     * Redis activation
    **/
    function wp_redis_activate() {
    
    	$url = "https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    
    	// activate only on redis config page, to get status
    	if (strpos(strtolower($url), 'redis') !== FALSE) { return TRUE; }
    
    	// no redis as logged in admin (except for above redis setting page)
            if(wp_login_cookie_exists()) { return FALSE; }
    
    	// exclusion pages, expand if needed
    	$excluded_pages = array("wp-admin", "admin", "login", "logout", "login", "ajax", "json", "404", "cancel", "contact", "cart", "checkout", "video", "event", "session", "post_type");
    
    	// loop through exclusion pages
    	foreach ($excluded_pages as $excluded_page) {
    		if (strpos(strtolower($url), $excluded_page) !== FALSE) {
    			// exclusion page found, do not activate
    			return FALSE;
    		}
    	}
    	// no exclusion reasons found, activate redis
    	return TRUE;
    }
    if (wp_redis_activate()) { 
    	define( 'WP_REDIS_DISABLED', false ); //activate
    } else {
    	define( 'WP_REDIS_DISABLED', true );  //deactivate	
    }
    Plugin Author Till Krüss

    (@tillkruess)

    @tezalsec: Excluding URLs will break your cache data. An object cache must be enabled on all pages.

    Thread Starter tezalsec

    (@tezalsec)

    Really? Wow, I really thought it was functioning fine. Frontend pages are faster than without it. The CLI monitoring behaves exactly as I would hope to when visiting pages.

    Having Redis active on my backend gave me way too much outdated admin data, I rather wait a little longer and get fresh data in the backend.

    I guess you suspect my issues are a result of the excluding of urls? Because these issues only happened recently, long after setting up my solution of excluding urls.

    Thank you.

    Plugin Author Till Krüss

    (@tillkruess)

    Really? Wow, I really thought it was functioning fine.

    Yeah, page caching and object caching is vastly different.

    I guess you suspect my issues are a result of the excluding of urls?

    Yes, it is. You can exclude cache groups however.

    Check out the WP_REDIS_IGNORED_GROUPS constant:
    https://github.com/rhubarbgroup/redis-cache/wiki/Configuration-Options#wp_redis_global_groups-default-see-below

    Thread Starter tezalsec

    (@tezalsec)

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘redis admin links not working’ is closed to new replies.