Commit Graph

71 Commits

Author SHA1 Message Date
Rodrigo Primo 487f96d844 Fix WordPress.DateTime.CurrentTimeTimestamp vilations
This commit fixes all violations of the WordPress.DateTime.CurrentTimeTimestamp sniff automatically using phpcbf.
2019-12-20 14:23:05 -03:00
Gregory Karpinsky a7bee0325d
WC_Log_Handler_File::remove - fix for MS Windows
WC_LOG_DIR is defined with Unix slashes at the end. The `realpath` has Windows slashes and therefore `stripos` never works.

Consider also fixing slashes here:
`$this->define( 'WC_LOG_DIR', $upload_dir['basedir'] . '/wc-logs/' );`
2019-01-31 21:23:22 -05:00
Rodrigo Primo 2c8d006c37 Update PHPCompatibility sniff names
The name of some sniffs changed in the most recent PHPCompatiblity version. This commit update all instances where those names are used in WooCommerce codebase.
2018-11-21 11:08:26 -02:00
Manos Psychogyiopoulos 60b84c09aa Parse query using '$wpdb->prepare' before querying 2018-11-16 16:11:31 +02:00
Claudiu Lodromanean e0d31107ea
Merge pull request #21523 from woocommerce/fix/21509
Fix DB log handler cleanup
2018-10-12 08:22:22 -07:00
claudiulodro d5ac2e4dee Backwards compatibility handling 2018-10-11 13:31:34 -07:00
Claudio Sanches 09ed5fd152 Fixed coding standards 2018-10-11 13:31:34 -07:00
claudiulodro bd7d73a788 Extra checking to make sure log file is in log file directory 2018-10-11 13:31:34 -07:00
claudiulodro 87b81c94ae Better way of doing it 2018-10-11 13:31:34 -07:00
claudiulodro 3bbf05d025 Prevent deleting things outside the log dir 2018-10-11 13:31:34 -07:00
claudiulodro 7e17be74d9 Fix db log handler cleanup 2018-10-10 12:14:25 -07:00
Gerhard Potgieter 1fdcf2a238 Fix log file deletion functionality. 2018-07-09 13:01:23 +02:00
Mike Jolley e9b0c6deec clear_expired_logs and date based clearing functions 2018-05-01 16:37:30 +01:00
Mike Jolley aef46ce8d3 Clear paypal logs when debug mode is turned off. 2018-04-30 18:04:52 +01:00
Rodrigo Primo 3a76769859 PHPCS fixes in includes/log-handlers/class-wc-log-handler-file.php 2018-03-07 10:49:45 -03:00
Rodrigo Primo 3d93e5d545 PHPCS fixes in includes/log-handlers/class-wc-log-handler-email.php 2018-03-07 10:49:32 -03:00
Rodrigo Primo 2d4afdc1d8 PHPCS fixes in includes/log-handlers/class-wc-log-handler-db.php 2018-03-07 10:49:17 -03:00
Rodrigo Primo ea93fca4ff Fix PHPCS violations in includes/log-handlers/ using phpcbf 2018-03-07 10:30:00 -03:00
Gerhard Potgieter fdc89056cd PHPCS fix 2017-11-17 14:47:51 +02:00
Gerhard Potgieter b11ab6d8d6 Convert comments to wc_logger logging, remove and deprecate unused functions and introduce a wc_get_log_file_name helper function. Still a couple of todos left regarding deprecating or removing filters related to comments. 2017-11-10 12:20:59 +02:00
Jaydeep Rami 3522857d23 Fix typo in WooCommerce plugin (#16135)
* Fixed typo

* Fixed more typo

* Fixed more typo

* Fix tyop

* Fix more typo

* Fix more typo

* Fix typo

* Fix typo

* Fix typo

* Fix typo datatime object

* Fix short name of compat

* Fix typo: update short name

* Fix typo "deactive" to "deactivate" and short BW - Compat

* Fix typo "Backwards compat"

* Fix typo 'parameters'

* Fix more typo 'pararmeters'

* Fix typo 'compund'

* FIx typo order

* Fix typo

* Fix typo 'incorrecly'

* Fix typo 'genarate'

* Fix typo 'reletive'

* Fix typo 'Handly'

* Fix typo 'rotatated'

* Fix typo

* Fix typo 'additonal'

* Fix typos
2017-07-17 11:10:52 +01:00
Rasmus Bengtsson 185934fad9 Fix phpdoc to include params and correct types 2017-05-15 13:50:52 +02:00
Claudio Sanches 1142ca20f0 Properly open log files 2017-04-20 13:37:18 -03:00
Claudio Sanches dfcbeaf044 Fixed logic in `is_open()` 2017-04-20 12:57:33 -03:00
Claudio Sanches 7f6b0c6d0f Moved resource check for `is_open()` method 2017-04-20 12:53:44 -03:00
Claudio Sanches aa21db2e64 Check if is a resource before try set log rotate
Fixes #14544
2017-04-20 00:54:31 -03:00
Akeda Bagus 0b416439c8
Fixed all typos of all files in includes/ directory.
Scanning and fixing were done automatically by codespell,
https://github.com/lucasdemarchi/codespell.
2017-03-29 00:58:51 +07:00
Claudio Sanches 59c2849736 Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00
Mike Jolley 962b60c8fe kses/sanitize 2017-02-09 15:43:47 +00:00
Jon Surrell a2dea96430 Add message when get_log_file_path called too early 2017-01-12 22:02:31 +01:00
Jon Surrell acd338fb87 Add default source to WC_Log_Handler_DB 2017-01-08 21:42:56 +01:00
Jon Surrell a33fac966d Use plural in multiple log email 2016-12-29 11:58:43 +01:00
Jon Surrell fbd91fe376 Improve email handler subject 2016-12-29 11:58:43 +01:00
Jon Surrell e4d5886427 Replace log `tag` with log `source` 2016-12-29 11:58:43 +01:00
Jon Surrell 088fc5cd68 Delay file log write when written too early
The function to look up log file paths depends on `wp_hash`, which is pluggable.
Log files cannot be found before `plugins_loaded` action. In case a log is
written to a file before `wp_hash` is available, cache and write on
`plugins_loaded` action.
2016-12-29 11:58:43 +01:00
Jon Surrell 5700043e6d Deprecate wc_get_log_file_path
wc_get_log_file_path moves into `WC_Log_Handler_File` class as a static
method.
Update deprecations and version info.
2016-12-29 11:58:43 +01:00
Jon Surrell feefabbdf0 Document _legacy context in WC_Log_Handler_File 2016-12-29 11:58:43 +01:00
Jon Surrell 2ae1bc1ab2 Protect methods 2016-12-29 11:58:43 +01:00
Jon Surrell fe837c5113 Aggregate email handler messages (max: 1 email/request/handler)
Update emails accordingly.
Update email handler tests.
2016-12-29 11:58:43 +01:00
Jon Surrell acc98a1d6a Mark WC_Log_Handler::format_entry abstract 2016-12-29 11:58:43 +01:00
Jon Surrell 5f24eca7e2 Add delete to db log viewer table
Clean up some nonce logic.
Use a single <form> containing log table.
2016-12-29 11:58:43 +01:00
Jonathan Surrell 4318b3aa53 Improve @return signature on WC_Log_Handler::handle
Make meaning of returned bool explicit.
Update WC_Log_Handler_Email::handle accordingly.

via https://github.com/woocommerce/woocommerce/pull/12575#pullrequestreview-12381573
2016-12-29 11:58:43 +01:00
Jon Surrell 080cf8e436 Store log levels as integer representations in database
This will allow indexed ordering by severity.
Add WC_Log_Levels::get_severity_level method to translate severity
integers to level strings. The inverse of WC_Log_Levels::get_level_severity.
Add context to tests.
2016-12-29 11:58:43 +01:00
Jon Surrell 78e6cb31a7 Include WC_Log_Handler with other abstracts 2016-12-29 11:58:43 +01:00
Jon Surrell 825d9c9f82 Fix spelling 2016-12-29 11:58:43 +01:00
Jon Surrell ffd0d380ee Remove threshold logic from handlers.
Email handler implements threshold logic internally. Other handlers handle all logs received.
Handler constructors have changed.
2016-12-29 11:58:43 +01:00
Jon Surrell 85fa9df7fe Drop "bubbling" support for logs
The concept of bubbling or consuming logs has little benefit for our use case.
Drop support for bubbling and simplify logging.
2016-12-29 11:58:43 +01:00
Jon Surrell 9d80017308 Mark db handler add method as static 2016-12-29 11:58:42 +01:00
Jon Surrell c945d727d5 Add log flushing to db log viewer 2016-12-29 11:58:42 +01:00
Jon Surrell f761183363 Update @package for log handlers 2016-12-29 11:58:42 +01:00