ollybach
Forum Replies Created
-
Forum: Plugins
In reply to: [WPPizza - A Restaurant Plugin] jQuery CDNIf you enable any of the “[abc] items update” options in “WPPizza->Order Settings->Item and Cart Updates and Amendments” or the “Categories accordion” option in “WPPizza->Layout->Miscellaneous”, you will load one of the themeroller styles from jquery ( under “Items update style” or “Accordion style” respectively ).
The selectable styles associated also have a “smoothness.gdpr” option which serves a local copy of the smoothness theme or indeed the option to omit the style entirely by choosing “a (themeroller) style is already loaded / I provide my own style”
Hope that helps
- This reply was modified 7 months, 2 weeks ago by ollybach.
Forum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignoredhas nothing to do with / or \ (php doesnt really care about the difference of those unless they end up being double slashes)
as per the error posted
PHP Fatal error: Uncaught Error: Failed opening required ‘[abs-path]\plugins\atec-cache-apcu\includes/includes/atec-wpca-dashboard.php’ in [abs-path]\plugins\atec-cache-apcu\includes\ATEC\INIT.php:523i.e it’s trying to ‘require’
atec-cache-apcu\includes/includes/atec-wpca-dashboard.phpwhich does not existand is also trying to load
http[s]://[domain]/wp-content/plugins/includes/ATEC/SVG.php?logo=true
http[s]://[domain]/wp-content/plugins/assets/css/atec-style.min.css?ver=1.0.3in the backend which do not exist either
Forum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignoredTrying on different sites / servers , it’s all fine on *nix, but still same issues on win (which I’m using as a dev box)
Just passing on the info as it is hereForum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignoredPS: there are also no funky overrides going on, no obscure constants defined and no mu plugins running . It’s a bog standard install
Forum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignoredthere’s only this atec one installed and running and 2.3.34 is still the same
(also the same with a default theme and no other plugin enabled)Forum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignoredthe same as stated above
Forum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignoredstill broken
Forum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignored>I’ve already updated and uploaded a new version of atec Cache APCu
seems to be broken thoughPHP Fatal error: Uncaught Error: Failed opening required ‘[path]\plugins\atec-cache-apcu\includes/includes/atec-wpca-dashboard.php’ in [path]\plugins\atec-cache-apcu\includes\ATEC\INIT.php:523
and also a bunch of 404’s for css files and svg.php
should probably be a new topic but it leave this here and start a new one next time
Forum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignoredWe are going round the houses it seems
>but its placement is critical
obviously. like everything else>unconditionally in wp-config.php,
forget wp-config.php. it was just a brutal example . as we know and stated earlier, it makes no sense to put the constant in there>If the page is already cached, then the plugin code never runs,
As already said , this is simply not true.
If I add the following to any plugin or your theme’s functions.php for that matter it will run and – on the homepage – the DONOTCACHEPAGE constant will be defined./* a simple / crude example */ add_action( 'init', 'dostuff' ); function dostuff( ) { //do some conditional logic - in this case check if it's the homepage - and if so, do not serve cached page if($_SERVER['REQUEST_URI'] == '/'){ define( "DONOTCACHEPAGE", true ); } return; }>because the cached content is served early and execution stops.
As your headers() is tied to the ‘send_headers’ action hook the init hook (and all sorts of others) will fire regardless
So if your headers() function were to listen to DONOTCACHEPAGE
i.epublic static function headers() { if (defined('DONOTCACHEPAGE') && DONOTCACHEPAGE) return; // Skip cache output .......etcit will stop serving the cached page
Forum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignored> headers() is the serving cache part.
of course> DONOTCACHEPAGE in headers() makes no sense – because it is not defined at this point in time
how would you know ? I am in fact doing exactly that . defining it before your function runs>which would make the whole page caching obsolete.
no, it does not or – more accurately – that’s exactly the point when it is defined for a particular page that I do not want to be cachedForum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignored>init() calls headers().
exactly
and headers() does not respect DONOTCACHEPAGE – that’s really all I’ve been sayingForum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignored>it has zero effect when the cached page is already being served from advanced-cache.php.
looking at the advanced-cache.php as it has been added here by the plugin on my dev box it says
@require WP_CONTENT_DIR.'/plugins/atec-cache-apcu/includes/atec-wpca-pcache.php'; \ATEC_WPCA\PCache::init();which would suggest that the
initis being executed in atec-wpca-pcache.php which in turn executesheaders()with thesend_headersaction…So ‘….Even my own headers() method never runs….’ is not the case here
Just reporting what’s happening here. May well be entirely different your end
Forum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignoredWe must be using a different version of you plugin or the setups differ significantly because none of your statements apply here.
on a cached page (or any page for that matter):
– all my init hooks run just fine
– there does not appear to be a plugin.php in the plugin (?)
– generally all init, plugins_loaded hooks etc seem to execute (though not checked in full detail admittedly )
– my nocache_orderpage most certainly does run in the setup I have here with your plugin
– your headers() also executes just fineForum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignoredNaturally, if the constant gets defined/set after the cached page is served then , yes, we are way too late and nothing will change. Completely agree with that (expected) behaviour and it would indeed be a surprise if we could alter what has already happened ( unless someone invented a timemachine recently ? )
The thing is – as I am sure you are aware – WordPress has hooks that run at different times with the ability to set priorities as to when you want to run what.
As a real world scenario I’m doing this (simplified somewhat):
add_action('init', array($this, 'nocache_orderpage'), -1000); function nocache_orderpage(){ /* a conditional that checks what page we are on */ if(is_orderpage()){ define( "DONOTCACHEPAGE", true ); /* some more stuff */ } return; }As this hook runs before your
public static function headers(){
It would quite happily stop the cached page from being served if your ‘headers’ method as described above were to ‘watch out for it’ as it were>Once a page is cached, it will be served as-is until it expires or is cleared manually.
..unless you tell a script not to…:)Forum: Plugins
In reply to: [atec Cache APCu] DONOTCACHEPAGE constant ignored>Page caching, by design, works by skipping the execution of WordPress and PHP entirely when a cached version of the page already exists
Sorry, but that’s patently not the case. (Not in a WordPress context)
All sorts of scripts get executed before the cached page gets served (just fewer)
If it were the case than pages would also be served cached when a user is logged in (as admin or otherwise) which – according to your little green dot / console.log for easy checking ( thanks for that , very useful) – does not happen.
And – to take it to the extreme – adding something likeexit();to the wp_config would not do anything as “PHP doesn’t run”…Back in the realms of usefulness and perhaps as a proof of concept at least (of course I may be missing things as I have not been digging through everything naturally).
Adding
if (defined('DONOTCACHEPAGE') && DONOTCACHEPAGE) {return;}right after
public static function headers(){....
inatec-wpca-pcache.phpseems to do exactly what you are saying cannot be done …>That’s safe and efficient — the plugin page will never be cached, and the rest of the site still benefits from full-page caching
Yes, I understand that and is the ideal scenario, but not always the case in all circumstances if the constant gets added after a/the page was cached for exampleAgain, just having a discussion here – happy to stand corrected if I’ve missed something