[Request for feedback] Updater Proof of Concept

Over the past month, @aristath and @sergeybiryukov have been working on a proof of concept to solve the two first outcomes highlighted in the Updater Initiative scope post.

They drew inspiration from the https://wordpress.org/plugins/rollback-update-failure/ pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party and tried to address a few tickets.

They created a proof of concept that can be found in a draft PR on https://github.com/WordPress/wordpress-develop/pull/1492/files and does the following:

  • Add new arguments to hook_extra passed by plugin and theme updates to ensure we can rollback to the correct version.
  • After a plugin/theme is successfully downloaded and extracted, the old plugin/theme folder is moved to wp-content/upgrade/rollback/plugins/PLUGIN or wp-content/upgrade/themes/THEME wp-content/upgrade/rollback/themes/THEME (thanks Paul Bigai for catching that)
  • If the plugin/theme was successfully installed, the backup of the previous version we kept in wp-content/upgrade/rollback/ is deleted.
  • If the plugin/theme was not successfully installed, then we cleanup any remnants of files in wp-content/plugins/PLUGIN (or the corresponding folder for themes), and then we move the backup we kept in the rollbacks folder back to its original location.
  • Adds info in the site-health screen, to make sure the rollback folder is writable (or can be created if it doesn’t exist)

That is the basic concept. The team ran some tests, helped by @peona as well and it seems to be working.

The main difference with the rollback-update-failure plugin is that this solution moves the plugin/theme folders instead of zipping/unzipping them. This change should help to make the implementation a bit lighter/safer on shared hosts with limited resources.

Before moving forward, I would like to ask the Upgrade/Install Maintainers to have a look at this and discuss together, in the comments of this post, if you agree with this change, if it works, etc…

I am not setting a deadline for the comments, but ideally, I would like to be able to write a merge proposal for 5.9 so I will review the post in mid-JulyAugust (thanks @meher for pointing out that we are at the end of July already 😂) and nudge a bit more 😉

Thank you all for your help and feedback!

Thanks @ipstenu for the peer review

#updater

[Request for feedback] Feature Notifications Proof of Concept

