Forum Replies Created

Viewing 15 replies - 1 through 15 (of 1,328 total)
  • Plugin Author ollybach

    (@ollybach)

    If 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.
    Thread Starter ollybach

    (@ollybach)

    has 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:523

    i.e it’s trying to ‘require’ atec-cache-apcu\includes/includes/atec-wpca-dashboard.php which does not exist

    and 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.3

    in the backend which do not exist either

    Thread Starter ollybach

    (@ollybach)

    Trying 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 here

    Thread Starter ollybach

    (@ollybach)

    PS: there are also no funky overrides going on, no obscure constants defined and no mu plugins running . It’s a bog standard install

    Thread Starter ollybach

    (@ollybach)

    there’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)

    Thread Starter ollybach

    (@ollybach)

    the same as stated above

    Thread Starter ollybach

    (@ollybach)

    still broken

    Thread Starter ollybach

    (@ollybach)

    >I’ve already updated and uploaded a new version of atec Cache APCu
    seems to be broken though

    PHP 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

    Thread Starter ollybach

    (@ollybach)

    We 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.e

    
    
    public static function headers()
    {
    
    	if (defined('DONOTCACHEPAGE') && DONOTCACHEPAGE) return; // Skip cache output	
    
    .......etc 
    

    it will stop serving the cached page

    Thread Starter ollybach

    (@ollybach)

    > 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 cached

    Thread Starter ollybach

    (@ollybach)

    >init() calls headers().
    exactly
    and headers() does not respect DONOTCACHEPAGE – that’s really all I’ve been saying

    Thread Starter ollybach

    (@ollybach)

    >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 init is being executed in atec-wpca-pcache.php which in turn executes headers() with the send_headers action…

    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

    Thread Starter ollybach

    (@ollybach)

    We 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 fine

    Thread Starter ollybach

    (@ollybach)

    Naturally, 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…:)

    Thread Starter ollybach

    (@ollybach)

    >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 like exit(); 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(){....
    in atec-wpca-pcache.php seems 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 example

    Again, just having a discussion here – happy to stand corrected if I’ve missed something

Viewing 15 replies - 1 through 15 (of 1,328 total)