diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ae8d6d..0bf3e46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ + ### v1.2.2 - 2017-05-08 + **Changes:** + - Update version + ### v1.2.1 - 2017-05-08 **Changes:** - Update version diff --git a/artifact/pirate-forms.zip b/artifact/pirate-forms.zip index 509447b..4c6d8b1 100644 Binary files a/artifact/pirate-forms.zip and b/artifact/pirate-forms.zip differ diff --git a/dist/CHANGELOG.md b/dist/CHANGELOG.md index 5ae8d6d..0bf3e46 100644 --- a/dist/CHANGELOG.md +++ b/dist/CHANGELOG.md @@ -1,4 +1,8 @@ + ### v1.2.2 - 2017-05-08 + **Changes:** + - Update version + ### v1.2.1 - 2017-05-08 **Changes:** - Update version diff --git a/dist/artifact/pirate-forms.zip b/dist/artifact/pirate-forms.zip new file mode 100644 index 0000000..509447b Binary files /dev/null and b/dist/artifact/pirate-forms.zip differ diff --git a/dist/css/front.css b/dist/css/front.css index 82e55e5..b955e58 100644 --- a/dist/css/front.css +++ b/dist/css/front.css @@ -1,5 +1,5 @@ /* -Version: 1.2.1 +Version: 1.2.2 */ .pirate_forms_wrap .form_field_wrap { margin-bottom: 20px; diff --git a/dist/dist/CHANGELOG.md b/dist/dist/CHANGELOG.md new file mode 100644 index 0000000..0bf3e46 --- /dev/null +++ b/dist/dist/CHANGELOG.md @@ -0,0 +1,80 @@ + + ### v1.2.2 - 2017-05-08 + **Changes:** + - Update version + + ### v1.2.1 - 2017-05-08 + **Changes:** + - Update version + + ### 1.2.0 - 06/04/2017 + **Changes:** + - Update readme.txt + + ### 1.2.0 - 06/04/2017 + **Changes:** + - Improved description + + ### 1.2.0 - 19/01/2017 + **Changes:** + - Fixed security error for file field. + - Added dashboard widget. + + ### 1.1.3 - 11/01/2017 + **Changes:** + - Update readme.txt + + ### 1.1.3 - 20/12/2016 + **Changes:** + - Sync with wp.org + + ### 1.1.2 - 20/12/2016 + **Changes:** + - Added upsell for custom emails plugin + - Fixed text domains errors + - Added travis and grunt + + ### 1.1.1 - 19/12/2016 + **Changes:** + - Update changelog + + ### 1.1.0 - 19/12/2016 + **Changes:** + - Escape form fields + + ### 1.0.18 - 07/11/2016 + **Changes:** + - Fixed php strict standards error + - Update tags + - Tested up to WordPress 4.6 + + ### 1.0.17 - 25/07/2016 + **Changes:** + - Development + + ### 1.0.16 - 13/07/2016 + **Changes:** + - Fixed IP issue when using web server behind a reverse proxy + - Fixed W3C compatibility issues + - Remove pcf=1#contact from url when theme is different then Zerif + - Removed blacklist option and made it default set to true + - Display site key and secret key fields only if recaptcha option is selected + - New attachment option + - New thank you URL option + - New option to make the nonce optional + + ### 1.0.16 - 20/06/2016 + **Changes:** + - #89 textarea field not saving + + ### 1.0.15 - 10/06/2016 + **Changes:** + - Update screenshots + - Added a clearfix after the Pirate Forms widget to avoid messed layout + - Update compatible WordPress version number + + ### 1.0.14 - 23/05/2016 + **Changes:** + - Reorganize backend content + - Fixed issue with checkbox not saving + ### 1.0.13 - 12/05/2016 Changes: pirate-forms Update readme.txt ### 1.0.13 - 05/05/2016 Changes: pirate-forms Update readme.txt pirate-forms Merge pull request #63 from mariusghitulescu/patch-1 Update readme.txt pirate-forms Update readme.txt pirate-forms Update readme.txt ### 1.0.13 - 01/04/2016 Changes: pirate-forms fix issue with multiple forms on same page fix for https://github.com/Codeinwp/pirate-forms/issues/59 pirate-forms Merge pull request #60 from selu91/development fix issue with multiple forms on same page ### 1.0.12 - 21/03/2016 Changes: pirate-forms Option to change recaptcha language ### 1.0.11 - 14/03/2016 Changes: pirate-forms Fixed #55 Recaptcha too down ### 1.0.9 - 10/03/2016 Changes: pirate-forms Fixed layout issues #52 pirate-forms Update readme.txt with == Changelog == section #51 ### 1.0.8 - 09/03/2016 Changes: pirate-forms Update readme.txt pirate-forms Update translations files pirate-forms #42, translation issues fixed diff --git a/dist/dist/bin/deploy.sh b/dist/dist/bin/deploy.sh new file mode 100644 index 0000000..2df91cd --- /dev/null +++ b/dist/dist/bin/deploy.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +# We run this just one time, for a first job from the buid and just at once after_deploy hook. +if ! [ $AFTER_DEPLOY_RUN ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then + + # Flag the run in order to not be trigged again on the next after_deploy. + export AFTER_DEPLOY_RUN=1; + echo " Started deploy script. "; + + # Setup git username and email. + + git config user.name "selul" + git config user.email ${GITHUB_EMAIL} + git fetch + + # Check if we already have a tag with this version. + if ! git rev-parse "v$THEMEISLE_VERSION" >/dev/null 2>&1 + then + + # Send changelog changes to git. + git checkout $MASTER_BRANCH + git add -v . + + # We use [skip ci] in message to prevent this commit to trigger the build. + git commit -a -m "[AUTO][skip ci] Updating changelog for v"$THEMEISLE_VERSION + git push --quiet "https://${GITHUB_TOKEN}@github.com/$UPSTREAM_REPO.git" HEAD:$MASTER_BRANCH + + # Tag the new release. + git tag -a "v$THEMEISLE_VERSION" -m "[AUTO] Release of $THEMEISLE_VERSION "; + git push --quiet "https://${GITHUB_TOKEN}@github.com/$UPSTREAM_REPO.git" --tags ; + sleep 5; + + # Sends the api call for creating the release. + # We use this as the travis release provider does not offer any way + # to set the body of the release. + API_JSON='{"tag_name": "v'$THEMEISLE_VERSION'","target_commitish": "'$MASTER_BRANCH'","name": "v'$THEMEISLE_VERSION'","body": "'$CHANGES'","draft": false,"prerelease": false}'; + curl -s --data "$API_JSON" "https://api.github.com/repos/$UPSTREAM_REPO/releases?access_token="$GITHUB_TOKEN > /dev/null; + fi + # Send update to the store + STORE_JSON='{"version": "'$THEMEISLE_VERSION'","id": "'$THEMEISLE_ID'","body": "'$CHANGES'"}'; + curl -s -H "Content-Type: application/json" -H "x-themeisle-auth: $THEMEISLE_AUTH" --data "$STORE_JSON" "$STORE_URL/wp-json/ti-endpoint/v1/update_changelog_new/" > /dev/null + + # Send data to demo server. + grunt sftp + + # Upload to Wordpress SVN + if [ ! -z "$WPORG_PASS" ]; then + + svn co -q "http://svn.wp-plugins.org/$THEMEISLE_REPO" svn + + # Copy new content to svn trunk. + rsync -r -p --delete --exclude=".*" dist/* svn/trunk + + # Create new SVN tag. + mkdir -p svn/tags/$THEMEISLE_VERSION + rsync -r -p dist/* svn/tags/$THEMEISLE_VERSION + # Add new files to SVN + svn stat svn | grep '^?' | awk '{print $2}' | xargs -I x svn add x@ + # Remove deleted files from SVN + svn stat svn | grep '^!' | awk '{print $2}' | xargs -I x svn rm --force x@ + + svn stat svn + + # Commit to SVN + svn commit svn --no-auth-cache -m "Release v$THEMEISLE_VERSION" --username $WPORG_USER --password $WPORG_PASS + # Remove svn dir. + rm -fR svn + + fi + +fi; diff --git a/dist/dist/bin/install-dependencies.sh b/dist/dist/bin/install-dependencies.sh new file mode 100644 index 0000000..0e9608b --- /dev/null +++ b/dist/dist/bin/install-dependencies.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# We run this on PR or on push to MASTER_BRANCH. +if [ "$TRAVIS_PULL_REQUEST" != "false" ] || ( [ "$TRAVIS_EVENT_TYPE" == "push" ] && [ "$TRAVIS_REPO_SLUG" == "$UPSTREAM_REPO" ] && [ "$TRAVIS_BRANCH" == "$MASTER_BRANCH" ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ] ) ; then + + . $HOME/.nvm/nvm.sh + nvm install stable + nvm use stable + + npm install + npm install grunt-cli -g + + phpenv local 5.6 + + composer selfupdate 1.0.0 --no-interaction + composer install --no-interaction + phpenv local --unset + +fi; +# We dont install PHPCS if is not a PR. +if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then + + # Install PHPCS. + pear install pear/PHP_CodeSniffer-2.8.1 + + # Install WPCS standards. + git clone -b master --depth 1 https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git $HOME/wordpress-coding-standards + phpenv rehash + phpcs --config-set installed_paths $HOME/wordpress-coding-standards + phpenv rehash + + # Install wordpress for testing. + bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION + export PATH="$HOME/.composer/vendor/bin:$PATH" + + # Use phpunit 5.7 as WP dont support 6. + if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then + composer global require "phpunit/phpunit=5.7.*" ; + fi; +fi; \ No newline at end of file diff --git a/dist/dist/bin/install-wp-tests.sh b/dist/dist/bin/install-wp-tests.sh new file mode 100644 index 0000000..aa2e239 --- /dev/null +++ b/dist/dist/bin/install-wp-tests.sh @@ -0,0 +1,127 @@ +#!/usr/bin/env bash + + +if [ $# -lt 3 ]; then + echo "usage: $0 [db-host] [wp-version] [force download]" + exit 1 +fi + +DB_NAME=$1 +DB_USER=$2 +DB_PASS=$3 +DB_HOST=${4-localhost} +WP_VERSION=${5-latest} +FORCE=${6-false} + +WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib} +WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/} + +download() { + if [ `which curl` ]; then + curl -s "$1" > "$2"; + elif [ `which wget` ]; then + wget -nv -O "$2" "$1" + fi +} + +if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then + WP_TESTS_TAG="tags/$WP_VERSION" +else + # http serves a single offer, whereas https serves multiple. we only want one + download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json + grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json + LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') + if [[ -z "$LATEST_VERSION" ]]; then + echo "Latest WordPress version could not be found" + exit 1 + fi + WP_TESTS_TAG="tags/$LATEST_VERSION" +fi + +if [[ $WP_TESTS_TAG == *"beta"* ]] +then + WP_TESTS_TAG="trunk" +fi + +set -ex + +install_wp() { + if [ $FORCE == 'true' ]; then + rm -Rf $WP_CORE_DIR + fi + + if [ -d $WP_CORE_DIR ]; then + return; + fi + + mkdir -p $WP_CORE_DIR + + if [ $WP_VERSION == 'latest' ]; then + local ARCHIVE_NAME='latest' + else + local ARCHIVE_NAME="wordpress-$WP_VERSION" + fi + + download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz + tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR + + download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php +} + +install_test_suite() { + if [ $FORCE == 'true' ]; then + rm -Rf $WP_TESTS_DIR + fi + + # portable in-place argument for both GNU sed and Mac OSX sed + if [[ $(uname -s) == 'Darwin' ]]; then + local ioption='-i .bak' + else + local ioption='-i' + fi + + # set up testing suite if it doesn't yet exist + if [ ! -d $WP_TESTS_DIR ]; then + # set up testing suite + mkdir -p $WP_TESTS_DIR + svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes + svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data + fi + + cd $WP_TESTS_DIR + + if [ ! -f wp-tests-config.php ]; then + download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php + sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php + fi + +} + +install_db() { + # parse DB_HOST for port or socket references + local PARTS=(${DB_HOST//\:/ }) + local DB_HOSTNAME=${PARTS[0]}; + local DB_SOCK_OR_PORT=${PARTS[1]}; + local EXTRA="" + + if ! [ -z $DB_HOSTNAME ] ; then + if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then + EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" + elif ! [ -z $DB_SOCK_OR_PORT ] ; then + EXTRA=" --socket=$DB_SOCK_OR_PORT" + elif ! [ -z $DB_HOSTNAME ] ; then + EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" + fi + fi + + # create database + mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA +} + +install_wp +install_test_suite +install_db \ No newline at end of file diff --git a/dist/dist/bin/prepare-deploy.sh b/dist/dist/bin/prepare-deploy.sh new file mode 100644 index 0000000..4e50635 --- /dev/null +++ b/dist/dist/bin/prepare-deploy.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +#We make sure we run this just at one before_deploy hook. +if ! [ $BEFORE_DEPLOY_RUN ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then + + echo " Preparing deploy. "; + + # Flag the run. + export BEFORE_DEPLOY_RUN=1; + + # Parse the name of the repo. + export THEMEISLE_REPO=$(node -pe "require('./package.json').name") + + # Parse the version of the product. + + export THEMEISLE_VERSION=$(node -pe "require('./package.json').version") + + # Parse product category. + export THEMEISLE_CATEGORY=$(node -pe "require('./package.json').category") + + export DEMO_THEMEISLE_PATH="/sites/demo.themeisle.com/wp-content/$THEMEISLE_CATEGORY/$THEMEISLE_REPO"; + + # Build changelog based on commit message description. + CHANGELOG="\n ### v$THEMEISLE_VERSION - "$(date +'%Y-%m-%d')" \n **Changes:** \n"; + + # Remove first line from the commit as is it used as commit title. + NORMALIZED_MESSAGE=$(sed "1d" <<< "$TRAVIS_COMMIT_MESSAGE"); + + # Save changes list in a sepparately variable as we use it in the release body. + export CHANGES=""; + while read -r line; do + if ! [ -z $line ]; then + line=$(echo "${line//[$'\r\n']}"); + export CHANGES=$CHANGES'- '$line'\n'; + fi; + done <<< "$NORMALIZED_MESSAGE" + + # Concat changes and changelog title and prepend to the changelog file. + + CHANGELOG="$CHANGELOG $CHANGES"; + echo -e "$CHANGELOG $(cat CHANGELOG.md)" > CHANGELOG.md + + # Run the prepare deployment action + + grunt deploy +fi; \ No newline at end of file diff --git a/dist/dist/css/front.css b/dist/dist/css/front.css new file mode 100644 index 0000000..b955e58 --- /dev/null +++ b/dist/dist/css/front.css @@ -0,0 +1,49 @@ +/* +Version: 1.2.2 + */ +.pirate_forms_wrap .form_field_wrap { + margin-bottom: 20px; +} + +.pirate-forms-g-recaptcha { + display: none; +} + +.pirate_forms_wrap { + float: left; + width: 100%; +} + +.sidebar .pirate_forms_wrap, +.sidebar-wrap .pirate_forms_wrap, +#sidebar-secondary .pirate_forms_wrap { + margin-bottom: 20px; +} + +.sidebar .form_field_wrap, +.sidebar-wrap .form_field_wrap, +#sidebar-secondary .form_field_wrap { + width: 100%; +} + +.sidebar .pirate-forms-submit-button, +.sidebar-wrap .pirate-forms-submit-button, +#sidebar-secondary .pirate-forms-submit-button { + float: left !important; + width: 100%; + margin-left: 0; +} + +.sidebar .pirate_forms_wrap label, +.sidebar-wrap .pirate_forms_wrap label, +#sidebar-secondary .pirate_forms_wrap label { + display: none; +} + +.pirate_forms_clearfix { + clear: both; +} + +.contact_submit_wrap { + text-align: right; +} diff --git a/dist/dist/css/wp-admin.css b/dist/dist/css/wp-admin.css new file mode 100644 index 0000000..45da32d --- /dev/null +++ b/dist/dist/css/wp-admin.css @@ -0,0 +1,278 @@ +.pirate-forms-nav-tabs a { + -webkit-box-shadow: none !important; + box-shadow: none !important; +} + +.pirate-forms-postbox { + margin-top: 20px; + padding: 10px 20px; + background: #fff; +} + +.pirate-forms-nav-tabs { + margin-bottom: 0; +} + +.pirate-forms-nav-tabs:after { + display: table; + clear: both; + content: " "; +} + +.pirate-forms-nav-tabs > li { + display: block; + float: left; + margin-bottom: -1px; +} + +.pirate-forms-nav-tabs > li > a { + display: block; + padding: 10px 15px; + border: 1px solid transparent; + border-radius: 4px 4px 0 0; + text-decoration: none; +} + +.pirate-forms-nav-tabs > li.active > a, +.pirate-forms-nav-tabs > li.active > a:focus, +.pirate-forms-nav-tabs > li.active > a:hover { + border: 1px solid #ddd; + border-bottom-color: transparent; + color: #555; + background-color: #fff; + font-weight: bold; +} + +.pirate-forms-nav-tabs > li.zerif-lite-w-red-tab > a { + color: red; + font-weight: bold; +} + +.pirate-forms-tab-content { + float: left; + width: 860px; + border-right: 1px solid #ddd; + border-bottom: 1px solid #ddd; + border-left: 1px solid #ddd; + background-color: #fff; +} + +.pirate-forms-tab-content > .tab-pane { + display: none; +} + +.pirate-forms-tab-content > .active { + display: block; +} + +.pirate-forms-tab-pane { + display: none; + padding: 30px; +} + +.pirate-forms-tab-pane.active { + display: block; +} + +.pirate-forms-grouped { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + margin-bottom: 20px; + + -webkit-align-items: center; + align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; +} + +.pirate-forms-grouped label { + display: inline-block; + width: 260px; + margin: 0 1em 0 0; + color: #333; + font-size: 15px; + font-weight: bold; +} + +.pirate-forms-grouped label .pirate_forms_option_description { + font-size: 11px; + font-weight: normal; +} + +.pirate-forms-grouped select, +.pirate-forms-grouped input[type="text"] { + display: inline-block; +} + +.pirate-forms-grouped input[type="text"] { + width: 30%; +} + +.pirate-options { + display: inline-block; +} + +.pirate-subscribe.postbox { + display: inline-block; + width: 90%; + margin: auto; + vertical-align: top; +} + +.wrap { + margin-right: 0; +} + +#\31 > form > div > label > span.dashicons { + margin-left: 10px; + color: #888; +} + +#\31 > form > div > label > span.dashicons:after { + display: none; + position: absolute; + margin-left: 5px; + border-right: 5px solid transparent; + border-bottom: 5px solid black; + border-left: 5px solid transparent; + content: ""; +} + +#\31 > form > div > label > .pirate_forms_option_description { + display: none; + position: absolute; + z-index: 999; + width: 200px; + margin-top: 4px; + margin-left: 190px; + padding: 15px; + border-radius: 5px; + color: #fff; + background: rgba(0,0,0,0.8); + font-size: 11px; + line-height: 16px; + text-align: left; +} + +#\31 > form > div > label > span.dashicons:hover + .pirate_forms_option_description, +#\31 > form > div > label > span.dashicons:hover::after { + display: block; +} + +#\31 > form > div > label { + width: 400px; + font-weight: normal; +} + +.pirate_forms_contact_settings h3.title, +.pirate_forms_welcome_text { + margin: 10px 0 30px; + color: #555; + font-size: 23px; + text-align: center; +} + +.pirate-forms-tab-pane hr { + margin-bottom: 30px; +} + +.pirate-forms-tab-pane ol { + margin: 20px 0 20px 50px; + list-style: inherit; +} + +.pirate_forms_subheading { + color: #333; + font-size: 14px; + text-align: center; +} + +.rate_plugin_invite { + text-align: center; +} + +.rate_plugin_invite .dashicons { + width: auto; + color: #0073aa; + font-size: 12px; +} + +.pirate_forms_preview { + display: inherit; + margin: 0 auto 10px; +} + +@media( max-width: 1360px) { + .pirate-subscribe.postbox { + display: block; + margin-top: 40px; + margin-left: 0; + } +} + +.ajaxAnimation { + display: none; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: url("../img/loader.gif") no-repeat center center, rgba(255,255,255,0.8); +} + +.pirate-forms-hidden { + display: none !important; +} + +#pirate-forms-main { + float: left; +} + +#pirate-forms-sidebar { + float: left; + width: 300px; + margin-top: 94px; + margin-left: 50px; +} + +.pirate-custom-emails a:hover { + -webkit-box-shadow: none; + box-shadow: none; + -webkit-transform: translateY(4px); + -ms-transform: translateY(4px); + transform: translateY(4px); +} + +.pirate-custom-emails a { + display: inline-block; + margin-top: 10px; + padding: 9px; + border-radius: 3px; + color: #fff; + background: #ff7f65; + -webkit-box-shadow: 0 4px 0 #da6f5a; + box-shadow: 0 4px 0 #da6f5a; + font-size: 12px; + font-weight: 700; + text-decoration: none; + text-transform: uppercase; + cursor: pointer; + -webkit-transition: ease 0.25s; + transition: ease 0.25s; +} + +.pirate-custom-emails { + width: 90%; + margin: auto; + margin-top: 10px; + border-color: #fdbda9; +} + +@media screen and (max-width: 780px) { + #pirate-forms-sidebar { + width: 100%; + margin: 4px; + } +} diff --git a/dist/dist/dashboard/dashboard.php b/dist/dist/dashboard/dashboard.php new file mode 100644 index 0000000..78636f4 --- /dev/null +++ b/dist/dist/dashboard/dashboard.php @@ -0,0 +1,235 @@ +setup_vars(); + self::$instance->load_hooks(); + } + + return self::$instance; + } + + /** + * Load hooks to show the widget + */ + public function load_hooks() { + add_action( 'wp_dashboard_setup', array( &$this, 'add_widget' ) ); + add_action( 'wp_network_dashboard_setup', array( &$this, 'add_widget' ) ); + } + + /** + * Setup class variables + */ + public function setup_vars() { + $this->dashboard_name = apply_filters( 'themeisle_sdk_dashboard_widget_name', 'WordPress Guides/Tutorials' ); + $this->feeds = apply_filters( 'themeisle_sdk_dashboard_widget_feeds', array( + 'https://themeisle.com/blog/feed' + ) ); + $abs = untrailingslashit( ( dirname( __FILE__ ) ) ); + $parts = str_replace( untrailingslashit( ABSPATH ), '', $abs ); + $parts = explode( DIRECTORY_SEPARATOR, $parts ); + $parts = array_filter( $parts ); + $this->script_url = site_url() . '/' . implode( '/', $parts ); + } + + /** + * Add widget to the dashboard + * + * @return string|void + */ + function add_widget() { + global $wp_meta_boxes; + if ( isset( $wp_meta_boxes['dashboard']['normal']['core']['themeisle'] ) ) { + return; + } + // Load SimplePie Instance + $feed = fetch_feed( $this->feeds ); + // TODO report error when is an error loading the feed + if ( is_wp_error( $feed ) ) { + return ''; + } + $feed->enable_cache( true ); + $feed->enable_order_by_date( true ); + $feed->set_cache_class( 'WP_Feed_Cache' ); + $feed->set_file_class( 'WP_SimplePie_File' ); + $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 7200, $this->feeds ) ); + do_action_ref_array( 'wp_feed_options', array( $feed, $this->feeds ) ); + $feed->strip_comments( true ); + $feed->strip_htmltags( array( + 'base', + 'blink', + 'body', + 'doctype', + 'embed', + 'font', + 'form', + 'frame', + 'frameset', + 'html', + 'iframe', + 'input', + 'marquee', + 'meta', + 'noscript', + 'object', + 'param', + 'script', + 'style', + ) ); + $feed->init(); + $feed->handle_content_type(); + $items = $feed->get_items( 0, 5 ); + foreach ( (array) $items as $item ) { + $this->items[] = array( + 'title' => $item->get_title(), + 'date' => $item->get_date( 'U' ), + 'link' => $item->get_permalink(), + ); + } + wp_add_dashboard_widget( 'themeisle', $this->dashboard_name, array( + &$this, + 'render_dashboard_widget', + ) ); + } + + /** + * Render widget content + */ + function render_dashboard_widget() { + ?> + +
    + items as $item ) { + ?> +
  • +
    +
  • + +
+ + $action, + 'method' => 'post', + 'enctype' => $pirate_forms_enctype, + 'class' => array(), + 'id' => '', + 'markup' => 'html', + 'novalidate' => false, + 'add_nonce' => false, + 'add_honeypot' => true, + 'form_element' => true, + 'add_submit' => true, + ); + + // Merge with arguments, if present + if ( $args ) { + $settings = array_merge( $defaults, $args ); + } // Otherwise, use the defaults wholesale + else { + $settings = $defaults; + } + + // Iterate through and save each option + foreach ( $settings as $key => $val ) { + // Try setting with user-passed setting + // If not, try the default with the same key name + if ( ! $this->set_att( $key, $val ) ) { + $this->set_att( $key, $defaults[ $key ] ); + } + } + } + + /** + * Validate and set form + * + * @param string $key A valid key; switch statement ensures validity + * @param string | bool $val A valid value; validated for each key + * + * @return bool + */ + function set_att( $key, $val ) { + + switch ( $key ) : + + case 'action': + break; + + case 'method': + if ( ! in_array( $val, array( 'post', 'get' ) ) ) { + return false; + } + break; + + case 'enctype': + if ( ! in_array( $val, array( 'application/x-www-form-urlencoded', 'multipart/form-data' ) ) ) { + return false; + } + break; + + case 'markup': + if ( ! in_array( $val, array( 'html', 'xhtml' ) ) ) { + return false; + } + break; + + case 'class': + case 'id': + if ( ! $this->_check_valid_attr( $val ) ) { + return false; + } + break; + + case 'novalidate': + case 'add_honeypot': + case 'form_element': + case 'add_submit': + if ( ! is_bool( $val ) ) { + return false; + } + break; + + case 'add_nonce': + if ( ! is_string( $val ) && ! is_bool( $val ) ) { + return false; + } + break; + + default: + return false; + + endswitch; + + $this->form[ $key ] = $val; + + return true; + + } + + /** + * Add an input field to the form for outputting later + * + * @param string $label + * @param string $args + * @param string $slug + */ + function add_input( $label, $args = '', $slug = '' ) { + + if ( empty( $args ) ) { + $args = array(); + } + + // Create a valid id or class attribute + if ( empty( $slug ) ) { + $slug = $this->_make_slug( $label ); + } + + $defaults = array( + 'type' => 'text', + 'name' => $slug, + 'id' => $slug, + 'label' => $label, + 'value' => '', + 'placeholder' => '', + 'class' => array(), + 'min' => '', + 'max' => '', + 'step' => '', + 'autofocus' => false, + 'checked' => false, + 'selected' => false, + 'required' => false, + 'add_label' => true, + 'options' => array(), + 'wrap_tag' => 'div', + 'wrap_class' => array( 'form_field_wrap' ), + 'wrap_id' => '', + 'wrap_style' => '', + 'before_html' => '', + 'after_html' => '', + 'request_populate' => true, + ); + + // Combined defaults and arguments + // Arguments override defaults + $args = array_merge( $defaults, $args ); + $this->inputs[ $slug ] = $args; + + } + + /** + * Add multiple inputs to the input queue + * + * @param $arr + * + * @return bool + */ + function add_inputs( $arr ) { + + if ( ! is_array( $arr ) ) { + return false; + } + + foreach ( $arr as $field ) { + $this->add_input( + $field[0], isset( $field[1] ) ? $field[1] : '', + isset( $field[2] ) ? $field[2] : '' + ); + } + + return true; + } + + /** + * Build the HTML for the form based on the input queue + * + * @param bool $echo Should the HTML be echoed or returned? + * + * @return string + */ + function build_form( $echo = true ) { + + $output = ''; + + if ( $this->form['form_element'] ) { + $output .= '
form['enctype'] ) ) { + $output .= ' enctype="' . $this->form['enctype'] . '"'; + } + + if ( ! empty( $this->form['action'] ) ) { + $output .= ' action="' . $this->form['action'] . '"'; + } + + if ( ! empty( $this->form['id'] ) ) { + $output .= ' id="' . $this->form['id'] . '"'; + } + + if ( count( $this->form['class'] ) > 0 ) { + $output .= $this->_output_classes( $this->form['class'] ); + } + + if ( $this->form['novalidate'] ) { + $output .= ' novalidate'; + } + + $output .= '>'; + } + + // Add honeypot anti-spam field + if ( $this->form['add_honeypot'] ) { + $this->add_input( 'Leave blank to submit', array( + 'name' => 'honeypot', + 'slug' => 'honeypot', + 'id' => 'form_honeypot', + 'wrap_tag' => 'div', + 'wrap_class' => array( 'form_field_wrap', 'hidden' ), + 'wrap_id' => '', + 'wrap_style' => 'display: none', + 'request_populate' => false, + ) ); + } + + // Add a WordPress nonce field + if ( $this->form['add_nonce'] && function_exists( 'wp_create_nonce' ) ) { + $this->add_input( 'WordPress nonce', array( + 'value' => wp_create_nonce( $this->form['add_nonce'] ), + 'add_label' => false, + 'type' => 'hidden', + 'request_populate' => false, + ) ); + } + + // Iterate through the input queue and add input HTML + foreach ( $this->inputs as $val ) : + + $min_max_range = $element = $end = $attr = $field = $label_html = ''; + + // Automatic population of values using $_REQUEST data + if ( $val['request_populate'] && isset( $_REQUEST[ $val['name'] ] ) ) { + + // Can this field be populated directly? + if ( ! in_array( $val['type'], array( 'html', 'title', 'radio', 'checkbox', 'select', 'submit' ) ) ) { + $val['value'] = $_REQUEST[ $val['name'] ]; + } + } + + // Automatic population for checkboxes and radios + if ( + $val['request_populate'] && + ( $val['type'] == 'radio' || $val['type'] == 'checkbox' ) && + empty( $val['options'] ) + ) { + $val['checked'] = isset( $_REQUEST[ $val['name'] ] ) ? true : $val['checked']; + } + + switch ( $val['type'] ) { + + case 'html': + $element = ''; + $end = $val['label']; + break; + + case 'title': + $element = ''; + $end = ' +

