• Plugin Author Lester Chan

    (@gamerz)


    WP-DraftsForFriends 2.0.0 is a total rewrite of the plugin with Claude Code to make it more modern and testable. There will be breaking changes. Please do test it https://github.com/lesterchan/wp-draftsforfriends/archive/refs/heads/master.zip

    WP-DraftsForFriends 2.0.0 requires WordPress 6.8 and PHP 8.2. A site on an older stack is simply not offered the update, so if WP-DraftsForFriends has stopped appearing in your updates list, that is why.

    The screen stays under Posts and is now one page with two tabs, Shared Drafts and Settings, at edit.php?page=wp-draftsforfriends rather than edit.php?page=wp-draftsforfriends/wp-draftsforfriends.php. The sidebar entry reads WP-DraftsForFriends. The old address embedded the plugin’s folder name, which is why renaming the folder used to break the page. The plugin does one thing — share a post with somebody — and its list is a list of shared posts; sharing is gated on publish_posts, an editorial capability rather than a site-configuration one, and WordPress keeps post-scoped tools under Posts. A top-level menu would have claimed a sidebar slot next to Posts, Media and Pages for something that only makes sense beside your posts.

    Links already sent keep working. They point at the post rather than the admin screen, and their form is unchanged: ?p=<id>&draftsforfriends=<hash>.

    Extend and Delete are bulk actions, not row links. Tick the rows, choose Extend selected or Revoke selected, and press Apply; Extend uses the Extend by duration beside the dropdown. A row action is a plain link, and a browser that prefetches links or a link checker crawling wp-admin would have revoked every share on the page with nobody clicking anything.

    Trashing a shared post now revokes its links, and restoring it makes them work again. Deleting a post permanently deletes its shares, which used to be left behind and counted towards the total above the list without ever being listed.

    There are settings, on the Settings tab, which requires manage_options and sets the duration a new share starts on. Sharing itself still requires publish_posts, and that is what the page as a whole requires — so an author reaches the page and sees only the Shared Drafts tab. The Settings tab is checked separately, both to open it and to save it.

    Smaller changes. The list shows twenty rows rather than fifty, changeable under Screen Options. The sort links no longer use dff_sortby and dff_sortorder, so a bookmarked sorted URL opens unsorted. The plugin stores wp_draftsforfriends_options and wp_draftsforfriends_version; deleting it from the Plugins screen removes both, removes the older draftsforfriends_db_version row, and drops the plugin’s table.

    For code written against the plugin. WPDraftsForFriends no longer exists — it is WP_DraftsForFriends plus seven WP_DraftsForFriends_* classes under includes/. The wp_ajax_draftsforfriends_admin endpoint is removed, because every write is now an ordinary form post. There is one new filter, wp_draftsforfriends_capability, deciding who may reach each tab; it also answers option_page_capability_wp_draftsforfriends_options, so a filtered settings capability governs the save and not only the screen. No hook was renamed, because the plugin previously fired none of its own.

    The page I need help with: [log in to see the link]

You must be logged in to reply to this topic.