Make WordPress Core

Opened 21 months ago

Closed 18 months ago

Last modified 15 months ago

#62633 closed defect (bug) (fixed)

Is writable check for fonts folder is misleading/wrong

Reported by: zodiac1978 Owned by: audrasjb
Priority: normal Milestone: 6.8
Component: Site Health Version: 6.5
Severity: normal Keywords: has-patch has-screenshots has-test-info commit
Cc: Focuses:

Description

If no font library is used, the check for folders permissions in Site Health is returning “not writable” for the fonts directory because it does not exist.

I think this is misleading. Maybe it could be created and would be writable then, but it is just not there at the moment.

Attachments (1)

Bildschirmfoto 2024-11-26 um 15.07.35.png (226.3 KB ) - added by zodiac1978 21 months ago.
Site Health check showing the fonts directory as not writable (although there are no permission issues)

Download all attachments as: .zip

Change History (18)

@zodiac1978
21 months ago

Site Health check showing the fonts directory as not writable (although there are no permission issues)

#1 @samiamnot
21 months ago

Introduced with #60719 (version 6.6 would be correct, but does not seem available as an option). #61638 is somewhat related.

#2 @sainathpoojary
21 months ago

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.26
  • Server: nginx/1.27.3
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.26)
  • Browser: Chrome 131.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0
  • MU Plugins: None activated
  • Plugins: Test Reports 1.2.0

Actual Results

✅ Error condition occurs.

Supplemental Artifacts

https://utfs.io/f/PL8E4NiPUWyOKJRJs2YmLeRwrnj39TqHcCJ7Kk0pPsmyaZFi

This ticket was mentioned in PR #7933 on WordPress/wordpress-develop by @sainathpoojary.


21 months ago
#3

  • Keywords has-patch added; needs-patch removed

This PR enhances the filesystem checks in the Site Health debug data by addressing the following:

#### 1. Existence Check

  • Before checking if the fonts directory is writable, it first verifies whether the directory exists.

#### 2. Improved Messaging

  • If the fonts directory does not exist, the debug output now reflects this scenario as "Does not exist".
  • If the directory exists, it shows whether it is writable or not.

### Changes Made

  • Updated the get_wp_filesystem() method in class-wp-debug-data.php.
  • Added a directory existence check (file_exists) for the fonts directory (wp_get_font_dir()['basedir']).
  • Adjusted the debug data output to handle cases where the fonts directory does not exist.

### Before fix:
Without Font directory

https://github.com/user-attachments/assets/44a3dae9-b07c-4c7e-9b78-15432d0a917b

### After fix:

Without Font directory

https://github.com/user-attachments/assets/9943a774-c931-45ba-85df-aba06caa10ba

With Font directory

https://github.com/user-attachments/assets/0127b587-96a7-4969-aafe-6a7dee99214e

Trac ticket: #62633

#4 @abcd95
21 months ago

Test Report

Description

This report validates the indicated patch works as expected.

Environment

  • WordPress: 6.7.1
  • PHP: 8.1.29
  • Server: nginx/1.16.0
  • Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.29)
  • Browser: Chrome 131.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0

Actual Results

✅ Issue resolved with patch.

Supplemental Artifacts

Screenshots

Before: https://postimg.cc/cKsy44VW

After: https://postimg.cc/GBY8rzwV

#5 @ankitkumarshah
21 months ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Environment

  • WordPress: 6.7.1
  • PHP: 8.1.29
  • Server: nginx/1.16.0
  • Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.29)
  • Browser: Chrome 131.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0
  • MU Plugins: None activated

Actual Results

  1. ✅ Issue resolved with patch.

Supplemental Artifacts

Before Patch

https://i.postimg.cc/ZJ5Jk41w/image.png

After patch

https://i.postimg.cc/Bv1GVZ7N/image.png

Last edited 21 months ago by ankitkumarshah (previous) (diff)

#6 @im3dabasia1
21 months ago

  • Keywords has-screenshots added

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.25
  • Server: nginx/1.27.2
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.25)
  • Browser: Chrome 129.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Error condition occurs (reproduced).

Additional Notes

  • Any additional details worth mentioning.

Supplemental Artifacts

https://i.postimg.cc/13HHC6DD/Screenshot-2024-12-03-at-4-49-36-PM.png

Last edited 21 months ago by im3dabasia1 (previous) (diff)

#7 @im3dabasia1
21 months ago

  • Keywords has-testing-info added

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/7933.diff

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.25
  • Server: nginx/1.27.2
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.25)
  • Browser: Chrome 129.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.0
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Supplemental Artifacts

https://i.postimg.cc/cJLcVHc2/Screenshot-2024-12-03-at-4-51-57-PM.png

#8 @zodiac1978
18 months ago

Hey @sainathpoojary, thanks for the PR!

Just one thing: $is_fonts_dir_exist sounds a little bit wrong for me. I am not a native speaker, but $is_writable_fonts_dir sounds like an English sentence and $is_fonts_dir_exist does not.

Maybe just $fonts_dir_exists following the common naming convention?

@SergeyBiryukov There was one check failing, but I don't think this is in relation to the patch. Is this a known issue?
https://github.com/WordPress/wordpress-develop/pull/7933/commits/7f297db89e32fe5e12cca88468c1d549d5855722

#9 @sainathpoojary
18 months ago

Thanks for the feedback, @zodiac1978! I’ve updated the variable name to $fonts_dir_exists, Also all the checks are now passing. Please take a look whenever you have a moment.

#10 @zodiac1978
18 months ago

@sainathpoojary It looks like you have changed the wrong line.
$is_fonts_dir_exist should be $fonts_dir_exists

#11 @sainathpoojary
18 months ago

Thanks for catching that @zodiac1978! I’ve now corrected the variable rename to $fonts_dir_exists. Let me know if there’s anything else that needs adjusting.

This ticket was mentioned in Slack in #core by zodiac1978. View the logs.


18 months ago

#13 @audrasjb
18 months ago

  • Milestone Awaiting Review6.8
  • Owner set to audrasjb
  • Status newaccepted

#14 @audrasjb
18 months ago

  • Keywords commit added

I tested the PR it it looks great to me.

#15 @audrasjb
18 months ago

  • Resolutionfixed
  • Status acceptedclosed

In 59853:

Site Health: Improve fonts directory check.

This changeset enhances the filesystem checks in the Site Health debug data by addressing the following:

  • Existence Check: Before checking if the fonts directory is writable, it first verifies whether the directory exists.
  • Improved Messaging: If the fonts directory does not exist, the debug output now reflects this scenario as "Does not exist". If the directory exists, it shows whether it is writable or not.

Props zodiac1978, samiamnot, sainathpoojary, abcd95, ankitkumarshah, im3dabasia1.
Fixes #62633.

#17 @wordpressdotorg
15 months ago

  • Keywords has-test-info added; has-testing-info removed
Note: See TracTickets for help on using tickets.