feat: add diagnostic logging and troubleshooting tools#95
Closed
tijmenbruggeman wants to merge 5 commits intotinify:masterfrom
Closed
feat: add diagnostic logging and troubleshooting tools#95tijmenbruggeman wants to merge 5 commits intotinify:masterfrom
tijmenbruggeman wants to merge 5 commits intotinify:masterfrom
Conversation
* chore: add settings view - use include pattern instead of rendering in class * chore: add logger singleton * chore: add diagnostics class - download zip file including logs and information about setup * chore: download zip file from settings page * chore: add loader and improve markup - added utility classes * Add various log points * Set timeout and proxy options on curl client * Scaffold tests * formatting * Add initial tests * On constructor log enabled test * Manual formatting logger * Manual formatting fixes in diagnostics * chore: add tests for log path * chore: simplify rotation * Format * change file name, format and size * Clear logs when turned on * Add more tests * Add mocks for test * set timeout to 300 * Seperate API timeout and connect timeout * remove server info and add a phpinfo file * test: add nonce verification test for download_diagnostics Add comprehensive test for nonce verification in the download_diagnostics AJAX endpoint. The test verifies that check_ajax_referer is called with the correct parameters and that wp_die is invoked when nonce verification fails. Also: - Add check_ajax_referer and wp_die mock implementations to WordPress test helpers - Add wp_json_encode mock for test compatibility - Rename test file to match class name convention (Tiny_Diagnostics_Test.php) * Replace phpinfo with server info block * Use temp path and remove cleanup * Check permissions * Use WP_Filesystem instead of low level php file handlers * formatting * Fix indentation * Fix test locale * Fix docs in mocks * Add docs for connection timeout * Add docs for reason api timeout * Add docs * Remove headers from log to prevent senstive data being logged in fopen client * format * move access to admin * update test for manage options * make clear_logs static * Use error_log for logging to file * format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds diagnostic logging functionality and troubleshooting tools to help debug issues in production environments.
Changes
Tiny_Loggersingleton class for centralized loggingTiny_Diagnosticsclass to collect system informationKey Features
wp-content/uploads/tiny-compress-logs/