Paid Memberships Pro - Version 1.8.6.7

Version Description

  • BUG: Fixed issue with prices over $1000 when using TwoCheckout. (Thanks, BigBradBrown and others.)
  • ENHANCEMENT: Removed the API Private Key option from 2Checkout setup since we don't actually use that in the API.
  • ENHANCEMENT: Using the pmpro_check_status_after_checkout filter to set the status of orders for recurring check payments in addition to one time payments. This update supports the update Pay by Check Add On v.5.
  • ENHANCEMENT: Added +1 to timestamp when the pmpro_cron_expiration_warnings cron is scheduled to make sure it runs after the pmpro_cron_expire_memberships cron.
  • ENHANCEMENT: Added email templates for Greek translation. (Thanks, Dimitris Kalliris)
Download this release

Release Info

Developer strangerstudios
Plugin Icon 128x128 Paid Memberships Pro
Version 1.8.6.7
Comparing to
See all releases

Code changes from version 1.8.6.4 to 1.8.6.7

Files changed (44) hide show
  1. adminpages/orders.php +5 -5
  2. classes/gateways/class.pmprogateway_check.php +1 -0
  3. classes/gateways/class.pmprogateway_stripe.php +2 -2
  4. classes/gateways/class.pmprogateway_twocheckout.php +10 -21
  5. includes/content.php +1 -1
  6. includes/functions.php +126 -104
  7. includes/setup.sql +16 -0
  8. includes/upgradecheck.php +135 -100
  9. languages/email/el/admin_change.html +7 -0
  10. languages/email/el/admin_change_admin.html +5 -0
  11. languages/email/el/billable_invoice.html +6 -0
  12. languages/email/el/billing.html +16 -0
  13. languages/email/el/billing_admin.html +17 -0
  14. languages/email/el/billing_failure.html +11 -0
  15. languages/email/el/billing_failure_admin.html +11 -0
  16. languages/email/el/cancel.html +3 -0
  17. languages/email/el/cancel_admin.html +8 -0
  18. languages/email/el/checkout_check.html +17 -0
  19. languages/email/el/checkout_check_admin.html +17 -0
  20. languages/email/el/checkout_express.html +15 -0
  21. languages/email/el/checkout_express_admin.html +15 -0
  22. languages/email/el/checkout_free.html +9 -0
  23. languages/email/el/checkout_free_admin.html +9 -0
  24. languages/email/el/checkout_freetrial.html +20 -0
  25. languages/email/el/checkout_freetrial_admin.html +20 -0
  26. languages/email/el/checkout_paid.html +25 -0
  27. languages/email/el/checkout_paid_admin.html +25 -0
  28. languages/email/el/checkout_trial.html +25 -0
  29. languages/email/el/checkout_trial_admin.html +25 -0
  30. languages/email/el/credit_card_expiring.html +13 -0
  31. languages/email/el/default.html +1 -0
  32. languages/email/el/footer.html +4 -0
  33. languages/email/el/header.html +1 -0
  34. languages/email/el/invoice.html +19 -0
  35. languages/email/el/membership_expired.html +7 -0
  36. languages/email/el/membership_expiring.html +6 -0
  37. languages/email/el/trial_ending.html +8 -0
  38. languages/pmpro.mo +0 -0
  39. languages/pmpro.po +739 -555
  40. languages/pmpro.pot +730 -549
  41. paid-memberships-pro.php +4 -4
  42. preheaders/levels.php +1 -1
  43. readme.txt +19 -1
  44. services/ipnhandler.php +0 -1
