1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Weird custom fields data lost

Discussion in 'WordPress' started by Divvy, May 17, 2019 at 7:21 AM.

  1. #1
    Hello guys,
    SEMrush
    I'm experiencing a weird issue with my wordpress. I'm around this for almost two months. Can someone please help me? Please be my life savior...

    The issue:

    When I publish a post with data in all fields (original and custom) everything seems ok. But after a few days (3-7 days on average), the data from my custom fields (only) disappear and I don't understand why. I already did the test of disabling all my plugins and I still have the same problem. So probably the issue is in my theme functions.php code, am I right?

    Is there any kind soul that have enough time to check my code to see if there is anything that can cause this to happen, please?
    My functions.php code: paste2.org/VvzxAdwA

    The custom fields that I have and where the data disappears after a few days are:

    mr_magnifying_glass
    
    mr_random_post
    mr_feature_video
    
    today_offer
    
    site_id1
    site_id2
    site_id3
    site_id4
    site_id5
    site_id6
    site_id7
    site_id8
    
    mr_active_discount
    mr_topdeal_discount
    mr_new_discount
    mr_lifetime_discount
    mr_discount_des
    mr_discount_Image
    mr_discountbutton_url
    
    mr_quility_des
    mr_content_des
    
    mr_month_price
    mr_month_off
    mr_month_lastrice
    mr_month_price_2
    mr_sixmonth_price
    mr_sixmonth_off
    mr_sixmonth_lastrice
    mr_per_month3
    mr_threeyear_price
    mr_threeyear_off
    mr_threeyear_lastrice
    mr_per_month6
    mr_fiveyear_price
    mr_fiveyear_off
    mr_fiveyear_lastrice
    mr_per_month12
    
    mr_feature1
    mr_feature2
    mr_feature3
    mr_feature4
    mr_feature5
    mr_feature6
    
    catag
    domaintag
    post_external_link
    joink_external_link
    titletag
    
    discount-extra-site[]
    Code (markup):
    I don't know if this helps...

    Please help me, I don't know what else to do...

    Thank you, guys!
     
    Divvy, May 17, 2019 at 7:21 AM IP
    SEMrush
  2. AttaboyRoi

    AttaboyRoi Member

    Messages:
    26
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    33
    #2
    Is the data going into a database and being removed from there?
    Did this work at first and then stop working or never work?
     
    AttaboyRoi, May 18, 2019 at 1:44 PM IP
  3. Divvy

    Divvy Well-Known Member

    Messages:
    722
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #3
    @AttaboyRoi, the data goes to the database but it disappears after 3-7 days.
    I already had this working fine before, but I don't remember which modification I made that made this stop to work. Any ideas?
     
    Divvy, May 18, 2019 at 4:25 PM IP
  4. AttaboyRoi

    AttaboyRoi Member

    Messages:
    26
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    33
    #4
    It's odd that the situation is time based. The two steps I would perform first are 1) check to make sure you're not running out of space as a precaution. Usually, the database will crash, but it doesn't hurt to check. 2) turn on debug logging. For instance, if you are using mysql then you want to view more than error logging. MySQL will log all your select, delete, etc actions so you see when the issue occurs and what is causing it.

    It's possible the data is being overwritten (scheduled task or cron maybe), a log review should be able to show you what's going on.
     
    AttaboyRoi, May 18, 2019 at 5:39 PM IP
  5. Divvy

    Divvy Well-Known Member

    Messages:
    722
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #5
    @AttaboyRoi that's a good idea using the debug log. I checked my config and I already have enabled.
    This is what I have: paste2.org/vsxnUmaI

    Do you see anything suspicious?
    I don't remember the date that the data disappeared from the fields last time, but I'm going to check this every day.

    How about this? Do you think it can help? How to use it?
    define(‘SAVEQUERIES’, true);

    Thanks!!
     
    Divvy, May 19, 2019 at 4:44 AM IP