Make WordPress Core

Opened 2 years ago

Closed 4 weeks ago

#60750 closed defect (bug) (fixed)

Warning: these pages should not be the same as your Privacy Policy page!

Reported by: octotoot's profile OctoTooT Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 7.0 Priority: normal
Severity: normal Version: 5.3
Component: Administration Keywords: has-patch has-screenshots commit
Focuses: Cc:

Description

On Settings > Reading this message appears. The Privacy Page is NOT SELECTED. The homepage is another page and that is what is selected. There is nothing else in there.

Attachments (1)

60750.diff (768 bytes) - added by safedawn 5 weeks ago.
Fix false positive in privacy policy admin notice condition

Download all attachments as: .zip

Change History (10)

#1 @rollybueno
8 months ago

I think this might be more of a setup/configuration issue rather than a core bug. The warning seems to trigger when the same page is used (or maybe just recognized internally) as both the homepage and the privacy policy, even if the Privacy Policy page isn’t explicitly selected in Settings → Privacy.

Could you share a screenshot of your Reading and Privacy settings? That might help confirm if it's just a misconfiguration or something deeper going on.

#2 @rollybueno
8 months ago

  • Keywords needs-screenshots reporter-feedback added

#3 @sabernhardt
3 months ago

Is this the same issue reported on #64192?

@safedawn
5 weeks ago

Fix false positive in privacy policy admin notice condition

#4 @safedawn
5 weeks ago

  • Keywords has-patch needs-testing added

Hello everyone! According to changeset:45766, which introduced this admin notice, the intent was to display it only when a Privacy Policy page is accidentally set as the Homepage or the Posts page.

However, when the Homepage, Posts page, or Privacy Policy page is not set, their corresponding options in the database are stored as 0 instead of a page ID. This leads to false positives in the following scenarios:

  • No Privacy Policy page is selected (wp_page_for_privacy_policy is 0), and Your homepage displays is set to Your latest posts (page_on_front and page_for_posts are both 0).
  • No Privacy Policy page is selected, Your homepage displays is set to A static page (select below), and one or both of the Homepage and Posts page options are not selected.

The attached patch adjusts the conditional logic to account for unset options and prevents the admin notice from being displayed in these cases.

Last edited 5 weeks ago by safedawn (previous) (diff)

#5 @sabernhardt
5 weeks ago

#64192 was marked as a duplicate.

#6 @sabernhardt
5 weeks ago

  • Component changed from General to Administration
  • Keywords has-screenshots added; needs-screenshots reporter-feedback removed
  • Milestone changed from Awaiting Review to 7.0
  • Version changed from 6.4.3 to 5.3

@dd32 shared a screenshot of this warning message on #64192

Warning on Reading Settings screen when Homepage is set but not Posts page

The above warning is needlessly shown on Settings -> Reading when a site has no privacy policy page defined, and either no front-page or posts-page defined.

This is common with newly setup sites, and leads to use confusion.

#7 @SirLouen
5 weeks ago

  • Keywords needs-testing removed

Combined Bug Reproduction and Patch Testing Report

Patch tested: https://core.trac.wordpress.org/attachment/ticket/60750/60750.diff

Steps to Reproduce or Test

  1. Go into Settings > Privacy
  2. Deselect the Privacy Policy Page and "Use this page"
  3. Go to Settings > Reading
  4. 🐞 The warning Warning: these pages should not be the same as your Privacy Policy page! appears

Expected Results

  • This warning must only appear when a Privacy policy page is set as a Homepage

Environment

  • WordPress: 7.0-alpha-61215-src
  • PHP: 8.2.29
  • Server: nginx/1.29.4
  • Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 143.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Actual Results

When reproducing a bug/defect:

  • ❌ Error condition occurs.

When testing the bugfix patch:

  • ✅ Issue resolved with patch.

#8 @sabernhardt
4 weeks ago

  • Keywords commit added

Test Report

Description

With the patch, the warning does not appear when the site has no Privacy page. It also continues to warn when the site has a Privacy page and the Home and/or Posts page is set to the Privacy page.

Patch tested: https://core.trac.wordpress.org/attachment/ticket/60750/60750.diff

Environment

  • WordPress: 7.0-alpha-61215-src (as of r61492)
  • PHP: 8.4.0
  • Server: Apache/2.4.62 (Win64) PHP/8.4.0 mod_fcgid/2.3.10-dev
  • Database: mysqli (Server: 9.1.0 / Client: mysqlnd 8.4.0)
  • Browser: Firefox 147.0
  • OS: Windows 11
  • Theme: Twenty Seventeen 4.0

Actual Results

I deselected the Privacy page, as described in comment:7, and chose each option in Reading Settings. Three of the four choices gave a warning before the patch, and none of them displayed the warning with the patch.

Setting Before With patch
Latest posts 🐞
Warning

No warning
Static Homepage set to “Home” 🐞
Warning

No warning
Static Posts page set to “Blog” 🐞
Warning

No warning
Static Homepage set to “Home” and Posts page set to “Blog”
No warning

No warning

After I set "Privacy Policy" as the Privacy page, the Reading Settings displayed a warning only when at least one of the static pages was set to the Privacy page (both before and after applying the patch).

Setting Before With patch
Latest posts
No warning

No warning
Static Homepage set to “Home”, no Posts page
No warning

No warning
Static Posts page set to “Blog”, no Homepage
No warning

No warning
Static Homepage set to “Home” and Posts page set to “Blog”
No warning

No warning
Static Homepage set to “Privacy Policy”, no Posts page
Warning

Warning
Static Posts page set to “Privacy Policy”, no Homepage
Warning

Warning
Static Homepage and Posts page both set to “Privacy Policy”
Warnings for same page and Privacy Policy

Warnings for same page and Privacy Policy
Static Homepage set to “Privacy Policy” and Posts page set to “Blog”
Warning

Warning
Static Posts page set to “Privacy Policy” and Homepage set to “Home”
Warning

Warning
Last edited 4 weeks ago by sabernhardt (previous) (diff)

#9 @SergeyBiryukov
4 weeks ago

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

In 61498:

Administration: Only warn about a Privacy Policy page collision when the page is set.

Follow-up to [45766].

Props safedawn, OctoTooT, rollybueno, sabernhardt, SirLouen, dd32, SergeyBiryukov.
Fixes #60750.

Note: See TracTickets for help on using tickets.