Forum Replies Created
-
In reply to: How to disable Nonce check
Hi @robkk. Actually I didn’t check that, sorry. The project is basically a bbpress project. And I had to set it enable all the time in order to develop.
I asked the IT guy to create a clon of the page in another host and it’s working fine as far as I can see. So, I’d leave this here being a hosting issue.
Thanks a lot for the replys.
In reply to: Strange cache issues (in profile and topic count)Great. Thanks for letting me know. I’ll investigate further about Apache cache.
I had this in my htaccess, but this doesn’t comprehend php files:
<filesMatch "\.(html|htm|js|css)$"> FileETag None <ifModule mod_headers.c> Header unset ETag Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT" </ifModule> </filesMatch>
So, nice to know you solved it. And thanks the other users for helping.
I think this works:
add_filter('bbp_get_reply_position', 'lugpa_get_reply_position', 10, 3); function lugpa_get_reply_position($reply_position, $reply_id, $topic_id){ if(empty($topic_id)) $topic_id = bbp_get_reply_topic_id ($reply_id); $numReplies = bbp_get_topic_reply_count($topic_id); return ($numReplies+1) - $reply_position; // plus one because of thread description }
I’m not sure about the +1 but it works. I tested this with first and last comment of a given page.
In reply to: How to disable Nonce checkSomething seems to be failing with nonce. Everywhere. By example, my logout button is set to logout without confirmation. But sometimes (randomly) it asks for confirmation: “Do you really want to log out?” Well, I can reproduce the error by modifying the nonce manually.
So, the response to this thread would be that there’s no way to disable nonce in the entire system (as far as I can tell). And my errors (the ones we talked in this thread and maybe the ones we talked in other threads) are being caused by my server or internet provider (IT guy says we have two internet providers and connection flows from one to another on the fly).
In reply to: How to disable Nonce check@casiepa It’s too late for that. But I’ll try to disable each nonce check manually (from the theme)
@robkk This bug is unrelated to “restore trashed topics” and I don’t know how to reproduce it. But I’d close this thread since the nonce functionality is part of WordPress and not bbpress, right? And also the existence of the nonce check is responsibility of the theme, right?Thanks, both of you.
In reply to: Strange cache issues (in profile and topic count)Hi @robkk . Thanks for the comments.
I’m posting the code. However, the issue may not be at that level. It’s true that sometimes part of the info is ok, and part is wrong. But actually the whole page is being cached. Prove of this is that when I added the html headers (see above) the browsers wouldn’t recognize that tags until I reloaded page with ctrl+F5
USERNAME
$user = wp_get_current_user();
echo $user->user_firstname;USER PHOTO
get_avatar( bbp_get_displayed_user_field( ‘user_email’, ‘raw’ ), apply_filters( ‘bbp_single_user_details_avatar_size’, 150 ) )USER NAME UNDER PHOTO
bbp_get_user_nicename() <- this one sometimes is not being cached as far as I can say———
I’ll try with another theme. But I’m not sure the views7templates will be recognized. I’ll try and let you know. Thanks for the suggestiong.
———
@mica123 Nice to know that changing the server solves the issue. That points in one direction. But let’s try to discover what’s the problem with server configuration.In reply to: Possible issue untrashing topicsSorry for the bump. But this is happening still.
Wordpress version 4.3.1
bbpress version 2.5.8In reply to: Strange cache issues (in profile and topic count)Anyway, question is still there: why there’s cache in profile pages and not in the rest of the forum?
In reply to: Strange cache issues (in profile and topic count)Adding these metatags to profile pages seems to work. But I have to go through 5 pages and reload with ctrl+F5 to make this happen:
<meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" /> <meta http-equiv="pragma" content="no-cache" />
Code is:
function head_meta_tags() { if ( bbp_is_single_user() ) { // try to avoid cache in profile pages echo ' <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" /> <meta http-equiv="pragma" content="no-cache" />'; } } add_action( 'wp_head', 'head_meta_tags' , 2 );
In reply to: Strange cache issues (in profile and topic count)Just to mention that I tried this headers in php side but they wont take effect:
header("Expires: 0"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache");
In reply to: Strange cache issues (in profile and topic count)Hi. Yes, I edit a file, add a blank line or something and save. Files in my case are:
user-profile.php
user-replies-created.php
user-subscriptions.php
etcI don’t know if the names are the conventional names or just the ones my theme set.
Anyway there’s no real need to do this. Reloading with ctrl+F5 usually do the trick.
I don’t have a real solution yet. And I’m not sure if the problem is with bbpress or wordpress. Or with something else. But I know wordpress use to cache stuff. That’s clear when you develop a plugin and things just don’t change (unless you add rules to .haccess).
In reply to: Strange cache issues (in profile and topic count)Thanks @casiepa!
No, my host is Gold Vision. And cache is disabled. We assure since we have many sites there. Anyway, we checked and it says “always revalidate”. So, cache is disabled.I believe I can’t reproduce this locally. But I’ll keep on trying.
Just a detail: profile image may or may not be displaying wrong. Sometimes all user data is wrong but the profile image. That’s weird. But quite logic because I have a rule in htaccess disabling cache for images.
In reply to: Strange cache issues (in profile and topic count)Yes, a custom howdy message. Printing the First Name. But it’s not an isolated issue. The whole page is retrieving the wrong information since the whole page is somehow cached.
Problem is in all mayor browsers (Chrome, Firefox, Safari, an I assume IE too).
See, I have these items defined in profile menu:
-
Profile (this one correspond to profile details)
Topics Started
Replies Created
Subscriptions
EditSo, (visiting any author’s profile and) clicking on some of these items will show the author’s data, while clicking in others will retrieve current user profile data or something. Reloading page solves the issue (most of the times) but problems occurs again after a while.
This happens in several machines, not only in mine. And as I said, I don’t have any cache plugin.
I’m not sure what sort of cache may be using my server but I’d assume none, since we develop a lot of webpages in the same server (and the IT guy says there isn’t any cache involved in the server)
I’d like to know if anyone else experimented something similar before.
Thanks in advance.
In reply to: Bug in subscribe buttonAlmost solved:
function lugpa_change_subscribe_button_texts($args){$fakeCbox = "<span class='subscribe-icon'></span>";
$args = array_merge($args, array(
'before' => '',
'subscribe'=> $fakeCbox.' Subscribe to thread notifications',
'unsubscribe'=> $fakeCbox.' Unsubscribe from thread notifications',
));
return $args;
}
// in a future please check if all these hooks subscribes to a "topic"
add_filter('bbp_before_get_forum_subscribe_link_parse_args', 'lugpa_change_subscribe_button_texts');
add_filter('bbp_before_get_topic_subscribe_link_parse_args', 'lugpa_change_subscribe_button_texts');
add_filter('bbp_before_get_user_subscribe_link_parse_args', 'lugpa_change_subscribe_button_texts');
However I’m not sure if all these hooks works over the same thing. Meaning, if they all are related to “thread subscriptions”.
One more thing: I’d like to be able to distinguish if I’m in “replys” page or in “my subscriptions” page. Because If I’m in the second one I should keep the short version.
In reply to: Bug in subscribe buttonNevermind. Issue is caused by my theme. There’s a filter causing troubles:
add_filter( ‘bbp_before_get_user_subscribe_link_parse_args’, ‘bbpress_remove_pipe_before’);
So, “before” is working.
Please give me some feedback about the second issue, the labels being overwritten after ajax call.
Thanks.