[wp-trac] [WordPress Trac] #33704: Reduce reliance on wp_is_mobile()

WordPress Trac noreply at wordpress.org
Thu Sep 1 15:21:46 UTC 2016


#33704: Reduce reliance on wp_is_mobile()
---------------------------------------+-----------------------------
 Reporter:  johnbillion                |       Owner:
     Type:  enhancement                |      Status:  new
 Priority:  normal                     |   Milestone:  4.7
Component:  General                    |     Version:  3.4
 Severity:  normal                     |  Resolution:
 Keywords:  needs-patch needs-testing  |     Focuses:  ui, javascript
---------------------------------------+-----------------------------
Changes (by akibjorklund):

 * keywords:  needs-patch => needs-patch needs-testing


Comment:

 [attachment:33704-login.diff] removes `wp_is_mobile()` from the login
 page.

 The viewport meta tag is returned for all browsers as it has no effect on
 desktop browsers. I would have removed the whole function that does add it
 and just inlined the tag with the rest of head HTML, but I was not sure
 what the policy with removing functions is.

 Secondly, no `mobile` class will be printed. There were three CSS rules in
 `login.css` that relied on that. The first one that moves the login box
 close to top I moved under a media query that test against the height of
 the viewport. The second one did set the left margin of the form to zero,
 but that was in any case zero, so the rule was redundant. The role of the
 third rule was mystery to me, it did just misalign links below the form
 with some extra left margin and thus did not seem useful to me and I
 removed it.

 Lastly, the login shake animation is used for all browsers. I do not have
 any old mobile phones to test this with (as refresh rate with BrowserStack
 is poor and thus results inconclusive), so I cannot say if this is a poor
 experience. My gut tells me it won't perform very well but I doubt it is
 really an issue either. If it is, maybe a width based rule would do the
 trick here. I would appreciate if someone could test the patch with a
 phone with low processing power.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33704#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list