Make WordPress Core

Opened 12 months ago

Closed 10 months ago

Last modified 10 months ago

#58737 closed defect (bug) (fixed)

Site Health Info doesnt show correct value for file_uploads in debug/clipboard text

Reported by: michi91's profile Michi91 Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.4 Priority: normal
Severity: normal Version: 6.3
Component: Site Health Keywords: has-patch
Focuses: Cc:

Description

With #50038 checks for file_uploads were added in Site Health.

https://github.com/WordPress/WordPress/blob/29791cad8c5ee936f5a3bd1e9d86c040fef2f576/wp-admin/includes/class-wp-debug-data.php#L557

// Add info in Media section.
                        $info['wp-media']['fields']['file_uploads']        = array(
                                'label' => __( 'File uploads' ),
                                'value' => empty( ini_get( 'file_uploads' ) ) ? __( 'Disabled' ) : __( 'Enabled' ),
                                'debug' => 'File uploads is turned off',
                        );

As you can see, the value for the Site Health report is set, but the value for 'debug' / clipboard text is always 'File uploads is turned off'.

### wp-media ###
...
file_uploads: File uploads is turned off
...

From my perspective the value for 'debug' should be set to "on", "off" or "true", "false" or even a text, to display the correct value to the report that is copied to the clipboard.

### wp-media ###
...
file_uploads: false
...

or

### wp-media ###
...
file_uploads: true
...

This is my first ticket here.

I didnt provide a patch yet, as I m not sure what values should be set for 'debug'. I personally would prefere "true" and "false", but as right now the value is a text, I m not sure about the correct way.

Change History (6)

#1 @Presskopp
10 months ago

Hi @Michi91,

Nice find! I think you're good to go with just:

'value' => empty( ini_get( 'file_uploads' ) ) ? __( 'Disabled' ) : __( 'Enabled' ),
'debug' => empty( ini_get( 'file_uploads' ) ) ? 'Disabled' : 'Enabled',

I'd like to see you upload your patch. Let's get this into core!

Last edited 10 months ago by Presskopp (previous) (diff)

This ticket was mentioned in PR #5129 on WordPress/wordpress-develop by MichaelSalp.


10 months ago
#2

  • Keywords has-patch added; needs-patch removed

#3 @Michi91
10 months ago

Created a Pull Request with the Patch :-)

#4 @SergeyBiryukov
10 months ago

  • Milestone changed from Awaiting Review to 6.4

#5 @SergeyBiryukov
10 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 56509:

Site Health: Show correct debug value for file uploads.

Follow-up to [48535].

Props Michi91, Presskopp.
Fixes #58737.

@SergeyBiryukov commented on PR #5129:


10 months ago
#6

Thanks for the PR! Merged in r56509.

Note: See TracTickets for help on using tickets.