This Local by Flywheel add-on allows you to publish and update 3D plugins for WordPress that extend the "XR Publisher" plugin. It integrates with the app.xr.foundation platform for plugin distribution.
Clone the repository into the following directory depending on your platform:
- macOS: ~/Library/Application Support/Local/addons
- Windows: C:\Users\username\AppData\Roaming\Local\addons
- Debian Linux: ~/.config/Local/addons
You can replace 'Local' with 'Local Beta' if you want to create the add-on for Local Beta.
yarn install
- Clone repo directly into the add-ons folder (paths described above)
yarn
(install dependencies)yarn build
- Open Local and enable add-on
- Plugin Name: The name of your plugin's directory in the WordPress plugins folder.
- Zip File Path: Relative path to your plugin's zip file within the plugin directory.
- JSON File Path: Relative path to your plugin's metadata JSON file within the plugin directory.
The addon looks for your files in the Local by Flywheel site structure:
~/Local Sites/[Plugin Name]/app/public/wp-content/plugins/[Plugin Name]/
- Enter your plugin name and file paths in the input fields.
- Click "Validate JSON" to ensure your metadata file is correct.
- If validation is successful, click "Upload Plugin" to start the publishing process.
- The addon will provide you with URLs for the uploaded zip file and metadata.
- @getflywheel/local provides type definitions for Local's Add-on API.
- @getflywheel/local-components provides reusable React components for your Local add-on.
All files in /src will be transpiled to /lib using TypeScript. Anything in /lib will be overwritten.
Consult the Local add-on API for a wide range of values and functions for developing your add-on.
To enable automatic updates for your plugin:
- Copy the XR_Publisher_Updater class into your plugin's directory.
- In your plugin's main file, include and initialize the updater:
require_once plugin_dir_path(FILE) . 'XR_Publisher_Updater.php';
$updater = new xrPublisher\XR_Publisher_Updater( 'your-plugin-slug', plugin_basename(FILE), '1.0.0', // Your plugin's current version 'https://example.com/your-plugin-metadata.json', // Metadata URL 'https://example.com/your-plugin.zip' // Zip file URL );
Replace the placeholder values with your plugin's actual information and the URLs provided by the Plugin Publisher addon after uploading your plugin.
MIT