Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#44045 closed defect (bug) (fixed)

GDPR WP Pointer dismiss link can be unreachable

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

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 8 years ago.

Download all attachments as: .zip

Change History (14)

#1 @audrasjb
8 years ago

  • Keywords gdpr added

#2 @audrasjb
8 years ago

Related: #43942

#3 @audrasjb
8 years 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
8 years ago

  • Component GeneralAdministration
  • Focuses ui added
  • Keywords has-patch needs-testing added
  • Milestone Awaiting Review4.9.6
  • Owner set to iandunn
  • Status newaccepted

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
8 years 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 8 years ago by imath (previous) (diff)

#6 @audrasjb
8 years 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
8 years 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
8 years ago

  • Resolutionfixed
  • Status acceptedclosed

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
8 years ago

  • Keywords fixed-major added; has-patch needs-testing removed
  • Resolution fixed
  • Status closedreopened

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
8 years ago

  • Keywords dev-feedback added

#11 @SergeyBiryukov
8 years ago

  • Keywords dev-reviewed added; dev-feedback removed

#12 @SergeyBiryukov
8 years ago

  • Resolutionfixed
  • Status reopenedclosed

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
8 years ago

  • Component AdministrationPrivacy

Moving to the new Privacy component.

Note: See TracTickets for help on using tickets.