Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter dmayhak

    (@dmayhak)

    Update: Issue found and resolved!

    I was debugging an unrelated issue using the Query Monitor plugin. Even though it was deactivated, it was injecting the custom DB object and adding a lot of excess data to the broadcast data object. After disabling that, the broadcast performance went back to normal.

    Will probably end up adding some code to disable QM when broadcasting, but just leaving it off for now.

    Thanks!

    Thread Starter dmayhak

    (@dmayhak)

    I think i found an issue when calling:

    ThreeWP_Broadcast()->api()->low_priority()->broadcast_children( $post_id, $broadcast_to_sites );

    this is in a handler for ‘savepost’ that will broadcast a post to zero or more sites based on some data in the post.

    When in the WP admin area, publishing one post works ok. Publishing 5 posts resulted in some issues.

    I added some simple logging to the compress() method in /queue/data.php

    $new_data = serialize( $data );
    error_log( print_r( 'compress() serialized length:' . strlen( $new_data ), true ) );
    $new_data = gzcompress( $new_data , 9 );
    error_log( print_r( 'compress() gzcompress length:' . strlen( $new_data ), true ) );
    $new_data = base64_encode( $new_data );
    error_log( print_r( 'compress() base64_encode length:' . strlen( $new_data ), true ) );
    return $this->set_data( $new_data );

    the publishing of 5 posts resulted in:

    [04-Jun-2022 02:54:32 UTC] compress() serialized length:<strong>5530723</strong>
    [04-Jun-2022 02:54:32 UTC] compress() gzcompress length:304696
    [04-Jun-2022 02:54:32 UTC] compress() base64_encode length:406264
    
    [04-Jun-2022 02:54:32 UTC] compress() serialized length:<strong>8167436</strong>
    [04-Jun-2022 02:54:32 UTC] compress() gzcompress length:1045420
    [04-Jun-2022 02:54:32 UTC] compress() base64_encode length:1393896
    
    [04-Jun-2022 02:54:32 UTC] compress() serialized length:<strong>13030598</strong>
    [04-Jun-2022 02:54:32 UTC] compress() gzcompress length:3463590
    [04-Jun-2022 02:54:32 UTC] compress() base64_encode length:4618120
    [04-Jun-2022 02:54:33 UTC] WordPress database error MySQL server has gone away ...
    
    [04-Jun-2022 02:54:33 UTC] compress() serialized length:<strong>31641989</strong>
    [04-Jun-2022 02:54:34 UTC] compress() gzcompress length:15786512
    [04-Jun-2022 02:54:34 UTC] compress() base64_encode length:21048684
    [04-Jun-2022 02:54:34 UTC] WordPress database error MySQL server has gone away ...
    
    [04-Jun-2022 02:54:34 UTC] compress() serialized length:<strong>110506248</strong>
    [04-Jun-2022 02:54:38 UTC] compress() gzcompress length:71923059
    [04-Jun-2022 02:54:38 UTC] compress() base64_encode length:95897412
    [04-Jun-2022 02:54:40 UTC] WordPress database error MySQL server has gone away ...

    looks like some variable is not getting cleared, but rather appended to when multiple items are published in bulk.

    TIA for your help!

    Thread Starter dmayhak

    (@dmayhak)

    I looked into the fetch from the broadcast_queue_data table and found this interesting:

    broadcasting_data field in the DB has length of 20901.

    sql query: “SELECT * FROM wp_3wp_broadcast_queue_data WHERE id IN (‘248’)”

    immediately after the $wpdb get call:

    broadcast_data length (in code) is 1025.

    guess I have more digging to do, but would welcome any ideas. 🙂

    Thread Starter dmayhak

    (@dmayhak)

    Thanks for looking into it. Sorry it seems to be a pain…

    Thread Starter dmayhak

    (@dmayhak)

    I added some more items such as popups and singular posts, etc. It appears that the elementor_pro_theme_builder_conditions value is somewhat of an aggregate of the _elementor_conditions entry in the postmeta table. Looks like both are being used now.

    adding more details on the workaround

    1. set up a template (footer in this example) on SiteA
    2. set the conditions as normal
    2a. postmeta => _elementor_conditions is set
    2b. options => elementor_pro_theme_builder_conditions is set
    3. publish to SiteB
    3a. postmeta => _elementor_conditions is set
    3b. options => elementor_pro_theme_builder_conditions is not set
    4. go to SiteB theme builder and select Footer in left menu
    5. on the footer overview area, the instances (conditions) text is correct
    6. click Edit Conditions
    7. broadcasted conditions appear
    8. hit save & close
    8a. postmeta => _elementor_conditions is set (already was)
    8b. options => elementor_pro_theme_builder_conditions is now set correctly

    I am thinking this is not just a simple “update the option being broadcast and save it” as the destination site may have templates of its own that need to remain in the options setting. Seems like it has to weave together the broadcasted settings with the settings for the destination. And also remove the settings for the templates being “un-broadcasted”

    Let me know if I can be of any assistance with this. (testing, etc.)

    Thanks!

    • This reply was modified 4 years, 4 months ago by dmayhak.
    Thread Starter dmayhak

    (@dmayhak)

    Had a few minutes to throw this together. There are a ton more combinations that can be made. Will try to get more examples later tonight.

    I am assuming that stuff like the custom post types (like saints below) would include the id for selecting singular items. (i.e. include/singular/saints/[nn])

    let me know if you want any other additional info. Thanks!

    elementor_pro_theme_builder_conditions option value (with comments):

    a:2:{
        s:6:"footer";
        a:1:    {
            i:105; // id of the site footer template
            a:6:{
                i:0;
                s:15:"include/general";
                i:1;
                s:22:"exclude/archive/author";
                i:2;
                s:30:"exclude/singular/in_category/1"; // uncategorized
                i:3;
                s:21:"include/singular/post"; // include on all singular post
                i:4;
                s:23:"include/singular/saints"; // custom post type
                i:5;
                s:31:"include/singular/e-landing-page";
            }
        }
        s:6:"header";
        a:2:{
            i:99; // id of the home page header template
            a:1:{
                i:0;
                s:24:"include/singular/page/11";
            }
            i:69;
            a:2:{ // id of the site header template; excluded on home page
                i:0;
                s:24:"exclude/singular/page/11"; // home page id
                i:1;
                s:15:"include/general";
            }
        }
    }
    Thread Starter dmayhak

    (@dmayhak)

    Will do! I’ll get some samples to you as soon as i get a chance to work on that again. Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)