diff --git a/public_html/wp-content/plugins/wordcamp-reports/classes/report/class-wordcamp-counts.php b/public_html/wp-content/plugins/wordcamp-reports/classes/report/class-wordcamp-counts.php index 3595d9bc80..f16589ce31 100644 --- a/public_html/wp-content/plugins/wordcamp-reports/classes/report/class-wordcamp-counts.php +++ b/public_html/wp-content/plugins/wordcamp-reports/classes/report/class-wordcamp-counts.php @@ -217,6 +217,23 @@ protected function get_cache_expiration() { return $this->range->generate_cache_duration( parent::get_cache_expiration() ); } + /** + * Simple method to check against URL field + * + * @param int $wordcamp_id ID for the wordcamp post type. + * + * @return bool + */ + public function is_a_wordcamp_url( $wordcamp_id ) { + $url = get_post_meta( $wordcamp_id, 'URL', true ); + + // doaction sites are tracked but break the validate wordcamp site check. + if ( false !== strpos( $url, 'doaction' ) ) { + return false; + } + return true; + } + /** * Query and parse the data for the report. * @@ -246,6 +263,9 @@ public function get_data() { foreach ( $wordcamp_ids as $wordcamp_id ) { try { + if ( ! $this->is_a_wordcamp_url( $wordcamp_id ) ) { + continue; + } $valid = validate_wordcamp_id( $wordcamp_id ); $data = array_merge( $data, $this->get_data_for_site( $valid->site_id, $valid->post_id ) );