cachify icon indicating copy to clipboard operation
cachify copied to clipboard

cachify.hdd.htaccess.php - should generate right variables

Open 1ucay opened this issue 3 years ago • 4 comments

Hello, thank you for you work.

In wp-config.php I have some personal changes

define( 'WP_DEFAULT_THEME', 'custom' );
define( 'ADMIN_COOKIE_PATH', '/admin' ); /*Im using /admin url */
define( 'SITECOOKIEPATH', '/' );
define( 'TEST_COOKIE', WP_DEFAULT_THEME . '_test' );
define( 'LOGGED_IN_COOKIE', WP_DEFAULT_THEME . '_logged_RANDOM' );
define( 'SECURE_AUTH_COOKIE', WP_DEFAULT_THEME . '_sec_RANDOM' );
define( 'AUTH_COOKIE', WP_DEFAULT_THEME . '_RANDOM' );
define( 'PASS_COOKIE', WP_DEFAULT_THEME . 'pass_RANDOM' );
define( 'USER_COOKIE', WP_DEFAULT_THEME . 'user_RANDOM' );
define( 'RECOVERY_MODE_COOKIE', WP_DEFAULT_THEME . '_rec_RANDOM' );
/* RANDOM is hash */

Also I have define( 'WP_CONTENT_DIR', WEB_ROOT . '/app' );

So these lines

RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-content/cache)/.*
RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_

Shoul be generated over LOGGED_IN_COOKIE, admin_url(), WP_CONTENT_DIR

Thank you.

1ucay avatar Aug 04 '22 09:08 1ucay

also there should be LOGGED_IN_COOKIE

private static function _is_logged_in() {
	/* Logged in */
	if ( is_user_logged_in() ) {
		return true;
	}

	/* Cookie? */
	if ( empty( $_COOKIE ) ) {
		return false;
	}

	/* Loop */
	foreach ( $_COOKIE as $k => $v ) {
		if ( preg_match( '/^(wp-postpass|wordpress_logged_in|comment_author)_/', $k ) ) {
			return true;
		}
	}

	return false;
}

1ucay avatar May 28 '24 18:05 1ucay

@Zodiac1978 Hi Zodiac, Sorry for the interruption, but can this be edited please? Thank you.

1ucay avatar Jan 30 '25 10:01 1ucay

@1ucay Can you provide a PR? Then someone can review your changes and maybe we can merge it with less time commitment. Thanks in advance.

Zodiac1978 avatar Jan 30 '25 14:01 Zodiac1978

I could have a look at this somewhere around the weekend, doesn't look like a big deal. But I'm also happy to "just" review a PR 😉

stklcode avatar Jan 30 '25 19:01 stklcode