' . $val['label'] . '

'; + break; + + case 'textarea': + $element = 'textarea'; + $end = ' class="form-control" placeholder="' . $val['placeholder'] . '">' . esc_attr( $val['value'] ) . ''; + break; + + case 'select': + $element = 'select'; + $end .= '>'; + foreach ( $val['options'] as $key => $opt ) { + $opt_insert = ''; + if ( + // Is this field set to automatically populate? + $val['request_populate'] && + + // Do we have $_REQUEST data to use? + isset( $_REQUEST[ $val['name'] ] ) && + + // Are we currently outputting the selected value? + $_REQUEST[ $val['name'] ] === $key + ) { + $opt_insert = ' selected'; + + // Does the field have a default selected value? + } else if ( $val['selected'] === $key ) { + $opt_insert = ' selected'; + } + $end .= ''; + } + $end .= ''; + break; + case 'captcha': + $element = 'div'; + $end = ' class="g-recaptcha pirate-forms-g-recaptcha" data-sitekey="' . $val['value'] . '">'; + break; + case 'file': + $element = 'input'; + $end = ' class="" type="' . $val['type'] . '">'; + break; + case 'radio': + case 'checkbox': + + // Special case for multiple check boxes + if ( count( $val['options'] ) > 0 ) : + $element = ''; + foreach ( $val['options'] as $key => $opt ) { + $slug = $this->_make_slug( $opt ); + $end .= sprintf( + 'field_close(); + $end .= ' '; + } + $label_html = '
' . $val['label'] . '
'; + break; + endif; + case 'submit': + $element = 'div class="col-xs-12 col-sm-6 col-lg-6 form_field_wrap contact_submit_wrap">' . $val['value'] . ''; + break; + default : + $element = 'input'; + + /* don't add a placeholder attribute for input type=hidden */ + if ( ! empty( $val['type'] ) && ($val['type'] == 'hidden' ) ) { + $end .= ' class="form-control" type="' . $val['type'] . '" value="' . esc_attr( $val['value'] ) . '"'; + } else { + $end .= ' class="form-control" type="' . $val['type'] . '" value="' . esc_attr( $val['value'] ) . '" placeholder="' . $val['placeholder'] . '"'; + } + $end .= $val['checked'] ? ' checked' : ''; + $end .= $this->field_close(); + break; + + } + + // Added a submit button, no need to auto-add one + if ( $val['type'] === 'submit' ) { + $this->has_submit = true; + } + + // Special number values for range and number types + if ( $val['type'] === 'range' || $val['type'] === 'number' ) { + $min_max_range .= ! empty( $val['min'] ) ? ' min="' . $val['min'] . '"' : ''; + $min_max_range .= ! empty( $val['max'] ) ? ' max="' . $val['max'] . '"' : ''; + $min_max_range .= ! empty( $val['step'] ) ? ' step="' . $val['step'] . '"' : ''; + } + + // Add an ID field, if one is present + $id = ! empty( $val['id'] ) ? ' id="' . $val['id'] . '"' : ''; + + // Output classes + $class = $this->_output_classes( $val['class'] ); + + // Special HTML5 fields, if set + $attr .= $val['autofocus'] ? ' autofocus' : ''; + $attr .= $val['checked'] ? ' checked' : ''; + $attr .= $val['required'] ? ' required' : ''; + + // Build the label + if ( ! empty( $label_html ) ) { + $field .= $label_html; + } elseif ( $val['add_label'] && ! in_array( $val['type'], array( 'hidden', 'submit', 'title', 'html', 'textarea', 'captcha' ) ) ) { + $field .= ''; + } + + // An $element was set in the $val['type'] switch statement above so use that + if ( ! empty( $element ) ) { + if ( $val['type'] === 'checkbox' ) { + $field = ' + <' . $element . $id . ' name="' . $val['name'] . '"' . $min_max_range . $class . $attr . $end . + $field; + } elseif ( $val['type'] === 'captcha' ) { /* don't add name attribute to div's holding recaptcha keys */ + $field .= ' + <' . $element . $id . ' ' . $min_max_range . $class . $attr . $end; + } else { + $field .= ' + <' . $element . $id . ' name="' . $val['name'] . '"' . $min_max_range . $class . $attr . $end; + } + // Not a form element + } else { + $field .= $end; + } + + // Parse and create wrap, if needed + if ( $val['type'] != 'hidden' && $val['type'] != 'html' ) : + + $wrap_before = $val['before_html']; + if ( ! empty( $val['wrap_tag'] ) ) { + $wrap_before .= '<' . $val['wrap_tag']; + $wrap_before .= count( $val['wrap_class'] ) > 0 ? $this->_output_classes( $val['wrap_class'] ) : ''; + $wrap_before .= ! empty( $val['wrap_style'] ) ? ' style="' . $val['wrap_style'] . '"' : ''; + $wrap_before .= ! empty( $val['wrap_id'] ) ? ' id="' . $val['wrap_id'] . '"' : ''; + $wrap_before .= '>'; + } + + $wrap_after = $val['after_html']; + if ( ! empty( $val['wrap_tag'] ) ) { + $wrap_after = '' . $wrap_after; + } + + $output .= $wrap_before . $field . $wrap_after; + else : + $output .= $field; + endif; + + endforeach; + + // Auto-add submit button + if ( ! $this->has_submit && $this->form['add_submit'] ) { + $output .= '
'; + } + + // Close the form tag if one was added + if ( $this->form['form_element'] ) { + $output .= ''; + } + + // Output or return? + if ( $echo ) { + echo $output; + } else { + return $output; + } + } + + // Easy way to auto-close fields, if necessary + function field_close() { + return $this->form['markup'] === 'xhtml' ? ' />' : '>'; + } + + // Validates id and class attributes + // TODO: actually validate these things + private function _check_valid_attr( $string ) { + + $result = true; + + // Check $name for correct characters + // "^[a-zA-Z0-9_-]*$" + return $result; + + } + + // Create a slug from a label name + private function _make_slug( $string ) { + + $result = ''; + + $result = str_replace( '"', '', $string ); + $result = str_replace( "'", '', $result ); + $result = str_replace( '_', '-', $result ); + $result = preg_replace( '~[\W\s]~', '-', $result ); + + $result = strtolower( $result ); + + return $result; + + } + + // Parses and builds the classes in multiple places + private function _output_classes( $classes ) { + + $output = ''; + + if ( is_array( $classes ) && count( $classes ) > 0 ) { + $output .= ' class="'; + foreach ( $classes as $class ) { + $output .= $class . ' '; + } + $output .= '"'; + } else if ( is_string( $classes ) ) { + $output .= ' class="' . $classes . '"'; + } + + return $output; + } +} diff --git a/dist/dist/inc/helpers.php b/dist/dist/inc/helpers.php new file mode 100644 index 0000000..ff6e498 --- /dev/null +++ b/dist/dist/inc/helpers.php @@ -0,0 +1,59 @@ +'; + $output .= '

' . __( 'Sorry, an error occured.','pirate-forms' ) . '

'; + $output .= ''; + foreach ( $errs as $err ) : + $output .= '
'; + $output .= "

$err

"; + $output .= '
'; + endforeach; + + endif; + + return $output; + } +} + +/** + +****** Get blacklist IPs and emails from the Discussion settings */ + + +if ( ! function_exists( 'pirate_forms_get_blacklist' ) ) { + + function pirate_forms_get_blacklist() { + + $final_blocked_arr = array(); + + $blocked = get_option( 'blacklist_keys' ); + $blocked = str_replace( "\r", "\n", $blocked ); + + $blocked_arr = explode( "\n", $blocked ); + $blocked_arr = array_map( 'trim', $blocked_arr ); + + foreach ( $blocked_arr as $ip_or_email ) { + $ip_or_email = trim( $ip_or_email ); + if ( + filter_var( $ip_or_email, FILTER_VALIDATE_IP ) || + filter_var( $ip_or_email, FILTER_VALIDATE_EMAIL ) + ) { + $final_blocked_arr[] = $ip_or_email; + } + } + + return $final_blocked_arr; + } +} diff --git a/dist/dist/inc/settings.php b/dist/dist/inc/settings.php new file mode 100644 index 0000000..9370337 --- /dev/null +++ b/dist/dist/inc/settings.php @@ -0,0 +1,762 @@ + __( 'None', 'pirate-forms' ), + ); + $items = get_posts( array( + 'post_type' => $type, + 'numberposts' => - 1, + ) ); + if ( ! empty( $items ) ) : + foreach ( $items as $item ) : + $content[ $item->ID ] = $item->post_title; + endforeach; + endif; + + return $content; + + } +} +/* + * + * OPTIONS + * @since 1.0.0 + * name; id; desc; type; default; options + * + */ +function pirate_forms_plugin_options() { + /** + ********** Default values from Zerif Lite */ + $zerif_contactus_sitekey = get_theme_mod( 'zerif_contactus_sitekey' ); + if ( ! empty( $zerif_contactus_sitekey ) ) : + $pirate_forms_contactus_sitekey = $zerif_contactus_sitekey; + else : + $pirate_forms_contactus_sitekey = ''; + endif; + $zerif_contactus_secretkey = get_theme_mod( 'zerif_contactus_secretkey' ); + if ( ! empty( $zerif_contactus_secretkey ) ) : + $pirate_forms_contactus_secretkey = $zerif_contactus_secretkey; + else : + $pirate_forms_contactus_secretkey = ''; + endif; + $zerif_contactus_recaptcha_show = get_theme_mod( 'zerif_contactus_recaptcha_show' ); + if ( isset( $zerif_contactus_recaptcha_show ) && ( $zerif_contactus_recaptcha_show == '1' ) ) : + $pirate_forms_contactus_recaptcha_show = ''; + else : + $pirate_forms_contactus_recaptcha_show = 'yes'; + endif; + $zerif_contactus_button_label = get_theme_mod( 'zerif_contactus_button_label', __( 'Send Message', 'pirate-forms' ) ); + if ( ! empty( $zerif_contactus_button_label ) ) : + $pirate_forms_contactus_button_label = $zerif_contactus_button_label; + else : + $pirate_forms_contactus_button_label = __( 'Send Message', 'pirate-forms' ); + endif; + $zerif_contactus_email = get_theme_mod( 'zerif_contactus_email' ); + $zerif_email = get_theme_mod( 'zerif_email' ); + $pirate_forms_contactus_email = ''; + if ( ! empty( $zerif_contactus_email ) ) : + $pirate_forms_contactus_email = $zerif_contactus_email; + elseif ( ! empty( $zerif_email ) ) : + $pirate_forms_contactus_email = $zerif_email; + else : + $pirate_forms_contactus_email = get_bloginfo( 'admin_email' ); + endif; + + return array( + 'fourth_tab' => array( + 'header_options' => array( + __( 'Form processing options', 'pirate-forms' ), + '', + 'title', + '', + ), + 'pirateformsopt_email' => array( + __( 'Contact notification sender email', 'pirate-forms' ), + '' . __( "Insert [email] to use the contact form submitter's email.", 'pirate-forms' ) . '
' . __( "Email to use for the sender of the contact form emails both to the recipients below and the contact form submitter (if this is activated below). The domain for this email address should match your site's domain.", 'pirate-forms' ), + 'text', + pirate_forms_from_email(), + ), + 'pirateformsopt_email_recipients' => array( + __( 'Contact submission recipients', 'pirate-forms' ), + __( 'Email address(es) to receive contact submission notifications. You can separate multiple emails with a comma.', 'pirate-forms' ), + 'text', + pirate_forms_get_key( 'pirateformsopt_email' ) ? pirate_forms_get_key( 'pirateformsopt_email' ) : $pirate_forms_contactus_email, + ), + 'pirateformsopt_store' => array( + __( 'Store submissions in the database', 'pirate-forms' ), + __( 'Should the submissions be stored in the admin area? If chosen, contact form submissions will be saved in Contacts on the left (appears after this option is activated).', 'pirate-forms' ), + 'checkbox', + 'yes', + ), + 'pirateformsopt_nonce' => array( + __( 'Add a nonce to the contact form:', 'pirate-forms' ), + __( 'Should the form use a WordPress nonce? This helps reduce spam by ensuring that the form submittor is on the site when submitting the form rather than submitting remotely. This could, however, cause problems with sites using a page caching plugin. Turn this off if you are getting complaints about forms not being able to be submitted with an error of "Nonce failed!"', 'pirate-forms' ), + 'checkbox', + 'yes', + ), + 'pirateformsopt_confirm_email' => array( + __( 'Send email confirmation to form submitter', 'pirate-forms' ), + __( 'Adding text here will send an email to the form submitter. The email uses the "Successful form submission text" field from the "Alert Messages" tab as the subject line. Plain text only here, no HTML.', 'pirate-forms' ), + 'textarea', + '', + ), + 'pirateformsopt_thank_you_url' => array( + __( '"Thank You" URL', 'pirate-forms' ), + __( 'Select the post-submit page for all forms submitted', 'pirate-forms' ), + 'select', + '', + pirate_forms_get_pages_array(), + ), + ), + 'first_tab' => array( + 'header_fields' => array( + __( 'Fields Settings', 'pirate-forms' ), + '', + 'title', + '', + ), + /* Name */ + 'pirateformsopt_name_field' => array( + __( 'Name', 'pirate-forms' ), + __( 'Do you want the name field to be displayed?', 'pirate-forms' ), + 'select', + 'req', + array( + '' => __( 'None', 'pirate-forms' ), + 'yes' => __( 'Yes but not required', 'pirate-forms' ), + 'req' => __( 'Required', 'pirate-forms' ), + ), + ), + /* Email */ + 'pirateformsopt_email_field' => array( + __( 'Email address', 'pirate-forms' ), + __( 'Do you want the email address field be displayed?', 'pirate-forms' ), + 'select', + 'req', + array( + '' => __( 'None', 'pirate-forms' ), + 'yes' => __( 'Yes but not required', 'pirate-forms' ), + 'req' => __( 'Required', 'pirate-forms' ), + ), + ), + /* Subject */ + 'pirateformsopt_subject_field' => array( + __( 'Subject', 'pirate-forms' ), + __( 'Do you want the subject field be displayed?', 'pirate-forms' ), + 'select', + 'req', + array( + '' => __( 'None', 'pirate-forms' ), + 'yes' => __( 'Yes but not required', 'pirate-forms' ), + 'req' => __( 'Required', 'pirate-forms' ), + ), + ), + /* Message */ + 'pirateformsopt_message_field' => array( + __( 'Message', 'pirate-forms' ), + '', + 'select', + 'req', + array( + '' => __( 'None', 'pirate-forms' ), + 'yes' => __( 'Yes but not required', 'pirate-forms' ), + 'req' => __( 'Required', 'pirate-forms' ), + ), + ), + /* Recaptcha */ + 'pirateformsopt_recaptcha_field' => array( + __( 'Add a reCAPTCHA', 'pirate-forms' ), + '', + 'checkbox', + $pirate_forms_contactus_recaptcha_show, + ), + /* Site key */ + 'pirateformsopt_recaptcha_sitekey' => array( + __( 'Site key', 'pirate-forms' ), + '' . __( 'Create an account here ', 'pirate-forms' ) . '' . __( 'to get the Site key and the Secret key for the reCaptcha.', 'pirate-forms' ), + 'text', + $pirate_forms_contactus_sitekey, + ), + /* Secret key */ + 'pirateformsopt_recaptcha_secretkey' => array( + __( 'Secret key', 'pirate-forms' ), + '', + 'text', + $pirate_forms_contactus_secretkey, + ), + /* Attachment */ + 'pirateformsopt_attachment_field' => array( + __( 'Add an attachment field', 'pirate-forms' ), + '', + 'checkbox', + '', + ), + ), + 'second_tab' => array( + 'header_labels' => array( + __( 'Fields Labels', 'pirate-forms' ), + '', + 'title', + '', + ), + 'pirateformsopt_label_name' => array( + __( 'Name', 'pirate-forms' ), + '', + 'text', + __( 'Your Name', 'pirate-forms' ), + ), + 'pirateformsopt_label_email' => array( + __( 'Email', 'pirate-forms' ), + '', + 'text', + __( 'Your Email', 'pirate-forms' ), + ), + 'pirateformsopt_label_subject' => array( + __( 'Subject', 'pirate-forms' ), + '', + 'text', + __( 'Subject', 'pirate-forms' ), + ), + 'pirateformsopt_label_message' => array( + __( 'Message', 'pirate-forms' ), + '', + 'text', + __( 'Your message', 'pirate-forms' ), + ), + 'pirateformsopt_label_submit_btn' => array( + __( 'Submit button', 'pirate-forms' ), + '', + 'text', + $pirate_forms_contactus_button_label, + ), + ), + 'third_tab' => array( + 'header_messages' => array( + __( 'Alert Messages', 'pirate-forms' ), + '', + 'title', + '', + ), + 'pirateformsopt_label_err_name' => array( + __( 'Name required and missing', 'pirate-forms' ), + '', + 'text', + __( 'Enter your name', 'pirate-forms' ), + ), + 'pirateformsopt_label_err_email' => array( + __( 'E-mail required and missing', 'pirate-forms' ), + '', + 'text', + __( 'Enter a valid email', 'pirate-forms' ), + ), + 'pirateformsopt_label_err_subject' => array( + __( 'Subject required and missing', 'pirate-forms' ), + '', + 'text', + __( 'Please enter a subject', 'pirate-forms' ), + ), + 'pirateformsopt_label_err_no_content' => array( + __( 'Question/comment is missing', 'pirate-forms' ), + '', + 'text', + __( 'Enter your question or comment', 'pirate-forms' ), + ), + 'pirateformsopt_label_submit' => array( + __( 'Successful form submission text', 'pirate-forms' ), + __( 'This text is used on the page if no "Thank You" URL is set above. This is also used as the confirmation email title, if one is set to send out.', 'pirate-forms' ), + 'text', + __( 'Thanks, your email was sent successfully!', 'pirate-forms' ), + ), + ), + 'fifth_tab' => array( + 'header_smtp' => array( + __( 'SMTP Options', 'pirate-forms' ), + '', + 'title', + '', + ), + 'pirateformsopt_use_smtp' => array( + __( 'Use SMTP to send emails?', 'pirate-forms' ), + __( 'Instead of PHP mail function', 'pirate-forms' ), + 'checkbox', + '', + ), + 'pirateformsopt_smtp_host' => array( + __( 'SMTP Host', 'pirate-forms' ), + '', + 'text', + '', + ), + 'pirateformsopt_smtp_port' => array( + __( 'SMTP Port', 'pirate-forms' ), + '', + 'text', + '', + ), + 'pirateformsopt_use_smtp_authentication' => array( + __( 'Use SMTP Authentication?', 'pirate-forms' ), + __( 'If you check this box, make sure the SMTP Username and SMTP Password are completed.', 'pirate-forms' ), + 'checkbox', + 'yes', + ), + 'pirateformsopt_smtp_username' => array( + __( 'SMTP Username', 'pirate-forms' ), + '', + 'text', + '', + ), + 'pirateformsopt_smtp_password' => array( + __( 'SMTP Password', 'pirate-forms' ), + '', + 'text', + '', + ), + ), + ); +} + +/* + * + * Add page to the dashbord menu + * @since 1.0.0 + */ +function pirate_forms_add_to_admin() { + add_submenu_page( + 'options-general.php', + __( 'Pirate Forms settings', 'pirate-forms' ), + __( 'Pirate Forms', 'pirate-forms' ), + 'manage_options', + 'pirate-forms-admin', + 'pirate_forms_admin' ); + +} + +add_action( 'admin_menu', 'pirate_forms_add_to_admin' ); +/* + * + * Save forms via Ajax + * @since 1.0.0 + * + */ +add_action( 'wp_ajax_pirate_forms_save', 'pirate_forms_save_callback' ); +add_action( 'wp_ajax_nopriv_pirate_forms_save', 'pirate_forms_save_callback' ); +function pirate_forms_save_callback() { + if ( isset( $_POST['dataSent'] ) ) : + $dataSent = $_POST['dataSent']; + $params = array(); + if ( ! empty( $dataSent ) ) : + parse_str( $dataSent, $params ); + endif; + if ( ! empty( $params ) ) : + /** + ****** Important fix for saving inputs of type checkbox */ + if ( ! isset( $params['pirateformsopt_store'] ) ) { + $params['pirateformsopt_store'] = ''; + } + if ( ! isset( $params['pirateformsopt_recaptcha_field'] ) ) { + $params['pirateformsopt_recaptcha_field'] = ''; + } + if ( ! isset( $params['pirateformsopt_nonce'] ) ) { + $params['pirateformsopt_nonce'] = ''; + } + if ( ! isset( $params['pirateformsopt_attachment_field'] ) ) { + $params['pirateformsopt_attachment_field'] = ''; + } + if ( ! isset( $params['pirateformsopt_use_smtp'] ) ) { + $params['pirateformsopt_use_smtp'] = ''; + } + if ( ! isset( $params['pirateformsopt_use_smtp_authentication'] ) ) { + $params['pirateformsopt_use_smtp_authentication'] = ''; + } + update_option( 'pirate_forms_settings_array', $params ); + $pirate_forms_zerif_lite_mods = get_option( 'theme_mods_zerif-lite' ); + if ( empty( $pirate_forms_zerif_lite_mods ) ) : + $pirate_forms_zerif_lite_mods = array(); + endif; + if ( isset( $params['pirateformsopt_label_submit_btn'] ) ) : + $pirate_forms_zerif_lite_mods['zerif_contactus_button_label'] = $params['pirateformsopt_label_submit_btn']; + endif; + if ( isset( $params['pirateformsopt_email'] ) ) : + $pirate_forms_zerif_lite_mods['zerif_contactus_email'] = $params['pirateformsopt_email']; + endif; + if ( isset( $params['pirateformsopt_email_recipients'] ) ) : + $pirate_forms_zerif_lite_mods['zerif_contactus_email'] = $params['pirateformsopt_email_recipients']; + endif; + if ( isset( $params['pirateformsopt_recaptcha_field'] ) && ( $params['pirateformsopt_recaptcha_field'] == 'yes' ) ) : + $pirate_forms_zerif_lite_mods['zerif_contactus_recaptcha_show'] = 0; + else : + $pirate_forms_zerif_lite_mods['zerif_contactus_recaptcha_show'] = 1; + endif; + if ( isset( $params['pirateformsopt_recaptcha_sitekey'] ) ) : + $pirate_forms_zerif_lite_mods['zerif_contactus_sitekey'] = $params['pirateformsopt_recaptcha_sitekey']; + endif; + if ( isset( $params['pirateformsopt_recaptcha_secretkey'] ) ) : + $pirate_forms_zerif_lite_mods['zerif_contactus_secretkey'] = $params['pirateformsopt_recaptcha_secretkey']; + endif; + update_option( 'theme_mods_zerif-lite', $pirate_forms_zerif_lite_mods ); + endif; + endif; + die(); + +} + +/* + * Admin area setting page for the plugin + * @since 1.0.0 + * + */ +function pirate_forms_admin() { + global $current_user; + $pirate_forms_options = get_option( 'pirate_forms_settings_array' ); + $plugin_options = pirate_forms_plugin_options(); + ?> + +
+
+

