Hi, have you tried to implement the following suggestion?
https://simple-membership-plugin.com/w3-total-cache-compatibility-simple-membership/
Regards.
-
This reply was modified 4 years, 4 months ago by
mbrsolution.
Yes mbrsolution, the above entries are in the Rejected Cookies field in the Page Cache.
W3TC caches the whole page which is a static page. But the swpm_mini_login shortcode is in the widget in the sidebar, and the content is dynamic to reflect the user login status.
Thank you for providing more information. I have submitted a message to the developers to investigate further your findings.
Kind regards.
Hi, The following shows where the code for the mini login shortcode is:
https://github.com/wp-insider/simple-membership/blob/c17fcc101d8ce6bb0f95f7592069fb9279f48e63/simple-membership/classes/shortcode-related/class.swpm-shortcodes-handler.php#L117
There is also the following filter hook available. You can potentially use this filter hook to override and output a customized code for the mini login:
swpm_mini_login_output
On a side note: what did they recommend you to put in the code for the caching?
Hi @wpinsider-1,
Thanks for the information. I am trying to confirm with W3TC support to see if that is how this can be done. Among other things I was told to wrap the coding of the swpm_mini_login shortcode with <!– mfunc xyzsecurestring –> and <!– /mfunc xyzsecurestring –> for example:
<!– mfunc xyzsecurestring –>
<?php
class SwpmShortcodesHandler {
public function __construct()
codes ….
public function 1 (…) {…}
public function 2 () (…) {…}
public function xyz_show_mini_login_sc () (…) {…}
public function 4 () (…) {…}
public function 5 () (…) {…}
}
<!– /mfunc xyzsecurestring –>
I don’t see the closing tag ?>. Is it necessary? I am not a developer, so don’t know this syntex.
I also don’t know how to use the hook you mentioned. A little direction/guidance would be appreciated.
Hi, just touching base with you. Did you manage to fix your issue?
Regards.
Hi,
I would like to try the hook that wp-insider mentioned in his reply. (swpm_mini_login_output) But I need some instructions as how to do it. Can you help?
The recommendation that you posted is not very clear to me so I don’t really know how best to handle it. You could try adding something like the following to your site’s functions.php file to wrap the mini login output with their special string:
function my_customized_mini_login( $outuput ){
$output = '<!– mfunc xyzsecurestring –>' . $outuput . '<!– /mfunc xyzsecurestring –>';
return $outuput;
}
add_filter( 'swpm_mini_login_output', 'my_customized_mini_login');
Please note that I didn’t test this code so I don’t know if it works or not. I am just giving the example to show how the login shortcodes output can be wrapped with the string that they recommended. Normally, for custom coding tweaks, it is better to hire a developer who can do the customized coding and testing for your site’s current setup.
Thanks wpinsider-1. I copied your code to the function.php file in my child theme. I don’t know where to put the hook swpm_mini_login_output so it can be triggered. I put it in my sidebar as widget (text shortcode), but it just displayed the actual text of the hook. Hope you don’t mind giving me another pointer.
@francoc30, all you have to do is add the mini login widget shortcode [swpm_mini_login]to the sidebar. The shortcode will trigger the function you added to the functions.php file. The following instructions can help you further.
https://simple-membership-plugin.com/adding-mini-login-widget-sidebar-header-footer/
Kind regards.
Hi @mbrsolution,
I am not talking about the shortcode [swpm_mini_login] which I already used in the sidebar widget. I am referring to the hook swpm_mini_login_output that wpinsider-1 suggested me to use. Can you pass my question to him/her please?
That hook is triggered from the shortcode that @mbrsolution suggested.
I don’t really know what other pointers I can provide from the top of my head. This topic is now going beyond the scope of the free support unfortunately. You can use a paid support ticket to get further help if you wish to.
Hi wpinsider-1,
Thanks for your response. I appreciate your help. I’ll further test things out.