Classifieds listed , turns to "draft" after specific time period

classifieds are published as per normal.

After a specific amount of time, they unpublish and become
"Drafts "

FYI :

Taxonomy
I have deleted the "expiry" taxonomy as there is no need for it.
( could this be the problem ?)

Classified status options
I have only enabled " publish " and disabled "Pending review" and
" Draft"

Please assist urgently, as published adverts are reverting to drafts.

Please additionally also check test site as well http://www.crestviewvet.co.za/wp
for the problem.

  • Ash
    • WordPress Hacker

    Hello @Nishal

    Welcome to WPMU community!

    I hope you are well today and thanks for asking the question.

    Sorry to hear that you are having issues.

    After a specific amount of time, they unpublish and become "Drafts "

    What is the amount of time? Is it random or really specific?

    I have deleted the "expiry" taxonomy as there is no need for it.

    What do you mean by expiry taxonomy? Please attach a screenshot of where it was.

    Cheers
    Ash

    • Nishal
      • Flash Drive

      Thank you Ashok,

      I am unsure about the time it takes to revert to a draft.

      Currently, if you look at the website, all published classifieds have reverted back to "drafts" ( see screen shot Drafts)

      This is cont. happening whenever someone posts a new classified.
      ( screenshot 2, shows no classifieds in the classifieds section )

      IN custompress, there was a default taxonomy named, Expiry that I deleted and is related to the classified ( see screenshot clipboard 3 & 4 )

      It is also occurin on my test site, http://www.crestviewvet.co.za/wp

      P : admin
      U : admin

      I will be publishing the auctions on sanaps.org.za in a few hours , just to make sure that they are visible. ( I can not cont. do this )

      Please see the http://www.crestviewvet.co.za/wp

      site, as it has the same problem,

      Note: if you view a saved classified, the adds appear there.

      Your help is massively appreciated.

  • Nishal
    • Flash Drive

    Hi Ashok,

    i have updated the plugin and still am experiencing the same problem, I have granted access to sanaps.org.za

    I have edited / added custom fields in custom press, you can have a look

    Thank you,
    ( i am currently re publishing classifieds every 6- 8 hours in order to keep them on the site)

  • Saurabh
    • New Recruit

    Howdy Nishal,

    Due to the nature of classifieds, the plugin has a built-in mechanism that checks if a particular ad has expired. This happens twice a day.

    Now, if you have removed the expiry for whatever purpose, this mechanism will not find an expiry date (no expiry date = 0 = expire, right now) and the ad will turn to draft.

    What I'm suggesting here involves editing a core file. You may have to redo this with every update. Meanwhile, I'll mark this as a feature request to see if more people need an unpluggable expiry feature.

    Open this page in an editor: plugins/classifieds/core/core.php

    At about line 164, locate this piece of code, that sets up the expiry checking mechanism:

    /* Check expiration dates */
            add_action( 'check_expiration_dates', array( &$this, 'check_expiration_dates_callback' ) );

    and comment it out, as follows:

    /* Check expiration dates */
            // add_action( 'check_expiration_dates', array( &$this, 'check_expiration_dates_callback' ) );

    This will solve your problem, immediately, since the expiry check will never happen and post status will never change!

    Best

    Saurabh

  • Nishal
    • Flash Drive

    Good day Ashok, Saurabh,

    The Ads have gone back to Expiring within 12 hour laps.

    Please do assist. I have not touched the website since.
    I am merely re-publishing all the classifieds.

    I extended access as well.
    P.S.
    Additional : Is it possible for me to remove, " excerpt " " cost" & "Duration"
    without affecting anything further.

    Note : there are 2 x Duration fields.

    Your urgency is will be immensely appreciated.

  • Michael Bissett
    • Recruit

    Hey @Nishal,

    Did you update Directory in the meantime? If you did, that would explain why the modifications were lost, since a plugin update will overwrite that.

    I'm not seeing that Support Access is enabled for your site, could you check that please? In the meantime, I've called @Saurabh Shukla back to this thread, so he can advise on the "Additional" request. :slight_smile:

    Regards,
    Michael

  • Arnold
    • El Macho WP

    Looking at your setup, in Custom fields you have two Cost and two Duration custom fields. The plugin create one Cost and one Duration. field sand they always have the same field ID.

    Cost = _ct_text_4cfeb3eac6f1f and
    Duration = _ct_selectbox_4cf582bd61fa4.

    If they are deleted they will recreate themselves because they are necessary to the logic of the program. In particular the Duration field sets the amount of time before the Ad will expire. It does this by taking the current date and adding the duration time and saving it as an _expire metadata for the given Ad. If there is already and _expire time the duration is added to that to extend it.

    I suspect the double fields are confusing things.

    Looking at your list of auctions they all say. "No Expiration date set" which is why they are expiring immediately.

    The proper duration field will have as it's first choice "How long is this ad open from today" and let you pick a number of weeks. It will display the expiration date once it's saved. I did this on your 101 test ad and it correctly shows the expiration date.

    How are you wanting it to work? It appears to be working OK except that you are not properly setting the expiration dates,

    We don't create an Expiry taxonomy so I don't know where that came from.

  • Nishal
    • Flash Drive

    Thank you Arnold, for your prompt help.

    I have not created the cost and duration additions,
    ( can we merely delete these duplicates)

    The Classifieds seemed to be working over the past 2.5 weeks without resetting back to drafts, this problem has suddenly reemerged again.

    I would like the adverts not to expire and eliminate the option of setting durations of the classifieds.

    Please do let me know if you need any further info from me.

  • Nishal
    • Flash Drive

    Hi Arnold,

    I think ive figured it out, as per Saurabh Shukla instructions earlier in this post, Ive gone back to the core file in the plugin and re-edited line 164. ( see att. )

    I am sure this will solve the problem for the time being.

    I do not understand why the core file reverted back to the original ?
    Any ideas ? I have disabled the auto update.

    secondary, Can we delete the duplicate fields ?

    I will monitor this over the next 2.5 weeks, I hope it does not revert once again.

    Thank you for your speedy assistance , it is more appreciated than you know.

    Have a great day

  • Arnold
    • El Macho WP

    Yes you can remove the duplicate fields. See the ids I posted above for the ones that should stay in there.

    Since you don't want expiration, which is an inherent part of Classifieds, you might do better with Directory. They don't expires and there is no cost field unless you add one. Directory is more of the line of buying a listing that remains in the database like a phone book.

    Take a look at it on your test machine and I can help you move your current listings over to directory if that's what you decide.

  • Nishal
    • Flash Drive

    Hi,

    I am still monitoring the plugin to make sure this update of the core files does not occur.

    The Classified plugin worked awesome for this purpose, until the expiration of all adds, it is a glitch in the plugin itself from my previous knowledge to amend it.

    I will monitor it and remove the duplicate fields.

    Thanks for the assistance

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.