Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Improve debug logging condition #58

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

ipokkel
Copy link
Member

@ipokkel ipokkel commented Jul 4, 2024

Check if WP_DEBUG is defined and true instead of checking WP_DEBUG_LOG.

All Submissions:

Changes proposed in this Pull Request:

Check if WP_DEBUG is defined and true instead of checking WP_DEBUG_LOG as this may sometimes return true if a file location was set as this constant's value instead of a boolean which may lead to error logging in the PHP Log file even if WP_DEBUGis set tofalse`

How to test the changes in this Pull Request:

  1. Enable error logging in the server's php.ini configuration.
  2. Set WP_DEBUG to false and set a file location for WP_DEBUG_LOG, e.g. define( 'WP_DEBUG_LOG', '/var/www/my-wp-debug-log.log' );.
  3. Navigate to the Membership Card page as a logged-in member.
  4. Confirm that no log entries were made in the custom WordPress debug log file or the server's PHP error log file.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you successfully run tests with your changes locally?

Changelog entry

Enhancement: Improve debug logging condition

Check if WP_DEBUG is defined and true instead of checking WP_DEBUG_LOG.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants