Opened 4 years ago
Last modified 5 months ago
#55376 new enhancement
Use wp_filesize in core
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | good-first-bug has-patch needs-refresh changes-requested |
| Focuses: | Cc: |
Attachments (1)
Change History (18)
This ticket was mentioned in PR #2402 on WordPress/wordpress-develop by Chargnn.
4 years ago
#2
- Keywords has-patch added; needs-patch removed
Replaced usage of filesize functions to wp_filesize in wp-admin/theme-editor.php
Trac ticket: https://core.trac.wordpress.org/ticket/55376
spacedmonkey commented on PR #2402:
4 years ago
#5
Thanks @Chargnn for the patch. I have added some links other places where this function can be used.
#6
in reply to:
↑ 5
@
4 years ago
Replying to spacedmonkey:
comment
1067905355
}}}
spacedmonkey commented on PR #2402:
I would consider using this function in the following places.
Thank you! Looking into this right now.
#8
in reply to:
↑ 4
@
4 years ago
Replying to spacedmonkey:
I would suggest not to use wp_filesize() in WP_Filesystem_* classes or other mission-critical parts like the update_core() function, due to backward compatibiltity concerns. See the discussion in comment:2:ticket:55688.
Using wp_filesize() in other instances seems fine at a glance.
#9
@
3 years ago
Thanks, @spacedmonkey for your advice, I followed your instruction and changed the filesize() function in the rest of the files.
#10
@
3 years ago
- Keywords needs-patch needs-refresh added; has-patch removed
@nihar007 This patch needs a refresh.
This ticket was mentioned in PR #4361 on WordPress/wordpress-develop by @spacedmonkey.
3 years ago
#11
- Keywords has-patch added; needs-patch needs-refresh removed
Trac ticket: https://core.trac.wordpress.org/ticket/55376
@spacedmonkey commented on PR #4361:
2 years ago
#12
Fixed
This ticket was mentioned in PR #7818 on WordPress/wordpress-develop by @ankitkumarshah.
12 months ago
#13
Trac ticket: https://core.trac.wordpress.org/ticket/55376
This PR replaces the use of filesize() with wp_filesize() in file.php and class-snoopy.php. The wp_filesize() function provides better handling for file size operations. This ensures improved compatibility and consistency with WordPress core standards.
#14
@
5 months ago
- Keywords needs-refresh changes-requested added
I reviewed @ankitkumarshah's PR on GitHub. To summarize here:
- The PR does not address all occurrences of
filesize()(minus the file system/update related ones noted by @SergeyBiryukov above). - Changes an instance within the
class-snoopy.phpfile, which has been deprecated since WP3.0. There's on benefit to updating this file.
@ankitkumarshah commented on PR #7818:
5 months ago
#15
Thank you for the feedback, @desrosj! I’ll make the suggested updates and refresh the PR shortly. 🙌
@ankitkumarshah commented on PR #7818:
5 months ago
#16
Hi @desrosj,
Thank you for the feedback! I’ve made the changes noted by @spacedmonkey in his comment on the Trac ticket. The following files were updated:
src/wp-admin/includes/file.phpsrc/wp-admin/includes/ms.phpsrc/wp-admin/includes/plugin.phpsrc/wp-includes/class-wp-customize-manager.phpsrc/wp-includes/ms-files.phpsrc/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.phpsrc/wp-includes/rest-api/endpoints/class-wp-rest-edit-site-export-controller.php
Please review the PR at your convenience. Thank You 🙌
CC @flixos90