Simple Membership - Version 3.0.1

Version Description

  • Added a new CSS class to the registration complete message.
  • Added Portuguese (Portugal) language translation file. The translation was submitted by Edgar Sprecher.
  • Replaced mysql_real_escape_string() with esc_sql()
  • Members list in the admin is now sorted by member_id by default.
  • Added a new filter in the registration form so Google recaptcha can be added to it.
Download this release

Release Info

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

Code changes from version 2.2.9 to 3.0.1

classes/class.swpm-category-list.php CHANGED
@@ -82,7 +82,7 @@ class SwpmCategoryList extends WP_List_Table {
82
  $all_cat_ids = get_categories(array('hide_empty' => '0'));
83
  $totalitems = count($all_cat_ids);
84
  $perpage = 100;
85
- $paged = !empty($_GET["paged"]) ? mysql_real_escape_string($_GET["paged"]) : '';
86
  if (empty($paged) || !is_numeric($paged) || $paged <= 0) {
87
  $paged = 1;
88
  }
82
  $all_cat_ids = get_categories(array('hide_empty' => '0'));
83
  $totalitems = count($all_cat_ids);
84
  $perpage = 100;
85
+ $paged = !empty($_GET["paged"]) ? esc_sql($_GET["paged"]) : '';
86
  if (empty($paged) || !is_numeric($paged) || $paged <= 0) {
87
  $paged = 1;
88
  }
classes/class.swpm-front-registration.php CHANGED
@@ -15,13 +15,12 @@ class SwpmFrontRegistration extends SwpmRegistration {
15
  public function regigstration_ui($level) {
16
  $settings_configs = SwpmSettings::get_instance();
17
  $joinuspage_url = $settings_configs->get_value('join-us-page-url');
18
- $membership_level = '';
19
- $member_id = filter_input(INPUT_GET, 'member_id', FILTER_SANITIZE_NUMBER_INT);
20
- $code = filter_input(INPUT_GET, 'code', FILTER_SANITIZE_STRING);
21
-
22
  global $wpdb;
 
23
  if (SwpmUtils::is_paid_registration()) {
24
- $member = $member = SwpmUtils::get_paid_member_info();
 
25
  if (empty($member)) {
26
  SwpmUtils::e('Error! Invalid Request. Could not find a match for the given security code and the user ID.');
27
  }
@@ -32,7 +31,11 @@ class SwpmFrontRegistration extends SwpmRegistration {
32
  }
33
  if (empty($membership_level)) {
34
  $joinuspage_link = '<a href="' . $joinuspage_url . '">Join us</a>';
 
35
  SwpmUtils::e('Free membership is disabled on this site. Please make a payment from the ' . $joinuspage_link . ' page to pay for a premium membership.');
 
 
 
36
  return;
37
  }
38
  $form = apply_filters('swpm_registration_form_override', '', $membership_level);
@@ -58,12 +61,20 @@ class SwpmFrontRegistration extends SwpmRegistration {
58
  }
59
 
60
  public function register() {
 
 
 
 
 
 
 
 
61
  if ($this->create_swpm_user() && $this->create_wp_user() && $this->send_reg_email()) {
62
- do_action('swpm_front_end_registration_complete');//Keep this action hook for people who are using it (so their implementation doesn't break).
63
  do_action('swpm_front_end_registration_complete_user_data', $this->member_info);
64
 
65
  $login_page_url = SwpmSettings::get_instance()->get_value('login-page-url');
66
- $after_rego_msg = '<p>' . SwpmUtils::_('Registration Successful. ') . SwpmUtils::_('Please') . ' <a href="' . $login_page_url . '">' . SwpmUtils::_('Login') . '</a></p>';
67
  $message = array('succeeded' => true, 'message' => $after_rego_msg);
68
  SwpmTransfer::get_instance()->set('status', $message);
69
  return;
@@ -146,11 +157,11 @@ class SwpmFrontRegistration extends SwpmRegistration {
146
  if ($form->is_valid()) {
147
  global $wpdb;
148
  $message = array('succeeded' => true, 'message' => SwpmUtils::_('Profile updated successfully.'));
149
-
150
- $member_info = $form->get_sanitized();
151
  SwpmUtils::update_wp_user($auth->get('user_name'), $member_info); //Update corresponding wp user record.
152
-
153
-
154
  if (isset($member_info['plain_password'])) {
155
  //Password was also changed so show the appropriate message
156
  $message = array('succeeded' => true, 'message' => SwpmUtils::_('Profile updated successfully. You will need to re-login since you changed your password.'));
@@ -159,7 +170,7 @@ class SwpmFrontRegistration extends SwpmRegistration {
159
 
160
  $wpdb->update($wpdb->prefix . "swpm_members_tbl", $member_info, array('member_id' => $auth->get('member_id')));
161
  $auth->reload_user_data();
162
-
163
  SwpmTransfer::get_instance()->set('status', $message);
164
  } else {
165
  $message = array('succeeded' => false, 'message' => SwpmUtils::_('Please correct the following'),
15
  public function regigstration_ui($level) {
16
  $settings_configs = SwpmSettings::get_instance();
17
  $joinuspage_url = $settings_configs->get_value('join-us-page-url');
18
+ $membership_level = '';
 
 
 
19
  global $wpdb;
20
+
21
  if (SwpmUtils::is_paid_registration()) {
22
+ //Lets check if this is a registration for paid membership
23
+ $member = SwpmUtils::get_paid_member_info();
24
  if (empty($member)) {
25
  SwpmUtils::e('Error! Invalid Request. Could not find a match for the given security code and the user ID.');
26
  }
31
  }
32
  if (empty($membership_level)) {
33
  $joinuspage_link = '<a href="' . $joinuspage_url . '">Join us</a>';
34
+ echo '<p>';
35
  SwpmUtils::e('Free membership is disabled on this site. Please make a payment from the ' . $joinuspage_link . ' page to pay for a premium membership.');
36
+ echo '</p><p>';
37
+ SwpmUtils::e('You will receive a unique link via email after the payment. You will be able to use that link to complete the premium membership registration.');
38
+ echo '</p>';
39
  return;
40
  }
41
  $form = apply_filters('swpm_registration_form_override', '', $membership_level);
61
  }
62
 
63
  public function register() {
64
+ //If captcha is present and validation failed, it returns an error string. If validation succeeds, it returns an empty string.
65
+ $captcha_validation_output = apply_filters('swpm_validate_registration_form_submission', '');
66
+
67
+ if (!empty($captcha_validation_output)) {
68
+ $message = array('succeeded' => false, 'message' => SwpmUtils::_('Security check: captcha validation failed.'));
69
+ SwpmTransfer::get_instance()->set('status', $message);
70
+ return;
71
+ }
72
  if ($this->create_swpm_user() && $this->create_wp_user() && $this->send_reg_email()) {
73
+ do_action('swpm_front_end_registration_complete'); //Keep this action hook for people who are using it (so their implementation doesn't break).
74
  do_action('swpm_front_end_registration_complete_user_data', $this->member_info);
75
 
76
  $login_page_url = SwpmSettings::get_instance()->get_value('login-page-url');
77
+ $after_rego_msg = '<div class="swpm-registration-success-msg">' . SwpmUtils::_('Registration Successful. ') . SwpmUtils::_('Please') . ' <a href="' . $login_page_url . '">' . SwpmUtils::_('Login') . '</a></div>';
78
  $message = array('succeeded' => true, 'message' => $after_rego_msg);
79
  SwpmTransfer::get_instance()->set('status', $message);
80
  return;
157
  if ($form->is_valid()) {
158
  global $wpdb;
159
  $message = array('succeeded' => true, 'message' => SwpmUtils::_('Profile updated successfully.'));
160
+
161
+ $member_info = $form->get_sanitized();
162
  SwpmUtils::update_wp_user($auth->get('user_name'), $member_info); //Update corresponding wp user record.
163
+
164
+
165
  if (isset($member_info['plain_password'])) {
166
  //Password was also changed so show the appropriate message
167
  $message = array('succeeded' => true, 'message' => SwpmUtils::_('Profile updated successfully. You will need to re-login since you changed your password.'));
170
 
171
  $wpdb->update($wpdb->prefix . "swpm_members_tbl", $member_info, array('member_id' => $auth->get('member_id')));
172
  $auth->reload_user_data();
173
+
174
  SwpmTransfer::get_instance()->set('status', $message);
175
  } else {
176
  $message = array('succeeded' => false, 'message' => SwpmUtils::_('Please correct the following'),
classes/class.swpm-members.php CHANGED
@@ -69,7 +69,7 @@ class SwpmMembers extends WP_List_Table {
69
  . " OR last_name LIKE '%" . strip_tags($s) . "%' ";
70
  }
71
  $orderby = filter_input(INPUT_GET, 'orderby');
72
- $orderby = empty($orderby) ? 'user_name' : $orderby ;
73
  $order = filter_input(INPUT_GET, 'order');
74
  $order = empty($order) ? 'DESC' : $order;
75
 
69
  . " OR last_name LIKE '%" . strip_tags($s) . "%' ";
70
  }
71
  $orderby = filter_input(INPUT_GET, 'orderby');
72
+ $orderby = empty($orderby) ? 'member_id' : $orderby ;
73
  $order = filter_input(INPUT_GET, 'order');
74
  $order = empty($order) ? 'DESC' : $order;
75
 
classes/class.swpm-membership-levels.php CHANGED
@@ -84,8 +84,8 @@ class SwpmMembershipLevels extends WP_List_Table {
84
  $query = "SELECT * FROM " . $wpdb->prefix . "swpm_membership_tbl WHERE id !=1 ";
85
  if (isset($_POST['s']))
86
  $query .= " AND alias LIKE '%" . strip_tags($_POST['s']) . "%' ";
87
- $orderby = !empty($_GET["orderby"]) ? mysql_real_escape_string($_GET["orderby"]) : 'id';
88
- $order = !empty($_GET["order"]) ? mysql_real_escape_string($_GET["order"]) : 'DESC';
89
 
90
  $sortable_columns = $this->get_sortable_columns();
91
  $orderby = SwpmUtils::sanitize_value_by_array($orderby, $sortable_columns);
@@ -97,7 +97,7 @@ class SwpmMembershipLevels extends WP_List_Table {
97
 
98
  $totalitems = $wpdb->query($query); //return the total number of affected rows
99
  $perpage = 20;
100
- $paged = !empty($_GET["paged"]) ? mysql_real_escape_string($_GET["paged"]) : '';
101
  if (empty($paged) || !is_numeric($paged) || $paged <= 0) {
102
  $paged = 1;
103
  }
84
  $query = "SELECT * FROM " . $wpdb->prefix . "swpm_membership_tbl WHERE id !=1 ";
85
  if (isset($_POST['s']))
86
  $query .= " AND alias LIKE '%" . strip_tags($_POST['s']) . "%' ";
87
+ $orderby = !empty($_GET["orderby"]) ? esc_sql($_GET["orderby"]) : 'id';
88
+ $order = !empty($_GET["order"]) ? esc_sql($_GET["order"]) : 'DESC';
89
 
90
  $sortable_columns = $this->get_sortable_columns();
91
  $orderby = SwpmUtils::sanitize_value_by_array($orderby, $sortable_columns);
97
 
98
  $totalitems = $wpdb->query($query); //return the total number of affected rows
99
  $perpage = 20;
100
+ $paged = !empty($_GET["paged"]) ? esc_sql($_GET["paged"]) : '';
101
  if (empty($paged) || !is_numeric($paged) || $paged <= 0) {
102
  $paged = 1;
103
  }
classes/shortcode-related/class.swpm-shortcodes-handler.php CHANGED
@@ -11,6 +11,7 @@ class SwpmShortcodesHandler {
11
  extract(shortcode_atts(array(
12
  'id' => '',
13
  'button_text' => '',
 
14
  ), $args));
15
 
16
  if(empty($id)){
11
  extract(shortcode_atts(array(
12
  'id' => '',
13
  'button_text' => '',
14
+ 'new_window' => '',
15
  ), $args));
16
 
17
  if(empty($id)){
languages/swpm-de_DE.mo CHANGED
Binary file
languages/swpm-de_DE.po CHANGED
@@ -2,13 +2,13 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: simple membership plugin depal\n"
4
  "POT-Creation-Date: 2014-08-28 19:28+1000\n"
5
- "PO-Revision-Date: 2014-10-10 09:44+0100\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "X-Generator: Poedit 1.6.9\n"
12
  "X-Poedit-KeywordsList: __;_e\n"
13
  "X-Poedit-Basepath: .\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
@@ -354,7 +354,7 @@ msgstr "Kein Zugang?"
354
 
355
  #: classes/class.bSettings.php:326 views/login.php:30
356
  msgid "Join Us"
357
- msgstr "Mitgliedschaftsseite URL"
358
 
359
  #: classes/class.bUtils.php:32 views/admin_member_form_common_part.php:66
360
  msgid "Active"
2
  msgstr ""
3
  "Project-Id-Version: simple membership plugin depal\n"
4
  "POT-Creation-Date: 2014-08-28 19:28+1000\n"
5
+ "PO-Revision-Date: 2015-07-07 13:12+0200\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.8.2\n"
12
  "X-Poedit-KeywordsList: __;_e\n"
13
  "X-Poedit-Basepath: .\n"
14
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
354
 
355
  #: classes/class.bSettings.php:326 views/login.php:30
356
  msgid "Join Us"
357
+ msgstr "Noch kein Mitglied? Registriere dich hier! "
358
 
359
  #: classes/class.bUtils.php:32 views/admin_member_form_common_part.php:66
360
  msgid "Active"
languages/swpm-pt_PT.mo ADDED
Binary file
languages/swpm-pt_PT.po ADDED
@@ -0,0 +1,925 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Simple Membership\n"
4
+ "POT-Creation-Date: 2015-07-07 14:18-0000\n"
5
+ "PO-Revision-Date: 2015-07-07 14:47-0000\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.8.1\n"
12
+ "X-Poedit-KeywordsList: __;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "Language: pt_PT\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: simple-membership/classes/class.bAccessControl.php:21
19
+ #: simple-membership/classes/class.bAccessControl.php:28
20
+ #: simple-membership/classes/class.bAccessControl.php:48
21
+ msgid "You need to login to view this content. "
22
+ msgstr "É necessário fazer o login para ver este conteúdo."
23
+
24
+ #: simple-membership/classes/class.bAccessControl.php:35
25
+ #: simple-membership/classes/class.bAccessControl.php:39
26
+ #: simple-membership/classes/class.bAccessControl.php:54
27
+ msgid "You are not allowed to view this content"
28
+ msgstr "Não tem permissão para visualizar este conteúdo"
29
+
30
+ #: simple-membership/classes/class.bAccessControl.php:72
31
+ msgid "You do no have permission to view rest of the content"
32
+ msgstr "Não tem permissão para ver o resto do conteúdo"
33
+
34
+ #: simple-membership/classes/class.bAccessControl.php:76
35
+ #: simple-membership/classes/class.bAccessControl.php:94
36
+ msgid "You need to login to view the rest of the content. "
37
+ msgstr "Precisa fazer o login para ver o restante do conteúdo."
38
+
39
+ #: simple-membership/classes/class.bAdminRegistration.php:49
40
+ msgid "Registration Successful."
41
+ msgstr "Registo com sucesso"
42
+
43
+ #: simple-membership/classes/class.bAdminRegistration.php:54
44
+ #: simple-membership/classes/class.bAdminRegistration.php:89
45
+ #: simple-membership/classes/class.bMembershipLevel.php:42
46
+ #: simple-membership/classes/class.bMembershipLevel.php:60
47
+ msgid "Please correct the following:"
48
+ msgstr "Por favor, corrija o seguinte:"
49
+
50
+ #: simple-membership/classes/class.bAjax.php:17
51
+ #: simple-membership/classes/class.bAjax.php:28
52
+ msgid "Aready taken"
53
+ msgstr "Já existente"
54
+
55
+ #: simple-membership/classes/class.bAjax.php:29
56
+ msgid "Available"
57
+ msgstr "Disponível"
58
+
59
+ #: simple-membership/classes/class.bAuth.php:46
60
+ #: simple-membership/classes/class.bFrontRegistration.php:173
61
+ msgid "User Not Found."
62
+ msgstr "Utilizador não encontrado"
63
+
64
+ #: simple-membership/classes/class.bAuth.php:53
65
+ msgid "Password Empty or Invalid."
66
+ msgstr "Palavra-passe a branco ou inválida."
67
+
68
+ #: simple-membership/classes/class.bAuth.php:76
69
+ msgid "Account is inactive."
70
+ msgstr "Conta inativa"
71
+
72
+ #: simple-membership/classes/class.bAuth.php:93
73
+ msgid "Account has expired."
74
+ msgstr "Conta expirada"
75
+
76
+ #: simple-membership/classes/class.bAuth.php:100
77
+ msgid "You are logged in as:"
78
+ msgstr "Com sessão iniciada como:"
79
+
80
+ #: simple-membership/classes/class.bAuth.php:139
81
+ msgid "Logged Out Successfully."
82
+ msgstr "Log out com sucesso."
83
+
84
+ #: simple-membership/classes/class.bAuth.php:186
85
+ msgid "Session Expired."
86
+ msgstr "Sessão expirada"
87
+
88
+ #: simple-membership/classes/class.bAuth.php:194
89
+ msgid "Invalid User Name"
90
+ msgstr "Utilizador inválido"
91
+
92
+ #: simple-membership/classes/class.bAuth.php:202
93
+ msgid "Sorry! Something went wrong"
94
+ msgstr "Ups! Algo correu mal"
95
+
96
+ #: simple-membership/classes/class.bCategoryList.php:15
97
+ #: simple-membership/classes/class.bMembers.php:21
98
+ #: simple-membership/classes/class.bMembershipLevels.php:8
99
+ #: simple-membership/classes/class.bMembershipLevels.php:17
100
+ #: simple-membership/views/add.php:30
101
+ #: simple-membership/views/admin_member_form_common_part.php:2
102
+ #: simple-membership/views/edit.php:52
103
+ msgid "Membership Level"
104
+ msgstr "Nível de associação"
105
+
106
+ #: simple-membership/classes/class.bCategoryList.php:16
107
+ #: simple-membership/classes/class.bMembershipLevels.php:9
108
+ #: simple-membership/classes/class.simple-wp-membership.php:464
109
+ msgid "Membership Levels"
110
+ msgstr "Níveis de associação"
111
+
112
+ #: simple-membership/classes/class.bCategoryList.php:29
113
+ #: simple-membership/classes/class.bMembers.php:16
114
+ #: simple-membership/classes/class.bMembershipLevels.php:16
115
+ msgid "ID"
116
+ msgstr "ID"
117
+
118
+ #: simple-membership/classes/class.bCategoryList.php:30
119
+ msgid "Name"
120
+ msgstr "Nome"
121
+
122
+ #: simple-membership/classes/class.bCategoryList.php:31
123
+ msgid "Description"
124
+ msgstr "Descrição"
125
+
126
+ #: simple-membership/classes/class.bCategoryList.php:32
127
+ msgid "Count"
128
+ msgstr "Localidade"
129
+
130
+ #: simple-membership/classes/class.bCategoryList.php:63
131
+ msgid "Updated! "
132
+ msgstr "Atualizado!"
133
+
134
+ #: simple-membership/classes/class.bForm.php:26
135
+ msgid ""
136
+ "Wordpress account exists with given user name. But given email doesn't match."
137
+ msgstr "A conta de Wordpress já existe. Mas o email não coincide."
138
+
139
+ #: simple-membership/classes/class.bForm.php:31
140
+ msgid ""
141
+ "Wordpress account exists with given email. But given user name doesn't match."
142
+ msgstr ""
143
+ "A conta de Wordpress já existe com o email indicado. Mas o utilizador não "
144
+ "coincide."
145
+
146
+ #: simple-membership/classes/class.bForm.php:40
147
+ msgid "User name is required"
148
+ msgstr "Nome de utilizado necessário"
149
+
150
+ #: simple-membership/classes/class.bForm.php:44
151
+ msgid "User name contains invalid character"
152
+ msgstr "Nome de utilizado com caracteres inválidos"
153
+
154
+ #: simple-membership/classes/class.bForm.php:52
155
+ msgid "User name already exists."
156
+ msgstr "Nome de utilizado já existe."
157
+
158
+ #: simple-membership/classes/class.bForm.php:75
159
+ msgid "Password is required"
160
+ msgstr "Palavra-passe necessária"
161
+
162
+ #: simple-membership/classes/class.bForm.php:82
163
+ msgid "Password mismatch"
164
+ msgstr "Palavras-passe não coincidem"
165
+
166
+ #: simple-membership/classes/class.bForm.php:98
167
+ msgid "Email is required"
168
+ msgstr "Email necessário"
169
+
170
+ #: simple-membership/classes/class.bForm.php:102
171
+ msgid "Email is invalid"
172
+ msgstr "Email inválido"
173
+
174
+ #: simple-membership/classes/class.bForm.php:118
175
+ msgid "Email is already used."
176
+ msgstr "Email já existente"
177
+
178
+ #: simple-membership/classes/class.bForm.php:184
179
+ msgid "Member since field is invalid"
180
+ msgstr "Membro desde inválido"
181
+
182
+ #: simple-membership/classes/class.bForm.php:195
183
+ msgid "Access starts field is invalid"
184
+ msgstr "Início de Acesso inválido"
185
+
186
+ #: simple-membership/classes/class.bForm.php:205
187
+ msgid "Gender field is invalid"
188
+ msgstr "Género inválido"
189
+
190
+ #: simple-membership/classes/class.bForm.php:216
191
+ msgid "Account state field is invalid"
192
+ msgstr "Estado da conta inválido."
193
+
194
+ #: simple-membership/classes/class.bForm.php:223
195
+ msgid "Invalid membership level"
196
+ msgstr "Nível de associação inválido"
197
+
198
+ #: simple-membership/classes/class.bFrontRegistration.php:61
199
+ msgid "Registration Successful. "
200
+ msgstr "Registo com sucesso"
201
+
202
+ #: simple-membership/classes/class.bFrontRegistration.php:61
203
+ #: simple-membership/classes/class.bSettings.php:367
204
+ msgid "Please"
205
+ msgstr "Por favor"
206
+
207
+ #: simple-membership/classes/class.bFrontRegistration.php:61
208
+ #: simple-membership/classes/class.bSettings.php:367
209
+ #: simple-membership/views/login.php:21
210
+ msgid "Login"
211
+ msgstr "Login"
212
+
213
+ #: simple-membership/classes/class.bFrontRegistration.php:72
214
+ #: simple-membership/classes/class.bFrontRegistration.php:152
215
+ msgid "Please correct the following"
216
+ msgstr "Por favor, corrija o seguinte:"
217
+
218
+ #: simple-membership/classes/class.bFrontRegistration.php:106
219
+ msgid "Membership Level Couldn't be found."
220
+ msgstr "Nível de associação inválido"
221
+
222
+ #: simple-membership/classes/class.bFrontRegistration.php:162
223
+ msgid "Email Address Not Valid."
224
+ msgstr "Email inválido"
225
+
226
+ #: simple-membership/classes/class.bFrontRegistration.php:193
227
+ msgid "New password has been sent to your email address."
228
+ msgstr "Nova palavra-passe enviada para o email."
229
+
230
+ #: simple-membership/classes/class.bLevelForm.php:47
231
+ msgid "Date format is not valid."
232
+ msgstr "Formato de data inválido."
233
+
234
+ #: simple-membership/classes/class.bLevelForm.php:54
235
+ msgid "Access duration must be > 0."
236
+ msgstr "Duração de Acesso de ser > 0."
237
+
238
+ #: simple-membership/classes/class.bMembers.php:7
239
+ msgid "Member"
240
+ msgstr "Utilizador"
241
+
242
+ #: simple-membership/classes/class.bMembers.php:8
243
+ #: simple-membership/classes/class.simple-wp-membership.php:462
244
+ msgid "Members"
245
+ msgstr "Membros"
246
+
247
+ #: simple-membership/classes/class.bMembers.php:17
248
+ #: simple-membership/views/add.php:6 simple-membership/views/edit.php:4
249
+ msgid "User Name"
250
+ msgstr "Utilizador"
251
+
252
+ #: simple-membership/classes/class.bMembers.php:18
253
+ #: simple-membership/views/add.php:22
254
+ #: simple-membership/views/admin_member_form_common_part.php:15
255
+ #: simple-membership/views/edit.php:20
256
+ msgid "First Name"
257
+ msgstr "Nome"
258
+
259
+ #: simple-membership/classes/class.bMembers.php:19
260
+ #: simple-membership/views/add.php:26
261
+ #: simple-membership/views/admin_member_form_common_part.php:19
262
+ #: simple-membership/views/edit.php:24
263
+ msgid "Last Name"
264
+ msgstr "Sobrenome"
265
+
266
+ #: simple-membership/classes/class.bMembers.php:20
267
+ #: simple-membership/views/add.php:10 simple-membership/views/edit.php:8
268
+ msgid "Email"
269
+ msgstr "email"
270
+
271
+ #: simple-membership/classes/class.bMembers.php:22
272
+ #: simple-membership/views/admin_member_form_common_part.php:11
273
+ msgid "Access Starts"
274
+ msgstr "Início de Acesso"
275
+
276
+ #: simple-membership/classes/class.bMembers.php:23
277
+ msgid "Account State"
278
+ msgstr "Estado da conta"
279
+
280
+ #: simple-membership/classes/class.bMembers.php:35
281
+ #: simple-membership/classes/class.bMembershipLevels.php:29
282
+ msgid "Delete"
283
+ msgstr "Apagar"
284
+
285
+ #: simple-membership/classes/class.bMembers.php:101
286
+ msgid "No Member found."
287
+ msgstr "Membro não encontrado"
288
+
289
+ #: simple-membership/classes/class.bMembershipLevel.php:37
290
+ msgid "Membership Level Creation Successful."
291
+ msgstr "Nível de associação com sucesso"
292
+
293
+ #: simple-membership/classes/class.bMembershipLevel.php:56
294
+ msgid "Updated Successfully."
295
+ msgstr "Atualizado!"
296
+
297
+ #: simple-membership/classes/class.bMembershipLevels.php:18
298
+ msgid "Role"
299
+ msgstr "Papel"
300
+
301
+ #: simple-membership/classes/class.bMembershipLevels.php:19
302
+ msgid "Access Valid For/Until"
303
+ msgstr "Acesso válido para/até"
304
+
305
+ #: simple-membership/classes/class.bSettings.php:30
306
+ msgid "Plugin Documentation"
307
+ msgstr "Documentação do plugin"
308
+
309
+ #: simple-membership/classes/class.bSettings.php:32
310
+ msgid "General Settings"
311
+ msgstr "Definições"
312
+
313
+ #: simple-membership/classes/class.bSettings.php:34
314
+ msgid "Enable Free Membership"
315
+ msgstr "Ativar associação gratuita"
316
+
317
+ #: simple-membership/classes/class.bSettings.php:37
318
+ msgid "Enable/disable registration for free membership level"
319
+ msgstr "Ativar/desativar registo para associação gratuitas"
320
+
321
+ #: simple-membership/classes/class.bSettings.php:38
322
+ msgid "Free Membership Level ID"
323
+ msgstr "ID de associação gratuita"
324
+
325
+ #: simple-membership/classes/class.bSettings.php:41
326
+ msgid "Assign free membership level ID"
327
+ msgstr "Atribuir ID de associação gratuita"
328
+
329
+ #: simple-membership/classes/class.bSettings.php:42
330
+ msgid "Enable More Tag Protection"
331
+ msgstr "Adicionar proteção de Ler Mais"
332
+
333
+ #: simple-membership/classes/class.bSettings.php:45
334
+ msgid ""
335
+ "Enables or disables \"more\" tag protection in the posts and pages. Anything "
336
+ "after the More tag is protected. Anything before the more tag is teaser "
337
+ "content."
338
+ msgstr "Ativa/desativa “ler mais” nos posts e páginas."
339
+
340
+ #: simple-membership/classes/class.bSettings.php:46
341
+ msgid "Hide Adminbar"
342
+ msgstr "Esconder Adminbar"
343
+
344
+ #: simple-membership/classes/class.bSettings.php:49
345
+ msgid ""
346
+ "WordPress shows an admin toolbar to the logged in users of the site. Check "
347
+ "this box if you want to hide that admin toolbar in the fronend of your site."
348
+ msgstr ""
349
+ "WordPress mostra uma barra de ferramentas de administração do site para os "
350
+ "utilizadores. Marque esta caixa se você quer esconder essa barra de "
351
+ "ferramentas admin no front-end do seu site."
352
+
353
+ #: simple-membership/classes/class.bSettings.php:51
354
+ msgid "Default Account Status"
355
+ msgstr "Estado de conta por defeito"
356
+
357
+ #: simple-membership/classes/class.bSettings.php:56
358
+ msgid ""
359
+ "Select the default account status for newly registered users. If you want to "
360
+ "manually approve the members then you can set the status to \"Pending\"."
361
+ msgstr ""
362
+ "Selecione o estado de novos utilizadores.Para aprovar manualmente, selecione "
363
+ "“Pendente”."
364
+
365
+ #: simple-membership/classes/class.bSettings.php:62
366
+ msgid "Pages Settings"
367
+ msgstr "Definições de página"
368
+
369
+ #: simple-membership/classes/class.bSettings.php:64
370
+ msgid "Login Page URL"
371
+ msgstr "Login URL"
372
+
373
+ #: simple-membership/classes/class.bSettings.php:68
374
+ msgid "Registration Page URL"
375
+ msgstr "URL de página de registo"
376
+
377
+ #: simple-membership/classes/class.bSettings.php:72
378
+ msgid "Join Us Page URL"
379
+ msgstr "Registe-se URL"
380
+
381
+ #: simple-membership/classes/class.bSettings.php:76
382
+ msgid "Edit Profile Page URL"
383
+ msgstr "Editar URL de perfil"
384
+
385
+ #: simple-membership/classes/class.bSettings.php:80
386
+ msgid "Password Reset Page URL"
387
+ msgstr "Redefinir Palavra-passe URL"
388
+
389
+ #: simple-membership/classes/class.bSettings.php:85
390
+ msgid "Test & Debug Settings"
391
+ msgstr "Definições de Teste & Debug"
392
+
393
+ #: simple-membership/classes/class.bSettings.php:91
394
+ msgid "Enable Sandbox Testing"
395
+ msgstr "Ativar teste de sandbox"
396
+
397
+ #: simple-membership/classes/class.bSettings.php:94
398
+ msgid "Enable this option if you want to do sandbox payment testing."
399
+ msgstr "Ativar se quiser teste de pagamento sandbox."
400
+
401
+ #: simple-membership/classes/class.bSettings.php:104
402
+ msgid "Email Misc. Settings"
403
+ msgstr "Definições de email"
404
+
405
+ #: simple-membership/classes/class.bSettings.php:106
406
+ msgid "From Email Address"
407
+ msgstr "De email"
408
+
409
+ #: simple-membership/classes/class.bSettings.php:111
410
+ msgid "Email Settings (Prompt to Complete Registration )"
411
+ msgstr "Definições de email"
412
+
413
+ #: simple-membership/classes/class.bSettings.php:113
414
+ #: simple-membership/classes/class.bSettings.php:124
415
+ #: simple-membership/classes/class.bSettings.php:143
416
+ msgid "Email Subject"
417
+ msgstr "Assunto de email"
418
+
419
+ #: simple-membership/classes/class.bSettings.php:117
420
+ #: simple-membership/classes/class.bSettings.php:128
421
+ #: simple-membership/classes/class.bSettings.php:147
422
+ msgid "Email Body"
423
+ msgstr "Corpo de email"
424
+
425
+ #: simple-membership/classes/class.bSettings.php:122
426
+ msgid "Email Settings (Registration Complete)"
427
+ msgstr "Definições de email (Registo completo)"
428
+
429
+ #: simple-membership/classes/class.bSettings.php:132
430
+ msgid "Send Notification To Admin"
431
+ msgstr "Enviar notificação a Admin"
432
+
433
+ #: simple-membership/classes/class.bSettings.php:136
434
+ msgid "Send Email to Member When Added via Admin Dashboard"
435
+ msgstr "Enviar email a membro quando adicionado pelo Painel de Admin"
436
+
437
+ #: simple-membership/classes/class.bSettings.php:141
438
+ msgid " Email Settings (Account Upgrade Notification)"
439
+ msgstr "Configurações de e-mail ( Conta de Notificação de atualização )"
440
+
441
+ #: simple-membership/classes/class.bSettings.php:367
442
+ msgid "Not a Member?"
443
+ msgstr "Não é membro?"
444
+
445
+ #: simple-membership/classes/class.bSettings.php:367
446
+ #: simple-membership/views/login.php:27
447
+ msgid "Join Us"
448
+ msgstr "Registe-se"
449
+
450
+ #: simple-membership/classes/class.bUtils.php:63
451
+ msgid "Active"
452
+ msgstr "Ativo"
453
+
454
+ #: simple-membership/classes/class.bUtils.php:64
455
+ msgid "Inactive"
456
+ msgstr "Inativo"
457
+
458
+ #: simple-membership/classes/class.bUtils.php:65
459
+ msgid "Pending"
460
+ msgstr "Pendente"
461
+
462
+ #: simple-membership/classes/class.bUtils.php:66
463
+ msgid "Expired"
464
+ msgstr "Conta expirada"
465
+
466
+ #: simple-membership/classes/class.bUtils.php:251
467
+ msgid "Never"
468
+ msgstr "Nunca"
469
+
470
+ #: simple-membership/classes/class.miscUtils.php:51
471
+ msgid "Registration"
472
+ msgstr "Registo"
473
+
474
+ #: simple-membership/classes/class.miscUtils.php:74
475
+ msgid "Member Login"
476
+ msgstr "Login de utilizador"
477
+
478
+ #: simple-membership/classes/class.miscUtils.php:97
479
+ msgid "Profile"
480
+ msgstr "Perfil"
481
+
482
+ #: simple-membership/classes/class.miscUtils.php:120
483
+ msgid "Password Reset"
484
+ msgstr "Redefinir Palavra-passe"
485
+
486
+ #: simple-membership/classes/class.simple-wp-membership.php:184
487
+ msgid "You are not logged in."
488
+ msgstr "Com sessão iniciada como:"
489
+
490
+ #: simple-membership/classes/class.simple-wp-membership.php:215
491
+ msgid "Simple WP Membership Protection"
492
+ msgstr "Proteção Simple Membership"
493
+
494
+ #: simple-membership/classes/class.simple-wp-membership.php:228
495
+ msgid "Simple Membership Protection options"
496
+ msgstr "Opções de proteção Simple Membership"
497
+
498
+ #: simple-membership/classes/class.simple-wp-membership.php:244
499
+ msgid "Do you want to protect this content?"
500
+ msgstr "Proteger este conteúdo?"
501
+
502
+ #: simple-membership/classes/class.simple-wp-membership.php:249
503
+ msgid "Select the membership level that can access this content:"
504
+ msgstr "Selecione o nível de acesso a este conteúdo:"
505
+
506
+ #: simple-membership/classes/class.simple-wp-membership.php:459
507
+ msgid "WP Membership"
508
+ msgstr "WP Membership"
509
+
510
+ #: simple-membership/classes/class.simple-wp-membership.php:466
511
+ msgid "Settings"
512
+ msgstr "Definições"
513
+
514
+ #: simple-membership/classes/class.simple-wp-membership.php:468
515
+ msgid "Add-ons"
516
+ msgstr "Add-ons"
517
+
518
+ #: simple-membership/views/add.php:14 simple-membership/views/admin_add.php:19
519
+ #: simple-membership/views/admin_edit.php:17
520
+ #: simple-membership/views/edit.php:12 simple-membership/views/login.php:11
521
+ msgid "Password"
522
+ msgstr "Palavra-passe"
523
+
524
+ #: simple-membership/views/add.php:18 simple-membership/views/edit.php:16
525
+ msgid "Repeat Password"
526
+ msgstr "Repetir Palavra-passe"
527
+
528
+ #: simple-membership/views/add.php:37
529
+ msgid "Register"
530
+ msgstr "Registar"
531
+
532
+ #: simple-membership/views/admin_add.php:6
533
+ msgid "Add Member"
534
+ msgstr "Adicionar membro"
535
+
536
+ #: simple-membership/views/admin_add.php:7
537
+ msgid "Create a brand new user and add it to this site."
538
+ msgstr "Criar um novo utilizador e adicionar ao site."
539
+
540
+ #: simple-membership/views/admin_add.php:11
541
+ msgid "User name"
542
+ msgstr "Utilizador"
543
+
544
+ #: simple-membership/views/admin_add.php:11
545
+ #: simple-membership/views/admin_add.php:15
546
+ #: simple-membership/views/admin_add_level.php:11
547
+ #: simple-membership/views/admin_add_level.php:15
548
+ #: simple-membership/views/admin_add_level.php:19
549
+ #: simple-membership/views/admin_edit.php:9
550
+ #: simple-membership/views/admin_edit.php:13
551
+ #: simple-membership/views/admin_edit_level.php:10
552
+ #: simple-membership/views/admin_edit_level.php:14
553
+ #: simple-membership/views/admin_edit_level.php:18
554
+ msgid "(required)"
555
+ msgstr "(Requerido)"
556
+
557
+ #: simple-membership/views/admin_add.php:15
558
+ #: simple-membership/views/admin_edit.php:13
559
+ msgid "E-mail"
560
+ msgstr "E-mail"
561
+
562
+ #: simple-membership/views/admin_add.php:19
563
+ msgid "(twice, required)"
564
+ msgstr "(duas vezes, necessário)"
565
+
566
+ #: simple-membership/views/admin_add.php:24
567
+ #: simple-membership/views/admin_edit.php:21
568
+ msgid "Strength indicator"
569
+ msgstr "Indicador de força"
570
+
571
+ #: simple-membership/views/admin_add.php:25
572
+ #: simple-membership/views/admin_edit.php:22
573
+ msgid ""
574
+ "Hint: The password should be at least seven characters long. To make it "
575
+ "stronger, use upper and lower case letters, numbers and symbols like ! \" ? "
576
+ "$ % ^ &amp; )."
577
+ msgstr ""
578
+ "Dica: A palavra-passe deve ter pelo menos sete caracteres. Para torná-la "
579
+ "mais forte, use letras maiúsculas e minúsculas, números e símbolos como ! "
580
+ "\" ? $ % ^ &amp; )."
581
+
582
+ #: simple-membership/views/admin_add.php:29
583
+ #: simple-membership/views/admin_edit.php:26
584
+ #: simple-membership/views/loggedin.php:7
585
+ msgid "Account Status"
586
+ msgstr "Estado da conta"
587
+
588
+ #: simple-membership/views/admin_add.php:36
589
+ msgid "Add New Member "
590
+ msgstr "Adicionar novo membro"
591
+
592
+ #: simple-membership/views/admin_addon_settings.php:2
593
+ #: simple-membership/views/admin_payment_settings.php:2
594
+ #: simple-membership/views/admin_settings.php:2
595
+ #: simple-membership/views/admin_tools_settings.php:2
596
+ msgid "Simple WP Membership::Settings"
597
+ msgstr "Simple WP Membership::Definições"
598
+
599
+ #: simple-membership/views/admin_addon_settings.php:7
600
+ msgid ""
601
+ "Some of the simple membership plugin's addon settings and options will be "
602
+ "displayed here (if you have them)"
603
+ msgstr "Definições de Addon de plugins serão aqui mostradas "
604
+
605
+ #: simple-membership/views/admin_add_level.php:6
606
+ msgid "Create new membership level."
607
+ msgstr "Criar novo nível de associação"
608
+
609
+ #: simple-membership/views/admin_add_level.php:11
610
+ #: simple-membership/views/admin_edit_level.php:10
611
+ msgid "Membership Level Name"
612
+ msgstr "Nome de nível de associação"
613
+
614
+ #: simple-membership/views/admin_add_level.php:15
615
+ #: simple-membership/views/admin_edit_level.php:14
616
+ msgid "Default WordPress Role"
617
+ msgstr "Papel por defeito"
618
+
619
+ #: simple-membership/views/admin_add_level.php:19
620
+ #: simple-membership/views/admin_edit_level.php:18
621
+ msgid "Access Duration"
622
+ msgstr "Duração de Acesso"
623
+
624
+ #: simple-membership/views/admin_add_level.php:22
625
+ msgid "No Expiry (Access for this level will not expire until cancelled"
626
+ msgstr "Não expira"
627
+
628
+ #: simple-membership/views/admin_add_level.php:23
629
+ #: simple-membership/views/admin_add_level.php:25
630
+ #: simple-membership/views/admin_add_level.php:27
631
+ #: simple-membership/views/admin_add_level.php:29
632
+ #: simple-membership/views/admin_edit_level.php:22
633
+ #: simple-membership/views/admin_edit_level.php:25
634
+ #: simple-membership/views/admin_edit_level.php:28
635
+ #: simple-membership/views/admin_edit_level.php:31
636
+ msgid "Expire After"
637
+ msgstr "Expira a"
638
+
639
+ #: simple-membership/views/admin_add_level.php:24
640
+ #: simple-membership/views/admin_edit_level.php:23
641
+ msgid "Days (Access expires after given number of days)"
642
+ msgstr "Dias (para expiração)"
643
+
644
+ #: simple-membership/views/admin_add_level.php:26
645
+ msgid "Weeks (Access expires after given number of weeks"
646
+ msgstr "Semanas (para expiração)"
647
+
648
+ #: simple-membership/views/admin_add_level.php:28
649
+ #: simple-membership/views/admin_edit_level.php:29
650
+ msgid "Months (Access expires after given number of months)"
651
+ msgstr "Meses (a expirar em)"
652
+
653
+ #: simple-membership/views/admin_add_level.php:30
654
+ #: simple-membership/views/admin_edit_level.php:32
655
+ msgid "Years (Access expires after given number of years)"
656
+ msgstr "Anos (para expiração)"
657
+
658
+ #: simple-membership/views/admin_add_level.php:31
659
+ #: simple-membership/views/admin_edit_level.php:34
660
+ msgid "Fixed Date Expiry"
661
+ msgstr "Acesso expira numa data fixa"
662
+
663
+ #: simple-membership/views/admin_add_level.php:32
664
+ #: simple-membership/views/admin_edit_level.php:35
665
+ msgid "(Access expires on a fixed date)"
666
+ msgstr "(Acesso expira numa data fixa)"
667
+
668
+ #: simple-membership/views/admin_add_level.php:36
669
+ msgid "Access to older posts."
670
+ msgstr "Acesso a posts mais antigos."
671
+
672
+ #: simple-membership/views/admin_add_level.php:39
673
+ msgid "Only allow access to posts published after the user's join date."
674
+ msgstr "Só permite acesso a posts publicados depois do registo do utilizador"
675
+
676
+ #: simple-membership/views/admin_add_level.php:45
677
+ msgid "Add New Membership Level "
678
+ msgstr "Adicionar novo nível de associação"
679
+
680
+ #: simple-membership/views/admin_add_ons_page.php:6
681
+ msgid "Simple WP Membership::Add-ons"
682
+ msgstr "Simple WP Membership::Add-ons"
683
+
684
+ #: simple-membership/views/admin_category_list.php:2
685
+ msgid "Simple WP Membership::Categories"
686
+ msgstr "Simple WP Membership::Categorias"
687
+
688
+ #: simple-membership/views/admin_category_list.php:7
689
+ msgid ""
690
+ "First of all, globally protect the category on your site by selecting "
691
+ "\"General Protection\" from the drop-down box below and then select the "
692
+ "categories that should be protected from non-logged in users."
693
+ msgstr ""
694
+ "Selecionar “Proteção Geral” da lista e depois selecionar a categoria a "
695
+ "proteger"
696
+
697
+ #: simple-membership/views/admin_category_list.php:10
698
+ msgid ""
699
+ "Next, select an existing membership level from the drop-down box below and "
700
+ "then select the categories you want to grant access to (for that particular "
701
+ "membership level)."
702
+ msgstr ""
703
+ "seguidamente, selecione um nível de associação e a categoria para garantir "
704
+ "acesso"
705
+
706
+ #: simple-membership/views/admin_edit.php:5
707
+ msgid "Edit Member"
708
+ msgstr "Editar utilizador"
709
+
710
+ #: simple-membership/views/admin_edit.php:6
711
+ msgid "Edit existing member details."
712
+ msgstr "Editar detalhes de utilizador."
713
+
714
+ #: simple-membership/views/admin_edit.php:9
715
+ #: simple-membership/views/login.php:5
716
+ msgid "Username"
717
+ msgstr "Nome de utilizador"
718
+
719
+ #: simple-membership/views/admin_edit.php:17
720
+ msgid "(twice, leave empty to retain old password)"
721
+ msgstr "(duas vezes, deixe vazio para manter a palavra-passe antiga)"
722
+
723
+ #: simple-membership/views/admin_edit.php:33
724
+ msgid "Notify User"
725
+ msgstr "Notificar Utilizador"
726
+
727
+ #: simple-membership/views/admin_edit.php:40
728
+ msgid "Edit User "
729
+ msgstr "Editar utilizador"
730
+
731
+ #: simple-membership/views/admin_edit_level.php:5
732
+ msgid "Edit membership level"
733
+ msgstr "Editar nível de associação"
734
+
735
+ #: simple-membership/views/admin_edit_level.php:6
736
+ msgid "Edit membership level."
737
+ msgstr "Editar nível de associação"
738
+
739
+ #: simple-membership/views/admin_edit_level.php:21
740
+ msgid "No Expiry (Access for this level will not expire until cancelled)"
741
+ msgstr "Não expira"
742
+
743
+ #: simple-membership/views/admin_edit_level.php:26
744
+ msgid "Weeks (Access expires after given number of weeks)"
745
+ msgstr "Semanas (para expiração)"
746
+
747
+ #: simple-membership/views/admin_edit_level.php:40
748
+ msgid "Protect Older Posts (optional)"
749
+ msgstr "Proteger posts mais antigos."
750
+
751
+ #: simple-membership/views/admin_edit_level.php:43
752
+ msgid ""
753
+ "Only allow access to protected posts published after the members's join date."
754
+ msgstr "Só permite acesso a posts publicados depois do registo do utilizador"
755
+
756
+ #: simple-membership/views/admin_edit_level.php:51
757
+ msgid "Edit Membership Level "
758
+ msgstr "Editar nível de associação"
759
+
760
+ #: simple-membership/views/admin_members.php:2
761
+ msgid "Simple WP Membership::Members"
762
+ msgstr "Simple WP Membership::Membros"
763
+
764
+ #: simple-membership/views/admin_members.php:3
765
+ #: simple-membership/views/admin_members.php:19
766
+ #: simple-membership/views/admin_membership_levels.php:20
767
+ msgid "Add New"
768
+ msgstr "Adicionar novo"
769
+
770
+ #: simple-membership/views/admin_members.php:9
771
+ #: simple-membership/views/admin_membership_levels.php:10
772
+ msgid "search"
773
+ msgstr "procurar"
774
+
775
+ #: simple-membership/views/admin_membership_levels.php:2
776
+ msgid "Simple WP Membership::Membership Levels"
777
+ msgstr "Simple WP Membership::Níveis de Membros"
778
+
779
+ #: simple-membership/views/admin_membership_level_menu.php:2
780
+ msgid "Membership level"
781
+ msgstr "Nível de associação"
782
+
783
+ #: simple-membership/views/admin_membership_level_menu.php:3
784
+ msgid "Manage Content Production"
785
+ msgstr "Gerir Produção de Conteúdo"
786
+
787
+ #: simple-membership/views/admin_membership_level_menu.php:4
788
+ msgid "Category Protection"
789
+ msgstr "Proteção de categoria"
790
+
791
+ #: simple-membership/views/admin_membership_manage.php:17
792
+ msgid "Example Content Protection Settings"
793
+ msgstr "Definições de proteção de conteúdo de exemplo"
794
+
795
+ #: simple-membership/views/admin_member_form_common_part.php:23
796
+ msgid "Gender"
797
+ msgstr "Género"
798
+
799
+ #: simple-membership/views/admin_member_form_common_part.php:30
800
+ #: simple-membership/views/edit.php:28
801
+ msgid "Phone"
802
+ msgstr "Telefone"
803
+
804
+ #: simple-membership/views/admin_member_form_common_part.php:34
805
+ #: simple-membership/views/edit.php:32
806
+ msgid "Street"
807
+ msgstr "Rua"
808
+
809
+ #: simple-membership/views/admin_member_form_common_part.php:38
810
+ #: simple-membership/views/edit.php:36
811
+ msgid "City"
812
+ msgstr "Cidade"
813
+
814
+ #: simple-membership/views/admin_member_form_common_part.php:42
815
+ #: simple-membership/views/edit.php:40
816
+ msgid "State"
817
+ msgstr "Localidade"
818
+
819
+ #: simple-membership/views/admin_member_form_common_part.php:46
820
+ #: simple-membership/views/edit.php:44
821
+ msgid "Zipcode"
822
+ msgstr "Código-postal"
823
+
824
+ #: simple-membership/views/admin_member_form_common_part.php:50
825
+ #: simple-membership/views/edit.php:48
826
+ msgid "Country"
827
+ msgstr "País"
828
+
829
+ #: simple-membership/views/admin_member_form_common_part.php:54
830
+ msgid "Company"
831
+ msgstr "Empresa"
832
+
833
+ #: simple-membership/views/admin_member_form_common_part.php:58
834
+ msgid "Member Since"
835
+ msgstr "Membro desde"
836
+
837
+ #: simple-membership/views/admin_payment_settings.php:33
838
+ msgid "PayPal Integration Settings"
839
+ msgstr "Definições de integração de PayPal"
840
+
841
+ #: simple-membership/views/admin_payment_settings.php:36
842
+ msgid "Generate the \"Advanced Variables\" Code for your PayPal button"
843
+ msgstr "Gerar \"Advanced Variables\" Code para PayPal"
844
+
845
+ #: simple-membership/views/admin_payment_settings.php:39
846
+ msgid "Enter the Membership Level ID"
847
+ msgstr "Atribuir ID de associação gratuita"
848
+
849
+ #: simple-membership/views/admin_payment_settings.php:41
850
+ msgid "Generate Code"
851
+ msgstr "Gerar código"
852
+
853
+ #: simple-membership/views/admin_tools_settings.php:9
854
+ msgid "Generate a Registration Completion link"
855
+ msgstr "Gerar um link de registo com sucesso"
856
+
857
+ #: simple-membership/views/admin_tools_settings.php:12
858
+ msgid ""
859
+ "You can manually generate a registration completion link here and give it to "
860
+ "your customer if they have missed the email that was automatically sent out "
861
+ "to them after the payment."
862
+ msgstr ""
863
+ "Pode gerar um atalho manualmente de conclusão de inscrição aqui e dar a seu "
864
+ "cliente, caso tenham perdido o e-mail que foi enviado automaticamente após o "
865
+ "pagamento."
866
+
867
+ #: simple-membership/views/admin_tools_settings.php:17
868
+ msgid "Generate Registration Completion Link"
869
+ msgstr "Gerar um link de registo com sucesso"
870
+
871
+ #: simple-membership/views/admin_tools_settings.php:20
872
+ msgid "OR"
873
+ msgstr "OU"
874
+
875
+ #: simple-membership/views/admin_tools_settings.php:21
876
+ msgid "For All Pending Registrations"
877
+ msgstr "Para todos os registos pendentes"
878
+
879
+ #: simple-membership/views/admin_tools_settings.php:24
880
+ msgid "Registration Completion Links Will Appear Below:"
881
+ msgstr "Link para registo completo:"
882
+
883
+ #: simple-membership/views/admin_tools_settings.php:31
884
+ msgid "Send Registration Reminder Email too"
885
+ msgstr "Enviar lembrete de registo"
886
+
887
+ #: simple-membership/views/admin_tools_settings.php:34
888
+ msgid "Submit"
889
+ msgstr "Submeter"
890
+
891
+ #: simple-membership/views/edit.php:58
892
+ msgid "Update"
893
+ msgstr "Atualizar"
894
+
895
+ #: simple-membership/views/forgot_password.php:5
896
+ msgid "Email Address"
897
+ msgstr "email"
898
+
899
+ #: simple-membership/views/forgot_password.php:12
900
+ msgid "Reset Password"
901
+ msgstr "Redefinir Palavra-passe"
902
+
903
+ #: simple-membership/views/loggedin.php:3
904
+ msgid "Logged in as"
905
+ msgstr "Com sessão iniciada como:"
906
+
907
+ #: simple-membership/views/loggedin.php:11
908
+ msgid "Membership"
909
+ msgstr "Associaçãp"
910
+
911
+ #: simple-membership/views/loggedin.php:15
912
+ msgid "Account Expiry"
913
+ msgstr "Conta expirada"
914
+
915
+ #: simple-membership/views/loggedin.php:19
916
+ msgid "Logout"
917
+ msgstr "Lougout"
918
+
919
+ #: simple-membership/views/login.php:18
920
+ msgid "Remember Me"
921
+ msgstr "Lembrar-me"
922
+
923
+ #: simple-membership/views/login.php:24
924
+ msgid "Forgot Password"
925
+ msgstr "Esqueceu palavra-passe"
languages/swpm-sv_SE.mo CHANGED
Binary file
languages/swpm-sv_SE.po CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Simple Membership\n"
4
  "POT-Creation-Date: 2015-06-10 22:20+0100\n"
5
- "PO-Revision-Date: 2015-06-16 14:41+0100\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
@@ -189,7 +189,7 @@ msgstr "Könfältet är ogiltigt"
189
 
190
  #: simple-membership/classes/class.bForm.php:216
191
  msgid "Account state field is invalid"
192
- msgstr "Konto status fältet är ogiltigt"
193
 
194
  #: simple-membership/classes/class.bForm.php:223
195
  msgid "Invalid membership level"
@@ -275,7 +275,7 @@ msgstr "Åtkomst börjar"
275
 
276
  #: simple-membership/classes/class.bMembers.php:23
277
  msgid "Account State"
278
- msgstr "Konto status"
279
 
280
  #: simple-membership/classes/class.bMembers.php:35
281
  #: simple-membership/classes/class.bMembershipLevels.php:29
@@ -442,12 +442,12 @@ msgstr "Inställningar för mejl (anmälan av kontouppgradering)"
442
 
443
  #: simple-membership/classes/class.bSettings.php:367
444
  msgid "Not a Member?"
445
- msgstr "Du är inte medlem?"
446
 
447
  #: simple-membership/classes/class.bSettings.php:367
448
  #: simple-membership/views/login.php:27
449
  msgid "Join Us"
450
- msgstr "Bli medlem"
451
 
452
  #: simple-membership/classes/class.bUtils.php:63
453
  msgid "Active"
@@ -529,7 +529,7 @@ msgstr "Repetera lösenord"
529
 
530
  #: simple-membership/views/add.php:37
531
  msgid "Register"
532
- msgstr "Register"
533
 
534
  #: simple-membership/views/admin_add.php:6
535
  msgid "Add Member"
@@ -624,7 +624,7 @@ msgstr "Tid för inloggning"
624
 
625
  #: simple-membership/views/admin_add_level.php:22
626
  msgid "No Expiry (Access for this level will not expire until cancelled"
627
- msgstr ""
628
 
629
  #: simple-membership/views/admin_add_level.php:23
630
  #: simple-membership/views/admin_add_level.php:25
@@ -635,26 +635,26 @@ msgstr ""
635
  #: simple-membership/views/admin_edit_level.php:28
636
  #: simple-membership/views/admin_edit_level.php:31
637
  msgid "Expire After"
638
- msgstr ""
639
 
640
  #: simple-membership/views/admin_add_level.php:24
641
  #: simple-membership/views/admin_edit_level.php:23
642
  msgid "Days (Access expires after given number of days)"
643
- msgstr ""
644
 
645
  #: simple-membership/views/admin_add_level.php:26
646
  msgid "Weeks (Access expires after given number of weeks"
647
- msgstr ""
648
 
649
  #: simple-membership/views/admin_add_level.php:28
650
  #: simple-membership/views/admin_edit_level.php:29
651
  msgid "Months (Access expires after given number of months)"
652
- msgstr ""
653
 
654
  #: simple-membership/views/admin_add_level.php:30
655
  #: simple-membership/views/admin_edit_level.php:32
656
  msgid "Years (Access expires after given number of years)"
657
- msgstr ""
658
 
659
  #: simple-membership/views/admin_add_level.php:31
660
  #: simple-membership/views/admin_edit_level.php:34
@@ -702,16 +702,16 @@ msgstr ""
702
 
703
  #: simple-membership/views/admin_edit.php:5
704
  msgid "Edit Member"
705
- msgstr ""
706
 
707
  #: simple-membership/views/admin_edit.php:6
708
  msgid "Edit existing member details."
709
- msgstr ""
710
 
711
  #: simple-membership/views/admin_edit.php:9
712
  #: simple-membership/views/login.php:5
713
  msgid "Username"
714
- msgstr ""
715
 
716
  #: simple-membership/views/admin_edit.php:17
717
  msgid "(twice, leave empty to retain old password)"
@@ -767,7 +767,7 @@ msgstr ""
767
  #: simple-membership/views/admin_members.php:9
768
  #: simple-membership/views/admin_membership_levels.php:10
769
  msgid "search"
770
- msgstr ""
771
 
772
  #: simple-membership/views/admin_membership_levels.php:2
773
  msgid "Simple WP Membership::Membership Levels"
@@ -775,7 +775,7 @@ msgstr ""
775
 
776
  #: simple-membership/views/admin_membership_level_menu.php:2
777
  msgid "Membership level"
778
- msgstr ""
779
 
780
  #: simple-membership/views/admin_membership_level_menu.php:3
781
  msgid "Manage Content Production"
@@ -904,7 +904,7 @@ msgstr "Medlemskap"
904
 
905
  #: simple-membership/views/loggedin.php:15
906
  msgid "Account Expiry"
907
- msgstr "Utgånget konto"
908
 
909
  #: simple-membership/views/loggedin.php:19
910
  msgid "Logout"
2
  msgstr ""
3
  "Project-Id-Version: Simple Membership\n"
4
  "POT-Creation-Date: 2015-06-10 22:20+0100\n"
5
+ "PO-Revision-Date: 2015-06-28 10:03+0100\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
189
 
190
  #: simple-membership/classes/class.bForm.php:216
191
  msgid "Account state field is invalid"
192
+ msgstr "Kontostatus fältet är ogiltigt"
193
 
194
  #: simple-membership/classes/class.bForm.php:223
195
  msgid "Invalid membership level"
275
 
276
  #: simple-membership/classes/class.bMembers.php:23
277
  msgid "Account State"
278
+ msgstr "Kontostatus"
279
 
280
  #: simple-membership/classes/class.bMembers.php:35
281
  #: simple-membership/classes/class.bMembershipLevels.php:29
442
 
443
  #: simple-membership/classes/class.bSettings.php:367
444
  msgid "Not a Member?"
445
+ msgstr "Är du är inte medlem?"
446
 
447
  #: simple-membership/classes/class.bSettings.php:367
448
  #: simple-membership/views/login.php:27
449
  msgid "Join Us"
450
+ msgstr "Bli medlem här!"
451
 
452
  #: simple-membership/classes/class.bUtils.php:63
453
  msgid "Active"
529
 
530
  #: simple-membership/views/add.php:37
531
  msgid "Register"
532
+ msgstr "Skicka"
533
 
534
  #: simple-membership/views/admin_add.php:6
535
  msgid "Add Member"
624
 
625
  #: simple-membership/views/admin_add_level.php:22
626
  msgid "No Expiry (Access for this level will not expire until cancelled"
627
+ msgstr "Inget utgångsdatum"
628
 
629
  #: simple-membership/views/admin_add_level.php:23
630
  #: simple-membership/views/admin_add_level.php:25
635
  #: simple-membership/views/admin_edit_level.php:28
636
  #: simple-membership/views/admin_edit_level.php:31
637
  msgid "Expire After"
638
+ msgstr "Upphör efter"
639
 
640
  #: simple-membership/views/admin_add_level.php:24
641
  #: simple-membership/views/admin_edit_level.php:23
642
  msgid "Days (Access expires after given number of days)"
643
+ msgstr "Dagar (antal dagar till att medlemskapet upphör)"
644
 
645
  #: simple-membership/views/admin_add_level.php:26
646
  msgid "Weeks (Access expires after given number of weeks"
647
+ msgstr "Veckor (antal veckor till att medlemskapet upphör)"
648
 
649
  #: simple-membership/views/admin_add_level.php:28
650
  #: simple-membership/views/admin_edit_level.php:29
651
  msgid "Months (Access expires after given number of months)"
652
+ msgstr "Månader (antal månader till att medlemskapet upphör)"
653
 
654
  #: simple-membership/views/admin_add_level.php:30
655
  #: simple-membership/views/admin_edit_level.php:32
656
  msgid "Years (Access expires after given number of years)"
657
+ msgstr "År (antal år till att medlemskapet upphör)"
658
 
659
  #: simple-membership/views/admin_add_level.php:31
660
  #: simple-membership/views/admin_edit_level.php:34
702
 
703
  #: simple-membership/views/admin_edit.php:5
704
  msgid "Edit Member"
705
+ msgstr "Redigera medlem"
706
 
707
  #: simple-membership/views/admin_edit.php:6
708
  msgid "Edit existing member details."
709
+ msgstr "Redigera befintliga medlemsuppgifter"
710
 
711
  #: simple-membership/views/admin_edit.php:9
712
  #: simple-membership/views/login.php:5
713
  msgid "Username"
714
+ msgstr "Användarnamn"
715
 
716
  #: simple-membership/views/admin_edit.php:17
717
  msgid "(twice, leave empty to retain old password)"
767
  #: simple-membership/views/admin_members.php:9
768
  #: simple-membership/views/admin_membership_levels.php:10
769
  msgid "search"
770
+ msgstr "Sök"
771
 
772
  #: simple-membership/views/admin_membership_levels.php:2
773
  msgid "Simple WP Membership::Membership Levels"
775
 
776
  #: simple-membership/views/admin_membership_level_menu.php:2
777
  msgid "Membership level"
778
+ msgstr "Medlemskapsnivå"
779
 
780
  #: simple-membership/views/admin_membership_level_menu.php:3
781
  msgid "Manage Content Production"
904
 
905
  #: simple-membership/views/loggedin.php:15
906
  msgid "Account Expiry"
907
+ msgstr "Medlemskapet upphör"
908
 
909
  #: simple-membership/views/loggedin.php:19
910
  msgid "Logout"
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: smp7, wp.insider, amijanina
3
  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,
5
  Requires at least: 3.3
6
- Tested up to: 4.2
7
- Stable tag: 2.2.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -61,6 +61,7 @@ You can create a free forum user account and ask your questions.
61
  * Hide the admin toolbar from the frontend of your site.
62
  * Allow your members to deleter their membership accounts.
63
  * Send quick notification email to your members.
 
64
  * The login and registration widgets will be responsive if you are using a responsive theme.
65
  * Front-end member registration page.
66
  * Front-end member profiles.
@@ -76,6 +77,7 @@ The following language translations are already available:
76
  * French
77
  * Chinese
78
  * Portuguese (Brazil)
 
79
  * Swedish
80
  * Macedonian
81
  * Polish
@@ -108,6 +110,18 @@ https://simple-membership-plugin.com/
108
 
109
  == Changelog ==
110
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  = 2.2.9 =
112
  - Added a new feature to customize the password reset email.
113
  - Added a new feature to customize the admin notification email address.
3
  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,
5
  Requires at least: 3.3
6
+ Tested up to: 4.3
7
+ Stable tag: 3.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
61
  * Hide the admin toolbar from the frontend of your site.
62
  * Allow your members to deleter their membership accounts.
63
  * Send quick notification email to your members.
64
+ * Customize the password reset email for members.
65
  * The login and registration widgets will be responsive if you are using a responsive theme.
66
  * Front-end member registration page.
67
  * Front-end member profiles.
77
  * French
78
  * Chinese
79
  * Portuguese (Brazil)
80
+ * Portuguese (Portugal)
81
  * Swedish
82
  * Macedonian
83
  * Polish
110
 
111
  == Changelog ==
112
 
113
+ = 3.0.1 =
114
+ - Added a new CSS class to the registration complete message.
115
+ - Added Portuguese (Portugal) language translation file. The translation was submitted by Edgar Sprecher.
116
+ - Replaced mysql_real_escape_string() with esc_sql()
117
+ - Members list in the admin is now sorted by member_id by default.
118
+ - Added a new filter in the registration form so Google recaptcha can be added to it.
119
+
120
+ = 3.0 =
121
+ - Updated the swedish langauge translation
122
+ - Added a new option to enable opening of the PayPal buy button in a new window (using the "new_window" parameter in the shortcode).
123
+ - You can now create and configure PayPal Subscription button for membership payment from the payments menu.
124
+
125
  = 2.2.9 =
126
  - Added a new feature to customize the password reset email.
127
  - Added a new feature to customize the admin notification email address.
simple-wp-membership.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Simple WordPress Membership
4
- Version: v2.2.9
5
  Plugin URI: https://simple-membership-plugin.com/
6
  Author: smp7, wp.insider
7
  Author URI: https://simple-membership-plugin.com/
@@ -9,7 +9,7 @@ Description: A flexible, well-supported, and easy-to-use WordPress membership pl
9
  */
10
 
11
  //Direct access to this file is not permitted
12
- if (realpath(__FILE__) === realpath($_SERVER["SCRIPT_FILENAME"])) {
13
  exit("Do not access this file directly.");
14
  }
15
 
@@ -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', '2.2.9');
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.0.1
5
  Plugin URI: https://simple-membership-plugin.com/
6
  Author: smp7, wp.insider
7
  Author URI: https://simple-membership-plugin.com/
9
  */
10
 
11
  //Direct access to this file is not permitted
12
+ if (!defined('ABSPATH')){
13
  exit("Do not access this file directly.");
14
  }
15
 
17
  include_once('classes/class.swpm-cronjob.php');
18
  include_once('swpm-compat.php');
19
 
20
+ define('SIMPLE_WP_MEMBERSHIP_VER', '3.0.1');
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__) . '/');
views/add.php CHANGED
@@ -1,49 +1,55 @@
1
  <div class="swpm-registration-widget-form">
2
- <form id="swpm-registration-form" name="swpm-registration-form" method="post" action="">
3
- <input type ="hidden" name="level_identifier" value="<?php echo $level_identifier?>" />
4
- <table>
5
- <tr>
6
- <td><label for="user_name"><?php echo SwpmUtils::_('User Name') ?></label></td>
7
- <td><input type="text" id="user_name" class="validate[required,custom[noapostrophe],custom[SWPMUserName],minSize[4],ajax[ajaxUserCall]]" value="<?php echo $user_name;?>" tabindex="1" size="50" name="user_name" /></td>
8
- </tr>
9
- <tr>
10
- <td><label for="email"><?php echo SwpmUtils::_('Email') ?></label></td>
11
- <td><input type="text" id="email" class="validate[required,custom[email],ajax[ajaxEmailCall]]" value="<?php echo $email;?>" tabindex="2" size="50" name="email" /></td>
12
- </tr>
13
- <tr>
14
- <td><label for="password"><?php echo SwpmUtils::_('Password') ?></label></td>
15
- <td><input type="password" autocomplete="off" id="password" value="" tabindex="3" size="50" name="password" /></td>
16
- </tr>
17
- <tr>
18
- <td><label for="password_re"><?php echo SwpmUtils::_('Repeat Password') ?></label></td>
19
- <td><input type="password" autocomplete="off" id="password_re" value="" tabindex="4" size="50" name="password_re" /></td>
20
- </tr>
21
- <tr>
22
- <td><label for="first_name"><?php echo SwpmUtils::_('First Name') ?></label></td>
23
- <td><input type="text" id="first_name" value="<?php echo $first_name;?>" tabindex="5" size="50" name="first_name" /></td>
24
- </tr>
25
- <tr>
26
- <td><label for="last_name"><?php echo SwpmUtils::_('Last Name') ?></label></td>
27
- <td><input type="text" id="last_name" value="<?php echo $last_name;?>" tabindex="6" size="50" name="last_name" /></td>
28
- </tr>
29
- <tr>
30
- <td><label for="membership_level"><?php echo SwpmUtils::_('Membership Level') ?></label></td>
31
- <td>
32
- <?php echo $membership_level_alias;?>
33
- <input type="hidden" value="<?php echo $membership_level;?>" size="50" name="membership_level" tabindex="7" id="membership_level" />
34
- </td>
35
- </tr>
36
- </table>
37
- <p align="center"><input type="submit" value="<?php echo SwpmUtils::_('Register') ?>" tabindex="8" id="submit" name="swpm_registration_submit" /></p>
38
- <input type="hidden" name="action" value="custom_posts" />
39
- <?php wp_nonce_field( 'name_of_my_action','name_of_nonce_field' ); ?>
40
- </form>
 
 
 
 
 
 
41
  </div>
42
  <script>
43
- jQuery(document).ready(function($){
44
- $.validationEngineLanguage.allRules['ajaxUserCall']['url']= '<?php echo admin_url('admin-ajax.php');?>';
45
- $.validationEngineLanguage.allRules['ajaxEmailCall']['url']= '<?php echo admin_url('admin-ajax.php');?>';
46
- $.validationEngineLanguage.allRules['ajaxEmailCall']['extraData'] = '&action=swpm_validate_email&member_id=<?php echo filter_input(INPUT_GET, 'member_id');?>';
47
- $("#swpm-registration-form").validationEngine('attach');
48
- });
49
  </script>
1
  <div class="swpm-registration-widget-form">
2
+ <form id="swpm-registration-form" name="swpm-registration-form" method="post" action="">
3
+ <input type ="hidden" name="level_identifier" value="<?php echo $level_identifier ?>" />
4
+ <table>
5
+ <tr>
6
+ <td><label for="user_name"><?php echo SwpmUtils::_('User Name') ?></label></td>
7
+ <td><input type="text" id="user_name" class="validate[required,custom[noapostrophe],custom[SWPMUserName],minSize[4],ajax[ajaxUserCall]]" value="<?php echo $user_name; ?>" size="50" name="user_name" /></td>
8
+ </tr>
9
+ <tr>
10
+ <td><label for="email"><?php echo SwpmUtils::_('Email') ?></label></td>
11
+ <td><input type="text" id="email" class="validate[required,custom[email],ajax[ajaxEmailCall]]" value="<?php echo $email; ?>" size="50" name="email" /></td>
12
+ </tr>
13
+ <tr>
14
+ <td><label for="password"><?php echo SwpmUtils::_('Password') ?></label></td>
15
+ <td><input type="password" autocomplete="off" id="password" value="" size="50" name="password" /></td>
16
+ </tr>
17
+ <tr>
18
+ <td><label for="password_re"><?php echo SwpmUtils::_('Repeat Password') ?></label></td>
19
+ <td><input type="password" autocomplete="off" id="password_re" value="" size="50" name="password_re" /></td>
20
+ </tr>
21
+ <tr>
22
+ <td><label for="first_name"><?php echo SwpmUtils::_('First Name') ?></label></td>
23
+ <td><input type="text" id="first_name" value="<?php echo $first_name; ?>" size="50" name="first_name" /></td>
24
+ </tr>
25
+ <tr>
26
+ <td><label for="last_name"><?php echo SwpmUtils::_('Last Name') ?></label></td>
27
+ <td><input type="text" id="last_name" value="<?php echo $last_name; ?>" size="50" name="last_name" /></td>
28
+ </tr>
29
+ <tr>
30
+ <td><label for="membership_level"><?php echo SwpmUtils::_('Membership Level') ?></label></td>
31
+ <td>
32
+ <?php echo $membership_level_alias; ?>
33
+ <input type="hidden" value="<?php echo $membership_level; ?>" size="50" name="membership_level" id="membership_level" />
34
+ </td>
35
+ </tr>
36
+ </table>
37
+
38
+ <div class="swpm-before-registration-submit-section" align="center"><?php echo apply_filters('swpm_before_registration_submit_button', ''); ?></div>
39
+
40
+ <div class="swpm-registration-submit-section" align="center">
41
+ <input type="submit" value="<?php echo SwpmUtils::_('Register') ?>" id="submit" name="swpm_registration_submit" />
42
+ </div>
43
+
44
+ <input type="hidden" name="action" value="custom_posts" />
45
+ <?php wp_nonce_field('name_of_my_action', 'name_of_nonce_field'); ?>
46
+ </form>
47
  </div>
48
  <script>
49
+ jQuery(document).ready(function ($) {
50
+ $.validationEngineLanguage.allRules['ajaxUserCall']['url'] = '<?php echo admin_url('admin-ajax.php'); ?>';
51
+ $.validationEngineLanguage.allRules['ajaxEmailCall']['url'] = '<?php echo admin_url('admin-ajax.php'); ?>';
52
+ $.validationEngineLanguage.allRules['ajaxEmailCall']['extraData'] = '&action=swpm_validate_email&member_id=<?php echo filter_input(INPUT_GET, 'member_id'); ?>';
53
+ $("#swpm-registration-form").validationEngine('attach');
54
+ });
55
  </script>
views/admin_add_ons_page.php CHANGED
@@ -3,93 +3,97 @@ $output = '';
3
  echo '<link type="text/css" rel="stylesheet" href="' . SIMPLE_WP_MEMBERSHIP_URL . '/css/swpm.addons.listing.css" />' . "\n";
4
  ?>
5
 
6
- <h1><?php echo SwpmUtils::_('Simple WP Membership::Add-ons') ?></h1>
7
  <div class="wrap">
 
8
 
9
- <?php
10
- $addons_data = array();
11
- $addon_1 = array(
12
- 'name' => 'After Login Redirection',
13
- 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-login-redirection.png',
14
- 'description' => 'Allows you to configure after login redirection to a specific page based on the member\'s level',
15
- 'page_url' => 'https://simple-membership-plugin.com/configure-login-redirection-members/',
16
- );
17
- array_push($addons_data, $addon_1);
18
-
19
- $addon_2 = array(
20
- 'name' => 'MailChimp Integration',
21
- 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/mailchimp-integration.png',
22
- 'description' => 'Allows you to signup the member to your MailChimp list after registration',
23
- 'page_url' => 'https://simple-membership-plugin.com/signup-members-mailchimp-list/',
24
- );
25
- array_push($addons_data, $addon_2);
26
-
27
- $addon_3 = array(
28
- 'name' => 'Form Shortcode',
29
- 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/form-shortcode-generator.png',
30
- 'description' => 'Simple Membership Addon to generate form shortcode for specific membership level.',
31
- 'page_url' => 'https://simple-membership-plugin.com/simple-membership-registration-form-shortcode-generator/',
32
- );
33
- array_push($addons_data, $addon_3);
34
-
35
- $addon_4 = array(
36
- 'name' => 'WP User Import',
37
- 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/wp-user-import.png',
38
- 'description' => 'Addon for importing existing Wordpress users to Simple Membership plugin',
39
- 'page_url' => 'https://simple-membership-plugin.com/import-existing-wordpress-users-simple-membership-plugin/',
40
- );
41
- array_push($addons_data, $addon_4);
42
-
43
- $addon_5 = array(
44
- 'name' => 'Form Builder',
45
- 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-form-builder.png',
46
- 'description' => 'Allows you to fully customize the fields that appear on the registration and edit profile forms of your membership site',
47
- 'page_url' => 'https://simple-membership-plugin.com/simple-membership-form-builder-addon/',
48
- );
49
- array_push($addons_data, $addon_5);
50
-
51
- $addon_6 = array(
52
- 'name' => 'Custom Messages',
53
- 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-custom-messages.png',
54
- 'description' => 'Custom Messages addon allows you to customize the content protection message that gets output from the membership plugin',
55
- 'page_url' => 'https://simple-membership-plugin.com/simple-membership-custom-messages-addon/',
56
- );
57
- array_push($addons_data, $addon_6);
58
-
59
- $addon_7 = array(
60
- 'name' => 'Protect Older Posts',
61
- 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-older-posts-protection.png',
62
- 'description' => 'The protect older posts addon allows you to control protection of posts that were published before a member\'s access start date.',
63
- 'page_url' => 'https://simple-membership-plugin.com/simple-membership-protect-older-posts-addon/',
64
- );
65
- array_push($addons_data, $addon_7);
66
-
67
- foreach ($addons_data as $addon) {
68
- $output .= '<div class="swpm_addon_item_canvas">';
69
-
70
- $output .= '<div class="swpm_addon_item_thumb">';
71
- $img_src = $addon['thumbnail'];
72
- $output .= '<img src="' . $img_src . '" alt="' . $addon['name'] . '">';
73
- $output .= '</div>'; //end thumbnail
74
-
75
- $output .='<div class="swpm_addon_item_body">';
76
- $output .='<div class="swpm_addon_item_name">';
77
- $output .= '<a href="' . $addon['page_url'] . '" target="_blank">' . $addon['name'] . '</a>';
78
- $output .='</div>'; //end name
79
-
80
- $output .='<div class="swpm_addon_item_description">';
81
- $output .= $addon['description'];
82
- $output .='</div>'; //end description
83
-
84
- $output .='<div class="swpm_addon_item_details_link">';
85
- $output .='<a href="'.$addon['page_url'].'" class="swpm_addon_view_details" target="_blank">View Details</a>';
86
- $output .='</div>'; //end detils link
87
- $output .='</div>'; //end body
88
-
89
- $output .= '</div>'; //end canvas
90
- }
91
-
92
- echo $output;
93
- ?>
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  </div><!-- end of .wrap -->
3
  echo '<link type="text/css" rel="stylesheet" href="' . SIMPLE_WP_MEMBERSHIP_URL . '/css/swpm.addons.listing.css" />' . "\n";
4
  ?>
5
 
 
6
  <div class="wrap">
7
+ <h2><?php echo SwpmUtils::_('Simple WP Membership::Add-ons') ?></h2>
8
 
9
+ <div id="poststuff"><div id="post-body">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
+
12
+ <?php
13
+ $addons_data = array();
14
+ $addon_1 = array(
15
+ 'name' => 'After Login Redirection',
16
+ 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-login-redirection.png',
17
+ 'description' => 'Allows you to configure after login redirection to a specific page based on the member\'s level',
18
+ 'page_url' => 'https://simple-membership-plugin.com/configure-login-redirection-members/',
19
+ );
20
+ array_push($addons_data, $addon_1);
21
+
22
+ $addon_2 = array(
23
+ 'name' => 'MailChimp Integration',
24
+ 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/mailchimp-integration.png',
25
+ 'description' => 'Allows you to signup the member to your MailChimp list after registration',
26
+ 'page_url' => 'https://simple-membership-plugin.com/signup-members-mailchimp-list/',
27
+ );
28
+ array_push($addons_data, $addon_2);
29
+
30
+ $addon_3 = array(
31
+ 'name' => 'Form Shortcode',
32
+ 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/form-shortcode-generator.png',
33
+ 'description' => 'Simple Membership Addon to generate form shortcode for specific membership level.',
34
+ 'page_url' => 'https://simple-membership-plugin.com/simple-membership-registration-form-shortcode-generator/',
35
+ );
36
+ array_push($addons_data, $addon_3);
37
+
38
+ $addon_4 = array(
39
+ 'name' => 'WP User Import',
40
+ 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/wp-user-import.png',
41
+ 'description' => 'Addon for importing existing Wordpress users to Simple Membership plugin',
42
+ 'page_url' => 'https://simple-membership-plugin.com/import-existing-wordpress-users-simple-membership-plugin/',
43
+ );
44
+ array_push($addons_data, $addon_4);
45
+
46
+ $addon_5 = array(
47
+ 'name' => 'Form Builder',
48
+ 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-form-builder.png',
49
+ 'description' => 'Allows you to fully customize the fields that appear on the registration and edit profile forms of your membership site',
50
+ 'page_url' => 'https://simple-membership-plugin.com/simple-membership-form-builder-addon/',
51
+ );
52
+ array_push($addons_data, $addon_5);
53
+
54
+ $addon_6 = array(
55
+ 'name' => 'Custom Messages',
56
+ 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-custom-messages.png',
57
+ 'description' => 'Custom Messages addon allows you to customize the content protection message that gets output from the membership plugin',
58
+ 'page_url' => 'https://simple-membership-plugin.com/simple-membership-custom-messages-addon/',
59
+ );
60
+ array_push($addons_data, $addon_6);
61
+
62
+ $addon_7 = array(
63
+ 'name' => 'Protect Older Posts',
64
+ 'thumbnail' => SIMPLE_WP_MEMBERSHIP_URL . '/images/addons/swpm-older-posts-protection.png',
65
+ 'description' => 'The protect older posts addon allows you to control protection of posts that were published before a member\'s access start date.',
66
+ 'page_url' => 'https://simple-membership-plugin.com/simple-membership-protect-older-posts-addon/',
67
+ );
68
+ array_push($addons_data, $addon_7);
69
+
70
+ foreach ($addons_data as $addon) {
71
+ $output .= '<div class="swpm_addon_item_canvas">';
72
+
73
+ $output .= '<div class="swpm_addon_item_thumb">';
74
+ $img_src = $addon['thumbnail'];
75
+ $output .= '<img src="' . $img_src . '" alt="' . $addon['name'] . '">';
76
+ $output .= '</div>'; //end thumbnail
77
+
78
+ $output .='<div class="swpm_addon_item_body">';
79
+ $output .='<div class="swpm_addon_item_name">';
80
+ $output .= '<a href="' . $addon['page_url'] . '" target="_blank">' . $addon['name'] . '</a>';
81
+ $output .='</div>'; //end name
82
+
83
+ $output .='<div class="swpm_addon_item_description">';
84
+ $output .= $addon['description'];
85
+ $output .='</div>'; //end description
86
+
87
+ $output .='<div class="swpm_addon_item_details_link">';
88
+ $output .='<a href="' . $addon['page_url'] . '" class="swpm_addon_view_details" target="_blank">View Details</a>';
89
+ $output .='</div>'; //end detils link
90
+ $output .='</div>'; //end body
91
+
92
+ $output .= '</div>'; //end canvas
93
+ }
94
+
95
+ echo $output;
96
+ ?>
97
+
98
+ </div></div><!-- end of poststuff and post-body -->
99
  </div><!-- end of .wrap -->
views/payments/payment-gateway/admin_paypal_subscription_button.php CHANGED
@@ -6,17 +6,20 @@ add_action('swpm_create_new_button_for_pp_subscription', 'swpm_create_new_pp_sub
6
 
7
  function swpm_create_new_pp_subscription_button() {
8
  ?>
9
- <div class="postbox">
10
- <h3><label for="title"><?php echo SwpmUtils::_('PayPal Subscription Button Configuration'); ?></label></h3>
11
- <div class="inside">
12
 
13
- <?php
14
- //TODO - Need to work on the subscription button fields
15
- echo '<p>This feature will be coming in the next version of the plugin.</p>';
16
- echo '</div></div>';
17
- return;
18
- ?>
19
- <form id="pp_button_config_form" method="post">
 
 
 
 
 
 
20
  <input type="hidden" name="button_type" value="<?php echo strip_tags($_REQUEST['button_type']); ?>">
21
  <input type="hidden" name="swpm_button_type_selected" value="1">
22
 
@@ -40,14 +43,6 @@ return;
40
  </td>
41
  </tr>
42
 
43
- <tr valign="top">
44
- <th scope="row"><?php echo SwpmUtils::_('Payment Amount'); ?></th>
45
- <td>
46
- <input type="text" size="6" name="payment_amount" value="" required />
47
- <p class="description">Enter payment amount. Example values: 10.00 or 19.50 or 299.95 etc (do not put currency symbol).</p>
48
- </td>
49
- </tr>
50
-
51
  <tr valign="top">
52
  <th scope="row"><?php echo SwpmUtils::_('Payment Currency'); ?></th>
53
  <td>
@@ -88,20 +83,99 @@ return;
88
  </tr>
89
 
90
  <tr valign="top">
91
- <th scope="row"><?php echo SwpmUtils::_('Return URL'); ?></th>
92
  <td>
93
- <input type="text" size="100" name="return_url" value="" />
94
- <p class="description">This is the URL the user will be redirected to after a successful payment. Enter the URL of your Thank You page here.</p>
 
 
 
 
 
 
 
 
95
  </td>
96
  </tr>
97
 
98
  <tr valign="top">
99
- <th scope="row"><?php echo SwpmUtils::_('PayPal Email'); ?></th>
100
  <td>
101
- <input type="text" size="50" name="paypal_email" value="" required />
102
- <p class="description">Enter your PayPal email address. The payment will go to this PayPal account.</p>
 
 
 
 
 
103
  </td>
104
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
 
106
  <tr valign="top">
107
  <th scope="row"><?php echo SwpmUtils::_('Button Image URL'); ?></th>
@@ -110,17 +184,17 @@ return;
110
  <p class="description">If you want to customize the look of the button using an image then enter the URL of the image.</p>
111
  </td>
112
  </tr>
113
-
114
  </table>
 
 
115
 
116
- <p class="submit">
117
- <input type="submit" name="swpm_pp_subscription_save_submit" class="button-primary" value="<?php echo SwpmUtils::_('Save Payment Data'); ?>" >
118
- </p>
119
 
120
- </form>
121
 
122
- </div>
123
- </div>
124
  <?php
125
  }
126
 
@@ -133,33 +207,316 @@ function swpm_save_new_pp_subscription_button_data() {
133
  if (isset($_REQUEST['swpm_pp_subscription_save_submit'])) {
134
  //This is a PayPal subscription button save event. Process the submission.
135
  //TODO - Do some basic validation check??
136
-
137
-
138
- //TODO Save the button data
139
- // $button_id = wp_insert_post(
140
- // array(
141
- // 'post_title' => strip_tags($_REQUEST['button_name']),
142
- // 'post_type' => 'swpm_payment_button',
143
- // 'post_content' => '',
144
- // 'post_status' => 'publish'
145
- // )
146
- // );
147
- //
148
- // $button_type = strip_tags($_REQUEST['button_type']);
149
- // add_post_meta($button_id, 'button_type', $button_type);
150
- // add_post_meta($button_id, 'membership_level_id', strip_tags($_REQUEST['membership_level_id']));
151
- // add_post_meta($button_id, 'payment_amount', trim(strip_tags($_REQUEST['payment_amount'])));
152
- // add_post_meta($button_id, 'payment_currency', strip_tags($_REQUEST['payment_currency']));
153
- // add_post_meta($button_id, 'return_url', trim(strip_tags($_REQUEST['return_url'])));
154
- // add_post_meta($button_id, 'paypal_email', trim(strip_tags($_REQUEST['paypal_email'])));
155
- // add_post_meta($button_id, 'button_image_url', trim(strip_tags($_REQUEST['button_image_url'])));
156
- //
157
- // //Redirect to the edit interface of this button with $button_id
158
- // $url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=edit_button&button_id=' . $button_id . '&button_type=' . $button_type;
159
- // SwpmMiscUtils::redirect_to_url($url);
 
 
 
 
 
 
 
 
 
 
160
  }
161
  }
162
 
163
  /* * **********************************************************************
164
  * End of new PayPal subscription payment button stuff
165
- * ********************************************************************** */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  function swpm_create_new_pp_subscription_button() {
8
  ?>
 
 
 
9
 
10
+ <div style="background: none repeat scroll 0 0 #FFF6D5;border: 1px solid #D1B655;color: #3F2502;margin: 10px 0;padding: 5px 5px 5px 10px;text-shadow: 1px 1px #FFFFFF;">
11
+ <p>View the
12
+ <a target="_blank" href="https://simple-membership-plugin.com/create-paypal-subscription-button-inside-the-simple-membership-plugin/">documentation</a>
13
+ to learn how to create a PayPal Subscription payment button and use it.
14
+ </p>
15
+ </div>
16
+
17
+ <form id="pp_button_config_form" method="post">
18
+
19
+ <div class="postbox">
20
+ <h3><label for="title"><?php echo SwpmUtils::_('PayPal Subscription Button Configuration'); ?></label></h3>
21
+ <div class="inside">
22
+
23
  <input type="hidden" name="button_type" value="<?php echo strip_tags($_REQUEST['button_type']); ?>">
24
  <input type="hidden" name="swpm_button_type_selected" value="1">
25
 
43
  </td>
44
  </tr>
45
 
 
 
 
 
 
 
 
 
46
  <tr valign="top">
47
  <th scope="row"><?php echo SwpmUtils::_('Payment Currency'); ?></th>
48
  <td>
83
  </tr>
84
 
85
  <tr valign="top">
86
+ <th scope="row"><?php echo SwpmUtils::_('PayPal Email'); ?></th>
87
  <td>
88
+ <input type="text" size="50" name="paypal_email" value="" required />
89
+ <p class="description">Enter your PayPal email address. The payment will go to this PayPal account.</p>
90
+ </td>
91
+ </tr>
92
+
93
+ <tr valign="top">
94
+ <th scope="row"><?php echo SwpmUtils::_('Billing Amount Each Cycle'); ?></th>
95
+ <td>
96
+ <input type="text" size="6" name="billing_amount" value="" required />
97
+ <p class="description">Amount to be charged on every billing cycle. If used with a trial period then this amount will be charged after the trial period is over. Example values: 10.00 or 19.50 or 299.95 etc (do not put currency symbol).</p>
98
  </td>
99
  </tr>
100
 
101
  <tr valign="top">
102
+ <th scope="row"><?php echo SwpmUtils::_('Billing Cycle'); ?></th>
103
  <td>
104
+ <input type="text" size="4" name="billing_cycle" value="" required />
105
+ <select id="billing_cycle_term" name="billing_cycle_term">
106
+ <option value="D">Day(s)</option>
107
+ <option value="M">Month(s)</option>
108
+ <option value="Y">Year(s)</option>
109
+ </select>
110
+ <p class="description">Set the interval of the recurring payment. Example value: 1 Month (if you want to charge every month)</p>
111
  </td>
112
+ </tr>
113
+
114
+ <tr valign="top">
115
+ <th scope="row"><?php echo SwpmUtils::_('Billing Cycle Count'); ?></th>
116
+ <td>
117
+ <input type="text" size="6" name="billing_cycle_count" value="" />
118
+ <p class="description">After how many cycles should billing stop. Leave this field empty (or enter 0) if you want the payment to continue until the subscription is canceled.</p>
119
+ </td>
120
+ </tr>
121
+
122
+ <tr valign="top">
123
+ <th scope="row"><?php echo SwpmUtils::_('Re-attempt on Failure'); ?></th>
124
+ <td>
125
+ <input type="checkbox" name="billing_reattempt" value="1" />
126
+ <p class="description">When checked, the payment will be re-attempted two more times if the payment fails. After the third failure, the subscription will be canceled..</p>
127
+ </td>
128
+ </tr>
129
+
130
+ </table>
131
+
132
+ </div>
133
+ </div><!-- end of main button configuration box -->
134
+
135
+ <div class="postbox">
136
+ <h3><label for="title"><?php echo SwpmUtils::_('Trial Billing Details (Leave empty if you are not offering a trial period)'); ?></label></h3>
137
+ <div class="inside">
138
+
139
+ <table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6">
140
+
141
+ <tr valign="top">
142
+ <th scope="row"><?php echo SwpmUtils::_('Trial Billing Amount'); ?></th>
143
+ <td>
144
+ <input type="text" size="6" name="trial_billing_amount" value="" />
145
+ <p class="description">Amount to be charged for the trial period. Enter 0 if you want to offer a free trial period.</p>
146
+ </td>
147
+ </tr>
148
+
149
+ <tr valign="top">
150
+ <th scope="row"><?php echo SwpmUtils::_('Trial Billing Period'); ?></th>
151
+ <td>
152
+ <input type="text" size="4" name="trial_billing_cycle" value="" />
153
+ <select id="billing_cycle_term" name="trial_billing_cycle_term">
154
+ <option value="D">Day(s)</option>
155
+ <option value="M">Month(s)</option>
156
+ <option value="Y">Year(s)</option>
157
+ </select>
158
+ <p class="description">Length of the trial period</p>
159
+ </td>
160
+ </tr>
161
+
162
+ </table>
163
+ </div>
164
+ </div><!-- end of trial billing details box -->
165
+
166
+ <div class="postbox">
167
+ <h3><label for="title"><?php echo SwpmUtils::_('Optional Details'); ?></label></h3>
168
+ <div class="inside">
169
+
170
+ <table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6">
171
+
172
+ <tr valign="top">
173
+ <th scope="row"><?php echo SwpmUtils::_('Return URL'); ?></th>
174
+ <td>
175
+ <input type="text" size="100" name="return_url" value="" />
176
+ <p class="description">This is the URL the user will be redirected to after a successful payment. Enter the URL of your Thank You page here.</p>
177
+ </td>
178
+ </tr>
179
 
180
  <tr valign="top">
181
  <th scope="row"><?php echo SwpmUtils::_('Button Image URL'); ?></th>
184
  <p class="description">If you want to customize the look of the button using an image then enter the URL of the image.</p>
185
  </td>
186
  </tr>
187
+
188
  </table>
189
+ </div>
190
+ </div><!-- end of optional details box -->
191
 
192
+ <p class="submit">
193
+ <input type="submit" name="swpm_pp_subscription_save_submit" class="button-primary" value="<?php echo SwpmUtils::_('Save Payment Data'); ?>" >
194
+ </p>
195
 
196
+ </form>
197
 
 
 
198
  <?php
199
  }
200
 
207
  if (isset($_REQUEST['swpm_pp_subscription_save_submit'])) {
208
  //This is a PayPal subscription button save event. Process the submission.
209
  //TODO - Do some basic validation check??
210
+
211
+ $button_id = wp_insert_post(
212
+ array(
213
+ 'post_title' => strip_tags($_REQUEST['button_name']),
214
+ 'post_type' => 'swpm_payment_button',
215
+ 'post_content' => '',
216
+ 'post_status' => 'publish'
217
+ )
218
+ );
219
+
220
+ $button_type = strip_tags($_REQUEST['button_type']);
221
+ add_post_meta($button_id, 'button_type', $button_type);
222
+ add_post_meta($button_id, 'membership_level_id', strip_tags($_REQUEST['membership_level_id']));
223
+ //add_post_meta($button_id, 'payment_amount', trim(strip_tags($_REQUEST['payment_amount'])));
224
+ add_post_meta($button_id, 'payment_currency', strip_tags($_REQUEST['payment_currency']));
225
+ add_post_meta($button_id, 'return_url', trim(strip_tags($_REQUEST['return_url'])));
226
+ add_post_meta($button_id, 'paypal_email', trim(strip_tags($_REQUEST['paypal_email'])));
227
+ add_post_meta($button_id, 'button_image_url', trim(strip_tags($_REQUEST['button_image_url'])));
228
+
229
+ //Subscription billing details
230
+ add_post_meta($button_id, 'billing_amount', strip_tags($_REQUEST['billing_amount']));
231
+ add_post_meta($button_id, 'billing_cycle', strip_tags($_REQUEST['billing_cycle']));
232
+ add_post_meta($button_id, 'billing_cycle_term', strip_tags($_REQUEST['billing_cycle_term']));
233
+ add_post_meta($button_id, 'billing_cycle_count', strip_tags($_REQUEST['billing_cycle_count']));
234
+ add_post_meta($button_id, 'billing_reattempt', isset($_REQUEST['billing_reattempt']) ? '1' : '');
235
+
236
+ //Trial billing details
237
+ add_post_meta($button_id, 'trial_billing_amount', strip_tags($_REQUEST['trial_billing_amount']));
238
+ add_post_meta($button_id, 'trial_billing_cycle', strip_tags($_REQUEST['trial_billing_cycle']));
239
+ add_post_meta($button_id, 'trial_billing_cycle_term', strip_tags($_REQUEST['trial_billing_cycle_term']));
240
+
241
+ //Redirect to the edit interface of this button with $button_id
242
+ $url = admin_url() . 'admin.php?page=simple_wp_membership_payments&tab=edit_button&button_id=' . $button_id . '&button_type=' . $button_type;
243
+ SwpmMiscUtils::redirect_to_url($url);
244
  }
245
  }
246
 
247
  /* * **********************************************************************
248
  * End of new PayPal subscription payment button stuff
249
+ * ********************************************************************** */
250
+
251
+
252
+ /* * ***************************************************************
253
+ * Render edit PayPal Subscription payment button interface
254
+ * ************************************************************** */
255
+ add_action('swpm_edit_payment_button_for_pp_subscription', 'swpm_edit_pp_subscription_button');
256
+
257
+ function swpm_edit_pp_subscription_button() {
258
+ //Retrieve the payment button data and present it for editing.
259
+
260
+ $button_id = strip_tags($_REQUEST['button_id']);
261
+ $button_type = strip_tags($_REQUEST['button_type']);
262
+
263
+ $button = get_post($button_id); //Retrieve the CPT for this button
264
+
265
+ $membership_level_id = get_post_meta($button_id, 'membership_level_id', true);
266
+ //$payment_amount = get_post_meta($button_id, 'payment_amount', true);
267
+ $payment_currency = get_post_meta($button_id, 'payment_currency', true);
268
+ $return_url = get_post_meta($button_id, 'return_url', true);
269
+ $paypal_email = get_post_meta($button_id, 'paypal_email', true);
270
+ $button_image_url = get_post_meta($button_id, 'button_image_url', true);
271
+
272
+ //Subscription billing details
273
+ $billing_amount = get_post_meta($button_id, 'billing_amount', true);
274
+ $billing_cycle = get_post_meta($button_id, 'billing_cycle', true);
275
+ $billing_cycle_term = get_post_meta($button_id, 'billing_cycle_term', true);
276
+ $billing_cycle_count = get_post_meta($button_id, 'billing_cycle_count', true);
277
+ $billing_reattempt = get_post_meta($button_id, 'billing_reattempt', true);
278
+
279
+ //Trial billing details
280
+ $trial_billing_amount = get_post_meta($button_id, 'trial_billing_amount', true);
281
+ $trial_billing_cycle = get_post_meta($button_id, 'trial_billing_cycle', true);
282
+ $trial_billing_cycle_term = get_post_meta($button_id, 'trial_billing_cycle_term', true);
283
+
284
+ ?>
285
+ <form id="pp_button_config_form" method="post">
286
+
287
+ <div class="postbox">
288
+ <h3><label for="title"><?php echo SwpmUtils::_('PayPal Subscription Button Configuration'); ?></label></h3>
289
+ <div class="inside">
290
+
291
+ <table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6">
292
+
293
+ <tr valign="top">
294
+ <th scope="row"><?php echo SwpmUtils::_('Button ID'); ?></th>
295
+ <td>
296
+ <input type="text" size="10" name="button_id" value="<?php echo $button_id; ?>" readonly required />
297
+ <p class="description">This is the ID of this payment button. It is automatically generated for you and it cannot be changed.</p>
298
+ </td>
299
+ </tr>
300
+
301
+ <tr valign="top">
302
+ <th scope="row"><?php echo SwpmUtils::_('Button Title'); ?></th>
303
+ <td>
304
+ <input type="text" size="50" name="button_name" value="<?php echo $button->post_title; ?>" required />
305
+ <p class="description">Give this membership payment button a name. Example: Gold membership payment</p>
306
+ </td>
307
+ </tr>
308
+
309
+ <tr valign="top">
310
+ <th scope="row"><?php echo SwpmUtils::_('Membership Level'); ?></th>
311
+ <td>
312
+ <select id="membership_level_id" name="membership_level_id">
313
+ <?php echo SwpmUtils::membership_level_dropdown($membership_level_id); ?>
314
+ </select>
315
+ <p class="description">Select the membership level this payment button is for.</p>
316
+ </td>
317
+ </tr>
318
+
319
+ <tr valign="top">
320
+ <th scope="row"><?php echo SwpmUtils::_('Payment Currency'); ?></th>
321
+ <td>
322
+ <select id="payment_currency" name="payment_currency">
323
+ <option value="USD" <?php echo ($payment_currency == 'USD') ? 'selected="selected"' : ''; ?>>US Dollars ($)</option>
324
+ <option value="EUR" <?php echo ($payment_currency == 'EUR') ? 'selected="selected"' : ''; ?>>Euros (€)</option>
325
+ <option value="GBP" <?php echo ($payment_currency == 'GBP') ? 'selected="selected"' : ''; ?>>Pounds Sterling (£)</option>
326
+ <option value="AUD" <?php echo ($payment_currency == 'AUD') ? 'selected="selected"' : ''; ?>>Australian Dollars ($)</option>
327
+ <option value="BRL" <?php echo ($payment_currency == 'BRL') ? 'selected="selected"' : ''; ?>>Brazilian Real (R$)</option>
328
+ <option value="CAD" <?php echo ($payment_currency == 'CAD') ? 'selected="selected"' : ''; ?>>Canadian Dollars ($)</option>
329
+ <option value="CNY" <?php echo ($payment_currency == 'CNY') ? 'selected="selected"' : ''; ?>>Chinese Yuan</option>
330
+ <option value="CZK" <?php echo ($payment_currency == 'CZK') ? 'selected="selected"' : ''; ?>>Czech Koruna</option>
331
+ <option value="DKK" <?php echo ($payment_currency == 'DKK') ? 'selected="selected"' : ''; ?>>Danish Krone</option>
332
+ <option value="HKD" <?php echo ($payment_currency == 'HKD') ? 'selected="selected"' : ''; ?>>Hong Kong Dollar ($)</option>
333
+ <option value="HUF" <?php echo ($payment_currency == 'HUF') ? 'selected="selected"' : ''; ?>>Hungarian Forint</option>
334
+ <option value="INR" <?php echo ($payment_currency == 'INR') ? 'selected="selected"' : ''; ?>>Indian Rupee</option>
335
+ <option value="IDR" <?php echo ($payment_currency == 'IDR') ? 'selected="selected"' : ''; ?>>Indonesia Rupiah</option>
336
+ <option value="ILS" <?php echo ($payment_currency == 'ILS') ? 'selected="selected"' : ''; ?>>Israeli Shekel</option>
337
+ <option value="JPY" <?php echo ($payment_currency == 'JPY') ? 'selected="selected"' : ''; ?>>Japanese Yen (¥)</option>
338
+ <option value="MYR" <?php echo ($payment_currency == 'MYR') ? 'selected="selected"' : ''; ?>>Malaysian Ringgits</option>
339
+ <option value="MXN" <?php echo ($payment_currency == 'MXN') ? 'selected="selected"' : ''; ?>>Mexican Peso ($)</option>
340
+ <option value="NZD" <?php echo ($payment_currency == 'NZD') ? 'selected="selected"' : ''; ?>>New Zealand Dollar ($)</option>
341
+ <option value="NOK" <?php echo ($payment_currency == 'NOK') ? 'selected="selected"' : ''; ?>>Norwegian Krone</option>
342
+ <option value="PHP" <?php echo ($payment_currency == 'PHP') ? 'selected="selected"' : ''; ?>>Philippine Pesos</option>
343
+ <option value="PLN" <?php echo ($payment_currency == 'PLN') ? 'selected="selected"' : ''; ?>>Polish Zloty</option>
344
+ <option value="SGD" <?php echo ($payment_currency == 'SGD') ? 'selected="selected"' : ''; ?>>Singapore Dollar ($)</option>
345
+ <option value="ZAR" <?php echo ($payment_currency == 'ZAR') ? 'selected="selected"' : ''; ?>>South African Rand (R)</option>
346
+ <option value="KRW" <?php echo ($payment_currency == 'KRW') ? 'selected="selected"' : ''; ?>>South Korean Won</option>
347
+ <option value="SEK" <?php echo ($payment_currency == 'SEK') ? 'selected="selected"' : ''; ?>>Swedish Krona</option>
348
+ <option value="CHF" <?php echo ($payment_currency == 'CHF') ? 'selected="selected"' : ''; ?>>Swiss Franc</option>
349
+ <option value="TWD" <?php echo ($payment_currency == 'TWD') ? 'selected="selected"' : ''; ?>>Taiwan New Dollars</option>
350
+ <option value="THB" <?php echo ($payment_currency == 'THB') ? 'selected="selected"' : ''; ?>>Thai Baht</option>
351
+ <option value="TRY" <?php echo ($payment_currency == 'TRY') ? 'selected="selected"' : ''; ?>>Turkish Lira</option>
352
+ <option value="VND" <?php echo ($payment_currency == 'VND') ? 'selected="selected"' : ''; ?>>Vietnamese Dong</option>
353
+ </select>
354
+ <p class="description">Select the currency for this payment button.</p>
355
+ </td>
356
+ </tr>
357
+
358
+ <tr valign="top">
359
+ <th scope="row"><?php echo SwpmUtils::_('PayPal Email'); ?></th>
360
+ <td>
361
+ <input type="text" size="50" name="paypal_email" value="<?php echo $paypal_email; ?>" required />
362
+ <p class="description">Enter your PayPal email address. The payment will go to this PayPal account.</p>
363
+ </td>
364
+ </tr>
365
+
366
+ <tr valign="top">
367
+ <th scope="row"><?php echo SwpmUtils::_('Billing Amount Each Cycle'); ?></th>
368
+ <td>
369
+ <input type="text" size="6" name="billing_amount" value="<?php echo $billing_amount; ?>" required />
370
+ <p class="description">Amount to be charged on every billing cycle. If used with a trial period then this amount will be charged after the trial period is over. Example values: 10.00 or 19.50 or 299.95 etc (do not put currency symbol).</p>
371
+ </td>
372
+ </tr>
373
+
374
+ <tr valign="top">
375
+ <th scope="row"><?php echo SwpmUtils::_('Billing Cycle'); ?></th>
376
+ <td>
377
+ <input type="text" size="4" name="billing_cycle" value="<?php echo $billing_cycle; ?>" required />
378
+ <select id="billing_cycle_term" name="billing_cycle_term">
379
+ <option value="D" <?php echo ($billing_cycle_term == 'D') ? 'selected="selected"' : ''; ?>>Day(s)</option>
380
+ <option value="M" <?php echo ($billing_cycle_term == 'M') ? 'selected="selected"' : ''; ?>>Month(s)</option>
381
+ <option value="Y" <?php echo ($billing_cycle_term == 'Y') ? 'selected="selected"' : ''; ?>>Year(s)</option>
382
+ </select>
383
+ <p class="description">Set the interval of the recurring payment. Example value: 1 Month (if you want to charge every month)</p>
384
+ </td>
385
+ </tr>
386
+
387
+ <tr valign="top">
388
+ <th scope="row"><?php echo SwpmUtils::_('Billing Cycle Count'); ?></th>
389
+ <td>
390
+ <input type="text" size="6" name="billing_cycle_count" value="<?php echo $billing_cycle_count; ?>" />
391
+ <p class="description">After how many cycles should billing stop. Leave this field empty (or enter 0) if you want the payment to continue until the subscription is canceled.</p>
392
+ </td>
393
+ </tr>
394
+
395
+ <tr valign="top">
396
+ <th scope="row"><?php echo SwpmUtils::_('Re-attempt on Failure'); ?></th>
397
+ <td>
398
+ <input type="checkbox" name="billing_reattempt" value="1" <?php if($billing_reattempt != ''){echo ' checked="checked"';} ?> />
399
+ <p class="description">When checked, the payment will be re-attempted two more times if the payment fails. After the third failure, the subscription will be canceled..</p>
400
+ </td>
401
+ </tr>
402
+
403
+ </table>
404
+
405
+ </div>
406
+ </div><!-- end of main button configuration box -->
407
+
408
+ <div class="postbox">
409
+ <h3><label for="title"><?php echo SwpmUtils::_('Trial Billing Details (Leave empty if you are not offering a trial period)'); ?></label></h3>
410
+ <div class="inside">
411
+
412
+ <table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6">
413
+
414
+ <tr valign="top">
415
+ <th scope="row"><?php echo SwpmUtils::_('Trial Billing Amount'); ?></th>
416
+ <td>
417
+ <input type="text" size="6" name="trial_billing_amount" value="<?php echo $trial_billing_amount; ?>" />
418
+ <p class="description">Amount to be charged for the trial period. Enter 0 if you want to offer a free trial period.</p>
419
+ </td>
420
+ </tr>
421
+
422
+ <tr valign="top">
423
+ <th scope="row"><?php echo SwpmUtils::_('Trial Billing Period'); ?></th>
424
+ <td>
425
+ <input type="text" size="4" name="trial_billing_cycle" value="<?php echo $trial_billing_cycle; ?>" />
426
+ <select id="billing_cycle_term" name="trial_billing_cycle_term">
427
+ <option value="D" <?php echo ($trial_billing_cycle_term == 'D') ? 'selected="selected"' : ''; ?>>Day(s)</option>
428
+ <option value="M" <?php echo ($trial_billing_cycle_term == 'M') ? 'selected="selected"' : ''; ?>>Month(s)</option>
429
+ <option value="Y" <?php echo ($trial_billing_cycle_term == 'Y') ? 'selected="selected"' : ''; ?>>Year(s)</option>
430
+ </select>
431
+ <p class="description">Length of the trial period</p>
432
+ </td>
433
+ </tr>
434
+
435
+ </table>
436
+ </div>
437
+ </div><!-- end of trial billing details box -->
438
+
439
+ <div class="postbox">
440
+ <h3><label for="title"><?php echo SwpmUtils::_('Optional Details'); ?></label></h3>
441
+ <div class="inside">
442
+
443
+ <table class="form-table" width="100%" border="0" cellspacing="0" cellpadding="6">
444
+
445
+ <tr valign="top">
446
+ <th scope="row"><?php echo SwpmUtils::_('Return URL'); ?></th>
447
+ <td>
448
+ <input type="text" size="100" name="return_url" value="<?php echo $return_url; ?>" />
449
+ <p class="description">This is the URL the user will be redirected to after a successful payment. Enter the URL of your Thank You page here.</p>
450
+ </td>
451
+ </tr>
452
+
453
+ <tr valign="top">
454
+ <th scope="row"><?php echo SwpmUtils::_('Button Image URL'); ?></th>
455
+ <td>
456
+ <input type="text" size="100" name="button_image_url" value="<?php echo $button_image_url; ?>" />
457
+ <p class="description">If you want to customize the look of the button using an image then enter the URL of the image.</p>
458
+ </td>
459
+ </tr>
460
+
461
+ </table>
462
+ </div>
463
+ </div><!-- end of optional details box -->
464
+
465
+ <p class="submit">
466
+ <input type="submit" name="swpm_pp_subscription_save_submit" class="button-primary" value="<?php echo SwpmUtils::_('Save Payment Data'); ?>" >
467
+ </p>
468
+
469
+ </form>
470
+
471
+ <?php
472
+ }
473
+
474
+ /*
475
+ * Process submission and save the edited PayPal Subscription payment button data
476
+ */
477
+ add_action('swpm_edit_payment_button_process_submission', 'swpm_edit_pp_subscription_button_data');
478
+
479
+ function swpm_edit_pp_subscription_button_data() {
480
+ if (isset($_REQUEST['swpm_pp_subscription_save_submit'])) {
481
+ //This is a PayPal subscription button edit event. Process the submission.
482
+ //TODO - Do some basic validation check?
483
+
484
+ //Update and Save the edited payment button data
485
+ $button_id = strip_tags($_REQUEST['button_id']);
486
+ $button_type = strip_tags($_REQUEST['button_type']);
487
+ $button_name = strip_tags($_REQUEST['button_name']);
488
+
489
+ $button_post = array(
490
+ 'ID' => $button_id,
491
+ 'post_title' => $button_name,
492
+ 'post_type' => 'swpm_payment_button',
493
+ );
494
+ wp_update_post($button_post);
495
+
496
+ update_post_meta($button_id, 'button_type', $button_type);
497
+ update_post_meta($button_id, 'membership_level_id', strip_tags($_REQUEST['membership_level_id']));
498
+ //update_post_meta($button_id, 'payment_amount', trim(strip_tags($_REQUEST['payment_amount'])));
499
+ update_post_meta($button_id, 'payment_currency', strip_tags($_REQUEST['payment_currency']));
500
+ update_post_meta($button_id, 'return_url', trim(strip_tags($_REQUEST['return_url'])));
501
+ update_post_meta($button_id, 'paypal_email', trim(strip_tags($_REQUEST['paypal_email'])));
502
+ update_post_meta($button_id, 'button_image_url', trim(strip_tags($_REQUEST['button_image_url'])));
503
+
504
+ //Subscription billing details
505
+ update_post_meta($button_id, 'billing_amount', strip_tags($_REQUEST['billing_amount']));
506
+ update_post_meta($button_id, 'billing_cycle', strip_tags($_REQUEST['billing_cycle']));
507
+ update_post_meta($button_id, 'billing_cycle_term', strip_tags($_REQUEST['billing_cycle_term']));
508
+ update_post_meta($button_id, 'billing_cycle_count', strip_tags($_REQUEST['billing_cycle_count']));
509
+ update_post_meta($button_id, 'billing_reattempt', isset($_REQUEST['billing_reattempt']) ? '1' : '');
510
+
511
+ //Trial billing details
512
+ update_post_meta($button_id, 'trial_billing_amount', strip_tags($_REQUEST['trial_billing_amount']));
513
+ update_post_meta($button_id, 'trial_billing_cycle', strip_tags($_REQUEST['trial_billing_cycle']));
514
+ update_post_meta($button_id, 'trial_billing_cycle_term', strip_tags($_REQUEST['trial_billing_cycle_term']));
515
+
516
+ echo '<div id="message" class="updated fade"><p>Payment button data successfully updated!</p></div>';
517
+ }
518
+ }
519
+
520
+ /************************************************************************
521
+ * End of edit PayPal Subscription payment button stuff
522
+ ************************************************************************/
views/payments/payment-gateway/paypal_button_shortcode_view.php CHANGED
@@ -1,5 +1,8 @@
1
  <?php
2
 
 
 
 
3
  add_filter('swpm_payment_button_shortcode_for_pp_buy_now', 'swpm_render_pp_buy_now_button_sc_output', 10, 2);
4
 
5
  function swpm_render_pp_buy_now_button_sc_output($button_code, $args) {
@@ -9,31 +12,34 @@ function swpm_render_pp_buy_now_button_sc_output($button_code, $args) {
9
  return '<p style="color: red;">Error! swpm_render_pp_buy_now_button_sc_output() function requires the button ID value to be passed to it.</p>';
10
  }
11
 
 
 
 
12
  $settings = SwpmSettings::get_instance();
13
  $button_cpt = get_post($button_id); //Retrieve the CPT for this button
14
 
15
  $membership_level_id = get_post_meta($button_id, 'membership_level_id', true);
16
  $paypal_email = get_post_meta($button_id, 'paypal_email', true);
17
  $payment_amount = get_post_meta($button_id, 'payment_amount', true);
18
- if(!is_numeric($payment_amount)){
19
  return '<p style="color: red;">Error! The payment amount value of the button must be a numeric number. Example: 49.50 </p>';
20
  }
21
- $payment_amount = round($payment_amount, 2);//round the amount to 2 decimal place.
22
  $payment_currency = get_post_meta($button_id, 'payment_currency', true);
23
-
24
  $sandbox_enabled = $settings->get_value('enable-sandbox-testing');
25
  $notify_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL . '/?swpm_process_ipn=1';
26
  $return_url = get_post_meta($button_id, 'return_url', true);
27
- if(empty($return_url)){
28
  $return_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL;
29
  }
30
  $cancel_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL;
31
-
32
  $custom_field_value = 'subsc_ref=' . $membership_level_id;
33
  $user_ip = $_SERVER['REMOTE_ADDR'];
34
- $custom_field_value .= '&user_ip='.$user_ip;
35
- if(SwpmMemberUtils::is_member_logged_in()){
36
- $custom_field_value .= '&swpm_id='.SwpmMemberUtils::get_logged_in_members_id();
37
  }
38
  $custom_field_value = apply_filters('swpm_custom_field_value_filter', $custom_field_value);
39
 
@@ -41,37 +47,155 @@ function swpm_render_pp_buy_now_button_sc_output($button_code, $args) {
41
  $output = '';
42
  $output .= '<div class="swpm-button-wrapper swpm-pp-buy-now-wrapper">';
43
  if ($sandbox_enabled) {
44
- $output .= '<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">';
45
  } else {
46
- $output .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">';
47
  }
48
 
49
  $output .= '<input type="hidden" name="cmd" value="_xclick" />';
50
  $output .= '<input type="hidden" name="charset" value="utf-8" />';
51
- $output .= '<input type="hidden" name="bn" value="TipsandTricks_SP" />';
52
  $output .= '<input type="hidden" name="business" value="' . $paypal_email . '" />';
53
- $output .= '<input type="hidden" name="amount" value="'.$payment_amount.'" />';
54
- $output .= '<input type="hidden" name="currency_code" value="'.$payment_currency.'" />';
55
- $output .= '<input type="hidden" name="item_number" value="'.$button_id.'" />';
56
  $output .= '<input type="hidden" name="item_name" value="' . htmlspecialchars($button_cpt->post_title) . '" />';
57
-
58
- $output .= '<input type="hidden" name="no_shipping" value="1" />';//Do not prompt for an address
59
-
60
  $output .= '<input type="hidden" name="notify_url" value="' . $notify_url . '" />';
61
  $output .= '<input type="hidden" name="return" value="' . $return_url . '" />';
62
  $output .= '<input type="hidden" name="cancel_return" value="' . $cancel_url . '" />';
63
 
64
  $output .= '<input type="hidden" name="custom" value="' . $custom_field_value . '" />';
65
-
66
  $button_image_url = get_post_meta($button_id, 'button_image_url', true);
67
  if (!empty($button_image_url)) {
68
  $output .= '<input type="image" src="' . $button_image_url . '" class="swpm-buy-now-button-submit" alt="' . SwpmUtils::_('Buy Now') . '"/>';
69
- } else {
70
- $button_text = (isset($args['button_text']))? $args['button_text'] : SwpmUtils::_('Buy Now');
71
  $output .= '<input type="submit" class="swpm-buy-now-button-submit" value="' . $button_text . '" />';
72
  }
73
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  $output .= '</div>'; //End .swpm_button_wrapper
75
 
76
  return $output;
77
- }
1
  <?php
2
 
3
+ /* * ************************************************
4
+ * PayPal Buy Now button shortcode handler
5
+ * *********************************************** */
6
  add_filter('swpm_payment_button_shortcode_for_pp_buy_now', 'swpm_render_pp_buy_now_button_sc_output', 10, 2);
7
 
8
  function swpm_render_pp_buy_now_button_sc_output($button_code, $args) {
12
  return '<p style="color: red;">Error! swpm_render_pp_buy_now_button_sc_output() function requires the button ID value to be passed to it.</p>';
13
  }
14
 
15
+ //Check new_window parameter
16
+ $window_target = isset($args['new_window']) ? 'target="_blank"' : '';
17
+
18
  $settings = SwpmSettings::get_instance();
19
  $button_cpt = get_post($button_id); //Retrieve the CPT for this button
20
 
21
  $membership_level_id = get_post_meta($button_id, 'membership_level_id', true);
22
  $paypal_email = get_post_meta($button_id, 'paypal_email', true);
23
  $payment_amount = get_post_meta($button_id, 'payment_amount', true);
24
+ if (!is_numeric($payment_amount)) {
25
  return '<p style="color: red;">Error! The payment amount value of the button must be a numeric number. Example: 49.50 </p>';
26
  }
27
+ $payment_amount = round($payment_amount, 2); //round the amount to 2 decimal place.
28
  $payment_currency = get_post_meta($button_id, 'payment_currency', true);
29
+
30
  $sandbox_enabled = $settings->get_value('enable-sandbox-testing');
31
  $notify_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL . '/?swpm_process_ipn=1';
32
  $return_url = get_post_meta($button_id, 'return_url', true);
33
+ if (empty($return_url)) {
34
  $return_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL;
35
  }
36
  $cancel_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL;
37
+
38
  $custom_field_value = 'subsc_ref=' . $membership_level_id;
39
  $user_ip = $_SERVER['REMOTE_ADDR'];
40
+ $custom_field_value .= '&user_ip=' . $user_ip;
41
+ if (SwpmMemberUtils::is_member_logged_in()) {
42
+ $custom_field_value .= '&swpm_id=' . SwpmMemberUtils::get_logged_in_members_id();
43
  }
44
  $custom_field_value = apply_filters('swpm_custom_field_value_filter', $custom_field_value);
45
 
47
  $output = '';
48
  $output .= '<div class="swpm-button-wrapper swpm-pp-buy-now-wrapper">';
49
  if ($sandbox_enabled) {
50
+ $output .= '<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" ' . $window_target . '>';
51
  } else {
52
+ $output .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" ' . $window_target . '>';
53
  }
54
 
55
  $output .= '<input type="hidden" name="cmd" value="_xclick" />';
56
  $output .= '<input type="hidden" name="charset" value="utf-8" />';
57
+ $output .= '<input type="hidden" name="bn" value="TipsandTricks_SP" />';
58
  $output .= '<input type="hidden" name="business" value="' . $paypal_email . '" />';
59
+ $output .= '<input type="hidden" name="amount" value="' . $payment_amount . '" />';
60
+ $output .= '<input type="hidden" name="currency_code" value="' . $payment_currency . '" />';
61
+ $output .= '<input type="hidden" name="item_number" value="' . $button_id . '" />';
62
  $output .= '<input type="hidden" name="item_name" value="' . htmlspecialchars($button_cpt->post_title) . '" />';
63
+
64
+ $output .= '<input type="hidden" name="no_shipping" value="1" />'; //Do not prompt for an address
65
+
66
  $output .= '<input type="hidden" name="notify_url" value="' . $notify_url . '" />';
67
  $output .= '<input type="hidden" name="return" value="' . $return_url . '" />';
68
  $output .= '<input type="hidden" name="cancel_return" value="' . $cancel_url . '" />';
69
 
70
  $output .= '<input type="hidden" name="custom" value="' . $custom_field_value . '" />';
71
+
72
  $button_image_url = get_post_meta($button_id, 'button_image_url', true);
73
  if (!empty($button_image_url)) {
74
  $output .= '<input type="image" src="' . $button_image_url . '" class="swpm-buy-now-button-submit" alt="' . SwpmUtils::_('Buy Now') . '"/>';
75
+ } else {
76
+ $button_text = (isset($args['button_text'])) ? $args['button_text'] : SwpmUtils::_('Buy Now');
77
  $output .= '<input type="submit" class="swpm-buy-now-button-submit" value="' . $button_text . '" />';
78
  }
79
+
80
+ $output .= '</form>'; //End .form
81
+ $output .= '</div>'; //End .swpm_button_wrapper
82
+
83
+ return $output;
84
+ }
85
+
86
+ /* * ************************************************
87
+ * PayPal subscription button shortcode handler
88
+ * *********************************************** */
89
+ add_filter('swpm_payment_button_shortcode_for_pp_subscription', 'swpm_render_pp_subscription_button_sc_output', 10, 2);
90
+
91
+ function swpm_render_pp_subscription_button_sc_output($button_code, $args) {
92
+
93
+ $button_id = isset($args['id']) ? $args['id'] : '';
94
+ if (empty($button_id)) {
95
+ return '<p style="color: red;">Error! swpm_render_pp_subscription_button_sc_output() function requires the button ID value to be passed to it.</p>';
96
+ }
97
+
98
+ //Check new_window parameter
99
+ $window_target = isset($args['new_window']) ? 'target="_blank"' : '';
100
+
101
+ $settings = SwpmSettings::get_instance();
102
+ $button_cpt = get_post($button_id); //Retrieve the CPT for this button
103
+
104
+ $membership_level_id = get_post_meta($button_id, 'membership_level_id', true);
105
+ $paypal_email = get_post_meta($button_id, 'paypal_email', true);
106
+ $payment_currency = get_post_meta($button_id, 'payment_currency', true);
107
+
108
+ //Subscription payment details
109
+ $billing_amount = get_post_meta($button_id, 'billing_amount', true);
110
+ if (!is_numeric($billing_amount)) {
111
+ return '<p style="color: red;">Error! The billing amount value of the button must be a numeric number. Example: 49.50 </p>';
112
+ }
113
+ $billing_amount = round($billing_amount, 2); //round the amount to 2 decimal place.
114
+ $billing_cycle = get_post_meta($button_id, 'billing_cycle', true);
115
+ $billing_cycle_term = get_post_meta($button_id, 'billing_cycle_term', true);
116
+ $billing_cycle_count = get_post_meta($button_id, 'billing_cycle_count', true);
117
+ $billing_reattempt = get_post_meta($button_id, 'billing_reattempt', true);
118
+
119
+ //Trial billing details
120
+ $trial_billing_amount = get_post_meta($button_id, 'trial_billing_amount', true);
121
+ if (!empty($trial_billing_amount)) {
122
+ if(!is_numeric($trial_billing_amount)){
123
+ return '<p style="color: red;">Error! The trial billing amount value of the button must be a numeric number. Example: 19.50 </p>';
124
+ }
125
+ }
126
+ $trial_billing_cycle = get_post_meta($button_id, 'trial_billing_cycle', true);
127
+ $trial_billing_cycle_term = get_post_meta($button_id, 'trial_billing_cycle_term', true);
128
+
129
+ $sandbox_enabled = $settings->get_value('enable-sandbox-testing');
130
+ $notify_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL . '/?swpm_process_ipn=1';
131
+ $return_url = get_post_meta($button_id, 'return_url', true);
132
+ if (empty($return_url)) {
133
+ $return_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL;
134
+ }
135
+ $cancel_url = SIMPLE_WP_MEMBERSHIP_SITE_HOME_URL;
136
+
137
+ $custom_field_value = 'subsc_ref=' . $membership_level_id;
138
+ $user_ip = $_SERVER['REMOTE_ADDR'];
139
+ $custom_field_value .= '&user_ip=' . $user_ip;
140
+ if (SwpmMemberUtils::is_member_logged_in()) {
141
+ $custom_field_value .= '&swpm_id=' . SwpmMemberUtils::get_logged_in_members_id();
142
+ }
143
+ $custom_field_value = apply_filters('swpm_custom_field_value_filter', $custom_field_value);
144
+
145
+ /* === PayPal Subscription Button Form === */
146
+ $output = '';
147
+ $output .= '<div class="swpm-button-wrapper swpm-pp-subscription-wrapper">';
148
+ if ($sandbox_enabled) {
149
+ $output .= '<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" ' . $window_target . '>';
150
+ } else {
151
+ $output .= '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" ' . $window_target . '>';
152
+ }
153
+
154
+ $output .= '<input type="hidden" name="cmd" value="_xclick-subscriptions" />';
155
+ $output .= '<input type="hidden" name="charset" value="utf-8" />';
156
+ $output .= '<input type="hidden" name="bn" value="TipsandTricks_SP" />';
157
+ $output .= '<input type="hidden" name="business" value="' . $paypal_email . '" />';
158
+ $output .= '<input type="hidden" name="currency_code" value="' . $payment_currency . '" />';
159
+ $output .= '<input type="hidden" name="item_number" value="' . $button_id . '" />';
160
+ $output .= '<input type="hidden" name="item_name" value="' . htmlspecialchars($button_cpt->post_title) . '" />';
161
+
162
+ //Check trial billing
163
+ if (!empty($trial_billing_cycle)) {
164
+ $output .= '<input type="hidden" name="a1" value="' . $trial_billing_amount . '" /><input type="hidden" name="p1" value="' . $trial_billing_cycle . '" /><input type="hidden" name="t1" value="' . $trial_billing_cycle_term . '" />';
165
+ }
166
+ //Main subscription billing
167
+ if (!empty($billing_cycle)) {
168
+ $output .= '<input type="hidden" name="a3" value="' . $billing_amount . '" /><input type="hidden" name="p3" value="' . $billing_cycle . '" /><input type="hidden" name="t3" value="' . $billing_cycle_term . '" />';
169
+ }
170
+ //Re-attempt on failure
171
+ if ($billing_reattempt != '') {
172
+ $output .= '<input type="hidden" name="sra" value="1" />';
173
+ }
174
+ //Reccurring times
175
+ if ($billing_cycle_count > 1) { //do not include srt value if billing cycle count set to 1 or a negetive number.
176
+ $output .= '<input type="hidden" name="src" value="1" /><input type="hidden" name="srt" value="' . $billing_cycle_count . '" />';
177
+ } else if (empty($billing_cycle_count)) {
178
+ $output .= '<input type="hidden" name="src" value="1" />';
179
+ }
180
+
181
+ //Other required data
182
+ $output .= '<input type="hidden" name="no_shipping" value="1" />'; //Do not prompt for an address
183
+ $output .= '<input type="hidden" name="notify_url" value="' . $notify_url . '" />';
184
+ $output .= '<input type="hidden" name="return" value="' . $return_url . '" />';
185
+ $output .= '<input type="hidden" name="cancel_return" value="' . $cancel_url . '" />';
186
+ $output .= '<input type="hidden" name="custom" value="' . $custom_field_value . '" />';
187
+
188
+ //Submit button
189
+ $button_image_url = get_post_meta($button_id, 'button_image_url', true);
190
+ if (!empty($button_image_url)) {
191
+ $output .= '<input type="image" src="' . $button_image_url . '" class="swpm-subscription-button-submit" alt="' . SwpmUtils::_('Subscribe Now') . '"/>';
192
+ } else {
193
+ $button_text = (isset($args['button_text'])) ? $args['button_text'] : SwpmUtils::_('Subscribe Now');
194
+ $output .= '<input type="submit" class="swpm-subscription-button-submit" value="' . $button_text . '" />';
195
+ }
196
+
197
+ $output .= '</form>'; //End .form
198
  $output .= '</div>'; //End .swpm_button_wrapper
199
 
200
  return $output;
201
+ }