Make WordPress Core

Updates from Mike Schroder Toggle Comment Threads | Keyboard Shortcuts

  • Mike Schroder 7:07 pm on March 6, 2013 Permalink
    Tags: ,   

    Autosave and Post Locking – 3/6 

    Improved user logout notification ( #23295 ) is now in core, and its UI has been tweaked to directly show the login box, rather than prompting first:

    expired_login

    There’s been discussion as to whether it’s better not to block the user’s access to the editor/current page when we detect that you no longer have a login token, since it could stop a user while they’re in the middle of a sentence. Any opinions either way? Feel free to comment either here or on #23295.

    A simple way to test the above is by removing your login cookie while working in WordPress (Firebug works well).

    On local autosaves, there was a decision to pivot from the previous UX posted here, and instead integrate with the new revisions model. This code is still being worked on.

    In the land of post locks, @azaozz posted a patch on #23697, that shows a dialog either when you visit a locked post, or when your post becomes locked. If you are visiting an already locked post, you have the option to break the lock. This is still in need of UX/UI love, but looks like this currently:

    post_is_locked_ui

    Finally, a patch on #23665 allows for one autosave per user per post, rather than per post, to let us keep an autosave from before you lost a lock. Testing on this, and the rest of the above welcome!

     
    • Mark Jaquith 8:24 pm on March 6, 2013 Permalink | Log in to Reply

      I think the session expired modal should darken the rest of the page. It kind of blends in as-is.

      • Mike Schroder 10:45 pm on March 6, 2013 Permalink | Log in to Reply

        Agreed. I think that was initially left over from the “let’s let the user continue to work” mentality. If we’re going with “Your only path is to log back in,” then making it darken the rest of the page is appropriate.

      • lessbloat 3:16 pm on March 7, 2013 Permalink | Log in to Reply

        I agree with @MarkJaquith. I took a quick stab at mocking it up:

        • Added a dark fullscreen overlay
        • Added right: 35px; left: 35px; top: 35px; bottom: 35px; to #wp-auth-check
        • Centered the login iframe
        • Removed the “Session expired” title
        • Removed the close link. If the whole point in doing this is to keep users from losing their work, I think we have to force it. The best thing they can do at this point is log back in, and continue on their way. If we do allow them to close it, and they click “publish”, they will be redirected to the login screen anyway, but once they log back in, they’ll discover (tragically) that all of their work has been lost.
        • Tweaked the copy to read: “Oops… Your log in has expired. Please log back in below to avoid losing any of your work.”
        • Andrew Ozz 6:44 pm on March 7, 2013 Permalink | Log in to Reply

          Was testing something similar too and agree it looks better. The only concern is that it will frighten the user when it shows.

          Most commonly this will show on the Add / Edit Post screen (as the users spend most time there). Imagine typing a new post, uploading images, etc. and suddenly the screen with your work disappears and is replaced by the login screen telling you to log in again. I bet two “scary” thoughts would go through your head: “What happened to my post?” and “This asks for my password, is it legit?”. Additionally the screen change will most likely cut you in the middle of a sentence and can literally startle you.

          In the original patch this was a two steps process: a non-modal (position fixed) warning shows first telling the user that the session has expired and asking to log in again. As the rest of the screen is visible this is not that scary (you can still see your work) and won’t startle you as most of the screen doesn’t change. Then clicking a link or a button in the warning opens the actual login screen in a modal.

          Perhaps this is a better solution. Yes, one more click, but better user experience.

          • lessbloat 1:56 pm on March 8, 2013 Permalink | Log in to Reply

            I think we can likely find a way to lessen the fear by getting the copy right. You could also bump the darker outer margin up (maybe double the margin), and perhaps lighten the opacity a tad, so that the user still can see some of the screen behind.

            I prefer the one step (taking them straight to the login form), vs. showing an intermediary step (which looks more suspect than the log in form with the logo above it, to be quite honest). If they’ve saved their login details, they only have to click once (on the “Log in” button), and they are right back to their writing.

    • jltallon 12:52 pm on March 20, 2013 Permalink | Log in to Reply

      +1 — Translucency allowing the user to see that their content is still back there, undisturbed, perfectly conveys the notion that “your session has expired, we need to re-authenticate you so that you can follow working as if nothing had happened”:

      • My content can be seen behind/below -> I haven’t lost my work
      • My *own* content is back there -> legitimate password request

      IMHO, you nailed it.

  • Mike Schroder 6:49 pm on February 13, 2013 Permalink
    Tags: ,   

    Autosave and Post Locking – 2/13 

    This is a rather late update, and will serve for the last two; apologies!

    Last week, we talked about the locks that went in, and @markjaquith suggested that we replace the “lock” with a Gravatar, which I like quite a bit. Will experiment with that to see if it can work.

    Today we chatted about the most recent update to #23220 posted by @azaozz, which integrates the work done by @asannad (AmitSannad on IRC), and adds a UI for selecting which you’d like to restore: localsaves_screenshot

    In addition, if it’s found that you have an autosave that has failed, and have a newer version locally, you’re warned (either on the Posts list or Post itself), and linked to the UI that allows you to restore the content (post content and title only) and save at will:
    posts_Warning

    It was brought up during the chat by @nacin that the UI included in the patch might be more than we need, and that we should decide what is best for the user regarding restores, and perform it for them. We continue to chat about this, and opinions are welcome!

    Lastly, there is a patch from @mintindeed on #23295 currently waiting for integration! That patch, and the one on #23220 could use some testing — let us know if you run into problems on trac.

    We’ll be meeting again this Friday at 2100 UTC (1pm PST).

     
    • Gabriel Koen 7:28 pm on February 13, 2013 Permalink | Log in to Reply

      Oops I missed today’s meeting.

      I am working on some revisions to my patch based on feedback from last week’s meeting, unfortunately work is killing me this week so it will probably be the coming weekend (Feb 16–17) before I get a revised patch up there.

  • Mike Schroder 10:47 pm on February 2, 2013 Permalink
    Tags: ,   

    Autosave and Post Locking Update 2/2 

    A quick update on status!

    Earlier this week, the initial run at the Heartbeat API went in. @azaozz is continuing to work on it, and flesh out the API further ( #23216 ).

    Tonight, the initial post lock view for the post listing was committed [23355] along with a temporary icon:
    new_lock

    I took a look over an older version of the NYT plugin kindly contributed on #18515.
    For discussion, I’m including a few examples of the UI/UX from the workflow included in it below.
    We don’t necessarily think everything here is a good idea for core (for instance, the “get me out” buttons wouldn’t be necessary), and will likely go a different route for UI, but hoping to get a bit of discussion going regarding the UI/UX flow for the project.

    Lock table:
    nyt_lock

    Lock table user mouseover:
    nyt_lock_notice

    Popup for lock within Post Editor:
    nyt_lock_popup

     
    • Ipstenu (Mika Epstein) 7:44 am on February 3, 2013 Permalink | Log in to Reply

      The first icon goes better with the new icon sets that’ve been worked on. Don’t forget to loop back to that group ;)

      What user levels can break locks? Is it hierarchical so Admins can break anyone’s locks, but Editors can break admins and so on down the line?

      The alert boxes greying out the screen behind is good, that reinforces ‘Hey! Someone’s in here!’ You could use that extra space to have something like …

      Warning: POSTTITLE is locked

      Other Person is currently editing this post.

      You can view the post as read only, exit out, or unlock the post and take over. If you chose to break the lock, their edits will be lost(?).

    • Alex 8:13 am on February 3, 2013 Permalink | Log in to Reply

      Why not open the edit screen as read-only directly? Greyed out with a warning on the top of the page which contains the “request” and “force” buttons. Content refreshes every 15 seconds and you directly see what the other is working on. Less buttons, less clutter.

      • Mike Schroder 6:44 pm on February 4, 2013 Permalink | Log in to Reply

        Read-only on edit is what we’d initially chatted about, so I’m glad to see you agree! I really like the idea of having the warning within something similar to the current warnings, only with “request” buttons there. Do you think it’s important to be able to force immediately, or only allow that after you’ve requested, and don’t immediately get feedback?

        • Ipstenu (Mika Epstein) 7:19 pm on February 4, 2013 Permalink | Log in to Reply

          I think… people don’t RTFM enough. A splash is annoying, but less likely to miss (never underestimate the ability of people to click on something without reading).

          • Alex 9:49 pm on February 4, 2013 Permalink | Log in to Reply

            Grey everything out and set the input fields to read only. Then refresh them all 15 seconds with auto-save changes from the current editor.

            @Mike Schroder: I think a button to force-get the right for editing would be necessary for people with a higher role. Still, the user currently editing would need to get a warning and a countdown for deciding to save or discard his work.

    • Alex 8:17 am on February 3, 2013 Permalink | Log in to Reply

      And is it already planned to add a “x people are watching you editing this post” notification?

    • Andrew Ozz 6:25 pm on February 4, 2013 Permalink | Log in to Reply

      Yes, we can use a modal to block access to the Edit Post screen when opening a locked post and show a “preview” of the latest content entered by the other user. In that modal we won’t need the “Read Only” button from the above screenshot and the “Get Me Out” would be “Return to [previous page]” or “Go to All Posts”.

      The “Unlock” could be “Request to edit” or “Request the lock” which will pop up a notification on the other user’s screen letting them finish what they are doing and save or perhaps refuse to give up the lock.

      Instead of a modal, this can also be a whole different screen. Then after the lock is transferred, the user will be able to load the post for editing. This way we will be loading everything fresh from the server.

    • Sam Parsons 5:04 pm on February 5, 2013 Permalink | Log in to Reply

      I know this maybe off-topic, but the whole idea of the hearbeat API and even perhaps showing updates from a locked post to an editor who is about to acquire a lock makes me think about perhaps making it a full collaborative editor? Why not go that far? It seems we’re already getting close. It’s a matter of sending/receiving diffs on the long-polling method which was discussed earlier.

  • Mike Schroder 11:17 pm on January 25, 2013 Permalink
    Tags: ,   

    Autosave and Post Locking Update, 1/25 

    We had our scheduled meeting today in IRC to continue planning the feature for this cycle.

    @azaozz noted that he’s continuing work on the Heartbeat API #23216, on schedule for initial commit before next week.

    I am continuing work on an initial pass for the post/page tables to display locks, and properly display edit/bulk edit links when locked. Should have an initial pass ready for view on Monday.

    @mintindeed offered to help port his plugin to core for improved login expiration warnings, which is great! He’s created #23295 to track the efforts.

    @asannad (AmitSannad on IRC) offered to help with localstorage Autosaves, which is being tracked on #23220. Initially, we’ll use a simple schema for storage, but will probably need something more complex later on to avoid collisions where multiple databases are used within the same domain.

    As initial guidance for improved workflow for locks, we’re looking over the plugin mentioned in #18515. @nacin is checking with the authors to see if there’s a new version we can take a look at.

    Our next meeting is on Tuesday, January 29th at 2100 UTC (1pm PST).

     
  • Mike Schroder 4:53 am on January 23, 2013 Permalink
    Tags: , ,   

    Autosave and Post Locking Update 

    Today we had our first scheduled meeting.

    Consensus was, for a first pass:

    • Display a simple lock/padlock icon next to locked posts within the post list screen, leaving the “Request Lock” button for the post edit screens.
    • When a post is locked, hide the Quick Edit link, and disable batch edit for the post
    • To unlock a post, the user will enter the post edit screen, then click a button to request a lock.  This will trigger a request to appear for the user with the current lock, where they can decide whether or not to allow the new lock.

    As far as development tasks go, @azaozz is planning on finishing a first run at the “Heartbeat” API to be committed before the end of the week. I’ll begin working on the list table changes for post listings. We’re currently looking for volunteers to aid, as there’s plenty of room for help! Additional tasks will include the UI for handling post lock requests and auto-save to local storage.

    We’ll certainly chat more about this tomorrow in dev chat, and are planning another meeting this Friday (2013–01–25), at 21:00 UTC (the same time as dev chat), unless this doesn’t work for many of you looking to help. Please post here, or come to the chats if you’re interested in helping with this project, and we’ll get in touch with you for further details!

     
    • John Saddington 12:20 pm on January 23, 2013 Permalink | Log in to Reply

      fantastic. i’m on pins waiting for this implementation. can’t wait!

    • mindctrl 3:25 pm on January 23, 2013 Permalink | Log in to Reply

      The idea for implementing post locking is for a person to manually click a Request Lock button in the edit post screen? Would that show up on all installs or only installs that are multi-author? Why not automatically lock a post when editing it so the workflow is streamlined?

      • Andrew Ozz 4:32 pm on January 23, 2013 Permalink | Log in to Reply

        Good questions. The Request/Take over a lock button will only show when the same post is being edited by another user. Under normal circumstances posts would never be locked on installs with only one user. However if the user opens the same post on two different devices (computers) or in two different browsers, the first instance should lock the second. That should also happen if several people use the same user account.

        We already monitor when a post is being edited and show a warning. The purpose of the enhancements is to actually prevent saving a post from two different places simultaneously.

        • mindctrl 5:59 pm on January 23, 2013 Permalink | Log in to Reply

          Thanks for the clarification. Sounds great.

          Will this be implemented in the mobile apps? I’m wondering what would happen if someone tried editing a locked post from a smartphone or tablet, and would those devices be able to lock and/or take over a locked post?

      • Mike Schroder 6:22 pm on January 23, 2013 Permalink | Log in to Reply

        That’s the idea — you’d get the lock automatically if the post isn’t locked by anyone. Then, if it’s already locked, you have the option to request the lock from the author that holds it. The feature would still exist on single-author installs, but you wouldn’t notice it, because you’d be the only one able to hold locks.

        [edit] Previous comments weren’t showing when I typed this. @azaozz‘s comments above explain further :) [/edit]

    • Mark Jaquith 8:52 pm on January 23, 2013 Permalink | Log in to Reply

      Unless I’m misunderstanding, this approach seems like it could result in posts becoming permanently locked.

      1. Open post for editing
      2. Walk away
      3. ???
      4. Profit

      • Mike Schroder 9:18 pm on January 23, 2013 Permalink | Log in to Reply

        To resolve this issue, we’ve talked about including a concept of activity via keystrokes and maybe mouse movement to maintain the lock assignment (otherwise, a user would lose the lock after X amount of inactivity).

        • Andrew Ozz 7:49 pm on January 25, 2013 Permalink | Log in to Reply

          We can also monitor user activity comparing autosaves to the server. If there are no changes for x minutes, user is inactive. Maybe we can set another flag for “user-active” in the post lock and toggle it based on autosaves.

  • Mike Schroder 1:04 am on December 6, 2012 Permalink
    Tags:   

    WP_Image_Editor is incoming! 

    In WordPress 3.5, GD has been abstracted out of core’s image manipulation functions.
    What does that mean for you, you ask?

    What’s cool?

    • We add support for Imagick by default, giving better image quality to those who have it available on their host. This is particularly important if you’re using images with extended color profiles, since GD discards them outright.
      • Imagick support requires Imagick 2.2.0+ compiled against Imagemagick 6.2.9+, for full support. If the required functions aren’t available, WordPress will default back to GD.
    • You can create your own image manipulation engine, or extend ours in plugins to easily add additional functionality to WordPress.

    Watch out for:

    Any function or filter that receives or returns a GD Image Resource should be avoided if possible, since 3.5 represents core’s move away from GD’s direct use.

    Deprecated Filters

    Several filters have been deprecated, and will no longer function as they did previously. This includes any filter that expected to receive a GD Image Resource, as we can’t pass a GD Image Resource to it if another backend is being used. Instead, new filters are introduced that expect a WP_Image_Editor object.

    It’s worth noting that if you’re using these filters, your plugin shouldn’t create a fatal error – it just won’t modify core’s functionality like it used to, and will fail silently.

    Deprecated Filters

    • image_save_pre is now image_editor_save_pre
    • wp_save_image_file is now wp_save_image_editor_file
    • image_edit_before_change is now wp_image_editor_before_change

    While jpeg_quality is backward compatible in 3.5, if you want to change compression quality globally, you should use wp_editor_set_quality in the future, since it applies to other editors and formats that support quality setting as well (like PNG with Imagick). To change the quality on a single image you’re editing, see WP_Image_Editor::set_quality().

    New Filters

    • wp_image_editors – modify array to re-order or add additional editor/engine classes.
    • image_editor_default_mime_type – string; set default mime-type for WP_Image_Editor.

    Deprecated Functions

    • wp_load_image() – use wp_get_image_editor() to load files instead.
    • image_resize() – use WP_Image_Editor::resize()
    • gd_edit_image_support() – use wp_image_editor_supports()

    Need to Deprecate

    There isn’t yet an alternative for load_image_to_edit(). This is because there is work towards creating an image container for a future version of WordPress. In the meantime, while decidedly not ideal, I’d suggest doing what core does: wp_get_image_editor( _load_image_to_edit_path( $post_id ) );

    How do I use it?

    A complete tutorial on the use of WP_Image_Editor is forthcoming, but this should get you started:

    $image = wp_get_image_editor( 'cool_image.jpg' );
    if ( ! is_wp_error( $image ) ) {
    	$image->rotate( 90 );
    	$image->resize( 300, 300, true );
    	$image->save( 'new_image.jpg' );
    }
    

    You can see full class documentation by taking a look at:
    wp-includes/class-wp-image-editor.php
    wp-includes/class-wp-image-editor-imagick.php
    wp-includes/class-wp-image-editor-gd.php

    Known issue

    #22663 – Non-Square Rotates (non 90*x), followed by a crop, can cause improper results.

     
  • Mike Schroder 6:55 pm on February 15, 2012 Permalink
    Tags: ,   

    Team Update: Browsing Buddies 

    Our first cycle ended successfully on the 9th, with a first patch for Infinite Scroll on Themes screens (#19815) committed on time.

    The task for our next cycle is Multiple Screenshots for Themes (#19816), and helenyhou has been spending time creating comps.  Additional comps still welcomed at Make UI.

    The rest of the time was spent on polishing the code for Infinite Scroll for the Themes screens, including prevention of loading themes.js on unnecessary tabs, throttling for the scroll event, general cleanup, and a move to use Deferred for AJAX requests.  Feedback and JS review welcomed on #19815.

     
  • Mike Schroder 8:23 am on February 1, 2012 Permalink
    Tags: ,   

    Team Update – Browsing Buddies (Tuesdays)

    Current Cycle Focus: Themes Screen Infinite Scrolling (#19815)

    • helenyhou: Created initial patch for hiding default theme details and displaying author on #19853.  Ported changes made on themes-list-table to theme-install-list-table.
    • DH-Shredder: Enabled fetch-list for class-wp-themes-list-table.  Currently porting wp-includes/js/wplink.dev.js, which handles infinite scrolling for internal linking, to wp-themes.dev.js for use in the Themes screen.  Initial patch (work in progress) posted on #19815.

    Office Hours:  22:00-24:00 UTC (2:00p-4:00p PST) on Fridays

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel