-
Notifications
You must be signed in to change notification settings - Fork 0
WordPress Plugin Developer Wiki
Start by cloning the repo and creating your own branch. Once this is done, you'll need to run npm install and bower install to download the necessary development dependencies. The current plugin uses SCSS for styling, gulp for task management, and bower to pull in certain packages such as Magnific Popup.
$ npm install && bower install
$ gulp
Once the packages have installed, you can run the gulp command to begin development:
$ gulp
This will begin the gulp watch
task that monitors PHP, SCSS, and JS files for changes and automatically rebuilds and minifies them.
Before you release the plugin, be sure to update the version number and changelog. You should update this in both flexmls_connect.php
and README.txt
.
Once you're ready to release the plugin, you can create a release package (in .zip format which will appear in the plugin folder) using gulp:
$ gulp build
Simply extract this and upload (SVN) this to WordPress for release.
The plugin's entry point for development is flexmls_connect.php
. This file serves as both the main plugin file as well as a table of contents for the rest of the plugin. The few functions that reside in this file's main class are "universal" functions (such as the activation function). Everything else in the plugin is namespaced.
This directory contains the various functions used to interface with the Spark API. The base class (found in Core.php
) contains all of the core logic needed to authenticate, reauthenticate, communicate with, cache results from, and clear results from the API. All api calls are made from various classes and functions that extend Core.php
.
This directory contains the various classes that run the plugin's main views, and is separated into three logical groups:
- Pages: This directory contains the files used to run the public-facing IDX pages, such as listing summaries and listing detail pages. The main
Page.php
is the entry point for these and contains logic common to both types. - Widgets: This directory contains the files used to manage and display widgets and shortcode results. The main
Widgets.php
is where widgets are registered and then calls the individual widget files. - Admin: This directory contains all other dashboard logic, and also a number of utility functions (such as converting price strings to numbers).
All SCSS and raw JS files are located here. This is where you'll make edits to the plugin's styling and scripts. While gulp
is running, these will be compiled, minified, and output to...
These are the minified and optimized plugin assets for production, and includes fonts, CSS, JS, and other image assets.
The plugin follows the WordPress convention for branch naming. If you are working on v4.0.0 of the plugin, the main development branch name should be 4.0.0-branch, and you should branch off of that. When it's ready for production, it should be merged into master and a Release should be created.