Skip to content

Commit

Permalink
Update includes/classes/Elasticsearch.php
Browse files Browse the repository at this point in the history
Co-authored-by: Felipe Elia <[email protected]>
  • Loading branch information
rebeccahum and felipeelia authored Nov 26, 2024
1 parent 6f94523 commit ca5ddbd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions includes/classes/Elasticsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,9 @@ public function add_elasticpress_version_to_user_agent( $user_agent ) {
* @param array $query Query to log.
*/
protected function add_query_log( $query ) {
$wp_debug = defined( 'WP_DEBUG' ) && WP_DEBUG;

Check warning on line 1738 in includes/classes/Elasticsearch.php

View workflow job for this annotation

GitHub Actions / PHP Lint

Equals sign not aligned with surrounding assignments; expected 4 spaces but found 6 spaces
$wp_ep_debug = defined( 'WP_EP_DEBUG' ) && WP_EP_DEBUG );

Check failure on line 1739 in includes/classes/Elasticsearch.php

View workflow job for this annotation

GitHub Actions / PHP Lint

PHP syntax error: Unclosed '{' on line 1737 does not match ')'

Check failure on line 1740 in includes/classes/Elasticsearch.php

View workflow job for this annotation

GitHub Actions / PHP Lint

Whitespace found at end of line
/**
* Filter query logging. Don't log anything to the queries property when true.
*
Expand All @@ -1743,8 +1746,9 @@ protected function add_query_log( $query ) {
* @return {bool} New value
* @since 5.2.0
*/
if ( apply_filters( 'ep_disable_query_logging', false ) && ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ||
( defined( 'WP_EP_DEBUG' ) && WP_EP_DEBUG ) ) ) {
$disable_query_logging = apply_filters( 'ep_disable_query_logging', false )

if ( ! $disable_query_logging && ( $wp_debug || $wp_ep_debug ) ) {
$this->queries[] = $query;
}

Expand Down

0 comments on commit ca5ddbd

Please sign in to comment.