Plugin Directory

Changeset 3378497


Ignore:
Timestamp:
10/15/2025 12:16:18 AM (6 months ago)
Author:
reoon
Message:

Bug fix and security update.

Location:
reoon-email-verifier
Files:
41 added
5 edited

Legend:

Unmodified
Added
Removed
  • reoon-email-verifier/trunk/includes/ajax-class.php

    r3073708 r3378497  
    77class ReoonAjax
    88{
     9    public function __construct()
     10    {
     11        // Admin-only endpoints (no nopriv)
     12        add_action('wp_ajax_validate_reoon_api', array($this, 'validate_reoon_api'));
     13        add_action('wp_ajax_validate_reoon_email', array($this, 'validate_reoon_email'));
     14        add_action('wp_ajax_reoon_remove_api_key', array($this, 'reoon_remove_api_key'));
     15    }
     16   
     17   
     18    // Remove api key from plugin settings page (admin only).
     19    public function reoon_remove_api_key()
     20    {
     21        if ( ! current_user_can('manage_options') ) {
     22            wp_send_json_error(array('message' => 'Forbidden'), 403);
     23        }
    924
    10     public function __construct()
    11     {       
    12         add_action( 'wp_ajax_validate_reoon_api', array($this,'validate_reoon_api' ));
    13         add_action( 'wp_ajax_nopriv_validate_reoon_api', array($this,'validate_reoon_api' ));
     25        $options = get_option('reoonev-settings');
     26        if ( isset($options['reoon_api_key']) ) {
     27            unset($options['reoon_api_key']);
     28            // Updating it in place won't work; You must delete/re-add the whole option.
     29            // update_option( 'reoonev-settings', serialize( $options ) );
     30            delete_option('reoonev-settings');
     31            add_option( 'reoonev-settings',  $options);
     32        }
    1433
    15 
    16         add_action( 'wp_ajax_validate_reoon_email', array($this,'validate_reoon_email' ));
    17         add_action( 'wp_ajax_nopriv_validate_reoon_email', array($this,'validate_reoon_email' ));
    18 
    19 
    20         add_action('wp_ajax_reoon_remove_api_key', array($this,'reoon_remove_api_key'));       
     34        wp_send_json_success();
    2135    }
    2236
    2337
    24     public function reoon_remove_api_key() {
    25        
    26            
    27         $options = get_option("reoonev-settings" );
    28         if ( isset( $options['reoon_api_key'] ) ) {
    29             unset( $options['reoon_api_key'] );
    30             //update_option( 'reoonev-settings', serialize( $options ) );           
    31            
    32             delete_option('reoonev-settings');
    33             add_option( 'reoonev-settings',  $options  );
    34         }
    35            
    36         wp_send_json_success();
    37        
    38     }
    39 
     38    // Test an email from the admin settings screen (admin only).
    4039    public function validate_reoon_email()
    4140    {
     41        if ( ! current_user_can('manage_options') ) {
     42            wp_send_json_error(array('message' => 'Forbidden'), 403);
     43        }
     44
    4245        if ( isset( $_POST["email"] ) ) {
    4346            $email = sanitize_email( $_POST["email"] );
     
    5356                   
    5457            if ( $result !== false ) {
    55                 wp_send_json( "Email validation is successful. Email status is: <b>" . esc_html( $result ) . "</b>" );
     58                wp_send_json( "This email will pass through. Email Status: <b>" . esc_html( $result ) . "</b>" );
    5659            } else {
    57                 wp_send_json( "Email validation is unsuccessful" );
     60                wp_send_json( "Email validation is unsuccessful (Bad email or failed verification)." );
    5861            }
    5962        } else {
    60             wp_send_json( "Email parameter is missing" );
     63            wp_send_json( "Email parameter is missing." );
    6164        }
    6265   
    63         die();  
     66        die();
    6467    }
    6568   
    66 public function validate_reoon_api(){
    6769
    68    
     70    // Validate API key (admin only).
     71    public function validate_reoon_api()
     72    {
     73        if ( ! current_user_can('manage_options') ) {
     74            wp_send_json_error(array('message' => 'Forbidden'), 403);
     75        }
    6976
    70     $api_key = $_POST["api_key"];
    71     $api = new ReoonApi();
    72     $result = $api->GetAccountInfo($api_key);
     77        $api_key = $_POST["api_key"];
     78        $api = new ReoonApi();
     79        $result = $api->GetAccountInfo($api_key);
    7380
    74     update_option("reoon_api_key",$api_key);
    75    
    76     var_dump($result);
    77      // your code
    78      wp_die();
    79 }
    80    
    81 
    82 
     81        update_option("reoon_api_key",$api_key);
     82       
     83        var_dump($result);
     84       
     85        wp_die();
     86    }
    8387}
    8488
    85 $reon_ajax = new ReoonAjax();
     89new ReoonAjax();
  • reoon-email-verifier/trunk/includes/reoon-api.php

    r3320207 r3378497  
    3030        }
    3131
    32 
    33 
    3432        $data = wp_remote_get("https://emailverifier.reoon.com/api/v1/verify?email=" . urlencode($email) . "&mode=" . urlencode($mode) . "&key=" . urlencode($key) . "&source=reoon_ev_wp_plugin", array(
    3533            "timeout" => $timeout
     
    4240
    4341        $res =  json_decode($data["body"]);
    44 
    4542
    4643
     
    6259            return $res->status;
    6360        }
    64 
    65 
    6661
    6762        return false;
     
    10398
    10499       
    105        
    106 
    107100        $email = str_replace("+", "%2B", $email);
    108101       
     
    159152        }
    160153
    161 
    162 
    163154        return false;
    164155    }
     156   
    165157
    166158    public function GetAccountInfo($api_key = "")
     
    172164        }
    173165
    174         $data = wp_remote_get("https://emailverifier.reoon.com/api/v1/get-account-info?key=" . $key);
     166        $data = wp_remote_get("https://emailverifier.reoon.com/api/v1/get-account-info?key=" . $key. "&source=reoon_ev_wp_plugin");
    175167
    176168        if (is_wp_error($data)) {
  • reoon-email-verifier/trunk/includes/util-class.php

    r3320207 r3378497  
    88class Util
    99{
    10 
    11 
    1210    public static function get_encrypted_api_key()
    1311    {
  • reoon-email-verifier/trunk/readme.txt

    r3320207 r3378497  
    33Tags: email verifier, email validator, block spam registration, form email validation, temporary email blocker
    44Requires at least: 4.7
    5 Tested up to: 6.8.1
    6 Requires PHP: 5.4
    7 Stable tag: 1.3.1
     5Tested up to: 6.8.3
     6Requires PHP: 7.4
     7Stable tag: 1.3.2
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7272In such cases email submissions will not be checked by the plugin and every submitted email addresses will be accepted (as like our plugin is not installed).
    7373
    74 = Is it GDPR compliant? =
    75 Yes, all data is encrypted and automatically deleted after 15 days of submission, ensuring compliance with GDPR regulations.
     74= Is it GDPR-friendly?
     75Our service is designed to help site owners meet privacy obligations. All data is encrypted and automatically deleted after 15 days of submission. See our privacy policy page to learn more.
    7676
    7777= How to get the support if something does not work? =
     
    104104* Minor performance improvements and compatibility updates.
    105105
     106= 1.3.2 =
     107* Support updated for happyforms (upgrade). Bug fix and security updates.
     108
     109
    106110
    107111== Upgrade Notice ==
     
    122126Added support for 7 new popular WordPress form plugins.
    123127
     128= 1.3.2 =
     129Support updated for happyforms (upgrade). Bug fix and security updates.
    124130
    125131
  • reoon-email-verifier/trunk/reoon-email-verifier.php

    r3320207 r3378497  
    44 * Plugin URI: https://www.reoon.com/email-verifier/
    55 * Description: This plugin verifies email addresses upon online form submission, safeguarding against invalid, temporary, disposable and harmful email addresses.
    6  * Version: 1.3.1
     6 * Version: 1.3.2
    77 * Author: Reoon Technology
    88 * Author URI: https://www.reoon.com/
     
    7777Class ReoonEmailVerifier{
    7878
    79     public function __construct()
    80     {
     79    public function __construct(){
    8180        // Register the Reoon Email Verifier menu
    8281        add_action( 'admin_menu', array($this,'reoonev_menu' ));
     
    8483        add_action( 'admin_enqueue_scripts', array($this,'enqueue_admin_scripts' ));
    8584
    86 
    8785        add_action( 'plugins_loaded', array($this,'plugins_loaded_action' ));
    8886       
    89 
    9087        register_activation_hook(__FILE__, array($this, 'reoonev_activation'));
    9188
    92 
    93        
    9489        add_filter( 'plugin_action_links_reoon-email-verifier/reoon-email-verifier.php', array($this,'add_settings_link'), 9999, 2 );
    95 
    96        
    9790    }
    9891
    9992
    100     public function add_settings_link( $links, $file ) {
     93    public function add_settings_link( $links, $file ){
    10194        // Check if the plugin being processed is the one we want to add a settings link for.
    10295        if ( $file == 'reoon-email-verifier/reoon-email-verifier.php' ) {
     
    109102
    110103
    111     public function reoonev_activation()
    112     {
     104    public function reoonev_activation(){
    113105        // Set default values for the plugin settings
    114106        $default_settings = array(       
     
    128120            'fluent_forms'       => 1,
    129121            'forminator_forms'   => 1,
    130             'happyforms'=>1,
    131             'mailmint_form'=>1,
    132             'everestforms'=>1,
    133             'buddyform'=>1,
    134             'metform'=>1,
    135             'jetformbuilder'=>1,
    136             'wsform'=>1,
    137             'surecart'=>1,
    138             'wordpress_comment_form'=>1,
    139             'best_websoft_forms'=>1,
    140             'bitform'=>1,
     122            'happyforms'         => 1,
     123            'mailmint_form'      => 1,
     124            'everestforms'       => 1,
     125            'buddyform'          => 1,
     126            'metform'            => 1,
     127            'jetformbuilder'     => 1,
     128            'wsform'             => 1,
     129            'surecart'           => 1,
     130            'wordpress_comment_form' => 1,
     131            'best_websoft_forms' => 1,
     132            'bitform'            => 1,
     133           
    141134            'timeout'=>10,
    142135            'custom_error_message'=>'This email address is not allowed'
     
    155148    }
    156149
    157     function plugins_loaded_action()
    158     {
    159 
     150    function plugins_loaded_action() {
    160151        if (!function_exists('is_plugin_active')) {
    161152            include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
     
    167158        }
    168159
    169         if(class_exists("FrmForm") && Util::get_reoon_option("formiddable_form")==1)
    170         {
     160        if(class_exists("FrmForm") && Util::get_reoon_option("formiddable_form")==1) {
    171161            $formidable_validator = new FormiddableFormsValidator();
    172162            add_filter('frm_validate_field_entry', array($formidable_validator,'reoonev_validate_emails'),10, 3);
    173163        }
    174164
    175         if(function_exists("wpcf7") && Util::get_reoon_option("contact_form_7")==1)
    176         {
    177            
     165        if(function_exists("wpcf7") && Util::get_reoon_option("contact_form_7")==1) {
    178166            $cf7_validator = new ContactForm7Validator();
    179            
    180             add_filter( 'wpcf7_validate_email*', array($cf7_validator,'reoonev_validate_emails'), 20, 2);
     167            add_filter( 'wpcf7_validate_email',  array($cf7_validator, 'reoonev_validate_emails'), 20, 2);
     168            add_filter( 'wpcf7_validate_email*', array($cf7_validator, 'reoonev_validate_emails'), 20, 2);
    181169        }
    182170
     
    185173
    186174
    187         if(class_exists('WooCommerce')  && Util::get_reoon_option("checkout_form")==1)
    188         {
     175        if(class_exists('WooCommerce')  && Util::get_reoon_option("checkout_form")==1) {
    189176            $wc_checkout = new WCCheckoutFormValidator();
    190177            add_action( 'woocommerce_checkout_process', array($wc_checkout,'reoonev_validate_emails' ));
    191178        }
    192179
    193         if(class_exists("Ninja_Forms")  && Util::get_reoon_option("ninja_forms")==1)
    194         {
     180        if(class_exists("Ninja_Forms")  && Util::get_reoon_option("ninja_forms")==1) {
    195181            $ninja_forms = new NinjaFormsValidator();
    196182            add_filter( 'ninja_forms_submit_data', array($ninja_forms,'reoonev_validate_emails' ));
    197183        }
    198184
    199         if(is_plugin_active( 'elementor/elementor.php' )  && Util::get_reoon_option("elementor_forms")==1)
    200         {
     185        if(is_plugin_active( 'elementor/elementor.php' )  && Util::get_reoon_option("elementor_forms")==1) {
    201186            $elementor_forms = new ElementorFormValidator();
    202187            add_action( 'elementor_pro/forms/validation/email', array($elementor_forms,'reoonev_validate_emails' ),10, 3);
     
    204189
    205190
    206         if(function_exists('wpforms') && Util::get_reoon_option("wp_forms")==1)
    207         {           
     191        if(function_exists('wpforms') && Util::get_reoon_option("wp_forms")==1) {           
    208192            $wpforms = new WPFormsValidator();
    209193            add_action( 'wpforms_process_validate_email', array($wpforms,'reoonev_validate_emails' ), 10, 3);
    210194        }
    211195       
    212         if(function_exists( 'wpFluentForm' )  && Util::get_reoon_option("fluent_forms")==1)
    213         {           
     196        if(function_exists( 'wpFluentForm' )  && Util::get_reoon_option("fluent_forms")==1) {           
    214197            $fluentForms = new FluentFormsValidator();
    215198            add_filter( 'fluentform/validate_input_item_input_email', array($fluentForms,'reoonev_validate_emails' ), 10, 5);
     
    223206        }
    224207
    225         if( is_plugin_active( 'happyforms/happyforms.php' ) && Util::get_reoon_option("happyforms")==1) {
     208        if( (is_plugin_active( 'happyforms/happyforms.php' ) || is_plugin_active( 'happyforms-upgrade/happyforms-upgrade.php' )) && Util::get_reoon_option("happyforms")==1) {
    226209            $happyforms = new HappyFormsValidator();           
    227210            add_filter( 'happyforms_validate_part_submission', array($happyforms,'reoonev_validate_emails'), 10, 4 );
    228           }
     211        }
    229212         
    230           if ( is_plugin_active('contact-form-plugin/contact_form.php') && Util::get_reoon_option("best_websoft_forms")==1) {               
     213        if ( is_plugin_active('contact-form-plugin/contact_form.php') && Util::get_reoon_option("best_websoft_forms")==1) {               
    231214            $bestWebsoftFormsValidator = new BestWebsoftFormsValidator();         
    232215            add_filter( 'cntctfrm_check_form', array($bestWebsoftFormsValidator,'reoonev_validate_emails'), 10 );
    233           }
    234 
    235           if ( Util::get_reoon_option("wordpress_comment_form")==1) {
     216        }
     217
     218        if ( Util::get_reoon_option("wordpress_comment_form")==1) {
    236219            $wordpress_comment_form = new WPCommentFormValidator();
    237220            add_filter( 'preprocess_comment', array($wordpress_comment_form,'reoonev_validate_emails'), 10, 1 );
    238           }
    239 
    240           if( is_plugin_active( 'mail-mint/mail-mint.php' ) && Util::get_reoon_option("mailmint_form")==1) {
     221        }
     222
     223        if( is_plugin_active( 'mail-mint/mail-mint.php' ) && Util::get_reoon_option("mailmint_form")==1) {
    241224            $mailMintFormsValidator = new MailMintFormsValidator();           
    242225            add_action( 'mailmint_before_form_submit', array($mailMintFormsValidator,'reoonev_validate_emails'), 10, 2 );
    243           }
    244 
    245           if( is_plugin_active( 'everest-forms/everest-forms.php' ) && Util::get_reoon_option("everestforms")==1) {
     226        }
     227
     228        if( is_plugin_active( 'everest-forms/everest-forms.php' ) && Util::get_reoon_option("everestforms")==1) {
    246229            $everestFormValidator = new EverestFormValidator();           
    247230            add_filter( 'everest_forms_visible_fields', array($everestFormValidator,'reoonev_validate_emails'), 10, 4 );
    248           }
    249 
    250           if( is_plugin_active( 'surecart/surecart.php' ) && Util::get_reoon_option("surecart")==1) {
     231        }
     232
     233        if( is_plugin_active( 'surecart/surecart.php' ) && Util::get_reoon_option("surecart")==1) {
    251234            $surecartValidator = new SurecartValidator();           
    252235            add_filter( 'surecart/checkout/validate', array($surecartValidator,'reoonev_validate_emails'), 10, 3 );
    253           }
    254 
    255           if( is_plugin_active( 'ws-form/ws-form.php' ) && Util::get_reoon_option("wsform")==1) {
     236        }
     237
     238        if( is_plugin_active( 'ws-form/ws-form.php' ) && Util::get_reoon_option("wsform")==1) {
    256239            $wsFormValidator = new WsFormValidator();           
    257240            add_filter( 'wsf_action_email_email_validate', array($wsFormValidator,'reoonev_validate_emails'), 10, 2 );
    258           }
    259 
    260           if( is_plugin_active( 'jetformbuilder/jet-form-builder.php' ) && Util::get_reoon_option("jetformbuilder")==1) {
     241        }
     242
     243        if( is_plugin_active( 'jetformbuilder/jet-form-builder.php' ) && Util::get_reoon_option("jetformbuilder")==1) {
    261244            $jetFormBuilderValidator = new JetFormBuilderValidator();           
    262245            add_action( 'jet-form-builder/form-handler/before-send', array($jetFormBuilderValidator,'reoonev_validate_emails') );           
    263           }
    264 
    265           if( is_plugin_active( 'metform/metform.php' ) && Util::get_reoon_option("metform")==1) {
     246        }
     247
     248        if( is_plugin_active( 'metform/metform.php' ) && Util::get_reoon_option("metform")==1) {
    266249            $metFormValidator = new MetformValidator();
    267250            add_action( 'metform_before_store_form_data', array($metFormValidator,'reoonev_validate_emails'),10,4 );
    268251
    269           }
    270           if( is_plugin_active( 'buddyforms/BuddyForms.php' ) && Util::get_reoon_option("buddyform")==1) {
     252        }
     253       
     254        if( is_plugin_active( 'buddyforms/BuddyForms.php' ) && Util::get_reoon_option("buddyform")==1) {
    271255            $buddyformValidator = new BuddyFormValidator();           
    272256            add_filter( 'buddyforms_form_custom_validation', array($buddyformValidator,'reoonev_validate_emails'),10,2 );           
    273           }
    274 
    275           if( is_plugin_active( 'bit-form/bitforms.php' ) && Util::get_reoon_option("bitform")==1) {
     257        }
     258
     259        if( is_plugin_active( 'bit-form/bitforms.php' ) && Util::get_reoon_option("bitform")==1) {
    276260            $bitFormValidator = new BitFormValidator();
    277261            add_filter( 'bitform_filter_form_validation', array($bitFormValidator,'reoonev_validate_emails'),10,2 );           
    278           }
     262        }
    279263         
    280264    }
     
    282266
    283267    function reoonev_menu() {
    284 
    285268        $dashboard_view = new DashboardView();
    286269        $settings_view = new SettignsView();
     
    323306
    324307
    325     public function enqueue_admin_scripts($hook)
    326     {
     308    public function enqueue_admin_scripts($hook){
    327309        if ('reoon-email-verifier_page_reoonev-settings' == $hook || $hook == "toplevel_page_reoon-email-verifier" || $hook == "reoon-email-verifier_page_reoonevfaq") {
    328310            // Define the path to the script and style for easier reference
     
    339321    }
    340322
    341 
    342 
    343323}
    344324
Note: See TracChangeset for help on using the changeset viewer.