Changeset 3250477
- Timestamp:
- 03/04/2025 02:07:29 PM (13 months ago)
- Location:
- email-re-validator/trunk
- Files:
-
- 2 edited
-
email-re-validator.php (modified) (11 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
email-re-validator/trunk/email-re-validator.php
r2825972 r3250477 1 1 <?php 2 2 3 /** 3 4 * The Wordpress User Email Verification, Confirmation and Re-validation Plugin Solution for Ultimate Member … … 6 7 * 7 8 * @author iFixcodes <info@ifixcodes.com> 8 * @copyright Copyright (c) 2022 , ifixcodes.com.9 * @copyright Copyright (c) 2022 - 2025, ifixcodes.com. 9 10 * @license GPLv2 or later http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 10 11 * @link https://ifixcodes.com … … 16 17 * Description: The easiest solution that allows site owners the option to enable email re-validation for their users through the ultimate member plugin. 17 18 * Donate link: https://ifixcodes.com/email-re-validator-plugin-for-ultimate-member/donation/ 18 * Version: 1.0.019 * Version: 2.0.0 19 20 * Author: iFixCodes.com 20 21 * Author URI: https://ifixcodes.com … … 41 42 42 43 if ( ! defined( 'IFXERV_VERSION' ) ) { 43 define( 'IFXERV_VERSION', ' 1.0.0' );44 define( 'IFXERV_VERSION', '2.0.0' ); 44 45 } 45 46 … … 47 48 48 49 /* 49 * IPX_PLUGIN_CHECK Class50 * ifxerv_plugin_checks function 50 51 * handles processes on plugin activation 51 52 * … … 53 54 */ 54 55 55 register_activation_hook( __FILE__, array('IFXERV_PLUGIN_CHECK','ifxerv_plugin_checks') ); 56 class IFXERV_PLUGIN_CHECK{ 56 57 register_activation_hook( __FILE__, 'ifxerv_plugin_checks'); 57 58 function ifxerv_plugin_checks() { 58 59 … … 66 67 } 67 68 68 }69 69 70 70 … … 78 78 function ifxerv_email_revalidate(){ 79 79 global $wp_query; 80 81 $wp_query->ifx_custom =false; 80 82 $current_user = wp_get_current_user(); 81 83 $ifxerv_args=array(); 84 $slug='ifxerv_approved_email'; 82 85 83 if (isset($_POST['user_email']) && isset($current_user->data->user_email) && isset(UM()->options()->options['ifxerv_approved_email_on']) && UM()->options()->options['ifxerv_approved_email_on']) { 86 if (isset($_POST['user_email']) && isset($current_user->data->user_email) && UM()->options()->get( $slug . '_on' )!==false){ 87 84 88 $ifxerv_args['user_email'] = sanitize_email( $_POST['user_email'] ); 85 89 if($ifxerv_args['user_email'] !== $current_user->data->user_email){ 86 um_reset_user(); 87 ifxerv_email_pending(); 90 $wp_query->ifx_custom =true; 91 um_reset_user(); 92 ifxerv_email_pending(); 88 93 wp_logout(); 89 94 exit( wp_redirect( add_query_arg( 'err', esc_attr( 'awaiting_new_email_confirmation' ), get_page_link(UM()->config()->permalinks['login']) ) ) ); … … 97 102 //Sets user status to awaiting confirmation and send out re-validation template with activation link 98 103 function ifxerv_email_pending() { 99 UM()->user()->assign_secretkey(); 100 UM()->user()->set_status( 'awaiting_email_confirmation' ); 101 102 //clear all sessions for email confirmation pending users 103 $user = \WP_Session_Tokens::get_instance( um_user( 'ID' ) ); 104 $user_id = um_user( 'ID' ); 105 UM()->common()->users()->assign_secretkey( $user_id ); 106 UM()->common()->users()->set_status( $user_id , 'awaiting_email_confirmation' ); 107 108 //clear all sessions for email confirmation pending users 109 $user = \WP_Session_Tokens::get_instance( $user_id ); 104 110 $user->destroy_all(); 105 106 UM()->mail()->send( um_user( 'user_email' ), 'ifxerv_approved_email' ); 111 112 //create activation link but prevent default activation email from being send out 113 add_filter( 'um_disable_email_notification_sending', 'my_disable_email_notification_sending', 10, 4 ); 114 UM()->common()->users()->send_activation( $user_id, true ); 115 116 //send out activtion link using custom email re-validator template 117 remove_filter( 'um_disable_email_notification_sending', 'my_disable_email_notification_sending', 10, 4 ); 118 UM()->mail()->send( um_user( 'user_email' ), 'ifxerv_approved_email', $args ); 119 120 121 107 122 } 123 108 124 109 125 /** … … 129 145 130 146 /* Default settings */ 131 UM()->options()->options = array_merge( array( 132 'ifxerv_approved_email_on' => 1, 133 'ifxerv_approved_email_sub' => '{site_name} - Verify your new email', 134 ), UM()->options()->options ); 147 foreach ( $custom_emails as $slug => $custom_email ){ 148 149 // Default settings. 150 UM()->options()->update( $slug.'_on' , 1);//empty( $custom_email['default_active'] ) ? 0 : 1; 151 UM()->options()->update( $slug.'_sub' , '{site_name} - Verify your new email');//$custom_email['subject']; 152 153 // Template file. 154 $located = um_email_locate_template( $slug ); 155 156 if ( ! file_exists( $located ) ) { 157 wp_mkdir_p( dirname( $located ) ); 158 file_put_contents( $located, $custom_email['body'] ); 159 } 160 161 $emails[ $slug ] = $custom_email; 162 163 } 135 164 136 165 return array_merge( $custom_emails, $emails ); 137 166 }add_filter( 'um_email_notifications','ifxerv_custom_um_email_notifications'); 167 168 169 138 170 139 171 /** … … 157 189 add_filter( 'um_custom_error_message_handler', 'ifxerv_custom_error_message_handler', 800, 2 ); 158 190 159 191 /*Newly added*/ 192 193 194 if ( ! function_exists( 'um_email_locate_template' ) ) { 195 /** 196 * Locate a template and return the path for inclusion. 197 */ 198 function um_email_locate_template( $template_name ) { 199 $blog_id = is_multisite() ? '/' . get_current_blog_id() : ''; 200 201 $template = locate_template( 202 array( 203 trailingslashit( 'ultimate-member/email' . $blog_id ) . $template_name . '.php', 204 trailingslashit( 'ultimate-member/email' ) . $template_name . '.php', 205 ) 206 ); 207 208 if ( ! $template ) { 209 $template = wp_normalize_path( STYLESHEETPATH . '/ultimate-member/email/' . $template_name . '.php' ); 210 } 211 212 return apply_filters( 'um_locate_email_template', $template, $template_name ); 213 } 214 } -
email-re-validator/trunk/readme.txt
r2826021 r3250477 7 7 Requires PHP: 5.6 8 8 Requires at least: 6.0 9 Tested up to: 6. 110 Stable tag: 1.0.09 Tested up to: 6.7 10 Stable tag: 2.0.0 11 11 License: GNU Version 2 or Any Later Version 12 12 License URI: http://www.gnu.org/licenses/gpl-3.0.txt … … 54 54 55 55 = Do I need to know any coding to use the Email Re-Validator plugin? = 56 No , be sure ultimate member is installed and configured, then simply install and activate the plugin and you're ready to go.56 No. Be sure you have the most current version of Ultimate Member installed and configured correctly. Then install and activate the email re-validator plugin. 57 57 58 58 = Will the plugin break my site? = 59 No . Wehave not used any external javascript or css. All code is custom built around the built-in wordpress and the ultimate plugin classes and functions to reduce maximum interruptions.59 Normally, no. But we understand that all servers are not made equally. We at iFixCodes have not used any external javascript or css. All code is custom built around the built-in wordpress and the ultimate plugin classes and functions to reduce maximum interruptions. 60 60 61 61 = Does the plugin work with any WordPress theme? = … … 91 91 * To learn more about version 1.0 please see this [email verification](https://ifixcodes.com/email-re-validator-plugin-for-ultimate-member/) 92 92 93 = 2.0.0: November, 2022 = 94 95 * Added support for up to ultimate member 2.10.0 96 * Added support for PHP 8.X 97 * Added support for WordPress 6.7 98 * Fixed missing activation link from UM 2.8+ 99 * Fixed sending of duplicate email activation 100 93 101 = 1.0.0: November, 2022 = 94 102
Note: See TracChangeset
for help on using the changeset viewer.