Arrigoo CDP Block control WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA
Control display of your blocks based on segments from the Arrigoo CDP.
Install
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/arrigoo/wp-block-control/archive/refs/heads/main.zipOn Packagist as arrigoo/wp-block-control:
composer require arrigoo/wp-block-controlArrigoo Block control
What this plugin does
A WordPress plugin that adds a "CDP Segment control" panel to every Gutenberg block's inspector. Editors pick segments (from the Arrigoo CDP) that the block should be shown to or hidden from. All blocks still render server-side; a frontend script reads the visitor's segments from the Arrigoo CDP and either reveals or removes the marked blocks in the DOM.
Commands
npm run build— Builds both JS entry points with@wordpress/scripts(webpack) and copiessrc/bundle.jstobuild/bundle.js. The copy step is required becausebundle.jsis a pre-built CDP SDK artifact, not a webpack entry — webpack would otherwise overwrite or skip it.npm start—wp-scripts start(watch mode forsrc/index.jsandsrc/frontend-loader.js). Note: this does not copybundle.js; runnpm run buildonce to seed it.composer install— Installs thearrigoo/cdp-php-sdkdependency and sets up the PSR-4 autoloader for theArrigoo\WpCdpBlockControl\namespace. The plugin relies on a Composer autoloader being loaded by WordPress (see README.md — the deliciousbrains "WP in git" pattern).
No test suite or linter is configured.
Architecture
Two-stage rendering (the core trick)
- Server: every block with selected segments is rendered with a
data-segments="seg1 seg2 !seg3"attribute. A `block in` hides them all by default (EndUser.php:34-38). - Client: frontend-loader.js waits for the CDP bundle to emit
ao_loaded, reads the visitor's segment list fromwindow.argo.get('s')(falling back to the base64-encodedarrigoocdpsessionStorage entry), then either unhides each block (display: block) or removes it from the DOM.
The ! prefix means "hide from this segment". The literal segment unknown matches visitors the CDP has not recognized.
PHP side (src_php/, namespace Arrigoo\WpCdpBlockControl\)
Hooks are registered in index.php. Three classes, all static:
- BlockControl — registers the editor JS bundle (
build/index.js) and injectswindow.arrigooCdpSegmentsviawp_add_inline_script. Adds aselectedSegmentsarray attribute to every block viaregister_block_type_args, and writesdata-segmentsonto the outermost tag of each block viarender_block. Owns the CDP segment fetch (cached 5 min in theARRIGOO_CDPoption). - EndUser — emits the frontend `
Releases
18 releases.
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.