Giter Site home page Giter Site logo

kennym / cf7-to-api Goto Github PK

View Code? Open in Web Editor NEW
52.0 52.0 28.0 144 KB

LOOKING FOR MAINTAINER. Wordpress plugin to transmit contact form 7 entries to remote API using POST or GET

Home Page: https://wordpress.org/plugins/cf7-to-api-basic-auth/

CSS 0.67% JavaScript 2.98% PHP 96.35%
cf7 wordpress

cf7-to-api's Introduction

Hi there 👋

I'm a full-stack software engineer striving to solve problems that make people life's better.

I'm top 5% on StackOverflow. I love playing video games with my daughter and I'm in line with crypto and the values that crypto represents: Trust through verification, Transparency, collaboration and self-sovereignty of money.

Latest Achievements

Proud achievements

  • Helped launching Bright Parenting, a parenting app, which got acquired by a NYC company, and is now used by Fortune 500 companies.
  • I've built a social book network and email list that serves over 100k people on a weekly basis since 2012 until 2021. (Now defunct: www.rifflebooks.com)
  • Made a WP plugin that helps 3k+ people
  • Participated and contributed in Google Code-In 2010 - a programming competition for less than 18 year-old high-school students

Tech stack

  • Web3 (Ethers/Metamask/Truffle/Hardhat)
  • ReactJS
  • React Native
  • TypeScript/ES6
  • NodeJS
  • Ruby
  • Python
  • Some Rust/Go

Misc

  • 🌱 I'm currently taking EatTheBlocks 30 dapps in 30 days course.
  • 😄 Pronouns: He/Him

📫 Follow and reach out

cf7-to-api's People

Contributors

chrisolesen avatar kennym avatar logikgate avatar mariovalney avatar ncs-thomas avatar nicop-s avatar zetanova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cf7-to-api's Issues

Could not parse external plugin shortcode to api

Hey author,
The plugin works wonderful. But I have an issue with the plugin. I am using International Telephone Input for contact form 7 which uses mail tags to display the output. In the mail tag the shortcode works but it does not parses to api params instead it displays the same shortcode in the debug params. How can I resolve this? I know this plugin is only intended to work with CF7 but how can I achieve this to work with external plugin which are made to work with CF7 that can parse their shortcodes?

Error line 595 of class-cf7-api-admin.php

Typo says 'Basic ' instead of 'Bearer '

Secondly on the same line, the API key that I submit does not need to be base 64 encoded, it is already in the correct format. I hacked the line locally as follows. Not elegant but it works... For some reason removing the encoding all together created other errors.

$args['headers']['Authorization'] = 'Bearer ' . base64_decode(base64_encode( $bearer_auth ));

Blank parameters

Since CF7 version 5.4 the parameters form is totally blank and if parameters are inserted, on saving everything is cleaned. I don't know honestly if inserted values are stored or not, and in that case it would be a simple issue of displaying the correct values

Schermata 2022-04-04 alle 12 20 28
.

Plugin error send json option

The plugin fails when you send double quote and backslash () in the contact form fields and you select the json option at the input type field of the API Integration plugin.
I think that the problem is that those characters are reserved in JSON and must be properly escaped to be used in strings.

New version not passing short code values

Hello
Please refer to the image. The short code values of the plugin "International Phone Number" are not getting pulled in the new version. in the old version they were working fine. Can you please check and advise where can I find older version of the plugin. thanks

Screen Shot 2021-04-22 at 12 48 03 PM

How to pass other authentication parameters ?

Hi,

Thanks a lot for this plugin !

I'm trying to POST form data to a Yetiforce CRM (Open Source) using REST API.
https://doc.yetiforce.com/api/

Here's a working demo php script :
https://github.com/YetiForceCompany/YetiForceScripts/tree/master/YetiREST

