Plugin Directory

Changeset 3242754


Ignore:
Timestamp:
02/18/2025 03:48:02 PM (12 months ago)
Author:
newwaypmsco
Message:

Updated version to 1.0.2, disabled admin notices on plugin page, and fixed minor bugs

Location:
facial-recognition-authentication/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • facial-recognition-authentication/trunk/facial-recognition-authentication.php

    r3241674 r3242754  
    11<?php
    22
    3 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     3if (!defined('ABSPATH')) exit; // Exit if accessed directly
    44
    55/**
     
    1414Description: Face ID registration and login for WordPress
    1515Author: New-way
    16 Version: 1.0.1
     16Version: 1.0.2
    1717*/
    1818
     
    2828
    2929// Updated code
    30 function fra_faceid_activation() {
     30function fra_faceid_activation()
     31{
    3132    // Code for activation without error_log
    3233}
    3334
    34 function fra_faceid_deactivation() {
     35function fra_faceid_deactivation()
     36{
    3537    // Code for deactivation without error_log
    3638}
  • facial-recognition-authentication/trunk/inc/admin_menu_page.php

    r3241674 r3242754  
    11<?php
    2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     2if (!defined('ABSPATH')) exit; // Exit if accessed directly
    33?>
    44
     
    1111                        FaceRecognition authentication plugin for WordPress websites
    1212                    </h1>
    13                     <button class="btn btn-warning text-white" id="accesscamera" data-bs-toggle="modal" data-bs-target="#photoModal">
     13                    <button class="btn btn-warning text-white" id="accesscamera" data-bs-toggle="modal"
     14                            data-bs-target="#photoModal">
    1415                        Capture Photo
    1516                    </button>
     
    3536                </div>
    3637                <div class="modal-footer">
    37                     <button type="button" class="btn btn-warning mx-auto text-white" id="takephoto" form="photoForm">Capture Photo</button>
    38                     <button type="button" class="btn btn-warning mx-auto text-white d-none" id="retakephoto">Retake</button>
    39                     <button type="submit" class="btn btn-warning mx-auto text-white d-none" id="uploadphoto" form="photoForm">Upload</button>
    40                     <input type="email" name="email" form="photoForm" id="email" class="d-none" value="" placeholder="Email" required />
    41                     <input type="password" name="password" form="photoForm" id="password" class="d-none" value="" placeholder="Enter your password" required />
     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/>
    4250                    <div id="alert"></div>
    4351                </div>
     
    4755</div>
    4856
    49 <?php wp_footer(); ?> <!-- برای بارگذاری اسکریپت‌های وردپرس -->
     57<?php wp_footer(); ?>
  • facial-recognition-authentication/trunk/inc/admin_menu_page2.php

    r3241674 r3242754  
    11<?php
    2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     2if (!defined('ABSPATH')) exit; // Exit if accessed directly
    33?>
    44
    5 <div class="wrap">
    6     <div class="container-fluid">
    7         <!-- مرکز محتوا با استفاده از grid bootstrap -->
    8         <div class="row text-center align-items-center justify-content-center" style="height: 100vh; background-color: #343a40;">
    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                 <!-- دکمه Capture Photo -->
    14                 <button class="btn btn-warning text-white" id="accesscamera" data-bs-toggle="modal" data-bs-target="#photoModal">
    15                     Capture Photo
    16                 </button>
     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>
     19                </div>
     20            </div>
     21        </div>
     22
     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
     33                        <div id="my_camera" class="d-block mx-auto rounded overflow-hidden"></div>
     34
     35                        <div id="results" class="d-none"></div>
     36                        <form method="post" id="photoForm">
     37                            <input type="hidden" id="photoStore" name="photoStore" value="">
     38                        </form>
     39                    </div>
     40                    <div class="modal-footer">
     41
     42                        <button type="button" class="btn btn-warning mx-auto text-white" id="takephoto"
     43                                form="photoForm">Capture Photo
     44                        </button>
     45                        <button type="button" class="btn btn-warning mx-auto text-white d-none" id="retakephoto">
     46                            Retake
     47                        </button>
     48                        <button type="submit" class="btn btn-warning mx-auto text-white d-none" id="uploadphoto"
     49                                form="photoForm">Upload
     50                        </button>
     51
     52                        <input type="email" name="email" form="photoForm" id="email" class="d-none" value=""
     53                               placeholder="Email" required/>
     54                        <input type="password" name="password" form="photoForm" id="password" class="d-none" value=""
     55                               placeholder="Enter your password" required/>
     56                        <div id="alert"></div>
     57                    </div>
     58                </div>
    1759            </div>
    1860        </div>
    1961    </div>
    2062
    21     <!-- Modal برای Capture Photo -->
    22     <div class="modal fade" id="photoModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    23         <div class="modal-dialog">
    24             <div class="modal-content">
    25                 <div class="modal-header">
    26                     <h5 class="modal-title" id="exampleModalLabel">Capture Photo</h5>
    27                     <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
    28                 </div>
    29                 <div class="modal-body">
    30                     <!-- نمایش وب‌کم -->
    31                     <div id="my_camera" class="d-block mx-auto rounded overflow-hidden"></div>
    32                     <!-- نتایج -->
    33                     <div id="results" class="d-none"></div>
    34                     <form method="post" id="photoForm">
    35                         <input type="hidden" id="photoStore" name="photoStore" value="">
    36                     </form>
    37                 </div>
    38                 <div class="modal-footer">
    39                     <!-- دکمه‌های مختلف برای عکسبرداری و آپلود -->
    40                     <button type="button" class="btn btn-warning mx-auto text-white" id="takephoto" form="photoForm">Capture Photo</button>
    41                     <button type="button" class="btn btn-warning mx-auto text-white d-none" id="retakephoto">Retake</button>
    42                     <button type="submit" class="btn btn-warning mx-auto text-white d-none" id="uploadphoto" form="photoForm">Upload</button>
    43                     <!-- فیلدهای مخفی برای ارسال اطلاعات -->
    44                     <input type="email" name="email" form="photoForm" id="email" class="d-none" value="" placeholder="Email" required />
    45                     <input type="password" name="password" form="photoForm" id="password" class="d-none" value="" placeholder="Enter your password" required />
    46                     <div id="alert"></div>
    47                 </div>
    48             </div>
    49         </div>
    50     </div>
    51 </div>
    52 
    53 <?php wp_footer(); ?> <!-- برای بارگذاری اسکریپت‌های وردپرس -->
     63<?php wp_footer(); ?>
  • facial-recognition-authentication/trunk/inc/backend.php

    r3241674 r3242754  
    11<?php
    2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
     2if (!defined('ABSPATH')) exit; // Exit if accessed directly
    33
    44/**
    55 * Register a custom menu page.
    66 */
    7 function fra_faceid_admin_menu() {
     7function fra_faceid_admin_menu()
     8{
    89    include FRA_FACEID_INC_DIR . 'admin_menu_page.php';
    910}
    1011
    11 function fra_faceid_load_assets() {
     12function fra_faceid_load_assets()
     13{
    1214
    13     // بررسی اینکه آیا jQuery قبلاً بارگذاری شده است یا نه
    14     if ( ! wp_script_is( 'jquery', 'enqueued' ) ) {
     15
     16    if (!wp_script_is('jquery', 'enqueued')) {
    1517        wp_enqueue_script('jquery');
    1618    }
    1719
    18     // بارگذاری اسکریپت‌های افزونه
    1920    wp_enqueue_script('sweetalert.min.js', FRA_FACEID_JS . 'sweetalert.min.js', array(), '2.1.2', true);
    2021    wp_enqueue_script('bootstrap.min.js', FRA_FACEID_JS . 'bootstrap.min.js', array('jquery'), '5.3.3', true);
     
    2223    wp_enqueue_script('main.js', FRA_FACEID_JS . 'main.js', array('jquery', 'webcam.min.js'), '1.0.25', true);
    2324
    24     // بارگذاری استایل‌ها
     25
    2526    wp_enqueue_style('fra-bootstrap', FRA_FACEID_CSS . 'bootstrap.min.css', array(), '5.3.3', 'all');
    26     // بررسی بارگذاری استایل‌های دیگه که ممکنه توسط قالب‌ها بارگذاری بشن
    27     if ( ! wp_style_is( 'fra-bootstrap', 'enqueued' ) ) {
     27
     28    if (!wp_style_is('fra-bootstrap', 'enqueued')) {
    2829        wp_enqueue_style('fra-bootstrap', FRA_FACEID_CSS . 'bootstrap.min.css', array(), '5.3.3', 'all');
    2930    }
     
    3334 * Register custom menu in the WordPress admin panel.
    3435 */
    35 function fra_faceid_register_my_custom_menu_page() {
     36function fra_faceid_register_my_custom_menu_page()
     37{
    3638    add_menu_page(
    3739        __('Facial Recognition', 'facial-recognition-authentication'),
     
    4749
    4850add_action('admin_menu', 'fra_faceid_register_my_custom_menu_page');
     51
     52
     53function disable_admin_notices_on_plugin_page()
     54{
     55    if (isset($_GET['page']) && $_GET['page'] === 'face-capture-register') {
     56        remove_all_actions('admin_notices');
     57    }
     58}
     59
     60add_action('admin_init', 'disable_admin_notices_on_plugin_page');
  • facial-recognition-authentication/trunk/inc/frontend.php

    r3239964 r3242754  
    44
    55// Function to load assets for the frontend
    6 function fra_faceid_load_assets() {
     6function fra_faceid_load_assets()
     7{
    78
    89    wp_enqueue_script('jquery');
     
    2223    ));
    2324}
     25
    2426add_action('login_enqueue_scripts', 'fra_faceid_load_assets');
    2527
    2628// Function to include custom login page
    27 function fra_faceid_login() {
     29function fra_faceid_login()
     30{
    2831    status_header(200);
    2932    include FRA_FACEID_INC_DIR . 'admin_menu_page2.php'; // Ensure the file exists in the correct path
     
    3235
    3336// Function to handle the login action
    34 function fra_faceid_handle_login() {
     37function fra_faceid_handle_login()
     38{
    3539    if (!headers_sent()) {
    3640        fra_faceid_login();
  • facial-recognition-authentication/trunk/readme.txt

    r3241680 r3242754  
    55Tested up to: 6.7
    66Requires PHP: 7.4
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.2
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    6868
    6969== Changelog ==
     70= 1.0.2 =
     71* Disabled admin notices on plugin page to improve user experience.
     72* Fixed minor bugs and improved performance.
    7073
    7174= 1.0.1 =
Note: See TracChangeset for help on using the changeset viewer.