Need help in mapping fields with Plugin: "Forms: 3rd-Party Integration" - wordpress

I am trying to connect contact form 7 with velocify using the Plugin: "Forms: 3rd-Party Integration". Lead created in velocify but no field data import. I have mapped the fields correctly as per the instructions given. Here is the debug message:
SUBMISSION
Array
(
[timeout] => 60
[body] =>
)
RAW RESPONSE
Array
(
[reason] => Could not locate success clause within response
[safe_message] => Success Clause not found
[clause] => done
[response] => <?xml version="1.0" encoding="UTF-8"?><ImportResults><ImportResult refId="" leadId="0" result="Failure" message="No input data was found" /></ImportResults>
)
Please help me out.

This is a strange place to ask this question, as opposed to:
WP stack exchange site
the plugin support forum
the plugin Github issue tracker
That said, as the plugin author I suggest you read the support forum's sticky post: https://wordpress.org/support/topic/its-not-sending-data-help-read-this-first/
Specifically in your case, the debug email tells you the two problems:
You've configured the service to expect the word 'done' in the response, and it's not finding it
It's not finding it because, as the response indicates 'No input data was found' confirming the empty body of the submission.
The second issue (which is the real problem) is probably that you're not mapping it correctly. But without the full debug (or at least the service configuration section of it) I can't tell you why. Look at the "Post (Form)" section to see what's available to map. If you have done it all correctly it may be a compatibility issue -- make sure you're using the latest versions of all relevant plugins, try turning off other unrelated plugins to see if there's some kind of conflict, and finally if you have FTP access turn on WP_DEBUG mode and check the log file.

Related

Send region name to header from Cloudflare Worker, then fetch with PHP

I'm proxying my website traffic through Cloudflare and would like to take advantage of their geolocation functionality shown here: https://developers.cloudflare.com/workers/examples/geolocation-hello-world/.
The website is on WordPress and I want to be able to fetch the geolocation using PHP in a plugin. I saw on here that by default you can call the country by using:
$userCountry = $_SERVER["HTTP_CF_IPCOUNTRY"];
But I haven't found anything that will do the same for the region code. Therefore I'm trying to set up a Cloudflare worker which can pass the result of request.cf.region to the header, so that I can call it like so:
$regionCode = $_SERVER["HTTP_CF_IPREGIONCODE"];
Am I on the right track here? Could someone please give me a pointer on how to achieve what I describe?
You will have to change your approach a bit.
The reason you get the IP country in your headers is that CloudFlare by default adds some predefined values, as seen here.
Since there is no info for the IP region, you will have to add it yourself in the worker code. The snippet that should do the work would look like this:
request.headers.set("X-Header-Name", request.cf.region)
And then use it in your WordPress code as you described.
Just to inform other visitors, there are several solutions for this issue.
The most famous solution is the worker, which needs configurations. Recently, the Cloudflare added a feature that automatically adds the user's geolocation information to the request. To set that up, follow the below steps:
Go the the Cloudflare dashboard
Select a domain
Go to the Rules -> Transform Rules -> Managed Transform
Enable the Add visitor location headers
Then you can access these meta data from $_SERVER global in PHP, you can use the below variables that was useful for me:
[REMOTE_ADDR] => ****
[HTTP_CF_IPLONGITUDE] => ****
[HTTP_CF_IPLATITUDE] => ****
[HTTP_CF_IPCOUNTRY] => ****
[HTTP_CF_IPCONTINENT] => ****
[HTTP_CF_IPCITY] => ****
[HTTP_CF_CONNECTING_IP] => ****
[HTTP_USER_AGENT] => ****

Why is there an error when submitting the form?

Please tell me how to solve the problem.
The site is on Wordpress, the page has several modals with forms.
They all work well. I need to configure adding an email to the Sendpulse address book, which the user enters into the field.
Installed the sendpulse package via composer: https://github.com/sendpulse/sendpulse-rest-api-php
The situation is this:
In the directory with the theme, there is a functions.php file where there is a form handler, in which you can configure sending letters with requests from forms.
In this file, I added, according to the instructions from github sendpulse, the code for sending an email to the address book:
require '../private/vendor/autoload.php';
use Sendpulse\RestApi\ApiClient;
use Sendpulse\RestApi\Storage\FileStorage;
define('API_USER_ID', 'b7****************************************');
define('API_SECRET', 'e1*************************************');
$SPApiClient = new ApiClient(API_USER_ID, API_SECRET, new FileStorage());
$bookID = '15********';
$emailForSP = ['test6#test.ru'];
$SPApiClient->addEmails($bookID, $emailForSP);
If you just add this piece to the beginning of the file, then it works out and the address is added to the book. But sending letters to mail does not work, an error is thrown: https://hsto.org/webt/v8/qn/le/v8qnled6ibyy-ltp9afwyrjv-2q.jpeg
In the error_log file the line is: https://hsto.org/webt/mk/vo/g0/mkvog03mb7olfji0qrjcsyxktf0.jpeg
Error text from main.js file: https://hsto.org/webt/cd/-n/ry/cd-nryfx06_mvgtglu-t9msp8ga.jpeg
That is, this piece of code somehow affects the processing of the form handler function. In general, I need to trigger sending an email to the book after sending a letter to the mail, but in this case nothing works at all.
I didn't look for the cause of the conflict for a long time. Allocated sending e-mail in the sendpulse into a separate file and added ajax post request to this file. I don’t know why I hadn’t thought of this before.
let emailForSendPulse = $form.find('[name="email"]').val();
$.post('/wp-admin/smth.php', {email: emailForSendPulse}, function(data){
console.log('Form sended');
});

