[wp-meta] [Making WordPress.org] #3789: Implement plugin with Gutenberg block types for Update PHP page
Making WordPress.org
noreply at wordpress.org
Mon Sep 10 12:33:26 UTC 2018
#3789: Implement plugin with Gutenberg block types for Update PHP page
-------------------------------------------------+-------------------------
Reporter: flixos90 | Owner: nerrad
Type: task | Status: assigned
Priority: normal | Milestone:
Component: Support Hub | Resolution:
Keywords: needs-patch dev-feedback needs- |
design needs-unit-tests has-screenshots |
-------------------------------------------------+-------------------------
Changes (by nerrad):
* keywords: needs-patch => needs-patch dev-feedback needs-design needs-
unit-tests has-screenshots
Comment:
Okay the initial build of the plugin is done.
The repository is for the plugin here: https://github.com/nerrad/update-
php
A release build (for installation from zip) is here:
https://github.com/nerrad/update-php/archive/0.1.0.zip
Regarding redirect logic requested:
> Implement a simple piece of logic to redirect from {$homeurl}/upgrade-
php/ to {$homeurl}/update-php/. Right before the plugin is activated
later, the existing page's slug should be modified from "upgrade-php" to
"update-php".
I don't think this should be done by the plugin but instead should be
something done at the server level. Having plugins handle redirects of
this nature is more resource intensive (because WordPress has to be loaded
twice) than simply adding the redirect to the webserver config. So maybe
request this from the wp.org systems team?
== Flow ==
Here's some gifs showing the block in action (editor and frontend)
**Creating the block and toggling what is previewed in the editor:**
[[Image(http://g.recordit.co/eaDqz2XAJu.gif)]]
**Modifying content:**
[[Image(http://g.recordit.co/fN5GF4a5ru.gif)]]
**Frontend:**
[[Image(http://g.recordit.co/PIaNSpm3ZU.gif)]]
== Summary ==
- The plugin is built so that adding additional blocks we need should be
fairly straightforward. I did not add sass yet because imo that's
overkill at the moment. Currently only simple CSS should be needed.
- From the doc linked to (https://docs.google.com/document/d/1_L76gu0Uj-
7qNKazpuKyIn1TwnNk8kE20-anMVOgyHg/edit) it appeared that there are three
distinct sections for the markup of the first block. So I followed that
for the various content options in the block (title, body, and emphasis).
- I have not implemented any styling yet. The block itself is within a
container with the class `detected-php-content`. The title is in a `<h4>`
tag, the body is just a paragraph block, and the emphasis section is a
paragraph block with the css class `detected-php-emphasis` so styling
should be fairly straightforward. I can help with that or anyone can
submit a pull request.
The block:
- Allows for modification of the various sections of the markup (body,
title, emphasis) for two states: outdated, up-to-date.
- Has immediate preview of changes in markup available in the editor (it
is _not_ using `<ServerSideRender>` because the block is simple so quicker
to do js preview).
- Has a method of toggling between out-dated preview and up-to-date php
version preview.
- Allows for setting what the minimum php version is used to consider for
"up-to-date" messaging.
The frontend:
- looks for `php_version` in the request (that can easily be changed if
something else is used) and displays the appropriate messaging from the
block attributes. If there is no `php_version` in the request then none
of the block content is shown.
== What Next? ==
- Need css implemented for block (auto-prefixr is already configured for
builds)
- Review and tweak any default text if necessary.
- Add php and js automated tests (I held off doing this until I know
whether this is a go as is or not).
- I'm not sure of the procedure for getting this on wp.org. I'm assuming
it will require a patch to add the plugin to the meta repo.
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/3789#comment:2>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list