Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabiermi committed Jan 16, 2024
0 parents commit e1c0970
Show file tree
Hide file tree
Showing 49 changed files with 2,370 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.wordpress
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @omnisend/integrations
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
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
16 changes: 16 additions & 0 deletions .github/workflows/release-plugin.yml
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
24 changes: 24 additions & 0 deletions .gitignore
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
16 changes: 16 additions & 0 deletions .phpcs.xml
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>
5 changes: 5 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tabWidth: 4
printWidth: 140
singleQuote: true
trailingComma: none
bracketSpacing: true
Binary file added .wordpress-org/1-contact-form-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/2-contact-form-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/3-contact-form-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/banner-1544x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/banner-772x250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/icon-256x256.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .wordpress-org/screenshot-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 60 additions & 0 deletions README.md
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
```
16 changes: 16 additions & 0 deletions composer.json
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"
}
}
Loading

0 comments on commit e1c0970

Please sign in to comment.