Fetching drafts forbidden in Wordpress rest api

I am using the wpapi npm module to interface with the WP rest api in a node app. I am authenticated and my user created some draft posts. When I go to the dashboard with the same credentials, I can see/edit the draft posts as well.
I am using this method to list the drafts:
wp.posts().auth().param( 'context', 'edit' ).param( 'status', 'draft' )
But I keep getting this error:
{ code: 'rest_invalid_param',
message: 'Invalid parameter(s): status',
data: { status: 400, params: { status: 'Status is forbidden.' } } }
Here's where I've commented on the issue and some helpful context.
The curl response to http://localhost:8000/wp-json/wp/v2/posts?status=draft is the same error message so I don't believe the issue is with the node module.
I'm the author of the wpapi module, this issue ended up on our issues list https://github.com/WP-API/node-wpapi/issues/325 and represented a bug that we've fixed in the latest release.
Authentication is required when querying for drafts, and not providing authentication can result in this 400 error; however, as noted in the linked issue above, authentication was working for one-off requests. Why the 400? What was happening was that inside wpapi requests we did not properly forward authentication credentials when paging through a collection, so the request to the first page of results would return a 200, then the second page would return a 400 because the second request lacked authentication. We've resolved this bug by always passing on the authentication credentials when paging through collections, and hopefully this doesn't trip anyone else up.
General troubleshooting if you do encounter a 400:
Are you sure you're authenticated? (try hitting /users/me)
Does your user have the capabilities required to view draft posts?
And we welcome issues if you do find bugs like this!

Drupal 7 feeds, permission-error with oauth for instagram ("public_content")

earlier in 2015 i started creating a website with drupal 7 that imports instagram-content (images, likes, comments etc.) via Drupal Feeds. Everything worked finde, but the projects stopped then.
Now it seems we start that again but suddenly the import is not working anymore. I always get the following error:
{"meta": {"error_type": "OAuthPermissionsException", "code": 400,
"error_message": "This request requires scope=public_content, but this
access token is not authorized with this scope. The user must
re-authorize your application with scope=public_content to be granted
this permissions."}}
I didnt had to send the "public_content" earlier, so i was just sending "basic"-scope access. And as i said, everything worked well.
Now i inserted also the scope for "public_content" along with "basic" within the oauth-Module for feeds. But still getting the error-message above.
Any hints on that?
Thanks in advance and regards,
Fab
This is due to a Instagram Platfrom Update
You'll have to add public_content scope as Joshi has pointed out - and also you'll need to renew your auth token in the settings page.
Then you'll be good to go.
Here is the solution:
Use following code in instagram_social_feed.module
Function: instagram_social_feed_settings()
if (variable_get('instagram_social_feed_client_id', '') != '' && variable_get('instagram_social_feed_redirect_uri', '') != '') {
$form['authenticate'] = array(
'#markup' => l(t('Click here to authenticate via Instagram and create an access token'),
'https://api.instagram.com/oauth/authorize/?client_id=' . variable_get('instagram_social_feed_client_id') . '&redirect_uri=' . variable_get('instagram_social_feed_redirect_uri') . '&response_type=code&scope=public_content'
)
);
}
This will solve the issus

DotNetOpenAuth get email

I am running dotnetopenauth 3.3.0.9283 (nightly build), it works great and it solved my previous problem ( DotNetOpenAuth get email and redirect problem )
So now I am able to get the users email from gmail only! I have tried yahoo and myspace but i always get "Object reference not set to an instance of an object." I ran the sample that came with the build, ajaxlogin.aspx and loginProgrammatic.aspx they both give me the same error message.
this is the only line i added to the sample (and also set email to required)
var email = OpenIdAjaxTextBox1.AuthenticationResponse.GetExtension<ClaimsResponse>().Email;
You've got too much code on one line.
GetExtension<T>() will return null if the Provider doesn't actually include that extension in the response. So you must always check that it returns a non-null value before dereferencing it.
You're getting null back from Yahoo because they don't support giving away their users' extra information (yet) except for a small whitelist of RPs.
I don't know about MySpace, but I suspect they just don't support it either.

Resources