Simple Membership - Version 3.2.5

Version Description

  • Added a new feature to enable redirection to the last page after login (where they clicked the login link). This new option is available in the after login redirection addon. https://wordpress.org/plugins/simple-membership-after-login-redirection/
Download this release

Release Info

Developer mra13
Plugin Icon 128x128 Simple Membership
Version 3.2.5
Comparing to
See all releases

Code changes from version 3.2.3 to 3.2.5

classes/class.simple-wp-membership.php CHANGED
@@ -110,11 +110,12 @@ class SimpleWpMembership {
110
  if (has_post_thumbnail($post_id)) {
111
  return $content;
112
  }
113
- if ($acl->can_i_read_post($post_id)) {
 
 
114
  return $content;
115
  }
116
 
117
-
118
  if (isset($content['file'])) {
119
  $content['file'] = 'restricted-icon.png';
120
  $content['width'] = '400';
@@ -130,7 +131,7 @@ class SimpleWpMembership {
130
  $content['sizes']['medium']['file'] = 'restricted-icon.png';
131
  $content['sizes']['medium']['mime-type'] = 'image/png';
132
  }
133
- if ($content['sizes']['post-thumbnail']) {
134
  $content['sizes']['post-thumbnail']['file'] = 'restricted-icon.png';
135
  $content['sizes']['post-thumbnail']['mime-type'] = 'image/png';
136
  }
@@ -147,7 +148,8 @@ class SimpleWpMembership {
147
  return $content;
148
  }
149
 
150
- if ($acl->can_i_read_post($post_id)) {
 
151
  return $content;
152
  }
153
 
110
  if (has_post_thumbnail($post_id)) {
111
  return $content;
112
  }
113
+
114
+ $post = get_post($post_id);
115
+ if ($acl->can_i_read_post($post)) {
116
  return $content;
117
  }
118
 
 
119
  if (isset($content['file'])) {
120
  $content['file'] = 'restricted-icon.png';
121
  $content['width'] = '400';
131
  $content['sizes']['medium']['file'] = 'restricted-icon.png';
132
  $content['sizes']['medium']['mime-type'] = 'image/png';
133
  }
134
+ if (isset($content['sizes']['post-thumbnail'])) {
135
  $content['sizes']['post-thumbnail']['file'] = 'restricted-icon.png';
136
  $content['sizes']['post-thumbnail']['mime-type'] = 'image/png';
137
  }
148
  return $content;
149
  }
150
 
151
+ $post = get_post($post_id);
152
+ if ($acl->can_i_read_post($post)) {
153
  return $content;
154
  }
155
 
classes/class.swpm-access-control.php CHANGED
@@ -18,7 +18,8 @@ class SwpmAccessControl {
18
 
19
  public function can_i_read_post($post){
20
  if (!is_a($post, 'WP_Post')) {
21
- return SwpmUtils::_('Error! $post is not a valid WP_Post object.');
 
22
  }
23
 
24
  $id = $post->ID;
@@ -87,7 +88,8 @@ class SwpmAccessControl {
87
 
88
  public function can_i_read_comment($comment){
89
  if (!is_a($comment, 'WP_Comment')) {
90
- return SwpmUtils::_('Error! $comment is not a valid WP_Comment object.');
 
91
  }
92
 
93
  $id = $comment->comment_ID;
@@ -154,7 +156,9 @@ class SwpmAccessControl {
154
 
155
  public function filter_post($post,$content){
156
  if (!is_a($post, 'WP_Post')) {
157
- return SwpmUtils::_('Error! $post is not a valid WP_Post object.');
 
 
158
  }
159
 
160
  if(self::expired_user_has_access_to_this_page()) {
18
 
19
  public function can_i_read_post($post){
20
  if (!is_a($post, 'WP_Post')) {
21
+ //This is not a WP_Post object. So we don't want to handle it in our plugin.
22
+ return true;
23
  }
24
 
25
  $id = $post->ID;
88
 
89
  public function can_i_read_comment($comment){
90
  if (!is_a($comment, 'WP_Comment')) {
91
+ //This is not a valid WP_Comment object. So we don't want to handle it in our plugin.
92
+ return true;
93
  }
94
 
95
  $id = $comment->comment_ID;
156
 
157
  public function filter_post($post,$content){
158
  if (!is_a($post, 'WP_Post')) {
159
+ //This is not a WP_Post object. So we don't want to handle it in our plugin.
160
+ return $content;
161
+ //return SwpmUtils::_('Error! $post is not a valid WP_Post object.');
162
  }
163
 
164
  if(self::expired_user_has_access_to_this_page()) {
classes/class.swpm-utils-misc.php CHANGED
@@ -203,14 +203,22 @@ class SwpmMiscUtils {
203
  $msg_body = str_replace($tags, $vals, $msg_body);
204
  return $msg_body;
205
  }
 
206
  public static function get_login_link() {
207
- $login = SwpmSettings::get_instance()->get_value('login-page-url');
208
- $joinus = SwpmSettings::get_instance()->get_value('join-us-page-url');
209
- if (empty($login) || empty($joinus)) {
210
- return '<span style="color:red;">Simple Membership is not configured correctly.'
211
  . 'Please contact <a href="mailto:' . get_option('admin_email') . '">Admin</a>';
212
  }
213
- return SwpmUtils::_('Please') . ' <a class="swpm-login-link" href="' . $login . '">' . SwpmUtils::_('Login') . '</a>. ' . SwpmUtils::_('Not a Member?') . ' <a href="' . $joinus . '">' . SwpmUtils::_('Join Us') . '</a>';
 
 
 
 
 
 
 
214
  }
215
 
216
  public static function get_renewal_link() {
203
  $msg_body = str_replace($tags, $vals, $msg_body);
204
  return $msg_body;
205
  }
206
+
207
  public static function get_login_link() {
208
+ $login_url = SwpmSettings::get_instance()->get_value('login-page-url');
209
+ $joinus_url = SwpmSettings::get_instance()->get_value('join-us-page-url');
210
+ if (empty($login_url) || empty($joinus_url)) {
211
+ return '<span style="color:red;">Simple Membership is not configured correctly. The login page or the join us page URL is missing in the settings configuration. '
212
  . 'Please contact <a href="mailto:' . get_option('admin_email') . '">Admin</a>';
213
  }
214
+
215
+ //Create the login/protection message
216
+ $filtered_login_url = apply_filters('swpm_get_login_link_url', $login_url);//Addons can override the login URL value using this filter.
217
+ $login_msg = '';
218
+ $login_msg .= SwpmUtils::_('Please') . ' <a class="swpm-login-link" href="' . $filtered_login_url . '">' . SwpmUtils::_('Login') . '</a>. ';
219
+ $login_msg .= SwpmUtils::_('Not a Member?') . ' <a href="' . $joinus_url . '">' . SwpmUtils::_('Join Us') . '</a>';
220
+
221
+ return $login_msg;
222
  }
223
 
224
  public static function get_renewal_link() {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://simple-membership-plugin.com/
4
  Tags: member, members, members only, membership, memberships, register, WordPress membership plugin, content, content protection, paypal, restrict, restrict access, Restrict content, admin, access control, subscription, teaser, protection, profile, login, login page, bbpress,
5
  Requires at least: 3.3
6
  Tested up to: 4.5
7
- Stable tag: 3.2.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -52,6 +52,7 @@ You can create a free forum user account and ask your questions.
52
 
53
  * Works with any WordPress theme.
54
  * Ability to protect photo galleries.
 
55
  * Show teaser content to convert visitors into members.
56
  * Comments on your protected posts will also be protected automatically.
57
  * There is an option to enable debug logging so you can troubleshoot membership payment related issues easily (if any).
@@ -122,6 +123,14 @@ https://simple-membership-plugin.com/
122
 
123
  == Changelog ==
124
 
 
 
 
 
 
 
 
 
125
  = 3.2.3 =
126
  - Added a new option so you can configure a membership account renewal page in the plugin.
127
  - The account expiry message will include the renewal page link (if you configure the renewal page).
4
  Tags: member, members, members only, membership, memberships, register, WordPress membership plugin, content, content protection, paypal, restrict, restrict access, Restrict content, admin, access control, subscription, teaser, protection, profile, login, login page, bbpress,
5
  Requires at least: 3.3
6
  Tested up to: 4.5
7
+ Stable tag: 3.2.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
52
 
53
  * Works with any WordPress theme.
54
  * Ability to protect photo galleries.
55
+ * Ability to protect attachment pages.
56
  * Show teaser content to convert visitors into members.
57
  * Comments on your protected posts will also be protected automatically.
58
  * There is an option to enable debug logging so you can troubleshoot membership payment related issues easily (if any).
123
 
124
  == Changelog ==
125
 
126
+ = 3.2.5 =
127
+ - Added a new feature to enable redirection to the last page after login (where they clicked the login link).
128
+ This new option is available in the after login redirection addon.
129
+ https://wordpress.org/plugins/simple-membership-after-login-redirection/
130
+
131
+ = 3.2.4 =
132
+ - Fixed a bug with attachment protection showing an error message.
133
+
134
  = 3.2.3 =
135
  - Added a new option so you can configure a membership account renewal page in the plugin.
136
  - The account expiry message will include the renewal page link (if you configure the renewal page).
simple-wp-membership.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Simple WordPress Membership
4
- Version: 3.2.3
5
  Plugin URI: https://simple-membership-plugin.com/
6
  Author: smp7, wp.insider
7
  Author URI: https://simple-membership-plugin.com/
@@ -17,7 +17,7 @@ include_once('classes/class.simple-wp-membership.php');
17
  include_once('classes/class.swpm-cronjob.php');
18
  include_once('swpm-compat.php');
19
 
20
- define('SIMPLE_WP_MEMBERSHIP_VER', '3.2.3');
21
  define('SIMPLE_WP_MEMBERSHIP_DB_VER', '1.2');
22
  define('SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL', home_url());
23
  define('SIMPLE_WP_MEMBERSHIP_PATH', dirname(__FILE__) . '/');
1
  <?php
2
  /*
3
  Plugin Name: Simple WordPress Membership
4
+ Version: 3.2.5
5
  Plugin URI: https://simple-membership-plugin.com/
6
  Author: smp7, wp.insider
7
  Author URI: https://simple-membership-plugin.com/
17
  include_once('classes/class.swpm-cronjob.php');
18
  include_once('swpm-compat.php');
19
 
20
+ define('SIMPLE_WP_MEMBERSHIP_VER', '3.2.4');
21
  define('SIMPLE_WP_MEMBERSHIP_DB_VER', '1.2');
22
  define('SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL', home_url());
23
  define('SIMPLE_WP_MEMBERSHIP_PATH', dirname(__FILE__) . '/');