jacob.tingen
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Varnish configuration not working in WoocommerceNevermind, I started googling a little more in-depth on making Varnish work with WordPress in general instead of making Varnish work with WooCommerce specifically.
The code I originally posted above was a mix of what I got from two different sources.
The first part was the code I got from Digital Ocean:
# Drop any cookies sent to WordPress. sub vcl_recv { if (!(req.url ~ "wp-(login|admin)")) { unset req.http.cookie; } }
This second part was what I got from the WooCommerce documentation:
if (req.url ~ "^/(cart|my-account|checkout|addons)") { return (pass); } if (req.url ~ "\?add-to-cart=" ) { return (pass); }
I realized the two bits of code conflict–the first snippet prevented WooCommerce from using any cookies on any page at all except for wp-login and wp-admin. That’s when I realized I could just customize that snippet to except WooCommerce pages too.
The following code works for me. It still prevents the use of many WordPress cookies, so it still leverages Varnish to cache most of my website (I read that WP’s use of cookies often prevents Varnish from actually caching anything unless setup appropriately). Here’s the code that worked for me:
# Drop any cookies sent to WordPress. sub vcl_recv { if (!(req.url ~ "(wp-login|wp-admin|cart|my-account|checkout|addons)")) { unset req.http.cookie; } # Drop any cookies WordPress tries to send back to the client. sub vcl_fetch { if (!(req.url ~ "(wp-login|wp-admin|cart|my-account|checkout|addons)")) { unset beresp.http.set-cookie; } }
Here is what I read that got me to my answer: https://www.varnish-cache.org/trac/wiki/VarnishAndWordpress
Just posting in case it helps anyone else. There might be a better way to do this, but it seems to be working fine.
Worked like a charm, and glad that it will be included in future releases. Thanks for your quick help.
Yes.
I also inserted the code in my functions.php file as the instructions direct.
Phew,
I was having the same problem–I thought maybe it was just me. Guess I’ll use version 2.3.2 until this gets fixed.
Forum: Plugins
In reply to: [WP Document Revisions] Issue: WP Document Revisions on a NetworkHi, I resolved my issue by creating a plugin to add wp document revision capabilities to the administrator role network wide. Here’s the code I used, it might work for someone out there.
You can put it in your theme’s functions.php file or you can make a plugin out of it like I did. I can’t claim authorship of the code, I found it somewhere recently where it was applied to gravity forms capabilities but didn’t bookmark the page…
// get role by name (change 'administrator' to a role) $role = get_role( 'administrator' ); // or get user by user ID (change $id to an id) // $role = new WP_User( $id ); // or get user by username (change $name to a username) // $role = new WP_User( null, '$name' ); // add core wp document revisions capabilities $role->add_cap( 'delete_documents' ); $role->add_cap( 'delete_others_documents' ); $role->add_cap( 'delete_private_documents' ); $role->add_cap( 'delete_published_documents' ); $role->add_cap( 'edit_documents' ); $role->add_cap( 'edit_others_documents' ); $role->add_cap( 'edit_private_documents' ); $role->add_cap( 'edit_published_documents' ); $role->add_cap( 'override_document_lock' ); $role->add_cap( 'publish_documents' ); $role->add_cap( 'read_documents' ); $role->add_cap( 'read_private_documents' ); $role->add_cap( 'read_document_revisions' );
Forum: Plugins
In reply to: [WP Document Revisions] Issue: WP Document Revisions on a NetworkOkay,
I installed the members plugin and tried to edit the capabilities each user role level can access.
When logged in as a super admin and editing user role capabilities on my main site, I saw that the document capabilities were already checked among the 99 available for my Administrator user level.
When I visited a subsite and attempted to edit the user roles, there were only 79 available capabilities for the Administrator user level. None of the document capabilities were listed so I was unable to make it available. Any idea of what could cause that?
When you say permissions, you aren’t talking about file permissions are you? Just user role permission/capabilities. Thanks for your help.
Also, I don’t have any custom user roles, just default WordPress roles. Thanks again.
Forum: Plugins
In reply to: [Plugin: Group Documents] Privacy/versioningI understand that adding the versioning functionality would be a large undertaking, but any word on that front?
No pressure, just curious.