As you may notice, the following parameters are required :
'apiPath' => 'https://gitdeveloper.yetiforce.com/',
'wsAppName' => 'portal',
'wsAppPass' => 'portal',
'wsApiKey' => 'VMUwRByXHSq1bLW485ikfvcC97P6gJsz',
'wsUserName' => '[email protected]',
'wsUserPass' => 'demo',

Does anybody knows how to add these extra parameters ?

Regards,

Handle API Response

As a developer, I would like to be able to get the API response programmatically, be able to search for string within the response and take an action based on that (such as redirect to page based on response)

Checkbox tags not working

Hi There,

When I create a checkbox, CF7-to-api seems to create its own tags that are in the format [name-checkboxlabel], however when I use those tags in my JSON, they never appear to resolve to anything but an empty string. Any idea what is happening?

As an aside, when i make the group of checkboxes a required field, it changes the way the tags are created, CF7-to-API only registers one tag which is just [name]. It doesn't seem like these two actions should be related.

This is whay my checkbox looks like in CF7:

[checkbox Budget "$750,000 - $999,999|280278" "$1,000,000 - $1,249,999|280279" "$1,250,000 - $1,499,999|280280" "$1,500,000 - $1,749,999|280281"]

It gives me tags like this:

[Budget-$750,000 - $999,999]

Am i using this wrong? or is there a bug?

Handle API errors

Currently, if the form is filled up properly but an error occurs at the API side, the form still shows a 'success' message. Would be nice to be able to show the server error on the form if the API call fails.

Cannot redeclare qs_cf7_textdomain()

I installed the plugin and tried to activate it. But it's showing an error while activating.

Plugin could not be activated because it triggered a fatal error.

Fatal error: Cannot redeclare qs_cf7_textdomain() (previously declared in /../public_html/wp-content/plugins/cf7-to-api-basic-auth/contact-form-7-api.php:44) in /../public_html/wp-content/plugins/cf7-to-api/contact-form-7-api.php on line 43

Plugin could not be activated due to fatal error

Plugin 1.3.0 downloaded form WP org repo.

Warning: require_once(/home/xxxxx/public/wp-content/plugins/cf7-to-api-basic-auth/includes/class.cf7-api.php): failed to open stream: No such file or directory in /home/xxxxx/public/wp-content/plugins/cf7-to-api-basic-auth/contact-form-7-api.php on line 49

Fatal error: require_once(): Failed opening required '/home/xxxxx/public/wp-content/plugins/cf7-to-api-basic-auth/includes/class.cf7-api.php' (include_path='.:/usr/share/php') in /home/xxxxx/public/wp-content/plugins/cf7-to-api-basic-auth/contact-form-7-api.php on line 49

Fatal error: require_once(): Failed opening required '/home/xxxxx/public/wp-content/plugins/cf7-to-api-basic-auth/includes/class.cf7-api.php' (include_path='.:/usr/share/php') in /home/xxxxx/public/wp-content/plugins/cf7-to-api-basic-auth/contact-form-7-api.php on line 49

adding "/" each time the form is saved

The plugin has started adding "/"'s in the JSON template every time the form is resaved after changes.

eg;
Original template:
{
"customer_name":"WP Update test",
"customer_billing_email":"[email protected]",
"customer_email":"[email protected]",
"customer_login":"astarisborn",
"customer_password":"somepasswordnotused",
"customer_dob":"1953-10-14",
"customer_street":"100 Devon Street East",
}
After save 1:
{
"customer_name":"WP Update test",
"customer_billing_email":"[email protected]",
"customer_email":"[email protected]",
"customer_login":"astarisborn",
"customer_password":"somepasswordnotused",
"customer_dob":"1953-10-14",
"customer_street":"100 Devon Street East",
}
After save 2:
{
\"customer_name\":\"WP Update test\",
\"customer_billing_email\":\"[email protected]\",
\"customer_email\":\"[email protected]\",
\"customer_login\":\"astarisborn\",
\"customer_password\":\"somepasswordnotused\",
\"customer_dob\":\"1953-10-14\",
\"customer_street\":\"100 Devon Street East\",
}

