Title: Can you explain QR CODE GENERATION php code ?
Last modified: December 16, 2019

---

# Can you explain QR CODE GENERATION php code ?

 *  Resolved [romainb](https://wordpress.org/support/users/romainb/)
 * (@romainb)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/can-you-explain-qr-code-generation-php-code/)
 * Hi,
 * I would love to understand how you generated the qrcode picture ?
    My main question
   would be “how far we can be sure that QRCODE is generated locally and not remotely
   asking for a third party site to generate qrcode?”
 * I’ve dig into your google-authenticator.php file and found this line that I think
   is the good one:
 *     ```
       		jQuery.post(ajaxurl, data, function(response) {
   
         			jQuery('#GA_secret').val(response['new-secret']);
   
         			var qrcode="otpauth://totp/WordPress:"+escape(jQuery('#GA_description').val())+"?secret="+jQuery('#GA_secret').val()+"&issuer=WordPress";
   
       			jQuery('#GA_QRCODE').qrcode(qrcode);
   
        			jQuery('#GA_QR_INFO').show('slow');
   
         		});  	
       ```
   
 * could you explain how this is working ?
 * thank you
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcan-you-explain-qr-code-generation-php-code%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Ivan](https://wordpress.org/support/users/ivankk/)
 * (@ivankk)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/can-you-explain-qr-code-generation-php-code/#post-12489345)
 * Hi [@romainb](https://wordpress.org/support/users/romainb/) thanks for the question:
 * First one point, you should review the source of the repo that publishes the 
   plugin, not a fork:
 * [https://github.com/ivankruchkoff/google-authenticator/blob/264f7c5b9eb34db6b4266f3a8a831b82439f9c54/google-authenticator.php#L769](https://github.com/ivankruchkoff/google-authenticator/blob/264f7c5b9eb34db6b4266f3a8a831b82439f9c54/google-authenticator.php#L769)
 * Second, you’re at the right place in the code:
    after that qrcode is initialised,
   you can output it in your console to see what it is set to, and how ‘#GA_description’).
   val() and #GA_secret’).val() are generated.
 * Finally as a third party jquery lib is used, you’ll want to audit [https://github.com/ivankruchkoff/google-authenticator/blob/264f7c5b9eb34db6b4266f3a8a831b82439f9c54/jquery.qrcode.min.js](https://github.com/ivankruchkoff/google-authenticator/blob/264f7c5b9eb34db6b4266f3a8a831b82439f9c54/jquery.qrcode.min.js)
 * Hope that helps

Viewing 1 replies (of 1 total)

The topic ‘Can you explain QR CODE GENERATION php code ?’ is closed to new replies.

 * ![](https://ps.w.org/google-authenticator/assets/icon-256x256.png?rev=3500822)
 * [Google Authenticator](https://wordpress.org/plugins/google-authenticator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-authenticator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-authenticator/)
 * [Active Topics](https://wordpress.org/support/plugin/google-authenticator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-authenticator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-authenticator/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ivan](https://wordpress.org/support/users/ivankk/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/can-you-explain-qr-code-generation-php-code/#post-12489345)
 * Status: resolved