PS. You have to go to the page on a mobile phone.
Solved myself.
For future reference for anyone else encountering this specific issue, I went to line 305 in that file, found where the function containing it begins, and added “global $cachedir;” just after the function statement on its own line.
If this is a correct solution for your team, please add to the next update.
This did not solve the issue, but is only a temporary fix.
After a short amount of time, 403 forbidden errors are thrown on all posts.
Please provide a permanent fix for this issue.
Can you be specific on:
1. what error you are getting exactly?
2. where are you getting it?
So I can understand and help you
I don’t know how I could be more specific. I answered both of your questions in my initial message.
1. what error you are getting exactly?
“Undefined variable: cachedir in /wp-content/plugins/amp-cache/ampforwp-cache.php on line 305.”
“Right now no amp pages are rendering.”
2. where are you getting it?
“I am getting an error on amp pages”
“You can see this at https://stadivm.com/cc”
Hey just a follow up on this, it would be great to get this solved and have my amp pages working on mobile again. Currently no mobile users can view my posts and are getting an error message.
Thanks!
In case anyone is looking for a solution to this.
Go to line 301 in /wp-content/plugins/amp-cache/ampforwp-cache.php, and edit this if statement:
if($this->cachemod == ‘serverrewrite’){
$cachedir=’ampforwp-cache/’;
}
.. to just this:
$cachedir=’ampforwp-cache/’;
This is probably a hacky solution, but my AMP pages are now working on mobile again and no doubt there will be a patch for this error at a later date.