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

W3TC not working due to DONOTCACHEPAGE set in Wordpress SEO?? #419

Closed
sgsthebest opened this Issue Nov 29, 2013 · 7 comments

Comments

Projects
None yet
2 participants
@sgsthebest
Copy link

sgsthebest commented Nov 29, 2013

Hi,

I'm having a problem with Wordpress SEO and W3TC. In fact, I had it also testing it with WP Super Cache. No cache was working on my site, and debugging it I found that DONOTCACHEPAGE was set to true and then caching disabled. I made a grep and found this variable set in several plugins. I deactivated it one by one and finally discovered that the one causing me the trouble is Wordpress SEO. It was the last I suspected, due to the quality of Yoast's plugins...
Anyway, in file /plugins/wordpress-seo/frontend/class-frontend.php
there is this code:

function title_test_helper( $title ) {
    if ( ! defined( 'DONOTCACHEPAGE' ) )
        define( 'DONOTCACHEPAGE', true);

    if ( ! defined( 'DONOTCACHCEOBJECT' ) )
        define( 'DONOTCACHCEOBJECT', true );

    if ( ! defined( 'DONOTMINIFY' ) )
        define( 'DONOTMINIFY', true );

    global $wp_version;
    if ( $_SERVER['HTTP_USER_AGENT'] == "WordPress/${wp_version}; " . get_bloginfo( 'url' ) . " - Yoast" )
        return 'This is a Yoast Test Title';
    return $title;
}

I don't know why it is needed, but deactivating the plugin brought my cache back. So, as I don't want this plugin deactivated, I changed the code to set the variable to fales. Both plugin and cache seem to work ok, but don't know if I'm causing another trouble.

Anyone else facing the same? Do you have any clue about it?

Regards

@jdevalk

This comment has been minimized.

Copy link
Member

jdevalk commented Dec 9, 2013

Hi, sorry but you've been misinformed. title_test_helper is only called once during setup of the plugin, not all the time.

@jdevalk jdevalk closed this Dec 9, 2013

@sgsthebest

This comment has been minimized.

Copy link
Author

sgsthebest commented Dec 9, 2013

Hi,

i don't know if I am misinformed. The FACT is that commenting out this
line makes the cache work.

Best regards

El 09/12/2013 13:22, Joost de Valk escribió:

Hi, sorry but you've been misinformed. title_test_helper is only
called once during setup of the plugin, not all the time.


Reply to this email directly or view it on GitHub
#419 (comment).

@jdevalk

This comment has been minimized.

Copy link
Member

jdevalk commented Dec 9, 2013

Hmm... That's... weird. Reopening. We should prevent that from happening.

@jdevalk jdevalk reopened this Dec 9, 2013

@jdevalk jdevalk closed this in ce028a7 Dec 9, 2013

@jdevalk

This comment has been minimized.

Copy link
Member

jdevalk commented Dec 9, 2013

I've added in a check to prevent the title test from running forever, that should fix your issue.

@sgsthebest

This comment has been minimized.

Copy link
Author

sgsthebest commented Dec 9, 2013

Ok thanks. I will try it and let you know. ..

Regards
El 09/12/2013 14:25, "Joost de Valk" notifications@github.com va escriure:

I've added in a check to prevent the title test from running forever, that
should fix your issue.


Reply to this email directly or view it on GitHubhttps://github.com//issues/419#issuecomment-30131378
.

@sgsthebest

This comment has been minimized.

Copy link
Author

sgsthebest commented Dec 17, 2013

Hi Joost,
I've tested the new version and W3TC works OK, your fix worked like a charm. Many thanks for your support!!
Regards

@jdevalk

This comment has been minimized.

Copy link
Member

jdevalk commented Dec 17, 2013

Perfect, thanks for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.