• Resolved Tennant

    (@tennant)


    Having an issue where products change status from Published to Draft what seems like daily, hosted with FlyWheel so my server-level troubleshooting is limited to what their support will allow me to do.

    What I’ve tried so far

    First I installed “WP Security Audit Log” and it did not catch it happening last time. So I published the products again manually, and uninstalled that plugin. Then installed “Simple History”. Same issue, didn’t catch it.

    https://en-ca.www.ads-software.com/plugins/activity-log-mainwp/
    https://en-ca.www.ads-software.com/plugins/simple-history/

    What I noticed

    This is not the first time it’s been reported, and that it’s daily, maybe a Cron or Cache thing.

    https://www.ads-software.com/support/topic/products-changing-status-to-draft-automatically/
    https://www.ads-software.com/support/topic/product-wont-publish-always-shoe-in-draft/

    System Status

    
    ### WordPress Environment ###
    
    WordPress address (URL): omitted for SEO reasons, same as "Link to the page you need help with".
    Site address (URL): omitted for SEO reasons, same as "Link to the page you need help with".
    WC Version: 3.9.2
    REST API Version: ? 1.0.7
    Log Directory Writable: ?
    WP Version: 5.3.2
    WP Multisite: –
    WP Memory Limit: 128 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_US
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Flywheel/5.1.0
    PHP Version: 7.3.15-3+ubuntu16.04.1+deb.sury.org+1
    PHP Post Max Size: 300 MB
    PHP Time Limit: 60
    PHP Max Input Vars: 1000
    cURL Version: 7.47.0
    OpenSSL/1.0.2g
    
    SUHOSIN Installed: –
    MySQL Version: 5.7.25-google
    Max Upload Size: 300 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 3.9.2
    WC Database Prefix: wp_7gm7hsa5eb_
    Total Database Size: 19.65MB
    Database Data Size: 10.38MB
    Database Index Size: 9.27MB
    wp_7gm7hsa5eb_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_7gm7hsa5eb_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_7gm7hsa5eb_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_7gm7hsa5eb_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
    wp_7gm7hsa5eb_dokan_announcement: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_dokan_orders: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_7gm7hsa5eb_dokan_refund: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_dokan_shipping_zone_locations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_dokan_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_dokan_vendor_balance: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_dokan_withdraw: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_7gm7hsa5eb_options: Data: 2.05MB + Index: 0.06MB + Engine InnoDB
    wp_7gm7hsa5eb_pmxi_files: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_pmxi_history: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_pmxi_images: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_pmxi_imports: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_pmxi_posts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_pmxi_templates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_7gm7hsa5eb_postmeta: Data: 2.52MB + Index: 4.03MB + Engine InnoDB
    wp_7gm7hsa5eb_posts: Data: 1.50MB + Index: 0.36MB + Engine InnoDB
    wp_7gm7hsa5eb_simple_history: Data: 0.13MB + Index: 0.08MB + Engine InnoDB
    wp_7gm7hsa5eb_simple_history_contexts: Data: 1.52MB + Index: 1.72MB + Engine InnoDB
    wp_7gm7hsa5eb_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_7gm7hsa5eb_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_7gm7hsa5eb_term_relationships: Data: 0.11MB + Index: 0.06MB + Engine InnoDB
    wp_7gm7hsa5eb_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_7gm7hsa5eb_usermeta: Data: 0.13MB + Index: 0.14MB + Engine InnoDB
    wp_7gm7hsa5eb_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_7gm7hsa5eb_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_7gm7hsa5eb_wc_product_meta_lookup: Data: 0.08MB + Index: 0.13MB + Engine InnoDB
    wp_7gm7hsa5eb_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_7gm7hsa5eb_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_7gm7hsa5eb_wsal_metadata: Data: 1.52MB + Index: 1.83MB + Engine InnoDB
    wp_7gm7hsa5eb_wsal_occurrences: Data: 0.06MB + Index: 0.09MB + Engine InnoDB
    wp_7gm7hsa5eb_wsal_options: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    
    ### Post Type Counts ###
    
    attachment: 818
    customize_changeset: 8
    dokan_announcement: 1
    dokan_slider: 2
    elementor_library: 1
    nav_menu_item: 5
    page: 12
    post: 2
    product: 711
    revision: 34
    scheduled-action: 5
    vc4_templates: 1
    
    ### Security ###
    
    Secure connection (HTTPS): ?
    Hide errors from visitors: ?
    
    ### Active Plugins (5) ###
    
    Dokan: by weDevs – 3.0.1
    Dokan Pro - business: by weDevs – 2.9.19
    Elementor: by Elementor.com – 2.9.3
    Simple History: by P?r Thernstr?m – 2.33.2
    WooCommerce: by Automattic – 3.9.2 – 4.0.0 is available
    
    ### Inactive Plugins (0) ###
    
    ### Dropin Plugins (1) ###
    
    db-error.php: db-error.php
    
    ### Must Use Plugins (1) ###
    
    Local by Flywheel Live Link Helper: by Flywheel – 1.1
    
    ### Settings ###
    
    API Enabled: –
    Force SSL: –
    Currency: CAD ($)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    product_pack (product_pack)
    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: –
    
    ### WC Pages ###
    
    Shop base: #3386 - /products/
    Cart: #3309 - /cart/
    Checkout: #3311 - /checkout/
    My account: #3234 - /my-account/
    Terms and conditions: ? Page not set
    
    ### Theme ###
    
    Name: Dokan
    Version: 2.3.6
    Author URL: https://tareq.weDevs.com
    Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
    WooCommerce Support: ?
    
    ### Templates ###
    
    Overrides: dokan/archive-product.php
    dokan/woocommerce/cart/mini-cart.php
    dokan/woocommerce/loop/add-to-cart.php
    dokan/woocommerce/myaccount/form-login.php
    dokan/single-product.php
    
    ### Action Scheduler ###
    
    Complete: 5
    Oldest: 2020-02-20 02:28:28 +0000
    Newest: 2020-03-10 17:11:46 +0000
    
    Pending: 0
    Oldest: –
    Newest: –
    
    Canceled: 0
    Oldest: –
    Newest: –
    
    In-progress: 0
    Oldest: –
    Newest: –
    
    Failed: 0
    Oldest: –
    Newest: –
    
    

    This problem is holding my website back from going live, any help you can provide I appreciate. I’m hoping this thread is the end-all for others facing this problem.

    As well – any suggestions to bring to my managed hosting (Flywheel) I will report back with findings.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Peter Fabian

    (@peterfabian1000)

    Hi, thanks for reporting this problem back to us.

    If you want to find out what’s causing it and you’re comfortable using a code snippet, e.g. by using https://www.ads-software.com/plugins/code-snippets/, you can add this snippet:

    
    
    function log_product_update( $product_id ){
    	$f = fopen( WC_LOG_DIR . '/product_update.log', 'a+' );
    	$log_str = sprintf( "%s: Updating product %d from %s\n", date( DateTimeInterface::ISO8601 ), $product_id, print_r( debug_backtrace( 2 ), true ) );
    	fwrite( $f, $log_str );
    	fclose( $f );
    }
    
    add_action( 'woocommerce_update_product', 'log_product_update', 1 );
    
    

    and then find out in the log file wp-content/uploads/wc-logs/product_update.log, what is causing the update of the product (that is, if it’s not updated directly in the database). You can also share the relevant part of the log here for us to help you out.

    Thread Starter Tennant

    (@tennant)

    @peterfabian1000 Just enabled your plugin suggestion and the code snippet. I’ll report back findings shortly (waiting for products to move to draft by themselves again).

    Thread Starter Tennant

    (@tennant)

    Had it happen again, and the code snippet did not produce any logs. But, I did figure out the issue.

    I’m using the Dokan plugin on the Business plan. And it includes a feature where “vendors” have subscriptions, and when the subscription expires, you can choose to have all those “vendors” products go back to draft mode.

    How I identified this

    I installed the WP Control plugin and looked for any CRON jobs that ran daily. Then published one product back from draft. And went back to my Tools > Cron Events page the WP Control plugin provides. And manually ran a few of the cron jobs.

    https://en-ca.www.ads-software.com/plugins/wp-crontrol/

    The specific cron job that was moving my products to draft mode was dps_schedule_pack_update. It’s job as mentioned above was to move products of vendors with expired subscriptions.

    My problem was not giving my vendors a subscription, so all of them were technically expired daily. Thus the cron job.

    This wont solve everyones problem that has reported it, but absolutely look at your CRON jobs with the plugin. And try out the steps to publish one, run the job manually, and see what happens.

    Thanks for the help @peterfabian1000

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Products change status from Published to Draft automatically’ is closed to new replies.