Digital Sovereignty for everyone

Architecture notes

Identity methods

LH_Polls provides static identity/path methods: return_plugin_namespace() (lh_polls), return_plugin_text_domain() (lh-polls), return_plugin_name(), return_plugin_version(), return_plugin_file(), return_plugin_dir(), return_plugin_url(). No global constants defined.

Multisite

Tables are per-site via $wpdb->prefix. On network activation, tables are created for all existing sites (looping get_sites() + switch_to_blog()). New sites get tables via the wpmu_new_blog hook. lh_polls_db_version option is stored per-site.

File structure

lh-polls/
  lh-polls.php - bootstrap, requires + plugins_loaded instantiation
  includes/
    class-lh-polls.php - identity methods
    class-lh-polls-db.php - DB queries, table creation, caching
    class-lh-polls-post-types.php - CPT registration, meta-box wiring, shared save guard, delete cleanup, publish validation
    class-lh-polls-settings-metabox.php - Poll Settings metabox (render+save) and its meta registration
    class-lh-polls-options-metabox.php - Options metabox (render+save) and publish-validation helper
    class-lh-polls-votes-metabox.php - Votes metabox (render+save), required-voters section, delete-vote handler
    class-lh-polls-admin-notices.php - validation + unresolved-email admin notices
    class-lh-polls-comments.php - comment/vote sync, comment filtering
    class-lh-polls-embed.php - oEmbed response, embed document, the_content, shared render_poll_markup()
    class-lh-polls-voting.php - vote form handler, validation, redirects, cache purge
    class-lh-polls-block.php - block registration, oEmbed wrapper
    class-lh-polls-abilities.php - MCP abilities
    class-lh-polls-reminders.php - required-voter reminder emails
  blocks/lh-polls/
    editor.js / editor.css - block editor poll picker
    resize.js - parent-page postMessage iframe-resize listener
    poll.css / poll.js - embed/standalone poll view styles + behaviour

As of 1.0.11, metabox render/save logic previously in one class-lh-polls-post-types.php god class is split across four dedicated classes (Settings/Options/Votes metaboxes + Admin Notices) — see Changelog.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.