User Registration – Custom Registration Form, Login Form And User Profile For WordPress - Version 1.5.6

Version Description

  • 11/01/2018 =
  • Fix - Authenticated XSS. Thanks wpvulndb.com for nofifying.
  • Fix - Smart tag bug on resend confirmation email
Download this release

Release Info

Developer wpeverest
Plugin Icon 128x128 User Registration – Custom Registration Form, Login Form And User Profile For WordPress
Version 1.5.6
Comparing to
See all releases

Code changes from version 1.5.5 to 1.5.6

Files changed (145) hide show
  1. includes/abstracts/abstract-ur-field-settings.php +12 -12
  2. includes/abstracts/abstract-ur-form-field.php +45 -41
  3. includes/abstracts/abstract-ur-session.php +2 -2
  4. includes/admin/class-ur-admin-addons.php +3 -3
  5. includes/admin/class-ur-admin-assets.php +86 -63
  6. includes/admin/class-ur-admin-export-users.php +107 -94
  7. includes/admin/class-ur-admin-form-modal.php +14 -14
  8. includes/admin/class-ur-admin-menus.php +95 -56
  9. includes/admin/class-ur-admin-notices.php +8 -8
  10. includes/admin/class-ur-admin-profile.php +103 -85
  11. includes/admin/class-ur-admin-registrations-table-list.php +58 -36
  12. includes/admin/class-ur-admin-settings.php +93 -76
  13. includes/admin/class-ur-admin-status.php +6 -4
  14. includes/admin/class-ur-admin-user-list-manager.php +143 -135
  15. includes/admin/class-ur-admin-user-manager.php +19 -19
  16. includes/admin/class-ur-admin.php +18 -16
  17. includes/admin/class-ur-config.php +1 -1
  18. includes/admin/functions-ur-admin.php +76 -67
  19. includes/admin/settings/class-ur-settings-email.php +60 -51
  20. includes/admin/settings/class-ur-settings-general.php +35 -30
  21. includes/admin/settings/class-ur-settings-integration.php +12 -11
  22. includes/admin/settings/class-ur-settings-page.php +1 -1
  23. includes/admin/settings/emails/class-ur-settings-admin-email.php +83 -75
  24. includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php +75 -67
  25. includes/admin/settings/emails/class-ur-settings-email-confirmation.php +72 -64
  26. includes/admin/settings/emails/class-ur-settings-registration-approved-email.php +75 -67
  27. includes/admin/settings/emails/class-ur-settings-registration-denied-email.php +34 -26
  28. includes/admin/settings/emails/class-ur-settings-registration-pending-email.php +82 -74
  29. includes/admin/settings/emails/class-ur-settings-reset-password-email.php +75 -67
  30. includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php +75 -67
  31. includes/admin/updater/class-ur-addon-updater.php +69 -45
  32. includes/admin/updater/class-ur-plugin-updater-api.php +15 -4
  33. includes/admin/updater/class-ur-plugin-updates.php +3 -1
  34. includes/admin/views/html-admin-page-addons.php +1 -1
  35. includes/admin/views/html-admin-page-export-users.php +20 -20
  36. includes/admin/views/html-admin-page-forms.php +28 -25
  37. includes/admin/views/html-admin-page-status-logs.php +5 -5
  38. includes/admin/views/html-admin-page-status.php +1 -1
  39. includes/admin/views/html-admin-settings.php +2 -2
  40. includes/admin/views/html-license-form.php +2 -2
  41. includes/admin/views/html-notice-custom.php +1 -1
  42. includes/admin/views/html-notice-deactivation.php +3 -3
  43. includes/admin/views/html-notice-error.php +1 -1
  44. includes/admin/views/html-notice-install.php +1 -1
  45. includes/admin/views/html-notice-key-activated.php +1 -1
  46. includes/admin/views/html-notice-key-deactivated.php +1 -1
  47. includes/admin/views/html-notice-key-unvalidated.php +2 -2
  48. includes/admin/views/html-notice-registration.php +2 -2
  49. includes/admin/views/html-notice-update.php +1 -1
  50. includes/admin/views/html-notice-updated.php +1 -1
  51. includes/admin/views/html-notice-updating.php +1 -1
  52. includes/class-ur-ajax.php +92 -69
  53. includes/class-ur-autoloader.php +3 -4
  54. includes/class-ur-background-updater.php +3 -3
  55. includes/class-ur-email-confirmation.php +105 -83
  56. includes/class-ur-emailer.php +118 -92
  57. includes/class-ur-form-block.php +48 -32
  58. includes/class-ur-form-handler.php +38 -35
  59. includes/class-ur-frontend-scripts.php +50 -47
  60. includes/class-ur-install.php +19 -16
  61. includes/class-ur-log-levels.php +7 -7
  62. includes/class-ur-logger.php +9 -1
  63. includes/class-ur-plugin-updater.php +36 -25
  64. includes/class-ur-post-types.php +4 -2
  65. includes/class-ur-query.php +9 -9
  66. includes/class-ur-session-handler.php +6 -4
  67. includes/class-ur-shortcodes.php +55 -33
  68. includes/class-ur-user-approval.php +23 -19
  69. includes/form/class-ur-form-field-checkbox.php +14 -11
  70. includes/form/class-ur-form-field-country.php +269 -263
  71. includes/form/class-ur-form-field-date.php +22 -15
  72. includes/form/class-ur-form-field-description.php +15 -12
  73. includes/form/class-ur-form-field-display-name.php +16 -13
  74. includes/form/class-ur-form-field-email.php +22 -16
  75. includes/form/class-ur-form-field-first-name.php +15 -12
  76. includes/form/class-ur-form-field-last-name.php +15 -12
  77. includes/form/class-ur-form-field-nickname.php +16 -13
  78. includes/form/class-ur-form-field-number.php +21 -15
  79. includes/form/class-ur-form-field-password.php +16 -13
  80. includes/form/class-ur-form-field-privacy-policy.php +14 -11
  81. includes/form/class-ur-form-field-radio.php +15 -12
  82. includes/form/class-ur-form-field-select.php +15 -12
  83. includes/form/class-ur-form-field-text.php +13 -10
  84. includes/form/class-ur-form-field-textarea.php +16 -13
  85. includes/form/class-ur-form-field-user-confirm-password.php +7 -7
  86. includes/form/class-ur-form-field-user-email.php +19 -13
  87. includes/form/class-ur-form-field-user-login.php +18 -12
  88. includes/form/class-ur-form-field-user-pass.php +11 -8
  89. includes/form/class-ur-form-field-user-url.php +17 -14
  90. includes/form/settings/class-ur-setting-checkbox.php +17 -16
  91. includes/form/settings/class-ur-setting-country.php +10 -9
  92. includes/form/settings/class-ur-setting-email.php +10 -9
  93. includes/form/settings/class-ur-setting-password.php +10 -9
  94. includes/form/settings/class-ur-setting-radio.php +18 -17
  95. includes/form/settings/class-ur-setting-select.php +18 -17
  96. includes/form/settings/class-ur-setting-text.php +26 -25
  97. includes/form/settings/class-ur-setting-textarea.php +17 -16
  98. includes/form/views/admin/admin-checkbox.php +6 -6
  99. includes/form/views/admin/admin-country.php +5 -5
  100. includes/form/views/admin/admin-date.php +2 -2
  101. includes/form/views/admin/admin-description.php +2 -2
  102. includes/form/views/admin/admin-display-name.php +3 -3
  103. includes/form/views/admin/admin-email.php +4 -3
  104. includes/form/views/admin/admin-first-name.php +3 -3
  105. includes/form/views/admin/admin-last-name.php +3 -3
  106. includes/form/views/admin/admin-nickname.php +3 -3
  107. includes/form/views/admin/admin-number.php +4 -4
  108. includes/form/views/admin/admin-password.php +2 -2
  109. includes/form/views/admin/admin-privacy-policy.php +3 -3
  110. includes/form/views/admin/admin-radio.php +8 -8
  111. includes/form/views/admin/admin-select.php +5 -5
  112. includes/form/views/admin/admin-text.php +4 -4
  113. includes/form/views/admin/admin-textarea.php +2 -2
  114. includes/form/views/admin/admin-user-confirm-password.php +3 -3
  115. includes/form/views/admin/admin-user-email.php +3 -3
  116. includes/form/views/admin/admin-user-login.php +3 -3
  117. includes/form/views/admin/admin-user-pass.php +3 -3
  118. includes/form/views/admin/admin-user-url.php +3 -3
  119. includes/frontend/class-ur-frontend-form-handler.php +74 -56
  120. includes/frontend/class-ur-frontend.php +8 -7
  121. includes/functions-ur-account.php +18 -18
  122. includes/functions-ur-core.php +225 -173
  123. includes/functions-ur-deprecated.php +1 -1
  124. includes/functions-ur-notice.php +12 -7
  125. includes/functions-ur-page.php +1 -1
  126. includes/functions-ur-template.php +81 -73
  127. includes/functions-ur-update.php +41 -42
  128. includes/libraries/wp-background-process.php +14 -4
  129. includes/shortcodes/class-ur-shortcode-login.php +11 -5
  130. includes/shortcodes/class-ur-shortcode-my-account.php +66 -45
  131. languages/user-registration.pot +731 -729
  132. package-lock.json +1 -1
  133. readme.txt +5 -2
  134. templates/form-registration.php +40 -40
  135. templates/myaccount/dashboard.php +10 -5
  136. templates/myaccount/form-edit-password.php +5 -5
  137. templates/myaccount/form-edit-profile.php +3 -3
  138. templates/myaccount/form-login.php +25 -24
  139. templates/myaccount/form-lost-password.php +1 -1
  140. templates/myaccount/form-reset-password.php +1 -1
  141. templates/myaccount/lost-password-confirmation.php +1 -1
  142. templates/myaccount/my-account.php +1 -1
  143. templates/myaccount/navigation.php +1 -1
  144. templates/notices/success.php +1 -1
  145. user-registration.php +243 -236
includes/abstracts/abstract-ur-field-settings.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  /**
@@ -15,7 +15,7 @@ abstract class UR_Field_Settings {
15
 
16
  public $field_id;
17
  public $fields_html;
18
- public $field_data = array();
19
  public $default_class = 'ur_advance_setting';
20
 
21
  /**
@@ -37,10 +37,10 @@ abstract class UR_Field_Settings {
37
  *
38
  * @return mixed
39
  */
40
- public abstract function output( $field_data = array() );
41
 
42
 
43
- public abstract function register_fields();
44
 
45
 
46
  /**
@@ -52,15 +52,15 @@ abstract class UR_Field_Settings {
52
 
53
  foreach ( $fields as $field_key => $field ) {
54
 
55
- $this->fields_html .= '<div class="ur-advance-setting ur-advance-' . esc_attr($field_key) . '">';
56
- $this->fields_html .= '<label for="' . esc_attr($field['class']) . '">' . esc_html($field['label']) . '</label>';
57
 
58
  $value = $this->get_advance_setting_data( $field_key ) == '' ? $field['default'] : $this->get_advance_setting_data( $field_key );
59
 
60
  switch ( $field['type'] ) {
61
 
62
  case 'text':
63
- $this->fields_html .= '<input data-advance-field="' . esc_attr($field_key) . '" value="' . esc_attr($value) . '" class="' . esc_attr($field['class']) . '" type="text" name="' . esc_attr($field['name']) . '" data-id="' . ( isset( $field['data-id'] ) ? esc_attr( $field['data-id'] ) : '' ) . '" placeholder="' . esc_attr($field['placeholder']) . '"';
64
 
65
  if ( true == $field['required'] ) {
66
  $this->fields_html .= ' required ';
@@ -70,7 +70,7 @@ abstract class UR_Field_Settings {
70
  break;
71
 
72
  case 'select':
73
- $this->fields_html .= '<select data-advance-field="' . esc_attr($field_key) . '" class="' . esc_attr($field['class']) . '" data-id="' . ( isset( $field['data-id'] ) ? esc_attr( $field['data-id'] ) : '' ) . '" placeholder="' . esc_attr($field['placeholder']) . '" ';
74
 
75
  if ( true == $field['required'] ) {
76
  $this->fields_html .= ' required ';
@@ -81,21 +81,21 @@ abstract class UR_Field_Settings {
81
  $this->fields_html .= '>';
82
 
83
  foreach ( $field_options as $option_key => $option_value ) {
84
- $required = $value === $option_key ? 'selected="selected"' : '';
85
- $this->fields_html .= '<option value="' . esc_attr($option_key) . '" ' . $required . '>' . esc_html($option_value) . '</option>';
86
  }
87
 
88
  $this->fields_html .= '</select>';
89
  break;
90
 
91
  case 'textarea':
92
- $this->fields_html .= '<textarea data-advance-field="' . esc_attr($field_key) . '" class="' . esc_attr($field['class']) . '" type="text" name="' . esc_attr($field['name']) . '" data-id="' . ( isset( $field['data-id'] ) ? esc_attr( $field['data-id'] ) : '' ) . '" placeholder="' . esc_attr($field['placeholder']) . '"';
93
 
94
  if ( true == $field['required'] ) {
95
  $this->fields_html .= ' required ';
96
  }
97
 
98
- $this->fields_html .= '>' . esc_html($value) . '</textarea>';
99
  break;
100
 
101
  default:
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) {
3
+ exit; // Exit if accessed directly.
4
  }
5
 
6
  /**
15
 
16
  public $field_id;
17
  public $fields_html;
18
+ public $field_data = array();
19
  public $default_class = 'ur_advance_setting';
20
 
21
  /**
37
  *
38
  * @return mixed
39
  */
40
+ abstract public function output( $field_data = array() );
41
 
42
 
43
+ abstract public function register_fields();
44
 
45
 
46
  /**
52
 
53
  foreach ( $fields as $field_key => $field ) {
54
 
55
+ $this->fields_html .= '<div class="ur-advance-setting ur-advance-' . esc_attr( $field_key ) . '">';
56
+ $this->fields_html .= '<label for="' . esc_attr( $field['class'] ) . '">' . esc_html( $field['label'] ) . '</label>';
57
 
58
  $value = $this->get_advance_setting_data( $field_key ) == '' ? $field['default'] : $this->get_advance_setting_data( $field_key );
59
 
60
  switch ( $field['type'] ) {
61
 
62
  case 'text':
63
+ $this->fields_html .= '<input data-advance-field="' . esc_attr( $field_key ) . '" value="' . esc_attr( $value ) . '" class="' . esc_attr( $field['class'] ) . '" type="text" name="' . esc_attr( $field['name'] ) . '" data-id="' . ( isset( $field['data-id'] ) ? esc_attr( $field['data-id'] ) : '' ) . '" placeholder="' . esc_attr( $field['placeholder'] ) . '"';
64
 
65
  if ( true == $field['required'] ) {
66
  $this->fields_html .= ' required ';
70
  break;
71
 
72
  case 'select':
73
+ $this->fields_html .= '<select data-advance-field="' . esc_attr( $field_key ) . '" class="' . esc_attr( $field['class'] ) . '" data-id="' . ( isset( $field['data-id'] ) ? esc_attr( $field['data-id'] ) : '' ) . '" placeholder="' . esc_attr( $field['placeholder'] ) . '" ';
74
 
75
  if ( true == $field['required'] ) {
76
  $this->fields_html .= ' required ';
81
  $this->fields_html .= '>';
82
 
83
  foreach ( $field_options as $option_key => $option_value ) {
84
+ $required = $value === $option_key ? 'selected="selected"' : '';
85
+ $this->fields_html .= '<option value="' . esc_attr( $option_key ) . '" ' . $required . '>' . esc_html( $option_value ) . '</option>';
86
  }
87
 
88
  $this->fields_html .= '</select>';
89
  break;
90
 
91
  case 'textarea':
92
+ $this->fields_html .= '<textarea data-advance-field="' . esc_attr( $field_key ) . '" class="' . esc_attr( $field['class'] ) . '" type="text" name="' . esc_attr( $field['name'] ) . '" data-id="' . ( isset( $field['data-id'] ) ? esc_attr( $field['data-id'] ) : '' ) . '" placeholder="' . esc_attr( $field['placeholder'] ) . '"';
93
 
94
  if ( true == $field['required'] ) {
95
  $this->fields_html .= ' required ';
96
  }
97
 
98
+ $this->fields_html .= '>' . esc_html( $value ) . '</textarea>';
99
  break;
100
 
101
  default:
includes/abstracts/abstract-ur-form-field.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  /**
@@ -21,9 +21,9 @@ abstract class UR_Form_Field {
21
  * @since 1.0.0
22
  * @var int
23
  */
24
- protected $id = 0;
25
- protected $field_defaults = array();
26
- protected $admin_data = array();
27
  protected $registered_fields_config = array();
28
 
29
  /**
@@ -34,7 +34,7 @@ abstract class UR_Form_Field {
34
  */
35
  protected $form_id = 0;
36
 
37
- public abstract function get_registered_admin_fields();
38
 
39
  public function get_general_setting_data( $key ) {
40
 
@@ -51,7 +51,8 @@ abstract class UR_Form_Field {
51
 
52
  /**
53
  * Include admin template for each form fields
54
- * @param array $admin_data
 
55
  */
56
  public function get_admin_template( $admin_data = array() ) {
57
 
@@ -59,9 +60,9 @@ abstract class UR_Form_Field {
59
 
60
  $this->admin_data = $admin_data;
61
 
62
- $template_path = str_replace( '_', '-', str_replace( 'user_registration_', 'admin-', $this->id ) );
63
  $admin_template_path = apply_filters( $this->id . '_admin_template', UR_FORM_PATH . 'views' . UR_DS . 'admin' . UR_DS . $template_path . '.php' );
64
- include( $admin_template_path );
65
 
66
  $this->admin_data = array();
67
 
@@ -76,19 +77,19 @@ abstract class UR_Form_Field {
76
 
77
  $this->form_id = $form_id;
78
 
79
- $form_data = (array) $data['general_setting'];
80
  $form_data['type'] = $field_type;
81
 
82
- if( isset( $form_data['hide_label'] ) && 'yes' === $form_data['hide_label'] ) {
83
  unset( $form_data['label'] );
84
  }
85
 
86
- if( isset( $data['general_setting']->required ) ) {
87
 
88
- if ( in_array( $field_key, ur_get_required_fields() )
89
  || 'yes' === $data['general_setting']->required ) {
90
 
91
- $form_data['required'] = true;
92
  $form_data['custom_attributes']['required'] = 'required';
93
  }
94
  }
@@ -133,7 +134,7 @@ abstract class UR_Form_Field {
133
  }
134
  }
135
 
136
- if( 'checkbox' == $field_key) {
137
  $choices = isset( $data['advance_setting']->choices ) ? explode( ',', $data['advance_setting']->choices ) : array();
138
 
139
  if ( is_array( $choices ) ) {
@@ -152,7 +153,7 @@ abstract class UR_Form_Field {
152
 
153
  $form_data = isset( $form_data_array['form_data'] ) ? $form_data_array['form_data'] : $form_data;
154
 
155
- if( isset( $data['general_setting']->field_name ) ) {
156
  user_registration_form_field( $data['general_setting']->field_name, $form_data );
157
  }
158
 
@@ -163,25 +164,28 @@ abstract class UR_Form_Field {
163
  */
164
  public function get_field_advance_settings() {
165
 
166
- $file_name = str_replace( 'user_registration_', '', $this->id );
167
- $file_path = UR_FORM_PATH . 'settings' . UR_DS . 'class-ur-setting-' . strtolower( $file_name ) . '.php';
168
  $class_name = 'UR_Setting_' . ucwords( $file_name );
169
 
170
  if ( ! class_exists( $class_name ) ) {
171
- $file_path_array = apply_filters( 'user_registration_' . strtolower( $file_name ) . '_advance_class', array(
172
-
173
- 'file_name' => strtolower( $file_name ),
174
- 'file_path' => $file_path
175
- ) );
 
 
 
176
  $file_path = isset( $file_path_array['file_path'] ) ? $file_path_array['file_path'] : $file_path;
177
 
178
  if ( file_exists( $file_path ) ) {
179
- $advance_setting_instance = include_once( $file_path );
180
  return $advance_setting_instance->output( $this->admin_data );
181
  }
182
  } else {
183
 
184
- $instance = new $class_name;
185
  return $instance->output( $this->admin_data );
186
  }
187
 
@@ -194,19 +198,19 @@ abstract class UR_Form_Field {
194
  */
195
  public function get_field_general_settings() {
196
 
197
- $general_settings = ur_get_general_settings( $this->id );
198
  $general_setting_html = '';
199
 
200
  foreach ( $general_settings as $setting_key => $setting_value ) {
201
- $general_setting_wrapper = '<div class="ur-general-setting ur-setting-' . $setting_value['type'] . ' ur-general-setting-' . str_replace(" ", "-", strtolower( $setting_value['label']) ) . '">';
202
  $general_setting_wrapper .= '<label for="ur-type-' . $setting_value['type'] . '">' . $setting_value['label'] . '</label>';
203
- $sub_string_key = substr( $this->id, strlen( 'user_registration_' ), 5 );
204
- $strip_prefix = substr( $this->id, 18 );
205
 
206
  switch ( $setting_value['type'] ) {
207
  case 'text':
208
- $extra_attribute = in_array( $strip_prefix, ur_get_fields_without_prefix() ) && 'field_name' == $setting_key ? "disabled='disabled'" : '';
209
- $value = in_array( $strip_prefix, ur_get_fields_without_prefix() ) && 'field_name' == $setting_key ? trim( str_replace( 'user_registration_', '', $this->id ) ) : $this->get_general_setting_data( $setting_key );
210
  $general_setting_wrapper .= '<input value="' . $value . '" data-field="' . $setting_key . '" class="ur-general-setting-field ur-type-' . $setting_value['type'] . '" type="text" name="' . $setting_value['name'] . '" placeholder="' . $setting_value['placeholder'] . '"';
211
 
212
  if ( true == $setting_value['required'] ) {
@@ -217,7 +221,7 @@ abstract class UR_Form_Field {
217
  break;
218
 
219
  case 'radio':
220
- if ( isset( $setting_value['options'] )
221
  && gettype( $setting_value['options'] ) == 'array' ) {
222
 
223
  foreach ( $setting_value['options'] as $option_key => $option_value ) {
@@ -236,13 +240,13 @@ abstract class UR_Form_Field {
236
  break;
237
 
238
  case 'select':
239
- if ( isset( $setting_value['options'] )
240
  && gettype( $setting_value['options'] ) == 'array' ) {
241
 
242
  $general_setting_wrapper .= '<select data-field="' . $setting_key . '" class="ur-general-setting-field ur-type-' . $setting_value['type'] . '" name="' . $setting_value['name'] . '">';
243
 
244
  foreach ( $setting_value['options'] as $option_key => $option_value ) {
245
- $selected = $this->get_general_setting_data( $setting_key ) == $option_key ? "selected='selected'" : '';
246
  $general_setting_wrapper .= '<option ' . $selected . " value='" . $option_key . "'>" . $option_value . '</option>';
247
  }
248
 
@@ -251,7 +255,7 @@ abstract class UR_Form_Field {
251
  break;
252
 
253
  case 'textarea':
254
- $general_setting_wrapper .= '<textarea data-field="' . $setting_key . '" class="ur-general-setting-field ur-type-' . $setting_value['type'] . '" name="' . $setting_value['name'] . '" placeholder= "'. esc_attr( $setting_value['placeholder'] ) .'" ';
255
 
256
  if ( true == $setting_value['required'] ) {
257
  $general_setting_wrapper .= ' required >';
@@ -261,11 +265,10 @@ abstract class UR_Form_Field {
261
  break;
262
 
263
  default:
264
-
265
  }// End switch().
266
 
267
  $general_setting_wrapper .= '</div>';
268
- $general_setting_html .= $general_setting_wrapper;
269
 
270
  }// End foreach().
271
 
@@ -274,20 +277,21 @@ abstract class UR_Form_Field {
274
 
275
  /**
276
  * Display Setting for each fields in options tab
 
277
  * @return void
278
  */
279
  public function get_setting() {
280
 
281
  $sub_string_key = substr( $this->id, strlen( 'user_registration_' ), 5 );
282
- $strip_prefix = substr( $this->id, 18 );
283
- $class = 'ur-general-setting-'.$strip_prefix;
284
 
285
- echo "<div class='ur-general-setting-block " . esc_attr( $class ) ."'>";
286
  echo '<h2>' . __( 'General Settings', 'user-registration' ) . '</h2>';
287
  echo $this->get_field_general_settings();
288
  echo '</div>';
289
 
290
- $advance_settings = $this->get_field_advance_settings( );
291
 
292
  if ( '' != $advance_settings ) {
293
  echo "<div class='ur-advance-setting-block'>";
@@ -298,5 +302,5 @@ abstract class UR_Form_Field {
298
  do_action( 'user_registration_after_advance_settings', $this->id, $this->admin_data );
299
  }
300
 
301
- public abstract function validation( $single_form_field, $form_data, $filter_hook, $form_id );
302
  }
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) {
3
+ exit; // Exit if accessed directly.
4
  }
5
 
6
  /**
21
  * @since 1.0.0
22
  * @var int
23
  */
24
+ protected $id = 0;
25
+ protected $field_defaults = array();
26
+ protected $admin_data = array();
27
  protected $registered_fields_config = array();
28
 
29
  /**
34
  */
35
  protected $form_id = 0;
36
 
37
+ abstract public function get_registered_admin_fields();
38
 
39
  public function get_general_setting_data( $key ) {
40
 
51
 
52
  /**
53
  * Include admin template for each form fields
54
+ *
55
+ * @param array $admin_data
56
  */
57
  public function get_admin_template( $admin_data = array() ) {
58
 
60
 
61
  $this->admin_data = $admin_data;
62
 
63
+ $template_path = str_replace( '_', '-', str_replace( 'user_registration_', 'admin-', $this->id ) );
64
  $admin_template_path = apply_filters( $this->id . '_admin_template', UR_FORM_PATH . 'views' . UR_DS . 'admin' . UR_DS . $template_path . '.php' );
65
+ include $admin_template_path;
66
 
67
  $this->admin_data = array();
68
 
77
 
78
  $this->form_id = $form_id;
79
 
80
+ $form_data = (array) $data['general_setting'];
81
  $form_data['type'] = $field_type;
82
 
83
+ if ( isset( $form_data['hide_label'] ) && 'yes' === $form_data['hide_label'] ) {
84
  unset( $form_data['label'] );
85
  }
86
 
87
+ if ( isset( $data['general_setting']->required ) ) {
88
 
89
+ if ( in_array( $field_key, ur_get_required_fields() )
90
  || 'yes' === $data['general_setting']->required ) {
91
 
92
+ $form_data['required'] = true;
93
  $form_data['custom_attributes']['required'] = 'required';
94
  }
95
  }
134
  }
135
  }
136
 
137
+ if ( 'checkbox' == $field_key ) {
138
  $choices = isset( $data['advance_setting']->choices ) ? explode( ',', $data['advance_setting']->choices ) : array();
139
 
140
  if ( is_array( $choices ) ) {
153
 
154
  $form_data = isset( $form_data_array['form_data'] ) ? $form_data_array['form_data'] : $form_data;
155
 
156
+ if ( isset( $data['general_setting']->field_name ) ) {
157
  user_registration_form_field( $data['general_setting']->field_name, $form_data );
158
  }
159
 
164
  */
165
  public function get_field_advance_settings() {
166
 
167
+ $file_name = str_replace( 'user_registration_', '', $this->id );
168
+ $file_path = UR_FORM_PATH . 'settings' . UR_DS . 'class-ur-setting-' . strtolower( $file_name ) . '.php';
169
  $class_name = 'UR_Setting_' . ucwords( $file_name );
170
 
171
  if ( ! class_exists( $class_name ) ) {
172
+ $file_path_array = apply_filters(
173
+ 'user_registration_' . strtolower( $file_name ) . '_advance_class',
174
+ array(
175
+
176
+ 'file_name' => strtolower( $file_name ),
177
+ 'file_path' => $file_path,
178
+ )
179
+ );
180
  $file_path = isset( $file_path_array['file_path'] ) ? $file_path_array['file_path'] : $file_path;
181
 
182
  if ( file_exists( $file_path ) ) {
183
+ $advance_setting_instance = include_once $file_path;
184
  return $advance_setting_instance->output( $this->admin_data );
185
  }
186
  } else {
187
 
188
+ $instance = new $class_name();
189
  return $instance->output( $this->admin_data );
190
  }
191
 
198
  */
199
  public function get_field_general_settings() {
200
 
201
+ $general_settings = ur_get_general_settings( $this->id );
202
  $general_setting_html = '';
203
 
204
  foreach ( $general_settings as $setting_key => $setting_value ) {
205
+ $general_setting_wrapper = '<div class="ur-general-setting ur-setting-' . $setting_value['type'] . ' ur-general-setting-' . str_replace( ' ', '-', strtolower( $setting_value['label'] ) ) . '">';
206
  $general_setting_wrapper .= '<label for="ur-type-' . $setting_value['type'] . '">' . $setting_value['label'] . '</label>';
207
+ $sub_string_key = substr( $this->id, strlen( 'user_registration_' ), 5 );
208
+ $strip_prefix = substr( $this->id, 18 );
209
 
210
  switch ( $setting_value['type'] ) {
211
  case 'text':
212
+ $extra_attribute = in_array( $strip_prefix, ur_get_fields_without_prefix() ) && 'field_name' == $setting_key ? "disabled='disabled'" : '';
213
+ $value = in_array( $strip_prefix, ur_get_fields_without_prefix() ) && 'field_name' == $setting_key ? trim( str_replace( 'user_registration_', '', $this->id ) ) : $this->get_general_setting_data( $setting_key );
214
  $general_setting_wrapper .= '<input value="' . $value . '" data-field="' . $setting_key . '" class="ur-general-setting-field ur-type-' . $setting_value['type'] . '" type="text" name="' . $setting_value['name'] . '" placeholder="' . $setting_value['placeholder'] . '"';
215
 
216
  if ( true == $setting_value['required'] ) {
221
  break;
222
 
223
  case 'radio':
224
+ if ( isset( $setting_value['options'] )
225
  && gettype( $setting_value['options'] ) == 'array' ) {
226
 
227
  foreach ( $setting_value['options'] as $option_key => $option_value ) {
240
  break;
241
 
242
  case 'select':
243
+ if ( isset( $setting_value['options'] )
244
  && gettype( $setting_value['options'] ) == 'array' ) {
245
 
246
  $general_setting_wrapper .= '<select data-field="' . $setting_key . '" class="ur-general-setting-field ur-type-' . $setting_value['type'] . '" name="' . $setting_value['name'] . '">';
247
 
248
  foreach ( $setting_value['options'] as $option_key => $option_value ) {
249
+ $selected = $this->get_general_setting_data( $setting_key ) == $option_key ? "selected='selected'" : '';
250
  $general_setting_wrapper .= '<option ' . $selected . " value='" . $option_key . "'>" . $option_value . '</option>';
251
  }
252
 
255
  break;
256
 
257
  case 'textarea':
258
+ $general_setting_wrapper .= '<textarea data-field="' . $setting_key . '" class="ur-general-setting-field ur-type-' . $setting_value['type'] . '" name="' . $setting_value['name'] . '" placeholder= "' . esc_attr( $setting_value['placeholder'] ) . '" ';
259
 
260
  if ( true == $setting_value['required'] ) {
261
  $general_setting_wrapper .= ' required >';
265
  break;
266
 
267
  default:
 
268
  }// End switch().
269
 
270
  $general_setting_wrapper .= '</div>';
271
+ $general_setting_html .= $general_setting_wrapper;
272
 
273
  }// End foreach().
274
 
277
 
278
  /**
279
  * Display Setting for each fields in options tab
280
+ *
281
  * @return void
282
  */
283
  public function get_setting() {
284
 
285
  $sub_string_key = substr( $this->id, strlen( 'user_registration_' ), 5 );
286
+ $strip_prefix = substr( $this->id, 18 );
287
+ $class = 'ur-general-setting-' . $strip_prefix;
288
 
289
+ echo "<div class='ur-general-setting-block " . esc_attr( $class ) . "'>";
290
  echo '<h2>' . __( 'General Settings', 'user-registration' ) . '</h2>';
291
  echo $this->get_field_general_settings();
292
  echo '</div>';
293
 
294
+ $advance_settings = $this->get_field_advance_settings();
295
 
296
  if ( '' != $advance_settings ) {
297
  echo "<div class='ur-advance-setting-block'>";
302
  do_action( 'user_registration_after_advance_settings', $this->id, $this->admin_data );
303
  }
304
 
305
+ abstract public function validation( $single_form_field, $form_data, $filter_hook, $form_id );
306
  }
includes/abstracts/abstract-ur-session.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  /**
@@ -87,7 +87,7 @@ abstract class UR_Session {
87
  public function set( $key, $value ) {
88
  if ( $value !== $this->get( $key ) ) {
89
  $this->_data[ sanitize_key( $key ) ] = maybe_serialize( $value );
90
- $this->_dirty = true;
91
  }
92
  }
93
 
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) {
3
+ exit; // Exit if accessed directly.
4
  }
5
 
6
  /**
87
  public function set( $key, $value ) {
88
  if ( $value !== $this->get( $key ) ) {
89
  $this->_data[ sanitize_key( $key ) ] = maybe_serialize( $value );
90
+ $this->_dirty = true;
91
  }
92
  }
93
 
includes/admin/class-ur-admin-addons.php CHANGED
@@ -9,7 +9,7 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
 
15
  /**
@@ -41,7 +41,7 @@ class UR_Admin_Addons {
41
  if ( empty( $sections_id ) ) {
42
  continue;
43
  }
44
- $addon_sections[ $sections_id ] = new stdClass;
45
  $addon_sections[ $sections_id ]->title = ur_clean( $section->title );
46
  $addon_sections[ $sections_id ]->endpoint = ur_clean( $section->endpoint );
47
  }
@@ -102,6 +102,6 @@ class UR_Admin_Addons {
102
  $theme = wp_get_theme();
103
  $section_keys = array_keys( $sections );
104
  $current_section = isset( $_GET['section'] ) ? sanitize_text_field( $_GET['section'] ) : current( $section_keys );
105
- include_once( dirname( __FILE__ ) . '/views/html-admin-page-addons.php' );
106
  }
107
  }
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  /**
41
  if ( empty( $sections_id ) ) {
42
  continue;
43
  }
44
+ $addon_sections[ $sections_id ] = new stdClass();
45
  $addon_sections[ $sections_id ]->title = ur_clean( $section->title );
46
  $addon_sections[ $sections_id ]->endpoint = ur_clean( $section->endpoint );
47
  }
102
  $theme = wp_get_theme();
103
  $section_keys = array_keys( $sections );
104
  $current_section = isset( $_GET['section'] ) ? sanitize_text_field( $_GET['section'] ) : current( $section_keys );
105
+ include_once dirname( __FILE__ ) . '/views/html-admin-page-addons.php';
106
  }
107
  }
includes/admin/class-ur-admin-assets.php CHANGED
@@ -12,7 +12,7 @@
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
15
- exit;
16
  }
17
 
18
  /**
@@ -40,7 +40,7 @@ class UR_Admin_Assets {
40
 
41
  // Register admin styles
42
  wp_register_style( 'user-registration-menu', UR()->plugin_url() . '/assets/css/menu.css', array(), UR_VERSION );
43
- wp_register_style ( 'user-registration-form-modal-css', UR()->plugin_url() . '/assets/css/form-modal.css', array(), UR_VERSION );
44
 
45
  wp_register_style( 'user-registration-admin', UR()->plugin_url() . '/assets/css/admin.css', array( 'nav-menus' ), UR_VERSION );
46
  wp_register_style( 'jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
@@ -77,64 +77,87 @@ class UR_Admin_Assets {
77
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
78
 
79
  // Register Scripts
80
- wp_register_script( 'user-registration-admin', UR()->plugin_url() . '/assets/js/admin/admin' . $suffix . '.js', array(
81
- 'jquery',
82
- 'selectWoo',
83
- 'jquery-blockui',
84
- 'jquery-tiptip',
85
- 'jquery-ui-sortable',
86
- 'jquery-ui-widget',
87
- 'jquery-ui-core',
88
- 'jquery-ui-tabs',
89
- 'jquery-ui-draggable',
90
- 'jquery-ui-droppable',
91
- 'jquery-tiptip',
92
- 'ur-backbone-modal',
93
- 'ur-enhanced-select',
94
-
95
- ), UR_VERSION );
 
 
 
 
 
96
  wp_register_script( 'jquery-blockui', UR()->plugin_url() . '/assets/js/jquery-blockui/jquery.blockUI' . $suffix . '.js', array( 'jquery' ), '2.70', true );
97
  wp_register_script( 'jquery-tiptip', UR()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip' . $suffix . '.js', array( 'jquery' ), UR_VERSION, true );
98
- wp_register_script( 'ur-backbone-modal', UR()->plugin_url() . '/assets/js/admin/backbone-modal' . $suffix . '.js', array(
99
- 'underscore',
100
- 'backbone',
101
- 'wp-util',
102
- ), UR_VERSION );
 
 
 
 
 
103
 
104
- wp_register_script ( 'user-registration-form-modal-js', UR()->plugin_url() . '/assets/js/admin/form-modal' . $suffix . '.js', 'jquery' );
105
  wp_register_script( 'selectWoo', UR()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '3.5.4' );
106
- wp_register_script( 'ur-enhanced-select', UR()->plugin_url() . '/assets/js/admin/enhanced-select' . $suffix . '.js', array(
107
- 'jquery',
108
- 'selectWoo',
109
- ), UR_VERSION );
 
 
 
 
 
110
  wp_register_script( 'flatpickr', UR()->plugin_url() . '/assets/js/flatpickr/flatpickr.min.js', array( 'jquery' ), '1.17.0' );
111
 
112
  if ( 'user-registration_page_add-new-registration' === $screen_id ) {
113
- wp_enqueue_script( 'ur-copy' , UR()->plugin_url() . '/assets/js/admin/ur-copy' . $suffix . '.js', 'jquery' );
114
  }
115
 
116
  wp_enqueue_script( 'user-registration-form-modal-js' );
117
 
118
- wp_localize_script( 'ur-enhanced-select', 'ur_enhanced_select_params', array(
119
- 'i18n_no_matches' => _x( 'No matches found', 'enhanced select', 'user-registration' ),
120
- 'i18n_ajax_error' => _x( 'Loading failed', 'enhanced select', 'user-registration' ),
121
- 'i18n_input_too_short_1' => _x( 'Please enter 1 or more characters', 'enhanced select', 'user-registration' ),
122
- 'i18n_input_too_short_n' => _x( 'Please enter %qty% or more characters', 'enhanced select', 'user-registration' ),
123
- 'i18n_input_too_long_1' => _x( 'Please delete 1 character', 'enhanced select', 'user-registration' ),
124
- 'i18n_input_too_long_n' => _x( 'Please delete %qty% characters', 'enhanced select', 'user-registration' ),
125
- 'i18n_selection_too_long_1' => _x( 'You can only select 1 item', 'enhanced select', 'user-registration' ),
126
- 'i18n_selection_too_long_n' => _x( 'You can only select %qty% items', 'enhanced select', 'user-registration' ),
127
- 'i18n_load_more' => _x( 'Loading more results&hellip;', 'enhanced select', 'user-registration' ),
128
- 'i18n_searching' => _x( 'Searching&hellip;', 'enhanced select', 'user-registration' ),
129
- ) );
 
 
 
 
130
 
131
  if ( 'user-registration_page_user-registration-modules' === $screen_id ) {
132
  wp_enqueue_style( 'user-registration-modules' );
133
  wp_enqueue_script( 'user-registration-modules-script' );
134
- wp_localize_script( 'user-registration-modules-script', 'user_registration_module_params', array(
135
- 'ajax_url' => admin_url( 'admin-ajax.php' ),
136
- 'error_could_not_install' => __( 'Could not install.', 'user-registration' )
137
- ));
 
 
 
 
138
  }
139
 
140
  // UserRegistration admin pages
@@ -152,7 +175,7 @@ class UR_Admin_Assets {
152
  'number_of_grid' => UR_Config::$ur_form_grid,
153
  'active_grid' => UR_Config::$default_active_grid,
154
  'is_edit_form' => isset( $_GET['edit-registration'] ) ? true : false,
155
- 'post_id' => isset( $_GET['edit-registration'] ) ? $_GET['edit-registration'] : 0,
156
  'admin_url' => admin_url( 'admin.php?page=add-new-registration&edit-registration=' ),
157
  'form_required_fields' => ur_get_required_fields(),
158
  'form_one_time_draggable_fields' => ur_get_one_time_draggable_fields(),
@@ -225,24 +248,24 @@ class UR_Admin_Assets {
225
  public static function get_i18n_admin_data() {
226
 
227
  $i18n = array(
228
- 'i18n_user_email' => _x( 'User Email', 'user-registration admin', 'user-registration' ),
229
- 'i18n_user_password' => _x( 'User Password', 'user-registration admin', 'user-registration' ),
230
- 'i18n_are_you_sure_want_to_delete' => _x( 'Are you sure want to delete?', 'user registration admin', 'user-registration' ),
231
- 'i18n_at_least_one_row_need_to_select' => _x( 'At least one row needs to be selected.', 'user registration admin', 'user-registration' ),
232
- 'i18n_user_required_field_already_there' => _x( 'This field is one time draggable.', 'user registration admin', 'user-registration' ),
233
  'i18n_user_required_field_already_there_could_not_clone' => _x( 'Could not clone this field.', 'user registration admin', 'user-registration' ),
234
- 'i18n_form_successfully_saved' => _x( 'Form successfully saved.', 'user registration admin', 'user-registration' ),
235
- 'i18n_success' => _x( 'Success', 'user registration admin', 'user-registration' ),
236
- 'i18n_error' => _x( 'Error', 'user registration admin', 'user-registration' ),
237
- 'i18n_at_least_one_field_need_to_select' => _x( 'At least one field needs to be selected.', 'user registration admin', 'user-registration' ),
238
- 'i18n_empty_form_name' => _x( 'Empty form name.', 'user registration admin', 'user-registration' ),
239
- 'i18n_previous_save_action_ongoing' => _x( 'Previous save action on going.', 'user registration admin', 'user-registration' ),
240
- 'i18n_duplicate_field_name' => _x( 'Duplicate field name.', 'user registration admin', 'user-registration' ),
241
- 'i18n_empty_field_label' => _x( 'Empty field label.', 'user registration admin', 'user-registration' ),
242
- 'i18n_invald_field_name' => _x( 'Invalid field name. Please do not use space, empty or special character, you can use underscore.', 'user registration admin', 'user-registration' ),
243
- 'i18n_multiple_field_key' => _x( 'Multiple field key ', 'user registration admin', 'user-registration' ),
244
- 'i18n_field_is_required' => _x( 'field is required.', 'user registration admin', 'user-registration' ),
245
- 'i18n_drag_your_first_item_here' => _x( 'Drag your first form item here.', 'user registration admin', 'user-registration' ),
246
 
247
  );
248
 
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
15
+ exit; // Exit if accessed directly.
16
  }
17
 
18
  /**
40
 
41
  // Register admin styles
42
  wp_register_style( 'user-registration-menu', UR()->plugin_url() . '/assets/css/menu.css', array(), UR_VERSION );
43
+ wp_register_style( 'user-registration-form-modal-css', UR()->plugin_url() . '/assets/css/form-modal.css', array(), UR_VERSION );
44
 
45
  wp_register_style( 'user-registration-admin', UR()->plugin_url() . '/assets/css/admin.css', array( 'nav-menus' ), UR_VERSION );
46
  wp_register_style( 'jquery-ui-style', '//code.jquery.com/ui/' . $jquery_version . '/themes/smoothness/jquery-ui.css', array(), $jquery_version );
77
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
78
 
79
  // Register Scripts
80
+ wp_register_script(
81
+ 'user-registration-admin',
82
+ UR()->plugin_url() . '/assets/js/admin/admin' . $suffix . '.js',
83
+ array(
84
+ 'jquery',
85
+ 'selectWoo',
86
+ 'jquery-blockui',
87
+ 'jquery-tiptip',
88
+ 'jquery-ui-sortable',
89
+ 'jquery-ui-widget',
90
+ 'jquery-ui-core',
91
+ 'jquery-ui-tabs',
92
+ 'jquery-ui-draggable',
93
+ 'jquery-ui-droppable',
94
+ 'jquery-tiptip',
95
+ 'ur-backbone-modal',
96
+ 'ur-enhanced-select',
97
+
98
+ ),
99
+ UR_VERSION
100
+ );
101
  wp_register_script( 'jquery-blockui', UR()->plugin_url() . '/assets/js/jquery-blockui/jquery.blockUI' . $suffix . '.js', array( 'jquery' ), '2.70', true );
102
  wp_register_script( 'jquery-tiptip', UR()->plugin_url() . '/assets/js/jquery-tiptip/jquery.tipTip' . $suffix . '.js', array( 'jquery' ), UR_VERSION, true );
103
+ wp_register_script(
104
+ 'ur-backbone-modal',
105
+ UR()->plugin_url() . '/assets/js/admin/backbone-modal' . $suffix . '.js',
106
+ array(
107
+ 'underscore',
108
+ 'backbone',
109
+ 'wp-util',
110
+ ),
111
+ UR_VERSION
112
+ );
113
 
114
+ wp_register_script( 'user-registration-form-modal-js', UR()->plugin_url() . '/assets/js/admin/form-modal' . $suffix . '.js', 'jquery' );
115
  wp_register_script( 'selectWoo', UR()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '3.5.4' );
116
+ wp_register_script(
117
+ 'ur-enhanced-select',
118
+ UR()->plugin_url() . '/assets/js/admin/enhanced-select' . $suffix . '.js',
119
+ array(
120
+ 'jquery',
121
+ 'selectWoo',
122
+ ),
123
+ UR_VERSION
124
+ );
125
  wp_register_script( 'flatpickr', UR()->plugin_url() . '/assets/js/flatpickr/flatpickr.min.js', array( 'jquery' ), '1.17.0' );
126
 
127
  if ( 'user-registration_page_add-new-registration' === $screen_id ) {
128
+ wp_enqueue_script( 'ur-copy', UR()->plugin_url() . '/assets/js/admin/ur-copy' . $suffix . '.js', 'jquery' );
129
  }
130
 
131
  wp_enqueue_script( 'user-registration-form-modal-js' );
132
 
133
+ wp_localize_script(
134
+ 'ur-enhanced-select',
135
+ 'ur_enhanced_select_params',
136
+ array(
137
+ 'i18n_no_matches' => _x( 'No matches found', 'enhanced select', 'user-registration' ),
138
+ 'i18n_ajax_error' => _x( 'Loading failed', 'enhanced select', 'user-registration' ),
139
+ 'i18n_input_too_short_1' => _x( 'Please enter 1 or more characters', 'enhanced select', 'user-registration' ),
140
+ 'i18n_input_too_short_n' => _x( 'Please enter %qty% or more characters', 'enhanced select', 'user-registration' ),
141
+ 'i18n_input_too_long_1' => _x( 'Please delete 1 character', 'enhanced select', 'user-registration' ),
142
+ 'i18n_input_too_long_n' => _x( 'Please delete %qty% characters', 'enhanced select', 'user-registration' ),
143
+ 'i18n_selection_too_long_1' => _x( 'You can only select 1 item', 'enhanced select', 'user-registration' ),
144
+ 'i18n_selection_too_long_n' => _x( 'You can only select %qty% items', 'enhanced select', 'user-registration' ),
145
+ 'i18n_load_more' => _x( 'Loading more results&hellip;', 'enhanced select', 'user-registration' ),
146
+ 'i18n_searching' => _x( 'Searching&hellip;', 'enhanced select', 'user-registration' ),
147
+ )
148
+ );
149
 
150
  if ( 'user-registration_page_user-registration-modules' === $screen_id ) {
151
  wp_enqueue_style( 'user-registration-modules' );
152
  wp_enqueue_script( 'user-registration-modules-script' );
153
+ wp_localize_script(
154
+ 'user-registration-modules-script',
155
+ 'user_registration_module_params',
156
+ array(
157
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
158
+ 'error_could_not_install' => __( 'Could not install.', 'user-registration' ),
159
+ )
160
+ );
161
  }
162
 
163
  // UserRegistration admin pages
175
  'number_of_grid' => UR_Config::$ur_form_grid,
176
  'active_grid' => UR_Config::$default_active_grid,
177
  'is_edit_form' => isset( $_GET['edit-registration'] ) ? true : false,
178
+ 'post_id' => isset( $_GET['edit-registration'] ) ? absint( $_GET['edit-registration'] ) : 0,
179
  'admin_url' => admin_url( 'admin.php?page=add-new-registration&edit-registration=' ),
180
  'form_required_fields' => ur_get_required_fields(),
181
  'form_one_time_draggable_fields' => ur_get_one_time_draggable_fields(),
248
  public static function get_i18n_admin_data() {
249
 
250
  $i18n = array(
251
+ 'i18n_user_email' => _x( 'User Email', 'user-registration admin', 'user-registration' ),
252
+ 'i18n_user_password' => _x( 'User Password', 'user-registration admin', 'user-registration' ),
253
+ 'i18n_are_you_sure_want_to_delete' => _x( 'Are you sure want to delete?', 'user registration admin', 'user-registration' ),
254
+ 'i18n_at_least_one_row_need_to_select' => _x( 'At least one row needs to be selected.', 'user registration admin', 'user-registration' ),
255
+ 'i18n_user_required_field_already_there' => _x( 'This field is one time draggable.', 'user registration admin', 'user-registration' ),
256
  'i18n_user_required_field_already_there_could_not_clone' => _x( 'Could not clone this field.', 'user registration admin', 'user-registration' ),
257
+ 'i18n_form_successfully_saved' => _x( 'Form successfully saved.', 'user registration admin', 'user-registration' ),
258
+ 'i18n_success' => _x( 'Success', 'user registration admin', 'user-registration' ),
259
+ 'i18n_error' => _x( 'Error', 'user registration admin', 'user-registration' ),
260
+ 'i18n_at_least_one_field_need_to_select' => _x( 'At least one field needs to be selected.', 'user registration admin', 'user-registration' ),
261
+ 'i18n_empty_form_name' => _x( 'Empty form name.', 'user registration admin', 'user-registration' ),
262
+ 'i18n_previous_save_action_ongoing' => _x( 'Previous save action on going.', 'user registration admin', 'user-registration' ),
263
+ 'i18n_duplicate_field_name' => _x( 'Duplicate field name.', 'user registration admin', 'user-registration' ),
264
+ 'i18n_empty_field_label' => _x( 'Empty field label.', 'user registration admin', 'user-registration' ),
265
+ 'i18n_invald_field_name' => _x( 'Invalid field name. Please do not use space, empty or special character, you can use underscore.', 'user registration admin', 'user-registration' ),
266
+ 'i18n_multiple_field_key' => _x( 'Multiple field key ', 'user registration admin', 'user-registration' ),
267
+ 'i18n_field_is_required' => _x( 'field is required.', 'user registration admin', 'user-registration' ),
268
+ 'i18n_drag_your_first_item_here' => _x( 'Drag your first form item here.', 'user registration admin', 'user-registration' ),
269
 
270
  );
271
 
includes/admin/class-ur-admin-export-users.php CHANGED
@@ -9,7 +9,7 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
 
15
  /**
@@ -27,21 +27,23 @@ class UR_Admin_Export_Users {
27
 
28
  /**
29
  * Outputs Export Users Page
 
30
  * @return void
31
  */
32
  public static function output() {
33
  $all_forms = ur_get_all_user_registration_form();
34
- include_once( dirname( __FILE__ ) . '/views/html-admin-page-export-users.php' );
35
  }
36
 
37
  /**
38
  * Exports users data along with extra information in CSV format.
 
39
  * @return void
40
  */
41
  public function export_csv( $form_id ) {
42
 
43
  // Check for non empty $_POST.
44
- if( ! isset( $_POST['user_registration_export_users'] ) ) {
45
  return;
46
  }
47
 
@@ -53,84 +55,93 @@ class UR_Admin_Export_Users {
53
  $form_id = isset( $_POST['export_users'] ) ? $_POST['export_users'] : 0;
54
 
55
  // Return if form id is not set and current user doesnot have export capability.
56
- if( ! isset( $form_id ) || ! current_user_can( 'export' ) ) {
57
  return;
58
  }
59
 
60
- $users = get_users( array(
61
- 'ur_form_id' => $form_id,
62
- ));
 
 
63
 
64
- if( count( $users ) === 0 ) {
65
- echo '<div id="message" class="updated inline notice notice-error"><p><strong>'. __( 'No users found with this form id.', 'user-registration' ) .'</strong></p></div>';
66
- return;
67
- }
68
 
69
  $columns = $this->generate_columns( $form_id );
70
- $rows = $this->generate_rows( $users, $form_id );
71
 
72
- $form_name = strtolower( str_replace( " ", "-", get_the_title( $form_id ) ) );
73
- $file_name = $form_name . "-" . current_time( 'Y-m-d_H:i:s' ) . '.csv';
74
 
75
- if ( ob_get_contents() ) {
76
- ob_clean();
77
- }
78
 
79
  // Force download
80
- header("Content-Type: application/force-download");
81
- header("Content-Type: application/octet-stream");
82
- header("Content-Type: application/download");
83
 
84
- // Disposition / Encoding on response body
85
- header("Content-Disposition: attachment;filename={$file_name}");
86
- header("Content-Transfer-Encoding: binary");
87
 
88
- $handle = fopen("php://output", 'w');
89
 
90
- // Handle UTF-8 chars conversion for CSV
91
- fprintf( $handle, chr(0xEF).chr(0xBB).chr(0xBF) );
92
 
93
- // Put the column headers
94
- fputcsv( $handle, array_values( $columns ) );
95
 
96
- // Put the row values
97
- foreach ( $rows as $row ) {
98
- fputcsv( $handle, $row );
99
- }
100
 
101
- fclose( $handle );
102
 
103
- exit;
104
  }
105
 
106
  /**
107
  * Generate Column for CSV export.
108
- * @param int $form_id Form ID.
 
109
  * @return array $columns CSV Export Columns.
110
  */
111
  public function generate_columns( $form_id ) {
112
 
113
  // Default Columns.
114
- $default_columns = apply_filters( 'user_registration_csv_export_default_columns', array(
115
- 'user_role' => __( 'User Role', 'user-registration' ),
116
- 'date_created' => __( 'User Registered', 'user-registration' ),
117
- 'date_created_gmt' => __( 'User Registered GMT', 'user-registration' ),
118
- ) );
 
 
 
119
 
120
  // User ID Column.
121
  $user_id_column = array(
122
- 'user_id' => __( 'User ID', 'user-registration' )
123
  );
124
 
125
  $columns = ur_get_meta_key_label( $form_id );
126
 
127
- $exclude_columns = apply_filters( 'user_registration_csv_export_exclude_columns', array(
128
- 'user_pass',
129
- 'user_confirm_password',
130
- ) );
 
 
 
131
 
132
- foreach( $exclude_columns as $exclude_column ) {
133
- unset( $columns[ $exclude_column ]);
134
  }
135
 
136
  $columns = array_merge( $user_id_column, $columns );
@@ -141,84 +152,86 @@ class UR_Admin_Export_Users {
141
 
142
  /**
143
  * Generate rows for CSV export
144
- * @param obj $users Users Data
145
- * @return array $rows CSV export rows.
 
146
  */
147
  public function generate_rows( $users, $form_id ) {
148
 
149
- $rows = array();
150
 
151
- foreach( $users as $user ) {
152
 
153
- if( ! isset( $user->data->ID ) ) {
154
- continue;
155
- }
156
 
157
- $user_form_id = get_user_meta( $user->data->ID, 'ur_form_id', true );
158
 
159
- // If the user is not submitted by selected registration form.
160
- if( $user_form_id !== $form_id ) {
161
- continue;
162
- }
163
 
164
- $user_id_row = array( 'user_id' => $user->data->ID );
165
- $user_extra_row = ur_get_user_extra_fields( $user->data->ID );
166
 
167
- foreach( $user_extra_row as $user_extra_data ) {
168
  $columns = $this->generate_columns( $form_id );
169
 
170
- if( ! isset( $columns[ $user_extra_data ] ) ) {
171
 
172
- // Remove the rows value that are not in columns.
173
- unset( $user_extra_row[ $user_extra_data ] );
174
- }
175
- }
176
 
177
- $user_table_data = ur_get_user_table_fields();
178
- $user_table_data_row = array();
179
 
180
- // Get user table data that are on column.
181
- foreach( $user_table_data as $data ) {
182
  $columns = $this->generate_columns( $form_id );
183
 
184
- if( isset( $columns[ $data ] ) ) {
185
- $user_table_data_row = array_merge( $user_table_data_row, array( $data => $user->$data ) );
186
- }
187
- }
188
 
189
- $user_meta_data = ur_get_registered_user_meta_fields();
190
- $user_meta_data_row = array();
191
 
192
- // Get user meta table data that are on column.
193
- foreach( $user_meta_data as $meta_data ) {
194
  $columns = $this->generate_columns( $form_id );
195
 
196
- if( isset( $columns[ $meta_data ] ) ) {
197
- $user_meta_data_row = array_merge( $user_meta_data_row, array( $meta_data => get_user_meta( $user->data->ID, $meta_data, true ) ) );
198
- }
199
- }
200
 
201
- $user_extra_row = array_merge( $user_extra_row, $user_table_data_row );
202
- $user_extra_row = array_merge( $user_extra_row, $user_meta_data_row );
203
 
204
- // Get user default row.
205
- $user_default_row = array(
206
- 'user_role' => is_array( $user->roles ) ? implode( ',', $user->roles ) : $user->roles,
207
- 'date_created' => $user->data->user_registered,
208
- 'date_created_gmt' => get_gmt_from_date( $user->data->user_registered ),
209
- );
210
 
211
- $user_row = array_merge( $user_id_row, $user_extra_row );
212
  $user_row = array_merge( $user_row, $user_default_row );
213
 
214
  /**
215
  * Reorder rows according to the values in column.
 
216
  * @see https://stackoverflow.com/a/44774818/9520912
217
  */
218
- $user_row = array_merge( array_fill_keys ( array_keys( $this->generate_columns( $form_id ) ), '' ), $user_row );
219
 
220
  $rows[] = $user_row;
221
- }
222
 
223
  return apply_filters( 'user_registration_csv_export_rows', $rows, $users );
224
  }
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  /**
27
 
28
  /**
29
  * Outputs Export Users Page
30
+ *
31
  * @return void
32
  */
33
  public static function output() {
34
  $all_forms = ur_get_all_user_registration_form();
35
+ include_once dirname( __FILE__ ) . '/views/html-admin-page-export-users.php';
36
  }
37
 
38
  /**
39
  * Exports users data along with extra information in CSV format.
40
+ *
41
  * @return void
42
  */
43
  public function export_csv( $form_id ) {
44
 
45
  // Check for non empty $_POST.
46
+ if ( ! isset( $_POST['user_registration_export_users'] ) ) {
47
  return;
48
  }
49
 
55
  $form_id = isset( $_POST['export_users'] ) ? $_POST['export_users'] : 0;
56
 
57
  // Return if form id is not set and current user doesnot have export capability.
58
+ if ( ! isset( $form_id ) || ! current_user_can( 'export' ) ) {
59
  return;
60
  }
61
 
62
+ $users = get_users(
63
+ array(
64
+ 'ur_form_id' => $form_id,
65
+ )
66
+ );
67
 
68
+ if ( count( $users ) === 0 ) {
69
+ echo '<div id="message" class="updated inline notice notice-error"><p><strong>' . __( 'No users found with this form id.', 'user-registration' ) . '</strong></p></div>';
70
+ return;
71
+ }
72
 
73
  $columns = $this->generate_columns( $form_id );
74
+ $rows = $this->generate_rows( $users, $form_id );
75
 
76
+ $form_name = strtolower( str_replace( ' ', '-', get_the_title( $form_id ) ) );
77
+ $file_name = $form_name . '-' . current_time( 'Y-m-d_H:i:s' ) . '.csv';
78
 
79
+ if ( ob_get_contents() ) {
80
+ ob_clean();
81
+ }
82
 
83
  // Force download
84
+ header( 'Content-Type: application/force-download' );
85
+ header( 'Content-Type: application/octet-stream' );
86
+ header( 'Content-Type: application/download' );
87
 
88
+ // Disposition / Encoding on response body
89
+ header( "Content-Disposition: attachment;filename={$file_name}" );
90
+ header( 'Content-Transfer-Encoding: binary' );
91
 
92
+ $handle = fopen( 'php://output', 'w' );
93
 
94
+ // Handle UTF-8 chars conversion for CSV
95
+ fprintf( $handle, chr( 0xEF ) . chr( 0xBB ) . chr( 0xBF ) );
96
 
97
+ // Put the column headers
98
+ fputcsv( $handle, array_values( $columns ) );
99
 
100
+ // Put the row values
101
+ foreach ( $rows as $row ) {
102
+ fputcsv( $handle, $row );
103
+ }
104
 
105
+ fclose( $handle );
106
 
107
+ exit;
108
  }
109
 
110
  /**
111
  * Generate Column for CSV export.
112
+ *
113
+ * @param int $form_id Form ID.
114
  * @return array $columns CSV Export Columns.
115
  */
116
  public function generate_columns( $form_id ) {
117
 
118
  // Default Columns.
119
+ $default_columns = apply_filters(
120
+ 'user_registration_csv_export_default_columns',
121
+ array(
122
+ 'user_role' => __( 'User Role', 'user-registration' ),
123
+ 'date_created' => __( 'User Registered', 'user-registration' ),
124
+ 'date_created_gmt' => __( 'User Registered GMT', 'user-registration' ),
125
+ )
126
+ );
127
 
128
  // User ID Column.
129
  $user_id_column = array(
130
+ 'user_id' => __( 'User ID', 'user-registration' ),
131
  );
132
 
133
  $columns = ur_get_meta_key_label( $form_id );
134
 
135
+ $exclude_columns = apply_filters(
136
+ 'user_registration_csv_export_exclude_columns',
137
+ array(
138
+ 'user_pass',
139
+ 'user_confirm_password',
140
+ )
141
+ );
142
 
143
+ foreach ( $exclude_columns as $exclude_column ) {
144
+ unset( $columns[ $exclude_column ] );
145
  }
146
 
147
  $columns = array_merge( $user_id_column, $columns );
152
 
153
  /**
154
  * Generate rows for CSV export
155
+ *
156
+ * @param obj $users Users Data
157
+ * @return array $rows CSV export rows.
158
  */
159
  public function generate_rows( $users, $form_id ) {
160
 
161
+ $rows = array();
162
 
163
+ foreach ( $users as $user ) {
164
 
165
+ if ( ! isset( $user->data->ID ) ) {
166
+ continue;
167
+ }
168
 
169
+ $user_form_id = get_user_meta( $user->data->ID, 'ur_form_id', true );
170
 
171
+ // If the user is not submitted by selected registration form.
172
+ if ( $user_form_id !== $form_id ) {
173
+ continue;
174
+ }
175
 
176
+ $user_id_row = array( 'user_id' => $user->data->ID );
177
+ $user_extra_row = ur_get_user_extra_fields( $user->data->ID );
178
 
179
+ foreach ( $user_extra_row as $user_extra_data ) {
180
  $columns = $this->generate_columns( $form_id );
181
 
182
+ if ( ! isset( $columns[ $user_extra_data ] ) ) {
183
 
184
+ // Remove the rows value that are not in columns.
185
+ unset( $user_extra_row[ $user_extra_data ] );
186
+ }
187
+ }
188
 
189
+ $user_table_data = ur_get_user_table_fields();
190
+ $user_table_data_row = array();
191
 
192
+ // Get user table data that are on column.
193
+ foreach ( $user_table_data as $data ) {
194
  $columns = $this->generate_columns( $form_id );
195
 
196
+ if ( isset( $columns[ $data ] ) ) {
197
+ $user_table_data_row = array_merge( $user_table_data_row, array( $data => $user->$data ) );
198
+ }
199
+ }
200
 
201
+ $user_meta_data = ur_get_registered_user_meta_fields();
202
+ $user_meta_data_row = array();
203
 
204
+ // Get user meta table data that are on column.
205
+ foreach ( $user_meta_data as $meta_data ) {
206
  $columns = $this->generate_columns( $form_id );
207
 
208
+ if ( isset( $columns[ $meta_data ] ) ) {
209
+ $user_meta_data_row = array_merge( $user_meta_data_row, array( $meta_data => get_user_meta( $user->data->ID, $meta_data, true ) ) );
210
+ }
211
+ }
212
 
213
+ $user_extra_row = array_merge( $user_extra_row, $user_table_data_row );
214
+ $user_extra_row = array_merge( $user_extra_row, $user_meta_data_row );
215
 
216
+ // Get user default row.
217
+ $user_default_row = array(
218
+ 'user_role' => is_array( $user->roles ) ? implode( ',', $user->roles ) : $user->roles,
219
+ 'date_created' => $user->data->user_registered,
220
+ 'date_created_gmt' => get_gmt_from_date( $user->data->user_registered ),
221
+ );
222
 
223
+ $user_row = array_merge( $user_id_row, $user_extra_row );
224
  $user_row = array_merge( $user_row, $user_default_row );
225
 
226
  /**
227
  * Reorder rows according to the values in column.
228
+ *
229
  * @see https://stackoverflow.com/a/44774818/9520912
230
  */
231
+ $user_row = array_merge( array_fill_keys( array_keys( $this->generate_columns( $form_id ) ), '' ), $user_row );
232
 
233
  $rows[] = $user_row;
234
+ }
235
 
236
  return apply_filters( 'user_registration_csv_export_rows', $rows, $users );
237
  }
includes/admin/class-ur-admin-form-modal.php CHANGED
@@ -11,7 +11,7 @@
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
14
- exit;
15
  }
16
 
17
  if ( ! class_exists( 'UR_Admin_Form_Modal', false ) ) :
@@ -23,7 +23,7 @@ if ( ! class_exists( 'UR_Admin_Form_Modal', false ) ) :
23
  */
24
  public function __construct() {
25
 
26
- add_action( 'media_buttons', array( $this, 'media_button' ), 15 );
27
  }
28
 
29
  /**
@@ -40,11 +40,11 @@ if ( ! class_exists( 'UR_Admin_Form_Modal', false ) ) :
40
  }
41
 
42
  // Setup the icon - currently using a dashicon
43
-
44
- $icon = '<span class="dashicons dashicons-list-view" style="line-height:25px; font-size:16px"></span>';
45
  $login_icon = '<span class="dashicons dashicons-migrate" style="line-height:25px; font-size:16px"></span>';
46
 
47
- printf( '<a href="#" class="button ur-insert-form-button" data-editor="%s" title="%s">%s %s</a>',
 
48
  esc_attr( $editor_id ),
49
  esc_attr__( 'Add User Registration Form', 'user-registration' ),
50
  $icon,
@@ -56,8 +56,8 @@ if ( ! class_exists( 'UR_Admin_Form_Modal', false ) ) :
56
 
57
  function shortcode_modal() {
58
 
59
- ?>
60
- <div id="ur-modal-backdrop" style="display: none"></div>
61
  <div id="ur-modal-wrap" style="display: none">
62
  <form id="ur-modal" tabindex="-1">
63
  <div id="ur-modal-title">
@@ -66,20 +66,20 @@ if ( ! class_exists( 'UR_Admin_Form_Modal', false ) ) :
66
  </div>
67
  <div id="ur-modal-inner">
68
  <div id="ur-modal-options">
69
- <?php
70
  $forms = ur_get_all_user_registration_form();
71
-
72
- if ( !empty( $forms ) ) {
73
  printf( '<p><label for="ur-modal-select-form">%s</label></p>', __( 'Select a form below to insert', 'user-registration' ) );
74
  echo '<select id="ur-modal-select-form">';
75
- foreach ( $forms as $form => $form_value) {
76
  printf( '<option value="%d">%s</option>', $form, esc_html( $form_value ) );
77
  }
78
  echo '</select>';
79
-
80
  } else {
81
  echo '<p>';
82
- __(printf( 'Whoops, you haven\'t created a form yet.'),'user-registration');
83
  echo '</p>';
84
  }
85
  ?>
@@ -97,7 +97,7 @@ if ( ! class_exists( 'UR_Admin_Form_Modal', false ) ) :
97
  </div>
98
  </form>
99
  </div>
100
- <?php
101
  }
102
  }
103
 
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
  }
16
 
17
  if ( ! class_exists( 'UR_Admin_Form_Modal', false ) ) :
23
  */
24
  public function __construct() {
25
 
26
+ add_action( 'media_buttons', array( $this, 'media_button' ), 15 );
27
  }
28
 
29
  /**
40
  }
41
 
42
  // Setup the icon - currently using a dashicon
43
+ $icon = '<span class="dashicons dashicons-list-view" style="line-height:25px; font-size:16px"></span>';
 
44
  $login_icon = '<span class="dashicons dashicons-migrate" style="line-height:25px; font-size:16px"></span>';
45
 
46
+ printf(
47
+ '<a href="#" class="button ur-insert-form-button" data-editor="%s" title="%s">%s %s</a>',
48
  esc_attr( $editor_id ),
49
  esc_attr__( 'Add User Registration Form', 'user-registration' ),
50
  $icon,
56
 
57
  function shortcode_modal() {
58
 
59
+ ?>
60
+ <div id="ur-modal-backdrop" style="display: none"></div>
61
  <div id="ur-modal-wrap" style="display: none">
62
  <form id="ur-modal" tabindex="-1">
63
  <div id="ur-modal-title">
66
  </div>
67
  <div id="ur-modal-inner">
68
  <div id="ur-modal-options">
69
+ <?php
70
  $forms = ur_get_all_user_registration_form();
71
+
72
+ if ( ! empty( $forms ) ) {
73
  printf( '<p><label for="ur-modal-select-form">%s</label></p>', __( 'Select a form below to insert', 'user-registration' ) );
74
  echo '<select id="ur-modal-select-form">';
75
+ foreach ( $forms as $form => $form_value ) {
76
  printf( '<option value="%d">%s</option>', $form, esc_html( $form_value ) );
77
  }
78
  echo '</select>';
79
+
80
  } else {
81
  echo '<p>';
82
+ __( printf( 'Whoops, you haven\'t created a form yet.' ), 'user-registration' );
83
  echo '</p>';
84
  }
85
  ?>
97
  </div>
98
  </form>
99
  </div>
100
+ <?php
101
  }
102
  }
103
 
includes/admin/class-ur-admin-menus.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
@@ -60,8 +60,8 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
60
  $this->empty_trash();
61
  }
62
 
63
- $action = isset( $_GET['action'] ) ? sanitize_text_field( $_GET['action'] ) : '';
64
- $nonce = isset( $_GET['nonce'] ) ? sanitize_text_field( $_GET['nonce'] ) : '';
65
  $form_id = isset( $_GET['form'] ) && is_numeric( $_GET['form'] ) ? $_GET['form'] : '';
66
 
67
  if ( ! empty( $action ) && ! empty( $nonce ) && ! empty( $form_id ) ) {
@@ -152,7 +152,7 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
152
  'post_title' => __( 'Copy of ', 'user-registration' ) . $post->post_title,
153
  'post_type' => $post->post_type,
154
  'to_ping' => $post->to_ping,
155
- 'menu_order' => $post->menu_order
156
  );
157
 
158
  /*
@@ -176,7 +176,7 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
176
  $meta_value = addslashes( $meta_info->meta_value );
177
  $sql_query_sel[] = "SELECT $new_post_id, '$meta_key', '$meta_value'";
178
  }
179
- $sql_query .= implode( " UNION ALL ", $sql_query_sel );
180
  $wpdb->query( $sql_query );
181
  }
182
 
@@ -196,7 +196,7 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
196
  $meta_value = addslashes( $meta_info->meta_value );
197
  $sql_query_sel[] = "SELECT $new_post_id, '$meta_key', '$meta_value'";
198
  }
199
- $sql_query .= implode( " UNION ALL ", $sql_query_sel );
200
  $wpdb->query( $sql_query );
201
  }
202
 
@@ -219,16 +219,16 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
219
  $registrations = array_map( 'absint', (array) $_REQUEST['registration'] );
220
 
221
  switch ( $_REQUEST['action'] ) {
222
- case 'trash' :
223
  $this->bulk_trash( $registrations );
224
  break;
225
- case 'untrash' :
226
  $this->bulk_untrash( $registrations );
227
  break;
228
- case 'delete' :
229
  $this->bulk_trash( $registrations, true );
230
  break;
231
- default :
232
  break;
233
  }
234
  }
@@ -245,13 +245,15 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
245
  wp_die( __( 'You do not have permissions to delete forms!', 'user-registration' ) );
246
  }
247
 
248
- $registration = get_posts( array(
249
- 'post_type' => 'user_registration',
250
- 'ignore_sticky_posts' => true,
251
- 'nopaging' => true,
252
- 'post_status' => 'trash',
253
- 'fields' => 'ids',
254
- ) );
 
 
255
 
256
  foreach ( $registration as $webhook_id ) {
257
  wp_delete_post( $webhook_id, true );
@@ -283,10 +285,13 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
283
  $registration_table_list = new UR_Admin_Registrations_Table_List();
284
 
285
  // Add screen option.
286
- add_screen_option( 'per_page', array(
287
- 'default' => 20,
288
- 'option' => 'user_registration_per_page',
289
- ) );
 
 
 
290
  }
291
  }
292
 
@@ -294,40 +299,68 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
294
  * Add settings menu item.
295
  */
296
  public function settings_menu() {
297
- add_submenu_page( 'user-registration', __( 'User Registration settings', 'user-registration' ), __( 'Settings', 'user-registration' ), 'manage_user_registration', 'user-registration-settings', array(
298
- $this,
299
- 'settings_page'
300
- ) );
 
 
 
 
 
 
 
301
  }
302
 
303
  /**
304
  * Add status menu item.
305
  */
306
  public function status_menu() {
307
- add_submenu_page( 'user-registration', __( 'User Registration Status', 'user-registration' ), __( 'Status', 'user-registration' ), 'manage_user_registration', 'user-registration-status', array(
308
- $this,
309
- 'status_page'
310
- ) );
 
 
 
 
 
 
 
311
  }
312
 
313
  /**
314
  * Add new registration menu items.
315
  */
316
  public function add_registration_menu() {
317
- add_submenu_page( 'user-registration', __( 'Add New', 'user-registration' ), __( 'Add New', 'user-registration' ), 'manage_user_registration', 'add-new-registration', array(
318
- $this,
319
- 'add_registration_page'
320
- ) );
 
 
 
 
 
 
 
321
  }
322
 
323
  /**
324
  * Addons menu item.
325
  */
326
  public function addons_menu() {
327
- add_submenu_page( 'user-registration', __( 'User Registration extensions', 'user-registration' ), __( 'Extensions', 'user-registration' ), 'manage_user_registration', 'user-registration-addons', array(
328
- $this,
329
- 'addons_page'
330
- ) );
 
 
 
 
 
 
 
331
  }
332
 
333
  /**
@@ -371,7 +404,7 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
371
  * Init the add registration page.
372
  */
373
  public function add_registration_page() {
374
- $post_id = isset( $_GET['edit-registration'] ) ? $_GET['edit-registration'] : 0;
375
  $args = array(
376
  'post_type' => 'user_registration',
377
  'post_status' => 'publish',
@@ -386,7 +419,7 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
386
  }
387
 
388
  // Forms view
389
- include_once( dirname( __FILE__ ) . '/views/html-admin-page-forms.php' );
390
  }
391
 
392
 
@@ -417,10 +450,17 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
417
  * Adapted from http://www.johnmorrisonline.com/how-to-add-a-fully-functional-custom-meta-box-to-wordpress-navigation-menus/.
418
  */
419
  public function add_nav_menu_meta_boxes() {
420
- add_meta_box( 'user_registration_endpoints_nav_link', __( 'User Registration endpoints', 'user-registration' ), array(
421
- $this,
422
- 'nav_menu_links'
423
- ), 'nav-menus', 'side', 'low' );
 
 
 
 
 
 
 
424
  }
425
 
426
  /**
@@ -451,19 +491,19 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
451
  <li>
452
  <label class="menu-item-title">
453
  <input type="checkbox" class="menu-item-checkbox"
454
- name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-object-id]"
455
- value="<?php echo esc_attr( $i ); ?>"/> <?php echo esc_html( $value ); ?>
456
  </label>
457
  <input type="hidden" class="menu-item-type"
458
- name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-type]" value="custom"/>
459
  <input type="hidden" class="menu-item-title"
460
- name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-title]"
461
- value="<?php echo esc_html( $value ); ?>"/>
462
  <input type="hidden" class="menu-item-url"
463
- name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-url]"
464
- value="<?php echo esc_url( ur_get_account_endpoint_url( $key ) ); ?>"/>
465
  <input type="hidden" class="menu-item-classes"
466
- name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-classes]"/>
467
  </li>
468
  <?php
469
  $i --;
@@ -478,8 +518,8 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
478
  </span>
479
  <span class="add-to-menu">
480
  <input type="submit" class="button-secondary submit-add-to-menu right"
481
- value="<?php esc_attr_e( 'Add to menu', 'user-registration' ); ?>"
482
- name="add-post-type-menu-item" id="submit-posttype-user-registration-endpoints">
483
  <span class="spinner"></span>
484
  </span>
485
  </p>
@@ -501,8 +541,7 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
501
  if ( json_last_error() != JSON_ERROR_NONE ) {
502
  throw new Exception( '' );
503
  }
504
- }
505
- catch ( Exception $e ) {
506
  $form_data_array = array();
507
  }
508
 
@@ -582,7 +621,7 @@ if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
582
 
583
  /* Backward Compat since 1.4.0 */
584
  $class_name_old = 'UR_' . ucwords( $single_field->field_key );
585
- if( class_exists( $class_name_old ) ) {
586
  echo $class_name_old::get_instance()->get_admin_template( $single_field );
587
  }
588
  /* Backward compat end */
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  if ( ! class_exists( 'UR_Admin_Menus', false ) ) :
60
  $this->empty_trash();
61
  }
62
 
63
+ $action = isset( $_GET['action'] ) ? sanitize_text_field( $_GET['action'] ) : '';
64
+ $nonce = isset( $_GET['nonce'] ) ? sanitize_text_field( $_GET['nonce'] ) : '';
65
  $form_id = isset( $_GET['form'] ) && is_numeric( $_GET['form'] ) ? $_GET['form'] : '';
66
 
67
  if ( ! empty( $action ) && ! empty( $nonce ) && ! empty( $form_id ) ) {
152
  'post_title' => __( 'Copy of ', 'user-registration' ) . $post->post_title,
153
  'post_type' => $post->post_type,
154
  'to_ping' => $post->to_ping,
155
+ 'menu_order' => $post->menu_order,
156
  );
157
 
158
  /*
176
  $meta_value = addslashes( $meta_info->meta_value );
177
  $sql_query_sel[] = "SELECT $new_post_id, '$meta_key', '$meta_value'";
178
  }
179
+ $sql_query .= implode( ' UNION ALL ', $sql_query_sel );
180
  $wpdb->query( $sql_query );
181
  }
182
 
196
  $meta_value = addslashes( $meta_info->meta_value );
197
  $sql_query_sel[] = "SELECT $new_post_id, '$meta_key', '$meta_value'";
198
  }
199
+ $sql_query .= implode( ' UNION ALL ', $sql_query_sel );
200
  $wpdb->query( $sql_query );
201
  }
202
 
219
  $registrations = array_map( 'absint', (array) $_REQUEST['registration'] );
220
 
221
  switch ( $_REQUEST['action'] ) {
222
+ case 'trash':
223
  $this->bulk_trash( $registrations );
224
  break;
225
+ case 'untrash':
226
  $this->bulk_untrash( $registrations );
227
  break;
228
+ case 'delete':
229
  $this->bulk_trash( $registrations, true );
230
  break;
231
+ default:
232
  break;
233
  }
234
  }
245
  wp_die( __( 'You do not have permissions to delete forms!', 'user-registration' ) );
246
  }
247
 
248
+ $registration = get_posts(
249
+ array(
250
+ 'post_type' => 'user_registration',
251
+ 'ignore_sticky_posts' => true,
252
+ 'nopaging' => true,
253
+ 'post_status' => 'trash',
254
+ 'fields' => 'ids',
255
+ )
256
+ );
257
 
258
  foreach ( $registration as $webhook_id ) {
259
  wp_delete_post( $webhook_id, true );
285
  $registration_table_list = new UR_Admin_Registrations_Table_List();
286
 
287
  // Add screen option.
288
+ add_screen_option(
289
+ 'per_page',
290
+ array(
291
+ 'default' => 20,
292
+ 'option' => 'user_registration_per_page',
293
+ )
294
+ );
295
  }
296
  }
297
 
299
  * Add settings menu item.
300
  */
301
  public function settings_menu() {
302
+ add_submenu_page(
303
+ 'user-registration',
304
+ __( 'User Registration settings', 'user-registration' ),
305
+ __( 'Settings', 'user-registration' ),
306
+ 'manage_user_registration',
307
+ 'user-registration-settings',
308
+ array(
309
+ $this,
310
+ 'settings_page',
311
+ )
312
+ );
313
  }
314
 
315
  /**
316
  * Add status menu item.
317
  */
318
  public function status_menu() {
319
+ add_submenu_page(
320
+ 'user-registration',
321
+ __( 'User Registration Status', 'user-registration' ),
322
+ __( 'Status', 'user-registration' ),
323
+ 'manage_user_registration',
324
+ 'user-registration-status',
325
+ array(
326
+ $this,
327
+ 'status_page',
328
+ )
329
+ );
330
  }
331
 
332
  /**
333
  * Add new registration menu items.
334
  */
335
  public function add_registration_menu() {
336
+ add_submenu_page(
337
+ 'user-registration',
338
+ __( 'Add New', 'user-registration' ),
339
+ __( 'Add New', 'user-registration' ),
340
+ 'manage_user_registration',
341
+ 'add-new-registration',
342
+ array(
343
+ $this,
344
+ 'add_registration_page',
345
+ )
346
+ );
347
  }
348
 
349
  /**
350
  * Addons menu item.
351
  */
352
  public function addons_menu() {
353
+ add_submenu_page(
354
+ 'user-registration',
355
+ __( 'User Registration extensions', 'user-registration' ),
356
+ __( 'Extensions', 'user-registration' ),
357
+ 'manage_user_registration',
358
+ 'user-registration-addons',
359
+ array(
360
+ $this,
361
+ 'addons_page',
362
+ )
363
+ );
364
  }
365
 
366
  /**
404
  * Init the add registration page.
405
  */
406
  public function add_registration_page() {
407
+ $post_id = isset( $_GET['edit-registration'] ) ? absint( $_GET['edit-registration'] ) : 0;
408
  $args = array(
409
  'post_type' => 'user_registration',
410
  'post_status' => 'publish',
419
  }
420
 
421
  // Forms view
422
+ include_once dirname( __FILE__ ) . '/views/html-admin-page-forms.php';
423
  }
424
 
425
 
450
  * Adapted from http://www.johnmorrisonline.com/how-to-add-a-fully-functional-custom-meta-box-to-wordpress-navigation-menus/.
451
  */
452
  public function add_nav_menu_meta_boxes() {
453
+ add_meta_box(
454
+ 'user_registration_endpoints_nav_link',
455
+ __( 'User Registration endpoints', 'user-registration' ),
456
+ array(
457
+ $this,
458
+ 'nav_menu_links',
459
+ ),
460
+ 'nav-menus',
461
+ 'side',
462
+ 'low'
463
+ );
464
  }
465
 
466
  /**
491
  <li>
492
  <label class="menu-item-title">
493
  <input type="checkbox" class="menu-item-checkbox"
494
+ name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-object-id]"
495
+ value="<?php echo esc_attr( $i ); ?>"/> <?php echo esc_html( $value ); ?>
496
  </label>
497
  <input type="hidden" class="menu-item-type"
498
+ name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-type]" value="custom"/>
499
  <input type="hidden" class="menu-item-title"
500
+ name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-title]"
501
+ value="<?php echo esc_html( $value ); ?>"/>
502
  <input type="hidden" class="menu-item-url"
503
+ name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-url]"
504
+ value="<?php echo esc_url( ur_get_account_endpoint_url( $key ) ); ?>"/>
505
  <input type="hidden" class="menu-item-classes"
506
+ name="menu-item[<?php echo esc_attr( $i ); ?>][menu-item-classes]"/>
507
  </li>
508
  <?php
509
  $i --;
518
  </span>
519
  <span class="add-to-menu">
520
  <input type="submit" class="button-secondary submit-add-to-menu right"
521
+ value="<?php esc_attr_e( 'Add to menu', 'user-registration' ); ?>"
522
+ name="add-post-type-menu-item" id="submit-posttype-user-registration-endpoints">
523
  <span class="spinner"></span>
524
  </span>
525
  </p>
541
  if ( json_last_error() != JSON_ERROR_NONE ) {
542
  throw new Exception( '' );
543
  }
544
+ } catch ( Exception $e ) {
 
545
  $form_data_array = array();
546
  }
547
 
621
 
622
  /* Backward Compat since 1.4.0 */
623
  $class_name_old = 'UR_' . ucwords( $single_field->field_key );
624
+ if ( class_exists( $class_name_old ) ) {
625
  echo $class_name_old::get_instance()->get_admin_template( $single_field );
626
  }
627
  /* Backward compat end */
includes/admin/class-ur-admin-notices.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  /**
@@ -166,7 +166,7 @@ class UR_Admin_Notices {
166
  return;
167
  }
168
 
169
- foreach ( array( 'user_admin_notices', 'admin_notices', 'all_admin_notices' ) as $wp_notice ) {
170
  if ( ! empty( $wp_filter[ $wp_notice ]->callbacks ) && is_array( $wp_filter[ $wp_notice ]->callbacks ) ) {
171
  foreach ( $wp_filter[ $wp_notice ]->callbacks as $priority => $hooks ) {
172
  foreach ( $hooks as $name => $arr ) {
@@ -200,7 +200,7 @@ class UR_Admin_Notices {
200
  $notice_html = get_option( 'user_registration_admin_notice_' . $notice );
201
 
202
  if ( $notice_html ) {
203
- include( 'views/html-notice-custom.php' );
204
  }
205
  }
206
  }
@@ -216,12 +216,12 @@ class UR_Admin_Notices {
216
  $updater = new UR_Background_Updater();
217
 
218
  if ( $updater->is_updating() || ! empty( $_GET['do_update_user_registration'] ) ) {
219
- include( 'views/html-notice-updating.php' );
220
  } else {
221
- include( 'views/html-notice-update.php' );
222
  }
223
  } else {
224
- include( 'views/html-notice-updated.php' );
225
  }
226
  }
227
 
@@ -229,7 +229,7 @@ class UR_Admin_Notices {
229
  * If we have just installed, show a message with the install pages button.
230
  */
231
  public static function install_notice() {
232
- include( 'views/html-notice-install.php' );
233
  }
234
 
235
  /**
@@ -239,7 +239,7 @@ class UR_Admin_Notices {
239
  $users_can_register = apply_filters( 'ur_register_setting_override', get_option( 'users_can_register' ) );
240
 
241
  if ( ! $users_can_register && is_admin() && ! defined( 'DOING_AJAX' ) ) {
242
- include( 'views/html-notice-registration.php' );
243
  } else {
244
  self::remove_notice( 'register' );
245
  }
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  /**
166
  return;
167
  }
168
 
169
+ foreach ( array( 'user_admin_notices', 'admin_notices', 'all_admin_notices' ) as $wp_notice ) {
170
  if ( ! empty( $wp_filter[ $wp_notice ]->callbacks ) && is_array( $wp_filter[ $wp_notice ]->callbacks ) ) {
171
  foreach ( $wp_filter[ $wp_notice ]->callbacks as $priority => $hooks ) {
172
  foreach ( $hooks as $name => $arr ) {
200
  $notice_html = get_option( 'user_registration_admin_notice_' . $notice );
201
 
202
  if ( $notice_html ) {
203
+ include 'views/html-notice-custom.php';
204
  }
205
  }
206
  }
216
  $updater = new UR_Background_Updater();
217
 
218
  if ( $updater->is_updating() || ! empty( $_GET['do_update_user_registration'] ) ) {
219
+ include 'views/html-notice-updating.php';
220
  } else {
221
+ include 'views/html-notice-update.php';
222
  }
223
  } else {
224
+ include 'views/html-notice-updated.php';
225
  }
226
  }
227
 
229
  * If we have just installed, show a message with the install pages button.
230
  */
231
  public static function install_notice() {
232
+ include 'views/html-notice-install.php';
233
  }
234
 
235
  /**
239
  $users_can_register = apply_filters( 'ur_register_setting_override', get_option( 'users_can_register' ) );
240
 
241
  if ( ! $users_can_register && is_admin() && ! defined( 'DOING_AJAX' ) ) {
242
+ include 'views/html-notice-registration.php';
243
  } else {
244
  self::remove_notice( 'register' );
245
  }
includes/admin/class-ur-admin-profile.php CHANGED
@@ -9,7 +9,7 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit; // Exit if accessed directly
13
  }
14
 
15
  if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
@@ -36,23 +36,27 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
36
 
37
  /**
38
  * Get User extra fields from usermeta and integrate with form
 
39
  * @param $user_id
40
  * @return array Fields to display which are filtered through user_registration_profile_meta_fields before being returned
41
  */
42
  public function get_user_meta_by_form_fields( $user_id ) {
43
 
44
- $show_fields = array();
45
- $form_id = $this->get_user_meta( $user_id, 'ur_form_id' );
46
  $all_meta_for_user = $this->get_user_meta_by_prefix( $user_id, 'user_registration_' );
47
- $form_fields = $this->get_form_fields( $all_meta_for_user, $form_id );
48
 
49
  if ( ! empty( $form_fields ) ) {
50
- $show_fields = apply_filters( 'user_registration_profile_meta_fields', array(
51
- 'user_registration' => array(
52
- 'title' => sprintf( __( 'User Extra Information %s', 'user-registration' ), '' ),
53
- 'fields' => $form_fields,
54
- ),
55
- ) );
 
 
 
56
  }
57
  return $show_fields;
58
  }
@@ -82,20 +86,20 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
82
  <h2><?php echo $fieldset['title']; ?></h2>
83
  <table class="form-table" id="<?php echo esc_attr( 'fieldset-' . $fieldset_key ); ?>">
84
  <?php
85
- $profile_field_type = array(
86
  'select',
87
  'country',
88
  'checkbox',
89
  'button',
90
  'textarea',
91
- 'radio'
92
  );
93
  foreach ( $fieldset['fields'] as $key => $field ) :
94
 
95
- $field['label'] = isset( $field['label'] ) ? $field['label'] : '';
96
  $field['description'] = isset( $field['description'] ) ? $field['description'] : '';
97
  $attributes = isset( $field['attributes'] ) ? $field['attributes'] : array();
98
- $attribute_string = '';
99
 
100
  foreach ( $attributes as $name => $value ) {
101
  if ( is_bool( $value ) ) {
@@ -108,7 +112,7 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
108
  }
109
 
110
  $field_label = $field['label'];
111
- $field_type = isset( $field['type'] ) ? $field['type'] : '';
112
 
113
  if ( ! in_array( $field_type, $profile_field_type ) ) {
114
  $extra_params_key = str_replace( 'user_registration_', 'ur_', $key ) . '_params';
@@ -126,38 +130,40 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
126
  <td>
127
  <?php if ( ! empty( $field['type'] ) && 'select' === $field['type'] ) : ?>
128
  <select name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>"
129
- class="<?php echo esc_attr( $field['class'] ); ?>" style="width: 25em;">
130
  <option><?php echo __( 'Select', 'user-registration' ); ?></option>
131
  <?php
132
  $selected = esc_attr( get_user_meta( $user->ID, $key, true ) );
133
- foreach ( $field['options'] as $option_key => $option_value ) : ?>
134
- <option value="<?php echo esc_attr( trim ( $option_key ) ); ?>" <?php selected( $selected, trim( $option_key ), true ); ?>><?php echo esc_attr( trim ( $option_value ) ); ?></option>
 
135
  <?php endforeach; ?>
136
  </select>
137
 
138
  <?php elseif ( ! empty( $field['type'] ) && 'country' === $field['type'] ) : ?>
139
  <select name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>"
140
- class="<?php echo esc_attr( $field['class'] ); ?>" style="width: 25em;">
141
  <option><?php echo __( 'Select', 'user-registration' ); ?></option>
142
  <?php
143
  $selected = esc_attr( get_user_meta( $user->ID, $key, true ) );
144
- foreach ( $field['options'] as $option_key => $option_value ) : ?>
 
145
  <option
146
- value="<?php echo esc_attr( trim ( $option_key ) ); ?>" <?php selected( $selected, $option_key, true ); ?>><?php echo esc_attr( trim ( $option_value ) ); ?></option>
147
  <?php endforeach; ?>
148
  </select>
149
 
150
  <?php elseif ( ! empty( $field['type'] ) && 'radio' === $field['type'] ) : ?>
151
  <?php
152
  $db_value = get_user_meta( $user->ID, $key, true );
153
- if( is_array( $field['options'] ) ) {
154
- foreach( $field['options'] as $option_key => $option_value ) {
155
  ?>
156
  <label><input type="radio"
157
- name="<?php echo esc_attr( $key ); ?>"
158
- id="<?php echo esc_attr( $key ); ?>"
159
- value="<?php echo esc_attr( trim ( $option_key ) ); ?>"
160
- class="<?php echo esc_attr( $field['class'] ); ?>" <?php checked( $db_value, trim( $option_value ), true ); ?> ><?php echo trim ( $option_value ); ?>
161
  </label><br/>
162
  <?php
163
  }
@@ -171,58 +177,68 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
171
 
172
  if ( is_array( $field['choices'] ) && array_filter( $field['choices'] ) ) {
173
  foreach ( $field['choices'] as $choice ) {
174
- ?><label><input type="checkbox"
175
- name="<?php echo esc_attr( $key ); ?>[]"
176
- id="<?php echo esc_attr( $key ); ?>"
177
- value="<?php echo esc_attr( trim( $choice ) ); ?>"
178
- class="<?php echo esc_attr( $field['class'] ); ?>" <?php if (is_array( $value ) && in_array( trim( $choice ), $value ) ) {
179
- echo 'checked="checked"';
180
- }elseif( $value == $choice ) {
181
- echo 'checked="checked"';
182
- } ?> ><?php echo trim( $choice ); ?></label><br/>
 
 
 
 
 
183
  <?php
184
  }
185
  } else {
186
  ?>
187
  <input type="checkbox" name="<?php echo esc_attr( $key ); ?>"
188
- id="<?php echo esc_attr( $key ); ?>" value="1"
189
- class="<?php echo esc_attr( $field['class'] ); ?>" <?php if ( $value == '1' ) {
190
- echo 'checked="checked"';
191
- } ?> >
 
 
 
 
192
  <?php
193
  }
194
- ?>
195
  <?php elseif ( ! empty( $field['type'] ) && 'button' === $field['type'] ) : ?>
196
  <button id="<?php echo esc_attr( $key ); ?>"
197
- class="button <?php echo esc_attr( $field['class'] ); ?>"><?php echo esc_html( $field['text'] ); ?></button>
198
  <?php elseif ( ! empty( $field['type'] ) && 'privacy_policy' === $field['type'] ) : ?>
199
  <input checked type="checkbox" disabled="disabled"/>
200
 
201
  <?php elseif ( ! empty( $field['type'] ) && 'textarea' === $field['type'] ) : ?>
202
  <textarea name="<?php echo esc_attr( $key ); ?>"
203
- id="<?php echo esc_attr( $key ); ?>"
204
 
205
- class="<?php echo( ! empty( $field['class'] ) ? esc_attr( $field['class'] ) : 'regular-text' ); ?>"
206
  <?php echo esc_attr( $attribute_string ); ?>
207
- rows="5"
208
- cols="30"><?php echo esc_attr( $this->get_user_meta( $user->ID, $key ) ); ?></textarea>
209
 
210
  <?php elseif ( ! empty( $field['type'] ) && 'date' === $field['type'] ) : ?>
211
  <input type="date" name="<?php echo esc_attr( $key ); ?>"
212
- id="<?php echo esc_attr( $key ); ?>"
213
- value="<?php echo esc_attr( $this->get_user_meta( $user->ID, $key ) ); ?>"
214
- class="<?php echo( ! empty( $field['class'] ) ? esc_attr( $field['class'] ) : 'regular-text' ); ?>"
215
  <?php echo esc_attr( $attribute_string ); ?>
216
  />
217
 
218
- <?php else :
 
219
 
220
  if ( ! empty( $field['type'] ) ) {
221
  $data = array(
222
- 'key' => $key,
223
- 'value' => $this->get_user_meta( $user->ID, $key ),
224
  'attribute_string' => $attribute_string,
225
- 'field' => $field
226
 
227
  );
228
  do_action( 'user_registration_profile_field_' . $field['type'], $data );
@@ -233,15 +249,16 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
233
  if ( empty( $extra_params ) ) {
234
  ?>
235
  <input type="text" name="<?php echo esc_attr( $key ); ?>"
236
- id="<?php echo esc_attr( $key ); ?>"
237
- value="<?php echo esc_attr( $this->get_user_meta( $user->ID, $key ) ); ?>"
238
- class="<?php echo( ! empty( $field['class'] ) ? esc_attr( $field['class'] ) : 'regular-text' ); ?>"
239
  <?php echo esc_attr( $attribute_string ); ?>
240
  />
241
 
242
- <?php }
243
-
244
- } endif; ?>
 
245
  <br/>
246
  </td>
247
  </tr>
@@ -277,12 +294,11 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
277
  if ( isset( $field['type'] ) && 'checkbox' === $field['type'] ) {
278
  if ( isset( $_POST[ $key ] ) ) {
279
  $value = $_POST[ $key ];
280
- if( is_array( $_POST[ $key ] ) ) {
281
  $value = array_map( 'sanitize_text_field', $value );
282
  }
283
  update_user_meta( $user_id, $key, $value );
284
- }
285
- else {
286
  update_user_meta( $user_id, $key, '' );
287
  }
288
  } elseif ( isset( $_POST[ $key ] ) ) {
@@ -294,6 +310,7 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
294
 
295
  /**
296
  * Get user meta for a given key, with fallbacks to core user info for pre-existing fields.
 
297
  * @param int $user_id User ID of the user being edited
298
  * @param string $key key for user meta field
299
  *
@@ -321,7 +338,7 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
321
  */
322
  protected function get_user_meta_by_prefix( $user_id, $key_prefix ) {
323
 
324
- $values = get_user_meta( $user_id );
325
  $return_values = array();
326
 
327
  if ( gettype( $values ) != 'array' ) {
@@ -351,21 +368,22 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
351
 
352
  /**
353
  * Get all the registration form fields
 
354
  * @param $all_meta_value
355
- * @param int $form_id
356
  */
357
  protected function get_form_fields( $all_meta_value, $form_id ) {
358
 
359
- $post_id = $form_id;
360
- $args = array(
361
  'post_type' => 'user_registration',
362
  'post_status' => 'publish',
363
  'post__in' => array( $post_id ),
364
  );
365
 
366
- $post_data = get_posts( $args );
367
- $post_content = isset( $post_data[0]->post_content ) ? $post_data[0]->post_content : '';
368
- $fields = array();
369
  $post_content_array = json_decode( $post_content );
370
 
371
  if ( gettype( $post_content_array ) != 'array' ) {
@@ -377,14 +395,14 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
377
  foreach ( $post_content_array as $post_content_row ) {
378
  foreach ( $post_content_row as $post_content_grid ) {
379
  foreach ( $post_content_grid as $field ) {
380
- $field_name = isset( $field->general_setting->field_name ) ? $field->general_setting->field_name : '';
381
- $field_label = isset( $field->general_setting->label ) ? $field->general_setting->label : '';
382
  $field_description = isset( $field->general_setting->description ) ? $field->general_setting->description : '';
383
- $field_key = isset( $field->field_key ) ? $field->field_key : '';
384
 
385
  if ( $field_label == '' && isset( $field->general_setting->field_name ) ) {
386
  $field_label_array = explode( '_', $field->general_setting->field_name );
387
- $field_label = join( ' ', array_map( 'ucwords', $field_label_array ) );
388
  }
389
  if ( $field_name != '' ) {
390
  $field_index = '';
@@ -397,7 +415,7 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
397
  );
398
 
399
  } elseif ( ! in_array( $field_name, ur_get_fields_without_prefix() ) ) {
400
- $field_index = 'user_registration_' . $field_name;
401
  $fields[ $field_index ] = array(
402
  'label' => $field_label,
403
  'description' => $field_description,
@@ -430,24 +448,24 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
430
  break;
431
 
432
  case 'country':
433
- $country = ur_load_form_field_class( $field_key );
434
  $fields[ $field_index ]['options'] = $country::get_instance()->get_country();
435
- $fields[ $field_index ]['type'] = 'country';
436
- $fields[ $field_index ]['class'] = '';
437
  break;
438
 
439
  case 'textarea':
440
- $fields[ $field_index ]['type'] = 'textarea';
441
  $fields[ $field_index ]['class'] = '';
442
  break;
443
 
444
  case 'mailchimp':
445
  case 'checkbox':
446
- $choices_data = isset( $field->advance_setting->choices ) ? ( $field->advance_setting->choices ) : '';
447
- $choices_data = explode( ",", $choices_data );
448
- $fields[ $field_index ]['choices'] = $choices_data;
449
- $fields[ $field_index ]['type'] = 'checkbox';
450
- $fields[ $field_index ]['class'] = '';
451
  break;
452
 
453
  case 'date':
@@ -455,14 +473,14 @@ if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
455
  break;
456
 
457
  case 'privacy_policy':
458
- $fields[ $field_index ]['type'] = 'privacy_policy';
459
  break;
460
  }
461
  }// End switch().
462
  $filter_data = array(
463
  'fields' => $fields,
464
  'field' => $field,
465
- 'field_name' => $field_name
466
  );
467
  $filtered_data_array = apply_filters( 'user_registration_profile_field_filter_' . $field_key, $filter_data );
468
  if ( isset( $filtered_data_array['fields'] ) ) {
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  if ( ! class_exists( 'UR_Admin_Profile', false ) ) :
36
 
37
  /**
38
  * Get User extra fields from usermeta and integrate with form
39
+ *
40
  * @param $user_id
41
  * @return array Fields to display which are filtered through user_registration_profile_meta_fields before being returned
42
  */
43
  public function get_user_meta_by_form_fields( $user_id ) {
44
 
45
+ $show_fields = array();
46
+ $form_id = $this->get_user_meta( $user_id, 'ur_form_id' );
47
  $all_meta_for_user = $this->get_user_meta_by_prefix( $user_id, 'user_registration_' );
48
+ $form_fields = $this->get_form_fields( $all_meta_for_user, $form_id );
49
 
50
  if ( ! empty( $form_fields ) ) {
51
+ $show_fields = apply_filters(
52
+ 'user_registration_profile_meta_fields',
53
+ array(
54
+ 'user_registration' => array(
55
+ 'title' => sprintf( __( 'User Extra Information %s', 'user-registration' ), '' ),
56
+ 'fields' => $form_fields,
57
+ ),
58
+ )
59
+ );
60
  }
61
  return $show_fields;
62
  }
86
  <h2><?php echo $fieldset['title']; ?></h2>
87
  <table class="form-table" id="<?php echo esc_attr( 'fieldset-' . $fieldset_key ); ?>">
88
  <?php
89
+ $profile_field_type = array(
90
  'select',
91
  'country',
92
  'checkbox',
93
  'button',
94
  'textarea',
95
+ 'radio',
96
  );
97
  foreach ( $fieldset['fields'] as $key => $field ) :
98
 
99
+ $field['label'] = isset( $field['label'] ) ? $field['label'] : '';
100
  $field['description'] = isset( $field['description'] ) ? $field['description'] : '';
101
  $attributes = isset( $field['attributes'] ) ? $field['attributes'] : array();
102
+ $attribute_string = '';
103
 
104
  foreach ( $attributes as $name => $value ) {
105
  if ( is_bool( $value ) ) {
112
  }
113
 
114
  $field_label = $field['label'];
115
+ $field_type = isset( $field['type'] ) ? $field['type'] : '';
116
 
117
  if ( ! in_array( $field_type, $profile_field_type ) ) {
118
  $extra_params_key = str_replace( 'user_registration_', 'ur_', $key ) . '_params';
130
  <td>
131
  <?php if ( ! empty( $field['type'] ) && 'select' === $field['type'] ) : ?>
132
  <select name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>"
133
+ class="<?php echo esc_attr( $field['class'] ); ?>" style="width: 25em;">
134
  <option><?php echo __( 'Select', 'user-registration' ); ?></option>
135
  <?php
136
  $selected = esc_attr( get_user_meta( $user->ID, $key, true ) );
137
+ foreach ( $field['options'] as $option_key => $option_value ) :
138
+ ?>
139
+ <option value="<?php echo esc_attr( trim( $option_key ) ); ?>" <?php selected( $selected, trim( $option_key ), true ); ?>><?php echo esc_attr( trim( $option_value ) ); ?></option>
140
  <?php endforeach; ?>
141
  </select>
142
 
143
  <?php elseif ( ! empty( $field['type'] ) && 'country' === $field['type'] ) : ?>
144
  <select name="<?php echo esc_attr( $key ); ?>" id="<?php echo esc_attr( $key ); ?>"
145
+ class="<?php echo esc_attr( $field['class'] ); ?>" style="width: 25em;">
146
  <option><?php echo __( 'Select', 'user-registration' ); ?></option>
147
  <?php
148
  $selected = esc_attr( get_user_meta( $user->ID, $key, true ) );
149
+ foreach ( $field['options'] as $option_key => $option_value ) :
150
+ ?>
151
  <option
152
+ value="<?php echo esc_attr( trim( $option_key ) ); ?>" <?php selected( $selected, $option_key, true ); ?>><?php echo esc_attr( trim( $option_value ) ); ?></option>
153
  <?php endforeach; ?>
154
  </select>
155
 
156
  <?php elseif ( ! empty( $field['type'] ) && 'radio' === $field['type'] ) : ?>
157
  <?php
158
  $db_value = get_user_meta( $user->ID, $key, true );
159
+ if ( is_array( $field['options'] ) ) {
160
+ foreach ( $field['options'] as $option_key => $option_value ) {
161
  ?>
162
  <label><input type="radio"
163
+ name="<?php echo esc_attr( $key ); ?>"
164
+ id="<?php echo esc_attr( $key ); ?>"
165
+ value="<?php echo esc_attr( trim( $option_key ) ); ?>"
166
+ class="<?php echo esc_attr( $field['class'] ); ?>" <?php checked( $db_value, trim( $option_value ), true ); ?> ><?php echo trim( $option_value ); ?>
167
  </label><br/>
168
  <?php
169
  }
177
 
178
  if ( is_array( $field['choices'] ) && array_filter( $field['choices'] ) ) {
179
  foreach ( $field['choices'] as $choice ) {
180
+ ?>
181
+ <label><input type="checkbox"
182
+ name="<?php echo esc_attr( $key ); ?>[]"
183
+ id="<?php echo esc_attr( $key ); ?>"
184
+ value="<?php echo esc_attr( trim( $choice ) ); ?>"
185
+ class="<?php echo esc_attr( $field['class'] ); ?>"
186
+ <?php
187
+ if ( is_array( $value ) && in_array( trim( $choice ), $value ) ) {
188
+ echo 'checked="checked"';
189
+ } elseif ( $value == $choice ) {
190
+ echo 'checked="checked"';
191
+ }
192
+ ?>
193
+ ><?php echo trim( $choice ); ?></label><br/>
194
  <?php
195
  }
196
  } else {
197
  ?>
198
  <input type="checkbox" name="<?php echo esc_attr( $key ); ?>"
199
+ id="<?php echo esc_attr( $key ); ?>" value="1"
200
+ class="<?php echo esc_attr( $field['class'] ); ?>"
201
+ <?php
202
+ if ( $value == '1' ) {
203
+ echo 'checked="checked"';
204
+ }
205
+ ?>
206
+ >
207
  <?php
208
  }
209
+ ?>
210
  <?php elseif ( ! empty( $field['type'] ) && 'button' === $field['type'] ) : ?>
211
  <button id="<?php echo esc_attr( $key ); ?>"
212
+ class="button <?php echo esc_attr( $field['class'] ); ?>"><?php echo esc_html( $field['text'] ); ?></button>
213
  <?php elseif ( ! empty( $field['type'] ) && 'privacy_policy' === $field['type'] ) : ?>
214
  <input checked type="checkbox" disabled="disabled"/>
215
 
216
  <?php elseif ( ! empty( $field['type'] ) && 'textarea' === $field['type'] ) : ?>
217
  <textarea name="<?php echo esc_attr( $key ); ?>"
218
+ id="<?php echo esc_attr( $key ); ?>"
219
 
220
+ class="<?php echo( ! empty( $field['class'] ) ? esc_attr( $field['class'] ) : 'regular-text' ); ?>"
221
  <?php echo esc_attr( $attribute_string ); ?>
222
+ rows="5"
223
+ cols="30"><?php echo esc_attr( $this->get_user_meta( $user->ID, $key ) ); ?></textarea>
224
 
225
  <?php elseif ( ! empty( $field['type'] ) && 'date' === $field['type'] ) : ?>
226
  <input type="date" name="<?php echo esc_attr( $key ); ?>"
227
+ id="<?php echo esc_attr( $key ); ?>"
228
+ value="<?php echo esc_attr( $this->get_user_meta( $user->ID, $key ) ); ?>"
229
+ class="<?php echo( ! empty( $field['class'] ) ? esc_attr( $field['class'] ) : 'regular-text' ); ?>"
230
  <?php echo esc_attr( $attribute_string ); ?>
231
  />
232
 
233
+ <?php
234
+ else :
235
 
236
  if ( ! empty( $field['type'] ) ) {
237
  $data = array(
238
+ 'key' => $key,
239
+ 'value' => $this->get_user_meta( $user->ID, $key ),
240
  'attribute_string' => $attribute_string,
241
+ 'field' => $field,
242
 
243
  );
244
  do_action( 'user_registration_profile_field_' . $field['type'], $data );
249
  if ( empty( $extra_params ) ) {
250
  ?>
251
  <input type="text" name="<?php echo esc_attr( $key ); ?>"
252
+ id="<?php echo esc_attr( $key ); ?>"
253
+ value="<?php echo esc_attr( $this->get_user_meta( $user->ID, $key ) ); ?>"
254
+ class="<?php echo( ! empty( $field['class'] ) ? esc_attr( $field['class'] ) : 'regular-text' ); ?>"
255
  <?php echo esc_attr( $attribute_string ); ?>
256
  />
257
 
258
+ <?php
259
+ }
260
+ } endif;
261
+ ?>
262
  <br/>
263
  </td>
264
  </tr>
294
  if ( isset( $field['type'] ) && 'checkbox' === $field['type'] ) {
295
  if ( isset( $_POST[ $key ] ) ) {
296
  $value = $_POST[ $key ];
297
+ if ( is_array( $_POST[ $key ] ) ) {
298
  $value = array_map( 'sanitize_text_field', $value );
299
  }
300
  update_user_meta( $user_id, $key, $value );
301
+ } else {
 
302
  update_user_meta( $user_id, $key, '' );
303
  }
304
  } elseif ( isset( $_POST[ $key ] ) ) {
310
 
311
  /**
312
  * Get user meta for a given key, with fallbacks to core user info for pre-existing fields.
313
+ *
314
  * @param int $user_id User ID of the user being edited
315
  * @param string $key key for user meta field
316
  *
338
  */
339
  protected function get_user_meta_by_prefix( $user_id, $key_prefix ) {
340
 
341
+ $values = get_user_meta( $user_id );
342
  $return_values = array();
343
 
344
  if ( gettype( $values ) != 'array' ) {
368
 
369
  /**
370
  * Get all the registration form fields
371
+ *
372
  * @param $all_meta_value
373
+ * @param int $form_id
374
  */
375
  protected function get_form_fields( $all_meta_value, $form_id ) {
376
 
377
+ $post_id = $form_id;
378
+ $args = array(
379
  'post_type' => 'user_registration',
380
  'post_status' => 'publish',
381
  'post__in' => array( $post_id ),
382
  );
383
 
384
+ $post_data = get_posts( $args );
385
+ $post_content = isset( $post_data[0]->post_content ) ? $post_data[0]->post_content : '';
386
+ $fields = array();
387
  $post_content_array = json_decode( $post_content );
388
 
389
  if ( gettype( $post_content_array ) != 'array' ) {
395
  foreach ( $post_content_array as $post_content_row ) {
396
  foreach ( $post_content_row as $post_content_grid ) {
397
  foreach ( $post_content_grid as $field ) {
398
+ $field_name = isset( $field->general_setting->field_name ) ? $field->general_setting->field_name : '';
399
+ $field_label = isset( $field->general_setting->label ) ? $field->general_setting->label : '';
400
  $field_description = isset( $field->general_setting->description ) ? $field->general_setting->description : '';
401
+ $field_key = isset( $field->field_key ) ? $field->field_key : '';
402
 
403
  if ( $field_label == '' && isset( $field->general_setting->field_name ) ) {
404
  $field_label_array = explode( '_', $field->general_setting->field_name );
405
+ $field_label = join( ' ', array_map( 'ucwords', $field_label_array ) );
406
  }
407
  if ( $field_name != '' ) {
408
  $field_index = '';
415
  );
416
 
417
  } elseif ( ! in_array( $field_name, ur_get_fields_without_prefix() ) ) {
418
+ $field_index = 'user_registration_' . $field_name;
419
  $fields[ $field_index ] = array(
420
  'label' => $field_label,
421
  'description' => $field_description,
448
  break;
449
 
450
  case 'country':
451
+ $country = ur_load_form_field_class( $field_key );
452
  $fields[ $field_index ]['options'] = $country::get_instance()->get_country();
453
+ $fields[ $field_index ]['type'] = 'country';
454
+ $fields[ $field_index ]['class'] = '';
455
  break;
456
 
457
  case 'textarea':
458
+ $fields[ $field_index ]['type'] = 'textarea';
459
  $fields[ $field_index ]['class'] = '';
460
  break;
461
 
462
  case 'mailchimp':
463
  case 'checkbox':
464
+ $choices_data = isset( $field->advance_setting->choices ) ? ( $field->advance_setting->choices ) : '';
465
+ $choices_data = explode( ',', $choices_data );
466
+ $fields[ $field_index ]['choices'] = $choices_data;
467
+ $fields[ $field_index ]['type'] = 'checkbox';
468
+ $fields[ $field_index ]['class'] = '';
469
  break;
470
 
471
  case 'date':
473
  break;
474
 
475
  case 'privacy_policy':
476
+ $fields[ $field_index ]['type'] = 'privacy_policy';
477
  break;
478
  }
479
  }// End switch().
480
  $filter_data = array(
481
  'fields' => $fields,
482
  'field' => $field,
483
+ 'field_name' => $field_name,
484
  );
485
  $filtered_data_array = apply_filters( 'user_registration_profile_field_filter_' . $field_key, $filter_data );
486
  if ( isset( $filtered_data_array['fields'] ) ) {
includes/admin/class-ur-admin-registrations-table-list.php CHANGED
@@ -9,7 +9,7 @@
9
  defined( 'ABSPATH' ) || exit;
10
 
11
  if ( ! class_exists( 'WP_List_Table' ) ) {
12
- require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
13
  }
14
 
15
  /**
@@ -21,11 +21,13 @@ class UR_Admin_Registrations_Table_List extends WP_List_Table {
21
  * Initialize the registration table list.
22
  */
23
  public function __construct() {
24
- parent::__construct( array(
25
- 'singular' => 'registration',
26
- 'plural' => 'registrations',
27
- 'ajax' => false,
28
- ) );
 
 
29
  }
30
 
31
  /**
@@ -143,9 +145,14 @@ class UR_Admin_Registrations_Table_List extends WP_List_Table {
143
  $user_name = ! empty( $user->data->display_name ) ? $user->data->display_name : $user->data->user_login;
144
 
145
  if ( current_user_can( 'edit_user' ) ) {
146
- return '<a href="' . esc_url( add_query_arg( array(
147
- 'user_id' => $user->ID,
148
- ), admin_url( 'user-edit.php' ) ) ) . '">' . esc_html( $user_name ) . '</a>';
 
 
 
 
 
149
  }
150
 
151
  return esc_html( $user_name );
@@ -166,17 +173,22 @@ class UR_Admin_Registrations_Table_List extends WP_List_Table {
166
  return;
167
  }
168
 
169
- $t_time = mysql2date( __( 'Y/m/d g:i:s A', 'user-registration' ),
170
- $post->post_date, true );
 
 
 
171
  $m_time = $post->post_date;
172
  $time = mysql2date( 'G', $post->post_date )
173
- - get_option( 'gmt_offset' ) * 3600;
174
 
175
  $time_diff = time() - $time;
176
 
177
  if ( $time_diff > 0 && $time_diff < 24 * 60 * 60 ) {
178
  $h_time = sprintf(
179
- __( '%s ago', 'user-registration' ), human_time_diff( $time ) );
 
 
180
  } else {
181
  $h_time = mysql2date( __( 'Y/m/d', 'user-registration' ), $m_time );
182
  }
@@ -194,7 +206,7 @@ class UR_Admin_Registrations_Table_List extends WP_List_Table {
194
  */
195
  private function get_status_label( $status_name, $status ) {
196
  switch ( $status_name ) {
197
- case 'publish' :
198
  /* translators: %s: count */
199
  $label = array(
200
  'singular' => __( 'Published <span class="count">(%s)</span>', 'user-registration' ),
@@ -203,7 +215,7 @@ class UR_Admin_Registrations_Table_List extends WP_List_Table {
203
  'domain' => 'user-registration',
204
  );
205
  break;
206
- case 'draft' :
207
  /* translators: %s: count */
208
  $label = array(
209
  'singular' => __( 'Draft <span class="count">(%s)</span>', 'user-registration' ),
@@ -212,7 +224,7 @@ class UR_Admin_Registrations_Table_List extends WP_List_Table {
212
  'domain' => 'user-registration',
213
  );
214
  break;
215
- case 'pending' :
216
  /* translators: %s: count */
217
  $label = array(
218
  'singular' => __( 'Pending <span class="count">(%s)</span>', 'user-registration' ),
@@ -243,9 +255,11 @@ class UR_Admin_Registrations_Table_List extends WP_List_Table {
243
 
244
  // Subtract post types that are not included in the admin all list.
245
  foreach (
246
- get_post_stati( array(
247
- 'show_in_admin_all_list' => false,
248
- ) ) as $state
 
 
249
  ) {
250
  $total_posts -= $num_posts->$state;
251
  }
@@ -255,22 +269,28 @@ class UR_Admin_Registrations_Table_List extends WP_List_Table {
255
  $status_links['all'] = "<a href='admin.php?page=user-registration'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts', 'user-registration' ), number_format_i18n( $total_posts ) ) . '</a>';
256
 
257
  foreach (
258
- get_post_stati( array(
259
- 'show_in_admin_status_list' => true,
260
- ), 'objects' ) as $status
 
 
 
261
  ) {
262
  $class = '';
263
  $status_name = $status->name;
264
 
265
- if ( ! in_array( $status_name, array(
266
- 'publish',
267
- 'draft',
268
- 'pending',
269
- 'trash',
270
- 'future',
271
- 'private',
272
- 'auto-draft'
273
- ) )
 
 
 
274
  ) {
275
  continue;
276
  }
@@ -351,10 +371,12 @@ class UR_Admin_Registrations_Table_List extends WP_List_Table {
351
  $this->items = $registrations->posts;
352
 
353
  // Set the pagination
354
- $this->set_pagination_args( array(
355
- 'total_items' => $registrations->found_posts,
356
- 'per_page' => $per_page,
357
- 'total_pages' => $registrations->max_num_pages,
358
- ) );
 
 
359
  }
360
  }
9
  defined( 'ABSPATH' ) || exit;
10
 
11
  if ( ! class_exists( 'WP_List_Table' ) ) {
12
+ require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
13
  }
14
 
15
  /**
21
  * Initialize the registration table list.
22
  */
23
  public function __construct() {
24
+ parent::__construct(
25
+ array(
26
+ 'singular' => 'registration',
27
+ 'plural' => 'registrations',
28
+ 'ajax' => false,
29
+ )
30
+ );
31
  }
32
 
33
  /**
145
  $user_name = ! empty( $user->data->display_name ) ? $user->data->display_name : $user->data->user_login;
146
 
147
  if ( current_user_can( 'edit_user' ) ) {
148
+ return '<a href="' . esc_url(
149
+ add_query_arg(
150
+ array(
151
+ 'user_id' => $user->ID,
152
+ ),
153
+ admin_url( 'user-edit.php' )
154
+ )
155
+ ) . '">' . esc_html( $user_name ) . '</a>';
156
  }
157
 
158
  return esc_html( $user_name );
173
  return;
174
  }
175
 
176
+ $t_time = mysql2date(
177
+ __( 'Y/m/d g:i:s A', 'user-registration' ),
178
+ $post->post_date,
179
+ true
180
+ );
181
  $m_time = $post->post_date;
182
  $time = mysql2date( 'G', $post->post_date )
183
+ - get_option( 'gmt_offset' ) * 3600;
184
 
185
  $time_diff = time() - $time;
186
 
187
  if ( $time_diff > 0 && $time_diff < 24 * 60 * 60 ) {
188
  $h_time = sprintf(
189
+ __( '%s ago', 'user-registration' ),
190
+ human_time_diff( $time )
191
+ );
192
  } else {
193
  $h_time = mysql2date( __( 'Y/m/d', 'user-registration' ), $m_time );
194
  }
206
  */
207
  private function get_status_label( $status_name, $status ) {
208
  switch ( $status_name ) {
209
+ case 'publish':
210
  /* translators: %s: count */
211
  $label = array(
212
  'singular' => __( 'Published <span class="count">(%s)</span>', 'user-registration' ),
215
  'domain' => 'user-registration',
216
  );
217
  break;
218
+ case 'draft':
219
  /* translators: %s: count */
220
  $label = array(
221
  'singular' => __( 'Draft <span class="count">(%s)</span>', 'user-registration' ),
224
  'domain' => 'user-registration',
225
  );
226
  break;
227
+ case 'pending':
228
  /* translators: %s: count */
229
  $label = array(
230
  'singular' => __( 'Pending <span class="count">(%s)</span>', 'user-registration' ),
255
 
256
  // Subtract post types that are not included in the admin all list.
257
  foreach (
258
+ get_post_stati(
259
+ array(
260
+ 'show_in_admin_all_list' => false,
261
+ )
262
+ ) as $state
263
  ) {
264
  $total_posts -= $num_posts->$state;
265
  }
269
  $status_links['all'] = "<a href='admin.php?page=user-registration'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts', 'user-registration' ), number_format_i18n( $total_posts ) ) . '</a>';
270
 
271
  foreach (
272
+ get_post_stati(
273
+ array(
274
+ 'show_in_admin_status_list' => true,
275
+ ),
276
+ 'objects'
277
+ ) as $status
278
  ) {
279
  $class = '';
280
  $status_name = $status->name;
281
 
282
+ if ( ! in_array(
283
+ $status_name,
284
+ array(
285
+ 'publish',
286
+ 'draft',
287
+ 'pending',
288
+ 'trash',
289
+ 'future',
290
+ 'private',
291
+ 'auto-draft',
292
+ )
293
+ )
294
  ) {
295
  continue;
296
  }
371
  $this->items = $registrations->posts;
372
 
373
  // Set the pagination
374
+ $this->set_pagination_args(
375
+ array(
376
+ 'total_items' => $registrations->found_posts,
377
+ 'per_page' => $per_page,
378
+ 'total_pages' => $registrations->max_num_pages,
379
+ )
380
+ );
381
  }
382
  }
includes/admin/class-ur-admin-settings.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  /**
@@ -30,7 +30,7 @@ class UR_Admin_Settings {
30
  *
31
  * @var array
32
  */
33
- private static $errors = array();
34
 
35
  /**
36
  * Update messages.
@@ -47,11 +47,11 @@ class UR_Admin_Settings {
47
  if ( empty( self::$settings ) ) {
48
  $settings = array();
49
 
50
- include_once( dirname( __FILE__ ) . '/settings/class-ur-settings-page.php' );
51
 
52
- $settings[] = include( 'settings/class-ur-settings-general.php' );
53
- $settings[] = include( 'settings/class-ur-settings-integration.php' );
54
- $settings[] = include( 'settings/class-ur-settings-email.php' );
55
 
56
  self::$settings = apply_filters( 'user_registration_get_settings_pages', $settings );
57
  }
@@ -76,7 +76,7 @@ class UR_Admin_Settings {
76
 
77
  $flag = apply_filters( 'show_user_registration_setting_message', true );
78
 
79
- if( $flag ) {
80
  self::add_message( __( 'Your settings have been saved.', 'user-registration' ) );
81
  }
82
 
@@ -135,9 +135,13 @@ class UR_Admin_Settings {
135
 
136
  wp_enqueue_script( 'user-registration-settings', UR()->plugin_url() . '/assets/js/admin/settings' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris' ), UR_VERSION, true );
137
 
138
- wp_localize_script( 'user-registration-settings', 'user_registration_settings_params', array(
139
- 'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'user-registration' ),
140
- ) );
 
 
 
 
141
 
142
  // Include settings pages
143
  self::get_settings_pages();
@@ -148,7 +152,7 @@ class UR_Admin_Settings {
148
 
149
  $flag = apply_filters( 'user_registration_settings_save_action', true );
150
 
151
- if( $flag ) {
152
 
153
  // Save settings if data has been posted
154
  if ( ! empty( $_POST ) ) {
@@ -168,11 +172,11 @@ class UR_Admin_Settings {
168
  // Get tabs for the settings page
169
  $tabs = apply_filters( 'user_registration_settings_tabs_array', array() );
170
 
171
- if( $current_tab === 'general' && $current_section === 'export-users' ) {
172
  $GLOBALS['hide_save_button'] = true;
173
  }
174
 
175
- include( dirname( __FILE__ ) . '/views/html-admin-settings.php' );
176
  }
177
 
178
  /**
@@ -300,7 +304,7 @@ class UR_Admin_Settings {
300
  case 'text':
301
  case 'email':
302
  case 'number':
303
- case 'password' :
304
  case 'date':
305
  $option_value = self::get_option( $value['id'], $value['default'] );
306
 
@@ -309,7 +313,7 @@ class UR_Admin_Settings {
309
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
310
  <?php echo $tooltip_html; ?>
311
  </th>
312
- <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
313
  <input
314
  name="<?php echo esc_attr( $value['id'] ); ?>"
315
  id="<?php echo esc_attr( $value['id'] ); ?>"
@@ -321,19 +325,21 @@ class UR_Admin_Settings {
321
  <?php echo implode( ' ', $custom_attributes ); ?>
322
  /> <?php echo $description; ?>
323
  </td>
324
- </tr><?php
 
325
  break;
326
 
327
  // Color picker.
328
- case 'color' :
329
  $option_value = self::get_option( $value['id'], $value['default'] );
330
 
331
- ?><tr valign="top" class="<?php echo esc_attr( $value['row_class'] ); ?>">
 
332
  <th scope="row" class="titledesc">
333
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
334
  <?php echo $tooltip_html; ?>
335
  </th>
336
- <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">&lrm;
337
  <span class="colorpickpreview" style="background: <?php echo esc_attr( $option_value ); ?>"></span>
338
  <input
339
  name="<?php echo esc_attr( $value['id'] ); ?>"
@@ -348,20 +354,21 @@ class UR_Admin_Settings {
348
  />&lrm; <?php echo $description; ?>
349
  <div id="colorPickerDiv_<?php echo esc_attr( $value['id'] ); ?>" class="colorpickdiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div>
350
  </td>
351
- </tr><?php
 
352
  break;
353
 
354
  // Textarea
355
  case 'textarea':
356
-
357
  $option_value = self::get_option( $value['id'], $value['default'] );
358
 
359
- ?><tr valign="top" class="<?php echo esc_attr( $value['row_class'] ); ?>">
 
360
  <th scope="row" class="titledesc">
361
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
362
  <?php echo $tooltip_html; ?>
363
  </th>
364
- <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
365
  <?php echo $description; ?>
366
 
367
  <textarea
@@ -371,23 +378,24 @@ class UR_Admin_Settings {
371
  class="<?php echo esc_attr( $value['class'] ); ?>"
372
  placeholder="<?php echo esc_attr( $value['placeholder'] ); ?>"
373
  <?php echo implode( ' ', $custom_attributes ); ?>
374
- ><?php echo esc_textarea( $option_value ); ?></textarea>
375
  </td>
376
- </tr><?php
 
377
  break;
378
 
379
  // Select boxes
380
- case 'select' :
381
- case 'multiselect' :
382
-
383
  $option_value = self::get_option( $value['id'], $value['default'] );
384
 
385
- ?><tr valign="top" class="<?php echo esc_attr( $value['row_class'] ); ?>">
 
386
  <th scope="row" class="titledesc">
387
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
388
  <?php echo $tooltip_html; ?>
389
  </th>
390
- <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
391
  <select
392
  name="<?php echo esc_attr( $value['id'] ); ?><?php echo ( 'multiselect' === $value['type'] ) ? '[]' : ''; ?>"
393
  id="<?php echo esc_attr( $value['id'] ); ?>"
@@ -399,34 +407,37 @@ class UR_Admin_Settings {
399
  <?php
400
  foreach ( $value['options'] as $key => $val ) {
401
  ?>
402
- <option value="<?php echo esc_attr( $key ); ?>" <?php
 
403
 
404
- if ( is_array( $option_value ) ) {
405
- selected( in_array( $key, $option_value ), true );
406
- } else {
407
- selected( $option_value, $key );
408
- }
409
 
410
- ?>><?php echo $val ?></option>
 
411
  <?php
412
  }
413
  ?>
414
  </select> <?php echo $description; ?>
415
  </td>
416
- </tr><?php
 
417
  break;
418
 
419
  // Radio inputs
420
- case 'radio' :
421
-
422
  $option_value = self::get_option( $value['id'], $value['default'] );
423
 
424
- ?><tr valign="top" class="<?php echo esc_attr( $value['row_class'] ); ?>">
 
425
  <th scope="row" class="titledesc">
426
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
427
  <?php echo $tooltip_html; ?>
428
  </th>
429
- <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
430
  <fieldset>
431
  <?php echo $description; ?>
432
  <ul>
@@ -442,7 +453,7 @@ class UR_Admin_Settings {
442
  class="<?php echo esc_attr( $value['class'] ); ?>"
443
  <?php echo implode( ' ', $custom_attributes ); ?>
444
  <?php checked( $key, $option_value ); ?>
445
- /> <?php echo $val ?></label>
446
  </li>
447
  <?php
448
  }
@@ -450,12 +461,12 @@ class UR_Admin_Settings {
450
  </ul>
451
  </fieldset>
452
  </td>
453
- </tr><?php
 
454
  break;
455
 
456
  // Checkbox input
457
- case 'checkbox' :
458
-
459
  $option_value = self::get_option( $value['id'], $value['default'] );
460
  $visbility_class = array();
461
 
@@ -477,7 +488,12 @@ class UR_Admin_Settings {
477
 
478
  if ( ! isset( $value['checkboxgroup'] ) || 'start' == $value['checkboxgroup'] ) {
479
  ?>
480
- <tr valign="top" class="<?php echo esc_attr( implode( ' ', $visbility_class ) ); echo ' ' .esc_attr( $value['row_class'] ); ?>">
 
 
 
 
 
481
  <th scope="row" class="titledesc">
482
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
483
  <?php echo $tooltip_html; ?>
@@ -492,7 +508,7 @@ class UR_Admin_Settings {
492
  }
493
 
494
  ?>
495
- <label for="<?php echo $value['id'] ?>">
496
  <input
497
  name="<?php echo esc_attr( $value['id'] ); ?>"
498
  id="<?php echo esc_attr( $value['id'] ); ?>"
@@ -501,12 +517,12 @@ class UR_Admin_Settings {
501
  value="1"
502
  <?php checked( $option_value, 'yes' ); ?>
503
  <?php echo implode( ' ', $custom_attributes ); ?>
504
- /> <?php echo $description ?>
505
  </label>
506
  <?php
507
 
508
  if ( ! isset( $value['checkboxgroup'] ) || 'end' == $value['checkboxgroup'] ) {
509
- ?>
510
  </fieldset>
511
  </td>
512
  </tr>
@@ -519,8 +535,7 @@ class UR_Admin_Settings {
519
  break;
520
 
521
  // Single page selects
522
- case 'single_select_page' :
523
-
524
  $args = array(
525
  'name' => $value['id'],
526
  'id' => $value['id'],
@@ -536,44 +551,46 @@ class UR_Admin_Settings {
536
  $args = wp_parse_args( $value['args'], $args );
537
  }
538
 
539
-
540
- ?><tr valign="top" class="single_select_page <?php echo esc_attr( $value['row_class'] ); ?>" <?php echo isset($value['display']) && $value['display']==='none' ? 'style="display:none"':'' ?>>
541
- <th scope="row" class="titledesc"><?php echo esc_html( $value['title'] ) ?> <?php echo $tooltip_html; ?></th>
542
  <td class="forminp">
543
  <?php echo str_replace( ' id=', " data-placeholder='" . esc_attr__( 'Select a page&hellip;', 'user-registration' ) . "' style='" . $value['css'] . "' class='" . $value['class'] . "' id=", wp_dropdown_pages( $args ) ); ?> <?php echo $description; ?>
544
  </td>
545
- </tr><?php
 
546
  break;
547
 
548
  case 'tinymce':
549
-
550
  $settings = array(
551
- 'name' => esc_attr($value['id']),
552
- 'id' => esc_attr( $value['id'] ),
553
- 'style' => esc_attr( $value['css'] ),
554
- 'default' => esc_attr($value['default']),
555
- 'class'=> esc_attr( $value['class'] ),
556
- 'quicktags' => array( 'buttons' => 'em,strong,link' ),
557
- 'tinymce' => array(
558
  'theme_advanced_buttons1' => 'bold,italic,strikethrough,separator,bullist,numlist,separator,blockquote,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,undo,redo,separator',
559
  'theme_advanced_buttons2' => '',
560
  ),
561
- 'editor_css' => '<style>#wp-excerpt-editor-container .wp-editor-area{height:175px; width:100%;}</style>',
562
  );
563
 
564
  $option_value = self::get_option( $value['id'], $value['default'] );
565
 
566
- ?><tr valign="top" class="<?php echo esc_attr( $value['row_class'] ); ?>">
 
567
  <th scope="row" class="titledesc">
568
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
569
  <?php echo $tooltip_html; ?>
570
  </th>
571
- <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ) ?>">
572
  <?php echo $description; ?>
573
 
574
- <?php wp_editor($option_value, $value['id'], $settings);?>
575
  </td>
576
- </tr><?php
 
577
  break;
578
 
579
  // Default: run an action
@@ -603,7 +620,7 @@ class UR_Admin_Settings {
603
  $description = $value['desc'];
604
  $tooltip_html = $value['desc_tip'];
605
  } elseif ( ! empty( $value['desc'] ) ) {
606
- $description = $value['desc'];
607
  }
608
 
609
  if ( $description && in_array( $value['type'], array( 'textarea', 'radio' ) ) ) {
@@ -650,7 +667,7 @@ class UR_Admin_Settings {
650
  // Get posted value.
651
  if ( strstr( $option['id'], '[' ) ) {
652
  parse_str( $option['id'], $option_name_array );
653
- $option_name = current( array_keys( $option_name_array ) );
654
 
655
  $setting_name = key( $option_name_array[ $option_name ] );
656
  $raw_value = isset( $_POST[ $option_name ][ $setting_name ] ) ? wp_unslash( $_POST[ $option_name ][ $setting_name ] ) : null;
@@ -663,13 +680,13 @@ class UR_Admin_Settings {
663
  // Format the value based on option type.
664
  switch ( $option['type'] ) {
665
 
666
- case 'checkbox' :
667
  $value = '1' === $raw_value || 'yes' === $raw_value ? 'yes' : 'no';
668
  break;
669
- case 'textarea' :
670
  $value = wp_kses_post( trim( $raw_value ) );
671
  break;
672
- case 'multiselect' :
673
  $value = array_filter( array_map( 'ur_clean', (array) $raw_value ) );
674
  break;
675
  case 'select':
@@ -683,9 +700,9 @@ class UR_Admin_Settings {
683
  break;
684
  case 'tinymce':
685
  $value = wpautop( $raw_value );
686
- break;
687
 
688
- default :
689
  $value = ur_clean( $raw_value );
690
  break;
691
  }
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  /**
30
  *
31
  * @var array
32
  */
33
+ private static $errors = array();
34
 
35
  /**
36
  * Update messages.
47
  if ( empty( self::$settings ) ) {
48
  $settings = array();
49
 
50
+ include_once dirname( __FILE__ ) . '/settings/class-ur-settings-page.php';
51
 
52
+ $settings[] = include 'settings/class-ur-settings-general.php';
53
+ $settings[] = include 'settings/class-ur-settings-integration.php';
54
+ $settings[] = include 'settings/class-ur-settings-email.php';
55
 
56
  self::$settings = apply_filters( 'user_registration_get_settings_pages', $settings );
57
  }
76
 
77
  $flag = apply_filters( 'show_user_registration_setting_message', true );
78
 
79
+ if ( $flag ) {
80
  self::add_message( __( 'Your settings have been saved.', 'user-registration' ) );
81
  }
82
 
135
 
136
  wp_enqueue_script( 'user-registration-settings', UR()->plugin_url() . '/assets/js/admin/settings' . $suffix . '.js', array( 'jquery', 'jquery-ui-datepicker', 'jquery-ui-sortable', 'iris' ), UR_VERSION, true );
137
 
138
+ wp_localize_script(
139
+ 'user-registration-settings',
140
+ 'user_registration_settings_params',
141
+ array(
142
+ 'i18n_nav_warning' => __( 'The changes you made will be lost if you navigate away from this page.', 'user-registration' ),
143
+ )
144
+ );
145
 
146
  // Include settings pages
147
  self::get_settings_pages();
152
 
153
  $flag = apply_filters( 'user_registration_settings_save_action', true );
154
 
155
+ if ( $flag ) {
156
 
157
  // Save settings if data has been posted
158
  if ( ! empty( $_POST ) ) {
172
  // Get tabs for the settings page
173
  $tabs = apply_filters( 'user_registration_settings_tabs_array', array() );
174
 
175
+ if ( $current_tab === 'general' && $current_section === 'export-users' ) {
176
  $GLOBALS['hide_save_button'] = true;
177
  }
178
 
179
+ include dirname( __FILE__ ) . '/views/html-admin-settings.php';
180
  }
181
 
182
  /**
304
  case 'text':
305
  case 'email':
306
  case 'number':
307
+ case 'password':
308
  case 'date':
309
  $option_value = self::get_option( $value['id'], $value['default'] );
310
 
313
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
314
  <?php echo $tooltip_html; ?>
315
  </th>
316
+ <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ); ?>">
317
  <input
318
  name="<?php echo esc_attr( $value['id'] ); ?>"
319
  id="<?php echo esc_attr( $value['id'] ); ?>"
325
  <?php echo implode( ' ', $custom_attributes ); ?>
326
  /> <?php echo $description; ?>
327
  </td>
328
+ </tr>
329
+ <?php
330
  break;
331
 
332
  // Color picker.
333
+ case 'color':
334
  $option_value = self::get_option( $value['id'], $value['default'] );
335
 
336
+ ?>
337
+ <tr valign="top" class="<?php echo esc_attr( $value['row_class'] ); ?>">
338
  <th scope="row" class="titledesc">
339
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
340
  <?php echo $tooltip_html; ?>
341
  </th>
342
+ <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ); ?>">&lrm;
343
  <span class="colorpickpreview" style="background: <?php echo esc_attr( $option_value ); ?>"></span>
344
  <input
345
  name="<?php echo esc_attr( $value['id'] ); ?>"
354
  />&lrm; <?php echo $description; ?>
355
  <div id="colorPickerDiv_<?php echo esc_attr( $value['id'] ); ?>" class="colorpickdiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div>
356
  </td>
357
+ </tr>
358
+ <?php
359
  break;
360
 
361
  // Textarea
362
  case 'textarea':
 
363
  $option_value = self::get_option( $value['id'], $value['default'] );
364
 
365
+ ?>
366
+ <tr valign="top" class="<?php echo esc_attr( $value['row_class'] ); ?>">
367
  <th scope="row" class="titledesc">
368
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
369
  <?php echo $tooltip_html; ?>
370
  </th>
371
+ <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ); ?>">
372
  <?php echo $description; ?>
373
 
374
  <textarea
378
  class="<?php echo esc_attr( $value['class'] ); ?>"
379
  placeholder="<?php echo esc_attr( $value['placeholder'] ); ?>"
380
  <?php echo implode( ' ', $custom_attributes ); ?>
381
+ ><?php echo esc_textarea( $option_value ); ?></textarea>
382
  </td>
383
+ </tr>
384
+ <?php
385
  break;
386
 
387
  // Select boxes
388
+ case 'select':
389
+ case 'multiselect':
 
390
  $option_value = self::get_option( $value['id'], $value['default'] );
391
 
392
+ ?>
393
+ <tr valign="top" class="<?php echo esc_attr( $value['row_class'] ); ?>">
394
  <th scope="row" class="titledesc">
395
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
396
  <?php echo $tooltip_html; ?>
397
  </th>
398
+ <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ); ?>">
399
  <select
400
  name="<?php echo esc_attr( $value['id'] ); ?><?php echo ( 'multiselect' === $value['type'] ) ? '[]' : ''; ?>"
401
  id="<?php echo esc_attr( $value['id'] ); ?>"
407
  <?php
408
  foreach ( $value['options'] as $key => $val ) {
409
  ?>
410
+ <option value="<?php echo esc_attr( $key ); ?>"
411
+ <?php
412
 
413
+ if ( is_array( $option_value ) ) {
414
+ selected( in_array( $key, $option_value ), true );
415
+ } else {
416
+ selected( $option_value, $key );
417
+ }
418
 
419
+ ?>
420
+ ><?php echo $val; ?></option>
421
  <?php
422
  }
423
  ?>
424
  </select> <?php echo $description; ?>
425
  </td>
426
+ </tr>
427
+ <?php
428
  break;
429
 
430
  // Radio inputs
431
+ case 'radio':
 
432
  $option_value = self::get_option( $value['id'], $value['default'] );
433
 
434
+ ?>
435
+ <tr valign="top" class="<?php echo esc_attr( $value['row_class'] ); ?>">
436
  <th scope="row" class="titledesc">
437
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
438
  <?php echo $tooltip_html; ?>
439
  </th>
440
+ <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ); ?>">
441
  <fieldset>
442
  <?php echo $description; ?>
443
  <ul>
453
  class="<?php echo esc_attr( $value['class'] ); ?>"
454
  <?php echo implode( ' ', $custom_attributes ); ?>
455
  <?php checked( $key, $option_value ); ?>
456
+ /> <?php echo $val; ?></label>
457
  </li>
458
  <?php
459
  }
461
  </ul>
462
  </fieldset>
463
  </td>
464
+ </tr>
465
+ <?php
466
  break;
467
 
468
  // Checkbox input
469
+ case 'checkbox':
 
470
  $option_value = self::get_option( $value['id'], $value['default'] );
471
  $visbility_class = array();
472
 
488
 
489
  if ( ! isset( $value['checkboxgroup'] ) || 'start' == $value['checkboxgroup'] ) {
490
  ?>
491
+ <tr valign="top" class="
492
+ <?php
493
+ echo esc_attr( implode( ' ', $visbility_class ) );
494
+ echo ' ' . esc_attr( $value['row_class'] );
495
+ ?>
496
+ ">
497
  <th scope="row" class="titledesc">
498
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
499
  <?php echo $tooltip_html; ?>
508
  }
509
 
510
  ?>
511
+ <label for="<?php echo $value['id']; ?>">
512
  <input
513
  name="<?php echo esc_attr( $value['id'] ); ?>"
514
  id="<?php echo esc_attr( $value['id'] ); ?>"
517
  value="1"
518
  <?php checked( $option_value, 'yes' ); ?>
519
  <?php echo implode( ' ', $custom_attributes ); ?>
520
+ /> <?php echo $description; ?>
521
  </label>
522
  <?php
523
 
524
  if ( ! isset( $value['checkboxgroup'] ) || 'end' == $value['checkboxgroup'] ) {
525
+ ?>
526
  </fieldset>
527
  </td>
528
  </tr>
535
  break;
536
 
537
  // Single page selects
538
+ case 'single_select_page':
 
539
  $args = array(
540
  'name' => $value['id'],
541
  'id' => $value['id'],
551
  $args = wp_parse_args( $value['args'], $args );
552
  }
553
 
554
+ ?>
555
+ <tr valign="top" class="single_select_page <?php echo esc_attr( $value['row_class'] ); ?>" <?php echo isset( $value['display'] ) && $value['display'] === 'none' ? 'style="display:none"' : ''; ?>>
556
+ <th scope="row" class="titledesc"><?php echo esc_html( $value['title'] ); ?> <?php echo $tooltip_html; ?></th>
557
  <td class="forminp">
558
  <?php echo str_replace( ' id=', " data-placeholder='" . esc_attr__( 'Select a page&hellip;', 'user-registration' ) . "' style='" . $value['css'] . "' class='" . $value['class'] . "' id=", wp_dropdown_pages( $args ) ); ?> <?php echo $description; ?>
559
  </td>
560
+ </tr>
561
+ <?php
562
  break;
563
 
564
  case 'tinymce':
 
565
  $settings = array(
566
+ 'name' => esc_attr( $value['id'] ),
567
+ 'id' => esc_attr( $value['id'] ),
568
+ 'style' => esc_attr( $value['css'] ),
569
+ 'default' => esc_attr( $value['default'] ),
570
+ 'class' => esc_attr( $value['class'] ),
571
+ 'quicktags' => array( 'buttons' => 'em,strong,link' ),
572
+ 'tinymce' => array(
573
  'theme_advanced_buttons1' => 'bold,italic,strikethrough,separator,bullist,numlist,separator,blockquote,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,separator,undo,redo,separator',
574
  'theme_advanced_buttons2' => '',
575
  ),
576
+ 'editor_css' => '<style>#wp-excerpt-editor-container .wp-editor-area{height:175px; width:100%;}</style>',
577
  );
578
 
579
  $option_value = self::get_option( $value['id'], $value['default'] );
580
 
581
+ ?>
582
+ <tr valign="top" class="<?php echo esc_attr( $value['row_class'] ); ?>">
583
  <th scope="row" class="titledesc">
584
  <label for="<?php echo esc_attr( $value['id'] ); ?>"><?php echo esc_html( $value['title'] ); ?></label>
585
  <?php echo $tooltip_html; ?>
586
  </th>
587
+ <td class="forminp forminp-<?php echo sanitize_title( $value['type'] ); ?>">
588
  <?php echo $description; ?>
589
 
590
+ <?php wp_editor( $option_value, $value['id'], $settings ); ?>
591
  </td>
592
+ </tr>
593
+ <?php
594
  break;
595
 
596
  // Default: run an action
620
  $description = $value['desc'];
621
  $tooltip_html = $value['desc_tip'];
622
  } elseif ( ! empty( $value['desc'] ) ) {
623
+ $description = $value['desc'];
624
  }
625
 
626
  if ( $description && in_array( $value['type'], array( 'textarea', 'radio' ) ) ) {
667
  // Get posted value.
668
  if ( strstr( $option['id'], '[' ) ) {
669
  parse_str( $option['id'], $option_name_array );
670
+ $option_name = current( array_keys( $option_name_array ) );
671
 
672
  $setting_name = key( $option_name_array[ $option_name ] );
673
  $raw_value = isset( $_POST[ $option_name ][ $setting_name ] ) ? wp_unslash( $_POST[ $option_name ][ $setting_name ] ) : null;
680
  // Format the value based on option type.
681
  switch ( $option['type'] ) {
682
 
683
+ case 'checkbox':
684
  $value = '1' === $raw_value || 'yes' === $raw_value ? 'yes' : 'no';
685
  break;
686
+ case 'textarea':
687
  $value = wp_kses_post( trim( $raw_value ) );
688
  break;
689
+ case 'multiselect':
690
  $value = array_filter( array_map( 'ur_clean', (array) $raw_value ) );
691
  break;
692
  case 'select':
700
  break;
701
  case 'tinymce':
702
  $value = wpautop( $raw_value );
703
+ break;
704
 
705
+ default:
706
  $value = ur_clean( $raw_value );
707
  break;
708
  }
includes/admin/class-ur-admin-status.php CHANGED
@@ -9,7 +9,7 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
 
15
  /**
@@ -21,7 +21,7 @@ class UR_Admin_Status {
21
  * Handles output of the reports page in admin.
22
  */
23
  public static function output() {
24
- include_once( dirname( __FILE__ ) . '/views/html-admin-page-status.php' );
25
  }
26
 
27
 
@@ -51,12 +51,13 @@ class UR_Admin_Status {
51
 
52
  $handle = ! empty( $viewed_log ) ? self::get_log_file_handle( $viewed_log ) : '';
53
 
54
- include_once( 'views/html-admin-page-status-logs.php' );
55
  }
56
 
57
 
58
  /**
59
  * Retrieve metadata from a file. Based on WP Core's get_file_data function.
 
60
  * @since 2.1.1
61
  *
62
  * @param string $file Path to the file
@@ -117,7 +118,7 @@ class UR_Admin_Status {
117
 
118
  foreach ( $files as $key => $value ) {
119
 
120
- if ( ! in_array( $value, array( ".", ".." ) ) ) {
121
 
122
  if ( is_dir( $template_path . DIRECTORY_SEPARATOR . $value ) ) {
123
  $sub_files = self::scan_template_files( $template_path . DIRECTORY_SEPARATOR . $value );
@@ -137,6 +138,7 @@ class UR_Admin_Status {
137
 
138
  /**
139
  * Scan the log files.
 
140
  * @return array
141
  */
142
  public static function scan_log_files() {
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  /**
21
  * Handles output of the reports page in admin.
22
  */
23
  public static function output() {
24
+ include_once dirname( __FILE__ ) . '/views/html-admin-page-status.php';
25
  }
26
 
27
 
51
 
52
  $handle = ! empty( $viewed_log ) ? self::get_log_file_handle( $viewed_log ) : '';
53
 
54
+ include_once 'views/html-admin-page-status-logs.php';
55
  }
56
 
57
 
58
  /**
59
  * Retrieve metadata from a file. Based on WP Core's get_file_data function.
60
+ *
61
  * @since 2.1.1
62
  *
63
  * @param string $file Path to the file
118
 
119
  foreach ( $files as $key => $value ) {
120
 
121
+ if ( ! in_array( $value, array( '.', '..' ) ) ) {
122
 
123
  if ( is_dir( $template_path . DIRECTORY_SEPARATOR . $value ) ) {
124
  $sub_files = self::scan_template_files( $template_path . DIRECTORY_SEPARATOR . $value );
138
 
139
  /**
140
  * Scan the log files.
141
+ *
142
  * @return array
143
  */
144
  public static function scan_log_files() {
includes/admin/class-ur-admin-user-list-manager.php CHANGED
@@ -10,30 +10,30 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  /**
17
- * Manager of the users list in the backend
18
- *
19
- * Class UR_Admin_User_List_Manager
20
- *
21
- * @package ComponentManualUserApprove
22
- */
23
  class UR_Admin_User_List_Manager {
24
 
25
  /**
26
- * UR_Admin_User_List_Manager constructor.
27
- */
28
  public function __construct() {
29
 
30
  // -------------------- ACTIONS & FILTERS --------------------
31
  add_action( 'load-users.php', array( $this, 'trigger_query_actions' ) );
32
  add_action( 'admin_notices', array( $this, 'display_admin_notices' ), 99 );
33
- add_action( 'admin_notices', array($this, 'pending_users_notices') );
34
-
35
  // Functions about users listing.
36
- add_action( 'restrict_manage_users', array($this, 'add_status_filter') );
37
  add_action( 'admin_footer-users.php', array( $this, 'add_bulk_actions' ) );
38
  add_action( 'load-users.php', array( $this, 'trigger_bulk_action' ) );
39
 
@@ -44,7 +44,7 @@ class UR_Admin_User_List_Manager {
44
  add_filter( 'user_row_actions', array( $this, 'ceate_quick_links' ), 10, 2 );
45
  add_filter( 'manage_users_columns', array( $this, 'add_column_head' ) );
46
  add_filter( 'manage_users_custom_column', array( $this, 'add_column_cell' ), 10, 3 );
47
- add_filter( 'pre_get_users', array($this, 'filter_users_by_approval_status') );
48
  }
49
 
50
  /**
@@ -57,29 +57,38 @@ class UR_Admin_User_List_Manager {
57
  */
58
  public function ceate_quick_links( $actions, $user ) {
59
 
60
- $user_manager = new UR_Admin_User_Manager($user);
61
 
62
- if ( ! $user_manager->can_status_be_changed_by(get_current_user_id())){
63
  return $actions;
64
  }
65
 
66
- $approve_link = add_query_arg( array( 'action' => 'approve', 'user' => $user->ID ) );
 
 
 
 
 
67
  $approve_link = remove_query_arg( array( 'new_role' ), $approve_link );
68
  $approve_link = wp_nonce_url( $approve_link, 'ur_user_change_status' );
69
 
70
- $deny_link = add_query_arg( array( 'action' => 'deny', 'user' => $user->ID ) );
 
 
 
 
 
71
  $deny_link = remove_query_arg( array( 'new_role' ), $deny_link );
72
  $deny_link = wp_nonce_url( $deny_link, 'ur_user_change_status' );
73
 
74
  $approve_action = '<a style="color:#086512" href="' . esc_url( $approve_link ) . '">' . _x( 'Approve', 'The action on users list page', 'user-registration' ) . '</a>';
75
- $deny_action = '<a style="color:#e20707" href="' . esc_url( $deny_link ) . '">' . _x( 'Deny', 'The action on users list page', 'user-registration' ) . '</a>';
76
-
77
 
78
- if($user_manager->is_pending() || $user_manager->is_denied()){
79
  $actions['ur_user_approve_action'] = $approve_action;
80
  }
81
 
82
- if($user_manager->is_pending() || $user_manager->is_approved()) {
83
  $actions['ur_user_deny_action'] = $deny_action;
84
  }
85
 
@@ -92,22 +101,22 @@ class UR_Admin_User_List_Manager {
92
  */
93
  public function trigger_query_actions() {
94
 
95
- $action = isset( $_REQUEST['action'] ) ? sanitize_key($_REQUEST['action']) : false;
96
- $mode = isset( $_POST['mode'] ) ? $_POST['mode'] : false;
97
 
98
  // If this is a multisite, bulk request, stop now!
99
  if ( 'list' == $mode ) {
100
  return;
101
  }
102
 
103
- if ( ! empty( $action ) && in_array( $action, array( 'approve', 'deny' ) ) && !isset( $_GET['new_role'] ) ) {
104
 
105
  check_admin_referer( 'ur_user_change_status' );
106
 
107
- $redirect = admin_url( 'users.php' );
108
- $status = $action;
109
- $user = absint( $_GET['user'] );
110
- $user_manager = new UR_Admin_User_Manager($user);
111
 
112
  if ( $status == 'approve' ) {
113
  $user_manager->approve();
@@ -125,17 +134,17 @@ class UR_Admin_User_List_Manager {
125
  // Display a notice to admin notifying the pending users.
126
  public function pending_users_notices() {
127
  $user_query = new WP_User_Query(
128
- array(
129
- 'meta_key' => 'ur_user_status',
130
- 'meta_value' => 0
131
- )
132
- );
133
- // Get the results from the query, returning the first user.
134
- $users = $user_query->get_results();
135
-
136
- if( count( $users ) > 0 ) {
137
- echo '<div id="user-approvation-result" class="notice notice-success is-dismissible"><p><strong>'.__( 'User Registration:', 'user-registration').'</strong> ' . count( $users ) . ' <a href="'. admin_url('users.php') .'">'.( ( count( $users ) === 1 ) ? __('User', 'user-registration') : __('Users', 'user-registration') ).'</a> '.__( 'pending approval.', 'user-registration').'</p></div>';
138
- }
139
  }
140
 
141
  /**
@@ -148,17 +157,17 @@ class UR_Admin_User_List_Manager {
148
  return;
149
  }
150
 
151
- $message = null;
152
- $users_denied = (isset( $_GET['denied'] ) && is_numeric($_GET['denied'])) ? absint($_GET['denied']) : null;
153
- $users_approved = (isset( $_GET['approved'] ) && is_numeric($_GET['approved'])) ? absint($_GET['approved']) : null;
154
 
155
  if ( $users_approved ) {
156
  $message = sprintf( _n( 'User approved.', '%s users approved.', $users_approved, 'user-registration' ), $users_approved );
157
- } else if( $users_denied ){
158
  $message = sprintf( _n( 'User denied.', '%s users denied.', $users_denied, 'user-registration' ), $users_denied );
159
  }
160
 
161
- if ( !empty( $message ) ) {
162
  echo '<div id="user-approvation-result" class="notice notice-success is-dismissible"><p><strong>' . $message . '</strong></p></div>';
163
  }
164
  }
@@ -172,9 +181,9 @@ class UR_Admin_User_List_Manager {
172
  */
173
  public function add_column_head( $columns ) {
174
  $the_columns['ur_user_user_status'] = __( 'Status', 'user-registration' );
175
- $newcol = array_slice( $columns, 0, -1 );
176
- $newcol = array_merge( $newcol, $the_columns );
177
- $columns = array_merge( $newcol, array_slice( $columns, 1 ) );
178
 
179
  return $columns;
180
  }
@@ -184,43 +193,43 @@ class UR_Admin_User_List_Manager {
184
  *
185
  * @param string $val
186
  * @param string $column_name
187
- * @param int $user_id
188
  *
189
  * @return string
190
  */
191
  public function add_column_cell( $val, $column_name, $user_id ) {
192
 
193
- if ( $column_name == 'ur_user_user_status') {
194
- $user_manager = new UR_Admin_User_Manager($user_id);
195
- $status = $user_manager->get_user_status();
196
 
197
- return UR_Admin_User_Manager::get_status_label($status);
198
  }
199
 
200
  return $val;
201
  }
202
 
203
- public function add_status_filter($which) {
204
 
205
- $id = 'bottom' === $which ? 'ur_user_approval_status2' : 'ur_user_approval_status';
206
- $filter_value = (isset($_GET[$id]) && !empty($_GET[$id])) ? $_GET[$id] : false;
207
 
208
- $approved_label = UR_Admin_User_Manager::get_status_label(UR_Admin_User_Manager::APPROVED);
209
- $pending_label = UR_Admin_User_Manager::get_status_label(UR_Admin_User_Manager::PENDING);
210
- $denied_label = UR_Admin_User_Manager::get_status_label(UR_Admin_User_Manager::DENIED);
211
 
212
  ?>
213
  </div><!-- .alignleft.actions opened in extra_tablenav() - class-wp-users-list-table.php:259 -->
214
  <div class="alignleft actions">
215
 
216
- <label class="screen-reader-text" for="<?php echo $id ?>"><?php _e( 'All statuses', 'user-registration' ) ?></label>
217
- <select name="<?php echo $id ?>" id="<?php echo $id ?>">
218
- <option value=""><?php _e( 'All approval statuses', 'user-registration' ) ?></option>
219
 
220
  <?php
221
- echo '<option value="approved" '.selected( 'approved', $filter_value ).'>'.$approved_label.'</option>';
222
- echo '<option value="pending" '.selected( 'pending', $filter_value ).'>'.$pending_label.'</option>';
223
- echo '<option value="denied" '.selected( 'denied', $filter_value ).'>'.$denied_label.'</option>';
224
  ?>
225
  </select>
226
  <?php
@@ -235,23 +244,23 @@ class UR_Admin_User_List_Manager {
235
  */
236
  public function filter_users_by_approval_status( $query ) {
237
 
238
- $ur_user_filter_action = (isset($_REQUEST['ur_user_filter_action']) && !empty($_REQUEST['ur_user_filter_action'])) ? $_REQUEST['ur_user_filter_action'] : false;
239
- $ur_user_approval_status = (isset($_REQUEST['ur_user_approval_status']) && !empty($_REQUEST['ur_user_approval_status'])) ? $_REQUEST['ur_user_approval_status'] : false;
240
- $ur_user_approval_status2 = (isset($_REQUEST['ur_user_approval_status2']) && !empty($_REQUEST['ur_user_approval_status2'])) ? $_REQUEST['ur_user_approval_status2'] : false;
241
 
242
- if( ! $ur_user_filter_action || ( ! $ur_user_approval_status && ! $ur_user_approval_status2 ) ){
243
  return;
244
  }
245
 
246
  $status = null;
247
 
248
  if ( $ur_user_approval_status2 ) {
249
- $status = sanitize_text_field($ur_user_approval_status2);
250
  } elseif ( $ur_user_approval_status ) {
251
- $status = sanitize_text_field($ur_user_approval_status);
252
  }
253
 
254
- switch($status) {
255
  case 'approved':
256
  $status = UR_Admin_User_Manager::APPROVED;
257
  break;
@@ -267,25 +276,25 @@ class UR_Admin_User_List_Manager {
267
 
268
  $meta_query = array(
269
  array(
270
- 'key' => 'ur_user_status',
271
- 'value' => $status,
272
- 'compare' => '='
273
- )
274
 
275
  );
276
 
277
- if($status == UR_Admin_User_Manager::APPROVED) {
278
  $meta_query = array(
279
  'relation' => 'OR',
280
  array(
281
- 'key' => 'ur_user_status',
282
  'compare' => 'NOT EXISTS', // works!
283
- 'value' => '' // This is ignored, but is necessary...
284
  ),
285
  array(
286
- 'key' => 'ur_user_status',
287
- 'value' => UR_Admin_User_Manager::APPROVED
288
- )
289
  );
290
  }
291
 
@@ -295,91 +304,89 @@ class UR_Admin_User_List_Manager {
295
 
296
  /**
297
  * Seems that doesn't exists a properaction or filter that allow to add custom bulk actions, so this function add them
298
- * in the select form at runtime, using javascript
299
- *
300
- */
301
  public function add_bulk_actions() {
302
 
303
- if( !UR_Admin_User_Manager::is_user_allowed_to_change_status())
304
- {return;}
305
 
306
  ?>
307
  <script type="text/javascript">
308
- jQuery(document).ready(function() {
309
- jQuery('<option>').val('approve').text('<?php _e('Approve', 'user-registration'); ?>').appendTo("select[name='action']");
310
- jQuery('<option>').val('approve').text('<?php _e('Approve', 'user-registration'); ?>').appendTo("select[name='action2']");
311
-
312
- jQuery('<option>').val('deny').text('<?php _e('Deny', 'user-registration'); ?>').appendTo("select[name='action']");
313
- jQuery('<option>').val('deny').text('<?php _e('Deny', 'user-registration'); ?>').appendTo("select[name='action2']");
314
- });
315
- </script>
316
  <?php
317
  }
318
 
319
 
320
  /**
321
  * Trigger the bulk action approvation
322
- */
323
- public function trigger_bulk_action() {
324
-
325
- $wp_list_table = _get_list_table('WP_Users_List_Table');
326
- $action = $wp_list_table->current_action();
327
- $redirect = 'users.php';
328
 
329
- //Check if the action is under the scope of this unction
330
- if ( $action != 'approve' && $action != 'deny' )
331
- {return;}
332
 
333
- //Check if the current user has permissions to change approvation statuses
334
- if( !UR_Admin_User_Manager::is_user_allowed_to_change_status())
335
- {throw new Exception('You have not enough permissions to perform a bulk action on users approval status');}
336
 
 
 
 
337
 
338
- if ( empty($_REQUEST['users']) ) {
339
- wp_redirect($redirect);
340
  exit();
341
  }
342
 
343
- if($action == 'approve') {
344
- $status = UR_Admin_User_Manager::APPROVED;
345
- $query_arg = 'approved';
346
- } else {
347
- $status = UR_Admin_User_Manager::DENIED;
348
- $query_arg = 'denied';
349
- }
350
 
351
  $userids = $_REQUEST['users'];
352
 
353
  $c = 0;
354
 
355
  foreach ( $userids as $id ) {
356
- $id = (int) $id;
357
- $user_manager = new UR_Admin_User_Manager($id);
358
 
359
- //For each user, check if the current user can change him status
360
- if(! $user_manager->can_status_be_changed_by(get_current_user_id()))
361
- {continue;}
362
 
363
- $user_manager->save_status($status);
364
  $c++;
365
  }
366
 
367
- wp_redirect(add_query_arg($query_arg, $c, $redirect));
368
  exit();
369
  }
370
 
371
  /**
372
- * Render the field Status in the user profile, in backend
373
- *
374
  * @param $user
375
- */
376
  public function render_profile_field( $user ) {
377
 
378
- $user_manager = new UR_Admin_User_Manager($user);
379
 
380
- //If the current user can't change status of the user displayed, then return
381
- if ( !$user_manager->can_status_be_changed_by(get_current_user_id()) )
382
- {return;}
383
 
384
  $user_status = $user_manager->get_user_status();
385
  ?>
@@ -391,9 +398,10 @@ class UR_Admin_User_List_Manager {
391
  <select id="ur_user_user_status" name="ur_user_user_status">
392
  <?php
393
  $available_statuses = array( UR_Admin_User_Manager::APPROVED, UR_Admin_User_Manager::PENDING, UR_Admin_User_Manager::DENIED );
394
- foreach ( $available_statuses as $status ) : ?>
 
395
  <option
396
- value="<?php echo esc_attr( $status ); ?>"<?php selected( $status, $user_status ); ?>><?php echo esc_html( UR_Admin_User_Manager::get_status_label($status) ); ?></option>
397
  <?php endforeach; ?>
398
  </select>
399
 
@@ -413,17 +421,17 @@ class UR_Admin_User_List_Manager {
413
  * @return bool
414
  */
415
  public function save_profile_field( $user_id ) {
416
- $user_manager = new UR_Admin_User_Manager($user_id);
417
 
418
- if ( !current_user_can( 'edit_users', $user_id ) || !$user_manager->can_status_be_changed_by(get_current_user_id())) {
419
  return false;
420
  }
421
 
422
- if ( empty( $_POST['ur_user_user_status'] ) && !UR_Admin_User_Manager::validate_status($_POST['ur_user_user_status']) ) {
423
  return false;
424
  }
425
 
426
  $new_status = $_POST['ur_user_user_status'];
427
- $user_manager->save_status($new_status);
428
  }
429
  }
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  /**
17
+ * Manager of the users list in the backend
18
+ *
19
+ * Class UR_Admin_User_List_Manager
20
+ *
21
+ * @package ComponentManualUserApprove
22
+ */
23
  class UR_Admin_User_List_Manager {
24
 
25
  /**
26
+ * UR_Admin_User_List_Manager constructor.
27
+ */
28
  public function __construct() {
29
 
30
  // -------------------- ACTIONS & FILTERS --------------------
31
  add_action( 'load-users.php', array( $this, 'trigger_query_actions' ) );
32
  add_action( 'admin_notices', array( $this, 'display_admin_notices' ), 99 );
33
+ add_action( 'admin_notices', array( $this, 'pending_users_notices' ) );
34
+
35
  // Functions about users listing.
36
+ add_action( 'restrict_manage_users', array( $this, 'add_status_filter' ) );
37
  add_action( 'admin_footer-users.php', array( $this, 'add_bulk_actions' ) );
38
  add_action( 'load-users.php', array( $this, 'trigger_bulk_action' ) );
39
 
44
  add_filter( 'user_row_actions', array( $this, 'ceate_quick_links' ), 10, 2 );
45
  add_filter( 'manage_users_columns', array( $this, 'add_column_head' ) );
46
  add_filter( 'manage_users_custom_column', array( $this, 'add_column_cell' ), 10, 3 );
47
+ add_filter( 'pre_get_users', array( $this, 'filter_users_by_approval_status' ) );
48
  }
49
 
50
  /**
57
  */
58
  public function ceate_quick_links( $actions, $user ) {
59
 
60
+ $user_manager = new UR_Admin_User_Manager( $user );
61
 
62
+ if ( ! $user_manager->can_status_be_changed_by( get_current_user_id() ) ) {
63
  return $actions;
64
  }
65
 
66
+ $approve_link = add_query_arg(
67
+ array(
68
+ 'action' => 'approve',
69
+ 'user' => $user->ID,
70
+ )
71
+ );
72
  $approve_link = remove_query_arg( array( 'new_role' ), $approve_link );
73
  $approve_link = wp_nonce_url( $approve_link, 'ur_user_change_status' );
74
 
75
+ $deny_link = add_query_arg(
76
+ array(
77
+ 'action' => 'deny',
78
+ 'user' => $user->ID,
79
+ )
80
+ );
81
  $deny_link = remove_query_arg( array( 'new_role' ), $deny_link );
82
  $deny_link = wp_nonce_url( $deny_link, 'ur_user_change_status' );
83
 
84
  $approve_action = '<a style="color:#086512" href="' . esc_url( $approve_link ) . '">' . _x( 'Approve', 'The action on users list page', 'user-registration' ) . '</a>';
85
+ $deny_action = '<a style="color:#e20707" href="' . esc_url( $deny_link ) . '">' . _x( 'Deny', 'The action on users list page', 'user-registration' ) . '</a>';
 
86
 
87
+ if ( $user_manager->is_pending() || $user_manager->is_denied() ) {
88
  $actions['ur_user_approve_action'] = $approve_action;
89
  }
90
 
91
+ if ( $user_manager->is_pending() || $user_manager->is_approved() ) {
92
  $actions['ur_user_deny_action'] = $deny_action;
93
  }
94
 
101
  */
102
  public function trigger_query_actions() {
103
 
104
+ $action = isset( $_REQUEST['action'] ) ? sanitize_key( $_REQUEST['action'] ) : false;
105
+ $mode = isset( $_POST['mode'] ) ? $_POST['mode'] : false;
106
 
107
  // If this is a multisite, bulk request, stop now!
108
  if ( 'list' == $mode ) {
109
  return;
110
  }
111
 
112
+ if ( ! empty( $action ) && in_array( $action, array( 'approve', 'deny' ) ) && ! isset( $_GET['new_role'] ) ) {
113
 
114
  check_admin_referer( 'ur_user_change_status' );
115
 
116
+ $redirect = admin_url( 'users.php' );
117
+ $status = $action;
118
+ $user = absint( $_GET['user'] );
119
+ $user_manager = new UR_Admin_User_Manager( $user );
120
 
121
  if ( $status == 'approve' ) {
122
  $user_manager->approve();
134
  // Display a notice to admin notifying the pending users.
135
  public function pending_users_notices() {
136
  $user_query = new WP_User_Query(
137
+ array(
138
+ 'meta_key' => 'ur_user_status',
139
+ 'meta_value' => 0,
140
+ )
141
+ );
142
+ // Get the results from the query, returning the first user.
143
+ $users = $user_query->get_results();
144
+
145
+ if ( count( $users ) > 0 ) {
146
+ echo '<div id="user-approvation-result" class="notice notice-success is-dismissible"><p><strong>' . __( 'User Registration:', 'user-registration' ) . '</strong> ' . count( $users ) . ' <a href="' . admin_url( 'users.php' ) . '">' . ( ( count( $users ) === 1 ) ? __( 'User', 'user-registration' ) : __( 'Users', 'user-registration' ) ) . '</a> ' . __( 'pending approval.', 'user-registration' ) . '</p></div>';
147
+ }
148
  }
149
 
150
  /**
157
  return;
158
  }
159
 
160
+ $message = null;
161
+ $users_denied = ( isset( $_GET['denied'] ) && is_numeric( $_GET['denied'] ) ) ? absint( $_GET['denied'] ) : null;
162
+ $users_approved = ( isset( $_GET['approved'] ) && is_numeric( $_GET['approved'] ) ) ? absint( $_GET['approved'] ) : null;
163
 
164
  if ( $users_approved ) {
165
  $message = sprintf( _n( 'User approved.', '%s users approved.', $users_approved, 'user-registration' ), $users_approved );
166
+ } elseif ( $users_denied ) {
167
  $message = sprintf( _n( 'User denied.', '%s users denied.', $users_denied, 'user-registration' ), $users_denied );
168
  }
169
 
170
+ if ( ! empty( $message ) ) {
171
  echo '<div id="user-approvation-result" class="notice notice-success is-dismissible"><p><strong>' . $message . '</strong></p></div>';
172
  }
173
  }
181
  */
182
  public function add_column_head( $columns ) {
183
  $the_columns['ur_user_user_status'] = __( 'Status', 'user-registration' );
184
+ $newcol = array_slice( $columns, 0, -1 );
185
+ $newcol = array_merge( $newcol, $the_columns );
186
+ $columns = array_merge( $newcol, array_slice( $columns, 1 ) );
187
 
188
  return $columns;
189
  }
193
  *
194
  * @param string $val
195
  * @param string $column_name
196
+ * @param int $user_id
197
  *
198
  * @return string
199
  */
200
  public function add_column_cell( $val, $column_name, $user_id ) {
201
 
202
+ if ( $column_name == 'ur_user_user_status' ) {
203
+ $user_manager = new UR_Admin_User_Manager( $user_id );
204
+ $status = $user_manager->get_user_status();
205
 
206
+ return UR_Admin_User_Manager::get_status_label( $status );
207
  }
208
 
209
  return $val;
210
  }
211
 
212
+ public function add_status_filter( $which ) {
213
 
214
+ $id = 'bottom' === $which ? 'ur_user_approval_status2' : 'ur_user_approval_status';
215
+ $filter_value = ( isset( $_GET[ $id ] ) && ! empty( $_GET[ $id ] ) ) ? $_GET[ $id ] : false;
216
 
217
+ $approved_label = UR_Admin_User_Manager::get_status_label( UR_Admin_User_Manager::APPROVED );
218
+ $pending_label = UR_Admin_User_Manager::get_status_label( UR_Admin_User_Manager::PENDING );
219
+ $denied_label = UR_Admin_User_Manager::get_status_label( UR_Admin_User_Manager::DENIED );
220
 
221
  ?>
222
  </div><!-- .alignleft.actions opened in extra_tablenav() - class-wp-users-list-table.php:259 -->
223
  <div class="alignleft actions">
224
 
225
+ <label class="screen-reader-text" for="<?php echo $id; ?>"><?php _e( 'All statuses', 'user-registration' ); ?></label>
226
+ <select name="<?php echo $id; ?>" id="<?php echo $id; ?>">
227
+ <option value=""><?php _e( 'All approval statuses', 'user-registration' ); ?></option>
228
 
229
  <?php
230
+ echo '<option value="approved" ' . selected( 'approved', $filter_value ) . '>' . $approved_label . '</option>';
231
+ echo '<option value="pending" ' . selected( 'pending', $filter_value ) . '>' . $pending_label . '</option>';
232
+ echo '<option value="denied" ' . selected( 'denied', $filter_value ) . '>' . $denied_label . '</option>';
233
  ?>
234
  </select>
235
  <?php
244
  */
245
  public function filter_users_by_approval_status( $query ) {
246
 
247
+ $ur_user_filter_action = ( isset( $_REQUEST['ur_user_filter_action'] ) && ! empty( $_REQUEST['ur_user_filter_action'] ) ) ? $_REQUEST['ur_user_filter_action'] : false;
248
+ $ur_user_approval_status = ( isset( $_REQUEST['ur_user_approval_status'] ) && ! empty( $_REQUEST['ur_user_approval_status'] ) ) ? $_REQUEST['ur_user_approval_status'] : false;
249
+ $ur_user_approval_status2 = ( isset( $_REQUEST['ur_user_approval_status2'] ) && ! empty( $_REQUEST['ur_user_approval_status2'] ) ) ? $_REQUEST['ur_user_approval_status2'] : false;
250
 
251
+ if ( ! $ur_user_filter_action || ( ! $ur_user_approval_status && ! $ur_user_approval_status2 ) ) {
252
  return;
253
  }
254
 
255
  $status = null;
256
 
257
  if ( $ur_user_approval_status2 ) {
258
+ $status = sanitize_text_field( $ur_user_approval_status2 );
259
  } elseif ( $ur_user_approval_status ) {
260
+ $status = sanitize_text_field( $ur_user_approval_status );
261
  }
262
 
263
+ switch ( $status ) {
264
  case 'approved':
265
  $status = UR_Admin_User_Manager::APPROVED;
266
  break;
276
 
277
  $meta_query = array(
278
  array(
279
+ 'key' => 'ur_user_status',
280
+ 'value' => $status,
281
+ 'compare' => '=',
282
+ ),
283
 
284
  );
285
 
286
+ if ( $status == UR_Admin_User_Manager::APPROVED ) {
287
  $meta_query = array(
288
  'relation' => 'OR',
289
  array(
290
+ 'key' => 'ur_user_status',
291
  'compare' => 'NOT EXISTS', // works!
292
+ 'value' => '', // This is ignored, but is necessary...
293
  ),
294
  array(
295
+ 'key' => 'ur_user_status',
296
+ 'value' => UR_Admin_User_Manager::APPROVED,
297
+ ),
298
  );
299
  }
300
 
304
 
305
  /**
306
  * Seems that doesn't exists a properaction or filter that allow to add custom bulk actions, so this function add them
307
+ * in the select form at runtime, using javascript
308
+ */
 
309
  public function add_bulk_actions() {
310
 
311
+ if ( ! UR_Admin_User_Manager::is_user_allowed_to_change_status() ) {
312
+ return;}
313
 
314
  ?>
315
  <script type="text/javascript">
316
+ jQuery(document).ready(function() {
317
+ jQuery('<option>').val('approve').text('<?php _e( 'Approve', 'user-registration' ); ?>').appendTo("select[name='action']");
318
+ jQuery('<option>').val('approve').text('<?php _e( 'Approve', 'user-registration' ); ?>').appendTo("select[name='action2']");
319
+
320
+ jQuery('<option>').val('deny').text('<?php _e( 'Deny', 'user-registration' ); ?>').appendTo("select[name='action']");
321
+ jQuery('<option>').val('deny').text('<?php _e( 'Deny', 'user-registration' ); ?>').appendTo("select[name='action2']");
322
+ });
323
+ </script>
324
  <?php
325
  }
326
 
327
 
328
  /**
329
  * Trigger the bulk action approvation
330
+ */
331
+ public function trigger_bulk_action() {
 
 
 
 
332
 
333
+ $wp_list_table = _get_list_table( 'WP_Users_List_Table' );
334
+ $action = $wp_list_table->current_action();
335
+ $redirect = 'users.php';
336
 
337
+ // Check if the action is under the scope of this unction
338
+ if ( $action != 'approve' && $action != 'deny' ) {
339
+ return;}
340
 
341
+ // Check if the current user has permissions to change approvation statuses
342
+ if ( ! UR_Admin_User_Manager::is_user_allowed_to_change_status() ) {
343
+ throw new Exception( 'You have not enough permissions to perform a bulk action on users approval status' );}
344
 
345
+ if ( empty( $_REQUEST['users'] ) ) {
346
+ wp_redirect( $redirect );
347
  exit();
348
  }
349
 
350
+ if ( $action == 'approve' ) {
351
+ $status = UR_Admin_User_Manager::APPROVED;
352
+ $query_arg = 'approved';
353
+ } else {
354
+ $status = UR_Admin_User_Manager::DENIED;
355
+ $query_arg = 'denied';
356
+ }
357
 
358
  $userids = $_REQUEST['users'];
359
 
360
  $c = 0;
361
 
362
  foreach ( $userids as $id ) {
363
+ $id = (int) $id;
364
+ $user_manager = new UR_Admin_User_Manager( $id );
365
 
366
+ // For each user, check if the current user can change him status
367
+ if ( ! $user_manager->can_status_be_changed_by( get_current_user_id() ) ) {
368
+ continue;}
369
 
370
+ $user_manager->save_status( $status );
371
  $c++;
372
  }
373
 
374
+ wp_redirect( add_query_arg( $query_arg, $c, $redirect ) );
375
  exit();
376
  }
377
 
378
  /**
379
+ * Render the field Status in the user profile, in backend
380
+ *
381
  * @param $user
382
+ */
383
  public function render_profile_field( $user ) {
384
 
385
+ $user_manager = new UR_Admin_User_Manager( $user );
386
 
387
+ // If the current user can't change status of the user displayed, then return
388
+ if ( ! $user_manager->can_status_be_changed_by( get_current_user_id() ) ) {
389
+ return;}
390
 
391
  $user_status = $user_manager->get_user_status();
392
  ?>
398
  <select id="ur_user_user_status" name="ur_user_user_status">
399
  <?php
400
  $available_statuses = array( UR_Admin_User_Manager::APPROVED, UR_Admin_User_Manager::PENDING, UR_Admin_User_Manager::DENIED );
401
+ foreach ( $available_statuses as $status ) :
402
+ ?>
403
  <option
404
+ value="<?php echo esc_attr( $status ); ?>"<?php selected( $status, $user_status ); ?>><?php echo esc_html( UR_Admin_User_Manager::get_status_label( $status ) ); ?></option>
405
  <?php endforeach; ?>
406
  </select>
407
 
421
  * @return bool
422
  */
423
  public function save_profile_field( $user_id ) {
424
+ $user_manager = new UR_Admin_User_Manager( $user_id );
425
 
426
+ if ( ! current_user_can( 'edit_users', $user_id ) || ! $user_manager->can_status_be_changed_by( get_current_user_id() ) ) {
427
  return false;
428
  }
429
 
430
+ if ( empty( $_POST['ur_user_user_status'] ) && ! UR_Admin_User_Manager::validate_status( $_POST['ur_user_user_status'] ) ) {
431
  return false;
432
  }
433
 
434
  $new_status = $_POST['ur_user_user_status'];
435
+ $user_manager->save_status( $new_status );
436
  }
437
  }
includes/admin/class-ur-admin-user-manager.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  /**
@@ -79,14 +79,14 @@ class UR_Admin_User_Manager {
79
 
80
  $action_label = '';
81
 
82
- switch ($status) {
83
- case UR_Admin_User_Manager::APPROVED:
84
- $action_label = 'approved';
85
- break;
86
 
87
- case UR_Admin_User_Manager::DENIED:
88
- $action_label = 'denied';
89
- break;
90
  }
91
 
92
  if ( ! empty( $action_label ) ) {
@@ -95,7 +95,7 @@ class UR_Admin_User_Manager {
95
 
96
  $this->user_status = $status;
97
 
98
- if( is_super_admin( $this->user->ID ) ){
99
  return;
100
  }
101
 
@@ -131,22 +131,22 @@ class UR_Admin_User_Manager {
131
  */
132
  public function get_user_status( $exact_value = false ) {
133
 
134
- //If the status is already get from the db and the requested status is not the exact value then provide the old one
135
  if ( ! is_null( $this->user_status ) && ! $exact_value ) {
136
  return $this->user_status;
137
  }
138
 
139
  $user_status = get_user_meta( $this->user->ID, 'ur_user_status', true );
140
 
141
- //If the exact_value is true, allow to understand if an user has status "approved" or has registered when the plugin wash not active
142
  if ( $exact_value ) {
143
  return $user_status;
144
  }
145
 
146
- //If the status is empty it's assume that user registered when the plugin was not active, then it is allowed
147
  $user_status = ( $user_status == '' || $user_status == array() ) ? self::APPROVED : $user_status;
148
 
149
- //If the value requested is not the exact value, than store it in the object
150
  $this->user_status = $user_status;
151
 
152
  return $user_status;
@@ -194,14 +194,14 @@ class UR_Admin_User_Manager {
194
  public function reset_password() {
195
  $password = '';
196
 
197
- //If the password reset has been programmatically removed, don't reset
198
  $avoid_password_reset = apply_filters( 'ur_avoid_password_reset', false );
199
  if ( $avoid_password_reset ) {
200
  return $password;
201
  }
202
 
203
- //If the first_access_flag is equal to "" it means that user has registered when the plugin was not active, then don't reset
204
- //If the first_access_flag is equal to 1 it means that user has has already loggedin at least one time, then don't reset
205
  $first_access_flag = $this->get_first_access_flag();
206
  if ( $first_access_flag == 1 ) {
207
  return $password;
@@ -252,17 +252,17 @@ class UR_Admin_User_Manager {
252
  */
253
  public function can_change_status_of( $user_id ) {
254
 
255
- //The instanced user is not able to update statuses at all
256
  if ( ! $this->is_allowed_to_change_users_status() ) {
257
  return false;
258
  }
259
 
260
- //The instanced user is the same user who the status have to be changed
261
  if ( $this->user->ID == $user_id ) {
262
  return false;
263
  }
264
 
265
- //If the changer user has the capability "edit_users" but not "manage_options" (isn't an admin),
266
  // then allow to edit the status of another user only if him hasn't capability "manage_options" (isn't an admin)
267
  if ( ! user_can( $this->user, 'manage_options' ) && user_can( $user_id, 'manage_options' ) ) {
268
  return false;
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  /**
79
 
80
  $action_label = '';
81
 
82
+ switch ( $status ) {
83
+ case self::APPROVED:
84
+ $action_label = 'approved';
85
+ break;
86
 
87
+ case self::DENIED:
88
+ $action_label = 'denied';
89
+ break;
90
  }
91
 
92
  if ( ! empty( $action_label ) ) {
95
 
96
  $this->user_status = $status;
97
 
98
+ if ( is_super_admin( $this->user->ID ) ) {
99
  return;
100
  }
101
 
131
  */
132
  public function get_user_status( $exact_value = false ) {
133
 
134
+ // If the status is already get from the db and the requested status is not the exact value then provide the old one
135
  if ( ! is_null( $this->user_status ) && ! $exact_value ) {
136
  return $this->user_status;
137
  }
138
 
139
  $user_status = get_user_meta( $this->user->ID, 'ur_user_status', true );
140
 
141
+ // If the exact_value is true, allow to understand if an user has status "approved" or has registered when the plugin wash not active
142
  if ( $exact_value ) {
143
  return $user_status;
144
  }
145
 
146
+ // If the status is empty it's assume that user registered when the plugin was not active, then it is allowed
147
  $user_status = ( $user_status == '' || $user_status == array() ) ? self::APPROVED : $user_status;
148
 
149
+ // If the value requested is not the exact value, than store it in the object
150
  $this->user_status = $user_status;
151
 
152
  return $user_status;
194
  public function reset_password() {
195
  $password = '';
196
 
197
+ // If the password reset has been programmatically removed, don't reset
198
  $avoid_password_reset = apply_filters( 'ur_avoid_password_reset', false );
199
  if ( $avoid_password_reset ) {
200
  return $password;
201
  }
202
 
203
+ // If the first_access_flag is equal to "" it means that user has registered when the plugin was not active, then don't reset
204
+ // If the first_access_flag is equal to 1 it means that user has has already loggedin at least one time, then don't reset
205
  $first_access_flag = $this->get_first_access_flag();
206
  if ( $first_access_flag == 1 ) {
207
  return $password;
252
  */
253
  public function can_change_status_of( $user_id ) {
254
 
255
+ // The instanced user is not able to update statuses at all
256
  if ( ! $this->is_allowed_to_change_users_status() ) {
257
  return false;
258
  }
259
 
260
+ // The instanced user is the same user who the status have to be changed
261
  if ( $this->user->ID == $user_id ) {
262
  return false;
263
  }
264
 
265
+ // If the changer user has the capability "edit_users" but not "manage_options" (isn't an admin),
266
  // then allow to edit the status of another user only if him hasn't capability "manage_options" (isn't an admin)
267
  if ( ! user_can( $this->user, 'manage_options' ) && user_can( $user_id, 'manage_options' ) ) {
268
  return false;
includes/admin/class-ur-admin.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  /**
@@ -37,13 +37,13 @@ class UR_Admin {
37
  * Includes any classes we need within admin.
38
  */
39
  public function includes() {
40
- include_once( dirname( __FILE__ ) . '/functions-ur-admin.php' );
41
- include_once( dirname( __FILE__ ) . '/class-ur-admin-notices.php' );
42
- include_once( dirname( __FILE__ ) . '/class-ur-admin-menus.php' );
43
- include_once( dirname( __FILE__ ) . '/class-ur-admin-export-users.php' );
44
- include_once( dirname( __FILE__ ) . '/class-ur-admin-form-modal.php' );
45
 
46
- include_once( UR_ABSPATH . 'includes' . UR_DS . 'admin' . UR_DS . 'class-ur-admin-assets.php' );
47
  }
48
 
49
  /**
@@ -55,12 +55,12 @@ class UR_Admin {
55
  }
56
 
57
  switch ( $screen->id ) {
58
- case 'users' :
59
- case 'user' :
60
- case 'profile' :
61
- case 'user-edit' :
62
- include( 'class-ur-admin-profile.php' );
63
- break;
64
  }
65
  }
66
 
@@ -113,17 +113,19 @@ class UR_Admin {
113
  // Change the footer text
114
  if ( ! get_option( 'user_registration_admin_footer_text_rated' ) ) {
115
  $footer_text = sprintf(
116
- /* translators: 1: WooCommerce 2:: five stars */
117
  __( 'If you like %1$s please leave us a %2$s rating. A huge thanks in advance!', 'user-registration' ),
118
  sprintf( '<strong>%s</strong>', esc_html__( 'User Registration', 'user-registration' ) ),
119
  '<a href="https://wordpress.org/support/plugin/user-registration/reviews?rate=5#new-post" target="_blank" class="ur-rating-link" data-rated="' . esc_attr__( 'Thank You!', 'user-registration' ) . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
120
  );
121
- ur_enqueue_js( "
 
122
  jQuery( 'a.ur-rating-link' ).click( function() {
123
  jQuery.post( '" . UR()->ajax_url() . "', { action: 'user_registration_rated' } );
124
  jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );
125
  });
126
- " );
 
127
  } else {
128
  $footer_text = __( 'Thank you for using User Registration.', 'user-registration' );
129
  }
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  /**
37
  * Includes any classes we need within admin.
38
  */
39
  public function includes() {
40
+ include_once dirname( __FILE__ ) . '/functions-ur-admin.php';
41
+ include_once dirname( __FILE__ ) . '/class-ur-admin-notices.php';
42
+ include_once dirname( __FILE__ ) . '/class-ur-admin-menus.php';
43
+ include_once dirname( __FILE__ ) . '/class-ur-admin-export-users.php';
44
+ include_once dirname( __FILE__ ) . '/class-ur-admin-form-modal.php';
45
 
46
+ include_once UR_ABSPATH . 'includes' . UR_DS . 'admin' . UR_DS . 'class-ur-admin-assets.php';
47
  }
48
 
49
  /**
55
  }
56
 
57
  switch ( $screen->id ) {
58
+ case 'users':
59
+ case 'user':
60
+ case 'profile':
61
+ case 'user-edit':
62
+ include 'class-ur-admin-profile.php';
63
+ break;
64
  }
65
  }
66
 
113
  // Change the footer text
114
  if ( ! get_option( 'user_registration_admin_footer_text_rated' ) ) {
115
  $footer_text = sprintf(
116
+ /* translators: 1: WooCommerce 2:: five stars */
117
  __( 'If you like %1$s please leave us a %2$s rating. A huge thanks in advance!', 'user-registration' ),
118
  sprintf( '<strong>%s</strong>', esc_html__( 'User Registration', 'user-registration' ) ),
119
  '<a href="https://wordpress.org/support/plugin/user-registration/reviews?rate=5#new-post" target="_blank" class="ur-rating-link" data-rated="' . esc_attr__( 'Thank You!', 'user-registration' ) . '">&#9733;&#9733;&#9733;&#9733;&#9733;</a>'
120
  );
121
+ ur_enqueue_js(
122
+ "
123
  jQuery( 'a.ur-rating-link' ).click( function() {
124
  jQuery.post( '" . UR()->ajax_url() . "', { action: 'user_registration_rated' } );
125
  jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );
126
  });
127
+ "
128
+ );
129
  } else {
130
  $footer_text = __( 'Thank you for using User Registration.', 'user-registration' );
131
  }
includes/admin/class-ur-config.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  /**
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  /**
includes/admin/functions-ur-admin.php CHANGED
@@ -9,7 +9,7 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit; // Exit if accessed directly
13
  }
14
 
15
  /**
@@ -41,14 +41,15 @@ add_filter( 'wp_privacy_personal_data_erasers', 'user_registration_register_data
41
 
42
  /**
43
  * Add user registration data to exporters
 
44
  * @param array $exporters
45
  * @return array
46
  */
47
  function user_registration_register_data_exporter( $exporters ) {
48
 
49
  $exporters['user-registration'] = array(
50
- 'exporter_friendly_name' => __( 'User Extra Information', 'user-registration' ),
51
- 'callback' => 'user_registration_data_exporter',
52
  );
53
 
54
  return $exporters;
@@ -56,7 +57,8 @@ function user_registration_register_data_exporter( $exporters ) {
56
 
57
  /**
58
  * Get user registration data to export.
59
- * @param string $email_address user's email address
 
60
  * @param integer $page
61
  * @return array exporting data
62
  */
@@ -65,44 +67,45 @@ function user_registration_data_exporter( $email_address, $page = 1 ) {
65
  global $wpdb;
66
 
67
  $form_data = array();
68
- $posts = get_posts( 'post_type=user_registration' );
69
 
70
  // Get array of field name label mapping of user registration fields.
71
- foreach( $posts as $post ) {
72
  $post_content = isset( $post->post_content ) ? $post->post_content : '';
73
  $post_content_array = json_decode( $post_content );
74
  foreach ( $post_content_array as $post_content_row ) {
75
  foreach ( $post_content_row as $post_content_grid ) {
76
  foreach ( $post_content_grid as $field ) {
77
- if( isset( $field->field_key ) && isset( $field->general_setting->field_name ) ) {
78
- $form_data[ $field->general_setting->field_name ] = $field->general_setting->label;
79
  }
80
  }
81
  }
82
  }
83
  }
84
 
85
- $user = get_user_by( 'email', $email_address );
86
- $user_id = isset( $user->ID ) ? $user->ID : 0;
87
- $usermeta = $wpdb->get_results( "SELECT * FROM $wpdb->usermeta WHERE meta_key LIKE 'user_registration\_%' AND user_id = ". $user_id ." ;" );
88
 
89
  $export_items = array();
90
- if( $usermeta && is_array( $usermeta )) {
91
 
92
- foreach( $usermeta as $meta ) {
93
  $strip_prefix = substr( $meta->meta_key, 18 );
94
 
95
- if( array_key_exists( $strip_prefix, $form_data ) ) {
96
 
97
- if( is_serialized( $meta->meta_value ) ) {
98
  $meta->meta_value = unserialize( $meta->meta_value );
99
- $meta->meta_value = implode( ",", $meta->meta_value );
100
  }
101
 
102
  $data[] =
103
- array( 'name' => $form_data[ $strip_prefix ],
104
- 'value' => $meta->meta_value,
105
- );
 
106
  }
107
  }
108
 
@@ -122,20 +125,22 @@ function user_registration_data_exporter( $email_address, $page = 1 ) {
122
 
123
  /**
124
  * Add user registration data to the eraser tool.
125
- * @param array $erasers
 
126
  * @return array
127
  */
128
  function user_registration_register_data_eraser( $erasers = array() ) {
129
  $erasers['user-registration'] = array(
130
  'eraser_friendly_name' => __( 'WordPress User Extra Information', 'user-registration' ),
131
- 'callback' => 'user_registration_data_eraser',
132
  );
133
  return $erasers;
134
  }
135
 
136
  /**
137
  * Get user registration data to erase
138
- * @param string $email_address user's email address
 
139
  * @param integer $page [description]
140
  * @return array
141
  */
@@ -152,19 +157,19 @@ function user_registration_data_eraser( $email_address, $page = 1 ) {
152
  );
153
  }
154
 
155
- $user = get_user_by( 'email', $email_address );
156
 
157
- $messages = array();
158
  $items_removed = false;
159
  $items_retained = false;
160
 
161
  if ( $user && $user->ID ) {
162
- $user_id = $user->ID;
163
- $delete_usermeta = $wpdb->get_results( "DELETE FROM $wpdb->usermeta WHERE meta_key LIKE 'user_registration\_%' AND user_id = ". $user_id ." ;" );
164
 
165
- $delete_form_data = $wpdb->get_results( "DELETE FROM $wpdb->usermeta WHERE meta_key = 'ur_form_id' AND user_id = ". $user_id ." ;");
166
 
167
- if( $delete_usermeta && $delete_form_data ) {
168
  $items_removed = true;
169
  }
170
  }
@@ -194,12 +199,15 @@ function ur_create_page( $slug, $option = '', $page_title = '', $page_content =
194
  $option_value = get_option( $option );
195
 
196
  if ( $option_value > 0 && ( $page_object = get_post( $option_value ) ) ) {
197
- if ( 'page' === $page_object->post_type && ! in_array( $page_object->post_status, array(
 
 
198
  'pending',
199
  'trash',
200
  'future',
201
- 'auto-draft'
202
- ) )
 
203
  ) {
204
  // Valid page is already in place
205
  return $page_object->ID;
@@ -271,7 +279,7 @@ function ur_create_page( $slug, $option = '', $page_title = '', $page_content =
271
  function user_registration_admin_fields( $options ) {
272
 
273
  if ( ! class_exists( 'UR_Admin_Settings', false ) ) {
274
- include( dirname( __FILE__ ) . '/class-ur-admin-settings.php' );
275
  }
276
 
277
  UR_Admin_Settings::output_fields( $options );
@@ -286,7 +294,7 @@ function user_registration_admin_fields( $options ) {
286
  function user_registration_update_options( $options, $data = null ) {
287
 
288
  if ( ! class_exists( 'UR_Admin_Settings', false ) ) {
289
- include( dirname( __FILE__ ) . '/class-ur-admin-settings.php' );
290
  }
291
 
292
  UR_Admin_Settings::save_fields( $options, $data );
@@ -303,7 +311,7 @@ function user_registration_update_options( $options, $data = null ) {
303
  function user_registration_settings_get_option( $option_name, $default = '' ) {
304
 
305
  if ( ! class_exists( 'UR_Admin_Settings', false ) ) {
306
- include( dirname( __FILE__ ) . '/class-ur-admin-settings.php' );
307
  }
308
 
309
  return UR_Admin_Settings::get_option( $option_name, $default );
@@ -311,11 +319,12 @@ function user_registration_settings_get_option( $option_name, $default = '' ) {
311
 
312
  /**
313
  * General settings area display
 
314
  * @param int $form_id Form ID.
315
  */
316
  function ur_admin_form_settings( $form_id = 0 ) {
317
 
318
- echo '<div id="general-settings" ><h3>'. esc_html__( 'General Settings' , 'user-registration' ) . '</h3>';
319
 
320
  $arguments = ur_admin_form_settings_fields( $form_id );
321
 
@@ -326,8 +335,9 @@ function ur_admin_form_settings( $form_id = 0 ) {
326
 
327
  /**
328
  * Update Settings of the form.
 
329
  * @param array $setting_data Settings data in name value array pair
330
- * @param int $form_id Form ID.
331
  */
332
  function ur_update_form_settings( $setting_data, $form_id ) {
333
  $remap_setting_data = array();
@@ -337,7 +347,7 @@ function ur_update_form_settings( $setting_data, $form_id ) {
337
 
338
  if ( isset( $setting['name'] ) ) {
339
 
340
- if( '[]' === substr( $setting['name'], -2 ) ) {
341
  $setting['name'] = substr( $setting['name'], 0, -2 );
342
  }
343
 
@@ -353,7 +363,7 @@ function ur_update_form_settings( $setting_data, $form_id ) {
353
  if ( isset( $remap_setting_data[ $field_data['id'] ]['value'] ) ) {
354
 
355
  // Check if any settings value contains array
356
- if( is_array( $remap_setting_data[ $field_data['id'] ]['value'] ) ) {
357
  $remap_setting_data[ $field_data['id'] ]['value'] = array_map( 'sanitize_text_field', $remap_setting_data[ $field_data['id'] ]['value'] );
358
  $remap_setting_data[ $field_data['id'] ]['value'] = maybe_serialize( $remap_setting_data[ $field_data['id'] ]['value'] );
359
  } else {
@@ -372,41 +382,40 @@ function ur_update_form_settings( $setting_data, $form_id ) {
372
  /**
373
  * Format settings data for same name. e.g. multiselect
374
  * Encloses all values in array for same name in settings.
 
375
  * @param array $setting_data unformatted settings data.
376
- * @return array $settings formatted settings data.
377
  */
378
  function ur_format_setting_data( $setting_data ) {
379
 
380
  $key_value = array();
381
- foreach( $setting_data as $value ) {
382
 
383
- if( array_key_exists( $value['name'], $key_value ) ) {
384
  $value_array = array();
385
 
386
- if( is_array( $key_value[ $value['name'] ] ) ) {
387
-
388
- $value_array = $key_value[ $value['name'] ];
389
- $value_array[] = $value['value'];
390
- $key_value[ $value['name'] ] = $value_array;
391
- }
392
- else {
393
- $value_array[] = $key_value[ $value['name'] ];
394
- $value_array[] = $value['value'];
395
- $key_value[ $value['name'] ] = $value_array;
396
- }
397
- }
398
- else {
399
- $key_value[ $value['name'] ] = $value['value'];
400
- }
401
- }
402
-
403
- $settings = array();
404
- foreach ( $key_value as $key => $value ) {
405
- $settings[] = array(
406
- "name" => $key,
407
- "value" => $value
408
- );
409
- }
410
-
411
- return $settings;
412
  }
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  /**
41
 
42
  /**
43
  * Add user registration data to exporters
44
+ *
45
  * @param array $exporters
46
  * @return array
47
  */
48
  function user_registration_register_data_exporter( $exporters ) {
49
 
50
  $exporters['user-registration'] = array(
51
+ 'exporter_friendly_name' => __( 'User Extra Information', 'user-registration' ),
52
+ 'callback' => 'user_registration_data_exporter',
53
  );
54
 
55
  return $exporters;
57
 
58
  /**
59
  * Get user registration data to export.
60
+ *
61
+ * @param string $email_address user's email address
62
  * @param integer $page
63
  * @return array exporting data
64
  */
67
  global $wpdb;
68
 
69
  $form_data = array();
70
+ $posts = get_posts( 'post_type=user_registration' );
71
 
72
  // Get array of field name label mapping of user registration fields.
73
+ foreach ( $posts as $post ) {
74
  $post_content = isset( $post->post_content ) ? $post->post_content : '';
75
  $post_content_array = json_decode( $post_content );
76
  foreach ( $post_content_array as $post_content_row ) {
77
  foreach ( $post_content_row as $post_content_grid ) {
78
  foreach ( $post_content_grid as $field ) {
79
+ if ( isset( $field->field_key ) && isset( $field->general_setting->field_name ) ) {
80
+ $form_data[ $field->general_setting->field_name ] = $field->general_setting->label;
81
  }
82
  }
83
  }
84
  }
85
  }
86
 
87
+ $user = get_user_by( 'email', $email_address );
88
+ $user_id = isset( $user->ID ) ? $user->ID : 0;
89
+ $usermeta = $wpdb->get_results( "SELECT * FROM $wpdb->usermeta WHERE meta_key LIKE 'user_registration\_%' AND user_id = " . $user_id . ' ;' );
90
 
91
  $export_items = array();
92
+ if ( $usermeta && is_array( $usermeta ) ) {
93
 
94
+ foreach ( $usermeta as $meta ) {
95
  $strip_prefix = substr( $meta->meta_key, 18 );
96
 
97
+ if ( array_key_exists( $strip_prefix, $form_data ) ) {
98
 
99
+ if ( is_serialized( $meta->meta_value ) ) {
100
  $meta->meta_value = unserialize( $meta->meta_value );
101
+ $meta->meta_value = implode( ',', $meta->meta_value );
102
  }
103
 
104
  $data[] =
105
+ array(
106
+ 'name' => $form_data[ $strip_prefix ],
107
+ 'value' => $meta->meta_value,
108
+ );
109
  }
110
  }
111
 
125
 
126
  /**
127
  * Add user registration data to the eraser tool.
128
+ *
129
+ * @param array $erasers
130
  * @return array
131
  */
132
  function user_registration_register_data_eraser( $erasers = array() ) {
133
  $erasers['user-registration'] = array(
134
  'eraser_friendly_name' => __( 'WordPress User Extra Information', 'user-registration' ),
135
+ 'callback' => 'user_registration_data_eraser',
136
  );
137
  return $erasers;
138
  }
139
 
140
  /**
141
  * Get user registration data to erase
142
+ *
143
+ * @param string $email_address user's email address
144
  * @param integer $page [description]
145
  * @return array
146
  */
157
  );
158
  }
159
 
160
+ $user = get_user_by( 'email', $email_address );
161
 
162
+ $messages = array();
163
  $items_removed = false;
164
  $items_retained = false;
165
 
166
  if ( $user && $user->ID ) {
167
+ $user_id = $user->ID;
168
+ $delete_usermeta = $wpdb->get_results( "DELETE FROM $wpdb->usermeta WHERE meta_key LIKE 'user_registration\_%' AND user_id = " . $user_id . ' ;' );
169
 
170
+ $delete_form_data = $wpdb->get_results( "DELETE FROM $wpdb->usermeta WHERE meta_key = 'ur_form_id' AND user_id = " . $user_id . ' ;' );
171
 
172
+ if ( $delete_usermeta && $delete_form_data ) {
173
  $items_removed = true;
174
  }
175
  }
199
  $option_value = get_option( $option );
200
 
201
  if ( $option_value > 0 && ( $page_object = get_post( $option_value ) ) ) {
202
+ if ( 'page' === $page_object->post_type && ! in_array(
203
+ $page_object->post_status,
204
+ array(
205
  'pending',
206
  'trash',
207
  'future',
208
+ 'auto-draft',
209
+ )
210
+ )
211
  ) {
212
  // Valid page is already in place
213
  return $page_object->ID;
279
  function user_registration_admin_fields( $options ) {
280
 
281
  if ( ! class_exists( 'UR_Admin_Settings', false ) ) {
282
+ include dirname( __FILE__ ) . '/class-ur-admin-settings.php';
283
  }
284
 
285
  UR_Admin_Settings::output_fields( $options );
294
  function user_registration_update_options( $options, $data = null ) {
295
 
296
  if ( ! class_exists( 'UR_Admin_Settings', false ) ) {
297
+ include dirname( __FILE__ ) . '/class-ur-admin-settings.php';
298
  }
299
 
300
  UR_Admin_Settings::save_fields( $options, $data );
311
  function user_registration_settings_get_option( $option_name, $default = '' ) {
312
 
313
  if ( ! class_exists( 'UR_Admin_Settings', false ) ) {
314
+ include dirname( __FILE__ ) . '/class-ur-admin-settings.php';
315
  }
316
 
317
  return UR_Admin_Settings::get_option( $option_name, $default );
319
 
320
  /**
321
  * General settings area display
322
+ *
323
  * @param int $form_id Form ID.
324
  */
325
  function ur_admin_form_settings( $form_id = 0 ) {
326
 
327
+ echo '<div id="general-settings" ><h3>' . esc_html__( 'General Settings', 'user-registration' ) . '</h3>';
328
 
329
  $arguments = ur_admin_form_settings_fields( $form_id );
330
 
335
 
336
  /**
337
  * Update Settings of the form.
338
+ *
339
  * @param array $setting_data Settings data in name value array pair
340
+ * @param int $form_id Form ID.
341
  */
342
  function ur_update_form_settings( $setting_data, $form_id ) {
343
  $remap_setting_data = array();
347
 
348
  if ( isset( $setting['name'] ) ) {
349
 
350
+ if ( '[]' === substr( $setting['name'], -2 ) ) {
351
  $setting['name'] = substr( $setting['name'], 0, -2 );
352
  }
353
 
363
  if ( isset( $remap_setting_data[ $field_data['id'] ]['value'] ) ) {
364
 
365
  // Check if any settings value contains array
366
+ if ( is_array( $remap_setting_data[ $field_data['id'] ]['value'] ) ) {
367
  $remap_setting_data[ $field_data['id'] ]['value'] = array_map( 'sanitize_text_field', $remap_setting_data[ $field_data['id'] ]['value'] );
368
  $remap_setting_data[ $field_data['id'] ]['value'] = maybe_serialize( $remap_setting_data[ $field_data['id'] ]['value'] );
369
  } else {
382
  /**
383
  * Format settings data for same name. e.g. multiselect
384
  * Encloses all values in array for same name in settings.
385
+ *
386
  * @param array $setting_data unformatted settings data.
387
+ * @return array $settings formatted settings data.
388
  */
389
  function ur_format_setting_data( $setting_data ) {
390
 
391
  $key_value = array();
392
+ foreach ( $setting_data as $value ) {
393
 
394
+ if ( array_key_exists( $value['name'], $key_value ) ) {
395
  $value_array = array();
396
 
397
+ if ( is_array( $key_value[ $value['name'] ] ) ) {
398
+
399
+ $value_array = $key_value[ $value['name'] ];
400
+ $value_array[] = $value['value'];
401
+ $key_value[ $value['name'] ] = $value_array;
402
+ } else {
403
+ $value_array[] = $key_value[ $value['name'] ];
404
+ $value_array[] = $value['value'];
405
+ $key_value[ $value['name'] ] = $value_array;
406
+ }
407
+ } else {
408
+ $key_value[ $value['name'] ] = $value['value'];
409
+ }
410
+ }
411
+
412
+ $settings = array();
413
+ foreach ( $key_value as $key => $value ) {
414
+ $settings[] = array(
415
+ 'name' => $key,
416
+ 'value' => $value,
417
+ );
418
+ }
419
+
420
+ return $settings;
 
 
421
  }
includes/admin/settings/class-ur-settings-email.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  if ( ! class_exists( 'UR_Settings_Email' ) ) :
@@ -34,26 +34,26 @@ if ( ! class_exists( 'UR_Settings_Email' ) ) :
34
 
35
  $this->id = 'email';
36
  $this->label = __( 'Emails', 'user-registration' );
37
-
38
  add_filter( 'user_registration_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
39
  add_action( 'user_registration_settings_' . $this->id, array( $this, 'output' ) );
40
  add_action( 'user_registration_settings_save_' . $this->id, array( $this, 'save' ) );
41
  add_action( 'user_registration_admin_field_email_notification', array( $this, 'email_notification_setting' ) );
42
 
43
- $this->emails['UR_Settings_Admin_Email'] = include( 'emails/class-ur-settings-admin-email.php' );
44
- $this->emails['UR_Settings_Awaiting_Admin_Approval_Email'] = include( 'emails/class-ur-settings-awaiting-admin-approval-email.php' );
45
-
46
- $this->emails['UR_Settings_Email_Confirmation'] = include( 'emails/class-ur-settings-email-confirmation.php' );
47
 
48
- $this->emails['UR_Settings_Registration_Approved_Email'] = include( 'emails/class-ur-settings-registration-approved-email.php' );
49
-
50
- $this->emails['UR_Settings_Registration_Denied_Email'] = include( 'emails/class-ur-settings-registration-denied-email.php' );
51
 
52
- $this->emails['UR_Settings_Registration_Pending_Email'] = include( 'emails/class-ur-settings-registration-pending-email.php' );
53
 
54
- $this->emails['UR_Settings_Successfully_Registered_Email'] = include( 'emails/class-ur-settings-successfully-registered-email.php' );
55
 
56
- $this->emails['UR_Settings_Reset_Password_Email'] = include( 'emails/class-ur-settings-reset-password-email.php' );
 
 
57
 
58
  $this->emails = apply_filters( 'user_registration_email_classes', $this->emails );
59
  }
@@ -63,8 +63,10 @@ if ( ! class_exists( 'UR_Settings_Email' ) ) :
63
  *
64
  * @return array
65
  */
66
- public function get_settings(){
67
- $settings = apply_filters( 'user_registration_email_settings', array(
 
 
68
  array(
69
  'title' => __( 'General Email Settings', 'user-registration' ),
70
  'type' => 'title',
@@ -73,24 +75,30 @@ if ( ! class_exists( 'UR_Settings_Email' ) ) :
73
  ),
74
 
75
  ur_get_user_login_option(),
76
-
77
  array(
78
  'type' => 'sectionend',
79
  'id' => 'general_email_setting',
80
  ),
81
 
82
- array(
83
  'title' => __( 'Email notifications', 'user-registration' ),
84
- 'desc' => __( 'Email notifications sent from user registration are listed below. Click on an email to configure it.', 'user-registration' ),
85
- 'type' => 'title',
86
- 'id' => 'email_notification_settings'
87
  ),
88
 
89
  array( 'type' => 'email_notification' ),
90
 
91
- array( 'type' => 'sectionend', 'id' => 'email_notification_settings' ),
 
 
 
92
 
93
- array( 'type' => 'sectionend', 'id' => 'email_recipient_options' ),
 
 
 
94
 
95
  array(
96
  'title' => __( 'Email Sender Options', 'user-registration' ),
@@ -132,60 +140,61 @@ if ( ! class_exists( 'UR_Settings_Email' ) ) :
132
  );
133
  return apply_filters( 'user_registration_get_email_settings_' . $this->id, $settings );
134
  }
135
-
136
  public function get_emails() {
137
  return $this->emails;
138
  }
139
 
140
  public function email_notification_setting() {
141
- ?>
142
  <tr valign="top">
143
- <td class="ur_emails_wrapper" colspan="2">
144
  <table class="ur_emails widefat" cellspacing="0">
145
  <thead>
146
  <tr>
147
  <?php
148
- $columns = apply_filters( 'user_registration_email_setting_columns', array(
149
- 'name' => __( 'Email', 'user-registration' ),
150
- 'actions' => __( 'Configure', 'user-registration' ),
151
- ) );
152
- foreach ( $columns as $key => $column ) {
153
- echo '<th style="padding-left:15px" class="ur-email-settings-table-' . esc_attr( $key ) . '">' . esc_html( $column ) . '</th>';
154
- }
 
 
 
155
  ?>
156
  </tr>
157
  </thead>
158
  <tbody>
159
 
160
- <?php
161
  $emails = $this->get_emails();
162
- foreach( $emails as $email ) {
163
  echo '<tr><td class="ur-email-settings-table">
164
- <a href="' . admin_url( 'admin.php?page=user-registration-settings&tab=email&section=ur_settings_'. $email->id .'' ) .
165
- '">'. __( $email->title, 'user-registration' ) .'</a>' . ur_help_tip( __($email->description,'user-registration' ) ) . '
166
  </td>
167
  <td class="ur-email-settings-table">
168
- <a class="button tips" data-tip="'. esc_attr__( 'Configure','user-registration' ) .'" href="' . admin_url( 'admin.php?page=user-registration-settings&tab=email&section=ur_settings_'. $email->id.'' ) . '"><span class="dashicons dashicons-admin-generic"></span> </a>
169
  </td>
170
- </tr>';
171
  }
172
  ?>
173
  </tbody>
174
  </table>
175
  </td>
176
  </tr>
177
- <?php
178
  }
179
-
180
  public function save() {
181
  global $current_section;
182
  $emails = $this->get_emails();
183
 
184
- foreach( $emails as $email )
185
- {
186
- if( $current_section == 'ur_settings_' . $email->id . '' )
187
- {
188
- $settings = new $email;
189
  $settings = $settings->get_settings();
190
  }
191
  }
@@ -201,10 +210,10 @@ if ( ! class_exists( 'UR_Settings_Email' ) ) :
201
  public function output() {
202
  global $current_section;
203
  $emails = $this->get_emails();
204
-
205
- foreach( $emails as $email ) {
206
- if( $current_section == 'ur_settings_' . $email->id . '' ) {
207
- $settings = new $email;
208
  $settings = $settings->get_settings();
209
  }
210
  }
@@ -213,16 +222,16 @@ if ( ! class_exists( 'UR_Settings_Email' ) ) :
213
 
214
  UR_Admin_Settings::output_fields( $settings );
215
 
216
- if( ! empty( $current_section ) ) {
217
  ?>
218
  <div id ="smart-tags">
219
  <a href="https://docs.wpeverest.com/docs/user-registration/email-settings/smart-tags/"><?php echo esc_html__( 'Smart Tags Used', 'user-registration' ); ?></a>
220
  </div>
221
- <?php
222
  }
223
  }
224
  }
225
 
226
  endif;
227
 
228
- return new UR_Settings_Email();
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  if ( ! class_exists( 'UR_Settings_Email' ) ) :
34
 
35
  $this->id = 'email';
36
  $this->label = __( 'Emails', 'user-registration' );
37
+
38
  add_filter( 'user_registration_settings_tabs_array', array( $this, 'add_settings_page' ), 20 );
39
  add_action( 'user_registration_settings_' . $this->id, array( $this, 'output' ) );
40
  add_action( 'user_registration_settings_save_' . $this->id, array( $this, 'save' ) );
41
  add_action( 'user_registration_admin_field_email_notification', array( $this, 'email_notification_setting' ) );
42
 
43
+ $this->emails['UR_Settings_Admin_Email'] = include 'emails/class-ur-settings-admin-email.php';
44
+ $this->emails['UR_Settings_Awaiting_Admin_Approval_Email'] = include 'emails/class-ur-settings-awaiting-admin-approval-email.php';
45
+
46
+ $this->emails['UR_Settings_Email_Confirmation'] = include 'emails/class-ur-settings-email-confirmation.php';
47
 
48
+ $this->emails['UR_Settings_Registration_Approved_Email'] = include 'emails/class-ur-settings-registration-approved-email.php';
 
 
49
 
50
+ $this->emails['UR_Settings_Registration_Denied_Email'] = include 'emails/class-ur-settings-registration-denied-email.php';
51
 
52
+ $this->emails['UR_Settings_Registration_Pending_Email'] = include 'emails/class-ur-settings-registration-pending-email.php';
53
 
54
+ $this->emails['UR_Settings_Successfully_Registered_Email'] = include 'emails/class-ur-settings-successfully-registered-email.php';
55
+
56
+ $this->emails['UR_Settings_Reset_Password_Email'] = include 'emails/class-ur-settings-reset-password-email.php';
57
 
58
  $this->emails = apply_filters( 'user_registration_email_classes', $this->emails );
59
  }
63
  *
64
  * @return array
65
  */
66
+ public function get_settings() {
67
+ $settings = apply_filters(
68
+ 'user_registration_email_settings',
69
+ array(
70
  array(
71
  'title' => __( 'General Email Settings', 'user-registration' ),
72
  'type' => 'title',
75
  ),
76
 
77
  ur_get_user_login_option(),
78
+
79
  array(
80
  'type' => 'sectionend',
81
  'id' => 'general_email_setting',
82
  ),
83
 
84
+ array(
85
  'title' => __( 'Email notifications', 'user-registration' ),
86
+ 'desc' => __( 'Email notifications sent from user registration are listed below. Click on an email to configure it.', 'user-registration' ),
87
+ 'type' => 'title',
88
+ 'id' => 'email_notification_settings',
89
  ),
90
 
91
  array( 'type' => 'email_notification' ),
92
 
93
+ array(
94
+ 'type' => 'sectionend',
95
+ 'id' => 'email_notification_settings',
96
+ ),
97
 
98
+ array(
99
+ 'type' => 'sectionend',
100
+ 'id' => 'email_recipient_options',
101
+ ),
102
 
103
  array(
104
  'title' => __( 'Email Sender Options', 'user-registration' ),
140
  );
141
  return apply_filters( 'user_registration_get_email_settings_' . $this->id, $settings );
142
  }
143
+
144
  public function get_emails() {
145
  return $this->emails;
146
  }
147
 
148
  public function email_notification_setting() {
149
+ ?>
150
  <tr valign="top">
151
+ <td class="ur_emails_wrapper" colspan="2">
152
  <table class="ur_emails widefat" cellspacing="0">
153
  <thead>
154
  <tr>
155
  <?php
156
+ $columns = apply_filters(
157
+ 'user_registration_email_setting_columns',
158
+ array(
159
+ 'name' => __( 'Email', 'user-registration' ),
160
+ 'actions' => __( 'Configure', 'user-registration' ),
161
+ )
162
+ );
163
+ foreach ( $columns as $key => $column ) {
164
+ echo '<th style="padding-left:15px" class="ur-email-settings-table-' . esc_attr( $key ) . '">' . esc_html( $column ) . '</th>';
165
+ }
166
  ?>
167
  </tr>
168
  </thead>
169
  <tbody>
170
 
171
+ <?php
172
  $emails = $this->get_emails();
173
+ foreach ( $emails as $email ) {
174
  echo '<tr><td class="ur-email-settings-table">
175
+ <a href="' . admin_url( 'admin.php?page=user-registration-settings&tab=email&section=ur_settings_' . $email->id . '' ) .
176
+ '">' . __( $email->title, 'user-registration' ) . '</a>' . ur_help_tip( __( $email->description, 'user-registration' ) ) . '
177
  </td>
178
  <td class="ur-email-settings-table">
179
+ <a class="button tips" data-tip="' . esc_attr__( 'Configure', 'user-registration' ) . '" href="' . admin_url( 'admin.php?page=user-registration-settings&tab=email&section=ur_settings_' . $email->id . '' ) . '"><span class="dashicons dashicons-admin-generic"></span> </a>
180
  </td>
181
+ </tr>';
182
  }
183
  ?>
184
  </tbody>
185
  </table>
186
  </td>
187
  </tr>
188
+ <?php
189
  }
190
+
191
  public function save() {
192
  global $current_section;
193
  $emails = $this->get_emails();
194
 
195
+ foreach ( $emails as $email ) {
196
+ if ( $current_section == 'ur_settings_' . $email->id . '' ) {
197
+ $settings = new $email();
 
 
198
  $settings = $settings->get_settings();
199
  }
200
  }
210
  public function output() {
211
  global $current_section;
212
  $emails = $this->get_emails();
213
+
214
+ foreach ( $emails as $email ) {
215
+ if ( $current_section == 'ur_settings_' . $email->id . '' ) {
216
+ $settings = new $email();
217
  $settings = $settings->get_settings();
218
  }
219
  }
222
 
223
  UR_Admin_Settings::output_fields( $settings );
224
 
225
+ if ( ! empty( $current_section ) ) {
226
  ?>
227
  <div id ="smart-tags">
228
  <a href="https://docs.wpeverest.com/docs/user-registration/email-settings/smart-tags/"><?php echo esc_html__( 'Smart Tags Used', 'user-registration' ); ?></a>
229
  </div>
230
+ <?php
231
  }
232
  }
233
  }
234
 
235
  endif;
236
 
237
+ return new UR_Settings_Email();
includes/admin/settings/class-ur-settings-general.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  if ( ! class_exists( 'UR_Settings_General' ) ) :
@@ -42,9 +42,9 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
42
  public function get_sections() {
43
  $sections = array(
44
  '' => __( 'General Options', 'user-registration' ),
45
- 'login-options' => __( 'Login Options', 'user-registration' ),
46
  'frontend-messages' => __( 'Frontend Messages', 'user-registration' ),
47
- 'export-users' => __( 'Export Users', 'user-registration' ),
48
  );
49
 
50
  return apply_filters( 'user_registration_get_sections_' . $this->id, $sections );
@@ -61,10 +61,11 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
61
 
62
  $all_roles_except_admin = $all_roles;
63
 
64
- unset($all_roles_except_admin['administrator']);
65
 
66
  $settings = apply_filters(
67
- 'user_registration_general_settings', array(
 
68
 
69
  array(
70
  'title' => __( 'General Options', 'user-registration' ),
@@ -72,7 +73,7 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
72
  'desc' => '',
73
  'id' => 'general_options',
74
  ),
75
- array(
76
  'title' => __( 'User login option', 'user-registration' ),
77
  'desc' => __( 'This option lets you choose login option after user registration.', 'user-registration' ),
78
  'id' => 'user_registration_general_setting_login_options',
@@ -132,9 +133,9 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
132
  'css' => 'min-width: 350px;',
133
  'desc_tip' => true,
134
  'options' => array(
135
- 'horizontal' => __( 'Horizontal', 'user-registration' ) ,
136
- 'vertical' => __( 'Vertical', 'user-registration' )
137
- ),
138
  ),
139
  array(
140
  'type' => 'sectionend',
@@ -143,8 +144,8 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
143
  array(
144
  'title' => __( '', 'user-registration' ),
145
  'type' => 'title',
146
- 'desc' => '<strong>'. __( 'Endpoints: ','user-registration' ). '</strong>' . __( 'Endpoints are appended to your page URLs to handle specific actions on the accounts pages. They should be unique and can be left blank to disable the endpoint.', 'user-registration' ),
147
- 'css' => 'min-width: 250px;',
148
  'id' => 'account_endpoint_options',
149
  ),
150
  array(
@@ -191,12 +192,14 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
191
 
192
  /**
193
  * Settings for frontend messages customization.
 
194
  * @return array
195
  */
196
  public function get_frontend_messages_settings() {
197
 
198
  $settings = apply_filters(
199
- 'user_registration_frontend_messages_settings', array(
 
200
 
201
  array(
202
  'title' => __( 'Success Messages', 'user-registration' ),
@@ -212,7 +215,7 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
212
  'type' => 'textarea',
213
  'desc_tip' => true,
214
  'css' => 'min-width: 350px; min-height: 100px;',
215
- 'default' => __( 'User successfully registered.','user-registration' ),
216
  ),
217
 
218
  array(
@@ -222,7 +225,7 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
222
  'type' => 'textarea',
223
  'desc_tip' => true,
224
  'css' => 'min-width: 350px; min-height: 100px;',
225
- 'default' => __( 'User registered. Verify your email by clicking on the link sent to your email.','user-registration' ),
226
  ),
227
 
228
  array(
@@ -232,7 +235,7 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
232
  'type' => 'textarea',
233
  'desc_tip' => true,
234
  'css' => 'min-width: 350px; min-height: 100px;',
235
- 'default' => __( 'User registered. Wait until admin approves your registration.','user-registration' ),
236
  ),
237
 
238
  array(
@@ -314,16 +317,18 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
314
  )
315
  );
316
 
317
- return apply_filters( 'user_registration_get_frontend_messages_settings_'. $this->id, $settings );
318
  }
319
 
320
  /**
321
  * Get settings for login form
 
322
  * @return array
323
  */
324
  public function get_login_options_settings() {
325
  $settings = apply_filters(
326
- 'user_registration_login_options_settings', array(
 
327
 
328
  array(
329
  'title' => __( 'Login Options', 'user-registration' ),
@@ -341,11 +346,11 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
341
  'css' => 'min-width: 350px;',
342
  'default' => 'default',
343
  'options' => array(
344
- 'default' => __( 'Default', 'user-registration' ),
345
- 'bordered' => __( 'Bordered', 'user-registration' ),
346
- 'flat' => __( 'Flat', 'user-registration' ),
347
- 'rounded' => __( 'Rounded', 'user-registration' ),
348
- 'rounded_edge' => __( 'Rounded Edge', 'user-registration' ),
349
  ),
350
  ),
351
 
@@ -395,7 +400,7 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
395
  'type' => 'text',
396
  'desc_tip' => true,
397
  'css' => 'min-width: 350px;',
398
- 'default' => __( 'Not a member yet? Register now.','user-registration' )
399
  ),
400
 
401
  array(
@@ -405,7 +410,7 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
405
  )
406
  );
407
 
408
- return apply_filters( 'user_registration_get_login_options_settings_'. $this->id, $settings );
409
  }
410
 
411
  /**
@@ -414,14 +419,14 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
414
  public function output() {
415
 
416
  global $current_section;
417
- if( $current_section === '') {
418
  $settings = $this->get_settings();
419
 
420
  } elseif ( $current_section === 'frontend-messages' ) {
421
  $settings = $this->get_frontend_messages_settings();
422
- } elseif( $current_section === 'login-options' ) {
423
  $settings = $this->get_login_options_settings();
424
- } elseif( $current_section === 'export-users') {
425
  $settings = array();
426
  UR_Admin_Export_Users::output();
427
  }
@@ -437,14 +442,14 @@ if ( ! class_exists( 'UR_Settings_General' ) ) :
437
  global $current_section;
438
  $settings = $this->get_settings();
439
 
440
- if( $current_section === '' ) {
441
  $settings = $this->get_settings();
442
 
443
  } elseif ( $current_section === 'frontend-messages' ) {
444
  $settings = $this->get_frontend_messages_settings();
445
- } elseif( $current_section === 'login-options' ) {
446
  $settings = $this->get_login_options_settings();
447
- } elseif( $current_section === 'export-users' ) {
448
  $settings = array();
449
  }
450
 
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  if ( ! class_exists( 'UR_Settings_General' ) ) :
42
  public function get_sections() {
43
  $sections = array(
44
  '' => __( 'General Options', 'user-registration' ),
45
+ 'login-options' => __( 'Login Options', 'user-registration' ),
46
  'frontend-messages' => __( 'Frontend Messages', 'user-registration' ),
47
+ 'export-users' => __( 'Export Users', 'user-registration' ),
48
  );
49
 
50
  return apply_filters( 'user_registration_get_sections_' . $this->id, $sections );
61
 
62
  $all_roles_except_admin = $all_roles;
63
 
64
+ unset( $all_roles_except_admin['administrator'] );
65
 
66
  $settings = apply_filters(
67
+ 'user_registration_general_settings',
68
+ array(
69
 
70
  array(
71
  'title' => __( 'General Options', 'user-registration' ),
73
  'desc' => '',
74
  'id' => 'general_options',
75
  ),
76
+ array(
77
  'title' => __( 'User login option', 'user-registration' ),
78
  'desc' => __( 'This option lets you choose login option after user registration.', 'user-registration' ),
79
  'id' => 'user_registration_general_setting_login_options',
133
  'css' => 'min-width: 350px;',
134
  'desc_tip' => true,
135
  'options' => array(
136
+ 'horizontal' => __( 'Horizontal', 'user-registration' ),
137
+ 'vertical' => __( 'Vertical', 'user-registration' ),
138
+ ),
139
  ),
140
  array(
141
  'type' => 'sectionend',
144
  array(
145
  'title' => __( '', 'user-registration' ),
146
  'type' => 'title',
147
+ 'desc' => '<strong>' . __( 'Endpoints: ', 'user-registration' ) . '</strong>' . __( 'Endpoints are appended to your page URLs to handle specific actions on the accounts pages. They should be unique and can be left blank to disable the endpoint.', 'user-registration' ),
148
+ 'css' => 'min-width: 250px;',
149
  'id' => 'account_endpoint_options',
150
  ),
151
  array(
192
 
193
  /**
194
  * Settings for frontend messages customization.
195
+ *
196
  * @return array
197
  */
198
  public function get_frontend_messages_settings() {
199
 
200
  $settings = apply_filters(
201
+ 'user_registration_frontend_messages_settings',
202
+ array(
203
 
204
  array(
205
  'title' => __( 'Success Messages', 'user-registration' ),
215
  'type' => 'textarea',
216
  'desc_tip' => true,
217
  'css' => 'min-width: 350px; min-height: 100px;',
218
+ 'default' => __( 'User successfully registered.', 'user-registration' ),
219
  ),
220
 
221
  array(
225
  'type' => 'textarea',
226
  'desc_tip' => true,
227
  'css' => 'min-width: 350px; min-height: 100px;',
228
+ 'default' => __( 'User registered. Verify your email by clicking on the link sent to your email.', 'user-registration' ),
229
  ),
230
 
231
  array(
235
  'type' => 'textarea',
236
  'desc_tip' => true,
237
  'css' => 'min-width: 350px; min-height: 100px;',
238
+ 'default' => __( 'User registered. Wait until admin approves your registration.', 'user-registration' ),
239
  ),
240
 
241
  array(
317
  )
318
  );
319
 
320
+ return apply_filters( 'user_registration_get_frontend_messages_settings_' . $this->id, $settings );
321
  }
322
 
323
  /**
324
  * Get settings for login form
325
+ *
326
  * @return array
327
  */
328
  public function get_login_options_settings() {
329
  $settings = apply_filters(
330
+ 'user_registration_login_options_settings',
331
+ array(
332
 
333
  array(
334
  'title' => __( 'Login Options', 'user-registration' ),
346
  'css' => 'min-width: 350px;',
347
  'default' => 'default',
348
  'options' => array(
349
+ 'default' => __( 'Default', 'user-registration' ),
350
+ 'bordered' => __( 'Bordered', 'user-registration' ),
351
+ 'flat' => __( 'Flat', 'user-registration' ),
352
+ 'rounded' => __( 'Rounded', 'user-registration' ),
353
+ 'rounded_edge' => __( 'Rounded Edge', 'user-registration' ),
354
  ),
355
  ),
356
 
400
  'type' => 'text',
401
  'desc_tip' => true,
402
  'css' => 'min-width: 350px;',
403
+ 'default' => __( 'Not a member yet? Register now.', 'user-registration' ),
404
  ),
405
 
406
  array(
410
  )
411
  );
412
 
413
+ return apply_filters( 'user_registration_get_login_options_settings_' . $this->id, $settings );
414
  }
415
 
416
  /**
419
  public function output() {
420
 
421
  global $current_section;
422
+ if ( $current_section === '' ) {
423
  $settings = $this->get_settings();
424
 
425
  } elseif ( $current_section === 'frontend-messages' ) {
426
  $settings = $this->get_frontend_messages_settings();
427
+ } elseif ( $current_section === 'login-options' ) {
428
  $settings = $this->get_login_options_settings();
429
+ } elseif ( $current_section === 'export-users' ) {
430
  $settings = array();
431
  UR_Admin_Export_Users::output();
432
  }
442
  global $current_section;
443
  $settings = $this->get_settings();
444
 
445
+ if ( $current_section === '' ) {
446
  $settings = $this->get_settings();
447
 
448
  } elseif ( $current_section === 'frontend-messages' ) {
449
  $settings = $this->get_frontend_messages_settings();
450
+ } elseif ( $current_section === 'login-options' ) {
451
  $settings = $this->get_login_options_settings();
452
+ } elseif ( $current_section === 'export-users' ) {
453
  $settings = array();
454
  }
455
 
includes/admin/settings/class-ur-settings-integration.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  if ( ! class_exists( 'UR_Settings_Integration ' ) ) :
@@ -41,7 +41,8 @@ if ( ! class_exists( 'UR_Settings_Integration ' ) ) :
41
  public function get_settings() {
42
 
43
  $settings = apply_filters(
44
- 'user_registration_integration_settings', array(
 
45
  array(
46
  'title' => __( 'Google reCaptcha Integation', 'user-registration' ),
47
  'type' => 'title',
@@ -50,20 +51,20 @@ if ( ! class_exists( 'UR_Settings_Integration ' ) ) :
50
  ),
51
  array(
52
  'title' => __( 'Version', 'user-registration' ),
53
- 'desc' => __( 'Select the google reCaptcha version', 'user-registration' ) ,
54
  'id' => 'user_registration_integration_setting_recaptcha_version',
55
  'default' => 'v2',
56
  'type' => 'radio',
57
  'class' => '',
58
  'desc_tip' => true,
59
  'options' => array(
60
- 'v2' => 'reCaptcha v2',
61
- 'v3' => 'reCaptcha v3',
62
- )
63
  ),
64
  array(
65
  'title' => __( 'Site Key (v2)', 'user-registration' ),
66
- 'desc' => sprintf( __('Get site key from google %1$s reCaptcha %2$s.', 'user-registration' ), '<a href="https://www.google.com/recaptcha" target="_blank">', '</a>' ),
67
  'id' => 'user_registration_integration_setting_recaptcha_site_key',
68
  'default' => '',
69
  'type' => 'text',
@@ -74,7 +75,7 @@ if ( ! class_exists( 'UR_Settings_Integration ' ) ) :
74
  ),
75
  array(
76
  'title' => __( 'Secret Key (v2)', 'user-registration' ),
77
- 'desc' => sprintf( __('Get secret key from google %1$s reCaptcha %2$s.', 'user-registration' ), '<a href="https://www.google.com/recaptcha" target="_blank">', '</a>' ),
78
  'id' => 'user_registration_integration_setting_recaptcha_site_secret',
79
  'default' => '',
80
  'type' => 'text',
@@ -84,7 +85,7 @@ if ( ! class_exists( 'UR_Settings_Integration ' ) ) :
84
  ),
85
  array(
86
  'title' => __( 'Site Key (v3)', 'user-registration' ),
87
- 'desc' => sprintf( __('Get site key from google %1$s reCaptcha %2$s.', 'user-registration' ), '<a href="https://www.google.com/recaptcha" target="_blank">', '</a>' ),
88
  'id' => 'user_registration_integration_setting_recaptcha_site_key_v3',
89
  'default' => '',
90
  'type' => 'text',
@@ -95,7 +96,7 @@ if ( ! class_exists( 'UR_Settings_Integration ' ) ) :
95
  ),
96
  array(
97
  'title' => __( 'Secret Key (v3)', 'user-registration' ),
98
- 'desc' => sprintf( __('Get secret key from google %1$s reCaptcha %2$s.', 'user-registration' ), '<a href="https://www.google.com/recaptcha" target="_blank">', '</a>' ),
99
  'id' => 'user_registration_integration_setting_recaptcha_site_secret_v3',
100
  'default' => '',
101
  'type' => 'text',
@@ -124,4 +125,4 @@ if ( ! class_exists( 'UR_Settings_Integration ' ) ) :
124
 
125
  endif;
126
 
127
- return new UR_Settings_Integration ();
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  if ( ! class_exists( 'UR_Settings_Integration ' ) ) :
41
  public function get_settings() {
42
 
43
  $settings = apply_filters(
44
+ 'user_registration_integration_settings',
45
+ array(
46
  array(
47
  'title' => __( 'Google reCaptcha Integation', 'user-registration' ),
48
  'type' => 'title',
51
  ),
52
  array(
53
  'title' => __( 'Version', 'user-registration' ),
54
+ 'desc' => __( 'Select the google reCaptcha version', 'user-registration' ),
55
  'id' => 'user_registration_integration_setting_recaptcha_version',
56
  'default' => 'v2',
57
  'type' => 'radio',
58
  'class' => '',
59
  'desc_tip' => true,
60
  'options' => array(
61
+ 'v2' => 'reCaptcha v2',
62
+ 'v3' => 'reCaptcha v3',
63
+ ),
64
  ),
65
  array(
66
  'title' => __( 'Site Key (v2)', 'user-registration' ),
67
+ 'desc' => sprintf( __( 'Get site key from google %1$s reCaptcha %2$s.', 'user-registration' ), '<a href="https://www.google.com/recaptcha" target="_blank">', '</a>' ),
68
  'id' => 'user_registration_integration_setting_recaptcha_site_key',
69
  'default' => '',
70
  'type' => 'text',
75
  ),
76
  array(
77
  'title' => __( 'Secret Key (v2)', 'user-registration' ),
78
+ 'desc' => sprintf( __( 'Get secret key from google %1$s reCaptcha %2$s.', 'user-registration' ), '<a href="https://www.google.com/recaptcha" target="_blank">', '</a>' ),
79
  'id' => 'user_registration_integration_setting_recaptcha_site_secret',
80
  'default' => '',
81
  'type' => 'text',
85
  ),
86
  array(
87
  'title' => __( 'Site Key (v3)', 'user-registration' ),
88
+ 'desc' => sprintf( __( 'Get site key from google %1$s reCaptcha %2$s.', 'user-registration' ), '<a href="https://www.google.com/recaptcha" target="_blank">', '</a>' ),
89
  'id' => 'user_registration_integration_setting_recaptcha_site_key_v3',
90
  'default' => '',
91
  'type' => 'text',
96
  ),
97
  array(
98
  'title' => __( 'Secret Key (v3)', 'user-registration' ),
99
+ 'desc' => sprintf( __( 'Get secret key from google %1$s reCaptcha %2$s.', 'user-registration' ), '<a href="https://www.google.com/recaptcha" target="_blank">', '</a>' ),
100
  'id' => 'user_registration_integration_setting_recaptcha_site_secret_v3',
101
  'default' => '',
102
  'type' => 'text',
125
 
126
  endif;
127
 
128
+ return new UR_Settings_Integration();
includes/admin/settings/class-ur-settings-page.php CHANGED
@@ -9,7 +9,7 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit; // Exit if accessed directly
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Page', false ) ) :
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Page', false ) ) :
includes/admin/settings/emails/class-ur-settings-admin-email.php CHANGED
@@ -9,98 +9,106 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Admin_Email', false ) ) :
16
 
17
- /**
18
- * UR_Settings_Admin_Email Class.
19
- */
20
- class UR_Settings_Admin_Email{
21
-
22
- public function __construct() {
23
- $this->id = 'admin_email';
24
- $this->title = __( 'Admin Email', 'user-registration' );
25
- $this->description = __( 'Email sent to the admin when a new user registers', 'user-registration' );
26
- }
27
-
28
  /**
29
- * Get settings
30
- *
31
- * @return array
32
  */
33
- public function get_settings() {
34
 
35
- ?><h2><?php echo esc_html__('Admin Email','user-registration'); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
 
 
 
 
36
 
37
- <?php
38
- $settings = apply_filters(
39
- 'user_registration_admin_email', array(
40
- array(
41
- 'type' => 'title',
42
- 'desc' => '',
43
- 'id' => 'admin_email',
44
- ),
45
- array(
46
- 'title' => __( 'Enable this email', 'user-registration' ),
47
- 'desc' => __( 'Enable this email sent to admin after successful user registration.', 'user-registration' ),
48
- 'id' => 'user_registration_enable_admin_email',
49
- 'default' => 'yes',
50
- 'type' => 'checkbox',
51
- 'autoload' => false,
52
- ),
53
- array(
54
- 'title' => __( 'Email Receipents', 'user-registration' ),
55
- 'desc' => __( 'Use comma to send emails to multiple receipents.', 'user-registration' ),
56
- 'id' => 'user_registration_admin_email_receipents',
57
- 'default' => get_option( 'admin_email' ),
58
- 'type' => 'text',
59
- 'css' => 'min-width: 350px;',
60
- 'autoload' => false,
61
- 'desc_tip' => true,
62
- ),
63
- array(
64
- 'title' => __( 'Email Subject', 'user-registration' ),
65
- 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
66
- 'id' => 'user_registration_admin_email_subject',
67
- 'type' => 'text',
68
- 'default' => __('A New User Registered', 'user-registration'),
69
- 'css' => 'min-width: 350px;',
70
- 'desc_tip' => true,
71
- ),
72
- array(
73
- 'title' => __( 'Email Content', 'user-registration' ),
74
- 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
75
- 'id' => 'user_registration_admin_email',
76
- 'type' => 'tinymce',
77
- 'default' => $this->ur_get_admin_email(),
78
- 'css' => 'min-width: 350px;',
79
- 'desc_tip' => true,
80
- ),
81
  array(
82
- 'type' => 'sectionend',
83
- 'id' => 'admin_email',
84
- ),
85
- )
86
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
 
88
- return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
89
- }
90
- public function ur_get_admin_email() {
91
-
92
- $message = apply_filters( 'user_registration_admin_email_message', sprintf( __(
93
- 'Hi Admin,
 
 
 
94
 
95
  A new user {{username}} - {{email}} has successfully registered to your site <a href="{{home_url}}">{{blog_info}}</a>.
96
 
97
  Please review the user role and details at \'<b>Users</b>\' menu in your WP dashboard.
98
 
99
- Thank You!', 'user-registration' ) ) );
 
 
 
 
100
 
101
- return $message;
 
102
  }
103
- }
104
  endif;
105
 
106
  return new UR_Settings_Admin_Email();
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Admin_Email', false ) ) :
16
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
+ * UR_Settings_Admin_Email Class.
 
 
19
  */
20
+ class UR_Settings_Admin_Email {
21
 
22
+ public function __construct() {
23
+ $this->id = 'admin_email';
24
+ $this->title = __( 'Admin Email', 'user-registration' );
25
+ $this->description = __( 'Email sent to the admin when a new user registers', 'user-registration' );
26
+ }
27
 
28
+ /**
29
+ * Get settings
30
+ *
31
+ * @return array
32
+ */
33
+ public function get_settings() {
34
+
35
+ ?><h2><?php echo esc_html__( 'Admin Email', 'user-registration' ); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
36
+
37
+ <?php
38
+ $settings = apply_filters(
39
+ 'user_registration_admin_email',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  array(
41
+ array(
42
+ 'type' => 'title',
43
+ 'desc' => '',
44
+ 'id' => 'admin_email',
45
+ ),
46
+ array(
47
+ 'title' => __( 'Enable this email', 'user-registration' ),
48
+ 'desc' => __( 'Enable this email sent to admin after successful user registration.', 'user-registration' ),
49
+ 'id' => 'user_registration_enable_admin_email',
50
+ 'default' => 'yes',
51
+ 'type' => 'checkbox',
52
+ 'autoload' => false,
53
+ ),
54
+ array(
55
+ 'title' => __( 'Email Receipents', 'user-registration' ),
56
+ 'desc' => __( 'Use comma to send emails to multiple receipents.', 'user-registration' ),
57
+ 'id' => 'user_registration_admin_email_receipents',
58
+ 'default' => get_option( 'admin_email' ),
59
+ 'type' => 'text',
60
+ 'css' => 'min-width: 350px;',
61
+ 'autoload' => false,
62
+ 'desc_tip' => true,
63
+ ),
64
+ array(
65
+ 'title' => __( 'Email Subject', 'user-registration' ),
66
+ 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
67
+ 'id' => 'user_registration_admin_email_subject',
68
+ 'type' => 'text',
69
+ 'default' => __( 'A New User Registered', 'user-registration' ),
70
+ 'css' => 'min-width: 350px;',
71
+ 'desc_tip' => true,
72
+ ),
73
+ array(
74
+ 'title' => __( 'Email Content', 'user-registration' ),
75
+ 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
76
+ 'id' => 'user_registration_admin_email',
77
+ 'type' => 'tinymce',
78
+ 'default' => $this->ur_get_admin_email(),
79
+ 'css' => 'min-width: 350px;',
80
+ 'desc_tip' => true,
81
+ ),
82
+ array(
83
+ 'type' => 'sectionend',
84
+ 'id' => 'admin_email',
85
+ ),
86
+ )
87
+ );
88
 
89
+ return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
90
+ }
91
+ public function ur_get_admin_email() {
92
+
93
+ $message = apply_filters(
94
+ 'user_registration_admin_email_message',
95
+ sprintf(
96
+ __(
97
+ 'Hi Admin,
98
 
99
  A new user {{username}} - {{email}} has successfully registered to your site <a href="{{home_url}}">{{blog_info}}</a>.
100
 
101
  Please review the user role and details at \'<b>Users</b>\' menu in your WP dashboard.
102
 
103
+ Thank You!',
104
+ 'user-registration'
105
+ )
106
+ )
107
+ );
108
 
109
+ return $message;
110
+ }
111
  }
 
112
  endif;
113
 
114
  return new UR_Settings_Admin_Email();
includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php CHANGED
@@ -9,91 +9,99 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Awaiting_Admin_Approval_Email', false ) ) :
16
 
17
- /**
18
- * UR_Settings_Awaiting_Admin_Approval_Email Class.
19
- */
20
- class UR_Settings_Awaiting_Admin_Approval_Email{
21
-
22
-
23
- public function __construct() {
24
- $this->id = 'awaiting_admin_approval_email';
25
- $this->title = __( 'Awaiting Admin Approval', 'user-registration' );
26
- $this->description = __( 'Email sent to the user notifying the registration is awaiting admin approval', 'user-registration' );
27
- }
28
-
29
  /**
30
- * Get settings
31
- *
32
- * @return array
33
  */
34
- public function get_settings() {
35
 
36
- ?><h2><?php echo esc_html__('Awaiting Admin Approval Email','user-registration'); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
37
 
38
- <?php
39
- $settings = apply_filters(
40
- 'user_registration_awaiting_admin_approval', array(
41
- array(
42
- 'type' => 'title',
43
- 'desc' => '',
44
- 'id' => 'awaiting_admin_approval_email',
45
- ),
46
- array(
47
- 'title' => __( 'Enable this email', 'user-registration' ),
48
- 'desc' => __( 'Enable this email sent to user notifying the registration is awaiting admin approval.', 'user-registration' ),
49
- 'id' => 'user_registration_enable_awaiting_admin_approval_email',
50
- 'default' => 'yes',
51
- 'type' => 'checkbox',
52
- 'autoload' => false,
53
- ),
54
- array(
55
- 'title' => __( 'Email Subject', 'user-registration' ),
56
- 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
57
- 'id' => 'user_registration_awaiting_admin_approval_email_subject',
58
- 'type' => 'text',
59
- 'default' => __('Thank you for registration on {{blog_info}}', 'user-registration'),
60
- 'css' => 'min-width: 350px;',
61
- 'desc_tip' => true,
62
- ),
63
- array(
64
- 'title' => __( 'Email Content', 'user-registration' ),
65
- 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
66
- 'id' => 'user_registration_awaiting_admin_approval_email',
67
- 'type' => 'tinymce',
68
- 'default' => $this->ur_get_awaiting_admin_approval_email(),
69
- 'css' => 'min-width: 350px;',
70
- 'desc_tip' => true,
71
- ),
72
  array(
73
- 'type' => 'sectionend',
74
- 'id' => 'awaiting_admin_approval_email',
75
- ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
- )
78
- );
79
 
80
- return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
81
- }
 
 
82
 
83
- public function ur_get_awaiting_admin_approval_email() {
84
-
85
- $message = apply_filters( 'user_registration_get_awaiting_admin_approval_email', sprintf( __(
86
- 'Hi {{username}},
 
87
 
88
  You have registered on <a href="{{home_url}}">{{blog_info}}</a>.
89
-
90
  Please wait until the site admin approves your registration. You will be notified after it is approved.
91
 
92
- Thank You!', 'user-registration' ) ) );
 
 
 
 
93
 
94
- return $message;
 
95
  }
96
- }
97
  endif;
98
 
99
  return new UR_Settings_Awaiting_Admin_Approval_Email();
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Awaiting_Admin_Approval_Email', false ) ) :
16
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
+ * UR_Settings_Awaiting_Admin_Approval_Email Class.
 
 
19
  */
20
+ class UR_Settings_Awaiting_Admin_Approval_Email {
21
 
 
22
 
23
+ public function __construct() {
24
+ $this->id = 'awaiting_admin_approval_email';
25
+ $this->title = __( 'Awaiting Admin Approval', 'user-registration' );
26
+ $this->description = __( 'Email sent to the user notifying the registration is awaiting admin approval', 'user-registration' );
27
+ }
28
+
29
+ /**
30
+ * Get settings
31
+ *
32
+ * @return array
33
+ */
34
+ public function get_settings() {
35
+
36
+ ?><h2><?php echo esc_html__( 'Awaiting Admin Approval Email', 'user-registration' ); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
37
+
38
+ <?php
39
+ $settings = apply_filters(
40
+ 'user_registration_awaiting_admin_approval',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  array(
42
+ array(
43
+ 'type' => 'title',
44
+ 'desc' => '',
45
+ 'id' => 'awaiting_admin_approval_email',
46
+ ),
47
+ array(
48
+ 'title' => __( 'Enable this email', 'user-registration' ),
49
+ 'desc' => __( 'Enable this email sent to user notifying the registration is awaiting admin approval.', 'user-registration' ),
50
+ 'id' => 'user_registration_enable_awaiting_admin_approval_email',
51
+ 'default' => 'yes',
52
+ 'type' => 'checkbox',
53
+ 'autoload' => false,
54
+ ),
55
+ array(
56
+ 'title' => __( 'Email Subject', 'user-registration' ),
57
+ 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
58
+ 'id' => 'user_registration_awaiting_admin_approval_email_subject',
59
+ 'type' => 'text',
60
+ 'default' => __( 'Thank you for registration on {{blog_info}}', 'user-registration' ),
61
+ 'css' => 'min-width: 350px;',
62
+ 'desc_tip' => true,
63
+ ),
64
+ array(
65
+ 'title' => __( 'Email Content', 'user-registration' ),
66
+ 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
67
+ 'id' => 'user_registration_awaiting_admin_approval_email',
68
+ 'type' => 'tinymce',
69
+ 'default' => $this->ur_get_awaiting_admin_approval_email(),
70
+ 'css' => 'min-width: 350px;',
71
+ 'desc_tip' => true,
72
+ ),
73
+ array(
74
+ 'type' => 'sectionend',
75
+ 'id' => 'awaiting_admin_approval_email',
76
+ ),
77
 
78
+ )
79
+ );
80
 
81
+ return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
82
+ }
83
+
84
+ public function ur_get_awaiting_admin_approval_email() {
85
 
86
+ $message = apply_filters(
87
+ 'user_registration_get_awaiting_admin_approval_email',
88
+ sprintf(
89
+ __(
90
+ 'Hi {{username}},
91
 
92
  You have registered on <a href="{{home_url}}">{{blog_info}}</a>.
93
+
94
  Please wait until the site admin approves your registration. You will be notified after it is approved.
95
 
96
+ Thank You!',
97
+ 'user-registration'
98
+ )
99
+ )
100
+ );
101
 
102
+ return $message;
103
+ }
104
  }
 
105
  endif;
106
 
107
  return new UR_Settings_Awaiting_Admin_Approval_Email();
includes/admin/settings/emails/class-ur-settings-email-confirmation.php CHANGED
@@ -9,84 +9,92 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Email_Confirmation', false ) ) :
16
 
17
- /**
18
- * UR_Settings_Email_Confirmation Class.
19
- */
20
- class UR_Settings_Email_Confirmation{
21
-
22
- public function __construct() {
23
- $this->id = 'email_confirmation';
24
- $this->title = __( 'Email Confirmation', 'user-registration' );
25
- $this->description = __( 'Email sent to the user with a verification link when email confirmation to register option is choosen', 'user-registration' );
26
- }
27
-
28
  /**
29
- * Get settings
30
- *
31
- * @return array
32
  */
33
- public function get_settings() {
34
-
35
- ?><h2><?php echo esc_html__('Email Confirmation','user-registration'); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
36
-
37
- <?php
38
- $settings = apply_filters(
39
- 'user_registration_email_confirmation', array(
40
-
41
- array(
42
- 'type' => 'title',
43
- 'desc' => '',
44
- 'id' => 'email_confirmation',
45
- ),
 
 
 
 
 
 
 
46
  array(
47
- 'title' => __( 'Email Subject', 'user-registration' ),
48
- 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
49
- 'id' => 'user_registration_email_confirmation_subject',
50
- 'type' => 'text',
51
- 'default' => __('Please confirm your registration on {{blog_info}}', 'user-registration'),
52
- 'css' => 'min-width: 350px;',
53
- 'desc_tip' => true,
54
- ),
55
 
56
- array(
57
- 'title' => __( 'Email Content', 'user-registration' ),
58
- 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
59
- 'id' => 'user_registration_email_confirmation',
60
- 'type' => 'tinymce',
61
- 'default' => $this->ur_get_email_confirmation(),
62
- 'css' => 'min-width: 350px;',
63
- 'desc_tip' => true,
64
- ),
65
-
66
- array(
67
- 'type' => 'sectionend',
68
- 'id' => 'email_confirmation',
69
- ),
70
-
71
- )
72
- );
73
-
74
- return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
75
- }
76
-
77
- public function ur_get_email_confirmation() {
78
-
79
- $message = apply_filters( 'user_registration_get_email_confirmation', sprintf( __(
80
- 'Hi {{username}},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
 
82
  You have registered on <a href="{{home_url}}">{{blog_info}}</a>.
83
 
84
  Please click on this verification link {{home_url}}/wp-login.php?ur_token={{email_token}} to confirm registration.
85
 
86
- Thank You!', 'user-registration' ) ) );
87
- return $message;
 
 
 
 
 
88
  }
89
- }
90
  endif;
91
 
92
  return new UR_Settings_Email_Confirmation();
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Email_Confirmation', false ) ) :
16
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
+ * UR_Settings_Email_Confirmation Class.
 
 
19
  */
20
+ class UR_Settings_Email_Confirmation {
21
+
22
+ public function __construct() {
23
+ $this->id = 'email_confirmation';
24
+ $this->title = __( 'Email Confirmation', 'user-registration' );
25
+ $this->description = __( 'Email sent to the user with a verification link when email confirmation to register option is choosen', 'user-registration' );
26
+ }
27
+
28
+ /**
29
+ * Get settings
30
+ *
31
+ * @return array
32
+ */
33
+ public function get_settings() {
34
+
35
+ ?><h2><?php echo esc_html__( 'Email Confirmation', 'user-registration' ); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
36
+
37
+ <?php
38
+ $settings = apply_filters(
39
+ 'user_registration_email_confirmation',
40
  array(
 
 
 
 
 
 
 
 
41
 
42
+ array(
43
+ 'type' => 'title',
44
+ 'desc' => '',
45
+ 'id' => 'email_confirmation',
46
+ ),
47
+ array(
48
+ 'title' => __( 'Email Subject', 'user-registration' ),
49
+ 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
50
+ 'id' => 'user_registration_email_confirmation_subject',
51
+ 'type' => 'text',
52
+ 'default' => __( 'Please confirm your registration on {{blog_info}}', 'user-registration' ),
53
+ 'css' => 'min-width: 350px;',
54
+ 'desc_tip' => true,
55
+ ),
56
+
57
+ array(
58
+ 'title' => __( 'Email Content', 'user-registration' ),
59
+ 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
60
+ 'id' => 'user_registration_email_confirmation',
61
+ 'type' => 'tinymce',
62
+ 'default' => $this->ur_get_email_confirmation(),
63
+ 'css' => 'min-width: 350px;',
64
+ 'desc_tip' => true,
65
+ ),
66
+
67
+ array(
68
+ 'type' => 'sectionend',
69
+ 'id' => 'email_confirmation',
70
+ ),
71
+
72
+ )
73
+ );
74
+
75
+ return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
76
+ }
77
+
78
+ public function ur_get_email_confirmation() {
79
+
80
+ $message = apply_filters(
81
+ 'user_registration_get_email_confirmation',
82
+ sprintf(
83
+ __(
84
+ 'Hi {{username}},
85
 
86
  You have registered on <a href="{{home_url}}">{{blog_info}}</a>.
87
 
88
  Please click on this verification link {{home_url}}/wp-login.php?ur_token={{email_token}} to confirm registration.
89
 
90
+ Thank You!',
91
+ 'user-registration'
92
+ )
93
+ )
94
+ );
95
+ return $message;
96
+ }
97
  }
 
98
  endif;
99
 
100
  return new UR_Settings_Email_Confirmation();
includes/admin/settings/emails/class-ur-settings-registration-approved-email.php CHANGED
@@ -9,91 +9,99 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Registration_Approved_Email', false ) ) :
16
 
17
- /**
18
- * UR_Settings_Registration_Approved_Email Class.
19
- */
20
- class UR_Settings_Registration_Approved_Email{
21
-
22
-
23
- public function __construct() {
24
- $this->id = 'registration_approved_email';
25
- $this->title = __( 'Registration Approved Email', 'user-registration' );
26
- $this->description = __( 'Email sent to the user notifying the registration is approved by site admin', 'user-registration' );
27
- }
28
-
29
  /**
30
- * Get settings
31
- *
32
- * @return array
33
  */
34
- public function get_settings() {
35
 
36
- ?><h2><?php echo esc_html__('Registration Approved Email','user-registration'); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
37
 
38
- <?php
39
- $settings = apply_filters(
40
- 'user_registration_registration_approved_email', array(
41
- array(
42
- 'type' => 'title',
43
- 'desc' => '',
44
- 'id' => 'registration_approved_email',
45
- ),
46
- array(
47
- 'title' => __( 'Enable this email', 'user-registration' ),
48
- 'desc' => __( 'Enable this email sent to the user notifying the registration is approved by site admin.', 'user-registration' ),
49
- 'id' => 'user_registration_enable_registration_approved_email',
50
- 'default' => 'yes',
51
- 'type' => 'checkbox',
52
- 'autoload' => false,
53
- ),
54
- array(
55
- 'title' => __( 'Email Subject', 'user-registration' ),
56
- 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
57
- 'id' => 'user_registration_registration_approved_email_subject',
58
- 'type' => 'text',
59
- 'default' => __('Congratulations! Registration approved on {{blog_info}}', 'user-registration'),
60
- 'css' => 'min-width: 350px;',
61
- 'desc_tip' => true,
62
- ),
63
- array(
64
- 'title' => __( 'Email Content', 'user-registration' ),
65
- 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
66
- 'id' => 'user_registration_registration_approved_email',
67
- 'type' => 'tinymce',
68
- 'default' => $this->ur_get_registration_approved_email(),
69
- 'css' => 'min-width: 350px;',
70
- 'desc_tip' => true,
71
- ),
72
- array(
73
- 'type' => 'sectionend',
74
- 'id' => 'registration_approved_email',
75
- ),
76
 
77
- )
78
- );
 
 
 
 
79
 
80
- return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
81
- }
82
 
83
- public function ur_get_registration_approved_email() {
84
-
85
- $message = apply_filters( 'user_registration_get_registration_approved_email', sprintf( __(
86
- 'Hi {{username}},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
 
88
  Your registration on <a href="{{home_url}}">{{blog_info}}</a> has been approved.
89
 
90
  Please visit \'<b>My Account</b>\' page to edit your account details and create your user profile on <a href="{{home_url}}">{{blog_info}}</a>.
91
 
92
- Thank You!', 'user-registration' ) ) );
 
 
 
 
93
 
94
- return $message;
 
95
  }
96
- }
97
  endif;
98
 
99
  return new UR_Settings_Registration_Approved_Email();
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Registration_Approved_Email', false ) ) :
16
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
+ * UR_Settings_Registration_Approved_Email Class.
 
 
19
  */
20
+ class UR_Settings_Registration_Approved_Email {
21
 
 
22
 
23
+ public function __construct() {
24
+ $this->id = 'registration_approved_email';
25
+ $this->title = __( 'Registration Approved Email', 'user-registration' );
26
+ $this->description = __( 'Email sent to the user notifying the registration is approved by site admin', 'user-registration' );
27
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
+ /**
30
+ * Get settings
31
+ *
32
+ * @return array
33
+ */
34
+ public function get_settings() {
35
 
36
+ ?><h2><?php echo esc_html__( 'Registration Approved Email', 'user-registration' ); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
 
37
 
38
+ <?php
39
+ $settings = apply_filters(
40
+ 'user_registration_registration_approved_email',
41
+ array(
42
+ array(
43
+ 'type' => 'title',
44
+ 'desc' => '',
45
+ 'id' => 'registration_approved_email',
46
+ ),
47
+ array(
48
+ 'title' => __( 'Enable this email', 'user-registration' ),
49
+ 'desc' => __( 'Enable this email sent to the user notifying the registration is approved by site admin.', 'user-registration' ),
50
+ 'id' => 'user_registration_enable_registration_approved_email',
51
+ 'default' => 'yes',
52
+ 'type' => 'checkbox',
53
+ 'autoload' => false,
54
+ ),
55
+ array(
56
+ 'title' => __( 'Email Subject', 'user-registration' ),
57
+ 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
58
+ 'id' => 'user_registration_registration_approved_email_subject',
59
+ 'type' => 'text',
60
+ 'default' => __( 'Congratulations! Registration approved on {{blog_info}}', 'user-registration' ),
61
+ 'css' => 'min-width: 350px;',
62
+ 'desc_tip' => true,
63
+ ),
64
+ array(
65
+ 'title' => __( 'Email Content', 'user-registration' ),
66
+ 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
67
+ 'id' => 'user_registration_registration_approved_email',
68
+ 'type' => 'tinymce',
69
+ 'default' => $this->ur_get_registration_approved_email(),
70
+ 'css' => 'min-width: 350px;',
71
+ 'desc_tip' => true,
72
+ ),
73
+ array(
74
+ 'type' => 'sectionend',
75
+ 'id' => 'registration_approved_email',
76
+ ),
77
+
78
+ )
79
+ );
80
+
81
+ return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
82
+ }
83
+
84
+ public function ur_get_registration_approved_email() {
85
+
86
+ $message = apply_filters(
87
+ 'user_registration_get_registration_approved_email',
88
+ sprintf(
89
+ __(
90
+ 'Hi {{username}},
91
 
92
  Your registration on <a href="{{home_url}}">{{blog_info}}</a> has been approved.
93
 
94
  Please visit \'<b>My Account</b>\' page to edit your account details and create your user profile on <a href="{{home_url}}">{{blog_info}}</a>.
95
 
96
+ Thank You!',
97
+ 'user-registration'
98
+ )
99
+ )
100
+ );
101
 
102
+ return $message;
103
+ }
104
  }
 
105
  endif;
106
 
107
  return new UR_Settings_Registration_Approved_Email();
includes/admin/settings/emails/class-ur-settings-registration-denied-email.php CHANGED
@@ -9,22 +9,22 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Registration_Denied_Email', false ) ) :
16
 
17
- /**
18
- * UR_Settings_Registration_Denied_Email Class.
19
- */
20
- class UR_Settings_Registration_Denied_Email{
21
 
22
 
23
- public function __construct() {
24
- $this->id = 'registration_denied_email';
25
- $this->title = __( 'Registration Denied Email', 'user-registration' );
26
- $this->description = __( 'Email sent to the user notifying the registration is denied by the admin', 'user-registration' );
27
- }
28
 
29
  /**
30
  * Get settings
@@ -33,15 +33,16 @@ class UR_Settings_Registration_Denied_Email{
33
  */
34
  public function get_settings() {
35
 
36
- ?><h2><?php echo esc_html__('Registration Denied Email','user-registration'); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
37
 
38
- <?php
39
  $settings = apply_filters(
40
- 'user_registration_registration_denied_email', array(
 
41
  array(
42
- 'type' => 'title',
43
- 'desc' => '',
44
- 'id' => 'registration_denied_email',
45
  ),
46
  array(
47
  'title' => __( 'Enable this email', 'user-registration' ),
@@ -55,8 +56,8 @@ class UR_Settings_Registration_Denied_Email{
55
  'title' => __( 'Email Subject', 'user-registration' ),
56
  'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
57
  'id' => 'user_registration_registration_denied_email_subject',
58
- 'type' => 'text',
59
- 'default' => __('Sorry! Registration denied on {{blog_info}}', 'user-registration'),
60
  'css' => 'min-width: 350px;',
61
  'desc_tip' => true,
62
  ),
@@ -64,8 +65,8 @@ class UR_Settings_Registration_Denied_Email{
64
  'title' => __( 'Email Content', 'user-registration' ),
65
  'desc' => __( 'The email content you want to customize.', 'user-registration' ),
66
  'id' => 'user_registration_registration_denied_email',
67
- 'type' => 'tinymce',
68
- 'default' => $this->ur_get_registration_denied_email(),
69
  'css' => 'min-width: 350px;',
70
  'desc_tip' => true,
71
  ),
@@ -80,20 +81,27 @@ class UR_Settings_Registration_Denied_Email{
80
  return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
81
  }
82
 
83
- public function ur_get_registration_denied_email() {
84
 
85
- $message = apply_filters( 'user_registration_get_registration_denied_email', sprintf( __(
86
- 'Hi {{username}},
 
 
 
87
 
88
  You have registered on <a href="{{home_url}}">{{blog_info}}</a>.
89
 
90
  Unfortunately your registration is denied. Sorry for the inconvenience.
91
 
92
- Thank You!', 'user-registration' ) ) );
 
 
 
 
93
 
94
- return $message;
 
95
  }
96
- }
97
  endif;
98
 
99
  return new UR_Settings_Registration_Denied_Email();
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Registration_Denied_Email', false ) ) :
16
 
17
+ /**
18
+ * UR_Settings_Registration_Denied_Email Class.
19
+ */
20
+ class UR_Settings_Registration_Denied_Email {
21
 
22
 
23
+ public function __construct() {
24
+ $this->id = 'registration_denied_email';
25
+ $this->title = __( 'Registration Denied Email', 'user-registration' );
26
+ $this->description = __( 'Email sent to the user notifying the registration is denied by the admin', 'user-registration' );
27
+ }
28
 
29
  /**
30
  * Get settings
33
  */
34
  public function get_settings() {
35
 
36
+ ?><h2><?php echo esc_html__( 'Registration Denied Email', 'user-registration' ); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
37
 
38
+ <?php
39
  $settings = apply_filters(
40
+ 'user_registration_registration_denied_email',
41
+ array(
42
  array(
43
+ 'type' => 'title',
44
+ 'desc' => '',
45
+ 'id' => 'registration_denied_email',
46
  ),
47
  array(
48
  'title' => __( 'Enable this email', 'user-registration' ),
56
  'title' => __( 'Email Subject', 'user-registration' ),
57
  'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
58
  'id' => 'user_registration_registration_denied_email_subject',
59
+ 'type' => 'text',
60
+ 'default' => __( 'Sorry! Registration denied on {{blog_info}}', 'user-registration' ),
61
  'css' => 'min-width: 350px;',
62
  'desc_tip' => true,
63
  ),
65
  'title' => __( 'Email Content', 'user-registration' ),
66
  'desc' => __( 'The email content you want to customize.', 'user-registration' ),
67
  'id' => 'user_registration_registration_denied_email',
68
+ 'type' => 'tinymce',
69
+ 'default' => $this->ur_get_registration_denied_email(),
70
  'css' => 'min-width: 350px;',
71
  'desc_tip' => true,
72
  ),
81
  return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
82
  }
83
 
84
+ public function ur_get_registration_denied_email() {
85
 
86
+ $message = apply_filters(
87
+ 'user_registration_get_registration_denied_email',
88
+ sprintf(
89
+ __(
90
+ 'Hi {{username}},
91
 
92
  You have registered on <a href="{{home_url}}">{{blog_info}}</a>.
93
 
94
  Unfortunately your registration is denied. Sorry for the inconvenience.
95
 
96
+ Thank You!',
97
+ 'user-registration'
98
+ )
99
+ )
100
+ );
101
 
102
+ return $message;
103
+ }
104
  }
 
105
  endif;
106
 
107
  return new UR_Settings_Registration_Denied_Email();
includes/admin/settings/emails/class-ur-settings-registration-pending-email.php CHANGED
@@ -9,84 +9,88 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Registration_Pending_Email', false ) ) :
16
 
17
- /**
18
- * UR_Settings_Registration_Pending_Email Class.
19
- */
20
- class UR_Settings_Registration_Pending_Email{
21
-
22
- public function __construct() {
23
- $this->id = 'registration_pending_email';
24
- $this->title = __( 'Registration Pending Email', 'user-registration' );
25
- $this->description = __( 'Email sent to the user notifying the registration is pending', 'user-registration' );
26
- }
27
-
28
  /**
29
- * Get settings
30
- *
31
- * @return array
32
  */
33
- public function get_settings() {
34
-
35
- ?><h2><?php echo esc_html__('Registration Pending Email','user-registration'); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
36
-
37
- <?php
38
- $settings = apply_filters(
39
- 'user_registration_registration_pending_email', array(
40
- array(
41
- 'type' => 'title',
42
- 'desc' => '',
43
- 'id' => 'registration_pending_email',
44
- ),
 
 
 
 
 
 
 
 
45
  array(
46
- 'title' => __( 'Enable this email', 'user-registration' ),
47
- 'desc' => __( 'Enable this email sent to the user notifying the registration is pending.', 'user-registration' ),
48
- 'id' => 'user_registration_enable_registration_pending_email',
49
- 'default' => 'yes',
50
- 'type' => 'checkbox',
51
- 'autoload' => false,
52
- ),
53
-
54
- array(
55
- 'title' => __( 'Email Subject', 'user-registration' ),
56
- 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
57
- 'id' => 'user_registration_registration_pending_email_subject',
58
- 'type' => 'text',
59
- 'default' => __('Sorry! Registration changed to pending on {{blog_info}}', 'user-registration'),
60
- 'css' => 'min-width: 350px;',
61
- 'desc_tip' => true,
62
- ),
63
-
64
- array(
65
- 'title' => __( 'Email Content', 'user-registration' ),
66
- 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
67
- 'id' => 'user_registration_registration_pending_email',
68
- 'type' => 'tinymce',
69
- 'default' => $this->ur_get_registration_pending_email(),
70
- 'css' => 'min-width: 350px;',
71
- 'desc_tip' => true,
72
- ),
73
-
74
- array(
75
- 'type' => 'sectionend',
76
- 'id' => 'registration_pending_email',
77
- ),
78
-
79
- )
80
- );
81
-
82
- return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
83
- }
84
-
85
- public function ur_get_registration_pending_email() {
86
-
87
- $message = apply_filters( 'user_registration_get_registration_pending_email', sprintf( __(
88
-
89
- 'Hi {{username}},
 
 
 
 
 
 
 
 
 
90
 
91
  Your registration on <a href="{{home_url}}">{{blog_info}}</a> has been changed to pending.
92
 
@@ -94,11 +98,15 @@ class UR_Settings_Registration_Pending_Email{
94
 
95
  You will be notified after it is approved.
96
 
97
- Thank You!', 'user-registration' ) ) );
 
 
 
 
98
 
99
- return $message;
 
100
  }
101
- }
102
  endif;
103
 
104
  return new UR_Settings_Registration_Pending_Email();
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Registration_Pending_Email', false ) ) :
16
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
+ * UR_Settings_Registration_Pending_Email Class.
 
 
19
  */
20
+ class UR_Settings_Registration_Pending_Email {
21
+
22
+ public function __construct() {
23
+ $this->id = 'registration_pending_email';
24
+ $this->title = __( 'Registration Pending Email', 'user-registration' );
25
+ $this->description = __( 'Email sent to the user notifying the registration is pending', 'user-registration' );
26
+ }
27
+
28
+ /**
29
+ * Get settings
30
+ *
31
+ * @return array
32
+ */
33
+ public function get_settings() {
34
+
35
+ ?><h2><?php echo esc_html__( 'Registration Pending Email', 'user-registration' ); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
36
+
37
+ <?php
38
+ $settings = apply_filters(
39
+ 'user_registration_registration_pending_email',
40
  array(
41
+ array(
42
+ 'type' => 'title',
43
+ 'desc' => '',
44
+ 'id' => 'registration_pending_email',
45
+ ),
46
+ array(
47
+ 'title' => __( 'Enable this email', 'user-registration' ),
48
+ 'desc' => __( 'Enable this email sent to the user notifying the registration is pending.', 'user-registration' ),
49
+ 'id' => 'user_registration_enable_registration_pending_email',
50
+ 'default' => 'yes',
51
+ 'type' => 'checkbox',
52
+ 'autoload' => false,
53
+ ),
54
+
55
+ array(
56
+ 'title' => __( 'Email Subject', 'user-registration' ),
57
+ 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
58
+ 'id' => 'user_registration_registration_pending_email_subject',
59
+ 'type' => 'text',
60
+ 'default' => __( 'Sorry! Registration changed to pending on {{blog_info}}', 'user-registration' ),
61
+ 'css' => 'min-width: 350px;',
62
+ 'desc_tip' => true,
63
+ ),
64
+
65
+ array(
66
+ 'title' => __( 'Email Content', 'user-registration' ),
67
+ 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
68
+ 'id' => 'user_registration_registration_pending_email',
69
+ 'type' => 'tinymce',
70
+ 'default' => $this->ur_get_registration_pending_email(),
71
+ 'css' => 'min-width: 350px;',
72
+ 'desc_tip' => true,
73
+ ),
74
+
75
+ array(
76
+ 'type' => 'sectionend',
77
+ 'id' => 'registration_pending_email',
78
+ ),
79
+
80
+ )
81
+ );
82
+
83
+ return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
84
+ }
85
+
86
+ public function ur_get_registration_pending_email() {
87
+
88
+ $message = apply_filters(
89
+ 'user_registration_get_registration_pending_email',
90
+ sprintf(
91
+ __(
92
+
93
+ 'Hi {{username}},
94
 
95
  Your registration on <a href="{{home_url}}">{{blog_info}}</a> has been changed to pending.
96
 
98
 
99
  You will be notified after it is approved.
100
 
101
+ Thank You!',
102
+ 'user-registration'
103
+ )
104
+ )
105
+ );
106
 
107
+ return $message;
108
+ }
109
  }
 
110
  endif;
111
 
112
  return new UR_Settings_Registration_Pending_Email();
includes/admin/settings/emails/class-ur-settings-reset-password-email.php CHANGED
@@ -8,93 +8,101 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  if ( ! class_exists( 'UR_Settings_Reset_Password_Email', false ) ) :
15
 
16
- /**
17
- * UR_Settings_Reset_Password_Email Class.
18
- */
19
- class UR_Settings_Reset_Password_Email{
20
-
21
- public function __construct() {
22
- $this->id = 'reset_password_email';
23
- $this->title = __( 'Reset Password Email', 'user-registration' );
24
- $this->description = __( 'Email sent to the user when a user requests for reset password', 'user-registration' );
25
- }
26
-
27
  /**
28
- * Get settings
29
- *
30
- * @return array
31
  */
32
- public function get_settings() {
33
 
34
- ?><h2><?php echo esc_html__('Reset Password Email','user-registration'); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
 
 
 
 
35
 
36
- <?php
37
- $settings = apply_filters(
38
- 'user_registration_reset_password_email', array(
39
- array(
40
- 'type' => 'title',
41
- 'desc' => '',
42
- 'id' => 'reset_password_email',
43
- ),
44
- array(
45
- 'title' => __( 'Enable this email', 'user-registration' ),
46
- 'desc' => __( 'Enable this email sent to the user when a user requests for reset password.', 'user-registration' ),
47
- 'id' => 'user_registration_enable_reset_password_email',
48
- 'default' => 'yes',
49
- 'type' => 'checkbox',
50
- 'autoload' => false,
51
- ),
52
- array(
53
- 'title' => __( 'Email Subject', 'user-registration' ),
54
- 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
55
- 'id' => 'user_registration_reset_password_email_subject',
56
- 'type' => 'text',
57
- 'default' => __('Password Reset Email: {{blog_info}}', 'user-registration'),
58
- 'css' => 'min-width: 350px;',
59
- 'desc_tip' => true,
60
- ),
61
- array(
62
- 'title' => __( 'Email Content', 'user-registration' ),
63
- 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
64
- 'id' => 'user_registration_reset_password_email',
65
- 'type' => 'tinymce',
66
- 'default' => $this->ur_get_reset_password_email(),
67
- 'css' => 'min-width: 350px;',
68
- 'desc_tip' => true,
69
- ),
70
  array(
71
- 'type' => 'sectionend',
72
- 'id' => 'reset_password_email',
73
- ),
74
- )
75
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
 
77
- return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
78
- }
 
 
79
 
80
- public function ur_get_reset_password_email() {
81
-
82
- $message = apply_filters( 'user_registration_reset_password_email_message', sprintf( __(
83
- 'Someone has requested a password reset for the following account:
 
84
 
85
  SiteName: {{blog_info}}
86
  Username: {{username}}
87
-
88
  If this was a mistake, just ignore this email and nothing will happen.
89
-
90
  To reset your password, visit the following address:
91
  {{home_url}}/wp-login.php?action=rp&key={{key}}&login={{username}}
92
 
93
- Thank You!', 'user-registration' ) ) );
 
 
 
 
94
 
95
- return $message;
 
96
  }
97
- }
98
  endif;
99
 
100
  return new UR_Settings_Reset_Password_Email();
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  if ( ! class_exists( 'UR_Settings_Reset_Password_Email', false ) ) :
15
 
 
 
 
 
 
 
 
 
 
 
 
16
  /**
17
+ * UR_Settings_Reset_Password_Email Class.
 
 
18
  */
19
+ class UR_Settings_Reset_Password_Email {
20
 
21
+ public function __construct() {
22
+ $this->id = 'reset_password_email';
23
+ $this->title = __( 'Reset Password Email', 'user-registration' );
24
+ $this->description = __( 'Email sent to the user when a user requests for reset password', 'user-registration' );
25
+ }
26
 
27
+ /**
28
+ * Get settings
29
+ *
30
+ * @return array
31
+ */
32
+ public function get_settings() {
33
+
34
+ ?><h2><?php echo esc_html__( 'Reset Password Email', 'user-registration' ); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
35
+
36
+ <?php
37
+ $settings = apply_filters(
38
+ 'user_registration_reset_password_email',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  array(
40
+ array(
41
+ 'type' => 'title',
42
+ 'desc' => '',
43
+ 'id' => 'reset_password_email',
44
+ ),
45
+ array(
46
+ 'title' => __( 'Enable this email', 'user-registration' ),
47
+ 'desc' => __( 'Enable this email sent to the user when a user requests for reset password.', 'user-registration' ),
48
+ 'id' => 'user_registration_enable_reset_password_email',
49
+ 'default' => 'yes',
50
+ 'type' => 'checkbox',
51
+ 'autoload' => false,
52
+ ),
53
+ array(
54
+ 'title' => __( 'Email Subject', 'user-registration' ),
55
+ 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
56
+ 'id' => 'user_registration_reset_password_email_subject',
57
+ 'type' => 'text',
58
+ 'default' => __( 'Password Reset Email: {{blog_info}}', 'user-registration' ),
59
+ 'css' => 'min-width: 350px;',
60
+ 'desc_tip' => true,
61
+ ),
62
+ array(
63
+ 'title' => __( 'Email Content', 'user-registration' ),
64
+ 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
65
+ 'id' => 'user_registration_reset_password_email',
66
+ 'type' => 'tinymce',
67
+ 'default' => $this->ur_get_reset_password_email(),
68
+ 'css' => 'min-width: 350px;',
69
+ 'desc_tip' => true,
70
+ ),
71
+ array(
72
+ 'type' => 'sectionend',
73
+ 'id' => 'reset_password_email',
74
+ ),
75
+ )
76
+ );
77
 
78
+ return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
79
+ }
80
+
81
+ public function ur_get_reset_password_email() {
82
 
83
+ $message = apply_filters(
84
+ 'user_registration_reset_password_email_message',
85
+ sprintf(
86
+ __(
87
+ 'Someone has requested a password reset for the following account:
88
 
89
  SiteName: {{blog_info}}
90
  Username: {{username}}
91
+
92
  If this was a mistake, just ignore this email and nothing will happen.
93
+
94
  To reset your password, visit the following address:
95
  {{home_url}}/wp-login.php?action=rp&key={{key}}&login={{username}}
96
 
97
+ Thank You!',
98
+ 'user-registration'
99
+ )
100
+ )
101
+ );
102
 
103
+ return $message;
104
+ }
105
  }
 
106
  endif;
107
 
108
  return new UR_Settings_Reset_Password_Email();
includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php CHANGED
@@ -9,91 +9,99 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Successfully_Registered_Email', false ) ) :
16
 
17
- /**
18
- * UR_Settings_Successfully_Registered_Email Class.
19
- */
20
- class UR_Settings_Successfully_Registered_Email{
21
-
22
-
23
- public function __construct() {
24
- $this->id = 'successfully_registered_email';
25
- $this->title = __( 'Successfully Registered Email', 'user-registration' );
26
- $this->description = __( 'Email sent to the user after successful registration', 'user-registration' );
27
- }
28
-
29
  /**
30
- * Get settings
31
- *
32
- * @return array
33
  */
34
- public function get_settings() {
35
 
36
- ?><h2><?php echo esc_html__('Successfully Registered Email','user-registration'); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
37
 
38
- <?php
39
- $settings = apply_filters(
40
- 'user_registration_successfully_registered_email', array(
41
- array(
42
- 'type' => 'title',
43
- 'desc' => '',
44
- 'id' => 'successfully_registered_email',
45
- ),
46
- array(
47
- 'title' => __( 'Enable this email', 'user-registration' ),
48
- 'desc' => __( 'Enable this email sent to the user after successful user registration.', 'user-registration' ),
49
- 'id' => 'user_registration_enable_successfully_registered_email',
50
- 'default' => 'yes',
51
- 'type' => 'checkbox',
52
- 'autoload' => false,
53
- ),
54
- array(
55
- 'title' => __( 'Email Subject', 'user-registration' ),
56
- 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
57
- 'id' => 'user_registration_successfully_registered_email_subject',
58
- 'type' => 'text',
59
- 'default' => __('Congratulations! Registration Complete on {{blog_info}}', 'user-registration'),
60
- 'css' => 'min-width: 350px;',
61
- 'desc_tip' => true,
62
- ),
63
- array(
64
- 'title' => __( 'Email Content', 'user-registration' ),
65
- 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
66
- 'id' => 'user_registration_successfully_registered_email',
67
- 'type' => 'tinymce',
68
- 'default' => $this->ur_get_successfully_registered_email(),
69
- 'css' => 'min-width: 350px;',
70
- 'desc_tip' => true,
71
- ),
72
- array(
73
- 'type' => 'sectionend',
74
- 'id' => 'successfully_registered_email',
75
- ),
76
- )
77
- );
78
 
79
- return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
80
- }
 
 
 
 
81
 
82
- public function ur_get_successfully_registered_email() {
83
 
84
- $message = apply_filters( 'user_registration_get_successfully_registered_email', sprintf( __(
85
-
86
- 'Hi {{username}},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
 
88
  You have successfully completed user registration on <a href="{{home_url}}">{{blog_info}}</a>.
89
 
90
  Please visit \'<b>My Account</b>\' page to edit your account details and create your user profile on <a href="{{home_url}}">{{blog_info}}</a>.
91
 
92
- Thank You!', 'user-registration' ) ) );
 
 
 
 
93
 
94
- return $message;
 
95
  }
96
- }
97
  endif;
98
 
99
  return new UR_Settings_Successfully_Registered_Email();
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  if ( ! class_exists( 'UR_Settings_Successfully_Registered_Email', false ) ) :
16
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /**
18
+ * UR_Settings_Successfully_Registered_Email Class.
 
 
19
  */
20
+ class UR_Settings_Successfully_Registered_Email {
21
 
 
22
 
23
+ public function __construct() {
24
+ $this->id = 'successfully_registered_email';
25
+ $this->title = __( 'Successfully Registered Email', 'user-registration' );
26
+ $this->description = __( 'Email sent to the user after successful registration', 'user-registration' );
27
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
+ /**
30
+ * Get settings
31
+ *
32
+ * @return array
33
+ */
34
+ public function get_settings() {
35
 
36
+ ?><h2><?php echo esc_html__( 'Successfully Registered Email', 'user-registration' ); ?> <?php ur_back_link( __( 'Return to emails', 'user-registration' ), admin_url( 'admin.php?page=user-registration-settings&tab=email' ) ); ?></h2>
37
 
38
+ <?php
39
+ $settings = apply_filters(
40
+ 'user_registration_successfully_registered_email',
41
+ array(
42
+ array(
43
+ 'type' => 'title',
44
+ 'desc' => '',
45
+ 'id' => 'successfully_registered_email',
46
+ ),
47
+ array(
48
+ 'title' => __( 'Enable this email', 'user-registration' ),
49
+ 'desc' => __( 'Enable this email sent to the user after successful user registration.', 'user-registration' ),
50
+ 'id' => 'user_registration_enable_successfully_registered_email',
51
+ 'default' => 'yes',
52
+ 'type' => 'checkbox',
53
+ 'autoload' => false,
54
+ ),
55
+ array(
56
+ 'title' => __( 'Email Subject', 'user-registration' ),
57
+ 'desc' => __( 'The email subject you want to customize.', 'user-registration' ),
58
+ 'id' => 'user_registration_successfully_registered_email_subject',
59
+ 'type' => 'text',
60
+ 'default' => __( 'Congratulations! Registration Complete on {{blog_info}}', 'user-registration' ),
61
+ 'css' => 'min-width: 350px;',
62
+ 'desc_tip' => true,
63
+ ),
64
+ array(
65
+ 'title' => __( 'Email Content', 'user-registration' ),
66
+ 'desc' => __( 'The email content you want to customize.', 'user-registration' ),
67
+ 'id' => 'user_registration_successfully_registered_email',
68
+ 'type' => 'tinymce',
69
+ 'default' => $this->ur_get_successfully_registered_email(),
70
+ 'css' => 'min-width: 350px;',
71
+ 'desc_tip' => true,
72
+ ),
73
+ array(
74
+ 'type' => 'sectionend',
75
+ 'id' => 'successfully_registered_email',
76
+ ),
77
+ )
78
+ );
79
+
80
+ return apply_filters( 'user_registration_get_settings_' . $this->id, $settings );
81
+ }
82
+
83
+ public function ur_get_successfully_registered_email() {
84
+
85
+ $message = apply_filters(
86
+ 'user_registration_get_successfully_registered_email',
87
+ sprintf(
88
+ __(
89
+
90
+ 'Hi {{username}},
91
 
92
  You have successfully completed user registration on <a href="{{home_url}}">{{blog_info}}</a>.
93
 
94
  Please visit \'<b>My Account</b>\' page to edit your account details and create your user profile on <a href="{{home_url}}">{{blog_info}}</a>.
95
 
96
+ Thank You!',
97
+ 'user-registration'
98
+ )
99
+ )
100
+ );
101
 
102
+ return $message;
103
+ }
104
  }
 
105
  endif;
106
 
107
  return new UR_Settings_Successfully_Registered_Email();
includes/admin/updater/class-ur-addon-updater.php CHANGED
@@ -12,7 +12,7 @@
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
15
- exit;
16
  }
17
 
18
  /**
@@ -34,9 +34,9 @@ class UR_AddOn_Updater {
34
  * @uses plugin_basename()
35
  * @uses hook()
36
  *
37
- * @param string $_api_url The URL pointing to the custom API endpoint.
38
- * @param string $_plugin_file Path to the plugin file.
39
- * @param array $_api_data Optional data to send with API calls.
40
  */
41
  public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
42
 
@@ -85,7 +85,7 @@ class UR_AddOn_Updater {
85
  *
86
  * @uses api_request()
87
  *
88
- * @param array $_transient_data Update array build by WordPress.
89
  * @return array Modified update array with custom plugin data.
90
  */
91
  public function check_update( $_transient_data ) {
@@ -93,7 +93,7 @@ class UR_AddOn_Updater {
93
  global $pagenow;
94
 
95
  if ( ! is_object( $_transient_data ) ) {
96
- $_transient_data = new stdClass;
97
  }
98
 
99
  if ( 'plugins.php' == $pagenow && is_multisite() ) {
@@ -107,7 +107,13 @@ class UR_AddOn_Updater {
107
  $version_info = $this->get_cached_version_info();
108
 
109
  if ( false === $version_info ) {
110
- $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) );
 
 
 
 
 
 
111
 
112
  $this->set_version_info_cache( $version_info );
113
 
@@ -132,8 +138,8 @@ class UR_AddOn_Updater {
132
  /**
133
  * show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
134
  *
135
- * @param string $file
136
- * @param array $plugin
137
  */
138
  public function show_update_notification( $file, $plugin ) {
139
 
@@ -141,11 +147,11 @@ class UR_AddOn_Updater {
141
  return;
142
  }
143
 
144
- if( ! current_user_can( 'update_plugins' ) ) {
145
  return;
146
  }
147
 
148
- if( ! is_multisite() ) {
149
  return;
150
  }
151
 
@@ -165,7 +171,13 @@ class UR_AddOn_Updater {
165
  $version_info = $this->get_cached_version_info();
166
 
167
  if ( false === $version_info ) {
168
- $version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug, 'beta' => $this->beta ) );
 
 
 
 
 
 
169
 
170
  $this->set_version_info_cache( $version_info );
171
  }
@@ -180,7 +192,7 @@ class UR_AddOn_Updater {
180
 
181
  }
182
 
183
- $update_cache->last_checked = current_time( 'timestamp' );
184
  $update_cache->checked[ $this->name ] = $this->version;
185
 
186
  set_site_transient( 'update_plugins', $update_cache );
@@ -198,7 +210,7 @@ class UR_AddOn_Updater {
198
 
199
  // build a plugin list row, with update notification
200
  $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
201
- # <tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
202
  echo '<tr class="plugin-update-tr" id="' . $this->slug . '-update" data-slug="' . $this->slug . '" data-plugin="' . $this->slug . '/' . $file . '">';
203
  echo '<td colspan="3" class="plugin-update colspanchange">';
204
  echo '<div class="update-message notice inline notice-warning notice-alt">';
@@ -220,7 +232,7 @@ class UR_AddOn_Updater {
220
  '<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
221
  esc_html( $version_info->new_version ),
222
  '</a>',
223
- '<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) .'">',
224
  '</a>'
225
  );
226
  }
@@ -236,9 +248,9 @@ class UR_AddOn_Updater {
236
  *
237
  * @uses api_request()
238
  *
239
- * @param mixed $_data
240
- * @param string $_action
241
- * @param object $_args
242
  * @return object $_data
243
  */
244
  public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
@@ -260,8 +272,8 @@ class UR_AddOn_Updater {
260
  'is_ssl' => is_ssl(),
261
  'fields' => array(
262
  'banners' => array(),
263
- 'reviews' => false
264
- )
265
  );
266
 
267
  $cache_key = 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
@@ -269,7 +281,7 @@ class UR_AddOn_Updater {
269
  // Get the transient where we store the api request for this plugin for 24 hours
270
  $edd_api_request_transient = $this->get_cached_version_info( $cache_key );
271
 
272
- //If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
273
  if ( empty( $edd_api_request_transient ) ) {
274
 
275
  $api_response = $this->api_request( 'plugin_information', $to_send );
@@ -280,7 +292,6 @@ class UR_AddOn_Updater {
280
  if ( false !== $api_response ) {
281
  $_data = $api_response;
282
  }
283
-
284
  } else {
285
  $_data = $edd_api_request_transient;
286
  }
@@ -311,8 +322,8 @@ class UR_AddOn_Updater {
311
  /**
312
  * Disable SSL verification in order to prevent download update failures
313
  *
314
- * @param array $args
315
- * @param string $url
316
  * @return object $array
317
  */
318
  public function http_request_args( $args, $url ) {
@@ -332,8 +343,8 @@ class UR_AddOn_Updater {
332
  * @uses wp_remote_post()
333
  * @uses is_wp_error()
334
  *
335
- * @param string $_action The requested action.
336
- * @param array $_data Parameters for the API action.
337
  * @return false|object
338
  */
339
  private function api_request( $_action, $_data ) {
@@ -346,7 +357,7 @@ class UR_AddOn_Updater {
346
  return;
347
  }
348
 
349
- if( $this->api_url == trailingslashit (home_url() ) ) {
350
  return false; // Don't allow a plugin to ping itself
351
  }
352
 
@@ -363,7 +374,14 @@ class UR_AddOn_Updater {
363
  );
364
 
365
  $verify_ssl = $this->verify_ssl();
366
- $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
 
 
 
 
 
 
 
367
 
368
  if ( ! is_wp_error( $request ) ) {
369
  $request = json_decode( wp_remote_retrieve_body( $request ) );
@@ -379,8 +397,8 @@ class UR_AddOn_Updater {
379
  $request->banners = maybe_unserialize( $request->banners );
380
  }
381
 
382
- if( ! empty( $request->sections ) ) {
383
- foreach( $request->sections as $key => $section ) {
384
  $request->$key = (array) $section;
385
  }
386
  }
@@ -392,19 +410,19 @@ class UR_AddOn_Updater {
392
 
393
  global $edd_plugin_data;
394
 
395
- if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
396
  return;
397
  }
398
 
399
- if( empty( $_REQUEST['plugin'] ) ) {
400
  return;
401
  }
402
 
403
- if( empty( $_REQUEST['slug'] ) ) {
404
  return;
405
  }
406
 
407
- if( ! current_user_can( 'update_plugins' ) ) {
408
  wp_die( __( 'You do not have permission to install plugin updates', 'user-registration' ), __( 'Error', 'user-registration' ), array( 'response' => 403 ) );
409
  }
410
 
@@ -413,7 +431,7 @@ class UR_AddOn_Updater {
413
  $cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' );
414
  $version_info = $this->get_cached_version_info( $cache_key );
415
 
416
- if( false === $version_info ) {
417
 
418
  $api_params = array(
419
  'edd_action' => 'get_version',
@@ -422,25 +440,31 @@ class UR_AddOn_Updater {
422
  'slug' => $_REQUEST['slug'],
423
  'author' => $data['author'],
424
  'url' => home_url(),
425
- 'beta' => ! empty( $data['beta'] )
426
  );
427
 
428
  $verify_ssl = $this->verify_ssl();
429
- $request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
 
 
 
 
 
 
 
430
 
431
  if ( ! is_wp_error( $request ) ) {
432
  $version_info = json_decode( wp_remote_retrieve_body( $request ) );
433
  }
434
 
435
-
436
  if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
437
  $version_info->sections = maybe_unserialize( $version_info->sections );
438
  } else {
439
  $version_info = false;
440
  }
441
 
442
- if( ! empty( $version_info ) ) {
443
- foreach( $version_info->sections as $key => $section ) {
444
  $version_info->$key = (array) $section;
445
  }
446
  }
@@ -449,7 +473,7 @@ class UR_AddOn_Updater {
449
 
450
  }
451
 
452
- if( ! empty( $version_info ) && isset( $version_info->sections['changelog'] ) ) {
453
  echo '<div style="background:#fff;padding:10px;">' . $version_info->sections['changelog'] . '</div>';
454
  }
455
 
@@ -458,13 +482,13 @@ class UR_AddOn_Updater {
458
 
459
  public function get_cached_version_info( $cache_key = '' ) {
460
 
461
- if( empty( $cache_key ) ) {
462
  $cache_key = $this->cache_key;
463
  }
464
 
465
  $cache = get_option( $cache_key );
466
 
467
- if( empty( $cache['timeout'] ) || current_time( 'timestamp' ) > $cache['timeout'] ) {
468
  return false; // Cache is expired
469
  }
470
 
@@ -474,13 +498,13 @@ class UR_AddOn_Updater {
474
 
475
  public function set_version_info_cache( $value = '', $cache_key = '' ) {
476
 
477
- if( empty( $cache_key ) ) {
478
  $cache_key = $this->cache_key;
479
  }
480
 
481
  $data = array(
482
  'timeout' => strtotime( '+3 hours', current_time( 'timestamp' ) ),
483
- 'value' => json_encode( $value )
484
  );
485
 
486
  update_option( $cache_key, $data, 'no' );
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
15
+ exit; // Exit if accessed directly.
16
  }
17
 
18
  /**
34
  * @uses plugin_basename()
35
  * @uses hook()
36
  *
37
+ * @param string $_api_url The URL pointing to the custom API endpoint.
38
+ * @param string $_plugin_file Path to the plugin file.
39
+ * @param array $_api_data Optional data to send with API calls.
40
  */
41
  public function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
42
 
85
  *
86
  * @uses api_request()
87
  *
88
+ * @param array $_transient_data Update array build by WordPress.
89
  * @return array Modified update array with custom plugin data.
90
  */
91
  public function check_update( $_transient_data ) {
93
  global $pagenow;
94
 
95
  if ( ! is_object( $_transient_data ) ) {
96
+ $_transient_data = new stdClass();
97
  }
98
 
99
  if ( 'plugins.php' == $pagenow && is_multisite() ) {
107
  $version_info = $this->get_cached_version_info();
108
 
109
  if ( false === $version_info ) {
110
+ $version_info = $this->api_request(
111
+ 'plugin_latest_version',
112
+ array(
113
+ 'slug' => $this->slug,
114
+ 'beta' => $this->beta,
115
+ )
116
+ );
117
 
118
  $this->set_version_info_cache( $version_info );
119
 
138
  /**
139
  * show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
140
  *
141
+ * @param string $file
142
+ * @param array $plugin
143
  */
144
  public function show_update_notification( $file, $plugin ) {
145
 
147
  return;
148
  }
149
 
150
+ if ( ! current_user_can( 'update_plugins' ) ) {
151
  return;
152
  }
153
 
154
+ if ( ! is_multisite() ) {
155
  return;
156
  }
157
 
171
  $version_info = $this->get_cached_version_info();
172
 
173
  if ( false === $version_info ) {
174
+ $version_info = $this->api_request(
175
+ 'plugin_latest_version',
176
+ array(
177
+ 'slug' => $this->slug,
178
+ 'beta' => $this->beta,
179
+ )
180
+ );
181
 
182
  $this->set_version_info_cache( $version_info );
183
  }
192
 
193
  }
194
 
195
+ $update_cache->last_checked = current_time( 'timestamp' );
196
  $update_cache->checked[ $this->name ] = $this->version;
197
 
198
  set_site_transient( 'update_plugins', $update_cache );
210
 
211
  // build a plugin list row, with update notification
212
  $wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
213
+ // <tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange">
214
  echo '<tr class="plugin-update-tr" id="' . $this->slug . '-update" data-slug="' . $this->slug . '" data-plugin="' . $this->slug . '/' . $file . '">';
215
  echo '<td colspan="3" class="plugin-update colspanchange">';
216
  echo '<div class="update-message notice inline notice-warning notice-alt">';
232
  '<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
233
  esc_html( $version_info->new_version ),
234
  '</a>',
235
+ '<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) . '">',
236
  '</a>'
237
  );
238
  }
248
  *
249
  * @uses api_request()
250
  *
251
+ * @param mixed $_data
252
+ * @param string $_action
253
+ * @param object $_args
254
  * @return object $_data
255
  */
256
  public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
272
  'is_ssl' => is_ssl(),
273
  'fields' => array(
274
  'banners' => array(),
275
+ 'reviews' => false,
276
+ ),
277
  );
278
 
279
  $cache_key = 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
281
  // Get the transient where we store the api request for this plugin for 24 hours
282
  $edd_api_request_transient = $this->get_cached_version_info( $cache_key );
283
 
284
+ // If we have no transient-saved value, run the API, set a fresh transient with the API value, and return that value too right now.
285
  if ( empty( $edd_api_request_transient ) ) {
286
 
287
  $api_response = $this->api_request( 'plugin_information', $to_send );
292
  if ( false !== $api_response ) {
293
  $_data = $api_response;
294
  }
 
295
  } else {
296
  $_data = $edd_api_request_transient;
297
  }
322
  /**
323
  * Disable SSL verification in order to prevent download update failures
324
  *
325
+ * @param array $args
326
+ * @param string $url
327
  * @return object $array
328
  */
329
  public function http_request_args( $args, $url ) {
343
  * @uses wp_remote_post()
344
  * @uses is_wp_error()
345
  *
346
+ * @param string $_action The requested action.
347
+ * @param array $_data Parameters for the API action.
348
  * @return false|object
349
  */
350
  private function api_request( $_action, $_data ) {
357
  return;
358
  }
359
 
360
+ if ( $this->api_url == trailingslashit( home_url() ) ) {
361
  return false; // Don't allow a plugin to ping itself
362
  }
363
 
374
  );
375
 
376
  $verify_ssl = $this->verify_ssl();
377
+ $request = wp_remote_post(
378
+ $this->api_url,
379
+ array(
380
+ 'timeout' => 15,
381
+ 'sslverify' => $verify_ssl,
382
+ 'body' => $api_params,
383
+ )
384
+ );
385
 
386
  if ( ! is_wp_error( $request ) ) {
387
  $request = json_decode( wp_remote_retrieve_body( $request ) );
397
  $request->banners = maybe_unserialize( $request->banners );
398
  }
399
 
400
+ if ( ! empty( $request->sections ) ) {
401
+ foreach ( $request->sections as $key => $section ) {
402
  $request->$key = (array) $section;
403
  }
404
  }
410
 
411
  global $edd_plugin_data;
412
 
413
+ if ( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
414
  return;
415
  }
416
 
417
+ if ( empty( $_REQUEST['plugin'] ) ) {
418
  return;
419
  }
420
 
421
+ if ( empty( $_REQUEST['slug'] ) ) {
422
  return;
423
  }
424
 
425
+ if ( ! current_user_can( 'update_plugins' ) ) {
426
  wp_die( __( 'You do not have permission to install plugin updates', 'user-registration' ), __( 'Error', 'user-registration' ), array( 'response' => 403 ) );
427
  }
428
 
431
  $cache_key = md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $beta . '_version_info' );
432
  $version_info = $this->get_cached_version_info( $cache_key );
433
 
434
+ if ( false === $version_info ) {
435
 
436
  $api_params = array(
437
  'edd_action' => 'get_version',
440
  'slug' => $_REQUEST['slug'],
441
  'author' => $data['author'],
442
  'url' => home_url(),
443
+ 'beta' => ! empty( $data['beta'] ),
444
  );
445
 
446
  $verify_ssl = $this->verify_ssl();
447
+ $request = wp_remote_post(
448
+ $this->api_url,
449
+ array(
450
+ 'timeout' => 15,
451
+ 'sslverify' => $verify_ssl,
452
+ 'body' => $api_params,
453
+ )
454
+ );
455
 
456
  if ( ! is_wp_error( $request ) ) {
457
  $version_info = json_decode( wp_remote_retrieve_body( $request ) );
458
  }
459
 
 
460
  if ( ! empty( $version_info ) && isset( $version_info->sections ) ) {
461
  $version_info->sections = maybe_unserialize( $version_info->sections );
462
  } else {
463
  $version_info = false;
464
  }
465
 
466
+ if ( ! empty( $version_info ) ) {
467
+ foreach ( $version_info->sections as $key => $section ) {
468
  $version_info->$key = (array) $section;
469
  }
470
  }
473
 
474
  }
475
 
476
+ if ( ! empty( $version_info ) && isset( $version_info->sections['changelog'] ) ) {
477
  echo '<div style="background:#fff;padding:10px;">' . $version_info->sections['changelog'] . '</div>';
478
  }
479
 
482
 
483
  public function get_cached_version_info( $cache_key = '' ) {
484
 
485
+ if ( empty( $cache_key ) ) {
486
  $cache_key = $this->cache_key;
487
  }
488
 
489
  $cache = get_option( $cache_key );
490
 
491
+ if ( empty( $cache['timeout'] ) || current_time( 'timestamp' ) > $cache['timeout'] ) {
492
  return false; // Cache is expired
493
  }
494
 
498
 
499
  public function set_version_info_cache( $value = '', $cache_key = '' ) {
500
 
501
+ if ( empty( $cache_key ) ) {
502
  $cache_key = $this->cache_key;
503
  }
504
 
505
  $data = array(
506
  'timeout' => strtotime( '+3 hours', current_time( 'timestamp' ) ),
507
+ 'value' => json_encode( $value ),
508
  );
509
 
510
  update_option( $cache_key, $data, 'no' );
includes/admin/updater/class-ur-plugin-updater-api.php CHANGED
@@ -9,7 +9,7 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
 
15
  /**
@@ -21,12 +21,13 @@ class UR_Updater_Key_API {
21
 
22
  /**
23
  * Attempt to activate a plugin license.
 
24
  * @return string JSON response
25
  */
26
  public static function activate( $api_params ) {
27
  $defaults = array(
28
  'url' => home_url(),
29
- 'edd_action' => 'activate_license'
30
  );
31
 
32
  $api_params = wp_parse_args( $defaults, $api_params );
@@ -43,11 +44,21 @@ class UR_Updater_Key_API {
43
 
44
  // Make sure there are no errors.
45
  if ( is_wp_error( $response ) ) {
46
- return json_encode( array( 'error_code' => $response->get_error_code(), 'error' => $response->get_error_message() ) );
 
 
 
 
 
47
  }
48
 
49
  if ( wp_remote_retrieve_response_code( $response ) != 200 ) {
50
- return json_encode( array( 'error_code' => wp_remote_retrieve_response_code( $response ), 'error' => 'Error code: ' . wp_remote_retrieve_response_code( $response ) ) );
 
 
 
 
 
51
  }
52
 
53
  // Tell WordPress to look for updates.
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  /**
21
 
22
  /**
23
  * Attempt to activate a plugin license.
24
+ *
25
  * @return string JSON response
26
  */
27
  public static function activate( $api_params ) {
28
  $defaults = array(
29
  'url' => home_url(),
30
+ 'edd_action' => 'activate_license',
31
  );
32
 
33
  $api_params = wp_parse_args( $defaults, $api_params );
44
 
45
  // Make sure there are no errors.
46
  if ( is_wp_error( $response ) ) {
47
+ return json_encode(
48
+ array(
49
+ 'error_code' => $response->get_error_code(),
50
+ 'error' => $response->get_error_message(),
51
+ )
52
+ );
53
  }
54
 
55
  if ( wp_remote_retrieve_response_code( $response ) != 200 ) {
56
+ return json_encode(
57
+ array(
58
+ 'error_code' => wp_remote_retrieve_response_code( $response ),
59
+ 'error' => 'Error code: ' . wp_remote_retrieve_response_code( $response ),
60
+ )
61
+ );
62
  }
63
 
64
  // Tell WordPress to look for updates.
includes/admin/updater/class-ur-plugin-updates.php CHANGED
@@ -9,7 +9,7 @@
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
 
15
  /**
@@ -19,12 +19,14 @@ class UR_Plugin_Updates {
19
 
20
  /**
21
  * This is the header used by extensions to show requirements.
 
22
  * @var string
23
  */
24
  const VERSION_REQUIRED_HEADER = 'UR requires at least';
25
 
26
  /**
27
  * This is the header used by extensions to show testing.
 
28
  * @var string
29
  */
30
  const VERSION_TESTED_HEADER = 'UR tested up to';
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
 
15
  /**
19
 
20
  /**
21
  * This is the header used by extensions to show requirements.
22
+ *
23
  * @var string
24
  */
25
  const VERSION_REQUIRED_HEADER = 'UR requires at least';
26
 
27
  /**
28
  * This is the header used by extensions to show testing.
29
+ *
30
  * @var string
31
  */
32
  const VERSION_TESTED_HEADER = 'UR tested up to';
includes/admin/views/html-admin-page-addons.php CHANGED
@@ -6,7 +6,7 @@
6
  * @var object $addons
7
  */
8
  if ( ! defined( 'ABSPATH' ) ) {
9
- exit;
10
  }
11
 
12
  ?>
6
  * @var object $addons
7
  */
8
  if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
  }
11
 
12
  ?>
includes/admin/views/html-admin-page-export-users.php CHANGED
@@ -3,35 +3,35 @@
3
  * Admin View: Page - Export Users
4
  */
5
  if ( ! defined( 'ABSPATH' ) ) {
6
- exit;
7
  }
8
 
9
  ?>
10
  <div class="ur-export-users-page">
11
  <div class="nav-tab-content">
12
- <div class="nav-tab-inside">
13
- <div class="postbox">
14
- <h3 class="hndle"><?php _e( 'Export Users With Extra Fields', 'user-registration' ); ?></h3>
15
 
16
- <div class="inside">
17
- <p class="help">
18
- <?php _e( 'Export your users along with their extra information registered with a user registration form as a <strong>CSV</strong> file.', 'user-registration' ); ?>
19
- </p>
20
 
21
- <p>
22
- <select name="export_users" class="forms-list">
23
- <?php
24
- foreach( $all_forms as $form_id => $form ) {
25
- echo '<option value ="'. esc_attr( $form_id ) .'">'. esc_html( $form ).'</option>';
26
- }
27
- ?>
28
- </select>
29
- </p>
30
 
31
- <input type="submit" class="button button-primary" name="user_registration_export_users" value="<?php _e( 'Export Users', 'user-registration' ) ?>">
32
 
33
- </div>
34
- </div><!-- .postbox -->
35
 
36
  </div>
37
  </div>
3
  * Admin View: Page - Export Users
4
  */
5
  if ( ! defined( 'ABSPATH' ) ) {
6
+ exit; // Exit if accessed directly.
7
  }
8
 
9
  ?>
10
  <div class="ur-export-users-page">
11
  <div class="nav-tab-content">
12
+ <div class="nav-tab-inside">
13
+ <div class="postbox">
14
+ <h3 class="hndle"><?php _e( 'Export Users With Extra Fields', 'user-registration' ); ?></h3>
15
 
16
+ <div class="inside">
17
+ <p class="help">
18
+ <?php _e( 'Export your users along with their extra information registered with a user registration form as a <strong>CSV</strong> file.', 'user-registration' ); ?>
19
+ </p>
20
 
21
+ <p>
22
+ <select name="export_users" class="forms-list">
23
+ <?php
24
+ foreach ( $all_forms as $form_id => $form ) {
25
+ echo '<option value ="' . esc_attr( $form_id ) . '">' . esc_html( $form ) . '</option>';
26
+ }
27
+ ?>
28
+ </select>
29
+ </p>
30
 
31
+ <input type="submit" class="button button-primary" name="user_registration_export_users" value="<?php _e( 'Export Users', 'user-registration' ); ?>">
32
 
33
+ </div>
34
+ </div><!-- .postbox -->
35
 
36
  </div>
37
  </div>
includes/admin/views/html-admin-page-forms.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
  ?>
6
  <div class="wrap ur-form-container">
7
- <h1 class="wp-heading-inline"><?php echo isset( $post_data[0]->post_title ) ? $post_data[0]->post_title : __( 'User Registration', 'user-registration' ) ?></h1>
8
  <div id="menu-management-liquid" class="ur-form-subcontainer">
9
  <div id="menu-management">
10
  <div class="menu-edit ">
@@ -13,28 +13,30 @@ if ( ! defined( 'ABSPATH' ) ) {
13
  <div id="nav-menu-header">
14
  <div class="major-publishing-actions wp-clearfix">
15
  <label class="ur-form-name-label"
16
- for="ur-form-name"><?php esc_html_e( 'Form Name', 'user-registration' ) ?></label>
17
  <input name="ur-form-name" id="ur-form-name" type="text"
18
- class="ur-form-name regular-text menu-item-textbox" value="<?php
19
- if ( isset( $post_data[0] ) ) {
 
20
 
21
- echo $post_data[0]->post_title;
22
 
23
- }
24
 
25
- ?>">
 
26
  <?php
27
  if ( isset( $post_data[0] ) ) {
28
 
29
  ?>
30
  <input type="text" onfocus="this.select();" readonly="readonly"
31
- value='[user_registration_form id=<?php echo '"' . $post_data[0]->ID . '"' ?>]'
32
- class=" code" size="35">
33
 
34
  <button id="copy-shortcode" class="button button-primary ur-copy-shortcode " href="#" data-tip="<?php esc_attr_e( 'Copy Shortcode!', 'user-registration' ); ?>" data-copied="<?php esc_attr_e( 'Copied!', 'user-registration' ); ?>">
35
- <svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16">
36
  <path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"/>
37
- </svg>
38
  </button>
39
 
40
  <?php
@@ -42,8 +44,8 @@ if ( ! defined( 'ABSPATH' ) ) {
42
  ?>
43
  <div class="publishing-action">
44
  <input type="button" name="save_form" id="save_form_footer"
45
- class="button button-primary button-large menu-form ur_save_form_action_button"
46
- value="<?php echo $save_label; ?> ">
47
  </div><!-- END .publishing-action -->
48
  </div><!-- END .major-publishing-actions -->
49
  </div><!-- END .nav-menu-header -->
@@ -53,25 +55,25 @@ if ( ! defined( 'ABSPATH' ) ) {
53
  <nav class="nav-tab-wrapper ur-tabs">
54
  <ul class="ur-tab-lists">
55
  <li><a href="#ur-tab-registered-fields"
56
- class="nav-tab active"><?php esc_html_e( 'Fields', 'user-registration' ) ?></a>
57
  </li>
58
  <li class="ur-no-pointer"><a href="#ur-tab-field-options"
59
- class="nav-tab"><?php esc_html_e( 'Field Options', 'user-registration' ) ?></a>
60
  </li>
61
  <li><a href="#ur-tab-field-settings"
62
- class="nav-tab"><?php esc_html_e( 'Form Setting', 'user-registration' ) ?></a>
63
  </li>
64
  </ul>
65
  <div style="clear:both"></div>
66
 
67
  <div id="ur-tab-registered-fields" class="ur-tab-content">
68
- <h2><?php echo __( 'Default User Fields', 'user-registration' ) ?></h2>
69
  <hr/>
70
  <?php $this->get_registered_user_form_fields(); ?>
71
- <h2><?php echo __( 'Extra Fields', 'user-registration' ) ?></h2>
72
  <hr/>
73
  <?php $this->get_registered_other_form_fields(); ?>
74
- <?php do_action( 'user_registration_extra_fields' );?>
75
  </div>
76
  <div id="ur-tab-field-options" class="ur-tab-content">
77
 
@@ -81,19 +83,20 @@ if ( ! defined( 'ABSPATH' ) ) {
81
  <form method="post" id="ur-field-settings" onsubmit="return false;">
82
  <?php
83
  $form_id = isset( $post_data[0]->ID ) ? $post_data[0]->ID : 0;
84
- ?>
85
  <div id ="ur-field-all-settings">
86
  <?php ur_admin_form_settings( $form_id ); ?>
87
  </div>
88
  <?php
89
  do_action( 'user_registration_after_form_settings', $form_id );
90
- ?>
91
  </form>
92
 
93
  </div>
94
  </nav>
95
  </div>
96
- <?php if ( isset( $post_data[0] ) && isset( $_GET['edit-registration'] ) && is_numeric( $_GET['edit-registration'] ) ) {
 
97
  $this->get_edit_form_field( $post_data );
98
  } else {
99
  ?>
@@ -107,8 +110,8 @@ if ( ! defined( 'ABSPATH' ) ) {
107
  <div class="major-publishing-actions wp-clearfix">
108
  <div class="publishing-action">
109
  <input type="button" name="save_form" id="save_form_footer"
110
- class="button button-primary button-large menu-form ur_save_form_action_button"
111
- value="<?php echo $save_label; ?> "/>
112
  </div><!-- END .publishing-action -->
113
  </div><!-- END .major-publishing-actions -->
114
  </div><!-- /#nav-menu-footer -->
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) {
3
+ exit; // Exit if accessed directly.
4
  }
5
  ?>
6
  <div class="wrap ur-form-container">
7
+ <h1 class="wp-heading-inline"><?php echo isset( $post_data[0]->post_title ) ? $post_data[0]->post_title : __( 'User Registration', 'user-registration' ); ?></h1>
8
  <div id="menu-management-liquid" class="ur-form-subcontainer">
9
  <div id="menu-management">
10
  <div class="menu-edit ">
13
  <div id="nav-menu-header">
14
  <div class="major-publishing-actions wp-clearfix">
15
  <label class="ur-form-name-label"
16
+ for="ur-form-name"><?php esc_html_e( 'Form Name', 'user-registration' ); ?></label>
17
  <input name="ur-form-name" id="ur-form-name" type="text"
18
+ class="ur-form-name regular-text menu-item-textbox" value="
19
+ <?php
20
+ if ( isset( $post_data[0] ) ) {
21
 
22
+ echo $post_data[0]->post_title;
23
 
24
+ }
25
 
26
+ ?>
27
+ ">
28
  <?php
29
  if ( isset( $post_data[0] ) ) {
30
 
31
  ?>
32
  <input type="text" onfocus="this.select();" readonly="readonly"
33
+ value='[user_registration_form id=<?php echo '"' . $post_data[0]->ID . '"'; ?>]'
34
+ class=" code" size="35">
35
 
36
  <button id="copy-shortcode" class="button button-primary ur-copy-shortcode " href="#" data-tip="<?php esc_attr_e( 'Copy Shortcode!', 'user-registration' ); ?>" data-copied="<?php esc_attr_e( 'Copied!', 'user-registration' ); ?>">
37
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16">
38
  <path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"/>
39
+ </svg>
40
  </button>
41
 
42
  <?php
44
  ?>
45
  <div class="publishing-action">
46
  <input type="button" name="save_form" id="save_form_footer"
47
+ class="button button-primary button-large menu-form ur_save_form_action_button"
48
+ value="<?php echo $save_label; ?> ">
49
  </div><!-- END .publishing-action -->
50
  </div><!-- END .major-publishing-actions -->
51
  </div><!-- END .nav-menu-header -->
55
  <nav class="nav-tab-wrapper ur-tabs">
56
  <ul class="ur-tab-lists">
57
  <li><a href="#ur-tab-registered-fields"
58
+ class="nav-tab active"><?php esc_html_e( 'Fields', 'user-registration' ); ?></a>
59
  </li>
60
  <li class="ur-no-pointer"><a href="#ur-tab-field-options"
61
+ class="nav-tab"><?php esc_html_e( 'Field Options', 'user-registration' ); ?></a>
62
  </li>
63
  <li><a href="#ur-tab-field-settings"
64
+ class="nav-tab"><?php esc_html_e( 'Form Setting', 'user-registration' ); ?></a>
65
  </li>
66
  </ul>
67
  <div style="clear:both"></div>
68
 
69
  <div id="ur-tab-registered-fields" class="ur-tab-content">
70
+ <h2><?php echo __( 'Default User Fields', 'user-registration' ); ?></h2>
71
  <hr/>
72
  <?php $this->get_registered_user_form_fields(); ?>
73
+ <h2><?php echo __( 'Extra Fields', 'user-registration' ); ?></h2>
74
  <hr/>
75
  <?php $this->get_registered_other_form_fields(); ?>
76
+ <?php do_action( 'user_registration_extra_fields' ); ?>
77
  </div>
78
  <div id="ur-tab-field-options" class="ur-tab-content">
79
 
83
  <form method="post" id="ur-field-settings" onsubmit="return false;">
84
  <?php
85
  $form_id = isset( $post_data[0]->ID ) ? $post_data[0]->ID : 0;
86
+ ?>
87
  <div id ="ur-field-all-settings">
88
  <?php ur_admin_form_settings( $form_id ); ?>
89
  </div>
90
  <?php
91
  do_action( 'user_registration_after_form_settings', $form_id );
92
+ ?>
93
  </form>
94
 
95
  </div>
96
  </nav>
97
  </div>
98
+ <?php
99
+ if ( isset( $post_data[0] ) && isset( $_GET['edit-registration'] ) && is_numeric( $_GET['edit-registration'] ) ) {
100
  $this->get_edit_form_field( $post_data );
101
  } else {
102
  ?>
110
  <div class="major-publishing-actions wp-clearfix">
111
  <div class="publishing-action">
112
  <input type="button" name="save_form" id="save_form_footer"
113
+ class="button button-primary button-large menu-form ur_save_form_action_button"
114
+ value="<?php echo $save_label; ?> "/>
115
  </div><!-- END .publishing-action -->
116
  </div><!-- END .major-publishing-actions -->
117
  </div><!-- /#nav-menu-footer -->
includes/admin/views/html-admin-page-status-logs.php CHANGED
@@ -4,14 +4,14 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <?php if ( $logs ) : ?>
12
  <div id="log-viewer-select" style="
13
  padding: 10px 0 8px;
14
- line-height: 28px;">
15
  <div class="alignleft">
16
  <h2>
17
  <?php echo esc_html( $viewed_log ); ?>
@@ -39,9 +39,9 @@ if ( ! defined( 'ABSPATH' ) ) {
39
  <div class="clear"></div>
40
  </div>
41
  <div id="log-viewer" style=" background: #fff;
42
- border: 1px solid #e5e5e5;
43
- box-shadow: 0 1px 1px rgba(0,0,0,.04);
44
- padding: 5px 20px;">
45
  <pre><?php echo esc_html( file_get_contents( UR_LOG_DIR . $viewed_log ) ); ?></pre>
46
  </div>
47
  <?php else : ?>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <?php if ( $logs ) : ?>
12
  <div id="log-viewer-select" style="
13
  padding: 10px 0 8px;
14
+ line-height: 28px;">
15
  <div class="alignleft">
16
  <h2>
17
  <?php echo esc_html( $viewed_log ); ?>
39
  <div class="clear"></div>
40
  </div>
41
  <div id="log-viewer" style=" background: #fff;
42
+ border: 1px solid #e5e5e5;
43
+ box-shadow: 0 1px 1px rgba(0,0,0,.04);
44
+ padding: 5px 20px;">
45
  <pre><?php echo esc_html( file_get_contents( UR_LOG_DIR . $viewed_log ) ); ?></pre>
46
  </div>
47
  <?php else : ?>
includes/admin/views/html-admin-page-status.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  $current_tab = ! empty( $_REQUEST['tab'] ) ? sanitize_title( $_REQUEST['tab'] ) : 'logs';
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  $current_tab = ! empty( $_REQUEST['tab'] ) ? sanitize_title( $_REQUEST['tab'] ) : 'logs';
includes/admin/views/html-admin-settings.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
@@ -30,7 +30,7 @@ if ( ! defined( 'ABSPATH' ) ) {
30
  ?>
31
  <p class="submit">
32
  <?php if ( ! isset( $GLOBALS['hide_save_button'] ) ) : ?>
33
- <input name="save" class="button-primary" type="submit" value="<?php echo apply_filters('user-registration-setting-save-label', esc_attr('Save Changes', 'user-registration' )); ?>" />
34
  <?php endif; ?>
35
  <input type="hidden" name="subtab" id="last_tab" />
36
  <?php wp_nonce_field( 'user-registration-settings' ); ?>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
30
  ?>
31
  <p class="submit">
32
  <?php if ( ! isset( $GLOBALS['hide_save_button'] ) ) : ?>
33
+ <input name="save" class="button-primary" type="submit" value="<?php echo apply_filters( 'user-registration-setting-save-label', esc_attr( 'Save Changes', 'user-registration' ) ); ?>" />
34
  <?php endif; ?>
35
  <input type="hidden" name="subtab" id="last_tab" />
36
  <?php wp_nonce_field( 'user-registration-settings' ); ?>
includes/admin/views/html-license-form.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  $license_key = sanitize_title( $this->plugin_slug . '_license_key' );
@@ -15,7 +15,7 @@ $license_key = sanitize_title( $this->plugin_slug . '_license_key' );
15
  <?php $this->error_notices(); ?>
16
  <input type="checkbox" name="checked[]" value="1" checked="checked" style="display: none;">
17
  <div class="update-message inline user-registration-updater-license-key">
18
- <label for="<?php echo $license_key ?>"><?php _e( 'License:', 'user-registration' ); ?></label>
19
  <input type="text" id="<?php echo $license_key; ?>" name="<?php echo esc_attr( $license_key ); ?>" placeholder="<?php echo esc_attr( 'XXXX-XXXX-XXXX-XXXX', 'user-registration' ); ?>" />
20
  <span class="description"><?php _e( 'Enter your license key and hit return. A valid key is required for updates.', 'user-registration' ); ?> <?php printf( 'Lost your key? <a href="%s">Retrieve it here</a>.', esc_url( 'https://wpeverest.com/lost-licence-key/' ) ); ?></span>
21
  </div>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  $license_key = sanitize_title( $this->plugin_slug . '_license_key' );
15
  <?php $this->error_notices(); ?>
16
  <input type="checkbox" name="checked[]" value="1" checked="checked" style="display: none;">
17
  <div class="update-message inline user-registration-updater-license-key">
18
+ <label for="<?php echo $license_key; ?>"><?php _e( 'License:', 'user-registration' ); ?></label>
19
  <input type="text" id="<?php echo $license_key; ?>" name="<?php echo esc_attr( $license_key ); ?>" placeholder="<?php echo esc_attr( 'XXXX-XXXX-XXXX-XXXX', 'user-registration' ); ?>" />
20
  <span class="description"><?php _e( 'Enter your license key and hit return. A valid key is required for updates.', 'user-registration' ); ?> <?php printf( 'Lost your key? <a href="%s">Retrieve it here</a>.', esc_url( 'https://wpeverest.com/lost-licence-key/' ) ); ?></span>
21
  </div>
includes/admin/views/html-notice-custom.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
includes/admin/views/html-notice-deactivation.php CHANGED
@@ -7,11 +7,11 @@
7
  * @author WPEverest
8
  * @category Admin
9
  * @package User Registration/Admin
10
- * @since 1.1.4
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
14
- exit;
15
  }
16
 
17
  $reason_deactivation_url = 'https://wpeverest.com/deactivation/user-registration/';
@@ -25,4 +25,4 @@ $deactivate_url = wp_nonce_url( 'plugins.php?action=deactivate&amp;plugin=' . UR
25
  <p><?php printf( __( 'Before we deactivate User Registration, would you care to <a href="%1$s" target="_blank">let us know why</a> so we can improve it for you? <a href="%2$s">No, deactivate now</a>.', 'user-registration' ), $reason_deactivation_url, $deactivate_url ); ?></p>
26
  </div>
27
  </td>
28
- </tr>
7
  * @author WPEverest
8
  * @category Admin
9
  * @package User Registration/Admin
10
+ * @since 1.1.4
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) {
14
+ exit; // Exit if accessed directly.
15
  }
16
 
17
  $reason_deactivation_url = 'https://wpeverest.com/deactivation/user-registration/';
25
  <p><?php printf( __( 'Before we deactivate User Registration, would you care to <a href="%1$s" target="_blank">let us know why</a> so we can improve it for you? <a href="%2$s">No, deactivate now</a>.', 'user-registration' ), $reason_deactivation_url, $deactivate_url ); ?></p>
26
  </div>
27
  </td>
28
+ </tr>
includes/admin/views/html-notice-error.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
includes/admin/views/html-notice-install.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
includes/admin/views/html-notice-key-activated.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
includes/admin/views/html-notice-key-deactivated.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
includes/admin/views/html-notice-key-unvalidated.php CHANGED
@@ -4,11 +4,11 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div id="message" class="updated">
12
  <p class="ur-updater-dismiss" style="float:right;"><a href="<?php echo esc_url( add_query_arg( 'dismiss-' . sanitize_title( $this->plugin_slug ), '1' ) ); ?>"><?php _e( 'Hide notice', 'user-registration' ); ?></a></p>
13
- <p><?php printf( __( '%sPlease enter your license key%s in the plugin list below to get updates for <strong>%s</strong> Add-Ons.', 'user-registration' ), '<a href="' . esc_url( admin_url( 'plugins.php#' . sanitize_title( $this->plugin_slug ) ) ) . '">', '</a>', esc_html( $this->plugin_data[ 'Name' ] ) ); ?></p>
14
  </div>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div id="message" class="updated">
12
  <p class="ur-updater-dismiss" style="float:right;"><a href="<?php echo esc_url( add_query_arg( 'dismiss-' . sanitize_title( $this->plugin_slug ), '1' ) ); ?>"><?php _e( 'Hide notice', 'user-registration' ); ?></a></p>
13
+ <p><?php printf( __( '%1$sPlease enter your license key%2$s in the plugin list below to get updates for <strong>%3$s</strong> Add-Ons.', 'user-registration' ), '<a href="' . esc_url( admin_url( 'plugins.php#' . sanitize_title( $this->plugin_slug ) ) ) . '">', '</a>', esc_html( $this->plugin_data['Name'] ) ); ?></p>
14
  </div>
includes/admin/views/html-notice-registration.php CHANGED
@@ -4,13 +4,13 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div id="message" class="error user-registration-message">
12
  <a class="user-registration-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'ur-hide-notice', 'register' ), 'user_registration_hide_notices_nonce', '_ur_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'user-registration' ); ?></a>
13
 
14
- <p><?php echo sprintf( __( 'To allow users to register for your website via User registration, you must first enable user registration. Go to %sSettings > General%s tab, and under Membership make sure to check <strong>Anyone can register</strong>.', 'user-registration' ), '<a target="_blank" href="' . admin_url( 'options-general.php#admin_email' ) . '">', '</a>' ); ?></p>
15
  </div>
16
 
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div id="message" class="error user-registration-message">
12
  <a class="user-registration-message-close notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'ur-hide-notice', 'register' ), 'user_registration_hide_notices_nonce', '_ur_notice_nonce' ) ); ?>"><?php _e( 'Dismiss', 'user-registration' ); ?></a>
13
 
14
+ <p><?php echo sprintf( __( 'To allow users to register for your website via User registration, you must first enable user registration. Go to %1$sSettings > General%2$s tab, and under Membership make sure to check <strong>Anyone can register</strong>.', 'user-registration' ), '<a target="_blank" href="' . admin_url( 'options-general.php#admin_email' ) . '">', '</a>' ); ?></p>
15
  </div>
16
 
includes/admin/views/html-notice-update.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
includes/admin/views/html-notice-updated.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
includes/admin/views/html-notice-updating.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
includes/class-ur-ajax.php CHANGED
@@ -23,9 +23,9 @@ class UR_AJAX {
23
  /**
24
  * Hooks in ajax handlers
25
  */
26
- private static $field_key_aray = array();
27
  private static $is_field_key_pass = true;
28
- private static $failed_key_value = array();
29
 
30
  public static function init() {
31
  self::add_ajax_events();
@@ -36,11 +36,11 @@ class UR_AJAX {
36
  */
37
  public static function add_ajax_events() {
38
  $ajax_events = array(
39
- 'user_input_dropped' => true,
40
- 'form_save_action' => true,
41
- 'user_form_submit' => true,
42
  'deactivation_notice' => false,
43
- 'rated' => false,
44
  );
45
 
46
  foreach ( $ajax_events as $ajax_event => $nopriv ) {
@@ -54,6 +54,7 @@ class UR_AJAX {
54
 
55
  /**
56
  * Get Post data on frontend form submit
 
57
  * @return void
58
  */
59
  public static function user_form_submit() {
@@ -61,35 +62,41 @@ class UR_AJAX {
61
  check_ajax_referer( 'user_registration_form_data_save_nonce', 'security' );
62
 
63
  $form_id = isset( $_POST['form_id'] ) ? absint( $_POST['form_id'] ) : 0;
64
- $nonce = isset( $_POST['ur_frontend_form_nonce'] ) ? $_POST['ur_frontend_form_nonce'] : '';
65
- $captcha_response = isset( $_POST['captchaResponse'] ) ? $_POST['captchaResponse'] : '';
66
- $flag = wp_verify_nonce( $nonce, 'ur_frontend_form_id-' . $form_id );
67
  $recaptcha_enabled = ur_get_form_setting_by_key( $form_id, 'user_registration_form_setting_enable_recaptcha_support', 'no' );
68
  $recaptcha_version = get_option( 'user_registration_integration_setting_recaptcha_version' );
69
- $secret_key = 'v3' === $recaptcha_version ? get_option( 'user_registration_integration_setting_recaptcha_site_secret_v3' ) : get_option( 'user_registration_integration_setting_recaptcha_site_secret' );
70
 
71
- if( 'yes' === $recaptcha_enabled ) {
72
  if ( ! empty( $captcha_response ) ) {
73
 
74
- $data = wp_remote_get( 'https://www.google.com/recaptcha/api/siteverify?secret=' . $secret_key . '&response=' . $captcha_response );
75
- $data = json_decode( wp_remote_retrieve_body( $data ) );
76
 
77
  if ( empty( $data->success ) || ( isset( $data->score ) && $data->score < apply_filters( 'user_registration_recaptcha_v3_threshold', 0.5 ) ) ) {
78
- wp_send_json_error( array(
79
- 'message' => __( 'Error on google reCaptcha. Contact your site administrator.', 'user-registration' ),
80
- ) );
 
 
81
  }
82
  } else {
83
- wp_send_json_error( array(
84
- 'message' => get_option( 'user_registration_form_submission_error_message_recaptcha', __( 'Captcha code error, please try again.', 'user-registration' ) ),
85
- ) );
 
 
86
  }
87
  }
88
 
89
  if ( $flag != true || is_wp_error( $flag ) ) {
90
- wp_send_json_error( array(
91
- 'message' => __( 'Nonce error, please reload.', 'user-registration' ),
92
- ) );
 
 
93
  }
94
 
95
  $users_can_register = apply_filters( 'ur_register_setting_override', get_option( 'users_can_register' ) );
@@ -97,9 +104,11 @@ class UR_AJAX {
97
  if ( ! is_user_logged_in() ) {
98
 
99
  if ( ! $users_can_register ) {
100
- wp_send_json_error( array(
101
- 'message' => apply_filters( 'ur_register_pre_form_message', __( 'Only administrators can add new users.', 'user-registration' ) )
102
- ) );
 
 
103
  }
104
  } else {
105
 
@@ -113,9 +122,11 @@ class UR_AJAX {
113
  $current_url = home_url( add_query_arg( array(), $wp->request ) );
114
  $display_name = ! empty( $user->data->display_name ) ? $user->data->display_name : $user->data->user_email;
115
 
116
- wp_send_json_error( array(
117
- 'message' => apply_filters( 'ur_register_pre_form_message', '<p class="alert" id="ur_register_pre_form_message">' . sprintf( __( "You are currently logged in as %1s. %2s", 'user-registration' ), '<a href="#" title="' . $display_name . '">' . $display_name . '</a>', '<a href="' . wp_logout_url( $current_url ) . '" title="' . __( 'Log out of this account.', 'user-registration' ) . '">' . __( 'Logout', 'user-registration' ) . ' &raquo;</a>' ) . '</p>', $user_ID )
118
- ) );
 
 
119
  }
120
  }
121
 
@@ -144,7 +155,7 @@ class UR_AJAX {
144
  }
145
 
146
  $class_file_name = str_replace( 'user_registration_', '', $form_field_id );
147
- $class_name = ur_load_form_field_class( $class_file_name );
148
 
149
  if ( empty( $class_name ) ) {
150
  throw new Exception( 'class not exists' );
@@ -152,20 +163,24 @@ class UR_AJAX {
152
 
153
  $template = $class_name::get_instance()->get_admin_template();
154
 
155
- wp_send_json_success( array(
156
- 'template' => $template,
157
- ) );
 
 
158
 
159
- }
160
- catch ( Exception $e ) {
161
- wp_send_json_error( array(
162
- 'error' => $e->getMessage(),
163
- ) );
 
164
  }
165
  }
166
 
167
  /**
168
  * Form save from backend
 
169
  * @return void
170
  */
171
  public static function form_save_action() {
@@ -211,15 +226,15 @@ class UR_AJAX {
211
  }
212
 
213
  $form_name = sanitize_text_field( $_POST['data']['form_name'] );
214
- $form_id = sanitize_text_field( $_POST['data']['form_id'] );
215
 
216
  $post_data = array(
217
- 'post_type' => 'user_registration',
218
- 'post_title' => ur_clean( $form_name ),
219
- 'post_content' => wp_json_encode( $post_data, JSON_UNESCAPED_UNICODE ),
220
- 'post_status' => 'publish',
221
  'comment_status' => 'closed', // if you prefer
222
- 'ping_status' => 'closed', // if you prefer
223
  );
224
 
225
  if ( $form_id > 0 && is_numeric( $form_id ) ) {
@@ -233,22 +248,26 @@ class UR_AJAX {
233
  ur_update_form_settings( $post_data_setting, $post_id );
234
  }
235
 
236
- wp_send_json_success( array(
237
- 'data' => $post_data,
238
- 'post_id' => $post_id,
239
- ) );
 
 
240
 
241
- }
242
- catch ( Exception $e ) {
243
- wp_send_json_error( array(
244
- 'message' => $e->getMessage(),
245
- ) );
 
246
 
247
  }// End try().
248
  }
249
 
250
  /**
251
  * AJAX plugin deactivation notice.
 
252
  * @since 1.4.2
253
  */
254
  public static function deactivation_notice() {
@@ -256,7 +275,7 @@ class UR_AJAX {
256
  check_ajax_referer( 'deactivation-notice', 'security' );
257
 
258
  ob_start();
259
- include_once( UR_ABSPATH . 'includes/admin/views/html-notice-deactivation.php' );
260
 
261
  $content = ob_get_clean();
262
  wp_send_json( $content ); // WPCS: XSS OK.
@@ -264,6 +283,7 @@ class UR_AJAX {
264
 
265
  /**
266
  * Checks if the string passes the regex
 
267
  * @param string $value
268
  * @return boolean
269
  */
@@ -283,6 +303,7 @@ class UR_AJAX {
283
 
284
  /**
285
  * Sanitize values of form field in backend
 
286
  * @param array &$array
287
  */
288
  public static function sweep_array( &$array ) {
@@ -299,7 +320,7 @@ class UR_AJAX {
299
 
300
  if ( ! $regex_status || in_array( $value, self::$field_key_aray ) ) {
301
  self::$is_field_key_pass = false;
302
- self::$failed_key_value = array(
303
  'key' => $key,
304
  'value' => $value,
305
  );
@@ -308,21 +329,23 @@ class UR_AJAX {
308
  }
309
  array_push( self::$field_key_aray, $value );
310
  }
311
- if( $key === 'description' ) {
312
- $value = str_replace('"', "'", $value);
313
- $value = wp_kses( $value, array(
314
- 'a' => array(
315
- 'href' => array(),
316
- 'title' => array(),
317
- 'target' => array(),
318
- ),
319
- 'br' => array(),
320
- 'em' => array(),
321
- 'strong' => array(),
322
- )
323
- );
324
-
325
- } elseif( $key == 'html') {
 
 
326
 
327
  if ( ! current_user_can( 'unfiltered_html' ) ) {
328
  $value = wp_kses_post( $value );
23
  /**
24
  * Hooks in ajax handlers
25
  */
26
+ private static $field_key_aray = array();
27
  private static $is_field_key_pass = true;
28
+ private static $failed_key_value = array();
29
 
30
  public static function init() {
31
  self::add_ajax_events();
36
  */
37
  public static function add_ajax_events() {
38
  $ajax_events = array(
39
+ 'user_input_dropped' => true,
40
+ 'form_save_action' => true,
41
+ 'user_form_submit' => true,
42
  'deactivation_notice' => false,
43
+ 'rated' => false,
44
  );
45
 
46
  foreach ( $ajax_events as $ajax_event => $nopriv ) {
54
 
55
  /**
56
  * Get Post data on frontend form submit
57
+ *
58
  * @return void
59
  */
60
  public static function user_form_submit() {
62
  check_ajax_referer( 'user_registration_form_data_save_nonce', 'security' );
63
 
64
  $form_id = isset( $_POST['form_id'] ) ? absint( $_POST['form_id'] ) : 0;
65
+ $nonce = isset( $_POST['ur_frontend_form_nonce'] ) ? $_POST['ur_frontend_form_nonce'] : '';
66
+ $captcha_response = isset( $_POST['captchaResponse'] ) ? $_POST['captchaResponse'] : '';
67
+ $flag = wp_verify_nonce( $nonce, 'ur_frontend_form_id-' . $form_id );
68
  $recaptcha_enabled = ur_get_form_setting_by_key( $form_id, 'user_registration_form_setting_enable_recaptcha_support', 'no' );
69
  $recaptcha_version = get_option( 'user_registration_integration_setting_recaptcha_version' );
70
+ $secret_key = 'v3' === $recaptcha_version ? get_option( 'user_registration_integration_setting_recaptcha_site_secret_v3' ) : get_option( 'user_registration_integration_setting_recaptcha_site_secret' );
71
 
72
+ if ( 'yes' === $recaptcha_enabled ) {
73
  if ( ! empty( $captcha_response ) ) {
74
 
75
+ $data = wp_remote_get( 'https://www.google.com/recaptcha/api/siteverify?secret=' . $secret_key . '&response=' . $captcha_response );
76
+ $data = json_decode( wp_remote_retrieve_body( $data ) );
77
 
78
  if ( empty( $data->success ) || ( isset( $data->score ) && $data->score < apply_filters( 'user_registration_recaptcha_v3_threshold', 0.5 ) ) ) {
79
+ wp_send_json_error(
80
+ array(
81
+ 'message' => __( 'Error on google reCaptcha. Contact your site administrator.', 'user-registration' ),
82
+ )
83
+ );
84
  }
85
  } else {
86
+ wp_send_json_error(
87
+ array(
88
+ 'message' => get_option( 'user_registration_form_submission_error_message_recaptcha', __( 'Captcha code error, please try again.', 'user-registration' ) ),
89
+ )
90
+ );
91
  }
92
  }
93
 
94
  if ( $flag != true || is_wp_error( $flag ) ) {
95
+ wp_send_json_error(
96
+ array(
97
+ 'message' => __( 'Nonce error, please reload.', 'user-registration' ),
98
+ )
99
+ );
100
  }
101
 
102
  $users_can_register = apply_filters( 'ur_register_setting_override', get_option( 'users_can_register' ) );
104
  if ( ! is_user_logged_in() ) {
105
 
106
  if ( ! $users_can_register ) {
107
+ wp_send_json_error(
108
+ array(
109
+ 'message' => apply_filters( 'ur_register_pre_form_message', __( 'Only administrators can add new users.', 'user-registration' ) ),
110
+ )
111
+ );
112
  }
113
  } else {
114
 
122
  $current_url = home_url( add_query_arg( array(), $wp->request ) );
123
  $display_name = ! empty( $user->data->display_name ) ? $user->data->display_name : $user->data->user_email;
124
 
125
+ wp_send_json_error(
126
+ array(
127
+ 'message' => apply_filters( 'ur_register_pre_form_message', '<p class="alert" id="ur_register_pre_form_message">' . sprintf( __( 'You are currently logged in as %1$1s. %2$2s', 'user-registration' ), '<a href="#" title="' . $display_name . '">' . $display_name . '</a>', '<a href="' . wp_logout_url( $current_url ) . '" title="' . __( 'Log out of this account.', 'user-registration' ) . '">' . __( 'Logout', 'user-registration' ) . ' &raquo;</a>' ) . '</p>', $user_ID ),
128
+ )
129
+ );
130
  }
131
  }
132
 
155
  }
156
 
157
  $class_file_name = str_replace( 'user_registration_', '', $form_field_id );
158
+ $class_name = ur_load_form_field_class( $class_file_name );
159
 
160
  if ( empty( $class_name ) ) {
161
  throw new Exception( 'class not exists' );
163
 
164
  $template = $class_name::get_instance()->get_admin_template();
165
 
166
+ wp_send_json_success(
167
+ array(
168
+ 'template' => $template,
169
+ )
170
+ );
171
 
172
+ } catch ( Exception $e ) {
173
+ wp_send_json_error(
174
+ array(
175
+ 'error' => $e->getMessage(),
176
+ )
177
+ );
178
  }
179
  }
180
 
181
  /**
182
  * Form save from backend
183
+ *
184
  * @return void
185
  */
186
  public static function form_save_action() {
226
  }
227
 
228
  $form_name = sanitize_text_field( $_POST['data']['form_name'] );
229
+ $form_id = sanitize_text_field( $_POST['data']['form_id'] );
230
 
231
  $post_data = array(
232
+ 'post_type' => 'user_registration',
233
+ 'post_title' => ur_clean( $form_name ),
234
+ 'post_content' => wp_json_encode( $post_data, JSON_UNESCAPED_UNICODE ),
235
+ 'post_status' => 'publish',
236
  'comment_status' => 'closed', // if you prefer
237
+ 'ping_status' => 'closed', // if you prefer
238
  );
239
 
240
  if ( $form_id > 0 && is_numeric( $form_id ) ) {
248
  ur_update_form_settings( $post_data_setting, $post_id );
249
  }
250
 
251
+ wp_send_json_success(
252
+ array(
253
+ 'data' => $post_data,
254
+ 'post_id' => $post_id,
255
+ )
256
+ );
257
 
258
+ } catch ( Exception $e ) {
259
+ wp_send_json_error(
260
+ array(
261
+ 'message' => $e->getMessage(),
262
+ )
263
+ );
264
 
265
  }// End try().
266
  }
267
 
268
  /**
269
  * AJAX plugin deactivation notice.
270
+ *
271
  * @since 1.4.2
272
  */
273
  public static function deactivation_notice() {
275
  check_ajax_referer( 'deactivation-notice', 'security' );
276
 
277
  ob_start();
278
+ include_once UR_ABSPATH . 'includes/admin/views/html-notice-deactivation.php';
279
 
280
  $content = ob_get_clean();
281
  wp_send_json( $content ); // WPCS: XSS OK.
283
 
284
  /**
285
  * Checks if the string passes the regex
286
+ *
287
  * @param string $value
288
  * @return boolean
289
  */
303
 
304
  /**
305
  * Sanitize values of form field in backend
306
+ *
307
  * @param array &$array
308
  */
309
  public static function sweep_array( &$array ) {
320
 
321
  if ( ! $regex_status || in_array( $value, self::$field_key_aray ) ) {
322
  self::$is_field_key_pass = false;
323
+ self::$failed_key_value = array(
324
  'key' => $key,
325
  'value' => $value,
326
  );
329
  }
330
  array_push( self::$field_key_aray, $value );
331
  }
332
+ if ( $key === 'description' ) {
333
+ $value = str_replace( '"', "'", $value );
334
+ $value = wp_kses(
335
+ $value,
336
+ array(
337
+ 'a' => array(
338
+ 'href' => array(),
339
+ 'title' => array(),
340
+ 'target' => array(),
341
+ ),
342
+ 'br' => array(),
343
+ 'em' => array(),
344
+ 'strong' => array(),
345
+ )
346
+ );
347
+
348
+ } elseif ( $key == 'html' ) {
349
 
350
  if ( ! current_user_can( 'unfiltered_html' ) ) {
351
  $value = wp_kses_post( $value );
includes/class-ur-autoloader.php CHANGED
@@ -58,7 +58,7 @@ class UR_Autoloader {
58
  */
59
  private function load_file( $path ) {
60
  if ( $path && is_readable( $path ) ) {
61
- include_once( $path );
62
 
63
  return true;
64
  }
@@ -82,10 +82,9 @@ class UR_Autoloader {
82
  $path = $this->include_path . 'admin/meta-boxes/';
83
  } elseif ( strpos( $class, 'ur_admin' ) === 0 ) {
84
  $path = $this->include_path . 'admin/';
85
- } elseif ( strpos($class, 'ur_settings') === 0 ) {
86
  $path = $this->include_path . 'admin/settings/emails/';
87
- }
88
- elseif ( strpos( $class, 'ur_form' ) === 0 ) {
89
  $path = $this->include_path . 'form/';
90
  } elseif ( strpos( $class, 'ur_log_handler_' ) === 0 ) {
91
  $path = $this->include_path . 'log-handlers/';
58
  */
59
  private function load_file( $path ) {
60
  if ( $path && is_readable( $path ) ) {
61
+ include_once $path;
62
 
63
  return true;
64
  }
82
  $path = $this->include_path . 'admin/meta-boxes/';
83
  } elseif ( strpos( $class, 'ur_admin' ) === 0 ) {
84
  $path = $this->include_path . 'admin/';
85
+ } elseif ( strpos( $class, 'ur_settings' ) === 0 ) {
86
  $path = $this->include_path . 'admin/settings/emails/';
87
+ } elseif ( strpos( $class, 'ur_form' ) === 0 ) {
 
88
  $path = $this->include_path . 'form/';
89
  } elseif ( strpos( $class, 'ur_log_handler_' ) === 0 ) {
90
  $path = $this->include_path . 'log-handlers/';
includes/class-ur-background-updater.php CHANGED
@@ -17,11 +17,11 @@ if ( ! defined( 'ABSPATH' ) ) {
17
  }
18
 
19
  if ( ! class_exists( 'WP_Async_Request', false ) ) {
20
- include_once( dirname( __FILE__ ) . '/libraries/wp-async-request.php' );
21
  }
22
 
23
  if ( ! class_exists( 'WP_Background_Process', false ) ) {
24
- include_once( dirname( __FILE__ ) . '/libraries/wp-background-process.php' );
25
  }
26
 
27
  /**
@@ -98,7 +98,7 @@ class UR_Background_Updater extends WP_Background_Process {
98
  define( 'UR_UPDATING', true );
99
  }
100
 
101
- include_once( 'functions-ur-update.php' );
102
 
103
  if ( is_callable( $callback ) ) {
104
  call_user_func( $callback );
17
  }
18
 
19
  if ( ! class_exists( 'WP_Async_Request', false ) ) {
20
+ include_once dirname( __FILE__ ) . '/libraries/wp-async-request.php';
21
  }
22
 
23
  if ( ! class_exists( 'WP_Background_Process', false ) ) {
24
+ include_once dirname( __FILE__ ) . '/libraries/wp-background-process.php';
25
  }
26
 
27
  /**
98
  define( 'UR_UPDATING', true );
99
  }
100
 
101
+ include_once 'functions-ur-update.php';
102
 
103
  if ( is_callable( $callback ) ) {
104
  call_user_func( $callback );
includes/class-ur-email-confirmation.php CHANGED
@@ -21,7 +21,7 @@ class UR_Email_Confirmation {
21
  public function __construct() {
22
 
23
  // Return if the login option is not email confirmation
24
- if( 'email_confirmation' !== get_option( 'user_registration_general_setting_login_options' ) ) {
25
  return;
26
  }
27
 
@@ -30,11 +30,11 @@ class UR_Email_Confirmation {
30
  add_filter( 'user_row_actions', array( $this, 'create_quick_links' ), 10, 2 );
31
  add_action( 'load-users.php', array( $this, 'trigger_query_actions' ) );
32
 
33
- add_filter( 'wp_authenticate_user', array( $this, 'check_email_status' ),10,2);
34
  add_filter( 'allow_password_reset', array( $this, 'allow_password_reset' ), 10, 2 );
35
  add_action( 'user_registration_after_register_user_action', array( $this, 'set_email_status' ), 9, 3 );
36
- add_action( 'template_redirect', array( $this, 'check_token_before_authenticate' ), 30, 2);
37
- add_action( 'wp_authenticate', array($this, 'check_token_before_authenticate'), 40, 2);
38
  }
39
 
40
  /**
@@ -47,23 +47,33 @@ class UR_Email_Confirmation {
47
  */
48
  public function create_quick_links( $actions, $user ) {
49
 
50
- $verify_link = add_query_arg( array( 'action' => 'verify', 'user' => $user->ID ) );
 
 
 
 
 
51
  $verify_link = remove_query_arg( array( 'new_role' ), $verify_link );
52
  $verify_link = wp_nonce_url( $verify_link, 'ur_user_change_email_status' );
53
 
54
- $unverify_link = add_query_arg( array( 'action' => 'unverify', 'user' => $user->ID ) );
 
 
 
 
 
55
  $unverify_link = remove_query_arg( array( 'new_role' ), $unverify_link );
56
  $unverify_link = wp_nonce_url( $unverify_link, 'ur_user_change_email_status' );
57
 
58
- $verify_action = '<a style="color:#086512" href="' . esc_url( $verify_link ) . '">' . _x( 'Verify', 'The action on users list page', 'user-registration' ) . '</a>';
59
  $unverify_action = '<a style="color:#e20707" href="' . esc_url( $unverify_link ) . '">' . _x( 'Unverify', 'The action on users list page', 'user-registration' ) . '</a>';
60
 
61
  if ( current_user_can( 'edit_user' ) ) {
62
  $get_user_status = get_user_meta( $user->ID, 'ur_confirm_email', true );
63
 
64
- if( '0' === $get_user_status ) {
65
  $actions['ur_user_verify_action'] = $verify_action;
66
- } elseif( '1' === $get_user_status ) {
67
  $actions['ur_user_unverify_action'] = $unverify_action;
68
  }
69
  }
@@ -75,21 +85,21 @@ class UR_Email_Confirmation {
75
  */
76
  public function trigger_query_actions() {
77
 
78
- $action = isset( $_REQUEST['action'] ) ? sanitize_key( $_REQUEST['action'] ) : false;
79
- $mode = isset( $_POST['mode'] ) ? $_POST['mode'] : false;
80
 
81
  // If this is a multisite, bulk request, stop now!
82
  if ( 'list' == $mode ) {
83
  return;
84
  }
85
 
86
- if ( ! empty( $action ) && in_array( $action, array( 'verify', 'unverify' ) ) && !isset( $_GET['new_role'] ) ) {
87
 
88
  check_admin_referer( 'ur_user_change_email_status' );
89
 
90
  $redirect = admin_url( 'users.php' );
91
- $status = $action;
92
- $user_id = absint( $_GET['user'] );
93
 
94
  if ( $status == 'verify' ) {
95
  update_user_meta( $user_id, 'ur_confirm_email', '1' );
@@ -118,8 +128,8 @@ class UR_Email_Confirmation {
118
 
119
  $the_columns['ur_user_user_email_status'] = __( 'Status', 'user-registration' );
120
 
121
- $newcol = array_slice( $columns, 0, -1 );
122
- $newcol = array_merge( $newcol, $the_columns );
123
  $columns = array_merge( $newcol, array_slice( $columns, 1 ) );
124
 
125
  return $columns;
@@ -130,7 +140,7 @@ class UR_Email_Confirmation {
130
  *
131
  * @param string $val
132
  * @param string $column_name
133
- * @param int $user_id
134
  *
135
  * @return string
136
  */
@@ -139,11 +149,11 @@ class UR_Email_Confirmation {
139
  return false;
140
  }
141
 
142
- if ( $column_name == 'ur_user_user_email_status') {
143
- $val = get_user_meta( $user_id, 'ur_confirm_email', true );
144
  $token = get_user_meta( $user_id, 'ur_confirm_email_token', true );
145
 
146
- if( '1' === $val ) {
147
  $val = __( 'Verified', 'user-registration' );
148
  } elseif ( $val == '0' && isset( $token ) ) {
149
  $val = __( 'Pending', 'user-registration' );
@@ -157,35 +167,37 @@ class UR_Email_Confirmation {
157
 
158
  /**
159
  * Enqueque CSS to load notice
 
160
  * @return void
161
  */
162
  public function ur_enqueue_script() {
163
- wp_register_style( 'user-registration-css', UR()->plugin_url().'/assets/css/user-registration.css', array(), UR_VERSION );
164
- wp_enqueue_style('user-registration-css');
165
  }
166
 
167
  // Successful registration message.
168
  public function custom_registration_message() {
169
- return ur_print_notice( __('User successfully registered. Login to continue.','user-registration'));
170
  }
171
 
172
  // Token mismatch message.
173
  public function custom_registration_error_message() {
174
- return ur_print_notice( __('Token Mismatch!','user-registration'), 'error' );
175
  }
176
 
177
  // Resend verification email message.
178
  public function custom_resend_email_token_message() {
179
- return ur_print_notice( __('Verification Email Sent!','user-registration'));
180
  }
181
 
182
  // Resend verification email error message.
183
  public function custom_resend_email_token_error_message() {
184
- return ur_print_notice( __('User doesnot exist!','user-registration'), 'error' );
185
  }
186
 
187
  /**
188
  * Compare user token with token in url
 
189
  * @return void
190
  */
191
  public function check_token_before_authenticate() {
@@ -195,55 +207,59 @@ class UR_Email_Confirmation {
195
  add_action( 'login_enqueue_scripts', array( $this, 'ur_enqueue_script' ), 1 );
196
 
197
  // Condition for resending token.
198
- if( isset( $_GET['ur_resend_id'] ) && $_GET['ur_resend_token'] == 'true') {
 
 
 
 
199
 
200
  $user_id = $this->crypt_the_string( $_GET['ur_resend_id'], 'd' );
201
- $user = get_user_by( 'id', $user_id );
 
202
 
203
- if( $user ) {
204
  $this->get_token( $user_id );
205
  $this->set_email_status( array(), '', $user_id );
206
 
207
  $attachments = apply_filters( 'user_registration_email_attachment_resending_token', array() );
 
208
 
209
- UR_Emailer::send_mail_to_user( $user->user_email, $user->user_login, $user_id, '', array(), $attachments );
210
 
211
- add_filter('login_message', array( $this,'custom_resend_email_token_message' ) );
212
- add_filter('user_registration_login_form_before_notice', array( $this,'custom_resend_email_token_message' ) );
213
  } else {
214
 
215
- add_filter('login_message', array( $this,'custom_resend_email_token_error_message' ) );
216
- add_filter('user_registration_login_form_before_notice', array( $this,'custom_resend_email_token_error_message' ) );
217
- ;
218
  }
219
-
220
  }
221
 
222
- if( ! isset( $_GET['ur_token'] ) ) {
223
  return;
224
  } else {
225
 
226
- $output = str_split( $_GET['ur_token'], 50 );
227
- $user_id = $this->crypt_the_string( $output[1], 'd');
 
228
  $user_token = get_user_meta( $user_id, 'ur_confirm_email_token', true );
229
 
230
  // Check if the token matches the token value stored in db.
231
- if( $user_token == $_GET['ur_token'] ) {
232
  $user_reg_successful = true;
233
 
234
  update_user_meta( $user_id, 'ur_confirm_email', 1 );
235
- delete_user_meta( $user_id, 'ur_confirm_email_token');
236
 
237
- add_filter('login_message', array( $this,'custom_registration_message' ) );
238
- add_filter('user_registration_login_form_before_notice', array( $this,'custom_registration_message' ) );
239
  } else {
240
- add_filter('login_message', array( $this,'custom_registration_error_message' ) );
241
- add_filter('user_registration_login_form_before_notice', array( $this,'custom_registration_error_message' ) );
242
  }
243
  }
244
 
245
- do_action('user_registration_check_token_complete', $user_id, $user_reg_successful );
246
-
247
  }
248
 
249
  /**
@@ -256,59 +272,60 @@ class UR_Email_Confirmation {
256
  */
257
  public function crypt_the_string( $string, $action = 'e' ) {
258
 
259
- $secret_key = 'ur_secret_key';
260
- $secret_iv = 'ur_secret_iv';
261
 
262
- $output = false;
263
- $encrypt_method = "AES-256-CBC";
264
- $key = hash( 'sha256', $secret_key );
265
- $iv = substr( hash( 'sha256', $secret_iv ), 0, 16 );
266
 
267
- if( $action == 'e' ) {
268
- $output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) );
269
- }
270
- else if( $action == 'd' ){
271
- $output = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv );
272
- }
273
 
274
- return $output;
275
  }
276
 
277
  /**
278
  * Generate email token for the user.
279
- * @param int $user_id User ID.
 
280
  * @return string Token.
281
  */
282
  public function get_token( $user_id ) {
283
 
284
- $length = 50;
285
- $token = "";
286
- $codeAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
287
- $codeAlphabet.= "abcdefghijklmnopqrstuvwxyz";
288
- $codeAlphabet.= "0123456789";
289
- $max = strlen($codeAlphabet);
290
 
291
- for ($i=0; $i < $length; $i++) {
292
- $token .= $codeAlphabet[random_int(0, $max-1)];
293
- }
294
 
295
- $token .=$this->crypt_the_string($user_id,'e');
296
 
297
- return $token;
298
 
299
- do_action('user_registration_get_token');
300
  }
301
 
302
  /**
303
  * Set the token of the user and update it to usermeta table in database.
304
- * @param array $valid_form_data Form filled data.
305
- * @param int $form_id Form ID.
306
- * @param int $user_id User ID.
 
307
  */
308
  public function set_email_status( $valid_form_data, $form_id, $user_id ) {
309
 
310
- if( 'email_confirmation' === get_option( 'user_registration_general_setting_login_options' ) ) {
311
- $token = $this->get_token($user_id);
312
  update_user_meta( $user_id, 'ur_confirm_email', 0 );
313
  update_user_meta( $user_id, 'ur_confirm_email_token', $token );
314
  }
@@ -316,17 +333,22 @@ class UR_Email_Confirmation {
316
 
317
  /**
318
  * Check the email status during authentication
 
319
  * @param WP_User $user User instance
320
  * @return mixed
321
  */
322
  public function check_email_status( WP_User $user ) {
323
 
324
- $email_status = get_user_meta($user->ID, 'ur_confirm_email', true);
325
 
326
  do_action( 'ur_user_before_check_email_status_on_login', $email_status, $user );
327
 
328
- if( $email_status === '0' ) {
329
- $message = '<strong>' . __( 'ERROR:', 'user-registration' ) . '</strong> ' . sprintf( __( 'Your account is still pending approval. Verify your email by clicking on the link sent to your email. %s', 'user-registration' ), '<a id="resend-email" href="?ur_resend_id='. $this->crypt_the_string( $user->ID, 'e' ) .'&ur_resend_token=true">'. __( 'Resend Verification Link', 'user-registration' ). '</a>' );
 
 
 
 
330
 
331
  return new WP_Error( 'user_email_not_verified', $message );
332
  }
@@ -344,11 +366,11 @@ class UR_Email_Confirmation {
344
  */
345
  public function allow_password_reset( $result, $user_id ) {
346
 
347
- $email_status = get_user_meta($user_id, 'ur_confirm_email', true);
348
 
349
  if ( $email_status === '0' ) {
350
  $error_message = __( 'Email not verified! Verifiy your email by clicking on the link sent to your email.', 'user-registration' );
351
- $result = new WP_Error( 'user_email_not_verified', $error_message );
352
  }
353
 
354
  return $result;
21
  public function __construct() {
22
 
23
  // Return if the login option is not email confirmation
24
+ if ( 'email_confirmation' !== get_option( 'user_registration_general_setting_login_options' ) ) {
25
  return;
26
  }
27
 
30
  add_filter( 'user_row_actions', array( $this, 'create_quick_links' ), 10, 2 );
31
  add_action( 'load-users.php', array( $this, 'trigger_query_actions' ) );
32
 
33
+ add_filter( 'wp_authenticate_user', array( $this, 'check_email_status' ), 10, 2 );
34
  add_filter( 'allow_password_reset', array( $this, 'allow_password_reset' ), 10, 2 );
35
  add_action( 'user_registration_after_register_user_action', array( $this, 'set_email_status' ), 9, 3 );
36
+ add_action( 'template_redirect', array( $this, 'check_token_before_authenticate' ), 30, 2 );
37
+ add_action( 'wp_authenticate', array( $this, 'check_token_before_authenticate' ), 40, 2 );
38
  }
39
 
40
  /**
47
  */
48
  public function create_quick_links( $actions, $user ) {
49
 
50
+ $verify_link = add_query_arg(
51
+ array(
52
+ 'action' => 'verify',
53
+ 'user' => $user->ID,
54
+ )
55
+ );
56
  $verify_link = remove_query_arg( array( 'new_role' ), $verify_link );
57
  $verify_link = wp_nonce_url( $verify_link, 'ur_user_change_email_status' );
58
 
59
+ $unverify_link = add_query_arg(
60
+ array(
61
+ 'action' => 'unverify',
62
+ 'user' => $user->ID,
63
+ )
64
+ );
65
  $unverify_link = remove_query_arg( array( 'new_role' ), $unverify_link );
66
  $unverify_link = wp_nonce_url( $unverify_link, 'ur_user_change_email_status' );
67
 
68
+ $verify_action = '<a style="color:#086512" href="' . esc_url( $verify_link ) . '">' . _x( 'Verify', 'The action on users list page', 'user-registration' ) . '</a>';
69
  $unverify_action = '<a style="color:#e20707" href="' . esc_url( $unverify_link ) . '">' . _x( 'Unverify', 'The action on users list page', 'user-registration' ) . '</a>';
70
 
71
  if ( current_user_can( 'edit_user' ) ) {
72
  $get_user_status = get_user_meta( $user->ID, 'ur_confirm_email', true );
73
 
74
+ if ( '0' === $get_user_status ) {
75
  $actions['ur_user_verify_action'] = $verify_action;
76
+ } elseif ( '1' === $get_user_status ) {
77
  $actions['ur_user_unverify_action'] = $unverify_action;
78
  }
79
  }
85
  */
86
  public function trigger_query_actions() {
87
 
88
+ $action = isset( $_REQUEST['action'] ) ? sanitize_key( $_REQUEST['action'] ) : false;
89
+ $mode = isset( $_POST['mode'] ) ? $_POST['mode'] : false;
90
 
91
  // If this is a multisite, bulk request, stop now!
92
  if ( 'list' == $mode ) {
93
  return;
94
  }
95
 
96
+ if ( ! empty( $action ) && in_array( $action, array( 'verify', 'unverify' ) ) && ! isset( $_GET['new_role'] ) ) {
97
 
98
  check_admin_referer( 'ur_user_change_email_status' );
99
 
100
  $redirect = admin_url( 'users.php' );
101
+ $status = $action;
102
+ $user_id = absint( $_GET['user'] );
103
 
104
  if ( $status == 'verify' ) {
105
  update_user_meta( $user_id, 'ur_confirm_email', '1' );
128
 
129
  $the_columns['ur_user_user_email_status'] = __( 'Status', 'user-registration' );
130
 
131
+ $newcol = array_slice( $columns, 0, -1 );
132
+ $newcol = array_merge( $newcol, $the_columns );
133
  $columns = array_merge( $newcol, array_slice( $columns, 1 ) );
134
 
135
  return $columns;
140
  *
141
  * @param string $val
142
  * @param string $column_name
143
+ * @param int $user_id
144
  *
145
  * @return string
146
  */
149
  return false;
150
  }
151
 
152
+ if ( $column_name == 'ur_user_user_email_status' ) {
153
+ $val = get_user_meta( $user_id, 'ur_confirm_email', true );
154
  $token = get_user_meta( $user_id, 'ur_confirm_email_token', true );
155
 
156
+ if ( '1' === $val ) {
157
  $val = __( 'Verified', 'user-registration' );
158
  } elseif ( $val == '0' && isset( $token ) ) {
159
  $val = __( 'Pending', 'user-registration' );
167
 
168
  /**
169
  * Enqueque CSS to load notice
170
+ *
171
  * @return void
172
  */
173
  public function ur_enqueue_script() {
174
+ wp_register_style( 'user-registration-css', UR()->plugin_url() . '/assets/css/user-registration.css', array(), UR_VERSION );
175
+ wp_enqueue_style( 'user-registration-css' );
176
  }
177
 
178
  // Successful registration message.
179
  public function custom_registration_message() {
180
+ return ur_print_notice( __( 'User successfully registered. Login to continue.', 'user-registration' ) );
181
  }
182
 
183
  // Token mismatch message.
184
  public function custom_registration_error_message() {
185
+ return ur_print_notice( __( 'Token Mismatch!', 'user-registration' ), 'error' );
186
  }
187
 
188
  // Resend verification email message.
189
  public function custom_resend_email_token_message() {
190
+ return ur_print_notice( __( 'Verification Email Sent!', 'user-registration' ) );
191
  }
192
 
193
  // Resend verification email error message.
194
  public function custom_resend_email_token_error_message() {
195
+ return ur_print_notice( __( 'User doesnot exist!', 'user-registration' ), 'error' );
196
  }
197
 
198
  /**
199
  * Compare user token with token in url
200
+ *
201
  * @return void
202
  */
203
  public function check_token_before_authenticate() {
207
  add_action( 'login_enqueue_scripts', array( $this, 'ur_enqueue_script' ), 1 );
208
 
209
  // Condition for resending token.
210
+ if ( isset( $_GET['ur_resend_id'] ) && $_GET['ur_resend_token'] === 'true' ) {
211
+
212
+ if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'ur_resend_token' ) ) {
213
+ die( __( 'Action failed. Please refresh the page and retry.', 'user-registration' ) );
214
+ }
215
 
216
  $user_id = $this->crypt_the_string( $_GET['ur_resend_id'], 'd' );
217
+ $user_id = absint( $user_id );
218
+ $user = get_user_by( 'id', $user_id );
219
 
220
+ if ( $user ) {
221
  $this->get_token( $user_id );
222
  $this->set_email_status( array(), '', $user_id );
223
 
224
  $attachments = apply_filters( 'user_registration_email_attachment_resending_token', array() );
225
+ $name_value = ur_get_user_extra_fields( $user_id );
226
 
227
+ UR_Emailer::send_mail_to_user( $user->user_email, $user->user_login, $user_id, '', $name_value, $attachments );
228
 
229
+ add_filter( 'login_message', array( $this, 'custom_resend_email_token_message' ) );
230
+ add_filter( 'user_registration_login_form_before_notice', array( $this, 'custom_resend_email_token_message' ) );
231
  } else {
232
 
233
+ add_filter( 'login_message', array( $this, 'custom_resend_email_token_error_message' ) );
234
+ add_filter( 'user_registration_login_form_before_notice', array( $this, 'custom_resend_email_token_error_message' ) );
 
235
  }
 
236
  }
237
 
238
+ if ( ! isset( $_GET['ur_token'] ) ) {
239
  return;
240
  } else {
241
 
242
+ $output = str_split( $_GET['ur_token'], 50 );
243
+ $user_id = $this->crypt_the_string( $output[1], 'd' );
244
+ $user_id = absint( $user_id );
245
  $user_token = get_user_meta( $user_id, 'ur_confirm_email_token', true );
246
 
247
  // Check if the token matches the token value stored in db.
248
+ if ( $user_token === $_GET['ur_token'] ) {
249
  $user_reg_successful = true;
250
 
251
  update_user_meta( $user_id, 'ur_confirm_email', 1 );
252
+ delete_user_meta( $user_id, 'ur_confirm_email_token' );
253
 
254
+ add_filter( 'login_message', array( $this, 'custom_registration_message' ) );
255
+ add_filter( 'user_registration_login_form_before_notice', array( $this, 'custom_registration_message' ) );
256
  } else {
257
+ add_filter( 'login_message', array( $this, 'custom_registration_error_message' ) );
258
+ add_filter( 'user_registration_login_form_before_notice', array( $this, 'custom_registration_error_message' ) );
259
  }
260
  }
261
 
262
+ do_action( 'user_registration_check_token_complete', $user_id, $user_reg_successful );
 
263
  }
264
 
265
  /**
272
  */
273
  public function crypt_the_string( $string, $action = 'e' ) {
274
 
275
+ $secret_key = 'ur_secret_key';
276
+ $secret_iv = 'ur_secret_iv';
277
 
278
+ $output = false;
279
+ $encrypt_method = 'AES-256-CBC';
280
+ $key = hash( 'sha256', $secret_key );
281
+ $iv = substr( hash( 'sha256', $secret_iv ), 0, 16 );
282
 
283
+ if ( $action == 'e' ) {
284
+ $output = base64_encode( openssl_encrypt( $string, $encrypt_method, $key, 0, $iv ) );
285
+ } elseif ( $action == 'd' ) {
286
+ $output = openssl_decrypt( base64_decode( $string ), $encrypt_method, $key, 0, $iv );
287
+ }
 
288
 
289
+ return $output;
290
  }
291
 
292
  /**
293
  * Generate email token for the user.
294
+ *
295
+ * @param int $user_id User ID.
296
  * @return string Token.
297
  */
298
  public function get_token( $user_id ) {
299
 
300
+ $length = 50;
301
+ $token = '';
302
+ $codeAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
303
+ $codeAlphabet .= 'abcdefghijklmnopqrstuvwxyz';
304
+ $codeAlphabet .= '0123456789';
305
+ $max = strlen( $codeAlphabet );
306
 
307
+ for ( $i = 0; $i < $length; $i++ ) {
308
+ $token .= $codeAlphabet[ random_int( 0, $max - 1 ) ];
309
+ }
310
 
311
+ $token .= $this->crypt_the_string( $user_id, 'e' );
312
 
313
+ return $token;
314
 
315
+ do_action( 'user_registration_get_token' );
316
  }
317
 
318
  /**
319
  * Set the token of the user and update it to usermeta table in database.
320
+ *
321
+ * @param array $valid_form_data Form filled data.
322
+ * @param int $form_id Form ID.
323
+ * @param int $user_id User ID.
324
  */
325
  public function set_email_status( $valid_form_data, $form_id, $user_id ) {
326
 
327
+ if ( 'email_confirmation' === get_option( 'user_registration_general_setting_login_options' ) ) {
328
+ $token = $this->get_token( $user_id );
329
  update_user_meta( $user_id, 'ur_confirm_email', 0 );
330
  update_user_meta( $user_id, 'ur_confirm_email_token', $token );
331
  }
333
 
334
  /**
335
  * Check the email status during authentication
336
+ *
337
  * @param WP_User $user User instance
338
  * @return mixed
339
  */
340
  public function check_email_status( WP_User $user ) {
341
 
342
+ $email_status = get_user_meta( $user->ID, 'ur_confirm_email', true );
343
 
344
  do_action( 'ur_user_before_check_email_status_on_login', $email_status, $user );
345
 
346
+ $url = ( ! empty( $_SERVER['HTTPS'] ) ) ? 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] : 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
347
+ $url = substr( $url, 0, strpos( $url, '?' ) );
348
+ $url = wp_nonce_url( $url . '?ur_resend_id=' . $this->crypt_the_string( $user->ID, 'e' ) . '&ur_resend_token=true', 'ur_resend_token' );
349
+
350
+ if ( $email_status === '0' ) {
351
+ $message = '<strong>' . __( 'ERROR:', 'user-registration' ) . '</strong> ' . sprintf( __( 'Your account is still pending approval. Verify your email by clicking on the link sent to your email. %s', 'user-registration' ), '<a id="resend-email" href="' . esc_url( $url ) . '">' . __( 'Resend Verification Link', 'user-registration' ) . '</a>' );
352
 
353
  return new WP_Error( 'user_email_not_verified', $message );
354
  }
366
  */
367
  public function allow_password_reset( $result, $user_id ) {
368
 
369
+ $email_status = get_user_meta( $user_id, 'ur_confirm_email', true );
370
 
371
  if ( $email_status === '0' ) {
372
  $error_message = __( 'Email not verified! Verifiy your email by clicking on the link sent to your email.', 'user-registration' );
373
+ $result = new WP_Error( 'user_email_not_verified', $error_message );
374
  }
375
 
376
  return $result;
includes/class-ur-emailer.php CHANGED
@@ -26,17 +26,22 @@ class UR_Emailer {
26
  */
27
  public static function init() {
28
 
29
- if( 'yes' === get_option('user_registration_email_setting_disable_email' ) ) {
30
  return;
31
  }
32
 
33
  add_action( 'user_registration_email_send_before', array( __CLASS__, 'ur_send_email_before' ) );
34
  add_action( 'user_registration_email_send_after', array( __CLASS__, 'ur_send_email_after' ) );
35
 
36
- add_action( 'user_registration_after_register_user_action', array(
37
- __CLASS__,
38
- 'ur_after_register_mail'
39
- ), 10, 3 );
 
 
 
 
 
40
  }
41
 
42
  /**
@@ -49,6 +54,7 @@ class UR_Emailer {
49
 
50
  /**
51
  * Remove filters after the email is sent.
 
52
  * @since 1.4.6
53
  */
54
  public static function ur_send_email_after() {
@@ -59,6 +65,7 @@ class UR_Emailer {
59
 
60
  /**
61
  * Sender's Email address
 
62
  * @return string sender's email
63
  */
64
  public static function ur_sender_email() {
@@ -68,6 +75,7 @@ class UR_Emailer {
68
 
69
  /**
70
  * Sender's name.
 
71
  * @return string sender's name
72
  */
73
  public static function ur_sender_name() {
@@ -77,11 +85,12 @@ class UR_Emailer {
77
 
78
  /**
79
  * Emails Headers.
 
80
  * @return string email header
81
  */
82
  public static function ur_get_header() {
83
- $header = "From: ". self::ur_sender_name()." <".self::ur_sender_email().">\r\n";
84
- $header .= "Reply-To: ".self::ur_sender_email()."\r\n";
85
  $header .= "Content-Type: text/html; charset=UTF-8\r\n";
86
 
87
  return $header;
@@ -90,39 +99,39 @@ class UR_Emailer {
90
  /**
91
  * Email sending process after registration hook.
92
  *
93
- * @param array $valid_form_data Form filled data.
94
- * @param int $form_id Form ID.
95
- * @param int $user_id User ID.
96
  * @return void
97
  */
98
  public static function ur_after_register_mail( $valid_form_data, $form_id, $user_id ) {
99
 
100
- $attachments = apply_filters('user_registration_email_attachment', array(), $valid_form_data, $form_id, $user_id );
101
- $valid_form_data = isset( $valid_form_data ) ? $valid_form_data : array();
102
- $name_value = array();
103
- $data_html = '';
104
 
105
  // Generate $data_html string to replace for {{all_fields}} smart tag.
106
- foreach( $valid_form_data as $field_meta => $form_data ) {
107
- if( $field_meta === 'user_confirm_password' ) {
108
  continue;
109
  }
110
 
111
  // Donot include privacy policy value
112
- if( isset( $form_data->extra_params['field_key'] ) && $form_data->extra_params['field_key'] === 'privacy_policy') {
113
  continue;
114
  }
115
 
116
  // Process for file upload
117
- if( isset( $form_data->extra_params['field_key'] ) && $form_data->extra_params['field_key'] === 'file') {
118
- $form_data->value = isset( $form_data->value ) ? wp_get_attachment_url( $form_data->value ) : '';
119
  }
120
 
121
- $label = isset( $form_data->extra_params['label'] ) ? $form_data->extra_params['label'] : '';
122
  $field_name = isset( $form_data->field_name ) ? $form_data->field_name : '';
123
- $value = isset( $form_data->value ) ? $form_data->value : '';
124
 
125
- if( $field_meta === 'user_pass') {
126
  $value = __( 'Chosen Password', 'user-registration' );
127
  }
128
 
@@ -139,10 +148,10 @@ class UR_Emailer {
139
  // Smart tag process for extra fields.
140
  $name_value = apply_filters( 'user_registration_process_smart_tag', $name_value, $form_data, $form_id, $user_id );
141
 
142
- $email_object = isset( $valid_form_data['user_email'] ) ? $valid_form_data['user_email'] : array();
143
- $user_login_object = isset( $valid_form_data['user_login'] ) ? $valid_form_data['user_login'] : array();
144
- $email = isset( $email_object->value ) && ! empty( $email_object->value ) ? $email_object->value : '';
145
- $username = isset( $user_login_object->value ) && ! empty( $user_login_object->value ) ? $user_login_object->value : '';
146
 
147
  if ( ! empty( $email ) && ! empty( $user_id ) ) {
148
 
@@ -157,33 +166,39 @@ class UR_Emailer {
157
 
158
  /**
159
  * Trigger the user email.
 
160
  * @param string $user_email Email of the user.
161
  * @param string $username Username of the user.
162
- * @param int $user_id User id.
163
  * @param string $data_html String replaced with {{all_fields}} smart tag.
164
  * @param array $name_value Array to replace with extra fields smart tag.
165
  * @return void
166
  */
167
  public static function send_mail_to_user( $email, $username, $user_id, $data_html, $name_value, $attachments ) {
168
 
169
- $attachment = isset( $attachments['user'] ) ? $attachments['user'] : '';
170
- $status = ur_get_user_approval_status( $user_id );
171
- $email_status = get_user_meta( $user_id, 'ur_confirm_email', true );
172
- $email_token = get_user_meta( $user_id, 'ur_confirm_email_token', true );
173
 
174
- $to_replace = array( "{{username}}", "{{email}}", "{{blog_info}}", "{{home_url}}", "{{email_token}}", "{{all_fields}}" );
175
- $replace_with = array( $username, $email, get_bloginfo(), get_home_url(), $email_token, $data_html );
176
 
177
  // Add the field name and values from $name_value to the replacement arrays.
178
- $to_replace = array_merge( $to_replace, array_keys( $name_value ) );
179
- $replace_with = array_merge( $replace_with, array_values( $name_value ) );
180
 
181
  // Surround every key with {{ and }}.
182
- array_walk( $to_replace, function( &$value, $key ) { $value = '{{'.trim( $value, '{}').'}}'; } );
 
 
 
 
 
183
 
184
- if( $email_status === '0' ) {
185
 
186
- $subject = get_option('user_registration_email_confirmation_subject', __('Please confirm your registration on {{blog_info}}', 'user-registration') );
187
  $message = new UR_Settings_Email_Confirmation();
188
  $message = $message->ur_get_email_confirmation();
189
  $message = get_option( 'user_registration_email_confirmation', $message );
@@ -191,54 +206,50 @@ class UR_Emailer {
191
  $subject = str_replace( $to_replace, $replace_with, $subject );
192
 
193
  wp_mail( $email, $subject, $message, self::ur_get_header(), $attachment );
194
- }
195
-
196
- else if ( $status == 0 ) {
197
 
198
- $subject = get_option( 'user_registration_awaiting_admin_approval_email_subject', __('Thank you for registration on {{blog_info}}', 'user-registration') );
199
  $message = new UR_Settings_Awaiting_Admin_Approval_Email();
200
  $message = $message->ur_get_awaiting_admin_approval_email();
201
  $message = get_option( 'user_registration_awaiting_admin_approval_email', $message );
202
  $message = str_replace( $to_replace, $replace_with, $message );
203
  $subject = str_replace( $to_replace, $replace_with, $subject );
204
 
205
- if ( 'yes' == get_option( 'user_registration_enable_awaiting_admin_approval_email', 'yes' ) ){
206
  wp_mail( $email, $subject, $message, self::ur_get_header(), $attachment );
207
  }
 
208
 
209
-
210
- } else if ( $status == - 1 ) {
211
-
212
- $subject = get_option( 'user_registration_registration_denied_email_subject', __('Sorry! Registration denied on {{blog_info}}', 'user-registration') );
213
  $message = new UR_Settings_Registration_Denied_Email();
214
  $message = $message->ur_get_registration_denied_email();
215
  $message = get_option( 'user_registration_registration_denied_email', $message );
216
  $message = str_replace( $to_replace, $replace_with, $message );
217
  $subject = str_replace( $to_replace, $replace_with, $subject );
218
 
219
- if ( 'yes' == get_option( 'user_registration_enable_registration_denied_email', 'yes' ) ){
220
  wp_mail( $email, $subject, $message, self::ur_get_header(), $attachment );
221
  }
222
-
223
- } else if( 'default' === get_option( 'user_registration_general_setting_login_options' ) || 'auto_login' === get_option( 'user_registration_general_setting_login_options' ) ) {
224
- $subject = get_option( 'user_registration_successfully_registered_email_subject',__('Congratulations! Registration Complete on {{blog_info}}', 'user-registration') );
225
  $message = new UR_Settings_Successfully_Registered_Email();
226
  $message = $message->ur_get_successfully_registered_email();
227
  $message = get_option( 'user_registration_successfully_registered_email', $message );
228
  $message = str_replace( $to_replace, $replace_with, $message );
229
  $subject = str_replace( $to_replace, $replace_with, $subject );
230
 
231
- if ( 'yes' == get_option( 'user_registration_enable_successfully_registered_email', 'yes' ) ){
232
- wp_mail( $email, $subject, $message, self::ur_get_header(), $attachment );
233
  }
234
  }
235
  }
236
 
237
  /**
238
  * Trigger the admin email.
 
239
  * @param string $user_email Email of the user.
240
  * @param string $username Username of the user.
241
- * @param int $user_id User id.
242
  * @param string $data_html String replaced with {{all_fields}} smart tag.
243
  * @param array $name_value Array to replace with extra fields smart tag.
244
  * @param array $attachments Email Attachement
@@ -246,35 +257,40 @@ class UR_Emailer {
246
  */
247
  public static function send_mail_to_admin( $user_email, $username, $user_id, $data_html, $name_value, $attachments ) {
248
 
249
- $header = "Reply-To: {{email}} \r\n";
250
- $header .= "Content-Type: text/html; charset=UTF-8";
251
 
252
  $attachment = isset( $attachments['admin'] ) ? $attachments['admin'] : '';
253
  $admin_email = get_option( 'user_registration_admin_email_receipents', get_option( 'admin_email' ) );
254
  $admin_email = explode( ',', $admin_email );
255
  $admin_email = array_map( 'trim', $admin_email );
256
 
257
- $subject = get_option( 'user_registration_admin_email_subject', __('A New User Registered', 'user-registration') );
258
  $message = new UR_Settings_Admin_Email();
259
  $message = $message->ur_get_admin_email();
260
  $message = get_option( 'user_registration_admin_email', $message );
261
 
262
- $to_replace = array("{{username}}", "{{email}}", "{{blog_info}}", "{{home_url}}", "{{all_fields}}");
263
- $replace_with = array( $username, $user_email, get_bloginfo(), get_home_url(), $data_html );
264
 
265
  // Add the field name and values from $name_value to the replacement arrays.
266
- $to_replace = array_merge( $to_replace, array_keys( $name_value ) );
267
- $replace_with = array_merge( $replace_with, array_values( $name_value ) );
268
 
269
  // Surround every key with {{ and }}.
270
- array_walk( $to_replace, function( &$value, $key ) { $value = '{{'.trim( $value, '{}').'}}'; } );
 
 
 
 
 
271
 
272
  $message = str_replace( $to_replace, $replace_with, $message );
273
  $subject = str_replace( $to_replace, $replace_with, $subject );
274
  $header = str_replace( $to_replace, $replace_with, $header );
275
 
276
- if ( 'yes' == get_option(' user_registration_enable_admin_email ', 'yes') ) {
277
- foreach($admin_email as $email ) {
278
  wp_mail( $email, $subject, $message, $header, $attachment );
279
  }
280
  }
@@ -282,6 +298,7 @@ class UR_Emailer {
282
 
283
  /**
284
  * Trigger status change email while admin changes users status on admin approval.
 
285
  * @param string $email Email address of the user.
286
  * @param string $username Username of the user.
287
  * @param bool $status Stautus of the user.
@@ -290,9 +307,9 @@ class UR_Emailer {
290
  public static function status_change_email( $email, $username, $status ) {
291
 
292
  // Get name value pair to replace smart tag.
293
- $name_value = self::status_change_emails_smart_tags( $email );
294
 
295
- $to_replace = array( "{{username}}", "{{email}}", "{{blog_info}}", "{{home_url}}" );
296
  $replace_with = array( $username, $email, get_bloginfo(), get_home_url() );
297
 
298
  // Add the field name and values from $name_value to the replacement arrays.
@@ -300,46 +317,49 @@ class UR_Emailer {
300
  $replace_with = array_merge( $replace_with, array_values( $name_value ) );
301
 
302
  // Surround every key with {{ and }}.
303
- array_walk( $to_replace, function( &$value, $key ) { $value = '{{'.trim( $value, '{}').'}}'; } );
 
 
 
 
 
304
 
305
  $headers = array( 'Content-Type: text/html; charset=UTF-8' );
306
 
307
  if ( $status == 0 ) {
308
 
309
- $subject = get_option( 'user_registration_registration_pending_email_subject', __('Sorry! Registration changed to pending on {{blog_info}}', 'user-registration') );
310
  $message = new UR_Settings_Registration_Pending_Email();
311
  $message = $message->ur_get_registration_pending_email();
312
  $message = get_option( 'user_registration_registration_pending_email', $message );
313
  $message = str_replace( $to_replace, $replace_with, $message );
314
  $subject = str_replace( $to_replace, $replace_with, $subject );
315
 
316
- if ( 'yes' == get_option( 'user_registration_enable_registration_pending_email', 'yes' ) ){
317
- wp_mail( $email, $subject, $message, self::ur_get_header() );
318
  }
 
319
 
320
- } else if ( $status == - 1 ) {
321
-
322
- $subject = get_option( 'user_registration_registration_denied_email_subject', __('Sorry! Registration denied on {{blog_info}}', 'user-registration') );
323
  $message = new UR_Settings_Registration_Denied_Email();
324
  $message = $message->ur_get_registration_denied_email();
325
  $message = get_option( 'user_registration_registration_denied_email', $message );
326
  $message = str_replace( $to_replace, $replace_with, $message );
327
  $subject = str_replace( $to_replace, $replace_with, $subject );
328
 
329
- if ( 'yes' == get_option( 'user_registration_enable_registration_denied_email', 'yes' ) ){
330
  wp_mail( $email, $subject, $message, self::ur_get_header() );
331
  }
332
-
333
  } else {
334
 
335
- $subject = get_option( 'user_registration_registration_approved_email_subject', __('Congratulations! Registration approved on {{blog_info}}', 'user-registration') );
336
  $message = new UR_Settings_Registration_Approved_Email();
337
  $message = $message->ur_get_registration_approved_email();
338
  $message = get_option( 'user_registration_registration_approved_email', $message );
339
  $message = str_replace( $to_replace, $replace_with, $message );
340
  $subject = str_replace( $to_replace, $replace_with, $subject );
341
 
342
- if ( 'yes' == get_option( 'user_registration_enable_registration_approved_email', 'yes' ) ){
343
  wp_mail( $email, $subject, $message, self::ur_get_header() );
344
  }
345
  }
@@ -347,31 +367,32 @@ class UR_Emailer {
347
 
348
  /**
349
  * Lost Password Email Trigger
 
350
  * @param string $user_login username
351
- * @param obj $user_data user object
352
  * @param string $key password reset key
353
  * @return bool
354
  */
355
  public static function lost_password_email( $user_login, $user_data, $key ) {
356
 
357
- $user = get_user_by( 'login', $user_login );
358
- $email = isset( $user->data->user_email ) ? $user->data->user_email : '';
359
- $username = isset( $user->data->user_login ) ? $user->data->user_login : '';
360
 
361
- if( empty( $email ) || empty( $username ) ) {
362
  return false;
363
  }
364
 
365
  // Get name value pair to replace smart tag.
366
- $name_value = self::status_change_emails_smart_tags( $email );
367
 
368
- $headers = array('Content-Type: text/html; charset=UTF-8');
369
- $subject = get_option( 'user_registration_reset_password_email_subject', __('Password Reset Email: {{blog_info}}', 'user-registration') );
370
  $message = new UR_Settings_Reset_Password_Email();
371
  $message = $message->ur_get_reset_password_email();
372
  $message = get_option( 'user_registration_reset_password_email', $message );
373
 
374
- $to_replace = array( "{{username}}", "{{key}}", "{{blog_info}}", "{{home_url}}" );
375
  $replace_with = array( $username, $key, get_bloginfo(), get_home_url() );
376
 
377
  // Add the field name and values from $name_value to the replacement arrays.
@@ -379,7 +400,12 @@ class UR_Emailer {
379
  $replace_with = array_merge( $replace_with, array_values( $name_value ) );
380
 
381
  // Surround every key with {{ and }}.
382
- array_walk( $to_replace, function( &$value, $key ) { $value = '{{'.trim( $value, '{}').'}}'; } );
 
 
 
 
 
383
 
384
  $message = str_replace( $to_replace, $replace_with, $message );
385
  $subject = str_replace( $to_replace, $replace_with, $subject );
@@ -400,20 +426,20 @@ class UR_Emailer {
400
  * @return array smart tag key value pair.
401
  */
402
  public static function status_change_emails_smart_tags( $email ) {
403
- $name_value = array();
404
- $user = get_user_by( 'email', $email );
405
- $user_id = isset( $user->ID ) ? absint( $user->ID ) : 0;
406
 
407
  $user_fields = ur_get_user_table_fields();
408
 
409
- foreach( $user_fields as $field ) {
410
  $name_value[ $field ] = isset( $user->data->$field ) ? $user->data->$field : '';
411
  }
412
 
413
  $user_meta_fields = ur_get_registered_user_meta_fields();
414
 
415
  // Use name_value for smart tag to replace
416
- foreach( $user_meta_fields as $field ) {
417
  $name_value[ $field ] = get_user_meta( $user_id, $field, true );
418
  }
419
 
26
  */
27
  public static function init() {
28
 
29
+ if ( 'yes' === get_option( 'user_registration_email_setting_disable_email' ) ) {
30
  return;
31
  }
32
 
33
  add_action( 'user_registration_email_send_before', array( __CLASS__, 'ur_send_email_before' ) );
34
  add_action( 'user_registration_email_send_after', array( __CLASS__, 'ur_send_email_after' ) );
35
 
36
+ add_action(
37
+ 'user_registration_after_register_user_action',
38
+ array(
39
+ __CLASS__,
40
+ 'ur_after_register_mail',
41
+ ),
42
+ 10,
43
+ 3
44
+ );
45
  }
46
 
47
  /**
54
 
55
  /**
56
  * Remove filters after the email is sent.
57
+ *
58
  * @since 1.4.6
59
  */
60
  public static function ur_send_email_after() {
65
 
66
  /**
67
  * Sender's Email address
68
+ *
69
  * @return string sender's email
70
  */
71
  public static function ur_sender_email() {
75
 
76
  /**
77
  * Sender's name.
78
+ *
79
  * @return string sender's name
80
  */
81
  public static function ur_sender_name() {
85
 
86
  /**
87
  * Emails Headers.
88
+ *
89
  * @return string email header
90
  */
91
  public static function ur_get_header() {
92
+ $header = 'From: ' . self::ur_sender_name() . ' <' . self::ur_sender_email() . ">\r\n";
93
+ $header .= 'Reply-To: ' . self::ur_sender_email() . "\r\n";
94
  $header .= "Content-Type: text/html; charset=UTF-8\r\n";
95
 
96
  return $header;
99
  /**
100
  * Email sending process after registration hook.
101
  *
102
+ * @param array $valid_form_data Form filled data.
103
+ * @param int $form_id Form ID.
104
+ * @param int $user_id User ID.
105
  * @return void
106
  */
107
  public static function ur_after_register_mail( $valid_form_data, $form_id, $user_id ) {
108
 
109
+ $attachments = apply_filters( 'user_registration_email_attachment', array(), $valid_form_data, $form_id, $user_id );
110
+ $valid_form_data = isset( $valid_form_data ) ? $valid_form_data : array();
111
+ $name_value = array();
112
+ $data_html = '';
113
 
114
  // Generate $data_html string to replace for {{all_fields}} smart tag.
115
+ foreach ( $valid_form_data as $field_meta => $form_data ) {
116
+ if ( $field_meta === 'user_confirm_password' ) {
117
  continue;
118
  }
119
 
120
  // Donot include privacy policy value
121
+ if ( isset( $form_data->extra_params['field_key'] ) && $form_data->extra_params['field_key'] === 'privacy_policy' ) {
122
  continue;
123
  }
124
 
125
  // Process for file upload
126
+ if ( isset( $form_data->extra_params['field_key'] ) && $form_data->extra_params['field_key'] === 'file' ) {
127
+ $form_data->value = isset( $form_data->value ) ? wp_get_attachment_url( $form_data->value ) : '';
128
  }
129
 
130
+ $label = isset( $form_data->extra_params['label'] ) ? $form_data->extra_params['label'] : '';
131
  $field_name = isset( $form_data->field_name ) ? $form_data->field_name : '';
132
+ $value = isset( $form_data->value ) ? $form_data->value : '';
133
 
134
+ if ( $field_meta === 'user_pass' ) {
135
  $value = __( 'Chosen Password', 'user-registration' );
136
  }
137
 
148
  // Smart tag process for extra fields.
149
  $name_value = apply_filters( 'user_registration_process_smart_tag', $name_value, $form_data, $form_id, $user_id );
150
 
151
+ $email_object = isset( $valid_form_data['user_email'] ) ? $valid_form_data['user_email'] : array();
152
+ $user_login_object = isset( $valid_form_data['user_login'] ) ? $valid_form_data['user_login'] : array();
153
+ $email = isset( $email_object->value ) && ! empty( $email_object->value ) ? $email_object->value : '';
154
+ $username = isset( $user_login_object->value ) && ! empty( $user_login_object->value ) ? $user_login_object->value : '';
155
 
156
  if ( ! empty( $email ) && ! empty( $user_id ) ) {
157
 
166
 
167
  /**
168
  * Trigger the user email.
169
+ *
170
  * @param string $user_email Email of the user.
171
  * @param string $username Username of the user.
172
+ * @param int $user_id User id.
173
  * @param string $data_html String replaced with {{all_fields}} smart tag.
174
  * @param array $name_value Array to replace with extra fields smart tag.
175
  * @return void
176
  */
177
  public static function send_mail_to_user( $email, $username, $user_id, $data_html, $name_value, $attachments ) {
178
 
179
+ $attachment = isset( $attachments['user'] ) ? $attachments['user'] : '';
180
+ $status = ur_get_user_approval_status( $user_id );
181
+ $email_status = get_user_meta( $user_id, 'ur_confirm_email', true );
182
+ $email_token = get_user_meta( $user_id, 'ur_confirm_email_token', true );
183
 
184
+ $to_replace = array( '{{username}}', '{{email}}', '{{blog_info}}', '{{home_url}}', '{{email_token}}', '{{all_fields}}' );
185
+ $replace_with = array( $username, $email, get_bloginfo(), get_home_url(), $email_token, $data_html );
186
 
187
  // Add the field name and values from $name_value to the replacement arrays.
188
+ $to_replace = array_merge( $to_replace, array_keys( $name_value ) );
189
+ $replace_with = array_merge( $replace_with, array_values( $name_value ) );
190
 
191
  // Surround every key with {{ and }}.
192
+ array_walk(
193
+ $to_replace,
194
+ function( &$value, $key ) {
195
+ $value = '{{' . trim( $value, '{}' ) . '}}';
196
+ }
197
+ );
198
 
199
+ if ( $email_status === '0' ) {
200
 
201
+ $subject = get_option( 'user_registration_email_confirmation_subject', __( 'Please confirm your registration on {{blog_info}}', 'user-registration' ) );
202
  $message = new UR_Settings_Email_Confirmation();
203
  $message = $message->ur_get_email_confirmation();
204
  $message = get_option( 'user_registration_email_confirmation', $message );
206
  $subject = str_replace( $to_replace, $replace_with, $subject );
207
 
208
  wp_mail( $email, $subject, $message, self::ur_get_header(), $attachment );
209
+ } elseif ( $status == 0 ) {
 
 
210
 
211
+ $subject = get_option( 'user_registration_awaiting_admin_approval_email_subject', __( 'Thank you for registration on {{blog_info}}', 'user-registration' ) );
212
  $message = new UR_Settings_Awaiting_Admin_Approval_Email();
213
  $message = $message->ur_get_awaiting_admin_approval_email();
214
  $message = get_option( 'user_registration_awaiting_admin_approval_email', $message );
215
  $message = str_replace( $to_replace, $replace_with, $message );
216
  $subject = str_replace( $to_replace, $replace_with, $subject );
217
 
218
+ if ( 'yes' == get_option( 'user_registration_enable_awaiting_admin_approval_email', 'yes' ) ) {
219
  wp_mail( $email, $subject, $message, self::ur_get_header(), $attachment );
220
  }
221
+ } elseif ( $status == - 1 ) {
222
 
223
+ $subject = get_option( 'user_registration_registration_denied_email_subject', __( 'Sorry! Registration denied on {{blog_info}}', 'user-registration' ) );
 
 
 
224
  $message = new UR_Settings_Registration_Denied_Email();
225
  $message = $message->ur_get_registration_denied_email();
226
  $message = get_option( 'user_registration_registration_denied_email', $message );
227
  $message = str_replace( $to_replace, $replace_with, $message );
228
  $subject = str_replace( $to_replace, $replace_with, $subject );
229
 
230
+ if ( 'yes' == get_option( 'user_registration_enable_registration_denied_email', 'yes' ) ) {
231
  wp_mail( $email, $subject, $message, self::ur_get_header(), $attachment );
232
  }
233
+ } elseif ( 'default' === get_option( 'user_registration_general_setting_login_options' ) || 'auto_login' === get_option( 'user_registration_general_setting_login_options' ) ) {
234
+ $subject = get_option( 'user_registration_successfully_registered_email_subject', __( 'Congratulations! Registration Complete on {{blog_info}}', 'user-registration' ) );
 
235
  $message = new UR_Settings_Successfully_Registered_Email();
236
  $message = $message->ur_get_successfully_registered_email();
237
  $message = get_option( 'user_registration_successfully_registered_email', $message );
238
  $message = str_replace( $to_replace, $replace_with, $message );
239
  $subject = str_replace( $to_replace, $replace_with, $subject );
240
 
241
+ if ( 'yes' == get_option( 'user_registration_enable_successfully_registered_email', 'yes' ) ) {
242
+ wp_mail( $email, $subject, $message, self::ur_get_header(), $attachment );
243
  }
244
  }
245
  }
246
 
247
  /**
248
  * Trigger the admin email.
249
+ *
250
  * @param string $user_email Email of the user.
251
  * @param string $username Username of the user.
252
+ * @param int $user_id User id.
253
  * @param string $data_html String replaced with {{all_fields}} smart tag.
254
  * @param array $name_value Array to replace with extra fields smart tag.
255
  * @param array $attachments Email Attachement
257
  */
258
  public static function send_mail_to_admin( $user_email, $username, $user_id, $data_html, $name_value, $attachments ) {
259
 
260
+ $header = "Reply-To: {{email}} \r\n";
261
+ $header .= 'Content-Type: text/html; charset=UTF-8';
262
 
263
  $attachment = isset( $attachments['admin'] ) ? $attachments['admin'] : '';
264
  $admin_email = get_option( 'user_registration_admin_email_receipents', get_option( 'admin_email' ) );
265
  $admin_email = explode( ',', $admin_email );
266
  $admin_email = array_map( 'trim', $admin_email );
267
 
268
+ $subject = get_option( 'user_registration_admin_email_subject', __( 'A New User Registered', 'user-registration' ) );
269
  $message = new UR_Settings_Admin_Email();
270
  $message = $message->ur_get_admin_email();
271
  $message = get_option( 'user_registration_admin_email', $message );
272
 
273
+ $to_replace = array( '{{username}}', '{{email}}', '{{blog_info}}', '{{home_url}}', '{{all_fields}}' );
274
+ $replace_with = array( $username, $user_email, get_bloginfo(), get_home_url(), $data_html );
275
 
276
  // Add the field name and values from $name_value to the replacement arrays.
277
+ $to_replace = array_merge( $to_replace, array_keys( $name_value ) );
278
+ $replace_with = array_merge( $replace_with, array_values( $name_value ) );
279
 
280
  // Surround every key with {{ and }}.
281
+ array_walk(
282
+ $to_replace,
283
+ function( &$value, $key ) {
284
+ $value = '{{' . trim( $value, '{}' ) . '}}';
285
+ }
286
+ );
287
 
288
  $message = str_replace( $to_replace, $replace_with, $message );
289
  $subject = str_replace( $to_replace, $replace_with, $subject );
290
  $header = str_replace( $to_replace, $replace_with, $header );
291
 
292
+ if ( 'yes' == get_option( ' user_registration_enable_admin_email ', 'yes' ) ) {
293
+ foreach ( $admin_email as $email ) {
294
  wp_mail( $email, $subject, $message, $header, $attachment );
295
  }
296
  }
298
 
299
  /**
300
  * Trigger status change email while admin changes users status on admin approval.
301
+ *
302
  * @param string $email Email address of the user.
303
  * @param string $username Username of the user.
304
  * @param bool $status Stautus of the user.
307
  public static function status_change_email( $email, $username, $status ) {
308
 
309
  // Get name value pair to replace smart tag.
310
+ $name_value = self::status_change_emails_smart_tags( $email );
311
 
312
+ $to_replace = array( '{{username}}', '{{email}}', '{{blog_info}}', '{{home_url}}' );
313
  $replace_with = array( $username, $email, get_bloginfo(), get_home_url() );
314
 
315
  // Add the field name and values from $name_value to the replacement arrays.
317
  $replace_with = array_merge( $replace_with, array_values( $name_value ) );
318
 
319
  // Surround every key with {{ and }}.
320
+ array_walk(
321
+ $to_replace,
322
+ function( &$value, $key ) {
323
+ $value = '{{' . trim( $value, '{}' ) . '}}';
324
+ }
325
+ );
326
 
327
  $headers = array( 'Content-Type: text/html; charset=UTF-8' );
328
 
329
  if ( $status == 0 ) {
330
 
331
+ $subject = get_option( 'user_registration_registration_pending_email_subject', __( 'Sorry! Registration changed to pending on {{blog_info}}', 'user-registration' ) );
332
  $message = new UR_Settings_Registration_Pending_Email();
333
  $message = $message->ur_get_registration_pending_email();
334
  $message = get_option( 'user_registration_registration_pending_email', $message );
335
  $message = str_replace( $to_replace, $replace_with, $message );
336
  $subject = str_replace( $to_replace, $replace_with, $subject );
337
 
338
+ if ( 'yes' == get_option( 'user_registration_enable_registration_pending_email', 'yes' ) ) {
339
+ wp_mail( $email, $subject, $message, self::ur_get_header() );
340
  }
341
+ } elseif ( $status == - 1 ) {
342
 
343
+ $subject = get_option( 'user_registration_registration_denied_email_subject', __( 'Sorry! Registration denied on {{blog_info}}', 'user-registration' ) );
 
 
344
  $message = new UR_Settings_Registration_Denied_Email();
345
  $message = $message->ur_get_registration_denied_email();
346
  $message = get_option( 'user_registration_registration_denied_email', $message );
347
  $message = str_replace( $to_replace, $replace_with, $message );
348
  $subject = str_replace( $to_replace, $replace_with, $subject );
349
 
350
+ if ( 'yes' == get_option( 'user_registration_enable_registration_denied_email', 'yes' ) ) {
351
  wp_mail( $email, $subject, $message, self::ur_get_header() );
352
  }
 
353
  } else {
354
 
355
+ $subject = get_option( 'user_registration_registration_approved_email_subject', __( 'Congratulations! Registration approved on {{blog_info}}', 'user-registration' ) );
356
  $message = new UR_Settings_Registration_Approved_Email();
357
  $message = $message->ur_get_registration_approved_email();
358
  $message = get_option( 'user_registration_registration_approved_email', $message );
359
  $message = str_replace( $to_replace, $replace_with, $message );
360
  $subject = str_replace( $to_replace, $replace_with, $subject );
361
 
362
+ if ( 'yes' == get_option( 'user_registration_enable_registration_approved_email', 'yes' ) ) {
363
  wp_mail( $email, $subject, $message, self::ur_get_header() );
364
  }
365
  }
367
 
368
  /**
369
  * Lost Password Email Trigger
370
+ *
371
  * @param string $user_login username
372
+ * @param obj $user_data user object
373
  * @param string $key password reset key
374
  * @return bool
375
  */
376
  public static function lost_password_email( $user_login, $user_data, $key ) {
377
 
378
+ $user = get_user_by( 'login', $user_login );
379
+ $email = isset( $user->data->user_email ) ? $user->data->user_email : '';
380
+ $username = isset( $user->data->user_login ) ? $user->data->user_login : '';
381
 
382
+ if ( empty( $email ) || empty( $username ) ) {
383
  return false;
384
  }
385
 
386
  // Get name value pair to replace smart tag.
387
+ $name_value = self::status_change_emails_smart_tags( $email );
388
 
389
+ $headers = array( 'Content-Type: text/html; charset=UTF-8' );
390
+ $subject = get_option( 'user_registration_reset_password_email_subject', __( 'Password Reset Email: {{blog_info}}', 'user-registration' ) );
391
  $message = new UR_Settings_Reset_Password_Email();
392
  $message = $message->ur_get_reset_password_email();
393
  $message = get_option( 'user_registration_reset_password_email', $message );
394
 
395
+ $to_replace = array( '{{username}}', '{{key}}', '{{blog_info}}', '{{home_url}}' );
396
  $replace_with = array( $username, $key, get_bloginfo(), get_home_url() );
397
 
398
  // Add the field name and values from $name_value to the replacement arrays.
400
  $replace_with = array_merge( $replace_with, array_values( $name_value ) );
401
 
402
  // Surround every key with {{ and }}.
403
+ array_walk(
404
+ $to_replace,
405
+ function( &$value, $key ) {
406
+ $value = '{{' . trim( $value, '{}' ) . '}}';
407
+ }
408
+ );
409
 
410
  $message = str_replace( $to_replace, $replace_with, $message );
411
  $subject = str_replace( $to_replace, $replace_with, $subject );
426
  * @return array smart tag key value pair.
427
  */
428
  public static function status_change_emails_smart_tags( $email ) {
429
+ $name_value = array();
430
+ $user = get_user_by( 'email', $email );
431
+ $user_id = isset( $user->ID ) ? absint( $user->ID ) : 0;
432
 
433
  $user_fields = ur_get_user_table_fields();
434
 
435
+ foreach ( $user_fields as $field ) {
436
  $name_value[ $field ] = isset( $user->data->$field ) ? $user->data->$field : '';
437
  }
438
 
439
  $user_meta_fields = ur_get_registered_user_meta_fields();
440
 
441
  // Use name_value for smart tag to replace
442
+ foreach ( $user_meta_fields as $field ) {
443
  $name_value[ $field ] = get_user_meta( $user_id, $field, true );
444
  }
445
 
includes/class-ur-form-block.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  /**
4
  * Form Selector Gutenberg block with live preview.
 
5
  * @since 1.5.1
6
  */
7
  class UR_Form_Block {
@@ -11,7 +12,7 @@ class UR_Form_Block {
11
  */
12
  public function __construct() {
13
 
14
- if( ! function_exists( 'register_block_type' ) ) {
15
  return;
16
  }
17
 
@@ -21,6 +22,7 @@ class UR_Form_Block {
21
 
22
  /**
23
  * Enqueue Block Editor Assets.
 
24
  * @return void.
25
  */
26
  public function enqueue_block_editor_assets() {
@@ -33,10 +35,10 @@ class UR_Form_Block {
33
  );
34
 
35
  wp_register_script(
36
- 'user-registration-block-editor',
37
- UR()->plugin_url() . '/assets/js/admin/gutenberg/form-block.build.js',
38
- array( 'wp-blocks', 'wp-element', 'wp-i18n', 'wp-editor', 'wp-components' ),
39
- UR_VERSION
40
  );
41
 
42
  $form_block_data = array(
@@ -48,7 +50,7 @@ class UR_Form_Block {
48
  'form_select' => esc_html__( 'Select a Form', 'user-registration' ),
49
  'form_settings' => esc_html__( 'Form Settings', 'user-registration' ),
50
  'form_selected' => esc_html__( 'Form', 'user-registration' ),
51
- )
52
  );
53
 
54
  wp_localize_script( 'user-registration-block-editor', 'ur_form_block_data', $form_block_data );
@@ -63,16 +65,19 @@ class UR_Form_Block {
63
  */
64
  public function register_block() {
65
 
66
- register_block_type( 'user-registration/form-selector', array(
67
- 'attributes' => array(
68
- 'formId' => array(
69
- 'type' => 'string',
 
 
 
70
  ),
71
- ),
72
- 'editor_script' => 'user-registration-block-editor',
73
- 'editor_style' => 'user-registration-block-editor',
74
- 'render_callback' => array( $this, 'render_callback' ),
75
- ) );
76
  }
77
 
78
  /**
@@ -85,30 +90,41 @@ class UR_Form_Block {
85
 
86
  $form_id = ! empty( $attr['formId'] ) ? absint( $attr['formId'] ) : 0;
87
 
88
- if ( empty( $form_id ) ) {
89
  return '';
90
  }
91
 
92
  $is_gb_editor = defined( 'REST_REQUEST' ) && REST_REQUEST && ! empty( $_REQUEST['context'] ) && 'edit' === $_REQUEST['context'];
93
 
94
- if( $is_gb_editor ) {
95
- add_filter( 'user_registration_form_custom_class', function( $class ) {
96
- return $class .' ur-gutenberg-editor';
97
- });
98
-
99
- add_action( 'user_registration_before_registration_form', function() {
100
- echo '<fieldset disabled>';
101
- });
102
-
103
- add_action( 'user_registration_form_registration', function() {
104
- echo '</fieldset>';
105
- });
 
 
 
 
 
 
 
 
 
106
  }
107
 
108
- return UR_Shortcodes::form( array(
109
- 'id' => $form_id,
110
- ) );
 
 
111
  }
112
  }
113
 
114
- new UR_Form_Block;
2
 
3
  /**
4
  * Form Selector Gutenberg block with live preview.
5
+ *
6
  * @since 1.5.1
7
  */
8
  class UR_Form_Block {
12
  */
13
  public function __construct() {
14
 
15
+ if ( ! function_exists( 'register_block_type' ) ) {
16
  return;
17
  }
18
 
22
 
23
  /**
24
  * Enqueue Block Editor Assets.
25
+ *
26
  * @return void.
27
  */
28
  public function enqueue_block_editor_assets() {
35
  );
36
 
37
  wp_register_script(
38
+ 'user-registration-block-editor',
39
+ UR()->plugin_url() . '/assets/js/admin/gutenberg/form-block.build.js',
40
+ array( 'wp-blocks', 'wp-element', 'wp-i18n', 'wp-editor', 'wp-components' ),
41
+ UR_VERSION
42
  );
43
 
44
  $form_block_data = array(
50
  'form_select' => esc_html__( 'Select a Form', 'user-registration' ),
51
  'form_settings' => esc_html__( 'Form Settings', 'user-registration' ),
52
  'form_selected' => esc_html__( 'Form', 'user-registration' ),
53
+ ),
54
  );
55
 
56
  wp_localize_script( 'user-registration-block-editor', 'ur_form_block_data', $form_block_data );
65
  */
66
  public function register_block() {
67
 
68
+ register_block_type(
69
+ 'user-registration/form-selector',
70
+ array(
71
+ 'attributes' => array(
72
+ 'formId' => array(
73
+ 'type' => 'string',
74
+ ),
75
  ),
76
+ 'editor_script' => 'user-registration-block-editor',
77
+ 'editor_style' => 'user-registration-block-editor',
78
+ 'render_callback' => array( $this, 'render_callback' ),
79
+ )
80
+ );
81
  }
82
 
83
  /**
90
 
91
  $form_id = ! empty( $attr['formId'] ) ? absint( $attr['formId'] ) : 0;
92
 
93
+ if ( empty( $form_id ) ) {
94
  return '';
95
  }
96
 
97
  $is_gb_editor = defined( 'REST_REQUEST' ) && REST_REQUEST && ! empty( $_REQUEST['context'] ) && 'edit' === $_REQUEST['context'];
98
 
99
+ if ( $is_gb_editor ) {
100
+ add_filter(
101
+ 'user_registration_form_custom_class',
102
+ function( $class ) {
103
+ return $class . ' ur-gutenberg-editor';
104
+ }
105
+ );
106
+
107
+ add_action(
108
+ 'user_registration_before_registration_form',
109
+ function() {
110
+ echo '<fieldset disabled>';
111
+ }
112
+ );
113
+
114
+ add_action(
115
+ 'user_registration_form_registration',
116
+ function() {
117
+ echo '</fieldset>';
118
+ }
119
+ );
120
  }
121
 
122
+ return UR_Shortcodes::form(
123
+ array(
124
+ 'id' => $form_id,
125
+ )
126
+ );
127
  }
128
  }
129
 
130
+ new UR_Form_Block();
includes/class-ur-form-handler.php CHANGED
@@ -42,6 +42,7 @@ class UR_Form_Handler {
42
 
43
  /**
44
  * Save and update a profie fields if the form was submitted through the user account page.
 
45
  * @return mixed
46
  */
47
  public static function save_profile_details() {
@@ -61,7 +62,7 @@ class UR_Form_Handler {
61
  }
62
 
63
  $form_id_array = get_user_meta( $user_id, 'ur_form_id' );
64
- $form_id = 0;
65
 
66
  if ( isset( $form_id_array[0] ) ) {
67
  $form_id = $form_id_array[0];
@@ -75,15 +76,14 @@ class UR_Form_Handler {
75
  }
76
  // Get Value.
77
  switch ( $field['type'] ) {
78
- case 'checkbox' :
79
- if( isset( $_POST[$key] ) && is_array( $_POST[$key] ) ) {
80
- $_POST[$key] = $_POST[$key];
81
- }
82
- else {
83
  $_POST[ $key ] = (int) isset( $_POST[ $key ] );
84
  }
85
  break;
86
- default :
87
  $_POST[ $key ] = isset( $_POST[ $key ] ) ? ur_clean( $_POST[ $key ] ) : '';
88
  break;
89
  }
@@ -102,7 +102,7 @@ class UR_Form_Handler {
102
  if ( ! empty( $field['validate'] ) && is_array( $field['validate'] ) ) {
103
  foreach ( $field['validate'] as $rule ) {
104
  switch ( $rule ) {
105
- case 'email' :
106
  $_POST[ $key ] = strtolower( $_POST[ $key ] );
107
 
108
  if ( ! is_email( $_POST[ $key ] ) ) {
@@ -130,7 +130,6 @@ class UR_Form_Handler {
130
  } else {
131
  $user_data[ $new_key ] = $_POST[ $key ];
132
  }
133
-
134
  } else {
135
  $update_key = $key;
136
 
@@ -139,19 +138,17 @@ class UR_Form_Handler {
139
  }
140
  $disabled = isset( $field['custom_attributes']['disabled'] ) ? $field['custom_attributes']['disabled'] : '';
141
 
142
- if( $disabled !== 'disabled' ){
143
  update_user_meta( $user_id, $update_key, $_POST[ $key ] );
144
  }
145
  }
146
  }
147
 
148
  if ( count( $user_data ) > 0 ) {
149
-
150
- $user_data["ID"] = get_current_user_id();
151
-
152
  wp_update_user( $user_data );
153
-
154
  }
 
155
  ur_add_notice( __( 'User profile updated successfully.', 'user-registration' ) );
156
 
157
  do_action( 'user_registration_save_profile_details', $user_id );
@@ -161,7 +158,6 @@ class UR_Form_Handler {
161
  }
162
  }
163
 
164
-
165
  /**
166
  * @deprecated 1.4.1
167
  * @param $user_id
@@ -193,10 +189,10 @@ class UR_Form_Handler {
193
  return;
194
  }
195
 
196
- $pass_cur = ! empty( $_POST['password_current'] ) ? $_POST['password_current'] : '';
197
- $pass1 = ! empty( $_POST['password_1'] ) ? $_POST['password_1'] : '';
198
- $pass2 = ! empty( $_POST['password_2'] ) ? $_POST['password_2'] : '';
199
- $save_pass = true;
200
 
201
  if ( ( ! empty( $pass_cur ) || empty( $pass_cur ) ) && empty( $pass1 ) && empty( $pass2 ) ) {
202
  ur_add_notice( __( 'Please fill out all password fields.', 'user-registration' ), 'error' );
@@ -246,13 +242,13 @@ class UR_Form_Handler {
246
  */
247
  public static function process_login() {
248
 
249
- $nonce_value = isset( $_POST['_wpnonce'] ) ? $_POST['_wpnonce'] : '';
250
- $nonce_value = isset( $_POST['user-registration-login-nonce'] ) ? $_POST['user-registration-login-nonce'] : $nonce_value;
251
  $recaptcha_value = isset( $_POST['g-recaptcha-response'] ) ? $_POST['g-recaptcha-response'] : '';
252
 
253
  $recaptcha_enabled = get_option( 'user_registration_login_options_enable_recaptcha', 'no' );
254
  $recaptcha_version = get_option( 'user_registration_integration_setting_recaptcha_version' );
255
- $secret_key = 'v3' === $recaptcha_version ? get_option( 'user_registration_integration_setting_recaptcha_site_secret_v3' ) : get_option( 'user_registration_integration_setting_recaptcha_site_secret' );
256
 
257
  if ( ! empty( $_POST['login'] ) && wp_verify_nonce( $nonce_value, 'user-registration-login' ) ) {
258
 
@@ -266,14 +262,14 @@ class UR_Form_Handler {
266
  $validation_error = new WP_Error();
267
  $validation_error = apply_filters( 'user_registration_process_login_errors', $validation_error, $_POST['username'], $_POST['password'] );
268
 
269
- if( 'yes' === $recaptcha_enabled ) {
270
  if ( ! empty( $recaptcha_value ) ) {
271
 
272
- $data = wp_remote_get( 'https://www.google.com/recaptcha/api/siteverify?secret=' . $secret_key . '&response=' . $recaptcha_value );
273
- $data = json_decode( wp_remote_retrieve_body( $data ) );
274
 
275
  if ( empty( $data->success ) || ( isset( $data->score ) && $data->score < apply_filters( 'user_registration_recaptcha_v3_threshold', 0.5 ) ) ) {
276
- throw new Exception( '<strong>' . __( 'ERROR:', 'user-registration' ) . '</strong>' . __( 'Error on google reCaptcha. Contact your site administrator.', 'user-registration' ) );
277
  }
278
  } else {
279
  throw new Exception( '<strong>' . __( 'ERROR:', 'user-registration' ) . '</strong>' . get_option( 'user_registration_form_submission_error_message_recaptcha', __( 'Captcha code error, please try again.', 'user-registration' ) ) );
@@ -326,11 +322,10 @@ class UR_Form_Handler {
326
  $redirect = get_home_url();
327
  }
328
 
329
- wp_redirect( wp_validate_redirect( apply_filters( 'user_registration_login_redirect', $redirect, $user ), $redirect ) );
330
  exit;
331
  }
332
- }
333
- catch ( Exception $e ) {
334
  ur_add_notice( apply_filters( 'login_errors', $e->getMessage() ), 'error' );
335
  do_action( 'user_registration_login_failed' );
336
  }
@@ -346,11 +341,19 @@ class UR_Form_Handler {
346
 
347
  // If successful, redirect to my account with query arg set
348
  if ( $success ) {
349
- wp_redirect( add_query_arg( 'reset-link-sent', 'true', remove_query_arg( array(
350
- 'key',
351
- 'login',
352
- 'reset'
353
- ) ) ) );
 
 
 
 
 
 
 
 
354
  exit;
355
  }
356
  }
@@ -366,7 +369,7 @@ class UR_Form_Handler {
366
  'password_2',
367
  'reset_key',
368
  'reset_login',
369
- '_wpnonce'
370
  );
371
 
372
  foreach ( $posted_fields as $field ) {
42
 
43
  /**
44
  * Save and update a profie fields if the form was submitted through the user account page.
45
+ *
46
  * @return mixed
47
  */
48
  public static function save_profile_details() {
62
  }
63
 
64
  $form_id_array = get_user_meta( $user_id, 'ur_form_id' );
65
+ $form_id = 0;
66
 
67
  if ( isset( $form_id_array[0] ) ) {
68
  $form_id = $form_id_array[0];
76
  }
77
  // Get Value.
78
  switch ( $field['type'] ) {
79
+ case 'checkbox':
80
+ if ( isset( $_POST[ $key ] ) && is_array( $_POST[ $key ] ) ) {
81
+ $_POST[ $key ] = $_POST[ $key ];
82
+ } else {
 
83
  $_POST[ $key ] = (int) isset( $_POST[ $key ] );
84
  }
85
  break;
86
+ default:
87
  $_POST[ $key ] = isset( $_POST[ $key ] ) ? ur_clean( $_POST[ $key ] ) : '';
88
  break;
89
  }
102
  if ( ! empty( $field['validate'] ) && is_array( $field['validate'] ) ) {
103
  foreach ( $field['validate'] as $rule ) {
104
  switch ( $rule ) {
105
+ case 'email':
106
  $_POST[ $key ] = strtolower( $_POST[ $key ] );
107
 
108
  if ( ! is_email( $_POST[ $key ] ) ) {
130
  } else {
131
  $user_data[ $new_key ] = $_POST[ $key ];
132
  }
 
133
  } else {
134
  $update_key = $key;
135
 
138
  }
139
  $disabled = isset( $field['custom_attributes']['disabled'] ) ? $field['custom_attributes']['disabled'] : '';
140
 
141
+ if ( $disabled !== 'disabled' ) {
142
  update_user_meta( $user_id, $update_key, $_POST[ $key ] );
143
  }
144
  }
145
  }
146
 
147
  if ( count( $user_data ) > 0 ) {
148
+ $user_data['ID'] = get_current_user_id();
 
 
149
  wp_update_user( $user_data );
 
150
  }
151
+
152
  ur_add_notice( __( 'User profile updated successfully.', 'user-registration' ) );
153
 
154
  do_action( 'user_registration_save_profile_details', $user_id );
158
  }
159
  }
160
 
 
161
  /**
162
  * @deprecated 1.4.1
163
  * @param $user_id
189
  return;
190
  }
191
 
192
+ $pass_cur = ! empty( $_POST['password_current'] ) ? $_POST['password_current'] : '';
193
+ $pass1 = ! empty( $_POST['password_1'] ) ? $_POST['password_1'] : '';
194
+ $pass2 = ! empty( $_POST['password_2'] ) ? $_POST['password_2'] : '';
195
+ $save_pass = true;
196
 
197
  if ( ( ! empty( $pass_cur ) || empty( $pass_cur ) ) && empty( $pass1 ) && empty( $pass2 ) ) {
198
  ur_add_notice( __( 'Please fill out all password fields.', 'user-registration' ), 'error' );
242
  */
243
  public static function process_login() {
244
 
245
+ $nonce_value = isset( $_POST['_wpnonce'] ) ? $_POST['_wpnonce'] : '';
246
+ $nonce_value = isset( $_POST['user-registration-login-nonce'] ) ? $_POST['user-registration-login-nonce'] : $nonce_value;
247
  $recaptcha_value = isset( $_POST['g-recaptcha-response'] ) ? $_POST['g-recaptcha-response'] : '';
248
 
249
  $recaptcha_enabled = get_option( 'user_registration_login_options_enable_recaptcha', 'no' );
250
  $recaptcha_version = get_option( 'user_registration_integration_setting_recaptcha_version' );
251
+ $secret_key = 'v3' === $recaptcha_version ? get_option( 'user_registration_integration_setting_recaptcha_site_secret_v3' ) : get_option( 'user_registration_integration_setting_recaptcha_site_secret' );
252
 
253
  if ( ! empty( $_POST['login'] ) && wp_verify_nonce( $nonce_value, 'user-registration-login' ) ) {
254
 
262
  $validation_error = new WP_Error();
263
  $validation_error = apply_filters( 'user_registration_process_login_errors', $validation_error, $_POST['username'], $_POST['password'] );
264
 
265
+ if ( 'yes' === $recaptcha_enabled ) {
266
  if ( ! empty( $recaptcha_value ) ) {
267
 
268
+ $data = wp_remote_get( 'https://www.google.com/recaptcha/api/siteverify?secret=' . $secret_key . '&response=' . $recaptcha_value );
269
+ $data = json_decode( wp_remote_retrieve_body( $data ) );
270
 
271
  if ( empty( $data->success ) || ( isset( $data->score ) && $data->score < apply_filters( 'user_registration_recaptcha_v3_threshold', 0.5 ) ) ) {
272
+ throw new Exception( '<strong>' . __( 'ERROR:', 'user-registration' ) . '</strong>' . __( 'Error on google reCaptcha. Contact your site administrator.', 'user-registration' ) );
273
  }
274
  } else {
275
  throw new Exception( '<strong>' . __( 'ERROR:', 'user-registration' ) . '</strong>' . get_option( 'user_registration_form_submission_error_message_recaptcha', __( 'Captcha code error, please try again.', 'user-registration' ) ) );
322
  $redirect = get_home_url();
323
  }
324
 
325
+ wp_redirect( wp_validate_redirect( apply_filters( 'user_registration_login_redirect', $redirect, $user ), $redirect ) );
326
  exit;
327
  }
328
+ } catch ( Exception $e ) {
 
329
  ur_add_notice( apply_filters( 'login_errors', $e->getMessage() ), 'error' );
330
  do_action( 'user_registration_login_failed' );
331
  }
341
 
342
  // If successful, redirect to my account with query arg set
343
  if ( $success ) {
344
+ wp_redirect(
345
+ add_query_arg(
346
+ 'reset-link-sent',
347
+ 'true',
348
+ remove_query_arg(
349
+ array(
350
+ 'key',
351
+ 'login',
352
+ 'reset',
353
+ )
354
+ )
355
+ )
356
+ );
357
  exit;
358
  }
359
  }
369
  'password_2',
370
  'reset_key',
371
  'reset_login',
372
+ '_wpnonce',
373
  );
374
 
375
  foreach ( $posted_fields as $field ) {
includes/class-ur-frontend-scripts.php CHANGED
@@ -55,28 +55,31 @@ class UR_Frontend_Scripts {
55
  * @return array
56
  */
57
  public static function get_styles() {
58
- return apply_filters( 'user_registration_enqueue_styles', array(
59
- 'user-registration-general' => array(
60
- 'src' => self::get_asset_url( 'assets/css/user-registration.css' ),
61
- 'deps' => '',
62
- 'version' => UR_VERSION,
63
- 'media' => 'all',
64
- 'has_rtl' => true,
65
- ),
66
- 'user-registration-smallscreen' => array(
67
- 'src' => self::get_asset_url( 'assets/css/user-registration-smallscreen.css' ),
68
- 'deps' => '',
69
- 'version' => UR_VERSION,
70
- 'media' => 'only screen and (max-width: ' . apply_filters( 'user_registration_style_smallscreen_breakpoint', $breakpoint = '768px' ) . ')',
71
- 'has_rtl' => true,
72
- ),
73
- 'user-registration-my-account-layout' => array(
74
- 'src' => self::get_asset_url( 'assets/css/my-account-layout.css' ),
75
- 'deps' => '',
76
- 'version' => UR_VERSION,
77
- 'media' => 'all',
 
 
 
78
  )
79
- ) );
80
  }
81
 
82
  /**
@@ -172,27 +175,27 @@ class UR_Frontend_Scripts {
172
  * Register all UR scripts.
173
  */
174
  private static function register_scripts() {
175
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
176
- $recaptcha_site_key_v3 = get_option( 'user_registration_integration_setting_recaptcha_site_key_v3' );
177
- $register_scripts = array(
178
- 'ur-inputmask' => array(
179
  'src' => self::get_asset_url( 'assets/js/inputmask/jquery.inputmask.bundle' . $suffix . '.js' ),
180
  'deps' => array( 'jquery' ),
181
  'version' => '4.0.0-beta.58',
182
  ),
183
- 'flatpickr' => array(
184
  'src' => self::get_asset_url( 'assets/js/flatpickr/flatpickr.min.js' ),
185
  'deps' => array( 'jquery' ),
186
  'version' => '1.17.0',
187
  ),
188
- 'ur-jquery-validate' => array(
189
  'src' => self::get_asset_url( 'assets/js/frontend/jquery.validate' . $suffix . '.js' ),
190
  'deps' => array( 'jquery' ),
191
  'version' => '1.15.1',
192
  ),
193
  'user-registration' => array(
194
  'src' => self::get_asset_url( 'assets/js/frontend/user-registration' . $suffix . '.js' ),
195
- 'deps' => array( 'jquery','ur-jquery-validate', 'ur-inputmask' ),
196
  'version' => UR_VERSION,
197
  ),
198
  'ur-lost-password' => array(
@@ -210,8 +213,8 @@ class UR_Frontend_Scripts {
210
  'deps' => array(),
211
  'version' => '2.0.0',
212
  ),
213
- 'ur-google-recaptcha-v3' => array(
214
- 'src' => 'https://www.google.com/recaptcha/api.js?render='.$recaptcha_site_key_v3,
215
  'deps' => array(),
216
  'version' => '3.0.0',
217
  ),
@@ -226,21 +229,21 @@ class UR_Frontend_Scripts {
226
  */
227
  private static function register_styles() {
228
  $register_styles = array(
229
- 'jquery-ui-css' => array(
230
  'src' => self::get_asset_url( 'assets/css/jquery-ui/jquery-ui.css' ),
231
  'deps' => '',
232
  'version' => '1.12.1',
233
  'media' => 'all',
234
  'has_rtl' => false,
235
  ),
236
- 'flatpickr' => array(
237
  'src' => self::get_asset_url( 'assets/css/flatpickr/flatpickr.min.css' ),
238
  'deps' => array(),
239
  'version' => '4.5.1',
240
- 'media' => 'all',
241
  'has_rtl' => false,
242
  ),
243
- 'select2' => array(
244
  'src' => self::get_asset_url( 'assets/css/select2.css' ),
245
  'deps' => array(),
246
  'version' => UR_VERSION,
@@ -311,32 +314,32 @@ class UR_Frontend_Scripts {
311
  private static function get_script_data( $handle ) {
312
 
313
  switch ( $handle ) {
314
- case 'user-registration' :
315
  return array(
316
  'ajax_url' => admin_url( 'admin-ajax.php' ),
317
  'user_registration_form_data_save' => wp_create_nonce( 'user_registration_form_data_save_nonce' ),
318
  'form_required_fields' => ur_get_required_fields(),
319
  'redirect_url' => get_option( 'user_registration_general_setting_redirect_options' ),
320
- 'login_option' => get_option( 'user_registration_general_setting_login_options' ),
321
  'message_required_fields' => get_option( 'user_registration_form_submission_error_message_required_fields', __( 'This field is required.', 'user-registration' ) ),
322
  'message_email_fields' => get_option( 'user_registration_form_submission_error_message_email', __( 'Please enter a valid email address.', 'user-registration' ) ),
323
- 'message_url_fields' => get_option( 'user_registration_form_submission_error_message_website_URL', __( 'Please enter a valid URL.', 'user-registration') ),
324
- 'message_number_fields' => get_option( 'user_registration_form_submission_error_message_number', __( 'Please enter a valid number.','user-registration' ) ),
325
  'message_confirm_password_fields' => get_option( 'user_registration_form_submission_error_message_confirm_password', __( 'Password and confirm password not matched.', 'user-registration' ) ),
326
  'ursL10n' => array(
327
- 'user_successfully_saved' => get_option( 'user_registration_successful_form_submission_message_manual_registation', __( 'User successfully registered.', 'user-registration' ) ),
328
- 'user_under_approval' => get_option( 'user_registration_successful_form_submission_message_admin_approval', __( 'User registered. Wait until admin approves your registration.', 'user-registration' ) ),
329
- 'user_email_pending' => get_option('user_registration_successful_form_submission_message_email_confirmation', __( 'User registered. Verify your email by clicking on the link sent to your email.', 'user-registration' ) ),
330
- 'captcha_error' => get_option( 'user_registration_form_submission_error_message_recaptcha', __( 'Captcha code error, please try again.', 'user-registration' ) ),
331
  ),
332
  );
333
  break;
334
 
335
- case 'ur-password-strength-meter' :
336
  return array(
337
- 'home_url' => home_url(),
338
- 'i18n_password_error' => esc_attr__( 'Please enter a stronger password.', 'user-registration' ),
339
- 'pwsL10n' => array(
340
  'shortpw' => __( 'Very Weak', 'user-registration' ),
341
  'bad' => __( 'Weak', 'user-registration' ),
342
  'good' => __( 'Medium', 'user-registration' ),
@@ -344,7 +347,7 @@ class UR_Frontend_Scripts {
344
  'mismatch' => __( 'Password with confirm password not matched.', 'user-registration' ),
345
 
346
  ),
347
- 'i18n_password_hint' => apply_filters( 'user_registration_strong_password_message' , __( 'Hint: To make password stronger, use upper and lower case letters, numbers, and symbols like ! " ? $ % ^ & ).', 'user-registration' ) ),
348
  );
349
  break;
350
  }
55
  * @return array
56
  */
57
  public static function get_styles() {
58
+ return apply_filters(
59
+ 'user_registration_enqueue_styles',
60
+ array(
61
+ 'user-registration-general' => array(
62
+ 'src' => self::get_asset_url( 'assets/css/user-registration.css' ),
63
+ 'deps' => '',
64
+ 'version' => UR_VERSION,
65
+ 'media' => 'all',
66
+ 'has_rtl' => true,
67
+ ),
68
+ 'user-registration-smallscreen' => array(
69
+ 'src' => self::get_asset_url( 'assets/css/user-registration-smallscreen.css' ),
70
+ 'deps' => '',
71
+ 'version' => UR_VERSION,
72
+ 'media' => 'only screen and (max-width: ' . apply_filters( 'user_registration_style_smallscreen_breakpoint', $breakpoint = '768px' ) . ')',
73
+ 'has_rtl' => true,
74
+ ),
75
+ 'user-registration-my-account-layout' => array(
76
+ 'src' => self::get_asset_url( 'assets/css/my-account-layout.css' ),
77
+ 'deps' => '',
78
+ 'version' => UR_VERSION,
79
+ 'media' => 'all',
80
+ ),
81
  )
82
+ );
83
  }
84
 
85
  /**
175
  * Register all UR scripts.
176
  */
177
  private static function register_scripts() {
178
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
179
+ $recaptcha_site_key_v3 = get_option( 'user_registration_integration_setting_recaptcha_site_key_v3' );
180
+ $register_scripts = array(
181
+ 'ur-inputmask' => array(
182
  'src' => self::get_asset_url( 'assets/js/inputmask/jquery.inputmask.bundle' . $suffix . '.js' ),
183
  'deps' => array( 'jquery' ),
184
  'version' => '4.0.0-beta.58',
185
  ),
186
+ 'flatpickr' => array(
187
  'src' => self::get_asset_url( 'assets/js/flatpickr/flatpickr.min.js' ),
188
  'deps' => array( 'jquery' ),
189
  'version' => '1.17.0',
190
  ),
191
+ 'ur-jquery-validate' => array(
192
  'src' => self::get_asset_url( 'assets/js/frontend/jquery.validate' . $suffix . '.js' ),
193
  'deps' => array( 'jquery' ),
194
  'version' => '1.15.1',
195
  ),
196
  'user-registration' => array(
197
  'src' => self::get_asset_url( 'assets/js/frontend/user-registration' . $suffix . '.js' ),
198
+ 'deps' => array( 'jquery', 'ur-jquery-validate', 'ur-inputmask' ),
199
  'version' => UR_VERSION,
200
  ),
201
  'ur-lost-password' => array(
213
  'deps' => array(),
214
  'version' => '2.0.0',
215
  ),
216
+ 'ur-google-recaptcha-v3' => array(
217
+ 'src' => 'https://www.google.com/recaptcha/api.js?render=' . $recaptcha_site_key_v3,
218
  'deps' => array(),
219
  'version' => '3.0.0',
220
  ),
229
  */
230
  private static function register_styles() {
231
  $register_styles = array(
232
+ 'jquery-ui-css' => array(
233
  'src' => self::get_asset_url( 'assets/css/jquery-ui/jquery-ui.css' ),
234
  'deps' => '',
235
  'version' => '1.12.1',
236
  'media' => 'all',
237
  'has_rtl' => false,
238
  ),
239
+ 'flatpickr' => array(
240
  'src' => self::get_asset_url( 'assets/css/flatpickr/flatpickr.min.css' ),
241
  'deps' => array(),
242
  'version' => '4.5.1',
243
+ 'media' => 'all',
244
  'has_rtl' => false,
245
  ),
246
+ 'select2' => array(
247
  'src' => self::get_asset_url( 'assets/css/select2.css' ),
248
  'deps' => array(),
249
  'version' => UR_VERSION,
314
  private static function get_script_data( $handle ) {
315
 
316
  switch ( $handle ) {
317
+ case 'user-registration':
318
  return array(
319
  'ajax_url' => admin_url( 'admin-ajax.php' ),
320
  'user_registration_form_data_save' => wp_create_nonce( 'user_registration_form_data_save_nonce' ),
321
  'form_required_fields' => ur_get_required_fields(),
322
  'redirect_url' => get_option( 'user_registration_general_setting_redirect_options' ),
323
+ 'login_option' => get_option( 'user_registration_general_setting_login_options' ),
324
  'message_required_fields' => get_option( 'user_registration_form_submission_error_message_required_fields', __( 'This field is required.', 'user-registration' ) ),
325
  'message_email_fields' => get_option( 'user_registration_form_submission_error_message_email', __( 'Please enter a valid email address.', 'user-registration' ) ),
326
+ 'message_url_fields' => get_option( 'user_registration_form_submission_error_message_website_URL', __( 'Please enter a valid URL.', 'user-registration' ) ),
327
+ 'message_number_fields' => get_option( 'user_registration_form_submission_error_message_number', __( 'Please enter a valid number.', 'user-registration' ) ),
328
  'message_confirm_password_fields' => get_option( 'user_registration_form_submission_error_message_confirm_password', __( 'Password and confirm password not matched.', 'user-registration' ) ),
329
  'ursL10n' => array(
330
+ 'user_successfully_saved' => get_option( 'user_registration_successful_form_submission_message_manual_registation', __( 'User successfully registered.', 'user-registration' ) ),
331
+ 'user_under_approval' => get_option( 'user_registration_successful_form_submission_message_admin_approval', __( 'User registered. Wait until admin approves your registration.', 'user-registration' ) ),
332
+ 'user_email_pending' => get_option( 'user_registration_successful_form_submission_message_email_confirmation', __( 'User registered. Verify your email by clicking on the link sent to your email.', 'user-registration' ) ),
333
+ 'captcha_error' => get_option( 'user_registration_form_submission_error_message_recaptcha', __( 'Captcha code error, please try again.', 'user-registration' ) ),
334
  ),
335
  );
336
  break;
337
 
338
+ case 'ur-password-strength-meter':
339
  return array(
340
+ 'home_url' => home_url(),
341
+ 'i18n_password_error' => esc_attr__( 'Please enter a stronger password.', 'user-registration' ),
342
+ 'pwsL10n' => array(
343
  'shortpw' => __( 'Very Weak', 'user-registration' ),
344
  'bad' => __( 'Weak', 'user-registration' ),
345
  'good' => __( 'Medium', 'user-registration' ),
347
  'mismatch' => __( 'Password with confirm password not matched.', 'user-registration' ),
348
 
349
  ),
350
+ 'i18n_password_hint' => apply_filters( 'user_registration_strong_password_message', __( 'Hint: To make password stronger, use upper and lower case letters, numbers, and symbols like ! " ? $ % ^ & ).', 'user-registration' ) ),
351
  );
352
  break;
353
  }
includes/class-ur-install.php CHANGED
@@ -37,7 +37,7 @@ class UR_Install {
37
  '1.4.2' => array(
38
  'ur_update_142_db_version',
39
  'ur_update_142_option',
40
- )
41
  );
42
 
43
  /**
@@ -222,12 +222,12 @@ class UR_Install {
222
  * @return array
223
  */
224
  public static function get_db_update_callbacks() {
225
- $updates = self::$db_updates;
226
  $current_db_version = get_option( 'user_registration_db_version' );
227
 
228
- $db_needs_update = array( '1.2.2','1.2.3','1.2.4' );
229
 
230
- if( in_array( $current_db_version, $db_needs_update ) ) {
231
  $updates['1.2.5'] = array(
232
  'ur_update_125_usermeta',
233
  'ur_update_125_db_version',
@@ -274,7 +274,8 @@ class UR_Install {
274
  include_once dirname( __FILE__ ) . '/admin/functions-ur-admin.php';
275
 
276
  $pages = apply_filters(
277
- 'user_registration_create_pages', array(
 
278
  'myaccount' => array(
279
  'name' => _x( 'my-account', 'Page slug', 'user-registration' ),
280
  'title' => _x( 'My Account', 'Page title', 'user-registration' ),
@@ -303,7 +304,7 @@ class UR_Install {
303
  */
304
  private static function create_options() {
305
  // Include settings so that we can run through defaults.
306
- include_once( dirname( __FILE__ ) . '/admin/class-ur-admin-settings.php' );
307
 
308
  $settings = UR_Admin_Settings::get_settings_pages();
309
 
@@ -334,14 +335,16 @@ class UR_Install {
334
  $post_content = '[[[{"field_key":"user_login","general_setting":{"label":"Username","field_name":"user_login","placeholder":"","required":"yes"},"advance_setting":{}},{"field_key":"user_pass","general_setting":{"label":"User Password","field_name":"user_pass","placeholder":"","required":"yes"},"advance_setting":{}}],[{"field_key":"user_email","general_setting":{"label":"User Email","field_name":"user_email","placeholder":"","required":"yes"},"advance_setting":{}},{"field_key":"user_confirm_password","general_setting":{"label":"Confirm Password","field_name":"user_confirm_password","placeholder":"","required":"yes"},"advance_setting":{}}]]]';
335
 
336
  // Insert default form :)
337
- $default_post_id = wp_insert_post( array(
338
- 'post_type' => 'user_registration',
339
- 'post_title' => __( 'Default form', 'user-registration' ),
340
- 'post_content' => $post_content,
341
- 'post_status' => 'publish',
342
- 'comment_status' => 'closed',
343
- 'ping_status' => 'closed',
344
- ) );
 
 
345
 
346
  update_option( 'user_registration_default_form_page_id', $default_post_id );
347
  }
@@ -366,7 +369,7 @@ class UR_Install {
366
  $collate = $wpdb->get_charset_collate();
367
  }
368
 
369
- require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
370
 
371
  $sql = "
372
  CREATE TABLE {$wpdb->prefix}user_registration_sessions (
@@ -453,7 +456,7 @@ CREATE TABLE {$wpdb->prefix}user_registration_sessions (
453
  $capabilities = array();
454
 
455
  $capabilities['core'] = array(
456
- 'manage_user_registration'
457
  );
458
 
459
  $capability_types = array( 'user_registration' );
37
  '1.4.2' => array(
38
  'ur_update_142_db_version',
39
  'ur_update_142_option',
40
+ ),
41
  );
42
 
43
  /**
222
  * @return array
223
  */
224
  public static function get_db_update_callbacks() {
225
+ $updates = self::$db_updates;
226
  $current_db_version = get_option( 'user_registration_db_version' );
227
 
228
+ $db_needs_update = array( '1.2.2', '1.2.3', '1.2.4' );
229
 
230
+ if ( in_array( $current_db_version, $db_needs_update ) ) {
231
  $updates['1.2.5'] = array(
232
  'ur_update_125_usermeta',
233
  'ur_update_125_db_version',
274
  include_once dirname( __FILE__ ) . '/admin/functions-ur-admin.php';
275
 
276
  $pages = apply_filters(
277
+ 'user_registration_create_pages',
278
+ array(
279
  'myaccount' => array(
280
  'name' => _x( 'my-account', 'Page slug', 'user-registration' ),
281
  'title' => _x( 'My Account', 'Page title', 'user-registration' ),
304
  */
305
  private static function create_options() {
306
  // Include settings so that we can run through defaults.
307
+ include_once dirname( __FILE__ ) . '/admin/class-ur-admin-settings.php';
308
 
309
  $settings = UR_Admin_Settings::get_settings_pages();
310
 
335
  $post_content = '[[[{"field_key":"user_login","general_setting":{"label":"Username","field_name":"user_login","placeholder":"","required":"yes"},"advance_setting":{}},{"field_key":"user_pass","general_setting":{"label":"User Password","field_name":"user_pass","placeholder":"","required":"yes"},"advance_setting":{}}],[{"field_key":"user_email","general_setting":{"label":"User Email","field_name":"user_email","placeholder":"","required":"yes"},"advance_setting":{}},{"field_key":"user_confirm_password","general_setting":{"label":"Confirm Password","field_name":"user_confirm_password","placeholder":"","required":"yes"},"advance_setting":{}}]]]';
336
 
337
  // Insert default form :)
338
+ $default_post_id = wp_insert_post(
339
+ array(
340
+ 'post_type' => 'user_registration',
341
+ 'post_title' => __( 'Default form', 'user-registration' ),
342
+ 'post_content' => $post_content,
343
+ 'post_status' => 'publish',
344
+ 'comment_status' => 'closed',
345
+ 'ping_status' => 'closed',
346
+ )
347
+ );
348
 
349
  update_option( 'user_registration_default_form_page_id', $default_post_id );
350
  }
369
  $collate = $wpdb->get_charset_collate();
370
  }
371
 
372
+ require_once ABSPATH . 'wp-admin/includes/upgrade.php';
373
 
374
  $sql = "
375
  CREATE TABLE {$wpdb->prefix}user_registration_sessions (
456
  $capabilities = array();
457
 
458
  $capabilities['core'] = array(
459
+ 'manage_user_registration',
460
  );
461
 
462
  $capability_types = array( 'user_registration' );
includes/class-ur-log-levels.php CHANGED
@@ -31,13 +31,13 @@ abstract class UR_Log_Levels {
31
  * @see @link {https://tools.ietf.org/html/rfc5424}
32
  */
33
  const EMERGENCY = 'emergency';
34
- const ALERT = 'alert';
35
- const CRITICAL = 'critical';
36
- const ERROR = 'error';
37
- const WARNING = 'warning';
38
- const NOTICE = 'notice';
39
- const INFO = 'info';
40
- const DEBUG = 'debug';
41
 
42
  /**
43
  * Level strings mapped to integer severity.
31
  * @see @link {https://tools.ietf.org/html/rfc5424}
32
  */
33
  const EMERGENCY = 'emergency';
34
+ const ALERT = 'alert';
35
+ const CRITICAL = 'critical';
36
+ const ERROR = 'error';
37
+ const WARNING = 'warning';
38
+ const NOTICE = 'notice';
39
+ const INFO = 'info';
40
+ const DEBUG = 'debug';
41
 
42
  /**
43
  * Level strings mapped to integer severity.
includes/class-ur-logger.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) {
3
  exit; // Exit if accessed directly
4
  }
@@ -104,7 +105,14 @@ class UR_Logger implements UR_Logger_Interface {
104
  */
105
  public function add( $handle, $message, $level = UR_Log_Levels::NOTICE ) {
106
  $message = apply_filters( 'user_registration_logger_add_message', $message, $handle );
107
- $this->log( $level, $message, array( 'source' => $handle, '_legacy' => true ) );
 
 
 
 
 
 
 
108
 
109
  return true;
110
  }
1
  <?php
2
+
3
  if ( ! defined( 'ABSPATH' ) ) {
4
  exit; // Exit if accessed directly
5
  }
105
  */
106
  public function add( $handle, $message, $level = UR_Log_Levels::NOTICE ) {
107
  $message = apply_filters( 'user_registration_logger_add_message', $message, $handle );
108
+ $this->log(
109
+ $level,
110
+ $message,
111
+ array(
112
+ 'source' => $handle,
113
+ '_legacy' => true,
114
+ )
115
+ );
116
 
117
  return true;
118
  }
includes/class-ur-plugin-updater.php CHANGED
@@ -13,11 +13,11 @@ if ( ! defined( 'ABSPATH' ) ) {
13
  }
14
 
15
  if ( ! class_exists( 'UR_AddOn_Updater', false ) ) {
16
- include_once( dirname( __FILE__ ) . '/admin/updater/class-ur-addon-updater.php' );
17
  }
18
 
19
  if ( ! class_exists( 'UR_Plugin_Updates', false ) ) {
20
- include_once( dirname( __FILE__ ) . '/admin/updater/class-ur-plugin-updates.php' );
21
  }
22
 
23
  /**
@@ -27,30 +27,35 @@ class UR_Plugin_Updater extends UR_Plugin_Updates {
27
 
28
  /**
29
  * Plugin File.
 
30
  * @var string
31
  */
32
  private $plugin_file = '';
33
 
34
  /**
35
  * Plugin Name.
 
36
  * @var string
37
  */
38
  private $plugin_name = '';
39
 
40
  /**
41
  * Plugin Slug.
 
42
  * @var string
43
  */
44
  private $plugin_slug = '';
45
 
46
  /**
47
  * Plugins data.
 
48
  * @var array of strings
49
  */
50
  private $plugin_data = array();
51
 
52
  /**
53
  * Validation errors.
 
54
  * @var array of strings
55
  */
56
  private $errors = array();
@@ -77,7 +82,7 @@ class UR_Plugin_Updater extends UR_Plugin_Updates {
77
  add_action( 'admin_init', array( $this, 'admin_init' ) );
78
 
79
  // Include required files.
80
- include_once( dirname( __FILE__ ) . '/admin/updater/class-ur-plugin-updater-api.php' );
81
  }
82
 
83
  /**
@@ -200,7 +205,7 @@ class UR_Plugin_Updater extends UR_Plugin_Updates {
200
  public function error_notices() {
201
  if ( ! empty( $this->errors ) ) {
202
  foreach ( $this->errors as $key => $error ) {
203
- include( dirname( __FILE__ ) . '/admin/views/html-notice-error.php' );
204
  if ( $key !== 'invalid_key' && did_action( 'all_admin_notices' ) ) {
205
  unset( $this->errors[ $key ] );
206
  }
@@ -227,12 +232,13 @@ class UR_Plugin_Updater extends UR_Plugin_Updates {
227
  */
228
  public function plugin_license_form( $plugin_file ) {
229
  if ( strtolower( basename( dirname( $plugin_file ) ) ) === strtolower( $this->plugin_slug ) ) {
230
- include_once( dirname( __FILE__ ) . '/admin/views/html-license-form.php' );
231
  }
232
  }
233
 
234
  /**
235
  * Display action links in the Plugins list table.
 
236
  * @param array $actions
237
  * @return array
238
  */
@@ -254,9 +260,13 @@ class UR_Plugin_Updater extends UR_Plugin_Updates {
254
  throw new Exception( 'Please enter your license key' );
255
  }
256
 
257
- $activate_results = json_decode( UR_Updater_Key_API::activate( array(
258
- 'license' => $license_key,
259
- ) ) );
 
 
 
 
260
 
261
  // Update activate results.
262
  update_option( $this->plugin_slug . '_license_active', $activate_results );
@@ -268,37 +278,37 @@ class UR_Plugin_Updater extends UR_Plugin_Updates {
268
 
269
  } elseif ( false === $activate_results->success ) {
270
  switch ( $activate_results->error ) {
271
- case 'expired' :
272
  $error_msg = sprintf( __( 'The provided license key expired on %1$s. Please <a href="%2$s" target="_blank">renew your license key</a>.', 'user-registration' ), date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ), 'https://wpeverest.com/checkout/?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired' );
273
  break;
274
 
275
- case 'revoked' :
276
  $error_msg = sprintf( __( 'The provided license key has been disabled. Please <a href="%s" target="_blank">contact support</a> for more information.', 'user-registration' ), 'https://wpeverest.com/contact?utm_campaign=admin&utm_source=licenses&utm_medium=revoked' );
277
  break;
278
 
279
- case 'missing' :
280
  $error_msg = sprintf( __( 'The provided license is invalid. Please <a href="%s" target="_blank">visit your account page</a> and verify it.', 'user-registration' ), 'https://wpeverest.com/my-account?utm_campaign=admin&utm_source=licenses&utm_medium=missing' );
281
  break;
282
 
283
- case 'invalid' :
284
- case 'site_inactive' :
285
  $error_msg = sprintf( __( 'The provided license is not active for this URL. Please <a href="%s" target="_blank">visit your account page</a> to manage your license key URLs.', 'user-registration' ), 'https://wpeverest.com/my-account?utm_campaign=admin&utm_source=licenses&utm_medium=missing' );
286
  break;
287
 
288
- case 'invalid_item_id' :
289
- case 'item_name_mismatch' :
290
  $error_msg = sprintf( __( 'This appears to be an invalid license key for <strong>%1$s</strong>.', 'user-registration' ), $this->plugin_data['Name'] );
291
  break;
292
 
293
- case 'no_activations_left' :
294
  $error_msg = sprintf( __( 'The provided license key has reached its activation limit. Please <a href="%1$s" target="_blank">View possible upgrades</a> now.', 'user-registration' ), 'https://wpeverest.com/my-account/' );
295
  break;
296
 
297
- case 'license_not_activable' :
298
  $error_msg = __( 'The key you entered belongs to a bundle, please use the product specific license key.', 'user-registration' );
299
  break;
300
 
301
- default :
302
  $error_msg = sprintf( __( 'The provided license key could not be found. Please <a href="%s" target="_blank">contact support</a> for more information.', 'user-registration' ), 'https://wpeverest.com/contact/' );
303
  break;
304
  }
@@ -319,7 +329,6 @@ class UR_Plugin_Updater extends UR_Plugin_Updates {
319
  } else {
320
  throw new Exception( 'Connection failed to the License Key API server - possible server issue.' );
321
  }
322
-
323
  } catch ( Exception $e ) {
324
  $this->add_error( $e->getMessage() );
325
  return false;
@@ -330,9 +339,11 @@ class UR_Plugin_Updater extends UR_Plugin_Updates {
330
  * Deactivate a license.
331
  */
332
  public function deactivate_license() {
333
- $reset = UR_Updater_Key_API::deactivate( array(
334
- 'license' => $this->api_key,
335
- ) );
 
 
336
 
337
  delete_option( $this->plugin_slug . '_errors' );
338
  delete_option( $this->plugin_slug . '_license_key' );
@@ -348,7 +359,7 @@ class UR_Plugin_Updater extends UR_Plugin_Updates {
348
  */
349
  public function key_notice() {
350
  if ( sizeof( $this->errors ) === 0 && ! get_option( $this->plugin_slug . '_hide_key_notice' ) ) {
351
- include( dirname( __FILE__ ) . '/admin/views/html-notice-key-unvalidated.php' );
352
  }
353
  }
354
 
@@ -356,14 +367,14 @@ class UR_Plugin_Updater extends UR_Plugin_Updates {
356
  * Activation success notice.
357
  */
358
  public function activated_key_notice() {
359
- include( dirname( __FILE__ ) . '/admin/views/html-notice-key-activated.php' );
360
  }
361
 
362
  /**
363
  * Dectivation success notice.
364
  */
365
  public function deactivated_key_notice() {
366
- include( dirname( __FILE__ ) . '/admin/views/html-notice-key-deactivated.php' );
367
  }
368
  }
369
 
13
  }
14
 
15
  if ( ! class_exists( 'UR_AddOn_Updater', false ) ) {
16
+ include_once dirname( __FILE__ ) . '/admin/updater/class-ur-addon-updater.php';
17
  }
18
 
19
  if ( ! class_exists( 'UR_Plugin_Updates', false ) ) {
20
+ include_once dirname( __FILE__ ) . '/admin/updater/class-ur-plugin-updates.php';
21
  }
22
 
23
  /**
27
 
28
  /**
29
  * Plugin File.
30
+ *
31
  * @var string
32
  */
33
  private $plugin_file = '';
34
 
35
  /**
36
  * Plugin Name.
37
+ *
38
  * @var string
39
  */
40
  private $plugin_name = '';
41
 
42
  /**
43
  * Plugin Slug.
44
+ *
45
  * @var string
46
  */
47
  private $plugin_slug = '';
48
 
49
  /**
50
  * Plugins data.
51
+ *
52
  * @var array of strings
53
  */
54
  private $plugin_data = array();
55
 
56
  /**
57
  * Validation errors.
58
+ *
59
  * @var array of strings
60
  */
61
  private $errors = array();
82
  add_action( 'admin_init', array( $this, 'admin_init' ) );
83
 
84
  // Include required files.
85
+ include_once dirname( __FILE__ ) . '/admin/updater/class-ur-plugin-updater-api.php';
86
  }
87
 
88
  /**
205
  public function error_notices() {
206
  if ( ! empty( $this->errors ) ) {
207
  foreach ( $this->errors as $key => $error ) {
208
+ include dirname( __FILE__ ) . '/admin/views/html-notice-error.php';
209
  if ( $key !== 'invalid_key' && did_action( 'all_admin_notices' ) ) {
210
  unset( $this->errors[ $key ] );
211
  }
232
  */
233
  public function plugin_license_form( $plugin_file ) {
234
  if ( strtolower( basename( dirname( $plugin_file ) ) ) === strtolower( $this->plugin_slug ) ) {
235
+ include_once dirname( __FILE__ ) . '/admin/views/html-license-form.php';
236
  }
237
  }
238
 
239
  /**
240
  * Display action links in the Plugins list table.
241
+ *
242
  * @param array $actions
243
  * @return array
244
  */
260
  throw new Exception( 'Please enter your license key' );
261
  }
262
 
263
+ $activate_results = json_decode(
264
+ UR_Updater_Key_API::activate(
265
+ array(
266
+ 'license' => $license_key,
267
+ )
268
+ )
269
+ );
270
 
271
  // Update activate results.
272
  update_option( $this->plugin_slug . '_license_active', $activate_results );
278
 
279
  } elseif ( false === $activate_results->success ) {
280
  switch ( $activate_results->error ) {
281
+ case 'expired':
282
  $error_msg = sprintf( __( 'The provided license key expired on %1$s. Please <a href="%2$s" target="_blank">renew your license key</a>.', 'user-registration' ), date_i18n( get_option( 'date_format' ), strtotime( $license->expires, current_time( 'timestamp' ) ) ), 'https://wpeverest.com/checkout/?edd_license_key=' . $license_key . '&utm_campaign=admin&utm_source=licenses&utm_medium=expired' );
283
  break;
284
 
285
+ case 'revoked':
286
  $error_msg = sprintf( __( 'The provided license key has been disabled. Please <a href="%s" target="_blank">contact support</a> for more information.', 'user-registration' ), 'https://wpeverest.com/contact?utm_campaign=admin&utm_source=licenses&utm_medium=revoked' );
287
  break;
288
 
289
+ case 'missing':
290
  $error_msg = sprintf( __( 'The provided license is invalid. Please <a href="%s" target="_blank">visit your account page</a> and verify it.', 'user-registration' ), 'https://wpeverest.com/my-account?utm_campaign=admin&utm_source=licenses&utm_medium=missing' );
291
  break;
292
 
293
+ case 'invalid':
294
+ case 'site_inactive':
295
  $error_msg = sprintf( __( 'The provided license is not active for this URL. Please <a href="%s" target="_blank">visit your account page</a> to manage your license key URLs.', 'user-registration' ), 'https://wpeverest.com/my-account?utm_campaign=admin&utm_source=licenses&utm_medium=missing' );
296
  break;
297
 
298
+ case 'invalid_item_id':
299
+ case 'item_name_mismatch':
300
  $error_msg = sprintf( __( 'This appears to be an invalid license key for <strong>%1$s</strong>.', 'user-registration' ), $this->plugin_data['Name'] );
301
  break;
302
 
303
+ case 'no_activations_left':
304
  $error_msg = sprintf( __( 'The provided license key has reached its activation limit. Please <a href="%1$s" target="_blank">View possible upgrades</a> now.', 'user-registration' ), 'https://wpeverest.com/my-account/' );
305
  break;
306
 
307
+ case 'license_not_activable':
308
  $error_msg = __( 'The key you entered belongs to a bundle, please use the product specific license key.', 'user-registration' );
309
  break;
310
 
311
+ default:
312
  $error_msg = sprintf( __( 'The provided license key could not be found. Please <a href="%s" target="_blank">contact support</a> for more information.', 'user-registration' ), 'https://wpeverest.com/contact/' );
313
  break;
314
  }
329
  } else {
330
  throw new Exception( 'Connection failed to the License Key API server - possible server issue.' );
331
  }
 
332
  } catch ( Exception $e ) {
333
  $this->add_error( $e->getMessage() );
334
  return false;
339
  * Deactivate a license.
340
  */
341
  public function deactivate_license() {
342
+ $reset = UR_Updater_Key_API::deactivate(
343
+ array(
344
+ 'license' => $this->api_key,
345
+ )
346
+ );
347
 
348
  delete_option( $this->plugin_slug . '_errors' );
349
  delete_option( $this->plugin_slug . '_license_key' );
359
  */
360
  public function key_notice() {
361
  if ( sizeof( $this->errors ) === 0 && ! get_option( $this->plugin_slug . '_hide_key_notice' ) ) {
362
+ include dirname( __FILE__ ) . '/admin/views/html-notice-key-unvalidated.php';
363
  }
364
  }
365
 
367
  * Activation success notice.
368
  */
369
  public function activated_key_notice() {
370
+ include dirname( __FILE__ ) . '/admin/views/html-notice-key-activated.php';
371
  }
372
 
373
  /**
374
  * Dectivation success notice.
375
  */
376
  public function deactivated_key_notice() {
377
+ include dirname( __FILE__ ) . '/admin/views/html-notice-key-deactivated.php';
378
  }
379
  }
380
 
includes/class-ur-post-types.php CHANGED
@@ -39,8 +39,10 @@ class UR_Post_Types {
39
 
40
  do_action( 'user_registration_register_post_type' );
41
 
42
- register_post_type( 'user_registration',
43
- apply_filters( 'user_registration_post_type',
 
 
44
  array(
45
  'labels' => array(
46
  'name' => __( 'Registrations', 'user-registration' ),
39
 
40
  do_action( 'user_registration_register_post_type' );
41
 
42
+ register_post_type(
43
+ 'user_registration',
44
+ apply_filters(
45
+ 'user_registration_post_type',
46
  array(
47
  'labels' => array(
48
  'name' => __( 'Registrations', 'user-registration' ),
includes/class-ur-query.php CHANGED
@@ -52,7 +52,7 @@ class UR_Query {
52
  // Query vars to add to WP.
53
  $this->query_vars = array(
54
  // My account actions.
55
- 'edit-password' => get_option( 'user_registration_myaccount_change_password_endpoint', 'edit-password' ),
56
  'edit-profile' => get_option( 'user_registration_myaccount_edit_profile_endpoint', 'edit-profile' ),
57
  'lost-password' => get_option( 'user_registration_myaccount_lost_password_endpoint', 'lost-password' ),
58
  'user-logout' => get_option( 'user_registration_logout_endpoint', 'user-logout' ),
@@ -69,18 +69,18 @@ class UR_Query {
69
  global $wp;
70
 
71
  switch ( $endpoint ) {
72
- case 'edit-password' :
73
  $title = __( 'Change Password', 'user-registration' );
74
- break;
75
- case 'edit-profile' :
76
  $title = __( 'Profile Details', 'user-registration' );
77
- break;
78
- case 'lost-password' :
79
  $title = __( 'Lost password', 'user-registration' );
80
- break;
81
- default :
82
  $title = '';
83
- break;
84
  }
85
 
86
  return apply_filters( 'user_registration_endpoint_' . $endpoint . '_title', $title, $endpoint );
52
  // Query vars to add to WP.
53
  $this->query_vars = array(
54
  // My account actions.
55
+ 'edit-password' => get_option( 'user_registration_myaccount_change_password_endpoint', 'edit-password' ),
56
  'edit-profile' => get_option( 'user_registration_myaccount_edit_profile_endpoint', 'edit-profile' ),
57
  'lost-password' => get_option( 'user_registration_myaccount_lost_password_endpoint', 'lost-password' ),
58
  'user-logout' => get_option( 'user_registration_logout_endpoint', 'user-logout' ),
69
  global $wp;
70
 
71
  switch ( $endpoint ) {
72
+ case 'edit-password':
73
  $title = __( 'Change Password', 'user-registration' );
74
+ break;
75
+ case 'edit-profile':
76
  $title = __( 'Profile Details', 'user-registration' );
77
+ break;
78
+ case 'lost-password':
79
  $title = __( 'Lost password', 'user-registration' );
80
+ break;
81
+ default:
82
  $title = '';
83
+ break;
84
  }
85
 
86
  return apply_filters( 'user_registration_endpoint_' . $endpoint . '_title', $title, $endpoint );
includes/class-ur-session-handler.php CHANGED
@@ -116,7 +116,7 @@ class UR_Session_Handler extends UR_Session {
116
 
117
  return get_current_user_id();
118
  } else {
119
- require_once( ABSPATH . 'wp-includes/class-phpass.php' );
120
  $hasher = new PasswordHash( 8, false );
121
  return md5( $hasher->get_random_bytes( 32 ) );
122
  }
@@ -156,6 +156,7 @@ class UR_Session_Handler extends UR_Session {
156
 
157
  /**
158
  * Get prefix for use with wp_cache_set. Allows all cache in a group to be invalidated at once.
 
159
  * @param string $group
160
  * @return string
161
  */
@@ -173,6 +174,7 @@ class UR_Session_Handler extends UR_Session {
173
 
174
  /**
175
  * Increment group cache prefix (invalidates cache).
 
176
  * @param string $group
177
  */
178
  public function incr_cache_prefix( $group = UR_SESSION_CACHE_GROUP ) {
@@ -190,8 +192,8 @@ class UR_Session_Handler extends UR_Session {
190
  $wpdb->replace(
191
  $this->_table,
192
  array(
193
- 'session_key' => $this->_customer_id,
194
- 'session_value' => maybe_serialize( $this->_data ),
195
  'session_expiry' => $this->_session_expiration,
196
  ),
197
  array(
@@ -317,7 +319,7 @@ class UR_Session_Handler extends UR_Session {
317
  'session_key' => $customer_id,
318
  ),
319
  array(
320
- '%d'
321
  )
322
  );
323
  }
116
 
117
  return get_current_user_id();
118
  } else {
119
+ require_once ABSPATH . 'wp-includes/class-phpass.php';
120
  $hasher = new PasswordHash( 8, false );
121
  return md5( $hasher->get_random_bytes( 32 ) );
122
  }
156
 
157
  /**
158
  * Get prefix for use with wp_cache_set. Allows all cache in a group to be invalidated at once.
159
+ *
160
  * @param string $group
161
  * @return string
162
  */
174
 
175
  /**
176
  * Increment group cache prefix (invalidates cache).
177
+ *
178
  * @param string $group
179
  */
180
  public function incr_cache_prefix( $group = UR_SESSION_CACHE_GROUP ) {
192
  $wpdb->replace(
193
  $this->_table,
194
  array(
195
+ 'session_key' => $this->_customer_id,
196
+ 'session_value' => maybe_serialize( $this->_data ),
197
  'session_expiry' => $this->_session_expiration,
198
  ),
199
  array(
319
  'session_key' => $customer_id,
320
  ),
321
  array(
322
+ '%d',
323
  )
324
  );
325
  }
includes/class-ur-shortcodes.php CHANGED
@@ -25,7 +25,7 @@ class UR_Shortcodes {
25
  $shortcodes = array(
26
  'user_registration_form' => __CLASS__ . '::form', // change it to user_registration_form ;)
27
  'user_registration_my_account' => __CLASS__ . '::my_account',
28
- 'user_registration_login' =>__class__ . '::login',
29
  );
30
 
31
  foreach ( $shortcodes as $shortcode => $function ) {
@@ -68,11 +68,18 @@ class UR_Shortcodes {
68
  * @return string
69
  */
70
  public static function my_account( $atts ) {
71
- return self::shortcode_wrapper( array( 'UR_Shortcode_My_Account', 'output' ), $atts,apply_filters('user_registration_my_account_shortcode',array(
72
- 'class' => 'user-registration',
73
- 'before' => null,
74
- 'after' => null,
75
- ) ));
 
 
 
 
 
 
 
76
  }
77
 
78
  /**
@@ -83,15 +90,23 @@ class UR_Shortcodes {
83
  * @return string
84
  */
85
  public static function login( $atts ) {
86
- return self::shortcode_wrapper( array( 'UR_Shortcode_Login', 'output' ), $atts,apply_filters('user_registration_login_shortcode',array(
87
- 'class' => 'user-registration',
88
- 'before' => null,
89
- 'after' => null,
90
- ) ));
 
 
 
 
 
 
 
91
  }
92
 
93
  /**
94
  * User Registration form shortcode.
 
95
  * @param mixed $atts
96
  */
97
  public static function form( $atts ) {
@@ -113,18 +128,22 @@ class UR_Shortcodes {
113
  if ( ! current_user_can( $current_user_capability ) ) {
114
  global $wp;
115
 
116
- $user_ID = get_current_user_id();
117
- $user = get_user_by( 'ID', $user_ID );
118
- $current_url = home_url( add_query_arg( array(), $wp->request ) );
119
  $display_name = ! empty( $user->data->display_name ) ? $user->data->display_name : $user->data->user_email;
120
 
121
- return apply_filters( 'ur_register_pre_form_message', '<p class="alert" id="ur_register_pre_form_message">' . sprintf( __( "You are currently logged in as %1s. %2s", 'user-registration' ), '<a href="#" title="' . $display_name . '">' . $display_name . '</a>', '<a href="' . wp_logout_url( $current_url ) . '" title="' . __( 'Log out of this account.', 'user-registration' ) . '">' . __( 'Logout', 'user-registration' ) . ' &raquo;</a>' ) . '</p>', $user_ID );
122
  }
123
  }
124
 
125
- $atts = shortcode_atts( array(
126
- 'id' => '',
127
- ), $atts, 'user_registration_form' );
 
 
 
 
128
 
129
  ob_start();
130
  self::render_form( $atts['id'] );
@@ -134,6 +153,7 @@ class UR_Shortcodes {
134
 
135
  /**
136
  * Output for registration form .
 
137
  * @since 1.0.1 Recaptcha only
138
  */
139
  private static function render_form( $form_id ) {
@@ -155,16 +175,16 @@ class UR_Shortcodes {
155
  $form_data_array = array();
156
  }
157
 
158
- $is_field_exists = false;
159
- $enable_strong_password = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_enable_strong_password' );
160
- $minimum_password_strength = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_minimum_password_strength' );
161
 
162
  // Enqueue script.
163
  wp_enqueue_script( 'user-registration' );
164
 
165
  $has_date = ur_has_date_field( $form_id );
166
 
167
- if( true === $has_date ) {
168
  wp_enqueue_style( 'flatpickr' );
169
  wp_enqueue_script( 'flatpickr' );
170
  }
@@ -174,17 +194,19 @@ class UR_Shortcodes {
174
  wp_localize_script( 'ur-password-strength-meter', 'enable_strong_password', $enable_strong_password );
175
  }
176
 
177
- $recaptcha_enabled = ur_get_form_setting_by_key( $form_id, 'user_registration_form_setting_enable_recaptcha_support' );
178
- $recaptcha_node = ur_get_recaptcha_node( $recaptcha_enabled, 'register' );
179
-
180
- include_once( UR_ABSPATH . 'includes/frontend/class-ur-frontend.php' );
181
- ur_get_template( 'form-registration.php', array(
182
- 'form_data_array' => $form_data_array,
183
- 'is_field_exists' => $is_field_exists,
184
- 'form_id' => $form_id,
185
- 'enable_strong_password' => $enable_strong_password,
186
- 'minimum_password_strength' => $minimum_password_strength,
187
- 'recaptcha_node' => $recaptcha_node,
 
 
188
  )
189
  );
190
  }
25
  $shortcodes = array(
26
  'user_registration_form' => __CLASS__ . '::form', // change it to user_registration_form ;)
27
  'user_registration_my_account' => __CLASS__ . '::my_account',
28
+ 'user_registration_login' => __class__ . '::login',
29
  );
30
 
31
  foreach ( $shortcodes as $shortcode => $function ) {
68
  * @return string
69
  */
70
  public static function my_account( $atts ) {
71
+ return self::shortcode_wrapper(
72
+ array( 'UR_Shortcode_My_Account', 'output' ),
73
+ $atts,
74
+ apply_filters(
75
+ 'user_registration_my_account_shortcode',
76
+ array(
77
+ 'class' => 'user-registration',
78
+ 'before' => null,
79
+ 'after' => null,
80
+ )
81
+ )
82
+ );
83
  }
84
 
85
  /**
90
  * @return string
91
  */
92
  public static function login( $atts ) {
93
+ return self::shortcode_wrapper(
94
+ array( 'UR_Shortcode_Login', 'output' ),
95
+ $atts,
96
+ apply_filters(
97
+ 'user_registration_login_shortcode',
98
+ array(
99
+ 'class' => 'user-registration',
100
+ 'before' => null,
101
+ 'after' => null,
102
+ )
103
+ )
104
+ );
105
  }
106
 
107
  /**
108
  * User Registration form shortcode.
109
+ *
110
  * @param mixed $atts
111
  */
112
  public static function form( $atts ) {
128
  if ( ! current_user_can( $current_user_capability ) ) {
129
  global $wp;
130
 
131
+ $user_ID = get_current_user_id();
132
+ $user = get_user_by( 'ID', $user_ID );
133
+ $current_url = home_url( add_query_arg( array(), $wp->request ) );
134
  $display_name = ! empty( $user->data->display_name ) ? $user->data->display_name : $user->data->user_email;
135
 
136
+ return apply_filters( 'ur_register_pre_form_message', '<p class="alert" id="ur_register_pre_form_message">' . sprintf( __( 'You are currently logged in as %1$1s. %2$2s', 'user-registration' ), '<a href="#" title="' . $display_name . '">' . $display_name . '</a>', '<a href="' . wp_logout_url( $current_url ) . '" title="' . __( 'Log out of this account.', 'user-registration' ) . '">' . __( 'Logout', 'user-registration' ) . ' &raquo;</a>' ) . '</p>', $user_ID );
137
  }
138
  }
139
 
140
+ $atts = shortcode_atts(
141
+ array(
142
+ 'id' => '',
143
+ ),
144
+ $atts,
145
+ 'user_registration_form'
146
+ );
147
 
148
  ob_start();
149
  self::render_form( $atts['id'] );
153
 
154
  /**
155
  * Output for registration form .
156
+ *
157
  * @since 1.0.1 Recaptcha only
158
  */
159
  private static function render_form( $form_id ) {
175
  $form_data_array = array();
176
  }
177
 
178
+ $is_field_exists = false;
179
+ $enable_strong_password = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_enable_strong_password' );
180
+ $minimum_password_strength = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_minimum_password_strength' );
181
 
182
  // Enqueue script.
183
  wp_enqueue_script( 'user-registration' );
184
 
185
  $has_date = ur_has_date_field( $form_id );
186
 
187
+ if ( true === $has_date ) {
188
  wp_enqueue_style( 'flatpickr' );
189
  wp_enqueue_script( 'flatpickr' );
190
  }
194
  wp_localize_script( 'ur-password-strength-meter', 'enable_strong_password', $enable_strong_password );
195
  }
196
 
197
+ $recaptcha_enabled = ur_get_form_setting_by_key( $form_id, 'user_registration_form_setting_enable_recaptcha_support' );
198
+ $recaptcha_node = ur_get_recaptcha_node( $recaptcha_enabled, 'register' );
199
+
200
+ include_once UR_ABSPATH . 'includes/frontend/class-ur-frontend.php';
201
+ ur_get_template(
202
+ 'form-registration.php',
203
+ array(
204
+ 'form_data_array' => $form_data_array,
205
+ 'is_field_exists' => $is_field_exists,
206
+ 'form_id' => $form_id,
207
+ 'enable_strong_password' => $enable_strong_password,
208
+ 'minimum_password_strength' => $minimum_password_strength,
209
+ 'recaptcha_node' => $recaptcha_node,
210
  )
211
  );
212
  }
includes/class-ur-user-approval.php CHANGED
@@ -27,30 +27,34 @@ class UR_User_Approval {
27
  return;
28
  }
29
  // -------------------- ACTIONS & FILTERS --------------------
30
-
31
  // Additional checks
32
  add_action( 'after_setup_theme', array( $this, 'check_status_on_page' ) );
33
 
34
- //Handle user Sign in
35
  add_action( 'user_register', array( $this, 'send_request_notification_to_admin' ) );
36
  add_action( 'user_register', array( $this, 'set_user_status' ) );
37
  add_filter( 'wp_login_errors', array( $this, 'registration_completed_message' ) );
38
 
39
- //Handle user Sign on
40
  add_action( 'wp_login', array( $this, 'track_first_login' ), 10, 2 );
41
  add_filter( 'wp_authenticate_user', array( $this, 'check_status_on_login' ) );
42
 
43
- //Handle Lost Password Page
44
  add_filter( 'allow_password_reset', array( $this, 'allow_password_reset' ), 10, 2 );
45
 
46
- //When the approval status of an user change
47
- add_action( 'ur_user_status_updated', array(
48
- $this,
49
- 'send_notification_to_user_about_status_changing'
50
- ), 10, 3 );
 
 
 
 
 
51
  add_action( 'ur_user_user_denied', array( $this, 'disconnect_user_session' ) );
52
 
53
- //Try to hide the not approved users from any theme or plugin request in frontend
54
  add_action( 'pre_get_users', array( $this, 'hide_not_approved_users_in_frontend' ) );
55
 
56
  do_action( 'ur_user_construct' );
@@ -103,7 +107,7 @@ class UR_User_Approval {
103
 
104
  $user_manager = new UR_Admin_User_Manager( $user_id );
105
 
106
- //Avoid to send multiple times the same email
107
  if ( $status == $user_manager->get_user_status() ) {
108
  return;
109
  }
@@ -125,7 +129,7 @@ class UR_User_Approval {
125
  */
126
  public function send_request_notification_to_admin( $user_id ) {
127
 
128
- //If the user is created by admin or if the admin alert is disabled, doesn't send the email to the admin
129
  if ( $this->is_admin_creation_process() ) {
130
  return;
131
  }
@@ -147,7 +151,7 @@ class UR_User_Approval {
147
 
148
  $user_manager = new UR_Admin_User_Manager( $user_id );
149
 
150
- //The user have to be not alerted on status creation, it will be always pending or approved
151
  $alert_user = false;
152
 
153
  $user_manager->save_status( $status, $alert_user );
@@ -252,7 +256,7 @@ class UR_User_Approval {
252
 
253
  if ( ! $user_manager->is_approved() ) {
254
  $error_message = __( 'Your account is still awaiting admin approval. Reset Password is not allowed.', 'user-registration' );
255
- $result = new WP_Error( 'user_not_approved', $error_message );
256
  }
257
 
258
  return $result;
@@ -267,7 +271,7 @@ class UR_User_Approval {
267
  */
268
  public function hide_not_approved_users_in_frontend( $query ) {
269
 
270
- //If this is not a frontend page, then do nothing
271
  if ( is_admin() ) {
272
  return;
273
  }
@@ -276,18 +280,18 @@ class UR_User_Approval {
276
  return;
277
  }
278
 
279
- //Otherwise display only approved users
280
  $meta_query = array(
281
  'relation' => 'OR',
282
  array(
283
  'key' => 'ur_user_status',
284
  'compare' => 'NOT EXISTS', // works!
285
- 'value' => '' // This is ignored, but is necessary...
286
  ),
287
  array(
288
  'key' => 'ur_user_status',
289
- 'value' => UR_Admin_User_Manager::APPROVED
290
- )
291
  );
292
 
293
  $meta_query = apply_filters( 'ur_user_hide_not_approved_users_in_frontend', $meta_query, $query );
27
  return;
28
  }
29
  // -------------------- ACTIONS & FILTERS --------------------
 
30
  // Additional checks
31
  add_action( 'after_setup_theme', array( $this, 'check_status_on_page' ) );
32
 
33
+ // Handle user Sign in
34
  add_action( 'user_register', array( $this, 'send_request_notification_to_admin' ) );
35
  add_action( 'user_register', array( $this, 'set_user_status' ) );
36
  add_filter( 'wp_login_errors', array( $this, 'registration_completed_message' ) );
37
 
38
+ // Handle user Sign on
39
  add_action( 'wp_login', array( $this, 'track_first_login' ), 10, 2 );
40
  add_filter( 'wp_authenticate_user', array( $this, 'check_status_on_login' ) );
41
 
42
+ // Handle Lost Password Page
43
  add_filter( 'allow_password_reset', array( $this, 'allow_password_reset' ), 10, 2 );
44
 
45
+ // When the approval status of an user change
46
+ add_action(
47
+ 'ur_user_status_updated',
48
+ array(
49
+ $this,
50
+ 'send_notification_to_user_about_status_changing',
51
+ ),
52
+ 10,
53
+ 3
54
+ );
55
  add_action( 'ur_user_user_denied', array( $this, 'disconnect_user_session' ) );
56
 
57
+ // Try to hide the not approved users from any theme or plugin request in frontend
58
  add_action( 'pre_get_users', array( $this, 'hide_not_approved_users_in_frontend' ) );
59
 
60
  do_action( 'ur_user_construct' );
107
 
108
  $user_manager = new UR_Admin_User_Manager( $user_id );
109
 
110
+ // Avoid to send multiple times the same email
111
  if ( $status == $user_manager->get_user_status() ) {
112
  return;
113
  }
129
  */
130
  public function send_request_notification_to_admin( $user_id ) {
131
 
132
+ // If the user is created by admin or if the admin alert is disabled, doesn't send the email to the admin
133
  if ( $this->is_admin_creation_process() ) {
134
  return;
135
  }
151
 
152
  $user_manager = new UR_Admin_User_Manager( $user_id );
153
 
154
+ // The user have to be not alerted on status creation, it will be always pending or approved
155
  $alert_user = false;
156
 
157
  $user_manager->save_status( $status, $alert_user );
256
 
257
  if ( ! $user_manager->is_approved() ) {
258
  $error_message = __( 'Your account is still awaiting admin approval. Reset Password is not allowed.', 'user-registration' );
259
+ $result = new WP_Error( 'user_not_approved', $error_message );
260
  }
261
 
262
  return $result;
271
  */
272
  public function hide_not_approved_users_in_frontend( $query ) {
273
 
274
+ // If this is not a frontend page, then do nothing
275
  if ( is_admin() ) {
276
  return;
277
  }
280
  return;
281
  }
282
 
283
+ // Otherwise display only approved users
284
  $meta_query = array(
285
  'relation' => 'OR',
286
  array(
287
  'key' => 'ur_user_status',
288
  'compare' => 'NOT EXISTS', // works!
289
+ 'value' => '', // This is ignored, but is necessary...
290
  ),
291
  array(
292
  'key' => 'ur_user_status',
293
+ 'value' => UR_Admin_User_Manager::APPROVED,
294
+ ),
295
  );
296
 
297
  $meta_query = apply_filters( 'ur_user_hide_not_approved_users_in_frontend', $meta_query, $query );
includes/form/class-ur-form-field-checkbox.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_Checkbox extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_checkbox';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
  'label' => __( 'Checkbox', 'user-registration' ),
36
- 'icon' => 'dashicons dashicons-yes',
37
  );
38
 
39
  $this->field_defaults = array(
40
- 'default_label' => __( 'Checkbox', 'user-registration' ),
41
  'default_field_name' => 'check_box_' . ur_get_random_number(),
42
  );
43
  }
@@ -58,14 +58,17 @@ class UR_Form_Field_Checkbox extends UR_Form_Field {
58
  */
59
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
60
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
61
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
62
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
63
- $value = isset( $form_data->value ) ? $form_data->value : '';
64
 
65
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
66
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
67
- return __( $field_label . ' is required.', 'user-registration' );
68
- });
 
 
 
69
  }
70
  }
71
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_checkbox';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
  'label' => __( 'Checkbox', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-yes',
37
  );
38
 
39
  $this->field_defaults = array(
40
+ 'default_label' => __( 'Checkbox', 'user-registration' ),
41
  'default_field_name' => 'check_box_' . ur_get_random_number(),
42
  );
43
  }
58
  */
59
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
60
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
61
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
62
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
63
+ $value = isset( $form_data->value ) ? $form_data->value : '';
64
 
65
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
66
+ add_filter(
67
+ $filter_hook,
68
+ function ( $msg ) use ( $field_label ) {
69
+ return __( $field_label . ' is required.', 'user-registration' );
70
+ }
71
+ );
72
  }
73
  }
74
  }
includes/form/class-ur-form-field-country.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,270 +29,273 @@ class UR_Form_Field_Country extends UR_Form_Field {
29
 
30
  public function get_country() {
31
 
32
- return apply_filters( 'user_registration_countries_list', array(
33
- 'AF' => __( 'Afghanistan', 'user-registration' ),
34
- 'AX' => __( '&#197;land Islands', 'user-registration' ),
35
- 'AL' => __( 'Albania', 'user-registration' ),
36
- 'DZ' => __( 'Algeria', 'user-registration' ),
37
- 'AS' => __( 'American Samoa', 'user-registration' ),
38
- 'AD' => __( 'Andorra', 'user-registration' ),
39
- 'AO' => __( 'Angola', 'user-registration' ),
40
- 'AI' => __( 'Anguilla', 'user-registration' ),
41
- 'AQ' => __( 'Antarctica', 'user-registration' ),
42
- 'AG' => __( 'Antigua and Barbuda', 'user-registration' ),
43
- 'AR' => __( 'Argentina', 'user-registration' ),
44
- 'AM' => __( 'Armenia', 'user-registration' ),
45
- 'AW' => __( 'Aruba', 'user-registration' ),
46
- 'AU' => __( 'Australia', 'user-registration' ),
47
- 'AT' => __( 'Austria', 'user-registration' ),
48
- 'AZ' => __( 'Azerbaijan', 'user-registration' ),
49
- 'BS' => __( 'Bahamas', 'user-registration' ),
50
- 'BH' => __( 'Bahrain', 'user-registration' ),
51
- 'BD' => __( 'Bangladesh', 'user-registration' ),
52
- 'BB' => __( 'Barbados', 'user-registration' ),
53
- 'BY' => __( 'Belarus', 'user-registration' ),
54
- 'BE' => __( 'Belgium', 'user-registration' ),
55
- 'PW' => __( 'Belau', 'user-registration' ),
56
- 'BZ' => __( 'Belize', 'user-registration' ),
57
- 'BJ' => __( 'Benin', 'user-registration' ),
58
- 'BM' => __( 'Bermuda', 'user-registration' ),
59
- 'BT' => __( 'Bhutan', 'user-registration' ),
60
- 'BO' => __( 'Bolivia', 'user-registration' ),
61
- 'BQ' => __( 'Bonaire, Saint Eustatius and Saba', 'user-registration' ),
62
- 'BA' => __( 'Bosnia and Herzegovina', 'user-registration' ),
63
- 'BW' => __( 'Botswana', 'user-registration' ),
64
- 'BV' => __( 'Bouvet Island', 'user-registration' ),
65
- 'BR' => __( 'Brazil', 'user-registration' ),
66
- 'IO' => __( 'British Indian Ocean Territory', 'user-registration' ),
67
- 'VG' => __( 'British Virgin Islands', 'user-registration' ),
68
- 'BN' => __( 'Brunei', 'user-registration' ),
69
- 'BG' => __( 'Bulgaria', 'user-registration' ),
70
- 'BF' => __( 'Burkina Faso', 'user-registration' ),
71
- 'BI' => __( 'Burundi', 'user-registration' ),
72
- 'KH' => __( 'Cambodia', 'user-registration' ),
73
- 'CM' => __( 'Cameroon', 'user-registration' ),
74
- 'CA' => __( 'Canada', 'user-registration' ),
75
- 'CV' => __( 'Cape Verde', 'user-registration' ),
76
- 'KY' => __( 'Cayman Islands', 'user-registration' ),
77
- 'CF' => __( 'Central African Republic', 'user-registration' ),
78
- 'TD' => __( 'Chad', 'user-registration' ),
79
- 'CL' => __( 'Chile', 'user-registration' ),
80
- 'CN' => __( 'China', 'user-registration' ),
81
- 'CX' => __( 'Christmas Island', 'user-registration' ),
82
- 'CC' => __( 'Cocos (Keeling) Islands', 'user-registration' ),
83
- 'CO' => __( 'Colombia', 'user-registration' ),
84
- 'KM' => __( 'Comoros', 'user-registration' ),
85
- 'CG' => __( 'Congo (Brazzaville)', 'user-registration' ),
86
- 'CD' => __( 'Congo (Kinshasa)', 'user-registration' ),
87
- 'CK' => __( 'Cook Islands', 'user-registration' ),
88
- 'CR' => __( 'Costa Rica', 'user-registration' ),
89
- 'HR' => __( 'Croatia', 'user-registration' ),
90
- 'CU' => __( 'Cuba', 'user-registration' ),
91
- 'CW' => __( 'Cura&ccedil;ao', 'user-registration' ),
92
- 'CY' => __( 'Cyprus', 'user-registration' ),
93
- 'CZ' => __( 'Czech Republic', 'user-registration' ),
94
- 'DK' => __( 'Denmark', 'user-registration' ),
95
- 'DJ' => __( 'Djibouti', 'user-registration' ),
96
- 'DM' => __( 'Dominica', 'user-registration' ),
97
- 'DO' => __( 'Dominican Republic', 'user-registration' ),
98
- 'EC' => __( 'Ecuador', 'user-registration' ),
99
- 'EG' => __( 'Egypt', 'user-registration' ),
100
- 'SV' => __( 'El Salvador', 'user-registration' ),
101
- 'GQ' => __( 'Equatorial Guinea', 'user-registration' ),
102
- 'ER' => __( 'Eritrea', 'user-registration' ),
103
- 'EE' => __( 'Estonia', 'user-registration' ),
104
- 'ET' => __( 'Ethiopia', 'user-registration' ),
105
- 'FK' => __( 'Falkland Islands', 'user-registration' ),
106
- 'FO' => __( 'Faroe Islands', 'user-registration' ),
107
- 'FJ' => __( 'Fiji', 'user-registration' ),
108
- 'FI' => __( 'Finland', 'user-registration' ),
109
- 'FR' => __( 'France', 'user-registration' ),
110
- 'GF' => __( 'French Guiana', 'user-registration' ),
111
- 'PF' => __( 'French Polynesia', 'user-registration' ),
112
- 'TF' => __( 'French Southern Territories', 'user-registration' ),
113
- 'GA' => __( 'Gabon', 'user-registration' ),
114
- 'GM' => __( 'Gambia', 'user-registration' ),
115
- 'GE' => __( 'Georgia', 'user-registration' ),
116
- 'DE' => __( 'Germany', 'user-registration' ),
117
- 'GH' => __( 'Ghana', 'user-registration' ),
118
- 'GI' => __( 'Gibraltar', 'user-registration' ),
119
- 'GR' => __( 'Greece', 'user-registration' ),
120
- 'GL' => __( 'Greenland', 'user-registration' ),
121
- 'GD' => __( 'Grenada', 'user-registration' ),
122
- 'GP' => __( 'Guadeloupe', 'user-registration' ),
123
- 'GU' => __( 'Guam', 'user-registration' ),
124
- 'GT' => __( 'Guatemala', 'user-registration' ),
125
- 'GG' => __( 'Guernsey', 'user-registration' ),
126
- 'GN' => __( 'Guinea', 'user-registration' ),
127
- 'GW' => __( 'Guinea-Bissau', 'user-registration' ),
128
- 'GY' => __( 'Guyana', 'user-registration' ),
129
- 'HT' => __( 'Haiti', 'user-registration' ),
130
- 'HM' => __( 'Heard Island and McDonald Islands', 'user-registration' ),
131
- 'HN' => __( 'Honduras', 'user-registration' ),
132
- 'HK' => __( 'Hong Kong', 'user-registration' ),
133
- 'HU' => __( 'Hungary', 'user-registration' ),
134
- 'IS' => __( 'Iceland', 'user-registration' ),
135
- 'IN' => __( 'India', 'user-registration' ),
136
- 'ID' => __( 'Indonesia', 'user-registration' ),
137
- 'IR' => __( 'Iran', 'user-registration' ),
138
- 'IQ' => __( 'Iraq', 'user-registration' ),
139
- 'IE' => __( 'Ireland', 'user-registration' ),
140
- 'IM' => __( 'Isle of Man', 'user-registration' ),
141
- 'IL' => __( 'Israel', 'user-registration' ),
142
- 'IT' => __( 'Italy', 'user-registration' ),
143
- 'CI' => __( 'Ivory Coast', 'user-registration' ),
144
- 'JM' => __( 'Jamaica', 'user-registration' ),
145
- 'JP' => __( 'Japan', 'user-registration' ),
146
- 'JE' => __( 'Jersey', 'user-registration' ),
147
- 'JO' => __( 'Jordan', 'user-registration' ),
148
- 'KZ' => __( 'Kazakhstan', 'user-registration' ),
149
- 'KE' => __( 'Kenya', 'user-registration' ),
150
- 'KI' => __( 'Kiribati', 'user-registration' ),
151
- 'KW' => __( 'Kuwait', 'user-registration' ),
152
- 'KG' => __( 'Kyrgyzstan', 'user-registration' ),
153
- 'LA' => __( 'Laos', 'user-registration' ),
154
- 'LV' => __( 'Latvia', 'user-registration' ),
155
- 'LB' => __( 'Lebanon', 'user-registration' ),
156
- 'LS' => __( 'Lesotho', 'user-registration' ),
157
- 'LR' => __( 'Liberia', 'user-registration' ),
158
- 'LY' => __( 'Libya', 'user-registration' ),
159
- 'LI' => __( 'Liechtenstein', 'user-registration' ),
160
- 'LT' => __( 'Lithuania', 'user-registration' ),
161
- 'LU' => __( 'Luxembourg', 'user-registration' ),
162
- 'MO' => __( 'Macao S.A.R., China', 'user-registration' ),
163
- 'MK' => __( 'Macedonia', 'user-registration' ),
164
- 'MG' => __( 'Madagascar', 'user-registration' ),
165
- 'MW' => __( 'Malawi', 'user-registration' ),
166
- 'MY' => __( 'Malaysia', 'user-registration' ),
167
- 'MV' => __( 'Maldives', 'user-registration' ),
168
- 'ML' => __( 'Mali', 'user-registration' ),
169
- 'MT' => __( 'Malta', 'user-registration' ),
170
- 'MH' => __( 'Marshall Islands', 'user-registration' ),
171
- 'MQ' => __( 'Martinique', 'user-registration' ),
172
- 'MR' => __( 'Mauritania', 'user-registration' ),
173
- 'MU' => __( 'Mauritius', 'user-registration' ),
174
- 'YT' => __( 'Mayotte', 'user-registration' ),
175
- 'MX' => __( 'Mexico', 'user-registration' ),
176
- 'FM' => __( 'Micronesia', 'user-registration' ),
177
- 'MD' => __( 'Moldova', 'user-registration' ),
178
- 'MC' => __( 'Monaco', 'user-registration' ),
179
- 'MN' => __( 'Mongolia', 'user-registration' ),
180
- 'ME' => __( 'Montenegro', 'user-registration' ),
181
- 'MS' => __( 'Montserrat', 'user-registration' ),
182
- 'MA' => __( 'Morocco', 'user-registration' ),
183
- 'MZ' => __( 'Mozambique', 'user-registration' ),
184
- 'MM' => __( 'Myanmar', 'user-registration' ),
185
- 'NA' => __( 'Namibia', 'user-registration' ),
186
- 'NR' => __( 'Nauru', 'user-registration' ),
187
- 'NP' => __( 'Nepal', 'user-registration' ),
188
- 'NL' => __( 'Netherlands', 'user-registration' ),
189
- 'NC' => __( 'New Caledonia', 'user-registration' ),
190
- 'NZ' => __( 'New Zealand', 'user-registration' ),
191
- 'NI' => __( 'Nicaragua', 'user-registration' ),
192
- 'NE' => __( 'Niger', 'user-registration' ),
193
- 'NG' => __( 'Nigeria', 'user-registration' ),
194
- 'NU' => __( 'Niue', 'user-registration' ),
195
- 'NF' => __( 'Norfolk Island', 'user-registration' ),
196
- 'MP' => __( 'Northern Mariana Islands', 'user-registration' ),
197
- 'KP' => __( 'North Korea', 'user-registration' ),
198
- 'NO' => __( 'Norway', 'user-registration' ),
199
- 'OM' => __( 'Oman', 'user-registration' ),
200
- 'PK' => __( 'Pakistan', 'user-registration' ),
201
- 'PS' => __( 'Palestinian Territory', 'user-registration' ),
202
- 'PA' => __( 'Panama', 'user-registration' ),
203
- 'PG' => __( 'Papua New Guinea', 'user-registration' ),
204
- 'PY' => __( 'Paraguay', 'user-registration' ),
205
- 'PE' => __( 'Peru', 'user-registration' ),
206
- 'PH' => __( 'Philippines', 'user-registration' ),
207
- 'PN' => __( 'Pitcairn', 'user-registration' ),
208
- 'PL' => __( 'Poland', 'user-registration' ),
209
- 'PT' => __( 'Portugal', 'user-registration' ),
210
- 'PR' => __( 'Puerto Rico', 'user-registration' ),
211
- 'QA' => __( 'Qatar', 'user-registration' ),
212
- 'RE' => __( 'Reunion', 'user-registration' ),
213
- 'RO' => __( 'Romania', 'user-registration' ),
214
- 'RU' => __( 'Russia', 'user-registration' ),
215
- 'RW' => __( 'Rwanda', 'user-registration' ),
216
- 'BL' => __( 'Saint Barth&eacute;lemy', 'user-registration' ),
217
- 'SH' => __( 'Saint Helena', 'user-registration' ),
218
- 'KN' => __( 'Saint Kitts and Nevis', 'user-registration' ),
219
- 'LC' => __( 'Saint Lucia', 'user-registration' ),
220
- 'MF' => __( 'Saint Martin (French part)', 'user-registration' ),
221
- 'SX' => __( 'Saint Martin (Dutch part)', 'user-registration' ),
222
- 'PM' => __( 'Saint Pierre and Miquelon', 'user-registration' ),
223
- 'VC' => __( 'Saint Vincent and the Grenadines', 'user-registration' ),
224
- 'SM' => __( 'San Marino', 'user-registration' ),
225
- 'ST' => __( 'S&atilde;o Tom&eacute; and Pr&iacute;ncipe', 'user-registration' ),
226
- 'SA' => __( 'Saudi Arabia', 'user-registration' ),
227
- 'SN' => __( 'Senegal', 'user-registration' ),
228
- 'RS' => __( 'Serbia', 'user-registration' ),
229
- 'SC' => __( 'Seychelles', 'user-registration' ),
230
- 'SL' => __( 'Sierra Leone', 'user-registration' ),
231
- 'SG' => __( 'Singapore', 'user-registration' ),
232
- 'SK' => __( 'Slovakia', 'user-registration' ),
233
- 'SI' => __( 'Slovenia', 'user-registration' ),
234
- 'SB' => __( 'Solomon Islands', 'user-registration' ),
235
- 'SO' => __( 'Somalia', 'user-registration' ),
236
- 'ZA' => __( 'South Africa', 'user-registration' ),
237
- 'GS' => __( 'South Georgia/Sandwich Islands', 'user-registration' ),
238
- 'KR' => __( 'South Korea', 'user-registration' ),
239
- 'SS' => __( 'South Sudan', 'user-registration' ),
240
- 'ES' => __( 'Spain', 'user-registration' ),
241
- 'LK' => __( 'Sri Lanka', 'user-registration' ),
242
- 'SD' => __( 'Sudan', 'user-registration' ),
243
- 'SR' => __( 'Suriname', 'user-registration' ),
244
- 'SJ' => __( 'Svalbard and Jan Mayen', 'user-registration' ),
245
- 'SZ' => __( 'Swaziland', 'user-registration' ),
246
- 'SE' => __( 'Sweden', 'user-registration' ),
247
- 'CH' => __( 'Switzerland', 'user-registration' ),
248
- 'SY' => __( 'Syria', 'user-registration' ),
249
- 'TW' => __( 'Taiwan', 'user-registration' ),
250
- 'TJ' => __( 'Tajikistan', 'user-registration' ),
251
- 'TZ' => __( 'Tanzania', 'user-registration' ),
252
- 'TH' => __( 'Thailand', 'user-registration' ),
253
- 'TL' => __( 'Timor-Leste', 'user-registration' ),
254
- 'TG' => __( 'Togo', 'user-registration' ),
255
- 'TK' => __( 'Tokelau', 'user-registration' ),
256
- 'TO' => __( 'Tonga', 'user-registration' ),
257
- 'TT' => __( 'Trinidad and Tobago', 'user-registration' ),
258
- 'TN' => __( 'Tunisia', 'user-registration' ),
259
- 'TR' => __( 'Turkey', 'user-registration' ),
260
- 'TM' => __( 'Turkmenistan', 'user-registration' ),
261
- 'TC' => __( 'Turks and Caicos Islands', 'user-registration' ),
262
- 'TV' => __( 'Tuvalu', 'user-registration' ),
263
- 'UG' => __( 'Uganda', 'user-registration' ),
264
- 'UA' => __( 'Ukraine', 'user-registration' ),
265
- 'AE' => __( 'United Arab Emirates', 'user-registration' ),
266
- 'GB' => __( 'United Kingdom (UK)', 'user-registration' ),
267
- 'US' => __( 'United States (US)', 'user-registration' ),
268
- 'UM' => __( 'United States (US) Minor Outlying Islands', 'user-registration' ),
269
- 'VI' => __( 'United States (US) Virgin Islands', 'user-registration' ),
270
- 'UY' => __( 'Uruguay', 'user-registration' ),
271
- 'UZ' => __( 'Uzbekistan', 'user-registration' ),
272
- 'VU' => __( 'Vanuatu', 'user-registration' ),
273
- 'VA' => __( 'Vatican', 'user-registration' ),
274
- 'VE' => __( 'Venezuela', 'user-registration' ),
275
- 'VN' => __( 'Vietnam', 'user-registration' ),
276
- 'WF' => __( 'Wallis and Futuna', 'user-registration' ),
277
- 'EH' => __( 'Western Sahara', 'user-registration' ),
278
- 'WS' => __( 'Samoa', 'user-registration' ),
279
- 'YE' => __( 'Yemen', 'user-registration' ),
280
- 'ZM' => __( 'Zambia', 'user-registration' ),
281
- 'ZW' => __( 'Zimbabwe', 'user-registration' ),
282
- ) );
 
 
 
283
  }
284
 
285
  public function __construct() {
286
 
287
- $this->id = 'user_registration_country';
288
- $this->form_id = 1;
289
  $this->registered_fields_config = array(
290
- 'label' => __( 'Country','user-registration' ),
291
- 'icon' => 'dashicons dashicons-admin-site',
292
  );
293
 
294
  $this->field_defaults = array(
295
- 'default_label' => __( 'Country','user-registration' ),
296
  'default_field_name' => 'country_' . ur_get_random_number(),
297
  );
298
  }
@@ -304,14 +307,17 @@ class UR_Form_Field_Country extends UR_Form_Field {
304
 
305
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
306
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
307
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
308
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
309
- $value = isset( $form_data->value ) ? $form_data->value : '';
310
 
311
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
312
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
313
- return __( $field_label . ' is required.', 'user-registration' );
314
- });
 
 
 
315
  }
316
  }
317
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function get_country() {
31
 
32
+ return apply_filters(
33
+ 'user_registration_countries_list',
34
+ array(
35
+ 'AF' => __( 'Afghanistan', 'user-registration' ),
36
+ 'AX' => __( '&#197;land Islands', 'user-registration' ),
37
+ 'AL' => __( 'Albania', 'user-registration' ),
38
+ 'DZ' => __( 'Algeria', 'user-registration' ),
39
+ 'AS' => __( 'American Samoa', 'user-registration' ),
40
+ 'AD' => __( 'Andorra', 'user-registration' ),
41
+ 'AO' => __( 'Angola', 'user-registration' ),
42
+ 'AI' => __( 'Anguilla', 'user-registration' ),
43
+ 'AQ' => __( 'Antarctica', 'user-registration' ),
44
+ 'AG' => __( 'Antigua and Barbuda', 'user-registration' ),
45
+ 'AR' => __( 'Argentina', 'user-registration' ),
46
+ 'AM' => __( 'Armenia', 'user-registration' ),
47
+ 'AW' => __( 'Aruba', 'user-registration' ),
48
+ 'AU' => __( 'Australia', 'user-registration' ),
49
+ 'AT' => __( 'Austria', 'user-registration' ),
50
+ 'AZ' => __( 'Azerbaijan', 'user-registration' ),
51
+ 'BS' => __( 'Bahamas', 'user-registration' ),
52
+ 'BH' => __( 'Bahrain', 'user-registration' ),
53
+ 'BD' => __( 'Bangladesh', 'user-registration' ),
54
+ 'BB' => __( 'Barbados', 'user-registration' ),
55
+ 'BY' => __( 'Belarus', 'user-registration' ),
56
+ 'BE' => __( 'Belgium', 'user-registration' ),
57
+ 'PW' => __( 'Belau', 'user-registration' ),
58
+ 'BZ' => __( 'Belize', 'user-registration' ),
59
+ 'BJ' => __( 'Benin', 'user-registration' ),
60
+ 'BM' => __( 'Bermuda', 'user-registration' ),
61
+ 'BT' => __( 'Bhutan', 'user-registration' ),
62
+ 'BO' => __( 'Bolivia', 'user-registration' ),
63
+ 'BQ' => __( 'Bonaire, Saint Eustatius and Saba', 'user-registration' ),
64
+ 'BA' => __( 'Bosnia and Herzegovina', 'user-registration' ),
65
+ 'BW' => __( 'Botswana', 'user-registration' ),
66
+ 'BV' => __( 'Bouvet Island', 'user-registration' ),
67
+ 'BR' => __( 'Brazil', 'user-registration' ),
68
+ 'IO' => __( 'British Indian Ocean Territory', 'user-registration' ),
69
+ 'VG' => __( 'British Virgin Islands', 'user-registration' ),
70
+ 'BN' => __( 'Brunei', 'user-registration' ),
71
+ 'BG' => __( 'Bulgaria', 'user-registration' ),
72
+ 'BF' => __( 'Burkina Faso', 'user-registration' ),
73
+ 'BI' => __( 'Burundi', 'user-registration' ),
74
+ 'KH' => __( 'Cambodia', 'user-registration' ),
75
+ 'CM' => __( 'Cameroon', 'user-registration' ),
76
+ 'CA' => __( 'Canada', 'user-registration' ),
77
+ 'CV' => __( 'Cape Verde', 'user-registration' ),
78
+ 'KY' => __( 'Cayman Islands', 'user-registration' ),
79
+ 'CF' => __( 'Central African Republic', 'user-registration' ),
80
+ 'TD' => __( 'Chad', 'user-registration' ),
81
+ 'CL' => __( 'Chile', 'user-registration' ),
82
+ 'CN' => __( 'China', 'user-registration' ),
83
+ 'CX' => __( 'Christmas Island', 'user-registration' ),
84
+ 'CC' => __( 'Cocos (Keeling) Islands', 'user-registration' ),
85
+ 'CO' => __( 'Colombia', 'user-registration' ),
86
+ 'KM' => __( 'Comoros', 'user-registration' ),
87
+ 'CG' => __( 'Congo (Brazzaville)', 'user-registration' ),
88
+ 'CD' => __( 'Congo (Kinshasa)', 'user-registration' ),
89
+ 'CK' => __( 'Cook Islands', 'user-registration' ),
90
+ 'CR' => __( 'Costa Rica', 'user-registration' ),
91
+ 'HR' => __( 'Croatia', 'user-registration' ),
92
+ 'CU' => __( 'Cuba', 'user-registration' ),
93
+ 'CW' => __( 'Cura&ccedil;ao', 'user-registration' ),
94
+ 'CY' => __( 'Cyprus', 'user-registration' ),
95
+ 'CZ' => __( 'Czech Republic', 'user-registration' ),
96
+ 'DK' => __( 'Denmark', 'user-registration' ),
97
+ 'DJ' => __( 'Djibouti', 'user-registration' ),
98
+ 'DM' => __( 'Dominica', 'user-registration' ),
99
+ 'DO' => __( 'Dominican Republic', 'user-registration' ),
100
+ 'EC' => __( 'Ecuador', 'user-registration' ),
101
+ 'EG' => __( 'Egypt', 'user-registration' ),
102
+ 'SV' => __( 'El Salvador', 'user-registration' ),
103
+ 'GQ' => __( 'Equatorial Guinea', 'user-registration' ),
104
+ 'ER' => __( 'Eritrea', 'user-registration' ),
105
+ 'EE' => __( 'Estonia', 'user-registration' ),
106
+ 'ET' => __( 'Ethiopia', 'user-registration' ),
107
+ 'FK' => __( 'Falkland Islands', 'user-registration' ),
108
+ 'FO' => __( 'Faroe Islands', 'user-registration' ),
109
+ 'FJ' => __( 'Fiji', 'user-registration' ),
110
+ 'FI' => __( 'Finland', 'user-registration' ),
111
+ 'FR' => __( 'France', 'user-registration' ),
112
+ 'GF' => __( 'French Guiana', 'user-registration' ),
113
+ 'PF' => __( 'French Polynesia', 'user-registration' ),
114
+ 'TF' => __( 'French Southern Territories', 'user-registration' ),
115
+ 'GA' => __( 'Gabon', 'user-registration' ),
116
+ 'GM' => __( 'Gambia', 'user-registration' ),
117
+ 'GE' => __( 'Georgia', 'user-registration' ),
118
+ 'DE' => __( 'Germany', 'user-registration' ),
119
+ 'GH' => __( 'Ghana', 'user-registration' ),
120
+ 'GI' => __( 'Gibraltar', 'user-registration' ),
121
+ 'GR' => __( 'Greece', 'user-registration' ),
122
+ 'GL' => __( 'Greenland', 'user-registration' ),
123
+ 'GD' => __( 'Grenada', 'user-registration' ),
124
+ 'GP' => __( 'Guadeloupe', 'user-registration' ),
125
+ 'GU' => __( 'Guam', 'user-registration' ),
126
+ 'GT' => __( 'Guatemala', 'user-registration' ),
127
+ 'GG' => __( 'Guernsey', 'user-registration' ),
128
+ 'GN' => __( 'Guinea', 'user-registration' ),
129
+ 'GW' => __( 'Guinea-Bissau', 'user-registration' ),
130
+ 'GY' => __( 'Guyana', 'user-registration' ),
131
+ 'HT' => __( 'Haiti', 'user-registration' ),
132
+ 'HM' => __( 'Heard Island and McDonald Islands', 'user-registration' ),
133
+ 'HN' => __( 'Honduras', 'user-registration' ),
134
+ 'HK' => __( 'Hong Kong', 'user-registration' ),
135
+ 'HU' => __( 'Hungary', 'user-registration' ),
136
+ 'IS' => __( 'Iceland', 'user-registration' ),
137
+ 'IN' => __( 'India', 'user-registration' ),
138
+ 'ID' => __( 'Indonesia', 'user-registration' ),
139
+ 'IR' => __( 'Iran', 'user-registration' ),
140
+ 'IQ' => __( 'Iraq', 'user-registration' ),
141
+ 'IE' => __( 'Ireland', 'user-registration' ),
142
+ 'IM' => __( 'Isle of Man', 'user-registration' ),
143
+ 'IL' => __( 'Israel', 'user-registration' ),
144
+ 'IT' => __( 'Italy', 'user-registration' ),
145
+ 'CI' => __( 'Ivory Coast', 'user-registration' ),
146
+ 'JM' => __( 'Jamaica', 'user-registration' ),
147
+ 'JP' => __( 'Japan', 'user-registration' ),
148
+ 'JE' => __( 'Jersey', 'user-registration' ),
149
+ 'JO' => __( 'Jordan', 'user-registration' ),
150
+ 'KZ' => __( 'Kazakhstan', 'user-registration' ),
151
+ 'KE' => __( 'Kenya', 'user-registration' ),
152
+ 'KI' => __( 'Kiribati', 'user-registration' ),
153
+ 'KW' => __( 'Kuwait', 'user-registration' ),
154
+ 'KG' => __( 'Kyrgyzstan', 'user-registration' ),
155
+ 'LA' => __( 'Laos', 'user-registration' ),
156
+ 'LV' => __( 'Latvia', 'user-registration' ),
157
+ 'LB' => __( 'Lebanon', 'user-registration' ),
158
+ 'LS' => __( 'Lesotho', 'user-registration' ),
159
+ 'LR' => __( 'Liberia', 'user-registration' ),
160
+ 'LY' => __( 'Libya', 'user-registration' ),
161
+ 'LI' => __( 'Liechtenstein', 'user-registration' ),
162
+ 'LT' => __( 'Lithuania', 'user-registration' ),
163
+ 'LU' => __( 'Luxembourg', 'user-registration' ),
164
+ 'MO' => __( 'Macao S.A.R., China', 'user-registration' ),
165
+ 'MK' => __( 'Macedonia', 'user-registration' ),
166
+ 'MG' => __( 'Madagascar', 'user-registration' ),
167
+ 'MW' => __( 'Malawi', 'user-registration' ),
168
+ 'MY' => __( 'Malaysia', 'user-registration' ),
169
+ 'MV' => __( 'Maldives', 'user-registration' ),
170
+ 'ML' => __( 'Mali', 'user-registration' ),
171
+ 'MT' => __( 'Malta', 'user-registration' ),
172
+ 'MH' => __( 'Marshall Islands', 'user-registration' ),
173
+ 'MQ' => __( 'Martinique', 'user-registration' ),
174
+ 'MR' => __( 'Mauritania', 'user-registration' ),
175
+ 'MU' => __( 'Mauritius', 'user-registration' ),
176
+ 'YT' => __( 'Mayotte', 'user-registration' ),
177
+ 'MX' => __( 'Mexico', 'user-registration' ),
178
+ 'FM' => __( 'Micronesia', 'user-registration' ),
179
+ 'MD' => __( 'Moldova', 'user-registration' ),
180
+ 'MC' => __( 'Monaco', 'user-registration' ),
181
+ 'MN' => __( 'Mongolia', 'user-registration' ),
182
+ 'ME' => __( 'Montenegro', 'user-registration' ),
183
+ 'MS' => __( 'Montserrat', 'user-registration' ),
184
+ 'MA' => __( 'Morocco', 'user-registration' ),
185
+ 'MZ' => __( 'Mozambique', 'user-registration' ),
186
+ 'MM' => __( 'Myanmar', 'user-registration' ),
187
+ 'NA' => __( 'Namibia', 'user-registration' ),
188
+ 'NR' => __( 'Nauru', 'user-registration' ),
189
+ 'NP' => __( 'Nepal', 'user-registration' ),
190
+ 'NL' => __( 'Netherlands', 'user-registration' ),
191
+ 'NC' => __( 'New Caledonia', 'user-registration' ),
192
+ 'NZ' => __( 'New Zealand', 'user-registration' ),
193
+ 'NI' => __( 'Nicaragua', 'user-registration' ),
194
+ 'NE' => __( 'Niger', 'user-registration' ),
195
+ 'NG' => __( 'Nigeria', 'user-registration' ),
196
+ 'NU' => __( 'Niue', 'user-registration' ),
197
+ 'NF' => __( 'Norfolk Island', 'user-registration' ),
198
+ 'MP' => __( 'Northern Mariana Islands', 'user-registration' ),
199
+ 'KP' => __( 'North Korea', 'user-registration' ),
200
+ 'NO' => __( 'Norway', 'user-registration' ),
201
+ 'OM' => __( 'Oman', 'user-registration' ),
202
+ 'PK' => __( 'Pakistan', 'user-registration' ),
203
+ 'PS' => __( 'Palestinian Territory', 'user-registration' ),
204
+ 'PA' => __( 'Panama', 'user-registration' ),
205
+ 'PG' => __( 'Papua New Guinea', 'user-registration' ),
206
+ 'PY' => __( 'Paraguay', 'user-registration' ),
207
+ 'PE' => __( 'Peru', 'user-registration' ),
208
+ 'PH' => __( 'Philippines', 'user-registration' ),
209
+ 'PN' => __( 'Pitcairn', 'user-registration' ),
210
+ 'PL' => __( 'Poland', 'user-registration' ),
211
+ 'PT' => __( 'Portugal', 'user-registration' ),
212
+ 'PR' => __( 'Puerto Rico', 'user-registration' ),
213
+ 'QA' => __( 'Qatar', 'user-registration' ),
214
+ 'RE' => __( 'Reunion', 'user-registration' ),
215
+ 'RO' => __( 'Romania', 'user-registration' ),
216
+ 'RU' => __( 'Russia', 'user-registration' ),
217
+ 'RW' => __( 'Rwanda', 'user-registration' ),
218
+ 'BL' => __( 'Saint Barth&eacute;lemy', 'user-registration' ),
219
+ 'SH' => __( 'Saint Helena', 'user-registration' ),
220
+ 'KN' => __( 'Saint Kitts and Nevis', 'user-registration' ),
221
+ 'LC' => __( 'Saint Lucia', 'user-registration' ),
222
+ 'MF' => __( 'Saint Martin (French part)', 'user-registration' ),
223
+ 'SX' => __( 'Saint Martin (Dutch part)', 'user-registration' ),
224
+ 'PM' => __( 'Saint Pierre and Miquelon', 'user-registration' ),
225
+ 'VC' => __( 'Saint Vincent and the Grenadines', 'user-registration' ),
226
+ 'SM' => __( 'San Marino', 'user-registration' ),
227
+ 'ST' => __( 'S&atilde;o Tom&eacute; and Pr&iacute;ncipe', 'user-registration' ),
228
+ 'SA' => __( 'Saudi Arabia', 'user-registration' ),
229
+ 'SN' => __( 'Senegal', 'user-registration' ),
230
+ 'RS' => __( 'Serbia', 'user-registration' ),
231
+ 'SC' => __( 'Seychelles', 'user-registration' ),
232
+ 'SL' => __( 'Sierra Leone', 'user-registration' ),
233
+ 'SG' => __( 'Singapore', 'user-registration' ),
234
+ 'SK' => __( 'Slovakia', 'user-registration' ),
235
+ 'SI' => __( 'Slovenia', 'user-registration' ),
236
+ 'SB' => __( 'Solomon Islands', 'user-registration' ),
237
+ 'SO' => __( 'Somalia', 'user-registration' ),
238
+ 'ZA' => __( 'South Africa', 'user-registration' ),
239
+ 'GS' => __( 'South Georgia/Sandwich Islands', 'user-registration' ),
240
+ 'KR' => __( 'South Korea', 'user-registration' ),
241
+ 'SS' => __( 'South Sudan', 'user-registration' ),
242
+ 'ES' => __( 'Spain', 'user-registration' ),
243
+ 'LK' => __( 'Sri Lanka', 'user-registration' ),
244
+ 'SD' => __( 'Sudan', 'user-registration' ),
245
+ 'SR' => __( 'Suriname', 'user-registration' ),
246
+ 'SJ' => __( 'Svalbard and Jan Mayen', 'user-registration' ),
247
+ 'SZ' => __( 'Swaziland', 'user-registration' ),
248
+ 'SE' => __( 'Sweden', 'user-registration' ),
249
+ 'CH' => __( 'Switzerland', 'user-registration' ),
250
+ 'SY' => __( 'Syria', 'user-registration' ),
251
+ 'TW' => __( 'Taiwan', 'user-registration' ),
252
+ 'TJ' => __( 'Tajikistan', 'user-registration' ),
253
+ 'TZ' => __( 'Tanzania', 'user-registration' ),
254
+ 'TH' => __( 'Thailand', 'user-registration' ),
255
+ 'TL' => __( 'Timor-Leste', 'user-registration' ),
256
+ 'TG' => __( 'Togo', 'user-registration' ),
257
+ 'TK' => __( 'Tokelau', 'user-registration' ),
258
+ 'TO' => __( 'Tonga', 'user-registration' ),
259
+ 'TT' => __( 'Trinidad and Tobago', 'user-registration' ),
260
+ 'TN' => __( 'Tunisia', 'user-registration' ),
261
+ 'TR' => __( 'Turkey', 'user-registration' ),
262
+ 'TM' => __( 'Turkmenistan', 'user-registration' ),
263
+ 'TC' => __( 'Turks and Caicos Islands', 'user-registration' ),
264
+ 'TV' => __( 'Tuvalu', 'user-registration' ),
265
+ 'UG' => __( 'Uganda', 'user-registration' ),
266
+ 'UA' => __( 'Ukraine', 'user-registration' ),
267
+ 'AE' => __( 'United Arab Emirates', 'user-registration' ),
268
+ 'GB' => __( 'United Kingdom (UK)', 'user-registration' ),
269
+ 'US' => __( 'United States (US)', 'user-registration' ),
270
+ 'UM' => __( 'United States (US) Minor Outlying Islands', 'user-registration' ),
271
+ 'VI' => __( 'United States (US) Virgin Islands', 'user-registration' ),
272
+ 'UY' => __( 'Uruguay', 'user-registration' ),
273
+ 'UZ' => __( 'Uzbekistan', 'user-registration' ),
274
+ 'VU' => __( 'Vanuatu', 'user-registration' ),
275
+ 'VA' => __( 'Vatican', 'user-registration' ),
276
+ 'VE' => __( 'Venezuela', 'user-registration' ),
277
+ 'VN' => __( 'Vietnam', 'user-registration' ),
278
+ 'WF' => __( 'Wallis and Futuna', 'user-registration' ),
279
+ 'EH' => __( 'Western Sahara', 'user-registration' ),
280
+ 'WS' => __( 'Samoa', 'user-registration' ),
281
+ 'YE' => __( 'Yemen', 'user-registration' ),
282
+ 'ZM' => __( 'Zambia', 'user-registration' ),
283
+ 'ZW' => __( 'Zimbabwe', 'user-registration' ),
284
+ )
285
+ );
286
  }
287
 
288
  public function __construct() {
289
 
290
+ $this->id = 'user_registration_country';
291
+ $this->form_id = 1;
292
  $this->registered_fields_config = array(
293
+ 'label' => __( 'Country', 'user-registration' ),
294
+ 'icon' => 'dashicons dashicons-admin-site',
295
  );
296
 
297
  $this->field_defaults = array(
298
+ 'default_label' => __( 'Country', 'user-registration' ),
299
  'default_field_name' => 'country_' . ur_get_random_number(),
300
  );
301
  }
307
 
308
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
309
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
310
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
311
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
312
+ $value = isset( $form_data->value ) ? $form_data->value : '';
313
 
314
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
315
+ add_filter(
316
+ $filter_hook,
317
+ function ( $msg ) use ( $field_label ) {
318
+ return __( $field_label . ' is required.', 'user-registration' );
319
+ }
320
+ );
321
  }
322
  }
323
  }
includes/form/class-ur-form-field-date.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  /**
@@ -31,15 +31,15 @@ class UR_Form_Field_Date extends UR_Form_Field {
31
 
32
  public function __construct() {
33
 
34
- $this->id = 'user_registration_date';
35
- $this->form_id = 1;
36
  $this->registered_fields_config = array(
37
  'label' => __( 'Date', 'user-registration' ),
38
- 'icon' => 'dashicons dashicons-calendar',
39
  );
40
 
41
  $this->field_defaults = array(
42
- 'default_label' => __( 'Date', 'user-registration' ),
43
  'default_field_name' => 'date_box_' . ur_get_random_number(),
44
  );
45
  }
@@ -52,32 +52,39 @@ class UR_Form_Field_Date extends UR_Form_Field {
52
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
53
 
54
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
55
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
56
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
57
- $value = isset( $form_data->value ) ? $form_data->value : '';
58
 
59
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
60
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
61
- return __( $field_label . ' is required.', 'user-registration' );
62
- });
 
 
 
63
  }
64
 
65
  if ( ! $this->is_valid_date( $value ) && ! empty( $value ) ) {
66
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
67
- return __( $field_label . ' must be valid date.', 'user-registration' );
68
- });
 
 
 
69
  }
70
  }
71
 
72
  /**
73
  * Checks for valid date
 
74
  * @param string $date_string
75
  */
76
  private function is_valid_date( $date_string ) {
77
 
78
  $date = date_parse( $date_string );
79
 
80
- if ( $date["error_count"] == 0 && checkdate( $date["month"], $date["day"], $date["year"] ) ) {
81
  return true;
82
  }
83
 
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  /**
31
 
32
  public function __construct() {
33
 
34
+ $this->id = 'user_registration_date';
35
+ $this->form_id = 1;
36
  $this->registered_fields_config = array(
37
  'label' => __( 'Date', 'user-registration' ),
38
+ 'icon' => 'dashicons dashicons-calendar',
39
  );
40
 
41
  $this->field_defaults = array(
42
+ 'default_label' => __( 'Date', 'user-registration' ),
43
  'default_field_name' => 'date_box_' . ur_get_random_number(),
44
  );
45
  }
52
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
53
 
54
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
55
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
56
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
57
+ $value = isset( $form_data->value ) ? $form_data->value : '';
58
 
59
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
60
+ add_filter(
61
+ $filter_hook,
62
+ function ( $msg ) use ( $field_label ) {
63
+ return __( $field_label . ' is required.', 'user-registration' );
64
+ }
65
+ );
66
  }
67
 
68
  if ( ! $this->is_valid_date( $value ) && ! empty( $value ) ) {
69
+ add_filter(
70
+ $filter_hook,
71
+ function ( $msg ) use ( $field_label ) {
72
+ return __( $field_label . ' must be valid date.', 'user-registration' );
73
+ }
74
+ );
75
  }
76
  }
77
 
78
  /**
79
  * Checks for valid date
80
+ *
81
  * @param string $date_string
82
  */
83
  private function is_valid_date( $date_string ) {
84
 
85
  $date = date_parse( $date_string );
86
 
87
+ if ( $date['error_count'] == 0 && checkdate( $date['month'], $date['day'], $date['year'] ) ) {
88
  return true;
89
  }
90
 
includes/form/class-ur-form-field-description.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -30,15 +30,15 @@ class UR_Form_Field_Description extends UR_Form_Field {
30
 
31
  public function __construct() {
32
 
33
- $this->id = 'user_registration_description';
34
- $this->form_id = 1;
35
  $this->registered_fields_config = array(
36
- 'label' => __( 'User Bio','user-registration' ),
37
- 'icon' => 'dashicons dashicons-id-alt',
38
  );
39
 
40
  $this->field_defaults = array(
41
- 'default_label' => __( 'User Bio','user-registration' ),
42
  'default_field_name' => 'description',
43
  );
44
  }
@@ -50,14 +50,17 @@ class UR_Form_Field_Description extends UR_Form_Field {
50
 
51
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
52
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
53
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
54
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
55
- $value = isset( $form_data->value ) ? $form_data->value : '';
56
 
57
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
58
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
59
- return __( $field_label . ' is required.', 'user-registration' );
60
- });
 
 
 
61
  }
62
  }
63
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
30
 
31
  public function __construct() {
32
 
33
+ $this->id = 'user_registration_description';
34
+ $this->form_id = 1;
35
  $this->registered_fields_config = array(
36
+ 'label' => __( 'User Bio', 'user-registration' ),
37
+ 'icon' => 'dashicons dashicons-id-alt',
38
  );
39
 
40
  $this->field_defaults = array(
41
+ 'default_label' => __( 'User Bio', 'user-registration' ),
42
  'default_field_name' => 'description',
43
  );
44
  }
50
 
51
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
52
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
53
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
54
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
55
+ $value = isset( $form_data->value ) ? $form_data->value : '';
56
 
57
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
58
+ add_filter(
59
+ $filter_hook,
60
+ function ( $msg ) use ( $field_label ) {
61
+ return __( $field_label . ' is required.', 'user-registration' );
62
+ }
63
+ );
64
  }
65
  }
66
  }
includes/form/class-ur-form-field-display-name.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_Display_Name extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_display_name';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
- 'label' => __( 'Display Name','user-registration' ),
36
- 'icon' => 'dashicons dashicons-id',
37
  );
38
 
39
- $this->field_defaults = array(
40
- 'default_label' => __( 'Display Name','user-registration' ),
41
  'default_field_name' => 'display_name',
42
  );
43
  }
@@ -49,14 +49,17 @@ class UR_Form_Field_Display_Name extends UR_Form_Field {
49
 
50
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
51
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
52
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
53
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
54
- $value = isset( $form_data->value ) ? $form_data->value : '';
55
 
56
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
57
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
58
- return __( $field_label . ' is required.', 'user-registration' );
59
- });
 
 
 
60
  }
61
  }
62
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_display_name';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
+ 'label' => __( 'Display Name', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-id',
37
  );
38
 
39
+ $this->field_defaults = array(
40
+ 'default_label' => __( 'Display Name', 'user-registration' ),
41
  'default_field_name' => 'display_name',
42
  );
43
  }
49
 
50
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
51
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
52
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
53
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
54
+ $value = isset( $form_data->value ) ? $form_data->value : '';
55
 
56
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
57
+ add_filter(
58
+ $filter_hook,
59
+ function ( $msg ) use ( $field_label ) {
60
+ return __( $field_label . ' is required.', 'user-registration' );
61
+ }
62
+ );
63
  }
64
  }
65
  }
includes/form/class-ur-form-field-email.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_Email extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_email';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
- 'label' => __( 'Secondary Email ','user-registration' ),
36
- 'icon' => 'dashicons dashicons-email-alt',
37
  );
38
 
39
  $this->field_defaults = array(
40
- 'default_label' => __( 'Secondary Email','user-registration' ),
41
  'default_field_name' => 'email_' . ur_get_random_number(),
42
  );
43
  }
@@ -49,20 +49,26 @@ class UR_Form_Field_Email extends UR_Form_Field {
49
 
50
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
51
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
52
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
53
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
54
- $value = isset( $form_data->value ) ? $form_data->value : '';
55
 
56
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
57
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
58
- return __( $field_label . ' is required.', 'user-registration' );
59
- });
 
 
 
60
  }
61
 
62
- if( ! is_email( $value ) ) {
63
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
64
- return __( $field_label . ' must be a valid email address.', 'user-registration' );
65
- });
 
 
 
66
  }
67
  }
68
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_email';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
+ 'label' => __( 'Secondary Email ', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-email-alt',
37
  );
38
 
39
  $this->field_defaults = array(
40
+ 'default_label' => __( 'Secondary Email', 'user-registration' ),
41
  'default_field_name' => 'email_' . ur_get_random_number(),
42
  );
43
  }
49
 
50
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
51
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
52
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
53
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
54
+ $value = isset( $form_data->value ) ? $form_data->value : '';
55
 
56
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
57
+ add_filter(
58
+ $filter_hook,
59
+ function ( $msg ) use ( $field_label ) {
60
+ return __( $field_label . ' is required.', 'user-registration' );
61
+ }
62
+ );
63
  }
64
 
65
+ if ( ! is_email( $value ) ) {
66
+ add_filter(
67
+ $filter_hook,
68
+ function ( $msg ) use ( $field_label ) {
69
+ return __( $field_label . ' must be a valid email address.', 'user-registration' );
70
+ }
71
+ );
72
  }
73
  }
74
  }
includes/form/class-ur-form-field-first-name.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_First_Name extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_first_name';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
  'label' => __( 'First Name', 'user-registration' ),
36
- 'icon' => 'dashicons dashicons-id',
37
  );
38
 
39
- $this->field_defaults = array(
40
- 'default_label' => __( 'First Name','user-registration' ),
41
  'default_field_name' => 'first_name',
42
  );
43
  }
@@ -49,14 +49,17 @@ class UR_Form_Field_First_Name extends UR_Form_Field {
49
 
50
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
51
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
52
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
53
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
54
- $value = isset( $form_data->value ) ? $form_data->value : '';
55
 
56
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
57
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
58
- return __( $field_label . ' is required.', 'user-registration' );
59
- });
 
 
 
60
  }
61
  }
62
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_first_name';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
  'label' => __( 'First Name', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-id',
37
  );
38
 
39
+ $this->field_defaults = array(
40
+ 'default_label' => __( 'First Name', 'user-registration' ),
41
  'default_field_name' => 'first_name',
42
  );
43
  }
49
 
50
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
51
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
52
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
53
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
54
+ $value = isset( $form_data->value ) ? $form_data->value : '';
55
 
56
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
57
+ add_filter(
58
+ $filter_hook,
59
+ function ( $msg ) use ( $field_label ) {
60
+ return __( $field_label . ' is required.', 'user-registration' );
61
+ }
62
+ );
63
  }
64
  }
65
  }
includes/form/class-ur-form-field-last-name.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_Last_Name extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_last_name';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
- 'label' => __( 'Last Name ','user-registration' ),
36
- 'icon' => 'dashicons dashicons-id',
37
  );
38
 
39
  $this->field_defaults = array(
40
- 'default_label' => __( 'Last Name','user-registration' ),
41
  'default_field_name' => 'last_name',
42
  );
43
  }
@@ -49,14 +49,17 @@ class UR_Form_Field_Last_Name extends UR_Form_Field {
49
 
50
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
51
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
52
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
53
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
54
- $value = isset( $form_data->value ) ? $form_data->value : '';
55
 
56
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
57
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
58
- return __( $field_label . ' is required.', 'user-registration' );
59
- });
 
 
 
60
  }
61
  }
62
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_last_name';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
+ 'label' => __( 'Last Name ', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-id',
37
  );
38
 
39
  $this->field_defaults = array(
40
+ 'default_label' => __( 'Last Name', 'user-registration' ),
41
  'default_field_name' => 'last_name',
42
  );
43
  }
49
 
50
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
51
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
52
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
53
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
54
+ $value = isset( $form_data->value ) ? $form_data->value : '';
55
 
56
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
57
+ add_filter(
58
+ $filter_hook,
59
+ function ( $msg ) use ( $field_label ) {
60
+ return __( $field_label . ' is required.', 'user-registration' );
61
+ }
62
+ );
63
  }
64
  }
65
  }
includes/form/class-ur-form-field-nickname.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_Nickname extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_nickname';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
- 'label' => __( 'Nickname','user-registration' ),
36
- 'icon' => 'dashicons dashicons-id',
37
  );
38
 
39
- $this->field_defaults = array(
40
- 'default_label' => __( 'Nickname','user-registration' ),
41
  'default_field_name' => 'description',
42
  );
43
  }
@@ -51,14 +51,17 @@ class UR_Form_Field_Nickname extends UR_Form_Field {
51
 
52
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
53
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
54
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
55
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
56
- $value = isset( $form_data->value ) ? $form_data->value : '';
57
 
58
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
59
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
60
- return __( $field_label . ' is required.', 'user-registration' );
61
- });
 
 
 
62
  }
63
  }
64
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_nickname';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
+ 'label' => __( 'Nickname', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-id',
37
  );
38
 
39
+ $this->field_defaults = array(
40
+ 'default_label' => __( 'Nickname', 'user-registration' ),
41
  'default_field_name' => 'description',
42
  );
43
  }
51
 
52
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
53
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
54
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
55
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
56
+ $value = isset( $form_data->value ) ? $form_data->value : '';
57
 
58
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
59
+ add_filter(
60
+ $filter_hook,
61
+ function ( $msg ) use ( $field_label ) {
62
+ return __( $field_label . ' is required.', 'user-registration' );
63
+ }
64
+ );
65
  }
66
  }
67
  }
includes/form/class-ur-form-field-number.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  /**
@@ -31,15 +31,15 @@ class UR_Form_Field_Number extends UR_Form_Field {
31
 
32
  public function __construct() {
33
 
34
- $this->id = 'user_registration_number';
35
- $this->form_id = 1;
36
  $this->registered_fields_config = array(
37
  'label' => __( 'Number', 'user-registration' ),
38
- 'icon' => 'dashicons dashicons-image-filter',
39
  );
40
 
41
  $this->field_defaults = array(
42
- 'default_label' => __( 'Number', 'user-registration' ),
43
  'default_field_name' => 'number_box_' . ur_get_random_number(),
44
  );
45
  }
@@ -51,20 +51,26 @@ class UR_Form_Field_Number extends UR_Form_Field {
51
 
52
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
53
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
54
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
55
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
56
- $value = isset( $form_data->value ) ? $form_data->value : '';
57
 
58
- if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
59
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
60
- return __( $field_label . ' is required.', 'user-registration' );
61
- });
 
 
 
62
  }
63
 
64
  if ( ! is_numeric( $value ) ) {
65
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
66
- return __( $field_label . ' must be numeric value.', 'user-registration' );
67
- });
 
 
 
68
  }
69
  }
70
  }
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  /**
31
 
32
  public function __construct() {
33
 
34
+ $this->id = 'user_registration_number';
35
+ $this->form_id = 1;
36
  $this->registered_fields_config = array(
37
  'label' => __( 'Number', 'user-registration' ),
38
+ 'icon' => 'dashicons dashicons-image-filter',
39
  );
40
 
41
  $this->field_defaults = array(
42
+ 'default_label' => __( 'Number', 'user-registration' ),
43
  'default_field_name' => 'number_box_' . ur_get_random_number(),
44
  );
45
  }
51
 
52
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
53
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
54
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
55
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
56
+ $value = isset( $form_data->value ) ? $form_data->value : '';
57
 
58
+ if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
59
+ add_filter(
60
+ $filter_hook,
61
+ function ( $msg ) use ( $field_label ) {
62
+ return __( $field_label . ' is required.', 'user-registration' );
63
+ }
64
+ );
65
  }
66
 
67
  if ( ! is_numeric( $value ) ) {
68
+ add_filter(
69
+ $filter_hook,
70
+ function ( $msg ) use ( $field_label ) {
71
+ return __( $field_label . ' must be numeric value.', 'user-registration' );
72
+ }
73
+ );
74
  }
75
  }
76
  }
includes/form/class-ur-form-field-password.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_Password extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_password';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
- 'label' => __( 'Password Field','user-registration' ),
36
- 'icon' => 'dashicons dashicons-lock',
37
- );
38
 
39
  $this->field_defaults = array(
40
- 'default_label' => __( 'Password Field','user-registration' ),
41
  'default_field_name' => 'password_' . ur_get_random_number(),
42
  );
43
  }
@@ -51,14 +51,17 @@ class UR_Form_Field_Password extends UR_Form_Field {
51
 
52
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
53
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
54
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
55
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
56
- $value = isset( $form_data->value ) ? $form_data->value : '';
57
 
58
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
59
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
60
- return __( $field_label . ' is required.', 'user-registration' );
61
- });
 
 
 
62
  }
63
  }
64
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_password';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
+ 'label' => __( 'Password Field', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-lock',
37
+ );
38
 
39
  $this->field_defaults = array(
40
+ 'default_label' => __( 'Password Field', 'user-registration' ),
41
  'default_field_name' => 'password_' . ur_get_random_number(),
42
  );
43
  }
51
 
52
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
53
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
54
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
55
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
56
+ $value = isset( $form_data->value ) ? $form_data->value : '';
57
 
58
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
59
+ add_filter(
60
+ $filter_hook,
61
+ function ( $msg ) use ( $field_label ) {
62
+ return __( $field_label . ' is required.', 'user-registration' );
63
+ }
64
+ );
65
  }
66
  }
67
  }
includes/form/class-ur-form-field-privacy-policy.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_Privacy_Policy extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_privacy_policy';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
  'label' => __( 'Privacy Policy', 'user-registration' ),
36
- 'icon' => 'dashicons dashicons-yes',
37
  );
38
 
39
  $this->field_defaults = array(
40
- 'default_label' => __( 'Privacy Policy', 'user-registration' ),
41
  'default_field_name' => 'privacy_policy_' . ur_get_random_number(),
42
  );
43
  }
@@ -59,14 +59,17 @@ class UR_Form_Field_Privacy_Policy extends UR_Form_Field {
59
  */
60
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
61
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
62
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
63
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
64
- $value = isset( $form_data->value ) ? $form_data->value : '';
65
 
66
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
67
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
68
- return __( $field_label . ' is required.', 'user-registration' );
69
- });
 
 
 
70
  }
71
  }
72
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_privacy_policy';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
  'label' => __( 'Privacy Policy', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-yes',
37
  );
38
 
39
  $this->field_defaults = array(
40
+ 'default_label' => __( 'Privacy Policy', 'user-registration' ),
41
  'default_field_name' => 'privacy_policy_' . ur_get_random_number(),
42
  );
43
  }
59
  */
60
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
61
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
62
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
63
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
64
+ $value = isset( $form_data->value ) ? $form_data->value : '';
65
 
66
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
67
+ add_filter(
68
+ $filter_hook,
69
+ function ( $msg ) use ( $field_label ) {
70
+ return __( $field_label . ' is required.', 'user-registration' );
71
+ }
72
+ );
73
  }
74
  }
75
  }
includes/form/class-ur-form-field-radio.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -32,15 +32,15 @@ class UR_Form_Field_Radio extends UR_Form_Field {
32
  */
33
  public function __construct() {
34
 
35
- $this->id = 'user_registration_radio';
36
- $this->form_id = 1;
37
  $this->registered_fields_config = array(
38
- 'label' => __( 'Radio','user-registration' ),
39
- 'icon' => 'dashicons dashicons-marker',
40
  );
41
 
42
  $this->field_defaults = array(
43
- 'default_label' => __( 'Radio','user-registration' ),
44
  'default_field_name' => 'radio_' . ur_get_random_number(),
45
  );
46
  }
@@ -54,14 +54,17 @@ class UR_Form_Field_Radio extends UR_Form_Field {
54
 
55
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
56
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
57
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
58
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
59
- $value = isset( $form_data->value ) ? $form_data->value : '';
60
 
61
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
62
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
63
- return __( $field_label . ' is required.', 'user-registration' );
64
- });
 
 
 
65
  }
66
  }
67
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
32
  */
33
  public function __construct() {
34
 
35
+ $this->id = 'user_registration_radio';
36
+ $this->form_id = 1;
37
  $this->registered_fields_config = array(
38
+ 'label' => __( 'Radio', 'user-registration' ),
39
+ 'icon' => 'dashicons dashicons-marker',
40
  );
41
 
42
  $this->field_defaults = array(
43
+ 'default_label' => __( 'Radio', 'user-registration' ),
44
  'default_field_name' => 'radio_' . ur_get_random_number(),
45
  );
46
  }
54
 
55
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
56
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
57
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
58
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
59
+ $value = isset( $form_data->value ) ? $form_data->value : '';
60
 
61
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
62
+ add_filter(
63
+ $filter_hook,
64
+ function ( $msg ) use ( $field_label ) {
65
+ return __( $field_label . ' is required.', 'user-registration' );
66
+ }
67
+ );
68
  }
69
  }
70
  }
includes/form/class-ur-form-field-select.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_Select extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_select';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
- 'label' => __( 'Select','user-registration' ),
36
- 'icon' => 'dashicons dashicons-image-flip-vertical',
37
  );
38
 
39
  $this->field_defaults = array(
40
- 'default_label' => __( 'Select','user-registration' ),
41
  'default_field_name' => 'select_' . ur_get_random_number(),
42
  );
43
  }
@@ -49,14 +49,17 @@ class UR_Form_Field_Select extends UR_Form_Field {
49
 
50
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
51
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
52
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
53
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
54
- $value = isset( $form_data->value ) ? $form_data->value : '';
55
 
56
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
57
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
58
- return __( $field_label . ' is required.', 'user-registration' );
59
- });
 
 
 
60
  }
61
  }
62
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_select';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
+ 'label' => __( 'Select', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-image-flip-vertical',
37
  );
38
 
39
  $this->field_defaults = array(
40
+ 'default_label' => __( 'Select', 'user-registration' ),
41
  'default_field_name' => 'select_' . ur_get_random_number(),
42
  );
43
  }
49
 
50
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
51
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
52
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
53
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
54
+ $value = isset( $form_data->value ) ? $form_data->value : '';
55
 
56
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
57
+ add_filter(
58
+ $filter_hook,
59
+ function ( $msg ) use ( $field_label ) {
60
+ return __( $field_label . ' is required.', 'user-registration' );
61
+ }
62
+ );
63
  }
64
  }
65
  }
includes/form/class-ur-form-field-text.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_Text extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_text';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
  'label' => __( 'Input Field', 'user-registration' ),
36
- 'icon' => 'dashicons dashicons-format-aside',
37
  );
38
 
39
  $this->field_defaults = array(
40
- 'default_label' => __( 'Input Field', 'user-registration' ),
41
  'default_field_name' => 'input_box_' . ur_get_random_number(),
42
  );
43
  }
@@ -51,14 +51,17 @@ class UR_Form_Field_Text extends UR_Form_Field {
51
 
52
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
53
 
54
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
55
  $field_label = isset( $form_data->label ) ? $form_data->label : '';
56
- $value = isset( $form_data->value ) ? $form_data->value : '';
57
 
58
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
59
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
60
- return __( $field_label . ' is required.', 'user-registration' );
61
- });
 
 
 
62
  }
63
  }
64
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_text';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
  'label' => __( 'Input Field', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-format-aside',
37
  );
38
 
39
  $this->field_defaults = array(
40
+ 'default_label' => __( 'Input Field', 'user-registration' ),
41
  'default_field_name' => 'input_box_' . ur_get_random_number(),
42
  );
43
  }
51
 
52
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
53
 
54
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
55
  $field_label = isset( $form_data->label ) ? $form_data->label : '';
56
+ $value = isset( $form_data->value ) ? $form_data->value : '';
57
 
58
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
59
+ add_filter(
60
+ $filter_hook,
61
+ function ( $msg ) use ( $field_label ) {
62
+ return __( $field_label . ' is required.', 'user-registration' );
63
+ }
64
+ );
65
  }
66
  }
67
  }
includes/form/class-ur-form-field-textarea.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_Textarea extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_textarea';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
- 'label' => __( 'Textarea','user-registration' ),
36
- 'icon' => 'dashicons dashicons-editor-textcolor',
37
  );
38
 
39
  $this->field_defaults = array(
40
- 'default_label' => __( 'Textarea','user-registration' ),
41
  'default_field_name' => 'textarea_' . ur_get_random_number(),
42
  );
43
  }
@@ -49,16 +49,19 @@ class UR_Form_Field_Textarea extends UR_Form_Field {
49
 
50
 
51
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
52
-
53
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
54
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
55
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
56
- $value = isset( $form_data->value ) ? $form_data->value : '';
57
 
58
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
59
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
60
- return __( $field_label . ' is required.', 'user-registration' );
61
- });
 
 
 
62
  }
63
  }
64
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_textarea';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
+ 'label' => __( 'Textarea', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-editor-textcolor',
37
  );
38
 
39
  $this->field_defaults = array(
40
+ 'default_label' => __( 'Textarea', 'user-registration' ),
41
  'default_field_name' => 'textarea_' . ur_get_random_number(),
42
  );
43
  }
49
 
50
 
51
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
52
+
53
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
54
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
55
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
56
+ $value = isset( $form_data->value ) ? $form_data->value : '';
57
 
58
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
59
+ add_filter(
60
+ $filter_hook,
61
+ function ( $msg ) use ( $field_label ) {
62
+ return __( $field_label . ' is required.', 'user-registration' );
63
+ }
64
+ );
65
  }
66
  }
67
  }
includes/form/class-ur-form-field-user-confirm-password.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_User_Confirm_Password extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_user_confirm_password';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
- 'label' => __( 'Confirm Password ','user-registration' ),
36
- 'icon' => 'dashicons dashicons-lock',
37
  );
38
 
39
- $this->field_defaults = array(
40
- 'default_label' => __( 'Confirm Password','user-registration' ),
41
  );
42
  }
43
 
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_user_confirm_password';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
+ 'label' => __( 'Confirm Password ', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-lock',
37
  );
38
 
39
+ $this->field_defaults = array(
40
+ 'default_label' => __( 'Confirm Password', 'user-registration' ),
41
  );
42
  }
43
 
includes/form/class-ur-form-field-user-email.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_User_Email extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_user_email';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
- 'label' => __( 'Email ' ,'user-registration' ),
36
- 'icon' => 'dashicons dashicons-email-alt',
37
  );
38
 
39
  $this->field_defaults = array(
40
- 'default_label' => __( 'User Email','user-registration' ),
41
  );
42
  }
43
 
@@ -49,19 +49,25 @@ class UR_Form_Field_User_Email extends UR_Form_Field {
49
 
50
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
51
 
52
- $email = isset( $form_data->value ) ? $form_data->value : '';
53
  $status = is_email( $email );
54
 
55
  if ( ! $status ) {
56
- add_filter( $filter_hook, function ( $msg ) {
57
- return __( 'Invalid email address.', 'user-registration' );
58
- });
 
 
 
59
  }
60
 
61
  if ( email_exists( $email ) ) {
62
- add_filter( $filter_hook, function ( $msg ) {
63
- return __( 'Email already exists.', 'user-registration' );
64
- });
 
 
 
65
  }
66
  }
67
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_user_email';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
+ 'label' => __( 'Email ', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-email-alt',
37
  );
38
 
39
  $this->field_defaults = array(
40
+ 'default_label' => __( 'User Email', 'user-registration' ),
41
  );
42
  }
43
 
49
 
50
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
51
 
52
+ $email = isset( $form_data->value ) ? $form_data->value : '';
53
  $status = is_email( $email );
54
 
55
  if ( ! $status ) {
56
+ add_filter(
57
+ $filter_hook,
58
+ function ( $msg ) {
59
+ return __( 'Invalid email address.', 'user-registration' );
60
+ }
61
+ );
62
  }
63
 
64
  if ( email_exists( $email ) ) {
65
+ add_filter(
66
+ $filter_hook,
67
+ function ( $msg ) {
68
+ return __( 'Email already exists.', 'user-registration' );
69
+ }
70
+ );
71
  }
72
  }
73
  }
includes/form/class-ur-form-field-user-login.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_User_Login extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_user_login';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
- 'label' => __( 'Username','user-registration' ),
36
- 'icon' => 'dashicons dashicons-id',
37
  );
38
 
39
  $this->field_defaults = array(
40
- 'default_label' => __( 'Username','user-registration' ),
41
  );
42
  }
43
 
@@ -51,17 +51,23 @@ class UR_Form_Field_User_Login extends UR_Form_Field {
51
  $username = isset( $form_data->value ) ? $form_data->value : '';
52
 
53
  if ( username_exists( $username ) ) {
54
- add_filter( $filter_hook, function ( $msg ) {
55
- return __( 'Username already exists.', 'user-registration' );
56
- } );
 
 
 
57
  }
58
 
59
  $status = validate_username( $username );
60
 
61
  if ( ! $status ) {
62
- add_filter( $filter_hook, function ( $msg ) {
63
- return __( 'Invalid username ! ', 'user-registration' );
64
- });
 
 
 
65
  }
66
  }
67
  }
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_user_login';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
+ 'label' => __( 'Username', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-id',
37
  );
38
 
39
  $this->field_defaults = array(
40
+ 'default_label' => __( 'Username', 'user-registration' ),
41
  );
42
  }
43
 
51
  $username = isset( $form_data->value ) ? $form_data->value : '';
52
 
53
  if ( username_exists( $username ) ) {
54
+ add_filter(
55
+ $filter_hook,
56
+ function ( $msg ) {
57
+ return __( 'Username already exists.', 'user-registration' );
58
+ }
59
+ );
60
  }
61
 
62
  $status = validate_username( $username );
63
 
64
  if ( ! $status ) {
65
+ add_filter(
66
+ $filter_hook,
67
+ function ( $msg ) {
68
+ return __( 'Invalid username ! ', 'user-registration' );
69
+ }
70
+ );
71
  }
72
  }
73
  }
includes/form/class-ur-form-field-user-pass.php CHANGED
@@ -8,7 +8,7 @@
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,14 +29,14 @@ class UR_Form_Field_User_Pass extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_user_pass';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
  'label' => __( 'Password ', 'user-registration' ),
36
- 'icon' => 'dashicons dashicons-lock',
37
  );
38
 
39
- $this->field_defaults = array(
40
  'default_label' => __( 'User Password', 'user-registration' ),
41
  );
42
  }
@@ -51,9 +51,12 @@ class UR_Form_Field_User_Pass extends UR_Form_Field {
51
  $password = isset( $form_data->value ) ? $form_data->value : '';
52
 
53
  if ( empty( $password ) ) {
54
- add_filter( $filter_hook, function ( $msg ) {
55
- return __( 'Empty password.', 'user-registration' );
56
- });
 
 
 
57
  }
58
  }
59
 
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_user_pass';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
  'label' => __( 'Password ', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-lock',
37
  );
38
 
39
+ $this->field_defaults = array(
40
  'default_label' => __( 'User Password', 'user-registration' ),
41
  );
42
  }
51
  $password = isset( $form_data->value ) ? $form_data->value : '';
52
 
53
  if ( empty( $password ) ) {
54
+ add_filter(
55
+ $filter_hook,
56
+ function ( $msg ) {
57
+ return __( 'Empty password.', 'user-registration' );
58
+ }
59
+ );
60
  }
61
  }
62
 
includes/form/class-ur-form-field-user-url.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
  /**
3
  * UR_Form_Field_User_Url
4
- *
5
  * @package UserRegistration/Form
6
  * @category Admin
7
  * @author WPEverest
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
- exit;
12
  }
13
 
14
  /**
@@ -29,15 +29,15 @@ class UR_Form_Field_User_Url extends UR_Form_Field {
29
 
30
  public function __construct() {
31
 
32
- $this->id = 'user_registration_user_url';
33
- $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
- 'label' => __( 'Website','user-registration' ),
36
- 'icon' => 'dashicons dashicons-admin-links',
37
  );
38
 
39
  $this->field_defaults = array(
40
- 'default_label' => __( 'Website','user-registration' ),
41
  );
42
  }
43
 
@@ -49,16 +49,19 @@ class UR_Form_Field_User_Url extends UR_Form_Field {
49
 
50
 
51
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
52
-
53
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
54
- $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
55
- $field_label = isset( $form_data->label ) ? $form_data->label : '';
56
- $value = isset( $form_data->value ) ? $form_data->value : '';
57
 
58
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
59
- add_filter( $filter_hook, function ( $msg ) use ( $field_label ) {
60
- return __( $field_label . ' is required.', 'user-registration' );
61
- });
 
 
 
62
  }
63
  }
64
  }
1
  <?php
2
  /**
3
  * UR_Form_Field_User_Url
4
+ *
5
  * @package UserRegistration/Form
6
  * @category Admin
7
  * @author WPEverest
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
  }
13
 
14
  /**
29
 
30
  public function __construct() {
31
 
32
+ $this->id = 'user_registration_user_url';
33
+ $this->form_id = 1;
34
  $this->registered_fields_config = array(
35
+ 'label' => __( 'Website', 'user-registration' ),
36
+ 'icon' => 'dashicons dashicons-admin-links',
37
  );
38
 
39
  $this->field_defaults = array(
40
+ 'default_label' => __( 'Website', 'user-registration' ),
41
  );
42
  }
43
 
49
 
50
 
51
  public function validation( $single_form_field, $form_data, $filter_hook, $form_id ) {
52
+
53
  $is_condition_enabled = isset( $single_form_field->advance_setting->enable_conditional_logic ) ? $single_form_field->advance_setting->enable_conditional_logic : '0';
54
+ $required = isset( $single_form_field->general_setting->required ) ? $single_form_field->general_setting->required : 'no';
55
+ $field_label = isset( $form_data->label ) ? $form_data->label : '';
56
+ $value = isset( $form_data->value ) ? $form_data->value : '';
57
 
58
  if ( $is_condition_enabled !== '1' && 'yes' == $required && empty( $value ) ) {
59
+ add_filter(
60
+ $filter_hook,
61
+ function ( $msg ) use ( $field_label ) {
62
+ return __( $field_label . ' is required.', 'user-registration' );
63
+ }
64
+ );
65
  }
66
  }
67
  }
includes/form/settings/class-ur-setting-checkbox.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  /**
@@ -31,24 +32,24 @@ class UR_Setting_Checkbox extends UR_Field_Settings {
31
  $fields = array(
32
 
33
  'custom_class' => array(
34
- 'label' => __( 'Custom Class', 'user-registration' ),
35
- 'data-id' => $this->field_id . '_custom_class',
36
- 'name' => $this->field_id . '[custom_class]',
37
- 'class' => $this->default_class . ' ur-settings-custom-class',
38
- 'type' => 'text',
39
- 'required' => false,
40
- 'default' => '',
41
  'placeholder' => __( 'Custom Class', 'user-registration' ),
42
  ),
43
 
44
- 'choices' => array(
45
- 'label' => __( 'Choices', 'user-registration' ),
46
- 'data-id' => $this->field_id . '_choices',
47
- 'name' => $this->field_id . '[choices]',
48
- 'class' => $this->default_class . ' ur-settings-choices',
49
- 'type' => 'textarea',
50
- 'required' => false,
51
- 'default' => '',
52
  'placeholder' => __( "Please input your text here to create the checkbox list like:\nCheckbox 1,\nCheckbox 2,\nCheckbox 3", 'user-registration' ),
53
  ),
54
  );
1
  <?php
2
+
3
  if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.
5
  }
6
 
7
  /**
32
  $fields = array(
33
 
34
  'custom_class' => array(
35
+ 'label' => __( 'Custom Class', 'user-registration' ),
36
+ 'data-id' => $this->field_id . '_custom_class',
37
+ 'name' => $this->field_id . '[custom_class]',
38
+ 'class' => $this->default_class . ' ur-settings-custom-class',
39
+ 'type' => 'text',
40
+ 'required' => false,
41
+ 'default' => '',
42
  'placeholder' => __( 'Custom Class', 'user-registration' ),
43
  ),
44
 
45
+ 'choices' => array(
46
+ 'label' => __( 'Choices', 'user-registration' ),
47
+ 'data-id' => $this->field_id . '_choices',
48
+ 'name' => $this->field_id . '[choices]',
49
+ 'class' => $this->default_class . ' ur-settings-choices',
50
+ 'type' => 'textarea',
51
+ 'required' => false,
52
+ 'default' => '',
53
  'placeholder' => __( "Please input your text here to create the checkbox list like:\nCheckbox 1,\nCheckbox 2,\nCheckbox 3", 'user-registration' ),
54
  ),
55
  );
includes/form/settings/class-ur-setting-country.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  /**
@@ -30,14 +31,14 @@ class UR_Setting_Country extends UR_Field_Settings {
30
 
31
  $fields = array(
32
  'custom_class' => array(
33
- 'label' => __( 'Custom Class','user-registration' ),
34
- 'data-id' => $this->field_id . '_custom_class',
35
- 'name' => $this->field_id . '[custom_class]',
36
- 'class' => $this->default_class . ' ur-settings-custom-class',
37
- 'type' => 'text',
38
- 'required' => false,
39
- 'default' => '',
40
- 'placeholder' => __( 'Custom Class' ,'user-registration' ),
41
  ),
42
  );
43
 
1
  <?php
2
+
3
  if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.
5
  }
6
 
7
  /**
31
 
32
  $fields = array(
33
  'custom_class' => array(
34
+ 'label' => __( 'Custom Class', 'user-registration' ),
35
+ 'data-id' => $this->field_id . '_custom_class',
36
+ 'name' => $this->field_id . '[custom_class]',
37
+ 'class' => $this->default_class . ' ur-settings-custom-class',
38
+ 'type' => 'text',
39
+ 'required' => false,
40
+ 'default' => '',
41
+ 'placeholder' => __( 'Custom Class', 'user-registration' ),
42
  ),
43
  );
44
 
includes/form/settings/class-ur-setting-email.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  /**
@@ -27,14 +28,14 @@ class UR_Setting_Email extends UR_Field_Settings {
27
  public function register_fields() {
28
  $fields = array(
29
  'custom_class' => array(
30
- 'label' => __( 'Custom Class','user-registration' ),
31
- 'data-id' => $this->field_id . '_custom_class',
32
- 'name' => $this->field_id . '[custom_class]',
33
- 'class' => $this->default_class . ' ur-settings-custom-class',
34
- 'type' => 'text',
35
- 'required' => false,
36
- 'default' => '',
37
- 'placeholder' => __( 'Custom Class' ,'user-registration' ),
38
  ),
39
  );
40
 
1
  <?php
2
+
3
  if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.\
5
  }
6
 
7
  /**
28
  public function register_fields() {
29
  $fields = array(
30
  'custom_class' => array(
31
+ 'label' => __( 'Custom Class', 'user-registration' ),
32
+ 'data-id' => $this->field_id . '_custom_class',
33
+ 'name' => $this->field_id . '[custom_class]',
34
+ 'class' => $this->default_class . ' ur-settings-custom-class',
35
+ 'type' => 'text',
36
+ 'required' => false,
37
+ 'default' => '',
38
+ 'placeholder' => __( 'Custom Class', 'user-registration' ),
39
  ),
40
  );
41
 
includes/form/settings/class-ur-setting-password.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  /**
@@ -27,14 +28,14 @@ class UR_Setting_Password extends UR_Field_Settings {
27
  public function register_fields() {
28
  $fields = array(
29
  'size' => array(
30
- 'label' => __( 'Password Size','user-registration' ),
31
- 'data-id' => $this->field_id . '_size',
32
- 'name' => $this->field_id . '[size]',
33
- 'class' => $this->default_class . ' ur-settings-size',
34
- 'type' => 'text',
35
- 'required' => false,
36
- 'default' => '5',
37
- 'placeholder' => __( 'Password Size' ,'user-registration' ),
38
  ),
39
  );
40
  $this->render_html( $fields );
1
  <?php
2
+
3
  if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.
5
  }
6
 
7
  /**
28
  public function register_fields() {
29
  $fields = array(
30
  'size' => array(
31
+ 'label' => __( 'Password Size', 'user-registration' ),
32
+ 'data-id' => $this->field_id . '_size',
33
+ 'name' => $this->field_id . '[size]',
34
+ 'class' => $this->default_class . ' ur-settings-size',
35
+ 'type' => 'text',
36
+ 'required' => false,
37
+ 'default' => '5',
38
+ 'placeholder' => __( 'Password Size', 'user-registration' ),
39
  ),
40
  );
41
  $this->render_html( $fields );
includes/form/settings/class-ur-setting-radio.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  /**
@@ -25,25 +26,25 @@ class UR_Setting_Radio extends UR_Field_Settings {
25
  public function register_fields() {
26
  $fields = array(
27
  'custom_class' => array(
28
- 'label' => __( 'Custom Class' ,'user-registration' ),
29
- 'data-id' => $this->field_id . '_custom_class',
30
- 'name' => $this->field_id . '[custom_class]',
31
- 'class' => $this->default_class . ' ur-settings-custom-class',
32
- 'type' => 'text',
33
- 'required' => false,
34
- 'default' => '',
35
- 'placeholder' => __( 'Custom Class','user-registration' ),
36
 
37
  ),
38
  'options' => array(
39
- 'label' => __( 'Options ', 'user-registration' ),
40
- 'data-id' => $this->field_id . '_options',
41
- 'name' => $this->field_id . '[options]',
42
- 'class' => $this->default_class . ' ur-settings-options',
43
- 'type' => 'textarea',
44
- 'required' => false,
45
- 'default' => '',
46
- 'placeholder' => __( "Please input your text here to create the radio choices list like:\nOption 1,\nOption 2,\nOption 3",'user-registration' ),
47
  ),
48
  );
49
  $this->render_html( $fields );
1
  <?php
2
+
3
  if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.
5
  }
6
 
7
  /**
26
  public function register_fields() {
27
  $fields = array(
28
  'custom_class' => array(
29
+ 'label' => __( 'Custom Class', 'user-registration' ),
30
+ 'data-id' => $this->field_id . '_custom_class',
31
+ 'name' => $this->field_id . '[custom_class]',
32
+ 'class' => $this->default_class . ' ur-settings-custom-class',
33
+ 'type' => 'text',
34
+ 'required' => false,
35
+ 'default' => '',
36
+ 'placeholder' => __( 'Custom Class', 'user-registration' ),
37
 
38
  ),
39
  'options' => array(
40
+ 'label' => __( 'Options ', 'user-registration' ),
41
+ 'data-id' => $this->field_id . '_options',
42
+ 'name' => $this->field_id . '[options]',
43
+ 'class' => $this->default_class . ' ur-settings-options',
44
+ 'type' => 'textarea',
45
+ 'required' => false,
46
+ 'default' => '',
47
+ 'placeholder' => __( "Please input your text here to create the radio choices list like:\nOption 1,\nOption 2,\nOption 3", 'user-registration' ),
48
  ),
49
  );
50
  $this->render_html( $fields );
includes/form/settings/class-ur-setting-select.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  /**
@@ -28,25 +29,25 @@ class UR_Setting_Select extends UR_Field_Settings {
28
  public function register_fields() {
29
  $fields = array(
30
  'custom_class' => array(
31
- 'label' => __( 'Custom Class' ,'user-registration' ),
32
- 'data-id' => $this->field_id . '_custom_class',
33
- 'name' => $this->field_id . '[custom_class]',
34
- 'class' => $this->default_class . ' ur-settings-custom-class',
35
- 'type' => 'text',
36
- 'required' => false,
37
- 'default' => '',
38
- 'placeholder' => __( 'Custom Class','user-registration' ),
39
 
40
  ),
41
  'options' => array(
42
- 'label' => __( 'Options ', 'user-registration' ),
43
- 'data-id' => $this->field_id . '_options',
44
- 'name' => $this->field_id . '[options]',
45
- 'class' => $this->default_class . ' ur-settings-options',
46
- 'type' => 'textarea',
47
- 'required' => false,
48
- 'default' => '',
49
- 'placeholder' => __( "Please input your text here to create the dropdown list like:\nOption 1,\nOption 2,\nOption 3",'user-registration' ),
50
  ),
51
  );
52
 
1
  <?php
2
+
3
  if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.
5
  }
6
 
7
  /**
29
  public function register_fields() {
30
  $fields = array(
31
  'custom_class' => array(
32
+ 'label' => __( 'Custom Class', 'user-registration' ),
33
+ 'data-id' => $this->field_id . '_custom_class',
34
+ 'name' => $this->field_id . '[custom_class]',
35
+ 'class' => $this->default_class . ' ur-settings-custom-class',
36
+ 'type' => 'text',
37
+ 'required' => false,
38
+ 'default' => '',
39
+ 'placeholder' => __( 'Custom Class', 'user-registration' ),
40
 
41
  ),
42
  'options' => array(
43
+ 'label' => __( 'Options ', 'user-registration' ),
44
+ 'data-id' => $this->field_id . '_options',
45
+ 'name' => $this->field_id . '[options]',
46
+ 'class' => $this->default_class . ' ur-settings-options',
47
+ 'type' => 'textarea',
48
+ 'required' => false,
49
+ 'default' => '',
50
+ 'placeholder' => __( "Please input your text here to create the dropdown list like:\nOption 1,\nOption 2,\nOption 3", 'user-registration' ),
51
  ),
52
  );
53
 
includes/form/settings/class-ur-setting-text.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  /**
@@ -27,36 +28,36 @@ class UR_Setting_Text extends UR_Field_Settings {
27
  public function register_fields() {
28
  $fields = array(
29
  'size' => array(
30
- 'label' => __( 'Size','user-registration' ),
31
- 'data-id' => $this->field_id . '_size',
32
- 'name' => $this->field_id . '[size]',
33
- 'class' => $this->default_class . ' ur-settings-size',
34
- 'type' => 'text',
35
- 'required' => false,
36
- 'default' => '20',
37
- 'placeholder' => __( 'Size','user-registration' ),
38
 
39
  ),
40
  'default_value' => array(
41
- 'label' => __( 'Default Value','user-registration' ),
42
- 'data-id' => $this->field_id . '_default_value',
43
- 'name' => $this->field_id . '[default_value]',
44
- 'class' => $this->default_class . ' ur-settings-default-value',
45
- 'type' => 'text',
46
- 'required' => false,
47
- 'default' => '',
48
- 'placeholder' => __( 'Default Value','user-registration' ),
49
 
50
  ),
51
  'custom_class' => array(
52
- 'label' => __( 'Custom Class', 'user-registration' ),
53
- 'id' => $this->field_id . '_custom_class',
54
- 'name' => $this->field_id . '[custom_class]',
55
- 'class' => $this->default_class . ' ur-settings-custom-class',
56
- 'type' => 'text',
57
- 'required' => false,
58
- 'default' => '',
59
- 'placeholder' => __( 'Custom Class','user-registration' ),
60
  ),
61
  );
62
 
1
  <?php
2
+
3
  if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.
5
  }
6
 
7
  /**
28
  public function register_fields() {
29
  $fields = array(
30
  'size' => array(
31
+ 'label' => __( 'Size', 'user-registration' ),
32
+ 'data-id' => $this->field_id . '_size',
33
+ 'name' => $this->field_id . '[size]',
34
+ 'class' => $this->default_class . ' ur-settings-size',
35
+ 'type' => 'text',
36
+ 'required' => false,
37
+ 'default' => '20',
38
+ 'placeholder' => __( 'Size', 'user-registration' ),
39
 
40
  ),
41
  'default_value' => array(
42
+ 'label' => __( 'Default Value', 'user-registration' ),
43
+ 'data-id' => $this->field_id . '_default_value',
44
+ 'name' => $this->field_id . '[default_value]',
45
+ 'class' => $this->default_class . ' ur-settings-default-value',
46
+ 'type' => 'text',
47
+ 'required' => false,
48
+ 'default' => '',
49
+ 'placeholder' => __( 'Default Value', 'user-registration' ),
50
 
51
  ),
52
  'custom_class' => array(
53
+ 'label' => __( 'Custom Class', 'user-registration' ),
54
+ 'id' => $this->field_id . '_custom_class',
55
+ 'name' => $this->field_id . '[custom_class]',
56
+ 'class' => $this->default_class . ' ur-settings-custom-class',
57
+ 'type' => 'text',
58
+ 'required' => false,
59
+ 'default' => '',
60
+ 'placeholder' => __( 'Custom Class', 'user-registration' ),
61
  ),
62
  );
63
 
includes/form/settings/class-ur-setting-textarea.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
  }
5
 
6
  /**
@@ -29,25 +30,25 @@ class UR_Setting_Textarea extends UR_Field_Settings {
29
 
30
  $fields = array(
31
  'default_value' => array(
32
- 'label' => __( 'Default Value','user-registration' ),
33
- 'data-id' => $this->field_id . '_default_value',
34
- 'name' => $this->field_id . '[default_value]',
35
- 'class' => $this->default_class . ' ur-settings-default-value',
36
- 'type' => 'text',
37
- 'required' => false,
38
- 'default' => '',
39
  'placeholder' => __( 'Default Value', 'user-registration' ),
40
 
41
  ),
42
  'custom_class' => array(
43
- 'label' => __( 'Custom Class', 'user-registration' ),
44
- 'data-id' => $this->field_id . '_custom_class',
45
- 'name' => $this->field_id . '[custom_class]',
46
- 'class' => $this->default_class . ' ur-settings-custom-class',
47
- 'type' => 'text',
48
- 'required' => false,
49
- 'default' => '',
50
- 'placeholder' => __( 'Custom Class' ,'user-registration' ),
51
  ),
52
  );
53
  $this->render_html( $fields );
1
  <?php
2
+
3
  if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.
5
  }
6
 
7
  /**
30
 
31
  $fields = array(
32
  'default_value' => array(
33
+ 'label' => __( 'Default Value', 'user-registration' ),
34
+ 'data-id' => $this->field_id . '_default_value',
35
+ 'name' => $this->field_id . '[default_value]',
36
+ 'class' => $this->default_class . ' ur-settings-default-value',
37
+ 'type' => 'text',
38
+ 'required' => false,
39
+ 'default' => '',
40
  'placeholder' => __( 'Default Value', 'user-registration' ),
41
 
42
  ),
43
  'custom_class' => array(
44
+ 'label' => __( 'Custom Class', 'user-registration' ),
45
+ 'data-id' => $this->field_id . '_custom_class',
46
+ 'name' => $this->field_id . '[custom_class]',
47
+ 'class' => $this->default_class . ' ur-settings-custom-class',
48
+ 'type' => 'text',
49
+ 'required' => false,
50
+ 'default' => '',
51
+ 'placeholder' => __( 'Custom Class', 'user-registration' ),
52
  ),
53
  );
54
  $this->render_html( $fields );
includes/form/views/admin/admin-checkbox.php CHANGED
@@ -18,13 +18,13 @@ $choices = isset( $this->admin_data->advance_setting->choices ) ? explode( ',',
18
 
19
  <div class="ur-field" data-field-key="checkbox">
20
  <?php
21
- if( count( $choices ) < 1 ) {
22
- echo "<input type = 'checkbox' value='1' disabled/>";
23
- }
24
 
25
- foreach ( $choices as $choice ) {
26
- echo "<input type = 'checkbox' value='" . esc_attr( trim( $choice ) ) . "' disabled/>" . esc_html( trim( $choice ) ) . '<br>';
27
- }
28
  ?>
29
 
30
  </div>
18
 
19
  <div class="ur-field" data-field-key="checkbox">
20
  <?php
21
+ if ( count( $choices ) < 1 ) {
22
+ echo "<input type = 'checkbox' value='1' disabled/>";
23
+ }
24
 
25
+ foreach ( $choices as $choice ) {
26
+ echo "<input type = 'checkbox' value='" . esc_attr( trim( $choice ) ) . "' disabled/>" . esc_html( trim( $choice ) ) . '<br>';
27
+ }
28
  ?>
29
 
30
  </div>
includes/form/views/admin/admin-country.php CHANGED
@@ -12,17 +12,17 @@ $instance = UR_Form_Field_Country::get_instance();
12
  <div class="ur-input-type-country ur-admin-template">
13
 
14
  <div class="ur-label">
15
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
16
  </div>
17
 
18
  <div class="ur-field" data-field-key="country">
19
  <select id="ur-input-type-country">
20
  <?php
21
- foreach ( $instance->get_country() as $country_key => $country_name ) {
22
- ?>
23
- <option value="<?php echo esc_attr( $country_key ) ?>"><?php echo esc_html( $country_name ); ?></option>
24
  <?php
25
- }
26
  ?>
27
  </select>
28
  </div>
12
  <div class="ur-input-type-country ur-admin-template">
13
 
14
  <div class="ur-label">
15
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
16
  </div>
17
 
18
  <div class="ur-field" data-field-key="country">
19
  <select id="ur-input-type-country">
20
  <?php
21
+ foreach ( $instance->get_country() as $country_key => $country_name ) {
22
+ ?>
23
+ <option value="<?php echo esc_attr( $country_key ); ?>"><?php echo esc_html( $country_name ); ?></option>
24
  <?php
25
+ }
26
  ?>
27
  </select>
28
  </div>
includes/form/views/admin/admin-date.php CHANGED
@@ -11,11 +11,11 @@ if ( ! defined( 'ABSPATH' ) ) {
11
  <div class="ur-input-type-date ur-admin-template">
12
 
13
  <div class="ur-label">
14
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="date">
18
- <input type="date" id="ur-input-type-date" placeholder="<?php echo esc_attr($this->get_general_setting_data( 'placeholder' )); ?>" disabled/>
19
  </div>
20
 
21
  <?php
11
  <div class="ur-input-type-date ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="date">
18
+ <input type="date" id="ur-input-type-date" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
19
  </div>
20
 
21
  <?php
includes/form/views/admin/admin-description.php CHANGED
@@ -4,13 +4,13 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
  ?>
10
  <div class="ur-input-type-description ur-admin-template">
11
 
12
  <div class="ur-label">
13
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
14
  </div>
15
 
16
  <div class="ur-field" data-field-key="description">
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
  ?>
10
  <div class="ur-input-type-description ur-admin-template">
11
 
12
  <div class="ur-label">
13
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
14
  </div>
15
 
16
  <div class="ur-field" data-field-key="description">
includes/form/views/admin/admin-display-name.php CHANGED
@@ -4,18 +4,18 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-display-name ur-admin-template">
12
 
13
  <div class="ur-label">
14
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="display_name">
18
- <input type="text" id="ur-input-type-display-name" placeholder="<?php echo esc_attr($this->get_general_setting_data( 'placeholder' )); ?>" disabled/>
19
  </div>
20
 
21
  <?php
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-display-name ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="display_name">
18
+ <input type="text" id="ur-input-type-display-name" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
19
  </div>
20
 
21
  <?php
includes/form/views/admin/admin-email.php CHANGED
@@ -4,13 +4,14 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
 
9
  ?>
10
  <div class="ur-input-type-email ur-admin-template">
11
 
12
  <div class="ur-label">
13
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
14
  </div>
15
 
16
  <div class="ur-field" data-field-key="email">
@@ -18,7 +19,7 @@ if ( ! defined( 'ABSPATH' ) ) {
18
  </div>
19
 
20
  <?php
21
- UR_Form_Field_Email::get_instance()->get_setting();
22
  ?>
23
  </div>
24
 
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
+
10
  ?>
11
  <div class="ur-input-type-email ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="email">
19
  </div>
20
 
21
  <?php
22
+ UR_Form_Field_Email::get_instance()->get_setting();
23
  ?>
24
  </div>
25
 
includes/form/views/admin/admin-first-name.php CHANGED
@@ -4,18 +4,18 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-first-name ur-admin-template">
12
 
13
  <div class="ur-label">
14
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="first_name">
18
- <input type="text" id="ur-input-type-first-name" placeholder="<?php echo esc_attr($this->get_general_setting_data( 'placeholder' )); ?>" disabled/>
19
  </div>
20
 
21
  <?php
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-first-name ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="first_name">
18
+ <input type="text" id="ur-input-type-first-name" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
19
  </div>
20
 
21
  <?php
includes/form/views/admin/admin-last-name.php CHANGED
@@ -4,17 +4,17 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-last-name ur-admin-template">
12
  <div class="ur-label">
13
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
14
  </div>
15
 
16
  <div class="ur-field" data-field-key="last_name">
17
- <input type="text" id="ur-input-type-last-name" placeholder="<?php echo esc_attr($this->get_general_setting_data( 'placeholder' )); ?>" disabled/>
18
  </div>
19
 
20
  <?php
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-last-name ur-admin-template">
12
  <div class="ur-label">
13
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
14
  </div>
15
 
16
  <div class="ur-field" data-field-key="last_name">
17
+ <input type="text" id="ur-input-type-last-name" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
18
  </div>
19
 
20
  <?php
includes/form/views/admin/admin-nickname.php CHANGED
@@ -4,18 +4,18 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-nickname ur-admin-template">
12
 
13
  <div class="ur-label">
14
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="nickname">
18
- <input type="text" id="ur-input-type-nickname" placeholder="<?php echo esc_attr($this->get_general_setting_data( 'placeholder' )); ?>" disabled/>
19
  </div>
20
 
21
  <?php
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-nickname ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="nickname">
18
+ <input type="text" id="ur-input-type-nickname" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
19
  </div>
20
 
21
  <?php
includes/form/views/admin/admin-number.php CHANGED
@@ -4,22 +4,22 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-number ur-admin-template">
12
 
13
  <div class="ur-label">
14
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="number">
18
- <input type="number" id="ur-input-type-number" placeholder="<?php echo esc_attr($this->get_general_setting_data( 'placeholder' )); ?>" disabled/>
19
  </div>
20
 
21
  <?php
22
- UR_Form_Field_Number::get_instance()->get_setting();
23
  ?>
24
  </div>
25
 
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-number ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="number">
18
+ <input type="number" id="ur-input-type-number" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
19
  </div>
20
 
21
  <?php
22
+ UR_Form_Field_Number::get_instance()->get_setting();
23
  ?>
24
  </div>
25
 
includes/form/views/admin/admin-password.php CHANGED
@@ -4,13 +4,13 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-password ur-admin-template">
12
  <div class="ur-label">
13
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
14
  </div>
15
 
16
  <div class="ur-field" data-field-key="password">
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-password ur-admin-template">
12
  <div class="ur-label">
13
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
14
  </div>
15
 
16
  <div class="ur-field" data-field-key="password">
includes/form/views/admin/admin-privacy-policy.php CHANGED
@@ -4,18 +4,18 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-privacy-policy ur-admin-template">
12
 
13
  <div class="ur-label">
14
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="privacy_policy">
18
- <input type="checkbox" id="ur-input-type-privacy-policy" placeholder="<?php echo esc_attr($this->get_general_setting_data( 'placeholder' )); ?>" disabled/>
19
 
20
  </div>
21
 
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-privacy-policy ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="privacy_policy">
18
+ <input type="checkbox" id="ur-input-type-privacy-policy" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
19
 
20
  </div>
21
 
includes/form/views/admin/admin-radio.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  $options = isset( $this->admin_data->advance_setting->options ) ? explode( ',', trim( $this->admin_data->advance_setting->options, ',' ) ) : array();
@@ -13,18 +13,18 @@ $options = isset( $this->admin_data->advance_setting->options ) ? explode( ',',
13
  <div class="ur-input-type-select ur-admin-template">
14
 
15
  <div class="ur-label">
16
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
17
  </div>
18
 
19
  <div class="ur-field" data-field-key="radio">
20
  <?php
21
- if( count( $options ) < 1 ) {
22
- echo "<input type = 'radio' value='1' disabled/>";
23
- }
24
 
25
- foreach ( $options as $option ) {
26
- echo "<input type = 'radio' value='" . esc_attr( trim( $option ) ) . "' disabled/>" . esc_html( trim( $option ) ) . '<br>';
27
- }
28
  ?>
29
  </div>
30
 
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  $options = isset( $this->admin_data->advance_setting->options ) ? explode( ',', trim( $this->admin_data->advance_setting->options, ',' ) ) : array();
13
  <div class="ur-input-type-select ur-admin-template">
14
 
15
  <div class="ur-label">
16
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
17
  </div>
18
 
19
  <div class="ur-field" data-field-key="radio">
20
  <?php
21
+ if ( count( $options ) < 1 ) {
22
+ echo "<input type = 'radio' value='1' disabled/>";
23
+ }
24
 
25
+ foreach ( $options as $option ) {
26
+ echo "<input type = 'radio' value='" . esc_attr( trim( $option ) ) . "' disabled/>" . esc_html( trim( $option ) ) . '<br>';
27
+ }
28
  ?>
29
  </div>
30
 
includes/form/views/admin/admin-select.php CHANGED
@@ -4,7 +4,7 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  $options = isset( $this->admin_data->advance_setting->options ) ? explode( ',', trim( $this->admin_data->advance_setting->options, ',' ) ) : array();
@@ -13,15 +13,15 @@ $options = isset( $this->admin_data->advance_setting->options ) ? explode( ',',
13
  <div class="ur-input-type-select ur-admin-template">
14
 
15
  <div class="ur-label">
16
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
17
  </div>
18
 
19
  <div class="ur-field" data-field-key="select">
20
  <select id="ur-input-type-select">
21
  <?php
22
- foreach ( $options as $option ) {
23
- echo "<option value='" . esc_attr( trim( $option ) ) . "'>" . esc_html( trim( $option ) ) . '</option>';
24
- }
25
  ?>
26
  </select>
27
  </div>
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  $options = isset( $this->admin_data->advance_setting->options ) ? explode( ',', trim( $this->admin_data->advance_setting->options, ',' ) ) : array();
13
  <div class="ur-input-type-select ur-admin-template">
14
 
15
  <div class="ur-label">
16
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
17
  </div>
18
 
19
  <div class="ur-field" data-field-key="select">
20
  <select id="ur-input-type-select">
21
  <?php
22
+ foreach ( $options as $option ) {
23
+ echo "<option value='" . esc_attr( trim( $option ) ) . "'>" . esc_html( trim( $option ) ) . '</option>';
24
+ }
25
  ?>
26
  </select>
27
  </div>
includes/form/views/admin/admin-text.php CHANGED
@@ -4,22 +4,22 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-text ur-admin-template">
12
 
13
  <div class="ur-label">
14
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="text">
18
- <input type="text" id="ur-input-type-text" placeholder="<?php echo esc_attr($this->get_general_setting_data( 'placeholder' )); ?>" disabled/>
19
  </div>
20
 
21
  <?php
22
- UR_Form_Field_Text::get_instance()->get_setting();
23
  ?>
24
  </div>
25
 
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-text ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="text">
18
+ <input type="text" id="ur-input-type-text" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
19
  </div>
20
 
21
  <?php
22
+ UR_Form_Field_Text::get_instance()->get_setting();
23
  ?>
24
  </div>
25
 
includes/form/views/admin/admin-textarea.php CHANGED
@@ -4,13 +4,13 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
  ?>
10
  <div class="ur-input-type-textarea ur-admin-template">
11
 
12
  <div class="ur-label">
13
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
14
  </div>
15
 
16
  <div class="ur-field" data-field-key="textarea">
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
  ?>
10
  <div class="ur-input-type-textarea ur-admin-template">
11
 
12
  <div class="ur-label">
13
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
14
  </div>
15
 
16
  <div class="ur-field" data-field-key="textarea">
includes/form/views/admin/admin-user-confirm-password.php CHANGED
@@ -4,18 +4,18 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-user-password ur-admin-template">
12
 
13
  <div class="ur-label">
14
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="user_confirm_password">
18
- <input type="password" id="ur-input-type-user-confirm-password" placeholder="<?php echo esc_attr( $this->get_general_setting_data('placeholder') ); ?>" disabled/>
19
  </div>
20
 
21
  <?php
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-user-password ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="user_confirm_password">
18
+ <input type="password" id="ur-input-type-user-confirm-password" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
19
  </div>
20
 
21
  <?php
includes/form/views/admin/admin-user-email.php CHANGED
@@ -4,18 +4,18 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-user-email ur-admin-template">
12
 
13
  <div class="ur-label">
14
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?><span style="color:red">*</span></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="user_email">
18
- <input type="email" id="ur-input-type-user-email" placeholder="<?php echo esc_attr($this->get_general_setting_data( 'placeholder' )); ?>" disabled/>
19
  </div>
20
 
21
  <?php
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-user-email ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?><span style="color:red">*</span></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="user_email">
18
+ <input type="email" id="ur-input-type-user-email" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
19
  </div>
20
 
21
  <?php
includes/form/views/admin/admin-user-login.php CHANGED
@@ -4,18 +4,18 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-user-login ur-admin-template">
12
 
13
  <div class="ur-label">
14
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="user_login">
18
- <input type="text" id="ur-input-type-user-login" placeholder="<?php echo esc_attr($this->get_general_setting_data( 'placeholder' )); ?>" disabled/>
19
  </div>
20
 
21
  <?php
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-user-login ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="user_login">
18
+ <input type="text" id="ur-input-type-user-login" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
19
  </div>
20
 
21
  <?php
includes/form/views/admin/admin-user-pass.php CHANGED
@@ -4,18 +4,18 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-user-pass ur-admin-template">
12
 
13
  <div class="ur-label">
14
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?><span style="color:red">*</span></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="user_pass">
18
- <input type="password" id="ur-input-type-user-pass" placeholder="<?php echo esc_attr($this->get_general_setting_data( 'placeholder' )); ?>" disabled/>
19
  </div>
20
 
21
  <?php
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-user-pass ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?><span style="color:red">*</span></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="user_pass">
18
+ <input type="password" id="ur-input-type-user-pass" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
19
  </div>
20
 
21
  <?php
includes/form/views/admin/admin-user-url.php CHANGED
@@ -4,18 +4,18 @@
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-user-url ur-admin-template">
12
 
13
  <div class="ur-label">
14
- <label><?php echo esc_html($this->get_general_setting_data( 'label' )); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="user_url">
18
- <input type="text" id="ur-input-type-user-url" placeholder="<?php echo esc_attr($this->get_general_setting_data( 'placeholder' )); ?>" disabled/>
19
  </div>
20
 
21
  <?php
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
7
+ exit; // Exit if accessed directly.
8
  }
9
 
10
  ?>
11
  <div class="ur-input-type-user-url ur-admin-template">
12
 
13
  <div class="ur-label">
14
+ <label><?php echo esc_html( $this->get_general_setting_data( 'label' ) ); ?></label>
15
  </div>
16
 
17
  <div class="ur-field" data-field-key="user_url">
18
+ <input type="text" id="ur-input-type-user-url" placeholder="<?php echo esc_attr( $this->get_general_setting_data( 'placeholder' ) ); ?>" disabled/>
19
  </div>
20
 
21
  <?php
includes/frontend/class-ur-frontend-form-handler.php CHANGED
@@ -9,27 +9,29 @@
9
  * @author WPEverest
10
  */
11
  if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
 
14
  /**
15
  * UR_Frontend_Form_Handler Class
16
  */
17
  class UR_Frontend_Form_Handler {
18
 
19
- public static $form_id = 0;
20
- public static $response_array = array();
21
  private static $valid_form_data = array();
22
 
23
  /**
24
  * Handle frontend form POST data
 
25
  * @param array $form_data Submitted form data
26
- * @param int $form_id ID of the form
27
  * @return void
28
  */
29
  public static function handle_form( $form_data, $form_id ) {
30
 
31
- self::$form_id = $form_id;
32
- $post_content = self::get_post_content( $form_id );
33
  $post_content_array = array();
34
 
35
  if ( ! empty( $post_content ) ) {
@@ -52,22 +54,22 @@ class UR_Frontend_Form_Handler {
52
  if ( count( self::$response_array ) == 0 ) {
53
  $user_role = ! in_array( ur_get_form_setting_by_key( $form_id, 'user_registration_form_setting_default_user_role' ), array_keys( ur_get_default_admin_roles() ) ) ? 'subscriber' : ur_get_form_setting_by_key( $form_id, 'user_registration_form_setting_default_user_role' );
54
  $user_role = apply_filters( 'user_registration_user_role', $user_role, self::$valid_form_data, $form_id );
55
- $userdata = array(
56
- 'user_login' => isset( self::$valid_form_data['user_login'] ) ? self::$valid_form_data['user_login']->value : '',
57
- 'user_pass' => wp_slash( self::$valid_form_data['user_pass']->value ),
58
- 'user_email' => self::$valid_form_data['user_email']->value,
59
  'display_name' => isset( self::$valid_form_data['display_name']->value ) ? self::$valid_form_data['display_name']->value : '',
60
- 'user_url' => isset( self::$valid_form_data['user_url']->value ) ? self::$valid_form_data['user_url']->value : '',
61
  // When creating an user, `user_pass` is expected.
62
- 'role' => $user_role,
63
  );
64
 
65
  self::$valid_form_data = apply_filters( 'user_registration_before_register_user_filter', self::$valid_form_data, $form_id );
66
  do_action( 'user_registration_before_register_user_action', self::$valid_form_data, $form_id );
67
 
68
- if( empty( $userdata['user_login'] ) ) {
69
- $part_of_email = explode( "@", $userdata['user_email'] );
70
- $username = check_username( $part_of_email[0] );
71
  $userdata['user_login'] = $username;
72
  }
73
 
@@ -77,7 +79,7 @@ class UR_Frontend_Form_Handler {
77
  do_action( 'user_registration_after_register_user_action', self::$valid_form_data, $form_id, $user_id );
78
 
79
  if ( $user_id > 0 ) {
80
- $login_option = get_option( 'user_registration_general_setting_login_options', 'default' );
81
  $success_params = array(
82
  'username' => isset( self::$valid_form_data['user_login'] ) ? self::$valid_form_data['user_login']->value : '',
83
  );
@@ -92,18 +94,23 @@ class UR_Frontend_Form_Handler {
92
 
93
  wp_send_json_success( $success_params );
94
  }
95
- wp_send_json_error( array(
96
- 'message' => __( 'Something went wrong! please try again', 'user-registration' ),
97
- ) );
 
 
98
  } else {
99
- wp_send_json_error( array(
100
- 'message' => array_unique(self::$response_array),
101
- ) );
 
 
102
  }// End if().
103
  }
104
 
105
  /**
106
  * Get form field data by post_content array passed
 
107
  * @param array $post_content_array
108
  * @return array
109
  */
@@ -123,14 +130,15 @@ class UR_Frontend_Form_Handler {
123
 
124
  /**
125
  * Get post content by form id
 
126
  * @param int $form_id form id
127
  * @return mixed
128
  */
129
  private static function get_post_content( $form_id ) {
130
  $args = array(
131
- 'post_type' => 'user_registration',
132
  'post_status' => 'publish',
133
- 'post__in' => array( $form_id ),
134
  );
135
  $post_data = get_posts( $args );
136
  if ( isset( $post_data[0]->post_content ) ) {
@@ -143,12 +151,13 @@ class UR_Frontend_Form_Handler {
143
  /**
144
  * Validation from each field's class validation() method.
145
  * Sanitization from get_sanitize_value().
146
- * @param array $form_field_data
147
- * @param array $form_data Form data to validate
 
148
  */
149
  private static function validate_form_data( $form_field_data = array(), $form_data = array() ) {
150
- $form_data_field = wp_list_pluck( $form_data, 'field_name' );
151
- $form_key_list = wp_list_pluck( wp_list_pluck( $form_field_data, 'general_setting' ), 'field_name' );
152
  $duplicate_field_key = array_diff_key( $form_data_field, array_unique( $form_data_field ) );
153
  if ( count( $duplicate_field_key ) > 0 ) {
154
  array_push( self::$response_array, __( 'Duplicate field key in form, please contact site administrator.', 'user-registration' ) );
@@ -162,18 +171,18 @@ class UR_Frontend_Form_Handler {
162
 
163
  foreach ( $form_data as $data ) {
164
  if ( in_array( $data->field_name, $form_key_list ) ) {
165
- $form_data_index = array_search( $data->field_name, $form_key_list );
166
- $single_form_field = $form_field_data[ $form_data_index ];
167
- $general_setting = isset( $single_form_field->general_setting ) ? $single_form_field->general_setting : new stdClass();
168
- $single_field_key = $single_form_field->field_key;
169
- $single_field_label = isset( $general_setting->label ) ? $general_setting->label : '';
170
- $data->extra_params = array(
171
  'field_key' => $single_field_key,
172
- 'label' => $single_field_label
173
  );
174
  self::$valid_form_data[ $data->field_name ] = self::get_sanitize_value( $data );
175
- $hook = "user_registration_validate_{$single_form_field->field_key}";
176
- $filter_hook = $hook . '_message';
177
  do_action( $hook, $single_form_field, $data, $filter_hook, self::$form_id );
178
  $response = apply_filters( $filter_hook, '' );
179
  if ( ! empty( $response ) ) {
@@ -186,6 +195,7 @@ class UR_Frontend_Form_Handler {
186
  /**
187
  * Triger validation method for user fields
188
  * Useful for custom fields validation
 
189
  * @param array $form_field_data
190
  * @param array $form_data
191
  */
@@ -193,29 +203,35 @@ class UR_Frontend_Form_Handler {
193
  $form_key_list = wp_list_pluck( wp_list_pluck( $form_field_data, 'general_setting' ), 'field_name' );
194
  foreach ( $form_data as $data ) {
195
  if ( in_array( $data->field_name, $form_key_list ) ) {
196
- $form_data_index = array_search( $data->field_name, $form_key_list );
197
  $single_form_field = $form_field_data[ $form_data_index ];
198
- $class_name = ur_load_form_field_class( $single_form_field->field_key );
199
- $hook = "user_registration_validate_{$single_form_field->field_key}";
200
- add_action( $hook, array(
201
- $class_name::get_instance(),
202
- 'validation',
203
- ), 10, 4 );
 
 
 
 
 
204
  }
205
  }
206
  }
207
 
208
  /**
209
  * Sanitize form data
 
210
  * @param obj &$form_data
211
  * @return object
212
  */
213
  private static function get_sanitize_value( &$form_data ) {
214
 
215
  $field_key = isset( $form_data->extra_params['field_key'] ) ? $form_data->extra_params['field_key'] : '';
216
- $fields = ur_get_registered_form_fields();
217
 
218
- if( in_array( $field_key, $fields ) ) {
219
 
220
  switch ( $field_key ) {
221
  case 'user_email':
@@ -228,7 +244,7 @@ class UR_Frontend_Form_Handler {
228
  case 'user_url':
229
  $form_data->value = esc_url_raw( $form_data->value );
230
  break;
231
- case 'textarea' :
232
  case 'description':
233
  $form_data->value = sanitize_textarea_field( $form_data->value );
234
  break;
@@ -257,34 +273,36 @@ class UR_Frontend_Form_Handler {
257
 
258
  /**
259
  * Update form data to usermeta table.
260
- * @param int $user_id
 
261
  * @param array $valid_form_data All valid form data.
262
- * @param int $form_id
263
  * @return void
264
  */
265
  private static function ur_update_user_meta( $user_id, $valid_form_data, $form_id ) {
266
 
267
  foreach ( $valid_form_data as $data ) {
268
  if ( ! in_array( trim( $data->field_name ), ur_get_user_table_fields() ) ) {
269
- $field_name = $data->field_name;
270
- $field_key = isset( $data->extra_params['field_key'] ) ? $data->extra_params['field_key'] : '';
271
  $fields_without_prefix = ur_get_fields_without_prefix();
272
 
273
- if( ! in_array( $field_key, $fields_without_prefix ) ) {
274
  $field_name = 'user_registration_' . $field_name;
275
  }
276
 
277
- if( isset( $data->extra_params['field_key'] ) && $data->extra_params['field_key'] === 'checkbox' ) {
278
- $data->value = ( json_decode( $data->value ) !== NULL ) ? json_decode( $data->value ) : $data->value;
279
  }
280
  update_user_meta( $user_id, $field_name, $data->value );
281
  }
282
- update_user_meta( $user_id, 'ur_form_id', $form_id );
283
  }
284
  }
285
 
286
  /**
287
  * Match password and confirm password field
 
288
  * @param obj &$form_data Form data submitted
289
  * @return obj $form_data
290
  */
@@ -295,7 +313,7 @@ class UR_Frontend_Form_Handler {
295
 
296
  foreach ( $form_data as $index => $single_data ) {
297
  if ( 'user_confirm_password' == $single_data->field_name ) {
298
- $confirm_password = $single_data->value;
299
  $has_confirm_password = true;
300
  unset( $form_data[ $index ] );
301
  }
9
  * @author WPEverest
10
  */
11
  if ( ! defined( 'ABSPATH' ) ) {
12
+ exit; // Exit if accessed directly.
13
  }
14
+
15
  /**
16
  * UR_Frontend_Form_Handler Class
17
  */
18
  class UR_Frontend_Form_Handler {
19
 
20
+ public static $form_id = 0;
21
+ public static $response_array = array();
22
  private static $valid_form_data = array();
23
 
24
  /**
25
  * Handle frontend form POST data
26
+ *
27
  * @param array $form_data Submitted form data
28
+ * @param int $form_id ID of the form
29
  * @return void
30
  */
31
  public static function handle_form( $form_data, $form_id ) {
32
 
33
+ self::$form_id = $form_id;
34
+ $post_content = self::get_post_content( $form_id );
35
  $post_content_array = array();
36
 
37
  if ( ! empty( $post_content ) ) {
54
  if ( count( self::$response_array ) == 0 ) {
55
  $user_role = ! in_array( ur_get_form_setting_by_key( $form_id, 'user_registration_form_setting_default_user_role' ), array_keys( ur_get_default_admin_roles() ) ) ? 'subscriber' : ur_get_form_setting_by_key( $form_id, 'user_registration_form_setting_default_user_role' );
56
  $user_role = apply_filters( 'user_registration_user_role', $user_role, self::$valid_form_data, $form_id );
57
+ $userdata = array(
58
+ 'user_login' => isset( self::$valid_form_data['user_login'] ) ? self::$valid_form_data['user_login']->value : '',
59
+ 'user_pass' => wp_slash( self::$valid_form_data['user_pass']->value ),
60
+ 'user_email' => self::$valid_form_data['user_email']->value,
61
  'display_name' => isset( self::$valid_form_data['display_name']->value ) ? self::$valid_form_data['display_name']->value : '',
62
+ 'user_url' => isset( self::$valid_form_data['user_url']->value ) ? self::$valid_form_data['user_url']->value : '',
63
  // When creating an user, `user_pass` is expected.
64
+ 'role' => $user_role,
65
  );
66
 
67
  self::$valid_form_data = apply_filters( 'user_registration_before_register_user_filter', self::$valid_form_data, $form_id );
68
  do_action( 'user_registration_before_register_user_action', self::$valid_form_data, $form_id );
69
 
70
+ if ( empty( $userdata['user_login'] ) ) {
71
+ $part_of_email = explode( '@', $userdata['user_email'] );
72
+ $username = check_username( $part_of_email[0] );
73
  $userdata['user_login'] = $username;
74
  }
75
 
79
  do_action( 'user_registration_after_register_user_action', self::$valid_form_data, $form_id, $user_id );
80
 
81
  if ( $user_id > 0 ) {
82
+ $login_option = get_option( 'user_registration_general_setting_login_options', 'default' );
83
  $success_params = array(
84
  'username' => isset( self::$valid_form_data['user_login'] ) ? self::$valid_form_data['user_login']->value : '',
85
  );
94
 
95
  wp_send_json_success( $success_params );
96
  }
97
+ wp_send_json_error(
98
+ array(
99
+ 'message' => __( 'Something went wrong! please try again', 'user-registration' ),
100
+ )
101
+ );
102
  } else {
103
+ wp_send_json_error(
104
+ array(
105
+ 'message' => array_unique( self::$response_array ),
106
+ )
107
+ );
108
  }// End if().
109
  }
110
 
111
  /**
112
  * Get form field data by post_content array passed
113
+ *
114
  * @param array $post_content_array
115
  * @return array
116
  */
130
 
131
  /**
132
  * Get post content by form id
133
+ *
134
  * @param int $form_id form id
135
  * @return mixed
136
  */
137
  private static function get_post_content( $form_id ) {
138
  $args = array(
139
+ 'post_type' => 'user_registration',
140
  'post_status' => 'publish',
141
+ 'post__in' => array( $form_id ),
142
  );
143
  $post_data = get_posts( $args );
144
  if ( isset( $post_data[0]->post_content ) ) {
151
  /**
152
  * Validation from each field's class validation() method.
153
  * Sanitization from get_sanitize_value().
154
+ *
155
+ * @param array $form_field_data
156
+ * @param array $form_data Form data to validate
157
  */
158
  private static function validate_form_data( $form_field_data = array(), $form_data = array() ) {
159
+ $form_data_field = wp_list_pluck( $form_data, 'field_name' );
160
+ $form_key_list = wp_list_pluck( wp_list_pluck( $form_field_data, 'general_setting' ), 'field_name' );
161
  $duplicate_field_key = array_diff_key( $form_data_field, array_unique( $form_data_field ) );
162
  if ( count( $duplicate_field_key ) > 0 ) {
163
  array_push( self::$response_array, __( 'Duplicate field key in form, please contact site administrator.', 'user-registration' ) );
171
 
172
  foreach ( $form_data as $data ) {
173
  if ( in_array( $data->field_name, $form_key_list ) ) {
174
+ $form_data_index = array_search( $data->field_name, $form_key_list );
175
+ $single_form_field = $form_field_data[ $form_data_index ];
176
+ $general_setting = isset( $single_form_field->general_setting ) ? $single_form_field->general_setting : new stdClass();
177
+ $single_field_key = $single_form_field->field_key;
178
+ $single_field_label = isset( $general_setting->label ) ? $general_setting->label : '';
179
+ $data->extra_params = array(
180
  'field_key' => $single_field_key,
181
+ 'label' => $single_field_label,
182
  );
183
  self::$valid_form_data[ $data->field_name ] = self::get_sanitize_value( $data );
184
+ $hook = "user_registration_validate_{$single_form_field->field_key}";
185
+ $filter_hook = $hook . '_message';
186
  do_action( $hook, $single_form_field, $data, $filter_hook, self::$form_id );
187
  $response = apply_filters( $filter_hook, '' );
188
  if ( ! empty( $response ) ) {
195
  /**
196
  * Triger validation method for user fields
197
  * Useful for custom fields validation
198
+ *
199
  * @param array $form_field_data
200
  * @param array $form_data
201
  */
203
  $form_key_list = wp_list_pluck( wp_list_pluck( $form_field_data, 'general_setting' ), 'field_name' );
204
  foreach ( $form_data as $data ) {
205
  if ( in_array( $data->field_name, $form_key_list ) ) {
206
+ $form_data_index = array_search( $data->field_name, $form_key_list );
207
  $single_form_field = $form_field_data[ $form_data_index ];
208
+ $class_name = ur_load_form_field_class( $single_form_field->field_key );
209
+ $hook = "user_registration_validate_{$single_form_field->field_key}";
210
+ add_action(
211
+ $hook,
212
+ array(
213
+ $class_name::get_instance(),
214
+ 'validation',
215
+ ),
216
+ 10,
217
+ 4
218
+ );
219
  }
220
  }
221
  }
222
 
223
  /**
224
  * Sanitize form data
225
+ *
226
  * @param obj &$form_data
227
  * @return object
228
  */
229
  private static function get_sanitize_value( &$form_data ) {
230
 
231
  $field_key = isset( $form_data->extra_params['field_key'] ) ? $form_data->extra_params['field_key'] : '';
232
+ $fields = ur_get_registered_form_fields();
233
 
234
+ if ( in_array( $field_key, $fields ) ) {
235
 
236
  switch ( $field_key ) {
237
  case 'user_email':
244
  case 'user_url':
245
  $form_data->value = esc_url_raw( $form_data->value );
246
  break;
247
+ case 'textarea':
248
  case 'description':
249
  $form_data->value = sanitize_textarea_field( $form_data->value );
250
  break;
273
 
274
  /**
275
  * Update form data to usermeta table.
276
+ *
277
+ * @param int $user_id
278
  * @param array $valid_form_data All valid form data.
279
+ * @param int $form_id
280
  * @return void
281
  */
282
  private static function ur_update_user_meta( $user_id, $valid_form_data, $form_id ) {
283
 
284
  foreach ( $valid_form_data as $data ) {
285
  if ( ! in_array( trim( $data->field_name ), ur_get_user_table_fields() ) ) {
286
+ $field_name = $data->field_name;
287
+ $field_key = isset( $data->extra_params['field_key'] ) ? $data->extra_params['field_key'] : '';
288
  $fields_without_prefix = ur_get_fields_without_prefix();
289
 
290
+ if ( ! in_array( $field_key, $fields_without_prefix ) ) {
291
  $field_name = 'user_registration_' . $field_name;
292
  }
293
 
294
+ if ( isset( $data->extra_params['field_key'] ) && $data->extra_params['field_key'] === 'checkbox' ) {
295
+ $data->value = ( json_decode( $data->value ) !== null ) ? json_decode( $data->value ) : $data->value;
296
  }
297
  update_user_meta( $user_id, $field_name, $data->value );
298
  }
299
+ update_user_meta( $user_id, 'ur_form_id', $form_id );
300
  }
301
  }
302
 
303
  /**
304
  * Match password and confirm password field
305
+ *
306
  * @param obj &$form_data Form data submitted
307
  * @return obj $form_data
308
  */
313
 
314
  foreach ( $form_data as $index => $single_data ) {
315
  if ( 'user_confirm_password' == $single_data->field_name ) {
316
+ $confirm_password = $single_data->value;
317
  $has_confirm_password = true;
318
  unset( $form_data[ $index ] );
319
  }
includes/frontend/class-ur-frontend.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
- exit;
14
  }
15
 
16
  /**
@@ -35,8 +35,8 @@ class UR_Frontend {
35
  }
36
 
37
  public function includes() {
38
- include_once( UR_ABSPATH . 'includes' . UR_DS . 'frontend' . UR_DS . 'class-ur-frontend-form-handler.php' );
39
- }
40
 
41
  /**
42
  * Includes any classes we need within admin.
@@ -45,17 +45,18 @@ class UR_Frontend {
45
 
46
  $class_name = ur_load_form_field_class( $field_object->field_key );
47
 
48
- if( class_exists( $class_name ) ) {
49
- $instance = $class_name::get_instance();
50
  $setting['general_setting'] = $field_object->general_setting;
51
  $setting['advance_setting'] = $field_object->advance_setting;
52
- $field_type = ur_get_field_type( $field_object->field_key );
53
  $instance->frontend_includes( $setting, $form_id, $field_type, $field_object->field_key );
54
  }
55
  }
56
 
57
  /**
58
  * My Account layouts(vertical/horizontal) by adding class.
 
59
  * @param $attributes
60
  * @since 1.4.2
61
  * @return $attributes
@@ -63,7 +64,7 @@ class UR_Frontend {
63
  public function user_registration_my_account_layout( $attributes ) {
64
 
65
  if ( is_user_logged_in() ) {
66
- $layout = get_option( 'user_registration_my_account_layout', 'horizontal' );
67
  $attributes['class'] = $attributes['class'] . ' ' . $layout;
68
  }
69
  return $attributes;
10
  */
11
 
12
  if ( ! defined( 'ABSPATH' ) ) {
13
+ exit; // Exit if accessed directly.
14
  }
15
 
16
  /**
35
  }
36
 
37
  public function includes() {
38
+ include_once UR_ABSPATH . 'includes' . UR_DS . 'frontend' . UR_DS . 'class-ur-frontend-form-handler.php';
39
+ }
40
 
41
  /**
42
  * Includes any classes we need within admin.
45
 
46
  $class_name = ur_load_form_field_class( $field_object->field_key );
47
 
48
+ if ( class_exists( $class_name ) ) {
49
+ $instance = $class_name::get_instance();
50
  $setting['general_setting'] = $field_object->general_setting;
51
  $setting['advance_setting'] = $field_object->advance_setting;
52
+ $field_type = ur_get_field_type( $field_object->field_key );
53
  $instance->frontend_includes( $setting, $form_id, $field_type, $field_object->field_key );
54
  }
55
  }
56
 
57
  /**
58
  * My Account layouts(vertical/horizontal) by adding class.
59
+ *
60
  * @param $attributes
61
  * @since 1.4.2
62
  * @return $attributes
64
  public function user_registration_my_account_layout( $attributes ) {
65
 
66
  if ( is_user_logged_in() ) {
67
+ $layout = get_option( 'user_registration_my_account_layout', 'horizontal' );
68
  $attributes['class'] = $attributes['class'] . ' ' . $layout;
69
  }
70
  return $attributes;
includes/functions-ur-account.php CHANGED
@@ -23,19 +23,19 @@ function ur_login_error_message( $error ) {
23
  return $error;
24
  }
25
 
26
- $pos = strpos( $error, 'incorrect' ); // Check if the error contains incorrect string.
27
- $pos2 = strpos( $error, 'Invalid' ); // Check if the error contains Invalid string.
28
 
29
- // Its the correct username with incorrect password.
30
  if ( is_int( $pos ) && isset( $_POST['username'] ) ) {
31
 
32
- $error = sprintf( '<strong>' . __( 'ERROR:', 'user-registration' ) . '</strong>' . __( 'The password you entered for username %1s is incorrect. %2s' , 'user-registration' ), $_POST['username'], "<a href='". esc_url( wp_lostpassword_url() ) ."'>".__('Lost Your Password?','user-registration').'</a>' );
33
- } // It's invalid username.
34
- elseif( is_int( $pos2 ) && isset( $_POST['username'] ) ) {
35
- $error = sprintf( '<strong>' . __( 'ERROR:', 'user-registration' ) . '</strong>' . __( 'Invalid username. %1s' , 'user-registration' ), "<a href='". esc_url( wp_lostpassword_url() ) ."'>".__('Lost Your Password?','user-registration').'</a>' );
36
- }
37
 
38
- return $error;
39
  }
40
 
41
  /**
@@ -55,7 +55,7 @@ function ur_lostpassword_url( $default_url = '' ) {
55
  // Don't change default url if admin side login form.
56
  if ( $GLOBALS['pagenow'] === 'wp-login.php' ) {
57
  return $default_url;
58
- }
59
 
60
  $ur_account_page_url = ur_get_page_permalink( 'myaccount' );
61
  $ur_account_page_exists = ur_get_page_id( 'myaccount' ) > 0;
@@ -77,21 +77,21 @@ add_filter( 'lostpassword_url', 'ur_lostpassword_url', 20, 1 );
77
  */
78
  function ur_get_account_menu_items() {
79
  $endpoints = array(
80
- 'edit-profile' => get_option( 'user_registration_myaccount_edit_profile_endpoint', 'edit-profile' ),
81
  'edit-password' => get_option( 'user_registration_myaccount_change_password_endpoint', 'edit-password' ),
82
- 'user-logout' => get_option( 'user_registration_logout_endpoint', 'user-logout' ),
83
  );
84
 
85
  $items = array(
86
- 'dashboard' => __( 'Dashboard', 'user-registration' ),
87
- 'edit-profile' => __( 'Profile Details', 'user-registration' ),
88
  'edit-password' => __( 'Change Password', 'user-registration' ),
89
- 'user-logout' => __( 'Logout', 'user-registration' ),
90
  );
91
 
92
- $user_id = get_current_user_id();
93
  $form_id_array = get_user_meta( $user_id, 'ur_form_id' );
94
- $form_id = 0;
95
 
96
  if ( isset( $form_id_array[0] ) ) {
97
  $form_id = $form_id_array[0];
@@ -100,7 +100,7 @@ function ur_get_account_menu_items() {
100
  $profile = user_registration_form_data( $user_id, $form_id );
101
 
102
  if ( count( $profile ) < 1 ) {
103
- unset($items['edit-profile']);
104
  }
105
 
106
  // Remove missing endpoints.
23
  return $error;
24
  }
25
 
26
+ $pos = strpos( $error, 'incorrect' ); // Check if the error contains incorrect string.
27
+ $pos2 = strpos( $error, 'Invalid' ); // Check if the error contains Invalid string.
28
 
29
+ // Its the correct username with incorrect password.
30
  if ( is_int( $pos ) && isset( $_POST['username'] ) ) {
31
 
32
+ $error = sprintf( '<strong>' . __( 'ERROR:', 'user-registration' ) . '</strong>' . __( 'The password you entered for username %1$1s is incorrect. %2$2s', 'user-registration' ), $_POST['username'], "<a href='" . esc_url( wp_lostpassword_url() ) . "'>" . __( 'Lost Your Password?', 'user-registration' ) . '</a>' );
33
+ } // It's invalid username.
34
+ elseif ( is_int( $pos2 ) && isset( $_POST['username'] ) ) {
35
+ $error = sprintf( '<strong>' . __( 'ERROR:', 'user-registration' ) . '</strong>' . __( 'Invalid username. %1s', 'user-registration' ), "<a href='" . esc_url( wp_lostpassword_url() ) . "'>" . __( 'Lost Your Password?', 'user-registration' ) . '</a>' );
36
+ }
37
 
38
+ return $error;
39
  }
40
 
41
  /**
55
  // Don't change default url if admin side login form.
56
  if ( $GLOBALS['pagenow'] === 'wp-login.php' ) {
57
  return $default_url;
58
+ }
59
 
60
  $ur_account_page_url = ur_get_page_permalink( 'myaccount' );
61
  $ur_account_page_exists = ur_get_page_id( 'myaccount' ) > 0;
77
  */
78
  function ur_get_account_menu_items() {
79
  $endpoints = array(
80
+ 'edit-profile' => get_option( 'user_registration_myaccount_edit_profile_endpoint', 'edit-profile' ),
81
  'edit-password' => get_option( 'user_registration_myaccount_change_password_endpoint', 'edit-password' ),
82
+ 'user-logout' => get_option( 'user_registration_logout_endpoint', 'user-logout' ),
83
  );
84
 
85
  $items = array(
86
+ 'dashboard' => __( 'Dashboard', 'user-registration' ),
87
+ 'edit-profile' => __( 'Profile Details', 'user-registration' ),
88
  'edit-password' => __( 'Change Password', 'user-registration' ),
89
+ 'user-logout' => __( 'Logout', 'user-registration' ),
90
  );
91
 
92
+ $user_id = get_current_user_id();
93
  $form_id_array = get_user_meta( $user_id, 'ur_form_id' );
94
+ $form_id = 0;
95
 
96
  if ( isset( $form_id_array[0] ) ) {
97
  $form_id = $form_id_array[0];
100
  $profile = user_registration_form_data( $user_id, $form_id );
101
 
102
  if ( count( $profile ) < 1 ) {
103
+ unset( $items['edit-profile'] );
104
  }
105
 
106
  // Remove missing endpoints.
includes/functions-ur-core.php CHANGED
@@ -11,9 +11,9 @@
11
  defined( 'ABSPATH' ) || exit;
12
 
13
  // Include core functions (available in both admin and frontend).
14
- include( UR_ABSPATH . 'includes/functions-ur-page.php' );
15
- include( UR_ABSPATH . 'includes/functions-ur-account.php' );
16
- include( UR_ABSPATH . 'includes/functions-ur-deprecated.php' );
17
 
18
  /**
19
  * Define a constant if it is not already defined.
@@ -128,17 +128,22 @@ function ur_clean( $var ) {
128
  * @return string
129
  */
130
  function ur_sanitize_tooltip( $var ) {
131
- return htmlspecialchars( wp_kses( html_entity_decode( $var ), array(
132
- 'br' => array(),
133
- 'em' => array(),
134
- 'strong' => array(),
135
- 'small' => array(),
136
- 'span' => array(),
137
- 'ul' => array(),
138
- 'li' => array(),
139
- 'ol' => array(),
140
- 'p' => array(),
141
- ) ) );
 
 
 
 
 
142
  }
143
 
144
  /**
@@ -167,7 +172,7 @@ function ur_get_template( $template_name, $args = array(), $template_path = '',
167
 
168
  do_action( 'user_registration_before_template_part', $template_name, $template_path, $located, $args );
169
 
170
- include( $located );
171
 
172
  do_action( 'user_registration_after_template_part', $template_name, $template_path, $located, $args );
173
  }
@@ -292,7 +297,7 @@ function ur_setcookie( $name, $value, $expire = 0, $secure = false ) {
292
  */
293
  function ur_enable_ur_plugin_headers( $headers ) {
294
  if ( ! class_exists( 'UR_Plugin_Updates', false ) ) {
295
- include_once( dirname( __FILE__ ) . '/admin/updater/class-ur-plugin-updates.php' );
296
  }
297
 
298
  $headers['URRequires'] = UR_Plugin_Updates::VERSION_REQUIRED_HEADER;
@@ -305,6 +310,7 @@ add_filter( 'extra_plugin_headers', 'ur_enable_ur_plugin_headers' );
305
 
306
  /**
307
  * Set field type for all registrered field keys
 
308
  * @param string $field_key field's field key
309
  * @return string $field_type
310
  */
@@ -375,13 +381,16 @@ function ur_get_field_type( $field_key ) {
375
  * @return array
376
  */
377
  function ur_get_user_table_fields() {
378
- return apply_filters( 'user_registration_user_table_fields', array(
379
- 'user_email',
380
- 'user_pass',
381
- 'user_login',
382
- 'user_url',
383
- 'display_name',
384
- ) );
 
 
 
385
  }
386
 
387
  /**
@@ -390,10 +399,13 @@ function ur_get_user_table_fields() {
390
  * @return array
391
  */
392
  function ur_get_required_fields() {
393
- return apply_filters( 'user_registration_required_form_fields', array(
394
- 'user_email',
395
- 'user_pass',
396
- ) );
 
 
 
397
  }
398
 
399
  /**
@@ -412,10 +424,13 @@ function ur_get_one_time_draggable_fields() {
412
  * @return array
413
  */
414
  function ur_exclude_profile_details_fields() {
415
- return apply_filters( 'user_registration_exclude_profile_fields', array(
416
- 'user_pass',
417
- 'user_confirm_password',
418
- ) );
 
 
 
419
  }
420
 
421
  /**
@@ -447,30 +462,33 @@ function ur_get_fields_without_prefix() {
447
  }
448
 
449
  /**
450
- * Get all default fields by wordpress.
451
  *
452
  * @return array
453
- */
454
  function ur_get_user_field_only() {
455
- return apply_filters( 'user_registration_user_form_fields', array(
456
- 'user_email',
457
- 'user_pass',
458
- 'user_confirm_password',
459
- 'user_login',
460
- 'nickname',
461
- 'first_name',
462
- 'last_name',
463
- 'user_url',
464
- 'display_name',
465
- 'description',
466
- ) );
 
 
 
467
  }
468
 
469
  /**
470
  * Get all extra form fields
471
  *
472
  * @return array
473
- */
474
  function ur_get_other_form_fields() {
475
  $registered = ur_get_registered_form_fields();
476
  $user_fields = ur_get_user_field_only();
@@ -481,70 +499,79 @@ function ur_get_other_form_fields() {
481
 
482
  /**
483
  * All default fields storing in usermeta table
 
484
  * @return mixed|array
485
  */
486
  function ur_get_registered_user_meta_fields() {
487
- return apply_filters( 'user_registration_registered_user_meta_fields', array(
488
- 'nickname',
489
- 'first_name',
490
- 'last_name',
491
- 'description'
492
- ) );
 
 
 
493
  }
494
 
495
  /**
496
  * All registered form fields
 
497
  * @return mixed|array
498
  */
499
  function ur_get_registered_form_fields() {
500
- return apply_filters( 'user_registration_registered_form_fields', array(
501
- 'user_email',
502
- 'user_pass',
503
- 'user_confirm_password',
504
- 'user_login',
505
- 'nickname',
506
- 'first_name',
507
- 'last_name',
508
- 'user_url',
509
- 'display_name',
510
- 'description',
511
- 'text',
512
- 'password',
513
- 'email',
514
- 'select',
515
- 'country',
516
- 'textarea',
517
- 'number',
518
- 'date',
519
- 'checkbox',
520
- 'privacy_policy',
521
- 'radio',
522
- ) );
 
 
 
523
  }
524
 
525
  /**
526
  * General settings for each fields
 
527
  * @param string $id id for each field
528
  * @return mixed|array
529
  */
530
  function ur_get_general_settings( $id ) {
531
 
532
  $general_settings = array(
533
- 'label' => array(
534
  'type' => 'text',
535
  'label' => __( 'Label', 'user-registration' ),
536
  'name' => 'ur_general_setting[label]',
537
  'placeholder' => __( 'Label', 'user-registration' ),
538
  'required' => true,
539
  ),
540
- 'description' => array(
541
  'type' => 'textarea',
542
  'label' => __( 'Description', 'user-registration' ),
543
  'name' => 'ur_general_setting[description]',
544
  'placeholder' => __( 'Description', 'user-registration' ),
545
  'required' => true,
546
  ),
547
- 'field_name' => array(
548
  'type' => 'text',
549
  'label' => __( 'Field Name', 'user-registration' ),
550
  'name' => 'ur_general_setting[field_name]',
@@ -570,7 +597,7 @@ function ur_get_general_settings( $id ) {
570
  'yes' => __( 'Yes', 'user-registration' ),
571
  ),
572
  ),
573
- 'hide_label' => array(
574
  'type' => 'select',
575
  'label' => __( 'Hide Label', 'user-registration' ),
576
  'name' => 'ur_general_setting[hide_label]',
@@ -583,7 +610,8 @@ function ur_get_general_settings( $id ) {
583
  ),
584
  );
585
 
586
- $exclude_placeholder = apply_filters( 'user_registration_exclude_placeholder',
 
587
  array(
588
  'checkbox',
589
  'country',
@@ -592,12 +620,12 @@ function ur_get_general_settings( $id ) {
592
  'radio',
593
  'select',
594
  'file',
595
- 'mailchimp'
596
  )
597
  );
598
- $strip_id = substr( $id, 18 );
599
 
600
- if( in_array( $strip_id, $exclude_placeholder ) ) {
601
  unset( $general_settings['placeholder'] );
602
  }
603
 
@@ -616,9 +644,9 @@ function ur_load_form_field_class( $class_key ) {
616
  $class_path = apply_filters( 'user_registration_form_field_' . $class_key . '_path', $class_path );
617
  /* Backward Compat since 1.4.0 */
618
  if ( file_exists( $class_path ) ) {
619
- $class_name = 'UR_' . join( '_', array_map( 'ucwords', $exploded_class ) );
620
  if ( ! class_exists( $class_name ) ) {
621
- include_once( $class_path );
622
  }
623
  }
624
  /* Backward compat end*/
@@ -628,6 +656,7 @@ function ur_load_form_field_class( $class_key ) {
628
 
629
  /**
630
  * List of all roles
 
631
  * @return array $all_roles
632
  */
633
  function ur_get_default_admin_roles() {
@@ -641,7 +670,7 @@ function ur_get_default_admin_roles() {
641
  $wp_roles = new WP_Roles();
642
  }
643
 
644
- $roles = isset( $wp_roles->roles ) ? $wp_roles->roles : array();
645
  $all_roles = array();
646
 
647
  foreach ( $roles as $role_key => $role ) {
@@ -654,6 +683,7 @@ function ur_get_default_admin_roles() {
654
 
655
  /**
656
  * Random number generated by time()
 
657
  * @return int
658
  */
659
  function ur_get_random_number() {
@@ -664,6 +694,7 @@ function ur_get_random_number() {
664
 
665
  /**
666
  * General Form settings
 
667
  * @param int $form_id Form ID.
668
  *
669
  * @since 1.0.1
@@ -675,7 +706,7 @@ function ur_admin_form_settings_fields( $form_id ) {
675
  $all_roles = ur_get_default_admin_roles();
676
 
677
  $arguments = array(
678
- 'form_id' => $form_id,
679
 
680
  'setting_data' => array(
681
  array(
@@ -700,7 +731,7 @@ function ur_admin_form_settings_fields( $form_id ) {
700
  'input_class' => array(),
701
  'options' => array(
702
  'yes' => __( 'Yes', 'user-registration' ),
703
- 'no' => __( 'No', 'user-registration' )
704
  ),
705
  'custom_attributes' => array(),
706
  'default' => ur_get_single_post_meta( $form_id, 'user_registration_form_setting_enable_strong_password', 'yes' ),
@@ -714,10 +745,10 @@ function ur_admin_form_settings_fields( $form_id ) {
714
  'class' => array( 'ur-enhanced-select' ),
715
  'input_class' => array(),
716
  'options' => array(
717
- '0' => __( 'Very Weak', 'user-registration' ),
718
- '1' => __( 'Weak', 'user-registration' ),
719
- '2' => __( 'Medium', 'user-registration' ),
720
- '3' => __( 'Strong', 'user-registration' ),
721
  ),
722
  'custom_attributes' => array(),
723
  'default' => ur_get_single_post_meta( $form_id, 'user_registration_form_setting_minimum_password_strength', '3' ),
@@ -743,7 +774,7 @@ function ur_admin_form_settings_fields( $form_id ) {
743
  'input_class' => array(),
744
  'options' => array(
745
  'yes' => __( 'Yes', 'user-registration' ),
746
- 'no' => __( 'No', 'user-registration' )
747
  ),
748
  'custom_attributes' => array(),
749
  'default' => ur_get_single_post_meta( $form_id, 'user_registration_form_setting_enable_recaptcha_support', 'no' ),
@@ -757,11 +788,11 @@ function ur_admin_form_settings_fields( $form_id ) {
757
  'class' => array( 'ur-enhanced-select' ),
758
  'input_class' => array(),
759
  'options' => array(
760
- 'Default' => __( 'Default', 'user-registration' ),
761
- 'Bordered' => __( 'Bordered', 'user-registration' ),
762
- 'Flat' => __( 'Flat', 'user-registration' ),
763
- 'Rounded' => __( 'Rounded', 'user-registration' ),
764
- 'Rounded Edge'=> __( 'Rounded Edge', 'user-registration' ),
765
  ),
766
  'custom_attributes' => array(),
767
  'default' => ur_get_single_post_meta( $form_id, 'user_registration_form_template', 'default' ),
@@ -775,9 +806,9 @@ function ur_admin_form_settings_fields( $form_id ) {
775
  'class' => array( 'ur-enhanced-select' ),
776
  'input_class' => array(),
777
  'custom_attributes' => array(),
778
- 'default' => ur_get_single_post_meta( $form_id, 'user_registration_form_custom_class' ),
779
  ),
780
- )
781
  );
782
 
783
  $arguments = apply_filters( 'user_registration_get_form_settings', $arguments );
@@ -787,24 +818,28 @@ function ur_admin_form_settings_fields( $form_id ) {
787
 
788
  /**
789
  * User Login Option
 
790
  * @return array
791
  */
792
  function ur_login_option() {
793
 
794
- return apply_filters( 'user_registration_login_options', array(
795
- 'default' => __( 'Manual login after registration', 'user-registration' ),
796
- 'email_confirmation' => __('Email confirmation to login', 'user-registration'),
797
- 'auto_login' => __( 'Auto login after registration', 'user-registration' ),
798
- 'admin_approval' => __( 'Admin approval after registration', 'user-registration' )
 
 
799
  )
800
  );
801
  }
802
 
803
  /**
804
  * Get Post meta value by meta key.
 
805
  * @param $post_id Post ID.
806
  * @param $meta_key Meta Key.
807
- * @param null $default
808
  *
809
  * @since 1.0.1
810
  *
@@ -823,6 +858,7 @@ function ur_get_single_post_meta( $post_id, $meta_key, $default = null ) {
823
 
824
  /**
825
  * Get general form settings by meta key (settings id).
 
826
  * @param $form_id Form ID.
827
  * @param $meta_key Meta Key.
828
  *
@@ -831,7 +867,7 @@ function ur_get_single_post_meta( $post_id, $meta_key, $default = null ) {
831
  function ur_get_form_setting_by_key( $form_id, $meta_key, $default = '' ) {
832
 
833
  $fields = ur_admin_form_settings_fields( $form_id );
834
- $value = '';
835
 
836
  foreach ( $fields as $field ) {
837
 
@@ -846,12 +882,13 @@ function ur_get_form_setting_by_key( $form_id, $meta_key, $default = '' ) {
846
 
847
  /**
848
  * Get user status in case of admin approval login option
 
849
  * @param $user_id
850
  * @return int $user_status
851
  */
852
  function ur_get_user_approval_status( $user_id ) {
853
 
854
- $user_status = 1;
855
 
856
  $login_option = get_option( 'user_registration_general_setting_login_options', '' );
857
 
@@ -865,6 +902,7 @@ function ur_get_user_approval_status( $user_id ) {
865
 
866
  /**
867
  * Get form data by key.
 
868
  * @param $form_data
869
  */
870
  function ur_get_form_data_by_key( $form_data, $key = null ) {
@@ -966,7 +1004,7 @@ function ur_get_logger() {
966
  if ( is_object( $class ) ) {
967
  $logger = $class;
968
  } else {
969
- $logger = new $class;
970
  }
971
  } else {
972
  ur_doing_it_wrong(
@@ -986,25 +1024,30 @@ function ur_get_logger() {
986
 
987
  /**
988
  * Handles addon plugin updater.
 
989
  * @param $file
990
  * @param $item_id
991
  * @param $addon_version
992
- * @param bool $beta
993
  *
994
  * @since 1.1.0
995
  */
996
- function ur_addon_updater( $file, $item_id, $addon_version, $beta= false ) {
997
  $api_endpoint = 'https://wpeverest.com/edd-sl-api/';
998
- $license_key = trim( get_option( 'user-registration_license_key' ) );
999
  if ( class_exists( 'UR_AddOn_Updater' ) ) {
1000
- $edd_updater = new UR_AddOn_Updater( $api_endpoint, $file, array(
1001
- 'version' => $addon_version,
1002
- 'license' => $license_key,
1003
- 'item_id' => $item_id,
1004
- 'author' => 'WPEverest',
1005
- 'url' => home_url(),
1006
- 'beta' => $beta ,
1007
- ) );
 
 
 
 
1008
  }
1009
 
1010
  }
@@ -1012,24 +1055,24 @@ function ur_addon_updater( $file, $item_id, $addon_version, $beta= false ) {
1012
  /**
1013
  * Check if username already exists in case of optional username
1014
  * And while stripping through email address and incremet last number by 1.
 
1015
  * @param string $username
1016
  * @return string $username Modified username
1017
  */
1018
  function check_username( $username ) {
1019
 
1020
- if( username_exists( $username ) ) {
1021
  $last_char = substr( $username, -1 );
1022
 
1023
- if( is_numeric( $last_char ) ) {
1024
  $strip_last_char = substr( $username, 0, -1 );
1025
- $last_char = $last_char+1;
1026
- $username = $strip_last_char.$last_char;
1027
- $username = check_username( $username );
1028
 
1029
  return $username;
1030
- }
1031
- else {
1032
- $username = $username.'_1';
1033
  $username = check_username( $username );
1034
 
1035
  return $username;
@@ -1041,17 +1084,18 @@ function check_username( $username ) {
1041
 
1042
  /**
1043
  * Get all user registration forms title with respective id.
 
1044
  * @return array $all_forms form id as key and form title as value.
1045
  */
1046
  function ur_get_all_user_registration_form() {
1047
 
1048
- $args = array(
1049
  'post_type' => 'user_registration',
1050
  'status' => 'publish',
1051
  );
1052
 
1053
  $posts_array = get_posts( $args );
1054
- $all_forms = array();
1055
 
1056
  foreach ( $posts_array as $post ) {
1057
  $all_forms[ $post->ID ] = $post->post_title;
@@ -1065,7 +1109,7 @@ function ur_get_all_user_registration_form() {
1065
  */
1066
  function ur_get_user_login_option() {
1067
 
1068
- if( 'email_confirmation' !== get_option( 'user_registration_general_setting_login_options' ) ) {
1069
  return array(
1070
  'title' => __( 'Disable emails', 'user-registration' ),
1071
  'desc' => __( 'Disable all emails sent after registration.', 'user-registration' ),
@@ -1074,41 +1118,45 @@ function ur_get_user_login_option() {
1074
  'type' => 'checkbox',
1075
  'autoload' => false,
1076
  );
1077
- }
1078
- else {
1079
- update_option( 'user_registration_email_setting_disable_email' , 'no');
1080
  }
1081
  }
1082
 
1083
  /**
1084
  * Get the node to display google reCaptcha
 
1085
  * @return string
1086
  */
1087
  function ur_get_recaptcha_node( $recaptcha_enabled = 'no', $context ) {
1088
 
1089
- $recaptcha_version = get_option( 'user_registration_integration_setting_recaptcha_version' );
1090
- $recaptcha_site_key = 'v3' === $recaptcha_version ? get_option( 'user_registration_integration_setting_recaptcha_site_key_v3' ) : get_option( 'user_registration_integration_setting_recaptcha_site_key' );
1091
- $recaptcha_site_secret = 'v3' === $recaptcha_version ? get_option( 'user_registration_integration_setting_recaptcha_site_secret_v3' ) : get_option( 'user_registration_integration_setting_recaptcha_site_secret' );
1092
 
1093
  static $rc_counter = 0;
1094
 
1095
  if ( 'yes' == $recaptcha_enabled && ! empty( $recaptcha_site_key ) && ! empty( $recaptcha_site_secret ) ) {
1096
 
1097
- if( 0 === $rc_counter ) {
1098
  $enqueue_script = 'v3' === $recaptcha_version ? 'ur-google-recaptcha-v3' : 'ur-google-recaptcha';
1099
  wp_enqueue_script( $enqueue_script );
1100
- wp_localize_script( $enqueue_script, 'ur_google_recaptcha_code', array(
1101
- 'site_key' => $recaptcha_site_key,
1102
- 'site_secret' => $recaptcha_site_secret,
1103
- 'is_captcha_enable' => true,
1104
- 'version' => $recaptcha_version,
1105
- ) );
1106
-
1107
- $rc_counter++;
 
 
 
 
1108
  }
1109
 
1110
- if( $recaptcha_version == 'v3' ) {
1111
- if( $context === 'login' ) {
1112
  $recaptcha_node = '<div id="node_recaptcha_login" class="g-recaptcha-v3" style="display:none"><textarea id="g-recaptcha-response" name="g-recaptcha-response" ></textarea></div>';
1113
  } elseif ( $context === 'register' ) {
1114
  $recaptcha_node = '<div id="node_recaptcha_register" class="g-recaptcha-v3" style="display:none"><textarea id="g-recaptcha-response" name="g-recaptcha-response" ></textarea></div>';
@@ -1117,16 +1165,15 @@ function ur_get_recaptcha_node( $recaptcha_enabled = 'no', $context ) {
1117
  }
1118
  } else {
1119
 
1120
- if( $context === 'login' ) {
1121
  $recaptcha_node = '<div id="node_recaptcha_login" class="g-recaptcha" style="margin-left:11px;transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;"></div>';
1122
 
1123
- } elseif ($context === 'register' ) {
1124
  $recaptcha_node = '<div id="node_recaptcha_register" class="g-recaptcha" style="margin-left:11px;transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;"></div>';
1125
  } else {
1126
  $recaptcha_node = '';
1127
  }
1128
  }
1129
-
1130
  } else {
1131
  $recaptcha_node = '';
1132
  }
@@ -1136,16 +1183,17 @@ function ur_get_recaptcha_node( $recaptcha_enabled = 'no', $context ) {
1136
 
1137
  /**
1138
  * Get meta key label pair by form id
1139
- * @param int $form_id Form ID.
 
1140
  * @since 1.5.0
1141
  * @return array $key_label
1142
  */
1143
  function ur_get_meta_key_label( $form_id ) {
1144
 
1145
- $key_label = array();
1146
- $post = get_post( $form_id );
1147
 
1148
- if( get_post_type( $post ) !== 'user_registration' ) {
1149
  return $key_label;
1150
  }
1151
 
@@ -1155,8 +1203,8 @@ function ur_get_meta_key_label( $form_id ) {
1155
  foreach ( $post_content_array as $post_content_row ) {
1156
  foreach ( $post_content_row as $post_content_grid ) {
1157
  foreach ( $post_content_grid as $field ) {
1158
- if( isset( $field->field_key ) && isset( $field->general_setting->field_name ) ) {
1159
- $key_label[ $field->general_setting->field_name ] = $field->general_setting->label;
1160
  }
1161
  }
1162
  }
@@ -1167,25 +1215,26 @@ function ur_get_meta_key_label( $form_id ) {
1167
 
1168
  /**
1169
  * Get all user registration fields of the user by querying to database.
1170
- * @param int $user_id User ID.
 
1171
  * @since 1.5.0
1172
- * @return array $name_value Meta key => value pair.
1173
  */
1174
  function ur_get_user_extra_fields( $user_id ) {
1175
 
1176
  global $wpdb;
1177
- $name_value = array();
1178
- $user_extra_fields = $wpdb->get_results( "SELECT * FROM $wpdb->usermeta WHERE meta_key LIKE 'user_registration\_%' AND user_id = ". $user_id ." ;" );
1179
 
1180
- foreach( $user_extra_fields as $extra_field ) {
1181
 
1182
  // Get meta key remove user_registration_ from the beginning
1183
  $key = isset( $extra_field->meta_key ) ? substr( $extra_field->meta_key, 18 ) : '';
1184
  $value = isset( $extra_field->meta_value ) ? $extra_field->meta_value : '';
1185
 
1186
- if( is_serialized( $value ) ) {
1187
  $value = unserialize( $value );
1188
- $value = implode( ",", $value );
1189
  }
1190
  $name_value[ $key ] = $value;
1191
  }
@@ -1195,6 +1244,7 @@ function ur_get_user_extra_fields( $user_id ) {
1195
 
1196
  /**
1197
  * Get link for back button used on email settings.
 
1198
  * @param string $label
1199
  * @param string $url ]
1200
  */
@@ -1214,18 +1264,20 @@ if ( ! function_exists( 'wp_doing_ajax' ) ) {
1214
 
1215
  /**
1216
  * Checks if the string is json or not
1217
- * @param string $str
 
1218
  * @since 1.4.2
1219
  * @return mixed
1220
  */
1221
  function ur_is_json( $str ) {
1222
- $json = json_decode( $str );
1223
- return $json && $str != $json;
1224
  }
1225
 
1226
  /**
1227
  * Checks if the form contains a date field or not.
1228
- * @param int $form_id Form ID
 
1229
  * @since 1.5.3
1230
  * @return boolean
1231
  */
@@ -1233,9 +1285,9 @@ function ur_has_date_field( $form_id ) {
1233
 
1234
  $post = get_post( $form_id );
1235
 
1236
- if( $post ) {
1237
 
1238
- if( $post->post_type !== 'user_registration' ) {
1239
  return false;
1240
  }
1241
 
@@ -1245,7 +1297,7 @@ function ur_has_date_field( $form_id ) {
1245
  foreach ( $post_content_array as $post_content_row ) {
1246
  foreach ( $post_content_row as $post_content_grid ) {
1247
  foreach ( $post_content_grid as $field ) {
1248
- if( isset( $field->field_key ) && $field->field_key === 'date' ) {
1249
  return true;
1250
  }
1251
  }
@@ -1312,14 +1364,14 @@ function ur_enqueue_js( $code ) {
1312
  function ur_delete_expired_transients() {
1313
  global $wpdb;
1314
 
1315
- $sql = "DELETE a, b FROM $wpdb->options a, $wpdb->options b
1316
  WHERE a.option_name LIKE %s
1317
  AND a.option_name NOT LIKE %s
1318
  AND b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, 12 ) )
1319
  AND b.option_value < %d";
1320
  $rows = $wpdb->query( $wpdb->prepare( $sql, $wpdb->esc_like( '_transient_' ) . '%', $wpdb->esc_like( '_transient_timeout_' ) . '%', time() ) ); // WPCS: unprepared SQL ok.
1321
 
1322
- $sql = "DELETE a, b FROM $wpdb->options a, $wpdb->options b
1323
  WHERE a.option_name LIKE %s
1324
  AND a.option_name NOT LIKE %s
1325
  AND b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) )
11
  defined( 'ABSPATH' ) || exit;
12
 
13
  // Include core functions (available in both admin and frontend).
14
+ require UR_ABSPATH . 'includes/functions-ur-page.php';
15
+ require UR_ABSPATH . 'includes/functions-ur-account.php';
16
+ require UR_ABSPATH . 'includes/functions-ur-deprecated.php';
17
 
18
  /**
19
  * Define a constant if it is not already defined.
128
  * @return string
129
  */
130
  function ur_sanitize_tooltip( $var ) {
131
+ return htmlspecialchars(
132
+ wp_kses(
133
+ html_entity_decode( $var ),
134
+ array(
135
+ 'br' => array(),
136
+ 'em' => array(),
137
+ 'strong' => array(),
138
+ 'small' => array(),
139
+ 'span' => array(),
140
+ 'ul' => array(),
141
+ 'li' => array(),
142
+ 'ol' => array(),
143
+ 'p' => array(),
144
+ )
145
+ )
146
+ );
147
  }
148
 
149
  /**
172
 
173
  do_action( 'user_registration_before_template_part', $template_name, $template_path, $located, $args );
174
 
175
+ include $located;
176
 
177
  do_action( 'user_registration_after_template_part', $template_name, $template_path, $located, $args );
178
  }
297
  */
298
  function ur_enable_ur_plugin_headers( $headers ) {
299
  if ( ! class_exists( 'UR_Plugin_Updates', false ) ) {
300
+ include_once dirname( __FILE__ ) . '/admin/updater/class-ur-plugin-updates.php';
301
  }
302
 
303
  $headers['URRequires'] = UR_Plugin_Updates::VERSION_REQUIRED_HEADER;
310
 
311
  /**
312
  * Set field type for all registrered field keys
313
+ *
314
  * @param string $field_key field's field key
315
  * @return string $field_type
316
  */
381
  * @return array
382
  */
383
  function ur_get_user_table_fields() {
384
+ return apply_filters(
385
+ 'user_registration_user_table_fields',
386
+ array(
387
+ 'user_email',
388
+ 'user_pass',
389
+ 'user_login',
390
+ 'user_url',
391
+ 'display_name',
392
+ )
393
+ );
394
  }
395
 
396
  /**
399
  * @return array
400
  */
401
  function ur_get_required_fields() {
402
+ return apply_filters(
403
+ 'user_registration_required_form_fields',
404
+ array(
405
+ 'user_email',
406
+ 'user_pass',
407
+ )
408
+ );
409
  }
410
 
411
  /**
424
  * @return array
425
  */
426
  function ur_exclude_profile_details_fields() {
427
+ return apply_filters(
428
+ 'user_registration_exclude_profile_fields',
429
+ array(
430
+ 'user_pass',
431
+ 'user_confirm_password',
432
+ )
433
+ );
434
  }
435
 
436
  /**
462
  }
463
 
464
  /**
465
+ * Get all default fields by WordPress.
466
  *
467
  * @return array
468
+ */
469
  function ur_get_user_field_only() {
470
+ return apply_filters(
471
+ 'user_registration_user_form_fields',
472
+ array(
473
+ 'user_email',
474
+ 'user_pass',
475
+ 'user_confirm_password',
476
+ 'user_login',
477
+ 'nickname',
478
+ 'first_name',
479
+ 'last_name',
480
+ 'user_url',
481
+ 'display_name',
482
+ 'description',
483
+ )
484
+ );
485
  }
486
 
487
  /**
488
  * Get all extra form fields
489
  *
490
  * @return array
491
+ */
492
  function ur_get_other_form_fields() {
493
  $registered = ur_get_registered_form_fields();
494
  $user_fields = ur_get_user_field_only();
499
 
500
  /**
501
  * All default fields storing in usermeta table
502
+ *
503
  * @return mixed|array
504
  */
505
  function ur_get_registered_user_meta_fields() {
506
+ return apply_filters(
507
+ 'user_registration_registered_user_meta_fields',
508
+ array(
509
+ 'nickname',
510
+ 'first_name',
511
+ 'last_name',
512
+ 'description',
513
+ )
514
+ );
515
  }
516
 
517
  /**
518
  * All registered form fields
519
+ *
520
  * @return mixed|array
521
  */
522
  function ur_get_registered_form_fields() {
523
+ return apply_filters(
524
+ 'user_registration_registered_form_fields',
525
+ array(
526
+ 'user_email',
527
+ 'user_pass',
528
+ 'user_confirm_password',
529
+ 'user_login',
530
+ 'nickname',
531
+ 'first_name',
532
+ 'last_name',
533
+ 'user_url',
534
+ 'display_name',
535
+ 'description',
536
+ 'text',
537
+ 'password',
538
+ 'email',
539
+ 'select',
540
+ 'country',
541
+ 'textarea',
542
+ 'number',
543
+ 'date',
544
+ 'checkbox',
545
+ 'privacy_policy',
546
+ 'radio',
547
+ )
548
+ );
549
  }
550
 
551
  /**
552
  * General settings for each fields
553
+ *
554
  * @param string $id id for each field
555
  * @return mixed|array
556
  */
557
  function ur_get_general_settings( $id ) {
558
 
559
  $general_settings = array(
560
+ 'label' => array(
561
  'type' => 'text',
562
  'label' => __( 'Label', 'user-registration' ),
563
  'name' => 'ur_general_setting[label]',
564
  'placeholder' => __( 'Label', 'user-registration' ),
565
  'required' => true,
566
  ),
567
+ 'description' => array(
568
  'type' => 'textarea',
569
  'label' => __( 'Description', 'user-registration' ),
570
  'name' => 'ur_general_setting[description]',
571
  'placeholder' => __( 'Description', 'user-registration' ),
572
  'required' => true,
573
  ),
574
+ 'field_name' => array(
575
  'type' => 'text',
576
  'label' => __( 'Field Name', 'user-registration' ),
577
  'name' => 'ur_general_setting[field_name]',
597
  'yes' => __( 'Yes', 'user-registration' ),
598
  ),
599
  ),
600
+ 'hide_label' => array(
601
  'type' => 'select',
602
  'label' => __( 'Hide Label', 'user-registration' ),
603
  'name' => 'ur_general_setting[hide_label]',
610
  ),
611
  );
612
 
613
+ $exclude_placeholder = apply_filters(
614
+ 'user_registration_exclude_placeholder',
615
  array(
616
  'checkbox',
617
  'country',
620
  'radio',
621
  'select',
622
  'file',
623
+ 'mailchimp',
624
  )
625
  );
626
+ $strip_id = substr( $id, 18 );
627
 
628
+ if ( in_array( $strip_id, $exclude_placeholder ) ) {
629
  unset( $general_settings['placeholder'] );
630
  }
631
 
644
  $class_path = apply_filters( 'user_registration_form_field_' . $class_key . '_path', $class_path );
645
  /* Backward Compat since 1.4.0 */
646
  if ( file_exists( $class_path ) ) {
647
+ $class_name = 'UR_' . join( '_', array_map( 'ucwords', $exploded_class ) );
648
  if ( ! class_exists( $class_name ) ) {
649
+ include_once $class_path;
650
  }
651
  }
652
  /* Backward compat end*/
656
 
657
  /**
658
  * List of all roles
659
+ *
660
  * @return array $all_roles
661
  */
662
  function ur_get_default_admin_roles() {
670
  $wp_roles = new WP_Roles();
671
  }
672
 
673
+ $roles = isset( $wp_roles->roles ) ? $wp_roles->roles : array();
674
  $all_roles = array();
675
 
676
  foreach ( $roles as $role_key => $role ) {
683
 
684
  /**
685
  * Random number generated by time()
686
+ *
687
  * @return int
688
  */
689
  function ur_get_random_number() {
694
 
695
  /**
696
  * General Form settings
697
+ *
698
  * @param int $form_id Form ID.
699
  *
700
  * @since 1.0.1
706
  $all_roles = ur_get_default_admin_roles();
707
 
708
  $arguments = array(
709
+ 'form_id' => $form_id,
710
 
711
  'setting_data' => array(
712
  array(
731
  'input_class' => array(),
732
  'options' => array(
733
  'yes' => __( 'Yes', 'user-registration' ),
734
+ 'no' => __( 'No', 'user-registration' ),
735
  ),
736
  'custom_attributes' => array(),
737
  'default' => ur_get_single_post_meta( $form_id, 'user_registration_form_setting_enable_strong_password', 'yes' ),
745
  'class' => array( 'ur-enhanced-select' ),
746
  'input_class' => array(),
747
  'options' => array(
748
+ '0' => __( 'Very Weak', 'user-registration' ),
749
+ '1' => __( 'Weak', 'user-registration' ),
750
+ '2' => __( 'Medium', 'user-registration' ),
751
+ '3' => __( 'Strong', 'user-registration' ),
752
  ),
753
  'custom_attributes' => array(),
754
  'default' => ur_get_single_post_meta( $form_id, 'user_registration_form_setting_minimum_password_strength', '3' ),
774
  'input_class' => array(),
775
  'options' => array(
776
  'yes' => __( 'Yes', 'user-registration' ),
777
+ 'no' => __( 'No', 'user-registration' ),
778
  ),
779
  'custom_attributes' => array(),
780
  'default' => ur_get_single_post_meta( $form_id, 'user_registration_form_setting_enable_recaptcha_support', 'no' ),
788
  'class' => array( 'ur-enhanced-select' ),
789
  'input_class' => array(),
790
  'options' => array(
791
+ 'Default' => __( 'Default', 'user-registration' ),
792
+ 'Bordered' => __( 'Bordered', 'user-registration' ),
793
+ 'Flat' => __( 'Flat', 'user-registration' ),
794
+ 'Rounded' => __( 'Rounded', 'user-registration' ),
795
+ 'Rounded Edge' => __( 'Rounded Edge', 'user-registration' ),
796
  ),
797
  'custom_attributes' => array(),
798
  'default' => ur_get_single_post_meta( $form_id, 'user_registration_form_template', 'default' ),
806
  'class' => array( 'ur-enhanced-select' ),
807
  'input_class' => array(),
808
  'custom_attributes' => array(),
809
+ 'default' => ur_get_single_post_meta( $form_id, 'user_registration_form_custom_class' ),
810
  ),
811
+ ),
812
  );
813
 
814
  $arguments = apply_filters( 'user_registration_get_form_settings', $arguments );
818
 
819
  /**
820
  * User Login Option
821
+ *
822
  * @return array
823
  */
824
  function ur_login_option() {
825
 
826
+ return apply_filters(
827
+ 'user_registration_login_options',
828
+ array(
829
+ 'default' => __( 'Manual login after registration', 'user-registration' ),
830
+ 'email_confirmation' => __( 'Email confirmation to login', 'user-registration' ),
831
+ 'auto_login' => __( 'Auto login after registration', 'user-registration' ),
832
+ 'admin_approval' => __( 'Admin approval after registration', 'user-registration' ),
833
  )
834
  );
835
  }
836
 
837
  /**
838
  * Get Post meta value by meta key.
839
+ *
840
  * @param $post_id Post ID.
841
  * @param $meta_key Meta Key.
842
+ * @param null $default
843
  *
844
  * @since 1.0.1
845
  *
858
 
859
  /**
860
  * Get general form settings by meta key (settings id).
861
+ *
862
  * @param $form_id Form ID.
863
  * @param $meta_key Meta Key.
864
  *
867
  function ur_get_form_setting_by_key( $form_id, $meta_key, $default = '' ) {
868
 
869
  $fields = ur_admin_form_settings_fields( $form_id );
870
+ $value = '';
871
 
872
  foreach ( $fields as $field ) {
873
 
882
 
883
  /**
884
  * Get user status in case of admin approval login option
885
+ *
886
  * @param $user_id
887
  * @return int $user_status
888
  */
889
  function ur_get_user_approval_status( $user_id ) {
890
 
891
+ $user_status = 1;
892
 
893
  $login_option = get_option( 'user_registration_general_setting_login_options', '' );
894
 
902
 
903
  /**
904
  * Get form data by key.
905
+ *
906
  * @param $form_data
907
  */
908
  function ur_get_form_data_by_key( $form_data, $key = null ) {
1004
  if ( is_object( $class ) ) {
1005
  $logger = $class;
1006
  } else {
1007
+ $logger = new $class();
1008
  }
1009
  } else {
1010
  ur_doing_it_wrong(
1024
 
1025
  /**
1026
  * Handles addon plugin updater.
1027
+ *
1028
  * @param $file
1029
  * @param $item_id
1030
  * @param $addon_version
1031
+ * @param bool $beta
1032
  *
1033
  * @since 1.1.0
1034
  */
1035
+ function ur_addon_updater( $file, $item_id, $addon_version, $beta = false ) {
1036
  $api_endpoint = 'https://wpeverest.com/edd-sl-api/';
1037
+ $license_key = trim( get_option( 'user-registration_license_key' ) );
1038
  if ( class_exists( 'UR_AddOn_Updater' ) ) {
1039
+ $edd_updater = new UR_AddOn_Updater(
1040
+ $api_endpoint,
1041
+ $file,
1042
+ array(
1043
+ 'version' => $addon_version,
1044
+ 'license' => $license_key,
1045
+ 'item_id' => $item_id,
1046
+ 'author' => 'WPEverest',
1047
+ 'url' => home_url(),
1048
+ 'beta' => $beta,
1049
+ )
1050
+ );
1051
  }
1052
 
1053
  }
1055
  /**
1056
  * Check if username already exists in case of optional username
1057
  * And while stripping through email address and incremet last number by 1.
1058
+ *
1059
  * @param string $username
1060
  * @return string $username Modified username
1061
  */
1062
  function check_username( $username ) {
1063
 
1064
+ if ( username_exists( $username ) ) {
1065
  $last_char = substr( $username, -1 );
1066
 
1067
+ if ( is_numeric( $last_char ) ) {
1068
  $strip_last_char = substr( $username, 0, -1 );
1069
+ $last_char = $last_char + 1;
1070
+ $username = $strip_last_char . $last_char;
1071
+ $username = check_username( $username );
1072
 
1073
  return $username;
1074
+ } else {
1075
+ $username = $username . '_1';
 
1076
  $username = check_username( $username );
1077
 
1078
  return $username;
1084
 
1085
  /**
1086
  * Get all user registration forms title with respective id.
1087
+ *
1088
  * @return array $all_forms form id as key and form title as value.
1089
  */
1090
  function ur_get_all_user_registration_form() {
1091
 
1092
+ $args = array(
1093
  'post_type' => 'user_registration',
1094
  'status' => 'publish',
1095
  );
1096
 
1097
  $posts_array = get_posts( $args );
1098
+ $all_forms = array();
1099
 
1100
  foreach ( $posts_array as $post ) {
1101
  $all_forms[ $post->ID ] = $post->post_title;
1109
  */
1110
  function ur_get_user_login_option() {
1111
 
1112
+ if ( 'email_confirmation' !== get_option( 'user_registration_general_setting_login_options' ) ) {
1113
  return array(
1114
  'title' => __( 'Disable emails', 'user-registration' ),
1115
  'desc' => __( 'Disable all emails sent after registration.', 'user-registration' ),
1118
  'type' => 'checkbox',
1119
  'autoload' => false,
1120
  );
1121
+ } else {
1122
+ update_option( 'user_registration_email_setting_disable_email', 'no' );
 
1123
  }
1124
  }
1125
 
1126
  /**
1127
  * Get the node to display google reCaptcha
1128
+ *
1129
  * @return string
1130
  */
1131
  function ur_get_recaptcha_node( $recaptcha_enabled = 'no', $context ) {
1132
 
1133
+ $recaptcha_version = get_option( 'user_registration_integration_setting_recaptcha_version' );
1134
+ $recaptcha_site_key = 'v3' === $recaptcha_version ? get_option( 'user_registration_integration_setting_recaptcha_site_key_v3' ) : get_option( 'user_registration_integration_setting_recaptcha_site_key' );
1135
+ $recaptcha_site_secret = 'v3' === $recaptcha_version ? get_option( 'user_registration_integration_setting_recaptcha_site_secret_v3' ) : get_option( 'user_registration_integration_setting_recaptcha_site_secret' );
1136
 
1137
  static $rc_counter = 0;
1138
 
1139
  if ( 'yes' == $recaptcha_enabled && ! empty( $recaptcha_site_key ) && ! empty( $recaptcha_site_secret ) ) {
1140
 
1141
+ if ( 0 === $rc_counter ) {
1142
  $enqueue_script = 'v3' === $recaptcha_version ? 'ur-google-recaptcha-v3' : 'ur-google-recaptcha';
1143
  wp_enqueue_script( $enqueue_script );
1144
+ wp_localize_script(
1145
+ $enqueue_script,
1146
+ 'ur_google_recaptcha_code',
1147
+ array(
1148
+ 'site_key' => $recaptcha_site_key,
1149
+ 'site_secret' => $recaptcha_site_secret,
1150
+ 'is_captcha_enable' => true,
1151
+ 'version' => $recaptcha_version,
1152
+ )
1153
+ );
1154
+
1155
+ $rc_counter++;
1156
  }
1157
 
1158
+ if ( $recaptcha_version == 'v3' ) {
1159
+ if ( $context === 'login' ) {
1160
  $recaptcha_node = '<div id="node_recaptcha_login" class="g-recaptcha-v3" style="display:none"><textarea id="g-recaptcha-response" name="g-recaptcha-response" ></textarea></div>';
1161
  } elseif ( $context === 'register' ) {
1162
  $recaptcha_node = '<div id="node_recaptcha_register" class="g-recaptcha-v3" style="display:none"><textarea id="g-recaptcha-response" name="g-recaptcha-response" ></textarea></div>';
1165
  }
1166
  } else {
1167
 
1168
+ if ( $context === 'login' ) {
1169
  $recaptcha_node = '<div id="node_recaptcha_login" class="g-recaptcha" style="margin-left:11px;transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;"></div>';
1170
 
1171
+ } elseif ( $context === 'register' ) {
1172
  $recaptcha_node = '<div id="node_recaptcha_register" class="g-recaptcha" style="margin-left:11px;transform:scale(0.77);-webkit-transform:scale(0.77);transform-origin:0 0;-webkit-transform-origin:0 0;"></div>';
1173
  } else {
1174
  $recaptcha_node = '';
1175
  }
1176
  }
 
1177
  } else {
1178
  $recaptcha_node = '';
1179
  }
1183
 
1184
  /**
1185
  * Get meta key label pair by form id
1186
+ *
1187
+ * @param int $form_id Form ID.
1188
  * @since 1.5.0
1189
  * @return array $key_label
1190
  */
1191
  function ur_get_meta_key_label( $form_id ) {
1192
 
1193
+ $key_label = array();
1194
+ $post = get_post( $form_id );
1195
 
1196
+ if ( get_post_type( $post ) !== 'user_registration' ) {
1197
  return $key_label;
1198
  }
1199
 
1203
  foreach ( $post_content_array as $post_content_row ) {
1204
  foreach ( $post_content_row as $post_content_grid ) {
1205
  foreach ( $post_content_grid as $field ) {
1206
+ if ( isset( $field->field_key ) && isset( $field->general_setting->field_name ) ) {
1207
+ $key_label[ $field->general_setting->field_name ] = $field->general_setting->label;
1208
  }
1209
  }
1210
  }
1215
 
1216
  /**
1217
  * Get all user registration fields of the user by querying to database.
1218
+ *
1219
+ * @param int $user_id User ID.
1220
  * @since 1.5.0
1221
+ * @return array $name_value Meta key => value pair.
1222
  */
1223
  function ur_get_user_extra_fields( $user_id ) {
1224
 
1225
  global $wpdb;
1226
+ $name_value = array();
1227
+ $user_extra_fields = $wpdb->get_results( "SELECT * FROM $wpdb->usermeta WHERE meta_key LIKE 'user_registration\_%' AND user_id = " . $user_id . ' ;' );
1228
 
1229
+ foreach ( $user_extra_fields as $extra_field ) {
1230
 
1231
  // Get meta key remove user_registration_ from the beginning
1232
  $key = isset( $extra_field->meta_key ) ? substr( $extra_field->meta_key, 18 ) : '';
1233
  $value = isset( $extra_field->meta_value ) ? $extra_field->meta_value : '';
1234
 
1235
+ if ( is_serialized( $value ) ) {
1236
  $value = unserialize( $value );
1237
+ $value = implode( ',', $value );
1238
  }
1239
  $name_value[ $key ] = $value;
1240
  }
1244
 
1245
  /**
1246
  * Get link for back button used on email settings.
1247
+ *
1248
  * @param string $label
1249
  * @param string $url ]
1250
  */
1264
 
1265
  /**
1266
  * Checks if the string is json or not
1267
+ *
1268
+ * @param string $str
1269
  * @since 1.4.2
1270
  * @return mixed
1271
  */
1272
  function ur_is_json( $str ) {
1273
+ $json = json_decode( $str );
1274
+ return $json && $str != $json;
1275
  }
1276
 
1277
  /**
1278
  * Checks if the form contains a date field or not.
1279
+ *
1280
+ * @param int $form_id Form ID
1281
  * @since 1.5.3
1282
  * @return boolean
1283
  */
1285
 
1286
  $post = get_post( $form_id );
1287
 
1288
+ if ( $post ) {
1289
 
1290
+ if ( $post->post_type !== 'user_registration' ) {
1291
  return false;
1292
  }
1293
 
1297
  foreach ( $post_content_array as $post_content_row ) {
1298
  foreach ( $post_content_row as $post_content_grid ) {
1299
  foreach ( $post_content_grid as $field ) {
1300
+ if ( isset( $field->field_key ) && $field->field_key === 'date' ) {
1301
  return true;
1302
  }
1303
  }
1364
  function ur_delete_expired_transients() {
1365
  global $wpdb;
1366
 
1367
+ $sql = "DELETE a, b FROM $wpdb->options a, $wpdb->options b
1368
  WHERE a.option_name LIKE %s
1369
  AND a.option_name NOT LIKE %s
1370
  AND b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, 12 ) )
1371
  AND b.option_value < %d";
1372
  $rows = $wpdb->query( $wpdb->prepare( $sql, $wpdb->esc_like( '_transient_' ) . '%', $wpdb->esc_like( '_transient_timeout_' ) . '%', time() ) ); // WPCS: unprepared SQL ok.
1373
 
1374
+ $sql = "DELETE a, b FROM $wpdb->options a, $wpdb->options b
1375
  WHERE a.option_name LIKE %s
1376
  AND a.option_name NOT LIKE %s
1377
  AND b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) )
includes/functions-ur-deprecated.php CHANGED
@@ -131,4 +131,4 @@ function ur_deprecated_argument( $argument, $version, $message = null ) {
131
  _deprecated_argument( $argument, $version, $message );
132
  }
133
  // @codingStandardsIgnoreEnd
134
- }
131
  _deprecated_argument( $argument, $version, $message );
132
  }
133
  // @codingStandardsIgnoreEnd
134
+ }
includes/functions-ur-notice.php CHANGED
@@ -143,10 +143,12 @@ function ur_print_notices() {
143
  foreach ( $notice_types as $notice_type ) {
144
  if ( ur_notice_count( $notice_type ) > 0 ) {
145
 
146
-
147
- ur_get_template( "notices/{$notice_type}.php", array(
148
- 'messages' => array_filter( $all_notices[ $notice_type ] ),
149
- ) );
 
 
150
  }
151
  }
152
 
@@ -166,9 +168,12 @@ function ur_print_notice( $message, $notice_type = 'success' ) {
166
  $message = apply_filters( 'user_registration_add_message', $message );
167
  }
168
 
169
- ur_get_template( "notices/{$notice_type}.php", array(
170
- 'messages' => array( apply_filters( 'user_registration_add_' . $notice_type, $message ) ),
171
- ) );
 
 
 
172
  }
173
 
174
  /**
143
  foreach ( $notice_types as $notice_type ) {
144
  if ( ur_notice_count( $notice_type ) > 0 ) {
145
 
146
+ ur_get_template(
147
+ "notices/{$notice_type}.php",
148
+ array(
149
+ 'messages' => array_filter( $all_notices[ $notice_type ] ),
150
+ )
151
+ );
152
  }
153
  }
154
 
168
  $message = apply_filters( 'user_registration_add_message', $message );
169
  }
170
 
171
+ ur_get_template(
172
+ "notices/{$notice_type}.php",
173
+ array(
174
+ 'messages' => array( apply_filters( 'user_registration_add_' . $notice_type, $message ) ),
175
+ )
176
+ );
177
  }
178
 
179
  /**
includes/functions-ur-page.php CHANGED
@@ -57,7 +57,7 @@ add_filter( 'the_title', 'ur_page_endpoint_title', 20 );
57
  */
58
  function ur_get_page_id( $page ) {
59
 
60
- if( 'myaccount' === $page && ur_post_content_has_shortcode( 'user_registration_my_account' ) ) {
61
  $page = get_the_ID();
62
  } else {
63
  $page = apply_filters( 'user_registration_get_' . $page . '_page_id', get_option( 'user_registration_' . $page . '_page_id' ) );
57
  */
58
  function ur_get_page_id( $page ) {
59
 
60
+ if ( 'myaccount' === $page && ur_post_content_has_shortcode( 'user_registration_my_account' ) ) {
61
  $page = get_the_ID();
62
  } else {
63
  $page = apply_filters( 'user_registration_get_' . $page . '_page_id', get_option( 'user_registration_' . $page . '_page_id' ) );
includes/functions-ur-template.php CHANGED
@@ -48,7 +48,7 @@ function ur_login_template_redirect() {
48
  if ( ( has_shortcode( $post_content, 'user_registration_login' ) || has_shortcode( $post_content, 'user_registration_my_account' ) ) && is_user_logged_in() ) {
49
  preg_match( '/' . get_shortcode_regex() . '/s', $post_content, $matches );
50
 
51
- $attributes = shortcode_parse_atts( $matches[3] );
52
  $redirect_url = isset( $attributes['redirect_url'] ) ? $attributes['redirect_url'] : '';
53
  $redirect_url = trim( $redirect_url, ']' );
54
  $redirect_url = trim( $redirect_url, '"' );
@@ -64,20 +64,21 @@ function ur_login_template_redirect() {
64
  /**
65
  * Redirects the logged in user to the option set in settings if registration page is selected.
66
  * Donot redirect for admins.
 
67
  * @return void
68
  * @since 1.5.1
69
  */
70
  function ur_registration_template_redirect() {
71
 
72
  // Return if the user is not logged in.
73
- if( is_user_logged_in() === false ) {
74
  return;
75
  }
76
 
77
  $current_user = wp_get_current_user();
78
 
79
  // Donot redirect for admins.
80
- if( in_array( 'administrator', wp_get_current_user()->roles) ) {
81
  return;
82
  } else {
83
 
@@ -90,7 +91,7 @@ function ur_registration_template_redirect() {
90
  $redirect_url = get_option( 'user_registration_general_setting_redirect_options' );
91
  $redirect_url = apply_filters( 'user_registration_redirect_from_registration_page', $redirect_url, $current_user );
92
 
93
- if( ! empty( $redirect_url ) ) {
94
  wp_redirect( $redirect_url );
95
  exit();
96
  }
@@ -136,21 +137,21 @@ if ( ! function_exists( 'user_registration_form_field' ) ) {
136
  function user_registration_form_field( $key, $args, $value = null ) {
137
 
138
  /* Conditional Logic codes */
139
- $rules = array();
140
- $rules['conditional_rules'] = isset ( $args['conditional_rules'] ) ? $args['conditional_rules'] : '';
141
- $rules['logic_gate'] = isset( $args['logic_gate'] ) ? $args['logic_gate'] : '';
142
- $rules['rules'] = isset( $args['rules'] ) ? $args['rules'] : array();
143
- $rules['required'] = isset( $args['required'] ) ? $args['required'] : '';
144
-
145
- foreach( $rules['rules'] as $rules_key => $rule ) {
146
- if( empty( $rule['field'] ) ) {
147
- unset( $rules['rules'][ $rules_key ] );
148
- }
149
  }
 
150
 
151
  $rules['rules'] = array_values( $rules['rules'] );
152
 
153
- $rules = ( ! empty( $rules['rules'] ) && isset( $args['enable_conditional_logic'] ) ) ? wp_json_encode( $rules ) : "";
154
  /*Conditonal Logic codes end*/
155
 
156
  $defaults = array(
@@ -225,58 +226,58 @@ if ( ! function_exists( 'user_registration_form_field' ) ) {
225
  }
226
  switch ( $args['type'] ) {
227
 
228
- case 'textarea' :
229
  $field .= '<textarea data-rules="' . esc_attr( $rules ) . '" data-id=""' . esc_attr( $key ) . '"" name="' . esc_attr( $key ) . '" class="input-text ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" id="' . esc_attr( $args['id'] ) . '" placeholder="' . esc_attr( $args['placeholder'] ) . '" ' . ( empty( $args['custom_attributes']['rows'] ) ? ' rows="2"' : '' ) . ( empty( $args['custom_attributes']['cols'] ) ? ' cols="5"' : '' ) . implode( ' ', $custom_attributes ) . '>' . esc_textarea( $value ) . '</textarea>';
230
  break;
231
 
232
- case 'checkbox' :
233
  $field_key = isset( $args['field_key'] ) ? $args['field_key'] : '';
234
- $default = $args['default'];
235
 
236
- if( isset( $args['choices'] ) && array_filter( $args['choices'] ) ) {
237
 
238
- if( ! empty( $default ) ) {
239
  $default = ( is_serialized( $default ) ) ? unserialize( $default ) : $default;
240
  }
241
 
242
  $choices = isset( $args['choices'] ) ? $args['choices'] : array();
243
 
244
- $field = '<label class="checkbox ' . implode( ' ', $custom_attributes ) . '">';
245
- $field .= $args['label'] . $required . '</label>';
246
  if ( $args['description'] ) {
247
  $field .= '<span class="description">' . $args['description'] . '</span>';
248
  }
249
- $checkbox_start =0;
250
  foreach ( $choices as $choice_index => $choice ) {
251
 
252
  $value = '';
253
  if ( is_array( $default ) && in_array( trim( $choice ), $default ) ) {
254
  $value = 'checked="checked"';
255
- } elseif( $default === $choice ) {
256
  $value = 'checked="checked"';
257
  }
258
 
259
  $field .= '<label>';
260
- $field .= ' <input data-rules="' . esc_attr( $rules ) . '" data-id="' . esc_attr( $key ) . '" ' . implode( ' ', $custom_attributes ) . ' data-value="' . $choice_index . '" type="' . esc_attr( $args['type'] ) . '" class="input-checkbox ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" name="' . esc_attr( $key ) . '[]" id="' . esc_attr( $args['id'] ) . '_' . esc_attr( $choice_index ) . '" value="'.trim($choice).'"' . $value . ' /> ';
261
  $field .= trim( $choice ) . ' </label>';
262
  $checkbox_start++;
263
  }
264
  } else {
265
  $field = '<label class="checkbox ' . implode( ' ', $custom_attributes ) . '">
266
  <input data-rules="' . esc_attr( $rules ) . '" data-id="' . esc_attr( $key ) . '" ' . implode( ' ', $custom_attributes ) . ' data-value="' . $value . '" type="' . esc_attr( $args['type'] ) . '" class="input-checkbox ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" value="1" ' . checked( $value, 1, false ) . ' /> '
267
- . $args['label'] . $required . '</label>';
268
- if ( $args['description'] ) {
269
  $field .= '<span class="description">' . $args['description'] . '</span>';
270
  }
271
  }
272
  break;
273
 
274
- case 'password' :
275
- case 'text' :
276
- case 'email' :
277
- case 'tel' :
278
- case 'number' :
279
- case 'url' :
280
  case 'date':
281
  case 'file':
282
  case 'timepicker':
@@ -284,14 +285,13 @@ if ( ! function_exists( 'user_registration_form_field' ) ) {
284
  $extra_params = json_decode( get_user_meta( get_current_user_id(), $extra_params_key, true ) );
285
 
286
  if ( empty( $extra_params ) ) {
287
- $field .= '<input data-rules="' . esc_attr( $rules ) . '" data-id="' . esc_attr( $key ) . '" type="' . esc_attr( $args['type'] ) . '" class="input-text input-' . esc_attr( $args['type'] ) ." " .esc_attr( implode( ' ', $args['input_class'] ) ) . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" placeholder="' . esc_attr( $args['placeholder'] ) . '" value="' . esc_attr( $value ) . '" ' . implode( ' ', $custom_attributes ) . ' />';
288
- }
289
- else {
290
  $field .= '<input data-rules="' . esc_attr( $rules ) . '" data-id="' . esc_attr( $key ) . '" type="' . esc_attr( $args['type'] ) . '" class="input-text ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" placeholder="' . esc_attr( $args['placeholder'] ) . '" value="' . esc_attr( $value ) . '" ' . implode( ' ', $custom_attributes ) . ' />';
291
  }
292
  break;
293
 
294
- case 'select' :
295
  $options = $field .= '';
296
  if ( ! empty( $args['options'] ) ) {
297
  foreach ( $args['options'] as $option_key => $option_text ) {
@@ -312,10 +312,10 @@ if ( ! function_exists( 'user_registration_form_field' ) ) {
312
  }
313
  break;
314
 
315
- case 'multiselect' :
316
  $options = $field .= '';
317
 
318
- if( is_serialized( $value ) ) {
319
  $default_value = unserialize( $value );
320
  } else {
321
  $default_value = $value;
@@ -332,10 +332,9 @@ if ( ! function_exists( 'user_registration_form_field' ) ) {
332
  $custom_attributes[] = 'data-allow_clear="true"';
333
  }
334
 
335
- if( is_array( $default_value ) ) {
336
  $options .= '<option value="' . esc_attr( trim( $option_key ) ) . '" ' . selected( in_array( trim( $option_key ), $default_value ), true, false ) . '>' . esc_attr( trim( $option_text ) ) . '</option>';
337
- }
338
- else {
339
  $options .= '<option value="' . esc_attr( trim( $option_key ) ) . '" ' . selected( $default_value, trim( $option_key ), false ) . '>' . esc_attr( trim( $option_text ) ) . '</option>';
340
  }
341
  }
@@ -346,20 +345,23 @@ if ( ! function_exists( 'user_registration_form_field' ) ) {
346
  }
347
  break;
348
 
349
- case 'radio' :
350
  $label_id = current( array_keys( $args['options'] ) );
351
  if ( ! empty( $args['options'] ) ) {
352
  foreach ( $args['options'] as $option_key => $option_text ) {
353
 
354
  $field .= '<label for="' . esc_attr( $args['id'] ) . '_' . esc_attr( $option_key ) . '" class="radio">';
355
 
356
- $field .= '<input data-rules="' . esc_attr( $rules ) . '" data-id="' . esc_attr( $key ) . '" type="radio" class="input-radio ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" value="' . esc_attr( trim ( $option_key ) ) . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '_' . esc_attr( $option_key ) . '" ' . implode( ' ', $custom_attributes ) . ' / ' . checked( $value, trim( $option_key ), false ) . ' />' . wp_kses( trim( $option_text ), array(
 
 
357
  'a' => array(
358
  'href' => array(),
359
- 'title' => array()
360
  ),
361
- 'span' => array()
362
- ) ) . '</label>';
 
363
  }
364
  }
365
  break;
@@ -370,16 +372,19 @@ if ( ! function_exists( 'user_registration_form_field' ) ) {
370
 
371
  $field_html = '';
372
  if ( $args['label'] && 'checkbox' != $args['type'] ) {
373
- $field_html .= '<label for="' . esc_attr( $label_id ) . '">' . wp_kses( $args['label'], array(
 
 
374
  'a' => array(
375
  'href' => array(),
376
- 'title' => array()
377
  ),
378
- 'span' => array()
379
- ) ) . $required . '</label>';
 
380
  }
381
 
382
- $field_html .= $field;
383
  $container_class = esc_attr( implode( ' ', $args['class'] ) );
384
  $container_id = esc_attr( $args['id'] ) . '_field';
385
  $field = sprintf( $field_container, $container_class, $container_id, $field_html );
@@ -407,13 +412,13 @@ if ( ! function_exists( 'user_registration_form_data' ) ) {
407
  function user_registration_form_data( $user_id = 0, $form_id = 0 ) {
408
  $all_meta_value = get_user_meta( $user_id );
409
 
410
- $fields = array();
411
- $args = array(
412
  'post_type' => 'user_registration',
413
  'post_status' => 'publish',
414
- 'post__in' => array( $form_id),
415
  );
416
- $post_data = get_posts( $args );
417
  $post_content = isset( $post_data[0]->post_content ) ? $post_data[0]->post_content : '';
418
  $post_content_array = json_decode( $post_content );
419
  if ( gettype( $post_content_array ) != 'array' ) {
@@ -428,13 +433,13 @@ if ( ! function_exists( 'user_registration_form_data' ) ) {
428
  foreach ( $post_content_array as $post_content_row ) {
429
  foreach ( $post_content_row as $post_content_grid ) {
430
  foreach ( $post_content_grid as $field ) {
431
- $field_name = isset( $field->general_setting->field_name ) ? $field->general_setting->field_name : '';
432
- $field_label = isset( $field->general_setting->label ) ? $field->general_setting->label : '';
433
  $field_description = isset( $field->general_setting->description ) ? $field->general_setting->description : '';
434
- $field_key = isset( $field->field_key ) ? ( $field->field_key ) : '';
435
- $field_type = isset( $field->field_key ) ? ur_get_field_type( $field_key ) : '';
436
- $required = isset( $field->general_setting->required ) ? $field->general_setting->required :'';
437
- $required = 'yes' == $required ? true : false;
438
 
439
  if ( empty( $field_label ) ) {
440
  $field_label_array = explode( '_', $field_name );
@@ -449,16 +454,16 @@ if ( ! function_exists( 'user_registration_form_data' ) ) {
449
  case 'radio':
450
  case 'select':
451
  $extra_params['options'] = explode( ',', $field->advance_setting->options );
452
- foreach ($extra_params['options'] as $key => $value) {
453
- $extra_params['options'][$value] = $value;
454
- unset($extra_params['options'][$key]);
455
  }
456
  break;
457
  case 'checkbox':
458
  $extra_params['choices'] = explode( ',', $field->advance_setting->choices );
459
- foreach ($extra_params['choices'] as $key => $value) {
460
- $extra_params['choices'][$value] = $value;
461
- unset($extra_params['choices'][$key]);
462
  }
463
  break;
464
  case 'country':
@@ -492,10 +497,10 @@ if ( ! function_exists( 'user_registration_form_data' ) ) {
492
  if ( isset( $fields[ 'user_registration_' . $field_name ] ) && count( $extra_params ) > 0 ) {
493
  $fields[ 'user_registration_' . $field_name ] = array_merge( $fields[ 'user_registration_' . $field_name ], $extra_params );
494
  }
495
- $filter_data = array(
496
  'fields' => $fields,
497
  'field' => $field,
498
- 'field_name' => $field_name
499
  );
500
 
501
  $filtered_data_array = apply_filters( 'user_registration_profile_account_filter_' . $field_key, $filter_data );
@@ -533,9 +538,12 @@ if ( ! function_exists( 'user_registration_account_content' ) ) {
533
  }
534
 
535
  // No endpoint found? Default to dashboard.
536
- ur_get_template( 'myaccount/dashboard.php', array(
537
- 'current_user' => get_user_by( 'id', get_current_user_id() ),
538
- ) );
 
 
 
539
  }
540
  }
541
 
48
  if ( ( has_shortcode( $post_content, 'user_registration_login' ) || has_shortcode( $post_content, 'user_registration_my_account' ) ) && is_user_logged_in() ) {
49
  preg_match( '/' . get_shortcode_regex() . '/s', $post_content, $matches );
50
 
51
+ $attributes = shortcode_parse_atts( $matches[3] );
52
  $redirect_url = isset( $attributes['redirect_url'] ) ? $attributes['redirect_url'] : '';
53
  $redirect_url = trim( $redirect_url, ']' );
54
  $redirect_url = trim( $redirect_url, '"' );
64
  /**
65
  * Redirects the logged in user to the option set in settings if registration page is selected.
66
  * Donot redirect for admins.
67
+ *
68
  * @return void
69
  * @since 1.5.1
70
  */
71
  function ur_registration_template_redirect() {
72
 
73
  // Return if the user is not logged in.
74
+ if ( is_user_logged_in() === false ) {
75
  return;
76
  }
77
 
78
  $current_user = wp_get_current_user();
79
 
80
  // Donot redirect for admins.
81
+ if ( in_array( 'administrator', wp_get_current_user()->roles ) ) {
82
  return;
83
  } else {
84
 
91
  $redirect_url = get_option( 'user_registration_general_setting_redirect_options' );
92
  $redirect_url = apply_filters( 'user_registration_redirect_from_registration_page', $redirect_url, $current_user );
93
 
94
+ if ( ! empty( $redirect_url ) ) {
95
  wp_redirect( $redirect_url );
96
  exit();
97
  }
137
  function user_registration_form_field( $key, $args, $value = null ) {
138
 
139
  /* Conditional Logic codes */
140
+ $rules = array();
141
+ $rules['conditional_rules'] = isset( $args['conditional_rules'] ) ? $args['conditional_rules'] : '';
142
+ $rules['logic_gate'] = isset( $args['logic_gate'] ) ? $args['logic_gate'] : '';
143
+ $rules['rules'] = isset( $args['rules'] ) ? $args['rules'] : array();
144
+ $rules['required'] = isset( $args['required'] ) ? $args['required'] : '';
145
+
146
+ foreach ( $rules['rules'] as $rules_key => $rule ) {
147
+ if ( empty( $rule['field'] ) ) {
148
+ unset( $rules['rules'][ $rules_key ] );
 
149
  }
150
+ }
151
 
152
  $rules['rules'] = array_values( $rules['rules'] );
153
 
154
+ $rules = ( ! empty( $rules['rules'] ) && isset( $args['enable_conditional_logic'] ) ) ? wp_json_encode( $rules ) : '';
155
  /*Conditonal Logic codes end*/
156
 
157
  $defaults = array(
226
  }
227
  switch ( $args['type'] ) {
228
 
229
+ case 'textarea':
230
  $field .= '<textarea data-rules="' . esc_attr( $rules ) . '" data-id=""' . esc_attr( $key ) . '"" name="' . esc_attr( $key ) . '" class="input-text ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" id="' . esc_attr( $args['id'] ) . '" placeholder="' . esc_attr( $args['placeholder'] ) . '" ' . ( empty( $args['custom_attributes']['rows'] ) ? ' rows="2"' : '' ) . ( empty( $args['custom_attributes']['cols'] ) ? ' cols="5"' : '' ) . implode( ' ', $custom_attributes ) . '>' . esc_textarea( $value ) . '</textarea>';
231
  break;
232
 
233
+ case 'checkbox':
234
  $field_key = isset( $args['field_key'] ) ? $args['field_key'] : '';
235
+ $default = $args['default'];
236
 
237
+ if ( isset( $args['choices'] ) && array_filter( $args['choices'] ) ) {
238
 
239
+ if ( ! empty( $default ) ) {
240
  $default = ( is_serialized( $default ) ) ? unserialize( $default ) : $default;
241
  }
242
 
243
  $choices = isset( $args['choices'] ) ? $args['choices'] : array();
244
 
245
+ $field = '<label class="checkbox ' . implode( ' ', $custom_attributes ) . '">';
246
+ $field .= $args['label'] . $required . '</label>';
247
  if ( $args['description'] ) {
248
  $field .= '<span class="description">' . $args['description'] . '</span>';
249
  }
250
+ $checkbox_start = 0;
251
  foreach ( $choices as $choice_index => $choice ) {
252
 
253
  $value = '';
254
  if ( is_array( $default ) && in_array( trim( $choice ), $default ) ) {
255
  $value = 'checked="checked"';
256
+ } elseif ( $default === $choice ) {
257
  $value = 'checked="checked"';
258
  }
259
 
260
  $field .= '<label>';
261
+ $field .= ' <input data-rules="' . esc_attr( $rules ) . '" data-id="' . esc_attr( $key ) . '" ' . implode( ' ', $custom_attributes ) . ' data-value="' . $choice_index . '" type="' . esc_attr( $args['type'] ) . '" class="input-checkbox ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" name="' . esc_attr( $key ) . '[]" id="' . esc_attr( $args['id'] ) . '_' . esc_attr( $choice_index ) . '" value="' . trim( $choice ) . '"' . $value . ' /> ';
262
  $field .= trim( $choice ) . ' </label>';
263
  $checkbox_start++;
264
  }
265
  } else {
266
  $field = '<label class="checkbox ' . implode( ' ', $custom_attributes ) . '">
267
  <input data-rules="' . esc_attr( $rules ) . '" data-id="' . esc_attr( $key ) . '" ' . implode( ' ', $custom_attributes ) . ' data-value="' . $value . '" type="' . esc_attr( $args['type'] ) . '" class="input-checkbox ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" value="1" ' . checked( $value, 1, false ) . ' /> '
268
+ . $args['label'] . $required . '</label>';
269
+ if ( $args['description'] ) {
270
  $field .= '<span class="description">' . $args['description'] . '</span>';
271
  }
272
  }
273
  break;
274
 
275
+ case 'password':
276
+ case 'text':
277
+ case 'email':
278
+ case 'tel':
279
+ case 'number':
280
+ case 'url':
281
  case 'date':
282
  case 'file':
283
  case 'timepicker':
285
  $extra_params = json_decode( get_user_meta( get_current_user_id(), $extra_params_key, true ) );
286
 
287
  if ( empty( $extra_params ) ) {
288
+ $field .= '<input data-rules="' . esc_attr( $rules ) . '" data-id="' . esc_attr( $key ) . '" type="' . esc_attr( $args['type'] ) . '" class="input-text input-' . esc_attr( $args['type'] ) . ' ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" placeholder="' . esc_attr( $args['placeholder'] ) . '" value="' . esc_attr( $value ) . '" ' . implode( ' ', $custom_attributes ) . ' />';
289
+ } else {
 
290
  $field .= '<input data-rules="' . esc_attr( $rules ) . '" data-id="' . esc_attr( $key ) . '" type="' . esc_attr( $args['type'] ) . '" class="input-text ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '" placeholder="' . esc_attr( $args['placeholder'] ) . '" value="' . esc_attr( $value ) . '" ' . implode( ' ', $custom_attributes ) . ' />';
291
  }
292
  break;
293
 
294
+ case 'select':
295
  $options = $field .= '';
296
  if ( ! empty( $args['options'] ) ) {
297
  foreach ( $args['options'] as $option_key => $option_text ) {
312
  }
313
  break;
314
 
315
+ case 'multiselect':
316
  $options = $field .= '';
317
 
318
+ if ( is_serialized( $value ) ) {
319
  $default_value = unserialize( $value );
320
  } else {
321
  $default_value = $value;
332
  $custom_attributes[] = 'data-allow_clear="true"';
333
  }
334
 
335
+ if ( is_array( $default_value ) ) {
336
  $options .= '<option value="' . esc_attr( trim( $option_key ) ) . '" ' . selected( in_array( trim( $option_key ), $default_value ), true, false ) . '>' . esc_attr( trim( $option_text ) ) . '</option>';
337
+ } else {
 
338
  $options .= '<option value="' . esc_attr( trim( $option_key ) ) . '" ' . selected( $default_value, trim( $option_key ), false ) . '>' . esc_attr( trim( $option_text ) ) . '</option>';
339
  }
340
  }
345
  }
346
  break;
347
 
348
+ case 'radio':
349
  $label_id = current( array_keys( $args['options'] ) );
350
  if ( ! empty( $args['options'] ) ) {
351
  foreach ( $args['options'] as $option_key => $option_text ) {
352
 
353
  $field .= '<label for="' . esc_attr( $args['id'] ) . '_' . esc_attr( $option_key ) . '" class="radio">';
354
 
355
+ $field .= '<input data-rules="' . esc_attr( $rules ) . '" data-id="' . esc_attr( $key ) . '" type="radio" class="input-radio ' . esc_attr( implode( ' ', $args['input_class'] ) ) . '" value="' . esc_attr( trim( $option_key ) ) . '" name="' . esc_attr( $key ) . '" id="' . esc_attr( $args['id'] ) . '_' . esc_attr( $option_key ) . '" ' . implode( ' ', $custom_attributes ) . ' / ' . checked( $value, trim( $option_key ), false ) . ' />' . wp_kses(
356
+ trim( $option_text ),
357
+ array(
358
  'a' => array(
359
  'href' => array(),
360
+ 'title' => array(),
361
  ),
362
+ 'span' => array(),
363
+ )
364
+ ) . '</label>';
365
  }
366
  }
367
  break;
372
 
373
  $field_html = '';
374
  if ( $args['label'] && 'checkbox' != $args['type'] ) {
375
+ $field_html .= '<label for="' . esc_attr( $label_id ) . '">' . wp_kses(
376
+ $args['label'],
377
+ array(
378
  'a' => array(
379
  'href' => array(),
380
+ 'title' => array(),
381
  ),
382
+ 'span' => array(),
383
+ )
384
+ ) . $required . '</label>';
385
  }
386
 
387
+ $field_html .= $field;
388
  $container_class = esc_attr( implode( ' ', $args['class'] ) );
389
  $container_id = esc_attr( $args['id'] ) . '_field';
390
  $field = sprintf( $field_container, $container_class, $container_id, $field_html );
412
  function user_registration_form_data( $user_id = 0, $form_id = 0 ) {
413
  $all_meta_value = get_user_meta( $user_id );
414
 
415
+ $fields = array();
416
+ $args = array(
417
  'post_type' => 'user_registration',
418
  'post_status' => 'publish',
419
+ 'post__in' => array( $form_id ),
420
  );
421
+ $post_data = get_posts( $args );
422
  $post_content = isset( $post_data[0]->post_content ) ? $post_data[0]->post_content : '';
423
  $post_content_array = json_decode( $post_content );
424
  if ( gettype( $post_content_array ) != 'array' ) {
433
  foreach ( $post_content_array as $post_content_row ) {
434
  foreach ( $post_content_row as $post_content_grid ) {
435
  foreach ( $post_content_grid as $field ) {
436
+ $field_name = isset( $field->general_setting->field_name ) ? $field->general_setting->field_name : '';
437
+ $field_label = isset( $field->general_setting->label ) ? $field->general_setting->label : '';
438
  $field_description = isset( $field->general_setting->description ) ? $field->general_setting->description : '';
439
+ $field_key = isset( $field->field_key ) ? ( $field->field_key ) : '';
440
+ $field_type = isset( $field->field_key ) ? ur_get_field_type( $field_key ) : '';
441
+ $required = isset( $field->general_setting->required ) ? $field->general_setting->required : '';
442
+ $required = 'yes' == $required ? true : false;
443
 
444
  if ( empty( $field_label ) ) {
445
  $field_label_array = explode( '_', $field_name );
454
  case 'radio':
455
  case 'select':
456
  $extra_params['options'] = explode( ',', $field->advance_setting->options );
457
+ foreach ( $extra_params['options'] as $key => $value ) {
458
+ $extra_params['options'][ $value ] = $value;
459
+ unset( $extra_params['options'][ $key ] );
460
  }
461
  break;
462
  case 'checkbox':
463
  $extra_params['choices'] = explode( ',', $field->advance_setting->choices );
464
+ foreach ( $extra_params['choices'] as $key => $value ) {
465
+ $extra_params['choices'][ $value ] = $value;
466
+ unset( $extra_params['choices'][ $key ] );
467
  }
468
  break;
469
  case 'country':
497
  if ( isset( $fields[ 'user_registration_' . $field_name ] ) && count( $extra_params ) > 0 ) {
498
  $fields[ 'user_registration_' . $field_name ] = array_merge( $fields[ 'user_registration_' . $field_name ], $extra_params );
499
  }
500
+ $filter_data = array(
501
  'fields' => $fields,
502
  'field' => $field,
503
+ 'field_name' => $field_name,
504
  );
505
 
506
  $filtered_data_array = apply_filters( 'user_registration_profile_account_filter_' . $field_key, $filter_data );
538
  }
539
 
540
  // No endpoint found? Default to dashboard.
541
+ ur_get_template(
542
+ 'myaccount/dashboard.php',
543
+ array(
544
+ 'current_user' => get_user_by( 'id', get_current_user_id() ),
545
+ )
546
+ );
547
  }
548
  }
549
 
includes/functions-ur-update.php CHANGED
@@ -54,36 +54,35 @@ function ur_update_120_db_version() {
54
  * Update usermeta.
55
  */
56
  function ur_update_125_usermeta() {
57
-
58
  $users = get_users( array( 'fields' => array( 'ID' ) ) );
59
-
60
- foreach( $users as $user_id ) {
61
 
62
- if( metadata_exists( 'user', $user_id->ID, 'user_registration_user_first_name' ) ) {
63
- $first_name = get_user_meta ( $user_id->ID, 'user_registration_user_first_name', true );
64
- update_user_meta ( $user_id->ID, 'first_name', $first_name );
65
- delete_user_meta( $user_id->ID, 'user_registration_user_first_name');
 
 
66
  }
67
 
68
- if( metadata_exists( 'user', $user_id->ID, 'user_registration_user_last_name' ) ) {
69
- $last_name = get_user_meta ( $user_id->ID, 'user_registration_user_last_name', true );
70
- update_user_meta ( $user_id->ID, 'last_name', $last_name );
71
- delete_user_meta( $user_id->ID, 'user_registration_user_last_name');
72
  }
73
-
74
- if( metadata_exists( 'user', $user_id->ID, 'user_registration_user_description' ) ) {
75
- $description = get_user_meta ( $user_id->ID, 'user_registration_user_description', true );
76
- update_user_meta ( $user_id->ID, 'description', $description );
77
- delete_user_meta( $user_id->ID, 'user_registration_user_description');
78
  }
79
 
80
- if( metadata_exists( 'user', $user_id->ID, 'user_registration_user_nickname' ) ) {
81
- $nickname = get_user_meta ( $user_id->ID, 'user_registration_user_nickname', true );
82
- update_user_meta ( $user_id->ID, 'nickname', $nickname );
83
- delete_user_meta( $user_id->ID, 'user_registration_user_nickname');
84
  }
85
-
86
- }
87
  }
88
  /**
89
  * Update DB Version.
@@ -104,7 +103,7 @@ function ur_update_130_db_version() {
104
  */
105
  function ur_update_130_post() {
106
  $posts = get_posts( 'post_type=user_registration' );
107
- foreach( $posts as $post ) {
108
  $post_content = isset( $post->post_content ) ? $post->post_content : '';
109
  $post_content_array = json_decode( $post_content );
110
 
@@ -112,8 +111,8 @@ function ur_update_130_post() {
112
  foreach ( $post_content_row as $post_content_grid ) {
113
  foreach ( $post_content_grid as $field ) {
114
 
115
- if( isset( $field->field_key ) && isset( $field->general_setting->field_name ) ) {
116
- switch( $field->field_key ) {
117
  case 'user_username':
118
  $field->general_setting->field_name = $field->field_key = 'user_login';
119
  break;
@@ -139,25 +138,25 @@ function ur_update_130_post() {
139
  }
140
  }
141
  }
142
- $post_content = json_encode( $post_content_array );
143
- $post->post_content = $post_content;
144
  }
145
  wp_update_post( $post );
146
  }
147
 
148
  $mailchimp_settings = get_option( 'urmc_mailchimp_settings' );
149
 
150
- if( $mailchimp_settings && is_array( $mailchimp_settings ) ) {
151
-
152
- if( isset( $mailchimp_settings['data'] ) && is_array( $mailchimp_settings['data'] ) ) {
 
 
153
 
154
- foreach( $mailchimp_settings['data'] as $id => $mailchimp_data ) {
155
-
156
- if( isset( $mailchimp_data['fields'] ) ) {
157
-
158
- foreach( $mailchimp_data['fields'] as $key => $field ) {
159
 
160
- switch( $field ) {
 
 
161
  case 'user_username':
162
  $mailchimp_data['fields'][ $key ] = 'user_login';
163
  break;
@@ -180,10 +179,10 @@ function ur_update_130_post() {
180
  break;
181
  }
182
  }
183
- }
184
- $mailchimp_settings['data'][ $id ] = $mailchimp_data ;
185
- }
186
- }
187
  update_option( 'urmc_mailchimp_settings', $mailchimp_settings );
188
  }
189
  }
@@ -205,7 +204,7 @@ function ur_update_140_option() {
205
  'user_registration_general_setting_form_submit_label',
206
  );
207
 
208
- foreach( $unused_options as $unused_option ) {
209
  delete_option( $unused_option );
210
  }
211
  }
@@ -224,4 +223,4 @@ function ur_update_142_option() {
224
  $value = get_option( 'user_registration_myaccount_edit_account_endpoint' );
225
  update_option( 'user_registration_myaccount_change_password_endpoint', $value );
226
  delete_option( 'user_registration_myaccount_edit_account_endpoint' );
227
- }
54
  * Update usermeta.
55
  */
56
  function ur_update_125_usermeta() {
57
+
58
  $users = get_users( array( 'fields' => array( 'ID' ) ) );
 
 
59
 
60
+ foreach ( $users as $user_id ) {
61
+
62
+ if ( metadata_exists( 'user', $user_id->ID, 'user_registration_user_first_name' ) ) {
63
+ $first_name = get_user_meta( $user_id->ID, 'user_registration_user_first_name', true );
64
+ update_user_meta( $user_id->ID, 'first_name', $first_name );
65
+ delete_user_meta( $user_id->ID, 'user_registration_user_first_name' );
66
  }
67
 
68
+ if ( metadata_exists( 'user', $user_id->ID, 'user_registration_user_last_name' ) ) {
69
+ $last_name = get_user_meta( $user_id->ID, 'user_registration_user_last_name', true );
70
+ update_user_meta( $user_id->ID, 'last_name', $last_name );
71
+ delete_user_meta( $user_id->ID, 'user_registration_user_last_name' );
72
  }
73
+
74
+ if ( metadata_exists( 'user', $user_id->ID, 'user_registration_user_description' ) ) {
75
+ $description = get_user_meta( $user_id->ID, 'user_registration_user_description', true );
76
+ update_user_meta( $user_id->ID, 'description', $description );
77
+ delete_user_meta( $user_id->ID, 'user_registration_user_description' );
78
  }
79
 
80
+ if ( metadata_exists( 'user', $user_id->ID, 'user_registration_user_nickname' ) ) {
81
+ $nickname = get_user_meta( $user_id->ID, 'user_registration_user_nickname', true );
82
+ update_user_meta( $user_id->ID, 'nickname', $nickname );
83
+ delete_user_meta( $user_id->ID, 'user_registration_user_nickname' );
84
  }
85
+ }
 
86
  }
87
  /**
88
  * Update DB Version.
103
  */
104
  function ur_update_130_post() {
105
  $posts = get_posts( 'post_type=user_registration' );
106
+ foreach ( $posts as $post ) {
107
  $post_content = isset( $post->post_content ) ? $post->post_content : '';
108
  $post_content_array = json_decode( $post_content );
109
 
111
  foreach ( $post_content_row as $post_content_grid ) {
112
  foreach ( $post_content_grid as $field ) {
113
 
114
+ if ( isset( $field->field_key ) && isset( $field->general_setting->field_name ) ) {
115
+ switch ( $field->field_key ) {
116
  case 'user_username':
117
  $field->general_setting->field_name = $field->field_key = 'user_login';
118
  break;
138
  }
139
  }
140
  }
141
+ $post_content = json_encode( $post_content_array );
142
+ $post->post_content = $post_content;
143
  }
144
  wp_update_post( $post );
145
  }
146
 
147
  $mailchimp_settings = get_option( 'urmc_mailchimp_settings' );
148
 
149
+ if ( $mailchimp_settings && is_array( $mailchimp_settings ) ) {
150
+
151
+ if ( isset( $mailchimp_settings['data'] ) && is_array( $mailchimp_settings['data'] ) ) {
152
+
153
+ foreach ( $mailchimp_settings['data'] as $id => $mailchimp_data ) {
154
 
155
+ if ( isset( $mailchimp_data['fields'] ) ) {
 
 
 
 
156
 
157
+ foreach ( $mailchimp_data['fields'] as $key => $field ) {
158
+
159
+ switch ( $field ) {
160
  case 'user_username':
161
  $mailchimp_data['fields'][ $key ] = 'user_login';
162
  break;
179
  break;
180
  }
181
  }
182
+ }
183
+ $mailchimp_settings['data'][ $id ] = $mailchimp_data;
184
+ }
185
+ }
186
  update_option( 'urmc_mailchimp_settings', $mailchimp_settings );
187
  }
188
  }
204
  'user_registration_general_setting_form_submit_label',
205
  );
206
 
207
+ foreach ( $unused_options as $unused_option ) {
208
  delete_option( $unused_option );
209
  }
210
  }
223
  $value = get_option( 'user_registration_myaccount_edit_account_endpoint' );
224
  update_option( 'user_registration_myaccount_change_password_endpoint', $value );
225
  delete_option( 'user_registration_myaccount_edit_account_endpoint' );
226
+ }
includes/libraries/wp-background-process.php CHANGED
@@ -194,11 +194,16 @@ abstract class WP_Background_Process extends WP_Async_Request {
194
 
195
  $key = $this->identifier . '_batch_%';
196
 
197
- $count = $wpdb->get_var( $wpdb->prepare( "
 
 
198
  SELECT COUNT(*)
199
  FROM {$table}
200
  WHERE {$column} LIKE %s
201
- ", $key ) );
 
 
 
202
 
203
  return ( $count > 0 ) ? false : true;
204
  }
@@ -269,13 +274,18 @@ abstract class WP_Background_Process extends WP_Async_Request {
269
 
270
  $key = $this->identifier . '_batch_%';
271
 
272
- $query = $wpdb->get_row( $wpdb->prepare( "
 
 
273
  SELECT *
274
  FROM {$table}
275
  WHERE {$column} LIKE %s
276
  ORDER BY {$key_column} ASC
277
  LIMIT 1
278
- ", $key ) );
 
 
 
279
 
280
  $batch = new stdClass();
281
  $batch->key = $query->$column;
194
 
195
  $key = $this->identifier . '_batch_%';
196
 
197
+ $count = $wpdb->get_var(
198
+ $wpdb->prepare(
199
+ "
200
  SELECT COUNT(*)
201
  FROM {$table}
202
  WHERE {$column} LIKE %s
203
+ ",
204
+ $key
205
+ )
206
+ );
207
 
208
  return ( $count > 0 ) ? false : true;
209
  }
274
 
275
  $key = $this->identifier . '_batch_%';
276
 
277
+ $query = $wpdb->get_row(
278
+ $wpdb->prepare(
279
+ "
280
  SELECT *
281
  FROM {$table}
282
  WHERE {$column} LIKE %s
283
  ORDER BY {$key_column} ASC
284
  LIMIT 1
285
+ ",
286
+ $key
287
+ )
288
+ );
289
 
290
  $batch = new stdClass();
291
  $batch->key = $query->$column;
includes/shortcodes/class-ur-shortcode-login.php CHANGED
@@ -12,7 +12,7 @@
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
15
- exit;
16
  }
17
 
18
  /**
@@ -38,10 +38,10 @@ class UR_Shortcode_Login {
38
  public static function output( $atts ) {
39
  global $wp, $post;
40
 
41
- $redirect_url = isset( $atts['redirect_url']) ? trim( $atts['redirect_url'] ) : '';
42
  $recaptcha_enabled = get_option( 'user_registration_login_options_enable_recaptcha', 'no' );
43
 
44
- if( 'yes' === $recaptcha_enabled ) {
45
  wp_enqueue_script( 'user-registration' );
46
  }
47
 
@@ -51,10 +51,16 @@ class UR_Shortcode_Login {
51
  if ( isset( $wp->query_vars['lost-password'] ) ) {
52
  UR_Shortcode_My_Account::lost_password();
53
  } else {
54
- ur_get_template( 'myaccount/form-login.php', array( 'recaptcha_node' => $recaptcha_node, 'redirect' => $redirect_url ) );
 
 
 
 
 
 
55
  }
56
  } else {
57
- echo apply_filters( 'user_registration_logged_in_message', sprintf( __( 'You are already logged in. <a href="%s">Log out?</a>', 'user-registration' ), ur_logout_url() ) );
58
  }
59
  }
60
  }
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
15
+ exit; // Exit if accessed directly.
16
  }
17
 
18
  /**
38
  public static function output( $atts ) {
39
  global $wp, $post;
40
 
41
+ $redirect_url = isset( $atts['redirect_url'] ) ? trim( $atts['redirect_url'] ) : '';
42
  $recaptcha_enabled = get_option( 'user_registration_login_options_enable_recaptcha', 'no' );
43
 
44
+ if ( 'yes' === $recaptcha_enabled ) {
45
  wp_enqueue_script( 'user-registration' );
46
  }
47
 
51
  if ( isset( $wp->query_vars['lost-password'] ) ) {
52
  UR_Shortcode_My_Account::lost_password();
53
  } else {
54
+ ur_get_template(
55
+ 'myaccount/form-login.php',
56
+ array(
57
+ 'recaptcha_node' => $recaptcha_node,
58
+ 'redirect' => $redirect_url,
59
+ )
60
+ );
61
  }
62
  } else {
63
+ echo apply_filters( 'user_registration_logged_in_message', sprintf( __( 'You are already logged in. <a href="%s">Log out?</a>', 'user-registration' ), ur_logout_url() ) );
64
  }
65
  }
66
  }
includes/shortcodes/class-ur-shortcode-my-account.php CHANGED
@@ -12,7 +12,7 @@
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
15
- exit;
16
  }
17
 
18
  /**
@@ -44,8 +44,8 @@ class UR_Shortcode_My_Account {
44
 
45
  $recaptcha_enabled = get_option( 'user_registration_login_options_enable_recaptcha', 'no' );
46
  $recaptcha_node = ur_get_recaptcha_node( $recaptcha_enabled, 'login' );
47
- $redirect_url = isset( $atts['redirect_url']) ? trim( $atts['redirect_url'] ) : '';
48
- $message = apply_filters( 'user_registration_my_account_message', '' );
49
 
50
  if ( ! empty( $message ) ) {
51
  ur_add_notice( $message );
@@ -59,19 +59,25 @@ class UR_Shortcode_My_Account {
59
  if ( isset( $wp->query_vars['lost-password'] ) ) {
60
  self::lost_password();
61
  } else {
62
- ur_get_template( 'myaccount/form-login.php', array( 'recaptcha_node' => $recaptcha_node, 'redirect' => $redirect_url ) );
 
 
 
 
 
 
63
  }
64
  } else {
65
 
66
  // Enqueue script.
67
- $user_id = get_current_user_id();
68
- $form_id = get_user_meta( $user_id, 'ur_form_id', true );
69
 
70
- if( ! empty( $form_id ) ) {
71
 
72
  $has_date = ur_has_date_field( $form_id );
73
 
74
- if( true === $has_date ) {
75
  wp_enqueue_style( 'flatpickr' );
76
  wp_enqueue_script( 'flatpickr' );
77
  }
@@ -87,7 +93,7 @@ class UR_Shortcode_My_Account {
87
  do_action( 'before-user-registration-my-account-shortcode' );
88
 
89
  // Collect notices before output
90
- include_once( UR_ABSPATH . 'includes/functions-ur-notice.php' );
91
  $notices = ur_get_notices();
92
 
93
  // Output the new account page
@@ -104,9 +110,12 @@ class UR_Shortcode_My_Account {
104
  * @param array $atts
105
  */
106
  private static function my_account( $atts ) {
107
- ur_get_template( 'myaccount/my-account.php', array(
108
- 'current_user' => get_user_by( 'id', get_current_user_id() ),
109
- ) );
 
 
 
110
  }
111
 
112
  /**
@@ -114,51 +123,57 @@ class UR_Shortcode_My_Account {
114
  */
115
  public static function edit_profile() {
116
 
117
- $user_id=get_current_user_id();
118
- $form_id_array=get_user_meta($user_id,'ur_form_id');
119
- $form_id=0;
120
 
121
- if( isset($form_id_array[0]) ){
122
  $form_id = $form_id_array[0];
123
  }
124
 
125
- $profile = user_registration_form_data( $user_id, $form_id );
126
- $user_data_obj = get_userdata($user_id);
127
- $user_data = $user_data_obj->data;
128
 
129
- if( count( $profile ) < 1 ) {
130
  return;
131
  }
132
 
133
  // Prepare values
134
  foreach ( $profile as $key => $field ) {
135
- $value = get_user_meta( get_current_user_id(), $key, true );
136
  $profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );
137
- $new_key=str_replace('user_registration_','',$key);
138
 
139
- if(in_array($new_key,ur_get_registered_user_meta_fields())){
140
- $value = get_user_meta( get_current_user_id(), (str_replace('user_','',$new_key)), true );
141
  $profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );
142
- }elseif(isset($user_data->$new_key) && in_array($new_key,ur_get_user_table_fields())){
143
- $profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->$new_key, $key );
144
 
145
- }else if(isset($user_data->display_name) && $key==='user_registration_display_name'){
146
  $profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->display_name, $key );
147
  }
148
  }
149
 
150
- ur_get_template( 'myaccount/form-edit-profile.php', array(
151
- 'profile' => apply_filters( 'user_registration_profile_to_edit', $profile ),
152
- ) );
 
 
 
153
  }
154
 
155
  /**
156
  * Edit account details page.
157
  */
158
  public static function edit_account() {
159
- ur_get_template( 'myaccount/form-edit-password.php', array(
160
- 'user' => get_user_by( 'id', get_current_user_id() ),
161
- ) );
 
 
 
162
  }
163
 
164
  /**
@@ -171,20 +186,23 @@ class UR_Shortcode_My_Account {
171
  if ( ! empty( $_GET['reset-link-sent'] ) ) {
172
  return ur_get_template( 'myaccount/lost-password-confirmation.php' );
173
 
174
- /**
175
- * Process reset key / login from email confirmation link
176
- */
177
  } elseif ( ! empty( $_GET['show-reset-form'] ) ) {
178
  if ( isset( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ] ) && 0 < strpos( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ], ':' ) ) {
179
  list( $rp_login, $rp_key ) = array_map( 'ur_clean', explode( ':', wp_unslash( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ] ), 2 ) );
180
- $user = self::check_password_reset_key( $rp_key, $rp_login );
181
 
182
  // reset key / login is correct, display reset password form with hidden key / login values
183
  if ( is_object( $user ) ) {
184
- return ur_get_template( 'myaccount/form-reset-password.php', array(
185
- 'key' => $rp_key,
186
- 'login' => $rp_login,
187
- ) );
 
 
 
188
  } else {
189
  self::set_reset_password_cookie();
190
  }
@@ -192,9 +210,12 @@ class UR_Shortcode_My_Account {
192
  }
193
 
194
  // Show lost password form by default
195
- ur_get_template( 'myaccount/form-lost-password.php', array(
196
- 'form' => 'lost_password',
197
- ) );
 
 
 
198
  }
199
 
200
  /**
@@ -259,7 +280,7 @@ class UR_Shortcode_My_Account {
259
  $key = get_password_reset_key( $user_data );
260
 
261
  // Send email notification
262
- if( UR_Emailer::lost_password_email( $user_login, $user_data, $key) == false ) {
263
  ur_add_notice( __( 'The email could not be sent. Contact your site administrator. ', 'user-registration' ), 'error' );
264
  return false;
265
  }
12
  */
13
 
14
  if ( ! defined( 'ABSPATH' ) ) {
15
+ exit; // Exit if accessed directly.
16
  }
17
 
18
  /**
44
 
45
  $recaptcha_enabled = get_option( 'user_registration_login_options_enable_recaptcha', 'no' );
46
  $recaptcha_node = ur_get_recaptcha_node( $recaptcha_enabled, 'login' );
47
+ $redirect_url = isset( $atts['redirect_url'] ) ? trim( $atts['redirect_url'] ) : '';
48
+ $message = apply_filters( 'user_registration_my_account_message', '' );
49
 
50
  if ( ! empty( $message ) ) {
51
  ur_add_notice( $message );
59
  if ( isset( $wp->query_vars['lost-password'] ) ) {
60
  self::lost_password();
61
  } else {
62
+ ur_get_template(
63
+ 'myaccount/form-login.php',
64
+ array(
65
+ 'recaptcha_node' => $recaptcha_node,
66
+ 'redirect' => $redirect_url,
67
+ )
68
+ );
69
  }
70
  } else {
71
 
72
  // Enqueue script.
73
+ $user_id = get_current_user_id();
74
+ $form_id = get_user_meta( $user_id, 'ur_form_id', true );
75
 
76
+ if ( ! empty( $form_id ) ) {
77
 
78
  $has_date = ur_has_date_field( $form_id );
79
 
80
+ if ( true === $has_date ) {
81
  wp_enqueue_style( 'flatpickr' );
82
  wp_enqueue_script( 'flatpickr' );
83
  }
93
  do_action( 'before-user-registration-my-account-shortcode' );
94
 
95
  // Collect notices before output
96
+ include_once UR_ABSPATH . 'includes/functions-ur-notice.php';
97
  $notices = ur_get_notices();
98
 
99
  // Output the new account page
110
  * @param array $atts
111
  */
112
  private static function my_account( $atts ) {
113
+ ur_get_template(
114
+ 'myaccount/my-account.php',
115
+ array(
116
+ 'current_user' => get_user_by( 'id', get_current_user_id() ),
117
+ )
118
+ );
119
  }
120
 
121
  /**
123
  */
124
  public static function edit_profile() {
125
 
126
+ $user_id = get_current_user_id();
127
+ $form_id_array = get_user_meta( $user_id, 'ur_form_id' );
128
+ $form_id = 0;
129
 
130
+ if ( isset( $form_id_array[0] ) ) {
131
  $form_id = $form_id_array[0];
132
  }
133
 
134
+ $profile = user_registration_form_data( $user_id, $form_id );
135
+ $user_data_obj = get_userdata( $user_id );
136
+ $user_data = $user_data_obj->data;
137
 
138
+ if ( count( $profile ) < 1 ) {
139
  return;
140
  }
141
 
142
  // Prepare values
143
  foreach ( $profile as $key => $field ) {
144
+ $value = get_user_meta( get_current_user_id(), $key, true );
145
  $profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );
146
+ $new_key = str_replace( 'user_registration_', '', $key );
147
 
148
+ if ( in_array( $new_key, ur_get_registered_user_meta_fields() ) ) {
149
+ $value = get_user_meta( get_current_user_id(), ( str_replace( 'user_', '', $new_key ) ), true );
150
  $profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $value, $key );
151
+ } elseif ( isset( $user_data->$new_key ) && in_array( $new_key, ur_get_user_table_fields() ) ) {
152
+ $profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->$new_key, $key );
153
 
154
+ } elseif ( isset( $user_data->display_name ) && $key === 'user_registration_display_name' ) {
155
  $profile[ $key ]['value'] = apply_filters( 'user_registration_my_account_edit_profile_field_value', $user_data->display_name, $key );
156
  }
157
  }
158
 
159
+ ur_get_template(
160
+ 'myaccount/form-edit-profile.php',
161
+ array(
162
+ 'profile' => apply_filters( 'user_registration_profile_to_edit', $profile ),
163
+ )
164
+ );
165
  }
166
 
167
  /**
168
  * Edit account details page.
169
  */
170
  public static function edit_account() {
171
+ ur_get_template(
172
+ 'myaccount/form-edit-password.php',
173
+ array(
174
+ 'user' => get_user_by( 'id', get_current_user_id() ),
175
+ )
176
+ );
177
  }
178
 
179
  /**
186
  if ( ! empty( $_GET['reset-link-sent'] ) ) {
187
  return ur_get_template( 'myaccount/lost-password-confirmation.php' );
188
 
189
+ /**
190
+ * Process reset key / login from email confirmation link
191
+ */
192
  } elseif ( ! empty( $_GET['show-reset-form'] ) ) {
193
  if ( isset( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ] ) && 0 < strpos( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ], ':' ) ) {
194
  list( $rp_login, $rp_key ) = array_map( 'ur_clean', explode( ':', wp_unslash( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ] ), 2 ) );
195
+ $user = self::check_password_reset_key( $rp_key, $rp_login );
196
 
197
  // reset key / login is correct, display reset password form with hidden key / login values
198
  if ( is_object( $user ) ) {
199
+ return ur_get_template(
200
+ 'myaccount/form-reset-password.php',
201
+ array(
202
+ 'key' => $rp_key,
203
+ 'login' => $rp_login,
204
+ )
205
+ );
206
  } else {
207
  self::set_reset_password_cookie();
208
  }
210
  }
211
 
212
  // Show lost password form by default
213
+ ur_get_template(
214
+ 'myaccount/form-lost-password.php',
215
+ array(
216
+ 'form' => 'lost_password',
217
+ )
218
+ );
219
  }
220
 
221
  /**
280
  $key = get_password_reset_key( $user_data );
281
 
282
  // Send email notification
283
+ if ( UR_Emailer::lost_password_email( $user_login, $user_data, $key ) == false ) {
284
  ur_add_notice( __( 'The email could not be sent. Contact your site administrator. ', 'user-registration' ), 'error' );
285
  return false;
286
  }
languages/user-registration.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the User Registration package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: User Registration 1.5.5\n"
6
  "Report-Msgid-Bugs-To: wpeverest@gmail.com\n"
7
- "POT-Creation-Date: 2019-01-08 09:02:47+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -13,53 +13,54 @@ msgstr ""
13
  "Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
14
  "X-Generator: grunt-wp-i18n 1.0.3\n"
15
 
16
- #: includes/abstracts/abstract-ur-form-field.php:286
17
- #: includes/admin/functions-ur-admin.php:318
18
  msgid "General Settings"
19
  msgstr ""
20
 
21
- #: includes/abstracts/abstract-ur-form-field.php:294
22
  msgid "Advance Settings"
23
  msgstr ""
24
 
25
- #: includes/admin/class-ur-admin-assets.php:136
26
  msgid "Could not install."
27
  msgstr ""
28
 
29
- #: includes/admin/class-ur-admin-assets.php:208
30
  msgid "Clone"
31
  msgstr ""
32
 
33
- #: includes/admin/class-ur-admin-assets.php:208
34
- #: includes/admin/class-ur-admin-registrations-table-list.php:112
35
  msgid "Trash"
36
  msgstr ""
37
 
38
- #: includes/admin/class-ur-admin-export-users.php:50
39
  #: includes/admin/class-ur-admin-menus.php:241
40
  #: includes/admin/class-ur-admin-notices.php:121
41
  #: includes/admin/class-ur-admin-settings.php:69
42
- #: includes/admin/class-ur-admin-status.php:167
 
43
  msgid "Action failed. Please refresh the page and retry."
44
  msgstr ""
45
 
46
- #: includes/admin/class-ur-admin-export-users.php:65
47
  msgid "No users found with this form id."
48
  msgstr ""
49
 
50
- #: includes/admin/class-ur-admin-export-users.php:115
51
  msgid "User Role"
52
  msgstr ""
53
 
54
- #: includes/admin/class-ur-admin-export-users.php:116
55
  msgid "User Registered"
56
  msgstr ""
57
 
58
- #: includes/admin/class-ur-admin-export-users.php:117
59
  msgid "User Registered GMT"
60
  msgstr ""
61
 
62
- #: includes/admin/class-ur-admin-export-users.php:122
63
  msgid "User ID"
64
  msgstr ""
65
 
@@ -107,180 +108,181 @@ msgstr ""
107
  msgid "User Registration"
108
  msgstr ""
109
 
110
- #: includes/admin/class-ur-admin-menus.php:297
111
  msgid "User Registration settings"
112
  msgstr ""
113
 
114
- #: includes/admin/class-ur-admin-menus.php:297
115
- #: includes/class-ur-install.php:608
116
  msgid "Settings"
117
  msgstr ""
118
 
119
- #: includes/admin/class-ur-admin-menus.php:307
120
  msgid "User Registration Status"
121
  msgstr ""
122
 
123
- #: includes/admin/class-ur-admin-menus.php:307
124
- #: includes/admin/class-ur-admin-user-list-manager.php:174
125
- #: includes/class-ur-email-confirmation.php:119
126
  msgid "Status"
127
  msgstr ""
128
 
129
- #: includes/admin/class-ur-admin-menus.php:317
130
- #: includes/admin/class-ur-admin-menus.php:354
 
131
  msgid "Add New"
132
  msgstr ""
133
 
134
- #: includes/admin/class-ur-admin-menus.php:327
135
  msgid "User Registration extensions"
136
  msgstr ""
137
 
138
- #: includes/admin/class-ur-admin-menus.php:327
139
  msgid "Extensions"
140
  msgstr ""
141
 
142
- #: includes/admin/class-ur-admin-menus.php:360
143
  msgid "Search Registration"
144
  msgstr ""
145
 
146
- #: includes/admin/class-ur-admin-menus.php:382
147
  msgid "Create Form"
148
  msgstr ""
149
 
150
- #: includes/admin/class-ur-admin-menus.php:385
151
  msgid "Update form"
152
  msgstr ""
153
 
154
- #: includes/admin/class-ur-admin-menus.php:420
155
  msgid "User Registration endpoints"
156
  msgstr ""
157
 
158
- #: includes/admin/class-ur-admin-menus.php:439
159
- #: includes/admin/settings/class-ur-settings-general.php:167
160
  #: includes/class-ur-query.php:79
161
  msgid "Lost password"
162
  msgstr ""
163
 
164
- #: includes/admin/class-ur-admin-menus.php:477
165
  msgid "Select all"
166
  msgstr ""
167
 
168
- #: includes/admin/class-ur-admin-menus.php:481
169
  msgid "Add to menu"
170
  msgstr ""
171
 
172
- #: includes/admin/class-ur-admin-menus.php:574
173
  msgid "Empty form data"
174
  msgstr ""
175
 
176
- #: includes/admin/class-ur-admin-notices.php:125 user-registration.php:74
177
- #: user-registration.php:83
178
  msgid "Cheatin&#8217; huh?"
179
  msgstr ""
180
 
181
- #: includes/admin/class-ur-admin-profile.php:52
182
  msgid "User Extra Information %s"
183
  msgstr ""
184
 
185
- #: includes/admin/class-ur-admin-profile.php:130
186
- #: includes/admin/class-ur-admin-profile.php:141
187
  #: includes/form/class-ur-form-field-select.php:35
188
  #: includes/form/class-ur-form-field-select.php:40
189
  msgid "Select"
190
  msgstr ""
191
 
192
- #: includes/admin/class-ur-admin-registrations-table-list.php:35
193
  msgid "No user registration found."
194
  msgstr ""
195
 
196
- #: includes/admin/class-ur-admin-registrations-table-list.php:46
197
  msgid "Title"
198
  msgstr ""
199
 
200
- #: includes/admin/class-ur-admin-registrations-table-list.php:47
201
  msgid "Shortcode"
202
  msgstr ""
203
 
204
- #: includes/admin/class-ur-admin-registrations-table-list.php:48
205
  msgid "Author"
206
  msgstr ""
207
 
208
- #: includes/admin/class-ur-admin-registrations-table-list.php:49
209
  #: includes/form/class-ur-form-field-date.php:37
210
  #: includes/form/class-ur-form-field-date.php:42
211
  msgid "Date"
212
  msgstr ""
213
 
214
- #: includes/admin/class-ur-admin-registrations-table-list.php:101
215
  msgid "ID: %d"
216
  msgstr ""
217
 
218
- #: includes/admin/class-ur-admin-registrations-table-list.php:105
219
- #: includes/class-ur-post-types.php:51
220
  msgid "Edit"
221
  msgstr ""
222
 
223
- #: includes/admin/class-ur-admin-registrations-table-list.php:110
224
  msgid "Restore this item from the Trash"
225
  msgstr ""
226
 
227
- #: includes/admin/class-ur-admin-registrations-table-list.php:110
228
- #: includes/admin/class-ur-admin-registrations-table-list.php:302
229
  msgid "Restore"
230
  msgstr ""
231
 
232
- #: includes/admin/class-ur-admin-registrations-table-list.php:112
233
  msgid "Move this item to the Trash"
234
  msgstr ""
235
 
236
- #: includes/admin/class-ur-admin-registrations-table-list.php:115
237
  msgid "Delete this item permanently"
238
  msgstr ""
239
 
240
- #: includes/admin/class-ur-admin-registrations-table-list.php:115
241
- #: includes/admin/class-ur-admin-registrations-table-list.php:303
242
  msgid "Delete permanently"
243
  msgstr ""
244
 
245
- #: includes/admin/class-ur-admin-registrations-table-list.php:122
246
  msgid "Duplicate"
247
  msgstr ""
248
 
249
- #: includes/admin/class-ur-admin-registrations-table-list.php:169
250
  msgid "Y/m/d g:i:s A"
251
  msgstr ""
252
 
253
- #: includes/admin/class-ur-admin-registrations-table-list.php:179
254
  msgid "%s ago"
255
  msgstr ""
256
 
257
- #: includes/admin/class-ur-admin-registrations-table-list.php:181
258
  msgid "Y/m/d"
259
  msgstr ""
260
 
261
- #: includes/admin/class-ur-admin-registrations-table-list.php:200
262
- #: includes/admin/class-ur-admin-registrations-table-list.php:201
263
  #. translators: %s: count
264
  msgid "Published <span class=\"count\">(%s)</span>"
265
  msgstr ""
266
 
267
- #: includes/admin/class-ur-admin-registrations-table-list.php:209
268
- #: includes/admin/class-ur-admin-registrations-table-list.php:210
269
  #. translators: %s: count
270
  msgid "Draft <span class=\"count\">(%s)</span>"
271
  msgstr ""
272
 
273
- #: includes/admin/class-ur-admin-registrations-table-list.php:218
274
- #: includes/admin/class-ur-admin-registrations-table-list.php:219
275
  #. translators: %s: count
276
  msgid "Pending <span class=\"count\">(%s)</span>"
277
  msgstr ""
278
 
279
- #: includes/admin/class-ur-admin-registrations-table-list.php:308
280
  msgid "Move to trash"
281
  msgstr ""
282
 
283
- #: includes/admin/class-ur-admin-registrations-table-list.php:319
284
  msgid "Empty trash"
285
  msgstr ""
286
 
@@ -288,69 +290,69 @@ msgstr ""
288
  msgid "Your settings have been saved."
289
  msgstr ""
290
 
291
- #: includes/admin/class-ur-admin-settings.php:139
292
  msgid "The changes you made will be lost if you navigate away from this page."
293
  msgstr ""
294
 
295
- #: includes/admin/class-ur-admin-settings.php:543
296
  msgid "Select a page&hellip;"
297
  msgstr ""
298
 
299
- #: includes/admin/class-ur-admin-user-list-manager.php:137
300
  msgid "User Registration:"
301
  msgstr ""
302
 
303
- #: includes/admin/class-ur-admin-user-list-manager.php:137
304
  msgid "User"
305
  msgstr ""
306
 
307
- #: includes/admin/class-ur-admin-user-list-manager.php:137
308
  msgid "Users"
309
  msgstr ""
310
 
311
- #: includes/admin/class-ur-admin-user-list-manager.php:137
312
  msgid "pending approval."
313
  msgstr ""
314
 
315
- #: includes/admin/class-ur-admin-user-list-manager.php:156
316
  msgid "User approved."
317
  msgid_plural "%s users approved."
318
  msgstr[0] ""
319
  msgstr[1] ""
320
 
321
- #: includes/admin/class-ur-admin-user-list-manager.php:158
322
  msgid "User denied."
323
  msgid_plural "%s users denied."
324
  msgstr[0] ""
325
  msgstr[1] ""
326
 
327
- #: includes/admin/class-ur-admin-user-list-manager.php:216
328
  msgid "All statuses"
329
  msgstr ""
330
 
331
- #: includes/admin/class-ur-admin-user-list-manager.php:218
332
  msgid "All approval statuses"
333
  msgstr ""
334
 
335
- #: includes/admin/class-ur-admin-user-list-manager.php:227
336
  msgid "Filter"
337
  msgstr ""
338
 
339
- #: includes/admin/class-ur-admin-user-list-manager.php:309
340
- #: includes/admin/class-ur-admin-user-list-manager.php:310
341
  msgid "Approve"
342
  msgstr ""
343
 
344
- #: includes/admin/class-ur-admin-user-list-manager.php:312
345
- #: includes/admin/class-ur-admin-user-list-manager.php:313
346
  msgid "Deny"
347
  msgstr ""
348
 
349
- #: includes/admin/class-ur-admin-user-list-manager.php:388
350
  msgid "Approval Status"
351
  msgstr ""
352
 
353
- #: includes/admin/class-ur-admin-user-list-manager.php:400
354
  msgid "If user has access to sign in or not."
355
  msgstr ""
356
 
@@ -379,16 +381,16 @@ msgstr ""
379
  msgid "Thank You!"
380
  msgstr ""
381
 
382
- #: includes/admin/class-ur-admin.php:128
383
  msgid "Thank you for using User Registration."
384
  msgstr ""
385
 
386
- #: includes/admin/functions-ur-admin.php:50
387
- #: includes/admin/functions-ur-admin.php:111
388
  msgid "User Extra Information"
389
  msgstr ""
390
 
391
- #: includes/admin/functions-ur-admin.php:130
392
  msgid "WordPress User Extra Information"
393
  msgstr ""
394
 
@@ -396,51 +398,51 @@ msgstr ""
396
  msgid "Emails"
397
  msgstr ""
398
 
399
- #: includes/admin/settings/class-ur-settings-email.php:69
400
  msgid "General Email Settings"
401
  msgstr ""
402
 
403
- #: includes/admin/settings/class-ur-settings-email.php:83
404
  msgid "Email notifications"
405
  msgstr ""
406
 
407
- #: includes/admin/settings/class-ur-settings-email.php:84
408
  msgid ""
409
  "Email notifications sent from user registration are listed below. Click on "
410
  "an email to configure it."
411
  msgstr ""
412
 
413
- #: includes/admin/settings/class-ur-settings-email.php:96
414
  msgid "Email Sender Options"
415
  msgstr ""
416
 
417
- #: includes/admin/settings/class-ur-settings-email.php:103
418
  msgid "\"From\" name"
419
  msgstr ""
420
 
421
- #: includes/admin/settings/class-ur-settings-email.php:104
422
  msgid "How the sender name appears in outgoing user registration emails."
423
  msgstr ""
424
 
425
- #: includes/admin/settings/class-ur-settings-email.php:114
426
  msgid "\"From\" address"
427
  msgstr ""
428
 
429
- #: includes/admin/settings/class-ur-settings-email.php:115
430
  msgid "How the sender email appears in outgoing user registration emails."
431
  msgstr ""
432
 
433
- #: includes/admin/settings/class-ur-settings-email.php:149
434
- #: includes/admin/settings/class-ur-settings-general.php:261
435
  msgid "Email"
436
  msgstr ""
437
 
438
- #: includes/admin/settings/class-ur-settings-email.php:150
439
- #: includes/admin/settings/class-ur-settings-email.php:168
440
  msgid "Configure"
441
  msgstr ""
442
 
443
- #: includes/admin/settings/class-ur-settings-email.php:219
444
  msgid "Smart Tags Used"
445
  msgstr ""
446
 
@@ -449,12 +451,12 @@ msgid "General"
449
  msgstr ""
450
 
451
  #: includes/admin/settings/class-ur-settings-general.php:44
452
- #: includes/admin/settings/class-ur-settings-general.php:70
453
  msgid "General Options"
454
  msgstr ""
455
 
456
  #: includes/admin/settings/class-ur-settings-general.php:45
457
- #: includes/admin/settings/class-ur-settings-general.php:329
458
  msgid "Login Options"
459
  msgstr ""
460
 
@@ -467,315 +469,315 @@ msgstr ""
467
  msgid "Export Users"
468
  msgstr ""
469
 
470
- #: includes/admin/settings/class-ur-settings-general.php:76
471
  msgid "User login option"
472
  msgstr ""
473
 
474
- #: includes/admin/settings/class-ur-settings-general.php:77
475
  msgid "This option lets you choose login option after user registration."
476
  msgstr ""
477
 
478
- #: includes/admin/settings/class-ur-settings-general.php:87
479
  msgid "Redirect URL"
480
  msgstr ""
481
 
482
- #: includes/admin/settings/class-ur-settings-general.php:88
483
  msgid "This option lets you enter redirect path after successful user registration."
484
  msgstr ""
485
 
486
- #: includes/admin/settings/class-ur-settings-general.php:95
487
  msgid "Prevent dashboard access"
488
  msgstr ""
489
 
490
- #: includes/admin/settings/class-ur-settings-general.php:96
491
  msgid ""
492
  "This option lets you limit which roles you are willing to prevent dashboard "
493
  "access."
494
  msgstr ""
495
 
496
- #: includes/admin/settings/class-ur-settings-general.php:111
497
  msgid "My account Section"
498
  msgstr ""
499
 
500
- #: includes/admin/settings/class-ur-settings-general.php:116
501
  msgid "My account page"
502
  msgstr ""
503
 
504
- #: includes/admin/settings/class-ur-settings-general.php:117
505
  msgid "Page contents: [%s]"
506
  msgstr ""
507
 
508
- #: includes/admin/settings/class-ur-settings-general.php:126
509
  msgid "Layout"
510
  msgstr ""
511
 
512
- #: includes/admin/settings/class-ur-settings-general.php:127
513
  msgid "This option lets you choose layout for user registration my account tab."
514
  msgstr ""
515
 
516
- #: includes/admin/settings/class-ur-settings-general.php:135
517
  msgid "Horizontal"
518
  msgstr ""
519
 
520
- #: includes/admin/settings/class-ur-settings-general.php:136
521
  msgid "Vertical"
522
  msgstr ""
523
 
524
- #: includes/admin/settings/class-ur-settings-general.php:146
525
  msgid "Endpoints: "
526
  msgstr ""
527
 
528
- #: includes/admin/settings/class-ur-settings-general.php:146
529
  msgid ""
530
  "Endpoints are appended to your page URLs to handle specific actions on the "
531
  "accounts pages. They should be unique and can be left blank to disable the "
532
  "endpoint."
533
  msgstr ""
534
 
535
- #: includes/admin/settings/class-ur-settings-general.php:151
536
  msgid "Edit profile"
537
  msgstr ""
538
 
539
- #: includes/admin/settings/class-ur-settings-general.php:152
540
  msgid "Endpoint for the \"My account &rarr; Edit profile\" page."
541
  msgstr ""
542
 
543
- #: includes/admin/settings/class-ur-settings-general.php:159
544
  #: includes/class-ur-query.php:73 includes/functions-ur-account.php:88
545
  msgid "Change Password"
546
  msgstr ""
547
 
548
- #: includes/admin/settings/class-ur-settings-general.php:160
549
  msgid "Endpoint for the \"My account &rarr; Change Password\" page."
550
  msgstr ""
551
 
552
- #: includes/admin/settings/class-ur-settings-general.php:168
553
  msgid "Endpoint for the \"My account &rarr; Lost password\" page."
554
  msgstr ""
555
 
556
- #: includes/admin/settings/class-ur-settings-general.php:175
557
  msgid "User logout"
558
  msgstr ""
559
 
560
- #: includes/admin/settings/class-ur-settings-general.php:176
561
  msgid ""
562
  "Endpoint for the triggering logout. You can add this to your menus via a "
563
  "custom link: yoursite.com/?user-logout=true"
564
  msgstr ""
565
 
566
- #: includes/admin/settings/class-ur-settings-general.php:202
567
  msgid "Success Messages"
568
  msgstr ""
569
 
570
- #: includes/admin/settings/class-ur-settings-general.php:209
571
- #: includes/functions-ur-core.php:795
572
  msgid "Manual login after registration"
573
  msgstr ""
574
 
575
- #: includes/admin/settings/class-ur-settings-general.php:210
576
  msgid ""
577
  "Enter the text message after successful form submission on manual login "
578
  "after registration."
579
  msgstr ""
580
 
581
- #: includes/admin/settings/class-ur-settings-general.php:215
582
- #: includes/class-ur-frontend-scripts.php:327
583
  msgid "User successfully registered."
584
  msgstr ""
585
 
586
- #: includes/admin/settings/class-ur-settings-general.php:219
587
- #: includes/functions-ur-core.php:796
588
  msgid "Email confirmation to login"
589
  msgstr ""
590
 
591
- #: includes/admin/settings/class-ur-settings-general.php:220
592
  msgid ""
593
  "Enter the text message after successful form submission on email "
594
  "confirmation to login."
595
  msgstr ""
596
 
597
- #: includes/admin/settings/class-ur-settings-general.php:225
598
- #: includes/class-ur-frontend-scripts.php:329
599
  msgid ""
600
  "User registered. Verify your email by clicking on the link sent to your "
601
  "email."
602
  msgstr ""
603
 
604
- #: includes/admin/settings/class-ur-settings-general.php:229
605
- #: includes/functions-ur-core.php:798
606
  msgid "Admin approval after registration"
607
  msgstr ""
608
 
609
- #: includes/admin/settings/class-ur-settings-general.php:230
610
  msgid ""
611
  "Enter the text message after successful form submission on admin approval "
612
  "after registration."
613
  msgstr ""
614
 
615
- #: includes/admin/settings/class-ur-settings-general.php:235
616
- #: includes/class-ur-frontend-scripts.php:328
617
  msgid "User registered. Wait until admin approves your registration."
618
  msgstr ""
619
 
620
- #: includes/admin/settings/class-ur-settings-general.php:244
621
  msgid "Error Messages"
622
  msgstr ""
623
 
624
- #: includes/admin/settings/class-ur-settings-general.php:251
625
- #: includes/functions-ur-core.php:564
626
  msgid "Required"
627
  msgstr ""
628
 
629
- #: includes/admin/settings/class-ur-settings-general.php:252
630
  msgid "Enter the error message in form submission on required fields."
631
  msgstr ""
632
 
633
- #: includes/admin/settings/class-ur-settings-general.php:257
634
- #: includes/class-ur-frontend-scripts.php:321
635
  msgid "This field is required."
636
  msgstr ""
637
 
638
- #: includes/admin/settings/class-ur-settings-general.php:262
639
  msgid "Enter the error message in form submission on Email."
640
  msgstr ""
641
 
642
- #: includes/admin/settings/class-ur-settings-general.php:267
643
- #: includes/class-ur-frontend-scripts.php:322
644
  msgid "Please enter a valid email address."
645
  msgstr ""
646
 
647
- #: includes/admin/settings/class-ur-settings-general.php:271
648
  msgid "Website URL"
649
  msgstr ""
650
 
651
- #: includes/admin/settings/class-ur-settings-general.php:272
652
  msgid "Enter the error message in form submission on website/URL."
653
  msgstr ""
654
 
655
- #: includes/admin/settings/class-ur-settings-general.php:277
656
- #: includes/class-ur-frontend-scripts.php:323
657
  msgid "Please enter a valid URL."
658
  msgstr ""
659
 
660
- #: includes/admin/settings/class-ur-settings-general.php:281
661
  #: includes/form/class-ur-form-field-number.php:37
662
  #: includes/form/class-ur-form-field-number.php:42
663
  msgid "Number"
664
  msgstr ""
665
 
666
- #: includes/admin/settings/class-ur-settings-general.php:282
667
  msgid "Enter the error message in form submission on Number."
668
  msgstr ""
669
 
670
- #: includes/admin/settings/class-ur-settings-general.php:287
671
- #: includes/class-ur-frontend-scripts.php:324
672
  msgid "Please enter a valid number."
673
  msgstr ""
674
 
675
- #: includes/admin/settings/class-ur-settings-general.php:291
676
  #: includes/form/class-ur-form-field-user-confirm-password.php:40
677
  msgid "Confirm Password"
678
  msgstr ""
679
 
680
- #: includes/admin/settings/class-ur-settings-general.php:292
681
  msgid "Enter the error message in form submission on Confim Password."
682
  msgstr ""
683
 
684
- #: includes/admin/settings/class-ur-settings-general.php:297
685
- #: includes/class-ur-frontend-scripts.php:325
686
  msgid "Password and confirm password not matched."
687
  msgstr ""
688
 
689
- #: includes/admin/settings/class-ur-settings-general.php:301
690
  msgid "Google reCaptcha"
691
  msgstr ""
692
 
693
- #: includes/admin/settings/class-ur-settings-general.php:302
694
  msgid "Enter the error message in form submission on google recaptcha."
695
  msgstr ""
696
 
697
- #: includes/admin/settings/class-ur-settings-general.php:307
698
- #: includes/class-ur-ajax.php:84 includes/class-ur-form-handler.php:279
699
- #: includes/class-ur-frontend-scripts.php:330
700
  msgid "Captcha code error, please try again."
701
  msgstr ""
702
 
703
- #: includes/admin/settings/class-ur-settings-general.php:336
704
- #: includes/functions-ur-core.php:753
705
  msgid "Form Template"
706
  msgstr ""
707
 
708
- #: includes/admin/settings/class-ur-settings-general.php:337
709
  msgid "Choose the login form template."
710
  msgstr ""
711
 
712
- #: includes/admin/settings/class-ur-settings-general.php:344
713
- #: includes/functions-ur-core.php:760
714
  msgid "Default"
715
  msgstr ""
716
 
717
- #: includes/admin/settings/class-ur-settings-general.php:345
718
- #: includes/functions-ur-core.php:761
719
  msgid "Bordered"
720
  msgstr ""
721
 
722
- #: includes/admin/settings/class-ur-settings-general.php:346
723
- #: includes/functions-ur-core.php:762
724
  msgid "Flat"
725
  msgstr ""
726
 
727
- #: includes/admin/settings/class-ur-settings-general.php:347
728
- #: includes/functions-ur-core.php:763
729
  msgid "Rounded"
730
  msgstr ""
731
 
732
- #: includes/admin/settings/class-ur-settings-general.php:348
733
- #: includes/functions-ur-core.php:764
734
  msgid "Rounded Edge"
735
  msgstr ""
736
 
737
- #: includes/admin/settings/class-ur-settings-general.php:353
738
  msgid "Enable remember me"
739
  msgstr ""
740
 
741
- #: includes/admin/settings/class-ur-settings-general.php:354
742
  msgid "Check to enable/disable remember me."
743
  msgstr ""
744
 
745
- #: includes/admin/settings/class-ur-settings-general.php:363
746
  msgid "Enable lost password"
747
  msgstr ""
748
 
749
- #: includes/admin/settings/class-ur-settings-general.php:364
750
  msgid "Check to enable/disable lost password."
751
  msgstr ""
752
 
753
- #: includes/admin/settings/class-ur-settings-general.php:373
754
  msgid "Enable google reCaptcha"
755
  msgstr ""
756
 
757
- #: includes/admin/settings/class-ur-settings-general.php:374
758
  msgid "Enable %1$s %2$s reCaptcha %3$s support"
759
  msgstr ""
760
 
761
- #: includes/admin/settings/class-ur-settings-general.php:383
762
  msgid "Registration URL"
763
  msgstr ""
764
 
765
- #: includes/admin/settings/class-ur-settings-general.php:384
766
  msgid "This option lets you enter the registration page url in login form."
767
  msgstr ""
768
 
769
- #: includes/admin/settings/class-ur-settings-general.php:392
770
  msgid "Registration URL label"
771
  msgstr ""
772
 
773
- #: includes/admin/settings/class-ur-settings-general.php:393
774
  msgid "This option lets you enter the label to registration url in login form."
775
  msgstr ""
776
 
777
- #: includes/admin/settings/class-ur-settings-general.php:398
778
- #: templates/myaccount/form-login.php:112
779
  msgid "Not a member yet? Register now."
780
  msgstr ""
781
 
@@ -783,41 +785,41 @@ msgstr ""
783
  msgid "Integration"
784
  msgstr ""
785
 
786
- #: includes/admin/settings/class-ur-settings-integration.php:46
787
  msgid "Google reCaptcha Integation"
788
  msgstr ""
789
 
790
- #: includes/admin/settings/class-ur-settings-integration.php:52
791
  msgid "Version"
792
  msgstr ""
793
 
794
- #: includes/admin/settings/class-ur-settings-integration.php:53
795
  msgid "Select the google reCaptcha version"
796
  msgstr ""
797
 
798
- #: includes/admin/settings/class-ur-settings-integration.php:65
799
  msgid "Site Key (v2)"
800
  msgstr ""
801
 
802
- #: includes/admin/settings/class-ur-settings-integration.php:66
803
- #: includes/admin/settings/class-ur-settings-integration.php:87
804
  msgid "Get site key from google %1$s reCaptcha %2$s."
805
  msgstr ""
806
 
807
- #: includes/admin/settings/class-ur-settings-integration.php:76
808
  msgid "Secret Key (v2)"
809
  msgstr ""
810
 
811
- #: includes/admin/settings/class-ur-settings-integration.php:77
812
- #: includes/admin/settings/class-ur-settings-integration.php:98
813
  msgid "Get secret key from google %1$s reCaptcha %2$s."
814
  msgstr ""
815
 
816
- #: includes/admin/settings/class-ur-settings-integration.php:86
817
  msgid "Site Key (v3)"
818
  msgstr ""
819
 
820
- #: includes/admin/settings/class-ur-settings-integration.php:97
821
  msgid "Secret Key (v3)"
822
  msgstr ""
823
 
@@ -841,39 +843,28 @@ msgstr ""
841
  msgid "Return to emails"
842
  msgstr ""
843
 
844
- #: includes/admin/settings/emails/class-ur-settings-admin-email.php:46
845
- #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:47
846
- #: includes/admin/settings/emails/class-ur-settings-registration-approved-email.php:47
847
- #: includes/admin/settings/emails/class-ur-settings-registration-denied-email.php:47
848
- #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:46
849
- #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:45
850
- #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:47
851
  msgid "Enable this email"
852
  msgstr ""
853
 
854
- #: includes/admin/settings/emails/class-ur-settings-admin-email.php:47
855
  msgid "Enable this email sent to admin after successful user registration."
856
  msgstr ""
857
 
858
- #: includes/admin/settings/emails/class-ur-settings-admin-email.php:54
859
  msgid "Email Receipents"
860
  msgstr ""
861
 
862
- #: includes/admin/settings/emails/class-ur-settings-admin-email.php:55
863
  msgid "Use comma to send emails to multiple receipents."
864
  msgstr ""
865
 
866
- #: includes/admin/settings/emails/class-ur-settings-admin-email.php:64
867
- #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:55
868
- #: includes/admin/settings/emails/class-ur-settings-email-confirmation.php:47
869
- #: includes/admin/settings/emails/class-ur-settings-registration-approved-email.php:55
870
- #: includes/admin/settings/emails/class-ur-settings-registration-denied-email.php:55
871
- #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:55
872
- #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:53
873
- #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:55
874
- msgid "Email Subject"
875
- msgstr ""
876
-
877
  #: includes/admin/settings/emails/class-ur-settings-admin-email.php:65
878
  #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:56
879
  #: includes/admin/settings/emails/class-ur-settings-email-confirmation.php:48
@@ -882,23 +873,23 @@ msgstr ""
882
  #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:56
883
  #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:54
884
  #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:56
885
- msgid "The email subject you want to customize."
886
  msgstr ""
887
 
888
- #: includes/admin/settings/emails/class-ur-settings-admin-email.php:68
889
- #: includes/class-ur-emailer.php:257
890
- msgid "A New User Registered"
 
 
 
 
 
 
891
  msgstr ""
892
 
893
- #: includes/admin/settings/emails/class-ur-settings-admin-email.php:73
894
- #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:64
895
- #: includes/admin/settings/emails/class-ur-settings-email-confirmation.php:57
896
- #: includes/admin/settings/emails/class-ur-settings-registration-approved-email.php:64
897
- #: includes/admin/settings/emails/class-ur-settings-registration-denied-email.php:64
898
- #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:65
899
- #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:62
900
- #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:64
901
- msgid "Email Content"
902
  msgstr ""
903
 
904
  #: includes/admin/settings/emails/class-ur-settings-admin-email.php:74
@@ -909,10 +900,21 @@ msgstr ""
909
  #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:66
910
  #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:63
911
  #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:65
 
 
 
 
 
 
 
 
 
 
 
912
  msgid "The email content you want to customize."
913
  msgstr ""
914
 
915
- #: includes/admin/settings/emails/class-ur-settings-admin-email.php:92
916
  msgid ""
917
  "Hi Admin,\n"
918
  "\n"
@@ -937,23 +939,23 @@ msgstr ""
937
  msgid "Awaiting Admin Approval Email"
938
  msgstr ""
939
 
940
- #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:48
941
  msgid ""
942
  "Enable this email sent to user notifying the registration is awaiting admin "
943
  "approval."
944
  msgstr ""
945
 
946
- #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:59
947
- #: includes/class-ur-emailer.php:198
948
  msgid "Thank you for registration on {{blog_info}}"
949
  msgstr ""
950
 
951
- #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:85
952
  msgid ""
953
  "Hi {{username}},\n"
954
  "\n"
955
  " \t\t\t\tYou have registered on <a href=\"{{home_url}}\">{{blog_info}}</a>.\n"
956
- " \t\t\t\t \n"
957
  " \t\t\t\tPlease wait until the site admin approves your registration. You "
958
  "will be notified after it is approved.\n"
959
  "\n"
@@ -971,12 +973,12 @@ msgid ""
971
  "register option is choosen"
972
  msgstr ""
973
 
974
- #: includes/admin/settings/emails/class-ur-settings-email-confirmation.php:51
975
- #: includes/class-ur-emailer.php:186
976
  msgid "Please confirm your registration on {{blog_info}}"
977
  msgstr ""
978
 
979
- #: includes/admin/settings/emails/class-ur-settings-email-confirmation.php:79
980
  msgid ""
981
  "Hi {{username}},\n"
982
  "\n"
@@ -997,18 +999,18 @@ msgstr ""
997
  msgid "Email sent to the user notifying the registration is approved by site admin"
998
  msgstr ""
999
 
1000
- #: includes/admin/settings/emails/class-ur-settings-registration-approved-email.php:48
1001
  msgid ""
1002
  "Enable this email sent to the user notifying the registration is approved "
1003
  "by site admin."
1004
  msgstr ""
1005
 
1006
- #: includes/admin/settings/emails/class-ur-settings-registration-approved-email.php:59
1007
- #: includes/class-ur-emailer.php:335
1008
  msgid "Congratulations! Registration approved on {{blog_info}}"
1009
  msgstr ""
1010
 
1011
- #: includes/admin/settings/emails/class-ur-settings-registration-approved-email.php:85
1012
  msgid ""
1013
  "Hi {{username}},\n"
1014
  "\n"
@@ -1030,18 +1032,18 @@ msgstr ""
1030
  msgid "Email sent to the user notifying the registration is denied by the admin"
1031
  msgstr ""
1032
 
1033
- #: includes/admin/settings/emails/class-ur-settings-registration-denied-email.php:48
1034
  msgid ""
1035
  "Enable this email sent to the user notifying the registration is denied by "
1036
  "the admin."
1037
  msgstr ""
1038
 
1039
- #: includes/admin/settings/emails/class-ur-settings-registration-denied-email.php:59
1040
- #: includes/class-ur-emailer.php:212 includes/class-ur-emailer.php:322
1041
  msgid "Sorry! Registration denied on {{blog_info}}"
1042
  msgstr ""
1043
 
1044
- #: includes/admin/settings/emails/class-ur-settings-registration-denied-email.php:85
1045
  msgid ""
1046
  "Hi {{username}},\n"
1047
  "\n"
@@ -1062,16 +1064,16 @@ msgstr ""
1062
  msgid "Email sent to the user notifying the registration is pending"
1063
  msgstr ""
1064
 
1065
- #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:47
1066
  msgid "Enable this email sent to the user notifying the registration is pending."
1067
  msgstr ""
1068
 
1069
- #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:59
1070
- #: includes/class-ur-emailer.php:309
1071
  msgid "Sorry! Registration changed to pending on {{blog_info}}"
1072
  msgstr ""
1073
 
1074
- #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:87
1075
  msgid ""
1076
  "Hi {{username}},\n"
1077
  "\n"
@@ -1094,25 +1096,25 @@ msgstr ""
1094
  msgid "Email sent to the user when a user requests for reset password"
1095
  msgstr ""
1096
 
1097
- #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:46
1098
  msgid "Enable this email sent to the user when a user requests for reset password."
1099
  msgstr ""
1100
 
1101
- #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:57
1102
- #: includes/class-ur-emailer.php:369
1103
  msgid "Password Reset Email: {{blog_info}}"
1104
  msgstr ""
1105
 
1106
- #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:82
1107
  msgid ""
1108
  "Someone has requested a password reset for the following account:\n"
1109
  "\n"
1110
  "\t\t\tSiteName: {{blog_info}}\n"
1111
  "\t\t\tUsername: {{username}}\n"
1112
- "\t\t\t\n"
1113
  "\t\t\tIf this was a mistake, just ignore this email and nothing will "
1114
  "happen.\n"
1115
- "\t\t\t\n"
1116
  "\t\t\tTo reset your password, visit the following address:\n"
1117
  "\t\t\t{{home_url}}/wp-login.php?action=rp&key={{key}}&login={{username}}\n"
1118
  "\n"
@@ -1128,16 +1130,16 @@ msgstr ""
1128
  msgid "Email sent to the user after successful registration"
1129
  msgstr ""
1130
 
1131
- #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:48
1132
  msgid "Enable this email sent to the user after successful user registration."
1133
  msgstr ""
1134
 
1135
- #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:59
1136
- #: includes/class-ur-emailer.php:224
1137
  msgid "Congratulations! Registration Complete on {{blog_info}}"
1138
  msgstr ""
1139
 
1140
- #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:84
1141
  msgid ""
1142
  "Hi {{username}},\n"
1143
  "\n"
@@ -1150,21 +1152,21 @@ msgid ""
1150
  "\t\t\tThank You!"
1151
  msgstr ""
1152
 
1153
- #: includes/admin/updater/class-ur-addon-updater.php:210
1154
  msgid "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
1155
  msgstr ""
1156
 
1157
- #: includes/admin/updater/class-ur-addon-updater.php:218
1158
  msgid ""
1159
  "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
1160
  "or %5$supdate now%6$s."
1161
  msgstr ""
1162
 
1163
- #: includes/admin/updater/class-ur-addon-updater.php:408
1164
  msgid "You do not have permission to install plugin updates"
1165
  msgstr ""
1166
 
1167
- #: includes/admin/updater/class-ur-addon-updater.php:408
1168
  msgid "Error"
1169
  msgstr ""
1170
 
@@ -1196,31 +1198,31 @@ msgstr ""
1196
  msgid "Form Name"
1197
  msgstr ""
1198
 
1199
- #: includes/admin/views/html-admin-page-forms.php:34
1200
  msgid "Copy Shortcode!"
1201
  msgstr ""
1202
 
1203
- #: includes/admin/views/html-admin-page-forms.php:34
1204
  msgid "Copied!"
1205
  msgstr ""
1206
 
1207
- #: includes/admin/views/html-admin-page-forms.php:56
1208
  msgid "Fields"
1209
  msgstr ""
1210
 
1211
- #: includes/admin/views/html-admin-page-forms.php:59
1212
  msgid "Field Options"
1213
  msgstr ""
1214
 
1215
- #: includes/admin/views/html-admin-page-forms.php:62
1216
  msgid "Form Setting"
1217
  msgstr ""
1218
 
1219
- #: includes/admin/views/html-admin-page-forms.php:68
1220
  msgid "Default User Fields"
1221
  msgstr ""
1222
 
1223
- #: includes/admin/views/html-admin-page-forms.php:71
1224
  msgid "Extra Fields"
1225
  msgstr ""
1226
 
@@ -1289,15 +1291,15 @@ msgstr ""
1289
 
1290
  #: includes/admin/views/html-notice-key-unvalidated.php:13
1291
  msgid ""
1292
- "%sPlease enter your license key%s in the plugin list below to get updates "
1293
- "for <strong>%s</strong> Add-Ons."
1294
  msgstr ""
1295
 
1296
  #: includes/admin/views/html-notice-registration.php:14
1297
  msgid ""
1298
  "To allow users to register for your website via User registration, you must "
1299
- "first enable user registration. Go to %sSettings > General%s tab, and under "
1300
- "Membership make sure to check <strong>Anyone can register</strong>."
1301
  msgstr ""
1302
 
1303
  #: includes/admin/views/html-notice-update.php:12
@@ -1333,108 +1335,108 @@ msgstr ""
1333
  msgid "Taking a while? Click here to run it now."
1334
  msgstr ""
1335
 
1336
- #: includes/class-ur-ajax.php:79 includes/class-ur-form-handler.php:276
1337
  msgid "Error on google reCaptcha. Contact your site administrator."
1338
  msgstr ""
1339
 
1340
- #: includes/class-ur-ajax.php:91
1341
  msgid "Nonce error, please reload."
1342
  msgstr ""
1343
 
1344
- #: includes/class-ur-ajax.php:101 includes/class-ur-shortcodes.php:107
1345
  msgid "Only administrators can add new users."
1346
  msgstr ""
1347
 
1348
- #: includes/class-ur-ajax.php:117 includes/class-ur-shortcodes.php:121
1349
- msgid "You are currently logged in as %1s. %2s"
1350
  msgstr ""
1351
 
1352
- #: includes/class-ur-ajax.php:117 includes/class-ur-shortcodes.php:121
1353
  msgid "Log out of this account."
1354
  msgstr ""
1355
 
1356
- #: includes/class-ur-ajax.php:117 includes/class-ur-shortcodes.php:121
1357
  #: includes/functions-ur-account.php:89
1358
  msgid "Logout"
1359
  msgstr ""
1360
 
1361
- #: includes/class-ur-ajax.php:178 includes/class-ur-ajax.php:184
1362
  msgid "post data not set"
1363
  msgstr ""
1364
 
1365
- #: includes/class-ur-ajax.php:199
1366
  msgid "Could not save form. Invalid field name. Please check all field name"
1367
  msgstr ""
1368
 
1369
- #: includes/class-ur-email-confirmation.php:147
1370
  msgid "Verified"
1371
  msgstr ""
1372
 
1373
- #: includes/class-ur-email-confirmation.php:149
1374
  msgid "Pending"
1375
  msgstr ""
1376
 
1377
- #: includes/class-ur-email-confirmation.php:169
1378
  msgid "User successfully registered. Login to continue."
1379
  msgstr ""
1380
 
1381
- #: includes/class-ur-email-confirmation.php:174
1382
  msgid "Token Mismatch!"
1383
  msgstr ""
1384
 
1385
- #: includes/class-ur-email-confirmation.php:179
1386
  msgid "Verification Email Sent!"
1387
  msgstr ""
1388
 
1389
- #: includes/class-ur-email-confirmation.php:184
1390
  msgid "User doesnot exist!"
1391
  msgstr ""
1392
 
1393
- #: includes/class-ur-email-confirmation.php:329
1394
- #: includes/class-ur-form-handler.php:276
1395
- #: includes/class-ur-form-handler.php:279
 
1396
  #: includes/class-ur-form-handler.php:284
1397
- #: includes/class-ur-form-handler.php:288
1398
- #: includes/class-ur-form-handler.php:297
1399
- #: includes/class-ur-user-approval.php:179
1400
- #: includes/class-ur-user-approval.php:184 includes/functions-ur-account.php:32
1401
  #: includes/functions-ur-account.php:35
1402
  msgid "ERROR:"
1403
  msgstr ""
1404
 
1405
- #: includes/class-ur-email-confirmation.php:329
1406
  msgid ""
1407
  "Your account is still pending approval. Verify your email by clicking on "
1408
  "the link sent to your email. %s"
1409
  msgstr ""
1410
 
1411
- #: includes/class-ur-email-confirmation.php:329
1412
  msgid "Resend Verification Link"
1413
  msgstr ""
1414
 
1415
- #: includes/class-ur-email-confirmation.php:350
1416
  msgid ""
1417
  "Email not verified! Verifiy your email by clicking on the link sent to your "
1418
  "email."
1419
  msgstr ""
1420
 
1421
- #: includes/class-ur-emailer.php:126
1422
  msgid "Chosen Password"
1423
  msgstr ""
1424
 
1425
- #: includes/class-ur-form-block.php:47
1426
  msgid "Select &#38; display one of your form."
1427
  msgstr ""
1428
 
1429
- #: includes/class-ur-form-block.php:48
1430
  msgid "Select a Form"
1431
  msgstr ""
1432
 
1433
- #: includes/class-ur-form-block.php:49
1434
  msgid "Form Settings"
1435
  msgstr ""
1436
 
1437
- #: includes/class-ur-form-block.php:50
1438
  msgid "Form"
1439
  msgstr ""
1440
 
@@ -1446,222 +1448,222 @@ msgstr ""
1446
  msgid "%s is not a valid email address."
1447
  msgstr ""
1448
 
1449
- #: includes/class-ur-form-handler.php:155
1450
  msgid "User profile updated successfully."
1451
  msgstr ""
1452
 
1453
- #: includes/class-ur-form-handler.php:202
1454
  msgid "Please fill out all password fields."
1455
  msgstr ""
1456
 
1457
- #: includes/class-ur-form-handler.php:205
1458
  msgid "Please enter your current password."
1459
  msgstr ""
1460
 
1461
- #: includes/class-ur-form-handler.php:208
1462
  msgid "Please re-enter your password."
1463
  msgstr ""
1464
 
1465
- #: includes/class-ur-form-handler.php:211
1466
  msgid "New passwords do not match."
1467
  msgstr ""
1468
 
1469
- #: includes/class-ur-form-handler.php:214
1470
  msgid "Your current password is incorrect."
1471
  msgstr ""
1472
 
1473
- #: includes/class-ur-form-handler.php:235
1474
  msgid "Password changed successfully."
1475
  msgstr ""
1476
 
1477
- #: includes/class-ur-form-handler.php:288
1478
  msgid "Username is required."
1479
  msgstr ""
1480
 
1481
- #: includes/class-ur-form-handler.php:297
1482
  msgid "A user could not be found with this email address."
1483
  msgstr ""
1484
 
1485
- #: includes/class-ur-form-handler.php:387
1486
  msgid "Please enter your password."
1487
  msgstr ""
1488
 
1489
- #: includes/class-ur-form-handler.php:391
1490
  msgid "Passwords do not match."
1491
  msgstr ""
1492
 
1493
- #: includes/class-ur-frontend-scripts.php:338
1494
  msgid "Please enter a stronger password."
1495
  msgstr ""
1496
 
1497
- #: includes/class-ur-frontend-scripts.php:340
1498
- #: includes/functions-ur-core.php:717
1499
  msgid "Very Weak"
1500
  msgstr ""
1501
 
1502
- #: includes/class-ur-frontend-scripts.php:341
1503
- #: includes/functions-ur-core.php:718
1504
  msgid "Weak"
1505
  msgstr ""
1506
 
1507
- #: includes/class-ur-frontend-scripts.php:342
1508
- #: includes/functions-ur-core.php:719
1509
  msgid "Medium"
1510
  msgstr ""
1511
 
1512
- #: includes/class-ur-frontend-scripts.php:343
1513
- #: includes/functions-ur-core.php:720
1514
  msgid "Strong"
1515
  msgstr ""
1516
 
1517
- #: includes/class-ur-frontend-scripts.php:344
1518
  msgid "Password with confirm password not matched."
1519
  msgstr ""
1520
 
1521
- #: includes/class-ur-frontend-scripts.php:347
1522
  msgid ""
1523
  "Hint: To make password stronger, use upper and lower case letters, numbers, "
1524
  "and symbols like ! \" ? $ % ^ & )."
1525
  msgstr ""
1526
 
1527
- #: includes/class-ur-install.php:339
1528
  msgid "Default form"
1529
  msgstr ""
1530
 
1531
- #: includes/class-ur-install.php:608
1532
  msgid "View User Registration settings"
1533
  msgstr ""
1534
 
1535
- #: includes/class-ur-install.php:624
1536
  msgid "View User Registration documentation"
1537
  msgstr ""
1538
 
1539
- #: includes/class-ur-install.php:624
1540
  msgid "Docs"
1541
  msgstr ""
1542
 
1543
- #: includes/class-ur-install.php:625
1544
  msgid "Visit free customer support"
1545
  msgstr ""
1546
 
1547
- #: includes/class-ur-install.php:625
1548
  msgid "Free support"
1549
  msgstr ""
1550
 
1551
- #: includes/class-ur-logger.php:57
1552
  msgid ""
1553
  "The provided handler <code>%s</code> does not implement "
1554
  "UR_Log_Handler_Interface."
1555
  msgstr ""
1556
 
1557
- #: includes/class-ur-logger.php:129
1558
  msgid "UR_Logger::log was called with an invalid level \"%s\"."
1559
  msgstr ""
1560
 
1561
- #: includes/class-ur-plugin-updater.php:241
1562
  msgid "Deactivate License Key"
1563
  msgstr ""
1564
 
1565
- #: includes/class-ur-plugin-updater.php:241
1566
  msgid "Deactivate License"
1567
  msgstr ""
1568
 
1569
- #: includes/class-ur-plugin-updater.php:272
1570
  msgid ""
1571
  "The provided license key expired on %1$s. Please <a href=\"%2$s\" "
1572
  "target=\"_blank\">renew your license key</a>."
1573
  msgstr ""
1574
 
1575
- #: includes/class-ur-plugin-updater.php:276
1576
  msgid ""
1577
  "The provided license key has been disabled. Please <a href=\"%s\" "
1578
  "target=\"_blank\">contact support</a> for more information."
1579
  msgstr ""
1580
 
1581
- #: includes/class-ur-plugin-updater.php:280
1582
  msgid ""
1583
  "The provided license is invalid. Please <a href=\"%s\" "
1584
  "target=\"_blank\">visit your account page</a> and verify it."
1585
  msgstr ""
1586
 
1587
- #: includes/class-ur-plugin-updater.php:285
1588
  msgid ""
1589
  "The provided license is not active for this URL. Please <a href=\"%s\" "
1590
  "target=\"_blank\">visit your account page</a> to manage your license key "
1591
  "URLs."
1592
  msgstr ""
1593
 
1594
- #: includes/class-ur-plugin-updater.php:290
1595
  msgid "This appears to be an invalid license key for <strong>%1$s</strong>."
1596
  msgstr ""
1597
 
1598
- #: includes/class-ur-plugin-updater.php:294
1599
  msgid ""
1600
  "The provided license key has reached its activation limit. Please <a "
1601
  "href=\"%1$s\" target=\"_blank\">View possible upgrades</a> now."
1602
  msgstr ""
1603
 
1604
- #: includes/class-ur-plugin-updater.php:298
1605
  msgid ""
1606
  "The key you entered belongs to a bundle, please use the product specific "
1607
  "license key."
1608
  msgstr ""
1609
 
1610
- #: includes/class-ur-plugin-updater.php:302
1611
  msgid ""
1612
  "The provided license key could not be found. Please <a href=\"%s\" "
1613
  "target=\"_blank\">contact support</a> for more information."
1614
  msgstr ""
1615
 
1616
- #: includes/class-ur-plugin-updater.php:306
1617
  msgid "<strong>Activation error:</strong> %1$s"
1618
  msgstr ""
1619
 
1620
- #: includes/class-ur-post-types.php:46
1621
  msgid "Registrations"
1622
  msgstr ""
1623
 
1624
- #: includes/class-ur-post-types.php:47
1625
  msgid "Registration"
1626
  msgstr ""
1627
 
1628
- #: includes/class-ur-post-types.php:49
1629
  msgid "Add registration"
1630
  msgstr ""
1631
 
1632
- #: includes/class-ur-post-types.php:50
1633
  msgid "Add new registration"
1634
  msgstr ""
1635
 
1636
- #: includes/class-ur-post-types.php:52
1637
  msgid "Edit registration"
1638
  msgstr ""
1639
 
1640
- #: includes/class-ur-post-types.php:53
1641
  msgid "New registration"
1642
  msgstr ""
1643
 
1644
- #: includes/class-ur-post-types.php:54
1645
  msgid "View registrations"
1646
  msgstr ""
1647
 
1648
- #: includes/class-ur-post-types.php:55
1649
  msgid "View registration"
1650
  msgstr ""
1651
 
1652
- #: includes/class-ur-post-types.php:56
1653
  msgid "Search registrations"
1654
  msgstr ""
1655
 
1656
- #: includes/class-ur-post-types.php:57
1657
  msgid "No registrations found"
1658
  msgstr ""
1659
 
1660
- #: includes/class-ur-post-types.php:58
1661
  msgid "No registrations found in trash"
1662
  msgstr ""
1663
 
1664
- #: includes/class-ur-post-types.php:59
1665
  msgid "Parent registration"
1666
  msgstr ""
1667
 
@@ -1866,15 +1868,15 @@ msgstr ""
1866
  msgid "Profile Details"
1867
  msgstr ""
1868
 
1869
- #: includes/class-ur-user-approval.php:179
1870
  msgid "Your account is still pending approval."
1871
  msgstr ""
1872
 
1873
- #: includes/class-ur-user-approval.php:184
1874
  msgid "Your account has been denied."
1875
  msgstr ""
1876
 
1877
- #: includes/class-ur-user-approval.php:254
1878
  msgid ""
1879
  "Your account is still awaiting admin approval. Reset Password is not "
1880
  "allowed."
@@ -1885,1004 +1887,1004 @@ msgstr ""
1885
  msgid "Checkbox"
1886
  msgstr ""
1887
 
1888
- #: includes/form/class-ur-form-field-country.php:33
1889
  msgid "Afghanistan"
1890
  msgstr ""
1891
 
1892
- #: includes/form/class-ur-form-field-country.php:34
1893
  msgid "&#197;land Islands"
1894
  msgstr ""
1895
 
1896
- #: includes/form/class-ur-form-field-country.php:35
1897
  msgid "Albania"
1898
  msgstr ""
1899
 
1900
- #: includes/form/class-ur-form-field-country.php:36
1901
  msgid "Algeria"
1902
  msgstr ""
1903
 
1904
- #: includes/form/class-ur-form-field-country.php:37
1905
  msgid "American Samoa"
1906
  msgstr ""
1907
 
1908
- #: includes/form/class-ur-form-field-country.php:38
1909
  msgid "Andorra"
1910
  msgstr ""
1911
 
1912
- #: includes/form/class-ur-form-field-country.php:39
1913
  msgid "Angola"
1914
  msgstr ""
1915
 
1916
- #: includes/form/class-ur-form-field-country.php:40
1917
  msgid "Anguilla"
1918
  msgstr ""
1919
 
1920
- #: includes/form/class-ur-form-field-country.php:41
1921
  msgid "Antarctica"
1922
  msgstr ""
1923
 
1924
- #: includes/form/class-ur-form-field-country.php:42
1925
  msgid "Antigua and Barbuda"
1926
  msgstr ""
1927
 
1928
- #: includes/form/class-ur-form-field-country.php:43
1929
  msgid "Argentina"
1930
  msgstr ""
1931
 
1932
- #: includes/form/class-ur-form-field-country.php:44
1933
  msgid "Armenia"
1934
  msgstr ""
1935
 
1936
- #: includes/form/class-ur-form-field-country.php:45
1937
  msgid "Aruba"
1938
  msgstr ""
1939
 
1940
- #: includes/form/class-ur-form-field-country.php:46
1941
  msgid "Australia"
1942
  msgstr ""
1943
 
1944
- #: includes/form/class-ur-form-field-country.php:47
1945
  msgid "Austria"
1946
  msgstr ""
1947
 
1948
- #: includes/form/class-ur-form-field-country.php:48
1949
  msgid "Azerbaijan"
1950
  msgstr ""
1951
 
1952
- #: includes/form/class-ur-form-field-country.php:49
1953
  msgid "Bahamas"
1954
  msgstr ""
1955
 
1956
- #: includes/form/class-ur-form-field-country.php:50
1957
  msgid "Bahrain"
1958
  msgstr ""
1959
 
1960
- #: includes/form/class-ur-form-field-country.php:51
1961
  msgid "Bangladesh"
1962
  msgstr ""
1963
 
1964
- #: includes/form/class-ur-form-field-country.php:52
1965
  msgid "Barbados"
1966
  msgstr ""
1967
 
1968
- #: includes/form/class-ur-form-field-country.php:53
1969
  msgid "Belarus"
1970
  msgstr ""
1971
 
1972
- #: includes/form/class-ur-form-field-country.php:54
1973
  msgid "Belgium"
1974
  msgstr ""
1975
 
1976
- #: includes/form/class-ur-form-field-country.php:55
1977
  msgid "Belau"
1978
  msgstr ""
1979
 
1980
- #: includes/form/class-ur-form-field-country.php:56
1981
  msgid "Belize"
1982
  msgstr ""
1983
 
1984
- #: includes/form/class-ur-form-field-country.php:57
1985
  msgid "Benin"
1986
  msgstr ""
1987
 
1988
- #: includes/form/class-ur-form-field-country.php:58
1989
  msgid "Bermuda"
1990
  msgstr ""
1991
 
1992
- #: includes/form/class-ur-form-field-country.php:59
1993
  msgid "Bhutan"
1994
  msgstr ""
1995
 
1996
- #: includes/form/class-ur-form-field-country.php:60
1997
  msgid "Bolivia"
1998
  msgstr ""
1999
 
2000
- #: includes/form/class-ur-form-field-country.php:61
2001
  msgid "Bonaire, Saint Eustatius and Saba"
2002
  msgstr ""
2003
 
2004
- #: includes/form/class-ur-form-field-country.php:62
2005
  msgid "Bosnia and Herzegovina"
2006
  msgstr ""
2007
 
2008
- #: includes/form/class-ur-form-field-country.php:63
2009
  msgid "Botswana"
2010
  msgstr ""
2011
 
2012
- #: includes/form/class-ur-form-field-country.php:64
2013
  msgid "Bouvet Island"
2014
  msgstr ""
2015
 
2016
- #: includes/form/class-ur-form-field-country.php:65
2017
  msgid "Brazil"
2018
  msgstr ""
2019
 
2020
- #: includes/form/class-ur-form-field-country.php:66
2021
  msgid "British Indian Ocean Territory"
2022
  msgstr ""
2023
 
2024
- #: includes/form/class-ur-form-field-country.php:67
2025
  msgid "British Virgin Islands"
2026
  msgstr ""
2027
 
2028
- #: includes/form/class-ur-form-field-country.php:68
2029
  msgid "Brunei"
2030
  msgstr ""
2031
 
2032
- #: includes/form/class-ur-form-field-country.php:69
2033
  msgid "Bulgaria"
2034
  msgstr ""
2035
 
2036
- #: includes/form/class-ur-form-field-country.php:70
2037
  msgid "Burkina Faso"
2038
  msgstr ""
2039
 
2040
- #: includes/form/class-ur-form-field-country.php:71
2041
  msgid "Burundi"
2042
  msgstr ""
2043
 
2044
- #: includes/form/class-ur-form-field-country.php:72
2045
  msgid "Cambodia"
2046
  msgstr ""
2047
 
2048
- #: includes/form/class-ur-form-field-country.php:73
2049
  msgid "Cameroon"
2050
  msgstr ""
2051
 
2052
- #: includes/form/class-ur-form-field-country.php:74
2053
  msgid "Canada"
2054
  msgstr ""
2055
 
2056
- #: includes/form/class-ur-form-field-country.php:75
2057
  msgid "Cape Verde"
2058
  msgstr ""
2059
 
2060
- #: includes/form/class-ur-form-field-country.php:76
2061
  msgid "Cayman Islands"
2062
  msgstr ""
2063
 
2064
- #: includes/form/class-ur-form-field-country.php:77
2065
  msgid "Central African Republic"
2066
  msgstr ""
2067
 
2068
- #: includes/form/class-ur-form-field-country.php:78
2069
  msgid "Chad"
2070
  msgstr ""
2071
 
2072
- #: includes/form/class-ur-form-field-country.php:79
2073
  msgid "Chile"
2074
  msgstr ""
2075
 
2076
- #: includes/form/class-ur-form-field-country.php:80
2077
  msgid "China"
2078
  msgstr ""
2079
 
2080
- #: includes/form/class-ur-form-field-country.php:81
2081
  msgid "Christmas Island"
2082
  msgstr ""
2083
 
2084
- #: includes/form/class-ur-form-field-country.php:82
2085
  msgid "Cocos (Keeling) Islands"
2086
  msgstr ""
2087
 
2088
- #: includes/form/class-ur-form-field-country.php:83
2089
  msgid "Colombia"
2090
  msgstr ""
2091
 
2092
- #: includes/form/class-ur-form-field-country.php:84
2093
  msgid "Comoros"
2094
  msgstr ""
2095
 
2096
- #: includes/form/class-ur-form-field-country.php:85
2097
  msgid "Congo (Brazzaville)"
2098
  msgstr ""
2099
 
2100
- #: includes/form/class-ur-form-field-country.php:86
2101
  msgid "Congo (Kinshasa)"
2102
  msgstr ""
2103
 
2104
- #: includes/form/class-ur-form-field-country.php:87
2105
  msgid "Cook Islands"
2106
  msgstr ""
2107
 
2108
- #: includes/form/class-ur-form-field-country.php:88
2109
  msgid "Costa Rica"
2110
  msgstr ""
2111
 
2112
- #: includes/form/class-ur-form-field-country.php:89
2113
  msgid "Croatia"
2114
  msgstr ""
2115
 
2116
- #: includes/form/class-ur-form-field-country.php:90
2117
  msgid "Cuba"
2118
  msgstr ""
2119
 
2120
- #: includes/form/class-ur-form-field-country.php:91
2121
  msgid "Cura&ccedil;ao"
2122
  msgstr ""
2123
 
2124
- #: includes/form/class-ur-form-field-country.php:92
2125
  msgid "Cyprus"
2126
  msgstr ""
2127
 
2128
- #: includes/form/class-ur-form-field-country.php:93
2129
  msgid "Czech Republic"
2130
  msgstr ""
2131
 
2132
- #: includes/form/class-ur-form-field-country.php:94
2133
  msgid "Denmark"
2134
  msgstr ""
2135
 
2136
- #: includes/form/class-ur-form-field-country.php:95
2137
  msgid "Djibouti"
2138
  msgstr ""
2139
 
2140
- #: includes/form/class-ur-form-field-country.php:96
2141
  msgid "Dominica"
2142
  msgstr ""
2143
 
2144
- #: includes/form/class-ur-form-field-country.php:97
2145
  msgid "Dominican Republic"
2146
  msgstr ""
2147
 
2148
- #: includes/form/class-ur-form-field-country.php:98
2149
  msgid "Ecuador"
2150
  msgstr ""
2151
 
2152
- #: includes/form/class-ur-form-field-country.php:99
2153
  msgid "Egypt"
2154
  msgstr ""
2155
 
2156
- #: includes/form/class-ur-form-field-country.php:100
2157
  msgid "El Salvador"
2158
  msgstr ""
2159
 
2160
- #: includes/form/class-ur-form-field-country.php:101
2161
  msgid "Equatorial Guinea"
2162
  msgstr ""
2163
 
2164
- #: includes/form/class-ur-form-field-country.php:102
2165
  msgid "Eritrea"
2166
  msgstr ""
2167
 
2168
- #: includes/form/class-ur-form-field-country.php:103
2169
  msgid "Estonia"
2170
  msgstr ""
2171
 
2172
- #: includes/form/class-ur-form-field-country.php:104
2173
  msgid "Ethiopia"
2174
  msgstr ""
2175
 
2176
- #: includes/form/class-ur-form-field-country.php:105
2177
  msgid "Falkland Islands"
2178
  msgstr ""
2179
 
2180
- #: includes/form/class-ur-form-field-country.php:106
2181
  msgid "Faroe Islands"
2182
  msgstr ""
2183
 
2184
- #: includes/form/class-ur-form-field-country.php:107
2185
  msgid "Fiji"
2186
  msgstr ""
2187
 
2188
- #: includes/form/class-ur-form-field-country.php:108
2189
  msgid "Finland"
2190
  msgstr ""
2191
 
2192
- #: includes/form/class-ur-form-field-country.php:109
2193
  msgid "France"
2194
  msgstr ""
2195
 
2196
- #: includes/form/class-ur-form-field-country.php:110
2197
  msgid "French Guiana"
2198
  msgstr ""
2199
 
2200
- #: includes/form/class-ur-form-field-country.php:111
2201
  msgid "French Polynesia"
2202
  msgstr ""
2203
 
2204
- #: includes/form/class-ur-form-field-country.php:112
2205
  msgid "French Southern Territories"
2206
  msgstr ""
2207
 
2208
- #: includes/form/class-ur-form-field-country.php:113
2209
  msgid "Gabon"
2210
  msgstr ""
2211
 
2212
- #: includes/form/class-ur-form-field-country.php:114
2213
  msgid "Gambia"
2214
  msgstr ""
2215
 
2216
- #: includes/form/class-ur-form-field-country.php:115
2217
  msgid "Georgia"
2218
  msgstr ""
2219
 
2220
- #: includes/form/class-ur-form-field-country.php:116
2221
  msgid "Germany"
2222
  msgstr ""
2223
 
2224
- #: includes/form/class-ur-form-field-country.php:117
2225
  msgid "Ghana"
2226
  msgstr ""
2227
 
2228
- #: includes/form/class-ur-form-field-country.php:118
2229
  msgid "Gibraltar"
2230
  msgstr ""
2231
 
2232
- #: includes/form/class-ur-form-field-country.php:119
2233
  msgid "Greece"
2234
  msgstr ""
2235
 
2236
- #: includes/form/class-ur-form-field-country.php:120
2237
  msgid "Greenland"
2238
  msgstr ""
2239
 
2240
- #: includes/form/class-ur-form-field-country.php:121
2241
  msgid "Grenada"
2242
  msgstr ""
2243
 
2244
- #: includes/form/class-ur-form-field-country.php:122
2245
  msgid "Guadeloupe"
2246
  msgstr ""
2247
 
2248
- #: includes/form/class-ur-form-field-country.php:123
2249
  msgid "Guam"
2250
  msgstr ""
2251
 
2252
- #: includes/form/class-ur-form-field-country.php:124
2253
  msgid "Guatemala"
2254
  msgstr ""
2255
 
2256
- #: includes/form/class-ur-form-field-country.php:125
2257
  msgid "Guernsey"
2258
  msgstr ""
2259
 
2260
- #: includes/form/class-ur-form-field-country.php:126
2261
  msgid "Guinea"
2262
  msgstr ""
2263
 
2264
- #: includes/form/class-ur-form-field-country.php:127
2265
  msgid "Guinea-Bissau"
2266
  msgstr ""
2267
 
2268
- #: includes/form/class-ur-form-field-country.php:128
2269
  msgid "Guyana"
2270
  msgstr ""
2271
 
2272
- #: includes/form/class-ur-form-field-country.php:129
2273
  msgid "Haiti"
2274
  msgstr ""
2275
 
2276
- #: includes/form/class-ur-form-field-country.php:130
2277
  msgid "Heard Island and McDonald Islands"
2278
  msgstr ""
2279
 
2280
- #: includes/form/class-ur-form-field-country.php:131
2281
  msgid "Honduras"
2282
  msgstr ""
2283
 
2284
- #: includes/form/class-ur-form-field-country.php:132
2285
  msgid "Hong Kong"
2286
  msgstr ""
2287
 
2288
- #: includes/form/class-ur-form-field-country.php:133
2289
  msgid "Hungary"
2290
  msgstr ""
2291
 
2292
- #: includes/form/class-ur-form-field-country.php:134
2293
  msgid "Iceland"
2294
  msgstr ""
2295
 
2296
- #: includes/form/class-ur-form-field-country.php:135
2297
  msgid "India"
2298
  msgstr ""
2299
 
2300
- #: includes/form/class-ur-form-field-country.php:136
2301
  msgid "Indonesia"
2302
  msgstr ""
2303
 
2304
- #: includes/form/class-ur-form-field-country.php:137
2305
  msgid "Iran"
2306
  msgstr ""
2307
 
2308
- #: includes/form/class-ur-form-field-country.php:138
2309
  msgid "Iraq"
2310
  msgstr ""
2311
 
2312
- #: includes/form/class-ur-form-field-country.php:139
2313
  msgid "Ireland"
2314
  msgstr ""
2315
 
2316
- #: includes/form/class-ur-form-field-country.php:140
2317
  msgid "Isle of Man"
2318
  msgstr ""
2319
 
2320
- #: includes/form/class-ur-form-field-country.php:141
2321
  msgid "Israel"
2322
  msgstr ""
2323
 
2324
- #: includes/form/class-ur-form-field-country.php:142
2325
  msgid "Italy"
2326
  msgstr ""
2327
 
2328
- #: includes/form/class-ur-form-field-country.php:143
2329
  msgid "Ivory Coast"
2330
  msgstr ""
2331
 
2332
- #: includes/form/class-ur-form-field-country.php:144
2333
  msgid "Jamaica"
2334
  msgstr ""
2335
 
2336
- #: includes/form/class-ur-form-field-country.php:145
2337
  msgid "Japan"
2338
  msgstr ""
2339
 
2340
- #: includes/form/class-ur-form-field-country.php:146
2341
  msgid "Jersey"
2342
  msgstr ""
2343
 
2344
- #: includes/form/class-ur-form-field-country.php:147
2345
  msgid "Jordan"
2346
  msgstr ""
2347
 
2348
- #: includes/form/class-ur-form-field-country.php:148
2349
  msgid "Kazakhstan"
2350
  msgstr ""
2351
 
2352
- #: includes/form/class-ur-form-field-country.php:149
2353
  msgid "Kenya"
2354
  msgstr ""
2355
 
2356
- #: includes/form/class-ur-form-field-country.php:150
2357
  msgid "Kiribati"
2358
  msgstr ""
2359
 
2360
- #: includes/form/class-ur-form-field-country.php:151
2361
  msgid "Kuwait"
2362
  msgstr ""
2363
 
2364
- #: includes/form/class-ur-form-field-country.php:152
2365
  msgid "Kyrgyzstan"
2366
  msgstr ""
2367
 
2368
- #: includes/form/class-ur-form-field-country.php:153
2369
  msgid "Laos"
2370
  msgstr ""
2371
 
2372
- #: includes/form/class-ur-form-field-country.php:154
2373
  msgid "Latvia"
2374
  msgstr ""
2375
 
2376
- #: includes/form/class-ur-form-field-country.php:155
2377
  msgid "Lebanon"
2378
  msgstr ""
2379
 
2380
- #: includes/form/class-ur-form-field-country.php:156
2381
  msgid "Lesotho"
2382
  msgstr ""
2383
 
2384
- #: includes/form/class-ur-form-field-country.php:157
2385
  msgid "Liberia"
2386
  msgstr ""
2387
 
2388
- #: includes/form/class-ur-form-field-country.php:158
2389
  msgid "Libya"
2390
  msgstr ""
2391
 
2392
- #: includes/form/class-ur-form-field-country.php:159
2393
  msgid "Liechtenstein"
2394
  msgstr ""
2395
 
2396
- #: includes/form/class-ur-form-field-country.php:160
2397
  msgid "Lithuania"
2398
  msgstr ""
2399
 
2400
- #: includes/form/class-ur-form-field-country.php:161
2401
  msgid "Luxembourg"
2402
  msgstr ""
2403
 
2404
- #: includes/form/class-ur-form-field-country.php:162
2405
  msgid "Macao S.A.R., China"
2406
  msgstr ""
2407
 
2408
- #: includes/form/class-ur-form-field-country.php:163
2409
  msgid "Macedonia"
2410
  msgstr ""
2411
 
2412
- #: includes/form/class-ur-form-field-country.php:164
2413
  msgid "Madagascar"
2414
  msgstr ""
2415
 
2416
- #: includes/form/class-ur-form-field-country.php:165
2417
  msgid "Malawi"
2418
  msgstr ""
2419
 
2420
- #: includes/form/class-ur-form-field-country.php:166
2421
  msgid "Malaysia"
2422
  msgstr ""
2423
 
2424
- #: includes/form/class-ur-form-field-country.php:167
2425
  msgid "Maldives"
2426
  msgstr ""
2427
 
2428
- #: includes/form/class-ur-form-field-country.php:168
2429
  msgid "Mali"
2430
  msgstr ""
2431
 
2432
- #: includes/form/class-ur-form-field-country.php:169
2433
  msgid "Malta"
2434
  msgstr ""
2435
 
2436
- #: includes/form/class-ur-form-field-country.php:170
2437
  msgid "Marshall Islands"
2438
  msgstr ""
2439
 
2440
- #: includes/form/class-ur-form-field-country.php:171
2441
  msgid "Martinique"
2442
  msgstr ""
2443
 
2444
- #: includes/form/class-ur-form-field-country.php:172
2445
  msgid "Mauritania"
2446
  msgstr ""
2447
 
2448
- #: includes/form/class-ur-form-field-country.php:173
2449
  msgid "Mauritius"
2450
  msgstr ""
2451
 
2452
- #: includes/form/class-ur-form-field-country.php:174
2453
  msgid "Mayotte"
2454
  msgstr ""
2455
 
2456
- #: includes/form/class-ur-form-field-country.php:175
2457
  msgid "Mexico"
2458
  msgstr ""
2459
 
2460
- #: includes/form/class-ur-form-field-country.php:176
2461
  msgid "Micronesia"
2462
  msgstr ""
2463
 
2464
- #: includes/form/class-ur-form-field-country.php:177
2465
  msgid "Moldova"
2466
  msgstr ""
2467
 
2468
- #: includes/form/class-ur-form-field-country.php:178
2469
  msgid "Monaco"
2470
  msgstr ""
2471
 
2472
- #: includes/form/class-ur-form-field-country.php:179
2473
  msgid "Mongolia"
2474
  msgstr ""
2475
 
2476
- #: includes/form/class-ur-form-field-country.php:180
2477
  msgid "Montenegro"
2478
  msgstr ""
2479
 
2480
- #: includes/form/class-ur-form-field-country.php:181
2481
  msgid "Montserrat"
2482
  msgstr ""
2483
 
2484
- #: includes/form/class-ur-form-field-country.php:182
2485
  msgid "Morocco"
2486
  msgstr ""
2487
 
2488
- #: includes/form/class-ur-form-field-country.php:183
2489
  msgid "Mozambique"
2490
  msgstr ""
2491
 
2492
- #: includes/form/class-ur-form-field-country.php:184
2493
  msgid "Myanmar"
2494
  msgstr ""
2495
 
2496
- #: includes/form/class-ur-form-field-country.php:185
2497
  msgid "Namibia"
2498
  msgstr ""
2499
 
2500
- #: includes/form/class-ur-form-field-country.php:186
2501
  msgid "Nauru"
2502
  msgstr ""
2503
 
2504
- #: includes/form/class-ur-form-field-country.php:187
2505
  msgid "Nepal"
2506
  msgstr ""
2507
 
2508
- #: includes/form/class-ur-form-field-country.php:188
2509
  msgid "Netherlands"
2510
  msgstr ""
2511
 
2512
- #: includes/form/class-ur-form-field-country.php:189
2513
  msgid "New Caledonia"
2514
  msgstr ""
2515
 
2516
- #: includes/form/class-ur-form-field-country.php:190
2517
  msgid "New Zealand"
2518
  msgstr ""
2519
 
2520
- #: includes/form/class-ur-form-field-country.php:191
2521
  msgid "Nicaragua"
2522
  msgstr ""
2523
 
2524
- #: includes/form/class-ur-form-field-country.php:192
2525
  msgid "Niger"
2526
  msgstr ""
2527
 
2528
- #: includes/form/class-ur-form-field-country.php:193
2529
  msgid "Nigeria"
2530
  msgstr ""
2531
 
2532
- #: includes/form/class-ur-form-field-country.php:194
2533
  msgid "Niue"
2534
  msgstr ""
2535
 
2536
- #: includes/form/class-ur-form-field-country.php:195
2537
  msgid "Norfolk Island"
2538
  msgstr ""
2539
 
2540
- #: includes/form/class-ur-form-field-country.php:196
2541
  msgid "Northern Mariana Islands"
2542
  msgstr ""
2543
 
2544
- #: includes/form/class-ur-form-field-country.php:197
2545
  msgid "North Korea"
2546
  msgstr ""
2547
 
2548
- #: includes/form/class-ur-form-field-country.php:198
2549
  msgid "Norway"
2550
  msgstr ""
2551
 
2552
- #: includes/form/class-ur-form-field-country.php:199
2553
  msgid "Oman"
2554
  msgstr ""
2555
 
2556
- #: includes/form/class-ur-form-field-country.php:200
2557
  msgid "Pakistan"
2558
  msgstr ""
2559
 
2560
- #: includes/form/class-ur-form-field-country.php:201
2561
  msgid "Palestinian Territory"
2562
  msgstr ""
2563
 
2564
- #: includes/form/class-ur-form-field-country.php:202
2565
  msgid "Panama"
2566
  msgstr ""
2567
 
2568
- #: includes/form/class-ur-form-field-country.php:203
2569
  msgid "Papua New Guinea"
2570
  msgstr ""
2571
 
2572
- #: includes/form/class-ur-form-field-country.php:204
2573
  msgid "Paraguay"
2574
  msgstr ""
2575
 
2576
- #: includes/form/class-ur-form-field-country.php:205
2577
  msgid "Peru"
2578
  msgstr ""
2579
 
2580
- #: includes/form/class-ur-form-field-country.php:206
2581
  msgid "Philippines"
2582
  msgstr ""
2583
 
2584
- #: includes/form/class-ur-form-field-country.php:207
2585
  msgid "Pitcairn"
2586
  msgstr ""
2587
 
2588
- #: includes/form/class-ur-form-field-country.php:208
2589
  msgid "Poland"
2590
  msgstr ""
2591
 
2592
- #: includes/form/class-ur-form-field-country.php:209
2593
  msgid "Portugal"
2594
  msgstr ""
2595
 
2596
- #: includes/form/class-ur-form-field-country.php:210
2597
  msgid "Puerto Rico"
2598
  msgstr ""
2599
 
2600
- #: includes/form/class-ur-form-field-country.php:211
2601
  msgid "Qatar"
2602
  msgstr ""
2603
 
2604
- #: includes/form/class-ur-form-field-country.php:212
2605
  msgid "Reunion"
2606
  msgstr ""
2607
 
2608
- #: includes/form/class-ur-form-field-country.php:213
2609
  msgid "Romania"
2610
  msgstr ""
2611
 
2612
- #: includes/form/class-ur-form-field-country.php:214
2613
  msgid "Russia"
2614
  msgstr ""
2615
 
2616
- #: includes/form/class-ur-form-field-country.php:215
2617
  msgid "Rwanda"
2618
  msgstr ""
2619
 
2620
- #: includes/form/class-ur-form-field-country.php:216
2621
  msgid "Saint Barth&eacute;lemy"
2622
  msgstr ""
2623
 
2624
- #: includes/form/class-ur-form-field-country.php:217
2625
  msgid "Saint Helena"
2626
  msgstr ""
2627
 
2628
- #: includes/form/class-ur-form-field-country.php:218
2629
  msgid "Saint Kitts and Nevis"
2630
  msgstr ""
2631
 
2632
- #: includes/form/class-ur-form-field-country.php:219
2633
  msgid "Saint Lucia"
2634
  msgstr ""
2635
 
2636
- #: includes/form/class-ur-form-field-country.php:220
2637
  msgid "Saint Martin (French part)"
2638
  msgstr ""
2639
 
2640
- #: includes/form/class-ur-form-field-country.php:221
2641
  msgid "Saint Martin (Dutch part)"
2642
  msgstr ""
2643
 
2644
- #: includes/form/class-ur-form-field-country.php:222
2645
  msgid "Saint Pierre and Miquelon"
2646
  msgstr ""
2647
 
2648
- #: includes/form/class-ur-form-field-country.php:223
2649
  msgid "Saint Vincent and the Grenadines"
2650
  msgstr ""
2651
 
2652
- #: includes/form/class-ur-form-field-country.php:224
2653
  msgid "San Marino"
2654
  msgstr ""
2655
 
2656
- #: includes/form/class-ur-form-field-country.php:225
2657
  msgid "S&atilde;o Tom&eacute; and Pr&iacute;ncipe"
2658
  msgstr ""
2659
 
2660
- #: includes/form/class-ur-form-field-country.php:226
2661
  msgid "Saudi Arabia"
2662
  msgstr ""
2663
 
2664
- #: includes/form/class-ur-form-field-country.php:227
2665
  msgid "Senegal"
2666
  msgstr ""
2667
 
2668
- #: includes/form/class-ur-form-field-country.php:228
2669
  msgid "Serbia"
2670
  msgstr ""
2671
 
2672
- #: includes/form/class-ur-form-field-country.php:229
2673
  msgid "Seychelles"
2674
  msgstr ""
2675
 
2676
- #: includes/form/class-ur-form-field-country.php:230
2677
  msgid "Sierra Leone"
2678
  msgstr ""
2679
 
2680
- #: includes/form/class-ur-form-field-country.php:231
2681
  msgid "Singapore"
2682
  msgstr ""
2683
 
2684
- #: includes/form/class-ur-form-field-country.php:232
2685
  msgid "Slovakia"
2686
  msgstr ""
2687
 
2688
- #: includes/form/class-ur-form-field-country.php:233
2689
  msgid "Slovenia"
2690
  msgstr ""
2691
 
2692
- #: includes/form/class-ur-form-field-country.php:234
2693
  msgid "Solomon Islands"
2694
  msgstr ""
2695
 
2696
- #: includes/form/class-ur-form-field-country.php:235
2697
  msgid "Somalia"
2698
  msgstr ""
2699
 
2700
- #: includes/form/class-ur-form-field-country.php:236
2701
  msgid "South Africa"
2702
  msgstr ""
2703
 
2704
- #: includes/form/class-ur-form-field-country.php:237
2705
  msgid "South Georgia/Sandwich Islands"
2706
  msgstr ""
2707
 
2708
- #: includes/form/class-ur-form-field-country.php:238
2709
  msgid "South Korea"
2710
  msgstr ""
2711
 
2712
- #: includes/form/class-ur-form-field-country.php:239
2713
  msgid "South Sudan"
2714
  msgstr ""
2715
 
2716
- #: includes/form/class-ur-form-field-country.php:240
2717
  msgid "Spain"
2718
  msgstr ""
2719
 
2720
- #: includes/form/class-ur-form-field-country.php:241
2721
  msgid "Sri Lanka"
2722
  msgstr ""
2723
 
2724
- #: includes/form/class-ur-form-field-country.php:242
2725
  msgid "Sudan"
2726
  msgstr ""
2727
 
2728
- #: includes/form/class-ur-form-field-country.php:243
2729
  msgid "Suriname"
2730
  msgstr ""
2731
 
2732
- #: includes/form/class-ur-form-field-country.php:244
2733
  msgid "Svalbard and Jan Mayen"
2734
  msgstr ""
2735
 
2736
- #: includes/form/class-ur-form-field-country.php:245
2737
  msgid "Swaziland"
2738
  msgstr ""
2739
 
2740
- #: includes/form/class-ur-form-field-country.php:246
2741
  msgid "Sweden"
2742
  msgstr ""
2743
 
2744
- #: includes/form/class-ur-form-field-country.php:247
2745
  msgid "Switzerland"
2746
  msgstr ""
2747
 
2748
- #: includes/form/class-ur-form-field-country.php:248
2749
  msgid "Syria"
2750
  msgstr ""
2751
 
2752
- #: includes/form/class-ur-form-field-country.php:249
2753
  msgid "Taiwan"
2754
  msgstr ""
2755
 
2756
- #: includes/form/class-ur-form-field-country.php:250
2757
  msgid "Tajikistan"
2758
  msgstr ""
2759
 
2760
- #: includes/form/class-ur-form-field-country.php:251
2761
  msgid "Tanzania"
2762
  msgstr ""
2763
 
2764
- #: includes/form/class-ur-form-field-country.php:252
2765
  msgid "Thailand"
2766
  msgstr ""
2767
 
2768
- #: includes/form/class-ur-form-field-country.php:253
2769
  msgid "Timor-Leste"
2770
  msgstr ""
2771
 
2772
- #: includes/form/class-ur-form-field-country.php:254
2773
  msgid "Togo"
2774
  msgstr ""
2775
 
2776
- #: includes/form/class-ur-form-field-country.php:255
2777
  msgid "Tokelau"
2778
  msgstr ""
2779
 
2780
- #: includes/form/class-ur-form-field-country.php:256
2781
  msgid "Tonga"
2782
  msgstr ""
2783
 
2784
- #: includes/form/class-ur-form-field-country.php:257
2785
  msgid "Trinidad and Tobago"
2786
  msgstr ""
2787
 
2788
- #: includes/form/class-ur-form-field-country.php:258
2789
  msgid "Tunisia"
2790
  msgstr ""
2791
 
2792
- #: includes/form/class-ur-form-field-country.php:259
2793
  msgid "Turkey"
2794
  msgstr ""
2795
 
2796
- #: includes/form/class-ur-form-field-country.php:260
2797
  msgid "Turkmenistan"
2798
  msgstr ""
2799
 
2800
- #: includes/form/class-ur-form-field-country.php:261
2801
  msgid "Turks and Caicos Islands"
2802
  msgstr ""
2803
 
2804
- #: includes/form/class-ur-form-field-country.php:262
2805
  msgid "Tuvalu"
2806
  msgstr ""
2807
 
2808
- #: includes/form/class-ur-form-field-country.php:263
2809
  msgid "Uganda"
2810
  msgstr ""
2811
 
2812
- #: includes/form/class-ur-form-field-country.php:264
2813
  msgid "Ukraine"
2814
  msgstr ""
2815
 
2816
- #: includes/form/class-ur-form-field-country.php:265
2817
  msgid "United Arab Emirates"
2818
  msgstr ""
2819
 
2820
- #: includes/form/class-ur-form-field-country.php:266
2821
  msgid "United Kingdom (UK)"
2822
  msgstr ""
2823
 
2824
- #: includes/form/class-ur-form-field-country.php:267
2825
  msgid "United States (US)"
2826
  msgstr ""
2827
 
2828
- #: includes/form/class-ur-form-field-country.php:268
2829
  msgid "United States (US) Minor Outlying Islands"
2830
  msgstr ""
2831
 
2832
- #: includes/form/class-ur-form-field-country.php:269
2833
  msgid "United States (US) Virgin Islands"
2834
  msgstr ""
2835
 
2836
- #: includes/form/class-ur-form-field-country.php:270
2837
  msgid "Uruguay"
2838
  msgstr ""
2839
 
2840
- #: includes/form/class-ur-form-field-country.php:271
2841
  msgid "Uzbekistan"
2842
  msgstr ""
2843
 
2844
- #: includes/form/class-ur-form-field-country.php:272
2845
  msgid "Vanuatu"
2846
  msgstr ""
2847
 
2848
- #: includes/form/class-ur-form-field-country.php:273
2849
  msgid "Vatican"
2850
  msgstr ""
2851
 
2852
- #: includes/form/class-ur-form-field-country.php:274
2853
  msgid "Venezuela"
2854
  msgstr ""
2855
 
2856
- #: includes/form/class-ur-form-field-country.php:275
2857
  msgid "Vietnam"
2858
  msgstr ""
2859
 
2860
- #: includes/form/class-ur-form-field-country.php:276
2861
  msgid "Wallis and Futuna"
2862
  msgstr ""
2863
 
2864
- #: includes/form/class-ur-form-field-country.php:277
2865
  msgid "Western Sahara"
2866
  msgstr ""
2867
 
2868
- #: includes/form/class-ur-form-field-country.php:278
2869
  msgid "Samoa"
2870
  msgstr ""
2871
 
2872
- #: includes/form/class-ur-form-field-country.php:279
2873
  msgid "Yemen"
2874
  msgstr ""
2875
 
2876
- #: includes/form/class-ur-form-field-country.php:280
2877
  msgid "Zambia"
2878
  msgstr ""
2879
 
2880
- #: includes/form/class-ur-form-field-country.php:281
2881
  msgid "Zimbabwe"
2882
  msgstr ""
2883
 
2884
- #: includes/form/class-ur-form-field-country.php:290
2885
- #: includes/form/class-ur-form-field-country.php:295
2886
  msgid "Country"
2887
  msgstr ""
2888
 
@@ -2959,11 +2961,11 @@ msgstr ""
2959
  msgid "User Email"
2960
  msgstr ""
2961
 
2962
- #: includes/form/class-ur-form-field-user-email.php:57
2963
  msgid "Invalid email address."
2964
  msgstr ""
2965
 
2966
- #: includes/form/class-ur-form-field-user-email.php:63
2967
  msgid "Email already exists."
2968
  msgstr ""
2969
 
@@ -2972,11 +2974,11 @@ msgstr ""
2972
  msgid "Username"
2973
  msgstr ""
2974
 
2975
- #: includes/form/class-ur-form-field-user-login.php:55
2976
  msgid "Username already exists."
2977
  msgstr ""
2978
 
2979
- #: includes/form/class-ur-form-field-user-login.php:63
2980
  msgid "Invalid username ! "
2981
  msgstr ""
2982
 
@@ -2988,7 +2990,7 @@ msgstr ""
2988
  msgid "User Password"
2989
  msgstr ""
2990
 
2991
- #: includes/form/class-ur-form-field-user-pass.php:55
2992
  msgid "Empty password."
2993
  msgstr ""
2994
 
@@ -2997,28 +2999,28 @@ msgstr ""
2997
  msgid "Website"
2998
  msgstr ""
2999
 
3000
- #: includes/form/settings/class-ur-setting-checkbox.php:34
3001
- #: includes/form/settings/class-ur-setting-checkbox.php:41
3002
- #: includes/form/settings/class-ur-setting-country.php:33
3003
- #: includes/form/settings/class-ur-setting-country.php:40
3004
- #: includes/form/settings/class-ur-setting-email.php:30
3005
- #: includes/form/settings/class-ur-setting-email.php:37
3006
- #: includes/form/settings/class-ur-setting-radio.php:28
3007
- #: includes/form/settings/class-ur-setting-radio.php:35
3008
- #: includes/form/settings/class-ur-setting-select.php:31
3009
- #: includes/form/settings/class-ur-setting-select.php:38
3010
- #: includes/form/settings/class-ur-setting-text.php:52
3011
- #: includes/form/settings/class-ur-setting-text.php:59
3012
- #: includes/form/settings/class-ur-setting-textarea.php:43
3013
- #: includes/form/settings/class-ur-setting-textarea.php:50
3014
  msgid "Custom Class"
3015
  msgstr ""
3016
 
3017
- #: includes/form/settings/class-ur-setting-checkbox.php:45
3018
  msgid "Choices"
3019
  msgstr ""
3020
 
3021
- #: includes/form/settings/class-ur-setting-checkbox.php:52
3022
  msgid ""
3023
  "Please input your text here to create the checkbox list like:\n"
3024
  "Checkbox 1,\n"
@@ -3026,17 +3028,17 @@ msgid ""
3026
  "Checkbox 3"
3027
  msgstr ""
3028
 
3029
- #: includes/form/settings/class-ur-setting-password.php:30
3030
- #: includes/form/settings/class-ur-setting-password.php:37
3031
  msgid "Password Size"
3032
  msgstr ""
3033
 
3034
- #: includes/form/settings/class-ur-setting-radio.php:39
3035
- #: includes/form/settings/class-ur-setting-select.php:42
3036
  msgid "Options "
3037
  msgstr ""
3038
 
3039
- #: includes/form/settings/class-ur-setting-radio.php:46
3040
  msgid ""
3041
  "Please input your text here to create the radio choices list like:\n"
3042
  "Option 1,\n"
@@ -3044,7 +3046,7 @@ msgid ""
3044
  "Option 3"
3045
  msgstr ""
3046
 
3047
- #: includes/form/settings/class-ur-setting-select.php:49
3048
  msgid ""
3049
  "Please input your text here to create the dropdown list like:\n"
3050
  "Option 1,\n"
@@ -3052,40 +3054,40 @@ msgid ""
3052
  "Option 3"
3053
  msgstr ""
3054
 
3055
- #: includes/form/settings/class-ur-setting-text.php:30
3056
- #: includes/form/settings/class-ur-setting-text.php:37
3057
  msgid "Size"
3058
  msgstr ""
3059
 
3060
- #: includes/form/settings/class-ur-setting-text.php:41
3061
- #: includes/form/settings/class-ur-setting-text.php:48
3062
- #: includes/form/settings/class-ur-setting-textarea.php:32
3063
- #: includes/form/settings/class-ur-setting-textarea.php:39
3064
  msgid "Default Value"
3065
  msgstr ""
3066
 
3067
- #: includes/frontend/class-ur-frontend-form-handler.php:96
3068
  msgid "Something went wrong! please try again"
3069
  msgstr ""
3070
 
3071
- #: includes/frontend/class-ur-frontend-form-handler.php:154
3072
  msgid "Duplicate field key in form, please contact site administrator."
3073
  msgstr ""
3074
 
3075
- #: includes/frontend/class-ur-frontend-form-handler.php:160
3076
  msgid "Required form field not found."
3077
  msgstr ""
3078
 
3079
- #: includes/frontend/class-ur-frontend-form-handler.php:309
3080
  msgid "Empty confirm password"
3081
  msgstr ""
3082
 
3083
- #: includes/frontend/class-ur-frontend-form-handler.php:311
3084
  msgid "Password and confirm password not matched"
3085
  msgstr ""
3086
 
3087
  #: includes/functions-ur-account.php:32
3088
- msgid "The password you entered for username %1s is incorrect. %2s"
3089
  msgstr ""
3090
 
3091
  #: includes/functions-ur-account.php:32 includes/functions-ur-account.php:35
@@ -3100,86 +3102,86 @@ msgstr ""
3100
  msgid "Dashboard"
3101
  msgstr ""
3102
 
3103
- #: includes/functions-ur-core.php:535 includes/functions-ur-core.php:537
3104
  msgid "Label"
3105
  msgstr ""
3106
 
3107
- #: includes/functions-ur-core.php:542 includes/functions-ur-core.php:544
3108
  msgid "Description"
3109
  msgstr ""
3110
 
3111
- #: includes/functions-ur-core.php:549 includes/functions-ur-core.php:551
3112
  msgid "Field Name"
3113
  msgstr ""
3114
 
3115
- #: includes/functions-ur-core.php:557 includes/functions-ur-core.php:559
3116
  msgid "Placeholder"
3117
  msgstr ""
3118
 
3119
- #: includes/functions-ur-core.php:569 includes/functions-ur-core.php:580
3120
- #: includes/functions-ur-core.php:703 includes/functions-ur-core.php:746
3121
  msgid "No"
3122
  msgstr ""
3123
 
3124
- #: includes/functions-ur-core.php:570 includes/functions-ur-core.php:581
3125
- #: includes/functions-ur-core.php:702 includes/functions-ur-core.php:745
3126
  msgid "Yes"
3127
  msgstr ""
3128
 
3129
- #: includes/functions-ur-core.php:575
3130
  msgid "Hide Label"
3131
  msgstr ""
3132
 
3133
- #: includes/functions-ur-core.php:683
3134
  msgid "Default User Role"
3135
  msgstr ""
3136
 
3137
- #: includes/functions-ur-core.php:695
3138
  msgid "Enable Strong Password"
3139
  msgstr ""
3140
 
3141
- #: includes/functions-ur-core.php:710
3142
  msgid "Minimum Password Strength"
3143
  msgstr ""
3144
 
3145
- #: includes/functions-ur-core.php:727
3146
  msgid "Form Submit Button Label"
3147
  msgstr ""
3148
 
3149
- #: includes/functions-ur-core.php:738
3150
  msgid "Enable %1$s %2$s reCaptcha %3$s Support"
3151
  msgstr ""
3152
 
3153
- #: includes/functions-ur-core.php:771
3154
  msgid "Custom CSS class"
3155
  msgstr ""
3156
 
3157
- #: includes/functions-ur-core.php:797
3158
  msgid "Auto login after registration"
3159
  msgstr ""
3160
 
3161
- #: includes/functions-ur-core.php:975
3162
  msgid ""
3163
  "The class <code>%s</code> provided by user_registration_logging_class "
3164
  "filter must implement <code>UR_Logger_Interface</code>."
3165
  msgstr ""
3166
 
3167
- #: includes/functions-ur-core.php:1070
3168
  msgid "Disable emails"
3169
  msgstr ""
3170
 
3171
- #: includes/functions-ur-core.php:1071
3172
  msgid "Disable all emails sent after registration."
3173
  msgstr ""
3174
 
3175
  #: includes/functions-ur-notice.php:29 includes/functions-ur-notice.php:61
3176
  #: includes/functions-ur-notice.php:81 includes/functions-ur-notice.php:107
3177
  #: includes/functions-ur-notice.php:121 includes/functions-ur-notice.php:135
3178
- #: includes/functions-ur-notice.php:185
3179
  msgid "This function should not be called before user_registration_init."
3180
  msgstr ""
3181
 
3182
- #: includes/functions-ur-template.php:181
3183
  msgid "required"
3184
  msgstr ""
3185
 
@@ -3188,7 +3190,7 @@ msgstr ""
3188
  msgid "Choose an option"
3189
  msgstr ""
3190
 
3191
- #: includes/libraries/wp-background-process.php:420
3192
  msgid "Every %d minutes"
3193
  msgstr ""
3194
 
@@ -3196,7 +3198,7 @@ msgstr ""
3196
  msgid "This method should not be called before plugins_loaded."
3197
  msgstr ""
3198
 
3199
- #: includes/shortcodes/class-ur-shortcode-login.php:57
3200
  msgid "You are already logged in. <a href=\"%s\">Log out?</a>"
3201
  msgstr ""
3202
 
@@ -3204,33 +3206,33 @@ msgstr ""
3204
  msgid "Your password has been reset successfully."
3205
  msgstr ""
3206
 
3207
- #: includes/shortcodes/class-ur-shortcode-my-account.php:84
3208
  msgid "Are you sure you want to log out? <a href=\"%s\">Confirm and log out</a>"
3209
  msgstr ""
3210
 
3211
- #: includes/shortcodes/class-ur-shortcode-my-account.php:214
3212
  msgid "Enter a username or email address."
3213
  msgstr ""
3214
 
3215
- #: includes/shortcodes/class-ur-shortcode-my-account.php:235
3216
- #: includes/shortcodes/class-ur-shortcode-my-account.php:240
3217
  msgid "Invalid username or email."
3218
  msgstr ""
3219
 
3220
- #: includes/shortcodes/class-ur-shortcode-my-account.php:250
3221
  msgid "Password reset is not allowed for this user"
3222
  msgstr ""
3223
 
3224
- #: includes/shortcodes/class-ur-shortcode-my-account.php:263
3225
  msgid "The email could not be sent. Contact your site administrator. "
3226
  msgstr ""
3227
 
3228
- #: templates/myaccount/dashboard.php:29
3229
  #. translators: 1: user display name 2: logout url
3230
  msgid "Hello %1$s (not %1$s? <a href=\"%2$s\">Sign out</a>)"
3231
  msgstr ""
3232
 
3233
- #: templates/myaccount/dashboard.php:39
3234
  #. translators: 1 profile details url, 2: change password url
3235
  msgid ""
3236
  "From your account dashboard you can edit your <a href=\"%1$s\"> profile "
@@ -3336,149 +3338,149 @@ msgstr ""
3336
  msgid "https://wpeverest.com"
3337
  msgstr ""
3338
 
3339
- #: includes/admin/class-ur-admin-assets.php:119
3340
  msgctxt "enhanced select"
3341
  msgid "No matches found"
3342
  msgstr ""
3343
 
3344
- #: includes/admin/class-ur-admin-assets.php:120
3345
  msgctxt "enhanced select"
3346
  msgid "Loading failed"
3347
  msgstr ""
3348
 
3349
- #: includes/admin/class-ur-admin-assets.php:121
3350
  msgctxt "enhanced select"
3351
  msgid "Please enter 1 or more characters"
3352
  msgstr ""
3353
 
3354
- #: includes/admin/class-ur-admin-assets.php:122
3355
  msgctxt "enhanced select"
3356
  msgid "Please enter %qty% or more characters"
3357
  msgstr ""
3358
 
3359
- #: includes/admin/class-ur-admin-assets.php:123
3360
  msgctxt "enhanced select"
3361
  msgid "Please delete 1 character"
3362
  msgstr ""
3363
 
3364
- #: includes/admin/class-ur-admin-assets.php:124
3365
  msgctxt "enhanced select"
3366
  msgid "Please delete %qty% characters"
3367
  msgstr ""
3368
 
3369
- #: includes/admin/class-ur-admin-assets.php:125
3370
  msgctxt "enhanced select"
3371
  msgid "You can only select 1 item"
3372
  msgstr ""
3373
 
3374
- #: includes/admin/class-ur-admin-assets.php:126
3375
  msgctxt "enhanced select"
3376
  msgid "You can only select %qty% items"
3377
  msgstr ""
3378
 
3379
- #: includes/admin/class-ur-admin-assets.php:127
3380
  msgctxt "enhanced select"
3381
  msgid "Loading more results&hellip;"
3382
  msgstr ""
3383
 
3384
- #: includes/admin/class-ur-admin-assets.php:128
3385
  msgctxt "enhanced select"
3386
  msgid "Searching&hellip;"
3387
  msgstr ""
3388
 
3389
- #: includes/admin/class-ur-admin-assets.php:228
3390
  msgctxt "user-registration admin"
3391
  msgid "User Email"
3392
  msgstr ""
3393
 
3394
- #: includes/admin/class-ur-admin-assets.php:229
3395
  msgctxt "user-registration admin"
3396
  msgid "User Password"
3397
  msgstr ""
3398
 
3399
- #: includes/admin/class-ur-admin-assets.php:230
3400
  msgctxt "user registration admin"
3401
  msgid "Are you sure want to delete?"
3402
  msgstr ""
3403
 
3404
- #: includes/admin/class-ur-admin-assets.php:231
3405
  msgctxt "user registration admin"
3406
  msgid "At least one row needs to be selected."
3407
  msgstr ""
3408
 
3409
- #: includes/admin/class-ur-admin-assets.php:232
3410
  msgctxt "user registration admin"
3411
  msgid "This field is one time draggable."
3412
  msgstr ""
3413
 
3414
- #: includes/admin/class-ur-admin-assets.php:233
3415
  msgctxt "user registration admin"
3416
  msgid "Could not clone this field."
3417
  msgstr ""
3418
 
3419
- #: includes/admin/class-ur-admin-assets.php:234
3420
  msgctxt "user registration admin"
3421
  msgid "Form successfully saved."
3422
  msgstr ""
3423
 
3424
- #: includes/admin/class-ur-admin-assets.php:235
3425
  msgctxt "user registration admin"
3426
  msgid "Success"
3427
  msgstr ""
3428
 
3429
- #: includes/admin/class-ur-admin-assets.php:236
3430
  msgctxt "user registration admin"
3431
  msgid "Error"
3432
  msgstr ""
3433
 
3434
- #: includes/admin/class-ur-admin-assets.php:237
3435
  msgctxt "user registration admin"
3436
  msgid "At least one field needs to be selected."
3437
  msgstr ""
3438
 
3439
- #: includes/admin/class-ur-admin-assets.php:238
3440
  msgctxt "user registration admin"
3441
  msgid "Empty form name."
3442
  msgstr ""
3443
 
3444
- #: includes/admin/class-ur-admin-assets.php:239
3445
  msgctxt "user registration admin"
3446
  msgid "Previous save action on going."
3447
  msgstr ""
3448
 
3449
- #: includes/admin/class-ur-admin-assets.php:240
3450
  msgctxt "user registration admin"
3451
  msgid "Duplicate field name."
3452
  msgstr ""
3453
 
3454
- #: includes/admin/class-ur-admin-assets.php:241
3455
  msgctxt "user registration admin"
3456
  msgid "Empty field label."
3457
  msgstr ""
3458
 
3459
- #: includes/admin/class-ur-admin-assets.php:242
3460
  msgctxt "user registration admin"
3461
  msgid ""
3462
  "Invalid field name. Please do not use space, empty or special character, "
3463
  "you can use underscore."
3464
  msgstr ""
3465
 
3466
- #: includes/admin/class-ur-admin-assets.php:243
3467
  msgctxt "user registration admin"
3468
  msgid "Multiple field key "
3469
  msgstr ""
3470
 
3471
- #: includes/admin/class-ur-admin-assets.php:244
3472
  msgctxt "user registration admin"
3473
  msgid "field is required."
3474
  msgstr ""
3475
 
3476
- #: includes/admin/class-ur-admin-assets.php:245
3477
  msgctxt "user registration admin"
3478
  msgid "Drag your first form item here."
3479
  msgstr ""
3480
 
3481
- #: includes/admin/class-ur-admin-registrations-table-list.php:255
3482
  #. translators: %s: count
3483
  msgctxt "posts"
3484
  msgid "All <span class=\"count\">(%s)</span>"
@@ -3486,47 +3488,47 @@ msgid_plural "All <span class=\"count\">(%s)</span>"
3486
  msgstr[0] ""
3487
  msgstr[1] ""
3488
 
3489
- #: includes/admin/class-ur-admin-user-list-manager.php:74
3490
  msgctxt "The action on users list page"
3491
  msgid "Approve"
3492
  msgstr ""
3493
 
3494
- #: includes/admin/class-ur-admin-user-list-manager.php:75
3495
  msgctxt "The action on users list page"
3496
  msgid "Deny"
3497
  msgstr ""
3498
 
3499
- #: includes/class-ur-email-confirmation.php:58
3500
  msgctxt "The action on users list page"
3501
  msgid "Verify"
3502
  msgstr ""
3503
 
3504
- #: includes/class-ur-email-confirmation.php:59
3505
  msgctxt "The action on users list page"
3506
  msgid "Unverify"
3507
  msgstr ""
3508
 
3509
- #: includes/class-ur-install.php:279
3510
  msgctxt "Page slug"
3511
  msgid "my-account"
3512
  msgstr ""
3513
 
3514
- #: includes/class-ur-install.php:288
3515
  msgctxt "Page slug"
3516
  msgid "registration"
3517
  msgstr ""
3518
 
3519
- #: includes/class-ur-install.php:280
3520
  msgctxt "Page title"
3521
  msgid "My Account"
3522
  msgstr ""
3523
 
3524
- #: includes/class-ur-install.php:289
3525
  msgctxt "Page title"
3526
  msgid "Registration"
3527
  msgstr ""
3528
 
3529
- #: includes/class-ur-post-types.php:48
3530
  msgctxt "Admin menu name"
3531
  msgid "Registrations"
3532
  msgstr ""
2
  # This file is distributed under the same license as the User Registration package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: User Registration 1.5.6\n"
6
  "Report-Msgid-Bugs-To: wpeverest@gmail.com\n"
7
+ "POT-Creation-Date: 2019-01-11 09:51:44+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
13
  "Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
14
  "X-Generator: grunt-wp-i18n 1.0.3\n"
15
 
16
+ #: includes/abstracts/abstract-ur-form-field.php:290
17
+ #: includes/admin/functions-ur-admin.php:327
18
  msgid "General Settings"
19
  msgstr ""
20
 
21
+ #: includes/abstracts/abstract-ur-form-field.php:298
22
  msgid "Advance Settings"
23
  msgstr ""
24
 
25
+ #: includes/admin/class-ur-admin-assets.php:158
26
  msgid "Could not install."
27
  msgstr ""
28
 
29
+ #: includes/admin/class-ur-admin-assets.php:231
30
  msgid "Clone"
31
  msgstr ""
32
 
33
+ #: includes/admin/class-ur-admin-assets.php:231
34
+ #: includes/admin/class-ur-admin-registrations-table-list.php:114
35
  msgid "Trash"
36
  msgstr ""
37
 
38
+ #: includes/admin/class-ur-admin-export-users.php:52
39
  #: includes/admin/class-ur-admin-menus.php:241
40
  #: includes/admin/class-ur-admin-notices.php:121
41
  #: includes/admin/class-ur-admin-settings.php:69
42
+ #: includes/admin/class-ur-admin-status.php:169
43
+ #: includes/class-ur-email-confirmation.php:213
44
  msgid "Action failed. Please refresh the page and retry."
45
  msgstr ""
46
 
47
+ #: includes/admin/class-ur-admin-export-users.php:69
48
  msgid "No users found with this form id."
49
  msgstr ""
50
 
51
+ #: includes/admin/class-ur-admin-export-users.php:122
52
  msgid "User Role"
53
  msgstr ""
54
 
55
+ #: includes/admin/class-ur-admin-export-users.php:123
56
  msgid "User Registered"
57
  msgstr ""
58
 
59
+ #: includes/admin/class-ur-admin-export-users.php:124
60
  msgid "User Registered GMT"
61
  msgstr ""
62
 
63
+ #: includes/admin/class-ur-admin-export-users.php:130
64
  msgid "User ID"
65
  msgstr ""
66
 
108
  msgid "User Registration"
109
  msgstr ""
110
 
111
+ #: includes/admin/class-ur-admin-menus.php:304
112
  msgid "User Registration settings"
113
  msgstr ""
114
 
115
+ #: includes/admin/class-ur-admin-menus.php:305
116
+ #: includes/class-ur-install.php:611
117
  msgid "Settings"
118
  msgstr ""
119
 
120
+ #: includes/admin/class-ur-admin-menus.php:321
121
  msgid "User Registration Status"
122
  msgstr ""
123
 
124
+ #: includes/admin/class-ur-admin-menus.php:322
125
+ #: includes/admin/class-ur-admin-user-list-manager.php:183
126
+ #: includes/class-ur-email-confirmation.php:129
127
  msgid "Status"
128
  msgstr ""
129
 
130
+ #: includes/admin/class-ur-admin-menus.php:338
131
+ #: includes/admin/class-ur-admin-menus.php:339
132
+ #: includes/admin/class-ur-admin-menus.php:387
133
  msgid "Add New"
134
  msgstr ""
135
 
136
+ #: includes/admin/class-ur-admin-menus.php:355
137
  msgid "User Registration extensions"
138
  msgstr ""
139
 
140
+ #: includes/admin/class-ur-admin-menus.php:356
141
  msgid "Extensions"
142
  msgstr ""
143
 
144
+ #: includes/admin/class-ur-admin-menus.php:393
145
  msgid "Search Registration"
146
  msgstr ""
147
 
148
+ #: includes/admin/class-ur-admin-menus.php:415
149
  msgid "Create Form"
150
  msgstr ""
151
 
152
+ #: includes/admin/class-ur-admin-menus.php:418
153
  msgid "Update form"
154
  msgstr ""
155
 
156
+ #: includes/admin/class-ur-admin-menus.php:455
157
  msgid "User Registration endpoints"
158
  msgstr ""
159
 
160
+ #: includes/admin/class-ur-admin-menus.php:479
161
+ #: includes/admin/settings/class-ur-settings-general.php:168
162
  #: includes/class-ur-query.php:79
163
  msgid "Lost password"
164
  msgstr ""
165
 
166
+ #: includes/admin/class-ur-admin-menus.php:517
167
  msgid "Select all"
168
  msgstr ""
169
 
170
+ #: includes/admin/class-ur-admin-menus.php:521
171
  msgid "Add to menu"
172
  msgstr ""
173
 
174
+ #: includes/admin/class-ur-admin-menus.php:613
175
  msgid "Empty form data"
176
  msgstr ""
177
 
178
+ #: includes/admin/class-ur-admin-notices.php:125 user-registration.php:77
179
+ #: user-registration.php:86
180
  msgid "Cheatin&#8217; huh?"
181
  msgstr ""
182
 
183
+ #: includes/admin/class-ur-admin-profile.php:55
184
  msgid "User Extra Information %s"
185
  msgstr ""
186
 
187
+ #: includes/admin/class-ur-admin-profile.php:134
188
+ #: includes/admin/class-ur-admin-profile.php:146
189
  #: includes/form/class-ur-form-field-select.php:35
190
  #: includes/form/class-ur-form-field-select.php:40
191
  msgid "Select"
192
  msgstr ""
193
 
194
+ #: includes/admin/class-ur-admin-registrations-table-list.php:37
195
  msgid "No user registration found."
196
  msgstr ""
197
 
198
+ #: includes/admin/class-ur-admin-registrations-table-list.php:48
199
  msgid "Title"
200
  msgstr ""
201
 
202
+ #: includes/admin/class-ur-admin-registrations-table-list.php:49
203
  msgid "Shortcode"
204
  msgstr ""
205
 
206
+ #: includes/admin/class-ur-admin-registrations-table-list.php:50
207
  msgid "Author"
208
  msgstr ""
209
 
210
+ #: includes/admin/class-ur-admin-registrations-table-list.php:51
211
  #: includes/form/class-ur-form-field-date.php:37
212
  #: includes/form/class-ur-form-field-date.php:42
213
  msgid "Date"
214
  msgstr ""
215
 
216
+ #: includes/admin/class-ur-admin-registrations-table-list.php:103
217
  msgid "ID: %d"
218
  msgstr ""
219
 
220
+ #: includes/admin/class-ur-admin-registrations-table-list.php:107
221
+ #: includes/class-ur-post-types.php:53
222
  msgid "Edit"
223
  msgstr ""
224
 
225
+ #: includes/admin/class-ur-admin-registrations-table-list.php:112
226
  msgid "Restore this item from the Trash"
227
  msgstr ""
228
 
229
+ #: includes/admin/class-ur-admin-registrations-table-list.php:112
230
+ #: includes/admin/class-ur-admin-registrations-table-list.php:322
231
  msgid "Restore"
232
  msgstr ""
233
 
234
+ #: includes/admin/class-ur-admin-registrations-table-list.php:114
235
  msgid "Move this item to the Trash"
236
  msgstr ""
237
 
238
+ #: includes/admin/class-ur-admin-registrations-table-list.php:117
239
  msgid "Delete this item permanently"
240
  msgstr ""
241
 
242
+ #: includes/admin/class-ur-admin-registrations-table-list.php:117
243
+ #: includes/admin/class-ur-admin-registrations-table-list.php:323
244
  msgid "Delete permanently"
245
  msgstr ""
246
 
247
+ #: includes/admin/class-ur-admin-registrations-table-list.php:124
248
  msgid "Duplicate"
249
  msgstr ""
250
 
251
+ #: includes/admin/class-ur-admin-registrations-table-list.php:177
252
  msgid "Y/m/d g:i:s A"
253
  msgstr ""
254
 
255
+ #: includes/admin/class-ur-admin-registrations-table-list.php:189
256
  msgid "%s ago"
257
  msgstr ""
258
 
259
+ #: includes/admin/class-ur-admin-registrations-table-list.php:193
260
  msgid "Y/m/d"
261
  msgstr ""
262
 
263
+ #: includes/admin/class-ur-admin-registrations-table-list.php:212
264
+ #: includes/admin/class-ur-admin-registrations-table-list.php:213
265
  #. translators: %s: count
266
  msgid "Published <span class=\"count\">(%s)</span>"
267
  msgstr ""
268
 
269
+ #: includes/admin/class-ur-admin-registrations-table-list.php:221
270
+ #: includes/admin/class-ur-admin-registrations-table-list.php:222
271
  #. translators: %s: count
272
  msgid "Draft <span class=\"count\">(%s)</span>"
273
  msgstr ""
274
 
275
+ #: includes/admin/class-ur-admin-registrations-table-list.php:230
276
+ #: includes/admin/class-ur-admin-registrations-table-list.php:231
277
  #. translators: %s: count
278
  msgid "Pending <span class=\"count\">(%s)</span>"
279
  msgstr ""
280
 
281
+ #: includes/admin/class-ur-admin-registrations-table-list.php:328
282
  msgid "Move to trash"
283
  msgstr ""
284
 
285
+ #: includes/admin/class-ur-admin-registrations-table-list.php:339
286
  msgid "Empty trash"
287
  msgstr ""
288
 
290
  msgid "Your settings have been saved."
291
  msgstr ""
292
 
293
+ #: includes/admin/class-ur-admin-settings.php:142
294
  msgid "The changes you made will be lost if you navigate away from this page."
295
  msgstr ""
296
 
297
+ #: includes/admin/class-ur-admin-settings.php:558
298
  msgid "Select a page&hellip;"
299
  msgstr ""
300
 
301
+ #: includes/admin/class-ur-admin-user-list-manager.php:146
302
  msgid "User Registration:"
303
  msgstr ""
304
 
305
+ #: includes/admin/class-ur-admin-user-list-manager.php:146
306
  msgid "User"
307
  msgstr ""
308
 
309
+ #: includes/admin/class-ur-admin-user-list-manager.php:146
310
  msgid "Users"
311
  msgstr ""
312
 
313
+ #: includes/admin/class-ur-admin-user-list-manager.php:146
314
  msgid "pending approval."
315
  msgstr ""
316
 
317
+ #: includes/admin/class-ur-admin-user-list-manager.php:165
318
  msgid "User approved."
319
  msgid_plural "%s users approved."
320
  msgstr[0] ""
321
  msgstr[1] ""
322
 
323
+ #: includes/admin/class-ur-admin-user-list-manager.php:167
324
  msgid "User denied."
325
  msgid_plural "%s users denied."
326
  msgstr[0] ""
327
  msgstr[1] ""
328
 
329
+ #: includes/admin/class-ur-admin-user-list-manager.php:225
330
  msgid "All statuses"
331
  msgstr ""
332
 
333
+ #: includes/admin/class-ur-admin-user-list-manager.php:227
334
  msgid "All approval statuses"
335
  msgstr ""
336
 
337
+ #: includes/admin/class-ur-admin-user-list-manager.php:236
338
  msgid "Filter"
339
  msgstr ""
340
 
341
+ #: includes/admin/class-ur-admin-user-list-manager.php:317
342
+ #: includes/admin/class-ur-admin-user-list-manager.php:318
343
  msgid "Approve"
344
  msgstr ""
345
 
346
+ #: includes/admin/class-ur-admin-user-list-manager.php:320
347
+ #: includes/admin/class-ur-admin-user-list-manager.php:321
348
  msgid "Deny"
349
  msgstr ""
350
 
351
+ #: includes/admin/class-ur-admin-user-list-manager.php:395
352
  msgid "Approval Status"
353
  msgstr ""
354
 
355
+ #: includes/admin/class-ur-admin-user-list-manager.php:408
356
  msgid "If user has access to sign in or not."
357
  msgstr ""
358
 
381
  msgid "Thank You!"
382
  msgstr ""
383
 
384
+ #: includes/admin/class-ur-admin.php:130
385
  msgid "Thank you for using User Registration."
386
  msgstr ""
387
 
388
+ #: includes/admin/functions-ur-admin.php:51
389
+ #: includes/admin/functions-ur-admin.php:114
390
  msgid "User Extra Information"
391
  msgstr ""
392
 
393
+ #: includes/admin/functions-ur-admin.php:134
394
  msgid "WordPress User Extra Information"
395
  msgstr ""
396
 
398
  msgid "Emails"
399
  msgstr ""
400
 
401
+ #: includes/admin/settings/class-ur-settings-email.php:71
402
  msgid "General Email Settings"
403
  msgstr ""
404
 
405
+ #: includes/admin/settings/class-ur-settings-email.php:85
406
  msgid "Email notifications"
407
  msgstr ""
408
 
409
+ #: includes/admin/settings/class-ur-settings-email.php:86
410
  msgid ""
411
  "Email notifications sent from user registration are listed below. Click on "
412
  "an email to configure it."
413
  msgstr ""
414
 
415
+ #: includes/admin/settings/class-ur-settings-email.php:104
416
  msgid "Email Sender Options"
417
  msgstr ""
418
 
419
+ #: includes/admin/settings/class-ur-settings-email.php:111
420
  msgid "\"From\" name"
421
  msgstr ""
422
 
423
+ #: includes/admin/settings/class-ur-settings-email.php:112
424
  msgid "How the sender name appears in outgoing user registration emails."
425
  msgstr ""
426
 
427
+ #: includes/admin/settings/class-ur-settings-email.php:122
428
  msgid "\"From\" address"
429
  msgstr ""
430
 
431
+ #: includes/admin/settings/class-ur-settings-email.php:123
432
  msgid "How the sender email appears in outgoing user registration emails."
433
  msgstr ""
434
 
435
+ #: includes/admin/settings/class-ur-settings-email.php:159
436
+ #: includes/admin/settings/class-ur-settings-general.php:264
437
  msgid "Email"
438
  msgstr ""
439
 
440
+ #: includes/admin/settings/class-ur-settings-email.php:160
441
+ #: includes/admin/settings/class-ur-settings-email.php:179
442
  msgid "Configure"
443
  msgstr ""
444
 
445
+ #: includes/admin/settings/class-ur-settings-email.php:228
446
  msgid "Smart Tags Used"
447
  msgstr ""
448
 
451
  msgstr ""
452
 
453
  #: includes/admin/settings/class-ur-settings-general.php:44
454
+ #: includes/admin/settings/class-ur-settings-general.php:71
455
  msgid "General Options"
456
  msgstr ""
457
 
458
  #: includes/admin/settings/class-ur-settings-general.php:45
459
+ #: includes/admin/settings/class-ur-settings-general.php:334
460
  msgid "Login Options"
461
  msgstr ""
462
 
469
  msgid "Export Users"
470
  msgstr ""
471
 
472
+ #: includes/admin/settings/class-ur-settings-general.php:77
473
  msgid "User login option"
474
  msgstr ""
475
 
476
+ #: includes/admin/settings/class-ur-settings-general.php:78
477
  msgid "This option lets you choose login option after user registration."
478
  msgstr ""
479
 
480
+ #: includes/admin/settings/class-ur-settings-general.php:88
481
  msgid "Redirect URL"
482
  msgstr ""
483
 
484
+ #: includes/admin/settings/class-ur-settings-general.php:89
485
  msgid "This option lets you enter redirect path after successful user registration."
486
  msgstr ""
487
 
488
+ #: includes/admin/settings/class-ur-settings-general.php:96
489
  msgid "Prevent dashboard access"
490
  msgstr ""
491
 
492
+ #: includes/admin/settings/class-ur-settings-general.php:97
493
  msgid ""
494
  "This option lets you limit which roles you are willing to prevent dashboard "
495
  "access."
496
  msgstr ""
497
 
498
+ #: includes/admin/settings/class-ur-settings-general.php:112
499
  msgid "My account Section"
500
  msgstr ""
501
 
502
+ #: includes/admin/settings/class-ur-settings-general.php:117
503
  msgid "My account page"
504
  msgstr ""
505
 
506
+ #: includes/admin/settings/class-ur-settings-general.php:118
507
  msgid "Page contents: [%s]"
508
  msgstr ""
509
 
510
+ #: includes/admin/settings/class-ur-settings-general.php:127
511
  msgid "Layout"
512
  msgstr ""
513
 
514
+ #: includes/admin/settings/class-ur-settings-general.php:128
515
  msgid "This option lets you choose layout for user registration my account tab."
516
  msgstr ""
517
 
518
+ #: includes/admin/settings/class-ur-settings-general.php:136
519
  msgid "Horizontal"
520
  msgstr ""
521
 
522
+ #: includes/admin/settings/class-ur-settings-general.php:137
523
  msgid "Vertical"
524
  msgstr ""
525
 
526
+ #: includes/admin/settings/class-ur-settings-general.php:147
527
  msgid "Endpoints: "
528
  msgstr ""
529
 
530
+ #: includes/admin/settings/class-ur-settings-general.php:147
531
  msgid ""
532
  "Endpoints are appended to your page URLs to handle specific actions on the "
533
  "accounts pages. They should be unique and can be left blank to disable the "
534
  "endpoint."
535
  msgstr ""
536
 
537
+ #: includes/admin/settings/class-ur-settings-general.php:152
538
  msgid "Edit profile"
539
  msgstr ""
540
 
541
+ #: includes/admin/settings/class-ur-settings-general.php:153
542
  msgid "Endpoint for the \"My account &rarr; Edit profile\" page."
543
  msgstr ""
544
 
545
+ #: includes/admin/settings/class-ur-settings-general.php:160
546
  #: includes/class-ur-query.php:73 includes/functions-ur-account.php:88
547
  msgid "Change Password"
548
  msgstr ""
549
 
550
+ #: includes/admin/settings/class-ur-settings-general.php:161
551
  msgid "Endpoint for the \"My account &rarr; Change Password\" page."
552
  msgstr ""
553
 
554
+ #: includes/admin/settings/class-ur-settings-general.php:169
555
  msgid "Endpoint for the \"My account &rarr; Lost password\" page."
556
  msgstr ""
557
 
558
+ #: includes/admin/settings/class-ur-settings-general.php:176
559
  msgid "User logout"
560
  msgstr ""
561
 
562
+ #: includes/admin/settings/class-ur-settings-general.php:177
563
  msgid ""
564
  "Endpoint for the triggering logout. You can add this to your menus via a "
565
  "custom link: yoursite.com/?user-logout=true"
566
  msgstr ""
567
 
568
+ #: includes/admin/settings/class-ur-settings-general.php:205
569
  msgid "Success Messages"
570
  msgstr ""
571
 
572
+ #: includes/admin/settings/class-ur-settings-general.php:212
573
+ #: includes/functions-ur-core.php:829
574
  msgid "Manual login after registration"
575
  msgstr ""
576
 
577
+ #: includes/admin/settings/class-ur-settings-general.php:213
578
  msgid ""
579
  "Enter the text message after successful form submission on manual login "
580
  "after registration."
581
  msgstr ""
582
 
583
+ #: includes/admin/settings/class-ur-settings-general.php:218
584
+ #: includes/class-ur-frontend-scripts.php:330
585
  msgid "User successfully registered."
586
  msgstr ""
587
 
588
+ #: includes/admin/settings/class-ur-settings-general.php:222
589
+ #: includes/functions-ur-core.php:830
590
  msgid "Email confirmation to login"
591
  msgstr ""
592
 
593
+ #: includes/admin/settings/class-ur-settings-general.php:223
594
  msgid ""
595
  "Enter the text message after successful form submission on email "
596
  "confirmation to login."
597
  msgstr ""
598
 
599
+ #: includes/admin/settings/class-ur-settings-general.php:228
600
+ #: includes/class-ur-frontend-scripts.php:332
601
  msgid ""
602
  "User registered. Verify your email by clicking on the link sent to your "
603
  "email."
604
  msgstr ""
605
 
606
+ #: includes/admin/settings/class-ur-settings-general.php:232
607
+ #: includes/functions-ur-core.php:832
608
  msgid "Admin approval after registration"
609
  msgstr ""
610
 
611
+ #: includes/admin/settings/class-ur-settings-general.php:233
612
  msgid ""
613
  "Enter the text message after successful form submission on admin approval "
614
  "after registration."
615
  msgstr ""
616
 
617
+ #: includes/admin/settings/class-ur-settings-general.php:238
618
+ #: includes/class-ur-frontend-scripts.php:331
619
  msgid "User registered. Wait until admin approves your registration."
620
  msgstr ""
621
 
622
+ #: includes/admin/settings/class-ur-settings-general.php:247
623
  msgid "Error Messages"
624
  msgstr ""
625
 
626
+ #: includes/admin/settings/class-ur-settings-general.php:254
627
+ #: includes/functions-ur-core.php:591
628
  msgid "Required"
629
  msgstr ""
630
 
631
+ #: includes/admin/settings/class-ur-settings-general.php:255
632
  msgid "Enter the error message in form submission on required fields."
633
  msgstr ""
634
 
635
+ #: includes/admin/settings/class-ur-settings-general.php:260
636
+ #: includes/class-ur-frontend-scripts.php:324
637
  msgid "This field is required."
638
  msgstr ""
639
 
640
+ #: includes/admin/settings/class-ur-settings-general.php:265
641
  msgid "Enter the error message in form submission on Email."
642
  msgstr ""
643
 
644
+ #: includes/admin/settings/class-ur-settings-general.php:270
645
+ #: includes/class-ur-frontend-scripts.php:325
646
  msgid "Please enter a valid email address."
647
  msgstr ""
648
 
649
+ #: includes/admin/settings/class-ur-settings-general.php:274
650
  msgid "Website URL"
651
  msgstr ""
652
 
653
+ #: includes/admin/settings/class-ur-settings-general.php:275
654
  msgid "Enter the error message in form submission on website/URL."
655
  msgstr ""
656
 
657
+ #: includes/admin/settings/class-ur-settings-general.php:280
658
+ #: includes/class-ur-frontend-scripts.php:326
659
  msgid "Please enter a valid URL."
660
  msgstr ""
661
 
662
+ #: includes/admin/settings/class-ur-settings-general.php:284
663
  #: includes/form/class-ur-form-field-number.php:37
664
  #: includes/form/class-ur-form-field-number.php:42
665
  msgid "Number"
666
  msgstr ""
667
 
668
+ #: includes/admin/settings/class-ur-settings-general.php:285
669
  msgid "Enter the error message in form submission on Number."
670
  msgstr ""
671
 
672
+ #: includes/admin/settings/class-ur-settings-general.php:290
673
+ #: includes/class-ur-frontend-scripts.php:327
674
  msgid "Please enter a valid number."
675
  msgstr ""
676
 
677
+ #: includes/admin/settings/class-ur-settings-general.php:294
678
  #: includes/form/class-ur-form-field-user-confirm-password.php:40
679
  msgid "Confirm Password"
680
  msgstr ""
681
 
682
+ #: includes/admin/settings/class-ur-settings-general.php:295
683
  msgid "Enter the error message in form submission on Confim Password."
684
  msgstr ""
685
 
686
+ #: includes/admin/settings/class-ur-settings-general.php:300
687
+ #: includes/class-ur-frontend-scripts.php:328
688
  msgid "Password and confirm password not matched."
689
  msgstr ""
690
 
691
+ #: includes/admin/settings/class-ur-settings-general.php:304
692
  msgid "Google reCaptcha"
693
  msgstr ""
694
 
695
+ #: includes/admin/settings/class-ur-settings-general.php:305
696
  msgid "Enter the error message in form submission on google recaptcha."
697
  msgstr ""
698
 
699
+ #: includes/admin/settings/class-ur-settings-general.php:310
700
+ #: includes/class-ur-ajax.php:88 includes/class-ur-form-handler.php:275
701
+ #: includes/class-ur-frontend-scripts.php:333
702
  msgid "Captcha code error, please try again."
703
  msgstr ""
704
 
705
+ #: includes/admin/settings/class-ur-settings-general.php:341
706
+ #: includes/functions-ur-core.php:784
707
  msgid "Form Template"
708
  msgstr ""
709
 
710
+ #: includes/admin/settings/class-ur-settings-general.php:342
711
  msgid "Choose the login form template."
712
  msgstr ""
713
 
714
+ #: includes/admin/settings/class-ur-settings-general.php:349
715
+ #: includes/functions-ur-core.php:791
716
  msgid "Default"
717
  msgstr ""
718
 
719
+ #: includes/admin/settings/class-ur-settings-general.php:350
720
+ #: includes/functions-ur-core.php:792
721
  msgid "Bordered"
722
  msgstr ""
723
 
724
+ #: includes/admin/settings/class-ur-settings-general.php:351
725
+ #: includes/functions-ur-core.php:793
726
  msgid "Flat"
727
  msgstr ""
728
 
729
+ #: includes/admin/settings/class-ur-settings-general.php:352
730
+ #: includes/functions-ur-core.php:794
731
  msgid "Rounded"
732
  msgstr ""
733
 
734
+ #: includes/admin/settings/class-ur-settings-general.php:353
735
+ #: includes/functions-ur-core.php:795
736
  msgid "Rounded Edge"
737
  msgstr ""
738
 
739
+ #: includes/admin/settings/class-ur-settings-general.php:358
740
  msgid "Enable remember me"
741
  msgstr ""
742
 
743
+ #: includes/admin/settings/class-ur-settings-general.php:359
744
  msgid "Check to enable/disable remember me."
745
  msgstr ""
746
 
747
+ #: includes/admin/settings/class-ur-settings-general.php:368
748
  msgid "Enable lost password"
749
  msgstr ""
750
 
751
+ #: includes/admin/settings/class-ur-settings-general.php:369
752
  msgid "Check to enable/disable lost password."
753
  msgstr ""
754
 
755
+ #: includes/admin/settings/class-ur-settings-general.php:378
756
  msgid "Enable google reCaptcha"
757
  msgstr ""
758
 
759
+ #: includes/admin/settings/class-ur-settings-general.php:379
760
  msgid "Enable %1$s %2$s reCaptcha %3$s support"
761
  msgstr ""
762
 
763
+ #: includes/admin/settings/class-ur-settings-general.php:388
764
  msgid "Registration URL"
765
  msgstr ""
766
 
767
+ #: includes/admin/settings/class-ur-settings-general.php:389
768
  msgid "This option lets you enter the registration page url in login form."
769
  msgstr ""
770
 
771
+ #: includes/admin/settings/class-ur-settings-general.php:397
772
  msgid "Registration URL label"
773
  msgstr ""
774
 
775
+ #: includes/admin/settings/class-ur-settings-general.php:398
776
  msgid "This option lets you enter the label to registration url in login form."
777
  msgstr ""
778
 
779
+ #: includes/admin/settings/class-ur-settings-general.php:403
780
+ #: templates/myaccount/form-login.php:113
781
  msgid "Not a member yet? Register now."
782
  msgstr ""
783
 
785
  msgid "Integration"
786
  msgstr ""
787
 
788
+ #: includes/admin/settings/class-ur-settings-integration.php:47
789
  msgid "Google reCaptcha Integation"
790
  msgstr ""
791
 
792
+ #: includes/admin/settings/class-ur-settings-integration.php:53
793
  msgid "Version"
794
  msgstr ""
795
 
796
+ #: includes/admin/settings/class-ur-settings-integration.php:54
797
  msgid "Select the google reCaptcha version"
798
  msgstr ""
799
 
800
+ #: includes/admin/settings/class-ur-settings-integration.php:66
801
  msgid "Site Key (v2)"
802
  msgstr ""
803
 
804
+ #: includes/admin/settings/class-ur-settings-integration.php:67
805
+ #: includes/admin/settings/class-ur-settings-integration.php:88
806
  msgid "Get site key from google %1$s reCaptcha %2$s."
807
  msgstr ""
808
 
809
+ #: includes/admin/settings/class-ur-settings-integration.php:77
810
  msgid "Secret Key (v2)"
811
  msgstr ""
812
 
813
+ #: includes/admin/settings/class-ur-settings-integration.php:78
814
+ #: includes/admin/settings/class-ur-settings-integration.php:99
815
  msgid "Get secret key from google %1$s reCaptcha %2$s."
816
  msgstr ""
817
 
818
+ #: includes/admin/settings/class-ur-settings-integration.php:87
819
  msgid "Site Key (v3)"
820
  msgstr ""
821
 
822
+ #: includes/admin/settings/class-ur-settings-integration.php:98
823
  msgid "Secret Key (v3)"
824
  msgstr ""
825
 
843
  msgid "Return to emails"
844
  msgstr ""
845
 
846
+ #: includes/admin/settings/emails/class-ur-settings-admin-email.php:47
847
+ #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:48
848
+ #: includes/admin/settings/emails/class-ur-settings-registration-approved-email.php:48
849
+ #: includes/admin/settings/emails/class-ur-settings-registration-denied-email.php:48
850
+ #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:47
851
+ #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:46
852
+ #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:48
853
  msgid "Enable this email"
854
  msgstr ""
855
 
856
+ #: includes/admin/settings/emails/class-ur-settings-admin-email.php:48
857
  msgid "Enable this email sent to admin after successful user registration."
858
  msgstr ""
859
 
860
+ #: includes/admin/settings/emails/class-ur-settings-admin-email.php:55
861
  msgid "Email Receipents"
862
  msgstr ""
863
 
864
+ #: includes/admin/settings/emails/class-ur-settings-admin-email.php:56
865
  msgid "Use comma to send emails to multiple receipents."
866
  msgstr ""
867
 
 
 
 
 
 
 
 
 
 
 
 
868
  #: includes/admin/settings/emails/class-ur-settings-admin-email.php:65
869
  #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:56
870
  #: includes/admin/settings/emails/class-ur-settings-email-confirmation.php:48
873
  #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:56
874
  #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:54
875
  #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:56
876
+ msgid "Email Subject"
877
  msgstr ""
878
 
879
+ #: includes/admin/settings/emails/class-ur-settings-admin-email.php:66
880
+ #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:57
881
+ #: includes/admin/settings/emails/class-ur-settings-email-confirmation.php:49
882
+ #: includes/admin/settings/emails/class-ur-settings-registration-approved-email.php:57
883
+ #: includes/admin/settings/emails/class-ur-settings-registration-denied-email.php:57
884
+ #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:57
885
+ #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:55
886
+ #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:57
887
+ msgid "The email subject you want to customize."
888
  msgstr ""
889
 
890
+ #: includes/admin/settings/emails/class-ur-settings-admin-email.php:69
891
+ #: includes/class-ur-emailer.php:268
892
+ msgid "A New User Registered"
 
 
 
 
 
 
893
  msgstr ""
894
 
895
  #: includes/admin/settings/emails/class-ur-settings-admin-email.php:74
900
  #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:66
901
  #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:63
902
  #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:65
903
+ msgid "Email Content"
904
+ msgstr ""
905
+
906
+ #: includes/admin/settings/emails/class-ur-settings-admin-email.php:75
907
+ #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:66
908
+ #: includes/admin/settings/emails/class-ur-settings-email-confirmation.php:59
909
+ #: includes/admin/settings/emails/class-ur-settings-registration-approved-email.php:66
910
+ #: includes/admin/settings/emails/class-ur-settings-registration-denied-email.php:66
911
+ #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:67
912
+ #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:64
913
+ #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:66
914
  msgid "The email content you want to customize."
915
  msgstr ""
916
 
917
+ #: includes/admin/settings/emails/class-ur-settings-admin-email.php:96
918
  msgid ""
919
  "Hi Admin,\n"
920
  "\n"
939
  msgid "Awaiting Admin Approval Email"
940
  msgstr ""
941
 
942
+ #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:49
943
  msgid ""
944
  "Enable this email sent to user notifying the registration is awaiting admin "
945
  "approval."
946
  msgstr ""
947
 
948
+ #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:60
949
+ #: includes/class-ur-emailer.php:211
950
  msgid "Thank you for registration on {{blog_info}}"
951
  msgstr ""
952
 
953
+ #: includes/admin/settings/emails/class-ur-settings-awaiting-admin-approval-email.php:89
954
  msgid ""
955
  "Hi {{username}},\n"
956
  "\n"
957
  " \t\t\t\tYou have registered on <a href=\"{{home_url}}\">{{blog_info}}</a>.\n"
958
+ "\n"
959
  " \t\t\t\tPlease wait until the site admin approves your registration. You "
960
  "will be notified after it is approved.\n"
961
  "\n"
973
  "register option is choosen"
974
  msgstr ""
975
 
976
+ #: includes/admin/settings/emails/class-ur-settings-email-confirmation.php:52
977
+ #: includes/class-ur-emailer.php:201
978
  msgid "Please confirm your registration on {{blog_info}}"
979
  msgstr ""
980
 
981
+ #: includes/admin/settings/emails/class-ur-settings-email-confirmation.php:83
982
  msgid ""
983
  "Hi {{username}},\n"
984
  "\n"
999
  msgid "Email sent to the user notifying the registration is approved by site admin"
1000
  msgstr ""
1001
 
1002
+ #: includes/admin/settings/emails/class-ur-settings-registration-approved-email.php:49
1003
  msgid ""
1004
  "Enable this email sent to the user notifying the registration is approved "
1005
  "by site admin."
1006
  msgstr ""
1007
 
1008
+ #: includes/admin/settings/emails/class-ur-settings-registration-approved-email.php:60
1009
+ #: includes/class-ur-emailer.php:355
1010
  msgid "Congratulations! Registration approved on {{blog_info}}"
1011
  msgstr ""
1012
 
1013
+ #: includes/admin/settings/emails/class-ur-settings-registration-approved-email.php:89
1014
  msgid ""
1015
  "Hi {{username}},\n"
1016
  "\n"
1032
  msgid "Email sent to the user notifying the registration is denied by the admin"
1033
  msgstr ""
1034
 
1035
+ #: includes/admin/settings/emails/class-ur-settings-registration-denied-email.php:49
1036
  msgid ""
1037
  "Enable this email sent to the user notifying the registration is denied by "
1038
  "the admin."
1039
  msgstr ""
1040
 
1041
+ #: includes/admin/settings/emails/class-ur-settings-registration-denied-email.php:60
1042
+ #: includes/class-ur-emailer.php:223 includes/class-ur-emailer.php:343
1043
  msgid "Sorry! Registration denied on {{blog_info}}"
1044
  msgstr ""
1045
 
1046
+ #: includes/admin/settings/emails/class-ur-settings-registration-denied-email.php:89
1047
  msgid ""
1048
  "Hi {{username}},\n"
1049
  "\n"
1064
  msgid "Email sent to the user notifying the registration is pending"
1065
  msgstr ""
1066
 
1067
+ #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:48
1068
  msgid "Enable this email sent to the user notifying the registration is pending."
1069
  msgstr ""
1070
 
1071
+ #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:60
1072
+ #: includes/class-ur-emailer.php:331
1073
  msgid "Sorry! Registration changed to pending on {{blog_info}}"
1074
  msgstr ""
1075
 
1076
+ #: includes/admin/settings/emails/class-ur-settings-registration-pending-email.php:91
1077
  msgid ""
1078
  "Hi {{username}},\n"
1079
  "\n"
1096
  msgid "Email sent to the user when a user requests for reset password"
1097
  msgstr ""
1098
 
1099
+ #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:47
1100
  msgid "Enable this email sent to the user when a user requests for reset password."
1101
  msgstr ""
1102
 
1103
+ #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:58
1104
+ #: includes/class-ur-emailer.php:390
1105
  msgid "Password Reset Email: {{blog_info}}"
1106
  msgstr ""
1107
 
1108
+ #: includes/admin/settings/emails/class-ur-settings-reset-password-email.php:86
1109
  msgid ""
1110
  "Someone has requested a password reset for the following account:\n"
1111
  "\n"
1112
  "\t\t\tSiteName: {{blog_info}}\n"
1113
  "\t\t\tUsername: {{username}}\n"
1114
+ "\n"
1115
  "\t\t\tIf this was a mistake, just ignore this email and nothing will "
1116
  "happen.\n"
1117
+ "\n"
1118
  "\t\t\tTo reset your password, visit the following address:\n"
1119
  "\t\t\t{{home_url}}/wp-login.php?action=rp&key={{key}}&login={{username}}\n"
1120
  "\n"
1130
  msgid "Email sent to the user after successful registration"
1131
  msgstr ""
1132
 
1133
+ #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:49
1134
  msgid "Enable this email sent to the user after successful user registration."
1135
  msgstr ""
1136
 
1137
+ #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:60
1138
+ #: includes/class-ur-emailer.php:234
1139
  msgid "Congratulations! Registration Complete on {{blog_info}}"
1140
  msgstr ""
1141
 
1142
+ #: includes/admin/settings/emails/class-ur-settings-successfully-registered-email.php:88
1143
  msgid ""
1144
  "Hi {{username}},\n"
1145
  "\n"
1152
  "\t\t\tThank You!"
1153
  msgstr ""
1154
 
1155
+ #: includes/admin/updater/class-ur-addon-updater.php:222
1156
  msgid "There is a new version of %1$s available. %2$sView version %3$s details%4$s."
1157
  msgstr ""
1158
 
1159
+ #: includes/admin/updater/class-ur-addon-updater.php:230
1160
  msgid ""
1161
  "There is a new version of %1$s available. %2$sView version %3$s details%4$s "
1162
  "or %5$supdate now%6$s."
1163
  msgstr ""
1164
 
1165
+ #: includes/admin/updater/class-ur-addon-updater.php:426
1166
  msgid "You do not have permission to install plugin updates"
1167
  msgstr ""
1168
 
1169
+ #: includes/admin/updater/class-ur-addon-updater.php:426
1170
  msgid "Error"
1171
  msgstr ""
1172
 
1198
  msgid "Form Name"
1199
  msgstr ""
1200
 
1201
+ #: includes/admin/views/html-admin-page-forms.php:36
1202
  msgid "Copy Shortcode!"
1203
  msgstr ""
1204
 
1205
+ #: includes/admin/views/html-admin-page-forms.php:36
1206
  msgid "Copied!"
1207
  msgstr ""
1208
 
1209
+ #: includes/admin/views/html-admin-page-forms.php:58
1210
  msgid "Fields"
1211
  msgstr ""
1212
 
1213
+ #: includes/admin/views/html-admin-page-forms.php:61
1214
  msgid "Field Options"
1215
  msgstr ""
1216
 
1217
+ #: includes/admin/views/html-admin-page-forms.php:64
1218
  msgid "Form Setting"
1219
  msgstr ""
1220
 
1221
+ #: includes/admin/views/html-admin-page-forms.php:70
1222
  msgid "Default User Fields"
1223
  msgstr ""
1224
 
1225
+ #: includes/admin/views/html-admin-page-forms.php:73
1226
  msgid "Extra Fields"
1227
  msgstr ""
1228
 
1291
 
1292
  #: includes/admin/views/html-notice-key-unvalidated.php:13
1293
  msgid ""
1294
+ "%1$sPlease enter your license key%2$s in the plugin list below to get "
1295
+ "updates for <strong>%3$s</strong> Add-Ons."
1296
  msgstr ""
1297
 
1298
  #: includes/admin/views/html-notice-registration.php:14
1299
  msgid ""
1300
  "To allow users to register for your website via User registration, you must "
1301
+ "first enable user registration. Go to %1$sSettings > General%2$s tab, and "
1302
+ "under Membership make sure to check <strong>Anyone can register</strong>."
1303
  msgstr ""
1304
 
1305
  #: includes/admin/views/html-notice-update.php:12
1335
  msgid "Taking a while? Click here to run it now."
1336
  msgstr ""
1337
 
1338
+ #: includes/class-ur-ajax.php:81 includes/class-ur-form-handler.php:272
1339
  msgid "Error on google reCaptcha. Contact your site administrator."
1340
  msgstr ""
1341
 
1342
+ #: includes/class-ur-ajax.php:97
1343
  msgid "Nonce error, please reload."
1344
  msgstr ""
1345
 
1346
+ #: includes/class-ur-ajax.php:109 includes/class-ur-shortcodes.php:122
1347
  msgid "Only administrators can add new users."
1348
  msgstr ""
1349
 
1350
+ #: includes/class-ur-ajax.php:127 includes/class-ur-shortcodes.php:136
1351
+ msgid "You are currently logged in as %1$1s. %2$2s"
1352
  msgstr ""
1353
 
1354
+ #: includes/class-ur-ajax.php:127 includes/class-ur-shortcodes.php:136
1355
  msgid "Log out of this account."
1356
  msgstr ""
1357
 
1358
+ #: includes/class-ur-ajax.php:127 includes/class-ur-shortcodes.php:136
1359
  #: includes/functions-ur-account.php:89
1360
  msgid "Logout"
1361
  msgstr ""
1362
 
1363
+ #: includes/class-ur-ajax.php:193 includes/class-ur-ajax.php:199
1364
  msgid "post data not set"
1365
  msgstr ""
1366
 
1367
+ #: includes/class-ur-ajax.php:214
1368
  msgid "Could not save form. Invalid field name. Please check all field name"
1369
  msgstr ""
1370
 
1371
+ #: includes/class-ur-email-confirmation.php:157
1372
  msgid "Verified"
1373
  msgstr ""
1374
 
1375
+ #: includes/class-ur-email-confirmation.php:159
1376
  msgid "Pending"
1377
  msgstr ""
1378
 
1379
+ #: includes/class-ur-email-confirmation.php:180
1380
  msgid "User successfully registered. Login to continue."
1381
  msgstr ""
1382
 
1383
+ #: includes/class-ur-email-confirmation.php:185
1384
  msgid "Token Mismatch!"
1385
  msgstr ""
1386
 
1387
+ #: includes/class-ur-email-confirmation.php:190
1388
  msgid "Verification Email Sent!"
1389
  msgstr ""
1390
 
1391
+ #: includes/class-ur-email-confirmation.php:195
1392
  msgid "User doesnot exist!"
1393
  msgstr ""
1394
 
1395
+ #: includes/class-ur-email-confirmation.php:351
1396
+ #: includes/class-ur-form-handler.php:272
1397
+ #: includes/class-ur-form-handler.php:275
1398
+ #: includes/class-ur-form-handler.php:280
1399
  #: includes/class-ur-form-handler.php:284
1400
+ #: includes/class-ur-form-handler.php:293
1401
+ #: includes/class-ur-user-approval.php:183
1402
+ #: includes/class-ur-user-approval.php:188 includes/functions-ur-account.php:32
 
1403
  #: includes/functions-ur-account.php:35
1404
  msgid "ERROR:"
1405
  msgstr ""
1406
 
1407
+ #: includes/class-ur-email-confirmation.php:351
1408
  msgid ""
1409
  "Your account is still pending approval. Verify your email by clicking on "
1410
  "the link sent to your email. %s"
1411
  msgstr ""
1412
 
1413
+ #: includes/class-ur-email-confirmation.php:351
1414
  msgid "Resend Verification Link"
1415
  msgstr ""
1416
 
1417
+ #: includes/class-ur-email-confirmation.php:372
1418
  msgid ""
1419
  "Email not verified! Verifiy your email by clicking on the link sent to your "
1420
  "email."
1421
  msgstr ""
1422
 
1423
+ #: includes/class-ur-emailer.php:135
1424
  msgid "Chosen Password"
1425
  msgstr ""
1426
 
1427
+ #: includes/class-ur-form-block.php:49
1428
  msgid "Select &#38; display one of your form."
1429
  msgstr ""
1430
 
1431
+ #: includes/class-ur-form-block.php:50
1432
  msgid "Select a Form"
1433
  msgstr ""
1434
 
1435
+ #: includes/class-ur-form-block.php:51
1436
  msgid "Form Settings"
1437
  msgstr ""
1438
 
1439
+ #: includes/class-ur-form-block.php:52
1440
  msgid "Form"
1441
  msgstr ""
1442
 
1448
  msgid "%s is not a valid email address."
1449
  msgstr ""
1450
 
1451
+ #: includes/class-ur-form-handler.php:152
1452
  msgid "User profile updated successfully."
1453
  msgstr ""
1454
 
1455
+ #: includes/class-ur-form-handler.php:198
1456
  msgid "Please fill out all password fields."
1457
  msgstr ""
1458
 
1459
+ #: includes/class-ur-form-handler.php:201
1460
  msgid "Please enter your current password."
1461
  msgstr ""
1462
 
1463
+ #: includes/class-ur-form-handler.php:204
1464
  msgid "Please re-enter your password."
1465
  msgstr ""
1466
 
1467
+ #: includes/class-ur-form-handler.php:207
1468
  msgid "New passwords do not match."
1469
  msgstr ""
1470
 
1471
+ #: includes/class-ur-form-handler.php:210
1472
  msgid "Your current password is incorrect."
1473
  msgstr ""
1474
 
1475
+ #: includes/class-ur-form-handler.php:231
1476
  msgid "Password changed successfully."
1477
  msgstr ""
1478
 
1479
+ #: includes/class-ur-form-handler.php:284
1480
  msgid "Username is required."
1481
  msgstr ""
1482
 
1483
+ #: includes/class-ur-form-handler.php:293
1484
  msgid "A user could not be found with this email address."
1485
  msgstr ""
1486
 
1487
+ #: includes/class-ur-form-handler.php:390
1488
  msgid "Please enter your password."
1489
  msgstr ""
1490
 
1491
+ #: includes/class-ur-form-handler.php:394
1492
  msgid "Passwords do not match."
1493
  msgstr ""
1494
 
1495
+ #: includes/class-ur-frontend-scripts.php:341
1496
  msgid "Please enter a stronger password."
1497
  msgstr ""
1498
 
1499
+ #: includes/class-ur-frontend-scripts.php:343
1500
+ #: includes/functions-ur-core.php:748
1501
  msgid "Very Weak"
1502
  msgstr ""
1503
 
1504
+ #: includes/class-ur-frontend-scripts.php:344
1505
+ #: includes/functions-ur-core.php:749
1506
  msgid "Weak"
1507
  msgstr ""
1508
 
1509
+ #: includes/class-ur-frontend-scripts.php:345
1510
+ #: includes/functions-ur-core.php:750
1511
  msgid "Medium"
1512
  msgstr ""
1513
 
1514
+ #: includes/class-ur-frontend-scripts.php:346
1515
+ #: includes/functions-ur-core.php:751
1516
  msgid "Strong"
1517
  msgstr ""
1518
 
1519
+ #: includes/class-ur-frontend-scripts.php:347
1520
  msgid "Password with confirm password not matched."
1521
  msgstr ""
1522
 
1523
+ #: includes/class-ur-frontend-scripts.php:350
1524
  msgid ""
1525
  "Hint: To make password stronger, use upper and lower case letters, numbers, "
1526
  "and symbols like ! \" ? $ % ^ & )."
1527
  msgstr ""
1528
 
1529
+ #: includes/class-ur-install.php:341
1530
  msgid "Default form"
1531
  msgstr ""
1532
 
1533
+ #: includes/class-ur-install.php:611
1534
  msgid "View User Registration settings"
1535
  msgstr ""
1536
 
1537
+ #: includes/class-ur-install.php:627
1538
  msgid "View User Registration documentation"
1539
  msgstr ""
1540
 
1541
+ #: includes/class-ur-install.php:627
1542
  msgid "Docs"
1543
  msgstr ""
1544
 
1545
+ #: includes/class-ur-install.php:628
1546
  msgid "Visit free customer support"
1547
  msgstr ""
1548
 
1549
+ #: includes/class-ur-install.php:628
1550
  msgid "Free support"
1551
  msgstr ""
1552
 
1553
+ #: includes/class-ur-logger.php:58
1554
  msgid ""
1555
  "The provided handler <code>%s</code> does not implement "
1556
  "UR_Log_Handler_Interface."
1557
  msgstr ""
1558
 
1559
+ #: includes/class-ur-logger.php:137
1560
  msgid "UR_Logger::log was called with an invalid level \"%s\"."
1561
  msgstr ""
1562
 
1563
+ #: includes/class-ur-plugin-updater.php:247
1564
  msgid "Deactivate License Key"
1565
  msgstr ""
1566
 
1567
+ #: includes/class-ur-plugin-updater.php:247
1568
  msgid "Deactivate License"
1569
  msgstr ""
1570
 
1571
+ #: includes/class-ur-plugin-updater.php:282
1572
  msgid ""
1573
  "The provided license key expired on %1$s. Please <a href=\"%2$s\" "
1574
  "target=\"_blank\">renew your license key</a>."
1575
  msgstr ""
1576
 
1577
+ #: includes/class-ur-plugin-updater.php:286
1578
  msgid ""
1579
  "The provided license key has been disabled. Please <a href=\"%s\" "
1580
  "target=\"_blank\">contact support</a> for more information."
1581
  msgstr ""
1582
 
1583
+ #: includes/class-ur-plugin-updater.php:290
1584
  msgid ""
1585
  "The provided license is invalid. Please <a href=\"%s\" "
1586
  "target=\"_blank\">visit your account page</a> and verify it."
1587
  msgstr ""
1588
 
1589
+ #: includes/class-ur-plugin-updater.php:295
1590
  msgid ""
1591
  "The provided license is not active for this URL. Please <a href=\"%s\" "
1592
  "target=\"_blank\">visit your account page</a> to manage your license key "
1593
  "URLs."
1594
  msgstr ""
1595
 
1596
+ #: includes/class-ur-plugin-updater.php:300
1597
  msgid "This appears to be an invalid license key for <strong>%1$s</strong>."
1598
  msgstr ""
1599
 
1600
+ #: includes/class-ur-plugin-updater.php:304
1601
  msgid ""
1602
  "The provided license key has reached its activation limit. Please <a "
1603
  "href=\"%1$s\" target=\"_blank\">View possible upgrades</a> now."
1604
  msgstr ""
1605
 
1606
+ #: includes/class-ur-plugin-updater.php:308
1607
  msgid ""
1608
  "The key you entered belongs to a bundle, please use the product specific "
1609
  "license key."
1610
  msgstr ""
1611
 
1612
+ #: includes/class-ur-plugin-updater.php:312
1613
  msgid ""
1614
  "The provided license key could not be found. Please <a href=\"%s\" "
1615
  "target=\"_blank\">contact support</a> for more information."
1616
  msgstr ""
1617
 
1618
+ #: includes/class-ur-plugin-updater.php:316
1619
  msgid "<strong>Activation error:</strong> %1$s"
1620
  msgstr ""
1621
 
1622
+ #: includes/class-ur-post-types.php:48
1623
  msgid "Registrations"
1624
  msgstr ""
1625
 
1626
+ #: includes/class-ur-post-types.php:49
1627
  msgid "Registration"
1628
  msgstr ""
1629
 
1630
+ #: includes/class-ur-post-types.php:51
1631
  msgid "Add registration"
1632
  msgstr ""
1633
 
1634
+ #: includes/class-ur-post-types.php:52
1635
  msgid "Add new registration"
1636
  msgstr ""
1637
 
1638
+ #: includes/class-ur-post-types.php:54
1639
  msgid "Edit registration"
1640
  msgstr ""
1641
 
1642
+ #: includes/class-ur-post-types.php:55
1643
  msgid "New registration"
1644
  msgstr ""
1645
 
1646
+ #: includes/class-ur-post-types.php:56
1647
  msgid "View registrations"
1648
  msgstr ""
1649
 
1650
+ #: includes/class-ur-post-types.php:57
1651
  msgid "View registration"
1652
  msgstr ""
1653
 
1654
+ #: includes/class-ur-post-types.php:58
1655
  msgid "Search registrations"
1656
  msgstr ""
1657
 
1658
+ #: includes/class-ur-post-types.php:59
1659
  msgid "No registrations found"
1660
  msgstr ""
1661
 
1662
+ #: includes/class-ur-post-types.php:60
1663
  msgid "No registrations found in trash"
1664
  msgstr ""
1665
 
1666
+ #: includes/class-ur-post-types.php:61
1667
  msgid "Parent registration"
1668
  msgstr ""
1669
 
1868
  msgid "Profile Details"
1869
  msgstr ""
1870
 
1871
+ #: includes/class-ur-user-approval.php:183
1872
  msgid "Your account is still pending approval."
1873
  msgstr ""
1874
 
1875
+ #: includes/class-ur-user-approval.php:188
1876
  msgid "Your account has been denied."
1877
  msgstr ""
1878
 
1879
+ #: includes/class-ur-user-approval.php:258
1880
  msgid ""
1881
  "Your account is still awaiting admin approval. Reset Password is not "
1882
  "allowed."
1887
  msgid "Checkbox"
1888
  msgstr ""
1889
 
1890
+ #: includes/form/class-ur-form-field-country.php:35
1891
  msgid "Afghanistan"
1892
  msgstr ""
1893
 
1894
+ #: includes/form/class-ur-form-field-country.php:36
1895
  msgid "&#197;land Islands"
1896
  msgstr ""
1897
 
1898
+ #: includes/form/class-ur-form-field-country.php:37
1899
  msgid "Albania"
1900
  msgstr ""
1901
 
1902
+ #: includes/form/class-ur-form-field-country.php:38
1903
  msgid "Algeria"
1904
  msgstr ""
1905
 
1906
+ #: includes/form/class-ur-form-field-country.php:39
1907
  msgid "American Samoa"
1908
  msgstr ""
1909
 
1910
+ #: includes/form/class-ur-form-field-country.php:40
1911
  msgid "Andorra"
1912
  msgstr ""
1913
 
1914
+ #: includes/form/class-ur-form-field-country.php:41
1915
  msgid "Angola"
1916
  msgstr ""
1917
 
1918
+ #: includes/form/class-ur-form-field-country.php:42
1919
  msgid "Anguilla"
1920
  msgstr ""
1921
 
1922
+ #: includes/form/class-ur-form-field-country.php:43
1923
  msgid "Antarctica"
1924
  msgstr ""
1925
 
1926
+ #: includes/form/class-ur-form-field-country.php:44
1927
  msgid "Antigua and Barbuda"
1928
  msgstr ""
1929
 
1930
+ #: includes/form/class-ur-form-field-country.php:45
1931
  msgid "Argentina"
1932
  msgstr ""
1933
 
1934
+ #: includes/form/class-ur-form-field-country.php:46
1935
  msgid "Armenia"
1936
  msgstr ""
1937
 
1938
+ #: includes/form/class-ur-form-field-country.php:47
1939
  msgid "Aruba"
1940
  msgstr ""
1941
 
1942
+ #: includes/form/class-ur-form-field-country.php:48
1943
  msgid "Australia"
1944
  msgstr ""
1945
 
1946
+ #: includes/form/class-ur-form-field-country.php:49
1947
  msgid "Austria"
1948
  msgstr ""
1949
 
1950
+ #: includes/form/class-ur-form-field-country.php:50
1951
  msgid "Azerbaijan"
1952
  msgstr ""
1953
 
1954
+ #: includes/form/class-ur-form-field-country.php:51
1955
  msgid "Bahamas"
1956
  msgstr ""
1957
 
1958
+ #: includes/form/class-ur-form-field-country.php:52
1959
  msgid "Bahrain"
1960
  msgstr ""
1961
 
1962
+ #: includes/form/class-ur-form-field-country.php:53
1963
  msgid "Bangladesh"
1964
  msgstr ""
1965
 
1966
+ #: includes/form/class-ur-form-field-country.php:54
1967
  msgid "Barbados"
1968
  msgstr ""
1969
 
1970
+ #: includes/form/class-ur-form-field-country.php:55
1971
  msgid "Belarus"
1972
  msgstr ""
1973
 
1974
+ #: includes/form/class-ur-form-field-country.php:56
1975
  msgid "Belgium"
1976
  msgstr ""
1977
 
1978
+ #: includes/form/class-ur-form-field-country.php:57
1979
  msgid "Belau"
1980
  msgstr ""
1981
 
1982
+ #: includes/form/class-ur-form-field-country.php:58
1983
  msgid "Belize"
1984
  msgstr ""
1985
 
1986
+ #: includes/form/class-ur-form-field-country.php:59
1987
  msgid "Benin"
1988
  msgstr ""
1989
 
1990
+ #: includes/form/class-ur-form-field-country.php:60
1991
  msgid "Bermuda"
1992
  msgstr ""
1993
 
1994
+ #: includes/form/class-ur-form-field-country.php:61
1995
  msgid "Bhutan"
1996
  msgstr ""
1997
 
1998
+ #: includes/form/class-ur-form-field-country.php:62
1999
  msgid "Bolivia"
2000
  msgstr ""
2001
 
2002
+ #: includes/form/class-ur-form-field-country.php:63
2003
  msgid "Bonaire, Saint Eustatius and Saba"
2004
  msgstr ""
2005
 
2006
+ #: includes/form/class-ur-form-field-country.php:64
2007
  msgid "Bosnia and Herzegovina"
2008
  msgstr ""
2009
 
2010
+ #: includes/form/class-ur-form-field-country.php:65
2011
  msgid "Botswana"
2012
  msgstr ""
2013
 
2014
+ #: includes/form/class-ur-form-field-country.php:66
2015
  msgid "Bouvet Island"
2016
  msgstr ""
2017
 
2018
+ #: includes/form/class-ur-form-field-country.php:67
2019
  msgid "Brazil"
2020
  msgstr ""
2021
 
2022
+ #: includes/form/class-ur-form-field-country.php:68
2023
  msgid "British Indian Ocean Territory"
2024
  msgstr ""
2025
 
2026
+ #: includes/form/class-ur-form-field-country.php:69
2027
  msgid "British Virgin Islands"
2028
  msgstr ""
2029
 
2030
+ #: includes/form/class-ur-form-field-country.php:70
2031
  msgid "Brunei"
2032
  msgstr ""
2033
 
2034
+ #: includes/form/class-ur-form-field-country.php:71
2035
  msgid "Bulgaria"
2036
  msgstr ""
2037
 
2038
+ #: includes/form/class-ur-form-field-country.php:72
2039
  msgid "Burkina Faso"
2040
  msgstr ""
2041
 
2042
+ #: includes/form/class-ur-form-field-country.php:73
2043
  msgid "Burundi"
2044
  msgstr ""
2045
 
2046
+ #: includes/form/class-ur-form-field-country.php:74
2047
  msgid "Cambodia"
2048
  msgstr ""
2049
 
2050
+ #: includes/form/class-ur-form-field-country.php:75
2051
  msgid "Cameroon"
2052
  msgstr ""
2053
 
2054
+ #: includes/form/class-ur-form-field-country.php:76
2055
  msgid "Canada"
2056
  msgstr ""
2057
 
2058
+ #: includes/form/class-ur-form-field-country.php:77
2059
  msgid "Cape Verde"
2060
  msgstr ""
2061
 
2062
+ #: includes/form/class-ur-form-field-country.php:78
2063
  msgid "Cayman Islands"
2064
  msgstr ""
2065
 
2066
+ #: includes/form/class-ur-form-field-country.php:79
2067
  msgid "Central African Republic"
2068
  msgstr ""
2069
 
2070
+ #: includes/form/class-ur-form-field-country.php:80
2071
  msgid "Chad"
2072
  msgstr ""
2073
 
2074
+ #: includes/form/class-ur-form-field-country.php:81
2075
  msgid "Chile"
2076
  msgstr ""
2077
 
2078
+ #: includes/form/class-ur-form-field-country.php:82
2079
  msgid "China"
2080
  msgstr ""
2081
 
2082
+ #: includes/form/class-ur-form-field-country.php:83
2083
  msgid "Christmas Island"
2084
  msgstr ""
2085
 
2086
+ #: includes/form/class-ur-form-field-country.php:84
2087
  msgid "Cocos (Keeling) Islands"
2088
  msgstr ""
2089
 
2090
+ #: includes/form/class-ur-form-field-country.php:85
2091
  msgid "Colombia"
2092
  msgstr ""
2093
 
2094
+ #: includes/form/class-ur-form-field-country.php:86
2095
  msgid "Comoros"
2096
  msgstr ""
2097
 
2098
+ #: includes/form/class-ur-form-field-country.php:87
2099
  msgid "Congo (Brazzaville)"
2100
  msgstr ""
2101
 
2102
+ #: includes/form/class-ur-form-field-country.php:88
2103
  msgid "Congo (Kinshasa)"
2104
  msgstr ""
2105
 
2106
+ #: includes/form/class-ur-form-field-country.php:89
2107
  msgid "Cook Islands"
2108
  msgstr ""
2109
 
2110
+ #: includes/form/class-ur-form-field-country.php:90
2111
  msgid "Costa Rica"
2112
  msgstr ""
2113
 
2114
+ #: includes/form/class-ur-form-field-country.php:91
2115
  msgid "Croatia"
2116
  msgstr ""
2117
 
2118
+ #: includes/form/class-ur-form-field-country.php:92
2119
  msgid "Cuba"
2120
  msgstr ""
2121
 
2122
+ #: includes/form/class-ur-form-field-country.php:93
2123
  msgid "Cura&ccedil;ao"
2124
  msgstr ""
2125
 
2126
+ #: includes/form/class-ur-form-field-country.php:94
2127
  msgid "Cyprus"
2128
  msgstr ""
2129
 
2130
+ #: includes/form/class-ur-form-field-country.php:95
2131
  msgid "Czech Republic"
2132
  msgstr ""
2133
 
2134
+ #: includes/form/class-ur-form-field-country.php:96
2135
  msgid "Denmark"
2136
  msgstr ""
2137
 
2138
+ #: includes/form/class-ur-form-field-country.php:97
2139
  msgid "Djibouti"
2140
  msgstr ""
2141
 
2142
+ #: includes/form/class-ur-form-field-country.php:98
2143
  msgid "Dominica"
2144
  msgstr ""
2145
 
2146
+ #: includes/form/class-ur-form-field-country.php:99
2147
  msgid "Dominican Republic"
2148
  msgstr ""
2149
 
2150
+ #: includes/form/class-ur-form-field-country.php:100
2151
  msgid "Ecuador"
2152
  msgstr ""
2153
 
2154
+ #: includes/form/class-ur-form-field-country.php:101
2155
  msgid "Egypt"
2156
  msgstr ""
2157
 
2158
+ #: includes/form/class-ur-form-field-country.php:102
2159
  msgid "El Salvador"
2160
  msgstr ""
2161
 
2162
+ #: includes/form/class-ur-form-field-country.php:103
2163
  msgid "Equatorial Guinea"
2164
  msgstr ""
2165
 
2166
+ #: includes/form/class-ur-form-field-country.php:104
2167
  msgid "Eritrea"
2168
  msgstr ""
2169
 
2170
+ #: includes/form/class-ur-form-field-country.php:105
2171
  msgid "Estonia"
2172
  msgstr ""
2173
 
2174
+ #: includes/form/class-ur-form-field-country.php:106
2175
  msgid "Ethiopia"
2176
  msgstr ""
2177
 
2178
+ #: includes/form/class-ur-form-field-country.php:107
2179
  msgid "Falkland Islands"
2180
  msgstr ""
2181
 
2182
+ #: includes/form/class-ur-form-field-country.php:108
2183
  msgid "Faroe Islands"
2184
  msgstr ""
2185
 
2186
+ #: includes/form/class-ur-form-field-country.php:109
2187
  msgid "Fiji"
2188
  msgstr ""
2189
 
2190
+ #: includes/form/class-ur-form-field-country.php:110
2191
  msgid "Finland"
2192
  msgstr ""
2193
 
2194
+ #: includes/form/class-ur-form-field-country.php:111
2195
  msgid "France"
2196
  msgstr ""
2197
 
2198
+ #: includes/form/class-ur-form-field-country.php:112
2199
  msgid "French Guiana"
2200
  msgstr ""
2201
 
2202
+ #: includes/form/class-ur-form-field-country.php:113
2203
  msgid "French Polynesia"
2204
  msgstr ""
2205
 
2206
+ #: includes/form/class-ur-form-field-country.php:114
2207
  msgid "French Southern Territories"
2208
  msgstr ""
2209
 
2210
+ #: includes/form/class-ur-form-field-country.php:115
2211
  msgid "Gabon"
2212
  msgstr ""
2213
 
2214
+ #: includes/form/class-ur-form-field-country.php:116
2215
  msgid "Gambia"
2216
  msgstr ""
2217
 
2218
+ #: includes/form/class-ur-form-field-country.php:117
2219
  msgid "Georgia"
2220
  msgstr ""
2221
 
2222
+ #: includes/form/class-ur-form-field-country.php:118
2223
  msgid "Germany"
2224
  msgstr ""
2225
 
2226
+ #: includes/form/class-ur-form-field-country.php:119
2227
  msgid "Ghana"
2228
  msgstr ""
2229
 
2230
+ #: includes/form/class-ur-form-field-country.php:120
2231
  msgid "Gibraltar"
2232
  msgstr ""
2233
 
2234
+ #: includes/form/class-ur-form-field-country.php:121
2235
  msgid "Greece"
2236
  msgstr ""
2237
 
2238
+ #: includes/form/class-ur-form-field-country.php:122
2239
  msgid "Greenland"
2240
  msgstr ""
2241
 
2242
+ #: includes/form/class-ur-form-field-country.php:123
2243
  msgid "Grenada"
2244
  msgstr ""
2245
 
2246
+ #: includes/form/class-ur-form-field-country.php:124
2247
  msgid "Guadeloupe"
2248
  msgstr ""
2249
 
2250
+ #: includes/form/class-ur-form-field-country.php:125
2251
  msgid "Guam"
2252
  msgstr ""
2253
 
2254
+ #: includes/form/class-ur-form-field-country.php:126
2255
  msgid "Guatemala"
2256
  msgstr ""
2257
 
2258
+ #: includes/form/class-ur-form-field-country.php:127
2259
  msgid "Guernsey"
2260
  msgstr ""
2261
 
2262
+ #: includes/form/class-ur-form-field-country.php:128
2263
  msgid "Guinea"
2264
  msgstr ""
2265
 
2266
+ #: includes/form/class-ur-form-field-country.php:129
2267
  msgid "Guinea-Bissau"
2268
  msgstr ""
2269
 
2270
+ #: includes/form/class-ur-form-field-country.php:130
2271
  msgid "Guyana"
2272
  msgstr ""
2273
 
2274
+ #: includes/form/class-ur-form-field-country.php:131
2275
  msgid "Haiti"
2276
  msgstr ""
2277
 
2278
+ #: includes/form/class-ur-form-field-country.php:132
2279
  msgid "Heard Island and McDonald Islands"
2280
  msgstr ""
2281
 
2282
+ #: includes/form/class-ur-form-field-country.php:133
2283
  msgid "Honduras"
2284
  msgstr ""
2285
 
2286
+ #: includes/form/class-ur-form-field-country.php:134
2287
  msgid "Hong Kong"
2288
  msgstr ""
2289
 
2290
+ #: includes/form/class-ur-form-field-country.php:135
2291
  msgid "Hungary"
2292
  msgstr ""
2293
 
2294
+ #: includes/form/class-ur-form-field-country.php:136
2295
  msgid "Iceland"
2296
  msgstr ""
2297
 
2298
+ #: includes/form/class-ur-form-field-country.php:137
2299
  msgid "India"
2300
  msgstr ""
2301
 
2302
+ #: includes/form/class-ur-form-field-country.php:138
2303
  msgid "Indonesia"
2304
  msgstr ""
2305
 
2306
+ #: includes/form/class-ur-form-field-country.php:139
2307
  msgid "Iran"
2308
  msgstr ""
2309
 
2310
+ #: includes/form/class-ur-form-field-country.php:140
2311
  msgid "Iraq"
2312
  msgstr ""
2313
 
2314
+ #: includes/form/class-ur-form-field-country.php:141
2315
  msgid "Ireland"
2316
  msgstr ""
2317
 
2318
+ #: includes/form/class-ur-form-field-country.php:142
2319
  msgid "Isle of Man"
2320
  msgstr ""
2321
 
2322
+ #: includes/form/class-ur-form-field-country.php:143
2323
  msgid "Israel"
2324
  msgstr ""
2325
 
2326
+ #: includes/form/class-ur-form-field-country.php:144
2327
  msgid "Italy"
2328
  msgstr ""
2329
 
2330
+ #: includes/form/class-ur-form-field-country.php:145
2331
  msgid "Ivory Coast"
2332
  msgstr ""
2333
 
2334
+ #: includes/form/class-ur-form-field-country.php:146
2335
  msgid "Jamaica"
2336
  msgstr ""
2337
 
2338
+ #: includes/form/class-ur-form-field-country.php:147
2339
  msgid "Japan"
2340
  msgstr ""
2341
 
2342
+ #: includes/form/class-ur-form-field-country.php:148
2343
  msgid "Jersey"
2344
  msgstr ""
2345
 
2346
+ #: includes/form/class-ur-form-field-country.php:149
2347
  msgid "Jordan"
2348
  msgstr ""
2349
 
2350
+ #: includes/form/class-ur-form-field-country.php:150
2351
  msgid "Kazakhstan"
2352
  msgstr ""
2353
 
2354
+ #: includes/form/class-ur-form-field-country.php:151
2355
  msgid "Kenya"
2356
  msgstr ""
2357
 
2358
+ #: includes/form/class-ur-form-field-country.php:152
2359
  msgid "Kiribati"
2360
  msgstr ""
2361
 
2362
+ #: includes/form/class-ur-form-field-country.php:153
2363
  msgid "Kuwait"
2364
  msgstr ""
2365
 
2366
+ #: includes/form/class-ur-form-field-country.php:154
2367
  msgid "Kyrgyzstan"
2368
  msgstr ""
2369
 
2370
+ #: includes/form/class-ur-form-field-country.php:155
2371
  msgid "Laos"
2372
  msgstr ""
2373
 
2374
+ #: includes/form/class-ur-form-field-country.php:156
2375
  msgid "Latvia"
2376
  msgstr ""
2377
 
2378
+ #: includes/form/class-ur-form-field-country.php:157
2379
  msgid "Lebanon"
2380
  msgstr ""
2381
 
2382
+ #: includes/form/class-ur-form-field-country.php:158
2383
  msgid "Lesotho"
2384
  msgstr ""
2385
 
2386
+ #: includes/form/class-ur-form-field-country.php:159
2387
  msgid "Liberia"
2388
  msgstr ""
2389
 
2390
+ #: includes/form/class-ur-form-field-country.php:160
2391
  msgid "Libya"
2392
  msgstr ""
2393
 
2394
+ #: includes/form/class-ur-form-field-country.php:161
2395
  msgid "Liechtenstein"
2396
  msgstr ""
2397
 
2398
+ #: includes/form/class-ur-form-field-country.php:162
2399
  msgid "Lithuania"
2400
  msgstr ""
2401
 
2402
+ #: includes/form/class-ur-form-field-country.php:163
2403
  msgid "Luxembourg"
2404
  msgstr ""
2405
 
2406
+ #: includes/form/class-ur-form-field-country.php:164
2407
  msgid "Macao S.A.R., China"
2408
  msgstr ""
2409
 
2410
+ #: includes/form/class-ur-form-field-country.php:165
2411
  msgid "Macedonia"
2412
  msgstr ""
2413
 
2414
+ #: includes/form/class-ur-form-field-country.php:166
2415
  msgid "Madagascar"
2416
  msgstr ""
2417
 
2418
+ #: includes/form/class-ur-form-field-country.php:167
2419
  msgid "Malawi"
2420
  msgstr ""
2421
 
2422
+ #: includes/form/class-ur-form-field-country.php:168
2423
  msgid "Malaysia"
2424
  msgstr ""
2425
 
2426
+ #: includes/form/class-ur-form-field-country.php:169
2427
  msgid "Maldives"
2428
  msgstr ""
2429
 
2430
+ #: includes/form/class-ur-form-field-country.php:170
2431
  msgid "Mali"
2432
  msgstr ""
2433
 
2434
+ #: includes/form/class-ur-form-field-country.php:171
2435
  msgid "Malta"
2436
  msgstr ""
2437
 
2438
+ #: includes/form/class-ur-form-field-country.php:172
2439
  msgid "Marshall Islands"
2440
  msgstr ""
2441
 
2442
+ #: includes/form/class-ur-form-field-country.php:173
2443
  msgid "Martinique"
2444
  msgstr ""
2445
 
2446
+ #: includes/form/class-ur-form-field-country.php:174
2447
  msgid "Mauritania"
2448
  msgstr ""
2449
 
2450
+ #: includes/form/class-ur-form-field-country.php:175
2451
  msgid "Mauritius"
2452
  msgstr ""
2453
 
2454
+ #: includes/form/class-ur-form-field-country.php:176
2455
  msgid "Mayotte"
2456
  msgstr ""
2457
 
2458
+ #: includes/form/class-ur-form-field-country.php:177
2459
  msgid "Mexico"
2460
  msgstr ""
2461
 
2462
+ #: includes/form/class-ur-form-field-country.php:178
2463
  msgid "Micronesia"
2464
  msgstr ""
2465
 
2466
+ #: includes/form/class-ur-form-field-country.php:179
2467
  msgid "Moldova"
2468
  msgstr ""
2469
 
2470
+ #: includes/form/class-ur-form-field-country.php:180
2471
  msgid "Monaco"
2472
  msgstr ""
2473
 
2474
+ #: includes/form/class-ur-form-field-country.php:181
2475
  msgid "Mongolia"
2476
  msgstr ""
2477
 
2478
+ #: includes/form/class-ur-form-field-country.php:182
2479
  msgid "Montenegro"
2480
  msgstr ""
2481
 
2482
+ #: includes/form/class-ur-form-field-country.php:183
2483
  msgid "Montserrat"
2484
  msgstr ""
2485
 
2486
+ #: includes/form/class-ur-form-field-country.php:184
2487
  msgid "Morocco"
2488
  msgstr ""
2489
 
2490
+ #: includes/form/class-ur-form-field-country.php:185
2491
  msgid "Mozambique"
2492
  msgstr ""
2493
 
2494
+ #: includes/form/class-ur-form-field-country.php:186
2495
  msgid "Myanmar"
2496
  msgstr ""
2497
 
2498
+ #: includes/form/class-ur-form-field-country.php:187
2499
  msgid "Namibia"
2500
  msgstr ""
2501
 
2502
+ #: includes/form/class-ur-form-field-country.php:188
2503
  msgid "Nauru"
2504
  msgstr ""
2505
 
2506
+ #: includes/form/class-ur-form-field-country.php:189
2507
  msgid "Nepal"
2508
  msgstr ""
2509
 
2510
+ #: includes/form/class-ur-form-field-country.php:190
2511
  msgid "Netherlands"
2512
  msgstr ""
2513
 
2514
+ #: includes/form/class-ur-form-field-country.php:191
2515
  msgid "New Caledonia"
2516
  msgstr ""
2517
 
2518
+ #: includes/form/class-ur-form-field-country.php:192
2519
  msgid "New Zealand"
2520
  msgstr ""
2521
 
2522
+ #: includes/form/class-ur-form-field-country.php:193
2523
  msgid "Nicaragua"
2524
  msgstr ""
2525
 
2526
+ #: includes/form/class-ur-form-field-country.php:194
2527
  msgid "Niger"
2528
  msgstr ""
2529
 
2530
+ #: includes/form/class-ur-form-field-country.php:195
2531
  msgid "Nigeria"
2532
  msgstr ""
2533
 
2534
+ #: includes/form/class-ur-form-field-country.php:196
2535
  msgid "Niue"
2536
  msgstr ""
2537
 
2538
+ #: includes/form/class-ur-form-field-country.php:197
2539
  msgid "Norfolk Island"
2540
  msgstr ""
2541
 
2542
+ #: includes/form/class-ur-form-field-country.php:198
2543
  msgid "Northern Mariana Islands"
2544
  msgstr ""
2545
 
2546
+ #: includes/form/class-ur-form-field-country.php:199
2547
  msgid "North Korea"
2548
  msgstr ""
2549
 
2550
+ #: includes/form/class-ur-form-field-country.php:200
2551
  msgid "Norway"
2552
  msgstr ""
2553
 
2554
+ #: includes/form/class-ur-form-field-country.php:201
2555
  msgid "Oman"
2556
  msgstr ""
2557
 
2558
+ #: includes/form/class-ur-form-field-country.php:202
2559
  msgid "Pakistan"
2560
  msgstr ""
2561
 
2562
+ #: includes/form/class-ur-form-field-country.php:203
2563
  msgid "Palestinian Territory"
2564
  msgstr ""
2565
 
2566
+ #: includes/form/class-ur-form-field-country.php:204
2567
  msgid "Panama"
2568
  msgstr ""
2569
 
2570
+ #: includes/form/class-ur-form-field-country.php:205
2571
  msgid "Papua New Guinea"
2572
  msgstr ""
2573
 
2574
+ #: includes/form/class-ur-form-field-country.php:206
2575
  msgid "Paraguay"
2576
  msgstr ""
2577
 
2578
+ #: includes/form/class-ur-form-field-country.php:207
2579
  msgid "Peru"
2580
  msgstr ""
2581
 
2582
+ #: includes/form/class-ur-form-field-country.php:208
2583
  msgid "Philippines"
2584
  msgstr ""
2585
 
2586
+ #: includes/form/class-ur-form-field-country.php:209
2587
  msgid "Pitcairn"
2588
  msgstr ""
2589
 
2590
+ #: includes/form/class-ur-form-field-country.php:210
2591
  msgid "Poland"
2592
  msgstr ""
2593
 
2594
+ #: includes/form/class-ur-form-field-country.php:211
2595
  msgid "Portugal"
2596
  msgstr ""
2597
 
2598
+ #: includes/form/class-ur-form-field-country.php:212
2599
  msgid "Puerto Rico"
2600
  msgstr ""
2601
 
2602
+ #: includes/form/class-ur-form-field-country.php:213
2603
  msgid "Qatar"
2604
  msgstr ""
2605
 
2606
+ #: includes/form/class-ur-form-field-country.php:214
2607
  msgid "Reunion"
2608
  msgstr ""
2609
 
2610
+ #: includes/form/class-ur-form-field-country.php:215
2611
  msgid "Romania"
2612
  msgstr ""
2613
 
2614
+ #: includes/form/class-ur-form-field-country.php:216
2615
  msgid "Russia"
2616
  msgstr ""
2617
 
2618
+ #: includes/form/class-ur-form-field-country.php:217
2619
  msgid "Rwanda"
2620
  msgstr ""
2621
 
2622
+ #: includes/form/class-ur-form-field-country.php:218
2623
  msgid "Saint Barth&eacute;lemy"
2624
  msgstr ""
2625
 
2626
+ #: includes/form/class-ur-form-field-country.php:219
2627
  msgid "Saint Helena"
2628
  msgstr ""
2629
 
2630
+ #: includes/form/class-ur-form-field-country.php:220
2631
  msgid "Saint Kitts and Nevis"
2632
  msgstr ""
2633
 
2634
+ #: includes/form/class-ur-form-field-country.php:221
2635
  msgid "Saint Lucia"
2636
  msgstr ""
2637
 
2638
+ #: includes/form/class-ur-form-field-country.php:222
2639
  msgid "Saint Martin (French part)"
2640
  msgstr ""
2641
 
2642
+ #: includes/form/class-ur-form-field-country.php:223
2643
  msgid "Saint Martin (Dutch part)"
2644
  msgstr ""
2645
 
2646
+ #: includes/form/class-ur-form-field-country.php:224
2647
  msgid "Saint Pierre and Miquelon"
2648
  msgstr ""
2649
 
2650
+ #: includes/form/class-ur-form-field-country.php:225
2651
  msgid "Saint Vincent and the Grenadines"
2652
  msgstr ""
2653
 
2654
+ #: includes/form/class-ur-form-field-country.php:226
2655
  msgid "San Marino"
2656
  msgstr ""
2657
 
2658
+ #: includes/form/class-ur-form-field-country.php:227
2659
  msgid "S&atilde;o Tom&eacute; and Pr&iacute;ncipe"
2660
  msgstr ""
2661
 
2662
+ #: includes/form/class-ur-form-field-country.php:228
2663
  msgid "Saudi Arabia"
2664
  msgstr ""
2665
 
2666
+ #: includes/form/class-ur-form-field-country.php:229
2667
  msgid "Senegal"
2668
  msgstr ""
2669
 
2670
+ #: includes/form/class-ur-form-field-country.php:230
2671
  msgid "Serbia"
2672
  msgstr ""
2673
 
2674
+ #: includes/form/class-ur-form-field-country.php:231
2675
  msgid "Seychelles"
2676
  msgstr ""
2677
 
2678
+ #: includes/form/class-ur-form-field-country.php:232
2679
  msgid "Sierra Leone"
2680
  msgstr ""
2681
 
2682
+ #: includes/form/class-ur-form-field-country.php:233
2683
  msgid "Singapore"
2684
  msgstr ""
2685
 
2686
+ #: includes/form/class-ur-form-field-country.php:234
2687
  msgid "Slovakia"
2688
  msgstr ""
2689
 
2690
+ #: includes/form/class-ur-form-field-country.php:235
2691
  msgid "Slovenia"
2692
  msgstr ""
2693
 
2694
+ #: includes/form/class-ur-form-field-country.php:236
2695
  msgid "Solomon Islands"
2696
  msgstr ""
2697
 
2698
+ #: includes/form/class-ur-form-field-country.php:237
2699
  msgid "Somalia"
2700
  msgstr ""
2701
 
2702
+ #: includes/form/class-ur-form-field-country.php:238
2703
  msgid "South Africa"
2704
  msgstr ""
2705
 
2706
+ #: includes/form/class-ur-form-field-country.php:239
2707
  msgid "South Georgia/Sandwich Islands"
2708
  msgstr ""
2709
 
2710
+ #: includes/form/class-ur-form-field-country.php:240
2711
  msgid "South Korea"
2712
  msgstr ""
2713
 
2714
+ #: includes/form/class-ur-form-field-country.php:241
2715
  msgid "South Sudan"
2716
  msgstr ""
2717
 
2718
+ #: includes/form/class-ur-form-field-country.php:242
2719
  msgid "Spain"
2720
  msgstr ""
2721
 
2722
+ #: includes/form/class-ur-form-field-country.php:243
2723
  msgid "Sri Lanka"
2724
  msgstr ""
2725
 
2726
+ #: includes/form/class-ur-form-field-country.php:244
2727
  msgid "Sudan"
2728
  msgstr ""
2729
 
2730
+ #: includes/form/class-ur-form-field-country.php:245
2731
  msgid "Suriname"
2732
  msgstr ""
2733
 
2734
+ #: includes/form/class-ur-form-field-country.php:246
2735
  msgid "Svalbard and Jan Mayen"
2736
  msgstr ""
2737
 
2738
+ #: includes/form/class-ur-form-field-country.php:247
2739
  msgid "Swaziland"
2740
  msgstr ""
2741
 
2742
+ #: includes/form/class-ur-form-field-country.php:248
2743
  msgid "Sweden"
2744
  msgstr ""
2745
 
2746
+ #: includes/form/class-ur-form-field-country.php:249
2747
  msgid "Switzerland"
2748
  msgstr ""
2749
 
2750
+ #: includes/form/class-ur-form-field-country.php:250
2751
  msgid "Syria"
2752
  msgstr ""
2753
 
2754
+ #: includes/form/class-ur-form-field-country.php:251
2755
  msgid "Taiwan"
2756
  msgstr ""
2757
 
2758
+ #: includes/form/class-ur-form-field-country.php:252
2759
  msgid "Tajikistan"
2760
  msgstr ""
2761
 
2762
+ #: includes/form/class-ur-form-field-country.php:253
2763
  msgid "Tanzania"
2764
  msgstr ""
2765
 
2766
+ #: includes/form/class-ur-form-field-country.php:254
2767
  msgid "Thailand"
2768
  msgstr ""
2769
 
2770
+ #: includes/form/class-ur-form-field-country.php:255
2771
  msgid "Timor-Leste"
2772
  msgstr ""
2773
 
2774
+ #: includes/form/class-ur-form-field-country.php:256
2775
  msgid "Togo"
2776
  msgstr ""
2777
 
2778
+ #: includes/form/class-ur-form-field-country.php:257
2779
  msgid "Tokelau"
2780
  msgstr ""
2781
 
2782
+ #: includes/form/class-ur-form-field-country.php:258
2783
  msgid "Tonga"
2784
  msgstr ""
2785
 
2786
+ #: includes/form/class-ur-form-field-country.php:259
2787
  msgid "Trinidad and Tobago"
2788
  msgstr ""
2789
 
2790
+ #: includes/form/class-ur-form-field-country.php:260
2791
  msgid "Tunisia"
2792
  msgstr ""
2793
 
2794
+ #: includes/form/class-ur-form-field-country.php:261
2795
  msgid "Turkey"
2796
  msgstr ""
2797
 
2798
+ #: includes/form/class-ur-form-field-country.php:262
2799
  msgid "Turkmenistan"
2800
  msgstr ""
2801
 
2802
+ #: includes/form/class-ur-form-field-country.php:263
2803
  msgid "Turks and Caicos Islands"
2804
  msgstr ""
2805
 
2806
+ #: includes/form/class-ur-form-field-country.php:264
2807
  msgid "Tuvalu"
2808
  msgstr ""
2809
 
2810
+ #: includes/form/class-ur-form-field-country.php:265
2811
  msgid "Uganda"
2812
  msgstr ""
2813
 
2814
+ #: includes/form/class-ur-form-field-country.php:266
2815
  msgid "Ukraine"
2816
  msgstr ""
2817
 
2818
+ #: includes/form/class-ur-form-field-country.php:267
2819
  msgid "United Arab Emirates"
2820
  msgstr ""
2821
 
2822
+ #: includes/form/class-ur-form-field-country.php:268
2823
  msgid "United Kingdom (UK)"
2824
  msgstr ""
2825
 
2826
+ #: includes/form/class-ur-form-field-country.php:269
2827
  msgid "United States (US)"
2828
  msgstr ""
2829
 
2830
+ #: includes/form/class-ur-form-field-country.php:270
2831
  msgid "United States (US) Minor Outlying Islands"
2832
  msgstr ""
2833
 
2834
+ #: includes/form/class-ur-form-field-country.php:271
2835
  msgid "United States (US) Virgin Islands"
2836
  msgstr ""
2837
 
2838
+ #: includes/form/class-ur-form-field-country.php:272
2839
  msgid "Uruguay"
2840
  msgstr ""
2841
 
2842
+ #: includes/form/class-ur-form-field-country.php:273
2843
  msgid "Uzbekistan"
2844
  msgstr ""
2845
 
2846
+ #: includes/form/class-ur-form-field-country.php:274
2847
  msgid "Vanuatu"
2848
  msgstr ""
2849
 
2850
+ #: includes/form/class-ur-form-field-country.php:275
2851
  msgid "Vatican"
2852
  msgstr ""
2853
 
2854
+ #: includes/form/class-ur-form-field-country.php:276
2855
  msgid "Venezuela"
2856
  msgstr ""
2857
 
2858
+ #: includes/form/class-ur-form-field-country.php:277
2859
  msgid "Vietnam"
2860
  msgstr ""
2861
 
2862
+ #: includes/form/class-ur-form-field-country.php:278
2863
  msgid "Wallis and Futuna"
2864
  msgstr ""
2865
 
2866
+ #: includes/form/class-ur-form-field-country.php:279
2867
  msgid "Western Sahara"
2868
  msgstr ""
2869
 
2870
+ #: includes/form/class-ur-form-field-country.php:280
2871
  msgid "Samoa"
2872
  msgstr ""
2873
 
2874
+ #: includes/form/class-ur-form-field-country.php:281
2875
  msgid "Yemen"
2876
  msgstr ""
2877
 
2878
+ #: includes/form/class-ur-form-field-country.php:282
2879
  msgid "Zambia"
2880
  msgstr ""
2881
 
2882
+ #: includes/form/class-ur-form-field-country.php:283
2883
  msgid "Zimbabwe"
2884
  msgstr ""
2885
 
2886
+ #: includes/form/class-ur-form-field-country.php:293
2887
+ #: includes/form/class-ur-form-field-country.php:298
2888
  msgid "Country"
2889
  msgstr ""
2890
 
2961
  msgid "User Email"
2962
  msgstr ""
2963
 
2964
+ #: includes/form/class-ur-form-field-user-email.php:59
2965
  msgid "Invalid email address."
2966
  msgstr ""
2967
 
2968
+ #: includes/form/class-ur-form-field-user-email.php:68
2969
  msgid "Email already exists."
2970
  msgstr ""
2971
 
2974
  msgid "Username"
2975
  msgstr ""
2976
 
2977
+ #: includes/form/class-ur-form-field-user-login.php:57
2978
  msgid "Username already exists."
2979
  msgstr ""
2980
 
2981
+ #: includes/form/class-ur-form-field-user-login.php:68
2982
  msgid "Invalid username ! "
2983
  msgstr ""
2984
 
2990
  msgid "User Password"
2991
  msgstr ""
2992
 
2993
+ #: includes/form/class-ur-form-field-user-pass.php:57
2994
  msgid "Empty password."
2995
  msgstr ""
2996
 
2999
  msgid "Website"
3000
  msgstr ""
3001
 
3002
+ #: includes/form/settings/class-ur-setting-checkbox.php:35
3003
+ #: includes/form/settings/class-ur-setting-checkbox.php:42
3004
+ #: includes/form/settings/class-ur-setting-country.php:34
3005
+ #: includes/form/settings/class-ur-setting-country.php:41
3006
+ #: includes/form/settings/class-ur-setting-email.php:31
3007
+ #: includes/form/settings/class-ur-setting-email.php:38
3008
+ #: includes/form/settings/class-ur-setting-radio.php:29
3009
+ #: includes/form/settings/class-ur-setting-radio.php:36
3010
+ #: includes/form/settings/class-ur-setting-select.php:32
3011
+ #: includes/form/settings/class-ur-setting-select.php:39
3012
+ #: includes/form/settings/class-ur-setting-text.php:53
3013
+ #: includes/form/settings/class-ur-setting-text.php:60
3014
+ #: includes/form/settings/class-ur-setting-textarea.php:44
3015
+ #: includes/form/settings/class-ur-setting-textarea.php:51
3016
  msgid "Custom Class"
3017
  msgstr ""
3018
 
3019
+ #: includes/form/settings/class-ur-setting-checkbox.php:46
3020
  msgid "Choices"
3021
  msgstr ""
3022
 
3023
+ #: includes/form/settings/class-ur-setting-checkbox.php:53
3024
  msgid ""
3025
  "Please input your text here to create the checkbox list like:\n"
3026
  "Checkbox 1,\n"
3028
  "Checkbox 3"
3029
  msgstr ""
3030
 
3031
+ #: includes/form/settings/class-ur-setting-password.php:31
3032
+ #: includes/form/settings/class-ur-setting-password.php:38
3033
  msgid "Password Size"
3034
  msgstr ""
3035
 
3036
+ #: includes/form/settings/class-ur-setting-radio.php:40
3037
+ #: includes/form/settings/class-ur-setting-select.php:43
3038
  msgid "Options "
3039
  msgstr ""
3040
 
3041
+ #: includes/form/settings/class-ur-setting-radio.php:47
3042
  msgid ""
3043
  "Please input your text here to create the radio choices list like:\n"
3044
  "Option 1,\n"
3046
  "Option 3"
3047
  msgstr ""
3048
 
3049
+ #: includes/form/settings/class-ur-setting-select.php:50
3050
  msgid ""
3051
  "Please input your text here to create the dropdown list like:\n"
3052
  "Option 1,\n"
3054
  "Option 3"
3055
  msgstr ""
3056
 
3057
+ #: includes/form/settings/class-ur-setting-text.php:31
3058
+ #: includes/form/settings/class-ur-setting-text.php:38
3059
  msgid "Size"
3060
  msgstr ""
3061
 
3062
+ #: includes/form/settings/class-ur-setting-text.php:42
3063
+ #: includes/form/settings/class-ur-setting-text.php:49
3064
+ #: includes/form/settings/class-ur-setting-textarea.php:33
3065
+ #: includes/form/settings/class-ur-setting-textarea.php:40
3066
  msgid "Default Value"
3067
  msgstr ""
3068
 
3069
+ #: includes/frontend/class-ur-frontend-form-handler.php:99
3070
  msgid "Something went wrong! please try again"
3071
  msgstr ""
3072
 
3073
+ #: includes/frontend/class-ur-frontend-form-handler.php:163
3074
  msgid "Duplicate field key in form, please contact site administrator."
3075
  msgstr ""
3076
 
3077
+ #: includes/frontend/class-ur-frontend-form-handler.php:169
3078
  msgid "Required form field not found."
3079
  msgstr ""
3080
 
3081
+ #: includes/frontend/class-ur-frontend-form-handler.php:327
3082
  msgid "Empty confirm password"
3083
  msgstr ""
3084
 
3085
+ #: includes/frontend/class-ur-frontend-form-handler.php:329
3086
  msgid "Password and confirm password not matched"
3087
  msgstr ""
3088
 
3089
  #: includes/functions-ur-account.php:32
3090
+ msgid "The password you entered for username %1$1s is incorrect. %2$2s"
3091
  msgstr ""
3092
 
3093
  #: includes/functions-ur-account.php:32 includes/functions-ur-account.php:35
3102
  msgid "Dashboard"
3103
  msgstr ""
3104
 
3105
+ #: includes/functions-ur-core.php:562 includes/functions-ur-core.php:564
3106
  msgid "Label"
3107
  msgstr ""
3108
 
3109
+ #: includes/functions-ur-core.php:569 includes/functions-ur-core.php:571
3110
  msgid "Description"
3111
  msgstr ""
3112
 
3113
+ #: includes/functions-ur-core.php:576 includes/functions-ur-core.php:578
3114
  msgid "Field Name"
3115
  msgstr ""
3116
 
3117
+ #: includes/functions-ur-core.php:584 includes/functions-ur-core.php:586
3118
  msgid "Placeholder"
3119
  msgstr ""
3120
 
3121
+ #: includes/functions-ur-core.php:596 includes/functions-ur-core.php:607
3122
+ #: includes/functions-ur-core.php:734 includes/functions-ur-core.php:777
3123
  msgid "No"
3124
  msgstr ""
3125
 
3126
+ #: includes/functions-ur-core.php:597 includes/functions-ur-core.php:608
3127
+ #: includes/functions-ur-core.php:733 includes/functions-ur-core.php:776
3128
  msgid "Yes"
3129
  msgstr ""
3130
 
3131
+ #: includes/functions-ur-core.php:602
3132
  msgid "Hide Label"
3133
  msgstr ""
3134
 
3135
+ #: includes/functions-ur-core.php:714
3136
  msgid "Default User Role"
3137
  msgstr ""
3138
 
3139
+ #: includes/functions-ur-core.php:726
3140
  msgid "Enable Strong Password"
3141
  msgstr ""
3142
 
3143
+ #: includes/functions-ur-core.php:741
3144
  msgid "Minimum Password Strength"
3145
  msgstr ""
3146
 
3147
+ #: includes/functions-ur-core.php:758
3148
  msgid "Form Submit Button Label"
3149
  msgstr ""
3150
 
3151
+ #: includes/functions-ur-core.php:769
3152
  msgid "Enable %1$s %2$s reCaptcha %3$s Support"
3153
  msgstr ""
3154
 
3155
+ #: includes/functions-ur-core.php:802
3156
  msgid "Custom CSS class"
3157
  msgstr ""
3158
 
3159
+ #: includes/functions-ur-core.php:831
3160
  msgid "Auto login after registration"
3161
  msgstr ""
3162
 
3163
+ #: includes/functions-ur-core.php:1013
3164
  msgid ""
3165
  "The class <code>%s</code> provided by user_registration_logging_class "
3166
  "filter must implement <code>UR_Logger_Interface</code>."
3167
  msgstr ""
3168
 
3169
+ #: includes/functions-ur-core.php:1114
3170
  msgid "Disable emails"
3171
  msgstr ""
3172
 
3173
+ #: includes/functions-ur-core.php:1115
3174
  msgid "Disable all emails sent after registration."
3175
  msgstr ""
3176
 
3177
  #: includes/functions-ur-notice.php:29 includes/functions-ur-notice.php:61
3178
  #: includes/functions-ur-notice.php:81 includes/functions-ur-notice.php:107
3179
  #: includes/functions-ur-notice.php:121 includes/functions-ur-notice.php:135
3180
+ #: includes/functions-ur-notice.php:190
3181
  msgid "This function should not be called before user_registration_init."
3182
  msgstr ""
3183
 
3184
+ #: includes/functions-ur-template.php:182
3185
  msgid "required"
3186
  msgstr ""
3187
 
3190
  msgid "Choose an option"
3191
  msgstr ""
3192
 
3193
+ #: includes/libraries/wp-background-process.php:430
3194
  msgid "Every %d minutes"
3195
  msgstr ""
3196
 
3198
  msgid "This method should not be called before plugins_loaded."
3199
  msgstr ""
3200
 
3201
+ #: includes/shortcodes/class-ur-shortcode-login.php:63
3202
  msgid "You are already logged in. <a href=\"%s\">Log out?</a>"
3203
  msgstr ""
3204
 
3206
  msgid "Your password has been reset successfully."
3207
  msgstr ""
3208
 
3209
+ #: includes/shortcodes/class-ur-shortcode-my-account.php:90
3210
  msgid "Are you sure you want to log out? <a href=\"%s\">Confirm and log out</a>"
3211
  msgstr ""
3212
 
3213
+ #: includes/shortcodes/class-ur-shortcode-my-account.php:235
3214
  msgid "Enter a username or email address."
3215
  msgstr ""
3216
 
3217
+ #: includes/shortcodes/class-ur-shortcode-my-account.php:256
3218
+ #: includes/shortcodes/class-ur-shortcode-my-account.php:261
3219
  msgid "Invalid username or email."
3220
  msgstr ""
3221
 
3222
+ #: includes/shortcodes/class-ur-shortcode-my-account.php:271
3223
  msgid "Password reset is not allowed for this user"
3224
  msgstr ""
3225
 
3226
+ #: includes/shortcodes/class-ur-shortcode-my-account.php:284
3227
  msgid "The email could not be sent. Contact your site administrator. "
3228
  msgstr ""
3229
 
3230
+ #: templates/myaccount/dashboard.php:30
3231
  #. translators: 1: user display name 2: logout url
3232
  msgid "Hello %1$s (not %1$s? <a href=\"%2$s\">Sign out</a>)"
3233
  msgstr ""
3234
 
3235
+ #: templates/myaccount/dashboard.php:42
3236
  #. translators: 1 profile details url, 2: change password url
3237
  msgid ""
3238
  "From your account dashboard you can edit your <a href=\"%1$s\"> profile "
3338
  msgid "https://wpeverest.com"
3339
  msgstr ""
3340
 
3341
+ #: includes/admin/class-ur-admin-assets.php:137
3342
  msgctxt "enhanced select"
3343
  msgid "No matches found"
3344
  msgstr ""
3345
 
3346
+ #: includes/admin/class-ur-admin-assets.php:138
3347
  msgctxt "enhanced select"
3348
  msgid "Loading failed"
3349
  msgstr ""
3350
 
3351
+ #: includes/admin/class-ur-admin-assets.php:139
3352
  msgctxt "enhanced select"
3353
  msgid "Please enter 1 or more characters"
3354
  msgstr ""
3355
 
3356
+ #: includes/admin/class-ur-admin-assets.php:140
3357
  msgctxt "enhanced select"
3358
  msgid "Please enter %qty% or more characters"
3359
  msgstr ""
3360
 
3361
+ #: includes/admin/class-ur-admin-assets.php:141
3362
  msgctxt "enhanced select"
3363
  msgid "Please delete 1 character"
3364
  msgstr ""
3365
 
3366
+ #: includes/admin/class-ur-admin-assets.php:142
3367
  msgctxt "enhanced select"
3368
  msgid "Please delete %qty% characters"
3369
  msgstr ""
3370
 
3371
+ #: includes/admin/class-ur-admin-assets.php:143
3372
  msgctxt "enhanced select"
3373
  msgid "You can only select 1 item"
3374
  msgstr ""
3375
 
3376
+ #: includes/admin/class-ur-admin-assets.php:144
3377
  msgctxt "enhanced select"
3378
  msgid "You can only select %qty% items"
3379
  msgstr ""
3380
 
3381
+ #: includes/admin/class-ur-admin-assets.php:145
3382
  msgctxt "enhanced select"
3383
  msgid "Loading more results&hellip;"
3384
  msgstr ""
3385
 
3386
+ #: includes/admin/class-ur-admin-assets.php:146
3387
  msgctxt "enhanced select"
3388
  msgid "Searching&hellip;"
3389
  msgstr ""
3390
 
3391
+ #: includes/admin/class-ur-admin-assets.php:251
3392
  msgctxt "user-registration admin"
3393
  msgid "User Email"
3394
  msgstr ""
3395
 
3396
+ #: includes/admin/class-ur-admin-assets.php:252
3397
  msgctxt "user-registration admin"
3398
  msgid "User Password"
3399
  msgstr ""
3400
 
3401
+ #: includes/admin/class-ur-admin-assets.php:253
3402
  msgctxt "user registration admin"
3403
  msgid "Are you sure want to delete?"
3404
  msgstr ""
3405
 
3406
+ #: includes/admin/class-ur-admin-assets.php:254
3407
  msgctxt "user registration admin"
3408
  msgid "At least one row needs to be selected."
3409
  msgstr ""
3410
 
3411
+ #: includes/admin/class-ur-admin-assets.php:255
3412
  msgctxt "user registration admin"
3413
  msgid "This field is one time draggable."
3414
  msgstr ""
3415
 
3416
+ #: includes/admin/class-ur-admin-assets.php:256
3417
  msgctxt "user registration admin"
3418
  msgid "Could not clone this field."
3419
  msgstr ""
3420
 
3421
+ #: includes/admin/class-ur-admin-assets.php:257
3422
  msgctxt "user registration admin"
3423
  msgid "Form successfully saved."
3424
  msgstr ""
3425
 
3426
+ #: includes/admin/class-ur-admin-assets.php:258
3427
  msgctxt "user registration admin"
3428
  msgid "Success"
3429
  msgstr ""
3430
 
3431
+ #: includes/admin/class-ur-admin-assets.php:259
3432
  msgctxt "user registration admin"
3433
  msgid "Error"
3434
  msgstr ""
3435
 
3436
+ #: includes/admin/class-ur-admin-assets.php:260
3437
  msgctxt "user registration admin"
3438
  msgid "At least one field needs to be selected."
3439
  msgstr ""
3440
 
3441
+ #: includes/admin/class-ur-admin-assets.php:261
3442
  msgctxt "user registration admin"
3443
  msgid "Empty form name."
3444
  msgstr ""
3445
 
3446
+ #: includes/admin/class-ur-admin-assets.php:262
3447
  msgctxt "user registration admin"
3448
  msgid "Previous save action on going."
3449
  msgstr ""
3450
 
3451
+ #: includes/admin/class-ur-admin-assets.php:263
3452
  msgctxt "user registration admin"
3453
  msgid "Duplicate field name."
3454
  msgstr ""
3455
 
3456
+ #: includes/admin/class-ur-admin-assets.php:264
3457
  msgctxt "user registration admin"
3458
  msgid "Empty field label."
3459
  msgstr ""
3460
 
3461
+ #: includes/admin/class-ur-admin-assets.php:265
3462
  msgctxt "user registration admin"
3463
  msgid ""
3464
  "Invalid field name. Please do not use space, empty or special character, "
3465
  "you can use underscore."
3466
  msgstr ""
3467
 
3468
+ #: includes/admin/class-ur-admin-assets.php:266
3469
  msgctxt "user registration admin"
3470
  msgid "Multiple field key "
3471
  msgstr ""
3472
 
3473
+ #: includes/admin/class-ur-admin-assets.php:267
3474
  msgctxt "user registration admin"
3475
  msgid "field is required."
3476
  msgstr ""
3477
 
3478
+ #: includes/admin/class-ur-admin-assets.php:268
3479
  msgctxt "user registration admin"
3480
  msgid "Drag your first form item here."
3481
  msgstr ""
3482
 
3483
+ #: includes/admin/class-ur-admin-registrations-table-list.php:269
3484
  #. translators: %s: count
3485
  msgctxt "posts"
3486
  msgid "All <span class=\"count\">(%s)</span>"
3488
  msgstr[0] ""
3489
  msgstr[1] ""
3490
 
3491
+ #: includes/admin/class-ur-admin-user-list-manager.php:84
3492
  msgctxt "The action on users list page"
3493
  msgid "Approve"
3494
  msgstr ""
3495
 
3496
+ #: includes/admin/class-ur-admin-user-list-manager.php:85
3497
  msgctxt "The action on users list page"
3498
  msgid "Deny"
3499
  msgstr ""
3500
 
3501
+ #: includes/class-ur-email-confirmation.php:68
3502
  msgctxt "The action on users list page"
3503
  msgid "Verify"
3504
  msgstr ""
3505
 
3506
+ #: includes/class-ur-email-confirmation.php:69
3507
  msgctxt "The action on users list page"
3508
  msgid "Unverify"
3509
  msgstr ""
3510
 
3511
+ #: includes/class-ur-install.php:280
3512
  msgctxt "Page slug"
3513
  msgid "my-account"
3514
  msgstr ""
3515
 
3516
+ #: includes/class-ur-install.php:289
3517
  msgctxt "Page slug"
3518
  msgid "registration"
3519
  msgstr ""
3520
 
3521
+ #: includes/class-ur-install.php:281
3522
  msgctxt "Page title"
3523
  msgid "My Account"
3524
  msgstr ""
3525
 
3526
+ #: includes/class-ur-install.php:290
3527
  msgctxt "Page title"
3528
  msgid "Registration"
3529
  msgstr ""
3530
 
3531
+ #: includes/class-ur-post-types.php:50
3532
  msgctxt "Admin menu name"
3533
  msgid "Registrations"
3534
  msgstr ""
package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "user-registration",
3
- "version": "1.5.5",
4
  "lockfileVersion": 1,
5
  "requires": true,
6
  "dependencies": {
1
  {
2
  "name": "user-registration",
3
+ "version": "1.5.6",
4
  "lockfileVersion": 1,
5
  "requires": true,
6
  "dependencies": {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: user registration, registration, user profile, registration form, login fo
4
  Requires at least: 4.0
5
  Requires PHP: 5.3
6
  Tested up to: 5.0
7
- Stable tag: 1.5.5
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -111,6 +111,10 @@ Yes, the plugin is designed to work with any themes that have been coded followi
111
 
112
  == Changelog ==
113
 
 
 
 
 
114
  = 1.5.5 - 08/01/2018 =
115
  * Feature - Google reCaptcha v3 support
116
  * Fix - Data display for input fields on users profile
@@ -125,7 +129,6 @@ Yes, the plugin is designed to work with any themes that have been coded followi
125
  * Dev - Filter to override user role
126
  * Dev - Filter to update settings on settings page
127
 
128
-
129
  = 1.5.3 - 10/12/2018 =
130
  * Tweak - Conditionally load flatpickr if only form has date field.
131
  * Fix - Enqueque CSS on block editor
4
  Requires at least: 4.0
5
  Requires PHP: 5.3
6
  Tested up to: 5.0
7
+ Stable tag: 1.5.6
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
111
 
112
  == Changelog ==
113
 
114
+ = 1.5.6 - 11/01/2018 =
115
+ * Fix - Authenticated XSS. Thanks wpvulndb.com for nofifying.
116
+ * Fix - Smart tag bug on resend confirmation email
117
+
118
  = 1.5.5 - 08/01/2018 =
119
  * Feature - Google reCaptcha v3 support
120
  * Fix - Data display for input fields on users profile
129
  * Dev - Filter to override user role
130
  * Dev - Filter to update settings on settings page
131
 
 
132
  = 1.5.3 - 10/12/2018 =
133
  * Tweak - Conditionally load flatpickr if only form has date field.
134
  * Fix - Enqueque CSS on block editor
templates/form-registration.php CHANGED
@@ -28,9 +28,9 @@ if ( ! defined( 'ABSPATH' ) ) {
28
  exit; // Exit if accessed directly
29
  }
30
 
31
- $frontend = UR_Frontend::instance();
32
- $form_template = ur_get_form_setting_by_key( $form_id, 'user_registration_form_template', 'Default' );
33
- $custom_class = ur_get_form_setting_by_key( $form_id, 'user_registration_form_custom_class', '' );
34
  $template_class = '';
35
 
36
  if ( 'Bordered' === $form_template ) {
@@ -39,10 +39,10 @@ if ( 'Bordered' === $form_template ) {
39
  } elseif ( 'Flat' === $form_template ) {
40
  $template_class = 'ur-frontend-form--flat';
41
 
42
- } elseif( 'Rounded' === $form_template ) {
43
  $template_class = 'ur-frontend-form--rounded';
44
 
45
- } elseif( 'Rounded Edge' === $form_template ) {
46
  $template_class = 'ur-frontend-form--rounded ur-frontend-form--rounded-edge';
47
  }
48
 
@@ -54,64 +54,64 @@ $custom_class = apply_filters( 'user_registration_form_custom_class', $custom_cl
54
  do_action( 'user_registration_before_registration_form' );
55
 
56
  ?>
57
- <div class='ur-frontend-form <?php echo $template_class .' '. $custom_class; ?>' id='ur-frontend-form'>
58
  <form method='post' class='register'
59
- data-enable-strength-password="<?php echo $enable_strong_password ?>" data-minimum-password-strength="<?php echo $minimum_password_strength;?>" <?php echo apply_filters( 'user_registration_form_params', '' ) ?>>
60
 
61
  <?php
62
- foreach ( $form_data_array as $data ) {
63
- ?>
64
  <div class='ur-form-row'>
65
- <?php
66
- $width = floor( 100 / count( $data ) ) - count( $data );
67
 
68
- foreach ( $data as $grid_key => $grid_data ) {
69
- ?>
70
  <div class="ur-form-grid ur-grid-<?php echo( $grid_key + 1 ); ?>"
71
- style="width:<?php echo $width; ?>%">
72
- <?php
73
- foreach ( $grid_data as $grid_data_key => $single_item ) {
74
 
75
- if ( isset( $single_item->field_key ) ) {
76
- ?>
77
  <div class="ur-field-item field-<?php echo $single_item->field_key; ?>">
78
- <?php
79
- $frontend->user_registration_frontend_form( $single_item, $form_id );
80
- $is_field_exists = true;
81
- ?>
82
  </div>
83
- <?php
84
- }
85
- }
86
- ?>
87
  </div>
88
  <?php
89
- }
90
- ?>
91
  </div>
92
  <?php
93
- }
94
 
95
- if ( $is_field_exists ) {
 
 
 
 
 
96
  ?>
97
- <?php
98
- if( ! empty( $recaptcha_node ) ) {
99
- echo '<div id="ur-recaptcha-node" style="width:100px;max-width: 100px;"> '. $recaptcha_node .'</div>';
100
- }
101
- ?>
102
  <button type="submit" class="btn button ur-submit-button">
103
  <span></span>
104
- <?php echo __( ur_get_form_setting_by_key( $form_id, 'user_registration_form_setting_form_submit_label' ), 'user-registration' ); ?>
105
  </button>
106
 
107
  <?php
108
- }
109
 
110
- if ( count( $form_data_array ) == 0 ) {
111
- ?>
112
  <h2><?php echo __( 'Form not found, form id :' . $form_id, 'user-registration' ); ?></h2>
113
  <?php
114
- }
115
  ?>
116
 
117
  <div style="clear:both"></div>
28
  exit; // Exit if accessed directly
29
  }
30
 
31
+ $frontend = UR_Frontend::instance();
32
+ $form_template = ur_get_form_setting_by_key( $form_id, 'user_registration_form_template', 'Default' );
33
+ $custom_class = ur_get_form_setting_by_key( $form_id, 'user_registration_form_custom_class', '' );
34
  $template_class = '';
35
 
36
  if ( 'Bordered' === $form_template ) {
39
  } elseif ( 'Flat' === $form_template ) {
40
  $template_class = 'ur-frontend-form--flat';
41
 
42
+ } elseif ( 'Rounded' === $form_template ) {
43
  $template_class = 'ur-frontend-form--rounded';
44
 
45
+ } elseif ( 'Rounded Edge' === $form_template ) {
46
  $template_class = 'ur-frontend-form--rounded ur-frontend-form--rounded-edge';
47
  }
48
 
54
  do_action( 'user_registration_before_registration_form' );
55
 
56
  ?>
57
+ <div class='ur-frontend-form <?php echo $template_class . ' ' . $custom_class; ?>' id='ur-frontend-form'>
58
  <form method='post' class='register'
59
+ data-enable-strength-password="<?php echo $enable_strong_password; ?>" data-minimum-password-strength="<?php echo $minimum_password_strength; ?>" <?php echo apply_filters( 'user_registration_form_params', '' ); ?>>
60
 
61
  <?php
62
+ foreach ( $form_data_array as $data ) {
63
+ ?>
64
  <div class='ur-form-row'>
65
+ <?php
66
+ $width = floor( 100 / count( $data ) ) - count( $data );
67
 
68
+ foreach ( $data as $grid_key => $grid_data ) {
69
+ ?>
70
  <div class="ur-form-grid ur-grid-<?php echo( $grid_key + 1 ); ?>"
71
+ style="width:<?php echo $width; ?>%">
72
+ <?php
73
+ foreach ( $grid_data as $grid_data_key => $single_item ) {
74
 
75
+ if ( isset( $single_item->field_key ) ) {
76
+ ?>
77
  <div class="ur-field-item field-<?php echo $single_item->field_key; ?>">
78
+ <?php
79
+ $frontend->user_registration_frontend_form( $single_item, $form_id );
80
+ $is_field_exists = true;
81
+ ?>
82
  </div>
83
+ <?php
84
+ }
85
+ }
86
+ ?>
87
  </div>
88
  <?php
89
+ }
90
+ ?>
91
  </div>
92
  <?php
93
+ }
94
 
95
+ if ( $is_field_exists ) {
96
+ ?>
97
+ <?php
98
+ if ( ! empty( $recaptcha_node ) ) {
99
+ echo '<div id="ur-recaptcha-node" style="width:100px;max-width: 100px;"> ' . $recaptcha_node . '</div>';
100
+ }
101
  ?>
 
 
 
 
 
102
  <button type="submit" class="btn button ur-submit-button">
103
  <span></span>
104
+ <?php echo __( ur_get_form_setting_by_key( $form_id, 'user_registration_form_setting_form_submit_label' ), 'user-registration' ); ?>
105
  </button>
106
 
107
  <?php
108
+ }
109
 
110
+ if ( count( $form_data_array ) == 0 ) {
111
+ ?>
112
  <h2><?php echo __( 'Form not found, form id :' . $form_id, 'user-registration' ); ?></h2>
113
  <?php
114
+ }
115
  ?>
116
 
117
  <div style="clear:both"></div>
templates/myaccount/dashboard.php CHANGED
@@ -23,7 +23,8 @@ if ( ! defined( 'ABSPATH' ) ) {
23
  }
24
  ?>
25
 
26
- <p><?php
 
27
  /* translators: 1: user display name 2: logout url */
28
  printf(
29
  __( 'Hello %1$s (not %1$s? <a href="%2$s">Sign out</a>)', 'user-registration' ),
@@ -31,15 +32,19 @@ if ( ! defined( 'ABSPATH' ) ) {
31
  esc_url( ur_logout_url( ur_get_page_permalink( 'myaccount' ) ) )
32
  );
33
 
34
- ?></p>
 
35
 
36
- <p><?php
 
37
  /* translators: 1 profile details url, 2: change password url */
38
  printf(
39
- __( 'From your account dashboard you can edit your <a href="%1$s"> profile details</a> and <a href="%2$s">edit your password</a>.', 'user-registration' ), esc_url( ur_get_endpoint_url('edit-profile') ),
 
40
  esc_url( ur_get_endpoint_url( 'edit-password' ) )
41
  );
42
- ?></p>
 
43
 
44
  <?php
45
  /**
23
  }
24
  ?>
25
 
26
+ <p>
27
+ <?php
28
  /* translators: 1: user display name 2: logout url */
29
  printf(
30
  __( 'Hello %1$s (not %1$s? <a href="%2$s">Sign out</a>)', 'user-registration' ),
32
  esc_url( ur_logout_url( ur_get_page_permalink( 'myaccount' ) ) )
33
  );
34
 
35
+ ?>
36
+ </p>
37
 
38
+ <p>
39
+ <?php
40
  /* translators: 1 profile details url, 2: change password url */
41
  printf(
42
+ __( 'From your account dashboard you can edit your <a href="%1$s"> profile details</a> and <a href="%2$s">edit your password</a>.', 'user-registration' ),
43
+ esc_url( ur_get_endpoint_url( 'edit-profile' ) ),
44
  esc_url( ur_get_endpoint_url( 'edit-password' ) )
45
  );
46
+ ?>
47
+ </p>
48
 
49
  <?php
50
  /**
templates/myaccount/form-edit-password.php CHANGED
@@ -27,7 +27,7 @@ do_action( 'user_registration_before_change_password_form' );
27
  <form class="user-registration-EditAccountForm edit-password" action="" method="post">
28
  <div class="ur-form-row">
29
  <div class="ur-form-grid">
30
- <?php
31
  ur_do_deprecated_action( 'user_registration_edit_account_form_start', array(), '1.4.2', 'user_registration_change_password_form_start' );
32
  do_action( 'user_registration_change_password_form_start' );
33
  ?>
@@ -49,7 +49,7 @@ do_action( 'user_registration_before_change_password_form' );
49
  </fieldset>
50
  <div class="clear"></div>
51
 
52
- <?php
53
  ur_do_deprecated_action( 'user_registration_edit_account_form', array(), '1.4.2', 'user_registration_change_password_form' );
54
  do_action( 'user_registration_change_password_form' );
55
  ?>
@@ -60,7 +60,7 @@ do_action( 'user_registration_before_change_password_form' );
60
  <input type="hidden" name="action" value="save_change_password" />
61
  </p>
62
 
63
- <?php
64
  ur_do_deprecated_action( 'user_registration_edit_account_form_end', array(), '1.4.2', 'user_registration_change_password_form_end' );
65
  do_action( 'user_registration_change_password_form_end' );
66
  ?>
@@ -69,7 +69,7 @@ do_action( 'user_registration_before_change_password_form' );
69
  </form>
70
  </div>
71
 
72
- <?php
73
  ur_do_deprecated_action( 'user_registration_after_edit_account_form', array(), '1.4.1', 'user_registration_after_change_password_form' );
74
- do_action( 'user_registration_after_edit_account_form' );
75
  ?>
27
  <form class="user-registration-EditAccountForm edit-password" action="" method="post">
28
  <div class="ur-form-row">
29
  <div class="ur-form-grid">
30
+ <?php
31
  ur_do_deprecated_action( 'user_registration_edit_account_form_start', array(), '1.4.2', 'user_registration_change_password_form_start' );
32
  do_action( 'user_registration_change_password_form_start' );
33
  ?>
49
  </fieldset>
50
  <div class="clear"></div>
51
 
52
+ <?php
53
  ur_do_deprecated_action( 'user_registration_edit_account_form', array(), '1.4.2', 'user_registration_change_password_form' );
54
  do_action( 'user_registration_change_password_form' );
55
  ?>
60
  <input type="hidden" name="action" value="save_change_password" />
61
  </p>
62
 
63
+ <?php
64
  ur_do_deprecated_action( 'user_registration_edit_account_form_end', array(), '1.4.2', 'user_registration_change_password_form_end' );
65
  do_action( 'user_registration_change_password_form_end' );
66
  ?>
69
  </form>
70
  </div>
71
 
72
+ <?php
73
  ur_do_deprecated_action( 'user_registration_after_edit_account_form', array(), '1.4.1', 'user_registration_after_change_password_form' );
74
+ do_action( 'user_registration_after_edit_account_form' );
75
  ?>
templates/myaccount/form-edit-profile.php CHANGED
@@ -27,9 +27,9 @@ do_action( 'user_registration_before_edit_profile_form' ); ?>
27
  <div class="ur-form-row">
28
  <div class="ur-form-grid">
29
  <div class="user-registration-profile-fields">
30
- <?php $image = get_avatar_url( get_current_user_id(), $args = NULL );?>
31
- <img alt="profile-picture" src="<?php echo $image;?>"><br/>
32
- <span><i>You can change your profile picture on <a href="https://en.gravatar.com/"><?php _e( 'Gravatar','user-registration' );?></a></i></span>
33
  <?php do_action( 'user_registration_edit_profile_form_start' ); ?>
34
  <div class="user-registration-profile-fields__field-wrapper">
35
 
27
  <div class="ur-form-row">
28
  <div class="ur-form-grid">
29
  <div class="user-registration-profile-fields">
30
+ <?php $image = get_avatar_url( get_current_user_id(), $args = null ); ?>
31
+ <img alt="profile-picture" src="<?php echo $image; ?>"><br/>
32
+ <span><i>You can change your profile picture on <a href="https://en.gravatar.com/"><?php _e( 'Gravatar', 'user-registration' ); ?></a></i></span>
33
  <?php do_action( 'user_registration_edit_profile_form_start' ); ?>
34
  <div class="user-registration-profile-fields__field-wrapper">
35
 
templates/myaccount/form-login.php CHANGED
@@ -17,10 +17,10 @@
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
- exit; // Exit if accessed directly
21
  }
22
 
23
- $form_template = get_option( 'user_registration_login_options_form_template', 'default' );
24
  $template_class = '';
25
 
26
  if ( 'bordered' === $form_template ) {
@@ -29,10 +29,10 @@ if ( 'bordered' === $form_template ) {
29
  } elseif ( 'flat' === $form_template ) {
30
  $template_class = 'ur-frontend-form--flat';
31
 
32
- } elseif( 'rounded' === $form_template ) {
33
  $template_class = 'ur-frontend-form--rounded';
34
 
35
- } elseif( 'rounded_edge' === $form_template ) {
36
  $template_class = 'ur-frontend-form--rounded ur-frontend-form--rounded-edge';
37
  }
38
 
@@ -60,9 +60,9 @@ if ( 'bordered' === $form_template ) {
60
  </p>
61
 
62
  <?php
63
- if( ! empty( $recaptcha_node ) ) {
64
- echo '<div id="ur-recaptcha-node" style="width:100px;max-width: 100px;"> '. $recaptcha_node .'</div>';
65
- }
66
  ?>
67
 
68
  <?php do_action( 'user_registration_login_form' ); ?>
@@ -75,48 +75,49 @@ if ( 'bordered' === $form_template ) {
75
  <?php
76
  $remember_me_enabled = get_option( 'user_registration_login_options_remember_me', 'yes' );
77
 
78
- if( 'yes' === $remember_me_enabled ) {
79
- ?>
80
  <label class="user-registration-form__label user-registration-form__label-for-checkbox inline">
81
  <input class="user-registration-form__input user-registration-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span><?php _e( 'Remember me', 'user-registration' ); ?></span>
82
  </label>
83
  <?php
84
- }
85
  ?>
86
  </p>
87
 
88
  <?php
89
  $lost_password_enabled = get_option( 'user_registration_login_options_lost_password', 'yes' );
90
 
91
- if( 'yes' === $lost_password_enabled ) {
92
- ?>
93
  <p class="user-registration-LostPassword lost_password">
94
  <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?', 'user-registration' ); ?></a>
95
  </p>
96
  <?php
97
- }
98
  ?>
99
 
100
  <?php
101
  $url_options = get_option( 'user_registration_general_setting_registration_url_options' );
102
 
103
- if ( ! empty( $url_options ) ) {
104
- echo '<p class="user-registration-register register">';
105
- $label = get_option('user_registration_general_setting_registration_label');
106
 
107
- if ( ! empty( $label ) ) {
108
- ?><a href="<?php echo get_option('user_registration_general_setting_registration_url_options');?>"> <?php echo get_option( 'user_registration_general_setting_registration_label' ); ?>
 
109
  </a>
110
  <?php
111
- } else {
112
- update_option( 'user_registration_general_setting_registration_label', __( 'Not a member yet? Register now.', 'user-registration' ) );
113
- ?>
114
- <a href="<?php echo get_option( 'user_registration_general_setting_registration_url_options' );?>"> <?php echo get_option( 'user_registration_general_setting_registration_label' ); ?>
115
  </a>
116
  <?php
117
- }
118
- echo '</p>';
119
  }
 
 
120
  ?>
121
  </p>
122
  <?php do_action( 'user_registration_login_form_end' ); ?>
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
+ exit; // Exit if accessed directly.
21
  }
22
 
23
+ $form_template = get_option( 'user_registration_login_options_form_template', 'default' );
24
  $template_class = '';
25
 
26
  if ( 'bordered' === $form_template ) {
29
  } elseif ( 'flat' === $form_template ) {
30
  $template_class = 'ur-frontend-form--flat';
31
 
32
+ } elseif ( 'rounded' === $form_template ) {
33
  $template_class = 'ur-frontend-form--rounded';
34
 
35
+ } elseif ( 'rounded_edge' === $form_template ) {
36
  $template_class = 'ur-frontend-form--rounded ur-frontend-form--rounded-edge';
37
  }
38
 
60
  </p>
61
 
62
  <?php
63
+ if ( ! empty( $recaptcha_node ) ) {
64
+ echo '<div id="ur-recaptcha-node" style="width:100px;max-width: 100px;"> ' . $recaptcha_node . '</div>';
65
+ }
66
  ?>
67
 
68
  <?php do_action( 'user_registration_login_form' ); ?>
75
  <?php
76
  $remember_me_enabled = get_option( 'user_registration_login_options_remember_me', 'yes' );
77
 
78
+ if ( 'yes' === $remember_me_enabled ) {
79
+ ?>
80
  <label class="user-registration-form__label user-registration-form__label-for-checkbox inline">
81
  <input class="user-registration-form__input user-registration-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span><?php _e( 'Remember me', 'user-registration' ); ?></span>
82
  </label>
83
  <?php
84
+ }
85
  ?>
86
  </p>
87
 
88
  <?php
89
  $lost_password_enabled = get_option( 'user_registration_login_options_lost_password', 'yes' );
90
 
91
+ if ( 'yes' === $lost_password_enabled ) {
92
+ ?>
93
  <p class="user-registration-LostPassword lost_password">
94
  <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?', 'user-registration' ); ?></a>
95
  </p>
96
  <?php
97
+ }
98
  ?>
99
 
100
  <?php
101
  $url_options = get_option( 'user_registration_general_setting_registration_url_options' );
102
 
103
+ if ( ! empty( $url_options ) ) {
104
+ echo '<p class="user-registration-register register">';
105
+ $label = get_option( 'user_registration_general_setting_registration_label' );
106
 
107
+ if ( ! empty( $label ) ) {
108
+ ?>
109
+ <a href="<?php echo get_option( 'user_registration_general_setting_registration_url_options' ); ?>"> <?php echo get_option( 'user_registration_general_setting_registration_label' ); ?>
110
  </a>
111
  <?php
112
+ } else {
113
+ update_option( 'user_registration_general_setting_registration_label', __( 'Not a member yet? Register now.', 'user-registration' ) );
114
+ ?>
115
+ <a href="<?php echo get_option( 'user_registration_general_setting_registration_url_options' ); ?>"> <?php echo get_option( 'user_registration_general_setting_registration_label' ); ?>
116
  </a>
117
  <?php
 
 
118
  }
119
+ echo '</p>';
120
+ }
121
  ?>
122
  </p>
123
  <?php do_action( 'user_registration_login_form_end' ); ?>
templates/myaccount/form-lost-password.php CHANGED
@@ -17,7 +17,7 @@
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
  }
22
 
23
  ur_print_notices(); ?>
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
+ exit; // Exit if accessed directly.
21
  }
22
 
23
  ur_print_notices(); ?>
templates/myaccount/form-reset-password.php CHANGED
@@ -17,7 +17,7 @@
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
  }
22
 
23
  ur_print_notices(); ?>
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
+ exit; // Exit if accessed directly.
21
  }
22
 
23
  ur_print_notices(); ?>
templates/myaccount/lost-password-confirmation.php CHANGED
@@ -17,7 +17,7 @@
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
  }
22
 
23
  ur_print_notices();
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
+ exit; // Exit if accessed directly.
21
  }
22
 
23
  ur_print_notices();
templates/myaccount/my-account.php CHANGED
@@ -17,7 +17,7 @@
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
  }
22
 
23
  ur_print_notices();
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
+ exit; // Exit if accessed directly.
21
  }
22
 
23
  ur_print_notices();
templates/myaccount/navigation.php CHANGED
@@ -17,7 +17,7 @@
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
  }
22
 
23
  do_action( 'user_registration_before_account_navigation' );
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
+ exit; // Exit if accessed directly.
21
  }
22
 
23
  do_action( 'user_registration_before_account_navigation' );
templates/notices/success.php CHANGED
@@ -17,7 +17,7 @@
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
- exit; // Exit if accessed directly
21
  }
22
 
23
  if ( ! $messages ) {
17
  */
18
 
19
  if ( ! defined( 'ABSPATH' ) ) {
20
+ exit; // Exit if accessed directly.
21
  }
22
 
23
  if ( ! $messages ) {
user-registration.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: User Registration
4
  * Plugin URI: https://wpeverest.com/plugins/user-registration
5
  * Description: Drag and Drop user registration and login form builder.
6
- * Version: 1.5.5
7
  * Author: WPEverest
8
  * Author URI: https://wpeverest.com
9
  * Text Domain: user-registration
@@ -18,289 +18,296 @@ if ( ! defined( 'ABSPATH' ) ) {
18
 
19
  if ( ! class_exists( 'UserRegistration' ) ) :
20
 
21
- /**
22
- * Main UserRegistration Class.
23
- *
24
- * @class UserRegistration
25
- * @version 1.0.0
26
- */
27
- final class UserRegistration {
28
-
29
- /**
30
- * Plugin version.
31
- * @var string
32
- */
33
- public $version = '1.5.5';
34
-
35
- /**
36
- * Session instance.
37
- *
38
- * @var UR_Session|UR_Session_Handler
39
- */
40
- public $session = null;
41
-
42
  /**
43
- * Query instance.
44
  *
45
- * @var UR_Query
46
- */
47
- public $query = null;
48
-
49
- /**
50
- * Instance of this class.
51
- * @var object
52
  */
53
- protected static $_instance = null;
54
 
55
- /**
56
- * Return an instance of this class.
57
- * @return object A single instance of this class.
58
- */
59
- public static function instance() {
60
- // If the single instance hasn't been set, set it now.
61
- if ( is_null( self::$_instance ) ) {
62
- self::$_instance = new self();
63
- }
64
-
65
- return self::$_instance;
66
- }
67
-
68
- /**
69
- * Cloning is forbidden.
70
- *
71
- * @since 1.0
72
- */
73
- public function __clone() {
74
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'user-registration' ), '1.0' );
75
- }
76
-
77
- /**
78
- * Unserializing instances of this class is forbidden.
79
- *
80
- * @since 1.0
81
- */
82
- public function __wakeup() {
83
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'user-registration' ), '1.0' );
84
- }
85
 
86
- /**
87
- * UserRegistration Constructor.
88
- */
89
- public function __construct() {
90
- $this->define_constants();
91
- $this->includes();
92
- $this->init_hooks();
93
 
94
- do_action( 'user_registration_loaded' );
95
- }
 
 
 
 
96
 
97
- /**
98
- * Hook into actions and filters.
99
- */
100
- private function init_hooks() {
101
- register_activation_hook( __FILE__, array( 'UR_Install', 'install' ) );
102
- add_action( 'after_setup_theme', array( $this, 'include_template_functions' ), 11 );
103
- add_action( 'init', array( $this, 'init' ), 0 );
104
- add_action( 'init', array( 'UR_Shortcodes', 'init' ) );
105
- }
106
 
107
- /**
108
- * Define FT Constants.
109
- */
110
- private function define_constants() {
111
- $upload_dir = wp_upload_dir();
112
- $this->define( 'UR_LOG_DIR', $upload_dir['basedir'] . '/ur-logs/' );
113
- $this->define( 'UR_DS', DIRECTORY_SEPARATOR );
114
- $this->define( 'UR_PLUGIN_FILE', __FILE__ );
115
- $this->define( 'UR_ABSPATH', dirname( __FILE__ ) . UR_DS );
116
- $this->define( 'UR_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
117
- $this->define( 'UR_VERSION', $this->version );
118
- $this->define( 'UR_TEMPLATE_DEBUG_MODE', false );
119
- $this->define( 'UR_FORM_PATH', UR_ABSPATH . 'includes' . UR_DS . 'form' . UR_DS );
120
- $this->define( 'UR_SESSION_CACHE_GROUP', 'ur_session_id' );
121
- }
122
 
123
- /**
124
- * Define constant if not already set.
125
- *
126
- * @param string $name
127
- * @param string|bool $value
128
- */
129
- private function define( $name, $value ) {
130
- if ( ! defined( $name ) ) {
131
- define( $name, $value );
132
  }
133
- }
134
 
135
- /**
136
- * What type of request is this?
137
- *
138
- * @param string $type admin, ajax, cron or frontend.
139
- * @return bool
140
- */
141
- private function is_request( $type ) {
142
- switch ( $type ) {
143
- case 'admin' :
144
- return is_admin();
145
- case 'ajax' :
146
- return defined( 'DOING_AJAX' );
147
- case 'cron' :
148
- return defined( 'DOING_CRON' );
149
- case 'frontend' :
150
- return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );
151
  }
152
- }
153
-
154
- /**
155
- * Includes.
156
- */
157
- private function includes() {
158
 
159
  /**
160
- * Class autoloader.
 
 
161
  */
162
- include_once( UR_ABSPATH . 'includes/class-ur-autoloader.php' );
 
 
163
 
164
  /**
165
- * Interfaces.
166
  */
167
- include_once( UR_ABSPATH . 'includes/interfaces/class-ur-logger-interface.php' );
168
- include_once( UR_ABSPATH . 'includes/interfaces/class-ur-log-handler-interface.php' );
 
 
 
 
 
169
 
170
  /**
171
- * Abstract classes
172
  */
173
- include_once( UR_ABSPATH . 'includes/abstracts/abstract-ur-form-field.php' );
174
- include_once( UR_ABSPATH . 'includes/abstracts/abstract-ur-field-settings.php' );
175
- include_once( UR_ABSPATH . 'includes/abstracts/abstract-ur-log-handler.php' );
176
- include_once( UR_ABSPATH . 'includes/abstracts/abstract-ur-session.php' );
 
 
177
 
178
  /**
179
- * Core classes.
180
  */
181
- include_once( UR_ABSPATH . 'includes/functions-ur-core.php' );
182
- include_once( UR_ABSPATH . 'includes/class-ur-install.php' );
183
- include_once( UR_ABSPATH . 'includes/class-ur-post-types.php' ); // Registers post types
184
- include_once( UR_ABSPATH . 'includes/class-ur-user-approval.php' ); // User Approval class
185
- include_once( UR_ABSPATH . 'includes/class-ur-emailer.php' );
186
- include_once( UR_ABSPATH . 'includes/class-ur-ajax.php' );
187
- include_once( UR_ABSPATH . 'includes/class-ur-query.php' );
188
- include_once( UR_ABSPATH . 'includes/class-ur-email-confirmation.php' );
189
- include_once( UR_ABSPATH . 'includes/class-ur-privacy.php' );
190
- include_once( UR_ABSPATH . 'includes/class-ur-form-block.php' );
 
 
191
 
192
  /**
193
- * Config classes.
 
 
 
194
  */
195
- include_once( UR_ABSPATH . 'includes/admin/class-ur-config.php' );
 
 
 
 
196
 
197
  /**
198
- * Plugin/Addon Updater.
 
 
 
199
  */
200
- include_once( UR_ABSPATH . 'includes/class-ur-plugin-updater.php' );
201
-
202
- if ( $this->is_request( 'admin' ) ) {
203
- include_once( UR_ABSPATH . 'includes/admin/class-ur-admin.php' );
 
 
 
 
 
 
 
204
  }
205
 
206
- if ( $this->is_request( 'frontend' ) ) {
207
- $this->frontend_includes();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  }
209
 
210
- if ( $this->is_request( 'frontend' ) || $this->is_request( 'cron' ) ) {
211
- include_once( UR_ABSPATH . 'includes/class-ur-session-handler.php' );
 
 
 
 
 
 
212
  }
213
 
214
- $this->query = new UR_Query();
215
- }
216
-
217
- /**
218
- * Include required frontend files.
219
- */
220
- public function frontend_includes() {
221
- include_once( UR_ABSPATH . 'includes/functions-ur-notice.php' );
222
- include_once( UR_ABSPATH . 'includes/class-ur-form-handler.php' ); // Form Handlers
223
- include_once( UR_ABSPATH . 'includes/class-ur-frontend-scripts.php' ); // Frontend Scripts
224
- include_once( UR_ABSPATH . 'includes/frontend/class-ur-frontend.php' );
225
- }
226
 
227
- /**
228
- * Function used to Init UserRegistration Template Functions - This makes them pluggable by plugins and themes.
229
- */
230
- public function include_template_functions() {
231
- include_once( UR_ABSPATH . 'includes/functions-ur-template.php' );
232
- }
233
 
234
- /**
235
- * Init UserRegistration when WordPress Initialises.
236
- */
237
- public function init() {
238
- // Before init action.
239
- do_action( 'before_user_registration_init' );
240
 
241
- // Set up localisation.
242
- $this->load_plugin_textdomain();
 
 
 
243
 
244
- // Session class, handles session data for users - can be overwritten if custom handler is needed.
245
- if ( $this->is_request( 'frontend' ) || $this->is_request( 'cron' ) || $this->is_request( 'admin' ) ) {
246
- $session_class = apply_filters( 'user_registration_session_handler', 'UR_Session_Handler' );
247
- $this->session = new $session_class();
248
  }
249
 
250
- // Init action.
251
- do_action( 'user_registration_init' );
252
- }
253
-
254
- /**
255
- * Load Localisation files.
256
- *
257
- * Note: the first-loaded translation file overrides any following ones if the same translation is present.
258
- *
259
- * Locales found in:
260
- * - WP_LANG_DIR/user-registration/user-registration-LOCALE.mo
261
- * - WP_LANG_DIR/plugins/user-registration-LOCALE.mo
262
- */
263
- public function load_plugin_textdomain() {
264
- $locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
265
- $locale = apply_filters( 'plugin_locale', $locale, 'user-registration' );
266
 
267
- unload_textdomain( 'user-registration' );
268
- load_textdomain( 'user-registration', WP_LANG_DIR . '/user-registration/user-registration-' . $locale . '.mo' );
269
- load_plugin_textdomain( 'user-registration', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
270
- }
271
 
272
- /**
273
- * Get the plugin url.
274
- * @return string
275
- */
276
- public function plugin_url() {
277
- return untrailingslashit( plugins_url( '/', __FILE__ ) );
278
- }
 
279
 
280
- /**
281
- * Get the plugin path.
282
- * @return string
283
- */
284
- public function plugin_path() {
285
- return untrailingslashit( plugin_dir_path( __FILE__ ) );
286
- }
 
287
 
288
- /**
289
- * Get the template path.
290
- * @return string
291
- */
292
- public function template_path() {
293
- return apply_filters( 'user_registration_template_path', 'user-registration/' );
294
- }
 
295
 
296
- /**
297
- * Get Ajax URL.
298
- * @return string
299
- */
300
- public function ajax_url() {
301
- return admin_url( 'admin-ajax.php', 'relative' );
 
 
302
  }
303
- }
304
 
305
  endif;
306
 
3
  * Plugin Name: User Registration
4
  * Plugin URI: https://wpeverest.com/plugins/user-registration
5
  * Description: Drag and Drop user registration and login form builder.
6
+ * Version: 1.5.6
7
  * Author: WPEverest
8
  * Author URI: https://wpeverest.com
9
  * Text Domain: user-registration
18
 
19
  if ( ! class_exists( 'UserRegistration' ) ) :
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  /**
22
+ * Main UserRegistration Class.
23
  *
24
+ * @class UserRegistration
25
+ * @version 1.0.0
 
 
 
 
 
26
  */
27
+ final class UserRegistration {
28
 
29
+ /**
30
+ * Plugin version.
31
+ *
32
+ * @var string
33
+ */
34
+ public $version = '1.5.6';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
+ /**
37
+ * Session instance.
38
+ *
39
+ * @var UR_Session|UR_Session_Handler
40
+ */
41
+ public $session = null;
 
42
 
43
+ /**
44
+ * Query instance.
45
+ *
46
+ * @var UR_Query
47
+ */
48
+ public $query = null;
49
 
50
+ /**
51
+ * Instance of this class.
52
+ *
53
+ * @var object
54
+ */
55
+ protected static $_instance = null;
 
 
 
56
 
57
+ /**
58
+ * Return an instance of this class.
59
+ *
60
+ * @return object A single instance of this class.
61
+ */
62
+ public static function instance() {
63
+ // If the single instance hasn't been set, set it now.
64
+ if ( is_null( self::$_instance ) ) {
65
+ self::$_instance = new self();
66
+ }
 
 
 
 
 
67
 
68
+ return self::$_instance;
 
 
 
 
 
 
 
 
69
  }
 
70
 
71
+ /**
72
+ * Cloning is forbidden.
73
+ *
74
+ * @since 1.0
75
+ */
76
+ public function __clone() {
77
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'user-registration' ), '1.0' );
 
 
 
 
 
 
 
 
 
78
  }
 
 
 
 
 
 
79
 
80
  /**
81
+ * Unserializing instances of this class is forbidden.
82
+ *
83
+ * @since 1.0
84
  */
85
+ public function __wakeup() {
86
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'user-registration' ), '1.0' );
87
+ }
88
 
89
  /**
90
+ * UserRegistration Constructor.
91
  */
92
+ public function __construct() {
93
+ $this->define_constants();
94
+ $this->includes();
95
+ $this->init_hooks();
96
+
97
+ do_action( 'user_registration_loaded' );
98
+ }
99
 
100
  /**
101
+ * Hook into actions and filters.
102
  */
103
+ private function init_hooks() {
104
+ register_activation_hook( __FILE__, array( 'UR_Install', 'install' ) );
105
+ add_action( 'after_setup_theme', array( $this, 'include_template_functions' ), 11 );
106
+ add_action( 'init', array( $this, 'init' ), 0 );
107
+ add_action( 'init', array( 'UR_Shortcodes', 'init' ) );
108
+ }
109
 
110
  /**
111
+ * Define FT Constants.
112
  */
113
+ private function define_constants() {
114
+ $upload_dir = wp_upload_dir();
115
+ $this->define( 'UR_LOG_DIR', $upload_dir['basedir'] . '/ur-logs/' );
116
+ $this->define( 'UR_DS', DIRECTORY_SEPARATOR );
117
+ $this->define( 'UR_PLUGIN_FILE', __FILE__ );
118
+ $this->define( 'UR_ABSPATH', dirname( __FILE__ ) . UR_DS );
119
+ $this->define( 'UR_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
120
+ $this->define( 'UR_VERSION', $this->version );
121
+ $this->define( 'UR_TEMPLATE_DEBUG_MODE', false );
122
+ $this->define( 'UR_FORM_PATH', UR_ABSPATH . 'includes' . UR_DS . 'form' . UR_DS );
123
+ $this->define( 'UR_SESSION_CACHE_GROUP', 'ur_session_id' );
124
+ }
125
 
126
  /**
127
+ * Define constant if not already set.
128
+ *
129
+ * @param string $name
130
+ * @param string|bool $value
131
  */
132
+ private function define( $name, $value ) {
133
+ if ( ! defined( $name ) ) {
134
+ define( $name, $value );
135
+ }
136
+ }
137
 
138
  /**
139
+ * What type of request is this?
140
+ *
141
+ * @param string $type admin, ajax, cron or frontend.
142
+ * @return bool
143
  */
144
+ private function is_request( $type ) {
145
+ switch ( $type ) {
146
+ case 'admin':
147
+ return is_admin();
148
+ case 'ajax':
149
+ return defined( 'DOING_AJAX' );
150
+ case 'cron':
151
+ return defined( 'DOING_CRON' );
152
+ case 'frontend':
153
+ return ( ! is_admin() || defined( 'DOING_AJAX' ) ) && ! defined( 'DOING_CRON' );
154
+ }
155
  }
156
 
157
+ /**
158
+ * Includes.
159
+ */
160
+ private function includes() {
161
+
162
+ /**
163
+ * Class autoloader.
164
+ */
165
+ include_once UR_ABSPATH . 'includes/class-ur-autoloader.php';
166
+
167
+ /**
168
+ * Interfaces.
169
+ */
170
+ include_once UR_ABSPATH . 'includes/interfaces/class-ur-logger-interface.php';
171
+ include_once UR_ABSPATH . 'includes/interfaces/class-ur-log-handler-interface.php';
172
+
173
+ /**
174
+ * Abstract classes
175
+ */
176
+ include_once UR_ABSPATH . 'includes/abstracts/abstract-ur-form-field.php';
177
+ include_once UR_ABSPATH . 'includes/abstracts/abstract-ur-field-settings.php';
178
+ include_once UR_ABSPATH . 'includes/abstracts/abstract-ur-log-handler.php';
179
+ include_once UR_ABSPATH . 'includes/abstracts/abstract-ur-session.php';
180
+
181
+ /**
182
+ * Core classes.
183
+ */
184
+ include_once UR_ABSPATH . 'includes/functions-ur-core.php';
185
+ include_once UR_ABSPATH . 'includes/class-ur-install.php';
186
+ include_once UR_ABSPATH . 'includes/class-ur-post-types.php'; // Registers post types
187
+ include_once UR_ABSPATH . 'includes/class-ur-user-approval.php'; // User Approval class
188
+ include_once UR_ABSPATH . 'includes/class-ur-emailer.php';
189
+ include_once UR_ABSPATH . 'includes/class-ur-ajax.php';
190
+ include_once UR_ABSPATH . 'includes/class-ur-query.php';
191
+ include_once UR_ABSPATH . 'includes/class-ur-email-confirmation.php';
192
+ include_once UR_ABSPATH . 'includes/class-ur-privacy.php';
193
+ include_once UR_ABSPATH . 'includes/class-ur-form-block.php';
194
+
195
+ /**
196
+ * Config classes.
197
+ */
198
+ include_once UR_ABSPATH . 'includes/admin/class-ur-config.php';
199
+
200
+ /**
201
+ * Plugin/Addon Updater.
202
+ */
203
+ include_once UR_ABSPATH . 'includes/class-ur-plugin-updater.php';
204
+
205
+ if ( $this->is_request( 'admin' ) ) {
206
+ include_once UR_ABSPATH . 'includes/admin/class-ur-admin.php';
207
+ }
208
+
209
+ if ( $this->is_request( 'frontend' ) ) {
210
+ $this->frontend_includes();
211
+ }
212
+
213
+ if ( $this->is_request( 'frontend' ) || $this->is_request( 'cron' ) ) {
214
+ include_once UR_ABSPATH . 'includes/class-ur-session-handler.php';
215
+ }
216
+
217
+ $this->query = new UR_Query();
218
  }
219
 
220
+ /**
221
+ * Include required frontend files.
222
+ */
223
+ public function frontend_includes() {
224
+ include_once UR_ABSPATH . 'includes/functions-ur-notice.php';
225
+ include_once UR_ABSPATH . 'includes/class-ur-form-handler.php'; // Form Handlers
226
+ include_once UR_ABSPATH . 'includes/class-ur-frontend-scripts.php'; // Frontend Scripts
227
+ include_once UR_ABSPATH . 'includes/frontend/class-ur-frontend.php';
228
  }
229
 
230
+ /**
231
+ * Function used to Init UserRegistration Template Functions - This makes them pluggable by plugins and themes.
232
+ */
233
+ public function include_template_functions() {
234
+ include_once UR_ABSPATH . 'includes/functions-ur-template.php';
235
+ }
 
 
 
 
 
 
236
 
237
+ /**
238
+ * Init UserRegistration when WordPress Initialises.
239
+ */
240
+ public function init() {
241
+ // Before init action.
242
+ do_action( 'before_user_registration_init' );
243
 
244
+ // Set up localisation.
245
+ $this->load_plugin_textdomain();
 
 
 
 
246
 
247
+ // Session class, handles session data for users - can be overwritten if custom handler is needed.
248
+ if ( $this->is_request( 'frontend' ) || $this->is_request( 'cron' ) || $this->is_request( 'admin' ) ) {
249
+ $session_class = apply_filters( 'user_registration_session_handler', 'UR_Session_Handler' );
250
+ $this->session = new $session_class();
251
+ }
252
 
253
+ // Init action.
254
+ do_action( 'user_registration_init' );
 
 
255
  }
256
 
257
+ /**
258
+ * Load Localisation files.
259
+ *
260
+ * Note: the first-loaded translation file overrides any following ones if the same translation is present.
261
+ *
262
+ * Locales found in:
263
+ * - WP_LANG_DIR/user-registration/user-registration-LOCALE.mo
264
+ * - WP_LANG_DIR/plugins/user-registration-LOCALE.mo
265
+ */
266
+ public function load_plugin_textdomain() {
267
+ $locale = is_admin() && function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale();
268
+ $locale = apply_filters( 'plugin_locale', $locale, 'user-registration' );
 
 
 
 
269
 
270
+ unload_textdomain( 'user-registration' );
271
+ load_textdomain( 'user-registration', WP_LANG_DIR . '/user-registration/user-registration-' . $locale . '.mo' );
272
+ load_plugin_textdomain( 'user-registration', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
273
+ }
274
 
275
+ /**
276
+ * Get the plugin url.
277
+ *
278
+ * @return string
279
+ */
280
+ public function plugin_url() {
281
+ return untrailingslashit( plugins_url( '/', __FILE__ ) );
282
+ }
283
 
284
+ /**
285
+ * Get the plugin path.
286
+ *
287
+ * @return string
288
+ */
289
+ public function plugin_path() {
290
+ return untrailingslashit( plugin_dir_path( __FILE__ ) );
291
+ }
292
 
293
+ /**
294
+ * Get the template path.
295
+ *
296
+ * @return string
297
+ */
298
+ public function template_path() {
299
+ return apply_filters( 'user_registration_template_path', 'user-registration/' );
300
+ }
301
 
302
+ /**
303
+ * Get Ajax URL.
304
+ *
305
+ * @return string
306
+ */
307
+ public function ajax_url() {
308
+ return admin_url( 'admin-ajax.php', 'relative' );
309
+ }
310
  }
 
311
 
312
  endif;
313