This page has been generated using AI and has not been validated. Expect inaccuracies until we remove this banner.


title: Troy Embed 𒄬 Deploy Troy description: Troy Embed is a PHP snippet you add to your WordPress plugin. It automatically installs and activates Troy Client on admin pages when it's missing. docstitle: Embed Snippet docsdescription: Under 1KB of code for silent Troy Client installation. validated: true

Troy Embed

Troy Embed is a code snippet you paste into your plugin. On WordPress admin pages, it silently installs and activates Troy Client if missing.

Note:

Consider using Packages instead. If you distribute via a Troy Package, Troy Client is included automatically. Troy Embed is for specific situations where Packages aren't an option.

Not for WordPress.org Plugins:

Do not use Troy Embed with plugins hosted on WordPress.org. WordPress.org guidelines prohibit plugins from installing other plugins without explicit user consent. Violating this will get your plugin removed.

If your plugin is on WordPress.org, distribute Troy Client separately via a Troy Package.

The Snippet

Get the latest version from GitHub:

→ troy-embed/snippet.php

Include it in your plugin, or paste the code directly into your main plugin file.

How Troy Embed Works

  1. On any WordPress admin page, the snippet checks whether Troy Client is active.
  2. If not, it downloads and installs Troy Client from Deploy Troy's server.
  3. It then activates the plugin silently — no admin notices, no redirect.

The snippet is about 40 lines — under 1KB added to your plugin.

When to Use Troy Embed

  • You distribute plugins only through your own website (not WordPress.org).
  • You sell through marketplaces like CodeCanyon that allow bundled dependencies.
  • You want zero installation friction for self-distributed plugins.

When Not to Use Troy Embed

  • You distribute through WordPress.org — their guidelines prohibit it (see warning above).
  • You control distribution end to end — use Packages instead, they're cleaner for everyone.
  • You need to install multiple plugins or want progress feedback — use Troy Installer instead.

Source Code and License

The snippet is MIT licensed. Copy it, modify it, ship it.

→ View on GitHub