Commit Graph

95 Commits

Author SHA1 Message Date
Peter Westwood 4448235a16
Coding Standards: Add missing space. 2019-05-24 18:15:24 -06:00
Peter Westwood f70dcc6a01 Add filters to file paths passed to the different xsendfile like backends.
Different server configurations can require different paths to be sent and it isn't always possible for a plugin to know the correct path for a platform.
These filters will allow a hosting provider to install a platform level configuration via an `mu-plugin` to make sure things work in there configuration.
2019-05-24 17:10:17 -06:00
claudiulodro afd24dea4b Add http(s) to // download urls 2018-10-11 13:31:18 -07:00
claudiulodro 989230f2b9 Refactor for increased safety 2018-10-11 13:31:18 -07:00
claudiulodro 88d506bac0 Dont do abspath file_exists check on urls that start with // since those are remote urls and not local urls 2018-10-11 13:31:18 -07:00
Mike Jolley b7099509ee If the file size cannot be read, ignore range headers.
Fixes #20204
2018-05-24 16:10:45 +01:00
Peter Fabian e31420234a Skip download remainig check if doing ranged request.
This allows to finish listening/waching the file on iOS device if the remaining download count goes from 1 to 0.
2018-05-09 16:34:58 +02:00
Peter Fabian e5dfa71e23 Moved check for download log to WC_Download_Handler. 2018-05-09 15:52:02 +02:00
Peter Fabian b920fb5786 Fixed bugs introduced by refactoring. 2018-05-09 14:29:52 +02:00
Peter Fabian 10fdae02bb Updated documentation according to WP CS. 2018-05-09 11:40:02 +02:00
Peter Fabian 3faf49b4aa Sanitize HTTP_RANGE input. 2018-05-09 11:13:36 +02:00
Peter Fabian ba79747975 Backwards compat fixes for range download. 2018-05-08 11:47:05 +02:00
Peter Fabian cb7ebe9aae Split handle_range_request function, code cleanup. 2018-05-07 23:56:12 +02:00
Peter Fabian ceb713adbc Basic range download handling for Force download. 2018-05-07 10:05:02 +02:00
Claudio Sanches 88d0b502d9 Fixed includes/class-wc-download-handler.php PHPCS violations 2018-03-22 14:12:36 -03:00
Mike Jolley b727f4ce64 Hash may not exist 2018-03-07 15:13:40 +00:00
Alex MacArthur bc41fb0ba9 Use wc_get_order(), handle failure in case WC_Order not returned. 2018-02-21 15:39:43 -06:00
Alex MacArthur 931bf27511 Fix spacing, use hash_equals to verify uid. 2018-02-21 07:45:07 -06:00
Alex MacArthur 3e0e75ebc3 Fix spacing issues. 2018-02-21 07:34:56 -06:00
Alex MacArthur 00e71b304d Hash customer email address in download URLs. 2018-02-21 07:34:56 -06:00
Mike Jolley 3459f83a9d When serving downloads, ensure order/key are set and valid. Fixes #18328 2018-01-03 10:55:57 +00:00
The Dramatist 31155ed531 Woocommerce download readfile chunk number hook proposal (#17699)
* A hook proposal to modify the chunk number.

`woocommerce_download_readfile_chunk_number` hook is proposed to make modifying the chunk number easily.

* Constant IMO declared for changeable chunk size. 

New constant `WC_CHUNK_SIZE` declared to make `WC_Download_Handler` class's `readfile_chunked` method's chunk size changeable.
2017-11-15 16:32:28 +00:00
Mike Jolley 3e7968d37b Merge branch 'master' into pr/16418 2017-11-13 14:37:18 +00:00
Mike Jolley 220728544a
Merge pull request #17631 from woocommerce/update/page-caching-class
Page caching class
2017-11-10 14:12:13 +00:00
Claudio Sanches 22232f29c7 Fixed PHPCompatibility issues
Closes #17625
2017-11-09 16:36:29 -02:00
Mike Jolley 9f059e17a9 Add helper function instead of calling method, and restore old method for bw compat 2017-11-08 15:07:00 +00:00
Gerhard Potgieter 7b9fb6c0cb Change nocache_headers hook firing (#17540)
* wp hook is too late to fire the nocache_headers filter, some caching plugins read it before that it seems.

* Create do_not_cache_page helper function and call that instead of nocache_headers

* Must add checks to prevent caching on certain pages as well

* Nothing to return
2017-11-08 14:27:30 +00:00
Josh Smith 5e4269267f [#12517] Change spacing and add full stop to comment to match WordPress style guide. 2017-08-23 03:15:23 +00:00
Josh Smith 3953fd081c [#12517] Get data for get_download_count from download log table 2017-07-31 03:44:11 +00:00
Josh Smith 399269a4f1 [#12517] Implement logging product downloads into new logging table 2017-07-30 22:38:17 +00:00
Mike Jolley fd12c344f8 Ensure we have a http URL for file path replacements
Closes #16179
2017-07-21 11:11:17 +01:00
Rasmus Bengtsson 185934fad9 Fix phpdoc to include params and correct types 2017-05-15 13:50:52 +02:00
Mike Jolley 7fd2f4f554 Support (not really) relative paths
Fixes #13750
2017-03-24 11:48:32 +00:00
Mike Jolley d55653a408 Merge branch 'master' into fix-13498
# Conflicts:
#	includes/class-wc-order.php
#	tests/unit-tests/crud/data.php
2017-03-15 15:52:40 +00:00
Claudio Sanches 591327287a Do not set remaining downloads when is unlimited 2017-03-13 21:24:59 -03:00
Claudio Sanches c4134586cd FUpdate how save download dates 2017-03-13 20:54:33 -03:00
Rami Yushuvaev d2457fe922 i18n: escape translation strings and fix wrong usage of i18n functions 2017-03-13 07:39:46 +02:00
Mike Jolley 7aeb151bb6 Fix download count 2017-02-20 13:36:15 +00:00
Mike Jolley 2e1e7c0f93 Fix downloads remaining
Issues around ‘’ set (unlimited downloads) Fixes #12692
2017-01-03 15:03:55 +00:00
Mike Jolley b1565cf0d6 Download update routine and interface 2016-11-18 19:29:37 +00:00
Mike Jolley 1b6d7acd24 Data store for downloads 2016-11-18 17:13:02 +00:00
Aristeides Stathopoulos b063bcfe4c last item in a multiline-array should end in a comma 2016-08-27 04:46:45 +03:00
Claudio Sanches 7d9d091767 Fixed mixed tabs and spaces 2016-07-11 16:56:35 +02:00
Mike Jolley a40fb29eca wc_set_time_limit helper function 2016-06-06 16:55:27 +01:00
Caleb Burks 14edd5c1f8 Return to shop if download fails 2016-05-17 16:54:01 -05:00
Mike Jolley 44b0059a06 Order by downloads remaining when getting permission so orders with same products over multiple lines links work 2016-05-05 09:28:36 +01:00
Claudio Sanches ee30b5b308 Fixed php docs standards 2015-11-03 11:31:20 -02:00
Mike Jolley dc37e49c02 Suppress set_time_limit errors to prevent issues in some environments
“Warning: Cannot set max_execution_time above master value of 30 (tried
to set unlimited) in
/var/www/web1043/html/wordpress/wp-content/plugins/woocommerce/includes/
class-wc-download-handler.php on line 337</p>”
2015-08-18 13:16:25 +01:00
Mike Jolley b425b9bce6 Avoid extract to keep original $file_path intact
Closes #8636
2015-07-27 12:44:29 +01:00
Claudio Sanches e1858d299b Changed WC_Download_Handler::count_download() from private to public, closes #8623 2015-07-21 19:03:40 -03:00