WordPress.org

Make WordPress Core

Opened 12 days ago

Closed 9 days ago

Last modified 7 days ago

#44045 closed defect (bug) (fixed)

GDPR WP Pointer dismiss link can be unreachable

Reported by: imath Owned by: iandunn
Milestone: 4.9.6 Priority: normal
Severity: normal Version: trunk
Component: Privacy Keywords: gdpr fixed-major dev-reviewed
Focuses: ui, administration Cc:

Description

WordPress Plugins can add admin menu pages and move the Tools menu very low in the page, so low it's no more possible to reach the "Dismiss" link for regular users. Here's an example with BuddyPress activated :

https://cldup.com/biErxRMbb0.png

I'm attaching a "workaround" patch to this ticket, but I think WP Pointer should allow the arrow to be positioned at the bottom of the box to avoid this kind of situation. Here's a screenshot of the workaround :

https://cldup.com/8xtUJ4g-TK.png

Attachments (1)

44045-workaround.patch (1.3 KB) - added by imath 12 days ago.

Download all attachments as: .zip

Change History (14)

#1 @audrasjb
12 days ago

  • Keywords gdpr added

#2 @audrasjb
12 days ago

Related: #43942

#3 @audrasjb
12 days ago

Hi @imath thanks for the ticket,

Note: I reproduced this edge case by using the following viewport:

  • height: less than 550px
  • width: more than 960px

#4 @iandunn
12 days ago

  • Component changed from General to Administration
  • Focuses ui added
  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to 4.9.6
  • Owner set to iandunn
  • Status changed from new to accepted

I think this is essentially the same problem as #43996, which was closed as wontfix. If it's a common occurance, though, maybe we should reconsider, especially since this has a patch. We'll need to make sure the patch doesn't have any side-effects, though, so testing on various real-world sites would be very helpful.

#5 @imath
12 days ago

@audrasjb

Well I think more than the screen resolution, it's the number of admin menus added by plugins that you need to consider. For instance on my good old MacBook Pro (1280 x 800), this happens when there are 3 new admin menus positioned before the tools one (eg: BuddyPress with the Groups and Activity components active). If there are 4 new admin menus, there's no problem.

So there's probably a number of menus for each screen resolution ;) Here's a function to find yours by replacing 3 with another number:

function random_admins_menu() {
	for ( $i = 1; $i <= 3; $i++ ) {
		add_menu_page(
			'random' . $i,
			'random' . $i,
			'manage_options',
			'random' . $i,
			'index.php',
			'',
			70
		);
	}
}
add_action( 'admin_menu', 'random_admins_menu' );
Last edited 12 days ago by imath (previous) (diff)

#6 @audrasjb
12 days ago

You’re absolutely right @imath this is not (only) a viewport issue. I think the next bug scrub is scheduled Monday, and this ticket should be fixed since it is now milestoned for 4.9.6 :)

#7 follow-up: @desrosj
12 days ago

The main issue that @imath is trying to address here is that it is really easy for the actual dismiss button is below the fold when there are custom menu items (which is different than #43996). This patch fixes that for me. I tested with the menu collapsed, and expanded/collapsed on RTL.

It does not fix the issue in #43996 where screen sizes causing the menu to scroll detach the notice from the menu item (which still may be a wontfix).

#8 @iandunn
11 days ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 43246:

Privacy: Reposition pointer to ensure dismiss link is always visible.

r43158 introduced a new admin pointer for the privacy tools added in 4.9.6. With the previous positioning, though, sometimes the Dismiss link would be fixed off screen, making it impossible for the user to dismiss the pointer. This happened when there were enough extra menu items, or when the viewport height was short enough.

This commit repositions the pointer to work around that problem. One down side of this workaround is that the arrow will not always be positioned next to the Tools menu, where it should be. That's an acceptable compromise given the current time constraints, though. A long term solution would be to make WP_Pointer robust enough to handle this use case.

Props imath, audrasjb, desrosj.
Fixes #44045.

#9 in reply to: ↑ 7 @iandunn
11 days ago

  • Keywords fixed-major added; has-patch needs-testing removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to desrosj:

The main issue that @imath is trying to address here is that it is really easy for the actual dismiss button is below the fold when there are custom menu items (which is different than #43996).

Er, you're right. 44045-workaround.patch tested well for me too in various browsers and both LTR/RTL.

Reopening for 4.9 backport consideration.

#10 @desrosj
9 days ago

  • Keywords dev-feedback added

#11 @SergeyBiryukov
9 days ago

  • Keywords dev-reviewed added; dev-feedback removed

#12 @SergeyBiryukov
9 days ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 43253:

Privacy: Reposition pointer to ensure dismiss link is always visible.

r43158 introduced a new admin pointer for the privacy tools added in 4.9.6. With the previous positioning, though, sometimes the Dismiss link would be fixed off screen, making it impossible for the user to dismiss the pointer. This happened when there were enough extra menu items, or when the viewport height was short enough.

This commit repositions the pointer to work around that problem. One down side of this workaround is that the arrow will not always be positioned next to the Tools menu, where it should be. That's an acceptable compromise given the current time constraints, though. A long term solution would be to make WP_Pointer robust enough to handle this use case.

Props imath, audrasjb, desrosj.
Merges [43246] to the 4.9 branch.
Fixes #44045.

#13 @desrosj
7 days ago

  • Component changed from Administration to Privacy

Moving to the new Privacy component.

Note: See TracTickets for help on using tickets.