• Resolved brizzol

    (@brizzol)


    Hi, I am having an issue with a bloated table which I think is down to woocommerce action schedule. I’ll post the log below:

    
    ### WordPress Environment ###
    
    WordPress address (URL): (removed url)
    Site address (URL): (removed url)
    WC Version: 6.7.0
    REST API Version: ? 6.7.0
    WC Blocks Version: ? 7.8.3
    Action Scheduler Version: ? 3.4.0
    Log Directory Writable: ?
    WP Version: 6.0.1
    WP Multisite: –
    WP Memory Limit: 1 GB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_US
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 7.4.29
    PHP Post Max Size: 256 MB
    PHP Time Limit: 300
    PHP Max Input Vars: 1000
    cURL Version: 7.81.0
    OpenSSL/1.1.1n
    
    SUHOSIN Installed: –
    MySQL Version: 5.5.5-10.3.34-MariaDB-log
    Max Upload Size: 256 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 6.7.0
    WC Database Prefix: wp5y_
    Total Database Size: 14318.29MB
    Database Data Size: 8876.94MB
    Database Index Size: 5441.35MB
    wp5y_woocommerce_sessions: Data: 0.34MB + Index: 0.02MB + Engine InnoDB
    wp5y_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp5y_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp5y_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_actionscheduler_actions: Data: 5941.69MB + Index: 3819.41MB + Engine InnoDB
    wp5y_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_actionscheduler_logs: Data: 2871.77MB + Index: 1607.84MB + Engine InnoDB
    wp5y_akeeba_common: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp5y_ak_params: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp5y_ak_profiles: Data: 0.01MB + Index: 0.00MB + Engine MyISAM
    wp5y_ak_stats: Data: 0.01MB + Index: 0.00MB + Engine MyISAM
    wp5y_ak_storage: Data: 0.45MB + Index: 0.01MB + Engine MyISAM
    wp5y_ak_users: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
    wp5y_connections: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_connections_address: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_connections_date: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_connections_email: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_connections_link: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_connections_messenger: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_connections_meta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_connections_phone: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_connections_social: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_connections_terms: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp5y_connections_term_meta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_connections_term_relationships: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_connections_term_taxonomy: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_compmenus: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_config: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_elements: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_forms: Data: 0.01MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_integrator_criteria_fixed: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_integrator_criteria_form: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_integrator_criteria_joomla: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_integrator_items: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_integrator_rules: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_packages: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_pieces: Data: 0.06MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_records: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_scripts: Data: 0.02MB + Index: 0.00MB + Engine MyISAM
    wp5y_facileforms_subrecords: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_fsmpt_email_logs: Data: 0.05MB + Index: 0.00MB + Engine InnoDB
    wp5y_geodir_attachments: Data: 0.01MB + Index: 0.00MB + Engine MyISAM
    wp5y_geodir_countries: Data: 0.03MB + Index: 0.00MB + Engine MyISAM
    wp5y_geodir_custom_fields: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_geodir_custom_sort_fields: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_geodir_gd_place_detail: Data: 0.01MB + Index: 0.00MB + Engine MyISAM
    wp5y_geodir_post_icon: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_geodir_post_review: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_options: Data: 2.17MB + Index: 0.06MB + Engine InnoDB
    wp5y_postmeta: Data: 27.52MB + Index: 11.06MB + Engine InnoDB
    wp5y_posts: Data: 2.50MB + Index: 0.39MB + Engine InnoDB
    wp5y_sbi_feeds: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_sbi_feed_caches: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_sbi_instagram_feeds_posts: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_sbi_instagram_feed_locator: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_sbi_instagram_posts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_sbi_sources: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_tcb_api_error_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_td_fields: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_td_groups: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_termmeta: Data: 0.08MB + Index: 0.03MB + Engine InnoDB
    wp5y_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_term_relationships: Data: 0.14MB + Index: 0.13MB + Engine InnoDB
    wp5y_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_usermeta: Data: 0.31MB + Index: 0.30MB + Engine InnoDB
    wp5y_users: Data: 0.05MB + Index: 0.05MB + Engine InnoDB
    wp5y_wc_admin_notes: Data: 0.05MB + Index: 0.00MB + Engine InnoDB
    wp5y_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp5y_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp5y_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp5y_wc_product_attributes_lookup: Data: 0.09MB + Index: 0.11MB + Engine InnoDB
    wp5y_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_wc_product_meta_lookup: Data: 0.08MB + Index: 0.13MB + Engine InnoDB
    wp5y_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_wfblockediplog: Data: 0.36MB + Index: 0.00MB + Engine InnoDB
    wp5y_wfblocks7: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp5y_wfconfig: Data: 0.52MB + Index: 0.00MB + Engine InnoDB
    wp5y_wfcrawlers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_wffilechanges: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_wffilemods: Data: 17.55MB + Index: 0.00MB + Engine InnoDB
    wp5y_wfhits: Data: 1.02MB + Index: 0.22MB + Engine InnoDB
    wp5y_wfhoover: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_wfissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp5y_wfknownfilelist: Data: 7.52MB + Index: 0.00MB + Engine InnoDB
    wp5y_wflivetraffichuman: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_wflocs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_wflogins: Data: 0.31MB + Index: 0.13MB + Engine InnoDB
    wp5y_wfls_2fa_secrets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp5y_wfls_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_wfnotifications: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_wfpendingissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp5y_wfreversecache: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_wfsnipcache: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp5y_wfstatus: Data: 1.02MB + Index: 0.09MB + Engine InnoDB
    wp5y_wftrafficrates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_widgetkit: Data: 0.03MB + Index: 0.00MB + Engine MyISAM
    wp5y_wpbdp_fees: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_wpbdp_form_fields: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_wpbdp_listing_fees: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_wpbdp_payments: Data: 0.00MB + Index: 0.01MB + Engine MyISAM
    wp5y_wpbdp_payments_items: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_wpbdp_submit_state: Data: 0.00MB + Index: 0.00MB + Engine MyISAM
    wp5y_wpmailsmtp_debug_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp5y_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    
    ### Post Type Counts ###
    
    _tcb_form_settings: 9
    acf-field: 5
    acf-field-group: 1
    attachment: 916
    custom_css: 2
    customize_changeset: 3
    page: 17
    post: 2
    product: 520
    revision: 252
    tcb_content_template: 11
    tcb_symbol: 4
    thrive_demo_page: 1
    thrive_demo_post: 1
    thrive_layout: 4
    thrive_template: 59
    thrive_typography: 2
    tve_cond_display: 4
    tve_notifications: 1
    wp_global_styles: 2
    ywctm-button-label: 4
    
    ### Security ###
    
    Secure connection (HTTPS): ?
    Hide errors from visitors: ?
    
    ### Active Plugins (13) ###
    
    Advanced Cron Manager: by BracketSpace – 2.4.2
    Advanced Custom Fields: by Delicious Brains – 5.12.3
    Cookie Notice & Compliance for GDPR / CCPA: by Hu-manity.co – 2.3.1
    Disable Media Pages: by Johannes Siipola – 2.0.1
    Import and export users and customers: by codection – 1.19.3.1
    Instagram Feed Pro Developer: by Smash Balloon – 6.0.8
    New User Approve: by WPExpertsio – 2.4.1
    Responsive Styled Google Maps: by hevada – 5.1
    Thrive Product Manager: by Thrive Themes – 1.3.0
    Thrive Architect: by <a href="https://www.thrivethemes.com">Thrive Themes</a> – 3.10
    WooCommerce: by Automattic – 6.7.0
    Wordfence Security: by Wordfence – 7.5.11
    WP Mail SMTP Pro: by WPForms – 3.5.1
    
    ### Inactive Plugins (0) ###
    
    ### Dropin Plugins (1) ###
    
    maintenance.php: maintenance.php
    
    ### Settings ###
    
    API Enabled: –
    Force SSL: –
    Currency: GBP (£)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    Connected to WooCommerce.com: –
    Enforce Approved Product Download Directories: ?
    
    ### WC Pages ###
    
    Shop base: #76 - /shop/
    Cart: #77 - /cart/
    Checkout: #78 - /checkout/
    My account: #79 - /my-account/
    Terms and conditions: ? Page not set
    
    ### Theme ###
    
    Name: Thrive Theme Builder Child
    Version: (update to version 0 is available)
    Author URL: 
    Child Theme: ?
    Parent Theme Name: Thrive Theme Builder
    Parent Theme Version: 3.8 – 3.9 is available
    Parent Theme Author URL: 
    WooCommerce Support: ?
    
    ### Templates ###
    
    Archive Template: Your theme has a woocommerce.php file
    you will not be able to override the woocommerce/archive-product.php custom template since woocommerce.php has priority over archive-product.php. This is intended to prevent display issues.
    
    Overrides: –
    
    ### Admin ###
    
    Enabled Features: activity-panels
    analytics
    coupons
    customer-effort-score-tracks
    experimental-products-task
    experimental-import-products-task
    experimental-fashion-sample-products
    experimental-product-tour
    homescreen
    marketing
    mobile-app-banner
    navigation
    onboarding
    onboarding-tasks
    remote-inbox-notifications
    remote-free-extensions
    payment-gateway-suggestions
    shipping-label-banner
    subscriptions
    store-alerts
    transient-notices
    wc-pay-promotion
    wc-pay-welcome-page
    wc-pay-subscriptions-page
    
    Disabled Features: minified-js
    settings
    
    Daily Cron: ? Next scheduled: 2022-07-29 14:05:53 +00:00
    Options: ?
    Notes: 48
    Onboarding: skipped
    
    ### Action Scheduler ###
    
    Complete: 15,339,754
    Oldest: 2022-06-29 19:42:31 +0000
    Newest: 2022-07-28 18:31:55 +0000
    
    Pending: 2
    Oldest: 2022-07-29 13:08:59 +0000
    Newest: 2022-08-03 03:26:40 +0000
    
    ### Status report information ###
    
    Generated at: 2022-07-28 20:40:20 +00:00
    
    • This topic was modified 2 years, 8 months ago by brizzol.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter brizzol

    (@brizzol)

    Here is custom code I put in functions php:

    add_filter( 'woocommerce_loop_add_to_cart_link', 'replace_loop_add_to_cart_button', 10, 2 );
    function replace_loop_add_to_cart_button( $button, $product  ) {
        // Not needed for variable products
        if( $product->is_type( 'variable' ) ) return $button;
    
        // Button text here
        $button_text = __( "View", "woocommerce" );
    
        return '<a class="button" href="' . $product->get_permalink() . '">' . $button_text . '</a>';
    }
    
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
    add_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 60 );
    
    function cc_mime_types($mimes) {
     $mimes['svg'] = 'image/svg+xml';
     return $mimes;
    }
    add_filter('upload_mimes', 'cc_mime_types');
    
    add_filter( 'woocommerce_variable_sale_price_html', 'update_price_html', 10, 2 );
    add_filter( 'woocommerce_variable_price_html', 'update_price_html', 10, 2 );
    add_filter('woocommerce_get_price_html','update_price_html', 10, 2);
    function update_price_html( $html, $product ) {
        if(!is_user_logged_in()) {
    
            add_filter( 'woocommerce_is_purchasable', '__return_false');
            $html = "Log in to see prices";
    
            return $html;
        } else {
            return $html;
        }
    }
    
    function wooc_extra_register_fields() {?>
    
           <p class="form-row form-row-first">
           <label for="reg_billing_first_name"><?php _e( 'First name', 'woocommerce' ); ?><span class="required">*</span></label>
           <input type="text" class="input-text" name="billing_first_name" id="reg_billing_first_name" value="<?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e( $_POST['billing_first_name'] ); ?>" />
           </p>
           <p class="form-row form-row-last">
           <label for="reg_billing_last_name"><?php _e( 'Last name', 'woocommerce' ); ?><span class="required">*</span></label>
           <input type="text" class="input-text" name="billing_last_name" id="reg_billing_last_name" value="<?php if ( ! empty( $_POST['billing_last_name'] ) ) esc_attr_e( $_POST['billing_last_name'] ); ?>" />
           </p>
           
                  <p class="form-row form-row-wide">
           <label for="reg_billing_company"><?php _e( 'Your business name', 'woocommerce' ); ?><span class="required">*</span></label>
           <input type="text" class="input-text" name="billing_company" id="reg_billing_company" value="<?php if ( ! empty( $_POST['billing_company'] ) ) esc_attr_e( $_POST['billing_company'] ); ?>" />
           </p>
    
                  <p class="form-row form-row-wide">
           <label for="reg_billing_phone"><?php _e( 'Phone', 'woocommerce' ); ?></label>
           <input type="text" class="input-text" name="billing_phone" id="reg_billing_phone" value="<?php esc_attr_e( $_POST['billing_phone'] ); ?>" />
           </p>
           <div class="clear"></div>
           <?php
     }
     add_action( 'woocommerce_register_form_start', 'wooc_extra_register_fields' );
     
     
     
     function wooc_validate_extra_register_fields( $username, $email, $validation_errors ) {
    
          if ( isset( $_POST['billing_first_name'] ) && empty( $_POST['billing_first_name'] ) ) {
    
                 $validation_errors->add( 'billing_first_name_error', __( '<strong>Error</strong>: First name is required!', 'woocommerce' ) );
    
          }
    
          if ( isset( $_POST['billing_last_name'] ) && empty( $_POST['billing_last_name'] ) ) {
    
                 $validation_errors->add( 'billing_last_name_error', __( '<strong>Error</strong>: Last name is required!.', 'woocommerce' ) );
    
          }
          
                if ( isset( $_POST['billing_company'] ) && empty( $_POST['billing_company'] ) ) {
    
                 $validation_errors->add( 'billing_company_error', __( 'Business name is required!.', 'woocommerce' ) );
    
          }
             return $validation_errors;
    }
    
    add_action( 'woocommerce_register_post', 'wooc_validate_extra_register_fields', 10, 3 );
    
    /**
    * Below code save extra fields.
    */
    function wooc_save_extra_register_fields( $customer_id ) {
        if ( isset( $_POST['billing_phone'] ) ) {
                     // Phone input filed which is used in WooCommerce
                     update_user_meta( $customer_id, 'billing_phone', sanitize_text_field( $_POST['billing_phone'] ) );
              }
          if ( isset( $_POST['billing_first_name'] ) ) {
                 //First name field which is by default
                 update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );
                 // First name field which is used in WooCommerce
                 update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );
          }
          if ( isset( $_POST['billing_last_name'] ) ) {
                 // Last name field which is by default
                 update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );
                 // Last name field which is used in WooCommerce
                 update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );
          }
          
                if ( isset( $_POST['billing_company'] ) ) {
                 // Last name field which is by default
                 update_user_meta( $customer_id, 'billing_company', sanitize_text_field( $_POST['billing_company'] ) );
                 // Last name field which is used in WooCommerce
                 update_user_meta( $customer_id, 'billing_company', sanitize_text_field( $_POST['billing_company'] ) );
          }
    
    }
    add_action( 'woocommerce_created_customer', 'wooc_save_extra_register_fields' );
    
    /**
     * Remove partial product structured data.
     */
    function ace_remove_partial_product_structured_data( $markup_offer, $product ) {
    	$markup_offer = array(
    		'availability'  => 'https://schema.org/' . ( $product->is_in_stock() ? 'InStock' : 'OutOfStock' ),
    		'url'           => get_permalink( $product->get_id() ),
    		'seller'        => array(
    			'@type' => 'Organization',
    			'name'  => get_bloginfo( 'name' ),
    			'url'   => home_url(),
    		),
    	);
    
    	return $markup_offer;
    }
    add_filter( 'woocommerce_structured_data_product_offer', 'ace_remove_partial_product_structured_data', 10, 2 );
    
    add_action('check_admin_referer', 'logout_without_confirm', 10, 2);
    function logout_without_confirm($action, $result)
    {
        /**
         * Allow logout without confirmation
         */
        if ($action == "log-out" && !isset($_GET['_wpnonce'])) {
            $redirect_to = isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : '/test';
            $location = str_replace('&', '&', wp_logout_url($redirect_to));
            header("Location: $location");
            die;
        }
    }
    Mirko P.

    (@rainfallnixfig)

    Hi @brizzol,

    Thanks for reaching out on the WooCommerce core forum.

    Can you please clarify what the custom code is supposed to do on your site and give us some more details on the issue with the database table? Which table are you referring to and what exactly happens in the database? The more details we get, the easier it would be for us to provide further assistance.

    Looking forward to hearing from you.

    Thread Starter brizzol

    (@brizzol)

    Hi Mirko,

    The code is to hide prices for users who don’t have an account.

    There is another bit of code for custom fields but I don’t think that’s needed anymore.

    Just didn’t know if any of those bits of code were responsible.

    The issue is the database is being populated with gigabytes of data from these two:
    actionscheduler_actions
    actionscheduler_logs

    There are 1.5m completed actions with nearly 15GB of data I’m not sure how to go through it to find what the issue is.

    Thanks.

    Hello,

    Thanks for providing that information.

    May I ask what happens when the custom code is disabled? Is the database still being populated with many gigabytes?

    I found a page with a different workaround to hide prices for users that are not logged in (You can add it either to your functions.php file or using a plugin like Code Snippets): Hide Add to Cart Buttons and Prices if Logged Out

    May I ask for one more piece of information? Can you share a copy of any fatal error log found under WooCommerce > System Status > Logs (if any).

    Please let us know so that we can take a better look. Thank you.

    Thread Starter brizzol

    (@brizzol)

    Hi Igor,

    I’m not sure as I only just found this issue due to my hosting running out of storage.

    I deleted the logs from there earlier thinking it would help free up storage, nothing more in there apart from an empty test log.

    Can I empty those two tables somehow without breaking anything to see if removing the custom code stops this from happening?

    Appreciate the help!

    Hello,

    Can I empty those two tables somehow without breaking anything to see if removing the custom code stops this from happening?

    In this case, I’d recommend running a conflict test on a staging environment so that you will not have to touch your production site, you can either ask your host for that option or you can use a plugin like WP Staging for quickly spinning up a new test site.

    Once the staging site is ready you can perform the conflict test following the instructions below:
    https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    Let us know if this worked for you.

    Thread Starter brizzol

    (@brizzol)

    I have emptied the tables which didn’t break anything and replaced my code with the suggested code above to see if that helps.

    Had to use the hide cart code that I was using before as the one you suggested didn’t work for my theme.

    • This reply was modified 2 years, 7 months ago by brizzol.
    • This reply was modified 2 years, 7 months ago by brizzol.
    Thread Starter brizzol

    (@brizzol)

    Also, I previously had some code that moved the description to the right of the image… Tried to show what I mean in this pic: https://imgur.com/a/1MBxqKJ

    Can you advise me on the code for this please.

    Found the code needed:

    remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_product_data_tabs’, 10 );
    add_action( ‘woocommerce_single_product_summary’, ‘woocommerce_output_product_data_tabs’, 60 );

    • This reply was modified 2 years, 7 months ago by brizzol.
    Plugin Support con

    (@conschneider)

    Engineer

    Hi @brizzol

    Tried to show what I mean in this pic: https://imgur.com/a/1MBxqKJ

    Your code has some minor faults. Just to be sure, this is working for me:

    // Removes tabs from their original loaction 
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
    
    // Inserts tabs under the main right product content 
    add_action( 'woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 60 );

    Kind regards,

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Database issues’ is closed to new replies.