Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FunkyCommerce Headless Dependencies

FunkyCommerce Headless Dependencies is a free, standalone WordPress plugin that reports on the plugins the FunkyCommerce Headless theme relies on while its headless mode is enabled, and offers nonce-protected, one-click install/activate actions. It ships independently of the theme so the theme itself never has to bundle a plugin installer.

Features

  • Detects the FunkyCommerce Headless theme's "headless mode" master toggle defensively — by reading its existing option directly, never by calling theme code — and mirrors the theme's own default and filter
  • Stays completely dormant everywhere else: no admin menu, no reachable actions, and no external requests unless the theme is active with headless mode enabled
  • Lists every required and recommended headless dependency (WooCommerce, WPGraphQL, WooGraphQL, WPGraphQL Headless Login, Polylang, Yoast SEO, WPGraphQL SEO, Polylang for WooCommerce, the WooCommerce Stripe gateway, and Mailgun) with a live status: active, installed but inactive, not installed, or incompatible with this site's WordPress/PHP version
  • Uses WordPress's own Plugin API (get_plugins(), is_plugin_active(), plugins_api(), Plugin_Upgrader) to determine status and to perform installs/activations — never a private update mechanism
  • Only ever installs or activates a plugin when an admin explicitly clicks a capability-gated, nonce-protected button on this plugin's own page; nothing runs automatically or in the background
  • No settings, tracking, or build step

Requirements

  • WordPress 6.0 or newer
  • PHP 7.4 or newer

Installation

  1. Download funkycommerce-headless-dependencies-1.0.1.zip from the latest GitHub release.
  2. In WordPress, open Plugins > Add New > Upload Plugin.
  3. Select the ZIP, install it, and activate FunkyCommerce Headless Dependencies.
  4. If the FunkyCommerce Headless theme is active with headless mode enabled, open Plugins > Headless Dependencies to see status and actions.

You can also clone this repository into wp-content/plugins/funkycommerce-headless-dependencies.

How it works

On every admin_menu call this plugin checks, defensively, whether the active theme's stylesheet or template slug is funkycommerce-headless and whether that theme's funkycommerce_control_center option has its headless_mode field set to anything other than no (the same default the theme itself uses, and the same funkycommerce_is_headless_mode filter, so both stay in agreement without a hard code dependency). Only when both are true does the plugin register its Plugins > Headless Dependencies page; otherwise nothing is registered, and the plugin is dormant.

The status page classifies each dependency using WordPress's own plugin API:

  • Active — installed and activated
  • Installed, inactive — installed but not activated
  • Not installed — no matching plugin folder was found
  • Incompatible — the plugin's own declared minimum WordPress/PHP version is not met by this site (checked from the installed plugin's header, or, for plugins that are not yet installed but are available on WordPress.org, from cached WordPress.org metadata)

Only plugins distributed through the official WordPress.org directory ever get a one-click Install now button (using plugins_api() and Plugin_Upgrader, exactly like WordPress's own Add Plugins screen). Plugins distributed elsewhere (WooGraphQL, WPGraphQL Headless Login, Polylang for WooCommerce) only ever show status and a link to their own installation instructions. Every install and activate action requires the relevant WordPress capability (install_plugins/activate_plugins) and a nonce scoped to that specific plugin slug.

Development

The production source is maintained in the coded-letter-monorepo and released to this public repository. The plugin has no build step.

Validate PHP changes with:

php -l funkycommerce-headless-dependencies.php
php -l uninstall.php

License

FunkyCommerce Headless Dependencies is free software licensed under the GNU General Public License v2.0 or later.

About

Dependency status and secure install actions for the FunkyCommerce Headless WordPress theme

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages