Alessandro Lin
Forum Replies Created
-
Forum: Plugins
In reply to: [Captcha Ajax] Not Working on WooCommerce Login & Registration FormHi @mohsinworld ,
These functions are already implemented. See this link: https://captcha-ajax.eu/wp-login.php?action=lostpassword
After the summer holidays I will start working on woocommerce. I know little about woocommerce. I was thinking of using your advice, if that’s okay with you. We will talk at the end of August or September. I will send you an email or post on your site’s contact form.
Greetings
Forum: Reviews
In reply to: [Captcha Ajax] It cannot be translatedHi @akron ,
Ok you’re right. After the summer holidays there will be accommodation.
Thanks for the review.
Alessandro
Forum: Plugins
In reply to: [Captcha Ajax] Not Working on WooCommerce Login & Registration FormHi @mohsinworld ,
True. Captcha Ajax doesn’t work with WooCommerce.
This feature has not yet been implemented. That’s something I’ll do in the future.
Thanks for reporting.
Kind regards.
Forum: Plugins
In reply to: [Captcha Ajax] Problem with sites that are in the subcategoryHi @fariborzasgarpour ,
I understood. I didn’t think about this situation: domain/folder/wordpress_files . ajaxurl is different.
You solved the problem. You mean how did you do it? I have difficulty testing the solutions to the problem.
Thanks for reporting.
Forum: Plugins
In reply to: [Captcha Ajax] Problem with sites that are in the subcategoryHi, @fariborzasgarpour ,
I can perform the correction but I have to understand what the problem is. I can’t reproduce it. If you want to communicate directly, look at my site.
Many thanks for the review. ??
Thank you for the code snippet.
Ciao Elena
Hi @elena18,
My difficulty is to debug the code step by step, as var_dump is not shown.
I know the problem, unfortunately :-).
To follow the flow of the code step by step, You can insert file_put_contents(); in various positions of your code . It is a very inconvenient method but if var_dump does not work . . .—
Forum: Developing with WordPress
In reply to: How to enter data into a tables field using PHPHi,
I think it is better to work with WordPress database functions. $wpdb
I gave an example of UPDATE. It is a bit laborious example but it works. I tried. UpdateData () is your function.
<?php // Exemple CREATE TABLE and UPDATE data on WP function CreateTestTable (){ global $wpdb; $table_name = $wpdb->prefix . 'rcpPay_Test'; $charset_collate = $wpdb->get_charset_collate(); $sqlTable = "CREATE TABLE IF NOT EXISTS $table_name ( ID int(11) NOT NULL AUTO_INCREMENT, amount_vat varchar(255), vario varchar(255), PRIMARY KEY (id) ) $charset_collate;"; if ( !function_exists('\dbDelta')) { require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); } dbDelta( $sqlTable ); } CreateTestTable(); function InsertData () { global $wpdb; $table_name = $wpdb->prefix . 'rcpPay_Test'; $wpdb->insert( $table_name, [ 'amount_vat' => '0,05', 'vario' => 'ins 1' ] ); $wpdb->insert( $table_name, [ 'amount_vat' => '0,10', 'vario' => 'ins 2' ] ); $wpdb->insert( $table_name, [ 'amount_vat' => '0,15', 'vario' => 'ins 3' ] ); } InsertData(); //And therefore, finally, your code : function UpdateData () { $vat = '0,22'; $payment_ID = 3; global $wpdb; $table_name = $wpdb->prefix . 'rcpPay_Test'; $wpdb->update( $table_name, [ 'amount_vat' => $vat, 'vario' => 'modified' ], [ 'ID' => $payment_ID ] ); } UpdateData();
Greetings.
Forum: Developing with WordPress
In reply to: Creating unique transient name per browser sessionIt seems to me that yours is a very good method!
No changes are needed to wp-cron.php or tricks and artificies that insert routines in the background to delete expired transients. ( I use transients that are 15 minutes old ).
Thank you, goodbye.Forum: Developing with WordPress
In reply to: Creating unique transient name per browser sessionHi Guido,
Merry Christmas and happy new year!Forum: Developing with WordPress
In reply to: Ajax call can’t get binary dataFinally, I get it working.
Okay, great! It was only necessary to put the right file path, then.
Forum: Developing with WordPress
In reply to: Ajax call can’t get binary dataI have a solution without jQuery.
Then you will also need to adapt the code to use with WP.
With the Hooks:
add_action( ‘wp_ajax_nopriv_your_action’, ‘your_function’ );
add_action( ‘wp_ajax_your_action’, ‘your_function’ );-- file index.html-- <!DOCTYPE html> <html> <head> <title>Ajax Image Snip</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta charset="utf-8"> </head> <body> <br><br> <div style="margin: auto;width: 300px;"> <input style="height: 50px;" type="button" id="ajax_get_image_button" name="ajax_get_image_button" value="Ajax call to get image" onclick="get_img();" /> </div> <script> { function get_img(){ let url='get_image.php'; let xhr = new XMLHttpRequest(); xhr.responseType = 'blob'; xhr.onload = function() { if (xhr.status != 200) { alert( 'Error: ' + xhr.status); return; } let img = document.createElement('img'); let imgUrl = URL.createObjectURL(xhr.response); img.src = imgUrl; document.body.append(img); }; xhr.open('GET', url); xhr.send(); } } </script> </body>
-- file get_image.php -- <?php $file = 'ImageKey.jpg'; if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.basename($file).'"'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); readfile($file); exit; }
If you want to try this it should work.
https://captcha-ajax.eu/ajaxImageSnip/
You can also get ajax with ” fetch ” which is more compact.
Forum: Developing with WordPress
In reply to: Creating unique transient name per browser sessionHi,
Sorry for the late reply but about 15 days ago I was sick (covid-19) . Now it has passed but still not good. I can’t concentrate well.
Sorry, please be patient and we can talk later.Thank you for the query of database.
Best regards.
Forum: Developing with WordPress
In reply to: Creating unique transient name per browser sessionHi @guido07111975 ,
Yes. Using the IP address could create problems. Really I think.
About 6 months ago I had tried cookies. With poor results.
Well, I’m glad I was helpful.
I remain available.
Sincerely.Forum: Developing with WordPress
In reply to: Creating unique transient name per browser sessionHi, @guido07111975 ,
Certainly, random.
name transient = prefix + random value . Everytime
You can pass the random value (input hidden) and the captcha value to the browser. Better to use the ajax method.
When it comes back you get Captcha entered by the user and the name transient and you can do the verification.
I have been trying this system live for about three months now. So far it has blocked all the bots.Greetings