Version Description
- Added comment protection. Comments on your protected posts will also be protected automatically.
- Added a new feature to hide the admin toolbar for logged in users of the site.
- Bug fix: password reset email not sent correctly
- Bug fix: page rendering issue after the member updates the profile.
Download this release
Release Info
| Developer | mra13 |
| Plugin | |
| Version | 1.6 |
| Comparing to | |
| See all releases | |
Code changes from version 1.5.1 to 1.6
- classes/class.bFrontRegistration.php +7 -4
- classes/class.bRegistration.php +2 -1
- classes/class.bSettings.php +38 -27
- classes/class.bUtils.php +6 -0
- classes/class.simple-wp-membership.php +7 -1
- readme.txt +10 -2
- simple-wp-membership.php +2 -2
classes/class.bFrontRegistration.php
CHANGED
|
@@ -54,7 +54,7 @@ class BFrontRegistration extends BRegistration {
|
|
| 54 |
public function register() {
|
| 55 |
if($this->create_swpm_user()&&$this->create_wp_user()&&$this->send_reg_email()){
|
| 56 |
do_action('swpm_front_end_registration_complete');
|
| 57 |
-
|
| 58 |
$login_page_url = BSettings::get_instance()->get_value('login-page-url');
|
| 59 |
$after_rego_msg = '<p>Registration Successful. Please <a href="' . $login_page_url . '">Login</a></p>';
|
| 60 |
$message = array('succeeded' => true, 'message' => $after_rego_msg);
|
|
@@ -147,7 +147,6 @@ class BFrontRegistration extends BRegistration {
|
|
| 147 |
}
|
| 148 |
$wpdb->update(
|
| 149 |
$wpdb->prefix . "swpm_members_tbl", $member_info, array('member_id' => $auth->get('member_id')));
|
| 150 |
-
echo '<pre>';
|
| 151 |
$message = array('succeeded' => true, 'message' => 'Profile Updated.');
|
| 152 |
BTransfer::get_instance()->set('status', $message);
|
| 153 |
} else {
|
|
@@ -179,15 +178,19 @@ class BFrontRegistration extends BRegistration {
|
|
| 179 |
}
|
| 180 |
$settings = BSettings::get_instance();
|
| 181 |
$password = wp_generate_password();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
$body = $settings->get_value('reset-mail-body');
|
| 183 |
$subject = $settings->get_value('reset-mail-subject');
|
| 184 |
-
$wpdb->update($wpdb->prefix . "swpm_members_tbl", array('password' => $password), array('member_id' => $user->member_id));
|
| 185 |
$search = array('{user_name}', '{first_name}', '{last_name}', '{password}');
|
| 186 |
$replace = array($user->user_name, $user->first_name, $user->last_name, $password);
|
| 187 |
$body = str_replace($search, $replace, $body);
|
| 188 |
$from = $settings->get_value('email-from');
|
| 189 |
$headers = "From: " . $from . "\r\n";
|
| 190 |
-
wp_mail($
|
| 191 |
$message = "New password has been sent to your email address.";
|
| 192 |
$message = array('succeeded' => false, 'message' => $message);
|
| 193 |
BTransfer::get_instance()->set('status', $message);
|
| 54 |
public function register() {
|
| 55 |
if($this->create_swpm_user()&&$this->create_wp_user()&&$this->send_reg_email()){
|
| 56 |
do_action('swpm_front_end_registration_complete');
|
| 57 |
+
|
| 58 |
$login_page_url = BSettings::get_instance()->get_value('login-page-url');
|
| 59 |
$after_rego_msg = '<p>Registration Successful. Please <a href="' . $login_page_url . '">Login</a></p>';
|
| 60 |
$message = array('succeeded' => true, 'message' => $after_rego_msg);
|
| 147 |
}
|
| 148 |
$wpdb->update(
|
| 149 |
$wpdb->prefix . "swpm_members_tbl", $member_info, array('member_id' => $auth->get('member_id')));
|
|
|
|
| 150 |
$message = array('succeeded' => true, 'message' => 'Profile Updated.');
|
| 151 |
BTransfer::get_instance()->set('status', $message);
|
| 152 |
} else {
|
| 178 |
}
|
| 179 |
$settings = BSettings::get_instance();
|
| 180 |
$password = wp_generate_password();
|
| 181 |
+
include_once(ABSPATH . WPINC . '/class-phpass.php');
|
| 182 |
+
$wp_hasher = new PasswordHash(8, TRUE);
|
| 183 |
+
$password_hash = $wp_hasher->HashPassword(trim($password)); //should use $saned??;
|
| 184 |
+
$wpdb->update($wpdb->prefix . "swpm_members_tbl", array('password' => $password_hash), array('member_id' => $user->member_id));
|
| 185 |
+
|
| 186 |
$body = $settings->get_value('reset-mail-body');
|
| 187 |
$subject = $settings->get_value('reset-mail-subject');
|
|
|
|
| 188 |
$search = array('{user_name}', '{first_name}', '{last_name}', '{password}');
|
| 189 |
$replace = array($user->user_name, $user->first_name, $user->last_name, $password);
|
| 190 |
$body = str_replace($search, $replace, $body);
|
| 191 |
$from = $settings->get_value('email-from');
|
| 192 |
$headers = "From: " . $from . "\r\n";
|
| 193 |
+
wp_mail($email, $subject, $body, $headers);
|
| 194 |
$message = "New password has been sent to your email address.";
|
| 195 |
$message = array('succeeded' => false, 'message' => $message);
|
| 196 |
BTransfer::get_instance()->set('status', $message);
|
classes/class.bRegistration.php
CHANGED
|
@@ -35,7 +35,8 @@ abstract class BRegistration {
|
|
| 35 |
return '{'.$n .'}';
|
| 36 |
}, array_keys($member_info));
|
| 37 |
$body = str_replace($keys, $values, $body);
|
| 38 |
-
|
|
|
|
| 39 |
if ($settings->get_value('enable-admin-notification-after-reg')) {
|
| 40 |
$subject = "Notification of New Member Registration";
|
| 41 |
$body = "A new member has registered. The following email was sent to the member." .
|
| 35 |
return '{'.$n .'}';
|
| 36 |
}, array_keys($member_info));
|
| 37 |
$body = str_replace($keys, $values, $body);
|
| 38 |
+
$email = sanitize_email(filter_input(INPUT_POST, 'email', FILTER_UNSAFE_RAW));
|
| 39 |
+
wp_mail(trim($email), $subject, $body, $headers);
|
| 40 |
if ($settings->get_value('enable-admin-notification-after-reg')) {
|
| 41 |
$subject = "Notification of New Member Registration";
|
| 42 |
$body = "A new member has registered. The following email was sent to the member." .
|
classes/class.bSettings.php
CHANGED
|
@@ -25,49 +25,53 @@ class BSettings {
|
|
| 25 |
}
|
| 26 |
private function tab_1() {
|
| 27 |
register_setting('swpm-settings-tab-1', 'swpm-settings', array(&$this, 'sanitize_tab_1'));
|
| 28 |
-
add_settings_section('swpm-documentation', 'Plugin Documentation',
|
| 29 |
array(&$this, 'swpm_documentation_callback'), 'simple_wp_membership_settings');
|
| 30 |
-
add_settings_section('general-settings', 'General Settings',
|
| 31 |
array(&$this, 'general_settings_callback'), 'simple_wp_membership_settings');
|
| 32 |
-
add_settings_field('enable-free-membership', 'Enable Free Membership',
|
| 33 |
array(&$this, 'checkbox_callback'), 'simple_wp_membership_settings', 'general-settings',
|
| 34 |
array('item' => 'enable-free-membership',
|
| 35 |
-
'message'=>''));
|
| 36 |
-
add_settings_field('free-membership-id', 'Free Membership Level ID',
|
| 37 |
array(&$this, 'textfield_small_callback'), 'simple_wp_membership_settings', 'general-settings',
|
| 38 |
array('item' => 'free-membership-id',
|
| 39 |
-
'message'=>''));
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
-
add_settings_section('pages-settings', 'Pages Settings',
|
| 42 |
array(&$this, 'pages_settings_callback'), 'simple_wp_membership_settings');
|
| 43 |
-
add_settings_field('login-page-url', 'Login Page URL',
|
| 44 |
array(&$this, 'textfield_long_callback'), 'simple_wp_membership_settings', 'pages-settings',
|
| 45 |
array('item' => 'login-page-url',
|
| 46 |
'message'=>''));
|
| 47 |
-
add_settings_field('registration-page-url', 'Registration Page URL',
|
| 48 |
array(&$this, 'textfield_long_callback'), 'simple_wp_membership_settings', 'pages-settings',
|
| 49 |
array('item' => 'registration-page-url',
|
| 50 |
'message'=>''));
|
| 51 |
-
add_settings_field('join-us-page-url', 'Join Us Page URL',
|
| 52 |
array(&$this, 'textfield_long_callback'), 'simple_wp_membership_settings', 'pages-settings',
|
| 53 |
array('item' => 'join-us-page-url',
|
| 54 |
'message'=>''));
|
| 55 |
-
add_settings_field('profile-page-url', 'Edit Profile Page URL',
|
| 56 |
array(&$this, 'textfield_long_callback'), 'simple_wp_membership_settings', 'pages-settings',
|
| 57 |
array('item' => 'profile-page-url',
|
| 58 |
'message'=>''));
|
| 59 |
-
add_settings_field('reset-page-url', 'Password Reset Page URL',
|
| 60 |
array(&$this, 'textfield_long_callback'), 'simple_wp_membership_settings', 'pages-settings',
|
| 61 |
array('item' => 'reset-page-url',
|
| 62 |
'message'=>''));
|
| 63 |
|
| 64 |
-
add_settings_section('debug-settings', 'Test & Debug Settings',
|
| 65 |
array(&$this, 'testndebug_settings_callback'), 'simple_wp_membership_settings');
|
| 66 |
add_settings_field('enable-debug', 'Enable Debug',
|
| 67 |
array(&$this, 'checkbox_callback'), 'simple_wp_membership_settings', 'debug-settings',
|
| 68 |
array('item' => 'enable-debug',
|
| 69 |
'message'=>'Check this option to enable debug logging. View debug log file <a href="'.SIMPLE_WP_MEMBERSHIP_URL.'/log.txt" target="_blank">here</a>.'));
|
| 70 |
-
add_settings_field('enable-sandbox-testing', 'Enable Sandbox Testing',
|
| 71 |
array(&$this, 'checkbox_callback'), 'simple_wp_membership_settings', 'debug-settings',
|
| 72 |
array('item' => 'enable-sandbox-testing',
|
| 73 |
'message'=>'Enable this option if you want to do sandbox payment testing.'));
|
|
@@ -83,50 +87,50 @@ class BSettings {
|
|
| 83 |
private function tab_3() {
|
| 84 |
register_setting('swpm-settings-tab-3', 'swpm-settings', array(&$this, 'sanitize_tab_3'));
|
| 85 |
|
| 86 |
-
add_settings_section('email-misc-settings', 'Email Misc. Settings',
|
| 87 |
array(&$this, 'email_misc_settings_callback'), 'simple_wp_membership_settings');
|
| 88 |
-
add_settings_field('email-misc-from', 'From Email Address',
|
| 89 |
array(&$this, 'textfield_callback'), 'simple_wp_membership_settings', 'email-misc-settings',
|
| 90 |
array('item' => 'email-from',
|
| 91 |
'message'=>'field specific message.'));
|
| 92 |
|
| 93 |
-
add_settings_section('reg-prompt-email-settings', 'Email Settings (Prompt to Complete Registration )',
|
| 94 |
array(&$this, 'reg_prompt_email_settings_callback'), 'simple_wp_membership_settings');
|
| 95 |
-
add_settings_field('reg-prompt-complete-mail-subject', 'Email Subject',
|
| 96 |
array(&$this, 'textfield_callback'), 'simple_wp_membership_settings', 'reg-prompt-email-settings',
|
| 97 |
array('item' => 'reg-prompt-complete-mail-subject',
|
| 98 |
'message'=>''));
|
| 99 |
-
add_settings_field('reg-prompt-complete-mail-body', 'Email Body',
|
| 100 |
array(&$this, 'textarea_callback'), 'simple_wp_membership_settings', 'reg-prompt-email-settings',
|
| 101 |
array('item' => 'reg-prompt-complete-mail-body',
|
| 102 |
'message'=>''));
|
| 103 |
|
| 104 |
-
add_settings_section('reg-email-settings', 'Email Settings (Registration Complete)',
|
| 105 |
array(&$this, 'reg_email_settings_callback'), 'simple_wp_membership_settings');
|
| 106 |
-
add_settings_field('reg-complete-mail-subject', 'Email Subject',
|
| 107 |
array(&$this, 'textfield_callback'), 'simple_wp_membership_settings', 'reg-email-settings',
|
| 108 |
array('item' => 'reg-complete-mail-subject',
|
| 109 |
'message'=>''));
|
| 110 |
-
add_settings_field('reg-complete-mail-body', 'Email Body',
|
| 111 |
array(&$this, 'textarea_callback'), 'simple_wp_membership_settings', 'reg-email-settings',
|
| 112 |
array('item' => 'reg-complete-mail-body',
|
| 113 |
'message'=>''));
|
| 114 |
-
add_settings_field('enable-admin-notification-after-reg', 'Send Notification To Admin',
|
| 115 |
array(&$this, 'checkbox_callback'), 'simple_wp_membership_settings', 'reg-email-settings',
|
| 116 |
array('item' => 'enable-admin-notification-after-reg',
|
| 117 |
'message'=>''));
|
| 118 |
-
add_settings_field('enable-notification-after-manual-user-add', 'Send Email to Member When Added via Admin Dashboard',
|
| 119 |
array(&$this, 'checkbox_callback'), 'simple_wp_membership_settings', 'reg-email-settings',
|
| 120 |
array('item' => 'enable-notification-after-manual-user-add',
|
| 121 |
'message'=>''));
|
| 122 |
|
| 123 |
-
add_settings_section('upgrade-email-settings', ' Email Settings (Account Upgrade Notification)',
|
| 124 |
array(&$this, 'upgrade_email_settings_callback'), 'simple_wp_membership_settings');
|
| 125 |
-
add_settings_field('upgrade-complete-mail-subject', 'Email Subject',
|
| 126 |
array(&$this, 'textfield_callback'), 'simple_wp_membership_settings', 'upgrade-email-settings',
|
| 127 |
array('item' => 'upgrade-complete-mail-subject',
|
| 128 |
'message'=>''));
|
| 129 |
-
add_settings_field('upgrade-complete-mail-body', 'Email Body',
|
| 130 |
array(&$this, 'textarea_callback'), 'simple_wp_membership_settings', 'upgrade-email-settings',
|
| 131 |
array('item' => 'upgrade-complete-mail-body',
|
| 132 |
'message'=>''));
|
|
@@ -221,6 +225,13 @@ class BSettings {
|
|
| 221 |
}
|
| 222 |
$output = $this->settings;
|
| 223 |
//general settings block
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
if (isset($input['enable-free-membership'])){
|
| 225 |
$output['enable-free-membership'] = esc_url($input['enable-free-membership']);
|
| 226 |
}
|
| 25 |
}
|
| 26 |
private function tab_1() {
|
| 27 |
register_setting('swpm-settings-tab-1', 'swpm-settings', array(&$this, 'sanitize_tab_1'));
|
| 28 |
+
add_settings_section('swpm-documentation', BUtils::_('Plugin Documentation'),
|
| 29 |
array(&$this, 'swpm_documentation_callback'), 'simple_wp_membership_settings');
|
| 30 |
+
add_settings_section('general-settings', BUtils::_('General Settings'),
|
| 31 |
array(&$this, 'general_settings_callback'), 'simple_wp_membership_settings');
|
| 32 |
+
add_settings_field('enable-free-membership', BUtils::_('Enable Free Membership'),
|
| 33 |
array(&$this, 'checkbox_callback'), 'simple_wp_membership_settings', 'general-settings',
|
| 34 |
array('item' => 'enable-free-membership',
|
| 35 |
+
'message'=> BUtils::_('Enable/disable registration for free membership level')));
|
| 36 |
+
add_settings_field('free-membership-id', BUtils::_('Free Membership Level ID'),
|
| 37 |
array(&$this, 'textfield_small_callback'), 'simple_wp_membership_settings', 'general-settings',
|
| 38 |
array('item' => 'free-membership-id',
|
| 39 |
+
'message'=> BUtils::_('Assign free membership level ID')));
|
| 40 |
+
add_settings_field('hide-adminbar', BUtils::_('Hide Adminbar'),
|
| 41 |
+
array(&$this, 'checkbox_callback'), 'simple_wp_membership_settings', 'general-settings',
|
| 42 |
+
array('item' => 'hide-adminbar',
|
| 43 |
+
'message'=>BUtils::_('WordPress shows an admin toolbar to the logged in users of the site. Check this box if you want to hide that admin toolbar in the fronend of your site.')));
|
| 44 |
|
| 45 |
+
add_settings_section('pages-settings', BUtils::_('Pages Settings'),
|
| 46 |
array(&$this, 'pages_settings_callback'), 'simple_wp_membership_settings');
|
| 47 |
+
add_settings_field('login-page-url', BUtils::_('Login Page URL'),
|
| 48 |
array(&$this, 'textfield_long_callback'), 'simple_wp_membership_settings', 'pages-settings',
|
| 49 |
array('item' => 'login-page-url',
|
| 50 |
'message'=>''));
|
| 51 |
+
add_settings_field('registration-page-url', BUtils::_('Registration Page URL'),
|
| 52 |
array(&$this, 'textfield_long_callback'), 'simple_wp_membership_settings', 'pages-settings',
|
| 53 |
array('item' => 'registration-page-url',
|
| 54 |
'message'=>''));
|
| 55 |
+
add_settings_field('join-us-page-url', BUtils::_('Join Us Page URL'),
|
| 56 |
array(&$this, 'textfield_long_callback'), 'simple_wp_membership_settings', 'pages-settings',
|
| 57 |
array('item' => 'join-us-page-url',
|
| 58 |
'message'=>''));
|
| 59 |
+
add_settings_field('profile-page-url', BUtils::_('Edit Profile Page URL'),
|
| 60 |
array(&$this, 'textfield_long_callback'), 'simple_wp_membership_settings', 'pages-settings',
|
| 61 |
array('item' => 'profile-page-url',
|
| 62 |
'message'=>''));
|
| 63 |
+
add_settings_field('reset-page-url', BUtils::_('Password Reset Page URL'),
|
| 64 |
array(&$this, 'textfield_long_callback'), 'simple_wp_membership_settings', 'pages-settings',
|
| 65 |
array('item' => 'reset-page-url',
|
| 66 |
'message'=>''));
|
| 67 |
|
| 68 |
+
add_settings_section('debug-settings', BUtils::_('Test & Debug Settings'),
|
| 69 |
array(&$this, 'testndebug_settings_callback'), 'simple_wp_membership_settings');
|
| 70 |
add_settings_field('enable-debug', 'Enable Debug',
|
| 71 |
array(&$this, 'checkbox_callback'), 'simple_wp_membership_settings', 'debug-settings',
|
| 72 |
array('item' => 'enable-debug',
|
| 73 |
'message'=>'Check this option to enable debug logging. View debug log file <a href="'.SIMPLE_WP_MEMBERSHIP_URL.'/log.txt" target="_blank">here</a>.'));
|
| 74 |
+
add_settings_field('enable-sandbox-testing', BUtils::_('Enable Sandbox Testing'),
|
| 75 |
array(&$this, 'checkbox_callback'), 'simple_wp_membership_settings', 'debug-settings',
|
| 76 |
array('item' => 'enable-sandbox-testing',
|
| 77 |
'message'=>'Enable this option if you want to do sandbox payment testing.'));
|
| 87 |
private function tab_3() {
|
| 88 |
register_setting('swpm-settings-tab-3', 'swpm-settings', array(&$this, 'sanitize_tab_3'));
|
| 89 |
|
| 90 |
+
add_settings_section('email-misc-settings', BUtils::_('Email Misc. Settings'),
|
| 91 |
array(&$this, 'email_misc_settings_callback'), 'simple_wp_membership_settings');
|
| 92 |
+
add_settings_field('email-misc-from', BUtils::_('From Email Address'),
|
| 93 |
array(&$this, 'textfield_callback'), 'simple_wp_membership_settings', 'email-misc-settings',
|
| 94 |
array('item' => 'email-from',
|
| 95 |
'message'=>'field specific message.'));
|
| 96 |
|
| 97 |
+
add_settings_section('reg-prompt-email-settings', BUtils::_('Email Settings (Prompt to Complete Registration )'),
|
| 98 |
array(&$this, 'reg_prompt_email_settings_callback'), 'simple_wp_membership_settings');
|
| 99 |
+
add_settings_field('reg-prompt-complete-mail-subject', BUtils::_('Email Subject'),
|
| 100 |
array(&$this, 'textfield_callback'), 'simple_wp_membership_settings', 'reg-prompt-email-settings',
|
| 101 |
array('item' => 'reg-prompt-complete-mail-subject',
|
| 102 |
'message'=>''));
|
| 103 |
+
add_settings_field('reg-prompt-complete-mail-body', BUtils::_('Email Body'),
|
| 104 |
array(&$this, 'textarea_callback'), 'simple_wp_membership_settings', 'reg-prompt-email-settings',
|
| 105 |
array('item' => 'reg-prompt-complete-mail-body',
|
| 106 |
'message'=>''));
|
| 107 |
|
| 108 |
+
add_settings_section('reg-email-settings', BUtils::_('Email Settings (Registration Complete)'),
|
| 109 |
array(&$this, 'reg_email_settings_callback'), 'simple_wp_membership_settings');
|
| 110 |
+
add_settings_field('reg-complete-mail-subject', BUtils::_('Email Subject'),
|
| 111 |
array(&$this, 'textfield_callback'), 'simple_wp_membership_settings', 'reg-email-settings',
|
| 112 |
array('item' => 'reg-complete-mail-subject',
|
| 113 |
'message'=>''));
|
| 114 |
+
add_settings_field('reg-complete-mail-body', BUtils::_('Email Body'),
|
| 115 |
array(&$this, 'textarea_callback'), 'simple_wp_membership_settings', 'reg-email-settings',
|
| 116 |
array('item' => 'reg-complete-mail-body',
|
| 117 |
'message'=>''));
|
| 118 |
+
add_settings_field('enable-admin-notification-after-reg', BUtils::_('Send Notification To Admin'),
|
| 119 |
array(&$this, 'checkbox_callback'), 'simple_wp_membership_settings', 'reg-email-settings',
|
| 120 |
array('item' => 'enable-admin-notification-after-reg',
|
| 121 |
'message'=>''));
|
| 122 |
+
add_settings_field('enable-notification-after-manual-user-add', BUtils::_('Send Email to Member When Added via Admin Dashboard'),
|
| 123 |
array(&$this, 'checkbox_callback'), 'simple_wp_membership_settings', 'reg-email-settings',
|
| 124 |
array('item' => 'enable-notification-after-manual-user-add',
|
| 125 |
'message'=>''));
|
| 126 |
|
| 127 |
+
add_settings_section('upgrade-email-settings', BUtils::_(' Email Settings (Account Upgrade Notification)'),
|
| 128 |
array(&$this, 'upgrade_email_settings_callback'), 'simple_wp_membership_settings');
|
| 129 |
+
add_settings_field('upgrade-complete-mail-subject', BUtils::_('Email Subject'),
|
| 130 |
array(&$this, 'textfield_callback'), 'simple_wp_membership_settings', 'upgrade-email-settings',
|
| 131 |
array('item' => 'upgrade-complete-mail-subject',
|
| 132 |
'message'=>''));
|
| 133 |
+
add_settings_field('upgrade-complete-mail-body', BUtils::_('Email Body'),
|
| 134 |
array(&$this, 'textarea_callback'), 'simple_wp_membership_settings', 'upgrade-email-settings',
|
| 135 |
array('item' => 'upgrade-complete-mail-body',
|
| 136 |
'message'=>''));
|
| 225 |
}
|
| 226 |
$output = $this->settings;
|
| 227 |
//general settings block
|
| 228 |
+
|
| 229 |
+
if (isset($input['hide-adminbar'])){
|
| 230 |
+
$output['hide-adminbar'] = esc_url($input['hide-adminbar']);
|
| 231 |
+
}
|
| 232 |
+
else{
|
| 233 |
+
$output['hide-adminbar'] = "";
|
| 234 |
+
}
|
| 235 |
if (isset($input['enable-free-membership'])){
|
| 236 |
$output['enable-free-membership'] = esc_url($input['enable-free-membership']);
|
| 237 |
}
|
classes/class.bUtils.php
CHANGED
|
@@ -178,4 +178,10 @@ class BUtils {
|
|
| 178 |
return false;
|
| 179 |
}
|
| 180 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
}
|
| 178 |
return false;
|
| 179 |
}
|
| 180 |
}
|
| 181 |
+
public static function _($msg){
|
| 182 |
+
return __($msg, 'swpm');
|
| 183 |
+
}
|
| 184 |
+
public static function e($msg){
|
| 185 |
+
_e($msg, 'swpm');
|
| 186 |
+
}
|
| 187 |
}
|
classes/class.simple-wp-membership.php
CHANGED
|
@@ -29,6 +29,7 @@ class SimpleWpMembership {
|
|
| 29 |
//add_action('admin_init', array(&$this, 'admin_init')); //This call has been moved inside 'init' function
|
| 30 |
add_action('init', array(&$this, 'init'));
|
| 31 |
add_filter('the_content', array(&$this, 'filter_content'));
|
|
|
|
| 32 |
//add_filter( 'the_content_more_link', array(&$this, 'filter_moretag'), 10, 2 );
|
| 33 |
add_filter('comment_text', array(&$this, 'filter_comment'));
|
| 34 |
add_action('save_post', array(&$this, 'save_postdata'));
|
|
@@ -55,6 +56,10 @@ class SimpleWpMembership {
|
|
| 55 |
add_action('admin_init', function (){BSettings::get_instance()->init_config_hooks();});
|
| 56 |
|
| 57 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
public function shutdown(){
|
| 59 |
BLog::writeall();
|
| 60 |
}
|
|
@@ -275,7 +280,8 @@ class SimpleWpMembership {
|
|
| 275 |
public function filter_comment($content) {
|
| 276 |
$acl = BAccessControl::get_instance();
|
| 277 |
global $comment;
|
| 278 |
-
return $acl->
|
|
|
|
| 279 |
}
|
| 280 |
|
| 281 |
public function filter_content($content) {
|
| 29 |
//add_action('admin_init', array(&$this, 'admin_init')); //This call has been moved inside 'init' function
|
| 30 |
add_action('init', array(&$this, 'init'));
|
| 31 |
add_filter('the_content', array(&$this, 'filter_content'));
|
| 32 |
+
add_filter('show_admin_bar', array(&$this, 'hide_adminbar'));
|
| 33 |
//add_filter( 'the_content_more_link', array(&$this, 'filter_moretag'), 10, 2 );
|
| 34 |
add_filter('comment_text', array(&$this, 'filter_comment'));
|
| 35 |
add_action('save_post', array(&$this, 'save_postdata'));
|
| 56 |
add_action('admin_init', function (){BSettings::get_instance()->init_config_hooks();});
|
| 57 |
|
| 58 |
}
|
| 59 |
+
public function hide_adminbar(){
|
| 60 |
+
$hide = BSettings::get_instance()->get_value('hide-adminbar');
|
| 61 |
+
return $hide? FALSE: TRUE;
|
| 62 |
+
}
|
| 63 |
public function shutdown(){
|
| 64 |
BLog::writeall();
|
| 65 |
}
|
| 280 |
public function filter_comment($content) {
|
| 281 |
$acl = BAccessControl::get_instance();
|
| 282 |
global $comment;
|
| 283 |
+
return $acl->filter_post($comment->comment_post_ID, $content);
|
| 284 |
+
//return $acl->filter_comment($comment->comment_ID, $content);
|
| 285 |
}
|
| 286 |
|
| 287 |
public function filter_content($content) {
|
readme.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
=== Simple Membership ===
|
| 2 |
Contributors: smp7, wp.insider
|
| 3 |
Donate link: https://simple-membership-plugin.com/
|
| 4 |
-
Tags: member, members, members only, membership, memberships, register, WordPress membership plugin, content protection, paypal, restrict access, Restrict content
|
| 5 |
Requires at least: 3.3
|
| 6 |
Tested up to: 3.9.1
|
| 7 |
Stable tag: 1.5.1
|
|
@@ -42,11 +42,13 @@ You can create a free forum user account and ask your question in the above foru
|
|
| 42 |
|
| 43 |
= Miscellaneous =
|
| 44 |
|
|
|
|
| 45 |
* Ability to protect photo galleries.
|
|
|
|
| 46 |
* There is an option to enable debug logging so you can troubleshoot membership payment related issues easily (if any).
|
| 47 |
* Membership management side is handled by the plugin.
|
| 48 |
* Can be translated to any language.
|
| 49 |
-
*
|
| 50 |
* The login and registration widgets will be responsive if you are using a responsive theme.
|
| 51 |
|
| 52 |
== Installation ==
|
|
@@ -67,6 +69,12 @@ https://simple-membership-plugin.com/
|
|
| 67 |
|
| 68 |
== Changelog ==
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
= 1.5.1 =
|
| 71 |
- Compatibility with the after login redirection addon:
|
| 72 |
http://wordpress.org/plugins/simple-membership-after-login-redirection/
|
| 1 |
=== Simple Membership ===
|
| 2 |
Contributors: smp7, wp.insider
|
| 3 |
Donate link: https://simple-membership-plugin.com/
|
| 4 |
+
Tags: member, members, members only, membership, memberships, register, WordPress membership plugin, content protection, paypal, restrict access, Restrict content, admin
|
| 5 |
Requires at least: 3.3
|
| 6 |
Tested up to: 3.9.1
|
| 7 |
Stable tag: 1.5.1
|
| 42 |
|
| 43 |
= Miscellaneous =
|
| 44 |
|
| 45 |
+
* Works with any WordPress theme.
|
| 46 |
* Ability to protect photo galleries.
|
| 47 |
+
* Comments on your protected posts will also be protected automatically.
|
| 48 |
* There is an option to enable debug logging so you can troubleshoot membership payment related issues easily (if any).
|
| 49 |
* Membership management side is handled by the plugin.
|
| 50 |
* Can be translated to any language.
|
| 51 |
+
* Hide the admin toolbar from the frontend of your site.
|
| 52 |
* The login and registration widgets will be responsive if you are using a responsive theme.
|
| 53 |
|
| 54 |
== Installation ==
|
| 69 |
|
| 70 |
== Changelog ==
|
| 71 |
|
| 72 |
+
= 1.6 =
|
| 73 |
+
- Added comment protection. Comments on your protected posts will also be protected automatically.
|
| 74 |
+
- Added a new feature to hide the admin toolbar for logged in users of the site.
|
| 75 |
+
- Bug fix: password reset email not sent correctly
|
| 76 |
+
- Bug fix: page rendering issue after the member updates the profile.
|
| 77 |
+
|
| 78 |
= 1.5.1 =
|
| 79 |
- Compatibility with the after login redirection addon:
|
| 80 |
http://wordpress.org/plugins/simple-membership-after-login-redirection/
|
simple-wp-membership.php
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?php
|
| 2 |
/*
|
| 3 |
Plugin Name: Simple WordPress Membership
|
| 4 |
-
Version: v1.
|
| 5 |
Plugin URI: https://simple-membership-plugin.com/
|
| 6 |
Author: smp7, wp.insider
|
| 7 |
Author URI: https://simple-membership-plugin.com/
|
|
@@ -16,7 +16,7 @@ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"])){
|
|
| 16 |
include_once('classes/class.simple-wp-membership.php');
|
| 17 |
|
| 18 |
define('SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL', home_url());
|
| 19 |
-
define('SIMPLE_WP_MEMBERSHIP_VER', '1.
|
| 20 |
define('SIMPLE_WP_MEMBERSHIP_PATH', dirname(__FILE__) . '/');
|
| 21 |
define('SIMPLE_WP_MEMBERSHIP_URL', plugins_url('',__FILE__));
|
| 22 |
define('SIMPLE_WP_MEMBERSHIP_AUTH', 'simple_wp_membership_'. COOKIEHASH);
|
| 1 |
<?php
|
| 2 |
/*
|
| 3 |
Plugin Name: Simple WordPress Membership
|
| 4 |
+
Version: v1.6
|
| 5 |
Plugin URI: https://simple-membership-plugin.com/
|
| 6 |
Author: smp7, wp.insider
|
| 7 |
Author URI: https://simple-membership-plugin.com/
|
| 16 |
include_once('classes/class.simple-wp-membership.php');
|
| 17 |
|
| 18 |
define('SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL', home_url());
|
| 19 |
+
define('SIMPLE_WP_MEMBERSHIP_VER', '1.6');
|
| 20 |
define('SIMPLE_WP_MEMBERSHIP_PATH', dirname(__FILE__) . '/');
|
| 21 |
define('SIMPLE_WP_MEMBERSHIP_URL', plugins_url('',__FILE__));
|
| 22 |
define('SIMPLE_WP_MEMBERSHIP_AUTH', 'simple_wp_membership_'. COOKIEHASH);
|
