WP Manifestindependent plugin directory
manifest / editor / planet4-gpea-plugin-blocks

Planet4 - GPEA Blocks WP Registry grade D+. High-severity findings · 2 findingsWP RegistryHigh-severity findings · 2 findingsOpen the reportD+

Shortcake blocks for the GPEA office Planet4 implementations

★ 2stars
4.4kcomposer installs
v0.3.8.3latest · 6 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/greenpeace/planet4-gpea-plugin-blocks/archive/refs/heads/master.zip

On Packagist as greenpeace/planet4-gpea-plugin-blocks:

composer require greenpeace/planet4-gpea-plugin-blocks
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

GreenpeaceEA Planet 4 - Shortcodes

This WordPress plugin provides blocks to be used with Shortcake UI plugin. This plugin is developed by Greenpeace Netherlands to be used in the Planet4 engagement platform.

Currently this plugin adds the following new shortcodes:

  1. Donation form
  2. Petition form
  3. No-index (to discourage search engines from indexing)
  4. Liveblog

Coming in the near-future (available on dev-branch)

  1. Quote block with image
  2. Statistics block in 3 columns
  3. New hero image header

In the backlog are among others:

  • Information request form
  • interactive maps

How to develop a new block you ask?

  1. Create a new controller class that extends Controller inside directory classes/controller/blocks. The class name should follow naming convention: GPEA_Blockname_Controller and its file name should be class-blockname-controller.php.

  2. Implement its parent's class two abstract methods:

  • In method prepare_fields() you need to define the blocks fields
  • In method prepare_template() you need to prepare them for rendering.
  1. Create the template file that will be used to render your block inside directory includes/blocks. If the name of the file is gpea_blockname.twig then you need to set the BLOCKNAME constant as gpea'blockname'

  2. Add your new class name to the array that the P4BLBKS\Loader function takes as an argument in planet4-gpea-blocks.php.

  3. Finally, before committing do composer update --no-dev && composer dump-autoload --optimize in order to add your new class to composer's autoload.

And how do i build new assets?

Asset sources are located in:

/includes/assets/

  1. /js/src/
  2. /css/scss/

Gulp builds the buildfiles into the parent directories of the sourcesfiles (so /js/ and /css/). Maps are placed in /maps/...

Using your favorite package manager install the required packages from package.json and simply run gulp watch or gulp.

Known issues

Currently Firefox does not read the maps correctly. Chrome/Chromium does.

Releases

Newest 25 of 33 recorded releases.

Tag
Published
v0.3.8.3 latest
Jun 4, 2020 6 years ago
Apr 13, 2020 6 years ago
Jan 15, 2020 6 years ago
Jan 14, 2020 6 years ago
Dec 5, 2019 6 years ago
Nov 26, 2019 6 years ago
Nov 15, 2019 6 years ago
Nov 4, 2019 6 years ago
Oct 23, 2019 7 years ago
Oct 2, 2019 7 years ago
Sep 30, 2019 7 years ago
Sep 24, 2019 7 years ago
Sep 23, 2019 7 years ago
Sep 9, 2019 7 years ago
Aug 9, 2019 7 years ago
Aug 8, 2019 7 years ago
Aug 6, 2019 7 years ago
Jul 31, 2019 7 years ago
Jul 29, 2019 7 years ago
Jul 26, 2019 7 years ago
Jul 25, 2019 7 years ago
Jul 25, 2019 7 years ago
Jul 25, 2019 7 years ago
Jul 25, 2019 7 years ago
Jul 24, 2019 7 years ago
All releases on GitHub →

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.

D+ grade

Security

Planet4 - GPEA Blocks 0.1 · audited by WP Registry

High-severity findings.

1 high 1 low
Audited release
0.1
Findings
2
Worst severity
high
Content hash
8b41e44b613432b7b3ebb32a…

Findings

  • high Iframe shortcode urldecodes attacker HTML and renders it with Twig |raw

    xss_stored

    Iframe_Controller::prepare_data() urldecodes the shortcode 'content' attribute (Shortcake stores it encoded) and iframe.twig prints {{ content|raw }}, which bypasses Timber autoescape and wp_kses. shortcode_ui_register_shortcodes() registers shortcake_iframe globally with no current_user_can in the render callback; P4EABKS_ALLOWED_PAGETYPE only hides the Shortcake UI, it does not stop the shortcode in posts. Users without unfiltered_html (Author on single-site; Author/Editor on typical Planet4 multisite) cannot paste <script> into post_content because kses strips it, but they can save [shortcake_iframe content="%3Cscript%3E…%3C/script%3E"] which contains no HTML tags. After do_shortcode the script runs for every frontend visitor. The field label ('Please make sure the script is safe') shows this is eval-by-design for trusted editors, but there is no capability gate, so it is stored XSS for any role that can publish/submit content with shortcodes. The same raw sink is reused by prepare_admin_preview when $_GET[content] is copied unsanitized.

    includes/blocks/iframe.twig:9-11

    Recommendation

    Restrict shortcake_iframe rendering to users with unfiltered_html (or a dedicated capability) and/or allowlist iframe/src/sandbox markup via wp_kses with an explicit iframe+script policy. Do not |raw urldecoded shortcode attributes. Keep the Shortcake UI on pages only if you also refuse the shortcode in other post types.

  • low Plugin header version stays 0.1 while the distributed git tag is v0.3.8.3

    version_mismatch

    planet4-gpea-blocks.php and readme.txt still declare Version 0.1 / 0.1.0 (Tested up to 4.8.1) even though this archive is GitHub tag v0.3.8.3 (the donate_amt and iframe modules were added in that tag). Update checkers and vulnerability scanners that key on the plugin header will mis-identify the installed build.

    planet4-gpea-blocks.php:3-6

    Recommendation

    Bump the plugin header, readme.txt stable tag, and any packaged version to the real git tag (0.3.8.3) on every release.

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.