@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/portfolio/lh-idb-keyval/>
  a sioc:Post ;
  dc:title "Using it in a plugin" ;
  dcterms:identifier 152638 ;
  dc:modified "2026-10-27T12:21:23Z"^^xsd:dateTime ;
  dc:created "2026-10-27T12:21:23Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-idb-keyval/using-it-in-a-plugin/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded "<ul class=\"lh_portfolio-meta\"><li><strong>Part of:</strong> <a href=\"https://lhero.org/portfolio/lh-idb-keyval/\">LH idb-keyval</a></li></ul><p class=\"wp-block-paragraph\">A consuming plugin bundles the library in <code>assets/lib/idb-keyval/</code> (<code>index.js</code>, <code>umd.js</code>, <code>LICENSE</code>) and copies <code>snippets/lh-idb-keyval-fallback.php</code> verbatim to <code>includes/lh-idb-keyval-fallback.php</code>. Never edit the copy: change the canonical snippet, bump its snippet version and recopy it everywhere. There is no <code>Requires Plugins</code> header, so the consumer stays independent and releasable.</p><h2 class=\"wp-block-heading\">What the snippet does</h2><ul class=\"wp-block-list\"><li><strong>Fallback check:</strong> <code>lh_idb_keyval_use_fallback()</code> is true when LH idb-keyval has not fired <code>lh_idb_keyval_registered</code>, so a plugin turned off by its init filter counts as inactive.</li><li><strong>Registration:</strong> <code>lh_idb_keyval_register_fallback()</code> registers the bundled copy only in that case.</li><li><strong>Registry:</strong> records each plugin using its own copy, with the version, in registration order. Only the first copy registers, as a script module ID can only be registered once.</li><li><strong>Site Health:</strong> one recommended test, added by whichever plugin loads the snippet first, lists those plugins and, when their versions differ, names the version every plugin is actually getting.</li><li><strong>Plugins screen:</strong> each such plugin&#8217;s row shows Using bundled idb-keyval x.y.z.</li><li><strong>Service workers:</strong> <code>lh_idb_keyval_get_umd_url()</code> returns the shared classic build when LH idb-keyval is active, otherwise the plugin&#8217;s own.</li></ul><p class=\"wp-block-paragraph\">No admin notices and no debug-log output.</p>"^^rdf:XMLLiteral ;
  sioc:content "Part of: LH idb-keyvalA consuming plugin bundles the library in assets/lib/idb-keyval/ (index.js, umd.js, LICENSE) and copies snippets/lh-idb-keyval-fallback.php verbatim to includes/lh-idb-keyval-fallback.php. Never edit the copy: change the canonical snippet, bump its snippet version and recopy it everywhere. There is no Requires Plugins header, so the consumer stays independent and releasable.What the snippet doesFallback check: lh_idb_keyval_use_fallback() is true when LH idb-keyval has not fired lh_idb_keyval_registered, so a plugin turned off by its init filter counts as inactive.Registration: lh_idb_keyval_register_fallback() registers the bundled copy only in that case.Registry: records each plugin using its own copy, with the version, in registration order. Only the first copy registers, as a script module ID can only be registered once.Site Health: one recommended test, added by whichever plugin loads the snippet first, lists those plugins and, when their versions differ, names the version every plugin is actually getting.Plugins screen: each such plugin&#8217;s row shows Using bundled idb-keyval x.y.z.Service workers: lh_idb_keyval_get_umd_url() returns the shared classic build when LH idb-keyval is active, otherwise the plugin&#8217;s own.No admin notices and no debug-log output." ;
  sioc:topic <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
