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

Still cant get it work after follow all the instructions #9

Open
happyej0131 opened this issue Mar 24, 2023 · 16 comments
Open

Still cant get it work after follow all the instructions #9

happyej0131 opened this issue Mar 24, 2023 · 16 comments

Comments

@happyej0131
Copy link

happyej0131 commented Mar 24, 2023

After follow all instructions, logged in users still very slow for 1st visit even the whole website is cache preloaded for guess visitor. (Logged out users work normally)

Mysite link : https://kch.ddnsfree.com

User login for u to test :
Username : sanderdekroon
Users password : 123456

Pls help me take a look, I really need this plugin/solution to work. 🙏

=============================
Mysite : advanced-cache.php
https://files.fm/f/6w3vfnmvx

Screenshot
IMG_20230325_070924_215

IMG_20230325_070923_917

IMG_20230325_070924_302

IMG_20230325_071151_548

@sanderdekroon
Copy link
Owner

I have not tested the addon with separate mobile caches. Could you maybe disable this option and try again?
Second, what is the lifetime of the cache?

@happyej0131
Copy link
Author

OK I try with disable separate mobile cache.
(But I really need separate mobile cache too)

0 lifetime.

Later get back to u 😀. Thank you for reply 🙏

@happyej0131
Copy link
Author

Just tested with disable separate mobile cache. The result still same.. logged-in users still slow for 1st visit.

@meirkalmus
Copy link

same issue - doesnt work for me and generates two common caches - looged in and not logged in folders

@happyej0131
Copy link
Author

I'm using nginx, you?

@meirkalmus
Copy link

meirkalmus commented Mar 27, 2023 via email

@sanderdekroon
Copy link
Owner

I'll try and look into this on friday.

@happyej0131
Copy link
Author

Okok thank you very much.🙏🙏

@meirkalmus
Copy link

thanks too:)

@meirkalmus
Copy link

something new in this issue?

@happyej0131
Copy link
Author

I'll try and look into this on friday.

Are you still working on this issue?😀

@meirkalmus
Copy link

please inform if you have intencions to fix the issue of this plugin.
thanks

@sanderdekroon
Copy link
Owner

I am unable to reproduce this issue. I've tested it with an existing WooCommerce shop and a relatively 'clean' installation with WP-Rocket 3.13.0.2.

Please make sure you've followed the installation steps correctly. I have updated the installation instructions to clarify some steps.

I would recommend to follow the installation instructions step by step. Also make sure you delete the original advanced-cache.php file from your server and visit the WP-Rocket settings page to generate a new one. After that, check that the new advanced-cache.php file contains the SdkGuestCache class. If it doesn't, one of the two required helpers is probably missing.

@meirkalmus
Copy link

meirkalmus commented Apr 14, 2023

did exactly by instructions, but no sdkguestcache appears in advanced-cache.php
this is the file created:

<?php

use WP_Rocket\Buffer\Cache;
use WP_Rocket\Buffer\Config;
use WP_Rocket\Buffer\Tests;

defined( 'ABSPATH' ) || exit;

define( 'WP_ROCKET_ADVANCED_CACHE', true );

$rocket_path        = '/home/762361.cloudwaysapps.com/vfnuqgunqb/public_html/wp-content/plugins/wp-rocket/';
$rocket_config_path = '/home/762361.cloudwaysapps.com/vfnuqgunqb/public_html/wp-content/wp-rocket-config/';
$rocket_cache_path  = '/home/762361.cloudwaysapps.com/vfnuqgunqb/public_html/wp-content/cache/wp-rocket/';

if (
	version_compare( phpversion(), '7.2', '<' )
	|| ! file_exists( $rocket_path )
	|| ! file_exists( $rocket_config_path )
	|| ! file_exists( $rocket_cache_path )
) {
	define( 'WP_ROCKET_ADVANCED_CACHE_PROBLEM', true );
	return;
}



spl_autoload_register(
	function( $class ) use ( $rocket_path ) {
		$rocket_classes = [
			'WP_Rocket\\Buffer\\Abstract_Buffer' => $rocket_path . 'inc/classes/Buffer/class-abstract-buffer.php',
			'WP_Rocket\\Buffer\\Cache'           => $rocket_path . 'inc/classes/Buffer/class-cache.php',
			'WP_Rocket\\Buffer\\Tests'           => $rocket_path . 'inc/classes/Buffer/class-tests.php',
			'WP_Rocket\\Buffer\\Config'          => $rocket_path . 'inc/classes/Buffer/class-config.php',
			'WP_Rocket\\Logger\\HTML_Formatter'  => $rocket_path . 'inc/classes/logger/class-html-formatter.php',
			'WP_Rocket\\Logger\\Logger'          => $rocket_path . 'inc/classes/logger/class-logger.php',
			'WP_Rocket\\Logger\\Stream_Handler'  => $rocket_path . 'inc/classes/logger/class-stream-handler.php',
			'WP_Rocket\\Traits\\Memoize'         => $rocket_path . 'inc/classes/traits/trait-memoize.php',
		];

		if ( isset( $rocket_classes[ $class ] ) ) {
			$file = $rocket_classes[ $class ];
		} elseif ( strpos( $class, 'Monolog\\' ) === 0 ) {
			$file = $rocket_path . 'vendor/monolog/monolog/src/' . str_replace( '\\', '/', $class ) . '.php';
		} elseif ( strpos( $class, 'Psr\\Log\\' ) === 0 ) {
			$file = $rocket_path . 'vendor/psr/log/' . str_replace( '\\', '/', $class ) . '.php';
		} else {
			return;
		}

		if ( file_exists( $file ) ) {
			require $file;
		}
	}
);

if ( ! class_exists( '\WP_Rocket\Buffer\Cache' ) ) {
	if ( ! defined( 'DONOTROCKETOPTIMIZE' ) ) {
		define( 'DONOTROCKETOPTIMIZE', true ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedConstantFound
	}
	return;
}

$rocket_config_class = new Config(
	[
		'config_dir_path' => $rocket_config_path,
	]
);

( new Cache(
	new Tests(
		$rocket_config_class
	),
	$rocket_config_class,
	[
		'cache_dir_path' => $rocket_cache_path,
	]
) )->maybe_init_process();

@sanderdekroon
Copy link
Owner

This probably means one of the required plugins is not (correctly) installed. This helper check for the existence of these plugins:

wp-rocket/wp-rocket.php
wp-rocket-no-cache-for-admins/wp-rocket-no-cache-for-admins.php
wp-rocket-cache-common-cache-loggedin/wp-rocket-cache-common-cache-loggedin.php

Perhaps the folders are differently named on your installation. If so, rename them and re-activate them again through WP-Admin. If you've done that, delete the advanced-cache.php file and regenerate it by visiting the WP-Rocket settings page.

@meirkalmus
Copy link

all plugins installed with right names
deleted advanced-cache.php and nothing happens
can you check in our site?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants