PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 2.3.2
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v2.3.2
4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 All 339 releases
profile-builder / index.php

index.php in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 2.3.2, at index.php

191 lines 9.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: Profile Builder
4 Plugin URI: http://www.cozmoslabs.com/wordpress-profile-builder/
5 Description: Login, registration and edit profile shortcodes for the front-end. Also you can chose what fields should be displayed or add new (custom) ones both in the front-end and in the dashboard.
6 Version: 2.3.2
7 Author: Cozmoslabs, Madalin Ungureanu, Antohe Cristian, Barina Gabriel, Mihai Iova
8 Author URI: http://www.cozmoslabs.com/
9 License: GPL2
10
11 == Copyright ==
12 Copyright 2014 Cozmoslabs (www.cozmoslabs.com)
13
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 */
26
27 /* Check if another version of Profile Builder is activated, to prevent fatal errors*/
28 function wppb_free_plugin_init() {
29 if (function_exists('wppb_return_bytes')) {
30 function wppb_admin_notice()
31 {
32 ?>
33 <div class="error">
34 <p><?php _e( PROFILE_BUILDER . ' is also activated. You need to deactivate it before activating this version of the plugin.', 'profile-builder'); ?></p>
35 </div>
36 <?php
37 }
38 function wppb_plugin_deactivate() {
39 deactivate_plugins( plugin_basename( __FILE__ ) );
40 unset($_GET['activate']);
41 }
42
43 add_action('admin_notices', 'wppb_admin_notice');
44 add_action( 'admin_init', 'wppb_plugin_deactivate' );
45 } else {
46
47 /**
48 * Convert memory value from ini file to a readable form
49 *
50 * @since v.1.0
51 *
52 * @return integer
53 */
54 function wppb_return_bytes($val)
55 {
56 $val = trim($val);
57
58 switch (strtolower($val[strlen($val) - 1])) {
59 // The 'G' modifier is available since PHP 5.1.0
60 case 'g':
61 $val *= 1024;
62 case 'm':
63 $val *= 1024;
64 case 'k':
65 $val *= 1024;
66 }
67
68 return $val;
69 }
70
71 /**
72 * Definitions
73 *
74 *
75 */
76 define('PROFILE_BUILDER_VERSION', '2.3.2' );
77 define('WPPB_PLUGIN_DIR', plugin_dir_path(__FILE__));
78 define('WPPB_PLUGIN_URL', plugin_dir_url(__FILE__));
79 define('WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE', apply_filters('wppb_server_max_upload_size_byte_constant', wppb_return_bytes(ini_get('upload_max_filesize'))));
80 define('WPPB_SERVER_MAX_UPLOAD_SIZE_MEGA', apply_filters('wppb_server_max_upload_size_mega_constant', ini_get('upload_max_filesize')));
81 define('WPPB_SERVER_MAX_POST_SIZE_BYTE', apply_filters('wppb_server_max_post_size_byte_constant', wppb_return_bytes(ini_get('post_max_size'))));
82 define('WPPB_SERVER_MAX_POST_SIZE_MEGA', apply_filters('wppb_server_max_post_size_mega_constant', ini_get('post_max_size')));
83 define('WPPB_TRANSLATE_DIR', WPPB_PLUGIN_DIR . '/translation');
84 define('WPPB_TRANSLATE_DOMAIN', 'profile-builder');
85
86 /* include notices class */
87 if (file_exists(WPPB_PLUGIN_DIR . '/assets/lib/class_notices.php'))
88 include_once(WPPB_PLUGIN_DIR . '/assets/lib/class_notices.php');
89
90 if (file_exists(WPPB_PLUGIN_DIR . '/modules/modules.php'))
91 define('PROFILE_BUILDER', 'Profile Builder Pro');
92 elseif (file_exists(WPPB_PLUGIN_DIR . '/front-end/extra-fields/extra-fields.php'))
93 define('PROFILE_BUILDER', 'Profile Builder Hobbyist');
94 else
95 define('PROFILE_BUILDER', 'Profile Builder Free');
96
97 /**
98 * Initialize the translation for the Plugin.
99 *
100 * @since v.1.0
101 *
102 * @return null
103 */
104 function wppb_init_translation()
105 {
106 load_plugin_textdomain('profile-builder', false, basename(dirname(__FILE__)) . '/translation/');
107 }
108
109 add_action('init', 'wppb_init_translation', 8);
110
111
112 /**
113 * Required files
114 *
115 *
116 */
117 include_once(WPPB_PLUGIN_DIR . '/assets/lib/wck-api/wordpress-creation-kit.php');
118 include_once(WPPB_PLUGIN_DIR . '/features/upgrades/upgrades.php');
119 include_once(WPPB_PLUGIN_DIR . '/features/functions.php');
120 include_once(WPPB_PLUGIN_DIR . '/admin/admin-functions.php');
121 include_once(WPPB_PLUGIN_DIR . '/admin/basic-info.php');
122 include_once(WPPB_PLUGIN_DIR . '/admin/general-settings.php');
123 include_once(WPPB_PLUGIN_DIR . '/admin/admin-bar.php');
124 include_once(WPPB_PLUGIN_DIR . '/admin/manage-fields.php');
125 include_once(WPPB_PLUGIN_DIR . '/admin/pms-cross-promotion.php');
126 include_once(WPPB_PLUGIN_DIR . '/features/email-confirmation/email-confirmation.php');
127 include_once(WPPB_PLUGIN_DIR . '/features/email-confirmation/class-email-confirmation.php');
128 if (file_exists(WPPB_PLUGIN_DIR . '/features/admin-approval/admin-approval.php')) {
129 include_once(WPPB_PLUGIN_DIR . '/features/admin-approval/admin-approval.php');
130 include_once(WPPB_PLUGIN_DIR . '/features/admin-approval/class-admin-approval.php');
131 }
132 include_once(WPPB_PLUGIN_DIR . '/features/login-widget/login-widget.php');
133
134 if (file_exists(WPPB_PLUGIN_DIR . '/update/update-checker.php')) {
135 include_once(WPPB_PLUGIN_DIR . '/update/update-checker.php');
136 include_once(WPPB_PLUGIN_DIR . '/admin/register-version.php');
137 }
138
139 if (file_exists(WPPB_PLUGIN_DIR . '/modules/modules.php')) {
140 include_once(WPPB_PLUGIN_DIR . '/modules/modules.php');
141 include_once(WPPB_PLUGIN_DIR . '/modules/custom-redirects/custom-redirects.php');
142 include_once(WPPB_PLUGIN_DIR . '/modules/email-customizer/email-customizer.php');
143 include_once(WPPB_PLUGIN_DIR . '/modules/multiple-forms/multiple-forms.php');
144
145 $wppb_module_settings = get_option('wppb_module_settings');
146 if (isset($wppb_module_settings['wppb_userListing']) && ($wppb_module_settings['wppb_userListing'] == 'show')) {
147 include_once(WPPB_PLUGIN_DIR . '/modules/user-listing/userlisting.php');
148 add_shortcode('wppb-list-users', 'wppb_user_listing_shortcode');
149 } else
150 add_shortcode('wppb-list-users', 'wppb_list_all_users_display_error');
151
152 if (isset($wppb_module_settings['wppb_emailCustomizerAdmin']) && ($wppb_module_settings['wppb_emailCustomizerAdmin'] == 'show'))
153 include_once(WPPB_PLUGIN_DIR . '/modules/email-customizer/admin-email-customizer.php');
154
155 if (isset($wppb_module_settings['wppb_emailCustomizer']) && ($wppb_module_settings['wppb_emailCustomizer'] == 'show'))
156 include_once(WPPB_PLUGIN_DIR . '/modules/email-customizer/user-email-customizer.php');
157 }
158
159 include_once(WPPB_PLUGIN_DIR . '/admin/add-ons.php');
160 include_once(WPPB_PLUGIN_DIR . '/assets/misc/plugin-compatibilities.php');
161 if ( PROFILE_BUILDER != 'Profile Builder Free' )
162 include_once(WPPB_PLUGIN_DIR . '/front-end/extra-fields/recaptcha/recaptcha.php'); //need to load this here for displaying reCAPTCHA on Login and Recover Password forms
163
164
165 /**
166 * Check for updates
167 *
168 *
169 */
170 if (file_exists(WPPB_PLUGIN_DIR . '/update/update-checker.php')) {
171 if (file_exists(WPPB_PLUGIN_DIR . '/modules/modules.php')) {
172 $localSerial = get_option('wppb_profile_builder_pro_serial');
173 $wppb_update = new wppb_PluginUpdateChecker('http://updatemetadata.cozmoslabs.com/?localSerialNumber=' . $localSerial . '&uniqueproduct=CLPBP', __FILE__, 'profile-builder-pro-update');
174
175 } else {
176 $localSerial = get_option('wppb_profile_builder_hobbyist_serial');
177 $wppb_update = new wppb_PluginUpdateChecker('http://updatemetadata.cozmoslabs.com/?localSerialNumber=' . $localSerial . '&uniqueproduct=CLPBH', __FILE__, 'profile-builder-hobbyist-update');
178 }
179 }
180
181
182 // these settings are important, so besides running them on page load, we also need to do a check on plugin activation
183 register_activation_hook(__FILE__, 'wppb_generate_default_settings_defaults'); //prepoulate general settings
184 register_activation_hook(__FILE__, 'wppb_prepopulate_fields'); //prepopulate manage fields list
185
186 }
187 } //end wppb_free_plugin_init
188 add_action( 'plugins_loaded', 'wppb_free_plugin_init' );
189
190 if (file_exists( plugin_dir_path(__FILE__) . '/front-end/extra-fields/upload/upload_helper_functions.php'))
191 include_once( plugin_dir_path(__FILE__) . '/front-end/extra-fields/upload/upload_helper_functions.php');