## Documentation

### Info

This is a copy of the [Teamleader WordPress](https://wordpress.org/plugins/teamleader-form-integration/) plugin that can be found on WordPress' plugin SVN [here](https://plugins.svn.wordpress.org/teamleader-form-integration/).

The login to our [WordPress](https://wordpress.org) account can be found in the Dev Vault in 1Password.

### teamleader-form-integration

The Teamleader CRM integration is a plugin to register leads or contacts directly from your Wordpress website or landing page to your Teamleader CRM account. The user friendly interface helps you to setup forms for capturing leads in no time - no coding skills required. Convert your website visitors into leads immediately and fill your sales funnel in Teamleader easily.

### How to contribute

#### SVN

WordPress uses SVN to provide versioning to Plugins, but development should be done on this Git repo. You only have to commit your changes to WP in the end.

#### Testing changes

The easiest way to test your changes is to manually apply those changes in the [Plugin Editor](http://meatdealer.be/wordpress/wp-admin/plugin-editor.php) under our own test WP website: [meatdealer.be](https://meatdealer.be).

To do so:
- Login to our test website [here](http://meatdealer.be/wordpress/wp-login.php) and login with the credentials found under `Wordpress Admin User` in our 2nd Line Support vault in 1Password.
- Navigate to `Tools` -> `Plugin File Editor`
- Select `Teamleader Form Integration` as plugin to edit.
- You can navigate the source files here, and manually make changes to the files there. Saving will reflect in these changes being applied for our own Meatdealer website.

### Adding changes to the actual codebase
- You should always develop under the `/trunk` directory, this is the latest code and is not necessarily stable.
- When you're finished, create a new version directory under the `/tags` directory. At TL, we follow Semantic Versioning. E.g: ./tags/2.1.0/
- copy all working code from the `/trunk` dir to the new version dir under `/tags`
- Update the stable tag in the root `readme.txt`, and also in the `/trunk/readme.txt`
- Update the version code in the `plugin.php` file's CodeDoc.
- Add a description of your changes in the `changelog` section of the `readme.txt`'s

#### Committing changes

When you've tested your changes and want to create a new release on Wordpress, you'll need to create a new release under the tags dir (as you should have from the previous steps) and push it to the WP [SVN](https://plugins.svn.wordpress.org/teamleader-form-integration/).

- First, make sure your changes are reflected on this Git repo, to keep it consistent, then:
- Install Subversion via [Homebrew](https://formulae.brew.sh/formula/subversion):

```
brew install subversion
```

- You'll need to tell the current folder it's also under SVN:

```
svn co https://plugins.svn.wordpress.org/teamleader-form-integration/
```

- Optional: if you added or removed files you need to tell SVN:

```
svn add path/to/file
svn delete path/to/file
```

- push your changes to the SVN repo

```
svn ci -m "COMMIT MESSAGE"
```

- You'll need to authenticate to be able to push to the repo, and you can do that with the credentials found under `WordPress.org` in the Dev Team vault in 1Password.

You should be able to see your changes on the WP SVN immediately, but they have a build step before it's available as a plugin update to clients. So give it some time (They say: up to 6 hours, for me it was more like 5 min).

** Keep in mind: when you commit to the WP svn under a new tag and mark that one as the stable tag, clients will get a message that an update is available **

#### Handy links
- [How to use SVN](https://developer.wordpress.org/plugins/wordpress-org/how-to-use-subversion)
- [Version not updating on WP](https://www.itsupportguides.com/knowledge-base/wordpress/version-number-not-updating-in-wordpress-plugin-directory/)