After save 3:
{
\\\"customer_name\\\":\\\"WP Update test\\\",
\\\"customer_billing_email\\\":\\\"[email protected]\\\",
\\\"customer_email\\\":\\\"[email protected]\\\",
\\\"customer_login\\\":\\\"astarisborn\\\",
\\\"customer_password\\\":\\\"somepasswordnotused\\\",
\\\"customer_dob\\\":\\\"1953-10-14\\\",
\\\"customer_street\\\":\\\"100 Devon Street East\\\",
}

etc.etc.

I'm in a bit of a panic, as an important project involving 4000 customers due to be deployed on Monday, started doing this today!! Help!!

The plugin cannot be Activated on WordPress 5.2.2

Hi. Thanks for your plugin!!

I've installed the plugin from Plugins - New plugin.

Unfortunately, when I click on Activate, it just keep disabled (no error is returned).

The plugin Contact form 7 to api + Basic auth v1.3.0 installed is this: https://es.wordpress.org/plugins/cf7-to-api-basic-auth/
I'm using WordPress 5.2.2 and Contact Form 7 Version 5.1.3

Note: I've also asked this question here: https://wordpress.org/support/topic/the-plugin-cannot-be-activated-on-wordpress-5-2-2/

Doesn't handle 409 response codes correctly

When sending to an API it doesn't handle response codes correctly.

For example if I send a sign up request to an API and that user already exists then the API should send back a 409 conflict code.

The plugin currently displays the correct text that is returned from the API
e.g.: 'The email address you have entered is already associated with another account.'

However it treats this as a success and clears the form. Rather than reading the 409 response as an error/failure and leaving the form as it is to be corrected by the user.

It would be awesome if the plugin would read error codes and react accordingly (I have only tested 409 so far)

[feature] Timeout custom

I had a case where i had to increase the timeout on the code directly to 10, would be very useful if we could set that on the config form.

Great work on this one, works great.

Custom message based on api response

Hi, how can i give custom messages based on api result?

i have 2 cases

  1. the api service is not available.
    the redirect page is set to go to the success page regardless of the api response
  2. if the sesponce from api has errors that the user need to fix how can i pass this messages back to the form?

thanks

Error with post json

i ha tried this plugin, but i have the problem
i call with basic auth my crm and i setup the json in the plugin but i have returned this error.

error:
Array
(
[0] => WP_Error Object
(
[errors] => Array
(
[json-error] => Array
(
[0] => 4
)

            )

        [error_data] => Array
            (
            )

        [additional_data:protected] => Array
            (
            )

    )

)


json:
{"elementType":"Leads", "element": "{"company":"[text-301]","firstname":"[text-302]","lastname":"[text-303]","email":"[email-497]","phone":"[tel-497]","accounttype":"[menu-429]","cf_mke_1055":"[menu-874]","gdpr_privacypolicy":"[acceptance-5]","leadsource":"[lead_source]","cf_mke_1056":"[language]"}"}

File Upload is not working

Hello,

I have checked the File Upload with API connector but it is not been received it comes with the encryption data.. How can we send the file uploads to the APIs?

I have checked the other methods as well but it is not sending a file to the APIs.?

can you please verify it.

cf7 repeater fields

public function qs_save_contact_form_details( $contact_form ){
$properties = $contact_form->get_properties();
$properties['wpcf7_api_data'] = isset( $_POST["wpcf7-sf"] ) ? $_POST["wpcf7-sf"] : '';
$properties['wpcf7_api_data_map'] = isset( $_POST["qs_wpcf7_api_map"] ) ? $_POST["qs_wpcf7_api_map"] : '';
$properties['template'] = isset( $_POST["template"] ) ? $_POST["template"] : '';
$properties['json_template'] = isset( $_POST["json_template"] ) ? $_POST["json_template"] : '';
$contact_form->set_properties( $properties );
}

This code is assuming that all valid form fields are known at design time.
the popular cf7 repeater plugin adds fields with an surfix of -1

quick fix/workaround

