Changeset 3245679
- Timestamp:
- 02/24/2025 11:25:27 AM (12 months ago)
- Location:
- facial-recognition-authentication/trunk
- Files:
-
- 6 edited
-
assets/js/main.js (modified) (3 diffs)
-
assets/js/main2.js (modified) (3 diffs)
-
facial-recognition-authentication.php (modified) (1 diff)
-
inc/admin_menu_page.php (modified) (2 diffs)
-
inc/admin_menu_page2.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
facial-recognition-authentication/trunk/assets/js/main.js
r3245333 r3245679 24 24 }); 25 25 Webcam.attach('#my_camera'); 26 // اضافه کردن راهنما 27 $('#camera-guide').html('<p>Please position your face close to the camera so it fills most of the frame.</p>'); 26 28 }); 27 29 … … 77 79 const email = $('#email').val(); 78 80 const password = $('#password').val(); 79 const domain = pluginData.domain; // تغییر از site_id به domain81 const domain = pluginData.domain; 80 82 81 83 const file = get_file_from_base64(base64image, `${email}.jpg`); 82 83 84 84 const url = "https://api.newwaypmsco.com/api/user/register/"; 85 85 const payload = new FormData(); … … 94 94 }) 95 95 .then(response => { 96 if (response.ok) { 97 swal({ 98 title: 'Success', 99 text: 'Register success', 100 icon: 'success', 101 buttons: false, 102 timer: 2000 103 }); 104 } else { 105 swal({ 106 title: 'Error', 107 text: 'Something went wrong', 108 icon: 'error' 96 if (!response.ok) { 97 return response.json().then(data => { 98 if (data.avatar) { 99 swal({ 100 title: 'Image Error', 101 text: data.avatar[0], 102 icon: 'error' 103 }); 104 } else if (data.email) { 105 swal({ 106 title: 'Email Error', 107 text: data.email[0], 108 icon: 'error' 109 }); 110 } else if (data.domain) { 111 swal({ 112 title: 'Domain Error', 113 text: data.domain[0], 114 icon: 'error' 115 }); 116 } else { 117 swal({ 118 title: 'Error', 119 text: 'Something went wrong during registration.', 120 icon: 'error' 121 }); 122 } 123 throw new Error('Registration failed'); 109 124 }); 110 125 } 126 return response.json(); 127 }) 128 .then(data => { 129 swal({ 130 title: 'Success', 131 text: 'Registration successful!', 132 icon: 'success', 133 buttons: false, 134 timer: 2000 135 }); 136 }) 137 .catch(error => { 138 console.error('Error:', error); 111 139 }); 112 140 } -
facial-recognition-authentication/trunk/assets/js/main2.js
r3245333 r3245679 26 26 }); 27 27 Webcam.attach('#my_camera'); 28 // اضافه کردن راهنما 29 $('#camera-guide').html('<p>Please position your face close to the camera so it fills most of the frame.</p>'); 28 30 }); 29 31 … … 95 97 console.log("Payload ready to send"); 96 98 99 97 100 fetch("https://api.newwaypmsco.com/api/user/login/", { 98 101 method: 'POST', … … 101 104 .then(response => { 102 105 console.log("Response status:", response.status); 103 if (response.ok) { 106 if (!response.ok) { 107 return response.json().then(data => { 108 if (data.avatar2) { 109 swal({ 110 title: 'Image Error', 111 text: data.avatar2[0], 112 icon: 'error' 113 }); 114 } else if (data.message === 'Invalid Login Details!') { 115 swal({ 116 title: 'Login Error', 117 text: 'Incorrect email or password.', 118 icon: 'error' 119 }); 120 } else if (data.message === 'Domain mismatch') { 121 swal({ 122 title: 'Domain Error', 123 text: 'This user is not registered for this domain.', 124 icon: 'error' 125 }); 126 } else if (data.message === 'Face Not Recognized') { 127 swal({ 128 title: 'Recognition Error', 129 text: 'Your face was not recognized. Please try again.', 130 icon: 'error' 131 }); 132 } else { 133 swal({ 134 title: 'Error', 135 text: 'Something went wrong during login.', 136 icon: 'error' 137 }); 138 } 139 throw new Error('Login failed'); 140 }); 141 } 142 return response.json(); 143 }) 144 .then(data => { 145 if (data.success === 'True') { 104 146 swal({ 105 147 title: 'Success', 106 text: 'Login successful ',148 text: 'Login successful!', 107 149 icon: 'success', 108 150 timer: 2000 109 151 }).then(() => refresh_page()); 110 } else {111 response.text().then(text => {112 console.log("Login error response:", text);113 swal({114 title: 'Error',115 text: 'Something went wrong: ' + text,116 icon: 'error'117 });118 });119 152 } 120 153 }) -
facial-recognition-authentication/trunk/facial-recognition-authentication.php
r3245333 r3245679 14 14 Description: Face ID registration and login for WordPress 15 15 Author: New-way 16 Version: 1.0. 316 Version: 1.0.4 17 17 */ 18 18 -
facial-recognition-authentication/trunk/inc/admin_menu_page.php
r3242754 r3245679 3 3 ?> 4 4 5 <div class="wrap"> 6 <section class="bg-dark"> 5 <div class="wrap"> 7 6 <div class="container-fluid"> 8 <div class="row text-center align-items-center justify-content-center" style="height: 100vh;"> 7 <!-- Grid Bootstrap --> 8 <div class="row text-center align-items-center justify-content-center" 9 style="height: 100vh; background-color: #343a40;"> 9 10 <div class="col-sm-12 col-md-6 mx-auto"> 10 11 <h1 class="text-white mb-5"> 11 FaceRecognition authentication plugin for WordPress websites12 FaceRecognition Authentication Plugin for WordPress Websites 12 13 </h1> 14 <!-- Capture Photo --> 13 15 <button class="btn btn-warning text-white" id="accesscamera" data-bs-toggle="modal" 14 16 data-bs-target="#photoModal"> … … 18 20 </div> 19 21 </div> 20 </section>21 22 22 <!-- Modal --> 23 <div class="modal fade" id="photoModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> 24 <div class="modal-dialog"> 25 <div class="modal-content"> 26 <div class="modal-header"> 27 <h5 class="modal-title" id="exampleModalLabel">Capture Photo</h5> 28 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 29 </div> 30 <div class="modal-body"> 31 <div id="my_camera" class="d-block mx-auto rounded overflow-hidden"></div> 32 <div id="results" class="d-none"></div> 33 <form method="post" id="photoForm" enctype="multipart/form-data"> 34 <input type="hidden" id="photoStore" name="photoStore" value=""> 35 </form> 36 </div> 37 <div class="modal-footer"> 38 <button type="button" class="btn btn-warning mx-auto text-white" id="takephoto" form="photoForm"> 39 Capture Photo 40 </button> 41 <button type="button" class="btn btn-warning mx-auto text-white d-none" id="retakephoto">Retake 42 </button> 43 <button type="submit" class="btn btn-warning mx-auto text-white d-none" id="uploadphoto" 44 form="photoForm">Upload 45 </button> 46 <input type="email" name="email" form="photoForm" id="email" class="d-none" value="" 47 placeholder="Email" required/> 48 <input type="password" name="password" form="photoForm" id="password" class="d-none" value="" 49 placeholder="Enter your password" required/> 50 <div id="alert"></div> 23 <!-- Modal Capture Photo --> 24 <div class="modal fade" id="photoModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> 25 <div class="modal-dialog"> 26 <div class="modal-content"> 27 <div class="modal-header"> 28 <h5 class="modal-title" id="exampleModalLabel">Capture Photo</h5> 29 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 30 </div> 31 <div class="modal-body"> 32 <div id="my_camera" class="d-block mx-auto rounded overflow-hidden"></div> 33 <div id="camera-guide" style="text-align: center; color: #333; margin-top: 10px;"></div> 34 <div id="results" class="d-none"></div> 35 <form method="post" id="photoForm"> 36 <input type="hidden" id="photoStore" name="photoStore" value=""> 37 </form> 38 </div> 39 <div class="modal-footer"> 40 <button type="button" class="btn btn-warning mx-auto text-white" id="takephoto" form="photoForm"> 41 Capture Photo 42 </button> 43 <button type="button" class="btn btn-warning mx-auto text-white d-none" id="retakephoto"> 44 Retake 45 </button> 46 <button type="submit" class="btn btn-warning mx-auto text-white d-none" id="uploadphoto" 47 form="photoForm"> 48 Upload 49 </button> 50 <input type="email" name="email" form="photoForm" id="email" class="d-none" value="" 51 placeholder="Email" required/> 52 <input type="password" name="password" form="photoForm" id="password" class="d-none" value="" 53 placeholder="Enter your password" required/> 54 <div id="alert"></div> 55 </div> 51 56 </div> 52 57 </div> 53 58 </div> 54 59 </div> 55 </div>56 60 57 61 <?php wp_footer(); ?> -
facial-recognition-authentication/trunk/inc/admin_menu_page2.php
r3242754 r3245679 4 4 5 5 <div class="wrap"> 6 <div class="container-fluid"> 7 <!-- grid bootstrap --> 8 <div class="row text-center align-items-center justify-content-center" 9 style="height: 100vh; background-color: #343a40;"> 10 <div class="col-sm-12 col-md-6 mx-auto"> 11 <h1 class="text-white mb-5"> 12 FaceRecognition Authentication Plugin for WordPress Websites 13 </h1> 14 <!-- Capture Photo --> 15 <button class="btn btn-warning text-white" id="accesscamera" data-bs-toggle="modal" 16 data-bs-target="#photoModal"> 17 Capture Photo 18 </button> 6 <section class="bg-dark"> 7 <div class="container-fluid"> 8 <div class="row text-center align-items-center justify-content-center" style="height: 100vh;"> 9 <div class="col-sm-12 col-md-6 mx-auto"> 10 <h1 class="text-white mb-5"> 11 FaceRecognition Authentication Plugin for WordPress Websites 12 </h1> 13 <button class="btn btn-warning text-white" id="accesscamera" data-bs-toggle="modal" 14 data-bs-target="#photoModal"> 15 Capture Photo 16 </button> 17 </div> 19 18 </div> 20 19 </div> 21 </ div>20 </section> 22 21 23 <!-- Modal Capture Photo-->22 <!-- Modal --> 24 23 <div class="modal fade" id="photoModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> 25 24 <div class="modal-dialog"> … … 30 29 </div> 31 30 <div class="modal-body"> 32 33 31 <div id="my_camera" class="d-block mx-auto rounded overflow-hidden"></div> 34 32 <div id="camera-guide" style="text-align: center; color: #333; margin-top: 10px;"></div> 35 33 <div id="results" class="d-none"></div> 36 <form method="post" id="photoForm" >34 <form method="post" id="photoForm" enctype="multipart/form-data"> 37 35 <input type="hidden" id="photoStore" name="photoStore" value=""> 38 36 </form> 39 37 </div> 40 38 <div class="modal-footer"> 41 42 <button type="button" class="btn btn-warning mx-auto text-white" id="takephoto" 43 form="photoForm">Capture Photo 39 <button type="button" class="btn btn-warning mx-auto text-white" id="takephoto" form="photoForm"> 40 Capture Photo 44 41 </button> 45 42 <button type="button" class="btn btn-warning mx-auto text-white d-none" id="retakephoto"> … … 47 44 </button> 48 45 <button type="submit" class="btn btn-warning mx-auto text-white d-none" id="uploadphoto" 49 form="photoForm">Upload 46 form="photoForm"> 47 Upload 50 48 </button> 51 52 49 <input type="email" name="email" form="photoForm" id="email" class="d-none" value="" 53 50 placeholder="Email" required/> -
facial-recognition-authentication/trunk/readme.txt
r3245333 r3245679 5 5 Tested up to: 6.7 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 37 Stable tag: 1.0.4 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 81 81 == Changelog == 82 82 83 = 1.0.3 - 2025-02-24 = 84 * Added image quality checks for registration and login (face detection, clarity, and size). 85 * Improved user guidance for capturing clear, close-up photos. 86 83 87 = 1.0.3 - 2025-02-23 = 84 88 * Fixed login issue where FormData was not sending correctly, ensuring proper authentication with domain validation. … … 98 102 99 103 == Upgrade Notice == 104 105 = 1.0.4 = 106 This update ensures better photo quality for accurate facial recognition. Update for improved security. 100 107 101 108 = 1.0.3 =
Note: See TracChangeset
for help on using the changeset viewer.