The goal of the WP Feature Notifications project is to create a new and better way to manage and deliver notifications to the relevant audience. The admin_notices hook has served WordPress well and will continue to do so for the foreseeable future. This project is focused on building a new framework for notifications from the ground up, and potentially providing a tool that encourages consistency in presentation, follows best practices in standards and accessibilityAccessibility Accessibility (commonly shortened to a11y) refers to the design of products, devices, services, or environments for people with disabilities. The concept of accessible design ensures both “direct access” (i.e. unassisted) and “indirect access” meaning compatibility with a person’s assistive technology (for example, computer screen readers). (https://en.wikipedia.org/wiki/Accessibility), and discourages spammy or disruptive interactions in the WordPress adminadmin (and super admin) screens.

The end result will be a RESTful model and APIAPI An API or Application Programming Interface is a software intermediary that allows programs to interact with each other and share data in limited, clearly defined ways. to be utilized by coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. but would also enable third-party developers to further extend the functionality. Possibilities could range from pulling in updates from relevant SaaS integrations and hosting platforms, to enabling mobile push or SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/. notifications outward from your WordPress website.

After approximately three years of discussion, scaffolding, and design, the WordPress Notifications feature project is ready to begin collecting feedback on a static demo of the previously reviewed designs. We’re inviting users to install the feature pluginFeature Plugin A plugin that was created with the intention of eventually being proposed for inclusion in WordPress Core. See Features as Plugins. on a test environment, view the static mockups, and provide feedback to the team. 

How To Install

The pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party zip file can be downloaded from the Releases page of the Github repository, and installed like any other WordPress plugin.

Alternatively, it can be installed via Composer:

First add the repository to your composer.jsonJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML.

{
    "type": "vcs",
    "url": "https://github.com/WordPress/wp-feature-notifications"
}

Then install the develop branchbranch A directory in Subversion. WordPress uses branches to store the latest development code for each major release (3.9, 4.0, etc.). Branches are then updated with code for any minor releases of that branch. Sometimes, a major version of WordPress and its minor versions are collectively referred to as a "branch", such as "the 4.0 branch". using the command composer require wordpress/wp-feature-notifications:dev-develop.

How To Test

Once installed and activated, the plugin will display three demo user interface elements for review:

  1. On-page notifications – Similar to the current admin_notices hook, on-page notifications appear at the top of the Dashboard screen.
  2. The Hub – A new “bell” notifications icon on the right-hand side of the admin bar will open the “hub”, a drawer of notifications.
  3. Notification Settings – Users can visit Settings > Notifications or click the link at the bottom of the Hub to see a preliminary draft of a settings table for managing notifications.

It is important to note that this is a static, front-end demo, and the team is mainly looking for overall feedback about the initial direction of these components. For more context on the project, we recommend reviewing the Project Requirements and reviewing the initial Project designs

Looking Ahead

We look forward to collecting your feedback in the comments below or in our Github issues. If you would like to contribute to the project, we invite you to join the #feature-notifications channel in the Making WordPress Slack for our weekly office hours every Wednesday at 14:00 UTC and are happy to welcome new contributors to the project.

Props @psykro for editing and proofreading and @codekraft and @sephsekla for providing content.

#feature-notifications

[Feature project] Updates on updating the updaters

Sorry, I couldn’t help myself…

In November 2020, I posted about an initiative to update the updaters. It took a bit longer than expected to research the issue and an efficient way to manage the project, but here we are.

Context

The WordPress updaters are a set of PHPPHP The web scripting language in which WordPress is primarily architected. WordPress requires PHP 5.6.20 or higher classes that assures that users can safely upgrade WordPress coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress., plugins, themes, and translations.

The ability to manually update WordPress from the adminadmin (and super admin) area, and to install and update plugins and themes, has existed since 2.3 in 2007. Auto-update features were added in WordPress 3.7 (for minor releases), extended in 5.5 (as opt-in for plugins and themes), and 5.6 (major releases). To make the user experience of auto-updates even better, and build trust with users and extenders, it’s important that this mechanism works well and provides all the failsafe checks needed.

The WordPress Core update has proven to be generally reliable, but it doesn’t actually have many tests nor is well documented. There are also some reliability concerns around adding new files and the overall number of changed files, which is the reason WordPress currently tries to keep the number of changed files in minor releases to a minimum.

Plugins and themes updaters are older: in general, all of them can be improved.

Goal

The project goal is to review the existing state of the updaters and propose ways to improve them.

Outcomes

The expected outcomes are:

  1. Make sure the zips upload and unpacking are safe.
  2. Create a mechanism to upgrade and rollback.
  3. Have managed updates (database migrations).
  4. Create a unified JSONJSON JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. convention for requirements and dependencies.

Outcome 1 – Make sure the zip uploads and unpacking are safe

With the introduction of auto-updates, these processes run more frequently.. So relatively small issues get triggered more often, and with that become a bigger problem. They also now more often run unattended: an auto-update that breaks could lead to quite problematic results.

The goal here is to address most of the known issues related to:

  • downloading and extracting update packages
  • copying files and directories
  • improving documentation for updates
  • adding some automated tests
  • making the update process more reliable in general

Related TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. tickets

Edited 2021-05-06T19:38 MDT: added #36710 and #36373 to the list of tickets. @pbiron.

Outcome 2 – Create a mechanism to upgrade and rollback.

When a core auto-update fails, core has long had the ability to automatically attempt a “rollback” to the latest stable release (in the branchbranch A directory in Subversion. WordPress uses branches to store the latest development code for each major release (3.9, 4.0, etc.). Branches are then updated with code for any minor releases of that branch. Sometimes, a major version of WordPress and its minor versions are collectively referred to as a "branch", such as "the 4.0 branch". that the site is running). Note: for core auto-updates, “rollback” is not attempted for certain failures (e.g. “disk full”, etc).

This capability should be extended to be available for plugin and theme updates. Work on some of these issues is already undergoing as part the rollback update feature.

Related Trac tickets

Outcome 3 – Have managed updates (database migrations)

Plugins should be able to easily run database migrations, so that update and rollback could be performed not only for files but also for data.

Yoast already does this by having a migrations library:

If we had a unified process for data migrations in core, WordPress would be able to run the latest available migrationMigration Moving the code, database and media files for a website site from one server to another. Most typically done when changing hosting companies. after an update or rollback:

  • without the need to store anything about the previous state
  • without requiring anything from the plugin author, apart from adding a “migrations” folder

Relevant Trac tickets

Outcome 4 – Create a unified JSON convention for requirements and dependencies.

Different plugins have introduced compatibility tags (For example, Elementor and WooCommerce). In the long run, this could become harder to manage.

Relevant Trac tickets

@afragen has written a lightweight library, wp-dependency-installer, that takes a JSON config file and can install a suggested or required plugin dependency. He mentions this as a lighter-weight solution to something like the TGMPA library. This makes it possible to solve many of the issues above.

How to contribute

  1. Familiarize yourself with the existing classes, listed above.
  2. Update your local WordPress SVN (use svn up) or Git repo (use git pull) to the latest version of WordPress trunktrunk A directory in Subversion containing the latest development code in preparation for the next major release cycle. If you are running "trunk", then you are on the latest revision..
  3. Pick a ticketticket Created for both bug reports and feature development on the bug tracker. from the above list, review its history, refresh it if needed or make a new patchpatch A special text file that describes changes to code, by identifying the files and lines which are added, removed, and altered. It may also be referred to as a diff. A patch can be applied to a codebase for testing..
  4. Upload your patch to the Trac ticket you created, and add the keywords has-patch and needs-testing
  5. If during the exploration of the above goals you can think of other enhancements, please create a new ticket and assign it to the Update/Install component

Keeping Discussions Focused

Any discussion about the specifics of a patch itself should happen on Trac. Any discussion about the broader scope of what this feature project is about should take place during the weekly chat in the #core-auto-update SlackSlack Slack is a Collaborative Group Chat Platform https://slack.com/. The WordPress community has its own Slack Channel at https://make.wordpress.org/chat/..

What’s next?

See you on May 4, 2021 at 17:00 UTC for the kickoff meeting, during the weekly #core-auto-update.

In the meantime, if you already know that you want to work on a specific goal or a specific ticket, please leave a comment.

Thank you!

Thanks @afragen, @audrasjb, and @hellofromtonya for the peer review. Thanks @sergeybiryukov for combing through Trac to look for the tickets!

#auto-updates, #updater

[12987] creates a post with post_status …

[12987] creates a post with post_status of “auto-draft” when you create a new post item. The first save (auto- or otherwise) will change this to a draft. This means that there are no more negative post IDs. You always have a legit post ID from the very beginning.

#commit

Your Organization Application for WordPress in Google…

Your Organization Application for “WordPress” in Google Summer of Code 2011 has been accepted.

Yay! Hopefully we’ll have another great year participating in GSoC.

Next week we’ll get the ball rolling with mentors, projects, applicants, etc. This weekend let’s just rest up.

#gsoc

Your help wanted: Gutenberg Migration Guide

Happy Thursday 🙂

I’ve started a new crowdsourcing project, the Gutenberg Migration Guide, to document WordPress Classic Editor customization points and their GutenbergGutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ equivalents (if such exist).

For example, the media_buttons action is a common way to add a button atop the editor:

Its Gutenberg-equivalent is the BlockBlock Block is the abstract term used to describe units of markup that, composed together, form the content or layout of a webpage using the WordPress editor. The idea combines concepts of what in the past may have achieved with shortcodes, custom HTML, and embed discovery into a single consistent API and user experience. Inserter. Converting a media button to the Block Inserter requires registering a block type. And now we have a corresponding page for developers to reference.

media_buttons is only one of the many ways the Classic Editor can be customized. Wouldn’t it be great if there was a database covering all of them?

This is where you come in! Take a look through the Gutenberg Migration Guide. For each action, filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output., and so on, we’d like to document real-world examples of how they’ve been used. Then, for each of those real-world examples, identify how the feature might be replicated in Gutenberg.

Have a new hook to suggest or question to ask? Please open a new GitHub issue and we’ll get it sorted.

#core-editor, #gutenberg

You might notice that this P2 has gotten…

You might notice that this P2P2 A free theme for WordPress, known for front-end posting, used by WordPress for development updates and project management. See our main development blog and other workgroup blogs. has gotten a big head. All of the Make P2s have actually, and like the rug in the Big Lebowski we think it really ties the room together.

The Get Involved tab has been added, docs have been moved under support, home has been hidden. This isn’t ideal — we’d eventually like to move to more of a verb-oriented navigation system — but it is better than everything under Make being its own island and not really linked to or from the main WP.org side, or to each other. Hopefully it will also let more folks know about how to get involved (I added a link to the Make CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. Handbook to the top sidebarSidebar A sidebar in WordPress is referred to a widget-ready area used by WordPress themes to display information that is not a part of the main content. It is not always a vertical column on the side. It can be a horizontal rectangle below or above the content area, footer, header, or any where in the theme. widgetWidget A WordPress Widget is a small block that performs a specific function. You can add these widgets in sidebars also known as widget-ready areas on your web page. WordPress widgets were originally created to provide a simple and easy-to-use way of giving design and structure control of the WordPress theme to the user..)

I’ll be talking more about some of the improvements to WP.org tomorrow at 11am PST and you can still get streaming tickets if you’d like to tune in: http://2012.sf.wordcamp.org/tickets/

#meta, #wordpress-org

You can shift-click to select a range of …

You can shift-click to select a range of checkboxes in trunktrunk A directory in Subversion containing the latest development code in preparation for the next major release cycle. If you are running "trunk", then you are on the latest revision..

#ui

Yoav usually helps with RTL issues around this…

Yoav usually helps with RTL issues around this time in the dev cycle, but he’s not around for a few weeks, as he is a proud new father. (Congrats, Yoav!) If anyone is able to look in on, test, help refine, etc the remaining RTL tickets for 3.3 (we could especially use help from Arabic native speakers), that would be awesome.

#3-3, #rtl

Yo yo Call for speakers for WCSF Note…

Yo yo. Call for speakers for WCSF. Note that this year devs are the main attraction (Saturday at conference center is all dev, plus hack days before/after). http://2011.sf.wordcamp.org/call-for-speakers/

Who should we put on stage (and subsequently on wordpress.tv) to inspire developers?

#wcsf