-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e1c0970
Showing
49 changed files
with
2,370 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.wordpress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @omnisend/integrations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: PHP Standards | ||
run-name: PHP Standards 🔀 ${{ github.ref_name }} | ||
|
||
on: push | ||
|
||
jobs: | ||
Lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer install --prefer-dist --no-progress | ||
- name: Lint PHP files | ||
run: ./lint.sh check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Release plugin | ||
|
||
on: [workflow_dispatch] | ||
jobs: | ||
svn: | ||
name: Release new tag | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@main | ||
- name: WordPress Plugin Deploy | ||
uses: omnisend/[email protected] | ||
env: | ||
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | ||
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | ||
SLUG: omnisend-for-contact-form-7 | ||
BUILD_DIR: omnisend-for-contact-form-7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
woocommerce-omnisend/.vscode/* | ||
.vscode/* | ||
.idea/* | ||
.svn | ||
|
||
# These are needed when repo is checked out at the location of working WordPress site | ||
.DS_Store | ||
akismet/ | ||
hello.php | ||
index.php | ||
klaviyo | ||
mailchimp-for-woocommerce | ||
woocommerce | ||
wp-crontrol | ||
code-snippets | ||
|
||
# Composer | ||
composer.phar | ||
/vendor/ | ||
# Local wordpress setup | ||
.wordpress | ||
.env | ||
|
||
*.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="Custom Standard" namespace="Omnisend\CS\Standard"> | ||
<rule ref="WordPress"> | ||
<exclude-pattern>*.js</exclude-pattern> | ||
|
||
<exclude name="Generic.Commenting.DocComment" /> | ||
<exclude name="Squiz.Commenting.ClassComment" /> | ||
<exclude name="Squiz.Commenting.FunctionComment" /> | ||
<exclude name="Squiz.Commenting.VariableComment" /> | ||
<exclude name="Squiz.Commenting.BlockComment" /> | ||
<exclude name="Universal.Operators.StrictComparisons" /> | ||
<exclude name="Universal.Files.SeparateFunctionsFromOO" /> | ||
<exclude name="WordPress.PHP.YodaConditions" /> | ||
<exclude name="WordPress.PHP.StrictInArray" /> | ||
</rule> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tabWidth: 4 | ||
printWidth: 140 | ||
singleQuote: true | ||
trailingComma: none | ||
bracketSpacing: true |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# wp-omnisend-contact-form-7 | ||
|
||
Plugin for _Contact Form 7_ WordPress plugin. More information can be found [here](https://wordpress.com/plugins/contact-form-7). | ||
|
||
https://contactform7.com/2020/07/28/accessing-user-input-data/ | ||
|
||
## Key class | ||
|
||
- `WPCF7_Service` - integration should implement class and be added to `WPCF7_Integration` with `add_service` to be displayed in integration list | ||
|
||
## Contact form 7 actions | ||
|
||
- `wpcf7_init` Plugin initiated. Register Omnisend service. | ||
- `wpcf7_submit` Website user submitted form. Check and send contact to Omnisend. | ||
- `wpcf7_save_contact_form` Admin user saved/modified form - save Omnisend related data to form. | ||
|
||
## Contact form 7 filters | ||
|
||
- `wpcf7_editor_panels` Add Omnisend configuration [panel](img/panel.png) for selected form. | ||
- `wpcf7_pre_construct_contact_form_properties` Constructs contact form properties. This is called only once from the constructor. | ||
|
||
## PHP Linting | ||
|
||
WordPress.org team mandates our plugin to be linted | ||
against [WordPress coding standards](https://github.com/WordPress/WordPress-Coding-Standards). | ||
|
||
After each push to any branch `PHP Standards` action will run and all the PHP code will be linted. See action output for results. | ||
|
||
### Linting locally | ||
|
||
Tools needed: | ||
|
||
- php (7.4 version is recommended because at the time of writing WordPress coding standards supports only up to 7.4 version); | ||
- composer (can be installed as described in https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos); | ||
|
||
After installing those tools one can run in local plugin dir (omnisend-for-contact-form-7) helper script: | ||
|
||
```shell | ||
./lint.sh check | ||
./lint.sh fix | ||
``` | ||
|
||
or all commands manually. Following commands | ||
|
||
```shell | ||
composer update | ||
composer install | ||
``` | ||
|
||
install linting tool and standards. And then actual linting `phpcs` script can be initiated with | ||
|
||
```shell | ||
./vendor/squizlabs/php_codesniffer/bin/phpcs --ignore=.js --standard=WordPress omnisend-connect | ||
``` | ||
|
||
A second `phpcbf` script can be run to automatically correct coding standard violations: | ||
|
||
```shell | ||
./vendor/squizlabs/php_codesniffer/bin/phpcbf --ignore=.js --standard=WordPress omnisend-connect | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "omnisend/contact-form-7-addon", | ||
"description": "Omnisend for Contact Form 7 Plugin", | ||
"license": "proprietary", | ||
"config": { | ||
"allow-plugins": { | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
}, | ||
"require-dev": { | ||
"php": ">=7.1.0", | ||
"wp-coding-standards/wpcs": "^3.0", | ||
"squizlabs/php_codesniffer": "^3.7.1", | ||
"dealerdirect/phpcodesniffer-composer-installer": "^1.0" | ||
} | ||
} |
Oops, something went wrong.