| @@ -39,12 +39,12 @@ | ||
| 39 | 39 | return; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $tracking = array( |
| 43 | - 'day' => random_int( 0, 6 ) * DAY_IN_SECONDS, | |
| 44 | - 'hour' => random_int( 0, 23 ) * HOUR_IN_SECONDS, | |
| 45 | - 'minute' => random_int( 0, 59 ) * MINUTE_IN_SECONDS, | |
| 46 | - 'second' => random_int( 0, 59 ), | |
| 43 | + 'day' => rand( 0, 6 ) * DAY_IN_SECONDS, | |
| 44 | + 'hour' => rand( 0, 23 ) * HOUR_IN_SECONDS, | |
| 45 | + 'minute' => rand( 0, 59 ) * MINUTE_IN_SECONDS, | |
| 46 | + 'second' => rand( 0, 59 ), | |
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | 49 | $offset = array_sum( $tracking ); |
| 50 | 50 | $init_send = strtotime( 'next sunday' ) + $offset; |
| @@ -105,15 +105,20 @@ | ||
| 105 | 105 | * |
| 106 | 106 | * @return bool |
| 107 | 107 | */ |
| 108 | 108 | private static function is_forms_list_page() { |
| 109 | - if ( ! FrmAppHelper::on_form_listing_page() ) { | |
| 109 | + if ( ! FrmAppHelper::is_admin_page() ) { | |
| 110 | 110 | return false; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - // Exclude Trash page. | |
| 113 | + // Check Trash page. | |
| 114 | 114 | $form_type = FrmAppHelper::simple_get( 'form_type' ); |
| 115 | - return $form_type && 'published' === $form_type; | |
| 115 | + if ( $form_type && 'published' !== $form_type ) { | |
| 116 | + return false; | |
| 117 | + } | |
| 118 | + | |
| 119 | + // Check edit or settings page. | |
| 120 | + return ! FrmAppHelper::simple_get( 'frm_action' ); | |
| 116 | 121 | } |
| 117 | 122 | |
| 118 | 123 | /** |
| 119 | 124 | * AJAX handler to track flows. |