Version Description
- Rewrote login errors so they can be translated easily
- Extended the send credentials email so there is a bit more info like the link to the website
- Add plugin notification about the Toolbox add-on.
- Fixed issue with update password and field visibility addon.
Download this release
Release Info
Developer | madalin.ungureanu |
Plugin | User registration & user profile – Profile Builder |
Version | 2.9.1 |
Comparing to | |
See all releases |
Code changes from version 2.9.0 to 2.9.1
- admin/admin-functions.php +9 -8
- admin/manage-fields.php +35 -32
- admin/register-version.php +22 -22
- assets/css/style-front-end.css +13 -2
- assets/js/jquery-manage-fields-live-change.js +31 -11
- features/email-confirmation/email-confirmation.php +3 -2
- features/functions.php +2 -2
- front-end/edit-profile.php +9 -1
- front-end/login.php +18 -17
- index.php +2 -2
- readme.txt +7 -1
admin/admin-functions.php
CHANGED
@@ -84,7 +84,7 @@ add_filter( 'wck_element_class_wppb_manage_fields', 'wppb_manage_fields_display_
|
|
84 |
*/
|
85 |
function wppb_update_container_class( $update_container_class, $meta, $results, $element_id ) {
|
86 |
$wppb_element_type = Wordpress_Creation_Kit_PB::wck_generate_slug( $results[$element_id]["field"] );
|
87 |
-
|
88 |
return "class='wck_update_container update_container_$meta update_container_$wppb_element_type element_type_$wppb_element_type'";
|
89 |
}
|
90 |
add_filter( 'wck_update_container_class_wppb_manage_fields', 'wppb_update_container_class', 10, 4 );
|
@@ -104,7 +104,7 @@ add_filter( 'wck_update_container_class_wppb_manage_fields', 'wppb_update_contai
|
|
104 |
*/
|
105 |
function wppb_element_class( $element_class, $meta, $results, $element_id ){
|
106 |
$wppb_element_type = Wordpress_Creation_Kit_PB::wck_generate_slug( $results[$element_id]["field"] );
|
107 |
-
|
108 |
return "class='element_type_$wppb_element_type added_fields_list'";
|
109 |
}
|
110 |
add_filter( 'wck_element_class_wppb_manage_fields', 'wppb_element_class', 10, 4 );
|
@@ -231,7 +231,7 @@ function wppb_plugin_action_links( $links, $file ) {
|
|
231 |
}
|
232 |
|
233 |
/**
|
234 |
-
* add links on plugin page
|
235 |
*/
|
236 |
add_filter( 'plugin_row_meta', 'wppb_plugin_row_meta', 10, 2 );
|
237 |
function wppb_plugin_row_meta( $links, $file ) {
|
@@ -254,14 +254,15 @@ function wppb_add_plugin_notifications() {
|
|
254 |
/* initiate the plugin notifications class */
|
255 |
$notifications = WPPB_Plugin_Notifications::get_instance();
|
256 |
/* this must be unique */
|
257 |
-
$notification_id = '
|
258 |
|
259 |
-
|
|
|
260 |
// be careful to use wppb_dismiss_admin_notification as query arg
|
261 |
-
$message .= '<p><a href="
|
262 |
$message .= '<a href="' . add_query_arg( array( 'wppb_dismiss_admin_notification' => $notification_id ) ) . '" type="button" class="notice-dismiss"><span class="screen-reader-text">' . __( 'Dismiss this notice.', 'profile-builder' ) . '</span></a>';
|
263 |
|
264 |
-
$notifications->add_notification( $notification_id, $message, 'wppb-notice wppb-narrow notice notice-info', true, array( 'profile-builder-
|
265 |
}
|
266 |
|
267 |
|
@@ -302,4 +303,4 @@ function wppb_create_form_pages(){
|
|
302 |
wp_safe_redirect( admin_url('edit.php?s=%5Bwppb-&post_status=all&post_type=page&action=-1&m=0&paged=1&action2=-1') );
|
303 |
}
|
304 |
}
|
305 |
-
}
|
84 |
*/
|
85 |
function wppb_update_container_class( $update_container_class, $meta, $results, $element_id ) {
|
86 |
$wppb_element_type = Wordpress_Creation_Kit_PB::wck_generate_slug( $results[$element_id]["field"] );
|
87 |
+
|
88 |
return "class='wck_update_container update_container_$meta update_container_$wppb_element_type element_type_$wppb_element_type'";
|
89 |
}
|
90 |
add_filter( 'wck_update_container_class_wppb_manage_fields', 'wppb_update_container_class', 10, 4 );
|
104 |
*/
|
105 |
function wppb_element_class( $element_class, $meta, $results, $element_id ){
|
106 |
$wppb_element_type = Wordpress_Creation_Kit_PB::wck_generate_slug( $results[$element_id]["field"] );
|
107 |
+
|
108 |
return "class='element_type_$wppb_element_type added_fields_list'";
|
109 |
}
|
110 |
add_filter( 'wck_element_class_wppb_manage_fields', 'wppb_element_class', 10, 4 );
|
231 |
}
|
232 |
|
233 |
/**
|
234 |
+
* add links on plugin page
|
235 |
*/
|
236 |
add_filter( 'plugin_row_meta', 'wppb_plugin_row_meta', 10, 2 );
|
237 |
function wppb_plugin_row_meta( $links, $file ) {
|
254 |
/* initiate the plugin notifications class */
|
255 |
$notifications = WPPB_Plugin_Notifications::get_instance();
|
256 |
/* this must be unique */
|
257 |
+
$notification_id = 'wppb_new_feature_customization_toolbox';
|
258 |
|
259 |
+
$message = '<img style="float: left; margin: 10px 12px 10px 0; max-width: 100px;" src="https://www.cozmoslabs.com/wp-content/themes/cozmiclight/img/pb_addon_small_toolbox.png" alt="Customization Toolbox Add-on"/>';
|
260 |
+
$message .= '<p style="margin-top: 16px;">' . __( 'Check out the Customization Toolbox add-on which packs the most popular customization requests from Profile Builder.', 'profile-builder' ) . '</p>';
|
261 |
// be careful to use wppb_dismiss_admin_notification as query arg
|
262 |
+
$message .= '<p><a href="https://www.cozmoslabs.com/add-ons/customization-toolbox/" class="button-primary">' . __( 'See details', 'profile-builder' ) . '</a></p>';
|
263 |
$message .= '<a href="' . add_query_arg( array( 'wppb_dismiss_admin_notification' => $notification_id ) ) . '" type="button" class="notice-dismiss"><span class="screen-reader-text">' . __( 'Dismiss this notice.', 'profile-builder' ) . '</span></a>';
|
264 |
|
265 |
+
$notifications->add_notification( $notification_id, $message, 'wppb-notice wppb-narrow notice notice-info', true, array( 'profile-builder-add-ons' ) );
|
266 |
}
|
267 |
|
268 |
|
303 |
wp_safe_redirect( admin_url('edit.php?s=%5Bwppb-&post_status=all&post_type=page&action=-1&m=0&paged=1&action2=-1') );
|
304 |
}
|
305 |
}
|
306 |
+
}
|
admin/manage-fields.php
CHANGED
@@ -22,7 +22,7 @@ function wppb_manage_fields_submenu(){
|
|
22 |
add_action( 'admin_menu', 'wppb_manage_fields_submenu', 1 );
|
23 |
|
24 |
function wppb_populate_manage_fields(){
|
25 |
-
|
26 |
$manage_field_types = array(
|
27 |
'optgroups' => array(
|
28 |
'default' =>
|
@@ -101,6 +101,9 @@ function wppb_populate_manage_fields(){
|
|
101 |
$manage_field_types['optgroups']['advanced']['options'][] = 'Colorpicker';
|
102 |
$manage_field_types['optgroups']['advanced']['options'][] = 'Validation';
|
103 |
$manage_field_types['optgroups']['advanced']['options'][] = 'Map';
|
|
|
|
|
|
|
104 |
}
|
105 |
|
106 |
/* added recaptcha and user role field since version 2.6.2 */
|
@@ -201,7 +204,7 @@ function wppb_populate_manage_fields(){
|
|
201 |
array( 'type' => 'select', 'slug' => 'required', 'title' => __( 'Required', 'profile-builder' ), 'options' => array( 'No', 'Yes' ), 'default' => 'No', 'description' => __( 'Whether the field is required or not', 'profile-builder' ) ),
|
202 |
array( 'type' => 'select', 'slug' => 'overwrite-existing', 'title' => __( 'Overwrite Existing', 'profile-builder' ), 'options' => array( 'No', 'Yes' ), 'default' => 'No', 'description' => __( "Selecting 'Yes' will add the field to the list, but will overwrite any other field in the database that has the same meta-name<br/>Use this at your own risk", 'profile-builder' ) ),
|
203 |
) );
|
204 |
-
|
205 |
// create the new submenu with the above options
|
206 |
$args = array(
|
207 |
'metabox_id' => 'manage-fields',
|
@@ -247,14 +250,14 @@ function wppb_prepopulate_fields(){
|
|
247 |
$prepopulated_fields[] = array( 'field' => 'Default - Contact Info (Heading)', 'field-title' => __( 'Contact Info', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '7', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
248 |
$prepopulated_fields[] = array( 'field' => 'Default - E-mail', 'field-title' => __( 'E-mail', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '8', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'Yes' );
|
249 |
$prepopulated_fields[] = array( 'field' => 'Default - Website', 'field-title' => __( 'Website', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '9', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
250 |
-
|
251 |
// Default contact methods were removed in WP 3.6. A filter dictates contact methods.
|
252 |
if ( apply_filters( 'wppb_remove_default_contact_methods', get_site_option( 'initial_db_version' ) < 23588 ) ){
|
253 |
$prepopulated_fields[] = array( 'field' => 'Default - AIM', 'field-title' => __( 'AIM', 'profile-builder' ), 'meta-name' => 'aim', 'overwrite-existing' => 'No', 'id' => '10', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
254 |
$prepopulated_fields[] = array( 'field' => 'Default - Yahoo IM', 'field-title' => __( 'Yahoo IM', 'profile-builder' ), 'meta-name' => 'yim', 'overwrite-existing' => 'No', 'id' => '11', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
255 |
$prepopulated_fields[] = array( 'field' => 'Default - Jabber / Google Talk', 'field-title' => __( 'Jabber / Google Talk', 'profile-builder' ), 'meta-name' => 'jabber', 'overwrite-existing' => 'No', 'id' => '12', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
256 |
}
|
257 |
-
|
258 |
$prepopulated_fields[] = array( 'field' => 'Default - About Yourself (Heading)', 'field-title' => __( 'About Yourself', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '13', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
259 |
$prepopulated_fields[] = array( 'field' => 'Default - Biographical Info', 'field-title' => __( 'Biographical Info', 'profile-builder' ), 'meta-name' => 'description', 'overwrite-existing' => 'No', 'id' => '14', 'description' => __( 'Share a little biographical information to fill out your profile. This may be shown publicly.', 'profile-builder' ), 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'required' => 'No' );
|
260 |
$prepopulated_fields[] = array( 'field' => 'Default - Password', 'field-title' => __( 'Password', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '15', 'description' => __( 'Type your password.', 'profile-builder' ), 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'Yes' );
|
@@ -275,7 +278,7 @@ function wppb_prepopulate_fields(){
|
|
275 |
*/
|
276 |
function wppb_get_meta_name( $option = 'wppb_manage_fields', $prefix = 'custom_field_' ){
|
277 |
$id = 1;
|
278 |
-
|
279 |
$wppb_manage_fields = get_option( $option, 'not_found' );
|
280 |
|
281 |
if ( ( $wppb_manage_fields === 'not_found' ) || ( empty( $wppb_manage_fields ) ) ){
|
@@ -961,7 +964,7 @@ add_filter( 'wck_add_meta_filter_values_wppb_manage_fields', 'wppb_check_unique_
|
|
961 |
|
962 |
|
963 |
function wppb_return_unique_field_list( $only_default_fields = false ){
|
964 |
-
|
965 |
$unique_field_list[] = 'Default - Name (Heading)';
|
966 |
$unique_field_list[] = 'Default - Contact Info (Heading)';
|
967 |
$unique_field_list[] = 'Default - About Yourself (Heading)';
|
@@ -978,7 +981,7 @@ function wppb_return_unique_field_list( $only_default_fields = false ){
|
|
978 |
$unique_field_list[] = 'Default - Yahoo IM';
|
979 |
$unique_field_list[] = 'Default - Jabber / Google Talk';
|
980 |
}
|
981 |
-
|
982 |
$unique_field_list[] = 'Default - Password';
|
983 |
$unique_field_list[] = 'Default - Repeat Password';
|
984 |
$unique_field_list[] = 'Default - Biographical Info';
|
@@ -1015,15 +1018,15 @@ function wppb_check_field_on_edit_add( $message, $fields, $required_fields, $met
|
|
1015 |
global $wpdb;
|
1016 |
|
1017 |
if ( $meta_name == 'wppb_manage_fields' ){
|
1018 |
-
|
1019 |
// check for a valid field-type (fallback)
|
1020 |
if ( $posted_values['field'] == '' )
|
1021 |
$message .= __( "You must select a field\n", 'profile-builder' );
|
1022 |
// END check for a valid field-type (fallback)
|
1023 |
-
|
1024 |
$unique_field_list = wppb_return_unique_field_list();
|
1025 |
$all_fields = apply_filters( 'wppb_manage_fields_check_field_on_edit_add', get_option ( $meta_name, 'not_set' ), $posted_values );
|
1026 |
-
|
1027 |
// check if the unique fields are only added once
|
1028 |
if( $all_fields != 'not_set' ){
|
1029 |
foreach( $all_fields as $field ){
|
@@ -1040,23 +1043,23 @@ function wppb_check_field_on_edit_add( $message, $fields, $required_fields, $met
|
|
1040 |
if ( is_numeric( $posted_values['avatar-size'] ) ){
|
1041 |
if ( ( $posted_values['avatar-size'] < 20 ) || ( $posted_values['avatar-size'] > 200 ) )
|
1042 |
$message .= __( "The entered avatar size is not between 20 and 200\n", 'profile-builder' );
|
1043 |
-
|
1044 |
}else
|
1045 |
$message .= __( "The entered avatar size is not numerical\n", 'profile-builder' );
|
1046 |
|
1047 |
}
|
1048 |
// END check for avatar size
|
1049 |
-
|
1050 |
// check for correct row value
|
1051 |
if ( ( $posted_values['field'] == 'Default - Biographical Info' ) || ( $posted_values['field'] == 'Textarea' ) ){
|
1052 |
if ( !is_numeric( $posted_values['row-count'] ) )
|
1053 |
$message .= __( "The entered row number is not numerical\n", 'profile-builder' );
|
1054 |
-
|
1055 |
elseif ( trim( $posted_values['row-count'] ) == '' )
|
1056 |
$message .= __( "You must enter a value for the row number\n", 'profile-builder' );
|
1057 |
}
|
1058 |
// END check for correct row value
|
1059 |
-
|
1060 |
|
1061 |
// check for the public and private keys
|
1062 |
if ( $posted_values['field'] == 'reCAPTCHA'){
|
@@ -1066,26 +1069,26 @@ function wppb_check_field_on_edit_add( $message, $fields, $required_fields, $met
|
|
1066 |
$message .= __( "You must enter the secret key\n", 'profile-builder' );
|
1067 |
}
|
1068 |
// END check for the public and private keys
|
1069 |
-
|
1070 |
// check for the correct the date-format
|
1071 |
if ( $posted_values['field'] == 'Datepicker' ){
|
1072 |
-
$date_format = strtolower( $posted_values['date-format'] );
|
1073 |
if ( trim( $date_format ) != 'mm/dd/yy' && trim( $date_format ) != 'mm/yy/dd' && trim( $date_format ) != 'dd/yy/mm' &&
|
1074 |
trim( $date_format ) != 'dd/mm/yy' && trim( $date_format ) != 'yy/dd/mm' && trim( $date_format ) != 'yy/mm/dd' &&
|
1075 |
trim( $date_format ) != 'yy-mm-dd' && trim( $date_format ) != 'DD, dd-M-y' && trim( $date_format ) != 'D, dd M yy' &&
|
1076 |
trim( $date_format ) != 'D, d M y' && trim( $date_format ) != 'D, d M yy' && trim( $date_format ) != 'mm-dd-yy' && trim( $date_format ) != '@' )
|
1077 |
$message .= __( "The entered value for the Datepicker is not a valid date-format\n", 'profile-builder' );
|
1078 |
-
|
1079 |
elseif ( trim( $date_format ) == '' )
|
1080 |
$message .= __( "You must enter a value for the date-format\n", 'profile-builder' );
|
1081 |
}
|
1082 |
-
// END check for the correct the date-format
|
1083 |
-
|
1084 |
//check for empty meta-name and duplicate meta-name
|
1085 |
if ( $posted_values['overwrite-existing'] == 'No' ){
|
1086 |
$skip_check_for_fields = wppb_return_unique_field_list(true);
|
1087 |
$skip_check_for_fields = apply_filters ( 'wppb_skip_check_for_fields', $skip_check_for_fields );
|
1088 |
-
|
1089 |
if ( !in_array( trim( $posted_values['field'] ), $skip_check_for_fields ) ){
|
1090 |
$unique_meta_name_list = array( 'first_name', 'last_name', 'nickname', 'description' );
|
1091 |
|
@@ -1102,24 +1105,24 @@ function wppb_check_field_on_edit_add( $message, $fields, $required_fields, $met
|
|
1102 |
$unique_meta_name_list[] = 'yim';
|
1103 |
$unique_meta_name_list[] = 'jabber';
|
1104 |
}
|
1105 |
-
|
1106 |
// if the desired meta-name is one of the following, automatically give an error
|
1107 |
if ( in_array( trim( $posted_values['meta-name'] ), apply_filters ( 'wppb_unique_meta_name_list', $unique_meta_name_list ) ) )
|
1108 |
$message .= __( "That meta-name is already in use\n", 'profile-builder' );
|
1109 |
-
|
1110 |
else{
|
1111 |
$found_in_custom_fields = false;
|
1112 |
-
|
1113 |
if( $all_fields != 'not_set' )
|
1114 |
foreach( $all_fields as $field ){
|
1115 |
if ( $posted_values['meta-name'] != '' && ( $field['meta-name'] == $posted_values['meta-name'] ) && ( $field['id'] != $posted_values['id'] ) ){
|
1116 |
$message .= __( "That meta-name is already in use\n", 'profile-builder' );
|
1117 |
$found_in_custom_fields = true;
|
1118 |
-
|
1119 |
}elseif ( ( $field['meta-name'] == $posted_values['meta-name'] ) && ( $field['id'] == $posted_values['id'] ) )
|
1120 |
$found_in_custom_fields = true;
|
1121 |
}
|
1122 |
-
|
1123 |
if ( $found_in_custom_fields === false ){
|
1124 |
if( $posted_values['meta-name'] != '' ) {
|
1125 |
$found_meta_name = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE meta_key = %s", $posted_values['meta-name']));
|
@@ -1139,7 +1142,7 @@ function wppb_check_field_on_edit_add( $message, $fields, $required_fields, $met
|
|
1139 |
}
|
1140 |
}
|
1141 |
// END check for correct meta name on upload field
|
1142 |
-
|
1143 |
// check for valid default option (checkbox, select, radio)
|
1144 |
if ( ( $posted_values['field'] == 'Checkbox' ) || ( $posted_values['field'] == 'Select (Multiple)' ) ) {
|
1145 |
$options = array_map( 'trim', explode( ',', $posted_values['options'] ) );
|
@@ -1147,16 +1150,16 @@ function wppb_check_field_on_edit_add( $message, $fields, $required_fields, $met
|
|
1147 |
|
1148 |
/* echo "<script>console.log( Posted options: " . print_r($options, true) . "' );</script>";
|
1149 |
echo "<script>console.log( Default options: " . print_r($default_options, true) . "' );</script>"; */
|
1150 |
-
|
1151 |
$not_found = '';
|
1152 |
foreach ( $default_options as $key => $value ){
|
1153 |
if ( !in_array( $value, $options ) )
|
1154 |
$not_found .= $value . ', ';
|
1155 |
}
|
1156 |
-
|
1157 |
if ( $not_found != '' )
|
1158 |
$message .= sprintf( __( "The following option(s) did not coincide with the ones in the options list: %s\n", 'profile-builder' ), trim( $not_found, ', ' ) );
|
1159 |
-
|
1160 |
}elseif ( ( $posted_values['field'] == 'Radio' ) || ( $posted_values['field'] == 'Select' ) ){
|
1161 |
if ( ( trim( $posted_values['default-option'] ) != '' ) && ( !in_array( $posted_values['default-option'], array_map( 'trim', explode( ',', $posted_values['options'] ) ) ) ) )
|
1162 |
$message .= sprintf( __( "The following option did not coincide with the ones in the options list: %s\n", 'profile-builder' ), $posted_values['default-option'] );
|
@@ -1176,10 +1179,10 @@ function wppb_check_field_on_edit_add( $message, $fields, $required_fields, $met
|
|
1176 |
}elseif ( ( $meta_name == 'wppb_rf_fields' ) || ( $meta_name == 'wppb_epf_fields' ) ){
|
1177 |
if ( $posted_values['field'] == '' ){
|
1178 |
$message .= __( "You must select a field\n", 'profile-builder' );
|
1179 |
-
|
1180 |
}else{
|
1181 |
$fields_so_far = get_post_meta ( $post_id, $meta_name, true );
|
1182 |
-
|
1183 |
foreach ( $fields_so_far as $key => $value ){
|
1184 |
if ( $value['id'] == $posted_values['id'] )
|
1185 |
$message .= __( "That field is already added in this form\n", 'profile-builder' );
|
@@ -1431,7 +1434,7 @@ function wppb_redisable_the_add_button(){
|
|
1431 |
*/
|
1432 |
add_action( 'wck_before_update_meta', 'wppb_change_field_meta_key', 10, 4 );
|
1433 |
function wppb_change_field_meta_key( $meta, $id, $values, $element_id ){
|
1434 |
-
if( apply_filters( 'wppb_update_field_meta_key_in_db', false ) ) {
|
1435 |
if ($meta == 'wppb_manage_fields') {
|
1436 |
global $wpdb;
|
1437 |
$wppb_manage_fields = get_option('wppb_manage_fields');
|
22 |
add_action( 'admin_menu', 'wppb_manage_fields_submenu', 1 );
|
23 |
|
24 |
function wppb_populate_manage_fields(){
|
25 |
+
|
26 |
$manage_field_types = array(
|
27 |
'optgroups' => array(
|
28 |
'default' =>
|
101 |
$manage_field_types['optgroups']['advanced']['options'][] = 'Colorpicker';
|
102 |
$manage_field_types['optgroups']['advanced']['options'][] = 'Validation';
|
103 |
$manage_field_types['optgroups']['advanced']['options'][] = 'Map';
|
104 |
+
|
105 |
+
$manage_field_types['optgroups']['other']['options'][] = 'Email';
|
106 |
+
$manage_field_types['optgroups']['other']['options'][] = 'URL';
|
107 |
}
|
108 |
|
109 |
/* added recaptcha and user role field since version 2.6.2 */
|
204 |
array( 'type' => 'select', 'slug' => 'required', 'title' => __( 'Required', 'profile-builder' ), 'options' => array( 'No', 'Yes' ), 'default' => 'No', 'description' => __( 'Whether the field is required or not', 'profile-builder' ) ),
|
205 |
array( 'type' => 'select', 'slug' => 'overwrite-existing', 'title' => __( 'Overwrite Existing', 'profile-builder' ), 'options' => array( 'No', 'Yes' ), 'default' => 'No', 'description' => __( "Selecting 'Yes' will add the field to the list, but will overwrite any other field in the database that has the same meta-name<br/>Use this at your own risk", 'profile-builder' ) ),
|
206 |
) );
|
207 |
+
|
208 |
// create the new submenu with the above options
|
209 |
$args = array(
|
210 |
'metabox_id' => 'manage-fields',
|
250 |
$prepopulated_fields[] = array( 'field' => 'Default - Contact Info (Heading)', 'field-title' => __( 'Contact Info', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '7', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
251 |
$prepopulated_fields[] = array( 'field' => 'Default - E-mail', 'field-title' => __( 'E-mail', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '8', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'Yes' );
|
252 |
$prepopulated_fields[] = array( 'field' => 'Default - Website', 'field-title' => __( 'Website', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '9', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
253 |
+
|
254 |
// Default contact methods were removed in WP 3.6. A filter dictates contact methods.
|
255 |
if ( apply_filters( 'wppb_remove_default_contact_methods', get_site_option( 'initial_db_version' ) < 23588 ) ){
|
256 |
$prepopulated_fields[] = array( 'field' => 'Default - AIM', 'field-title' => __( 'AIM', 'profile-builder' ), 'meta-name' => 'aim', 'overwrite-existing' => 'No', 'id' => '10', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
257 |
$prepopulated_fields[] = array( 'field' => 'Default - Yahoo IM', 'field-title' => __( 'Yahoo IM', 'profile-builder' ), 'meta-name' => 'yim', 'overwrite-existing' => 'No', 'id' => '11', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
258 |
$prepopulated_fields[] = array( 'field' => 'Default - Jabber / Google Talk', 'field-title' => __( 'Jabber / Google Talk', 'profile-builder' ), 'meta-name' => 'jabber', 'overwrite-existing' => 'No', 'id' => '12', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
259 |
}
|
260 |
+
|
261 |
$prepopulated_fields[] = array( 'field' => 'Default - About Yourself (Heading)', 'field-title' => __( 'About Yourself', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '13', 'description' => '', 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'No' );
|
262 |
$prepopulated_fields[] = array( 'field' => 'Default - Biographical Info', 'field-title' => __( 'Biographical Info', 'profile-builder' ), 'meta-name' => 'description', 'overwrite-existing' => 'No', 'id' => '14', 'description' => __( 'Share a little biographical information to fill out your profile. This may be shown publicly.', 'profile-builder' ), 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'required' => 'No' );
|
263 |
$prepopulated_fields[] = array( 'field' => 'Default - Password', 'field-title' => __( 'Password', 'profile-builder' ), 'meta-name' => '', 'overwrite-existing' => 'No', 'id' => '15', 'description' => __( 'Type your password.', 'profile-builder' ), 'row-count' => '5', 'allowed-image-extensions' => '.*', 'allowed-upload-extensions' => '.*', 'avatar-size' => '100', 'date-format' => 'mm/dd/yy', 'terms-of-agreement' => '', 'options' => '', 'labels' => '', 'public-key' => '', 'private-key' => '', 'default-value' => '', 'default-option' => '', 'default-options' => '', 'default-content' => '', 'required' => 'Yes' );
|
278 |
*/
|
279 |
function wppb_get_meta_name( $option = 'wppb_manage_fields', $prefix = 'custom_field_' ){
|
280 |
$id = 1;
|
281 |
+
|
282 |
$wppb_manage_fields = get_option( $option, 'not_found' );
|
283 |
|
284 |
if ( ( $wppb_manage_fields === 'not_found' ) || ( empty( $wppb_manage_fields ) ) ){
|
964 |
|
965 |
|
966 |
function wppb_return_unique_field_list( $only_default_fields = false ){
|
967 |
+
|
968 |
$unique_field_list[] = 'Default - Name (Heading)';
|
969 |
$unique_field_list[] = 'Default - Contact Info (Heading)';
|
970 |
$unique_field_list[] = 'Default - About Yourself (Heading)';
|
981 |
$unique_field_list[] = 'Default - Yahoo IM';
|
982 |
$unique_field_list[] = 'Default - Jabber / Google Talk';
|
983 |
}
|
984 |
+
|
985 |
$unique_field_list[] = 'Default - Password';
|
986 |
$unique_field_list[] = 'Default - Repeat Password';
|
987 |
$unique_field_list[] = 'Default - Biographical Info';
|
1018 |
global $wpdb;
|
1019 |
|
1020 |
if ( $meta_name == 'wppb_manage_fields' ){
|
1021 |
+
|
1022 |
// check for a valid field-type (fallback)
|
1023 |
if ( $posted_values['field'] == '' )
|
1024 |
$message .= __( "You must select a field\n", 'profile-builder' );
|
1025 |
// END check for a valid field-type (fallback)
|
1026 |
+
|
1027 |
$unique_field_list = wppb_return_unique_field_list();
|
1028 |
$all_fields = apply_filters( 'wppb_manage_fields_check_field_on_edit_add', get_option ( $meta_name, 'not_set' ), $posted_values );
|
1029 |
+
|
1030 |
// check if the unique fields are only added once
|
1031 |
if( $all_fields != 'not_set' ){
|
1032 |
foreach( $all_fields as $field ){
|
1043 |
if ( is_numeric( $posted_values['avatar-size'] ) ){
|
1044 |
if ( ( $posted_values['avatar-size'] < 20 ) || ( $posted_values['avatar-size'] > 200 ) )
|
1045 |
$message .= __( "The entered avatar size is not between 20 and 200\n", 'profile-builder' );
|
1046 |
+
|
1047 |
}else
|
1048 |
$message .= __( "The entered avatar size is not numerical\n", 'profile-builder' );
|
1049 |
|
1050 |
}
|
1051 |
// END check for avatar size
|
1052 |
+
|
1053 |
// check for correct row value
|
1054 |
if ( ( $posted_values['field'] == 'Default - Biographical Info' ) || ( $posted_values['field'] == 'Textarea' ) ){
|
1055 |
if ( !is_numeric( $posted_values['row-count'] ) )
|
1056 |
$message .= __( "The entered row number is not numerical\n", 'profile-builder' );
|
1057 |
+
|
1058 |
elseif ( trim( $posted_values['row-count'] ) == '' )
|
1059 |
$message .= __( "You must enter a value for the row number\n", 'profile-builder' );
|
1060 |
}
|
1061 |
// END check for correct row value
|
1062 |
+
|
1063 |
|
1064 |
// check for the public and private keys
|
1065 |
if ( $posted_values['field'] == 'reCAPTCHA'){
|
1069 |
$message .= __( "You must enter the secret key\n", 'profile-builder' );
|
1070 |
}
|
1071 |
// END check for the public and private keys
|
1072 |
+
|
1073 |
// check for the correct the date-format
|
1074 |
if ( $posted_values['field'] == 'Datepicker' ){
|
1075 |
+
$date_format = strtolower( $posted_values['date-format'] );
|
1076 |
if ( trim( $date_format ) != 'mm/dd/yy' && trim( $date_format ) != 'mm/yy/dd' && trim( $date_format ) != 'dd/yy/mm' &&
|
1077 |
trim( $date_format ) != 'dd/mm/yy' && trim( $date_format ) != 'yy/dd/mm' && trim( $date_format ) != 'yy/mm/dd' &&
|
1078 |
trim( $date_format ) != 'yy-mm-dd' && trim( $date_format ) != 'DD, dd-M-y' && trim( $date_format ) != 'D, dd M yy' &&
|
1079 |
trim( $date_format ) != 'D, d M y' && trim( $date_format ) != 'D, d M yy' && trim( $date_format ) != 'mm-dd-yy' && trim( $date_format ) != '@' )
|
1080 |
$message .= __( "The entered value for the Datepicker is not a valid date-format\n", 'profile-builder' );
|
1081 |
+
|
1082 |
elseif ( trim( $date_format ) == '' )
|
1083 |
$message .= __( "You must enter a value for the date-format\n", 'profile-builder' );
|
1084 |
}
|
1085 |
+
// END check for the correct the date-format
|
1086 |
+
|
1087 |
//check for empty meta-name and duplicate meta-name
|
1088 |
if ( $posted_values['overwrite-existing'] == 'No' ){
|
1089 |
$skip_check_for_fields = wppb_return_unique_field_list(true);
|
1090 |
$skip_check_for_fields = apply_filters ( 'wppb_skip_check_for_fields', $skip_check_for_fields );
|
1091 |
+
|
1092 |
if ( !in_array( trim( $posted_values['field'] ), $skip_check_for_fields ) ){
|
1093 |
$unique_meta_name_list = array( 'first_name', 'last_name', 'nickname', 'description' );
|
1094 |
|
1105 |
$unique_meta_name_list[] = 'yim';
|
1106 |
$unique_meta_name_list[] = 'jabber';
|
1107 |
}
|
1108 |
+
|
1109 |
// if the desired meta-name is one of the following, automatically give an error
|
1110 |
if ( in_array( trim( $posted_values['meta-name'] ), apply_filters ( 'wppb_unique_meta_name_list', $unique_meta_name_list ) ) )
|
1111 |
$message .= __( "That meta-name is already in use\n", 'profile-builder' );
|
1112 |
+
|
1113 |
else{
|
1114 |
$found_in_custom_fields = false;
|
1115 |
+
|
1116 |
if( $all_fields != 'not_set' )
|
1117 |
foreach( $all_fields as $field ){
|
1118 |
if ( $posted_values['meta-name'] != '' && ( $field['meta-name'] == $posted_values['meta-name'] ) && ( $field['id'] != $posted_values['id'] ) ){
|
1119 |
$message .= __( "That meta-name is already in use\n", 'profile-builder' );
|
1120 |
$found_in_custom_fields = true;
|
1121 |
+
|
1122 |
}elseif ( ( $field['meta-name'] == $posted_values['meta-name'] ) && ( $field['id'] == $posted_values['id'] ) )
|
1123 |
$found_in_custom_fields = true;
|
1124 |
}
|
1125 |
+
|
1126 |
if ( $found_in_custom_fields === false ){
|
1127 |
if( $posted_values['meta-name'] != '' ) {
|
1128 |
$found_meta_name = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->usermeta WHERE meta_key = %s", $posted_values['meta-name']));
|
1142 |
}
|
1143 |
}
|
1144 |
// END check for correct meta name on upload field
|
1145 |
+
|
1146 |
// check for valid default option (checkbox, select, radio)
|
1147 |
if ( ( $posted_values['field'] == 'Checkbox' ) || ( $posted_values['field'] == 'Select (Multiple)' ) ) {
|
1148 |
$options = array_map( 'trim', explode( ',', $posted_values['options'] ) );
|
1150 |
|
1151 |
/* echo "<script>console.log( Posted options: " . print_r($options, true) . "' );</script>";
|
1152 |
echo "<script>console.log( Default options: " . print_r($default_options, true) . "' );</script>"; */
|
1153 |
+
|
1154 |
$not_found = '';
|
1155 |
foreach ( $default_options as $key => $value ){
|
1156 |
if ( !in_array( $value, $options ) )
|
1157 |
$not_found .= $value . ', ';
|
1158 |
}
|
1159 |
+
|
1160 |
if ( $not_found != '' )
|
1161 |
$message .= sprintf( __( "The following option(s) did not coincide with the ones in the options list: %s\n", 'profile-builder' ), trim( $not_found, ', ' ) );
|
1162 |
+
|
1163 |
}elseif ( ( $posted_values['field'] == 'Radio' ) || ( $posted_values['field'] == 'Select' ) ){
|
1164 |
if ( ( trim( $posted_values['default-option'] ) != '' ) && ( !in_array( $posted_values['default-option'], array_map( 'trim', explode( ',', $posted_values['options'] ) ) ) ) )
|
1165 |
$message .= sprintf( __( "The following option did not coincide with the ones in the options list: %s\n", 'profile-builder' ), $posted_values['default-option'] );
|
1179 |
}elseif ( ( $meta_name == 'wppb_rf_fields' ) || ( $meta_name == 'wppb_epf_fields' ) ){
|
1180 |
if ( $posted_values['field'] == '' ){
|
1181 |
$message .= __( "You must select a field\n", 'profile-builder' );
|
1182 |
+
|
1183 |
}else{
|
1184 |
$fields_so_far = get_post_meta ( $post_id, $meta_name, true );
|
1185 |
+
|
1186 |
foreach ( $fields_so_far as $key => $value ){
|
1187 |
if ( $value['id'] == $posted_values['id'] )
|
1188 |
$message .= __( "That field is already added in this form\n", 'profile-builder' );
|
1434 |
*/
|
1435 |
add_action( 'wck_before_update_meta', 'wppb_change_field_meta_key', 10, 4 );
|
1436 |
function wppb_change_field_meta_key( $meta, $id, $values, $element_id ){
|
1437 |
+
if( apply_filters( 'wppb_update_field_meta_key_in_db', false ) ) {
|
1438 |
if ($meta == 'wppb_manage_fields') {
|
1439 |
global $wpdb;
|
1440 |
$wppb_manage_fields = get_option('wppb_manage_fields');
|
admin/register-version.php
CHANGED
@@ -117,7 +117,7 @@ function wppb_check_serial_number($oldVal, $newVal){
|
|
117 |
}
|
118 |
$user_ID = get_current_user_id();
|
119 |
delete_user_meta( $user_ID, 'wppb_dismiss_notification' );
|
120 |
-
|
121 |
}
|
122 |
|
123 |
add_action( 'update_option_wppb_profile_builder_pro_serial', 'wppb_check_serial_number', 10, 2 );
|
@@ -147,7 +147,7 @@ function wppb_check_serial_number_fix($newvalue, $oldvalue){
|
|
147 |
|
148 |
if ( $newvalue == $oldvalue )
|
149 |
wppb_check_serial_number( $oldvalue, $newvalue );
|
150 |
-
|
151 |
return $newvalue;
|
152 |
}
|
153 |
add_filter( 'pre_update_option_wppb_profile_builder_pro_serial', 'wppb_check_serial_number_fix', 10, 2 );
|
@@ -161,32 +161,32 @@ add_filter( 'pre_update_option_wppb_profile_builder_hobbyist_serial', 'wppb_chec
|
|
161 |
*
|
162 |
* @return void
|
163 |
*/
|
164 |
-
class
|
165 |
public $pluginPrefix = '';
|
166 |
public $pluginName = '';
|
167 |
public $notificaitonMessage = '';
|
168 |
public $pluginSerialStatus = '';
|
169 |
-
|
170 |
function __construct( $pluginPrefix, $pluginName, $notificaitonMessage, $pluginSerialStatus ){
|
171 |
$this->pluginPrefix = $pluginPrefix;
|
172 |
$this->pluginName = $pluginName;
|
173 |
$this->notificaitonMessage = $notificaitonMessage;
|
174 |
$this->pluginSerialStatus = $pluginSerialStatus;
|
175 |
-
|
176 |
add_action( 'admin_notices', array( $this, 'add_admin_notice' ) );
|
177 |
add_action( 'admin_init', array( $this, 'dismiss_notification' ) );
|
178 |
}
|
179 |
-
|
180 |
|
181 |
// Display a notice that can be dismissed in case the serial number is inactive
|
182 |
function add_admin_notice() {
|
183 |
global $current_user ;
|
184 |
global $pagenow;
|
185 |
-
|
186 |
$user_id = $current_user->ID;
|
187 |
-
|
188 |
do_action( $this->pluginPrefix.'_before_notification_displayed', $current_user, $pagenow );
|
189 |
-
|
190 |
if ( current_user_can( 'manage_options' ) ){
|
191 |
|
192 |
$plugin_serial_status = get_option( $this->pluginSerialStatus );
|
@@ -196,26 +196,26 @@ class wppb_add_notices{
|
|
196 |
echo $finalMessage = apply_filters($this->pluginPrefix.'_notification_message','<div class="error wppb-serial-notification" >'.$this->notificaitonMessage.'</div>', $this->notificaitonMessage);
|
197 |
}
|
198 |
}
|
199 |
-
|
200 |
do_action( $this->pluginPrefix.'_notification_displayed', $current_user, $pagenow, $plugin_serial_status );
|
201 |
|
202 |
}
|
203 |
-
|
204 |
do_action( $this->pluginPrefix.'_after_notification_displayed', $current_user, $pagenow );
|
205 |
-
|
206 |
}
|
207 |
|
208 |
function dismiss_notification() {
|
209 |
global $current_user;
|
210 |
-
|
211 |
$user_id = $current_user->ID;
|
212 |
-
|
213 |
do_action( $this->pluginPrefix.'_before_notification_dismissed', $current_user );
|
214 |
-
|
215 |
-
// If user clicks to ignore the notice, add that to their user meta
|
216 |
if ( isset( $_GET[$this->pluginPrefix.'_dismiss_notification']) && '0' == $_GET[$this->pluginPrefix.'_dismiss_notification'] )
|
217 |
-
add_user_meta( $user_id, $this->pluginPrefix.'_dismiss_notification', 'true', true );
|
218 |
-
|
219 |
do_action( $this->pluginPrefix.'_after_notification_dismissed', $current_user );
|
220 |
}
|
221 |
}
|
@@ -240,13 +240,13 @@ if ( $wppb_profile_builder_pro_hobbyist_serial_status == 'notFound' || $wppb_pro
|
|
240 |
else
|
241 |
$register_url = network_admin_url( 'admin.php?page=profile-builder-register' );
|
242 |
|
243 |
-
new
|
244 |
}
|
245 |
elseif ( $wppb_profile_builder_pro_hobbyist_serial_status == 'expired' ){
|
246 |
-
new
|
247 |
}
|
248 |
elseif( strpos( $wppb_profile_builder_pro_hobbyist_serial_status, 'aboutToExpire' ) === 0 ){
|
249 |
$serial_status_parts = explode( '#', $wppb_profile_builder_pro_hobbyist_serial_status );
|
250 |
$date = $serial_status_parts[1];
|
251 |
-
new
|
252 |
-
}
|
117 |
}
|
118 |
$user_ID = get_current_user_id();
|
119 |
delete_user_meta( $user_ID, 'wppb_dismiss_notification' );
|
120 |
+
|
121 |
}
|
122 |
|
123 |
add_action( 'update_option_wppb_profile_builder_pro_serial', 'wppb_check_serial_number', 10, 2 );
|
147 |
|
148 |
if ( $newvalue == $oldvalue )
|
149 |
wppb_check_serial_number( $oldvalue, $newvalue );
|
150 |
+
|
151 |
return $newvalue;
|
152 |
}
|
153 |
add_filter( 'pre_update_option_wppb_profile_builder_pro_serial', 'wppb_check_serial_number_fix', 10, 2 );
|
161 |
*
|
162 |
* @return void
|
163 |
*/
|
164 |
+
class WPPB_add_notices{
|
165 |
public $pluginPrefix = '';
|
166 |
public $pluginName = '';
|
167 |
public $notificaitonMessage = '';
|
168 |
public $pluginSerialStatus = '';
|
169 |
+
|
170 |
function __construct( $pluginPrefix, $pluginName, $notificaitonMessage, $pluginSerialStatus ){
|
171 |
$this->pluginPrefix = $pluginPrefix;
|
172 |
$this->pluginName = $pluginName;
|
173 |
$this->notificaitonMessage = $notificaitonMessage;
|
174 |
$this->pluginSerialStatus = $pluginSerialStatus;
|
175 |
+
|
176 |
add_action( 'admin_notices', array( $this, 'add_admin_notice' ) );
|
177 |
add_action( 'admin_init', array( $this, 'dismiss_notification' ) );
|
178 |
}
|
179 |
+
|
180 |
|
181 |
// Display a notice that can be dismissed in case the serial number is inactive
|
182 |
function add_admin_notice() {
|
183 |
global $current_user ;
|
184 |
global $pagenow;
|
185 |
+
|
186 |
$user_id = $current_user->ID;
|
187 |
+
|
188 |
do_action( $this->pluginPrefix.'_before_notification_displayed', $current_user, $pagenow );
|
189 |
+
|
190 |
if ( current_user_can( 'manage_options' ) ){
|
191 |
|
192 |
$plugin_serial_status = get_option( $this->pluginSerialStatus );
|
196 |
echo $finalMessage = apply_filters($this->pluginPrefix.'_notification_message','<div class="error wppb-serial-notification" >'.$this->notificaitonMessage.'</div>', $this->notificaitonMessage);
|
197 |
}
|
198 |
}
|
199 |
+
|
200 |
do_action( $this->pluginPrefix.'_notification_displayed', $current_user, $pagenow, $plugin_serial_status );
|
201 |
|
202 |
}
|
203 |
+
|
204 |
do_action( $this->pluginPrefix.'_after_notification_displayed', $current_user, $pagenow );
|
205 |
+
|
206 |
}
|
207 |
|
208 |
function dismiss_notification() {
|
209 |
global $current_user;
|
210 |
+
|
211 |
$user_id = $current_user->ID;
|
212 |
+
|
213 |
do_action( $this->pluginPrefix.'_before_notification_dismissed', $current_user );
|
214 |
+
|
215 |
+
// If user clicks to ignore the notice, add that to their user meta
|
216 |
if ( isset( $_GET[$this->pluginPrefix.'_dismiss_notification']) && '0' == $_GET[$this->pluginPrefix.'_dismiss_notification'] )
|
217 |
+
add_user_meta( $user_id, $this->pluginPrefix.'_dismiss_notification', 'true', true );
|
218 |
+
|
219 |
do_action( $this->pluginPrefix.'_after_notification_dismissed', $current_user );
|
220 |
}
|
221 |
}
|
240 |
else
|
241 |
$register_url = network_admin_url( 'admin.php?page=profile-builder-register' );
|
242 |
|
243 |
+
new WPPB_add_notices( 'wppb', 'profile_builder_pro', sprintf( __( '<p>Your <strong>Profile Builder</strong> serial number is invalid or missing. <br/>Please %1$sregister your copy%2$s to receive access to automatic updates and support. Need a license key? %3$sPurchase one now%4$s</p>', 'profile-builder'), "<a href='". $register_url ."'>", "</a>", "<a href='https://www.cozmoslabs.com/wordpress-profile-builder/?utm_source=PB&utm_medium=dashboard&utm_campaign=PB-SN-Purchase' target='_blank' class='button-primary'>", "</a>" ), 'wppb_profile_builder_pro_serial_status' );
|
244 |
}
|
245 |
elseif ( $wppb_profile_builder_pro_hobbyist_serial_status == 'expired' ){
|
246 |
+
new WPPB_add_notices( 'wppb_expired', 'profile_builder_pro', sprintf( __( '<p>Your <strong>Profile Builder</strong> license has expired. <br/>Please %1$sRenew Your Licence%2$s to continue receiving access to product downloads, automatic updates and support. %3$sRenew now and get 40% off %4$s %5$sDismiss%6$s</p>', 'profile-builder'), "<a href='https://www.cozmoslabs.com/downloads/profile-builder-". $version ."-v2-yearly-renewal/?utm_source=PB&utm_medium=dashboard&utm_campaign=PB-Renewal' target='_blank'>", "</a>", "<a href='https://www.cozmoslabs.com/downloads/profile-builder-".$version."-v2-yearly-renewal/?utm_source=PB&utm_medium=dashboard&utm_campaign=PB-Renewal' target='_blank' class='button-primary'>", "</a>", "<a href='". esc_url( add_query_arg( 'wppb_expired_dismiss_notification', '0' ) ) ."' class='wppb-dismiss-notification'>", "</a>" ), 'wppb_profile_builder_pro_serial_status' );
|
247 |
}
|
248 |
elseif( strpos( $wppb_profile_builder_pro_hobbyist_serial_status, 'aboutToExpire' ) === 0 ){
|
249 |
$serial_status_parts = explode( '#', $wppb_profile_builder_pro_hobbyist_serial_status );
|
250 |
$date = $serial_status_parts[1];
|
251 |
+
new WPPB_add_notices( 'wppb_about_to_expire', 'profile_builder_pro', sprintf( __( '<p>Your <strong>Profile Builder</strong> license is about to expire on %5$s. <br/>Please %1$sRenew Your Licence%2$s to continue receiving access to product downloads, automatic updates and support. %3$sRenew now and get 40% off %4$s %6$sDismiss%7$s</p>', 'profile-builder'), "<a href='https://www.cozmoslabs.com/downloads/profile-builder-". $version ."-v2-yearly-renewal/?utm_source=PB&utm_medium=dashboard&utm_campaign=PB-Renewal' target='_blank'>", "</a>", "<a href='https://www.cozmoslabs.com/downloads/profile-builder-".$version."-v2-yearly-renewal/?utm_source=PB&utm_medium=dashboard&utm_campaign=PB-Renewal' target='_blank' class='button-primary'>", "</a>", $date, "<a href='". esc_url( add_query_arg( 'wppb_about_to_expire_dismiss_notification', '0' ) )."' class='wppb-dismiss-notification'>", "</a>" ), 'wppb_profile_builder_pro_serial_status' );
|
252 |
+
}
|
assets/css/style-front-end.css
CHANGED
@@ -236,6 +236,10 @@ input#send_credentials_via_email{
|
|
236 |
clear:none;
|
237 |
}
|
238 |
|
|
|
|
|
|
|
|
|
239 |
.wppb-form-field.wppb-timepicker > span.wppb-timepicker-separator {
|
240 |
display: inline-block;
|
241 |
float: left;
|
@@ -372,13 +376,20 @@ label[for=blog-privacy]{
|
|
372 |
#wppb_general_top_error_message,
|
373 |
.wppb-error,
|
374 |
.wppb-warning{
|
375 |
-
color:#222222;
|
376 |
}
|
377 |
|
378 |
#wppb_general_top_error_message a,
|
379 |
.wppb-error a,
|
380 |
.wppb-warning a{
|
381 |
-
color:#007acc;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
382 |
}
|
383 |
|
384 |
.wppb-required{
|
236 |
clear:none;
|
237 |
}
|
238 |
|
239 |
+
.wppb-repeater .wppb-select-cpt span.select2-container{
|
240 |
+
width:auto !important;
|
241 |
+
}
|
242 |
+
|
243 |
.wppb-form-field.wppb-timepicker > span.wppb-timepicker-separator {
|
244 |
display: inline-block;
|
245 |
float: left;
|
376 |
#wppb_general_top_error_message,
|
377 |
.wppb-error,
|
378 |
.wppb-warning{
|
379 |
+
color:#222222 !important;
|
380 |
}
|
381 |
|
382 |
#wppb_general_top_error_message a,
|
383 |
.wppb-error a,
|
384 |
.wppb-warning a{
|
385 |
+
color:#007acc !important;
|
386 |
+
}
|
387 |
+
|
388 |
+
#wppb_general_top_error_message a:hover,
|
389 |
+
.wppb-error a:hover,
|
390 |
+
.wppb-warning a:hover{
|
391 |
+
color:#007acc !important;
|
392 |
+
text-decoration: underline;
|
393 |
}
|
394 |
|
395 |
.wppb-required{
|
assets/js/jquery-manage-fields-live-change.js
CHANGED
@@ -139,7 +139,7 @@ var fields = {
|
|
139 |
'meta_name_value' : 'jabber'
|
140 |
}
|
141 |
},
|
142 |
-
|
143 |
'Default - Password': { 'show_rows' : [
|
144 |
'.row-field-title',
|
145 |
'.row-description',
|
@@ -236,6 +236,26 @@ var fields = {
|
|
236 |
]
|
237 |
},
|
238 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
239 |
'Number': { 'show_rows' : [
|
240 |
'.row-field-title',
|
241 |
'.row-meta-name',
|
@@ -295,7 +315,7 @@ var fields = {
|
|
295 |
'.row-options',
|
296 |
'.row-labels'
|
297 |
]
|
298 |
-
},
|
299 |
'Select (Multiple)': { 'show_rows' : [
|
300 |
'.row-field-title',
|
301 |
'.row-meta-name',
|
@@ -306,8 +326,8 @@ var fields = {
|
|
306 |
'.row-options',
|
307 |
'.row-labels'
|
308 |
]
|
309 |
-
},
|
310 |
-
|
311 |
'Select (Country)': { 'show_rows' : [
|
312 |
'.row-field-title',
|
313 |
'.row-meta-name',
|
@@ -558,8 +578,8 @@ function wppb_disable_add_entry_button( container_name ){
|
|
558 |
jQuery( container_name + ' ' + '.mb-list-entry-fields .button-primary' ).each( function(){
|
559 |
|
560 |
//jQuery(this).data('myclick', this.onclick );
|
561 |
-
this.onclick = function(event) {
|
562 |
-
if ( jQuery(this).attr( 'disabled' ) ) {
|
563 |
return false;
|
564 |
}
|
565 |
/* changed this in version 2.5.0 because the commented line generated stack exceeded error when multiple fields were opened with edit */
|
@@ -574,7 +594,7 @@ function wppb_disable_add_entry_button( container_name ){
|
|
574 |
//jQuery(this).data('myclick').call(this, event || window.event);
|
575 |
};
|
576 |
});
|
577 |
-
|
578 |
}
|
579 |
|
580 |
|
@@ -626,7 +646,7 @@ function wppb_display_needed_fields( index, container_name, current_field_select
|
|
626 |
jQuery( container_name + ' ' + '#description' ).val( properties['description'] );
|
627 |
}
|
628 |
}
|
629 |
-
|
630 |
}else{
|
631 |
/* meta value when editing a field shouldn't change so we take it from the current entered value which is displayed above the edit form */
|
632 |
if( jQuery( current_field_select).parents('.update_container_wppb_manage_fields').length != 0 ){
|
@@ -671,17 +691,17 @@ function wppb_display_needed_fields( index, container_name, current_field_select
|
|
671 |
|
672 |
//Handle user role sorting
|
673 |
wppb_handle_user_role_field( container_name );
|
674 |
-
|
675 |
var set_required = fields[jQuery.trim(index)]['required'];
|
676 |
if ( ( typeof set_required !== 'undefined' ) && ( set_required ) ){
|
677 |
jQuery( container_name + ' ' + '#required' ).val( 'Yes' );
|
678 |
jQuery( container_name + ' ' + '#required' ).attr( 'disabled', true );
|
679 |
-
|
680 |
}else{
|
681 |
jQuery( container_name + ' ' + '#required' ).val( 'No' );
|
682 |
jQuery( container_name + ' ' + '#required' ).attr( 'disabled', false );
|
683 |
}
|
684 |
-
|
685 |
jQuery( container_name + ' ' + '.mb-list-entry-fields .button-primary' ).removeAttr( 'disabled' );
|
686 |
}
|
687 |
|
139 |
'meta_name_value' : 'jabber'
|
140 |
}
|
141 |
},
|
142 |
+
|
143 |
'Default - Password': { 'show_rows' : [
|
144 |
'.row-field-title',
|
145 |
'.row-description',
|
236 |
]
|
237 |
},
|
238 |
|
239 |
+
'Email': { 'show_rows' : [
|
240 |
+
'.row-field-title',
|
241 |
+
'.row-meta-name',
|
242 |
+
'.row-description',
|
243 |
+
'.row-default-value',
|
244 |
+
'.row-required',
|
245 |
+
'.row-overwrite-existing'
|
246 |
+
]
|
247 |
+
},
|
248 |
+
|
249 |
+
'URL': { 'show_rows' : [
|
250 |
+
'.row-field-title',
|
251 |
+
'.row-meta-name',
|
252 |
+
'.row-description',
|
253 |
+
'.row-default-value',
|
254 |
+
'.row-required',
|
255 |
+
'.row-overwrite-existing'
|
256 |
+
]
|
257 |
+
},
|
258 |
+
|
259 |
'Number': { 'show_rows' : [
|
260 |
'.row-field-title',
|
261 |
'.row-meta-name',
|
315 |
'.row-options',
|
316 |
'.row-labels'
|
317 |
]
|
318 |
+
},
|
319 |
'Select (Multiple)': { 'show_rows' : [
|
320 |
'.row-field-title',
|
321 |
'.row-meta-name',
|
326 |
'.row-options',
|
327 |
'.row-labels'
|
328 |
]
|
329 |
+
},
|
330 |
+
|
331 |
'Select (Country)': { 'show_rows' : [
|
332 |
'.row-field-title',
|
333 |
'.row-meta-name',
|
578 |
jQuery( container_name + ' ' + '.mb-list-entry-fields .button-primary' ).each( function(){
|
579 |
|
580 |
//jQuery(this).data('myclick', this.onclick );
|
581 |
+
this.onclick = function(event) {
|
582 |
+
if ( jQuery(this).attr( 'disabled' ) ) {
|
583 |
return false;
|
584 |
}
|
585 |
/* changed this in version 2.5.0 because the commented line generated stack exceeded error when multiple fields were opened with edit */
|
594 |
//jQuery(this).data('myclick').call(this, event || window.event);
|
595 |
};
|
596 |
});
|
597 |
+
|
598 |
}
|
599 |
|
600 |
|
646 |
jQuery( container_name + ' ' + '#description' ).val( properties['description'] );
|
647 |
}
|
648 |
}
|
649 |
+
|
650 |
}else{
|
651 |
/* meta value when editing a field shouldn't change so we take it from the current entered value which is displayed above the edit form */
|
652 |
if( jQuery( current_field_select).parents('.update_container_wppb_manage_fields').length != 0 ){
|
691 |
|
692 |
//Handle user role sorting
|
693 |
wppb_handle_user_role_field( container_name );
|
694 |
+
|
695 |
var set_required = fields[jQuery.trim(index)]['required'];
|
696 |
if ( ( typeof set_required !== 'undefined' ) && ( set_required ) ){
|
697 |
jQuery( container_name + ' ' + '#required' ).val( 'Yes' );
|
698 |
jQuery( container_name + ' ' + '#required' ).attr( 'disabled', true );
|
699 |
+
|
700 |
}else{
|
701 |
jQuery( container_name + ' ' + '#required' ).val( 'No' );
|
702 |
jQuery( container_name + ' ' + '#required' ).attr( 'disabled', false );
|
703 |
}
|
704 |
+
|
705 |
jQuery( container_name + ' ' + '.mb-list-entry-fields .button-primary' ).removeAttr( 'disabled' );
|
706 |
}
|
707 |
|
features/email-confirmation/email-confirmation.php
CHANGED
@@ -581,10 +581,11 @@ function wppb_notify_user_registration_email( $bloginfo, $user_name, $email, $se
|
|
581 |
}
|
582 |
|
583 |
$send_password = apply_filters( 'wppb_send_password_in_default_email_message', false );
|
|
|
584 |
if( !$send_password )
|
585 |
-
$user_message_content = sprintf( __( 'Welcome to %1$s!<br/><br/><br/>Your username is:%2$s', 'profile-builder' ), $user_message_from, $user_name );
|
586 |
else
|
587 |
-
$user_message_content = sprintf( __( 'Welcome to %1$s!<br/><br/><br/>Your username is:%2$s and password
|
588 |
|
589 |
if ( $password === __( 'Your selected password at signup', 'profile-builder' ) ) {
|
590 |
$password = NULL;
|
581 |
}
|
582 |
|
583 |
$send_password = apply_filters( 'wppb_send_password_in_default_email_message', false );
|
584 |
+
$site_url = '<a href="'. home_url() .'"> ' . home_url() . ' </a>';
|
585 |
if( !$send_password )
|
586 |
+
$user_message_content = sprintf( __( 'Welcome to %1$s!<br/><br/><br/>Your username is:%2$s and the password you selected on registration.<br/><br/>Access your account: %3$s ', 'profile-builder' ), $user_message_from, $user_name, $site_url );
|
587 |
else
|
588 |
+
$user_message_content = sprintf( __( 'Welcome to %1$s!<br/><br/><br/>Your username is:%2$s and the password: %3$s.<br/><br/>Access your account: %4$s ', 'profile-builder' ), $user_message_from, $user_name, $password, $site_url );
|
589 |
|
590 |
if ( $password === __( 'Your selected password at signup', 'profile-builder' ) ) {
|
591 |
$password = NULL;
|
features/functions.php
CHANGED
@@ -547,7 +547,7 @@ add_action('admin_print_styles-users_page_ProfileBuilderOptionsAndSettings', 'wp
|
|
547 |
function wppb_user_meta_exists( $id, $meta_name ){
|
548 |
global $wpdb;
|
549 |
|
550 |
-
return $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $id, $meta_name ) );
|
551 |
}
|
552 |
|
553 |
|
@@ -1092,7 +1092,7 @@ function wppb_get_role_name($role){
|
|
1092 |
* Functionality for Private Website start
|
1093 |
*/
|
1094 |
add_action( 'template_redirect', 'wppb_private_website_functionality' );
|
1095 |
-
add_action( '
|
1096 |
function wppb_private_website_functionality(){
|
1097 |
$wppb_private_website_settings = get_option( 'wppb_private_website_settings', 'not_found' );
|
1098 |
if( $wppb_private_website_settings != 'not_found' ){
|
547 |
function wppb_user_meta_exists( $id, $meta_name ){
|
548 |
global $wpdb;
|
549 |
|
550 |
+
return apply_filters( 'wppb_user_meta_exists_meta_name', $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $id, $meta_name ) ), $id, $meta_name );
|
551 |
}
|
552 |
|
553 |
|
1092 |
* Functionality for Private Website start
|
1093 |
*/
|
1094 |
add_action( 'template_redirect', 'wppb_private_website_functionality' );
|
1095 |
+
add_action( 'login_init', 'wppb_private_website_functionality', 1 );
|
1096 |
function wppb_private_website_functionality(){
|
1097 |
$wppb_private_website_settings = get_option( 'wppb_private_website_settings', 'not_found' );
|
1098 |
if( $wppb_private_website_settings != 'not_found' ){
|
front-end/edit-profile.php
CHANGED
@@ -21,10 +21,18 @@ function wppb_autologin_after_password_changed(){
|
|
21 |
$form_fields = apply_filters( 'wppb_change_form_fields', get_option( 'wppb_manage_fields' ), array( 'form_type'=> 'edit_profile', 'form_fields' => array(), 'form_name' => sanitize_text_field( $_POST['form_name'] ), 'role' => '', 'ID' => Profile_Builder_Form_Creator::wppb_get_form_id_from_form_name( sanitize_text_field( $_POST['form_name'] ), 'edit_profile' ), 'context' => 'edit_profile_auto_login_after_password_change' ) );
|
22 |
if( !empty( $form_fields ) ){
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
/* check for errors in the form through the filters */
|
25 |
$output_field_errors = array();
|
26 |
foreach( $form_fields as $field ){
|
27 |
-
|
|
|
28 |
if( !empty( $error_for_field ) )
|
29 |
$output_field_errors[$field['id']] = '<span class="wppb-form-error">' . $error_for_field . '</span>';
|
30 |
}
|
21 |
$form_fields = apply_filters( 'wppb_change_form_fields', get_option( 'wppb_manage_fields' ), array( 'form_type'=> 'edit_profile', 'form_fields' => array(), 'form_name' => sanitize_text_field( $_POST['form_name'] ), 'role' => '', 'ID' => Profile_Builder_Form_Creator::wppb_get_form_id_from_form_name( sanitize_text_field( $_POST['form_name'] ), 'edit_profile' ), 'context' => 'edit_profile_auto_login_after_password_change' ) );
|
22 |
if( !empty( $form_fields ) ){
|
23 |
|
24 |
+
$edited_user_id = get_current_user_id();
|
25 |
+
if( ( !is_multisite() && current_user_can( 'edit_users' ) ) || ( is_multisite() && current_user_can( 'manage_network' ) ) ) {
|
26 |
+
if( isset( $_GET['edit_user'] ) && ! empty( $_GET['edit_user'] ) ){
|
27 |
+
$edited_user_id = absint( $_GET['edit_user'] );
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
/* check for errors in the form through the filters */
|
32 |
$output_field_errors = array();
|
33 |
foreach( $form_fields as $field ){
|
34 |
+
//this is not perfect because we don't know the role attribute for the form here so we send it as '' in the filter, but as of v 2.9.0 it is not needed anywhere so we're good
|
35 |
+
$error_for_field = apply_filters( 'wppb_check_form_field_'.Wordpress_Creation_Kit_PB::wck_generate_slug( $field['field'] ), '', $field, $_POST, 'edit_profile', '', $edited_user_id );
|
36 |
if( !empty( $error_for_field ) )
|
37 |
$output_field_errors[$field['id']] = '<span class="wppb-form-error">' . $error_for_field . '</span>';
|
38 |
}
|
front-end/login.php
CHANGED
@@ -293,35 +293,36 @@ function wppb_login_redirect( $redirect_to, $requested_redirect_to, $user ){
|
|
293 |
$wppb_generalSettings = get_option('wppb_general_settings');
|
294 |
|
295 |
if (isset($wppb_generalSettings['loginWith'])) {
|
296 |
-
$LostPassURL = site_url('/wp-login.php?action=lostpassword');
|
297 |
|
|
|
298 |
// if the Login shortcode has a lostpassword argument set, give the lost password error link that value
|
299 |
if (!empty($_POST['wppb_lostpassword_url'])) {
|
300 |
-
|
301 |
-
|
|
|
302 |
}
|
303 |
-
|
304 |
//apply filter to allow changing Lost your Password link
|
305 |
$LostPassURL = apply_filters('wppb_pre_login_url_filter', $LostPassURL);
|
306 |
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
|
311 |
-
|
312 |
-
$error_string
|
313 |
}
|
|
|
314 |
if ($user->get_error_code() == 'invalid_username') {
|
315 |
-
|
316 |
-
|
|
|
|
|
|
|
|
|
317 |
}
|
318 |
-
// if login with email is enabled change the word username with email
|
319 |
-
if ($wppb_generalSettings['loginWith'] == 'email')
|
320 |
-
$error_string = str_replace( __('username','profile-builder'), __('email','profile-builder'), $error_string);
|
321 |
|
322 |
-
|
323 |
-
|
324 |
-
$error_string = str_replace( __('username','profile-builder'), __('username or email','profile-builder'), $error_string);
|
325 |
|
326 |
}
|
327 |
// if the error string is empty it means that none of the fields were completed
|
293 |
$wppb_generalSettings = get_option('wppb_general_settings');
|
294 |
|
295 |
if (isset($wppb_generalSettings['loginWith'])) {
|
|
|
296 |
|
297 |
+
$LostPassURL = site_url('/wp-login.php?action=lostpassword');
|
298 |
// if the Login shortcode has a lostpassword argument set, give the lost password error link that value
|
299 |
if (!empty($_POST['wppb_lostpassword_url'])) {
|
300 |
+
$LostPassURL = $_POST['wppb_lostpassword_url'];
|
301 |
+
if ( wppb_check_missing_http( $_POST['wppb_lostpassword_url'] ) )
|
302 |
+
$LostPassURL = "http://" . $_POST['wppb_lostpassword_url'];
|
303 |
}
|
|
|
304 |
//apply filter to allow changing Lost your Password link
|
305 |
$LostPassURL = apply_filters('wppb_pre_login_url_filter', $LostPassURL);
|
306 |
|
307 |
+
/* start building the error string */
|
308 |
+
if( $user->get_error_code() == 'incorrect_password' || $user->get_error_code() == 'invalid_username' )
|
309 |
+
$error_string = '<strong>' . __('ERROR', 'profile-builder') . '</strong>: ';
|
310 |
|
311 |
+
if ($user->get_error_code() == 'incorrect_password') {
|
312 |
+
$error_string .= __('The password you entered is incorrect.', 'profile-builder') . ' ';
|
313 |
}
|
314 |
+
|
315 |
if ($user->get_error_code() == 'invalid_username') {
|
316 |
+
if ($wppb_generalSettings['loginWith'] == 'email')// if login with email is enabled change the word username with email
|
317 |
+
$error_string .= __('Invalid email.', 'profile-builder') . ' ';
|
318 |
+
else if( $wppb_generalSettings['loginWith'] == 'usernameemail' )// if login with username and email is enabled change the word username with username or email
|
319 |
+
$error_string .= __('Invalid username or email.', 'profile-builder') . ' ';
|
320 |
+
else
|
321 |
+
$error_string .= __('Invalid username.', 'profile-builder') . ' ';
|
322 |
}
|
|
|
|
|
|
|
323 |
|
324 |
+
if( $user->get_error_code() == 'incorrect_password' || $user->get_error_code() == 'invalid_username' )
|
325 |
+
$error_string .= '<a href="' . esc_url( $LostPassURL ) . '" title="' . __('Password Lost and Found.', 'profile-builder') . '">' . __('Lost your password', 'profile-builder') . '</a>?';
|
|
|
326 |
|
327 |
}
|
328 |
// if the error string is empty it means that none of the fields were completed
|
index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Profile Builder
|
4 |
Plugin URI: https://www.cozmoslabs.com/wordpress-profile-builder/
|
5 |
Description: Login, registration and edit profile shortcodes for the front-end. Also you can choose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard.
|
6 |
-
Version: 2.9.
|
7 |
Author: Cozmoslabs
|
8 |
Author URI: https://www.cozmoslabs.com/
|
9 |
Text Domain: profile-builder
|
@@ -75,7 +75,7 @@ function wppb_free_plugin_init() {
|
|
75 |
*
|
76 |
*
|
77 |
*/
|
78 |
-
define('PROFILE_BUILDER_VERSION', '2.9.
|
79 |
define('WPPB_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
80 |
define('WPPB_PLUGIN_URL', plugin_dir_url(__FILE__));
|
81 |
define('WPPB_PLUGIN_BASENAME', plugin_basename(__FILE__));
|
3 |
Plugin Name: Profile Builder
|
4 |
Plugin URI: https://www.cozmoslabs.com/wordpress-profile-builder/
|
5 |
Description: Login, registration and edit profile shortcodes for the front-end. Also you can choose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard.
|
6 |
+
Version: 2.9.1
|
7 |
Author: Cozmoslabs
|
8 |
Author URI: https://www.cozmoslabs.com/
|
9 |
Text Domain: profile-builder
|
75 |
*
|
76 |
*
|
77 |
*/
|
78 |
+
define('PROFILE_BUILDER_VERSION', '2.9.1' );
|
79 |
define('WPPB_PLUGIN_DIR', plugin_dir_path(__FILE__));
|
80 |
define('WPPB_PLUGIN_URL', plugin_dir_url(__FILE__));
|
81 |
define('WPPB_PLUGIN_BASENAME', plugin_basename(__FILE__));
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.cozmoslabs.com/wordpress-profile-builder/
|
|
4 |
Tags: user registration, user profile, user registration form, user fields, extra user fields, edit profile, user custom fields, front-end login, front-end edit profile, front-end user registration, email confirmation, login form, content restriction, restrict content
|
5 |
Requires at least: 3.1
|
6 |
Tested up to: 4.9.8
|
7 |
-
Stable tag: 2.9.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -167,6 +167,12 @@ This plugin adds/removes user fields in the front-end. Both default and extra pr
|
|
167 |
12. Role Editor
|
168 |
|
169 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
= 2.9.0 =
|
171 |
* Fixed an issue with Private page settings not saving "Redirect to page" if "Allowed pages" was empty
|
172 |
* Fixed some html validation issues in our forms
|
4 |
Tags: user registration, user profile, user registration form, user fields, extra user fields, edit profile, user custom fields, front-end login, front-end edit profile, front-end user registration, email confirmation, login form, content restriction, restrict content
|
5 |
Requires at least: 3.1
|
6 |
Tested up to: 4.9.8
|
7 |
+
Stable tag: 2.9.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
167 |
12. Role Editor
|
168 |
|
169 |
== Changelog ==
|
170 |
+
= 2.9.1 =
|
171 |
+
* Rewrote login errors so they can be translated easily
|
172 |
+
* Extended the send credentials email so there is a bit more info like the link to the website
|
173 |
+
* Add plugin notification about the Toolbox add-on.
|
174 |
+
* Fixed issue with update password and field visibility addon.
|
175 |
+
|
176 |
= 2.9.0 =
|
177 |
* Fixed an issue with Private page settings not saving "Redirect to page" if "Allowed pages" was empty
|
178 |
* Fixed some html validation issues in our forms
|