preg_match_all("/\[(\w+(-\d+)?)\]/", $properties['json_template'], $matches, PREG_PATTERN_ORDER); 
$properties['wpcf7_api_data_map'] = array_merge(array_fill_keys($matches[1], ''), $properties['wpcf7_api_data_map']);

Bug Report - API Call not accepting Array Value

Hi Dev Team,

Very nice plugin and useful. Thank you for your effort!

I want to report a bug, for the multiple select boxes on CF7, this plugin is not accepting the Array from the field. It is only passing the first element of the array via REST.

Example, if the field "Months" contains the array "[0]=> Jan, [1] => Feb, [2] => Mar", the plugin will only send "Jan" in the API call.

Hopefully, we can get this issue fix!

Thank you!

Regards,
Kenny C

Need examples of API CALL?

Hello Kennym,
I'm very happy to use this ambitious plugin.
But I need examples to write API CALLS.
Do you have cases with input type = "Parameters-GEST-POT" or "json" ?
My need is to add events (tribe) from a front-end form.
api_integration
last-api-call

API call not working.

I'm trying to integrated with marketo API and using following setting.

[https://[munchkinID].mktorest.com/identity/oauth/token/rest/v1/leads.json]https://[munchkinID].mktorest.com/identity/oauth/token/rest/v1/leads.json
Input type - JSON (We have tried Parameters - GET/POST also)
Method - POST

Some time its shows

[body] => {"requestId":"8dd7#176947dc2a7","success":false,"errors":[{"code":"1003","message":"Leads not specified"}]}

And some time its work but we are not able to see leads in marketo admin.

I have checked with marketo support team and they are not receiving any request. In postman API is working as expected.

MicrosoftTeams-image

checkbox: multiple values not parsed

Hi,

When I use [my-checkbox], and multiple values are checked, only the first item is parsed in the XML to the API with basic auth.

Any ideas on how to fix this ?

Is this plugin here better updated and supported then the mothballed version on Wordpress itself ( no author responses and no updates )?

Thanks

Hardcoded parameters in Called URL & Auth

Hi,
Thanks for this plugin.

I would like to use it with Jenkins.

Something I misunderstood.

URL to job:
JENKINS_URL/job/JOB_NAME/buildWithParameters?token=xxx&PARAMETERS=value&PARAMETERS=value&PARAMETERS=value

I need to put token for job (not for user authentification).

With this plugins I don't know how how to do that, because when I put token in base_url, others parameters appear like ?PARAMETERS=value and not &PARAMETERS=value and URL is wrong.

To avoid I need to put token in public form, not very good solution.

What is solution to let increment others parameters ?

And second problem for auth.

I need to put user:token in base_url instead of specific field basic auth.

When I put in basic auth field, not working.

Thanks!

Form is not saved

All data under tab “API Integration” is not being saved. I tried different browsers, but all I got was “Contact form saved” and an empty form.

What could be the cause? “max_input_vars” is 1000.

Changes " with \"

Hi,
I'm trying 1.4.11
in API integration, using JSON, when I save, editor changes every " with ".
API call fails.

file input to API

Hello,
I am trying to get a form with multiple inputs posted to an API.

There is one file input in my form. My API receives a md5 sum or filename i think. Is it possible to get the file transferd to the api via POST multipart/form-data or something?

[image] => ffc8c6d6a1738d750f7cdfa5f1a12d29

I found the cf7 docs and it says:

How your uploaded files are managed#How your uploaded files are managed
After a user uploads a file through your contact form, Contact Form 7 checks to see if: 1.) Any PHP errors have occurred; 2.) the file type and file size are valid; and then, if the check turns out okay, Contact Form 7 moves the uploaded file to a temporary folder. At this point, Contact Form 7 attaches the file to the mail and sends it. After these procedures, Contact Form 7 then removes the file from the temporary folder.

https://contactform7.com/file-uploading-and-attachment/#How-your-uploaded-files-are-managed

If i check the folder it is empty..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.