/** * Process registration * * @since 2.5 */ public function process_signup() { if (!empty($_POST['rcp_stripe_checkout'])) { $this->auto_renew = '2' === rcp_get_auto_renew_behavior() || '0' === $this->length ? false : true; } parent::process_signup(); }
function rcp_add_auto_renew( $levels = array() ) { if( '3' == rcp_get_auto_renew_behavior() ) : ?> <p id="rcp_auto_renew_wrap"> <input name="rcp_auto_renew" id="rcp_auto_renew" type="checkbox" checked="checked"/> <label for="rcp_auto_renew"><?php echo apply_filters ( 'rcp_registration_auto_renew', __( 'Auto Renew', 'rcp' ) ); ?></label> </p> <?php endif; }
/** * Register a new user * * @access public * @since 1.0 */ function rcp_process_registration() { if ( isset( $_POST["rcp_register_nonce"] ) && wp_verify_nonce( $_POST['rcp_register_nonce'], 'rcp-register-nonce' ) ) { global $rcp_options, $user_ID; $subscription_id = isset( $_POST['rcp_level'] ) ? absint( $_POST['rcp_level'] ) : false; $discount = isset( $_POST['rcp_discount'] ) ? sanitize_text_field( $_POST['rcp_discount'] ) : ''; $discount_valid = false; $price = number_format( (float) rcp_get_subscription_price( $subscription_id ), 2 ); $price = str_replace( ',', '', $price ); $base_price = $price; // Used for discount calculations later $expiration = rcp_get_subscription_length( $subscription_id ); $subscription = rcp_get_subscription_details( $subscription_id ); // get the selected payment method/gateway if( ! isset( $_POST['rcp_gateway'] ) ) { $gateway = 'paypal'; } else { $gateway = sanitize_text_field( $_POST['rcp_gateway'] ); } /*********************** * validate the form ***********************/ do_action( 'rcp_before_form_errors', $_POST ); $is_ajax = isset( $_POST['rcp_ajax'] ); $user_data = rcp_validate_user_data(); if( ! $subscription_id ) { // no subscription level was chosen rcp_errors()->add( 'no_level', __( 'Please choose a subscription level', 'rcp' ), 'register' ); } if( $subscription_id ) { if( $price == 0 && $expiration->duration > 0 && rcp_has_used_trial( $user_data['id'] ) ) { // this ensures that users only sign up for a free trial once rcp_errors()->add( 'free_trial_used', __( 'You may only sign up for a free trial once', 'rcp' ), 'register' ); } } if( ! empty( $discount ) ) { if( rcp_validate_discount( $discount, $subscription_id ) ) { $discount_valid = true; } else { // the entered discount code is incorrect rcp_errors()->add( 'invalid_discount', __( 'The discount you entered is invalid', 'rcp' ), 'register' ); } if( $discount_valid && $price > 0 ) { if( ! $user_data['need_new'] && rcp_user_has_used_discount( $user_data['id'] , $discount ) && apply_filters( 'rcp_discounts_once_per_user', true ) ) { $discount_valid = false; rcp_errors()->add( 'discount_already_used', __( 'You can only use the discount code once', 'rcp' ), 'register' ); } if( $discount_valid ) { $discounts = new RCP_Discounts(); $discount_obj = $discounts->get_by( 'code', $discount ); if( is_object( $discount_obj ) ) { // calculate the after-discount price $price = $discounts->calc_discounted_price( $base_price, $discount_obj->amount, $discount_obj->unit ); } } } } if( $price == 0 && isset( $_POST['rcp_auto_renew'] ) ) { // since free subscriptions do not go through PayPal, they cannot be auto renewed rcp_errors()->add( 'invalid_auto_renew', __( 'Free subscriptions cannot be automatically renewed', 'rcp' ), 'register' ); } // Validate extra fields in gateways with the 2.1+ gateway API if( ! has_action( 'rcp_gateway_' . $gateway ) && $price > 0 ) { $gateways = new RCP_Payment_Gateways; $gateway_var = $gateways->get_gateway( $gateway ); $gateway_obj = new $gateway_var['class']; $gateway_obj->validate_fields(); } do_action( 'rcp_form_errors', $_POST ); // retrieve all error messages, if any $errors = rcp_errors()->get_error_messages(); if ( ! empty( $errors ) && $is_ajax ) { wp_send_json_error( array( 'success' => false, 'errors' => rcp_get_error_messages_html( 'register' ), 'nonce' => wp_create_nonce( 'rcp-register-nonce' ) ) ); } elseif( $is_ajax ) { wp_send_json_success( array( 'success' => true ) ); } // only create the user if there are no errors if( ! empty( $errors ) ) { return; } // deterime the expiration date of the user's subscription if( $expiration->duration > 0 ) { $member_expires = rcp_calc_member_expiration( $expiration ); } else { $member_expires = 'none'; } if( $user_data['need_new'] ) { $user_data['id'] = wp_insert_user( array( 'user_login' => $user_data['login'], 'user_pass' => $user_data['password'], 'user_email' => $user_data['email'], 'first_name' => $user_data['first_name'], 'last_name' => $user_data['last_name'], 'user_registered' => date( 'Y-m-d H:i:s' ) ) ); } if( $user_data['id'] ) { if( ! rcp_is_active( $user_data['id'] ) ) { rcp_set_status( $user_data['id'], 'pending' ); } // setup a unique key for this subscription $subscription_key = rcp_generate_subscription_key(); update_user_meta( $user_data['id'], 'rcp_subscription_key', $subscription_key ); update_user_meta( $user_data['id'], 'rcp_subscription_level', $subscription_id ); rcp_set_expiration_date( $user_data['id'], $member_expires ); // Set the user's role $role = ! empty( $subscription->role ) ? $subscription->role : 'subscriber'; $user = new WP_User( $user_data['id'] ); $user->add_role( apply_filters( 'rcp_default_user_level', $role, $subscription_id ) ); do_action( 'rcp_form_processing', $_POST, $user_data['id'], $price ); // process a paid subscription if( $price > '0' ) { if( ! empty( $discount ) ) { // record the usage of this discount code $discounts->add_to_user( $user_data['id'], $discount ); // incrase the usage count for the code $discounts->increase_uses( $discount_obj->id ); // if the discount is 100%, log the user in and redirect to success page if( $price == '0' ) { rcp_set_status( $user_data['id'], 'active' ); rcp_email_subscription_status( $user_data['id'], 'active' ); rcp_login_user_in( $user_data['id'], $user_data['login'] ); wp_redirect( rcp_get_return_url( $user_data['id'] ) ); exit; } } // Determine auto renew behavior if( '3' == rcp_get_auto_renew_behavior() && isset( $_POST['rcp_auto_renew'] ) ) { $auto_renew = true; } elseif( '1' == rcp_get_auto_renew_behavior() ) { $auto_renew = true; } else { $auto_renew = false; } // Remove trialing status, if it exists delete_user_meta( $user_data['id'], 'rcp_is_trialing' ); // log the new user in rcp_login_user_in( $user_data['id'], $user_data['login'] ); $redirect = rcp_get_return_url( $user_data['id'] ); $subscription_data = array( 'price' => $price, 'discount' => $base_price - $price, 'discount_code' => $discount, 'fee' => ! empty( $subscription->fee ) ? number_format( $subscription->fee, 2 ) : 0, 'length' => $expiration->duration, 'length_unit' => strtolower( $expiration->duration_unit ), 'subscription_id' => $subscription->id, 'subscription_name' => $subscription->name, 'key' => $subscription_key, 'user_id' => $user_data['id'], 'user_name' => $user_data['login'], 'user_email' => $user_data['email'], 'currency' => $rcp_options['currency'], 'auto_renew' => $auto_renew, 'return_url' => $redirect, 'new_user' => $user_data['need_new'], 'post_data' => $_POST ); // send all of the subscription data off for processing by the gateway rcp_send_to_gateway( $gateway, apply_filters( 'rcp_subscription_data', $subscription_data ) ); // process a free or trial subscription } else { // This is a free user registration or trial // if the subscription is a free trial, we need to record it in the user meta if( $member_expires != 'none' ) { // this is so that users can only sign up for one trial update_user_meta( $user_data['id'], 'rcp_has_trialed', 'yes' ); update_user_meta( $user_data['id'], 'rcp_is_trialing', 'yes' ); // activate the user's trial subscription rcp_set_status( $user_data['id'], 'active' ); rcp_email_subscription_status( $user_data['id'], 'trial' ); } else { // set the user's status to free rcp_set_status( $user_data['id'], 'free' ); rcp_email_subscription_status( $user_data['id'], 'free' ); } // date for trial / paid users, "none" for free users rcp_set_expiration_date( $user_data['id'], $member_expires ); if( $user_data['need_new'] ) { if( ! isset( $rcp_options['disable_new_user_notices'] ) ) { // send an email to the admin alerting them of the registration wp_new_user_notification( $user_data['id']) ; } // log the new user in rcp_login_user_in( $user_data['id'], $user_data['login'] ); } // send the newly created user to the redirect page after logging them in wp_redirect( rcp_get_return_url( $user_data['id'] ) ); exit; } // end price check } // end if new user id } // end nonce check }
function rcp_settings_page() { global $rcp_options; $defaults = array('currency_position' => 'before', 'currency' => 'USD', 'registration_page' => 0, 'redirect' => 0, 'redirect_from_premium' => 0, 'login_redirect' => 0); $rcp_options = wp_parse_args($rcp_options, $defaults); ?> <div class="wrap"> <?php if (!isset($_REQUEST['updated'])) { $_REQUEST['updated'] = false; } ?> <?php if (false !== $_REQUEST['updated']) { ?> <div class="updated fade"><p><strong><?php _e('Options saved', 'rcp'); ?> </strong></p></div> <?php } ?> <form method="post" action="options.php" class="rcp_options_form"> <?php settings_fields('rcp_settings_group'); ?> <?php $pages = get_pages(); ?> <h2 class="nav-tab-wrapper"> <?php _e('Restrict Content Pro', 'rcp'); ?> <a href="#general" class="nav-tab"><?php _e('General', 'rcp'); ?> </a> <a href="#payments" class="nav-tab"><?php _e('Payments', 'rcp'); ?> </a> <a href="#emails" class="nav-tab"><?php _e('Emails', 'rcp'); ?> </a> <a href="#invoices" class="nav-tab"><?php _e('PDF Invoices', 'rcp'); ?> </a> <a href="#misc" class="nav-tab"><?php _e('Misc', 'rcp'); ?> </a> </h2> <div id="tab_container"> <div class="tab_content" id="general"> <table class="form-table"> <tr valign="top"> <th colspan=2> <h3><?php _e('General', 'rcp'); ?> </h3> </th> </tr> <tr valign="top"> <th> <label for="rcp_settings[license_key]"><?php _e('License Key', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[license_key]" style="width: 300px;" name="rcp_settings[license_key]" value="<?php if (isset($rcp_options['license_key'])) { echo $rcp_options['license_key']; } ?> "/> <?php $status = get_option('rcp_license_status'); ?> <?php if ($status !== false && $status == 'valid') { ?> <?php wp_nonce_field('rcp_deactivate_license', 'rcp_deactivate_license'); ?> <input type="submit" class="button-secondary" name="rcp_license_deactivate" value="<?php _e('Deactivate License', 'rcp'); ?> "/> <span style="color:green;"><?php _e('active'); ?> </span> <?php } elseif (!empty($rcp_options['license_key'])) { ?> <input type="submit" class="button-secondary" name="rcp_license_activate" value="<?php _e('Activate License', 'rcp'); ?> "/> <?php } ?> <p class="description"><?php printf(__('Enter license key for Restrict Content Pro. This is required for automatic updates and <a href="%s">support</a>.', 'rcp'), 'http://pippinsplugins.com/plugin-support'); ?> </p> </td> </tr> <?php do_action('rcp_license_settings', $rcp_options); ?> <tr valign="top"> <th> <label for="rcp_settings[registration_page]"><?php _e('Registration Page', 'rcp'); ?> </label> </th> <td> <select id="rcp_settings[registration_page]" name="rcp_settings[registration_page]"> <?php if ($pages) { foreach ($pages as $page) { $option = '<option value="' . $page->ID . '" ' . selected($page->ID, $rcp_options['registration_page'], false) . '>'; $option .= $page->post_title; $option .= ' (ID: ' . $page->ID . ')'; $option .= '</option>'; echo $option; } } else { echo '<option>' . __('No pages found', 'rcp') . '</option>'; } ?> </select> <p class="description"><?php _e('Choose the page that has the [register_form] short code.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[redirect]"><?php _e('Success Page', 'rcp'); ?> </label> </th> <td> <select id="rcp_settings[redirect]" name="rcp_settings[redirect]"> <?php if ($pages) { foreach ($pages as $page) { $option = '<option value="' . $page->ID . '" ' . selected($page->ID, $rcp_options['redirect'], false) . '>'; $option .= $page->post_title; $option .= ' (ID: ' . $page->ID . ')'; $option .= '</option>'; echo $option; } } else { echo '<option>' . __('No pages found', 'rcp') . '</option>'; } ?> </select> <p class="description"><?php _e('This is the page users are redirected to after a successful registration.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[account_page]"><?php _e('Account Page', 'rcp'); ?> </label> </th> <td> <select id="rcp_settings[account_page]" name="rcp_settings[account_page]"> <?php if ($pages) { $rcp_options['account_page'] = isset($rcp_options['account_page']) ? absint($rcp_options['account_page']) : 0; foreach ($pages as $page) { $option = '<option value="' . $page->ID . '" ' . selected($page->ID, $rcp_options['account_page'], false) . '>'; $option .= $page->post_title; $option .= ' (ID: ' . $page->ID . ')'; $option .= '</option>'; echo $option; } } else { echo '<option>' . __('No pages found', 'rcp') . '</option>'; } ?> </select> <p class="description"><?php _e('This page displays the account and membership information for members. Contains [subscription_details] shortcode.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[edit_profile]"><?php _e('Edit Profile Page', 'rcp'); ?> </label> </th> <td> <select id="rcp_settings[edit_profile]" name="rcp_settings[edit_profile]"> <?php if ($pages) { $rcp_options['edit_profile'] = isset($rcp_options['edit_profile']) ? absint($rcp_options['edit_profile']) : 0; foreach ($pages as $page) { $option = '<option value="' . $page->ID . '" ' . selected($page->ID, $rcp_options['edit_profile'], false) . '>'; $option .= $page->post_title; $option .= ' (ID: ' . $page->ID . ')'; $option .= '</option>'; echo $option; } } else { echo '<option>' . __('No pages found', 'rcp') . '</option>'; } ?> </select> <p class="description"><?php _e('This page displays a profile edit form for logged-in members. Contains [rcp_profile_editor] shortcode.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[update_card]"><?php _e('Update Billing Card Page', 'rcp'); ?> </label> </th> <td> <select id="rcp_settings[update_card]" name="rcp_settings[update_card]"> <?php if ($pages) { $rcp_options['update_card'] = isset($rcp_options['update_card']) ? absint($rcp_options['update_card']) : 0; foreach ($pages as $page) { $option = '<option value="' . $page->ID . '" ' . selected($page->ID, $rcp_options['update_card'], false) . '>'; $option .= $page->post_title; $option .= ' (ID: ' . $page->ID . ')'; $option .= '</option>'; echo $option; } } else { echo '<option>' . __('No pages found', 'rcp') . '</option>'; } ?> </select> <p class="description"><?php _e('This page displays a profile edit form for logged-in members. Contains [rcp_update_card] shortcode.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[auto_renew]"><?php _e('Auto Renew', 'rcp'); ?> </label> </th> <td> <select name="rcp_settings[auto_renew]" id="rcp_settings[auto_renew]"> <option value="1"<?php selected('1', rcp_get_auto_renew_behavior()); ?> ><?php _e('Always auto renew', 'rcp'); ?> </option> <option value="2"<?php selected('2', rcp_get_auto_renew_behavior()); ?> ><?php _e('Never auto renew', 'rcp'); ?> </option> <option value="3"<?php selected('3', rcp_get_auto_renew_behavior()); ?> ><?php _e('Let customer choose whether to auto renew', 'rcp'); ?> </option> </select> <p class="description"><?php _e('Select the auto renew behavior you would like subscription levels to have.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[free_message]"><?php _e('Free Content Message', 'rcp'); ?> </label> </th> <td> <?php $free_message = isset($rcp_options['free_message']) ? $rcp_options['free_message'] : ''; wp_editor($free_message, 'rcp_settings_free_message', array('textarea_name' => 'rcp_settings[free_message]', 'teeny' => true)); ?> <p class="description"><?php _e('This is the message shown to users that do not have privilege to view free, user only content.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[paid_message]"><?php _e('Premium Content Message', 'rcp'); ?> </label> </th> <td> <?php $paid_message = isset($rcp_options['paid_message']) ? $rcp_options['paid_message'] : ''; wp_editor($paid_message, 'rcp_settings_paid_message', array('textarea_name' => 'rcp_settings[paid_message]', 'teeny' => true)); ?> <p class="description"><?php _e('This is the message shown to users that do not have privilege to view premium content.', 'rcp'); ?> </p> </td> </tr> <?php do_action('rcp_messages_settings', $rcp_options); ?> </table> <?php do_action('rcp_general_settings', $rcp_options); ?> </div><!--end #general--> <div class="tab_content" id="payments"> <table class="form-table"> <tr> <th> <label fo="rcp_settings[currency]"><?php _e('Currency', 'rcp'); ?> </label> </th> <td> <select id="rcp_settings[currency]" name="rcp_settings[currency]"> <?php $currencies = rcp_get_currencies(); foreach ($currencies as $key => $currency) { echo '<option value="' . esc_attr($key) . '" ' . selected($key, $rcp_options['currency'], false) . '>' . $currency . '</option>'; } ?> </select> <p class="description"><?php _e('Choose your currency.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[currency_position]"><?php _e('Currency Position', 'rcp'); ?> </label> </th> <td> <select id="rcp_settings[currency_position]" name="rcp_settings[currency_position]"> <option value="before" <?php selected('before', $rcp_options['currency_position']); ?> ><?php _e('Before - $10', 'rcp'); ?> </option> <option value="after" <?php selected('after', $rcp_options['currency_position']); ?> ><?php _e('After - 10$', 'rcp'); ?> </option> </select> <p class="description"><?php _e('Show the currency sign before or after the price?', 'rcp'); ?> </p> </td> </tr> <?php $gateways = rcp_get_payment_gateways(); ?> <?php if (count($gateways) > 1) { ?> <tr valign="top"> <th> <h3><?php _e('Gateways', 'rcp'); ?> </h3> </th> <td> <?php _e('Check each of the payment gateways you would like to enable. Configure the selected gateways below.', 'rcp'); ?> </td> </tr> <tr valign="top"> <th><span><?php _e('Enabled Gateways', 'rcp'); ?> </span></th> <td> <?php $gateways = rcp_get_payment_gateways(); foreach ($gateways as $key => $gateway) { $label = $gateway; if (is_array($gateway)) { $label = $gateway['admin_label']; } echo '<input name="rcp_settings[gateways][' . $key . ']" id="rcp_settings[gateways][' . $key . ']" type="checkbox" value="1" ' . checked(true, isset($rcp_options['gateways'][$key]), false) . '/> '; echo '<label for="rcp_settings[gateways][' . $key . ']">' . $label . '</label><br/>'; } ?> </td> </tr> <?php } ?> <tr valign="top"> <th> <label for="rcp_settings[sandbox]"><?php _e('Sandbox Mode', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[sandbox]" id="rcp_settings[sandbox]" <?php if (isset($rcp_options['sandbox'])) { checked('1', $rcp_options['sandbox']); } ?> /> <span class="description"><?php _e('Use Restrict Content Pro in Sandbox mode. This allows you to test the plugin with test accounts from your payment processor.', 'rcp'); ?> </span> </td> </tr> <?php if (!function_exists('rcp_register_stripe_gateway')) { ?> <tr valign="top"> <th colspan=2> <h3><?php _e('Stripe Settings', 'rcp'); ?> </h3> </th> </tr> <tr> <th> <label for="rcp_settings[stripe_test_secret]"><?php _e('Test Secret Key', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[stripe_test_secret]" style="width: 300px;" name="rcp_settings[stripe_test_secret]" value="<?php if (isset($rcp_options['stripe_test_secret'])) { echo $rcp_options['stripe_test_secret']; } ?> "/> <p class="description"><?php _e('Enter your test secret key. Your API keys can be obtained from your <a href="https://dashboard.stripe.com/account/apikeys" target="_blank">Stripe account settings</a>.', 'rcp'); ?> </p> </td> </tr> <tr> <th> <label for="rcp_settings[stripe_test_publishable]"><?php _e('Test Publishable Key', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[stripe_test_publishable]" style="width: 300px;" name="rcp_settings[stripe_test_publishable]" value="<?php if (isset($rcp_options['stripe_test_publishable'])) { echo $rcp_options['stripe_test_publishable']; } ?> "/> <p class="description"><?php _e('Enter your test publishable key.', 'rcp'); ?> </p> </td> </tr> <tr> <th> <label for="rcp_settings[stripe_live_secret]"><?php _e('Live Secret Key', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[stripe_live_secret]" style="width: 300px;" name="rcp_settings[stripe_live_secret]" value="<?php if (isset($rcp_options['stripe_live_secret'])) { echo $rcp_options['stripe_live_secret']; } ?> "/> <p class="description"><?php _e('Enter your live secret key.', 'rcp'); ?> </p> </td> </tr> <tr> <th> <label for="rcp_settings[stripe_live_publishable]"><?php _e('Live Publishable Key', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[stripe_live_publishable]" style="width: 300px;" name="rcp_settings[stripe_live_publishable]" value="<?php if (isset($rcp_options['stripe_live_publishable'])) { echo $rcp_options['stripe_live_publishable']; } ?> "/> <p class="description"><?php _e('Enter your live publishable key.', 'rcp'); ?> </p> </td> </tr> <tr> <th colspan=2> <p><strong><?php _e('Note', 'rcp'); ?> </strong>: <?php _e('in order for subscription payments made through Stripe to be tracked, you must enter the following URL to your <a href="https://dashboard.stripe.com/account/webhooks" target="_blank">Stripe Webhooks</a> under Account Settings:', 'rcp'); ?> </p> <p><strong><?php echo esc_url(add_query_arg('listener', 'stripe', home_url())); ?> </strong></p> </th> </tr> <?php } ?> <tr valign="top"> <th colspan=2><h3><?php _e('PayPal Settings', 'rcp'); ?> </h3></th> </tr> <tr valign="top"> <th> <label for="rcp_settings[paypal_email]"><?php _e('PayPal Address', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[paypal_email]" style="width: 300px;" name="rcp_settings[paypal_email]" value="<?php if (isset($rcp_options['paypal_email'])) { echo $rcp_options['paypal_email']; } ?> "/> <p class="description"><?php _e('Enter your PayPal email address.', 'rcp'); ?> </p> </td> </tr> <tr> <th><?php _e('PayPal API Credentials', 'rcp'); ?> </th> <td> <p><?php _e('The PayPal API credentials are required in order to use PayPal Express, PayPal Pro, and to support advanced subscription cancellation options in PayPal Standard. Test API credentials can be obtained at <a href="http://docs.pippinsplugins.com/article/826-setting-up-paypal-sandbox-accounts" target="_blank">developer.paypal.com</a>.', 'rcp'); ?> </p> </td> </tr> <?php if (!function_exists('rcp_register_paypal_pro_express_gateway')) { ?> <tr> <th> <label for="rcp_settings[test_paypal_api_username]"><?php _e('Test API Username', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[test_paypal_api_username]" style="width: 300px;" name="rcp_settings[test_paypal_api_username]" value="<?php if (isset($rcp_options['test_paypal_api_username'])) { echo trim($rcp_options['test_paypal_api_username']); } ?> "/> <p class="description"><?php _e('Enter your test API username.', 'rcp'); ?> </p> </td> </tr> <tr> <th> <label for="rcp_settings[test_paypal_api_password]"><?php _e('Test API Password', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[test_paypal_api_password]" style="width: 300px;" name="rcp_settings[test_paypal_api_password]" value="<?php if (isset($rcp_options['test_paypal_api_password'])) { echo trim($rcp_options['test_paypal_api_password']); } ?> "/> <p class="description"><?php _e('Enter your test API password.', 'rcp'); ?> </p> </td> </tr> <tr> <th> <label for="rcp_settings[test_paypal_api_signature]"><?php _e('Test API Signature', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[test_paypal_api_signature]" style="width: 300px;" name="rcp_settings[test_paypal_api_signature]" value="<?php if (isset($rcp_options['test_paypal_api_signature'])) { echo trim($rcp_options['test_paypal_api_signature']); } ?> "/> <p class="description"><?php _e('Enter your test API signature.', 'rcp'); ?> </p> </td> </tr> <tr> <th> <label for="rcp_settings[live_paypal_api_username]"><?php _e('Live API Username', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[live_paypal_api_username]" style="width: 300px;" name="rcp_settings[live_paypal_api_username]" value="<?php if (isset($rcp_options['live_paypal_api_username'])) { echo trim($rcp_options['live_paypal_api_username']); } ?> "/> <p class="description"><?php _e('Enter your live API username.', 'rcp'); ?> </p> </td> </tr> <tr> <th> <label for="rcp_settings[live_paypal_api_password]"><?php _e('Live API Password', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[live_paypal_api_password]" style="width: 300px;" name="rcp_settings[live_paypal_api_password]" value="<?php if (isset($rcp_options['live_paypal_api_password'])) { echo trim($rcp_options['live_paypal_api_password']); } ?> "/> <p class="description"><?php _e('Enter your live API password.', 'rcp'); ?> </p> </td> </tr> <tr> <th> <label for="rcp_settings[live_paypal_api_signature]"><?php _e('Live API Signature', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[live_paypal_api_signature]" style="width: 300px;" name="rcp_settings[live_paypal_api_signature]" value="<?php if (isset($rcp_options['live_paypal_api_signature'])) { echo trim($rcp_options['live_paypal_api_signature']); } ?> "/> <p class="description"><?php _e('Enter your live API signature.', 'rcp'); ?> </p> </td> </tr> <?php } ?> <tr valign="top"> <th> <label for="rcp_settings[paypal_page_style]"><?php _e('PayPal Page Style', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[paypal_page_style]" style="width: 300px;" name="rcp_settings[paypal_page_style]" value="<?php if (isset($rcp_options['paypal_page_style'])) { echo trim($rcp_options['paypal_page_style']); } ?> "/> <p class="description"><?php _e('Enter the PayPal page style name you wish to use, or leave blank for default.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[disable_curl]"><?php _e('Disable CURL', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[disable_curl]" id="rcp_settings[disable_curl]" <?php if (isset($rcp_options['disable_curl'])) { checked('1', $rcp_options['disable_curl']); } ?> /> <span class="description"><?php _e('Only check this option if your host does not allow cURL.', 'rcp'); ?> </span> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[disable_ipn_verify]"><?php _e('Disable IPN Verification', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[disable_ipn_verify]" id="rcp_settings[disable_ipn_verify]" <?php if (isset($rcp_options['disable_ipn_verify'])) { checked('1', $rcp_options['disable_ipn_verify']); } ?> /> <span class="description"><?php _e('Only check this option if your members statuses are not getting changed to "active".', 'rcp'); ?> </span> </td> </tr> </table> <?php do_action('rcp_payments_settings', $rcp_options); ?> </div><!--end #payments--> <div class="tab_content" id="emails"> <div id="rcp_email_options"> <table class="form-table"> <tr> <th colspan=2><h3><?php _e('General', 'rcp'); ?> </h3></th> </tr> <tr> <th> <label for="rcp_settings[from_name]"><?php _e('From Name', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[from_name]" style="width: 300px;" name="rcp_settings[from_name]" value="<?php if (isset($rcp_options['from_name'])) { echo $rcp_options['from_name']; } else { echo get_bloginfo('name'); } ?> "/> <p class="description"><?php _e('The name that emails come from. This is usually the name of your business.', 'rcp'); ?> </p> </td> </tr> <tr> <th> <label for="rcp_settings[from_email]"><?php _e('From Email', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[from_email]" style="width: 300px;" name="rcp_settings[from_email]" value="<?php if (isset($rcp_options['from_email'])) { echo $rcp_options['from_email']; } else { echo get_bloginfo('admin_email'); } ?> "/> <p class="description"><?php _e('The email address that emails are sent from.', 'rcp'); ?> </p> </td> </tr> <tr> <th colspan=2><h3><?php _e('Active Subscription Email', 'rcp'); ?> </h3></th> </tr> <tr> <th> <label for="rcp_settings[disable_active_email]"><?php _e('Disabled', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[disable_active_email]" id="rcp_settings[disable_active_email]" <?php checked(true, isset($rcp_options['disable_active_email'])); ?> /> <span><?php _e('Check this to disable the email sent out when a member becomes active.', 'rcp'); ?> </span> </td> </tr> <tr> <th> <label for="rcp_settings[active_subject]"><?php _e('Subject', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[active_subject]" style="width: 300px;" name="rcp_settings[active_subject]" value="<?php if (isset($rcp_options['active_subject'])) { echo $rcp_options['active_subject']; } ?> "/> <p class="description"><?php _e('The subject line for the email sent to users when their subscription becomes active.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[active_email]"><?php _e('Email Body', 'rcp'); ?> </label> </th> <td> <textarea id="rcp_settings[active_email]" style="width: 300px; height: 100px;" name="rcp_settings[active_email]"><?php if (isset($rcp_options['active_email'])) { echo $rcp_options['active_email']; } ?> </textarea> <p class="description"><?php _e('This is the email message that is sent to users when their subscription becomes active.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th colspan=2> <h3><?php _e('Cancelled Subscription Email', 'rcp'); ?> </h3> </th> </tr> <tr> <th> <label for="rcp_settings[disable_cancelled_email]"><?php _e('Disabled', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[disable_cancelled_email]" id="rcp_settings[disable_cancelled_email]" <?php checked(true, isset($rcp_options['disable_cancelled_email'])); ?> /> <span><?php _e('Check this to disable the email sent out when a member is cancelled.', 'rcp'); ?> </span> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[cancelled_subject]"><?php _e('Subject line', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[cancelled_subject]" style="width: 300px;" name="rcp_settings[cancelled_subject]" value="<?php if (isset($rcp_options['cancelled_subject'])) { echo $rcp_options['cancelled_subject']; } ?> "/> <p class="description"><?php _e('The subject line for the email sent to users when their subscription is cancelled.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[cancelled_email]"><?php _e('Email Body', 'rcp'); ?> </label> </th> <td> <textarea id="rcp_settings[cancelled_email]" style="width: 300px; height: 100px;" name="rcp_settings[cancelled_email]"><?php if (isset($rcp_options['cancelled_email'])) { echo $rcp_options['cancelled_email']; } ?> </textarea> <p class="description"><?php _e('This is the email message that is sent to users when their subscription is cancelled.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th colspan=2> <h3><?php _e('Expired Subscription Email', 'rcp'); ?> </h3> </th> </tr> <tr> <th> <label for="rcp_settings[disable_expired_email]"><?php _e('Disabled', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[disable_expired_email]" id="rcp_settings[disable_expired_email]" <?php checked(true, isset($rcp_options['disable_expired_email'])); ?> /> <span><?php _e('Check this to disable the email sent out when a member expires.', 'rcp'); ?> </span> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[expired_subject]"><?php _e('Subject', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[expired_subject]" style="width: 300px;" name="rcp_settings[expired_subject]" value="<?php if (isset($rcp_options['expired_subject'])) { echo $rcp_options['expired_subject']; } ?> "/> <p class="description"><?php _e('The subject line for the email sent to users when their subscription is expired.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[expired_email]"><?php _e('Email Body', 'rcp'); ?> </label> </th> <td> <textarea id="rcp_settings[expired_email]" style="width: 300px; height: 100px;" name="rcp_settings[expired_email]"><?php if (isset($rcp_options['expired_email'])) { echo $rcp_options['expired_email']; } ?> </textarea> <p class="description"><?php _e('This is the email message that is sent to users when their subscription is expired.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th colspan=2><h3><?php _e('Expiring Soon Email', 'rcp'); ?> </h3></th> </tr> <tr valign="top"> <th> <label for="rcp_settings[renewal_subject]"><?php _e('Subject', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[renewal_subject]" style="width: 300px;" name="rcp_settings[renewal_subject]" value="<?php if (isset($rcp_options['renewal_subject'])) { echo $rcp_options['renewal_subject']; } ?> "/> <p class="description"><?php _e('The subject line for the email sent to users before their subscription expires.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[renew_notice_email]"><?php _e('Email Body', 'rcp'); ?> </label> </th> <td> <textarea id="rcp_settings[renew_notice_email]" style="width: 300px; height: 100px;" name="rcp_settings[renew_notice_email]"><?php if (isset($rcp_options['renew_notice_email'])) { echo $rcp_options['renew_notice_email']; } ?> </textarea> <p class="description"><?php _e('This is the email message that is sent to users before their subscription expires to encourage them to renew.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[renewal_reminder_period]"><?php _e('Reminder Period', 'rcp'); ?> </label> </th> <td> <select id="rcp_settings[renewal_reminder_period]" name="rcp_settings[renewal_reminder_period]"> <?php $periods = rcp_get_renewal_reminder_periods(); foreach ($periods as $key => $period) { $option = '<option value="' . $key . '" ' . selected($key, rcp_get_renewal_reminder_period(), false) . '>' . $period . '</option>'; echo $option; } ?> </select> <p class="description"><?php _e('When should the renewal reminder be sent?', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th colspan=2> <h3><?php _e('Free Subscription Email', 'rcp'); ?> </h3> </th> </tr> <tr> <th> <label for="rcp_settings[disable_free_email]"><?php _e('Disabled', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[disable_free_email]" id="rcp_settings[disable_free_email]" <?php checked(true, isset($rcp_options['disable_free_email'])); ?> /> <span><?php _e('Check this to disable the email sent out when a free member registers.', 'rcp'); ?> </span> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[free_subject]"><?php _e('Subject', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[free_subject]" style="width: 300px;" name="rcp_settings[free_subject]" value="<?php if (isset($rcp_options['free_subject'])) { echo $rcp_options['free_subject']; } ?> "/> <p class="description"><?php _e('The subject line for the email sent to users when they sign up for a free membership.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[free_email]"><?php _e('Email Body', 'rcp'); ?> </label> </th> <td> <textarea id="rcp_settings[free_email]" style="width: 300px; height: 100px;" name="rcp_settings[free_email]"><?php if (isset($rcp_options['free_email'])) { echo $rcp_options['free_email']; } ?> </textarea> <p class="description"><?php _e('This is the email message that is sent to users when they sign up for a free account.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th colspan=2> <h3><?php _e('Trial Subscription Email', 'rcp'); ?> </h3> </th> </tr> <tr> <th> <label for="rcp_settings[disable_trial_email]"><?php _e('Disabled', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[disable_trial_email]" id="rcp_settings[disable_trial_email]" <?php checked(true, isset($rcp_options['disable_trial_email'])); ?> /> <span><?php _e('Check this to disable the email sent out when a member signs up with a trial.', 'rcp'); ?> </span> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[trial_subject]"><?php _e('Subject', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[trial_subject]" style="width: 300px;" name="rcp_settings[trial_subject]" value="<?php if (isset($rcp_options['trial_subject'])) { echo $rcp_options['trial_subject']; } ?> "/> <p class="description"><?php _e('The subject line for the email sent to users when they sign up for a free trial.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[trial_email]"><?php _e('Trial Email Message', 'rcp'); ?> </label> </th> <td> <textarea id="rcp_settings[trial_email]" style="width: 300px; height: 100px;" name="rcp_settings[trial_email]"><?php if (isset($rcp_options['trial_email'])) { echo $rcp_options['trial_email']; } ?> </textarea> <p class="description"><?php _e('This is the email message that is sent to users when they sign up for a free trial.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th colspan=2><h3><?php _e('Payment Recieved Email', 'rcp'); ?> </h3></th> </tr> <tr> <th> <label for="rcp_settings[disable_payment_received_email]"><?php _e('Disabled', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[disable_payment_received_email]" id="rcp_settings[disable_payment_received_email]" <?php checked(true, isset($rcp_options['disable_payment_received_email'])); ?> /> <span><?php _e('Check this to disable the email sent out when a payment is received.', 'rcp'); ?> </span> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[payment_received_subject]"><?php _e('Subject', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[payment_received_subject]" style="width: 300px;" name="rcp_settings[payment_received_subject]" value="<?php if (isset($rcp_options['payment_received_subject'])) { echo $rcp_options['payment_received_subject']; } ?> "/> <p class="description"><?php _e('The subject line for the email sent to users upon a successful payment being received.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[payment_received_email]"><?php _e('Email Body', 'rcp'); ?> </label> </th> <td> <textarea id="rcp_settings[payment_received_email]" style="width: 300px; height: 100px;" name="rcp_settings[payment_received_email]"><?php if (isset($rcp_options['payment_received_email'])) { echo $rcp_options['payment_received_email']; } ?> </textarea> <p class="description"><?php _e('This is the email message that is sent to users after a payment has been received from them.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th colspan=2> <h3><?php _e('New User Notifications', 'rcp'); ?> </h3> </th> </tr> <tr valign="top"> <th> <label for="rcp_settings[disable_new_user_notices]"><?php _e('Disable New User Notifications', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[disable_new_user_notices]" id="rcp_settings[disable_new_user_notices]" <?php if (isset($rcp_options['disable_new_user_notices'])) { checked('1', $rcp_options['disable_new_user_notices']); } ?> /> <span class="description"><?php _e('Check this option if you do NOT want to receive emails when new users signup.', 'rcp'); ?> </span> </td> </tr> </table> <?php do_action('rcp_email_settings', $rcp_options); ?> </div><!--end #rcp_email_options--> <div id="rcp_email_tags"> <p><strong><?php _e('Available Template Tags', 'rcp'); ?> </strong></p> <ul> <li><em>%blogname%</em> - <?php _e('will be replaced with the name of your site', 'rcp'); ?> </li> <li><em>%username%</em> - <?php _e('will be replaced with the user name of the person receiving the email', 'rcp'); ?> </li> <li><em>%useremail%</em> - <?php _e('will be replaced with the email of the person receiving the email', 'rcp'); ?> </li> <li><em>%firstname%</em> - <?php _e('will be replaced with the first name of the person receiving the email', 'rcp'); ?> </li> <li><em>%lastname%</em> - <?php _e('will be replaced with the last name of the person receiving the email', 'rcp'); ?> </li> <li><em>%displayname%</em> - <?php _e('will be replaced with the display name of the person receiving the email', 'rcp'); ?> </li> <li><em>%expiration%</em> - <?php _e('will be replaced with the expiration date of subscription', 'rcp'); ?> </li> <li><em>%subscription_name%</em> - <?php _e('will be replaced with the name of the subscription', 'rcp'); ?> </li> <li><em>%subscription_key%</em> - <?php _e('will be replaced with the unique, 32 character key created when the user is registered', 'rcp'); ?> </li> <li><em>%amount%</em> - <?php _e('will be replaced with the amount of the users last payment', 'rcp'); ?> </li> </ul> </div><!--end #rcp_email_tags--> <div class="clear"></div> </div><!--end #emails--> <div class="tab_content" id="invoices"> <table class="form-table"> <tr valign="top"> <th> <label for="rcp_settings[invoice_logo]"><?php _e('Invoice Logo', 'rcp'); ?> </label> </th> <td> <input class="regular-text rcp-upload-field" id="rcp_settings[invoice_logo]" style="width: 300px;" name="rcp_settings[invoice_logo]" value="<?php if (isset($rcp_options['invoice_logo'])) { echo $rcp_options['invoice_logo']; } ?> "/> <button class="button-secondary rcp-upload"><?php _e('Choose Logo', 'rcp'); ?> </button> <p class="description"><?php _e('Upload a logo to display on the invoices.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[invoice_company]"><?php _e('Company Name', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[invoice_company]" style="width: 300px;" name="rcp_settings[invoice_company]" value="<?php if (isset($rcp_options['invoice_company'])) { echo $rcp_options['invoice_company']; } ?> "/> <p class="description"><?php _e('Enter the company name that will be shown on the invoice. This is only displayed if no logo image is uploaded above.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[invoice_name]"><?php _e('Name', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[invoice_name]" style="width: 300px;" name="rcp_settings[invoice_name]" value="<?php if (isset($rcp_options['invoice_name'])) { echo $rcp_options['invoice_name']; } ?> "/> <p class="description"><?php _e('Enter the personal name that will be shown on the invoice.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[invoice_address]"><?php _e('Address Line 1', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[invoice_address]" style="width: 300px;" name="rcp_settings[invoice_address]" value="<?php if (isset($rcp_options['invoice_address'])) { echo $rcp_options['invoice_address']; } ?> "/> <p class="description"><?php _e('Enter the first address line that will appear on the invoice.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[invoice_address_2]"><?php _e('Address Line 2', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[invoice_address_2]" style="width: 300px;" name="rcp_settings[invoice_address_2]" value="<?php if (isset($rcp_options['invoice_address_2'])) { echo $rcp_options['invoice_address_2']; } ?> "/> <p class="description"><?php _e('Enter the second address line that will appear on the invoice.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[invoice_city_state_zip]"><?php _e('City, State, and Zip', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[invoice_city_state_zip]" style="width: 300px;" name="rcp_settings[invoice_city_state_zip]" value="<?php if (isset($rcp_options['invoice_city_state_zip'])) { echo $rcp_options['invoice_city_state_zip']; } ?> "/> <p class="description"><?php _e('Enter the city, state and zip/postal code that will appear on the invoice.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[invoice_email]"><?php _e('Email', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[invoice_email]" style="width: 300px;" name="rcp_settings[invoice_email]" value="<?php if (isset($rcp_options['invoice_email'])) { echo $rcp_options['invoice_email']; } ?> "/> <p class="description"><?php _e('Enter the email address that will appear on the invoice.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[invoice_header]"><?php _e('Header Text', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[invoice_header]" style="width: 300px;" name="rcp_settings[invoice_header]" value="<?php if (isset($rcp_options['invoice_header'])) { echo $rcp_options['invoice_header']; } ?> "/> <p class="description"><?php _e('Enter the message you would like to be shown on the header of the invoice.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[invoice_notes]"><?php _e('Notes', 'rcp'); ?> </label> </th> <td> <textarea id="rcp_settings[invoice_notes]" style="width: 300px; height: 100px;" name="rcp_settings[invoice_notes]"><?php if (isset($rcp_options['invoice_notes'])) { echo $rcp_options['invoice_notes']; } ?> </textarea> <p class="description"><?php _e('Enter additional notes you would like displayed below the invoice totals.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[invoice_footer]"><?php _e('Footer Text', 'rcp'); ?> </label> </th> <td> <input class="regular-text" id="rcp_settings[invoice_footer]" style="width: 300px;" name="rcp_settings[invoice_footer]" value="<?php if (isset($rcp_options['invoice_footer'])) { echo $rcp_options['invoice_footer']; } ?> "/> <p class="description"><?php _e('Enter the message you would like to be shown on the footer of the invoice.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[invoice_enable_char_support]"><?php _e('Characters not displaying correctly?', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[invoice_enable_char_support]" id="rcp_settings[invoice_enable_char_support]" <?php if (isset($rcp_options['invoice_enable_char_support'])) { checked('1', $rcp_options['invoice_enable_char_support']); } ?> /> <span class="description"><?php _e('Check to enable the Free Sans/Free Serif font replacing Open Sans/Helvetica/Times. Only do this if you have characters which do not display correctly (e.g. Greek characters)', 'rcp'); ?> </span> </td> </tr> </table> <?php do_action('rcp_invoice_settings', $rcp_options); ?> </div><!--end #invoices--> <div class="tab_content" id="misc"> <table class="form-table"> <tr valign="top"> <th> <label for="rcp_settings[hide_premium]"><?php _e('Hide Premium Posts', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[hide_premium]" id="rcp_settings[hide_premium]" <?php if (isset($rcp_options['hide_premium'])) { checked('1', $rcp_options['hide_premium']); } ?> /> <span class="description"><?php _e('Check this to hide all premium posts from queries when user is not logged in. Note, this will only hide posts that have the "Paid Only?" checkbox checked.', 'rcp'); ?> </span> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[redirect]"> — <?php _e('Redirect Page', 'rcp'); ?> </label> </th> <td> <select id="rcp_settings[redirect_from_premium]" name="rcp_settings[redirect_from_premium]"> <?php if ($pages) { foreach ($pages as $page) { $option = '<option value="' . $page->ID . '" ' . selected($page->ID, $rcp_options['redirect_from_premium'], false) . '>'; $option .= $page->post_title; $option .= '</option>'; echo $option; } } else { echo '<option>' . __('No pages found', 'rcp') . '</option>'; } ?> </select> <p class="description"><?php _e('This is the page non-subscribed users are redirected to when attempting to access a premium post or page.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[hijack_login_url]"><?php _e('Redirect Default Login URL', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[hijack_login_url]" id="rcp_settings[hijack_login_url]" <?php if (isset($rcp_options['hijack_login_url'])) { checked('1', $rcp_options['hijack_login_url']); } ?> /> <span class="description"><?php _e('Check this to force the default login URL to redirect to the page specified below.', 'rcp'); ?> </span> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[redirect]"> — <?php _e('Login Page', 'rcp'); ?> </label> </th> <td> <select id="rcp_settings[login_redirect]" name="rcp_settings[login_redirect]"> <?php if ($pages) { foreach ($pages as $page) { $option = '<option value="' . $page->ID . '" ' . selected($page->ID, $rcp_options['login_redirect'], false) . '>'; $option .= $page->post_title; $option .= '</option>'; echo $option; } } else { echo '<option>' . __('No pages found', 'rcp') . '</option>'; } ?> </select> <p class="description"><?php _e('This is the page the default login URL redirects to, if the option above is checked. This should be the page that contains the [login_form] short code.', 'rcp'); ?> </p> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[no_login_sharing]"><?php _e('Prevent Account Sharing', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[no_login_sharing]" id="rcp_settings[no_login_sharing]"<?php checked(true, isset($rcp_options['no_login_sharing'])); ?> /> <span class="description"><?php _e('Check this if you\'d like to prevent multiple users from logging into the same account simultaneously.', 'rcp'); ?> </span> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[email_ipn_reports]"><?php _e('Email IPN reports', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[email_ipn_reports]" id="rcp_settings[email_ipn_reports]" <?php if (isset($rcp_options['email_ipn_reports'])) { checked('1', $rcp_options['email_ipn_reports']); } ?> /> <span class="description"><?php _e('Check this to send an email each time an IPN request is made with PayPal. The email will contain a list of all data sent. This is useful for debugging in the case that something is not working with the PayPal integration.', 'rcp'); ?> </span> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[disable_css]"><?php _e('Disable Form CSS', 'rcp'); ?> </label><br/> </th> <td> <input type="checkbox" value="1" name="rcp_settings[disable_css]" id="rcp_settings[disable_css]" <?php if (isset($rcp_options['disable_css'])) { checked('1', $rcp_options['disable_css']); } ?> /> <span class="description"><?php _e('Check this to disable all included form styling.', 'rcp'); ?> </span> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[enable_recaptcha]"><?php _e('Enable reCaptcha', 'rcp'); ?> </label> </th> <td> <input type="checkbox" value="1" name="rcp_settings[enable_recaptcha]" id="rcp_settings[enable_recaptcha]" <?php if (isset($rcp_options['enable_recaptcha'])) { checked('1', $rcp_options['enable_recaptcha']); } ?> /> <span class="description"><?php _e('Check this to enable reCaptcha on the registration form.', 'rcp'); ?> </span> </td> </tr> <tr valign="top"> <th> <label for="rcp_settings[recaptcha_public_key]"><?php _e('reCaptcha Site Key'); ?> </label> </th> <td> <input id="rcp_settings[recaptcha_public_key]" style="width: 300px;" name="rcp_settings[recaptcha_public_key]" type="text" value="<?php if (isset($rcp_options['recaptcha_public_key'])) { echo $rcp_options['recaptcha_public_key']; } ?> " /> <p class="description"><?php _e('This your own personal reCaptcha Site key. Go to', 'rcp'); ?> <a href="https://www.google.com/recaptcha/"><?php _e('your account', 'rcp'); ?> </a>, <?php _e('then click on your domain (or add a new one) to find your site key.', 'rcp'); ?> </p> <td> </tr> <tr valign="top"> <th> <label for="rcp_settings[recaptcha_private_key]"><?php _e('reCaptcha Secret Key'); ?> </label> </th> <td> <input id="rcp_settings[recaptcha_private_key]" style="width: 300px;" name="rcp_settings[recaptcha_private_key]" type="text" value="<?php if (isset($rcp_options['recaptcha_private_key'])) { echo $rcp_options['recaptcha_private_key']; } ?> " /> <p class="description"><?php _e('This your own personal reCaptcha Secret key. Go to', 'rcp'); ?> <a href="https://www.google.com/recaptcha/"><?php _e('your account', 'rcp'); ?> </a>, <?php _e('then click on your domain (or add a new one) to find your secret key.', 'rcp'); ?> </p> </td> </tr> </table> <?php do_action('rcp_misc_settings', $rcp_options); ?> </div><!--end #misc--> </div><!--end #tab_container--> <!-- save the options --> <p class="submit"> <input type="submit" class="button-primary" value="<?php _e('Save Options', 'rcp'); ?> " /> </p> </form> </div><!--end wrap--> <?php }
/** * Determine if this registration is recurring * * @since 2.5 * @return bool */ function rcp_registration_is_recurring() { $auto_renew = false; if ('3' == rcp_get_auto_renew_behavior()) { $auto_renew = isset($_POST['rcp_auto_renew']); } if ('1' == rcp_get_auto_renew_behavior()) { $auto_renew = true; } // make sure this gateway supports recurring payments if ($auto_renew && !empty($_POST['rcp_gateway'])) { $auto_renew = rcp_gateway_supports(sanitize_text_field($_POST['rcp_gateway']), 'recurring'); } if ($auto_renew && !empty($_POST['rcp_level'])) { $details = rcp_get_subscription_details($_POST['rcp_level']); // check if this is an unlimited or free subscription if (empty($details->duration) || empty($details->price)) { $auto_renew = false; } } if (!rcp_get_registration_recurring_total() > 0) { $auto_renew = false; } return apply_filters('rcp_registration_is_recurring', $auto_renew); }