Support » Plugin: Entry Expiration for Gravity Forms » None of the entries is deleted

  • Resolved if_Patrick

    (@if_patrick)


    Howdy Travis,

    I could need some advice from you, because none of the entries are being deleted by this plugin on our website.

    We have quite a few forms on our website. Some of the save entries, others don’t. So for those which save entries, I added your plugin and activated it for those forms. Since it seems to be possible to set various periods of deletion times, I used three different “Delete-Entry-After”-settings/categories.

    The web api is not activated. We do have other plugins that may interfere with your plugin:

    We use the latest version of wordpress. It is connected to a cloudflare cdn and we have set up an external cron-service to ping the wp_cron every 5 minutes.

    The Gravity Forms log shows, that the function is being called. It always logs a line similar to the following one:

    2017-04-10 12:45:08.919217 – DEBUG –> GF_Entry_Expiration::maybe_run_deletion(): Not deleting entries for form #<XX> because no entries were found matching the search criteria.

    Do you have any idea, what might be going wrong? What do you think is the source of this problem? Is it about caching (we make use of Cloudflare CDN, as well as WP-Rocket). Or do you see anything else, that might cause this “strange” behaviour?

    Thanks in advance,
    Patrick

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi Patrick,

    We are experiencing similar problems with the 2.0.1 version of the plugin.
    Expiration is set on a per form basis (expire after 2 hours, check every hour) but entries do not get removed.

    Have you had any luck in getting this working?

    Thanks,
    Ruud

    Hi Ruud,

    no sorry. The plugin still does not work as expected. I also changed the WP-Cron to a real Cron and the result was still the same. No entries are deleted after a given expiration time.

    Cheers,
    Patrick

    Hi Patrick,

    The cron is probably doing its job, but as you also found out, I’m guessing the part where the code is determining which records to delete is not working as it should.

    ” because no entries were found matching the search criteria.”

    Is your expiration interval bases on hours, or days?

    Thanks,
    Ruud

    I encountered the same problem.

    After some debugging I found that:

    The method maybe_run_deletion() on line 484 is calling the get_search_criteria with 3 arguments:

    $search_critera = $this->get_search_criteria( $form, $settings, 'deletion' );

    However, that method has no third parameters set:

    get_search_criteria( $form, $settings )

    Yet it is still trying to use $type (I assume that should be ‘deletion’) when building the search criteria array (line 587):

    'end_date' => date( 'Y-m-d H:i:s', strtotime( '-' . $settings[ $type . 'Date' ]['number'] . ' ' . $settings[ $type . 'Date' ]['unit'] ) ),

    Meaning that search results can not get a proper date so it will return to the date time for null: 1970-01-01.

    So basically what is happening here is it is looking for forms with a start date of 1970 and an end date of 1970, ain’t going to work.

    Everyone who has this version should have this problem.

    Plugin Author Travis Lopes

    (@travislopes)

    Entry Expiration has been updated to 2.0.2 which fixes an issue with the search criteria not preparing the correct search end date. It also includes additional debug logging.

    Hi Travis, thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘None of the entries is deleted’ is closed to new replies.