Hello everyone,
First, I would like to apologize for my english. I'm french so it's not so easy for me.
For my problem I did a little research. but frankly I'm not sure what I'm looking for exactly ! :/
I have a part of my plugin that find info on another website and made the parsing to retrieve specific information. So far, all is well. In fact, the script works fine. The only point where I do not know what or how to do is on the wait. Because for each record in the database , there is a waiting time of about a 1-2 sec. This waiting time will not be "lived" by the user, but only by the admin who decide when to trigger the update procedure .
Here is the code that is triggered by the administrator :
global $wpdb;
$price_query = 'SELECT * FROM wp_prix';
$price_list = $wpdb->get_results( $price_query );
foreach ( $price_list as $price ) {
$monprix = afficher_prix($price->url);
$monid = $price->prix_id;
echo $wpdb->update( 'wp_prix', array('prix' => $monprix ), array( 'prix_id' => $monid));
}
The waiting time is at "afficher_prix($url)" function.
Is there a way to perform the processing in background or put a " rolling circle " or a progress bar in the meantime? For the moment, at the stage of creating the plugin I have a dozen recording. So the wait time is minimal , but when I turn it on I expect nearly a thousand recording ... This will dramatically increase the waiting time .
I am very open to suggestions !
thank you
Francois