WordPress.org

Plugin Directory

Changeset 1656875


Ignore:
Timestamp:
05/14/17 04:40:27 (3 months ago)
Author:
travislopes
Message:

Entry Expiration for Gravity Forms (2.0.3)

  • Fixed search criteria not correctly preparing in certain scenarios
Location:
gravity-forms-entry-expiration
Files:
6 added
3 edited

Legend:

Unmodified
Added
Removed
  • gravity-forms-entry-expiration/trunk/class-gf-entryexpiration.php

    r1637657 r1656875  
    494494 
    495495        // Define next run time. 
    496         $next_run_time  = 'hours' === $settings['deletionRunTime']['unit'] ? ( $settings['deletionRunTime']['number'] * HOUR_IN_SECONDS ) : ( $settings['deletionRunTime']['number'] * DAY_IN_SECONDS ); 
    497         $next_run_time -= 5; 
     496        $next_run_time = $this->prepare_next_run_time( $settings ); 
    498497 
    499498        // Get search criteria for form. 
    500         $search_critera = $this->get_search_criteria( $form, $settings ); 
     499        $search_critera = $this->get_search_criteria( $settings, $form ); 
    501500 
    502501        // Log the search criteria. 
     
    604603     * @return array 
    605604     */ 
    606     public function get_search_criteria( $form, $settings ) { 
     605    public function get_search_criteria( $settings, $form ) { 
    607606 
    608607        // Initialize search criteria. 
     
    634633 
    635634        return $search_critera; 
     635 
     636    } 
     637 
     638    /** 
     639     * Prepare the next time Entry Expiration should run. 
     640     * 
     641     * @since  2.0.3 
     642     * @access public 
     643     * 
     644     * @param array $settings Entry Expiration settings. 
     645     * 
     646     * @return int 
     647     */ 
     648    public function prepare_next_run_time( $settings ) { 
     649 
     650        // Get run time number. 
     651        $number = $settings['deletionRunTime']['number']; 
     652 
     653        // Prepare run time based on unit. 
     654        switch ( $settings['deletionRunTime']['unit'] ) { 
     655 
     656            case 'days': 
     657                $next_run_time = $number * DAY_IN_SECONDS; 
     658                break; 
     659 
     660            case 'hours': 
     661                $next_run_time = $number * HOUR_IN_SECONDS; 
     662                break; 
     663 
     664            case 'months': 
     665                $next_run_time = $number * MONTH_IN_SECONDS; 
     666                break; 
     667 
     668            case 'weeks': 
     669                $next_run_time = $number * WEEK_IN_SECONDS; 
     670                break; 
     671 
     672        } 
     673 
     674        // Adjust run time by five seconds. 
     675        $next_run_time -= 5; 
     676 
     677        return $next_run_time; 
    636678 
    637679    } 
  • gravity-forms-entry-expiration/trunk/entryexpiration.php

    r1637657 r1656875  
    44Plugin URI: http://travislop.es/plugins/gravity-forms-entry-expiration/ 
    55Description: Provides a simple way to remove old entries in Gravity Forms. 
    6 Version: 2.0.2 
     6Version: 2.0.3 
    77Author: travislopes 
    88Author URI: http://travislop.es 
     
    1111 **/ 
    1212 
    13 define( 'GF_ENTRYEXPIRATION_VERSION', '2.0.2' ); 
     13define( 'GF_ENTRYEXPIRATION_VERSION', '2.0.3' ); 
    1414 
    1515// If Gravity Forms is loaded, bootstrap the Entry Expiration Add-On. 
  • gravity-forms-entry-expiration/trunk/readme.txt

    r1637657 r1656875  
    1010== Description == 
    1111 
    12 > #### [Entry Automation for Gravity Forms](https://forgravity.com/plugins/entry-automation/?utm_source=wordpress&utm_medium=readme&utm_campaign=readme) makes entry deletion more powerful and more! 
     12> #### [Entry Automation for Gravity Forms](https://forgravity.com/plugins/entry-automation/?utm_source=wordpress&utm_medium=readme&utm_campaign=readme) makes entry deletion more powerful and allows you to export your entries too! 
    1313> 
    1414> Entry Expiration started out as a simple tool to automatically remove your old form entries. But what if you need more control over when entries are deleted? Want to apply conditional logic to target specific entries? Need to generate an export file before getting rid of those entries? 
     
    3535== Changelog == 
    3636 
    37 = v2.0.2 = 
     37= Version 2.0.3 = 
     38* Fixed search criteria not correctly preparing in certain scenarios. 
     39 
     40= Version 2.0.2 = 
    3841* Fixed search criteria not correctly preparing the search end date. 
    3942 
    40 = v2.0.1 = 
     43= Version 2.0.1 = 
    4144* Fixed fatal error during 2.0 upgrade process. 
    4245 
    43 = v2.0 = 
     46= Version 2.0 = 
    4447* Added expiration time and recurrence at the form level. 
    4548* Rewrote expiration procedure to be more efficient. 
    4649 
    47 = v1.2.3 = 
     50= Version 1.2.3 = 
    4851* Added additional logging 
    4952* Added filter for setting entry expiration time for each form 
    5053 
    51 = v1.2.2 = 
     54= Version 1.2.2 = 
    5255* Changed plugin loading method 
    5356* Added "gf_entryexpiration_recurrence" hook to change cron recurrence 
    5457 
    55 = v1.2.1 =  
     58= Version 1.2.1 =  
    5659* Adjusted entry older than date to not be relative to midnight 
    5760 
    58 = v1.2 =  
     61= Version 1.2 =  
    5962* Fixed update routine to not automatically enable forms for processing if running a fresh install 
    6063* Changed expiration time setting to allow choosing between hours, days, weeks and months 
    6164 
    62 = v1.1 = 
     65= Version 1.1 = 
    6366* Switched forms from being able to be excluded to having to include them for processing 
    6467* Deletion cron now runs hourly instead of daily 
     
    6669* Added filters for: payment status, number of entries to be processed at a time 
    6770 
    68 = v1.0 = 
     71= Version 1.0 = 
    6972* Initial release 
Note: See TracChangeset for help on using the changeset viewer.