Paid Memberships Pro - Version 1.8.4.5

Version Description

  • BUG: Fixed broken links when adminpages/admin_header.php is loaded outside of the PMPro settings tabs.
  • BUG: Fixed issue with PMPro page templates being loaded from child themes. (Thanks, SeventhQueen)
  • BUG: Fixed bug where gateway subscriptions would sometimes be cancelled even if an admin unchecked the "cancel at gateway" option when changing a users level on the edit user page. (Thanks, Scott Noelle)
  • ENHANCEMENT: Added debugging to the Braintree webhook. Use define('PMPRO_BRAINTREE_WEBHOOK_DEBUG', true); in your wp-config.php to have debug emails sent to the admin when the Braintree webhook is hit.
  • ENHANCEMENT: Updated email fields on checkout and billing update form to use the "email" field type instead of "text". If you need to revert this back to "text" type, use the pmpro_email_field_type filter like this: apply_filters('pmpro_email_field_type', '__return_false'); (Thanks, Yann Kozon)
  • ENHANCEMENT: French translation updated and now includes email templates. (Thanks, Jean-Christophe Michel)
  • ENHANCEMENT: Added the pmpro_is_ready filter. This should be used by gateway plugins to set the $pmpro_gateway_ready global variable.
  • ENHANCEMENT: Added pmpro_memberslist_per_page and pmpro_orders_per_page filters to change the default number of items to show on those admin pages.
  • ENHANCEMENT: Added pmpro_new_user and pmpro_new_user_setup hooks to allow for alterring the user creation code at checkout. For an example of how to use these see (https://github.com/strangerstudios/paid-memberships-pro/pull/224). (Thanks, David Crabill)
  • ENHANCEMENT: Now setting the Stripe API version in the Stripe class. (Set to version "2015-07-13" right now.) This ensures that Stripe processes PMPro API calls correctly. We will update this to the latest versions as they come out and we test PMPro against them. You will still need to update the API version in the Account Settings of your Stripe dashboard to versio 2015-07-13 (or later as we update the version we work against) so webhook events originating from Stripe are sent out in the correct format.
Download this release

Release Info

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

Code changes from version 1.8.5.5 to 1.8.4.5

Files changed (81) hide show
  1. adminpages/addons.php +142 -284
  2. adminpages/addons/hide-admin-bar-from-non-admins.php +32 -0
  3. adminpages/addons/images/pmpro-aweber.gif +0 -0
  4. adminpages/addons/images/pmpro-bbpress.jpg +0 -0
  5. adminpages/addons/images/pmpro-constant-contact.gif +0 -0
  6. adminpages/addons/images/pmpro-email-templates.gif +0 -0
  7. adminpages/addons/images/pmpro-infusionsoft.jpg +0 -0
  8. adminpages/addons/images/pmpro-mailchimp.jpg +0 -0
  9. adminpages/addons/images/pmpro-network.gif +0 -0
  10. adminpages/addons/images/pmpro-post-affiliate-pro.jpg +0 -0
  11. adminpages/addons/images/pmpro-register-helper.gif +0 -0
  12. adminpages/addons/images/pmpro-series.gif +0 -0
  13. adminpages/addons/images/pmpro-woocommerce.gif +0 -0
  14. adminpages/addons/images/pmpro-wp-affiliate-platform.jpg +0 -0
  15. adminpages/addons/images/wp-bouncer.gif +0 -0
  16. adminpages/addons/pmpro-addon-packages.php +30 -0
  17. adminpages/addons/pmpro-affiliates.php +30 -0
  18. adminpages/addons/pmpro-aweber.php +31 -0
  19. adminpages/addons/pmpro-bbpress.php +31 -0
  20. adminpages/addons/pmpro-constant-contact.php +31 -0
  21. adminpages/addons/pmpro-disable-emails.php +28 -0
  22. adminpages/addons/pmpro-email-templates.php +31 -0
  23. adminpages/addons/pmpro-expiration.php +30 -0
  24. adminpages/addons/pmpro-freeaddress.php +30 -0
  25. adminpages/addons/pmpro-infusionsoft.php +31 -0
  26. adminpages/addons/pmpro-international-addresses.php +31 -0
  27. adminpages/addons/pmpro-level-cost-text.php +30 -0
  28. adminpages/addons/pmpro-mailchimp.php +31 -0
  29. adminpages/addons/pmpro-network-subsite.php +31 -0
  30. adminpages/addons/pmpro-network.php +31 -0
  31. adminpages/addons/pmpro-post-affiliate-pro.php +31 -0
  32. adminpages/addons/pmpro-register-helper.php +31 -0
  33. adminpages/addons/pmpro-require-code-to-register.php +28 -0
  34. adminpages/addons/pmpro-series.php +31 -0
  35. adminpages/addons/pmpro-shipping.php +31 -0
  36. adminpages/addons/pmpro-user-pages.php +30 -0
  37. adminpages/addons/pmpro-woocommerce.php +31 -0
  38. adminpages/addons/pmpro-wp-affiliate.php +31 -0
  39. adminpages/addons/tml.php +32 -0
  40. adminpages/addons/wp-bouncer.php +31 -0
  41. adminpages/discountcodes.php +2 -3
  42. adminpages/functions.php +1 -1
  43. adminpages/membershiplevels.php +672 -681
  44. adminpages/orders-csv.php +2 -2
  45. adminpages/orders.php +3 -6
  46. adminpages/pagesettings.php +251 -294
  47. adminpages/reports/memberships.php +1 -1
  48. adminpages/reports/sales.php +9 -9
  49. classes/class.memberorder.php +1 -7
  50. classes/class.pmproemail.php +2 -2
  51. classes/gateways/class.pmprogateway_paypalexpress.php +0 -48
  52. classes/gateways/class.pmprogateway_stripe.php +0 -40
  53. css/frontend.css +177 -198
  54. includes/addons.php +0 -238
  55. includes/content.php +1 -32
  56. includes/functions.php +23 -131
  57. includes/https.php +1 -1
  58. includes/init.php +4 -20
  59. includes/license.php +0 -293
  60. includes/metaboxes.php +108 -136
  61. includes/profile.php +9 -27
  62. includes/upgradecheck.php +2 -2
  63. languages/pmpro-fi.mo +0 -0
  64. languages/pmpro-fi.po +0 -3200
  65. languages/pmpro.mo +0 -0
  66. languages/pmpro.po +476 -856
  67. languages/pmpro.pot +476 -856
  68. license.txt +9 -9
  69. pages/billing.php +354 -357
  70. pages/checkout.php +795 -800
  71. paid-memberships-pro.php +2 -9
  72. readme.txt +24 -79
  73. screenshot-1.jpg +0 -0
  74. screenshot-2.jpg +0 -0
  75. screenshot-4.jpg +0 -0
  76. screenshot-5.jpg +0 -0
  77. screenshot-6.jpg +0 -0
  78. screenshot-7.jpg +0 -0
  79. screenshot-8.jpg +0 -0
  80. services/braintree-webhook.php +1 -1
  81. services/ipnhandler.php +2 -7
adminpages/addons.php CHANGED
@@ -1,284 +1,142 @@
1
- <?php
2
- //only admins can get this
3
- if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_addons")))
4
- {
5
- die(__("You do not have permissions to perform this action.", "pmpro"));
6
- }
7
-
8
- global $wpdb, $msg, $msgt, $pmpro_addons;
9
-
10
- wp_enqueue_script( 'plugin-install' );
11
- add_thickbox();
12
- wp_enqueue_script( 'updates' );
13
-
14
- require_once(dirname(__FILE__) . "/admin_header.php");
15
-
16
- //force a check of plugin versions?
17
- if(!empty($_REQUEST['force-check']))
18
- {
19
- wp_version_check(array(), true);
20
- wp_update_plugins();
21
- $pmpro_license_key = get_option("pmpro_license_key", "");
22
- pmpro_license_isValid($pmpro_license_key, NULL, true);
23
- }
24
-
25
- //some vars
26
- $addons = pmpro_getAddons();
27
- $addons_timestamp = get_option("pmpro_addons_timestamp", false);
28
- $plugin_info = get_site_transient( 'update_plugins' );
29
- $pmpro_license_key = get_option("pmpro_license_key", "");
30
-
31
- //get plugin status for filters
32
- if(!empty($_REQUEST['plugin_status']))
33
- $status = $_REQUEST['plugin_status'];
34
- else
35
- $status = "all";
36
-
37
- //split addons into groups for filtering
38
- $addons_all = $addons;
39
- $addons_active = array();
40
- $addons_inactive = array();
41
- $addons_update = array();
42
- $addons_uninstalled = array();
43
-
44
- foreach($addons as $addon)
45
- {
46
- $plugin_file = $addon['Slug'] . '/' . $addon['Slug'] . '.php';
47
- $plugin_file_abs = ABSPATH . 'wp-content/plugins/' . $plugin_file;
48
-
49
- //active?
50
- if(is_plugin_active($plugin_file))
51
- $addons_active[] = $addon;
52
- else
53
- $addons_inactive[] = $addon;
54
-
55
- //has update?
56
- if(isset($plugin_info->response[$plugin_file]))
57
- $addons_update[] = $addon;
58
-
59
- //not installed?
60
- if(!file_exists($plugin_file_abs))
61
- $addons_uninstalled[] = $addon;
62
- }
63
- ?>
64
- <h2><?php _e('Add Ons', 'pmpro'); ?></h2>
65
-
66
- <?php
67
- pmpro_showMessage();
68
- ?>
69
-
70
- <p>
71
- <?php printf(__('Last checked on %s at %s.', 'pmpro'), date(get_option('date_format'), $addons_timestamp), date(get_option('time_format'), $addons_timestamp));?> &nbsp;
72
- <a class="button" href="<?php echo admin_url("admin.php?page=pmpro-addons&force-check=1&plugin_status=" . $status);?>"><?php _e('Check Again', 'pmpro'); ?></a>
73
- </p>
74
-
75
- <ul class="subsubsub">
76
- <li class="all"><a href="admin.php?page=pmpro-addons&plugin_status=all" <?php if(empty($status) || $status == "all") { ?>class="current"<?php } ?>><?php _e('All', 'pmpro'); ?> <span class="count">(<?php echo count($addons);?>)</span></a> |</li>
77
- <li class="active"><a href="admin.php?page=pmpro-addons&plugin_status=active" <?php if($status == "active") { ?>class="current"<?php } ?>><?php _e('Active', 'pmpro'); ?> <span class="count">(<?php echo count($addons_active);?>)</span></a> |</li>
78
- <li class="inactive"><a href="admin.php?page=pmpro-addons&plugin_status=inactive" <?php if($status == "inactive") { ?>class="current"<?php } ?>><?php _e('Inactive', 'pmpro'); ?> <span class="count">(<?php echo count($addons_inactive);?>)</span></a> |</li>
79
- <li class="update"><a href="admin.php?page=pmpro-addons&plugin_status=update" <?php if($status == "update") { ?>class="current"<?php } ?>><?php _e('Update Available', 'pmpro'); ?><span class="count">(<?php echo count($addons_update);?>)</span></a> |</li>
80
- <li class="uninstalled"><a href="admin.php?page=pmpro-addons&plugin_status=uninstalled" <?php if($status == "uninstalled") { ?>class="current"<?php } ?>><?php _e('Not Installed', 'pmpro'); ?> <span class="count">(<?php echo count($addons_uninstalled);?>)</span></a></li>
81
- </ul>
82
-
83
- <br /><br />
84
-
85
- <table class="wp-list-table widefat plugins">
86
- <thead>
87
- <tr>
88
- <th scope="col" id="cb" class="manage-column column-cb check-column" style="">
89
- <?php /*
90
- <label class="screen-reader-text" for="cb-select-all-1"><?php _e('Select All'); ?></label><input id="cb-select-all-1" type="checkbox">
91
- */ ?>
92
- </th>
93
- <th scope="col" id="name" class="manage-column column-name" style=""><?php _e('Add On Name','pmpro'); ?></th>
94
- <th scope="col" id="type" class="manage-column column-type" style=""><?php _e('Type', 'pmpro'); ?></th>
95
- <th scope="col" id="description" class="manage-column column-description" style=""><?php _e('Description', 'pmpro'); ?></th>
96
- </tr>
97
- </thead>
98
- <tbody id="the-list">
99
- <?php
100
- //which addons to show?
101
- if($status == "active")
102
- $addons = $addons_active;
103
- elseif($status == "inactive")
104
- $addons = $addons_inactive;
105
- elseif($status == "update")
106
- $addons = $addons_update;
107
- elseif($status == "uninstalled")
108
- $addons = $addons_uninstalled;
109
- else
110
- $addons = $addons_all;
111
-
112
- //no addons for this filter?
113
- if(count($addons) < 1)
114
- {
115
- ?>
116
- <tr>
117
- <td></td>
118
- <td colspan="3"><p><?php _e('No Add Ons found.', 'pmpro'); ?></p></td>
119
- </tr>
120
- <?php
121
- }
122
-
123
- foreach($addons as $addon)
124
- {
125
- $plugin_file = $addon['Slug'] . '/' . $addon['Slug'] . '.php';
126
- $plugin_file_abs = ABSPATH . 'wp-content/plugins/' . $plugin_file;
127
-
128
- if(file_exists($plugin_file_abs))
129
- $plugin_data = get_plugin_data( $plugin_file_abs, false, true);
130
- else
131
- $plugin_data = $addon;
132
-
133
- //make sure plugin value is set
134
- if(empty($plugin_data['plugin']))
135
- $plugin_data['plugin'] = $plugin_file;
136
-
137
- $plugin_name = $plugin_data['Name'];
138
- $id = sanitize_title( $plugin_name );
139
- $checkbox_id = "checkbox_" . md5($plugin_name);
140
-
141
- if(!empty($plugin_data['License']))
142
- {
143
- $context = 'uninstalled inactive';
144
- }
145
- elseif(isset($plugin_info->response[$plugin_file]))
146
- {
147
- $context = 'active update';
148
- }
149
- elseif(is_plugin_active($plugin_file))
150
- {
151
- $context = 'active';
152
- }
153
- elseif(file_exists($plugin_file_abs))
154
- {
155
- $context = 'inactive';
156
- }
157
- else
158
- {
159
- $context = false;
160
- }
161
- ?>
162
- <tr id="<?php echo $id; ?>" class="<?php echo $context;?>" data-slug="<?php echo $id; ?>">
163
- <th scope="row" class="check-column">
164
- <?php /*
165
- <label class="screen-reader-text" for="<?php echo $checkbox_id; ?>"><?php sprintf( __( 'Select %s' ), $plugin_name ); ?></label>
166
- <input type="checkbox" name="checked[]" value="<?php esc_attr( $plugin_file ); ?>" id="<?php echo $checkbox_id; ?>">
167
- */ ?>
168
- </th>
169
- <td class="plugin-title">
170
- <strong><?php echo $plugin_name; ?></strong>
171
- <div class="row-actions visible">
172
- <?php
173
- $actions = array();
174
- if($context === 'uninstalled inactive')
175
- {
176
- if($plugin_data['License'] == 'wordpress.org')
177
- {
178
- //wordpress.org
179
- $actions['install'] = '<span class="install"><a href="' . wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $plugin_data['Slug']), 'install-plugin_' . $plugin_data['Slug']) . '">' . __('Install Now', 'pmpro') . '</a></span>';
180
- }
181
- elseif($plugin_data['License'] == 'free')
182
- {
183
- //free
184
- $actions['install'] = '<span class="install"><a href="' . wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $plugin_data['Slug']), 'install-plugin_' . $plugin_data['Slug']) . '">' . __('Install Now', 'pmpro') . '</a></span>';
185
- $actions['download'] = '<span class="download"><a target="_blank" href="' . $plugin_data['Download'] . '?key=' . $pmpro_license_key . '">' . __('Download', 'pmpro') . '</a></span>';
186
- }
187
- elseif(empty($pmpro_license_key))
188
- {
189
- //no key
190
- $actions['settings'] = '<span class="settings"><a href="' . admin_url('options-general.php?page=pmpro_license_settings') . '">' . __('Update License', 'pmpro') . '</a></span>';
191
- $actions['download'] = '<span class="download"><a target="_blank" href="' . $plugin_data['PluginURI'] . '">' . __('Download', 'pmpro') . '</a></span>';
192
- }
193
- elseif(pmpro_license_isValid($pmpro_license_key, $plugin_data['License']))
194
- {
195
- //valid key
196
- $actions['install'] = '<span class="install"><a href="' . wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $plugin_data['Slug']), 'install-plugin_' . $plugin_data['Slug']) . '">' . __('Install Now', 'pmpro') . '</a></span>';
197
- $actions['download'] = '<span class="download"><a target="_blank" href="' . $plugin_data['Download'] . '?key=' . $pmpro_license_key . '">' . __('Download', 'pmpro') . '</a></span>';
198
- }
199
- else
200
- {
201
- //invalid key
202
- $actions['settings'] = '<span class="settings"><a href="' . admin_url('options-general.php?page=pmpro_license_settings') . '">' . __('Update License', 'pmpro') . '</a></span>';
203
- $actions['download'] = '<span class="download"><a target="_blank" href="' . $plugin_data['PluginURI'] . '">' . __('Download', 'pmpro') . '</a></span>';
204
- }
205
- }
206
- elseif($context === 'active' || $context === 'active update')
207
- {
208
- $actions['deactivate'] = '<span class="deactivate"><a href="' . wp_nonce_url(self_admin_url('plugins.php?action=deactivate&plugin=' . $plugin_file), 'deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( __( 'Deactivate %s' ), $plugin_data['Name'] ) ) . '">' . __('Deactivate') . '</a></span>';
209
- }
210
- elseif($context === 'inactive')
211
- {
212
- $actions['activate'] = '<span class="activate"><a href="' . wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=' . $plugin_file), 'activate-plugin_' . $plugin_file) . '" class="edit" aria-label="' . esc_attr( sprintf( __( 'Activate %s' ), $plugin_data['Name'] ) ) . '">' . __('Activate') . '</a></span>';
213
- $actions['delete'] = '<span class="delete"><a href="' . wp_nonce_url(self_admin_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file), 'bulk-plugins') . '" class="delete" aria-label="' . esc_attr( sprintf( __( 'Delete %s' ), $plugin_data['Name'] ) ) . '">' . __('Delete') . '</a></span>';
214
- }
215
- $actions = apply_filters( 'plugin_action_links_' . $plugin_file, $actions, $plugin_file, $plugin_data, $context );
216
- echo implode(' | ',$actions);
217
- ?>
218
- </div>
219
- </td>
220
- <td class="column-type">
221
- <?php
222
- if($addon['License'] == 'free')
223
- _e("PMPro Free", "pmpro");
224
- elseif($addon['License'] == 'core')
225
- _e("PMPro Core", "pmpro");
226
- elseif($addon['License'] == 'plus')
227
- _e("PMPro Plus", "pmpro");
228
- elseif($addon['License'] == 'wordpress.org')
229
- _e("WordPress.org", "pmpro");
230
- else
231
- _e("N/A", "pmpro");
232
- ?>
233
- </td>
234
- <td class="column-description desc">
235
- <div class="plugin-description"><p><?php echo $plugin_data['Description']; ?></p></div>
236
- <div class="inactive second plugin-version-author-uri">
237
- <?php
238
- $plugin_meta = array();
239
- if ( !empty( $plugin_data['Version'] ) )
240
- $plugin_meta[] = sprintf( __( 'Version %s' ), $plugin_data['Version'] );
241
- if ( !empty( $plugin_data['Author'] ) ) {
242
- $author = $plugin_data['Author'];
243
- if ( !empty( $plugin_data['AuthorURI'] ) )
244
- $author = '<a href="' . $plugin_data['AuthorURI'] . '">' . $plugin_data['Author'] . '</a>';
245
- $plugin_meta[] = sprintf( __( 'By %s' ), $author );
246
- }
247
- // Details link using API info, if available
248
- if ( isset( $plugin_data['slug'] ) && current_user_can( 'install_plugins' ) ) {
249
- $plugin_meta[] = sprintf( '<a href="%s" class="thickbox" aria-label="%s" data-title="%s">%s</a>',
250
- esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] .
251
- '&TB_iframe=true&width=600&height=550' ) ),
252
- esc_attr( sprintf( __( 'More information about %s' ), $plugin_name ) ),
253
- esc_attr( $plugin_name ),
254
- __( 'View details' )
255
- );
256
- } elseif ( ! empty( $plugin_data['PluginURI'] ) ) {
257
- $plugin_meta[] = sprintf( '<a href="%s">%s</a>',
258
- esc_url( $plugin_data['PluginURI'] ),
259
- __( 'Visit plugin site' )
260
- );
261
- }
262
- $plugin_meta = apply_filters( 'plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data );
263
- echo implode( ' | ', $plugin_meta );
264
- ?>
265
- </div>
266
- </td>
267
- </tr>
268
- <?php
269
-
270
- ob_start();
271
- wp_plugin_update_row( $plugin_file, $plugin_data );
272
- $row = ob_get_contents();
273
- ob_end_clean();
274
-
275
- echo str_replace('colspan="0"', 'colspan="4"', $row);
276
- }
277
- ?>
278
- </tbody>
279
- </table>
280
-
281
- <?php
282
- require_once(dirname(__FILE__) . "/admin_footer.php");
283
- wp_print_request_filesystem_credentials_modal();
284
- ?>
1
+ <?php
2
+ //only admins can get this
3
+ if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_addons")))
4
+ {
5
+ die(__("You do not have permissions to perform this action.", "pmpro"));
6
+ }
7
+
8
+ global $wpdb, $msg, $msgt, $pmpro_addons;
9
+
10
+ /*
11
+ Addon lists
12
+ */
13
+ $pmpro_addon_lists = array(
14
+ 'repo' => array('Plugins in the WordPress Repository', 'These official PMPro plugins are available in the WordPress repository and can be installed through Plugins --> Add New.'),
15
+ 'thirdparty' => array('Third-party Integration', 'These official PMPro plugins integrate with specific third-party tools and software.'),
16
+ 'recommended' => array('Recommended Plugins', 'These plugins are not developed by the PMPro team, but are recommended for sites running PMPro.'),
17
+ 'github' => array('Plugins on GitHub', 'These official PMPro plugins must be downloaded from GitHub and installed through Plugins --> Add New --> Upload, then activated. These plugins cannot be automatically updated and may require more developer input.'),
18
+ 'gists' => array('Code Gists', 'These are bits of code that generally must be added to your active theme\'s functions.php file or included in a custom plugin. Most gists require customization and are recommended for developers only.')
19
+ );
20
+
21
+ /*
22
+ Function to add an addon
23
+ */
24
+ function pmpro_add_addon($list, $addon)
25
+ {
26
+ global $pmpro_addons;
27
+
28
+ //make sure we have the base array
29
+ if(empty($pmpro_addons))
30
+ $pmpro_addons = array();
31
+
32
+ //make sure we have an array for the list
33
+ if(empty($pmpro_addons[$list]))
34
+ $pmpro_addons[$list] = array();
35
+
36
+ //add addon to list
37
+ $pmpro_addons[$list][] = $addon;
38
+ }
39
+
40
+ /*
41
+ Load All Addons
42
+ */
43
+ $pmpro_addons_dir = dirname(__FILE__) . "/../adminpages/addons/";
44
+ $cwd = getcwd();
45
+ chdir($pmpro_addons_dir);
46
+ $count = 0;
47
+ foreach (glob("*.php") as $filename)
48
+ {
49
+ $count++;
50
+ require_once($filename);
51
+ }
52
+ chdir($cwd);
53
+
54
+ require_once(dirname(__FILE__) . "/admin_header.php");
55
+ ?>
56
+
57
+ <h2>Add Ons</h2>
58
+ <ul id="addon-filters" class="subsubsub">
59
+ <li id="addon-filters-all"><a href="javascript:void(0);" class="current all tab">All</a> <span>(<?php echo $count;?>)</span></li>
60
+ <?php foreach($pmpro_addon_lists as $list => $list_info) { ?>
61
+ <li id="addon-filters-<?php echo $list;?>"> | <a href="javascript:void(0);>" class="tab"><?php echo $list_info[0];?></a> <span>(<?php echo count($pmpro_addons[$list]);?>)</span></li>
62
+ <?php } ?>
63
+ </ul>
64
+
65
+ <?php foreach($pmpro_addon_lists as $list => $list_info) { ?>
66
+ <div id="pmpro-<?php echo $list;?>" class="pmpro-addon-list widgets-holder-wrap">
67
+
68
+ <h3 class="section-title"><?php echo $list_info[0];?></h3>
69
+ <p class="description"><?php echo $list_info[1];?></p>
70
+ <br class="clear" />
71
+
72
+ <div id="addons-list-<?php echo $list;?>" class="addon-list">
73
+
74
+ <?php foreach($pmpro_addons[$list] as $slug => $addon) { ?>
75
+ <div id="addon-<?php echo $slug;?>" class="widget <?php if($addon['enabled']) echo "enabled"; else echo "disabled";?>">
76
+ <div class="widget-top">
77
+ <div class="widget-title">
78
+ <h4>
79
+ <span class="status-label"><?php if($addon['enabled']) echo __("Enabled", "pmpro"); else echo __("Disabled", "pmpro");?></span>
80
+ <span class="title"><?php echo $addon['title'];?></span>
81
+ <span class="version pmpro_tag-grey"><?php echo $addon['version'];?></span>
82
+ <span class="in-widget-title"></span>
83
+ </h4>
84
+ </div> <!-- end widget-title -->
85
+ </div> <!-- end widget-top -->
86
+ <div class="widget-inside">
87
+ <?php call_user_func($addon['widget'], $addon);?>
88
+ </div> <!-- end addon-inside -->
89
+ </div> <!-- end widget -->
90
+ <?php } ?>
91
+
92
+ <br class="clear" />
93
+ </div> <!-- end addon-list -->
94
+
95
+ </div> <!-- end pmpro-<?php echo $list;?> -->
96
+ <?php } ?>
97
+
98
+ <script>
99
+ //tabs
100
+ jQuery(document).ready(function() {
101
+ jQuery('#addon-filters a.tab').click(function() {
102
+ //which tab?
103
+ var tab = jQuery(this).parent().attr('id').replace('addon-filters-', '');
104
+
105
+ //un select tabs
106
+ jQuery('#addon-filters a.tab').removeClass('current');
107
+
108
+ //select this tab
109
+ jQuery('#addon-filters-'+tab+' a').addClass('current');
110
+
111
+ //show all?
112
+ if(tab == 'all')
113
+ jQuery('div.pmpro-addon-list').show();
114
+ else
115
+ {
116
+ //hide all
117
+ jQuery('div.pmpro-addon-list').hide();
118
+
119
+ //show this one
120
+ jQuery('#pmpro-'+tab).show();
121
+ }
122
+ });
123
+ });
124
+
125
+ //resize addon boxes
126
+ jQuery(document).ready(function() {
127
+ jQuery('.addon-list').each(function() {
128
+ //what's the tallest p in the list?
129
+ var tallest = 32;
130
+ jQuery(this).find('div.info p').each(function() {
131
+ tallest = Math.max(tallest, jQuery(this).height());
132
+ });
133
+
134
+ //set all p's to match
135
+ jQuery(this).find('div.info p').css('height', tallest);
136
+ });
137
+ });
138
+ </script>
139
+
140
+ <?php
141
+ require_once(dirname(__FILE__) . "/admin_footer.php");
142
+ ?>
adminpages/addons/hide-admin-bar-from-non-admins.php ADDED
@@ -0,0 +1,32 @@
1
+ <?php
2
+ /*
3
+ Addon: Hide Admin Bar From Non-Admins
4
+ Slug: hide-admin-bar-from-non-admins
5
+ */
6
+ pmpro_add_addon('repo', array(
7
+ 'title' => 'Hide Admin Bar From Non-Admins',
8
+ 'version' => '1.0',
9
+ 'widget' => 'pmpro_addon_hide_admin_bar_from_non_admins_widget',
10
+ 'enabled' => function_exists('habfna_disable_admin_bar')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_hide_admin_bar_from_non_admins_widget($addon)
15
+ {
16
+ ?>
17
+ <div class="info">
18
+ <p>Perfect for sites where there is only one admin who needs access to the dashboard and the admin bar. When activated only administrators will see the admin bar.</p>
19
+ <div class="actions">
20
+ <form method="post" name="component-actions" action="">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../hide-admin-bar-from-non-admins/hide-admin-bar-from-non-admins.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=hide-admin-bar-from-non-admins/hide-admin-bar-from-non-admins.php'), 'activate-plugin_hide-admin-bar-from-non-admins/hide-admin-bar-from-non-admins.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=hide-admin-bar-from-non-admins'), 'install-plugin_hide-admin-bar-from-non-admins'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </form>
29
+ </div>
30
+ </div> <!-- end info -->
31
+ <?php
32
+ }
adminpages/addons/images/pmpro-aweber.gif ADDED
Binary file
adminpages/addons/images/pmpro-bbpress.jpg ADDED
Binary file
adminpages/addons/images/pmpro-constant-contact.gif ADDED
Binary file
adminpages/addons/images/pmpro-email-templates.gif ADDED
Binary file
adminpages/addons/images/pmpro-infusionsoft.jpg ADDED
Binary file
adminpages/addons/images/pmpro-mailchimp.jpg ADDED
Binary file
adminpages/addons/images/pmpro-network.gif ADDED
Binary file
adminpages/addons/images/pmpro-post-affiliate-pro.jpg ADDED
Binary file
adminpages/addons/images/pmpro-register-helper.gif ADDED
Binary file
adminpages/addons/images/pmpro-series.gif ADDED
Binary file
adminpages/addons/images/pmpro-woocommerce.gif ADDED
Binary file
adminpages/addons/images/pmpro-wp-affiliate-platform.jpg ADDED
Binary file
adminpages/addons/images/wp-bouncer.gif ADDED
Binary file
adminpages/addons/pmpro-addon-packages.php ADDED
@@ -0,0 +1,30 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Addon Packages
4
+ Slug: pmpro-addon-packages
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Addon Packages',
8
+ 'version' => '.4.3',
9
+ 'widget' => 'pmpro_addon_pmpro_addon_packages_widget',
10
+ 'enabled' => function_exists('pmproap_post_meta')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_addon_packages_widget($addon)
15
+ {
16
+ ?>
17
+ <div class="info">
18
+ <p>Sell access to individual pages or posts for a flat fee. This is a workaround if you would like to allow multiple membership levels per user.</p>
19
+ <div class="actions">
20
+ <?php if($addon['enabled']) { ?>
21
+ <a href="https://github.com/strangerstudios/pmpro-addon-packages/blob/master/readme.txt" class="button">Enabled</a>
22
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-addon-packages/pmpro-addon-packages.php")) { ?>
23
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-addon-packages/pmpro-addon-packages.php'), 'activate-plugin_pmpro-addon-packages/pmpro-addon-packages.php')?>" class="button button-primary">Activate</a>
24
+ <?php } else { ?>
25
+ <a href="https://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-addon-packages.zip" class="button button-primary">Download</a>
26
+ <?php } ?>
27
+ </div>
28
+ </div> <!-- end info -->
29
+ <?php
30
+ }
adminpages/addons/pmpro-affiliates.php ADDED
@@ -0,0 +1,30 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Affiliates
4
+ Slug: pmpro-affiliates
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Affiliates',
8
+ 'version' => '.2.4',
9
+ 'widget' => 'pmpro_addon_pmpro_affiliates_widget',
10
+ 'enabled' => function_exists('pmpro_affiliates_dependencies')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_affiliates_widget($addon)
15
+ {
16
+ ?>
17
+ <div class="info">
18
+ <p>Lightweight Affiliate system. Create affiliate accounts and codes; tracks checkouts by affiliate account.</p>
19
+ <div class="actions">
20
+ <?php if($addon['enabled']) { ?>
21
+ <a href="https://github.com/strangerstudios/pmpro-affiliates/blob/master/readme.txt" class="button">Enabled</a>
22
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-affiliates/pmpro-affiliates.php")) { ?>
23
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-affiliates/pmpro-affiliates.php'), 'activate-plugin_pmpro-affiliates/pmpro-affiliates.php')?>" class="button button-primary">Activate</a>
24
+ <?php } else { ?>
25
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-affiliates.zip" class="button button-primary">Download</a>
26
+ <?php } ?>
27
+ </div>
28
+ </div> <!-- end info -->
29
+ <?php
30
+ }
adminpages/addons/pmpro-aweber.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro AWeber Integration
4
+ Slug: pmpro-aweber
5
+ */
6
+ pmpro_add_addon('thirdparty', array(
7
+ 'title' => 'PMPro AWeber Integration',
8
+ 'version' => '1.0',
9
+ 'widget' => 'pmpro_addon_pmpro_aweber_widget',
10
+ 'enabled' => function_exists('pmproaw_init')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_aweber_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-aweber.gif" />
18
+ <div class="info">
19
+ <p>Integrate User Registrations with AWeber. Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-aweber/pmpro-aweber.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-aweber/pmpro-aweber.php'), 'activate-plugin_pmpro-aweber/pmpro-aweber.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-aweber'), 'install-plugin_pmpro-aweber'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-bbpress.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro bbPress
4
+ Slug: pmpro-bbpress
5
+ */
6
+ pmpro_add_addon('repo', array(
7
+ 'title' => 'PMPro bbPress',
8
+ 'version' => '1.0.1',
9
+ 'widget' => 'pmpro_addon_pmpro_bbpress_widget',
10
+ 'enabled' => function_exists('pmprobbp_add_meta_box')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_bbpress_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-bbpress.jpg" />
18
+ <div class="info">
19
+ <p>Locking down bbPress Forums by Membership Level and Forum ID.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-bbpress/pmpro-bbpress.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-bbpress/pmpro-bbpress.php'), 'activate-plugin_pmpro-bbpress/pmpro-bbpress.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-bbpress'), 'install-plugin_pmpro-bbpress'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-constant-contact.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Constant Contact Integration
4
+ Slug: pmpro-constant-contact
5
+ */
6
+ pmpro_add_addon('thirdparty', array(
7
+ 'title' => 'PMPro Constant Contact Integration',
8
+ 'version' => '1.0',
9
+ 'widget' => 'pmpro_addon_pmpro_constant_contact_widget',
10
+ 'enabled' => function_exists('pmprocc_init')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_constant_contact_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-constant-contact.gif" />
18
+ <div class="info">
19
+ <p>Integrate User Registrations with Constant Contact . Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-constant-contact/pmpro-constant-contact.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-constant-contact/pmpro-constant-contact.php'), 'activate-plugin_pmpro-constant-contact/pmpro-constant-contact.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-constant-contact'), 'install-plugin_pmpro-constant-contact'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-disable-emails.php ADDED
@@ -0,0 +1,28 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Disable PMPro Emails
4
+ Slug: pmpro-disable-emails
5
+ */
6
+ pmpro_add_addon('gists', array(
7
+ 'title' => 'PMPro Disable Emails',
8
+ 'version' => '.1',
9
+ 'widget' => 'pmpro_addon_pmpro_disable_emails_widget',
10
+ 'enabled' => function_exists('dae_pmpro_email_recipient')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_disable_emails_widget($addon)
15
+ {
16
+ ?>
17
+ <div class="info">
18
+ <p>Disable all or specific emails sent by the PMPro plugin.</p>
19
+ <div class="actions">
20
+ <?php if($addon['enabled']) { ?>
21
+ <a target="_blank" href="https://gist.github.com/strangerstudios/3667545" class="button">Enabled</a>
22
+ <?php } else { ?>
23
+ <a target="_blank" href="https://gist.github.com/strangerstudios/3667545" class="button button-primary">View Gist</a>
24
+ <?php } ?>
25
+ </div>
26
+ </div> <!-- end info -->
27
+ <?php
28
+ }
adminpages/addons/pmpro-email-templates.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Email Templates Editor
4
+ Slug: pmpro-email-templates-addon
5
+ */
6
+ pmpro_add_addon('repo', array(
7
+ 'title' => 'PMPro Email Templates',
8
+ 'version' => '.5.2',
9
+ 'widget' => 'pmpro_addon_email_templates_widget',
10
+ 'enabled' => function_exists('pmproet_scripts')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_email_templates_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-email-templates.gif" />
18
+ <div class="info">
19
+ <p>Easily edit system-generated Email Templates from the WordPress admin.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="http://wordpress.org/plugins/pmpro-email-templates-addon/" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-email-templates-addon/pmpro-email-templates.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-email-templates-addon/pmpro-email-templates.php'), 'activate-plugin_pmpro-email-templates-addon/pmpro-email-templates.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-email-templates-addon'), 'install-plugin_pmpro-email-templates-addon'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-expiration.php ADDED
@@ -0,0 +1,30 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Expiration Date
4
+ Slug: pmpro-expiration
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Set Expiration Dates',
8
+ 'version' => '.1.1',
9
+ 'widget' => 'pmpro_addon_pmpro_expiration_widget',
10
+ 'enabled' => function_exists('pmprosed_pmpro_checkout_level')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_expiration_widget($addon)
15
+ {
16
+ ?>
17
+ <div class="info">
18
+ <p>Set a specific expiration date (e.g. 2013-12-31) for a PMPro membership level or discount code.</p>
19
+ <div class="actions">
20
+ <?php if($addon['enabled']) { ?>
21
+ <a href="https://github.com/strangerstudios/pmpro-set-expiration-dates/blob/master/readme.txt" class="button">Enabled</a>
22
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-set-expiration-dates/pmpro-set-expiration-dates.php")) { ?>
23
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-set-expiration-dates/pmpro-set-expiration-dates.php'), 'activate-plugin_pmpro-set-expiration-dates/pmpro-set-expiration-dates.php')?>" class="button button-primary">Activate</a>
24
+ <?php } else { ?>
25
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-set-expiration-dates.zip" class="button button-primary">Download</a>
26
+ <?php } ?>
27
+ </div>
28
+ </div> <!-- end info -->
29
+ <?php
30
+ }
adminpages/addons/pmpro-freeaddress.php ADDED
@@ -0,0 +1,30 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Require Name and Address for Free Level
4
+ Slug: pmpro-freerequire
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Require Name/Address for Free Level',
8
+ 'version' => '.2',
9
+ 'widget' => 'pmpro_addon_pmpro_freerequire_widget',
10
+ 'enabled' => function_exists('my_pmpro_checkout_boxes_require_address')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_freerequire_widget($addon)
15
+ {
16
+ ?>
17
+ <div class="info">
18
+ <p>Require name/address for free Membership Level checkout.</p>
19
+ <div class="actions">
20
+ <?php if($addon['enabled']) { ?>
21
+ <a href="https://github.com/strangerstudios/pmpro-address-for-free-levels" class="button">Enabled</a>
22
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-address-for-free-levels/pmpro-address-for-free-levels.php")) { ?>
23
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-address-for-free-levels/pmpro-address-for-free-levels.php'), 'activate-plugin_pmpro-address-for-free-levels/pmpro-address-for-free-levels.php')?>" class="button button-primary">Activate</a>
24
+ <?php } else { ?>
25
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-address-for-free-levels.zip" class="button button-primary">Download</a>
26
+ <?php } ?>
27
+ </div>
28
+ </div> <!-- end info -->
29
+ <?php
30
+ }
adminpages/addons/pmpro-infusionsoft.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Infusionsoft Integration
4
+ Slug: pmpro-infusionsoft
5
+ */
6
+ pmpro_add_addon('thirdparty', array(
7
+ 'title' => 'PMPro Infusionsoft Integration',
8
+ 'version' => '1.2',
9
+ 'widget' => 'pmpro_addon_pmpro_infusionsoft_widget',
10
+ 'enabled' => function_exists('pmprois_init')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_infusionsoft_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-infusionsoft.jpg" />
18
+ <div class="info">
19
+ <p>Integrate with Infusionsoft. Add members to email lists (groups, tags) based on their membership level. (Note: works without PMPro as well.)</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-infusionsoft/pmpro-infusionsoft.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-infusionsoft/pmpro-infusionsoft.php'), 'activate-plugin_pmpro-infusionsoft/pmpro-infusionsoft.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-infusionsoft'), 'install-plugin_pmpro-infusionsoft'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-international-addresses.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro International Addresses
4
+ Slug: pmpro-international-addresses
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro International Addresses',
8
+ 'version' => '.2.2',
9
+ 'widget' => 'pmpro_addon_pmpro_international_addresses_widget',
10
+ 'enabled' => function_exists('pmproia_pmpro_international_addresses')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_international_addresses_widget($addon)
15
+ {
16
+ ?>
17
+ <?php /* <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-international-addresses.jpg" /> */ ?>
18
+ <div class="info">
19
+ <p>Adds long form addresses to the PMPro checkout.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-international-addresses/" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-international-addresses/pmpro-international-addresses.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-international-addresses/pmpro-international-addresses.php'), 'activate-plugin_pmpro-international-addresses/pmpro-international-addresses.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-international-addresses.zip" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-level-cost-text.php ADDED
@@ -0,0 +1,30 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Custom Level Cost Text
4
+ Slug: pmpro-level-cost-text
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Level Cost Text',
8
+ 'version' => '.2',
9
+ 'widget' => 'pmpro_addon_pmpro_level_cost_text_widget',
10
+ 'enabled' => function_exists('pclct_pmpro_discount_code_after_level_settings')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_level_cost_text_widget($addon)
15
+ {
16
+ ?>
17
+ <div class="info">
18
+ <p>Adds a "level cost text" field to PMPro Membership Levels and Discount Codes to allow you to override the automatically generated level cost text PMPro provides.</p>
19
+ <div class="actions">
20
+ <?php if($addon['enabled']) { ?>
21
+ <a href="https://github.com/strangerstudios/pmpro-level-cost-text/blob/master/readme.txt" class="button">Enabled</a>
22
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-level-cost-text/pmpro-level-cost-text.php")) { ?>
23
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-level-cost-text/pmpro-level-cost-text.php'), 'activate-plugin_pmpro-level-cost-text/pmpro-level-cost-text.php')?>" class="button button-primary">Activate</a>
24
+ <?php } else { ?>
25
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-level-cost-text.zip" class="button button-primary">Download</a>
26
+ <?php } ?>
27
+ </div>
28
+ </div> <!-- end info -->
29
+ <?php
30
+ }
adminpages/addons/pmpro-mailchimp.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro MailChimp Integration
4
+ Slug: pmpro-mailchimp
5
+ */
6
+ pmpro_add_addon('thirdparty', array(
7
+ 'title' => 'PMPro MailChimp Integration',
8
+ 'version' => '1.0',
9
+ 'widget' => 'pmpro_addon_pmpro_mailchimp_widget',
10
+ 'enabled' => function_exists('pmpromc_init')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_mailchimp_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-mailchimp.jpg" />
18
+ <div class="info">
19
+ <p>Integrate User Registrations with Mailchimp. Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-mailchimp/pmpro-mailchimp.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-mailchimp/pmpro-mailchimp.php'), 'activate-plugin_pmpro-mailchimp/pmpro-mailchimp.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-mailchimp'), 'install-plugin_pmpro-mailchimp'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-network-subsite.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Network
4
+ Slug: pmpro-network-subsite
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Network Subsite Helper',
8
+ 'version' => '.2',
9
+ 'widget' => 'pmpro_addon_pmpro_network_subsite_widget',
10
+ 'enabled' => function_exists('pmpron_subsite_activated_plugin')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_network_subsite_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-network.gif" />
18
+ <div class="info">
19
+ <p>Have network subsites use membership data from a "main" site to handle access restrictions.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-network-subsite" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-network-subsite/pmpro-network-subsite.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-network-subsite/pmpro-network-subsite.php'), 'activate-plugin_pmpro-network-subsite/pmpro-network-subsite.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-network-subsite.zip" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-network.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Network
4
+ Slug: pmpro-network
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Network',
8
+ 'version' => '.3.1',
9
+ 'widget' => 'pmpro_addon_pmpro_network_widget',
10
+ 'enabled' => function_exists('pmpron_new_blogs_settings')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_network_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-network.gif" />
18
+ <div class="info">
19
+ <p>Allow users to checkout for a membership to create a site on your WordPress multisite network.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-network/blob/master/readme.txt" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-network/pmpro-network.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-network/pmpro-network.php'), 'activate-plugin_pmpro-network/pmpro-network.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-network.zip" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-post-affiliate-pro.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Post Affiliate Pro Integration
4
+ Slug: pmpro-post-affiliate-pro
5
+ */
6
+ pmpro_add_addon('thirdparty', array(
7
+ 'title' => 'PMPro Post Affiliate Pro Integration',
8
+ 'version' => '.2.1.1',
9
+ 'widget' => 'pmpro_addon_pmpro_post_affiliate_pro_widget',
10
+ 'enabled' => function_exists('pap_pmpro_track_sale')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_post_affiliate_pro_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-post-affiliate-pro.jpg" />
18
+ <div class="info">
19
+ <p>Integrate Paid Memberships Pro with the Post Affiliate Pro platform.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-post-affiliate-pro/blob/master/readme.txt" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-post-affiliate-pro/pmpro-post-affiliate-pro.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-post-affiliate-pro/pmpro-post-affiliate-pro.php'), 'activate-plugin_pmpro-post-affiliate-pro/pmpro-post-affiliate-pro.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-post-affiliate-pro.zip" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-register-helper.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Register Helper
4
+ Slug: pmpro-register-helper
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Register Helper',
8
+ 'version' => '.5.16.1',
9
+ 'widget' => 'pmpro_addon_pmpro_register_helper_widget',
10
+ 'enabled' => class_exists('PMProRH_Field')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_register_helper_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-register-helper.gif" />
18
+ <div class="info">
19
+ <p>Add additional meta fields to your PMPro checkout page and/or "Your Profile" pages. Support for text, select, multi-select, textarea, hidden, and custom HTML. Loop into existing checkout/profile field sections or add new ones.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-register-helper/blob/master/readme.txt" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-register-helper/pmpro-register-helper.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-register-helper/pmpro-register-helper.php'), 'activate-plugin_pmpro-register-helper/pmpro-register-helper.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-register-helper.zip" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-require-code-to-register.php ADDED
@@ -0,0 +1,28 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Require Code to Register
4
+ Slug: pmpro-require-code-to-register
5
+ */
6
+ pmpro_add_addon('gists', array(
7
+ 'title' => 'PMPro Require a Code to Register',
8
+ 'version' => '.1',
9
+ 'widget' => 'pmpro_addon_pmpro_require_code_to_register_widget',
10
+ 'enabled' => function_exists('my_pmpro_registration_checks_require_code_to_register')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_require_code_to_register_widget($addon)
15
+ {
16
+ ?>
17
+ <div class="info">
18
+ <p>Require a discount code to checkout for a specific level.</p>
19
+ <div class="actions">
20
+ <?php if($addon['enabled']) { ?>
21
+ <a target="_blank" href="https://gist.github.com/strangerstudios/5573829" class="button">Enabled</a>
22
+ <?php } else { ?>
23
+ <a target="_blank" href="https://gist.github.com/strangerstudios/5573829" class="button button-primary">View Gist</a>
24
+ <?php } ?>
25
+ </div>
26
+ </div> <!-- end info -->
27
+ <?php
28
+ }
adminpages/addons/pmpro-series.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Series
4
+ Slug: pmpro-series
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Series',
8
+ 'version' => '.3',
9
+ 'widget' => 'pmpro_addon_pmpro_series_widget',
10
+ 'enabled' => class_exists("PMProSeries")
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_series_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-series.gif" />
18
+ <div class="info">
19
+ <p>"Drip feed" content to your members over the course of their membership. Serializes content by # of days post-registration.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("edit.php?post_type=pmpro_series");?>" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-series/pmpro-series.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-series/pmpro-series.php'), 'activate-plugin_pmpro-series/pmpro-series.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-series.zip" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-shipping.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Shipping Add On
4
+ Slug: pmpro-shipping
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Shipping Add On',
8
+ 'version' => '.2.6',
9
+ 'widget' => 'pmpro_addon_pmpro_shipping_widget',
10
+ 'enabled' => function_exists('pmproship_pmpro_checkout_boxes')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_shipping_widget($addon)
15
+ {
16
+ ?>
17
+ <?php /* <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-shipping.jpg" /> */ ?>
18
+ <div class="info">
19
+ <p>Adds shipping fields to the checkout page, confirmation page, confirmation emails, member's list and edit user profile pages.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-shipping/" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-shipping/pmpro-shipping.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-shipping/pmpro-shipping.php'), 'activate-plugin_pmpro-shipping/pmpro-shipping.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-shipping.zip" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-user-pages.php ADDED
@@ -0,0 +1,30 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro User Pages
4
+ Slug: pmpro-user-pages
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro User Pages',
8
+ 'version' => '.3',
9
+ 'widget' => 'pmpro_addon_pmpro_user_pages_widget',
10
+ 'enabled' => function_exists('pmproup_pmpro_after_checkout')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_user_pages_widget($addon)
15
+ {
16
+ ?>
17
+ <div class="info">
18
+ <p>Creates a unique page for each Member after checkout, giving the Admin access to write customized content for each specific member.</p>
19
+ <div class="actions">
20
+ <?php if($addon['enabled']) { ?>
21
+ <a href="https://github.com/strangerstudios/pmpro-user-pages/blob/master/readme.txt" class="button">Enabled</a>
22
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-user-pages/pmpro-user-pages.php")) { ?>
23
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-user-pages/pmpro-user-pages.php'), 'activate-plugin_pmpro-user-pages/pmpro-user-pages.php')?>" class="button button-primary">Activate</a>
24
+ <?php } else { ?>
25
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-user-pages.zip" class="button button-primary">Download</a>
26
+ <?php } ?>
27
+ </div>
28
+ </div> <!-- end info -->
29
+ <?php
30
+ }
adminpages/addons/pmpro-woocommerce.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro WooCommerce
4
+ Slug: pmpro-woocommerce
5
+ */
6
+ pmpro_add_addon('thirdparty', array(
7
+ 'title' => 'PMPro WooCommerce',
8
+ 'version' => '1.2.2',
9
+ 'widget' => 'pmpro_addon_pmpro_woocommerce_widget',
10
+ 'enabled' => function_exists('pmprowoo_add_membership_from_order')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_woocommerce_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-woocommerce.gif" />
18
+ <div class="info">
19
+ <p>Use <a href="http://www.woothemes.com/woocommerce/">WooCommerce</a> to purchase membership levels or set members-only product pricing.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-woocommerce/pmpro-woocommerce.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-woocommerce/pmpro-woocommerce.php'), 'activate-plugin_pmpro-woocommerce/pmpro-woocommerce.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-woocommerce'), 'install-plugin_pmpro-woocommerce'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-wp-affiliate.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro WP Affiliate Platform Integration
4
+ Slug: pmpro-wp-affiliate
5
+ */
6
+ pmpro_add_addon('thirdparty', array(
7
+ 'title' => 'PMPro WP Affiliate Platform Integration',
8
+ 'version' => '.3',
9
+ 'widget' => 'pmpro_addon_pmpro_wp_affiliate_widget',
10
+ 'enabled' => function_exists('wpa_pmpro_after_checkout')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_wp_affiliate_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-wp-affiliate-platform.jpg" />
18
+ <div class="info">
19
+ <p>Process an affiliate via WP Affiliate Platform after a PMPro checkout.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-wp-affiliate-platform/" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-wp-affiliate-platform/pmpro-wp-affiliate-platform.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-wp-affiliate-platform/pmpro-wp-affiliate-platform.php'), 'activate-plugin_pmpro-wp-affiliate-platform/pmpro-wp-affiliate-platform.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-wp-affiliate-platform.zip" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/tml.php ADDED
@@ -0,0 +1,32 @@
1
+ <?php
2
+ /*
3
+ Addon: Theme My Login
4
+ Slug: pmpro-tml
5
+ */
6
+ pmpro_add_addon('recommended', array(
7
+ 'title' => 'Theme My Login',
8
+ 'widget' => 'pmpro_addon_tml_widget',
9
+ 'enabled' => class_exists('Theme_My_Login'),
10
+ 'version' => '6.3.10'
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_tml_widget($addon)
15
+ {
16
+ ?>
17
+ <div class="info">
18
+ <p>This plugin themes the WordPress login, registration and forgot password pages according to your current theme. By <a href="http://www.jfarthing.com/" target="_blank">Jeff Farthing</a></p>
19
+ <div class="actions">
20
+ <form method="post" name="component-actions" action="">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../theme-my-login/theme-my-login.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=theme-my-login/theme-my-login.php'), 'activate-plugin_theme-my-login/theme-my-login.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=theme-my-login'), 'install-plugin_theme-my-login'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </form>
29
+ </div>
30
+ </div> <!-- end info -->
31
+ <?php
32
+ }
adminpages/addons/wp-bouncer.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: WP Bouncer
4
+ Slug: wp-bouncer
5
+ */
6
+ pmpro_add_addon('repo', array(
7
+ 'title' => 'WP Bouncer',
8
+ 'version' => '1.1',
9
+ 'widget' => 'pmpro_addon_wp_bouncer_widget',
10
+ 'enabled' => class_exists('WP_Bouncer')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_wp_bouncer_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/wp-bouncer.gif" />
18
+ <div class="info">
19
+ <p>Make sure users are only logged in from one computer or device at a time.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="http://wordpress.org/plugins/wp-bouncer/" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../wp-bouncer/wp-bouncer.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=wp-bouncer/wp-bouncer.php'), 'activate-plugin_wp-bouncer/wp-bouncer.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=wp-bouncer'), 'install-plugin_wp-bouncer'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/discountcodes.php CHANGED
@@ -396,7 +396,7 @@
396
</tbody>
397
</table>
398
399
- <?php do_action("pmpro_discount_code_after_settings", $edit); ?>
400
401
<h3><?php _e('Which Levels Will This Code Apply To?', 'pmpro'); ?></h3>
402
@@ -606,7 +606,6 @@
606
}
607
else
608
{
609
- $count = 0;
610
foreach($codes as $code)
611
{
612
?>
@@ -649,7 +648,7 @@
649
<a href="?page=pmpro-discountcodes&edit=<?php echo $code->id?>"><?php _e('edit', 'pmpro');?></a>
650
</td>
651
<td>
652
- <a href="javascript:askfirst('<?php echo str_replace("'", "\'", sprintf(__('Are you sure you want to delete the %s discount code? The subscriptions for existing users will not change, but new users will not be able to use this code anymore.', 'pmpro'), $code->code));?>', '?page=pmpro-discountcodes&delete=<?php echo $code->id?>'); void(0);"><?php _e('delete', 'pmpro');?></a>
653
</td>
654
</tr>
655
<?php
396
</tbody>
397
</table>
398
399
+ <?php do_action("pmpro_discount_code_after_settings"); ?>
400
401
<h3><?php _e('Which Levels Will This Code Apply To?', 'pmpro'); ?></h3>
402
606
}
607
else
608
{
609
foreach($codes as $code)
610
{
611
?>
648
<a href="?page=pmpro-discountcodes&edit=<?php echo $code->id?>"><?php _e('edit', 'pmpro');?></a>
649
</td>
650
<td>
651
+ <a href="javascript:askfirst('<?php printf(__('Are you sure you want to delete the %s discount code? The subscriptions for existing users will not change, but new users will not be able to use this code anymore.', 'pmpro'), $code->code);?>', '?page=pmpro-discountcodes&delete=<?php echo $code->id?>'); void(0);"><?php _e('delete', 'pmpro');?></a>
652
</td>
653
</tr>
654
<?php
adminpages/functions.php CHANGED
@@ -221,7 +221,7 @@ function pmpro_checkLevelForTwoCheckoutCompatibility($level = NULL)
221
* @param string $field The name of the field to check.
222
* @param bool $force If true, it will rebuild the cached results.
223
*
224
- * @since 1.8
225
*/
226
function pmpro_getClassesForPaymentSettingsField($field, $force = false)
227
{
221
* @param string $field The name of the field to check.
222
* @param bool $force If true, it will rebuild the cached results.
223
*
224
+ * @since 2.0
225
*/
226
function pmpro_getClassesForPaymentSettingsField($field, $force = false)
227
{
adminpages/membershiplevels.php CHANGED
@@ -1,682 +1,673 @@
1
- <?php
2
- //only admins can get this
3
- if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_membershiplevels")))
4
- {
5
- die(__("You do not have permissions to perform this action.", "pmpro"));
6
- }
7
-
8
- global $wpdb, $msg, $msgt, $pmpro_currency_symbol;
9
-
10
- //some vars
11
- $gateway = pmpro_getOption("gateway");
12
- $pmpro_level_order = pmpro_getOption('level_order');
13
-
14
- global $pmpro_stripe_error, $pmpro_braintree_error, $pmpro_payflow_error, $pmpro_twocheckout_error, $wp_version;
15
-
16
- if(isset($_REQUEST['edit']))
17
- $edit = intval($_REQUEST['edit']);
18
- else
19
- $edit = false;
20
- if(isset($_REQUEST['copy']))
21
- $copy = intval($_REQUEST['copy']);
22
- if(isset($_REQUEST['s']))
23
- $s = sanitize_text_field($_REQUEST['s']);
24
- else
25
- $s = "";
26
-
27
- if(isset($_REQUEST['action']))
28
- $action = sanitize_text_field($_REQUEST['action']);
29
- else
30
- $action = false;
31
-
32
- if(isset($_REQUEST['saveandnext']))
33
- $saveandnext = intval($_REQUEST['saveandnext']);
34
-
35
- if(isset($_REQUEST['saveid']))
36
- $saveid = intval($_REQUEST['saveid']);
37
- if(isset($_REQUEST['deleteid']))
38
- $deleteid = intval($_REQUEST['deleteid']);
39
-
40
- if($action == "save_membershiplevel")
41
- {
42
- $ml_name = stripslashes($_REQUEST['name']);
43
- $ml_description = stripslashes($_REQUEST['description']);
44
- $ml_confirmation = stripslashes($_REQUEST['confirmation']);
45
- $ml_initial_payment = stripslashes($_REQUEST['initial_payment']);
46
- if(!empty($_REQUEST['recurring']))
47
- $ml_recurring = 1;
48
- else
49
- $ml_recurring = 0;
50
- $ml_billing_amount = stripslashes($_REQUEST['billing_amount']);
51
- $ml_cycle_number = stripslashes($_REQUEST['cycle_number']);
52
- $ml_cycle_period = stripslashes($_REQUEST['cycle_period']);
53
- $ml_billing_limit = stripslashes($_REQUEST['billing_limit']);
54
- if(!empty($_REQUEST['custom_trial']))
55
- $ml_custom_trial = 1;
56
- else
57
- $ml_custom_trial = 0;
58
- $ml_trial_amount = stripslashes($_REQUEST['trial_amount']);
59
- $ml_trial_limit = stripslashes($_REQUEST['trial_limit']);
60
- if(!empty($_REQUEST['expiration']))
61
- $ml_expiration = 1;
62
- else
63
- $ml_expiration = 0;
64
- $ml_expiration_number = stripslashes($_REQUEST['expiration_number']);
65
- $ml_expiration_period = stripslashes($_REQUEST['expiration_period']);
66
- $ml_categories = array();
67
-
68
- //reversing disable to allow here
69
- if(empty($_REQUEST['disable_signups']))
70
- $ml_allow_signups = 1;
71
- else
72
- $ml_allow_signups = 0;
73
-
74
- foreach ( $_REQUEST as $key => $value )
75
- {
76
- if ( $value == 'yes' && preg_match( '/^membershipcategory_(\d+)#x2F;i', $key, $matches ) )
77
- {
78
- $ml_categories[] = $matches[1];
79
- }
80
- }
81
-
82
- //clearing out values if checkboxes aren't checked
83
- if(empty($ml_recurring))
84
- {
85
- $ml_billing_amount = $ml_cycle_number = $ml_cycle_period = $ml_billing_limit = $ml_trial_amount = $ml_trial_limit = 0;
86
- }
87
- elseif(empty($ml_custom_trial))
88
- {
89
- $ml_trial_amount = $ml_trial_limit = 0;
90
- }
91
- if(empty($ml_expiration))
92
- {
93
- $ml_expiration_number = $ml_expiration_period = 0;
94
- }
95
-
96
- if($saveid > 0)
97
- {
98
- $sqlQuery = " UPDATE {$wpdb->pmpro_membership_levels}
99
- SET name = '" . esc_sql($ml_name) . "',
100
- description = '" . esc_sql($ml_description) . "',
101
- confirmation = '" . esc_sql($ml_confirmation) . "',
102
- initial_payment = '" . esc_sql($ml_initial_payment) . "',
103
- billing_amount = '" . esc_sql($ml_billing_amount) . "',
104
- cycle_number = '" . esc_sql($ml_cycle_number) . "',
105
- cycle_period = '" . esc_sql($ml_cycle_period) . "',
106
- billing_limit = '" . esc_sql($ml_billing_limit) . "',
107
- trial_amount = '" . esc_sql($ml_trial_amount) . "',
108
- trial_limit = '" . esc_sql($ml_trial_limit) . "',
109
- expiration_number = '" . esc_sql($ml_expiration_number) . "',
110
- expiration_period = '" . esc_sql($ml_expiration_period) . "',
111
- allow_signups = '" . esc_sql($ml_allow_signups) . "'
112
- WHERE id = '$saveid' LIMIT 1;";
113
- $wpdb->query($sqlQuery);
114
-
115
- pmpro_updateMembershipCategories( $saveid, $ml_categories );
116
- if(!mysql_errno())
117
- {
118
- $edit = false;
119
- $msg = 2;
120
- $msgt = __("Membership level updated successfully.", "pmpro");
121
- }
122
- else
123
- {
124
- $msg = -2;
125
- $msg = true;
126
- $msgt = __("Error updating membership level.", "pmpro");
127
- }
128
- }
129
- else
130
- {
131
- $sqlQuery = " INSERT INTO {$wpdb->pmpro_membership_levels}
132
- ( name, description, confirmation, initial_payment, billing_amount, cycle_number, cycle_period, billing_limit, trial_amount, trial_limit, expiration_number, expiration_period, allow_signups)
133
- VALUES
134
- ( '" . esc_sql($ml_name) . "', '" . esc_sql($ml_description) . "', '" . esc_sql($ml_confirmation) . "', '" . esc_sql($ml_initial_payment) . "', '" . esc_sql($ml_billing_amount) . "', '" . esc_sql($ml_cycle_number) . "', '" . esc_sql($ml_cycle_period) . "', '" . esc_sql($ml_billing_limit) . "', '" . esc_sql($ml_trial_amount) . "', '" . esc_sql($ml_trial_limit) . "', '" . esc_sql($ml_expiration_number) . "', '" . esc_sql($ml_expiration_period) . "', '" . esc_sql($ml_allow_signups) . "' )";
135
- $wpdb->query($sqlQuery);
136
- if(!mysql_errno())
137
- {
138
- $saveid = $wpdb->insert_id;
139
- pmpro_updateMembershipCategories( $saveid, $ml_categories );
140
-
141
- $edit = false;
142
- $msg = 1;
143
- $msgt = __("Membership level added successfully.", "pmpro");
144
- }
145
- else
146
- {
147
- $msg = -1;
148
- $msgt = __("Error adding membership level.", "pmpro");
149
- }
150
- }
151
-
152
- do_action("pmpro_save_membership_level", $saveid);
153
- }
154
- elseif($action == "delete_membership_level")
155
- {
156
- global $wpdb;
157
-
158
- $ml_id = intval($_REQUEST['deleteid']);
159
-
160
- if($ml_id > 0)
161
- {
162
- do_action("pmpro_delete_membership_level", $ml_id);
163
-
164
- //remove any categories from the ml
165
- $sqlQuery = "DELETE FROM $wpdb->pmpro_memberships_categories WHERE membership_id = '$ml_id'";
166
- $r1 = $wpdb->query($sqlQuery);
167
-
168
- //cancel any subscriptions to the ml
169
- $r2 = true;
170
- $user_ids = $wpdb->get_col("SELECT user_id FROM $wpdb->pmpro_memberships_users WHERE membership_id = '$ml_id' AND status = 'active'");
171
- foreach($user_ids as $user_id)
172
- {
173
- //change there membership level to none. that will handle the cancel
174
- if(pmpro_changeMembershipLevel(0, $user_id))
175
- {
176
- //okay
177
- }
178
- else
179
- {
180
- //couldn't delete the subscription
181
- //we should probably notify the admin
182
- $pmproemail = new PMProEmail();
183
- $pmproemail->data = array("body"=>"<p>" . sprintf(__("There was an error canceling the subscription for user with ID=%d. You will want to check your payment gateway to see if their subscription is still active.", "pmpro"), $user_id) . "</p>");
184
- $last_order = $wpdb->get_row("SELECT * FROM $wpdb->pmpro_membership_orders WHERE user_id = '" . $user_id . "' ORDER BY timestamp DESC LIMIT 1");
185
- if($last_order)
186
- $pmproemail->data["body"] .= "<p>" . __("Last Invoice", "pmpro") . ":<br />" . nl2br(var_export($last_order, true)) . "</p>";
187
- $pmproemail->sendEmail(get_bloginfo("admin_email"));
188
-
189
- $r2 = false;
190
- }
191
- }
192
-
193
- //delete the ml
194
- $sqlQuery = "DELETE FROM $wpdb->pmpro_membership_levels WHERE id = '$ml_id' LIMIT 1";
195
- $r3 = $wpdb->query($sqlQuery);
196
-
197
- if($r1 !== FALSE && $r2 !== FALSE && $r3 !== FALSE)
198
- {
199
- $msg = 3;
200
- $msgt = __("Membership level deleted successfully.", "pmpro");
201
- }
202
- else
203
- {
204
- $msg = -3;
205
- $msgt = __("Error deleting membership level.", "pmpro");
206
- }
207
- }
208
- else
209
- {
210
- $msg = -3;
211
- $msgt = __("Error deleting membership level.", "pmpro");
212
- }
213
- }
214
-
215
- require_once(dirname(__FILE__) . "/admin_header.php");
216
- ?>
217
-
218
- <?php
219
- if($edit)
220
- {
221
- ?>
222
-
223
- <h2>
224
- <?php
225
- if($edit > 0)
226
- echo __("Edit Membership Level", "pmpro");
227
- else
228
- echo __("Add New Membership Level", "pmpro");
229
- ?>
230
- </h2>
231
-
232
- <div>
233
- <?php
234
- // get the level...
235
- if(!empty($edit) && $edit > 0)
236
- {
237
- $level = $wpdb->get_row("SELECT * FROM $wpdb->pmpro_membership_levels WHERE id = '$edit' LIMIT 1", OBJECT);
238
- $temp_id = $level->id;
239
- }
240
- elseif(!empty($copy) && $copy > 0)
241
- {
242
- $level = $wpdb->get_row("SELECT * FROM $wpdb->pmpro_membership_levels WHERE id = '$copy' LIMIT 1", OBJECT);
243
- $temp_id = $level->id;
244
- $level->id = NULL;
245
- }
246
- else
247
-
248
- // didn't find a membership level, let's add a new one...
249
- if(empty($level))
250
- {
251
- $level = new stdClass();
252
- $level->id = NULL;
253
- $level->name = NULL;
254
- $level->description = NULL;
255
- $level->confirmation = NULL;
256
- $level->billing_amount = NULL;
257
- $level->trial_amount = NULL;
258
- $level->initial_payment = NULL;
259
- $level->billing_limit = NULL;
260
- $level->trial_limit = NULL;
261
- $level->expiration_number = NULL;
262
- $level->expiration_period = NULL;
263
- $edit = -1;
264
- }
265
-
266
- //defaults for new levels
267
- if(empty($copy) && $edit == -1)
268
- {
269
- $level->cycle_number = 1;
270
- $level->cycle_period = "Month";
271
- }
272
-
273
- // grab the categories for the given level...
274
- if(!empty($temp_id))
275
- $level->categories = $wpdb->get_col("SELECT c.category_id
276
- FROM $wpdb->pmpro_memberships_categories c
277
- WHERE c.membership_id = '" . $temp_id . "'");
278
- if(empty($level->categories))
279
- $level->categories = array();
280
-
281
- ?>
282
- <form action="" method="post" enctype="multipart/form-data">
283
- <input name="saveid" type="hidden" value="<?php echo esc_attr($edit); ?>" />
284
- <input type="hidden" name="action" value="save_membershiplevel" />
285
- <table class="form-table">
286
- <tbody>
287
- <tr>
288
- <th scope="row" valign="top"><label><?php _e('ID', 'pmpro');?>:</label></th>
289
- <td>
290
- <?php echo $level->id?>
291
- </td>
292
- </tr>
293
-
294
- <tr>
295
- <th scope="row" valign="top"><label for="name"><?php _e('Name', 'pmpro');?>:</label></th>
296
- <td><input name="name" type="text" size="50" value="<?php echo esc_attr($level->name);?>" /></td>
297
- </tr>
298
-
299
- <tr>
300
- <th scope="row" valign="top"><label for="description"><?php _e('Description', 'pmpro');?>:</label></th>
301
- <td>
302
- <div id="poststuff" class="pmpro_description">
303
- <?php
304
- if(version_compare($wp_version, "3.3") >= 0)
305
- wp_editor($level->description, "description", array("textarea_rows"=>5));
306
- else
307
- {
308
- ?>
309
- <textarea rows="10" cols="80" name="description" id="description"><?php echo esc_textarea($level->description);?></textarea>
310
- <?php
311
- }
312
- ?>
313
- </div>
314
- </td>
315
- </tr>
316
-
317
- <tr>
318
- <th scope="row" valign="top"><label for="confirmation"><?php _e('Confirmation Message', 'pmpro');?>:</label></th>
319
- <td>
320
- <div class="pmpro_confirmation">
321
- <?php
322
- if(version_compare($wp_version, "3.3") >= 0)
323
- wp_editor($level->confirmation, "confirmation", array("textarea_rows"=>5));
324
- else
325
- {
326
- ?>
327
- <textarea rows="10" cols="80" name="confirmation" id="confirmation"><?php echo esc_textarea($level->confirmation);?></textarea>
328
- <?php
329
- }
330
- ?>
331
- </div>
332
- </td>
333
- </tr>
334
- </tbody>
335
- </table>
336
-
337
- <h3 class="topborder"><?php _e('Billing Details', 'pmpro');?></h3>
338
- <table class="form-table">
339
- <tbody>
340
- <tr>
341
- <th scope="row" valign="top"><label for="initial_payment"><?php _e('Initial Payment', 'pmpro');?>:</label></th>
342
- <td>
343
- <?php
344
- if(pmpro_getCurrencyPosition() == "left")
345
- echo $pmpro_currency_symbol;
346
- ?>
347
- <input name="initial_payment" type="text" size="20" value="<?php echo esc_attr($level->initial_payment);?>" />
348
- <?php
349
- if(pmpro_getCurrencyPosition() == "right")
350
- echo $pmpro_currency_symbol;
351
- ?>
352
- <small><?php _e('The initial amount collected at registration.', 'pmpro');?></small></td>
353
- </tr>
354
-
355
- <tr>
356
- <th scope="row" valign="top"><label><?php _e('Recurring Subscription', 'pmpro');?>:</label></th>
357
- <td><input id="recurring" name="recurring" type="checkbox" value="yes" <?php if(pmpro_isLevelRecurring($level)) { echo "checked='checked'"; } ?> onclick="if(jQuery('#recurring').is(':checked')) { jQuery('.recurring_info').show(); if(jQuery('#custom_trial').is(':checked')) {jQuery('.trial_info').show();} else {jQuery('.trial_info').hide();} } else { jQuery('.recurring_info').hide();}" /> <label for="recurring"><?php _e('Check if this level has a recurring subscription payment.', 'pmpro');?></label></td>
358
- </tr>
359
-
360
- <tr class="recurring_info" <?php if(!pmpro_isLevelRecurring($level)) {?>style="display: none;"<?php } ?>>
361
- <th scope="row" valign="top"><label for="billing_amount"><?php _e('Billing Amount', 'pmpro');?>:</label></th>
362
- <td>
363
- <?php
364
- if(pmpro_getCurrencyPosition() == "left")
365
- echo $pmpro_currency_symbol;
366
- ?>
367
- <input name="billing_amount" type="text" size="20" value="<?php echo esc_attr($level->billing_amount);?>" />
368
- <?php
369
- if(pmpro_getCurrencyPosition() == "right")
370
- echo $pmpro_currency_symbol;
371
- ?>
372
- <small><?php _e('per', 'pmpro');?></small>
373
- <input id="cycle_number" name="cycle_number" type="text" size="10" value="<?php echo esc_attr($level->cycle_number);?>" />
374
- <select id="cycle_period" name="cycle_period">
375
- <?php
376
- $cycles = array( __('Day(s)', 'pmpro') => 'Day', __('Week(s)', 'pmpro') => 'Week', __('Month(s)', 'pmpro') => 'Month', __('Year(s)', 'pmpro') => 'Year' );
377
- foreach ( $cycles as $name => $value ) {
378
- echo "<option value='$value'";
379
- if ( $level->cycle_period == $value ) echo " selected='selected'";
380
- echo ">$name</option>";
381
- }
382
- ?>
383
- </select>
384
- <br /><small>
385
- <?php _e('The amount to be billed one cycle after the initial payment.', 'pmpro');?>
386
- <?php if($gateway == "stripe") { ?>
387
- <br /><strong <?php if(!empty($pmpro_stripe_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Stripe integration currently only supports billing periods of "Week", "Month" or "Year".', 'pmpro');?>
388
- <?php } elseif($gateway == "braintree") { ?>
389
- <br /><strong <?php if(!empty($pmpro_braintree_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Braintree integration currently only supports billing periods of "Month" or "Year".', 'pmpro');?>
390
- <?php } elseif($gateway == "payflowpro") { ?>
391
- <br /><strong <?php if(!empty($pmpro_payflow_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Payflow integration currently only supports billing frequencies of 1 and billing periods of "Week", "Month" or "Year".', 'pmpro');?>
392
- <?php } ?>
393
- </small>
394
- <?php if($gateway == "braintree" && $edit < 0) { ?>
395
- <p class="pmpro_message"><strong><?php _e('Note', 'pmpro');?>:</strong> <?php _e('After saving this level, make note of the ID and create a "Plan" in your Braintree dashboard with the same settings and the "Plan ID" set to <em>pmpro_#</em>, where # is the level ID.', 'pmpro');?></p>
396
- <?php } elseif($gateway == "braintree") { ?>
397
- <p class="pmpro_message"><strong><?php _e('Note', 'pmpro');?>:</strong> <?php _e('You will need to create a "Plan" in your Braintree dashboard with the same settings and the "Plan ID" set to', 'pmpro');?> <em>pmpro_<?php echo $level->id;?></em>.</p>
398
- <?php } ?>
399
- </td>
400
- </tr>
401
-
402
- <tr class="recurring_info" <?php if(!pmpro_isLevelRecurring($level)) {?>style="display: none;"<?php } ?>>
403
- <th scope="row" valign="top"><label for="billing_limit"><?php _e('Billing Cycle Limit', 'pmpro');?>:</label></th>
404
- <td>
405
- <input name="billing_limit" type="text" size="20" value="<?php echo $level->billing_limit?>" />
406
- <br /><small>
407
- <?php _e('The <strong>total</strong> number of recurring billing cycles for this level, including the trial period (if applicable) but not including the initial payment. Set to zero if membership is indefinite.', 'pmpro');?>
408
- <?php if($gateway == "stripe") { ?>
409
- <br /><strong <?php if(!empty($pmpro_stripe_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Stripe integration currently does not support billing limits. You can still set an expiration date below.', 'pmpro');?></strong>
410
- <?php } ?>
411
- </small>
412
- </td>
413
- </tr>
414
-
415
- <tr class="recurring_info" <?php if (!pmpro_isLevelRecurring($level)) echo "style='display:none;'";?>>
416
- <th scope="row" valign="top"><label><?php _e('Custom Trial', 'pmpro');?>:</label></th>
417
- <td>
418
- <input id="custom_trial" name="custom_trial" type="checkbox" value="yes" <?php if ( pmpro_isLevelTrial($level) ) { echo "checked='checked'"; } ?> onclick="jQuery('.trial_info').toggle();" /> <label for="custom_trial"><?php _e('Check to add a custom trial period.', 'pmpro');?></label>
419
-
420
- <?php if($gateway == "twocheckout") { ?>
421
- <br /><small><strong <?php if(!empty($pmpro_twocheckout_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('2Checkout integration does not support custom trials. You can do one period trials by setting an initial payment different from the billing amount.', 'pmpro');?></strong></small>
422
- <?php } ?>
423
- </td>
424
- </tr>
425
-
426
- <tr class="trial_info recurring_info" <?php if (!pmpro_isLevelTrial($level)) echo "style='display:none;'";?>>
427
- <th scope="row" valign="top"><label for="trial_amount"><?php _e('Trial Billing Amount', 'pmpro');?>:</label></th>
428
- <td>
429
- <?php
430
- if(pmpro_getCurrencyPosition() == "left")
431
- echo $pmpro_currency_symbol;
432
- ?>
433
- <input name="trial_amount" type="text" size="20" value="<?php echo esc_attr($level->trial_amount);?>" />
434
- <?php
435
- if(pmpro_getCurrencyPosition() == "right")
436
- echo $pmpro_currency_symbol;
437
- ?>
438
- <small><?php _e('for the first', 'pmpro');?></small>
439
- <input name="trial_limit" type="text" size="10" value="<?php echo esc_attr($level->trial_limit);?>" />
440
- <small><?php _e('subscription payments', 'pmpro');?>.</small>
441
- <?php if($gateway == "stripe") { ?>
442
- <br /><small>
443
- <strong <?php if(!empty($pmpro_stripe_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Stripe integration currently does not support trial amounts greater than $0.', 'pmpro');?></strong>
444
- </small>
445
- <?php } elseif($gateway == "braintree") { ?>
446
- <br /><small>
447
- <strong <?php if(!empty($pmpro_braintree_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Braintree integration currently does not support trial amounts greater than $0.', 'pmpro');?></strong>
448
- </small>
449
- <?php } elseif($gateway == "payflowpro") { ?>
450
- <br /><small>
451
- <strong <?php if(!empty($pmpro_payflow_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Payflow integration currently does not support trial amounts greater than $0.', 'pmpro');?></strong>
452
- </small>
453
- <?php } ?>
454
- </td>
455
- </tr>
456
-
457
- </tbody>
458
- </table>
459
-
460
- <h3 class="topborder"><?php _e('Other Settings', 'pmpro');?></h3>
461
- <table class="form-table">
462
- <tbody>
463
- <tr>
464
- <th scope="row" valign="top"><label><?php _e('Disable New Signups', 'pmpro');?>:</label></th>
465
- <td><input id="disable_signups" name="disable_signups" type="checkbox" value="yes" <?php if($level->id && !$level->allow_signups) { ?>checked="checked"<?php } ?> /> <label for="disable_signups"><?php _e('Check to hide this level from the membership levels page and disable registration.', 'pmpro');?></label></td>
466
- </tr>
467
-
468
- <tr>
469
- <th scope="row" valign="top"><label><?php _e('Membership Expiration', 'pmpro');?>:</label></th>
470
- <td><input id="expiration" name="expiration" type="checkbox" value="yes" <?php if(pmpro_isLevelExpiring($level)) { echo "checked='checked'"; } ?> onclick="if(jQuery('#expiration').is(':checked')) { jQuery('.expiration_info').show(); } else { jQuery('.expiration_info').hide();}" /> <label for="expiration"><?php _e('Check this to set when membership access expires.', 'pmpro');?></a></td>
471
- </tr>
472
-
473
- <tr class="expiration_info" <?php if(!pmpro_isLevelExpiring($level)) {?>style="display: none;"<?php } ?>>
474
- <th scope="row" valign="top"><label for="billing_amount"><?php _e('Expires In', 'pmpro');?>:</label></th>
475
- <td>
476
- <input id="expiration_number" name="expiration_number" type="text" size="10" value="<?php echo esc_attr($level->expiration_number);?>" />
477
- <select id="expiration_period" name="expiration_period">
478
- <?php
479
- $cycles = array( __('Day(s)', 'pmpro') => 'Day', __('Week(s)', 'pmpro') => 'Week', __('Month(s)', 'pmpro') => 'Month', __('Year(s)', 'pmpro') => 'Year' );
480
- foreach ( $cycles as $name => $value ) {
481
- echo "<option value='$value'";
482
- if ( $level->expiration_period == $value ) echo " selected='selected'";
483
- echo ">$name</option>";
484
- }
485
- ?>
486
- </select>
487
- <br /><small><?php _e('Set the duration of membership access. Note that the any future payments (recurring subscription, if any) will be cancelled when the membership expires.', 'pmpro');?></small>
488
- </td>
489
- </tr>
490
- </tbody>
491
- </table>
492
-
493
- <?php do_action("pmpro_membership_level_after_other_settings"); ?>
494
-
495
- <h3 class="topborder"><?php _e('Content Settings', 'pmpro');?></h3>
496
- <table class="form-table">
497
- <tbody>
498
- <tr>
499
- <th scope="row" valign="top"><label><?php _e('Categories', 'pmpro');?>:</label></th>
500
- <td>
501
- <?php
502
- $categories = get_categories( array( 'hide_empty' => 0 ) );
503
- echo "<ul>";
504
- foreach ( $categories as $cat )
505
- {
506
- $checked = in_array( $cat->term_id, $level->categories ) ? "checked='checked'" : '';
507
- echo "<li><input id='membershipcategory_{$cat->term_id}' name='membershipcategory_{$cat->term_id}' type='checkbox' value='yes' $checked /> <label for='membershipcategory_{$cat->term_id}'>{$cat->name}</label></li>\n";
508
- }
509
- echo "</ul>";
510
- ?>
511
- </td>
512
- </tr>
513
- </tbody>
514
- </table>
515
- <p class="submit topborder">
516
- <input name="save" type="submit" class="button-primary" value="<?php _e('Save Level', 'pmpro'); ?>" />
517
- <input name="cancel" type="button" value="<?php _e('Cancel', 'pmpro'); ?>" onclick="location.href='<?php echo get_admin_url(NULL, '/admin.php?page=pmpro-membershiplevels')?>';" />
518
- </p>
519
- </form>
520
- </div>
521
-
522
- <?php
523
- }
524
- else
525
- {
526
- $sqlQuery = "SELECT * FROM $wpdb->pmpro_membership_levels ";
527
- if($s)
528
- $sqlQuery .= "WHERE name LIKE '%$s%' ";
529
- $sqlQuery .= "ORDER BY id ASC";
530
-
531
- $levels = $wpdb->get_results($sqlQuery, OBJECT);
532
-
533
- if(empty($_REQUEST['s']) && !empty($pmpro_level_order)) {
534
- //reorder levels
535
- $order = explode(',', $pmpro_level_order);
536
-
537
- //put level ids in their own array
538
- $level_ids = array();
539
- foreach($levels as $level)
540
- $level_ids[] = $level->id;
541
-
542
- //remove levels from order if they are gone
543
- foreach($order as $key => $level_id)
544
- if(!in_array($level_id, $level_ids))
545
- unset($order[$key]);
546
-
547
- //add levels to the end if they aren't in the order array
548
- foreach($level_ids as $level_id)
549
- if(!in_array($level_id, $order))
550
- $order[] = $level_id;
551
-
552
- //remove dupes
553
- $order = array_unique($order);
554
-
555
- //save the level order
556
- pmpro_setOption('level_order', implode(',', $order));
557
-
558
- //reorder levels here
559
- $reordered_levels = array();
560
- foreach ($order as $level_id) {
561
- foreach ($levels as $level) {
562
- if ($level_id == $level->id)
563
- $reordered_levels[] = $level;
564
- }
565
- }
566
- }
567
- else
568
- $reordered_levels = $levels;
569
-
570
- if(empty($_REQUEST['s']) && count($reordered_levels) > 1)
571
- {
572
- ?>
573
- <script>
574
- jQuery(document).ready(function($) {
575
-
576
- // Return a helper with preserved width of cells
577
- // from http://www.foliotek.com/devblog/make-table-rows-sortable-using-jquery-ui-sortable/
578
- var fixHelper = function(e, ui) {
579
- ui.children().each(function() {
580
- $(this).width($(this).width());
581
- });
582
- return ui;
583
- };
584
-
585
- $("table.membership-levels tbody").sortable({
586
- helper: fixHelper,
587
- placeholder: 'testclass',
588
- forcePlaceholderSize: true,
589
- update: update_level_order
590
- });
591
-
592
- function update_level_order(event, ui) {
593
- level_order = [];
594
- $("table.membership-levels tbody tr").each(function() {
595
- $(this).removeClass('alternate');
596
- level_order.push(parseInt( $("td:first", this).text()));
597
- });
598
-
599
- //update styles
600
- $("table.membership-levels tbody tr:odd").each(function() {
601
- $(this).addClass('alternate');
602
- });
603
-
604
- data = {
605
- action: 'pmpro_update_level_order',
606
- level_order: level_order
607
- };
608
-
609
- $.post(ajaxurl, data, function(response) {
610
- });
611
- }
612
- });
613
- </script>
614
- <?php
615
- }
616
- ?>
617
-
618
- <h2 class="alignleft"><?php _e('Membership Levels', 'pmpro');?> <a href="admin.php?page=pmpro-membershiplevels&edit=-1" class="add-new-h2"><?php _e('Add New Level', 'pmpro');?></a></h2>
619
- <form id="posts-filter" method="get" action="">
620
- <p class="search-box">
621
- <label class="screen-reader-text" for="post-search-input"><?php _e('Search Levels', 'pmpro');?>:</label>
622
- <input type="hidden" name="page" value="pmpro-membershiplevels" />
623
- <input id="post-search-input" type="text" value="<?php echo esc_attr($s); ?>" name="s" size="30" />
624
- <input class="button" type="submit" value="<?php _e('Search Levels', 'pmpro');?>" id="search-submit" />
625
- </p>
626
- </form>
627
-
628
- <?php if(empty($_REQUEST['s']) && count($reordered_levels) > 1) { ?>
629
- <br class="clear" />
630
- <p><?php _e('Drag and drop membership levels to reorder them on the Levels page.', 'pmpro'); ?></p>
631
- <?php } ?>
632
-
633
- <table class="widefat membership-levels">
634
- <thead>
635
- <tr>
636
- <th><?php _e('ID', 'pmpro');?></th>
637
- <th><?php _e('Name', 'pmpro');?></th>
638
- <th><?php _e('Billing Details', 'pmpro');?></th>
639
- <th><?php _e('Expiration', 'pmpro');?></th>
640
- <th><?php _e('Allow Signups', 'pmpro');?></th>
641
- <th></th>
642
- </tr>
643
- </thead>
644
- <tbody>
645
- <?php
646
- $count = 0;
647
- foreach($reordered_levels as $level)
648
- {
649
- ?>
650
- <tr class="<?php if($count++ % 2 == 1) { ?>alternate<?php } ?> <?php if(!$level->allow_signups) { ?>pmpro_gray<?php } ?> <?php if(!pmpro_checkLevelForStripeCompatibility($level) || !pmpro_checkLevelForBraintreeCompatibility($level) || !pmpro_checkLevelForPayflowCompatibility($level) || !pmpro_checkLevelForTwoCheckoutCompatibility($level)) { ?>pmpro_error<?php } ?>">
651
- <td><?php echo $level->id?></td>
652
- <td class="level_name"><a href="admin.php?page=pmpro-membershiplevels&edit=<?php echo $level->id?>"><?php echo $level->name?></a></td>
653
- <td>
654
- <?php if(pmpro_isLevelFree($level)) { ?>
655
- <?php _e('FREE', 'pmpro');?>
656
- <?php } else { ?>
657
- <?php echo str_replace( 'The price for membership is', '', pmpro_getLevelCost($level)); ?>
658
- <?php } ?>
659
- </td>
660
- <td>
661
- <?php if(!pmpro_isLevelExpiring($level)) { ?>
662
- --
663
- <?php } else { ?>
664
- <?php _e('After', 'pmpro');?> <?php echo $level->expiration_number?> <?php echo sornot($level->expiration_period,$level->expiration_number)?>
665
- <?php } ?>
666
- </td>
667
- <td><?php if($level->allow_signups) { ?><a href="<?php echo pmpro_url("checkout", "?level=" . $level->id);?>"><?php _e('Yes', 'pmpro');?></a><?php } else { ?><?php _e('No', 'pmpro');?><?php } ?></td>
668
-
669
- <td><a title="<?php _e('edit','pmpro'); ?>" href="admin.php?page=pmpro-membershiplevels&edit=<?php echo $level->id?>" class="button-primary"><?php _e('edit','pmpro'); ?></a>&nbsp;<a title="<?php _e('copy','pmpro'); ?>" href="admin.php?page=pmpro-membershiplevels&copy=<?php echo $level->id?>&edit=-1" class="button-secondary"><?php _e('copy','pmpro'); ?></a>&nbsp;<a title="<?php _e('delete','pmpro'); ?>" href="javascript: askfirst('<?php echo str_replace("'", "\'", sprintf(__("Are you sure you want to delete membership level %s? All subscriptions will be cancelled.", "pmpro"), $level->name));?>','admin.php?page=pmpro-membershiplevels&action=delete_membership_level&deleteid=<?php echo $level->id?>'); void(0);" class="button-secondary"><?php _e('delete','pmpro'); ?></a></td>
670
- </tr>
671
- <?php
672
- }
673
- ?>
674
- </tbody>
675
- </table>
676
- <?php
677
- }
678
- ?>
679
-
680
- <?php
681
- require_once(dirname(__FILE__) . "/admin_footer.php");
682
?>
1
+ <?php
2
+ //only admins can get this
3
+ if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_membershiplevels")))
4
+ {
5
+ die(__("You do not have permissions to perform this action.", "pmpro"));
6
+ }
7
+
8
+ global $wpdb, $msg, $msgt, $pmpro_currency_symbol;
9
+
10
+ //some vars
11
+ $gateway = pmpro_getOption("gateway");
12
+ $pmpro_level_order = pmpro_getOption('level_order');
13
+
14
+ global $pmpro_stripe_error, $pmpro_braintree_error, $pmpro_payflow_error, $pmpro_twocheckout_error, $wp_version;
15
+
16
+ if(isset($_REQUEST['edit']))
17
+ $edit = intval($_REQUEST['edit']);
18
+ else
19
+ $edit = false;
20
+ if(isset($_REQUEST['copy']))
21
+ $copy = intval($_REQUEST['copy']);
22
+ if(isset($_REQUEST['s']))
23
+ $s = sanitize_text_field($_REQUEST['s']);
24
+ else
25
+ $s = "";
26
+
27
+ if(isset($_REQUEST['action']))
28
+ $action = sanitize_text_field($_REQUEST['action']);
29
+ else
30
+ $action = false;
31
+
32
+ if(isset($_REQUEST['saveandnext']))
33
+ $saveandnext = intval($_REQUEST['saveandnext']);
34
+
35
+ if(isset($_REQUEST['saveid']))
36
+ $saveid = intval($_REQUEST['saveid']);
37
+ if(isset($_REQUEST['deleteid']))
38
+ $deleteid = intval($_REQUEST['deleteid']);
39
+
40
+ if($action == "save_membershiplevel")
41
+ {
42
+ $ml_name = stripslashes($_REQUEST['name']);
43
+ $ml_description = stripslashes($_REQUEST['description']);
44
+ $ml_confirmation = stripslashes($_REQUEST['confirmation']);
45
+ $ml_initial_payment = stripslashes($_REQUEST['initial_payment']);
46
+ if(!empty($_REQUEST['recurring']))
47
+ $ml_recurring = 1;
48
+ else
49
+ $ml_recurring = 0;
50
+ $ml_billing_amount = stripslashes($_REQUEST['billing_amount']);
51
+ $ml_cycle_number = stripslashes($_REQUEST['cycle_number']);
52
+ $ml_cycle_period = stripslashes($_REQUEST['cycle_period']);
53
+ $ml_billing_limit = stripslashes($_REQUEST['billing_limit']);
54
+ if(!empty($_REQUEST['custom_trial']))
55
+ $ml_custom_trial = 1;
56
+ else
57
+ $ml_custom_trial = 0;
58
+ $ml_trial_amount = stripslashes($_REQUEST['trial_amount']);
59
+ $ml_trial_limit = stripslashes($_REQUEST['trial_limit']);
60
+ if(!empty($_REQUEST['expiration']))
61
+ $ml_expiration = 1;
62
+ else
63
+ $ml_expiration = 0;
64
+ $ml_expiration_number = stripslashes($_REQUEST['expiration_number']);
65
+ $ml_expiration_period = stripslashes($_REQUEST['expiration_period']);
66
+ $ml_categories = array();
67
+
68
+ //reversing disable to allow here
69
+ if(empty($_REQUEST['disable_signups']))
70
+ $ml_allow_signups = 1;
71
+ else
72
+ $ml_allow_signups = 0;
73
+
74