| @@ -97,15 +97,17 @@ | ||
| 97 | 97 | if ( null !== $to_date ) { |
| 98 | 98 | $where['created_at <'] = $to_date . ' 23:59:59'; |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | + $db_version = get_option( $this->db_opt_name ); | |
| 102 | + | |
| 101 | 103 | // Do not collect test payment, this is a new feature of Stripe lite. |
| 102 | - if ( 6 <= get_option( $this->db_opt_name ) ) { | |
| 104 | + if ( 6 <= $db_version ) { | |
| 103 | 105 | $where['test'] = array( null, 0 ); |
| 104 | 106 | } |
| 105 | 107 | |
| 106 | 108 | // If only Paypal is used, and the DB isn't migrated (to version 4), use `completed` column instead of `status`. |
| 107 | - if ( 4 > get_option( $this->db_opt_name ) && FrmDb::db_column_exists( $this->table_name, 'completed' ) ) { | |
| 109 | + if ( 4 > $db_version && FrmDb::db_column_exists( $this->table_name, 'completed' ) ) { | |
| 108 | 110 | $where['completed'] = 1; |
| 109 | 111 | } else { |
| 110 | 112 | $where['status'] = 'complete'; |
| 111 | 113 | } |