PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 2.0.4
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v2.0.4
4.0.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 All 340 releases
profile-builder / index.php

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

162 lines 7.3 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.0.4
7 Author: Cozmoslabs, Madalin Ungureanu, Antohe Cristian, Barina Gabriel
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 /**
28 * Convert memory value from ini file to a readable form
29 *
30 * @since v.1.0
31 *
32 * @return integer
33 */
34 function wppb_return_bytes( $val ) {
35 $val = trim( $val );
36
37 switch( strtolower( $val[strlen( $val )-1] ) ) {
38 // The 'G' modifier is available since PHP 5.1.0
39 case 'g':
40 $val *= 1024;
41 case 'm':
42 $val *= 1024;
43 case 'k':
44 $val *= 1024;
45 }
46
47 return $val;
48 }
49
50 /**
51 * Definitions
52 *
53 *
54 */
55 define( 'PROFILE_BUILDER_VERSION', '2.0.4' );
56 define( 'WPPB_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
57 define( 'WPPB_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
58 define( 'WPPB_SERVER_MAX_UPLOAD_SIZE_BYTE', apply_filters( 'wppb_server_max_upload_size_byte_constant', wppb_return_bytes( ini_get( 'upload_max_filesize') ) ) );
59 define( 'WPPB_SERVER_MAX_UPLOAD_SIZE_MEGA', apply_filters( 'wppb_server_max_upload_size_mega_constant', ini_get( 'upload_max_filesize') ) );
60 define( 'WPPB_SERVER_MAX_POST_SIZE_BYTE', apply_filters( 'wppb_server_max_post_size_byte_constant', wppb_return_bytes( ini_get( 'post_max_size') ) ) );
61 define( 'WPPB_SERVER_MAX_POST_SIZE_MEGA', apply_filters( 'wppb_server_max_post_size_mega_constant', ini_get( 'post_max_size') ) );
62 define( 'WPPB_TRANSLATE_DIR', WPPB_PLUGIN_DIR.'/translation' );
63 define( 'WPPB_TRANSLATE_DOMAIN', 'profilebuilder' );
64
65 /* include notices class */
66 if ( file_exists ( WPPB_PLUGIN_DIR.'/assets/lib/class_notices.php' ) )
67 include_once(WPPB_PLUGIN_DIR . '/assets/lib/class_notices.php' );
68
69 if ( file_exists ( WPPB_PLUGIN_DIR.'/modules/modules.php' ) )
70 define( 'PROFILE_BUILDER', 'Profile Builder Pro' );
71 elseif ( file_exists ( WPPB_PLUGIN_DIR.'/front-end/extra-fields/extra-fields.php' ) )
72 define( 'PROFILE_BUILDER', 'Profile Builder Hobbyist' );
73 else
74 define( 'PROFILE_BUILDER', 'Profile Builder Free' );
75
76 /**
77 * Initialize the translation for the Plugin.
78 *
79 * @since v.1.0
80 *
81 * @return null
82 */
83 function wppb_init_translation(){
84 load_plugin_textdomain( 'profilebuilder', false, basename( dirname( __FILE__ ) ) . '/translation/' );
85 }
86 add_action( 'init', 'wppb_init_translation' );
87
88
89 /**
90 * Required files
91 *
92 *
93 */
94 include_once( WPPB_PLUGIN_DIR.'/assets/lib/wck-api/wordpress-creation-kit.php' );
95 include_once( WPPB_PLUGIN_DIR.'/features/upgrades/upgrades.php' );
96 include_once( WPPB_PLUGIN_DIR.'/features/functions.php' );
97 include_once( WPPB_PLUGIN_DIR.'/admin/admin-functions.php' );
98 include_once( WPPB_PLUGIN_DIR.'/admin/basic-info.php' );
99 include_once( WPPB_PLUGIN_DIR.'/admin/general-settings.php' );
100 include_once( WPPB_PLUGIN_DIR.'/admin/admin-bar.php' );
101 include_once( WPPB_PLUGIN_DIR.'/admin/manage-fields.php' );
102 include_once( WPPB_PLUGIN_DIR.'/features/email-confirmation/email-confirmation.php' );
103 include_once( WPPB_PLUGIN_DIR.'/features/email-confirmation/class-email-confirmation.php' );
104 if ( file_exists ( WPPB_PLUGIN_DIR.'/features/admin-approval/admin-approval.php' ) ) {
105 include_once(WPPB_PLUGIN_DIR . '/features/admin-approval/admin-approval.php');
106 include_once(WPPB_PLUGIN_DIR . '/features/admin-approval/class-admin-approval.php');
107 }
108 include_once( WPPB_PLUGIN_DIR.'/features/login-widget/login-widget.php' );
109
110 if ( file_exists ( WPPB_PLUGIN_DIR.'/update/update-checker.php' ) ){
111 include_once ( WPPB_PLUGIN_DIR.'/update/update-checker.php' );
112 include_once ( WPPB_PLUGIN_DIR.'/admin/register-version.php' );
113 }
114
115 if ( file_exists ( WPPB_PLUGIN_DIR.'/modules/modules.php' ) ){
116 include_once ( WPPB_PLUGIN_DIR.'/modules/modules.php' );
117 include_once ( WPPB_PLUGIN_DIR.'/modules/custom-redirects/custom-redirects.php' );
118 include_once ( WPPB_PLUGIN_DIR.'/modules/email-customizer/email-customizer.php' );
119 include_once ( WPPB_PLUGIN_DIR.'/modules/multiple-forms/multiple-forms.php' );
120
121 $wppb_module_settings = get_option( 'wppb_module_settings' );
122 if ( isset( $wppb_module_settings['wppb_userListing'] ) && ( $wppb_module_settings['wppb_userListing'] == 'show' ) ){
123 include_once ( WPPB_PLUGIN_DIR.'/modules/user-listing/userlisting.php' );
124 add_shortcode( 'wppb-list-users', 'wppb_user_listing_shortcode' );
125 }else
126 add_shortcode( 'wppb-list-users', 'wppb_list_all_users_display_error' );
127
128 if ( isset( $wppb_module_settings['wppb_emailCustomizerAdmin'] ) && ( $wppb_module_settings['wppb_emailCustomizerAdmin'] == 'show' ) )
129 include_once ( WPPB_PLUGIN_DIR.'/modules/email-customizer/admin-email-customizer.php' );
130
131 if ( isset( $wppb_module_settings['wppb_emailCustomizer'] ) && ( $wppb_module_settings['wppb_emailCustomizer'] == 'show' ) )
132 include_once ( WPPB_PLUGIN_DIR.'/modules/email-customizer/user-email-customizer.php' );
133 }
134
135
136 /**
137 * Check for updates
138 *
139 *
140 */
141 if ( file_exists ( WPPB_PLUGIN_DIR.'/update/update-checker.php' ) ){
142 if ( file_exists ( WPPB_PLUGIN_DIR.'/modules/modules.php' ) ){
143 $localSerial = get_option( 'wppb_profile_builder_pro_serial' );
144 $wppb_update = new wppb_PluginUpdateChecker( 'http://updatemetadata.cozmoslabs.com/?localSerialNumber='.$localSerial.'&uniqueproduct=CLPBP', __FILE__, 'profile-builder-pro-update' );
145
146 }else{
147 $localSerial = get_option( 'wppb_profile_builder_hobbyist_serial' );
148 $wppb_update = new wppb_PluginUpdateChecker( 'http://updatemetadata.cozmoslabs.com/?localSerialNumber='.$localSerial.'&uniqueproduct=CLPBH', __FILE__, 'profile-builder-hobbyist-update' );
149 }
150 }
151
152
153 // these settings are important, so besides running them on page load, we also need to do a check on plugin activation
154 register_activation_hook( __FILE__, 'wppb_generate_default_settings_defaults' ); //prepoulate general settings
155 register_activation_hook( __FILE__, 'wppb_prepopulate_fields' ); //prepopulate manage fields list
156
157 /* Add a halloween notice */
158 new WPPB_Add_General_Notices( 'wppb_halloween',
159 sprintf( __( '<p style="position:relative;">Halloween treat: 30&#37; OFF on all Profile Builder purchases 29 - 30 -31 October over at %1$swww.cozmslabs.com%2$s Get your discount code! %3$sDismiss%4$s</p>', 'profilebuilder'), "<a href='http://www.cozmoslabs.com/' target='_blank' class='button-primary'>", "</a>", "<a href='". add_query_arg( 'wppb_halloween_dismiss_notification', '0' ) ."' class='wppb-dismiss-notification' style='position: absolute;right: 0;top: 50%;margin-top: -7px;'>", "</a>" ),
160 'updated halloween',
161 '28 October 2014',
162 '1 November 2014' );