I followed the instructions for integrating a custom translation API and used the Mock Translation API as a reference. I modified it to simply call a Python API i made. First, it submits a request to be processed, then it keeps polling on the request’s status until it’s finished. The Python API creates a Job for the translation request and puts it in a Redis task queue. currently it simply sleeps for 120 seconds, for testing purposes (not sure if that’s relevant). Here’s the modified plugin.
The Python API takes quite some time to return results back. The problem is, before the API finishes processing the results, an error message comes up in the UI (see screenshot) saying “Blank response from server”, and in the debug console it says that a timeout occurred, and the error is coming from the file admin.js. I think it’s assumed somewhere that if the custom plugin doesn’t return a response within a certain time interval (i think 30 seconds), the application times out and gives the “Blank response” message.
I looked around in Loco plugin’s source code to try to find any clues on where that timeout occurs, I’m just speculating here but i think it’s in pub/js/min/admin.js
The thing is, this file is obfuscated, so I’m not really sure what I’m looking at.
I’m pretty sure the timeout is not coming from the custom plugin’s end because even after i see the timeout error on the console, i keep seeing that the API is being calling by translator.php.
I tried my best, being neither an expert in PHP nor WordPress. please advise. thanks
]]>woocommerce_new_order
, to capture Zettle order data.I am not a web developer, I’m learning as i go at the moment. I am so stuck an am in desperate need of help. Is there any developer on here that would be willing to help me.
]]>Is it possible to do that? Some PATCH route for example.
]]>My goal is to have a Chatbot that is aware of the fixed information about the apartments (via a PDF provided in the Playground) and also always has the latest information on availability.
Regarding the latest availability, does the plugin allow specifying a URL that the chatbot can regularly consult?
]]><?php
// // accept all post data and make array
$data = json_decode(file_get_contents('php://input'), true);
if (!$data) {
$data = $_POST;
}
var_dump($data); // // get the data from the array
$deal_name = "test";
// $deal_source = isset($data['deal_source']) ? $data['deal_source'] : "";
$contact_first_name = isset($data['yrname']) ? $data['yrname'] : "";
// $contact_last_name = isset($data['contact_last_name']) ? $data['contact_last_name'] : "";
$contact_email = isset($data['yremail']) ? $data['yremail'] : "";
echo $contact_email ;
$contact_phone = isset($data['telephone']) ? $data['telephone'] : "";
$contact_message = isset($data['yrmessage']) ? $data['yrmessage'] : "";
$data_string = json_encode(array(
"custom_fields" => array(),
"email" => $contact_email,
"first_name" => $contact_first_name,
"last_name" => "WA",
"is_public" => true,
"phone" => $contact_phone
));
i use this code code to fetch cf7 data to send to crm. but form data is not being fetched.
]]>if ( ! wp_next_scheduled( 'send_notification' ) ) {
wp_schedule_event( time(), 'minutely', 'send_notification' );
function send_notification ( ) {
$end_point = 'https://api.webpushr.com/v1/notification/send/segment';
$args = array(
'posts_per_page' => 1,
'orderby' => 'rand',
);
$random_post = get_posts( $args );
$body = array(
'title' => $random_post[0]->post_title,
'message' => 'check out now',
'target_url' =>get_permalink( $random_post[0]->ID ),
//'image' => get_the_post_thumbnail_url($product->get_id()),
// 'icon'=> get_the_post_thumbnail_url($product->get_id()),
'segment' => array(489294 ), //required
);
$response = wp_remote_post( $end_point, array(
'method' => 'POST',
'timeout' => 45,
'headers' => array(
'Content-Type' => 'Application/Json',
'webpushrKey' => 'XXXXXXXXX',
'webpushrAuthToken' => '29009'
),
'body' => json_encode($body), //replace it with $body if a array body is expected by the api.
));
if ( is_wp_error( $response ) ) {
$error_message = $response->get_error_message();
//Something went wrong
} else {
//Success. Store or output $response as you want.
//use: wp_remote_retrieve_body( $response ) to get response body
}
}
}
add_action( 'send_notification', 'send_notification' );
]]>leider kann ich das frisch installierte Matomo nicht mit dem Plugin verbinden, weil mir schlichtweg der API token fehlt und ich den Zugriff ��ber den beschriebenen Weg nicht habe.
Im verlinkten Demosystem von Matomo sehe ich unter den Einstellungen (Zahnrad oben rechts) dann auf der linken Seite den Part f��r den API token. Aber in meiner selbst gehosteten Installation kann ich es nicht finden.
Hast du eine Idee?
Gru?
Timo
Can you help us with this problem
And how do i fire api when product is ordered to place order to through api
]]>