Skip to content

0.8.0 — the option that hides elements from the client also hides them from the agent

Choose a tag to compare

@NertiPL NertiPL released this 21 Aug 17:49
· 10 commits to master since this release

Nothing added, nothing removed. Every ability description, the plugin header, the README and UPSTREAM.md were re-measured against Oxygen 6.2.0-beta.5 + Breakdance Elements for Oxygen 1.1.0.beta.1, WordPress 7.1, PHP 8.2.29 and corrected. Three of the pack's stated reasons for existing turned out to be fixed upstream, one was flatly wrong, and one new coupling was found.

Fixed

  • The pack claimed oxygen_builder_hidden_elements does not affect MCP. It does. The plugin header, the README and bdox/element-visibility's description all said the option controls the editor panel only. admin/settings-page/tabs/elements.php hangs filter_builder_elements() on the breakdance_builder_elements filter at priority 10, and mcp/schemas/elements.php runs the MCP element list through that same filter. Measured: adding EssentialElements\Button to the option took oxygen-get-element-slugs from 164 to 163 and made get-element-schemas refuse it; removing it restored 164. Rule that follows, now stated in three places: build first, hide last.
  • bdox/builder-hidden-elements reported a number that never moves. It returned builder_panel from count(get_elements_for_builder()), which maps over every registered classname and only feeds the filtered list to addPanelRules — measured 165 both before and after hiding an element. Replaced with mcp_visible_count and hidden_from_mcp, so the ability now reports both sources of truth: the stored option and what MCP can actually address.
  • The "empty list is repopulated on the next request" claim was wrong. Measured: an empty builder_hidden_elements persists across requests. addDefaultHiddenElements() is called from handleVersionChange() and the setup wizard, so the re-fill happens on the next Oxygen update, not the next request. The non-empty placeholder is still correct — the reason changed, not the behaviour.
  • The element counts in the header and README were from beta.2 (162 / 149). Re-measured: 186 registered, 151 MCP-visible without the pack, 164 with it. BREAKDANCE_MCP_HIDDEN_ELEMENTS now holds 14 entries and no longer bans Section, Heading or Icon — those three are hidden purely by the WP option.

Changed

  • bdox/merge-css-selector no longer claims to be the only route to !important. Oxygen fixed that in 6.2.0: css-to-properties.php diverts every !important declaration into custom_css with the flag intact, before the typed converters run. Measured on beta.5 — .probe{color:#ff0000 !important;padding:8px} stored padding as a typed property and custom_css as :selector {\n color: #f00 !important;\n}. The ability stays for the two things still broken: the importer replaces a selector's whole property map per breakpoint (measured — a margin-only import wiped both padding and custom_css), and it lowercases custom-property names (--myVar stored as --myvar while var(--myVar) keeps its case, so the reference dies and the import reports success).
  • bdox/patch-global-settings lost its main reason and kept a smaller one. set-global-settings deep-merges since beta.5 (breakdance_mcp_deep_merge_settings) — measured, a typography.base_font_size-only call left colors.palette and typography.body_font intact. What it still cannot do is write a key on an object closed with additionalProperties: false: buttons.primary.background_hover goes through, buttons.primary.typography.color_hover is rejected — and elements/macros/atom-v1-button-css.twig reads exactly that key. The description now says so instead of advertising the merge.
  • bdox/get-global-settings stays, with the real failure. Soflyy fixed the empty-settings case ({"settings":{}} instead of an error), so on a blank site the built-in reader works. On a real one it still returns nothing: output[settings][buttons][primary][corner_radius][unit] is not of type object,null. Observed on a production site and reproduced on the beta.5 lab install with the same stored value. The output schema wants corner_radius breakpoint-keyed; the builder stores it flat as {number, unit, style} — and stores it breakpoint-keyed under button_presets[].styles, so the same control is persisted two different ways.
  • bdox/regenerate-css narrowed its claim. Still no cache-regeneration tool among the 49 the beta.5 server exposes, but Oxygen's own save paths do regenerate (data/save.php:121 calls generateCacheForPost(); save_global_settings() and save_selectors() call generateCacheForGlobalSettings()). The ability is for data changed outside those paths, and for a stale compiled cache.
  • bdox/element-visibility was rewritten to report three lists, not two counts. banned_by_oxygen (the constant), hidden_in_elements_panel (the WP option), restored_by_this_pack, plus still_hidden_from_mcp and an explicit warning about the shared filter. It also stopped comparing element slugs against classnames, which made the old hidden_from_mcp meaningless.
  • The two add_filter calls stay, with the deletion condition written into the code. They exist only because the fundamentals are supposed to replace these elements — and on BEFO 1.1.0.beta.1 the fundamentals do not exist: class_exists() is false for FText, FImage, FRichText, FTextLink, FSvgIcon2, FHtmlCode and EssentialElements\ContainerLink. The native OxygenElements fallbacks exist but have no Design tab — measured via oxygen-get-element-schemas: EssentialElements\{Section,Heading,Text,Image2,Button} expose design, OxygenElements\{Container,Text,Image} do not. The header now names the re-measure condition: after BEFO ≥ 1.1.0.beta.3, check class_exists('EssentialElements\FText') and whether its schema has a design section; only if both hold do the filters get deleted.
  • bdox/set-image re-measured, unchanged. The wpmedia control still schemas media as {id, url, alt} with additionalProperties: false, and both OxygenElements\Image and EssentialElements\Image2 still resolve src as content.image.media.sizes[size].url.
  • typography.css.twig lines 114 and 126 still lack | join(' '), so text-decoration-line still compiles to the literal Array. Recorded in UPSTREAM.md as still open.

The cost of the restore is now written down

Previously unstated: restoring on breakdance_builder_elements also unhides those 13 elements in the builder's Add panel, because get_elements_for_builder() hands the same filtered array to FilteredGets\addPanelRules(), which sets alwaysHide on whatever is missing from it. Measured — pack active: Section, Div, Heading report no alwaysHide; pack filter removed: all three do. Two consequences, now documented in the plugin header, the README and bdox/builder-hidden-elements:

  • While the pack is active the client sees those elements too, which removes exactly the simplification Oxygen was going for.
  • A human who hides one of the 13 in Oxygen → Settings → Elements is silently overruled: the pack restores at priority 20, after the settings page subtracts at priority 10.

Restoring "for MCP only" was considered and rejected. The panel and MCP go through different functions but share one filter, and the filter carries no caller context, so the only discriminator is the admin-ajax action name — a string Oxygen may rename, after which the guard silently stops matching. Instead, the existing bdox_pack_restored_elements filter is documented as the lever: add_filter( 'bdox_pack_restored_elements', '__return_empty_array' ) at handover. Handover order, which is not the build order: build → hide → narrow (or deactivate). Hiding while the pack still restores does nothing.