adminpages/orders.php CHANGED
@@ -57,6 +57,11 @@
57
else
58
$status = "";
59
60
//some vars for the search
61
if(isset($_REQUEST['pn']))
62
$pn = intval($_REQUEST['pn']);
@@ -177,11 +182,6 @@
177
}
178
}
179
180
- if(isset($_REQUEST['filter']))
181
- $filter = sanitize_text_field($_REQUEST['filter']);
182
- else
183
- $filter = "all";
184
-
185
$thisyear = date("Y");
186
187
//this array stores fields that should be read only
57
else
58
$status = "";
59
60
+ if(isset($_REQUEST['filter']))
61
+ $filter = sanitize_text_field($_REQUEST['filter']);
62
+ else
63
+ $filter = "all";
64
+
65
//some vars for the search
66
if(isset($_REQUEST['pn']))
67
$pn = intval($_REQUEST['pn']);
182
}
183
}
184
185
$thisyear = date("Y");
186
187
//this array stores fields that should be read only
classes/gateways/class.pmprogateway_check.php CHANGED
@@ -234,6 +234,7 @@
234
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
235
if($this->subscribe($order))
236
{
237
return true;
238
}
239
else
234
$order->ProfileStartDate = apply_filters("pmpro_profile_start_date", $order->ProfileStartDate, $order);
235
if($this->subscribe($order))
236
{
237
+ $order->status = apply_filters("pmpro_check_status_after_checkout", "success"); //saved on checkout page
238
return true;
239
}
240
else
classes/gateways/class.pmprogateway_stripe.php CHANGED
@@ -360,7 +360,7 @@
360
361
if($gateway == "stripe")
362
{
363
- if(!empty($morder) && !empty($morer->Gateway) && !empty($morder->Gateway->customer) && !empty($morder->Gateway->customer->id))
364
{
365
update_user_meta($user_id, "pmpro_stripe_customerid", $morder->Gateway->customer->id);
366
}
@@ -1659,4 +1659,4 @@
1659
1660
return $timestamp;
1661
}
1662
- }
360
361
if($gateway == "stripe")
362
{
363
+ if(!empty($morder) && !empty($morder->Gateway) && !empty($morder->Gateway->customer) && !empty($morder->Gateway->customer->id))
364
{
365
update_user_meta($user_id, "pmpro_stripe_customerid", $morder->Gateway->customer->id);
366
}
1659
1660
return $timestamp;
1661
}
1662
+ }
classes/gateways/class.pmprogateway_twocheckout.php CHANGED
@@ -13,8 +13,7 @@
13
require_once(dirname(__FILE__) . "/../../includes/lib/Twocheckout/Twocheckout.php");
14
15
//set API connection vars
16
- Twocheckout::sellerId(pmpro_getOption('twocheckout_accountnumber'));
17
- Twocheckout::privateKey(pmpro_getOption('twocheckout_privatekey'));
18
Twocheckout::username(pmpro_getOption('twocheckout_apiusername'));
19
Twocheckout::password(pmpro_getOption('twocheckout_apipassword'));
20
Twocheckout::$verifySSL = false;
@@ -74,8 +73,7 @@
74
'nuclear_HTTPS',
75
'gateway_environment',
76
'twocheckout_apiusername',
77
- 'twocheckout_apipassword',
78
- 'twocheckout_privatekey',
79
'twocheckout_accountnumber',
80
'twocheckout_secretword',
81
'currency',
@@ -133,16 +131,7 @@
133
<input type="text" id="twocheckout_apipassword" name="twocheckout_apipassword" size="60" value="<?php echo esc_attr($values['twocheckout_apipassword'])?>" />
134
<br /><small><?php _e('Password for the API user created.');?></small>
135
</td>
136
- </tr>
137
- <tr class="gateway gateway_twocheckout" <?php if($gateway != "twocheckout") { ?>style="display: none;"<?php } ?>>
138
- <th scope="row" valign="top">
139
- <label for="twocheckout_privatekey"><?php _e('API Private Key', 'pmpro');?>:</label>
140
- </th>
141
- <td>
142
- <input type="text" name="twocheckout_privatekey" size="60" value="<?php echo $values['twocheckout_privatekey']?>" />
143
- <br /><small><?php _e('Go to API in 2Checkout and generate a new key pair. Paste the Private Key here.');?></small>
144
- </td>
145
- </tr>
146
<tr class="gateway gateway_twocheckout" <?php if($gateway != "twocheckout") { ?>style="display: none;"<?php } ?>>
147
<th scope="row" valign="top">
148
<label for="twocheckout_accountnumber"><?php _e('Account Number', 'pmpro');?>:</label>
@@ -296,11 +285,11 @@
296
297
// Recurring membership
298
if( pmpro_isLevelRecurring( $order->membership_level ) ) {
299
- $tco_args['li_0_startup_fee'] = number_format($initial_payment - $amount, 2); //negative amount for lower initial payments
300
- $recurring_payment = $order->membership_level->billing_amount;
301
- $recurring_payment_tax = $order->getTaxForPrice($recurring_payment);
302
- $recurring_payment = round((float)$recurring_payment + (float)$recurring_payment_tax, 2);
303
- $tco_args['li_0_price'] = number_format($recurring_payment, 2);
304
305
$tco_args['li_0_recurrence'] = ( $order->BillingFrequency == 1 ) ? $order->BillingFrequency . ' ' . $order->BillingPeriod : $order->BillingFrequency . ' ' . $order->BillingPeriod . 's';
306
@@ -311,7 +300,7 @@
311
}
312
// Non-recurring membership
313
else {
314
- $tco_args['li_0_price'] = $initial_payment;
315
}
316
317
// Demo mode?
@@ -332,7 +321,7 @@
332
if(!empty($order->TrialBillingPeriod)) {
333
$trial_amount = $order->TrialAmount;
334
$trial_tax = $order->getTaxForPrice($trial_amount);
335
- $trial_amount = round((float)$trial_amount + (float)$trial_tax, 2);
336
$tco_args['li_0_startup_fee'] = $trial_amount; // Negative trial amount
337
}
338
13
require_once(dirname(__FILE__) . "/../../includes/lib/Twocheckout/Twocheckout.php");
14
15
//set API connection vars
16
+ Twocheckout::sellerId(pmpro_getOption('twocheckout_accountnumber'));
17
Twocheckout::username(pmpro_getOption('twocheckout_apiusername'));
18
Twocheckout::password(pmpro_getOption('twocheckout_apipassword'));
19
Twocheckout::$verifySSL = false;
73
'nuclear_HTTPS',
74
'gateway_environment',
75
'twocheckout_apiusername',
76
+ 'twocheckout_apipassword',
77
'twocheckout_accountnumber',
78
'twocheckout_secretword',
79
'currency',
131
<input type="text" id="twocheckout_apipassword" name="twocheckout_apipassword" size="60" value="<?php echo esc_attr($values['twocheckout_apipassword'])?>" />
132
<br /><small><?php _e('Password for the API user created.');?></small>
133
</td>
134
+ </tr>
135
<tr class="gateway gateway_twocheckout" <?php if($gateway != "twocheckout") { ?>style="display: none;"<?php } ?>>
136
<th scope="row" valign="top">
137
<label for="twocheckout_accountnumber"><?php _e('Account Number', 'pmpro');?>:</label>
285
286
// Recurring membership
287
if( pmpro_isLevelRecurring( $order->membership_level ) ) {
288
+ $tco_args['li_0_startup_fee'] = number_format($initial_payment - $amount, 2, ".", ""); //negative amount for lower initial payments
289
+ $recurring_payment = number_format($order->membership_level->billing_amount, 2, ".", "");
290
+ $recurring_payment_tax = number_format($order->getTaxForPrice($recurring_payment), 2, ".", "");
291
+ $recurring_payment = number_format(round((float)$recurring_payment + (float)$recurring_payment_tax, 2), 2, ".", "");
292
+ $tco_args['li_0_price'] = number_format($recurring_payment, 2, ".", "");
293
294
$tco_args['li_0_recurrence'] = ( $order->BillingFrequency == 1 ) ? $order->BillingFrequency . ' ' . $order->BillingPeriod : $order->BillingFrequency . ' ' . $order->BillingPeriod . 's';
295
300
}
301
// Non-recurring membership
302
else {
303
+ $tco_args['li_0_price'] = number_format($initial_payment, 2, ".", "");
304
}
305
306
// Demo mode?
321
if(!empty($order->TrialBillingPeriod)) {
322
$trial_amount = $order->TrialAmount;
323
$trial_tax = $order->getTaxForPrice($trial_amount);
324
+ $trial_amount = pmpro_formatPrice(round((float)$trial_amount + (float)$trial_tax, 2), false, false);
325
$tco_args['li_0_startup_fee'] = $trial_amount; // Negative trial amount
326
}
327
includes/content.php CHANGED
@@ -323,7 +323,7 @@ function pmpro_membership_content_filter($content, $skipcheck = false)
323
$pmpro_content_message_post = '</div>';
324
325
$sr_search = array("!!levels!!", "!!referrer!!");
326
- $sr_replace = array(pmpro_implodeToEnglish($post_membership_levels_names), site_url($_SERVER['REQUEST_URI']));
327
328
//get the correct message to show at the bottom
329
if(is_feed())
323
$pmpro_content_message_post = '</div>';
324
325
$sr_search = array("!!levels!!", "!!referrer!!");
326
+ $sr_replace = array(pmpro_implodeToEnglish($post_membership_levels_names), urlencode(site_url($_SERVER['REQUEST_URI'])));
327
328
//get the correct message to show at the bottom
329
if(is_feed())
includes/functions.php CHANGED
@@ -1,22 +1,22 @@
1
<?php
2
/****************************************************************
3
4
- IMPORTANT. PLEASE READ.
5
6
- DO NOT EDIT THIS FILE or any other file in the /wp-content/plugins/paid-memberships-pro/ directory.
7
- Doing so could break the PMPro plugin and/or keep you from upgrading this plugin in the future.
8
- We regularly release updates to the plugin, including important security fixes and new features.
9
- You want to be able to upgrade.
10
11
- If you were asked to insert code into "your functions.php file", it was meant that you edit the functions.php
12
- in the root folder of your active theme. e.g. /wp-content/themes/twentytwelve/functions.php
13
- You can also create a custom plugin to place customization code into. Instructions are here:
14
- http://www.paidmembershipspro.com/2012/08/create-a-plugin-for-pmpro-customizations/
15
16
- Further documentation for customizing Paid Memberships Pro can be found here:
17
- http://www.paidmembershipspro.com/documentation/
18
19
- ****************************************************************/
20
if(!function_exists("sornot"))
21
{
22
function sornot($t, $n)
@@ -41,6 +41,7 @@ function pmpro_setDBTables()
41
$wpdb->pmpro_discount_codes = $wpdb->prefix . 'pmpro_discount_codes';
42
$wpdb->pmpro_discount_codes_levels = $wpdb->prefix . 'pmpro_discount_codes_levels';
43
$wpdb->pmpro_discount_codes_uses = $wpdb->prefix . 'pmpro_discount_codes_uses';
44
}
45
pmpro_setDBTables();
46
@@ -109,10 +110,10 @@ function pmpro_setOption($s, $v = NULL)
109
function pmpro_get_slug($post_id)
110
{
111
global $pmpro_slugs, $wpdb;
112
-
113
//make sure post id is int for security
114
$post_id = intval($post_id);
115
-
116
if(!$pmpro_slugs[$post_id])
117
$pmpro_slugs[$post_id] = $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE ID = '" . $post_id . "' LIMIT 1");
118
@@ -222,7 +223,8 @@ function pmpro_isLevelExpiringSoon( &$level ) {
222
223
//are we within the days til expiration?
224
$now = current_time('timestamp');
225
- if( $now + ($days*3600*24) < strtotime( $level->enddate, $now ) )
226
$r = true;
227
else
228
$r = false;
@@ -253,7 +255,7 @@ function pmpro_getLevelCost(&$level, $tags = true, $short = false)
253
}
254
else
255
{
256
- $r .= sprintf(__(' and then <strong>%s every %d %s for %d more %s</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number), $level->billing_limit, pmpro_translate_billing_period($level->cycle_period, $level->billing_limit));
257
}
258
}
259
elseif($level->billing_limit == 1)
@@ -351,6 +353,27 @@ function pmpro_getLevelExpiration(&$level)
351
return $expiration_text;
352
}
353
354
function pmpro_hideAds()
355
{
356
global $pmpro_display_ads;
@@ -396,7 +419,7 @@ function pmpro_next_payment($user_id = NULL, $order_status = "success", $format
396
$r = false;
397
}
398
}
399
-
400
/**
401
* Filter the next payment date.
402
*
@@ -407,7 +430,7 @@ function pmpro_next_payment($user_id = NULL, $order_status = "success", $format
407
* @param string $order_status Status or array of statuses to find the last order based on.
408
*/
409
$r = apply_filters('pmpro_next_payment', $r, $user_id, $order_status);
410
-
411
//return in desired format
412
if($r === false)
413
return false; //always return false when no date found
@@ -453,7 +476,7 @@ if(!function_exists("cleanPhone"))
453
* NOTE: Could probably replace with preg_replace("[^0-9]", "", $phone)
454
*
455
* @since 1.0
456
- *
457
* @param string $phone The phone number to clean.
458
*/
459
function cleanPhone($phone)
@@ -478,7 +501,7 @@ if(!function_exists("formatPhone"))
478
* Function to format a phone number.
479
*
480
* @since 1.0
481
- *
482
* @param string $phone The phone number to format.
483
*/
484
function formatPhone($phone)
@@ -490,8 +513,8 @@ if(!function_exists("formatPhone"))
490
elseif(strlen($r) == 10)
491
$r = "(" . substr($r, 0, 3) . ") " . substr($r, 3, 3) . "-" . substr($r, 6, 4);
492
elseif(strlen($r) == 7)
493
- $r = substr($r, 0, 3) . "-" . substr($r, 3, 4);
494
-
495
/**
496
* Filter to do more or less cleaning of phone numbers.
497
*
@@ -578,9 +601,9 @@ function pmpro_hasMembershipLevel($levels = NULL, $user_id = NULL)
578
{
579
$levels = array($levels);
580
}
581
-
582
if(empty($membership_levels))
583
- {
584
//user has no levels just check if 0, L, -1, or e was sent in one of the levels
585
if(in_array(0, $levels, true) || in_array("0", $levels))
586
$return = true;
@@ -595,17 +618,17 @@ function pmpro_hasMembershipLevel($levels = NULL, $user_id = NULL)
595
}
596
}
597
else
598
- {
599
foreach($levels as $level)
600
- {
601
if(strtoupper($level) == "L")
602
- {
603
//checking if user is logged in
604
if(!empty($user_id) && $user_id == $current_user->ID)
605
$return = true;
606
}
607
elseif(strtoupper($level) == "-L")
608
- {
609
//checking if user is logged out
610
if(empty($user_id) || $user_id != $current_user->ID)
611
$return = true;
@@ -627,13 +650,13 @@ function pmpro_hasMembershipLevel($levels = NULL, $user_id = NULL)
627
$found_level = true;
628
}
629
}
630
-
631
if(is_numeric($level) && intval($level) < 0 && !$found_level) //checking for the absence of this level and they don't have it
632
{
633
$return = true;
634
- }
635
elseif(is_numeric($level) && intval($level) > 0 && $found_level) //checking for the presence of this level and they have it
636
- {
637
$return = true;
638
}
639
elseif(!is_numeric($level)) //if a level name was passed
@@ -674,7 +697,7 @@ function pmpro_changeMembershipLevel($level, $user_id = NULL, $old_level_status
674
675
//make sure user id is int for security
676
$user_id = intval($user_id);
677
-
678
if(empty($level)) //cancelling membership
679
{
680
$level = 0;
@@ -689,7 +712,7 @@ function pmpro_changeMembershipLevel($level, $user_id = NULL, $old_level_status
689
if(empty($level_obj))
690
{
691
$pmpro_error = __("Invalid level.", "pmpro");
692
- return false;
693
}
694
$level = $level_obj->id;
695
}
@@ -697,33 +720,33 @@ function pmpro_changeMembershipLevel($level, $user_id = NULL, $old_level_status
697
//if it's a custom level, they're changing
698
if(!is_array($level))
699
{
700
- //are they even changing?
701
if(pmpro_hasMembershipLevel($level, $user_id)) {
702
- $pmpro_error = __("not changing?", "pmpro");
703
- return false; //not changing
704
}
705
}
706
707
- //get all active membershipships for this user
708
$old_levels = pmpro_getMembershipLevelsForUser($user_id);
709
710
- //deactivate old memberships based on the old_level_status passed in (updates pmpro_memberships_users table)
711
- if($old_levels)
712
- {
713
- foreach($old_levels as $old_level) {
714
715
- $sql = "UPDATE $wpdb->pmpro_memberships_users SET `status`='$old_level_status', `enddate`='" . current_time('mysql') . "' WHERE `id`=".$old_level->subscription_id;
716
717
- if(!$wpdb->query($sql))
718
- {
719
- $pmpro_error = __("Error interacting with database", "pmpro") . ": ".(mysql_errno()?mysql_error():'unavailable');
720
721
- return false;
722
- }
723
- }
724
- }
725
726
- //get level id
727
if(is_array($level))
728
$level_id = $level['membership_id']; //custom level
729
else
@@ -737,25 +760,25 @@ function pmpro_changeMembershipLevel($level, $user_id = NULL, $old_level_status
737
*/
738
do_action("pmpro_before_change_membership_level", $level_id, $user_id);
739
740
- //should we cancel their gateway subscriptions?
741
- $pmpro_cancel_previous_subscriptions = true;
742
- if(isset($_REQUEST['cancel_membership']) && $_REQUEST['cancel_membership'] == false)
743
- $pmpro_cancel_previous_subscriptions = false;
744
- $pmpro_cancel_previous_subscriptions = apply_filters("pmpro_cancel_previous_subscriptions", $pmpro_cancel_previous_subscriptions);
745
746
- //cancel any other subscriptions they have (updates pmpro_membership_orders table)
747
if($pmpro_cancel_previous_subscriptions)
748
{
749
- $other_order_ids = $wpdb->get_col("SELECT id FROM $wpdb->pmpro_membership_orders WHERE user_id = '" . $user_id . "' AND status = 'success' ORDER BY id DESC");
750
751
- foreach($other_order_ids as $order_id)
752
- {
753
- $c_order = new MemberOrder($order_id);
754
- $c_order->cancel();
755
756
- if(!empty($c_order->error))
757
- $pmpro_error = $c_order->error;
758
- }
759
}
760
761
//insert current membership
@@ -770,10 +793,10 @@ function pmpro_changeMembershipLevel($level, $user_id = NULL, $old_level_status
770
if($level['enddate'] != current_time('mysql') && $level['enddate'] != "NULL" && substr($level['enddate'], 0, 1) != "'")
771
$level['enddate'] = "'" . $level['enddate'] . "'";
772
773
- //Better support mySQL Strict Mode by passing a proper enum value for cycle_period
774
- if ($level['cycle_period'] == '') $level['cycle_period'] = 0;
775
776
- $sql = "INSERT INTO $wpdb->pmpro_memberships_users (user_id, membership_id, code_id, initial_payment, billing_amount, cycle_number, cycle_period, billing_limit, trial_amount, trial_limit, startdate, enddate)
777
VALUES('" . $level['user_id'] . "',
778
'" . $level['membership_id'] . "',
779
'" . intval($level['code_id']) . "',
@@ -850,26 +873,26 @@ function pmpro_toggleMembershipCategory( $level, $category, $value )
850
global $wpdb;
851
$category = intval($category);
852
853
- if ( ($level = intval($level)) <= 0 )
854
{
855
- $safe = addslashes($level);
856
- if ( ($level = intval($wpdb->get_var("SELECT id FROM {$wpdb->pmpro_membership_levels} WHERE name = '$safe' LIMIT 1"))) <= 0 )
857
- {
858
- return __("Membership level not found.", "pmpro");
859
- }
860
}
861
862
if ( $value )
863
{
864
- $sql = "REPLACE INTO {$wpdb->pmpro_memberships_categories} (`membership_id`,`category_id`) VALUES ('$level','$category')";
865
- $wpdb->query($sql);
866
- if(mysql_errno()) return mysql_error();
867
}
868
else
869
{
870
- $sql = "DELETE FROM {$wpdb->pmpro_memberships_categories} WHERE `membership_id` = '$level' AND `category_id` = '$category' LIMIT 1";
871
- $wpdb->query($sql);
872
- if(mysql_errno()) return mysql_error();
873
}
874
875
return true;
@@ -928,7 +951,7 @@ function pmpro_updateMembershipCategories($level, $categories)
928
function pmpro_getMembershipCategories($level_id)
929
{
930
$level_id = intval($level_id);
931
-
932
global $wpdb;
933
$categories = $wpdb->get_col("SELECT c.category_id
934
FROM {$wpdb->pmpro_memberships_categories} AS c
@@ -995,8 +1018,8 @@ function pmpro_getMetavalues($query)
995
$r = new stdClass();
996
foreach($results as $result)
997
{
998
- if(!empty($r))
999
- $r->{$result->key} = $result->value;
1000
}
1001
1002
return $r;
@@ -1261,7 +1284,7 @@ function pmpro_checkDiscountCode($code, $level_id = NULL, $return_errors = false
1261
1262
//make sure level id is int for security
1263
$level_id = intval($level_id);
1264
-
1265
//no code, no code
1266
if(empty($code))
1267
$error = __("No code was given to check.", "pmpro");
@@ -1406,7 +1429,7 @@ function pmpro_getMembershipLevelForUser($user_id = NULL, $force = false)
1406
1407
//make sure user id is int for security
1408
$user_id = intval($user_id);
1409
-
1410
global $all_membership_levels;
1411
1412
if(isset($all_membership_levels[$user_id]) && !$force)
@@ -1478,7 +1501,7 @@ function pmpro_getMembershipLevelsForUser($user_id = NULL, $include_inactive = f
1478
1479
//make sure user id is int for security
1480
$user_id = intval($user_id);
1481
-
1482
global $wpdb;
1483
1484
$levels = $wpdb->get_results("SELECT
@@ -1547,15 +1570,15 @@ function pmpro_getLevel($level)
1547
}
1548
}
1549
else
1550
- {
1551
global $wpdb;
1552
- $level_obj = $wpdb->get_row("SELECT * FROM $wpdb->pmpro_membership_levels WHERE name = '" . esc_sql($level) . "' LIMIT 1");
1553
-
1554
if(!empty($level_obj))
1555
$level_id = $level_obj->id;
1556
else
1557
return false;
1558
-
1559
$pmpro_levels[$level_id] = $level_obj;
1560
return $pmpro_levels[$level_id];
1561
}
@@ -1689,7 +1712,7 @@ if(!function_exists("pmpro_getMemberStartdate"))
1689
//make sure user and level id are int for security
1690
$user_id = intval($user_id);
1691
$level_id = intval($level_id);
1692
-
1693
global $pmpro_startdates; //for cache
1694
if(empty($pmpro_startdates[$user_id][$level_id]))
1695
{
@@ -1764,14 +1787,14 @@ function pmpro_setMessage($message, $type, $force = false)
1764
function pmpro_showMessage()
1765
{
1766
global $pmpro_msg, $pmpro_msgt;
1767
-
1768
if(!empty($pmpro_msg))
1769
{
1770
- ?>
1771
- <div class="<?php echo $pmpro_msgt;?>">
1772
- <p><?php echo $pmpro_msg;?></p>
1773
- </div>
1774
- <?php
1775
}
1776
}
1777
@@ -1975,20 +1998,20 @@ function pmpro_is_ready()
1975
$r = true;
1976
else
1977
$r = false;
1978
-
1979
/**
1980
* Filter to determine if PMPro setup is complete or
1981
* if notices or warnings need to be shown in the PMPro settings.
1982
*
1983
* Note: The filter should return true or false and also set
1984
* the $pmpro_level_ready, $pmpro_gateway_ready, $pmpro_pages_ready global variabls.
1985
- *
1986
* @since 1.8.4.5
1987
*
1988
- * @param bool $r ready?
1989
- */
1990
$r = apply_filters('pmpro_is_ready', $r);
1991
-
1992
return $r;
1993
}
1994
@@ -2013,7 +2036,7 @@ function pmpro_formatPrice($price)
2013
(isset($pmpro_currencies[$pmpro_currency]['decimal_separator']) ? $pmpro_currencies[$pmpro_currency]['decimal_separator'] : '.'),
2014
(isset($pmpro_currencies[$pmpro_currency]['thousands_separator']) ? $pmpro_currencies[$pmpro_currency]['thousands_separator'] : ',')
2015
);
2016
-
2017
//which side is the symbol on?
2018
if(!empty($pmpro_currencies[$pmpro_currency]['position']) && $pmpro_currencies[$pmpro_currency]['position']== 'left')
2019
$formatted = $pmpro_currency_symbol . $formatted;
@@ -2128,7 +2151,7 @@ function pmpro_generatePages($pages) {
2128
$title = $page;
2129
$content = '[pmpro_' . $name . ']';
2130
}
2131
-
2132
$insert = array(
2133
'post_title' => $title,
2134
'post_status' => 'publish',
@@ -2154,4 +2177,3 @@ function pmpro_generatePages($pages) {
2154
2155
return $pages_created;
2156
}
2157
-
1
<?php
2
/****************************************************************
3
4
+ IMPORTANT. PLEASE READ.
5
6
+ DO NOT EDIT THIS FILE or any other file in the /wp-content/plugins/paid-memberships-pro/ directory.
7
+ Doing so could break the PMPro plugin and/or keep you from upgrading this plugin in the future.
8
+ We regularly release updates to the plugin, including important security fixes and new features.
9
+ You want to be able to upgrade.
10
11
+ If you were asked to insert code into "your functions.php file", it was meant that you edit the functions.php
12
+ in the root folder of your active theme. e.g. /wp-content/themes/twentytwelve/functions.php
13
+ You can also create a custom plugin to place customization code into. Instructions are here:
14
+ http://www.paidmembershipspro.com/2012/08/create-a-plugin-for-pmpro-customizations/
15
16
+ Further documentation for customizing Paid Memberships Pro can be found here:
17
+ http://www.paidmembershipspro.com/documentation/
18
19
+ ****************************************************************/
20
if(!function_exists("sornot"))
21
{
22
function sornot($t, $n)
41
$wpdb->pmpro_discount_codes = $wpdb->prefix . 'pmpro_discount_codes';
42
$wpdb->pmpro_discount_codes_levels = $wpdb->prefix . 'pmpro_discount_codes_levels';
43
$wpdb->pmpro_discount_codes_uses = $wpdb->prefix . 'pmpro_discount_codes_uses';
44
+ $wpdb->pmpro_membership_levelmeta = $wpdb->prefix . 'pmpro_membership_levelmeta';
45
}
46
pmpro_setDBTables();
47
110
function pmpro_get_slug($post_id)
111
{
112
global $pmpro_slugs, $wpdb;
113
+
114
//make sure post id is int for security
115
$post_id = intval($post_id);
116
+
117
if(!$pmpro_slugs[$post_id])
118
$pmpro_slugs[$post_id] = $wpdb->get_var("SELECT post_name FROM $wpdb->posts WHERE ID = '" . $post_id . "' LIMIT 1");
119
223
224
//are we within the days til expiration?
225
$now = current_time('timestamp');
226
+
227
+ if( $now + ($days*3600*24) < $level->enddate )
228
$r = true;
229
else
230
$r = false;
255
}
256
else
257
{
258
+ $r .= sprintf(__(' and then <strong>%s every %d %s for %d more payments</strong>.', 'pmpro'), pmpro_formatPrice($level->billing_amount), $level->cycle_number, pmpro_translate_billing_period($level->cycle_period, $level->cycle_number), $level->billing_limit);
259
}
260
}
261
elseif($level->billing_limit == 1)
353
return $expiration_text;
354
}
355
356
+ /**
357
+ * pmpro_membership_level Meta Functions
358
+ *
359
+ * @ssince 1.8.6.5
360
+ */
361
+ function add_pmpro_membership_level_meta($level_id, $meta_key, $meta_value, $unique = false) {
362
+ return add_metadata('pmpro_membership_level', $level_id, $meta_key, $meta_value, $unique);
363
+ }
364
+
365
+ function get_pmpro_membership_level_meta($level_id, $key, $single = false) {
366
+ return get_metadata('pmpro_membership_level', $level_id, $key, $single);
367
+ }
368
+
369
+ function update_pmpro_membership_level_meta($level_id, $meta_key, $meta_value, $prev_value = '') {
370
+ return update_metadata('pmpro_membership_level', $level_id, $meta_key, $meta_value, $prev_value);
371
+ }
372
+
373
+ function delete_pmpro_membership_level_meta($level_id, $meta_key, $meta_value = '') {
374
+ return delete_metadata('pmpro_membership_level', $level_id, $meta_key, $meta_value);
375
+ }
376
+
377
function pmpro_hideAds()
378
{
379
global $pmpro_display_ads;
419
$r = false;
420
}
421
}
422
+
423
/**
424
* Filter the next payment date.
425
*
430
* @param string $order_status Status or array of statuses to find the last order based on.
431
*/
432
$r = apply_filters('pmpro_next_payment', $r, $user_id, $order_status);
433
+
434
//return in desired format
435
if($r === false)
436
return false; //always return false when no date found
476
* NOTE: Could probably replace with preg_replace("[^0-9]", "", $phone)
477
*
478
* @since 1.0
479
+ *
480
* @param string $phone The phone number to clean.
481
*/
482
function cleanPhone($phone)
501
* Function to format a phone number.
502
*
503
* @since 1.0
504
+ *
505
* @param string $phone The phone number to format.
506
*/
507
function formatPhone($phone)
513
elseif(strlen($r) == 10)
514
$r = "(" . substr($r, 0, 3) . ") " . substr($r, 3, 3) . "-" . substr($r, 6, 4);
515
elseif(strlen($r) == 7)
516
+ $r = substr($r, 0, 3) . "-" . substr($r, 3, 4);
517
+
518
/**
519
* Filter to do more or less cleaning of phone numbers.
520
*
601
{
602
$levels = array($levels);
603
}
604
+
605
if(empty($membership_levels))
606
+ {
607
//user has no levels just check if 0, L, -1, or e was sent in one of the levels
608
if(in_array(0, $levels, true) || in_array("0", $levels))
609
$return = true;
618
}
619
}
620
else
621
+ {
622
foreach($levels as $level)
623
+ {
624
if(strtoupper($level) == "L")
625
+ {
626
//checking if user is logged in
627
if(!empty($user_id) && $user_id == $current_user->ID)
628
$return = true;
629
}
630
elseif(strtoupper($level) == "-L")
631
+ {
632
//checking if user is logged out
633
if(empty($user_id) || $user_id != $current_user->ID)
634
$return = true;
650
$found_level = true;
651
}
652
}
653
+
654
if(is_numeric($level) && intval($level) < 0 && !$found_level) //checking for the absence of this level and they don't have it
655
{
656
$return = true;
657
+ }
658
elseif(is_numeric($level) && intval($level) > 0 && $found_level) //checking for the presence of this level and they have it
659
+ {
660
$return = true;
661
}
662
elseif(!is_numeric($level)) //if a level name was passed
697
698
//make sure user id is int for security
699
$user_id = intval($user_id);
700
+
701
if(empty($level)) //cancelling membership
702
{
703
$level = 0;
712
if(empty($level_obj))
713
{
714
$pmpro_error = __("Invalid level.", "pmpro");
715
+ return false;
716
}
717
$level = $level_obj->id;
718
}
720
//if it's a custom level, they're changing
721
if(!is_array($level))
722
{
723
+ //are they even changing?
724
if(pmpro_hasMembershipLevel($level, $user_id)) {
725
+ $pmpro_error = __("not changing?", "pmpro");
726
+ return false; //not changing
727
}
728
}
729
730
+ //get all active membershipships for this user
731
$old_levels = pmpro_getMembershipLevelsForUser($user_id);
732
733
+ //deactivate old memberships based on the old_level_status passed in (updates pmpro_memberships_users table)
734
+ if($old_levels)
735
+ {
736
+ foreach($old_levels as $old_level) {
737
738
+ $sql = "UPDATE $wpdb->pmpro_memberships_users SET `status`='$old_level_status', `enddate`='" . current_time('mysql') . "' WHERE `id`=".$old_level->subscription_id;
739
740
+ if(!$wpdb->query($sql))
741
+ {
742
+ $pmpro_error = __("Error interacting with database", "pmpro") . ": ".(mysql_errno()?mysql_error():'unavailable');
743
744
+ return false;
745
+ }
746
+ }
747
+ }
748
749
+ //get level id
750
if(is_array($level))
751
$level_id = $level['membership_id']; //custom level
752
else
760
*/
761
do_action("pmpro_before_change_membership_level", $level_id, $user_id);
762
763
+ //should we cancel their gateway subscriptions?
764
+ $pmpro_cancel_previous_subscriptions = true;
765
+ if(isset($_REQUEST['cancel_membership']) && $_REQUEST['cancel_membership'] == false)
766
+ $pmpro_cancel_previous_subscriptions = false;
767
+ $pmpro_cancel_previous_subscriptions = apply_filters("pmpro_cancel_previous_subscriptions", $pmpro_cancel_previous_subscriptions);
768
769
+ //cancel any other subscriptions they have (updates pmpro_membership_orders table)
770
if($pmpro_cancel_previous_subscriptions)
771
{
772
+ $other_order_ids = $wpdb->get_col("SELECT id FROM $wpdb->pmpro_membership_orders WHERE user_id = '" . $user_id . "' AND status = 'success' ORDER BY id DESC");
773
774
+ foreach($other_order_ids as $order_id)
775
+ {
776
+ $c_order = new MemberOrder($order_id);
777
+ $c_order->cancel();
778
779
+ if(!empty($c_order->error))
780
+ $pmpro_error = $c_order->error;
781
+ }
782
}
783
784
//insert current membership
793
if($level['enddate'] != current_time('mysql') && $level['enddate'] != "NULL" && substr($level['enddate'], 0, 1) != "'")
794
$level['enddate'] = "'" . $level['enddate'] . "'";
795
796
+ //Better support mySQL Strict Mode by passing a proper enum value for cycle_period
797
+ if ($level['cycle_period'] == '') $level['cycle_period'] = 0;
798
799
+ $sql = "INSERT INTO $wpdb->pmpro_memberships_users (user_id, membership_id, code_id, initial_payment, billing_amount, cycle_number, cycle_period, billing_limit, trial_amount, trial_limit, startdate, enddate)
800
VALUES('" . $level['user_id'] . "',
801
'" . $level['membership_id'] . "',
802
'" . intval($level['code_id']) . "',
873
global $wpdb;
874
$category = intval($category);
875
876
+ if ( ($level = intval($level)) <= 0 )
877
+ {
878
+ $safe = addslashes($level);
879
+ if ( ($level = intval($wpdb->get_var("SELECT id FROM {$wpdb->pmpro_membership_levels} WHERE name = '$safe' LIMIT 1"))) <= 0 )
880
{
881
+ return __("Membership level not found.", "pmpro");
882
}
883
+ }
884
885
if ( $value )
886
{
887
+ $sql = "REPLACE INTO {$wpdb->pmpro_memberships_categories} (`membership_id`,`category_id`) VALUES ('$level','$category')";
888
+ $wpdb->query($sql);
889
+ if(mysql_errno()) return mysql_error();
890
}
891
else
892
{
893
+ $sql = "DELETE FROM {$wpdb->pmpro_memberships_categories} WHERE `membership_id` = '$level' AND `category_id` = '$category' LIMIT 1";
894
+ $wpdb->query($sql);
895
+ if(mysql_errno()) return mysql_error();
896
}
897
898
return true;
951
function pmpro_getMembershipCategories($level_id)
952
{
953
$level_id = intval($level_id);
954
+
955
global $wpdb;
956
$categories = $wpdb->get_col("SELECT c.category_id
957
FROM {$wpdb->pmpro_memberships_categories} AS c
1018
$r = new stdClass();
1019
foreach($results as $result)
1020
{
1021
+ if(!empty($r) && !empty($result->key))
1022
+ $r->{$result->key} = $result->value;
1023
}
1024
1025
return $r;
1284
1285
//make sure level id is int for security
1286
$level_id = intval($level_id);
1287
+
1288
//no code, no code
1289
if(empty($code))
1290
$error = __("No code was given to check.", "pmpro");
1429
1430
//make sure user id is int for security
1431
$user_id = intval($user_id);
1432
+
1433
global $all_membership_levels;
1434
1435
if(isset($all_membership_levels[$user_id]) && !$force)
1501
1502
//make sure user id is int for security
1503
$user_id = intval($user_id);
1504
+
1505
global $wpdb;
1506
1507
$levels = $wpdb->get_results("SELECT
1570
}
1571
}
1572
else
1573
+ {
1574
global $wpdb;
1575
+ $level_obj = $wpdb->get_row("SELECT * FROM $wpdb->pmpro_membership_levels WHERE name = '" . esc_sql($level) . "' LIMIT 1");
1576
+
1577
if(!empty($level_obj))
1578
$level_id = $level_obj->id;
1579
else
1580
return false;
1581
+
1582
$pmpro_levels[$level_id] = $level_obj;
1583
return $pmpro_levels[$level_id];
1584
}
1712
//make sure user and level id are int for security
1713
$user_id = intval($user_id);
1714
$level_id = intval($level_id);
1715
+
1716
global $pmpro_startdates; //for cache
1717
if(empty($pmpro_startdates[$user_id][$level_id]))
1718
{
1787
function pmpro_showMessage()
1788
{
1789
global $pmpro_msg, $pmpro_msgt;
1790
+
1791
if(!empty($pmpro_msg))
1792
{
1793
+ ?>
1794
+ <div class="<?php echo $pmpro_msgt;?>">
1795
+ <p><?php echo $pmpro_msg;?></p>
1796
+ </div>
1797
+ <?php
1798
}
1799
}
1800
1998
$r = true;
1999
else
2000
$r = false;
2001
+
2002
/**
2003
* Filter to determine if PMPro setup is complete or
2004
* if notices or warnings need to be shown in the PMPro settings.
2005
*
2006
* Note: The filter should return true or false and also set
2007
* the $pmpro_level_ready, $pmpro_gateway_ready, $pmpro_pages_ready global variabls.
2008
+ *
2009
* @since 1.8.4.5
2010
*
2011
+ * @param bool $r ready?
2012
+ */
2013
$r = apply_filters('pmpro_is_ready', $r);
2014
+
2015
return $r;
2016
}
2017
2036
(isset($pmpro_currencies[$pmpro_currency]['decimal_separator']) ? $pmpro_currencies[$pmpro_currency]['decimal_separator'] : '.'),
2037
(isset($pmpro_currencies[$pmpro_currency]['thousands_separator']) ? $pmpro_currencies[$pmpro_currency]['thousands_separator'] : ',')
2038
);
2039
+
2040
//which side is the symbol on?
2041
if(!empty($pmpro_currencies[$pmpro_currency]['position']) && $pmpro_currencies[$pmpro_currency]['position']== 'left')
2042
$formatted = $pmpro_currency_symbol . $formatted;
2151
$title = $page;
2152
$content = '[pmpro_' . $name . ']';
2153
}
2154
+
2155
$insert = array(
2156
'post_title' => $title,
2157
'post_status' => 'publish',
2177
2178
return $pages_created;
2179
}
includes/setup.sql CHANGED
@@ -96,6 +96,22 @@ CREATE TABLE `wp_pmpro_membership_levels` (
96
97
-- --------------------------------------------------------
98
99
--
100
-- Table structure for table `wp_pmpro_membership_orders`
101
--
96
97
-- --------------------------------------------------------
98
99
+ --
100
+ -- Table structure for table `wp_pmpro_membership_levelmeta`
101
+ --
102
+
103
+ CREATE TABLE `wp_pmpro_membership_levelmeta` (
104
+ `meta_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
105
+ `pmpro_membership_level_id` int(10) unsigned NOT NULL,
106
+ `meta_key` varchar(255) NOT NULL,
107
+ `meta_value` longtext,
108
+ PRIMARY KEY (`meta_id`),
109
+ KEY (`pmpro_membership_level_id`),
110
+ KEY (`meta_key`)
111
+ );
112
+
113
+ -- --------------------------------------------------------
114
+
115
--
116
-- Table structure for table `wp_pmpro_membership_orders`
117
--
includes/upgradecheck.php CHANGED
@@ -5,63 +5,63 @@
5
function pmpro_checkForUpgrades()
6
{
7
$pmpro_db_version = pmpro_getOption("db_version");
8
-
9
//if we can't find the DB tables, reset db_version to 0
10
global $wpdb;
11
$wpdb->hide_errors();
12
$wpdb->pmpro_membership_levels = $wpdb->prefix . 'pmpro_membership_levels';
13
- $table_exists = $wpdb->query("SHOW TABLES LIKE '" . $wpdb->pmpro_membership_levels . "'");
14
- if(!$table_exists)
15
$pmpro_db_version = 0;
16
-
17
if(!$pmpro_db_version)
18
- $pmpro_db_version = pmpro_upgrade_1();
19
-
20
if($pmpro_db_version < 1.115)
21
- $pmpro_db_version = pmpro_upgrade_1_1_15();
22
-
23
if($pmpro_db_version < 1.23)
24
- $pmpro_db_version = pmpro_upgrade_1_2_3();
25
-
26
if($pmpro_db_version < 1.318)
27
$pmpro_db_version = pmpro_upgrade_1_3_18();
28
-
29
if($pmpro_db_version < 1.4)
30
$pmpro_db_version = pmpro_upgrade_1_4();
31
-
32
if($pmpro_db_version < 1.42)
33
$pmpro_db_version = pmpro_upgrade_1_4_2();
34
-
35
if($pmpro_db_version < 1.48)
36
$pmpro_db_version = pmpro_upgrade_1_4_8();
37
38
if($pmpro_db_version < 1.5)
39
$pmpro_db_version = pmpro_upgrade_1_5();
40
-
41
if($pmpro_db_version < 1.59)
42
$pmpro_db_version = pmpro_upgrade_1_5_9();
43
-
44
if($pmpro_db_version < 1.6)
45
$pmpro_db_version = pmpro_upgrade_1_6();
46
-
47
//fix for fresh 1.7 installs
48
if($pmpro_db_version == 1.7)
49
{
50
//check if we have an id column in the memberships_users table
51
$wpdb->pmpro_memberships_users = $wpdb->prefix . 'pmpro_memberships_users';
52
- $col = $wpdb->get_var("SELECT id FROM $wpdb->pmpro_memberships_users LIMIT 1");
53
if($wpdb->last_error == "Unknown column 'id' in 'field list'")
54
- {
55
//redo 1.5 fix
56
pmpro_upgrade_1_5();
57
}
58
-
59
pmpro_db_delta();
60
-
61
pmpro_setOption("db_version", "1.703");
62
$pmpro_db_version = 1.703;
63
}
64
-
65
//updates from this point on should be like this if DB only
66
if($pmpro_db_version < 1.71)
67
{
@@ -69,31 +69,31 @@ function pmpro_checkForUpgrades()
69
pmpro_setOption("db_version", "1.71");
70
$pmpro_db_version = 1.71;
71
}
72
-
73
if($pmpro_db_version < 1.72)
74
- {
75
//schedule the credit card expiring cron
76
wp_schedule_event(current_time('timestamp'), 'monthly', 'pmpro_cron_credit_card_expiring_warnings');
77
-
78
pmpro_setOption("db_version", "1.72");
79
$pmpro_db_version = 1.72;
80
}
81
-
82
/*
83
1.7.3
84
- default Stripe Billing Fields to true
85
- unless Stripe Lite is activated, then deactivate Stripe Lite and set Stripe Billing Fields to false
86
*/
87
-
88
if($pmpro_db_version < 1.79)
89
{
90
//need to register caps for menu
91
pmpro_activation();
92
-
93
pmpro_setOption("db_version", "1.79");
94
$pmpro_db_version = 1.79;
95
}
96
-
97
//set default filter_queries setting
98
if($pmpro_db_version < 1.791)
99
{
@@ -101,10 +101,30 @@ function pmpro_checkForUpgrades()
101
pmpro_setOption("filterqueries", 1);
102
else
103
pmpro_SetOption("filterqueries", 0);
104
-
105
pmpro_setOption("db_version", "1.791");
106
$pmpro_db_version = 1.791;
107
}
108
}
109
110
function pmpro_upgrade_1_7()
@@ -120,11 +140,11 @@ function pmpro_upgrade_1_6()
120
global $wpdb;
121
$wpdb->hide_errors();
122
$wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
123
-
124
//add notes column to orders
125
$sqlQuery = "ALTER TABLE `" . $wpdb->pmpro_membership_orders . "` ADD `notes` TEXT NOT NULL";
126
$wpdb->query($sqlQuery);
127
-
128
pmpro_setOption("db_version", "1.6");
129
return 1.6;
130
}
@@ -138,7 +158,7 @@ function pmpro_upgrade_1_5_9()
138
//fix firstpayment statuses
139
$sqlQuery = "UPDATE " . $wpdb->pmpro_membership_orders . " SET status = 'success' WHERE status = 'firstpayment'";
140
$wpdb->query($sqlQuery);
141
-
142
pmpro_setOption("db_version", "1.59");
143
return 1.59;
144
}
@@ -174,17 +194,17 @@ function pmpro_upgrade_1_4_8()
174
/*
175
Adding a billing_country field to the orders table.
176
*/
177
-
178
global $wpdb;
179
$wpdb->hide_errors();
180
$wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
181
-
182
//billing_country
183
$sqlQuery = "
184
ALTER TABLE `" . $wpdb->pmpro_membership_orders . "` ADD `billing_country` VARCHAR( 128 ) NOT NULL AFTER `billing_zip`
185
";
186
$wpdb->query($sqlQuery);
187
-
188
pmpro_setOption("db_version", "1.48");
189
return 1.48;
190
}
@@ -201,7 +221,7 @@ function pmpro_upgrade_1_4_2()
201
pmpro_setOption("use_ssl", 1);
202
else
203
pmpro_setOption("use_ssl", 0);
204
-
205
pmpro_setOption("db_version", "1.42");
206
return 1.42;
207
}
@@ -211,13 +231,13 @@ function pmpro_upgrade_1_4()
211
global $wpdb;
212
$wpdb->hide_errors();
213
$wpdb->pmpro_membership_levels = $wpdb->prefix . 'pmpro_membership_levels';
214
-
215
//confirmation message
216
$sqlQuery = "
217
ALTER TABLE `" . $wpdb->pmpro_membership_levels . "` ADD `confirmation` LONGTEXT NOT NULL AFTER `description`
218
";
219
$wpdb->query($sqlQuery);
220
-
221
pmpro_setOption("db_version", "1.4");
222
return 1.4;
223
}
@@ -230,7 +250,7 @@ function pmpro_upgrade_1_3_18()
230
pmpro_setOption("email_admin_cancels", "1");
231
pmpro_setOption("email_admin_billing", "1");
232
233
- pmpro_setOption("db_version", "1.318");
234
return 1.318;
235
}
236
@@ -245,39 +265,39 @@ function pmpro_upgrade_1_2_3()
245
$wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
246
$wpdb->pmpro_discount_codes = $wpdb->prefix . 'pmpro_discount_codes';
247
$wpdb->pmpro_discount_codes_levels = $wpdb->prefix . 'pmpro_discount_codes_levels';
248
- $wpdb->pmpro_discount_codes_uses = $wpdb->prefix . 'pmpro_discount_codes_uses';
249
-
250
//expiration number and period for levels
251
$sqlQuery = "
252
ALTER TABLE `" . $wpdb->pmpro_membership_levels . "` ADD `expiration_number` INT UNSIGNED NOT NULL ,
253
ADD `expiration_period` ENUM( 'Day', 'Week', 'Month', 'Year' ) NOT NULL
254
";
255
$wpdb->query($sqlQuery);
256
-
257
//expiration number and period for discount code levels
258
$sqlQuery = "
259
ALTER TABLE `" . $wpdb->pmpro_discount_codes_levels . "` ADD `expiration_number` INT UNSIGNED NOT NULL ,
260
ADD `expiration_period` ENUM( 'Day', 'Week', 'Month', 'Year' ) NOT NULL
261
";
262
- $wpdb->query($sqlQuery);
263
-
264
//end date for members
265
$sqlQuery = "
266
ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` ADD `enddate` DATETIME NULL AFTER `startdate`
267
";
268
$wpdb->query($sqlQuery);
269
-
270
$sqlQuery = "
271
ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` ADD INDEX ( `enddate` )
272
";
273
$wpdb->query($sqlQuery);
274
-
275
- pmpro_setOption("db_version", "1.23");
276
return 1.23;
277
}
278
279
function pmpro_upgrade_1_1_15()
280
- {
281
/*
282
DB table setup
283
*/
@@ -290,8 +310,8 @@ function pmpro_upgrade_1_1_15()
290
$wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
291
$wpdb->pmpro_discount_codes = $wpdb->prefix . 'pmpro_discount_codes';
292
$wpdb->pmpro_discount_codes_levels = $wpdb->prefix . 'pmpro_discount_codes_levels';
293
- $wpdb->pmpro_discount_codes_uses = $wpdb->prefix . 'pmpro_discount_codes_uses';
294
-
295
/*
296
Changing some id columns to unsigned.
297
*/
@@ -299,66 +319,66 @@ function pmpro_upgrade_1_1_15()
299
ALTER TABLE `" . $wpdb->pmpro_membership_levels . "` CHANGE `id` `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT
300
";
301
$wpdb->query($sqlQuery);
302
-
303
$sqlQuery = "
304
ALTER TABLE `" . $wpdb->pmpro_memberships_categories . "` CHANGE `membership_id` `membership_id` INT( 11 ) UNSIGNED NOT NULL
305
";
306
$wpdb->query($sqlQuery);
307
-
308
$sqlQuery = "
309
ALTER TABLE `" . $wpdb->pmpro_memberships_categories . "` CHANGE `category_id` `category_id` INT( 11 ) UNSIGNED NOT NULL
310
";
311
$wpdb->query($sqlQuery);
312
-
313
$sqlQuery = "
314
ALTER TABLE `" . $wpdb->pmpro_memberships_pages . "` CHANGE `membership_id` `membership_id` INT( 11 ) UNSIGNED NOT NULL
315
";
316
$wpdb->query($sqlQuery);
317
-
318
$sqlQuery = "
319
ALTER TABLE `" . $wpdb->pmpro_memberships_pages . "` CHANGE `page_id` `page_id` INT( 11 ) UNSIGNED NOT NULL
320
";
321
$wpdb->query($sqlQuery);
322
-
323
$sqlQuery = "
324
ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` CHANGE `user_id` `user_id` INT( 11 ) UNSIGNED NOT NULL
325
";
326
$wpdb->query($sqlQuery);
327
-
328
$sqlQuery = "
329
ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` CHANGE `membership_id` `membership_id` INT( 11 ) UNSIGNED NOT NULL
330
";
331
$wpdb->query($sqlQuery);
332
-
333
$sqlQuery = "
334
ALTER TABLE `" . $wpdb->pmpro_membership_orders . "` CHANGE `id` `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT
335
";
336
$wpdb->query($sqlQuery);
337
-
338
$sqlQuery = "
339
ALTER TABLE `" . $wpdb->pmpro_membership_orders . "` CHANGE `user_id` `user_id` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0'
340
";
341
$wpdb->query($sqlQuery);
342
-
343
$sqlQuery = "
344
ALTER TABLE `" . $wpdb->pmpro_membership_orders . "` CHANGE `membership_id` `membership_id` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0'
345
";
346
$wpdb->query($sqlQuery);
347
-
348
$sqlQuery = "
349
ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` ADD `code_id` INT UNSIGNED NOT NULL AFTER `membership_id` ;
350
";
351
$wpdb->query($sqlQuery);
352
-
353
$sqlQuery = "
354
ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` ADD INDEX ( `code_id` )
355
";
356
- $wpdb->query($sqlQuery);
357
-
358
/*
359
New tables for discount codes
360
*/
361
-
362
//wp_pmpro_discount_codes
363
$sqlQuery = "
364
CREATE TABLE `" . $wpdb->pmpro_discount_codes . "` (
@@ -371,9 +391,9 @@ function pmpro_upgrade_1_1_15()
371
UNIQUE KEY `code` (`code`),
372
KEY `starts` (`starts`),
373
KEY `expires` (`expires`)
374
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
375
";
376
- $wpdb->query($sqlQuery);
377
378
//wp_pmpro_discount_codes_levels
379
$sqlQuery = "
@@ -389,9 +409,9 @@ function pmpro_upgrade_1_1_15()
389
`trial_limit` int(11) NOT NULL DEFAULT '0',
390
PRIMARY KEY (`code_id`,`level_id`),
391
KEY `initial_payment` (`initial_payment`)
392
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
393
";
394
- $wpdb->query($sqlQuery);
395
396
//wp_pmpro_discount_codes_uses
397
$sqlQuery = "
@@ -404,61 +424,61 @@ function pmpro_upgrade_1_1_15()
404
PRIMARY KEY (`id`),
405
KEY `user_id` (`user_id`),
406
KEY `timestamp` (`timestamp`)
407
- ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
408
";
409
$wpdb->query($sqlQuery);
410
-
411
pmpro_setOption("db_version", "1.115");
412
-
413
//do the next update
414
return pmpro_upgrade_1_2_2();
415
}
416
417
function pmpro_upgrade_1()
418
- {
419
/*
420
default options
421
*/
422
$nonmembertext = sprintf( __( 'This content is for !!levels!! members only.<br /><a href="%s">Register</a>', 'pmpro' ), wp_login_url() . "?action=register" );
423
pmpro_setOption("nonmembertext", $nonmembertext);
424
-
425
$notloggedintext = sprintf( __( 'This content is for !!levels!! members only.<br /><a href="%s">Log In</a> <a href="%s">Register</a>', 'pmpro' ), wp_login_url(), wp_login_url() . "?action=register" );
426
'?action=register">Register</a>';
427
pmpro_setOption("notloggedintext", $notloggedintext);
428
-
429
$rsstext = __( "This content is for !!levels!! members only. Visit the site and log in/register to read.", 'pmpro' );
430
pmpro_setOption("rsstext", $rsstext);
431
-
432
$gateway_environment = "sandbox";
433
pmpro_setOption("gateway_environment", $gateway_environment);
434
-
435
$pmpro_currency = "USD";
436
pmpro_setOption("currency", $pmpro_currency);
437
-
438
$pmpro_accepted_credit_cards = "Visa,Mastercard,American Express,Discover";
439
- pmpro_setOption("accepted_credit_cards", $pmpro_accepted_credit_cards);
440
-
441
- $parsed = parse_url(home_url());
442
$hostname = $parsed['host'];
443
$hostparts = explode(".", $hostname);
444
- $email_domain = $hostparts[count($hostparts) - 2] . "." . $hostparts[count($hostparts) - 1];
445
$from_email = "wordpress@" . $email_domain;
446
pmpro_setOption("from_email", $from_email);
447
-
448
$from_name = "WordPress";
449
- pmpro_setOption("from_name", $from_name);
450
-
451
//setting new email settings defaults
452
pmpro_setOption("email_admin_checkout", "1");
453
pmpro_setOption("email_admin_changes", "1");
454
pmpro_setOption("email_admin_cancels", "1");
455
pmpro_setOption("email_admin_billing", "1");
456
-
457
- pmpro_setOption("tospage", "");
458
-
459
//db update
460
- pmpro_db_delta();
461
-
462
//update version and return
463
pmpro_setOption("db_version", "1.71"); //no need to run other updates
464
return 1.71;
@@ -467,7 +487,7 @@ function pmpro_upgrade_1()
467
function pmpro_db_delta()
468
{
469
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
470
-
471
global $wpdb;
472
$wpdb->hide_errors();
473
$wpdb->pmpro_membership_levels = $wpdb->prefix . 'pmpro_membership_levels';
@@ -477,8 +497,9 @@ function pmpro_db_delta()
477
$wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
478
$wpdb->pmpro_discount_codes = $wpdb->prefix . 'pmpro_discount_codes';
479
$wpdb->pmpro_discount_codes_levels = $wpdb->prefix . 'pmpro_discount_codes_levels';
480
- $wpdb->pmpro_discount_codes_uses = $wpdb->prefix . 'pmpro_discount_codes_uses';
481
-
482
//wp_pmpro_membership_levels
483
$sqlQuery = "
484
CREATE TABLE `" . $wpdb->pmpro_membership_levels . "` (
@@ -503,7 +524,7 @@ function pmpro_db_delta()
503
);
504
";
505
dbDelta($sqlQuery);
506
-
507
//wp_pmpro_membership_orders
508
$sqlQuery = "
509
CREATE TABLE `" . $wpdb->pmpro_membership_orders . "` (
@@ -556,7 +577,7 @@ function pmpro_db_delta()
556
);
557
";
558
dbDelta($sqlQuery);
559
-
560
//wp_pmpro_memberships_categories
561
$sqlQuery = "
562
CREATE TABLE `" . $wpdb->pmpro_memberships_categories . "` (
@@ -568,7 +589,7 @@ function pmpro_db_delta()
568
);
569
";
570
dbDelta($sqlQuery);
571
-
572
//wp_pmpro_memberships_pages
573
$sqlQuery = "
574
CREATE TABLE `" . $wpdb->pmpro_memberships_pages . "` (
@@ -580,7 +601,7 @@ function pmpro_db_delta()
580
);
581
";
582
dbDelta($sqlQuery);
583
-
584
//wp_pmpro_memberships_users
585
$sqlQuery = "
586
CREATE TABLE `" . $wpdb->pmpro_memberships_users . "` (
@@ -608,8 +629,8 @@ function pmpro_db_delta()
608
KEY `status` (`status`)
609
);
610
";
611
- dbDelta($sqlQuery);
612
-
613
//wp_pmpro_discount_codes
614
$sqlQuery = "
615
CREATE TABLE `" . $wpdb->pmpro_discount_codes . "` (
@@ -624,7 +645,7 @@ function pmpro_db_delta()
624
KEY `expires` (`expires`)
625
);
626
";
627
- dbDelta($sqlQuery);
628
629
//wp_pmpro_discount_codes_levels
630
$sqlQuery = "
@@ -644,7 +665,7 @@ function pmpro_db_delta()
644
KEY `initial_payment` (`initial_payment`)
645
);
646
";
647
- dbDelta($sqlQuery);
648
649
//wp_pmpro_discount_codes_uses
650
$sqlQuery = "
@@ -660,4 +681,18 @@ function pmpro_db_delta()
660
);
661
";
662
dbDelta($sqlQuery);
663
}
5
function pmpro_checkForUpgrades()
6
{
7
$pmpro_db_version = pmpro_getOption("db_version");
8
+
9
//if we can't find the DB tables, reset db_version to 0
10
global $wpdb;
11
$wpdb->hide_errors();
12
$wpdb->pmpro_membership_levels = $wpdb->prefix . 'pmpro_membership_levels';
13
+ $table_exists = $wpdb->query("SHOW TABLES LIKE '" . $wpdb->pmpro_membership_levels . "'");
14
+ if(!$table_exists)
15
$pmpro_db_version = 0;
16
+
17
if(!$pmpro_db_version)
18
+ $pmpro_db_version = pmpro_upgrade_1();
19
+
20
if($pmpro_db_version < 1.115)
21
+ $pmpro_db_version = pmpro_upgrade_1_1_15();
22
+
23
if($pmpro_db_version < 1.23)
24
+ $pmpro_db_version = pmpro_upgrade_1_2_3();
25
+
26
if($pmpro_db_version < 1.318)
27
$pmpro_db_version = pmpro_upgrade_1_3_18();
28
+
29
if($pmpro_db_version < 1.4)
30
$pmpro_db_version = pmpro_upgrade_1_4();
31
+
32
if($pmpro_db_version < 1.42)
33
$pmpro_db_version = pmpro_upgrade_1_4_2();
34
+
35
if($pmpro_db_version < 1.48)
36
$pmpro_db_version = pmpro_upgrade_1_4_8();
37
38
if($pmpro_db_version < 1.5)
39
$pmpro_db_version = pmpro_upgrade_1_5();
40
+
41
if($pmpro_db_version < 1.59)
42
$pmpro_db_version = pmpro_upgrade_1_5_9();
43
+
44
if($pmpro_db_version < 1.6)
45
$pmpro_db_version = pmpro_upgrade_1_6();
46
+
47
//fix for fresh 1.7 installs
48
if($pmpro_db_version == 1.7)
49
{
50
//check if we have an id column in the memberships_users table
51
$wpdb->pmpro_memberships_users = $wpdb->prefix . 'pmpro_memberships_users';
52
+ $col = $wpdb->get_var("SELECT id FROM $wpdb->pmpro_memberships_users LIMIT 1");
53
if($wpdb->last_error == "Unknown column 'id' in 'field list'")
54
+ {
55
//redo 1.5 fix
56
pmpro_upgrade_1_5();
57
}
58
+
59
pmpro_db_delta();
60
+
61
pmpro_setOption("db_version", "1.703");
62
$pmpro_db_version = 1.703;
63
}
64
+
65
//updates from this point on should be like this if DB only
66
if($pmpro_db_version < 1.71)
67
{
69
pmpro_setOption("db_version", "1.71");
70
$pmpro_db_version = 1.71;
71
}
72
+
73
if($pmpro_db_version < 1.72)
74
+ {
75
//schedule the credit card expiring cron
76
wp_schedule_event(current_time('timestamp'), 'monthly', 'pmpro_cron_credit_card_expiring_warnings');
77
+
78
pmpro_setOption("db_version", "1.72");
79
$pmpro_db_version = 1.72;
80
}
81
+
82
/*
83
1.7.3
84
- default Stripe Billing Fields to true
85
- unless Stripe Lite is activated, then deactivate Stripe Lite and set Stripe Billing Fields to false
86
*/
87
+
88
if($pmpro_db_version < 1.79)
89
{
90
//need to register caps for menu
91
pmpro_activation();
92
+
93
pmpro_setOption("db_version", "1.79");
94
$pmpro_db_version = 1.79;
95
}
96
+
97
//set default filter_queries setting
98
if($pmpro_db_version < 1.791)
99
{
101
pmpro_setOption("filterqueries", 1);
102
else
103
pmpro_SetOption("filterqueries", 0);
104
+
105
pmpro_setOption("db_version", "1.791");
106
$pmpro_db_version = 1.791;
107
}
108
+
109
+ //add level meta table
110
+ /*
111
+ if($pmpro_db_version < 1.87) {
112
+
113
+ pmpro_db_delta();
114
+ pmpro_upgrade_1_8_7();
115
+
116
+ pmpro_setOption("db_version", "1.87");
117
+ $pmpro_db_version = 1.87;
118
+ }
119
+ */
120
+ }
121
+
122
+ function pmpro_upgrade_1_8_7() {
123
+
124
+ /*
125
+ Additional upgrade scripts will go here or we will remove it.
126
+ */
127
+ return 1.87;
128
}
129
130
function pmpro_upgrade_1_7()
140
global $wpdb;
141
$wpdb->hide_errors();
142
$wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
143
+
144
//add notes column to orders
145
$sqlQuery = "ALTER TABLE `" . $wpdb->pmpro_membership_orders . "` ADD `notes` TEXT NOT NULL";
146
$wpdb->query($sqlQuery);
147
+
148
pmpro_setOption("db_version", "1.6");
149
return 1.6;
150
}
158
//fix firstpayment statuses
159
$sqlQuery = "UPDATE " . $wpdb->pmpro_membership_orders . " SET status = 'success' WHERE status = 'firstpayment'";
160
$wpdb->query($sqlQuery);
161
+
162
pmpro_setOption("db_version", "1.59");
163
return 1.59;
164
}
194
/*
195
Adding a billing_country field to the orders table.
196
*/
197
+
198
global $wpdb;
199
$wpdb->hide_errors();
200
$wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
201
+
202
//billing_country
203
$sqlQuery = "
204
ALTER TABLE `" . $wpdb->pmpro_membership_orders . "` ADD `billing_country` VARCHAR( 128 ) NOT NULL AFTER `billing_zip`
205
";
206
$wpdb->query($sqlQuery);
207
+
208
pmpro_setOption("db_version", "1.48");
209
return 1.48;
210
}
221
pmpro_setOption("use_ssl", 1);
222
else
223
pmpro_setOption("use_ssl", 0);
224
+
225
pmpro_setOption("db_version", "1.42");
226
return 1.42;
227
}
231
global $wpdb;
232
$wpdb->hide_errors();
233
$wpdb->pmpro_membership_levels = $wpdb->prefix . 'pmpro_membership_levels';
234
+
235
//confirmation message
236
$sqlQuery = "
237
ALTER TABLE `" . $wpdb->pmpro_membership_levels . "` ADD `confirmation` LONGTEXT NOT NULL AFTER `description`
238
";
239
$wpdb->query($sqlQuery);
240
+
241
pmpro_setOption("db_version", "1.4");
242
return 1.4;
243
}
250
pmpro_setOption("email_admin_cancels", "1");
251
pmpro_setOption("email_admin_billing", "1");
252
253
+ pmpro_setOption("db_version", "1.318");
254
return 1.318;
255
}
256
265
$wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
266
$wpdb->pmpro_discount_codes = $wpdb->prefix . 'pmpro_discount_codes';
267
$wpdb->pmpro_discount_codes_levels = $wpdb->prefix . 'pmpro_discount_codes_levels';
268
+ $wpdb->pmpro_discount_codes_uses = $wpdb->prefix . 'pmpro_discount_codes_uses';
269
+
270
//expiration number and period for levels
271
$sqlQuery = "
272
ALTER TABLE `" . $wpdb->pmpro_membership_levels . "` ADD `expiration_number` INT UNSIGNED NOT NULL ,
273
ADD `expiration_period` ENUM( 'Day', 'Week', 'Month', 'Year' ) NOT NULL
274
";
275
$wpdb->query($sqlQuery);
276
+
277
//expiration number and period for discount code levels
278
$sqlQuery = "
279
ALTER TABLE `" . $wpdb->pmpro_discount_codes_levels . "` ADD `expiration_number` INT UNSIGNED NOT NULL ,
280
ADD `expiration_period` ENUM( 'Day', 'Week', 'Month', 'Year' ) NOT NULL
281
";
282
+ $wpdb->query($sqlQuery);
283
+
284
//end date for members
285
$sqlQuery = "
286
ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` ADD `enddate` DATETIME NULL AFTER `startdate`
287
";
288
$wpdb->query($sqlQuery);
289
+
290
$sqlQuery = "
291
ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` ADD INDEX ( `enddate` )
292
";
293
$wpdb->query($sqlQuery);
294
+
295
+ pmpro_setOption("db_version", "1.23");
296
return 1.23;
297
}
298
299
function pmpro_upgrade_1_1_15()
300
+ {
301
/*
302
DB table setup
303
*/
310
$wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
311
$wpdb->pmpro_discount_codes = $wpdb->prefix . 'pmpro_discount_codes';
312
$wpdb->pmpro_discount_codes_levels = $wpdb->prefix . 'pmpro_discount_codes_levels';
313
+ $wpdb->pmpro_discount_codes_uses = $wpdb->prefix . 'pmpro_discount_codes_uses';
314
+
315
/*
316
Changing some id columns to unsigned.
317
*/
319
ALTER TABLE `" . $wpdb->pmpro_membership_levels . "` CHANGE `id` `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT
320
";
321
$wpdb->query($sqlQuery);
322
+
323
$sqlQuery = "
324
ALTER TABLE `" . $wpdb->pmpro_memberships_categories . "` CHANGE `membership_id` `membership_id` INT( 11 ) UNSIGNED NOT NULL
325
";
326
$wpdb->query($sqlQuery);
327
+
328
$sqlQuery = "
329
ALTER TABLE `" . $wpdb->pmpro_memberships_categories . "` CHANGE `category_id` `category_id` INT( 11 ) UNSIGNED NOT NULL
330
";
331
$wpdb->query($sqlQuery);
332
+
333
$sqlQuery = "
334
ALTER TABLE `" . $wpdb->pmpro_memberships_pages . "` CHANGE `membership_id` `membership_id` INT( 11 ) UNSIGNED NOT NULL
335
";
336
$wpdb->query($sqlQuery);
337
+
338
$sqlQuery = "
339
ALTER TABLE `" . $wpdb->pmpro_memberships_pages . "` CHANGE `page_id` `page_id` INT( 11 ) UNSIGNED NOT NULL
340
";
341
$wpdb->query($sqlQuery);
342
+
343
$sqlQuery = "
344
ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` CHANGE `user_id` `user_id` INT( 11 ) UNSIGNED NOT NULL
345
";
346
$wpdb->query($sqlQuery);
347
+
348
$sqlQuery = "
349
ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` CHANGE `membership_id` `membership_id` INT( 11 ) UNSIGNED NOT NULL
350
";
351
$wpdb->query($sqlQuery);
352
+
353
$sqlQuery = "
354
ALTER TABLE `" . $wpdb->pmpro_membership_orders . "` CHANGE `id` `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT
355
";
356
$wpdb->query($sqlQuery);
357
+
358
$sqlQuery = "
359
ALTER TABLE `" . $wpdb->pmpro_membership_orders . "` CHANGE `user_id` `user_id` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0'
360
";
361
$wpdb->query($sqlQuery);
362
+
363
$sqlQuery = "
364
ALTER TABLE `" . $wpdb->pmpro_membership_orders . "` CHANGE `membership_id` `membership_id` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0'
365
";
366
$wpdb->query($sqlQuery);
367
+
368
$sqlQuery = "
369
ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` ADD `code_id` INT UNSIGNED NOT NULL AFTER `membership_id` ;
370
";
371
$wpdb->query($sqlQuery);
372
+
373
$sqlQuery = "
374
ALTER TABLE `" . $wpdb->pmpro_memberships_users . "` ADD INDEX ( `code_id` )
375
";
376
+ $wpdb->query($sqlQuery);
377
+
378
/*
379
New tables for discount codes
380
*/
381
+
382
//wp_pmpro_discount_codes
383
$sqlQuery = "
384
CREATE TABLE `" . $wpdb->pmpro_discount_codes . "` (
391
UNIQUE KEY `code` (`code`),
392
KEY `starts` (`starts`),
393
KEY `expires` (`expires`)
394
+ );
395
";
396
+ $wpdb->query($sqlQuery);
397
398
//wp_pmpro_discount_codes_levels
399
$sqlQuery = "
409
`trial_limit` int(11) NOT NULL DEFAULT '0',
410
PRIMARY KEY (`code_id`,`level_id`),
411
KEY `initial_payment` (`initial_payment`)
412
+ );
413
";
414
+ $wpdb->query($sqlQuery);
415
416
//wp_pmpro_discount_codes_uses
417
$sqlQuery = "
424
PRIMARY KEY (`id`),
425
KEY `user_id` (`user_id`),
426
KEY `timestamp` (`timestamp`)
427
+ );
428
";
429
$wpdb->query($sqlQuery);
430
+
431
pmpro_setOption("db_version", "1.115");
432
+
433
//do the next update
434
return pmpro_upgrade_1_2_2();
435
}
436
437
function pmpro_upgrade_1()
438
+ {
439
/*
440
default options
441
*/
442
$nonmembertext = sprintf( __( 'This content is for !!levels!! members only.<br /><a href="%s">Register</a>', 'pmpro' ), wp_login_url() . "?action=register" );
443
pmpro_setOption("nonmembertext", $nonmembertext);
444
+
445
$notloggedintext = sprintf( __( 'This content is for !!levels!! members only.<br /><a href="%s">Log In</a> <a href="%s">Register</a>', 'pmpro' ), wp_login_url(), wp_login_url() . "?action=register" );
446
'?action=register">Register</a>';
447
pmpro_setOption("notloggedintext", $notloggedintext);
448
+
449
$rsstext = __( "This content is for !!levels!! members only. Visit the site and log in/register to read.", 'pmpro' );
450
pmpro_setOption("rsstext", $rsstext);
451
+
452
$gateway_environment = "sandbox";
453
pmpro_setOption("gateway_environment", $gateway_environment);
454
+
455
$pmpro_currency = "USD";
456
pmpro_setOption("currency", $pmpro_currency);
457
+
458
$pmpro_accepted_credit_cards = "Visa,Mastercard,American Express,Discover";
459
+ pmpro_setOption("accepted_credit_cards", $pmpro_accepted_credit_cards);
460
+
461
+ $parsed = parse_url(home_url());
462
$hostname = $parsed['host'];
463
$hostparts = explode(".", $hostname);
464
+ $email_domain = $hostparts[count($hostparts) - 2] . "." . $hostparts[count($hostparts) - 1];
465
$from_email = "wordpress@" . $email_domain;
466
pmpro_setOption("from_email", $from_email);
467
+
468
$from_name = "WordPress";
469
+ pmpro_setOption("from_name", $from_name);
470
+
471
//setting new email settings defaults
472
pmpro_setOption("email_admin_checkout", "1");
473
pmpro_setOption("email_admin_changes", "1");
474
pmpro_setOption("email_admin_cancels", "1");
475
pmpro_setOption("email_admin_billing", "1");
476
+
477
+ pmpro_setOption("tospage", "");
478
+
479
//db update
480
+ pmpro_db_delta();
481
+
482
//update version and return
483
pmpro_setOption("db_version", "1.71"); //no need to run other updates
484
return 1.71;
487
function pmpro_db_delta()
488
{
489
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
490
+
491
global $wpdb;
492
$wpdb->hide_errors();
493
$wpdb->pmpro_membership_levels = $wpdb->prefix . 'pmpro_membership_levels';
497
$wpdb->pmpro_membership_orders = $wpdb->prefix . 'pmpro_membership_orders';
498
$wpdb->pmpro_discount_codes = $wpdb->prefix . 'pmpro_discount_codes';
499
$wpdb->pmpro_discount_codes_levels = $wpdb->prefix . 'pmpro_discount_codes_levels';
500
+ $wpdb->pmpro_discount_codes_uses = $wpdb->prefix . 'pmpro_discount_codes_uses';
501
+ $wpdb->pmpro_membership_levelmeta = $wpdb->prefix . 'pmpro_membership_levelmeta';
502
+
503
//wp_pmpro_membership_levels
504
$sqlQuery = "
505
CREATE TABLE `" . $wpdb->pmpro_membership_levels . "` (
524
);
525
";
526
dbDelta($sqlQuery);
527
+
528
//wp_pmpro_membership_orders
529
$sqlQuery = "
530
CREATE TABLE `" . $wpdb->pmpro_membership_orders . "` (
577
);
578
";
579
dbDelta($sqlQuery);
580
+
581
//wp_pmpro_memberships_categories
582
$sqlQuery = "
583
CREATE TABLE `" . $wpdb->pmpro_memberships_categories . "` (
589
);
590
";
591
dbDelta($sqlQuery);
592
+
593
//wp_pmpro_memberships_pages
594
$sqlQuery = "
595
CREATE TABLE `" . $wpdb->pmpro_memberships_pages . "` (
601
);
602
";
603
dbDelta($sqlQuery);
604
+
605
//wp_pmpro_memberships_users
606
$sqlQuery = "
607
CREATE TABLE `" . $wpdb->pmpro_memberships_users . "` (
629
KEY `status` (`status`)
630
);
631
";
632
+ dbDelta($sqlQuery);
633
+
634
//wp_pmpro_discount_codes
635
$sqlQuery = "
636
CREATE TABLE `" . $wpdb->pmpro_discount_codes . "` (
645
KEY `expires` (`expires`)
646
);
647
";
648
+ dbDelta($sqlQuery);
649
650
//wp_pmpro_discount_codes_levels
651
$sqlQuery = "
665
KEY `initial_payment` (`initial_payment`)
666
);
667
";
668
+ dbDelta($sqlQuery);
669
670
//wp_pmpro_discount_codes_uses
671
$sqlQuery = "
681
);
682
";
683
dbDelta($sqlQuery);
684
+
685
+ //pmpro_membership_levelmeta
686
+ $sqlQuery = "
687
+ CREATE TABLE `" . $wpdb->pmpro_membership_levelmeta . "` (
688
+ `meta_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
689
+ `pmpro_membership_level_id` int(10) unsigned NOT NULL,
690
+ `meta_key` varchar(255) NOT NULL,
691
+ `meta_value` longtext,
692
+ PRIMARY KEY (`meta_id`),
693
+ KEY (`pmpro_membership_level_id`),
694
+ KEY (`meta_key`)
695
+ );
696
+ ";
697
+ dbDelta($sqlQuery);
698
}
languages/email/el/admin_change.html ADDED
@@ -0,0 +1,7 @@
1
+ <p>Ένας διαχειρστής στο !!sitename!! άλλαξε το επίπεδο συνδρομής σας.</p>
2
+
3
+ <p>!!membership_change!!.</p>
4
+
5
+ <p>Εάν δεν ζητήσατε αυτή την αλλαγή και χρειάζεστε περισσότερες πληρογορίες παρακαλώ επικοινωνήστε στο !!siteemail!!</p>
6
+
7
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/admin_change_admin.html ADDED
@@ -0,0 +1,5 @@
1
+ <p>Ένας διαχειριστής στο !!sitename!! άλλαξε το επίπεδο συνδρομής του/της !!name!!.</p>
2
+
3
+ <p>!!membership_change!!.</p>
4
+
5
+ <p>Συνδεθείτε εδώ: !!login_link!!</p>
languages/email/el/billable_invoice.html ADDED
@@ -0,0 +1,6 @@
1
+ <p>Ευχαριστούμε για τη συνδρομή σου στο !!sitename!!. Παρακάτω θα βρεις το τιμολόγιο της παραγγελίας #: !!order_code!!</p>
2
+
3
+ !!invoice!!
4
+
5
+ <p>Συνδέσου εδώ: !!login_link!!</p>
6
+ <p>Για να δεις ένα αντίγραφο του τιμολογίου online, πάτα εδώ: !!invoice_link!!</p>
languages/email/el/billing.html ADDED
@@ -0,0 +1,16 @@
1
+ <p>Οι πληροφορίες χρέωσης στο !!sitename!! άλλαξαν.</p>
2
+
3
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
4
+ <p>
5
+ Πληροφορίες χρέωσης:<br />
6
+ !!billing_address!!
7
+ </p>
8
+
9
+ <p>
10
+ !!cardtype!!: !!accountnumber!!<br />
11
+ Λήξη: !!expirationmonth!!/!!expirationyear!!
12
+ </p>
13
+
14
+ <p>Εάν δεν ζήτησες αλλαγή των στοιχείων σου, παρακαλώ επικοινώνησε μαζί μας στο !!siteemail!!</p>
15
+
16
+ <p>Συνδέσου στο λογαριασμό σου εδώ: !!login_link!!</p>
languages/email/el/billing_admin.html ADDED
@@ -0,0 +1,17 @@
1
+ <p>Οι πληροφορίες χρέωσης του/της !!display_name!! στο !!sitename!! άλλαξαν.</p>
2
+
3
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
4
+ <p>
5
+ Πληροφορίες χρέωσης:<br />
6
+ !!billing_name!!<br />
7
+ !!billing_street!!<br />
8
+ !!billing_city!!, !!billing_state!! !!billing_zip!! !!billing_country!!
9
+ !!billing_phone!!
10
+ </p>
11
+
12
+ <p>
13
+ !!cardtype!!: !!accountnumber!!<br />
14
+ Λήξη: !!expirationmonth!!/!!expirationyear!!
15
+ </p>
16
+
17
+ <p>Συνδέσου στο λογαριασμό σου εδώ: !!login_link!!</p>
languages/email/el/billing_failure.html ADDED
@@ -0,0 +1,11 @@
1
+ <p>Η τρέχουσα πληρωμή συνδρομής στο !!sitename!! απέτυχε. <strong>Παρακαλώ πάτα στον επόμενο σύνδεσμο για να συνδεθείς και να ανανεώσεις τις πληροφορίες σύνδεσής σου για να αποφύγεις πάγωμα του λογαριασμού σου. !!login_link!!</strong></p>
2
+
3
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
4
+ <p>Οι πιο πρόσφατες πληροφορίες λογαριασμού που έχουμε είναι:</p>
5
+
6
+ <p>!!billing_address!!</p>
7
+
8
+ <p>
9
+ !!cardtype!!: !!accountnumber!!<br />
10
+ Λήξη: !!expirationmonth!!/!!expirationyear!!
11
+ </p>
languages/email/el/billing_failure_admin.html ADDED
@@ -0,0 +1,11 @@
1
+ <p>Αποτυχία πληρωμής</p>
2
+
3
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
4
+ <p>Οι πιο πρόσφατες πληροφορίες λογαριασμού που έχουμε είναι:</p>
5
+
6
+ <p>!!billing_address!!</p>
7
+
8
+ <p>
9
+ !!cardtype!!: !!accountnumber!!<br />
10
+ Λήξη: !!expirationmonth!!/!!expirationyear!!
11
+ </p>
languages/email/el/cancel.html ADDED
@@ -0,0 +1,3 @@
1
+ <p>Η συνδρομή σου στο !!sitename!! ακυρώθηκε.</p>
2
+
3
+ <p>Εάν δεν ζήτησες την ακύρωση, παρακαλώ επικοινώνησε μαζί μας στο !!siteemail!!</p>
languages/email/el/cancel_admin.html ADDED
@@ -0,0 +1,8 @@
1
+ <p>Η συνδρομή του/της !!user_login!! στο !!sitename!! ακυρώθηκε.</p>
2
+
3
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
4
+ <p>Επίπεδο συνδρομής: !!membership_level_name!!</p>
5
+ <p>Ημερομηνία έναρξης: !!startdate!!</p>
6
+ <p>Ημερομηνία ακύρωσης: !!enddate!!</p>
7
+
8
+ <p>Συνδέσου στο λογαριασμό σου εδώ: !!login_link!!</p>
languages/email/el/checkout_check.html ADDED
@@ -0,0 +1,17 @@
1
+ <p>Ευχαριστούμε για τη συνδρομή σας στο !!sitename!!. Ο συνδρομητικός λογαριασμός σας είναι τώρα ενεργός.</p>
2
+
3
+ !!instructions!!
4
+
5
+ <p>Παρακάτω βρίσκονται λεπτομέρειες της νέας συνδρομής και μια απόδειξη του αρχικού τιμολογίου.</p>
6
+
7
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
8
+ <p>Επίπεδο λογαριασμού: !!membership_level_name!!</p>
9
+ <p>Κόστος συνδρομής: !!membership_cost!!</p>
10
+ !!membership_expiration!! !!discount_code!!
11
+
12
+ <p>
13
+ Τιμολόγιο #!!invoice_id!! στις !!invoice_date!!<br />
14
+ Συνολικό κόστος: !!invoice_total!!
15
+ </p>
16
+
17
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/checkout_check_admin.html ADDED
@@ -0,0 +1,17 @@
1
+ <p>Νέα συνδρομή στο !!sitename!!.</p>
2
+
3
+ <p><strong>Επέλεξε να πληρώσει με επιταγή.</strong></p>
4
+
5
+ <p>Παρακάτω βρίσκονται λεπτομέρειες της νέας συνδρομής και μια απόδειξη του αρχικού τιμολογίου.</p>
6
+
7
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
8
+ <p>Επίπεδο συνδρομής: !!membership_level_name!!</p>
9
+ <p>Κόστος συνδρομής: !!membership_cost!!</p>
10
+ !!membership_expiration!! !!discount_code!!
11
+
12
+ <p>
13
+ Τιμολόγιο #!!invoice_id!! στις !!invoice_date!!<br />
14
+ Συνολική χρέωση: $!!invoice_total!!
15
+ </p>
16
+
17
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/checkout_express.html ADDED
@@ -0,0 +1,15 @@
1
+ <p>Ευχαριστούμε για τη συνδρομή σας στο !!sitename!!. Ο συνδρομητικός λογαριασμός σας είναι τώρα ενεργός.</p>
2
+
3
+ <p>Παρακάτω βρίσκονται λεπτομέρειες της νέας συνδρομής και μια απόδειξη του αρχικού τιμολογίου.</p>
4
+
5
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
6
+ <p>Επίπεδο λογαριασμού: !!membership_level_name!!</p>
7
+ <p>Κόστος συνδρομής: !!membership_cost!!</p>
8
+ !!membership_expiration!! !!discount_code!!
9
+
10
+ <p>
11
+ Τιμολόγιο #!!invoice_id!! στις !!invoice_date!!<br />
12
+ Συνολικό κόστος: !!invoice_total!!
13
+ </p>
14
+
15
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/checkout_express_admin.html ADDED
@@ -0,0 +1,15 @@
1
+ <p>Νέα συνδρομή στο !!sitename!!.</p>
2
+
3
+ <p>Παρακάτω βρίσκονται λεπτομέρειες της νέας συνδρομής και μια απόδειξη του αρχικού τιμολογίου.</p>
4
+
5
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
6
+ <p>Επίπεδο συνδρομής: !!membership_level_name!!</p>
7
+ <p>Κόστος συνδρομής: !!membership_cost!!</p>
8
+ !!membership_expiration!! !!discount_code!!
9
+
10
+ <p>
11
+ Τιμολόγιο #!!invoice_id!! στις !!invoice_date!!<br />
12
+ Συνολική χρέωση: $!!invoice_total!!
13
+ </p>
14
+
15
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/checkout_free.html ADDED
@@ -0,0 +1,9 @@
1
+ <p>Ευχαριστούμε για τη συνδρομή σας στο !!sitename!!. Ο συνδρομητικός λογαριασμός σας είναι τώρα ενεργός.</p>
2
+
3
+ <p>Παρακάτω βρίσκονται λεπτομέρειες της νέας συνδρομής και μια απόδειξη του αρχικού τιμολογίου.</p>
4
+
5
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
6
+ <p>Επίπεδο λογαριασμού: !!membership_level_name!!</p>
7
+ !!membership_expiration!! !!discount_code!!
8
+
9
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/checkout_free_admin.html ADDED
@@ -0,0 +1,9 @@
1
+ <p>Νέα συνδρομή στο !!sitename!!.</p>
2
+
3
+ <p>Παρακάτω βρίσκονται λεπτομέρειες της νέας συνδρομής και μια απόδειξη του αρχικού τιμολογίου.</p>
4
+
5
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
6
+ <p>Επίπεδο συνδρομής: !!membership_level_name!!</p>
7
+ !!membership_expiration!! !!discount_code!!
8
+
9
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/checkout_freetrial.html ADDED
@@ -0,0 +1,20 @@
1
+ <p>Ευχαριστούμε για τη συνδρομή σας στο !!sitename!!. Ο συνδρομητικός λογαριασμός σας είναι τώρα ενεργός.</p>
2
+
3
+ <p>Παρακάτω βρίσκονται λεπτομέρειες της νέας συνδρομής και μια απόδειξη του αρχικού τιμολογίου.</p>
4
+
5
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
6
+ <p>Επίπεδο λογαριασμού: !!membership_level_name!!</p>
7
+ <p>Κόστος συνδρομής: !!membership_cost!!</p>
8
+ !!membership_expiration!! !!discount_code!!
9
+
10
+ <p>
11
+ Αρχείο πληροφοριών χρέωσης:<br />
12
+ !!billing_address!!
13
+ </p>
14
+
15
+ <p>
16
+ !!cardtype!!: !!accountnumber!!<br />
17
+ Λήξη: !!expirationmonth!!/!!expirationyear!!
18
+ </p>
19
+
20
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/checkout_freetrial_admin.html ADDED
@@ -0,0 +1,20 @@
1
+ <p>Νέα συνδρομή στο !!sitename!!.</p>
2
+
3
+ <p>Παρακάτω βρίσκονται λεπτομέρειες της νέας συνδρομής και μια απόδειξη του αρχικού τιμολογίου.</p>
4
+
5
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
6
+ <p>Επίπεδο συνδρομής: !!membership_level_name!!</p>
7
+ <p>Κόστος συνδρομής: !!membership_cost!!</p>
8
+ !!membership_expiration!! !!discount_code!!
9
+
10
+ <p>
11
+ Αρχείο πληροφοριών χρέωσης:<br />
12
+ !!billing_address!!
13
+ </p>
14
+
15
+ <p>
16
+ !!cardtype!!: !!accountnumber!!<br />
17
+ Λήξη: !!expirationmonth!!/!!expirationyear!!
18
+ </p>
19
+
20
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/checkout_paid.html ADDED
@@ -0,0 +1,25 @@
1
+ <p>Ευχαριστούμε για τη συνδρομή σας στο !!sitename!!. Ο συνδρομητικός λογαριασμός σας είναι τώρα ενεργός.</p>
2
+
3
+ <p>Παρακάτω βρίσκονται λεπτομέρειες της νέας συνδρομής και μια απόδειξη του αρχικού τιμολογίου.</p>
4
+
5
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
6
+ <p>Επίπεδο λογαριασμού: !!membership_level_name!!</p>
7
+ <p>Κόστος συνδρομής: !!membership_cost!!</p>
8
+ !!membership_expiration!! !!discount_code!!
9
+
10
+ <p>
11
+ Τιμολόγιο #!!invoice_id!! στις !!invoice_date!!<br />
12
+ Συνολική χρέωση: $!!invoice_total!!
13
+ </p>
14
+
15
+ <p>
16
+ Αρχείο πληροφοριών χρέωσης:<br />
17
+ !!billing_address!!
18
+ </p>
19
+
20
+ <p>
21
+ !!cardtype!!: !!accountnumber!!<br />
22
+ Λήξη: !!expirationmonth!!/!!expirationyear!!
23
+ </p>
24
+
25
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/checkout_paid_admin.html ADDED
@@ -0,0 +1,25 @@
1
+ <p>Νέα συνδρομή στο !!sitename!!.</p>
2
+
3
+ <p>Παρακάτω βρίσκονται λεπτομέρειες της νέας συνδρομής και μια απόδειξη του αρχικού τιμολογίου.</p>
4
+
5
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
6
+ <p>Επίπεδο συνδρομής: !!membership_level_name!!</p>
7
+ <p>Κόστος συνδρομής: !!membership_cost!!</p>
8
+ !!membership_expiration!! !!discount_code!!
9
+
10
+ <p>
11
+ Τιμολόγιο #!!invoice_id!! στις !!invoice_date!!<br />
12
+ Συνολική χρέωση: $!!invoice_total!!
13
+ </p>
14
+
15
+ <p>
16
+ Πληροφορίες χρέωσης:<br />
17
+ !!billing_address!!
18
+ </p>
19
+
20
+ <p>
21
+ !!cardtype!!: !!accountnumber!!<br />
22
+ Λήξη: !!expirationmonth!!/!!expirationyear!!
23
+ </p>
24
+
25
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/checkout_trial.html ADDED
@@ -0,0 +1,25 @@
1
+ <p>Ευχαριστούμε για τη συνδρομή σας στο !!sitename!!. Ο συνδρομητικός λογαριασμός σας είναι τώρα ενεργός.</p>
2
+
3
+ <p>Παρακάτω βρίσκονται λεπτομέρειες της νέας συνδρομής και μια απόδειξη του αρχικού τιμολογίου.</p>
4
+
5
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
6
+ <p>Επίπεδο λογαριασμού: !!membership_level_name!!</p>
7
+ <p>Κόστος συνδρομής: !!membership_cost!!</p>
8
+ !!membership_expiration!! !!discount_code!!
9
+
10
+ <p>
11
+ Τιμολόγιο #!!invoice_id!! στις !!invoice_date!!<br />
12
+ Συνολική χρέωση: $!!invoice_total!!
13
+ </p>
14
+
15
+ <p>
16
+ Αρχείο πληροφοριών χρέωσης:<br />
17
+ !!billing_address!!
18
+ </p>
19
+
20
+ <p>
21
+ !!cardtype!!: !!accountnumber!!<br />
22
+ Λήξη: !!expirationmonth!!/!!expirationyear!!
23
+ </p>
24
+
25
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/checkout_trial_admin.html ADDED
@@ -0,0 +1,25 @@
1
+ <p>Νέα συνδρομή στο !!sitename!!.</p>
2
+
3
+ <p>Παρακάτω βρίσκονται λεπτομέρειες της νέας συνδρομής και μια απόδειξη του αρχικού τιμολογίου.</p>
4
+
5
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
6
+ <p>Επίπεδο συνδρομής: !!membership_level_name!!</p>
7
+ <p>Κόστος συνδρομής: !!membership_cost!!</p>
8
+ !!membership_expiration!! !!discount_code!!
9
+
10
+ <p>
11
+ Τιμολόγιο #!!invoice_id!! στις !!invoice_date!!<br />
12
+ Συνολική χρέωση: $!!invoice_total!!
13
+ </p>
14
+
15
+ <p>
16
+ Πληροφορίες χρέωσης:<br />
17
+ !!billing_address!!
18
+ </p>
19
+
20
+ <p>
21
+ !!cardtype!!: !!accountnumber!!<br />
22
+ Λήξη: !!expirationmonth!!/!!expirationyear!!
23
+ </p>
24
+
25
+ <p>Συνδεθείτε στο λογαριασμό σας εδώ: !!login_link!!</p>
languages/email/el/credit_card_expiring.html ADDED
@@ -0,0 +1,13 @@
1
+ <p>Ο τρόπος πληρωμής που χρησιμοποιείς για τη συνδρομή σου στο !!sitename!! θα λήξει σύντομα. <strong>Παρακαλώ πάτησε στον επόμενο σύνδεσμο για να συνδεθείς και να ανανεώσεις της πληροφορίες χρέωσής σου για να αποφύγεις το πάγωμα της συνδρομής σου. !!login_link!!</strong></p>
2
+
3
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
4
+ <p>Οι πιο πρόσφατες πληροφορίες χρέωσης που έχουμε είναι:</p>
5
+
6
+ <p>!!billing_name!!</br />
7
+ !!billing_address!!
8
+ </p>
9
+
10
+ <p>
11
+ !!cardtype!!: !!accountnumber!!<br />
12
+ Λήξη: !!expirationmonth!!/!!expirationyear!!
13
+ </p>
languages/email/el/default.html ADDED
@@ -0,0 +1 @@
1
+ !!body!!
languages/email/el/footer.html ADDED
@@ -0,0 +1,4 @@
1
+ <p>
2
+ Η ομάδα του,<br />
3
+ !!sitename!!
4
+ </p>
languages/email/el/header.html ADDED
@@ -0,0 +1 @@
1
+ <p>Αγαπητέ !!name!!,</p>
languages/email/el/invoice.html ADDED
@@ -0,0 +1,19 @@
1
+ <p>Ευχαριστούμε πολύ για τη συνδρομή σου στο !!sitename!!. Παρακάτω βρίσκεται μία απόδειξη του πιο πρόσφατου τιμολογίου συνδρομής.</p>
2
+
3
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
4
+ <p>
5
+ Τιμολόγιο #!!invoice_id!! στις !!invoice_date!!<br />
6
+ Συνολική χρέωση: !!invoice_total!!
7
+ </p>
8
+ <p>
9
+ Πληροφορίες χρέωσης:<br />
10
+ !!billing_address!!
11
+ </p>
12
+
13
+ <p>
14
+ !!cardtype!!: !!accountnumber!!<br />
15
+ Λήξη: !!expirationmonth!!/!!expirationyear!!
16
+ </p>
17
+
18
+ <p>Συνδέσου στο λογαριασμό σου εδώ: !!login_link!!</p>
19
+ <p>Για να δεις μία online έκδοση του τιμολογίου, παρακαλώ πάτα εδώ: !!invoice_link!!</p>
languages/email/el/membership_expired.html ADDED
@@ -0,0 +1,7 @@
1
+ <p>Η συνδρομή σου στο !!sitename!! έληξε.</p>
2
+
3
+ <p>Ευχαριστούμε πολύ για την στήριξή σου.</p>
4
+
5
+ <p>Μπορείς να δεις τα τρέχοντα επίπεδα συνδρομών μας εδώ: !!levels_link!!</p>
6
+
7
+ <p>Συνδέσου στο λογαριασμό σου εδώ: !!login_link!!</p>
languages/email/el/membership_expiring.html ADDED
@@ -0,0 +1,6 @@
1
+ <p>Ευχαριστούμε για τη συνδρομή σου στο !!sitename!!. Αυτό είναι απλά μία υπενθύμιση ότι η συνδρομή σου θα λήξει στις !!enddate!!.</p>
2
+
3
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
4
+ <p>Επίπεδο συνδρομής: !!membership_level_name!!</p>
5
+
6
+ <p>Συνδέσου στο λογαριασμό σου εδώ: !!login_link!!</p>
languages/email/el/trial_ending.html ADDED
@@ -0,0 +1,8 @@
1
+ <p>Ευχαριστούμε για τη συνδρομή σου στο !!sitename!!. Η δοκιμαστική περίοδος θα λήξει στις !!enddate!!.</p>
2
+
3
+ <p>Λογαριασμός: !!display_name!! (!!user_email!!)</p>
4
+ <p>Επίπεδο συνδρομής: !!membership_level_name!!</p>
5
+
6
+ <p>Το κόστος θα αλλάξει από !!trial_amount!! σε !!billing_amount!! κάθε !!cycle_number!! !!cycle_period!!(s).</p>
7
+
8
+ <p>Συνδέσου στο λογαριασμό σου εδώ: !!login_link!!</p>
languages/pmpro.mo CHANGED
Binary file
languages/pmpro.po CHANGED
@@ -1,14 +1,17 @@
1
#
2
- # Hi there! Details on how to help out translating Paid Memberships Pro can be found at:
3
- # http://www.paidmembershipspro.com/documentation/languages/
4
- #
5
msgid ""
6
msgstr ""
7
- "Project-Id-Version: pmpro\n"
8
- "POT-Creation-Date: 2015-09-04 12:26-0400\n"
9
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
10
- "Last-Translator: \n"
11
- "Language-Team: Stranger Studios <jason@strangerstudios.com>\n"
12
"MIME-Version: 1.0\n"
13
"Content-Type: text/plain; charset=UTF-8\n"
14
"Content-Transfer-Encoding: 8bit\n"
@@ -17,161 +20,185 @@ msgstr ""
17
#: adminpages/discountcodes.php:5 adminpages/emailsettings.php:5
18
#: adminpages/membershiplevels.php:5 adminpages/memberslist-csv.php:5
19
#: adminpages/memberslist.php:5 adminpages/orders-csv.php:5
20
- #: adminpages/orders.php:5 adminpages/pagesettings.php:4
21
- #: adminpages/paymentsettings.php:5 includes/license.php:36
22
- #: adminpages/addons.php:5 adminpages/addons.php:21
23
#: adminpages/advancedsettings.php:5 adminpages/discountcodes.php:5
24
#: adminpages/emailsettings.php:5 adminpages/membershiplevels.php:5
25
#: adminpages/memberslist-csv.php:5 adminpages/memberslist.php:5
26
#: adminpages/orders-csv.php:5 adminpages/orders.php:5
27
- #: adminpages/pagesettings.php:5 adminpages/paymentsettings.php:5
28
- #: includes/license.php:36
29
msgid "You do not have permissions to perform this action."
30
msgstr ""
31
32
#: adminpages/addons.php:64 adminpages/admin_header.php:170
33
#: includes/adminpages.php:52 includes/adminpages.php:146
34
- #: adminpages/addons.php:80 adminpages/admin_header.php:133
35
- #: adminpages/admin_header.php:154 adminpages/admin_header.php:170
36
- #: includes/adminpages.php:14 includes/adminpages.php:52
37
- #: includes/adminpages.php:69 includes/adminpages.php:135
38
- #: includes/adminpages.php:142 includes/adminpages.php:146
39
msgid "Add Ons"
40
msgstr ""
41
42
- #: adminpages/addons.php:71 adminpages/addons.php:87
43
#, php-format
44
msgid "Last checked on %s at %s."
45
msgstr ""
46
47
- #: adminpages/addons.php:72 adminpages/addons.php:88
48
msgid "Check Again"
49
msgstr ""
50
51
- #: adminpages/addons.php:76 adminpages/orders.php:605 adminpages/addons.php:92
52
- #: adminpages/orders.php:605
53
msgid "All"
54
msgstr ""
55
56
- #: adminpages/addons.php:77 adminpages/addons.php:93
57
msgid "Active"
58
msgstr ""
59
60
- #: adminpages/addons.php:78 adminpages/addons.php:94
61
msgid "Inactive"
62
msgstr ""
63
64
- #: adminpages/addons.php:79 adminpages/addons.php:95
65
msgid "Update Available"
66
msgstr ""
67
68
- #: adminpages/addons.php:80 adminpages/addons.php:96
69
msgid "Not Installed"
70
msgstr ""
71
72
- #: adminpages/addons.php:93 adminpages/addons.php:109
73
msgid "Add On Name"
74
msgstr ""
75
76
- #: adminpages/addons.php:94 adminpages/addons.php:110
77
msgid "Type"
78
msgstr ""
79
80
#: adminpages/addons.php:95 adminpages/membershiplevels.php:300
81
- #: adminpages/addons.php:111 adminpages/membershiplevels.php:296
82
- #: adminpages/membershiplevels.php:298 adminpages/membershiplevels.php:300
83
msgid "Description"
84
msgstr ""
85
86
- #: adminpages/addons.php:118 adminpages/addons.php:134
87
msgid "No Add Ons found."
88
msgstr ""
89
90
#: adminpages/addons.php:179 adminpages/addons.php:184
91
- #: adminpages/addons.php:196 adminpages/addons.php:195
92
- #: adminpages/addons.php:200 adminpages/addons.php:212
93
msgid "Install Now"
94
msgstr ""
95
96
#: adminpages/addons.php:185 adminpages/addons.php:191
97
#: adminpages/addons.php:197 adminpages/addons.php:203
98
- #: adminpages/addons.php:201 adminpages/addons.php:207
99
#: adminpages/addons.php:213 adminpages/addons.php:219
100
msgid "Download"
101
msgstr ""
102
103
#: adminpages/addons.php:190 adminpages/addons.php:202
104
#: adminpages/addons.php:206 adminpages/addons.php:218
105
msgid "Update License"
106
msgstr ""
107
108
- #: adminpages/addons.php:208 adminpages/addons.php:224
109
msgid "Deactivate"
110
msgstr ""
111
112
- #: adminpages/addons.php:208 adminpages/addons.php:224
113
#, php-format
114
msgid "Deactivate %s"
115
msgstr ""
116
117
- #: adminpages/addons.php:212 adminpages/addons.php:228
118
msgid "Activate"
119
msgstr ""
120
121
- #: adminpages/addons.php:212 adminpages/addons.php:228
122
#, php-format
123
msgid "Activate %s"
124
msgstr ""
125
126
- #: adminpages/addons.php:213 adminpages/addons.php:229
127
msgid "Delete"
128
msgstr ""
129
130
- #: adminpages/addons.php:213 adminpages/addons.php:229
131
#, php-format
132
msgid "Delete %s"
133
msgstr ""
134
135
- #: adminpages/addons.php:223 adminpages/addons.php:239
136
msgid "PMPro Free"
137
msgstr ""
138
139
- #: adminpages/addons.php:225 adminpages/addons.php:241
140
msgid "PMPro Core"
141
msgstr ""
142
143
- #: adminpages/addons.php:227 adminpages/addons.php:243
144
msgid "PMPro Plus"
145
msgstr ""
146
147
- #: adminpages/addons.php:229 adminpages/addons.php:245
148
msgid "WordPress.org"
149
msgstr ""
150
151
- #: adminpages/addons.php:231 adminpages/addons.php:247
152
msgid "N/A"
153
msgstr ""
154
155
- #: adminpages/addons.php:240 adminpages/addons.php:256
156
#, php-format
157
msgid "Version %s"
158
msgstr ""
159
160
- #: adminpages/addons.php:245 adminpages/addons.php:261
161
#, php-format
162
msgid "By %s"
163
msgstr ""
164
165
- #: adminpages/addons.php:252 adminpages/addons.php:268
166
#, php-format
167
msgid "More information about %s"
168
msgstr ""
169
170
- #: adminpages/addons.php:254 adminpages/addons.php:270
171
msgid "View details"
172
msgstr ""
173
174
- #: adminpages/addons.php:259 adminpages/addons.php:275
175
msgid "Visit plugin site"
176
msgstr ""
177
@@ -267,10 +294,12 @@ msgstr ""
267
#: adminpages/membershiplevels.php:490 adminpages/membershiplevels.php:496
268
#: adminpages/membershiplevels.php:498 adminpages/membershiplevels.php:525
269
#: adminpages/membershiplevels.php:526 adminpages/membershiplevels.php:569
270
- #: adminpages/membershiplevels.php:619 adminpages/pagesettings.php:69
271
#: includes/adminpages.php:44 includes/adminpages.php:64
272
#: includes/adminpages.php:65 includes/adminpages.php:100
273
#: includes/adminpages.php:107 includes/adminpages.php:111
274
msgid "Membership Levels"
275
msgstr ""
276
@@ -287,7 +316,7 @@ msgid "Payment Gateway &amp; SSL"
287
msgstr ""
288
289
#: adminpages/admin_header.php:162 adminpages/memberslist.php:168
290
- #: shortcodes/pmpro_account.php:106 adminpages/admin_header.php:131
291
#: adminpages/admin_header.php:152 adminpages/admin_header.php:162
292
#: adminpages/memberslist.php:115 adminpages/memberslist.php:148
293
#: adminpages/memberslist.php:158 adminpages/memberslist.php:168
@@ -412,14 +441,17 @@ msgstr ""
412
#: adminpages/advancedsettings.php:219 adminpages/membershiplevels.php:563
413
#: adminpages/membershiplevels.php:569 adminpages/membershiplevels.php:571
414
#: adminpages/membershiplevels.php:578 adminpages/membershiplevels.php:598
415
- #: adminpages/membershiplevels.php:658 adminpages/membershiplevels.php:668
416
- #: adminpages/paymentsettings.php:210 adminpages/paymentsettings.php:414
417
- #: adminpages/paymentsettings.php:429 adminpages/paymentsettings.php:434
418
- #: adminpages/paymentsettings.php:436 adminpages/paymentsettings.php:454
419
- #: adminpages/paymentsettings.php:459 adminpages/paymentsettings.php:461
420
#: classes/gateways/class.pmprogateway_stripe.php:173
421
- #: classes/gateways/class.pmprogateway_stripe.php:174 includes/profile.php:101
422
- #: includes/profile.php:105 includes/profile.php:121 includes/profile.php:123
423
msgid "No"
424
msgstr ""
425
@@ -465,15 +497,17 @@ msgstr ""
465
#: adminpages/advancedsettings.php:208 adminpages/membershiplevels.php:563
466
#: adminpages/membershiplevels.php:569 adminpages/membershiplevels.php:571
467
#: adminpages/membershiplevels.php:578 adminpages/membershiplevels.php:598
468
- #: adminpages/membershiplevels.php:658 adminpages/membershiplevels.php:668
469
- #: adminpages/paymentsettings.php:211 adminpages/paymentsettings.php:415
470
- #: adminpages/paymentsettings.php:424 adminpages/paymentsettings.php:430
471
- #: adminpages/paymentsettings.php:435 adminpages/paymentsettings.php:437
472
- #: adminpages/paymentsettings.php:455 adminpages/paymentsettings.php:460
473
- #: adminpages/paymentsettings.php:462
474
#: classes/gateways/class.pmprogateway_stripe.php:174
475
- #: classes/gateways/class.pmprogateway_stripe.php:175 includes/profile.php:102
476
- #: includes/profile.php:106 includes/profile.php:122 includes/profile.php:124
477
msgid "Yes"
478
msgstr ""
479
@@ -534,9 +568,9 @@ msgstr ""
534
#: adminpages/advancedsettings.php:355 adminpages/advancedsettings.php:368
535
#: adminpages/pagesettings.php:209 adminpages/pagesettings.php:223
536
#: adminpages/pagesettings.php:251 adminpages/pagesettings.php:254
537
- #: adminpages/paymentsettings.php:238 adminpages/paymentsettings.php:485
538
- #: adminpages/paymentsettings.php:526 adminpages/paymentsettings.php:532
539
- #: adminpages/paymentsettings.php:534
540
msgid "Save Settings"
541
msgstr ""
542
@@ -606,8 +640,9 @@ msgstr ""
606
607
#: adminpages/discountcodes.php:310 adminpages/discountcodes.php:586
608
#: adminpages/membershiplevels.php:288 adminpages/membershiplevels.php:636
609
- #: adminpages/memberslist.php:164 adminpages/orders.php:910
610
- #: adminpages/reports/login.php:142 adminpages/discountcodes.php:306
611
#: adminpages/discountcodes.php:309 adminpages/discountcodes.php:310
612
#: adminpages/discountcodes.php:547 adminpages/discountcodes.php:557
613
#: adminpages/discountcodes.php:585 adminpages/discountcodes.php:586
@@ -615,16 +650,16 @@ msgstr ""
615
#: adminpages/membershiplevels.php:288 adminpages/membershiplevels.php:505
616
#: adminpages/membershiplevels.php:511 adminpages/membershiplevels.php:513
617
#: adminpages/membershiplevels.php:540 adminpages/membershiplevels.php:541
618
- #: adminpages/membershiplevels.php:583 adminpages/membershiplevels.php:637
619
- #: adminpages/memberslist.php:111 adminpages/memberslist.php:144
620
- #: adminpages/memberslist.php:154 adminpages/memberslist.php:164
621
- #: adminpages/orders.php:597