Forum Replies Created

Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter charlyox

    (@charlyox)

    Hello @vmarko thanks for your research

    I cannot paste screen captures here but I have strange things indeed, let me kind of reproduce file system inside page_enhanced/ directory

    category
      -0
        -0
          -0
            -0
              -0
                -page
                  -4

    This is for the taxonomy archives I guess. Each line up there is a directory
    and each directory gets a sub directory.
    The first and the last in the tree gets the _index_ssl.html_old file and its gzip equivalent.

    So we can conclude that here the url tree is not being respected as I don’t have urls like : /category/0/0/0/0 etc.

    Do we have something interesting here ?
    I would like to share the xml sitemap with you but I don’t want to publish it here.
    The sitemap is provided by
    yoast and in my opinion there are no mistake in it.

    Thanks again for your help

    Charles

    ps : however the garbage collection is still a problem and still does not clean _old files – but maybe we are facing a double problem here

    • This reply was modified 2 years, 3 months ago by charlyox.
    Thread Starter charlyox

    (@charlyox)

    Hello @vmarko
    I’m sorry again but I don’t get what you are trying to explain.

    You say :

    The Garbage collection is removing the _old files once they are created, and if for example, the new process of caching begins, it may take up to 100 pages cached before the _old files are removed.

    => But in that case the directory would not grow on and on but would just never be completely empty. My directory keeps growing on and on: Before I manually emptied it, its size was 58GO which is approximately 58 times its expected size (which by the waytriggered a crash on my customer’s website).
    What I understand :

    • Pages are cached (in two hours)
    • Garbage collection is triggered => No _old file, no collection
    • Pages are invalidated (getting _old prefix)
    • In the meantime some new pages may be cached again
    • Garbage collection is triggered => Every _old file is removed
    • Again some new pages may be cached, until next invalidation

    This is my understanding. Perhaps I am mistaken somewhere. I know that the timings I chose for priming, unvalidating and garbage collecting may be optimised.

    But I still don’t understand why GC is not triggered. Again, it’s not dependent on the chosen timing since I triggered it “manually” with wp CLI and it gave me a “success” while _old files still remained.

    Please give me a way to resolve this issue. I like your plugin and find it useful but this is a really annoying issue.

    Thanks for your help

    Charles

    • This reply was modified 2 years, 3 months ago by charlyox.
    Thread Starter charlyox

    (@charlyox)

    Hello @vmarko
    I added a cronjob every 600 seconds (10 minutes), which is two cron jobs calling wp-cron.php, one every minute, one every 10 minutes :

    */1 * * * * wget --delete-after https://domain.fr/wp-cron.php
    */10 * * * * wget --delete-after https://domain.fr/wp-cron.php

    Anyway, my page_enhanced directory keeps growing and growing and does not get emptied, one hour later.

    In addition, when I call the command wp w3-total-cache pgcache_cleanup, the output is “success”, but the page_enhanced directory is still at the same size.

    I think this issue comes from something else.
    Will you help me further ?
    Thanks a lot

    Charles

    Thread Starter charlyox

    (@charlyox)

    I’m sorry @vmarko but I don’t understand your point.
    When I list scheduled events using wp cli I get this one among others :

    | w3_pgcache_cleanup| [W3TC] Page Cache file GC (every 600 seconds) | 600 |

    The interval is 600 which means it’s not disabled.

    My serverside CRON calling every 60 seconds wp-cron.php should trigger the w3_pgcache_cleanup task once every 600 seconds, even if it runs every 60 seconds, shouldn’t it ?

    Thanks for your answer

    Charles

    Thread Starter charlyox

    (@charlyox)

    Hello @vmarko thank you but can you just answer this question ?
    Another cron job should also call https://domain.fr/w3_pgcache_cleanup ? Is that the right url ? no .php ?
    Thank you

    Charles

    Thread Starter charlyox

    (@charlyox)

    Thanks a lot @vmarko for your quick answer,

    yes this line is present in my wp-config.php :
    define('DISABLE_WP_CRON', true);

    my current server cron only calls https://domain.fr/wp-cron.php.

    I understand that, more than this, another cron job should also call https://domain.fr/w3_pgcache_cleanup ? Is that the right url ? no .php ?

    I’d rather keep my server cron instead of wordpress’s, if you don’t mind.

    Thanks a lot!

    Charles

    charlyox

    (@charlyox)

    Hello there,

    I am testing the Mail poet 3.0.0-beta.2 version.

    The script calls for the forms are still on the ‘/wysija-newsletters/’ directory while the main plugins directory has changed to ‘/mailpoet/’.
    This prevents any e-mail from being added from the website to the mailing lists and gives an “invalid request” – 401 unauthorized ajax call result.

    Thanks a lot
    Charles

    Thread Starter charlyox

    (@charlyox)

    Hello Caimin,

    thanks for your answer.

    Types and Views are developer-friendly plugins, which allow to create any Custom post types, and display them with any html you want in the front end on WordPress.

    I am a long-time user of these plugins and was quite puzzled when trying to integrate the events manager into this simple WordPress logic (Custom post types, custom fields displaying).

    The use of a specific templating system in the events manager plugin (which is very powerful) seems to conflict with Views’ templating system.

    I have found a workaround for this specific issue. I am giving it here for anybody who would bend over the same problem int he future :

    The events manager does not like a specific short code in Views :
    [wpv-post-body]
    That is, whenever WP queries for events and asks for this shortcode, the whole event gets outputted whatever parameters in the shortcode were given.

    My solution was to shortcut this shortcode by inserting directly my content template’s content into my view. Views users will know what I mean !

    Cheers,

    Charles

    Thread Starter charlyox

    (@charlyox)

    Yes it seems so !
    Thanks a lot !

    Charles

    @justin
    great! that’s “charlyox”. see you there ??

    @justin,

    I just made an improvement to your code that addresses this problem (still wonder why Woocommerce makes the admin or shop manager the author of the order when he’s the one who completes it – still wonder why also there is no customer id in the order object :

    in /includes/functions.php :

    /**
     * [add_credits_to_user_account description]
     * @param [type] $order_id [description]
     *
     * @since 1.1 - Now fired on woocommerce_order_status_completed action. This is a    * change to rid infinite reloads
     * of credits after pruchase.
     *
    *Changed by Charles Senard on October, 2015, 17. The customer is credited with the *amount of credits he has bought, vs. before where it was the admin in some cases (when the admin performed an action on the order)
     */
    add_action( 'woocommerce_order_status_completed', 'add_credits_to_user_account' );
    function add_credits_to_user_account ( $order_id )
    {
    write_log( "function add_credits_to_user_account");
    	$order = new WC_Order( $order_id );
        $customer_id = get_post_meta( $order->id , '_customer_user', true );
    
    	if ( count( $order->get_items() ) > 0 )
    	{
    		foreach ( $order->get_items() as $item )
    		{
        	$product_name = $item['name'];
        	$product_id = $item['product_id'];
        	$product_variation_id = $item['variation_id'];
        	$credit_amount = floatval( get_post_meta( $product_id, "_credits_amount", true ) );
        	$current_users_wallet_ballance = floatval( get_user_meta( $customer_id, "_uw_balance", true ) );
        	$la62_success = update_user_meta( $customer_id, "_uw_balance", ( $credit_amount + $current_users_wallet_ballance ) );
    		}
    	}
    }
    
    /**
     * [custom_woocommerce_auto_complete_order description]
     * @param  [type] $order_id [description]
     * @return [type]           [description]
     *
    * Changed by Charles Senard on 2015, October 17th
     * Action deactivated - We may plan to delete it but remains for means of non -
    * regression tests
     */
    //add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
    function custom_woocommerce_auto_complete_order( $order_id )
    {
      if ( !$order_id )
           return;
    
      $order = new WC_Order( $order_id );
      if ( count( $order->get_items() ) > 0 )
    	{
    		foreach ( $order->get_items() as $item )
    		{
    	   	if(has_term('credit', 'product_cat', $item['product_id']))
    	   		$order->update_status( 'completed' );
    		}
    	}
    }

    Hey @justin,

    How about sharing this plugin on Github, so that we can make it better together?

    @ reminute2008,
    if this piece of code solved your problem – I think you should change directly in the plugin – , you might mark this thread as “resolved”. Thanks ??
    Have a good day,

    Charles

    Hi James,

    you probably got around this error since then, I hope so. Anyway I found myself in front of the same problem a few days ago and here is how I resolved it:

    the action woocommerce_review_order_before_submit does not provide the $checkout object necessary for the on_checkout_page function to execute correctly.

    So you need to override this action call to provide the $checkout object.

    You need to do that in a custom theme because you need to override woo commerce templates.

    In your custom theme’s main folder, add a folder woocommerce.
    Inside this folder you may

    • copy and paste the whole plugins/woocommerce/templates/ folder (good if you really develop a real custom theme)
    • Copy only the file that interests us here, that is /templates/checkout/payment.php to your-custom-theme/woocommerce/checkout/payment.php.

    Now you are able to edit the file payment.php.

    You see that part around line 47:
    <?php do_action( 'woocommerce_review_order_before_submit' ); ?>

    replace it by this :

    <?php do_action( 'woocommerce_review_order_before_submit', $checkout ); ?>

    The global $checkout variable is now passed to your action. and your function can execute normally.

    Hello Mike,

    I am facing the same issue. is this the

    wp-content/debug.log

    that we should watch at?

    Thanks

    Charles

    Thread Starter charlyox

    (@charlyox)

    Hello Yasserr.

    Well, this gives me a reason not to upgrade to 2,3,10 !

    What I did was a vulgar hack inside woo commerce’s plugin:

    In plugins/woocommerce/assets/js/jquery-blockui/
    rename the two files by appending something like “-renamed” at the end of the file and before the .js extension.

    This will prevent Woocommerce from retrieving these problematic files.

    Be careful on upgrade these changes will be overwritten so you ‘ll have to repeat this action.

    Hope it world for you

    Charles

    Thread Starter charlyox

    (@charlyox)

    SHAME ON ME!

    I had not given the last two arguments of the add_action function…

    So for those who are interested the right code for the add_action is:

    add_action('woocommerce_add_order_item_meta', array($this, 'charlie_ajoute_un_order_item_meta'), 10, 3);

    Sorry for my dumbness.

    Charles

Viewing 15 replies - 1 through 15 (of 20 total)