| @@ -46,9 +46,9 @@ | ||
| 46 | 46 | public function upload_software() { |
| 47 | 47 | // Get the software data and hash. |
| 48 | 48 | $data = $this->get_software_data(); |
| 49 | 49 | $hash = sha1( json_encode( $data ) ); |
| 50 | - if ( ! defined( 'DOING_CRON' ) && ! isset( $_POST['webarx_secret'] ) && get_option( 'patchstack_software_data_hash', false ) === $hash ) { | |
| 50 | + if ( ! isset( $_POST['webarx_secret'] ) && get_option( 'patchstack_software_data_hash', false ) === $hash ) { | |
| 51 | 51 | return; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // Synchronize the software list with the API. |
| @@ -76,9 +76,9 @@ | ||
| 76 | 76 | * @return void |
| 77 | 77 | */ |
| 78 | 78 | public function upload_firewall_logs() { |
| 79 | 79 | global $wpdb; |
| 80 | - $lastid = get_option( 'patchstack_firewall_log_lastid', 0 ); | |
| 80 | + $lastid = get_option( 'patchstack_firewall_log_lastid', 0, true ); | |
| 81 | 81 | $items = $wpdb->get_results( $wpdb->prepare( 'SELECT ip, log_date, request_uri, user_agent, fid, method, post_data FROM ' . $wpdb->prefix . 'patchstack_firewall_log WHERE id > %d ORDER BY id', $lastid ) ); |
| 82 | 82 | |
| 83 | 83 | // No need to synchronize if there are no new logs present. |
| 84 | 84 | if ( $wpdb->num_rows == 0 ) { |