+ +
+
    + +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
+ +
+ +
+ +

+

+ +

+ +
+ +

+
    +
  1. +
  2. +
  3. + [pirate_forms] +
  4. +
  5. <?php echo + do_shortcode( '[pirate_forms]' ) + ?> +
  6. +
+ +
+ +
+ +

+ + + +

+ +

+ + ', '' ); + ?> + +

+
+ +
+ + '; + ?> +
+ + $value ) : + /* Label */ + if ( ! empty( $value[0] ) ) : + $opt_name = $value[0]; + endif; + /* ID */ + $opt_id = $key; + /* Description */ + if ( ! empty( $value[1] ) ) : + $opt_desc = $value[1]; + else : + $opt_desc = ''; + endif; + /* Input type */ + if ( ! empty( $value[2] ) ) : + $opt_type = $value[2]; + else : + $opt_type = ''; + endif; + /* Default value */ + if ( ! empty( $value[3] ) ) : + $opt_default = $value[3]; + else : + $opt_default = ''; + endif; + /* Value */ + $opt_val = isset( $pirate_forms_options[ $opt_id ] ) ? $pirate_forms_options[ $opt_id ] : $opt_default; + /* Options if checkbox, select, or radio */ + $opt_options = empty( $value[4] ) ? array() : $value[4]; + switch ( $opt_type ) { + case 'title': + if ( ! empty( $opt_name ) ) : + echo '

' . $opt_name . '


'; + endif; + break; + case 'text': + /* Display recaptcha secret key and site key only if the Add a reCAPTCHA option is checked */ + $pirateformsopt_recaptcha_field = pirate_forms_get_key( 'pirateformsopt_recaptcha_field' ); + if ( ! empty( $opt_id ) && ( ( $opt_id != 'pirateformsopt_recaptcha_sitekey' ) && ( $opt_id != 'pirateformsopt_recaptcha_secretkey' ) ) || ( ! empty( $pirateformsopt_recaptcha_field ) && ( $pirateformsopt_recaptcha_field == 'yes' ) && ( ( $opt_id == 'pirateformsopt_recaptcha_sitekey' ) || ( $opt_id == 'pirateformsopt_recaptcha_secretkey' ) ) ) ) { + $pirate_forms_is_hidden_class = ''; + } else { + $pirate_forms_is_hidden_class = 'pirate-forms-hidden'; + } + ?> + +
+ + + + +
+ + + +
+ + + + +
+ + +
+ + + + + +
+ + +
+ + + + + + >Yes + +
+ + + + + + +
+
+
+ + + +
+
+
+
+
+

+
+ $_POST['pirate_forms_mail'], + 'attributes' => array( + 'NAME' => $user_info->first_name, + 'SURNAME' => $user_info->last_name, + ), + 'blacklisted' => 0, + 'listid' => array( 51 ), + 'blacklisted_sms' => 0, + ); + $status = $mailin->create_update_user( $data ); + if ( $status['code'] == 'success' ) { + update_option( 'pirate_forms_subscribe', true ); + } + } + $was_submited = get_option( 'pirate_forms_subscribe', false ); + if ( $was_submited == false ) { + echo sprintf( '

%s

', esc_html__( 'Ready to learn how to reduce your website loading times by half? Come and join the 1st lesson here!', 'pirate-forms' ) ); + } else { + echo sprintf( '

%s

', esc_html__( 'Thank you for subscribing! You have been added to the mailing list and will receive the next email information in the coming weeks. If you ever wish to unsubscribe, simply use the "Unsubscribe" link included in each newsletter.', 'pirate-forms' ) ); + } ?> +
+
+ +
+

+
+ Change default WordPress email templates using Custom Emails plugin + View more + details +
+
+ +
+
+ + + $opt ) { + $new_opt[ $key ] = $opt[3]; + } + } + update_option( 'pirate_forms_settings_array', $new_opt ); + + } +} + +add_action( 'admin_head', 'pirate_forms_settings_init' ); diff --git a/dist/dist/inc/widget.php b/dist/dist/inc/widget.php new file mode 100644 index 0000000..b8f8bc3 --- /dev/null +++ b/dist/dist/inc/widget.php @@ -0,0 +1,102 @@ + __FUNCTION__, + 'description' => __( 'Pirate Forms', 'pirate-forms' ), + ) + ); + } + + /** + * Widget logic and display + * + * @param array $args + * @param array $instance + */ + function widget( $args, $instance ) { + // Pulling out all settings + $args = wp_parse_args( $args, array( + 'before_widget' => '', + 'after_widget' => '', + 'before_title' => '', + 'after_title' => '', + ) ); + $instance = wp_parse_args( $instance, array( + 'pirate_forms_widget_title' => 'Pirate Forms', + 'pirate_forms_widget_subtext' => 'Pirate Forms', + ) ); + // Output all wrappers + echo $args['before_widget'] . '
'; + if ( ! empty( $instance['pirate_forms_widget_title'] ) ) { + echo $args['before_title'] . $instance['pirate_forms_widget_title'] . $args['after_title']; + } + if ( ! empty( $instance['pirate_forms_widget_subtext'] ) ) { + echo wpautop( stripslashes( $instance['pirate_forms_widget_subtext'] ) ); + } + echo do_shortcode( '[pirate_forms]' ); + echo '
'; + echo '
' . $args['after_widget']; + + } + + /** + * Used to update widget settings + * + * @param array $new_instance + * @param array $old_instance + * + * @return array + */ + function update( $new_instance, $old_instance ) { + $instance = $old_instance; + // Storing widget title as inputted option or category name + $instance['pirate_forms_widget_title'] = apply_filters( 'widget_title', sanitize_text_field( $new_instance['pirate_forms_widget_title'] ) ); + $instance['pirate_forms_widget_subtext'] = $new_instance['pirate_forms_widget_subtext']; + + return $instance; + } + + /** + * Used to generate the widget admin view + * + * @param array $instance + * + * @return string|void + */ + function form( $instance ) { + $pirate_forms_widget_title = ! empty( $instance['pirate_forms_widget_title'] ) ? $instance['pirate_forms_widget_title'] : __( 'Title', 'pirate-forms' ); + $pirate_forms_widget_subtext = ! empty( $instance['pirate_forms_widget_subtext'] ) ? $instance['pirate_forms_widget_subtext'] : __( 'Text above form', 'pirate-forms' ); + ?> +

+ + +

+

+ + +

+ '); + }); + } +}); diff --git a/dist/dist/js/scripts.js b/dist/dist/js/scripts.js new file mode 100644 index 0000000..7359571 --- /dev/null +++ b/dist/dist/js/scripts.js @@ -0,0 +1,23 @@ +jQuery(document).ready(function() { + + /* show/hide reCaptcha */ + + var thisOpen = false; + jQuery('.pirate_forms .form-control').each(function(){ + if ( jQuery(this).val().length > 0 ){ + thisOpen = true; + jQuery('.zerif-g-recaptcha').css('display','block').delay(1000).css('opacity','1'); + return false; + } + }); + if ( thisOpen === false && (typeof jQuery('.pirate_forms textarea').val() !== 'undefined') && (jQuery('.pirate_forms textarea').val().length > 0) ) { + thisOpen = true; + jQuery('.pirate-forms-g-recaptcha').css('display','block').delay(1000).css('opacity','1'); + } + jQuery('.pirate_forms input, .pirate_forms textarea').focus(function(){ + if ( !jQuery('.pirate-forms-g-recaptcha').hasClass('recaptcha-display') ) { + jQuery('.pirate-forms-g-recaptcha').css('display','block').delay(1000).css('opacity','1'); + } + }); + +}); \ No newline at end of file diff --git a/dist/dist/languages/pirate-forms-de_DE.mo b/dist/dist/languages/pirate-forms-de_DE.mo new file mode 100644 index 0000000..85ff33a Binary files /dev/null and b/dist/dist/languages/pirate-forms-de_DE.mo differ diff --git a/dist/dist/languages/pirate-forms-de_DE.po b/dist/dist/languages/pirate-forms-de_DE.po new file mode 100644 index 0000000..94b2786 --- /dev/null +++ b/dist/dist/languages/pirate-forms-de_DE.po @@ -0,0 +1,475 @@ +msgid "" +msgstr "" +"Project-Id-Version: Pirate Forms\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-09 18:51+0200\n" +"PO-Revision-Date: 2016-03-09 18:51+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_html__;esc_html_e\n" +"X-Poedit-Basepath: ../\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPath-1: inc\n" + +#: pirate-forms.php:295 +msgid "Contact Referrer" +msgstr "Kontakt Referrer" + +#: pirate-forms.php:306 +msgid "Referring page" +msgstr "Bezugnehmend Seite" + +#: pirate-forms.php:346 +msgid "Nonce failed!" +msgstr "Nonce fehlgeschlagen!" + +#: pirate-forms.php:352 +msgid "Form submission failed!" +msgstr "Formularübergabe fehlgeschlagen!" + +#: pirate-forms.php:357 +msgid "Contact form submission on" +msgstr "Kontaktformularübertragungauf" + +#: pirate-forms.php:438 +#: pirate-forms.php:451 +msgid "Wrong reCAPTCHA" +msgstr "Falsche reCAPTCHA" + +#: pirate-forms.php:462 +#, fuzzy +msgid "Please enter one or more Contact submission recipients" +msgstr "Kontakt Einreichung Empfänger" + +#: pirate-forms.php:473 +#, fuzzy +msgid "IP address: " +msgstr "E-Mail-Addresse" + +#: pirate-forms.php:473 +msgid "IP search:" +msgstr "" + +#: pirate-forms.php:478 +msgid "Came from: " +msgstr "" + +#: pirate-forms.php:482 +msgid "Sent from page: " +msgstr "" + +#: pirate-forms.php:491 +msgid "Form submission blocked!" +msgstr "Formularübertragung blockiert!" + +#: pirate-forms.php:705 +msgid "Add New Contact" +msgstr "Neuen Kontakt hinzufügen" + +#: pirate-forms.php:706 +msgid "New Contact" +msgstr "New Kontakt" + +#: pirate-forms.php:707 +msgid "Edit Contact" +msgstr "Kontakt bearbeiten" + +#: pirate-forms.php:708 +msgid "View Contact" +msgstr "View Kontakt" + +#: pirate-forms.php:709 +msgid "All Contacts" +msgstr "Alle Kontakte" + +#: pirate-forms.php:710 +msgid "Search Contacts" +msgstr "Suche Kontakte" + +#: pirate-forms.php:711 +msgid "Parent Contacts:" +msgstr "Mutter Kontakte:" + +#: pirate-forms.php:712 +msgid "No contacts found." +msgstr "Keine Kontakte gefunden." + +#: pirate-forms.php:713 +msgid "No contacts found in Trash." +msgstr "Keine Kontakte gefunden im Papierkorb." + +#: pirate-forms.php:717 +msgid "Contacts from Pirate Forms" +msgstr "Kontakte von Pirate Forms" + +#: pirate-forms.php:739 +msgid "Settings" +msgstr "" + +#: inc/helpers.php:16 +msgid "Sorry, an error occured." +msgstr "Sorry, ein Fehler aufgetreten." + +#: inc/settings.php:62 +#: inc/settings.php:66 +msgid "Send Message" +msgstr "Nachricht senden" + +#: inc/settings.php:84 +msgid "Form processing options" +msgstr "Form Verarbeitungsoptionen" + +#: inc/settings.php:90 +msgid "Contact notification sender email" +msgstr "Kontakt E-Mail- Benachrichtigung Absender" + +#: inc/settings.php:91 +msgid "Insert [email] to use the contact form submitter's email." +msgstr "" + +#: inc/settings.php:91 +#, fuzzy +msgid "Email to use for the sender of the contact form emails both to the recipients below and the contact form submitter (if this is activated below). The domain for this email address should match your site's domain." +msgstr "E-Mail an die Absender der Kontakt-Formular E-Mails sowohl auf die unten Empfänger und das Kontaktformular Einreicher ( wenn dies unten aktiviert) verwenden . Die Domain für diese E-Mail- Adresse sollte Ihre Website -Domain entsprechen." + +#: inc/settings.php:96 +msgid "Contact submission recipients" +msgstr "Kontakt Einreichung Empfänger" + +#: inc/settings.php:97 +msgid "Email address(es) to receive contact submission notifications. You can separate multiple emails with a comma." +msgstr "E-Mail- Adresse (n) , um den Kontakt Einreichung Benachrichtigungen zu erhalten. Sie können mehrere E-Mails durch Komma trennen." + +#: inc/settings.php:102 +msgid "Store submissions in the database" +msgstr "Shop Einreichungen in der Datenbank" + +#: inc/settings.php:103 +msgid "Should the submissions be stored in the admin area? If chosen, contact form submissions will be saved in Contacts on the left (appears after this option is activated)." +msgstr "Sollten die Einreichungen im Admin-Bereich gespeichert werden? Wenn gewählt , werden Kontaktformular Einreichungen in den Kontakten auf der linken Seite ( wird angezeigt, nachdem diese Option aktiviert ) gespeichert werden." + +#: inc/settings.php:108 +msgid "Use the comments blacklist to restrict submissions" +msgstr "Verwenden Sie die Kommentare Blacklist , um Einsendungen zu beschränken" + +#: inc/settings.php:109 +msgid "Should form submission IP and email addresses be compared against the Comment Blacklist, found in" +msgstr "Sollte die Einreichung IP bilden und Email-Adressen gegen den Kommentar Blacklist verglichen werden , in gefunden" + +#: inc/settings.php:109 +msgid "wp-admin > Settings > Discussion > Comment Blacklist?" +msgstr "wp-admin > Einstellungen> Diskussion > Hats Blacklist ?" + +#: inc/settings.php:114 +msgid "Send email confirmation to form submitter" +msgstr "Senden Sie E-Mail- Bestätigung an Einreicher bilden" + +#: inc/settings.php:115 +msgid "Adding text here will send an email to the form submitter. The email uses the \"Text to show when form is submitted...\" field below as the subject line. Plain text only here, no HTML." +msgstr "Hinzufügen von Text hier eine E-Mail in das Formular Einreicher zu senden. Die E-Mail verwendet die \"Text , um zu zeigen , wenn das Formular ... vorgelegt \" Feld unterhalb dem Betreff . Klartext nur hier , kein HTML ." + +#: inc/settings.php:122 +#: inc/settings.php:424 +msgid "Fields" +msgstr "Felder" + +#: inc/settings.php:129 +#: inc/settings.php:206 +msgid "Name" +msgstr "Name" + +#: inc/settings.php:130 +msgid "Do you want the name field to be displayed?" +msgstr "Möchten Sie das Namensfeld angezeigt werden?" + +#: inc/settings.php:134 +#: inc/settings.php:146 +#: inc/settings.php:158 +#: inc/settings.php:170 +msgid "None" +msgstr "Keine" + +#: inc/settings.php:135 +#: inc/settings.php:147 +#: inc/settings.php:159 +#: inc/settings.php:171 +msgid "Yes but not required" +msgstr "Ja, aber nicht erforderlich" + +#: inc/settings.php:136 +#: inc/settings.php:148 +#: inc/settings.php:160 +#: inc/settings.php:172 +msgid "Required" +msgstr "Erforderlich" + +#: inc/settings.php:141 +msgid "Email address" +msgstr "E-Mail-Addresse" + +#: inc/settings.php:142 +msgid "Do you want the email address field be displayed?" +msgstr "Möchten Sie die E-Mail- Adressfeld angezeigt werden?" + +#: inc/settings.php:153 +#: inc/settings.php:218 +#: inc/settings.php:221 +msgid "Subject" +msgstr "Subjekt" + +#: inc/settings.php:154 +msgid "Do you want the subject field be displayed?" +msgstr "Möchten Sie das Betreff-Feld angezeigt werden?" + +#: inc/settings.php:165 +#: inc/settings.php:224 +msgid "Message" +msgstr "Meldung" + +#: inc/settings.php:177 +msgid "Add a reCAPTCHA" +msgstr "Fügen Sie einen reCAPTCHA" + +#: inc/settings.php:184 +msgid "Site key" +msgstr "Site-Schlüssel" + +#: inc/settings.php:185 +msgid "Create an account here " +msgstr "Erstellen Sie ein Konto hier" + +#: inc/settings.php:185 +msgid "to get the Site key and the Secret key for the reCaptcha." +msgstr "um die Website- Schlüssel und den geheimen Schlüssel für die reCaptcha zu bekommen." + +#: inc/settings.php:191 +msgid "Secret key" +msgstr "geheimen Schlüssel" + +#: inc/settings.php:200 +#: inc/settings.php:425 +msgid "Labels" +msgstr "das Etikett" + +#: inc/settings.php:209 +msgid "Your Name" +msgstr "Ihr Name" + +#: inc/settings.php:212 +msgid "Email" +msgstr "Email" + +#: inc/settings.php:215 +msgid "Your Email" +msgstr "Deine E-Mail" + +#: inc/settings.php:227 +msgid "Your message" +msgstr "Ihre Nachricht" + +#: inc/settings.php:230 +msgid "Submit button" +msgstr "Submit button" + +#: inc/settings.php:238 +#: inc/settings.php:426 +msgid "Messages" +msgstr "Nachrichten" + +#: inc/settings.php:244 +msgid "Name required and missing" +msgstr "Name erforderlich und fehlende" + +#: inc/settings.php:247 +msgid "Enter your name" +msgstr "Gib deinen Namen ein" + +#: inc/settings.php:250 +msgid "E-mail required and missing" +msgstr "E-mail benötigt und fehlende" + +#: inc/settings.php:253 +msgid "Enter a valid email" +msgstr "Geben Sie eine gültige E-Mail" + +#: inc/settings.php:256 +msgid "Subject required and missing" +msgstr "Angabe erforderlich und fehlende" + +#: inc/settings.php:259 +msgid "Please enter a subject" +msgstr "Bitte geben Sie einen Betreff" + +#: inc/settings.php:262 +msgid "Question/comment is missing" +msgstr "Frage / Anmerkung fehlt" + +#: inc/settings.php:265 +msgid "Enter your question or comment" +msgstr "Geben Sie Ihre Frage oder einen Kommentar" + +#: inc/settings.php:268 +msgid "Successful form submission text" +msgstr "Erfolgreiche Formularübertragung Text" + +#: inc/settings.php:269 +msgid "This text is used on the page if no \"Thank You\" URL is set above. This is also used as the confirmation email title, if one is set to send out." +msgstr "Dieser Text wird auf der Seite verwendet werden, wenn keine \"Dankeschön \" URL ist oben angegeben. Dies wird auch als der Bestätigungsmail Titel verwendet , wenn man gesetzt zu versenden ." + +#: inc/settings.php:271 +msgid "Thanks, your email was sent successfully!" +msgstr "Vielen Dank , Ihre E-Mail wurde erfolgreich gesendet!" + +#: inc/settings.php:276 +msgid "Use SMTP to send emails?" +msgstr "Verwenden Sie SMTP- E-Mails schicken?" + +#: inc/settings.php:277 +msgid "Instead of PHP mail function" +msgstr "Anstelle von PHP Mail-Funktion" + +#: inc/settings.php:282 +msgid "SMTP Host" +msgstr "SMTP Host" + +#: inc/settings.php:288 +msgid "SMTP Port" +msgstr "SMTP Port" + +#: inc/settings.php:294 +msgid "Use SMTP Authentication?" +msgstr "Verwenden Sie SMTP-Authentifizierung ?" + +#: inc/settings.php:295 +msgid "If you check this box, make sure the SMTP Username and SMTP Password are completed." +msgstr "Wenn Sie dieses Kontrollkästchen aktivieren , stellen Sie sicher, dass der SMTP- Benutzernamen und das SMTP-Kennwort abgeschlossen sind." + +#: inc/settings.php:300 +msgid "SMTP Username" +msgstr "SMTP Benutzername" + +#: inc/settings.php:306 +msgid "SMTP Password" +msgstr "SMTP Passwort" + +#: inc/settings.php:324 +msgid "Pirate Forms settings" +msgstr "Piraten Forms Einstellungen" + +#: inc/settings.php:325 +#: inc/settings.php:417 +#: inc/widget.php:15 +#: inc/widget.php:16 +msgid "Pirate Forms" +msgstr "Piraten Forms" + +#: inc/settings.php:422 +msgid "How to use" +msgstr "" + +#: inc/settings.php:423 +msgid "Options" +msgstr "" + +#: inc/settings.php:427 +#, fuzzy +msgid "SMTP" +msgstr "SMTP Host" + +#: inc/settings.php:434 +#, fuzzy +msgid "Welcome to Pirate Forms!" +msgstr "Piraten Forms" + +#: inc/settings.php:435 +msgid "To get started, just " +msgstr "" + +#: inc/settings.php:435 +msgid "configure all the options " +msgstr "" + +#: inc/settings.php:435 +msgid "you need, hit save and start using the created form." +msgstr "" + +#: inc/settings.php:439 +msgid "There are 3 ways of using the newly created form:" +msgstr "" + +#: inc/settings.php:440 +msgid "1. Use the shortcode " +msgstr "" + +#: inc/settings.php:440 +msgid "in any page or post." +msgstr "" + +#: inc/settings.php:441 +msgid "2. Add a " +msgstr "" + +#: inc/settings.php:441 +msgid "widget" +msgstr "" + +#: inc/settings.php:442 +msgid "3. Use the shortcode " +msgstr "" + +#: inc/settings.php:442 +msgid "in the theme's files." +msgstr "" + +#: inc/settings.php:561 +msgid "Save changes" +msgstr "Änderungen speichern" + +#: inc/settings.php:575 +msgid "Get Our Free Email Course" +msgstr "" + +#: inc/settings.php:595 +msgid "Ready to learn how to reduce your website loading times by half? Come and join the 1st lesson here!" +msgstr "" + +#: inc/settings.php:597 +msgid "Thank you for subscribing! You have been added to the mailing list and will receive the next email information in the coming weeks. If you ever wish to unsubscribe, simply use the \"Unsubscribe\" link included in each newsletter." +msgstr "" + +#: inc/widget.php:75 +msgid "Title" +msgstr "Titel" + +#: inc/widget.php:76 +msgid "Text above form" +msgstr "Text oben Form" + +#: inc/widget.php:79 +msgid "Title:" +msgstr "Titel:" + +#: inc/widget.php:83 +msgid "Subtext:" +msgstr "Subtext:" + +#~ msgid "Use the email address above as notification sender" +#~ msgstr "" +#~ "Verwenden Sie die E-Mail- Adresse oben als Benachrichtigung Absender" + +#~ msgid "" +#~ "When this is on, the notification emails sent from your site will come " +#~ "from the email address above. When this is off, the emails will come from " +#~ "the form submitter, making it easy to reply. If you are not receiving " +#~ "notifications from the site, then turn this option off as your email " +#~ "server might be marking them as spam." +#~ msgstr "" +#~ "Wenn diese aktiviert ist, wird die Benachrichtigungs-Mails von Ihrer " +#~ "Website geschickt aus der E-Mail- Adresse oben zu kommen. Wenn diese " +#~ "Option deaktiviert ist , werden die E-Mails aus dem Formular Einreicher " +#~ "kommen , dass es leicht zu beantworten. Wenn Sie nicht den Empfang von " +#~ "Benachrichtigungen von der Seite , und schalten Sie diese Option ab , wie " +#~ "Ihre E-Mail -Server könnte als Spam markiert sie ." diff --git a/dist/dist/languages/pirate-forms-es_ES.mo b/dist/dist/languages/pirate-forms-es_ES.mo new file mode 100644 index 0000000..e36169f Binary files /dev/null and b/dist/dist/languages/pirate-forms-es_ES.mo differ diff --git a/dist/dist/languages/pirate-forms-es_ES.po b/dist/dist/languages/pirate-forms-es_ES.po new file mode 100644 index 0000000..46a81a9 --- /dev/null +++ b/dist/dist/languages/pirate-forms-es_ES.po @@ -0,0 +1,475 @@ +msgid "" +msgstr "" +"Project-Id-Version: Pirate Forms\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-09 18:51+0200\n" +"PO-Revision-Date: 2016-03-09 18:52+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_html__;esc_html_e\n" +"X-Poedit-Basepath: ../\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPath-1: inc\n" + +#: pirate-forms.php:295 +msgid "Contact Referrer" +msgstr "Contacto referente" + +#: pirate-forms.php:306 +msgid "Referring page" +msgstr "Página de referencia" + +#: pirate-forms.php:346 +msgid "Nonce failed!" +msgstr "¡Falló nonce!" + +#: pirate-forms.php:352 +msgid "Form submission failed!" +msgstr "¡Falló el envío del formulario!" + +#: pirate-forms.php:357 +msgid "Contact form submission on" +msgstr "Envío del formulario de contacto en" + +#: pirate-forms.php:438 +#: pirate-forms.php:451 +msgid "Wrong reCAPTCHA" +msgstr "reCAPTCHA incorrecto" + +#: pirate-forms.php:462 +msgid "Please enter one or more Contact submission recipients" +msgstr "Por favor, introduzca uno o más destinatarios del envío" + +#: pirate-forms.php:473 +#, fuzzy +msgid "IP address: " +msgstr "Dirección de correo electrónico" + +#: pirate-forms.php:473 +msgid "IP search:" +msgstr "" + +#: pirate-forms.php:478 +msgid "Came from: " +msgstr "" + +#: pirate-forms.php:482 +msgid "Sent from page: " +msgstr "" + +#: pirate-forms.php:491 +msgid "Form submission blocked!" +msgstr "¡Envío de formulario bloqueado!" + +#: pirate-forms.php:705 +msgid "Add New Contact" +msgstr "Añadir nuevo contacto" + +#: pirate-forms.php:706 +msgid "New Contact" +msgstr "Nuevo contacto" + +#: pirate-forms.php:707 +msgid "Edit Contact" +msgstr "Editar contacto" + +#: pirate-forms.php:708 +msgid "View Contact" +msgstr "Ver contacto" + +#: pirate-forms.php:709 +msgid "All Contacts" +msgstr "Todos los contactos" + +#: pirate-forms.php:710 +msgid "Search Contacts" +msgstr "Buscar contactos" + +#: pirate-forms.php:711 +msgid "Parent Contacts:" +msgstr "Contactos superiores:" + +#: pirate-forms.php:712 +msgid "No contacts found." +msgstr "No se han encontrado contactos." + +#: pirate-forms.php:713 +msgid "No contacts found in Trash." +msgstr "No se han encontrado contactos en la papelera." + +#: pirate-forms.php:717 +msgid "Contacts from Pirate Forms" +msgstr "Contactos de Pirate Forms" + +#: pirate-forms.php:739 +msgid "Settings" +msgstr "Ajustes" + +#: inc/helpers.php:16 +msgid "Sorry, an error occured." +msgstr "Disculpe, ha ocurrido un error." + +#: inc/settings.php:62 +#: inc/settings.php:66 +msgid "Send Message" +msgstr "Enviar mensaje" + +#: inc/settings.php:84 +msgid "Form processing options" +msgstr "Opciones de procesamiento del formulario" + +#: inc/settings.php:90 +msgid "Contact notification sender email" +msgstr "Correo electrónico del remitente para notificaciones" + +#: inc/settings.php:91 +msgid "Insert [email] to use the contact form submitter's email." +msgstr "" + +#: inc/settings.php:91 +#, fuzzy +msgid "Email to use for the sender of the contact form emails both to the recipients below and the contact form submitter (if this is activated below). The domain for this email address should match your site's domain." +msgstr "El correo electrónico para usar como remitente de los mensajes, tanto para los siguientes destinatarios como para quien envía el mensaje desde el formulario (si se activa a continuación). El dominio de esta dirección de correo electrónico debe coincidir con el dominio de su sitio." + +#: inc/settings.php:96 +msgid "Contact submission recipients" +msgstr "Destinatarios del envío" + +#: inc/settings.php:97 +msgid "Email address(es) to receive contact submission notifications. You can separate multiple emails with a comma." +msgstr "La o las direcciones de correo electrónico para recibir notificaciones de envío. Puede separar múltiples direcciones con una coma." + +#: inc/settings.php:102 +msgid "Store submissions in the database" +msgstr "Guardar los envíos en la base de datos" + +#: inc/settings.php:103 +msgid "Should the submissions be stored in the admin area? If chosen, contact form submissions will be saved in Contacts on the left (appears after this option is activated)." +msgstr "¿Los envíos deben guardarse en el área de administración? Si se selecciona, los envíos desde el formulario de contacto serán guardados en \"Contactos\", en la parte la izquierda (aparecerá una vez activada esta opción)." + +#: inc/settings.php:108 +msgid "Use the comments blacklist to restrict submissions" +msgstr "Usar lista negra de comentarios para restringir envíos" + +#: inc/settings.php:109 +msgid "Should form submission IP and email addresses be compared against the Comment Blacklist, found in" +msgstr "¿Las IP y direcciones de los envíos desde el formulario deben compararse con la lista negra de comentarios que se encuentra en" + +#: inc/settings.php:109 +msgid "wp-admin > Settings > Discussion > Comment Blacklist?" +msgstr "WordPress > Ajustes > Comentarios > Lista negra de comentarios?" + +#: inc/settings.php:114 +msgid "Send email confirmation to form submitter" +msgstr "Enviar un mensaje de confirmación al remitente del formulario" + +#: inc/settings.php:115 +msgid "Adding text here will send an email to the form submitter. The email uses the \"Text to show when form is submitted...\" field below as the subject line. Plain text only here, no HTML." +msgstr "Si añade un texto aquí se le enviará un mensaje al remitente del formulario. Este mensaje usa el siguiente campo \"Texto para mostrar cuando se envía el formulario...\" como línea del asunto. Solo se admite texto sin formato, no HTML." + +#: inc/settings.php:122 +#: inc/settings.php:424 +msgid "Fields" +msgstr "Campos" + +#: inc/settings.php:129 +#: inc/settings.php:206 +msgid "Name" +msgstr "Nombre" + +#: inc/settings.php:130 +msgid "Do you want the name field to be displayed?" +msgstr "¿Desea mostrar el campo \"Nombre\"?" + +#: inc/settings.php:134 +#: inc/settings.php:146 +#: inc/settings.php:158 +#: inc/settings.php:170 +msgid "None" +msgstr "No" + +#: inc/settings.php:135 +#: inc/settings.php:147 +#: inc/settings.php:159 +#: inc/settings.php:171 +msgid "Yes but not required" +msgstr "Sí, pero no obligatorio" + +#: inc/settings.php:136 +#: inc/settings.php:148 +#: inc/settings.php:160 +#: inc/settings.php:172 +msgid "Required" +msgstr "Obligatorio" + +#: inc/settings.php:141 +msgid "Email address" +msgstr "Dirección de correo electrónico" + +#: inc/settings.php:142 +msgid "Do you want the email address field be displayed?" +msgstr "¿Desea mostrar el campo \"Dirección de correo electrónico\"?" + +#: inc/settings.php:153 +#: inc/settings.php:218 +#: inc/settings.php:221 +msgid "Subject" +msgstr "Asunto" + +#: inc/settings.php:154 +msgid "Do you want the subject field be displayed?" +msgstr "¿Desea mostrar el campo \"Asunto\"?" + +#: inc/settings.php:165 +#: inc/settings.php:224 +msgid "Message" +msgstr "Mensaje" + +#: inc/settings.php:177 +msgid "Add a reCAPTCHA" +msgstr "Añadir un reCAPTCHA" + +#: inc/settings.php:184 +msgid "Site key" +msgstr "Clave del sitio" + +#: inc/settings.php:185 +msgid "Create an account here " +msgstr "Crear una cuenta aquí " + +#: inc/settings.php:185 +msgid "to get the Site key and the Secret key for the reCaptcha." +msgstr "para obtener la clave del sitio y la clave secreta para el reCaptcha." + +#: inc/settings.php:191 +msgid "Secret key" +msgstr "Clave secreta" + +#: inc/settings.php:200 +#: inc/settings.php:425 +msgid "Labels" +msgstr "Etiquetas" + +#: inc/settings.php:209 +msgid "Your Name" +msgstr "Nombre" + +#: inc/settings.php:212 +msgid "Email" +msgstr "Correo electrónico" + +#: inc/settings.php:215 +msgid "Your Email" +msgstr "Correo electrónico" + +#: inc/settings.php:227 +msgid "Your message" +msgstr "Mensaje" + +#: inc/settings.php:230 +msgid "Submit button" +msgstr "Botón \"Enviar\"" + +#: inc/settings.php:238 +#: inc/settings.php:426 +msgid "Messages" +msgstr "Mensajes" + +#: inc/settings.php:244 +msgid "Name required and missing" +msgstr "Falta el nombre y es obligatorio" + +#: inc/settings.php:247 +msgid "Enter your name" +msgstr "Escriba su nombre" + +#: inc/settings.php:250 +msgid "E-mail required and missing" +msgstr "Falta el correo electrónico y es obligatorio" + +#: inc/settings.php:253 +msgid "Enter a valid email" +msgstr "Escriba un correo electrónico válido" + +#: inc/settings.php:256 +msgid "Subject required and missing" +msgstr "Falta el asunto y es obligatorio" + +#: inc/settings.php:259 +msgid "Please enter a subject" +msgstr "Por favor, escriba un asunto" + +#: inc/settings.php:262 +msgid "Question/comment is missing" +msgstr "Falta la pregunta/comentario" + +#: inc/settings.php:265 +msgid "Enter your question or comment" +msgstr "Escriba su pregunta o comentario" + +#: inc/settings.php:268 +msgid "Successful form submission text" +msgstr "Envío del formulario con éxito" + +#: inc/settings.php:269 +msgid "This text is used on the page if no \"Thank You\" URL is set above. This is also used as the confirmation email title, if one is set to send out." +msgstr "Este texto se usa en la página cuando no se asigna una URL distinta para el mensaje de agradecimiento. También se utiliza como título del mensaje de confirmación, si ha establecido que se envíe." + +#: inc/settings.php:271 +msgid "Thanks, your email was sent successfully!" +msgstr "¡Gracias, su mensaje fue enviado con éxito!" + +#: inc/settings.php:276 +msgid "Use SMTP to send emails?" +msgstr "¿Usar SMTP para enviar los mensajes?" + +#: inc/settings.php:277 +msgid "Instead of PHP mail function" +msgstr "En lugar de la función PHP mail" + +#: inc/settings.php:282 +msgid "SMTP Host" +msgstr "Servidor de SMTP" + +#: inc/settings.php:288 +msgid "SMTP Port" +msgstr "Puerto SMTP" + +#: inc/settings.php:294 +msgid "Use SMTP Authentication?" +msgstr "¿Usar autenticación SMTP?" + +#: inc/settings.php:295 +msgid "If you check this box, make sure the SMTP Username and SMTP Password are completed." +msgstr "Si selecciona esta casilla, asegúrese de completar el nombre de usuario SMTP y la contraseña SMTP." + +#: inc/settings.php:300 +msgid "SMTP Username" +msgstr "Nombre de usuario SMTP" + +#: inc/settings.php:306 +msgid "SMTP Password" +msgstr "Contraseña SMTP" + +#: inc/settings.php:324 +msgid "Pirate Forms settings" +msgstr "Ajustes de Pirate Forms" + +#: inc/settings.php:325 +#: inc/settings.php:417 +#: inc/widget.php:15 +#: inc/widget.php:16 +msgid "Pirate Forms" +msgstr "Pirate Forms" + +#: inc/settings.php:422 +msgid "How to use" +msgstr "" + +#: inc/settings.php:423 +msgid "Options" +msgstr "" + +#: inc/settings.php:427 +#, fuzzy +msgid "SMTP" +msgstr "Servidor de SMTP" + +#: inc/settings.php:434 +#, fuzzy +msgid "Welcome to Pirate Forms!" +msgstr "Pirate Forms" + +#: inc/settings.php:435 +msgid "To get started, just " +msgstr "" + +#: inc/settings.php:435 +msgid "configure all the options " +msgstr "" + +#: inc/settings.php:435 +msgid "you need, hit save and start using the created form." +msgstr "" + +#: inc/settings.php:439 +msgid "There are 3 ways of using the newly created form:" +msgstr "" + +#: inc/settings.php:440 +msgid "1. Use the shortcode " +msgstr "" + +#: inc/settings.php:440 +msgid "in any page or post." +msgstr "" + +#: inc/settings.php:441 +msgid "2. Add a " +msgstr "" + +#: inc/settings.php:441 +msgid "widget" +msgstr "" + +#: inc/settings.php:442 +msgid "3. Use the shortcode " +msgstr "" + +#: inc/settings.php:442 +msgid "in the theme's files." +msgstr "" + +#: inc/settings.php:561 +msgid "Save changes" +msgstr "Guardar cambios" + +#: inc/settings.php:575 +msgid "Get Our Free Email Course" +msgstr "" + +#: inc/settings.php:595 +msgid "Ready to learn how to reduce your website loading times by half? Come and join the 1st lesson here!" +msgstr "" + +#: inc/settings.php:597 +msgid "Thank you for subscribing! You have been added to the mailing list and will receive the next email information in the coming weeks. If you ever wish to unsubscribe, simply use the \"Unsubscribe\" link included in each newsletter." +msgstr "" + +#: inc/widget.php:75 +msgid "Title" +msgstr "Título" + +#: inc/widget.php:76 +msgid "Text above form" +msgstr "Texto arriba del formulario" + +#: inc/widget.php:79 +msgid "Title:" +msgstr "Título:" + +#: inc/widget.php:83 +msgid "Subtext:" +msgstr "Subtítulo:" + +#~ msgid "Use the email address above as notification sender" +#~ msgstr "" +#~ "Usar la dirección de correo electrónico anterior como remitente de la " +#~ "notificación" + +#~ msgid "" +#~ "When this is on, the notification emails sent from your site will come " +#~ "from the email address above. When this is off, the emails will come from " +#~ "the form submitter, making it easy to reply. If you are not receiving " +#~ "notifications from the site, then turn this option off as your email " +#~ "server might be marking them as spam." +#~ msgstr "" +#~ "Cuando esto está activado, los mensajes de notificación enviados desde su " +#~ "sitio provendrán de la dirección de correo electrónico anterior. Cuando " +#~ "esto está desactivado, los mensajes provendrán del remitente del " +#~ "formulario, para que sea más fácil responderlos. Si no está recibiendo " +#~ "notificaciones desde el sitio, desactive esta opción, ya que su servidor " +#~ "de correo puede estar marcándolos como spam." diff --git a/dist/dist/languages/pirate-forms-ro_RO.mo b/dist/dist/languages/pirate-forms-ro_RO.mo new file mode 100644 index 0000000..0a1f6c2 Binary files /dev/null and b/dist/dist/languages/pirate-forms-ro_RO.mo differ diff --git a/dist/dist/languages/pirate-forms-ro_RO.po b/dist/dist/languages/pirate-forms-ro_RO.po new file mode 100644 index 0000000..b5e8699 --- /dev/null +++ b/dist/dist/languages/pirate-forms-ro_RO.po @@ -0,0 +1,474 @@ +msgid "" +msgstr "" +"Project-Id-Version: Pirate Forms\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-09 18:51+0200\n" +"PO-Revision-Date: 2016-03-09 18:52+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_html__;esc_html_e\n" +"X-Poedit-Basepath: ../\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPath-1: inc\n" + +#: pirate-forms.php:295 +msgid "Contact Referrer" +msgstr "Contact Referrer" + +#: pirate-forms.php:306 +msgid "Referring page" +msgstr "Pagina de referință" + +#: pirate-forms.php:346 +msgid "Nonce failed!" +msgstr "Eroare la nounce!" + +#: pirate-forms.php:352 +msgid "Form submission failed!" +msgstr "Trimiterea formularului nu a reușit !" + +#: pirate-forms.php:357 +msgid "Contact form submission on" +msgstr "Trimiterea formularului de contact pe" + +#: pirate-forms.php:438 +#: pirate-forms.php:451 +msgid "Wrong reCAPTCHA" +msgstr "reCAPTCHA greșită" + +#: pirate-forms.php:462 +#, fuzzy +msgid "Please enter one or more Contact submission recipients" +msgstr "Destinatarii formularelor de contact" + +#: pirate-forms.php:473 +#, fuzzy +msgid "IP address: " +msgstr "Adresă de email" + +#: pirate-forms.php:473 +msgid "IP search:" +msgstr "" + +#: pirate-forms.php:478 +msgid "Came from: " +msgstr "" + +#: pirate-forms.php:482 +msgid "Sent from page: " +msgstr "" + +#: pirate-forms.php:491 +msgid "Form submission blocked!" +msgstr "Trimiterea formularului a fost blocată!" + +#: pirate-forms.php:705 +msgid "Add New Contact" +msgstr "Adauga contact nou" + +#: pirate-forms.php:706 +msgid "New Contact" +msgstr "Contact nou" + +#: pirate-forms.php:707 +msgid "Edit Contact" +msgstr "Editeaza contact" + +#: pirate-forms.php:708 +msgid "View Contact" +msgstr "Vezi Contact" + +#: pirate-forms.php:709 +msgid "All Contacts" +msgstr "Toate Contactele" + +#: pirate-forms.php:710 +msgid "Search Contacts" +msgstr "Caută contacte" + +#: pirate-forms.php:711 +msgid "Parent Contacts:" +msgstr "Părinte Contacte:" + +#: pirate-forms.php:712 +msgid "No contacts found." +msgstr "Nu au fost găsite contacte" + +#: pirate-forms.php:713 +msgid "No contacts found in Trash." +msgstr " Nu au fost găsite contacte în coșul de gunoi" + +#: pirate-forms.php:717 +msgid "Contacts from Pirate Forms" +msgstr "Contacte din Formularul Pirate" + +#: pirate-forms.php:739 +msgid "Settings" +msgstr "Setari" + +#: inc/helpers.php:16 +msgid "Sorry, an error occured." +msgstr "Ne pare rău, a apărut o eroare." + +#: inc/settings.php:62 +#: inc/settings.php:66 +msgid "Send Message" +msgstr "Trimite mesajul" + +#: inc/settings.php:84 +msgid "Form processing options" +msgstr "Opțiuni de procesare a formularului" + +#: inc/settings.php:90 +msgid "Contact notification sender email" +msgstr "Email-ul expeditorului pentru notificari" + +#: inc/settings.php:91 +msgid "Insert [email] to use the contact form submitter's email." +msgstr "" + +#: inc/settings.php:91 +#, fuzzy +msgid "Email to use for the sender of the contact form emails both to the recipients below and the contact form submitter (if this is activated below). The domain for this email address should match your site's domain." +msgstr "E-mail utilizat pentru expeditorul e-mailurilor, atât la destinatarii de mai jos și cel care a trimis formularul de contact ( dacă acest lucru este activat de mai jos ) . Domeniul pentru această adresă de e-mail ar trebui să corespundă domeniului site-ului." + +#: inc/settings.php:96 +msgid "Contact submission recipients" +msgstr "Destinatarii formularelor de contact" + +#: inc/settings.php:97 +msgid "Email address(es) to receive contact submission notifications. You can separate multiple emails with a comma." +msgstr "Adresa/e de email, la care se primesc notificări. Puteți separa mai multe e-mailuri cu virgulă." + +#: inc/settings.php:102 +msgid "Store submissions in the database" +msgstr "Doriți să salvați email-urile în baza de date" + +#: inc/settings.php:103 +msgid "Should the submissions be stored in the admin area? If chosen, contact form submissions will be saved in Contacts on the left (appears after this option is activated)." +msgstr "Doriți ca observațiile să fie stocate în zona de admin? Dacă da , email-urile vor fi salvate în Contacte în meniul din stanga ( apare după ce această opțiune este activată)." + +#: inc/settings.php:108 +msgid "Use the comments blacklist to restrict submissions" +msgstr "Utilizați lista neagră a comentariilor pentru a restricționa email-urile" + +#: inc/settings.php:109 +msgid "Should form submission IP and email addresses be compared against the Comment Blacklist, found in" +msgstr "Ar trebui ca IP-ul și adresa de email să fie comparate cu lista neagră, găsită în" + +#: inc/settings.php:109 +msgid "wp-admin > Settings > Discussion > Comment Blacklist?" +msgstr "wp-admin > Settings > Discutii > Lista neagra?" + +#: inc/settings.php:114 +msgid "Send email confirmation to form submitter" +msgstr "Trimite confirmare prin e-mail celui care a emis formularul" + +#: inc/settings.php:115 +msgid "Adding text here will send an email to the form submitter. The email uses the \"Text to show when form is submitted...\" field below as the subject line. Plain text only here, no HTML." +msgstr "Adăugarea de text aici va trimite un e-mail la emitentul formularului. E-mail utilizează \" Text afisat atunci când formularul este trimis ... \" câmpul de mai jos ca linia de subiect. Doar text simplu aici, nu HTML." + +#: inc/settings.php:122 +#: inc/settings.php:424 +msgid "Fields" +msgstr "Câmpuri" + +#: inc/settings.php:129 +#: inc/settings.php:206 +msgid "Name" +msgstr "Nume" + +#: inc/settings.php:130 +msgid "Do you want the name field to be displayed?" +msgstr "Vrei să fie afișat câmpul nume?" + +#: inc/settings.php:134 +#: inc/settings.php:146 +#: inc/settings.php:158 +#: inc/settings.php:170 +msgid "None" +msgstr "Nu" + +#: inc/settings.php:135 +#: inc/settings.php:147 +#: inc/settings.php:159 +#: inc/settings.php:171 +msgid "Yes but not required" +msgstr "Da, dar nu obligatoriu" + +#: inc/settings.php:136 +#: inc/settings.php:148 +#: inc/settings.php:160 +#: inc/settings.php:172 +msgid "Required" +msgstr "Obligatoriu" + +#: inc/settings.php:141 +msgid "Email address" +msgstr "Adresă de email" + +#: inc/settings.php:142 +msgid "Do you want the email address field be displayed?" +msgstr "Vreți sa fie afișat câmpul adresa de email?" + +#: inc/settings.php:153 +#: inc/settings.php:218 +#: inc/settings.php:221 +msgid "Subject" +msgstr "Subiect" + +#: inc/settings.php:154 +msgid "Do you want the subject field be displayed?" +msgstr "Vrei să fie afișat câmpul subiect?" + +#: inc/settings.php:165 +#: inc/settings.php:224 +msgid "Message" +msgstr "Mesaj" + +#: inc/settings.php:177 +msgid "Add a reCAPTCHA" +msgstr "Adaugă reCAPTCHA" + +#: inc/settings.php:184 +msgid "Site key" +msgstr "Cheia site-ului" + +#: inc/settings.php:185 +msgid "Create an account here " +msgstr "Creează-ți un cont aici" + +#: inc/settings.php:185 +msgid "to get the Site key and the Secret key for the reCaptcha." +msgstr "pentru a obține cheia site-ului și cheia secretă pentru reCAPTCHA." + +#: inc/settings.php:191 +msgid "Secret key" +msgstr "Cheia secretă" + +#: inc/settings.php:200 +#: inc/settings.php:425 +msgid "Labels" +msgstr "Etichete" + +#: inc/settings.php:209 +msgid "Your Name" +msgstr "Numele tău" + +#: inc/settings.php:212 +msgid "Email" +msgstr "Email" + +#: inc/settings.php:215 +msgid "Your Email" +msgstr "Emailul tău" + +#: inc/settings.php:227 +msgid "Your message" +msgstr "Mesajul tău" + +#: inc/settings.php:230 +msgid "Submit button" +msgstr "Buton de trimis formularul" + +#: inc/settings.php:238 +#: inc/settings.php:426 +msgid "Messages" +msgstr "Mesaje" + +#: inc/settings.php:244 +msgid "Name required and missing" +msgstr "Numele este necesar și lipsește" + +#: inc/settings.php:247 +msgid "Enter your name" +msgstr "Introdu numele tău" + +#: inc/settings.php:250 +msgid "E-mail required and missing" +msgstr "Adresa de e-mail este necesară și lipsește" + +#: inc/settings.php:253 +msgid "Enter a valid email" +msgstr "Introduceți o adresă de e-mail validă" + +#: inc/settings.php:256 +msgid "Subject required and missing" +msgstr "Subiectul este necesar și lipseşte" + +#: inc/settings.php:259 +msgid "Please enter a subject" +msgstr "Vă rugăm să introduceți un subiect" + +#: inc/settings.php:262 +msgid "Question/comment is missing" +msgstr "Intrebarea / comentariul lipsește" + +#: inc/settings.php:265 +msgid "Enter your question or comment" +msgstr "Introduceți întrebarea dvs. sau comentariul" + +#: inc/settings.php:268 +msgid "Successful form submission text" +msgstr "Mesajul de succes pentru formular" + +#: inc/settings.php:269 +msgid "This text is used on the page if no \"Thank You\" URL is set above. This is also used as the confirmation email title, if one is set to send out." +msgstr "Acest text este folosit în pagină dacă nu este setat mai sus \" Thank You \" URL. Acest text este, de asemenea, utilizat ca titlul email-ului de confirmare, în cazul în care unul este setat." + +#: inc/settings.php:271 +msgid "Thanks, your email was sent successfully!" +msgstr "Mulțumim , e-mailul a fost trimis cu succes !" + +#: inc/settings.php:276 +msgid "Use SMTP to send emails?" +msgstr "Doriți să utilizați SMTP pentru a trimite emailuri?" + +#: inc/settings.php:277 +msgid "Instead of PHP mail function" +msgstr "în loc de funcția PHP mail" + +#: inc/settings.php:282 +msgid "SMTP Host" +msgstr "Gazda SMTP" + +#: inc/settings.php:288 +msgid "SMTP Port" +msgstr "Portul SMTP" + +#: inc/settings.php:294 +msgid "Use SMTP Authentication?" +msgstr "Doriți autentificarea SMTP?" + +#: inc/settings.php:295 +msgid "If you check this box, make sure the SMTP Username and SMTP Password are completed." +msgstr "După selectarea acestei căsuțe, te rugăm să completezi utilizatorul SMTP și parola SMTP. " + +#: inc/settings.php:300 +msgid "SMTP Username" +msgstr "Utilizator SMTP" + +#: inc/settings.php:306 +msgid "SMTP Password" +msgstr "Parola SMTP" + +#: inc/settings.php:324 +msgid "Pirate Forms settings" +msgstr "Formularul Piraților - setări" + +#: inc/settings.php:325 +#: inc/settings.php:417 +#: inc/widget.php:15 +#: inc/widget.php:16 +msgid "Pirate Forms" +msgstr "Formularul Piraților" + +#: inc/settings.php:422 +msgid "How to use" +msgstr "" + +#: inc/settings.php:423 +msgid "Options" +msgstr "" + +#: inc/settings.php:427 +#, fuzzy +msgid "SMTP" +msgstr "Gazda SMTP" + +#: inc/settings.php:434 +#, fuzzy +msgid "Welcome to Pirate Forms!" +msgstr "Formularul Piraților" + +#: inc/settings.php:435 +msgid "To get started, just " +msgstr "" + +#: inc/settings.php:435 +msgid "configure all the options " +msgstr "" + +#: inc/settings.php:435 +msgid "you need, hit save and start using the created form." +msgstr "" + +#: inc/settings.php:439 +msgid "There are 3 ways of using the newly created form:" +msgstr "" + +#: inc/settings.php:440 +msgid "1. Use the shortcode " +msgstr "" + +#: inc/settings.php:440 +msgid "in any page or post." +msgstr "" + +#: inc/settings.php:441 +msgid "2. Add a " +msgstr "" + +#: inc/settings.php:441 +msgid "widget" +msgstr "" + +#: inc/settings.php:442 +msgid "3. Use the shortcode " +msgstr "" + +#: inc/settings.php:442 +msgid "in the theme's files." +msgstr "" + +#: inc/settings.php:561 +msgid "Save changes" +msgstr "Salvează" + +#: inc/settings.php:575 +msgid "Get Our Free Email Course" +msgstr "" + +#: inc/settings.php:595 +msgid "Ready to learn how to reduce your website loading times by half? Come and join the 1st lesson here!" +msgstr "" + +#: inc/settings.php:597 +msgid "Thank you for subscribing! You have been added to the mailing list and will receive the next email information in the coming weeks. If you ever wish to unsubscribe, simply use the \"Unsubscribe\" link included in each newsletter." +msgstr "" + +#: inc/widget.php:75 +msgid "Title" +msgstr "Titlu" + +#: inc/widget.php:76 +msgid "Text above form" +msgstr "Text deasupra formularului:" + +#: inc/widget.php:79 +msgid "Title:" +msgstr "Titlu:" + +#: inc/widget.php:83 +msgid "Subtext:" +msgstr "Subtext:" + +#~ msgid "Use the email address above as notification sender" +#~ msgstr "Utilizați adresa de email de mai sus ca expeditorul notificarilor" + +#~ msgid "" +#~ "When this is on, the notification emails sent from your site will come " +#~ "from the email address above. When this is off, the emails will come from " +#~ "the form submitter, making it easy to reply. If you are not receiving " +#~ "notifications from the site, then turn this option off as your email " +#~ "server might be marking them as spam." +#~ msgstr "" +#~ "Când acestă căsuță este selectată, e-mailurile de notificare trimise de " +#~ "site-ul dvs. vor veni de la adresa de email de mai sus . Atunci când " +#~ "acestă căsuță nu este selectată , e-mailurile vor veni de la autorul " +#~ "formularului, făcând ușoară modalitatea de a răspunde. Dacă nu primiți " +#~ "notificări de pe site-ul dvs., dezactivați această opțiune deoarece " +#~ "server-ul dvs. de e-mail le-ar putea marca ca spam." diff --git a/dist/dist/languages/pirate-forms.pot b/dist/dist/languages/pirate-forms.pot new file mode 100644 index 0000000..8243038 --- /dev/null +++ b/dist/dist/languages/pirate-forms.pot @@ -0,0 +1,554 @@ +# Copyright (C) 2017 Themeisle +# This file is distributed under the GPLv2. +msgid "" +msgstr "" +"Project-Id-Version: Free & Simple Contact Form Plugin - PirateForms 1.2.0\n" +"Report-Msgid-Bugs-To: https://github.com/Codeinwp/pirate-forms/issues\n" +"POT-Creation-Date: 2017-01-19 17:18:12+00:00\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n" +"Last-Translator: Themeisle Translate Team \n" +"Language-Team: Themeisle Translate \n" +"X-Generator: grunt-wp-i18n 0.5.4\n" +"X-Poedit-KeywordsList: " +"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_" +"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-Country: United States\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-Basepath: ../\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-Bookmarks: \n" +"X-Textdomain-Support: yes\n" + +#: inc/helpers.php:16 +msgid "Sorry, an error occured." +msgstr "" + +#: inc/settings.php:27 inc/settings.php:148 inc/settings.php:160 +#: inc/settings.php:172 inc/settings.php:184 +msgid "None" +msgstr "" + +#: inc/settings.php:71 inc/settings.php:75 +msgid "Send Message" +msgstr "" + +#: inc/settings.php:91 +msgid "Form processing options" +msgstr "" + +#: inc/settings.php:97 +msgid "Contact notification sender email" +msgstr "" + +#: inc/settings.php:98 +msgid "Insert [email] to use the contact form submitter's email." +msgstr "" + +#: inc/settings.php:98 +msgid "" +"Email to use for the sender of the contact form emails both to the " +"recipients below and the contact form submitter (if this is activated " +"below). The domain for this email address should match your site's domain." +msgstr "" + +#: inc/settings.php:103 +msgid "Contact submission recipients" +msgstr "" + +#: inc/settings.php:104 +msgid "" +"Email address(es) to receive contact submission notifications. You can " +"separate multiple emails with a comma." +msgstr "" + +#: inc/settings.php:109 +msgid "Store submissions in the database" +msgstr "" + +#: inc/settings.php:110 +msgid "" +"Should the submissions be stored in the admin area? If chosen, contact form " +"submissions will be saved in Contacts on the left (appears after this " +"option is activated)." +msgstr "" + +#: inc/settings.php:115 +msgid "Add a nonce to the contact form:" +msgstr "" + +#: inc/settings.php:116 +msgid "" +"Should the form use a WordPress nonce? This helps reduce spam by ensuring " +"that the form submittor is on the site when submitting the form rather than " +"submitting remotely. This could, however, cause problems with sites using a " +"page caching plugin. Turn this off if you are getting complaints about " +"forms not being able to be submitted with an error of \"Nonce failed!\"" +msgstr "" + +#: inc/settings.php:121 +msgid "Send email confirmation to form submitter" +msgstr "" + +#: inc/settings.php:122 +msgid "" +"Adding text here will send an email to the form submitter. The email uses " +"the \"Successful form submission text\" field from the \"Alert Messages\" " +"tab as the subject line. Plain text only here, no HTML." +msgstr "" + +#: inc/settings.php:127 +msgid "\"Thank You\" URL" +msgstr "" + +#: inc/settings.php:128 +msgid "Select the post-submit page for all forms submitted" +msgstr "" + +#: inc/settings.php:136 inc/settings.php:450 +msgid "Fields Settings" +msgstr "" + +#: inc/settings.php:143 inc/settings.php:226 +msgid "Name" +msgstr "" + +#: inc/settings.php:144 +msgid "Do you want the name field to be displayed?" +msgstr "" + +#: inc/settings.php:149 inc/settings.php:161 inc/settings.php:173 +#: inc/settings.php:185 +msgid "Yes but not required" +msgstr "" + +#: inc/settings.php:150 inc/settings.php:162 inc/settings.php:174 +#: inc/settings.php:186 +msgid "Required" +msgstr "" + +#: inc/settings.php:155 +msgid "Email address" +msgstr "" + +#: inc/settings.php:156 +msgid "Do you want the email address field be displayed?" +msgstr "" + +#: inc/settings.php:167 inc/settings.php:238 inc/settings.php:241 +msgid "Subject" +msgstr "" + +#: inc/settings.php:168 +msgid "Do you want the subject field be displayed?" +msgstr "" + +#: inc/settings.php:179 inc/settings.php:244 +msgid "Message" +msgstr "" + +#: inc/settings.php:191 +msgid "Add a reCAPTCHA" +msgstr "" + +#: inc/settings.php:198 +msgid "Site key" +msgstr "" + +#: inc/settings.php:199 +msgid "Create an account here " +msgstr "" + +#: inc/settings.php:199 +msgid "to get the Site key and the Secret key for the reCaptcha." +msgstr "" + +#: inc/settings.php:205 +msgid "Secret key" +msgstr "" + +#: inc/settings.php:212 +msgid "Add an attachment field" +msgstr "" + +#: inc/settings.php:220 inc/settings.php:453 +msgid "Fields Labels" +msgstr "" + +#: inc/settings.php:229 +msgid "Your Name" +msgstr "" + +#: inc/settings.php:232 +msgid "Email" +msgstr "" + +#: inc/settings.php:235 +msgid "Your Email" +msgstr "" + +#: inc/settings.php:247 +msgid "Your message" +msgstr "" + +#: inc/settings.php:250 +msgid "Submit button" +msgstr "" + +#: inc/settings.php:258 inc/settings.php:456 +msgid "Alert Messages" +msgstr "" + +#: inc/settings.php:264 +msgid "Name required and missing" +msgstr "" + +#: inc/settings.php:267 +msgid "Enter your name" +msgstr "" + +#: inc/settings.php:270 +msgid "E-mail required and missing" +msgstr "" + +#: inc/settings.php:273 +msgid "Enter a valid email" +msgstr "" + +#: inc/settings.php:276 +msgid "Subject required and missing" +msgstr "" + +#: inc/settings.php:279 +msgid "Please enter a subject" +msgstr "" + +#: inc/settings.php:282 +msgid "Question/comment is missing" +msgstr "" + +#: inc/settings.php:285 +msgid "Enter your question or comment" +msgstr "" + +#: inc/settings.php:288 +msgid "Successful form submission text" +msgstr "" + +#: inc/settings.php:289 +msgid "" +"This text is used on the page if no \"Thank You\" URL is set above. This is " +"also used as the confirmation email title, if one is set to send out." +msgstr "" + +#: inc/settings.php:291 +msgid "Thanks, your email was sent successfully!" +msgstr "" + +#: inc/settings.php:296 +msgid "SMTP Options" +msgstr "" + +#: inc/settings.php:302 +msgid "Use SMTP to send emails?" +msgstr "" + +#: inc/settings.php:303 +msgid "Instead of PHP mail function" +msgstr "" + +#: inc/settings.php:308 +msgid "SMTP Host" +msgstr "" + +#: inc/settings.php:314 +msgid "SMTP Port" +msgstr "" + +#: inc/settings.php:320 +msgid "Use SMTP Authentication?" +msgstr "" + +#: inc/settings.php:321 +msgid "" +"If you check this box, make sure the SMTP Username and SMTP Password are " +"completed." +msgstr "" + +#: inc/settings.php:326 +msgid "SMTP Username" +msgstr "" + +#: inc/settings.php:332 +msgid "SMTP Password" +msgstr "" + +#: inc/settings.php:349 +msgid "Pirate Forms settings" +msgstr "" + +#: inc/settings.php:350 inc/settings.php:439 inc/widget.php:18 +#: inc/widget.php:19 +msgid "Pirate Forms" +msgstr "" + +#: inc/settings.php:444 +msgid "How to use" +msgstr "" + +#: inc/settings.php:447 +msgid "Options" +msgstr "" + +#: inc/settings.php:459 +msgid "SMTP" +msgstr "" + +#: inc/settings.php:466 +msgid "Welcome to Pirate Forms!" +msgstr "" + +#: inc/settings.php:467 +msgid "To get started, just " +msgstr "" + +#: inc/settings.php:468 +msgid "configure all the options " +msgstr "" + +#: inc/settings.php:468 +msgid "you need, hit save and start using the created form." +msgstr "" + +#: inc/settings.php:473 +msgid "There are 3 ways of using the newly created form:" +msgstr "" + +#: inc/settings.php:475 +msgid "Add a " +msgstr "" + +#: inc/settings.php:476 +msgid "widget" +msgstr "" + +#: inc/settings.php:478 inc/settings.php:481 +msgid "Use the shortcode " +msgstr "" + +#: inc/settings.php:479 +msgid " in any page or post." +msgstr "" + +#: inc/settings.php:483 +msgid " in the theme's files." +msgstr "" + +#: inc/settings.php:491 +msgid "Are you enjoying Pirate Forms?" +msgstr "" + +#: inc/settings.php:493 +msgid "Rate our plugin on %1$s WordPress.org %2$s. We'd really appreciate it!" +msgstr "" + +#: inc/settings.php:502 +msgid "" +"If you want a more complex Contact Form Plugin please check %1$s this link " +"%2$s." +msgstr "" + +#: inc/settings.php:669 +msgid "Save changes" +msgstr "" + +#: inc/settings.php:686 +msgid "Get Our Free Email Course" +msgstr "" + +#: inc/settings.php:710 +msgid "" +"Ready to learn how to reduce your website loading times by half? Come and " +"join the 1st lesson here!" +msgstr "" + +#: inc/settings.php:712 +msgid "" +"Thank you for subscribing! You have been added to the mailing list and will " +"receive the next email information in the coming weeks. If you ever wish to " +"unsubscribe, simply use the \"Unsubscribe\" link included in each " +"newsletter." +msgstr "" + +#: inc/settings.php:720 +msgid "Control Emails in WordPress" +msgstr "" + +#: inc/widget.php:80 +msgid "Title" +msgstr "" + +#: inc/widget.php:81 +msgid "Text above form" +msgstr "" + +#: inc/widget.php:84 +msgid "Title:" +msgstr "" + +#: inc/widget.php:90 +msgid "Subtext:" +msgstr "" + +#: pirate-forms.php:245 +msgid "Contact Referrer" +msgstr "" + +#: pirate-forms.php:255 +msgid "Referring page" +msgstr "" + +#: pirate-forms.php:387 +msgid "Nonce failed!" +msgstr "" + +#: pirate-forms.php:394 +msgid "Form submission failed!" +msgstr "" + +#: pirate-forms.php:399 +msgid "Contact form submission from" +msgstr "" + +#: pirate-forms.php:452 pirate-forms.php:462 +msgid "Wrong reCAPTCHA" +msgstr "" + +#: pirate-forms.php:469 +msgid "Please enter one or more Contact submission recipients" +msgstr "" + +#: pirate-forms.php:483 +msgid "IP address: " +msgstr "" + +#: pirate-forms.php:483 +msgid "IP search:" +msgstr "" + +#: pirate-forms.php:487 +msgid "Came from: " +msgstr "" + +#: pirate-forms.php:490 +msgid "Sent from page: " +msgstr "" + +#: pirate-forms.php:498 +msgid "Form submission blocked!" +msgstr "" + +#: pirate-forms.php:556 +msgid "Uploaded file is not allowed for file type" +msgstr "" + +#: pirate-forms.php:563 +msgid "Uploaded file is too large" +msgstr "" + +#: pirate-forms.php:576 +msgid "There was an unknown error uploading the file." +msgstr "" + +#: pirate-forms.php:727 +msgid "Add New Contact" +msgstr "" + +#: pirate-forms.php:728 +msgid "New Contact" +msgstr "" + +#: pirate-forms.php:729 +msgid "Edit Contact" +msgstr "" + +#: pirate-forms.php:730 +msgid "View Contact" +msgstr "" + +#: pirate-forms.php:731 +msgid "All Contacts" +msgstr "" + +#: pirate-forms.php:732 +msgid "Search Contacts" +msgstr "" + +#: pirate-forms.php:733 +msgid "Parent Contacts:" +msgstr "" + +#: pirate-forms.php:734 +msgid "No contacts found." +msgstr "" + +#: pirate-forms.php:735 +msgid "No contacts found in Trash." +msgstr "" + +#: pirate-forms.php:739 +msgid "Contacts from Pirate Forms" +msgstr "" + +#: pirate-forms.php:758 +msgid "Settings" +msgstr "" + +#. Plugin Name of the plugin/theme +msgid "Free & Simple Contact Form Plugin - PirateForms" +msgstr "" + +#. Plugin URI of the plugin/theme +msgid "http://themeisle.com/plugins/pirate-forms/" +msgstr "" + +#. Description of the plugin/theme +msgid "Easily creates a nice looking, simple contact form on your WP site." +msgstr "" + +#. Author of the plugin/theme +msgid "Themeisle" +msgstr "" + +#. Author URI of the plugin/theme +msgid "http://themeisle.com" +msgstr "" + +#: pirate-forms.php:722 +msgctxt "post type general name" +msgid "Contacts" +msgstr "" + +#: pirate-forms.php:723 +msgctxt "post type singular name" +msgid "Contact" +msgstr "" + +#: pirate-forms.php:724 +msgctxt "admin menu" +msgid "Contacts" +msgstr "" + +#: pirate-forms.php:725 +msgctxt "add new on admin bar" +msgid "Contact" +msgstr "" + +#: pirate-forms.php:726 +msgctxt "contact" +msgid "Add New" +msgstr "" \ No newline at end of file diff --git a/dist/dist/mailin.php b/dist/dist/mailin.php new file mode 100644 index 0000000..e2dc8b2 --- /dev/null +++ b/dist/dist/mailin.php @@ -0,0 +1,868 @@ +base_url = $base_url; + $this->api_key = $api_key; + } + /** + * Do CURL request with authorization + */ + private function do_request( $resource, $method, $input ) { + $called_url = $this->base_url . '/' . $resource; + $ch = curl_init( $called_url ); + $auth_header = 'api-key:' . $this->api_key; + $content_header = 'Content-Type:application/json'; + if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) { + // Windows only over-ride + curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); + } + curl_setopt( $ch, CURLOPT_HTTPHEADER, array( $auth_header, $content_header ) ); + curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 ); + curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, $method ); + curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); + curl_setopt( $ch, CURLOPT_HEADER, 0 ); + curl_setopt( $ch, CURLOPT_POSTFIELDS, $input ); + $data = curl_exec( $ch ); + if ( curl_errno( $ch ) ) { + echo 'Curl error: ' . curl_error( $ch ) . '\n'; + } + curl_close( $ch ); + return json_decode( $data,true ); + } + public function get( $resource, $input ) { + return $this->do_request( $resource,'GET',$input ); + } + public function put( $resource, $input ) { + return $this->do_request( $resource,'PUT',$input ); + } + public function post( $resource, $input ) { + return $this->do_request( $resource,'POST',$input ); + } + public function delete( $resource, $input ) { + return $this->do_request( $resource,'DELETE',$input ); + } + + /* + Get Account. + No input required + */ + public function get_account() { + return $this->get( 'account','' ); + } + + /* + Get SMTP details. + No input required + */ + public function get_smtp_details() { + return $this->get( 'account/smtpdetail','' ); + } + + /* + Create Child Account. + @param {Array} data contains php array with key value pair. + @options data {String} child_email: Email address of Reseller child [Mandatory] + @options data {String} password: Password of Reseller child to login [Mandatory] + @options data {String} company_org: Name of Reseller child’s company [Mandatory] + @options data {String} first_name: First name of Reseller child [Mandatory] + @options data {String} last_name: Last name of Reseller child [Mandatory] + @options data {Array} credits: Number of email & sms credits respectively, which will be assigned to the Reseller child’s account [Optional] + - email_credit {Integer} number of email credits + - sms_credit {Integer} Number of sms credts + @options data {Array} associate_ip: Associate dedicated IPs to reseller child. You can use commas to separate multiple IPs [Optional] + */ + public function create_child_account( $data ) { + return $this->post( 'account',json_encode( $data ) ); + } + + /* + Update Child Account. + @param {Array} data contains php array with key value pair. + @options data {String} auth_key: 16 character authorization key of Reseller child to be modified [Mandatory] + @options data {String} company_org: Name of Reseller child’s company [Optional] + @options data {String} first_name: First name of Reseller child [Optional] + @options data {String} last_name: Last name of Reseller child [Optional] + @options data {String} password: Password of Reseller child to login [Optional] + @options data {Array} associate_ip: Associate dedicated IPs to reseller child. You can use commas to separate multiple IPs [Optional] + @options data {Array} disassociate_ip: Disassociate dedicated IPs from reseller child. You can use commas to separate multiple IPs [Optional] + */ + public function update_child_account( $data ) { + return $this->put( 'account',json_encode( $data ) ); + } + + /* + Delete Child Account. + @param {Array} data contains php array with key value pair. + @options data {String} auth_key: 16 character authorization key of Reseller child to be deleted [Mandatory] + */ + public function delete_child_account( $data ) { + return $this->delete( 'account/' . $data['auth_key'],'' ); + } + + /* + Get Reseller child Account. + @param {Array} data contains php array with key value pair. + @options data {String} auth_key: 16 character authorization key of Reseller child. Example : To get the details of more than one child account, use, {"key1":"abC01De2fGHI3jkL","key2":"mnO45Pq6rSTU7vWX"} [Mandatory] + */ + public function get_reseller_child( $data ) { + return $this->post( 'account/getchildv2',json_encode( $data ) ); + } + + /* + Add/Remove Reseller child's Email/Sms credits. + @param {Array} data contains php array with key value pair. + @options data {String} auth_key: 16 character authorization key of Reseller child to modify credits [Mandatory] + @options data {Array} add_credit: Number of email & sms credits to be added. You can assign either email or sms credits, one at a time other will remain 0. [Mandatory: if rmv_credit is empty] + - email_credit {Integer} number of email credits + - sms_credit {Integer} Number of sms credts + @options data {Array} rmv_credit: Number of email & sms credits to be removed. You can assign either email or sms credits, one at a time other will remain 0. [Mandatory: if add_credits is empty] + - email_credit {Integer} number of email credits + - sms_credit {Integer} Number of sms credts + */ + public function add_remove_child_credits( $data ) { + return $this->post( 'account/addrmvcredit',json_encode( $data ) ); + } + + /* + Get a particular campaign detail. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Unique Id of the campaign [Mandatory] + */ + public function get_campaign_v2( $data ) { + return $this->get( 'campaign/' . $data['id'] . '/detailsv2','' ); + } + + /* + Get all campaigns detail. + @param {Array} data contains php array with key value pair. + @options data {String} type: Type of campaign. Possible values – classic, trigger, sms, template ( case sensitive ) [Optional] + @options data {String} status: Status of campaign. Possible values – draft, sent, archive, queued, suspended, in_process, temp_active, temp_inactive ( case sensitive ) [Optional] + @options data {Integer} page: Maximum number of records per request is 500, if there are more than 500 campaigns then you can use this parameter to get next 500 results [Optional] + @options data {Integer} page_limit: This should be a valid number between 1-500 [Optional] + */ + public function get_campaigns_v2( $data ) { + return $this->get( 'campaign/detailsv2',json_encode( $data ) ); + } + + /* + Create and Schedule your campaigns. It returns the ID of the created campaign. + @param {Array} data contains php array with key value pair. + @options data {String} category: Tag name of the campaign [Optional] + @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists] + @options data {String} name: Name of the campaign [Mandatory] + @options data {String} bat: Email address for test mail [Optional] + @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty] + @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty] + @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty] + @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional] + @options data {String} subject: Subject of the campaign [Mandatory] + @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists] + @options data {String} reply_to: The reply to email in the campaign emails [Optional] + @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM] To use the contact attributes here, these should already exist in SendinBlue account [Optional] + @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional] + @options data {String} attachment_url: Provide the absolute url of the attachment [Optional] + @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional] + @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional] + @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional] + + */ + public function create_campaign( $data ) { + return $this->post( 'campaign',json_encode( $data ) ); + } + + /* + Update your campaign. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of campaign to be modified [Mandatory] + @options data {String} category: Tag name of the campaign [Optional] + @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists] + @options data {String} name: Name of the campaign [Optional] + @options data {String} bat: Email address for test mail [Optional] + @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Optional] + @options data {String} html_url: Url which content is the body of content [Optional] + @options data {Array} listid These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty] + @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional] + @options data {String} subject: Subject of the campaign. + @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists] + @options data {String} reply_to: The reply to email in the campaign emails [Optional] + @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional] + @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional] + @options data {String} attachment_url: Provide the absolute url of the attachment [Optional] + @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional] + @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional] + @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional] + */ + public function update_campaign( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->put( 'campaign/' . $id,json_encode( $data ) ); + } + + /* + Delete your campaigns. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of campaign to be deleted [Mandatory] + */ + public function delete_campaign( $data ) { + return $this->delete( 'campaign/' . $data['id'],'' ); + } + + /* + Send report of Sent and Archived campaign. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of campaign to send its report [Mandatory] + @options data {String} lang: Language of email content. Possible values – fr (default), en, es, it & pt [Optional] + @options data {String} email_subject: Message subject [Mandatory] + @options data {Array} email_to: Email address of the recipient(s). Example: "test@example.net". You can use commas to separate multiple recipients [Mandatory] + @options data {String} email_content_type: Body of the message in text/HTML version. Possible values – text & html [Mandatory] + @options data {Array} email_bcc: Same as email_to but for Bcc [Optional] + @options data {Array} email_cc: Same as email_to but for Cc [Optional] + @options data {String} email_body: Body of the message [Mandatory] + */ + public function campaign_report_email( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->post( 'campaign/' . $id . '/report',json_encode( $data ) ); + } + + /* + Export the recipients of a specified campaign. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of campaign to export its recipients [Mandatory] + @options data {String} notify_url: URL that will be called once the export process is finished [Mandatory] + @options data {String} type: Type of recipients. Possible values – all, non_clicker, non_opener, clicker, opener, soft_bounces, hard_bounces & unsubscribes [Mandatory] + */ + public function campaign_recipients_export( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->post( 'campaign/' . $id . '/recipients',json_encode( $data ) ); + } + + /* + Get the Campaign name, subject and share link of the classic type campaigns only which are sent, for those which are not sent and the rest of campaign types like trigger, template & sms, will return an error message of share link not available. + @param {Array} data contains php array with key value pair. + @options data {Array} camp_ids: Id of campaign to get share link. You can use commas to separate multiple ids [Mandatory] + */ + + public function share_campaign( $data ) { + return $this->post( 'campaign/sharelinkv2',json_encode( $data ) ); + } + + /* + Send a Test Campaign. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of the campaign [Mandatory] + @options data {Array} emails: Email address of recipient(s) existing in the one of the lists & should not be blacklisted. Example: "test@example.net". You can use commas to separate multiple recipients [Mandatory] + */ + public function send_bat_email( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->post( 'campaign/' . $id . '/test',json_encode( $data ) ); + } + + /* + Update the Campaign status. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of campaign to update its status [Mandatory] + @options data {String} status: Types of status. Possible values – suspended, archive, darchive, sent, queued, replicate and replicate_template ( case sensitive ) [Mandatory] + */ + public function update_campaign_status( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->put( 'campaign/' . $id . '/updatecampstatus',json_encode( $data ) ); + } + + /* + Create and schedule your Trigger campaigns. + @param {Array} data contains php array with key value pair. + @options data {String} category: Tag name of the campaign [Optional] + @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists] + @options data {String} trigger_name: Name of the campaign [Mandatory] + @options data {String} bat: Email address for test mail [Optional] + @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty] + @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty] + @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty] + @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional] + @options data {String} subject: Subject of the campaign [Mandatory] + @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists] + @options data {String} reply_to: The reply to email in the campaign emails [Optional] + @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional] + @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional] + @options data {Integer} recurring: Type of trigger campaign. Possible values = 0 (default) & 1. recurring = 0 means contact can receive the same Trigger campaign only once, & recurring = 1 means contact can receive the same Trigger campaign several times [Optional] + @options data {String} attachment_url: Provide the absolute url of the attachment [Optional] + @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional] + @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional] + @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional] + */ + public function create_trigger_campaign( $data ) { + return $this->post( 'campaign',json_encode( $data ) ); + } + + /* + Update and schedule your Trigger campaigns. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of Trigger campaign to be modified [Mandatory] + @options data {String} category: Tag name of the campaign [Optional] + @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists] + @options data {String} trigger_name: Name of the campaign [Mandatory] + @options data {String} bat Email address for test mail [Optional] + @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty] + @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty] + @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty] + @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional] + @options data {String} subject: Subject of the campaign [Mandatory] + @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists] + @options data {String} reply_to: The reply to email in the campaign emails [Optional] + @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional] + @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional] + @options data {Integer} recurring: Type of trigger campaign. Possible values = 0 (default) & 1. recurring = 0 means contact can receive the same Trigger campaign only once, & recurring = 1 means contact can receive the same Trigger campaign several times [Optional] + @options data {String} attachment_url: Provide the absolute url of the attachment [Optional] + @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional] + @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional] + @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional] + */ + public function update_trigger_campaign( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->put( 'campaign/' . $id,json_encode( $data ) ); + } + + /* + Get all folders detail. + @param {Array} data contains php array with key value pair. + @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 folders then you can use this parameter to get next 50 results [Mandatory] + @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory] + */ + public function get_folders( $data ) { + return $this->get( 'folder',json_encode( $data ) ); + } + + /* + Get a particular folder detail. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of folder to get details [Mandatory] + */ + public function get_folder( $data ) { + return $this->get( 'folder/' . $data['id'],'' ); + } + + /* + Create a new folder. + @param {Array} data contains php array with key value pair. + @options data {String} name: Desired name of the folder to be created [Mandatory] + */ + public function create_folder( $data ) { + return $this->post( 'folder',json_encode( $data ) ); + } + + /* + Delete a specific folder information. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of folder to be deleted [Mandatory] + */ + public function delete_folder( $data ) { + return $this->delete( 'folder/' . $data['id'],'' ); + } + + /* + Update an existing folder. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of folder to be modified [Mandatory] + @options data {String} name: Desired name of the folder to be modified [Mandatory] + */ + public function update_folder( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->put( 'folder/' . $id,json_encode( $data ) ); + } + + /* + Get all lists detail. + @param {Array} data contains php array with key value pair. + @options data {Integer} list_parent: This is the existing folder id & can be used to get all lists belonging to it [Optional] + @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 processes then you can use this parameter to get next 50 results [Mandatory] + @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory] + */ + public function get_lists( $data ) { + return $this->get( 'list',json_encode( $data ) ); + } + + /* + Get a particular list detail. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of list to get details [Mandatory] + */ + public function get_list( $data ) { + return $this->get( 'list/' . $data['id'],'' ); + } + + /* + Create a new list. + @param {Array} data contains php array with key value pair. + @options data {String} list_name: Desired name of the list to be created [Mandatory] + @options data {Integer} list_parent: Folder ID [Mandatory] + */ + public function create_list( $data ) { + return $this->post( 'list',json_encode( $data ) ); + } + + /* + Update a list. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of list to be modified [Mandatory] + @options data {String} list_name: Desired name of the list to be modified [Optional] + @options data {Integer} list_parent: Folder ID [Mandatory] + */ + public function update_list( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->put( 'list/' . $id,json_encode( $data ) ); + } + + /* + Delete a specific list. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of list to be deleted [Mandatory] + */ + public function delete_list( $data ) { + return $this->delete( 'list/' . $data['id'],'' ); + } + + /* + Display details of all users for the given lists. + @param {Array} data contains php array with key value pair. + @options data {Array} listids: These are the list ids to get their data. The ids found will display records [Mandatory] + @options data {String} timestamp: This is date-time filter to fetch modified user records >= this time. Valid format Y-m-d H:i:s. Example: "2015-05-22 14:30:00" [Optional] + @options data {Integer} page: Maximum number of records per request is 500, if in your list there are more than 500 users then you can use this parameter to get next 500 results [Optional] + @options data {Integer} page_limit: This should be a valid number between 1-500 [Optional] + */ + public function display_list_users( $data ) { + return $this->post( 'list/display',json_encode( $data ) ); + } + + /* + Add already existing users in the SendinBlue contacts to the list. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of list to link users in it [Mandatory] + @options data {Array} users: Email address of the already existing user(s) in the SendinBlue contacts. Example: "test@example.net". You can use commas to separate multiple users [Mandatory] + */ + + public function add_users_list( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->post( 'list/' . $id . '/users',json_encode( $data ) ); + } + + /* + Delete already existing users in the SendinBlue contacts from the list. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of list to unlink users from it [Mandatory] + @options data {Array} users: Email address of the already existing user(s) in the SendinBlue contacts to be modified. Example: "test@example.net". You can use commas to separate multiple users [Mandatory] + */ + public function delete_users_list( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->delete( 'list/' . $id . '/delusers',json_encode( $data ) ); + } + + /* + Access all the attributes information under the account. + No input required + */ + public function get_attributes() { + return $this->get( 'attribute','' ); + } + + /* + Access the specific type of attribute information. + @param {Array} data contains php array with key value pair. + @options data {String} type: Type of attribute. Possible values – normal, transactional, category, calculated & global [Optional] + */ + public function get_attribute( $data ) { + return $this->get( 'attribute/' . $data['type'],'' ); + } + + /* + Create an Attribute. + @param {Array} data contains php array with key value pair. + @options data {String} type: Type of attribute. Possible values – normal, transactional, category, calculated & global ( case sensitive ) [Mandatory] + @options data {Array} data: The name and data type of ‘normal’ & ‘transactional’ attribute to be created in your SendinBlue account. It should be sent as an associative array. Example: array(‘ATTRIBUTE_NAME1′ => ‘DATA_TYPE1′, ‘ATTRIBUTE_NAME2’=> ‘DATA_TYPE2′). + The name and data value of ‘category’, ‘calculated’ & ‘global’, should be sent as JSON string. Example: ‘[{ "name":"ATTRIBUTE_NAME1", "value":"Attribute_value1" }, { "name":"ATTRIBUTE_NAME2", "value":"Attribute_value2" }]’. You can use commas to separate multiple attributes [Mandatory] + */ + public function create_attribute( $data ) { + return $this->post( 'attribute/',json_encode( $data ) ); + } + + /* + Delete a specific type of attribute information. + @param {Array} data contains php array with key value pair. + @options data {Integer} type: Type of attribute to be deleted [Mandatory] + */ + public function delete_attribute( $type, $data ) { + $type = $data['type']; + unset( $data['type'] ); + return $this->post( 'attribute/' . $type,json_encode( $data ) ); + } + + /* + Create a new user if an email provided as input, doesn’t exists in the contact list of your SendinBlue account, otherwise it will update the existing user. + @param {Array} data contains php array with key value pair. + @options data {String} email: Email address of the user to be created in SendinBlue contacts. Already existing email address of user in the SendinBlue contacts to be modified [Mandatory] + @options data {Array} attributes: The name of attribute present in your SendinBlue account. It should be sent as an associative array. Example: array("NAME"=>"name"). You can use commas to separate multiple attributes [Optional] + @options data {Integer} blacklisted: This is used to blacklist/ Unblacklist a user. Possible values – 0 & 1. blacklisted = 1 means user has been blacklisted [Optional] + @options data {Array} listid: The list id(s) to be linked from user [Optional] + @options data {Array} listid_unlink: The list id(s) to be unlinked from user [Optional] + @options data {Array} blacklisted_sms: This is used to blacklist/ Unblacklist a user’s SMS number. Possible values – 0 & 1. blacklisted_sms = 1 means user’s SMS number has been blacklisted [Optional] + */ + public function create_update_user( $data ) { + return $this->post( 'user/createdituser',json_encode( $data ) ); + } + + /* + Get Access a specific user Information. + @param {Array} data contains php array with key value pair. + @options data {String} email: Email address of the already existing user in the SendinBlue contacts [Mandatory] + */ + public function get_user( $data ) { + return $this->get( 'user/' . $data['email'],'' ); + } + + /* + Unlink existing user from all lists. + @param {Array} data contains php array with key value pair. + @options data {String} email: Email address of the already existing user in the SendinBlue contacts to be unlinked from all lists [Mandatory] + */ + public function delete_user( $data ) { + return $this->delete( 'user/' . $data['email'],'' ); + } + + /* + Import Users Information. + @param {Array} data contains php array with key value pair. + @options data {String} url: The URL of the file to be imported. Possible file types – .txt, .csv [Mandatory: if body is empty] + @options data {String} body: The Body with csv content to be imported. Example: ‘NAME;SURNAME;EMAIL\n"Name1";"Surname1";"example1@example.net"\n"Name2";"Surname2";"example2@example.net"‘, where \n separates each user data. You can use semicolon to separate multiple attributes [Mandatory: if url is empty] + @options data {Array} listids: These are the list ids in which the the users will be imported [Mandatory: if name is empty] + @options data {String} notify_url: URL that will be called once the import process is finished [Optional] In notify_url, we are sending the content using POST method + @options data {String} name: This is new list name which will be created first & then users will be imported in it [Mandatory: if listids is empty] + @options data {Integer} list_parent: This is the existing folder id & can be used with name parameter to make newly created list’s desired parent [Optional] + */ + public function import_users( $data ) { + return $this->post( 'user/import',json_encode( $data ) ); + } + + /* + Export Users Information. + @param {Array} data contains php array with key value pair. + @options data {String} export_attrib: The name of attribute present in your SendinBlue account. You can use commas to separate multiple attributes. Example: "EMAIL,NAME,SMS" [Optional] + @options data {String} filter: Filter can be added to export users. Example: "{\"blacklisted\":1}", will export all blacklisted users [Mandatory] + @options data {String} notify_url: URL that will be called once the export process is finished [Optional] + */ + public function export_users( $data ) { + return $this->post( 'user/export',json_encode( $data ) ); + } + + /* + Get all the processes information under the account. + @param {Array} data contains php array with key value pair. + @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 processes then you can use this parameter to get next 50 results [Mandatory] + @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory] + */ + public function get_processes( $data ) { + return $this->get( 'process',json_encode( $data ) ); + } + + /* + Get the process information. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of process to get details [Mandatory] + */ + public function get_process( $data ) { + return $this->get( 'process/' . $data['id'],'' ); + } + + /* + To retrieve details of all webhooks. + @param {Array} data contains php array with key value pair. + @options data {String} is_plat: Flag to get webhooks. Possible values – 0 & 1. Example: to get Transactional webhooks, use $is_plat=0, to get Marketing webhooks, use $is_plat=1, & to get all webhooks, use $is_plat="" [Optional] + */ + public function get_webhooks( $data ) { + return $this->get( 'webhook',json_encode( $data ) ); + } + + /* + To retrieve details of any particular webhook. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of webhook to get details [Mandatory] + */ + public function get_webhook( $data ) { + return $this->get( 'webhook/' . $data['id'],'' ); + } + + /* + Create a Webhook. + @param {Array} data contains php array with key value pair. + @options data {String} url: URL that will be triggered by a webhook [Mandatory] + @options data {String} description: Webook description [Optional] + @options data {Array} events: Set of events. You can use commas to separate multiple events. Possible values for Transcational webhook – request, delivered, hard_bounce, soft_bounce, blocked, spam, invalid_email, deferred, click, & opened and Possible Values for Marketing webhook – spam, opened, click, hard_bounce, unsubscribe, soft_bounce & list_addition ( case sensitive ) [Mandatory] + @options data {Integer} is_plat: Flag to create webhook type. Possible values – 0 (default) & 1. Example: to create Transactional webhooks, use $is_plat=0, & to create Marketing webhooks, use $is_plat=1 [Optional] + */ + public function create_webhook( $data ) { + return $this->post( 'webhook',json_encode( $data ) ); + } + + /* + Delete a webhook. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of webhook to be deleted [Mandatory] + */ + public function delete_webhook( $data ) { + return $this->delete( 'webhook/' . $data['id'],'' ); + } + + /* + Update a webhook. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of webhook to be modified [Mandatory] + @options data {String} url: URL that will be triggered by a webhook [Mandatory] + @options data {String} description: Webook description [Optional] + @options data {Array} events: Set of events. You can use commas to separate multiple events. Possible values for Transcational webhook – request, delivered, hard_bounce, soft_bounce, blocked, spam, invalid_email, deferred, click, & opened and Possible Values for Marketing webhook – spam, opened, click, hard_bounce, unsubscribe, soft_bounce & list_addition ( case sensitive ) [Mandatory] + */ + public function update_webhook( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->put( 'webhook/' . $id,json_encode( $data ) ); + } + + /* + Get Access of created senders information. + @param {Array} data contains php array with key value pair. + @options data {String} option: Options to get senders. Possible options – IP-wise, & Domain-wise ( only for dedicated IP clients ). Example: to get senders with specific IP, use $option=’1.2.3.4′, to get senders with specific domain use, $option=’domain.com’, & to get all senders, use $option="" [Optional] + */ + public function get_senders( $data ) { + return $this->get( 'advanced',json_encode( $data ) ); + } + + /* + Create your Senders. + @param {Array} data contains php array with key value pair. + @options data {String} name: Name of the sender [Mandatory] + @options data {String} email: Email address of the sender [Mandatory] + @options data {Array} ip_domain: Pass pipe ( | ) separated Dedicated IP and its associated Domain. Example: "1.2.3.4|mydomain.com". You can use commas to separate multiple ip_domain’s [Mandatory: Only for Dedicated IP clients, for Shared IP clients, it should be kept blank] + */ + public function create_sender( $data ) { + return $this->post( 'advanced',json_encode( $data ) ); + } + + /* + Update your Senders. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of sender to be modified [Mandatory] + @options data {String} name: Name of the sender [Mandatory] + @options data {Array} ip_domain: Pass pipe ( | ) separated Dedicated IP and its associated Domain. Example: "1.2.3.4|mydomain.com". You can use commas to separate multiple ip_domain’s [Mandatory: Only for Dedicated IP clients, for Shared IP clients, it should be kept blank] + */ + public function update_sender( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->put( 'advanced/' . $id,json_encode( $data ) ); + } + + /* + Delete your Sender Information. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of sender to be deleted [Mandatory] + */ + public function delete_sender( $data ) { + return $this->delete( 'advanced/' . $data['id'],'' ); + } + + /* + Send Transactional Email. + @param {Array} data contains php array with key value pair. + @options data {Array} to: Email address of the recipient(s). It should be sent as an associative array. Example: array("to@example.net"=>"to whom"). You can use commas to separate multiple recipients [Mandatory] + @options data {String} subject: Message subject [Mandatory] + @options data {Array} from Email address for From header. It should be sent as an array. Example: array("from@email.com","from email") [Mandatory] + @options data {String} html: Body of the message. (HTML version) [Mandatory]. To send inline images, use image, the 'src' attribute value inside {} (curly braces) should be same as the filename used in 'inline_image' parameter + @options data {String} text: Body of the message. (text version) [Optional] + @options data {Array} cc: Same as to but for Cc. Example: array("cc@example.net","cc whom") [Optional] + @options data {Array} bcc: Same as to but for Bcc. Example: array("bcc@example.net","bcc whom") [Optional] + @options data {Array} replyto: Same as from but for Reply To. Example: array("from@email.com","from email") [Optional] + @options data {Array} attachment: Provide the absolute url of the attachment/s. Possible extension values = gif, png, bmp, cgm, jpg, jpeg, txt, css, shtml, html, htm, csv, zip, pdf, xml, doc, xls, ppt, tar, and ez. To send attachment/s generated on the fly you have to pass your attachment/s filename & its base64 encoded chunk data as an associative array. Example: array("YourFileName.Extension"=>"Base64EncodedChunkData"). You can use commas to separate multiple attachments [Optional] + @options data {Array} headers: The headers will be sent along with the mail headers in original email. Example: array("Content-Type"=>"text/html; charset=iso-8859-1"). You can use commas to separate multiple headers [Optional] + @options data {Array} inline_image: Pass your inline image/s filename & its base64 encoded chunk data as an associative array. Example: array("YourFileName.Extension"=>"Base64EncodedChunkData"). You can use commas to separate multiple inline images [Optional] + */ + public function send_email( $data ) { + return $this->post( 'email',json_encode( $data ) ); + } + + /* + Aggregate / date-wise report of the SendinBlue SMTP account. + @param {Array} data contains php array with key value pair. + @options data {Integer} aggregate: This is used to indicate, you are interested in all-time totals. Possible values – 0 & 1. aggregate = 0 means it will not aggregate records, and will show stats per day/date wise [Optional] + @options data {String} start_date: The start date to look up statistics. Date must be in YYYY-MM-DD format and should be before the end_date [Optional] + @options data {String} end_date: The end date to look up statistics. Date must be in YYYY-MM-DD format and should be after the start_date [Optional] + @options data {Integer} days: Number of days in the past to include statistics ( Includes today ). It must be an integer greater than 0 [Optional] + @options data {String} tag: The tag you will specify to retrieve detailed stats. It must be an existing tag that has statistics [Optional] + */ + public function get_statistics( $data ) { + return $this->post( 'statistics',json_encode( $data ) ); + } + + /* + Get Email Event report. + @param {Array} data contains php array with key value pair. + @options data {Integer} limit: To limit the number of results returned. It should be an integer [Optional] + @options data {String} start_date: The start date to get report from. Date must be in YYYY-MM-DD format and should be before the end_date [Optional] + @options data {String} end_date: The end date to get report till date. Date must be in YYYY-MM-DD format and should be after the start_date [Optional] + @options data {Integer} offset: Beginning point in the list to retrieve from. It should be an integer [Optional] + @options data {String} date: Specific date to get its report. Date must be in YYYY-MM-DD format and should be earlier than todays date [Optional] + @options data {Integer} days: Number of days in the past (includes today). If specified, must be an integer greater than 0 [Optional] + @options data {String} email: Email address to search report for [Optional] + */ + public function get_report( $data ) { + return $this->post( 'report',json_encode( $data ) ); + } + + /* + Delete any hardbounce, which actually would have been blocked due to some temporary ISP failures. + @param {Array} data contains php array with key value pair. + @options data {String} start_date: The start date to get report from. Date must be in YYYY-MM-DD format and should be before the end_date [Optional] + @options data {String} end_date: The end date to get report till date. Date must be in YYYY-MM-DD format and should be after the start_date [Optional] + @options data {String} email: Email address to delete its bounces [Optional] + */ + public function delete_bounces( $data ) { + return $this->post( 'bounces',json_encode( $data ) ); + } + + /* + Send templates created on SendinBlue, through SendinBlue SMTP (transactional mails). + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of the template created on SendinBlue account [Mandatory] + @options data {String} to: Email address of the recipient(s). You can use pipe ( | ) to separate multiple recipients. Example: "to-example@example.net|to2-example@example.net" [Mandatory] + @options data {String} cc: Same as to but for Cc [Optional] + @options data {String} bcc: Same as to but for Bcc [Optional] + @options data {Array} attrv The name of attribute present in your SendinBlue account. It should be sent as an associative array. Example: array("NAME"=>"name"). You can use commas to separate multiple attributes [Optional] + @options data {String} attachment_url: Provide the absolute url of the attachment. Url not allowed from local machine. File must be hosted somewhere [Optional] + @options data {Array} attachment: To send attachment/s generated on the fly you have to pass your attachment/s filename & its base64 encoded chunk data as an associative array [Optional] + */ + public function send_transactional_template( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->put( 'template/' . $id,json_encode( $data ) ); + } + + /* + Create a Template. + @param {Array} data contains php array with key value pair. + @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists] + @options data {String} template_name: Name of the Template [Mandatory] + @options data {String} bat: Email address for test mail [Optional] + @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty] + @options data {String} html_url Url: which content is the body of content [Mandatory: if html_content is empty] + @options data {String} subject: Subject of the campaign [Mandatory] + @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists] + @options data {String} reply_to: The reply to email in the campaign emails [Optional] + @options data {String} to_fieldv This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional] + @options data {Integer} status: Status of template. Possible values = 0 (default) & 1. status = 0 means template is inactive, & status = 1 means template is active [Optional] + @options data {Integer} attachment: Status of attachment. Possible values = 0 (default) & 1. attach = 0 means an attachment can’t be sent, & attach = 1 means an attachment can be sent, in the email [Optional] + */ + public function create_template( $data ) { + return $this->post( 'template',json_encode( $data ) ); + } + + /* + Update a Template. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of Template to be modified [Mandatory] + @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists] + @options data {String} template_name: Name of the Template [Mandatory] + @options data {String} bat: Email address for test mail [Optional] + @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty] + @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty] + @options data {String} subject: Subject of the campaign [Mandatory] + @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists] + @options data {String} reply_to: The reply to email in the campaign emails [Optional] + @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional] + @options data {Integer} status: Status of template. Possible values = 0 (default) & 1. status = 0 means template is inactive, & status = 1 means template is active [Optional] + @options data {Integer} attachment: Status of attachment. Possible values = 0 (default) & 1. attach = 0 means an attachment can’t be sent, & attach = 1 means an attachment can be sent, in the email [Optional] + */ + public function update_template( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->put( 'template/' . $id,json_encode( $data ) ); + } + + /* + Send a transactional SMS. + @param {Array} data contains php array with key value pair. + @options data {String} to: The mobile number to send SMS to with country code [Mandatory] + @options data {String} from: The name of the sender. The number of characters is limited to 11 (alphanumeric format) [Mandatory] + @options data {String} text: The text of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Mandatory] + @options data {String} web_url: The web URL that can be called once the message is successfully delivered [Optional] + @options data {String} tag: The tag that you can associate with the message [Optional] + @options data {String} type: Type of message. Possible values – marketing (default) & transactional. You can use marketing for sending marketing SMS, & for sending transactional SMS, use transactional type [Optional] + */ + public function send_sms( $data ) { + return $this->post( 'sms',json_encode( $data ) ); + } + + /* + Create & Schedule your SMS campaigns. + @param {Array} data contains php array with key value pair. + @options data {String} name: Name of the SMS campaign [Mandatory] + @options data {String} sender: This allows you to customize the SMS sender. The number of characters is limited to 11 ( alphanumeric format ) [Optional] + @options data {String} content: Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Optional] + @options data {String} bat: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Optional] + @options data {Array} listid: These are the list ids to which the SMS campaign is sent [Mandatory: if scheduled_date is not empty] + @options data {Array} exclude_list: These are the list ids which will be excluded from the SMS campaign [Optional] + @options data {String} scheduled_date: The day on which the SMS campaign is supposed to run [Optional] + @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional] + */ + public function create_sms_campaign( $data ) { + return $this->post( 'sms',json_encode( $data ) ); + } + + /* + Update your SMS campaigns. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of the SMS campaign [Mandatory] + @options data {String} name: Name of the SMS campaign [Optional] + @options data {String} sender: This allows you to customize the SMS sender. The number of characters is limited to 11 ( alphanumeric format ) [Optional] + @options data {String} content: Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Optional] + @options data {String} bat: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Optional] + @options data {Array} listid: hese are the list ids to which the SMS campaign is sent [Mandatory: if scheduled_date is not empty] + @options data {Array} exclude_list: These are the list ids which will be excluded from the SMS campaign [Optional] + @options data {String} scheduled_date: The day on which the SMS campaign is supposed to run [Optional] + @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional] + */ + public function update_sms_campaign( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->put( 'sms/' . $id,json_encode( $data ) ); + } + + /* + Send a Test SMS. + @param {Array} data contains php array with key value pair. + @options data {Integer} id: Id of the SMS campaign [Mandatory] + @options data {String} to: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Mandatory] + */ + public function send_bat_sms( $data ) { + $id = $data['id']; + unset( $data['id'] ); + return $this->get( 'sms/' . $id,json_encode( $data ) ); + } + +} + diff --git a/dist/dist/pirate-forms.php b/dist/dist/pirate-forms.php new file mode 100644 index 0000000..01c2fde --- /dev/null +++ b/dist/dist/pirate-forms.php @@ -0,0 +1,794 @@ + +

' . sanitize_text_field( pirate_forms_get_key( 'pirateformsopt_label_submit' ) ) . '

+ '; + } + /** + ******** FormBuilder */ + if ( ! class_exists( 'PhpFormBuilder' ) ) { + require_once( dirname( __FILE__ ) . '/inc/PhpFormBuilder.php' ); + } + $pirate_form = new PhpFormBuilder(); + $pirate_form->set_att( 'id', 'pirate_forms_' . ( get_the_id() ? get_the_id() : 1 ) ); + $pirate_form->set_att( 'class', array( 'pirate_forms' ) ); + if ( 'yes' === pirate_forms_get_key( 'pirateformsopt_nonce' ) ) { + $pirate_form->set_att( 'add_nonce', get_bloginfo( 'admin_email' ) ); + } + $pirate_forms_options = get_option( 'pirate_forms_settings_array' ); + if ( ! empty( $pirate_forms_options ) ) : + /* Count the number of requested fields from Name, Email and Subject to add a certain class col-12, col-6 or col-4 */ + $pirate_forms_required_fields = 0; + if ( ! empty( $pirate_forms_options['pirateformsopt_name_field'] ) && ! empty( $pirate_forms_options['pirateformsopt_label_name'] ) ) : + $pirateformsopt_name_field = $pirate_forms_options['pirateformsopt_name_field']; + $pirateformsopt_name_label = $pirate_forms_options['pirateformsopt_label_name']; + if ( ! empty( $pirateformsopt_name_field ) && ! empty( $pirateformsopt_name_label ) && ( $pirateformsopt_name_field != '' ) ) : + $pirate_forms_required_fields ++; + endif; + endif; + if ( ! empty( $pirate_forms_options['pirateformsopt_email_field'] ) && ! empty( $pirate_forms_options['pirateformsopt_label_email'] ) ) : + $pirateformsopt_email_field = $pirate_forms_options['pirateformsopt_email_field']; + $pirateformsopt_email_label = $pirate_forms_options['pirateformsopt_label_email']; + if ( ! empty( $pirateformsopt_email_field ) && ! empty( $pirateformsopt_email_label ) && ( $pirateformsopt_email_field != '' ) ) : + $pirate_forms_required_fields ++; + endif; + endif; + if ( ! empty( $pirate_forms_options['pirateformsopt_subject_field'] ) && ! empty( $pirate_forms_options['pirateformsopt_label_subject'] ) ) : + $pirateformsopt_subject_field = $pirate_forms_options['pirateformsopt_subject_field']; + $pirateformsopt_subject_label = $pirate_forms_options['pirateformsopt_label_subject']; + if ( ! empty( $pirateformsopt_subject_field ) && ! empty( $pirateformsopt_subject_label ) && ( $pirateformsopt_subject_field != '' ) ) : + $pirate_forms_required_fields ++; + endif; + endif; + $pirate_forms_layout_input = ''; + switch ( $pirate_forms_required_fields ) { + case 1: + $pirate_forms_layout_input = 'col-sm-12 col-lg-12'; + break; + case 2: + $pirate_forms_layout_input = 'col-sm-6 col-lg-6'; + break; + case 3: + $pirate_forms_layout_input = 'col-sm-4 col-lg-4'; + break; + default: + $pirate_forms_layout_input = 'col-sm-4 col-lg-4'; + } + /** + ****** Name field */ + if ( ! empty( $pirateformsopt_name_field ) && ! empty( $pirateformsopt_name_label ) ) : + $required = $pirateformsopt_name_field === 'req' ? true : false; + $wrap_classes = array( + $pirate_forms_layout_input . ' form_field_wrap', + 'contact_name_wrap pirate_forms_three_inputs ', + ); + // If this field was submitted with invalid data + if ( isset( $_SESSION['pirate_forms_contact_errors']['contact-name'] ) ) { + $wrap_classes[] = 'error'; + } + $pirate_form->add_input( + '', + array( + 'placeholder' => stripslashes( sanitize_text_field( $pirateformsopt_name_label ) ), + 'required' => $required, + 'wrap_class' => $wrap_classes, + ), + 'pirate-forms-contact-name' + ); + endif; + /** + ****** Email field */ + if ( ! empty( $pirateformsopt_email_field ) && ! empty( $pirateformsopt_email_label ) ) : + $required = $pirateformsopt_email_field === 'req' ? true : false; + $wrap_classes = array( + $pirate_forms_layout_input . ' form_field_wrap', + 'contact_email_wrap pirate_forms_three_inputs ', + ); + // If this field was submitted with invalid data + if ( isset( $_SESSION['pirate_forms_contact_errors']['contact-email'] ) ) { + $wrap_classes[] = 'error'; + } + $pirate_form->add_input( + '', + array( + 'placeholder' => stripslashes( sanitize_text_field( $pirateformsopt_email_label ) ), + 'required' => $required, + 'type' => 'email', + 'wrap_class' => $wrap_classes, + ), + 'pirate-forms-contact-email' + ); + endif; + /** + ****** Subject field */ + if ( ! empty( $pirateformsopt_subject_field ) && ! empty( $pirateformsopt_subject_label ) ) : + $required = $pirateformsopt_subject_field === 'req' ? true : false; + $wrap_classes = array( + $pirate_forms_layout_input . ' form_field_wrap', + 'contact_subject_wrap pirate_forms_three_inputs ', + ); + // If this field was submitted with invalid data + if ( isset( $_SESSION['pirate_forms_contact_errors']['contact-subject'] ) ) { + $wrap_classes[] = 'error'; + } + $pirate_form->add_input( + '', + array( + 'placeholder' => stripslashes( sanitize_text_field( $pirateformsopt_subject_label ) ), + 'required' => $required, + 'wrap_class' => $wrap_classes, + ), + 'pirate-forms-contact-subject' + ); + endif; + /** + ****** Message field */ + if ( ! empty( $pirate_forms_options['pirateformsopt_message_field'] ) && ! empty( $pirate_forms_options['pirateformsopt_label_message'] ) ) : + $pirateformsopt_message_field = $pirate_forms_options['pirateformsopt_message_field']; + $pirateformsopt_message_label = $pirate_forms_options['pirateformsopt_label_message']; + if ( ! empty( $pirateformsopt_message_field ) && ! empty( $pirateformsopt_message_label ) ) : + $required = $pirateformsopt_message_field === 'req' ? true : false; + $wrap_classes = array( 'col-sm-12 col-lg-12 form_field_wrap', 'contact_message_wrap ' ); + // If this field was submitted with invalid data + if ( isset( $_SESSION['pirate_forms_contact_errors']['contact-message'] ) ) { + $wrap_classes[] = 'error'; + } + $pirate_form->add_input( + '', + array( + 'placeholder' => stripslashes( sanitize_text_field( $pirateformsopt_message_label ) ), + 'required' => $required, + 'wrap_class' => $wrap_classes, + 'type' => 'textarea', + ), + 'pirate-forms-contact-message' + ); + endif; + endif; + /** + ******* ReCaptcha */ + if ( ! empty( $pirate_forms_options['pirateformsopt_recaptcha_secretkey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_sitekey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_field'] ) && ( $pirate_forms_options['pirateformsopt_recaptcha_field'] == 'yes' ) ) : + $pirateformsopt_recaptcha_sitekey = $pirate_forms_options['pirateformsopt_recaptcha_sitekey']; + $pirateformsopt_recaptcha_secretkey = $pirate_forms_options['pirateformsopt_recaptcha_secretkey']; + $pirate_form->add_input( + '', + array( + 'value' => $pirateformsopt_recaptcha_sitekey, + 'wrap_class' => 'col-xs-12 col-sm-6 col-lg-6 form_field_wrap form_captcha_wrap', + 'type' => 'captcha', + ), + 'pirate-forms-captcha' + ); + endif; + /** + ******** Attachment */ + if ( ! empty( $pirate_forms_options['pirateformsopt_attachment_field'] ) && ( $pirate_forms_options['pirateformsopt_attachment_field'] == 'yes' ) ) { + $pirate_form->add_input( + '', + array( + 'wrap_class' => $wrap_classes, + 'type' => 'file', + ), + 'pirate-forms-attachment' + ); + + } + /** + ****** Submit button */ + if ( ! empty( $pirate_forms_options['pirateformsopt_label_submit_btn'] ) ) : + $pirateformsopt_label_submit_btn = $pirate_forms_options['pirateformsopt_label_submit_btn']; + if ( ! empty( $pirateformsopt_label_submit_btn ) ) : + $wrap_classes = array(); + $pirate_form->add_input( + '', + array( + 'value' => stripslashes( sanitize_text_field( $pirateformsopt_label_submit_btn ) ), + 'wrap_class' => $wrap_classes, + 'type' => 'submit', + 'wrap_tag' => '', + 'class' => 'pirate-forms-submit-button', + ), + 'pirate-forms-contact-submit' + ); + endif; + endif; + endif; + /* Referring site or page, if any */ + if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) { + $pirate_form->add_input( + __( 'Contact Referrer', 'pirate-forms' ), + array( + 'type' => 'hidden', + 'value' => $_SERVER['HTTP_REFERER'], + ) + ); + } + /* Referring page, if sent via URL query */ + if ( ! empty( $_REQUEST['src'] ) || ! empty( $_REQUEST['ref'] ) ) { + $pirate_form->add_input( + __( 'Referring page', 'pirate-forms' ), + array( + 'type' => 'hidden', + 'value' => ! empty( $_REQUEST['src'] ) ? $_REQUEST['src'] : $_REQUEST['ref'], + ) + ); + } + /* Are there any submission errors? */ + $errors = ''; + if ( ! empty( $_SESSION['pirate_forms_contact_errors'] ) ) { + $errors = pirate_forms_display_errors( $_SESSION['pirate_forms_contact_errors'] ); + unset( $_SESSION['pirate_forms_contact_errors'] ); + } + + /* Display the form */ + + return $pirate_forms_thankyou_message . ' +
+ ' . $errors . ' + ' . $pirate_form->build_form( false ) . ' +
+
'; + +} + +/** + * Functions to Process uploaded files + */ +function pirate_forms_canonicalize( $text ) { + if ( function_exists( 'mb_convert_kana' ) + && 'UTF-8' == get_option( 'blog_charset' ) + ) { + $text = mb_convert_kana( $text, 'asKV', 'UTF-8' ); + } + $text = strtolower( $text ); + $text = trim( $text ); + + return $text; +} + +function pirate_forms_antiscript_file_name( $filename ) { + $filename = basename( $filename ); + $parts = explode( '.', $filename ); + if ( count( $parts ) < 2 ) { + return $filename; + } + $script_pattern = '/^(php|phtml|pl|py|rb|cgi|asp|aspx)\d?$/i'; + $filename = array_shift( $parts ); + $extension = array_pop( $parts ); + foreach ( (array) $parts as $part ) { + if ( preg_match( $script_pattern, $part ) ) { + $filename .= '.' . $part . '_'; + } else { + $filename .= '.' . $part; + } + } + if ( preg_match( $script_pattern, $extension ) ) { + $filename .= '.' . $extension . '_.txt'; + } else { + $filename .= '.' . $extension; + } + + return $filename; +} + +function pirate_forms_upload_dir( $type = false ) { + $uploads = wp_upload_dir(); + $uploads = apply_filters( 'pirate_forms_upload_dir', array( + 'dir' => $uploads['basedir'], + 'url' => $uploads['baseurl'], + ) ); + if ( 'dir' == $type ) { + return $uploads['dir']; + } + if ( 'url' == $type ) { + return $uploads['url']; + } + + return $uploads; +} + +function pirate_forms_upload_tmp_dir() { + return pirate_forms_upload_dir( 'dir' ) . '/pirate_forms_uploads'; +} + +function pirate_forms_init_uploads() { + $dir = pirate_forms_upload_tmp_dir(); + wp_mkdir_p( $dir ); + $htaccess_file = trailingslashit( $dir ) . '.htaccess'; + if ( file_exists( $htaccess_file ) ) { + return; + } + try { + $handle = fopen( $htaccess_file, 'w' ); + + if ( ! $handle ) { + throw new Exception( 'File open failed.' ); + } else { + fwrite( $handle, "Deny from all\n" ); + fclose( $handle ); + } + } catch ( Exception $e ) { + + } +} + +function pirate_forms_maybe_add_random_dir( $dir ) { + do { + $rand_max = mt_getrandmax(); + $rand = zeroise( mt_rand( 0, $rand_max ), strlen( $rand_max ) ); + $dir_new = path_join( $dir, $rand ); + } while ( file_exists( $dir_new ) ); + if ( wp_mkdir_p( $dir_new ) ) { + return $dir_new; + } + + return $dir; +} + +function pirate_forms_table_row( $key, $value ) { + return '' . $key . '' . $value . ''; +} + +/** + * Process the incoming contact form data, if any + */ +add_action( 'template_redirect', 'pirate_forms_process_contact' ); +function pirate_forms_process_contact() { + // If POST and honeypot are not set, beat it + if ( empty( $_POST ) || ! isset( $_POST['honeypot'] ) ) { + return false; + } + // Session variable for form errors + $_SESSION['pirate_forms_contact_errors'] = array(); + // If nonce is not valid, beat it + if ( 'yes' === pirate_forms_get_key( 'pirateformsopt_nonce' ) ) { + if ( ! wp_verify_nonce( $_POST['wordpress-nonce'], get_bloginfo( 'admin_email' ) ) ) { + $_SESSION['pirate_forms_contact_errors']['nonce'] = __( 'Nonce failed!', 'pirate-forms' ); + + return false; + } + } + // If the honeypot caught a bear, beat it + if ( ! empty( $_POST['honeypot'] ) ) { + $_SESSION['pirate_forms_contact_errors']['honeypot'] = __( 'Form submission failed!', 'pirate-forms' ); + + return false; + } + // Start the body of the contact email + $body = '

' . __( 'Contact form submission from', 'pirate-forms' ) . ' ' . + get_bloginfo( 'name' ) . ' (' . site_url() . ')

'; + + $body .= ''; + /** + ******* Sanitize and validate name */ + $pirate_forms_contact_name = isset( $_POST['pirate-forms-contact-name'] ) ? sanitize_text_field( trim( $_POST['pirate-forms-contact-name'] ) ) : ''; + // if name is required and is missing + if ( ( pirate_forms_get_key( 'pirateformsopt_name_field' ) === 'req' ) && empty( $pirate_forms_contact_name ) ) { + $_SESSION['pirate_forms_contact_errors']['pirate-forms-contact-name'] = pirate_forms_get_key( 'pirateformsopt_label_err_name' ); + } // If not required and empty, leave it out + elseif ( ! empty( $pirate_forms_contact_name ) ) { + $body .= pirate_forms_table_row( stripslashes( pirate_forms_get_key( 'pirateformsopt_label_name' ) ), $pirate_forms_contact_name ); + } + /** + ***** Sanitize and validate email */ + $pirate_forms_contact_email = isset( $_POST['pirate-forms-contact-email'] ) ? sanitize_email( $_POST['pirate-forms-contact-email'] ) : ''; + // If required, is it valid? + if ( ( pirate_forms_get_key( 'pirateformsopt_email_field' ) === 'req' ) && ! filter_var( $pirate_forms_contact_email, FILTER_VALIDATE_EMAIL ) ) { + $_SESSION['pirate_forms_contact_errors']['pirate-forms-contact-email'] = pirate_forms_get_key( 'pirateformsopt_label_err_email' ); + } // If not required and empty, leave it out + elseif ( ! empty( $pirate_forms_contact_email ) ) { + $body .= pirate_forms_table_row( stripslashes( pirate_forms_get_key( 'pirateformsopt_label_email' ) ), $pirate_forms_contact_email ); + } + /** + ******* Sanitize and validate subject */ + $pirate_forms_contact_subject = isset( $_POST['pirate-forms-contact-subject'] ) ? sanitize_text_field( trim( $_POST['pirate-forms-contact-subject'] ) ) : ''; + // if subject is required and is missing + if ( ( pirate_forms_get_key( 'pirateformsopt_subject_field' ) === 'req' ) && empty( $pirate_forms_contact_subject ) ) { + $_SESSION['pirate_forms_contact_errors']['pirate-forms-contact-subject'] = pirate_forms_get_key( 'pirateformsopt_label_err_subject' ); + } // If not required and empty, leave it out + elseif ( ! empty( $pirate_forms_contact_subject ) ) { + $body .= pirate_forms_table_row( stripslashes( pirate_forms_get_key( 'pirateformsopt_label_subject' ) ), $pirate_forms_contact_subject ); + } + /** + ******* Sanitize and validate message */ + $pirate_forms_contact_message = isset( $_POST['pirate-forms-contact-message'] ) ? sanitize_text_field( trim( $_POST['pirate-forms-contact-message'] ) ) : ''; + // if message is required and is missing + if ( ( pirate_forms_get_key( 'pirateformsopt_message_field' ) === 'req' ) && empty( $pirate_forms_contact_message ) ) { + $_SESSION['pirate_forms_contact_errors']['pirate-forms-contact-message'] = pirate_forms_get_key( 'pirateformsopt_label_err_message' ); + } // If not required and empty, leave it out + elseif ( ! empty( $pirate_forms_contact_message ) ) { + $body .= pirate_forms_table_row( stripslashes( pirate_forms_get_key( 'pirateformsopt_label_message' ) ), $pirate_forms_contact_message ); + } + /** + *********** Validate reCAPTCHA */ + $pirateformsopt_recaptcha_sitekey = pirate_forms_get_key( 'pirateformsopt_recaptcha_sitekey' ); + $pirateformsopt_recaptcha_secretkey = pirate_forms_get_key( 'pirateformsopt_recaptcha_secretkey' ); + $pirateformsopt_recaptcha_field = pirate_forms_get_key( 'pirateformsopt_recaptcha_field' ); + if ( ! empty( $pirateformsopt_recaptcha_secretkey ) && ! empty( $pirateformsopt_recaptcha_sitekey ) && ! empty( $pirateformsopt_recaptcha_field ) && ( $pirateformsopt_recaptcha_field == 'yes' ) ) : + if ( isset( $_POST['g-recaptcha-response'] ) ) { + $captcha = $_POST['g-recaptcha-response']; + } + if ( ! $captcha ) { + $_SESSION['pirate_forms_contact_errors']['pirate-forms-captcha'] = __( 'Wrong reCAPTCHA', 'pirate-forms' ); + } + $response = wp_remote_get( 'https://www.google.com/recaptcha/api/siteverify?secret=' . $pirateformsopt_recaptcha_secretkey . '&response=' . $captcha . '&remoteip=' . $_SERVER['REMOTE_ADDR'] ); + if ( ! empty( $response ) ) : + $response_body = wp_remote_retrieve_body( $response ); + endif; + if ( ! empty( $response_body ) ) : + $result = json_decode( $response_body, true ); + endif; + if ( isset( $result['success'] ) && ( $result['success'] == false ) ) { + $_SESSION['pirate_forms_contact_errors']['pirate-forms-captcha'] = __( 'Wrong reCAPTCHA', 'pirate-forms' ); + } + endif; + /** + ******** Validate recipients email */ + $site_recipients = sanitize_text_field( pirate_forms_get_key( 'pirateformsopt_email_recipients' ) ); + if ( empty( $site_recipients ) ) { + $_SESSION['pirate_forms_contact_errors']['pirate-forms-recipients-email'] = __( 'Please enter one or more Contact submission recipients', 'pirate-forms' ); + } + /** + ****** Sanitize and validate IP */ + $contact_ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP ); + /* for the case of a Web server behind a reverse proxy */ + if ( array_key_exists( 'HTTP_X_FORWARDED_FOR', $_SERVER ) ) { + $contact_ip_tmp = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] ); + if ( ! empty( $contact_ip_tmp ) ) { + $contact_ip = array_pop( $contact_ip_tmp ); + } + } + // If valid and present, create a link to an IP search + if ( ! empty( $contact_ip ) ) { + $body .= pirate_forms_table_row( __( 'IP address: ', 'pirate-forms' ), $contact_ip ); + $body .= pirate_forms_table_row( __( 'IP search:', 'pirate-forms' ), "http://whatismyipaddress.com/ip/$contact_ip" ); + } + // Sanitize and prepare referrer; + if ( ! empty( $_POST['pirate-forms-contact-referrer'] ) ) { + $body .= pirate_forms_table_row( __( 'Came from: ', 'pirate-forms' ), sanitize_text_field( $_POST['pirate-forms-contact-referrer'] ) ); + } + // Show the page this contact form was submitted on + $body .= pirate_forms_table_row( __( 'Sent from page: ', 'pirate-forms' ), get_permalink( get_the_id() ) ); + // Check the blacklist + $blocked = pirate_forms_get_blacklist(); + if ( ! empty( $blocked ) ) { + if ( + in_array( $pirate_forms_contact_email, $blocked ) || + in_array( $contact_ip, $blocked ) + ) { + $_SESSION['pirate_forms_contact_errors']['blacklist-blocked'] = __( 'Form submission blocked!', 'pirate-forms' ); + + return false; + } + } + $body .= '
'; + + // No errors? Go ahead and process the contact + if ( empty( $_SESSION['pirate_forms_contact_errors'] ) ) { + $pirate_forms_options_tmp = get_option( 'pirate_forms_settings_array' ); + if ( isset( $pirate_forms_options_tmp['pirateformsopt_email'] ) ) { + $site_email = $pirate_forms_options_tmp['pirateformsopt_email']; + } + if ( ! empty( $pirate_forms_contact_name ) ) : + $site_name = $pirate_forms_contact_name; + else : + $site_name = htmlspecialchars_decode( get_bloginfo( 'name' ) ); + endif; + // Notification recipients + $site_recipients = sanitize_text_field( pirate_forms_get_key( 'pirateformsopt_email_recipients' ) ); + $site_recipients = explode( ',', $site_recipients ); + $site_recipients = array_map( 'trim', $site_recipients ); + $site_recipients = array_map( 'sanitize_email', $site_recipients ); + $site_recipients = implode( ',', $site_recipients ); + // No name? Use the submitter email address, if one is present + if ( empty( $pirate_forms_contact_name ) ) { + $pirate_forms_contact_name = ! empty( $pirate_forms_contact_email ) ? $pirate_forms_contact_email : '[None given]'; + } + // Need an email address for the email notification + if ( ! empty( $site_email ) ) { + if ( $site_email == '[email]' ) { + if ( ! empty( $pirate_forms_contact_email ) ) { + $send_from = $pirate_forms_contact_email; + } else { + $send_from = pirate_forms_from_email(); + } + } else { + $send_from = $site_email; + } + } else { + $send_from = pirate_forms_from_email(); + } + $send_from_name = $site_name; + // Sent an email notification to the correct address + $headers = "From: $send_from_name <$send_from>\r\nReply-To: $pirate_forms_contact_name <$pirate_forms_contact_email>\r\nContent-type: text/html"; + add_action( 'phpmailer_init', 'pirate_forms_phpmailer' ); + /** + ******* Validate Attachment */ + $attachments = ''; + $use_files = pirate_forms_get_key( 'pirateformsopt_attachment_field' ); + if ( ! empty( $use_files ) && ( $use_files == 'yes' ) ) { + $attachments = ''; + $pirate_forms_attach_file = isset( $_FILES['pirate-forms-attachment'] ) ? $_FILES['pirate-forms-attachment'] : ''; + if ( ! empty( $pirate_forms_attach_file ) && ! empty( $pirate_forms_attach_file['name'] ) ) { + /* Validate file type */ + $pirate_forms_file_types_allowed = 'jpg|jpeg|png|gif|pdf|doc|docx|ppt|pptx|odt|avi|ogg|m4a|mov|mp3|mp4|mpg|wav|wmv'; + $pirate_forms_file_types_allowed = trim( $pirate_forms_file_types_allowed, '|' ); + $pirate_forms_file_types_allowed = '(' . $pirate_forms_file_types_allowed . ')'; + $pirate_forms_file_types_allowed = '/\.' . $pirate_forms_file_types_allowed . '$/i'; + if ( ! preg_match( $pirate_forms_file_types_allowed, $pirate_forms_attach_file['name'] ) ) { + $_SESSION['pirate_forms_contact_errors']['pirate-forms-upload-failed-type'] = __( 'Uploaded file is not allowed for file type', 'pirate-forms' ); + + return false; + } + /* Validate file size */ + $pirate_forms_file_size_allowed = 1048576; // default size 1 MB + if ( $pirate_forms_attach_file['size'] > $pirate_forms_file_size_allowed ) { + $_SESSION['pirate_forms_contact_errors']['pirate-forms-upload-failed-size'] = __( 'Uploaded file is too large', 'pirate-forms' ); + } + pirate_forms_init_uploads(); + $uploads_dir = pirate_forms_upload_tmp_dir(); + $uploads_dir = pirate_forms_maybe_add_random_dir( $uploads_dir ); + $filename = $pirate_forms_attach_file['name']; + $filename = pirate_forms_canonicalize( $filename ); + $filename = sanitize_file_name( $filename ); + $filename = pirate_forms_antiscript_file_name( $filename ); + $filename = wp_unique_filename( $uploads_dir, $filename ); + $new_file = trailingslashit( $uploads_dir ) . $filename; + try { + if ( false === move_uploaded_file( $pirate_forms_attach_file['tmp_name'], $new_file ) ) { + throw new Exception( __( 'There was an unknown error uploading the file.', 'pirate-forms' ) ); + } + } catch ( Exception $ex ) { + $_SESSION['pirate_forms_contact_errors']['pirate-forms-upload-failed-general'] = $ex->getMessage(); + } + if ( ! empty( $new_file ) ) { + $attachments = $new_file; + } + } + } + + wp_mail( $site_recipients, 'Contact on ' . htmlspecialchars_decode( get_bloginfo( 'name' ) ), $body, $headers, $attachments ); + require_once( ABSPATH . 'wp-admin/includes/file.php' ); + WP_Filesystem(); + global $wp_filesystem; + $wp_filesystem->delete( pirate_forms_upload_tmp_dir(), true, 'd' ); + // Should a confirm email be sent? + $confirm_body = stripslashes( trim( pirate_forms_get_key( 'pirateformsopt_confirm_email' ) ) ); + if ( ! empty( $confirm_body ) && ! empty( $pirate_forms_contact_email ) ) { + // Removing entities + $confirm_body = htmlspecialchars_decode( $confirm_body ); + $confirm_body = html_entity_decode( $confirm_body ); + $confirm_body = str_replace( ''', "'", $confirm_body ); + $headers = "From: $site_name <$site_email>\r\nReply-To: $site_name <$site_email>"; + wp_mail( + $pirate_forms_contact_email, + pirate_forms_get_key( 'pirateformsopt_label_submit' ) . ' - ' . $site_name, + $confirm_body, + $headers + ); + } + /** + *********** Store the entries in the DB */ + if ( pirate_forms_get_key( 'pirateformsopt_store' ) === 'yes' ) { + $new_post_id = wp_insert_post( + array( + 'post_type' => 'pf_contact', + 'post_title' => date( 'l, M j, Y', time() ) . ' by "' . $pirate_forms_contact_name . '"', + 'post_content' => $body, + 'post_author' => 1, + 'post_status' => 'private', + ) + ); + if ( isset( $pirate_forms_contact_email ) && ! empty( $pirate_forms_contact_email ) ) { + add_post_meta( $new_post_id, 'Contact email', $pirate_forms_contact_email ); + } + } + $pirate_forms_current_theme = wp_get_theme(); + /* If a Thank you page is selected, redirect to that page */ + if ( pirate_forms_get_key( 'pirateformsopt_thank_you_url' ) ) { + $redirect_id = intval( pirate_forms_get_key( 'pirateformsopt_thank_you_url' ) ); + $redirect = get_permalink( $redirect_id ); + wp_safe_redirect( $redirect ); + } /* Redirect to ?pcf=1#contact only if the theme is Zerif */ + elseif ( ( 'Zerif Lite' == $pirate_forms_current_theme->name ) || ( 'Zerif Lite' == $pirate_forms_current_theme->parent_theme ) || ( 'Zerif PRO' == $pirate_forms_current_theme->name ) || ( 'Zerif PRO' == $pirate_forms_current_theme->parent_theme ) ) { + $redirect = $_SERVER['HTTP_REFERER'] . ( strpos( $_SERVER['HTTP_REFERER'], '?' ) === false ? '?' : '&' ) . 'pcf=1#contact'; + wp_safe_redirect( $redirect ); + } + } + +} + +/** + * Alter the phpmailer object + * + * @param $phpmailer PHPMailer object + */ +function pirate_forms_phpmailer( $phpmailer ) { + $pirateformsopt_use_smtp = pirate_forms_get_key( 'pirateformsopt_use_smtp' ); + $pirateformsopt_smtp_host = pirate_forms_get_key( 'pirateformsopt_smtp_host' ); + $pirateformsopt_smtp_port = pirate_forms_get_key( 'pirateformsopt_smtp_port' ); + $pirateformsopt_smtp_username = pirate_forms_get_key( 'pirateformsopt_smtp_username' ); + $pirateformsopt_smtp_password = pirate_forms_get_key( 'pirateformsopt_smtp_password' ); + $pirateformsopt_use_smtp_authentication = pirate_forms_get_key( 'pirateformsopt_use_smtp_authentication' ); + if ( ! empty( $pirateformsopt_use_smtp ) && ( $pirateformsopt_use_smtp == 'yes' ) && ! empty( $pirateformsopt_smtp_host ) && ! empty( $pirateformsopt_smtp_port ) ) : + // @codingStandardsIgnoreStart + $phpmailer->isSMTP(); + $phpmailer->Host = $pirateformsopt_smtp_host; + if ( ! empty( $pirateformsopt_use_smtp_authentication ) && ( $pirateformsopt_use_smtp_authentication == 'yes' ) && ! empty( $pirateformsopt_smtp_username ) && ! empty( $pirateformsopt_smtp_password ) ) : + $phpmailer->SMTPAuth = true; // Force it to use Username and Password to authenticate + $phpmailer->Port = $pirateformsopt_smtp_port; + $phpmailer->Username = $pirateformsopt_smtp_username; + $phpmailer->Password = $pirateformsopt_smtp_password; + endif; + // @codingStandardsIgnoreEnd + endif; +} + +/* Get a settings value */ +function pirate_forms_get_key( $id ) { + $pirate_forms_options = get_option( 'pirate_forms_settings_array' ); + + return isset( $pirate_forms_options[ $id ] ) ? $pirate_forms_options[ $id ] : ''; +} + +/** + ************************** Scripts and Styles */ +add_action( 'wp_enqueue_scripts', 'pirate_forms_add_styles_and_scripts' ); +function pirate_forms_add_styles_and_scripts() { + /* style for frontpage contact */ + wp_enqueue_style( 'pirate_forms_front_styles', PIRATE_FORMS_URL . 'css/front.css' ); + /* recaptcha js */ + $pirate_forms_options = get_option( 'pirate_forms_settings_array' ); + if ( ! empty( $pirate_forms_options ) ) : + if ( ! empty( $pirate_forms_options['pirateformsopt_recaptcha_secretkey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_sitekey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_field'] ) && ( $pirate_forms_options['pirateformsopt_recaptcha_field'] == 'yes' ) ) : + if ( defined( 'POLYLANG_VERSION' ) && function_exists( 'pll_current_language' ) ) { + $pirate_forms_contactus_language = pll_current_language(); + } else { + $pirate_forms_contactus_language = get_locale(); + } + wp_enqueue_script( 'recaptcha', 'https://www.google.com/recaptcha/api.js?hl=' . $pirate_forms_contactus_language . '' ); + wp_enqueue_script( 'pirate_forms_scripts', plugins_url( 'js/scripts.js', __FILE__ ), array( + 'jquery', + 'recaptcha', + ) ); + endif; + endif; + wp_enqueue_script( 'pirate_forms_scripts_general', plugins_url( 'js/scripts-general.js', __FILE__ ), array( 'jquery' ) ); + $pirate_forms_errors = ''; + if ( ! empty( $_SESSION['pirate_forms_contact_errors'] ) ) : + $pirate_forms_errors = $_SESSION['pirate_forms_contact_errors']; + endif; + wp_localize_script( 'pirate_forms_scripts_general', 'pirateFormsObject', array( + 'errors' => $pirate_forms_errors, + ) ); + +} + +add_action( 'admin_enqueue_scripts', 'pirate_forms_admin_css' ); +function pirate_forms_admin_css() { + global $pagenow; + if ( ! empty( $pagenow ) && ( $pagenow == 'options-general.php' || $pagenow == 'admin.php' ) + && isset( $_GET['page'] ) && $_GET['page'] == 'pirate-forms-admin' + ) { + wp_enqueue_style( 'pirate_forms_admin_styles', PIRATE_FORMS_URL . 'css/wp-admin.css' ); + wp_enqueue_script( 'pirate_forms_scripts_admin', plugins_url( 'js/scripts-admin.js', __FILE__ ), array( 'jquery' ) ); + wp_localize_script( 'pirate_forms_scripts_admin', 'cwp_top_ajaxload', array( + 'ajaxurl' => admin_url( 'admin-ajax.php' ), + ) ); + } +} + +/** + * If submissions should be stored in the DB, create the Contacts CPT */ +if ( pirate_forms_get_key( 'pirateformsopt_store' ) === 'yes' ) { + add_action( 'init', 'pirate_forms_register_content_type' ); + function pirate_forms_register_content_type() { + $labels = array( + 'name' => _x( 'Contacts', 'post type general name', 'pirate-forms' ), + 'singular_name' => _x( 'Contact', 'post type singular name', 'pirate-forms' ), + 'menu_name' => _x( 'Contacts', 'admin menu', 'pirate-forms' ), + 'name_admin_bar' => _x( 'Contact', 'add new on admin bar', 'pirate-forms' ), + 'add_new' => _x( 'Add New', 'contact', 'pirate-forms' ), + 'add_new_item' => __( 'Add New Contact', 'pirate-forms' ), + 'new_item' => __( 'New Contact', 'pirate-forms' ), + 'edit_item' => __( 'Edit Contact', 'pirate-forms' ), + 'view_item' => __( 'View Contact', 'pirate-forms' ), + 'all_items' => __( 'All Contacts', 'pirate-forms' ), + 'search_items' => __( 'Search Contacts', 'pirate-forms' ), + 'parent_item_colon' => __( 'Parent Contacts:', 'pirate-forms' ), + 'not_found' => __( 'No contacts found.', 'pirate-forms' ), + 'not_found_in_trash' => __( 'No contacts found in Trash.', 'pirate-forms' ), + ); + $args = array( + 'labels' => $labels, + 'description' => __( 'Contacts from Pirate Forms', 'pirate-forms' ), + 'public' => true, + 'publicly_queryable' => true, + 'show_ui' => true, + 'show_in_menu' => true, + 'query_var' => true, + 'capability_type' => 'post', + 'has_archive' => true, + 'hierarchical' => false, + 'menu_position' => null, + 'supports' => array( 'title', 'editor', 'custom-fields' ), + ); + register_post_type( 'pf_contact', $args ); + } +} +/** + * Add a Settings link in the plugins list for the Pirate Forms + */ +function pirate_forms_add_settings_link( $links ) { + $settings_link = '' . __( 'Settings', 'pirate-forms' ) . ''; + if ( function_exists( 'array_unshift' ) ) : + array_unshift( $links, $settings_link ); + else : + array_push( $links, $settings_link ); + endif; + + return $links; +} + +$plugin = plugin_basename( __FILE__ ); +add_filter( "plugin_action_links_$plugin", 'pirate_forms_add_settings_link' ); +/** + * Allow [pirate_forms] shortcode in text widget + */ +add_filter( 'widget_text', 'pirate_forms_widget_text_filter', 9 ); +function pirate_forms_widget_text_filter( $content ) { + if ( ! preg_match( '[pirate_forms]', $content ) ) { + return $content; + } + $content = do_shortcode( $content ); + + return $content; +} + +require dirname( __FILE__ ) . '/dashboard/dashboard.php'; diff --git a/dist/dist/readme.txt b/dist/dist/readme.txt new file mode 100644 index 0000000..62672be --- /dev/null +++ b/dist/dist/readme.txt @@ -0,0 +1,144 @@ +=== Contact Form & SMTP Plugin by PirateForms === +Contributors: themeisle, codeinwp, rodicaelena, hardeepasrani, pirateforms +Tags: contact forms plugin, contact form, contact us, contact us form, contacts form plugin, custom form, subscribe form, feedback form, wordpress contact form +Requires at least: 3.0 +Tested up to: 4.7 +Stable tag: trunk +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html + +A simple and effective WordPress contact form & SMTP plugin. Compatible with best themes out there, is both secure and responsive. + +== Description == + +Stay in touch with your visitors very easily. Pirate Contact Forms offers you a great and friendly contact form for your website. +This is an easy-to-use WordPress contact form with captcha plugin. To create a contact form you just need to use the [pirate_forms] shortcode or use the WordPress contact form widget. + + +**Why use our responsive WordPress Contact Form:** + +- It's easy to use + +This Contact Form 7 or any form builder alternative is very easy to set up. You can quickly create an engaging contact form by using a shortcode and copying it where you want it to appear. + +- It's fully customizable + +This WordPress Contact Form plugin allows you to customize everything you want. You can change the field labels and decide what message to tell your visitors when an error shows up. You can also decide which fields are required and which are not. + +- Provides reCaptcha + +Avoid spam messages and make sure the e-mails you receive are entirely addressed to you. + +- Comes with SMTP + +With the SMTP option, you can be sure you won’t miss any e-mail from your visitors. The messages will be safely delivered from the source to your personal e-mail address. +If you were using Mandrill's SMTP for transactional emails and contact forms, you should take a look at these Mandrill Alternatives. + +- Stores contacts in special databases + +You can keep all the contacts in an archive by saving their e-mail addresses. Pirate Contact Form allows you to do that by providing contact databases. + +A simple to use contact form plugin for creating a clean contact form using the [pirate_forms] shortcode or the 'Pirate Forms' form widget. + +- What PirateForms isn't for now + + +This is not a form maker or drag & drop builder plugin nor "the best contact form plugin", you cannot add new fields or create multiple forms (subscription forms, payment, order, feedback or quote), there are some great alternatives out there for those like : Caldera Forms or Ninja Forms. + + + +We've also built some fantastic free themes that work well with Pirate Contact Form, check them out. + +**Features:** + +- Choosing the fields(required or not) +- Choosing the labels +- Choosing error messages +- reCAPTCHA +- Store the contacts in the database + +If are you looking for other alternatives check-out our article on best contact form plugins. + + + +This plugin started as a fork of https://wordpress.org/plugins/proper-contact-form/. + +== Installation == + +Activating the Pirate Contact Form plugin is just like any other plugin. If you've uploaded the plugin package to your server already, skip to step 5 below: + +1. In your WordPress admin, go to **Plugins > Add New** +2. In the Search field type "pirate forms" +3. Under "Pirate Forms," click the **Install Now** link +4. Once the process is complete, click the **Activate Plugin** link +5. Now, you're able to add contact forms but, first, we could configure a few settings. These can be found at **Settings > Pirate Forms** +6. Make the changes desired, then click the **Save changes** button at the bottom +7. To add this form to any page or post, just copy/paste or type "[pirate_forms]" into the page or post content and save. The form should appear on that page + +== Screenshots == + +1. Screenshot 1. How to use contact form in posts/pages +2. Screenshot 2. How to customize contact form labels +3. Screenshot 3. How to use reCaptcha +4. Screenshot 4. Enabling SMTP + +== Changelog == + += 1.2.0 = + +* Fixed security error when upload field was active. + += 1.1.3 = + +* Added integration with custom emails plugin +* Fixed text domains errors + += 1.1.0 = +* Escape form fields ( Thanks to Gabriel Avramescu gabriel.avramescu@ituniversity.ro ) + += 1.0.18 = +* Fixed php strict standards error +* Update tags +* Tested up to WordPress 4.6 + += 1.0.17 = +* Fixed IP issue when using web server behind a reverse proxy +* Fixed W3C compatibility issues +* Remove pcf=1#contact from url when theme is different then Zerif +* Removed blacklist option and made it default set to true +* Display site key and secret key fields only if recaptcha option is selected +* New attachment option +* New thank you URL option +* New option to make the nonce optional + += 1.0.16 = +* textarea field not saving + += 1.0.15 = +* Update screenshots +* Added a clearfix after the Pirate Forms widget to avoid messed layout +* Update compatible WordPress version number + += 1.0.14 = +* Fix issues with checkboxes not saving data +* Redo the layout of the plugin's admin area + += 1.0.13 = +* Fix issues with multiple forms on same page +* Update readme.txt + += 1.0.12 = +* Update contributors names +* Option to change recaptcha language + += 1.0.11 = +* Fixed #55 Recaptcha too down + += 1.0.9 = +* Fixed layout issues #52 +* Update readme.txt with == Changelog == section #51 + += 1.0.8 = +* Update readme.txt +* Update translations files +* #42, translation issues fixed diff --git a/dist/dist/screenshot-1.png b/dist/dist/screenshot-1.png new file mode 100644 index 0000000..687bdbc Binary files /dev/null and b/dist/dist/screenshot-1.png differ diff --git a/dist/dist/screenshot-2.png b/dist/dist/screenshot-2.png new file mode 100644 index 0000000..b84afca Binary files /dev/null and b/dist/dist/screenshot-2.png differ diff --git a/dist/dist/screenshot-3.png b/dist/dist/screenshot-3.png new file mode 100644 index 0000000..2e90880 Binary files /dev/null and b/dist/dist/screenshot-3.png differ diff --git a/dist/dist/screenshot-4.png b/dist/dist/screenshot-4.png new file mode 100644 index 0000000..fcaf926 Binary files /dev/null and b/dist/dist/screenshot-4.png differ diff --git a/dist/dist/tests/bootstrap.php b/dist/dist/tests/bootstrap.php new file mode 100644 index 0000000..04bcf51 --- /dev/null +++ b/dist/dist/tests/bootstrap.php @@ -0,0 +1,34 @@ +set_role( 'administrator' ); +wp_update_user( array( 'ID' => 1, 'first_name' => 'Admin', 'last_name' => 'User' ) ); \ No newline at end of file diff --git a/dist/dist/tests/test-pirate-forms.php b/dist/dist/tests/test-pirate-forms.php new file mode 100644 index 0000000..44d6a9d --- /dev/null +++ b/dist/dist/tests/test-pirate-forms.php @@ -0,0 +1,21 @@ +assertTrue(true); + } + +} diff --git a/dist/dist/wpml-config.xml b/dist/dist/wpml-config.xml new file mode 100644 index 0000000..a05f5d8 --- /dev/null +++ b/dist/dist/wpml-config.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/dist/pirate-forms.php b/dist/pirate-forms.php index 01c2fde..d0d3a8c 100644 --- a/dist/pirate-forms.php +++ b/dist/pirate-forms.php @@ -3,7 +3,7 @@ Plugin Name: Free & Simple Contact Form Plugin - PirateForms Plugin URI: http://themeisle.com/plugins/pirate-forms/ Description: Easily creates a nice looking, simple contact form on your WP site. -Version: 1.2.1 +Version: 1.2.2 Author: Themeisle Author URI: http://themeisle.com Text Domain: pirate-forms @@ -15,7 +15,7 @@ die( 'Nothing to do...' ); } /* Important constants */ -define( 'PIRATE_FORMS_VERSION', '1.2.1' ); +define( 'PIRATE_FORMS_VERSION', '1.2.2' ); define( 'PIRATE_FORMS_URL', plugin_dir_url( __FILE__ ) ); define( 'PIRATE_FORMS_PATH', plugin_dir_path( __FILE__ ) ); /* Required helper functions */