← Back
Editing: index.html.php
<?php /** * GiveWP Onboarding Setup Guide template file * * @since 4.19.1 Escape output. Add translators comments. Sanitize the Stripe error message. * @since 3.15.0 Refactored to make it compatible with v3 forms. * @since 2.8.0 */ if (!defined('ABSPATH')) { exit; } // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- template variables; this file is included inside a function, so they are not globals. /** * Variables from onboarding PageView * * @var array $settings */ ?> <div class="wrap" class="give-setup-page"> <h1 class="wp-heading-inline"> <?php echo esc_html__('GiveWP Setup Guide', 'give'); ?> </h1> <hr class="wp-header-end"> <?php if (isset($_GET['give_setup_stripe_error'])) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only error message from the Stripe connect redirect; it is escaped on output and saves nothing. ?> <div class="notice notice-error"> <p><?php echo esc_html(sanitize_text_field(wp_unslash($_GET['give_setup_stripe_error']))); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- same read-only error message as above. ?></p> </div> <?php endif; ?> <?php /** * Use this action to perform task before section loads. * * @since 2.10.0 */ do_action('give_setup_page_before_sections'); ?> <!-- Configuration --> <?php if ($this->isFormConfigured()) { $campaign = give()->campaigns->getByFormId((int)$settings['form_id']); $customizeCampaignURL = $campaign && $campaign->id ? admin_url('edit.php?post_type=give_forms&page=give-campaigns&tab=settings&id=' . $campaign->id) : admin_url('edit.php?post_type=give_forms&page=give-campaigns'); } echo wp_kses_post($this->render_template( 'section', [ 'class' => !$this->isFormConfigured() ? 'current-step' : '', 'title' => sprintf('%s 1: %s', esc_html__('Step', 'give'), esc_html__('Create your first campaign', 'give')), 'badge' => ($this->isFormConfigured() ? $this->render_template('badge', [ 'class' => 'completed', 'text' => esc_html__('Completed', 'give'), ]) : $this->render_template('badge', [ 'class' => 'not-completed', 'text' => esc_html__('Not Completed', 'give'), ]) ), 'button' => ($this->isFormConfigured() ? $this->render_template('action-button', [ 'href' => esc_url($customizeCampaignURL), 'text' => esc_html__('Customize campaign', 'give'), 'target' => '_blank', ]) : $this->render_template('action-button', [ 'href' => esc_url(admin_url('?page=give-onboarding-wizard')), 'text' => esc_html__('Configure GiveWP', 'give'), 'target' => '_blank', ]) ), ] )); ?> <!-- Gateways --> <?php echo wp_kses_post($this->render_template( 'section', [ 'class' => ($this->isFormConfigured() && !($this->isStripeSetup() || $this->isPayPalSetup())) ? 'current-step' : '', 'title' => sprintf('%s 2: %s', esc_html__('Step', 'give'), esc_html__('Connect a payment gateway', 'give')), 'badge' => (($this->isStripeSetup() || $this->isPayPalSetup()) ? $this->render_template('badge', [ 'class' => 'completed', 'text' => esc_html__('Completed', 'give'), ]) : $this->render_template('badge', [ 'class' => 'not-completed', 'text' => esc_html__('Not Completed', 'give'), ]) ), 'contents' => [ $this->render_template( 'row-item', [ 'testId' => 'stripe', 'class' => ($this->isStripeSetup()) ? 'stripe setup-item-completed' : 'stripe', 'icon' => ($this->isStripeSetup()) ? $this->image('check-circle.min.png') : $this->image('stripe@2x.min.png'), 'icon_alt' => esc_html__('Stripe', 'give'), 'title' => esc_html__('Connect to Stripe', 'give'), 'description' => sprintf( /* translators: %s: URL of the Stripe fees documentation */ __('Stripe is one of the most popular payment gateways, and for good reason! Receive one-time and Recurring Donations (add-on) using many of the most popular payment methods. Additional fees may apply for free users. Read our <a href="%s" target="_blank" rel="noopener noreferrer">Stripe documentation</a> for more information.', 'give'), 'https://docs.givewp.com/stripe-fees' ), 'action' => ($this->isStripeSetup()) ? sprintf( '<a href="%s"><i class="fab fa-stripe-s"></i> Stripe Settings</a>', esc_url(add_query_arg( [ 'post_type' => 'give_forms', 'page' => 'give-settings', 'tab' => 'gateways', 'section' => 'stripe-settings', ], admin_url('edit.php') )) ) : sprintf( '<a href="%s"><i class="fab fa-stripe-s"></i> Connect to Stripe</a>', $this->stripeConnectURL() ), ] ), $this->render_template( 'row-item', [ 'testId' => 'paypal', 'class' => ($this->isPayPalSetup()) ? 'paypal setup-item-completed' : 'paypal', 'icon' => ($this->isPayPalSetup()) ? $this->image('check-circle.min.png') : $this->image('paypal@2x.min.png'), 'icon_alt' => esc_html__('PayPal', 'give'), 'title' => esc_html__('Connect to PayPal', 'give'), 'description' => esc_html__( 'PayPal is synonymous with nonprofits and online charitable gifts. It\'s been the go-to payment merchant for many of the world\'s top NGOs. Accept PayPal, credit and debit cards without any added platform fees.', 'give' ), 'action' => sprintf( '<a href="%1$s"><i class="fab fa-paypal"></i> %2$s</a>', esc_url(add_query_arg( [ 'post_type' => 'give_forms', 'page' => 'give-settings', 'tab' => 'gateways', 'section' => 'paypal', 'group' => 'paypal-commerce', ], admin_url('edit.php') )), ! $this->isPayPalSetup() ? esc_html__('Connect to PayPal', 'give') : esc_html__( 'PayPal Settings', 'give' ) ), ] ), ], 'footer' => $this->render_template( 'footer', [ 'contents' => sprintf( '<img src="%s" /><p><strong>%s</strong> %s</p> %s', $this->image('payment-gateway.svg'), __('Explore other payment gateways:', 'give'), __('GiveWP has support for many others including Authorize.net, Square, Razorpay and more!', 'give'), sprintf( '<a href="%s" target="_blank">%s <i class="fa fa-chevron-right" aria-hidden="true"></i></a>', 'http://docs.givewp.com/payment-gateways', // UTM included. __('View all gateways', 'give') ) ), ] ), ] )); ?> <!-- Resources --> <?php $needsActivation = true; $licenses = get_option('give_licenses', []); foreach ($licenses as $license) { if (empty($license['license_key'])) { continue; } $licenseKey = $license['license_key']; $licenseStatus = $license['license']; $expiresTimestamp = strtotime($license['expires']); $isLicenseInactive = $licenseStatus !== 'valid'; $isLicenseExpired = $licenseStatus === 'expired' || $expiresTimestamp < time(); if (!$isLicenseInactive && !$isLicenseExpired) { $needsActivation = false; break; } } // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- renders the section shell; the license-activation form content inside is escaped above and cannot be wp_kses_post()'d without stripping its form elements. echo $this->render_template( 'section', [ 'title' => sprintf('%s 3: %s', esc_html__('Step', 'give'), esc_html__('Get more from your fundraising campaign with add-ons', 'give')), 'badge' => wp_kses_post($this->render_template('badge', [ 'class' => 'optional', 'text' => esc_html__('Optional', 'give'), ])), 'contents' => [ // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- renders the license-activation form; its own values are escaped below, and wp_kses_post() would strip the form/input elements. (! empty($settings['addons'] || $needsActivation)) ? $this->render_template( 'sub-header', [ 'text' => sprintf( '%s%s', (! empty($settings['addons']) ? esc_html__('Based on your selections, Give recommends the following add-ons to support your fundraising.', 'give') . ' ' : ''), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- renders the license-activation form; its own values are escaped below, and wp_kses_post() would strip the form/input elements. ($needsActivation ? $this->render_template('activate-license', [ 'text' => esc_html__('Already have an add-on license?', 'give'), 'label' => esc_html__('Activate your license', 'give'), 'href' => esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=licenses')), 'title' => esc_html__('Activate an Add-on License', 'give'), 'description' => wp_kses_post(sprintf( /* translators: %1$s: URL of the My Account page on the GiveWP website */ __('Enter your license key below to unlock your GiveWP add-ons. You can access your licenses anytime from the <a href="%1$s" target="_blank">My Account</a> section on the GiveWP website. ', 'give'), esc_url(Give_License::get_account_url()) )), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- wp_nonce_field(..., false) returns a trusted hidden <input>; wp_kses_post() would strip it. 'nonce' => wp_nonce_field('give-license-activator-nonce', 'give_license_activator_nonce', true, false), 'form-label' => esc_html__('License key', 'give'), 'form-placeholder' => esc_html__('Enter your license key', 'give'), 'form-submit-activate' => esc_html__('Activate License', 'give'), 'form-submit-activating' => esc_html__('Verifying License...', 'give'), 'form-submit-value' => esc_html__('Activate License', 'give'), ] ) : ''), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- ternary else-arm is a literal empty string. ) ] ) : '', // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- ternary else-arm is a literal empty string. in_array('recurring-donations', $settings['addons']) ? wp_kses_post($this->render_template( 'row-item', [ 'class' => 'setup-item-recurring-donations', 'icon' => $this->image('recurring-donations@2x.min.png'), 'icon_alt' => __('Recurring Donations', 'give'), 'title' => __('Recurring Donations', 'give'), 'description' => __( 'Raise funds reliably through subscriptions based donations. Let your donors choose how often they give and how much. Manage your subscriptions, view specialized reports, and strengthen relationships with your recurring donors.', 'give' ), 'action' => $this->render_template( 'action-link', [ 'target' => '_blank', 'href' => 'http://docs.givewp.com/setup-recurring', // UTM included. 'label' => __('Get Recurring Donations', 'give'), ] ), ] )) : '', in_array('donors-cover-fees', $settings['addons']) ? wp_kses_post($this->render_template( 'row-item', [ 'class' => 'setup-item-fee-recovery', 'icon' => $this->image('fee-recovery@2x.min.png'), 'icon_alt' => __('Fee Recovery', 'give'), 'title' => __('Fee Recovery', 'give'), 'description' => __( 'Maximize your donations by allowing donors to cover payment processing fees, ensuring more funds go directly to your cause.', 'give' ), 'action' => $this->render_template( 'action-link', [ 'target' => '_blank', 'href' => 'http://docs.givewp.com/setup-fee-recovery', // UTM included. 'label' => __('Get Fee Recovery', 'give'), ] ), ] )) : '', in_array('pdf-receipts', $settings['addons']) ? wp_kses_post($this->render_template( 'row-item', [ 'class' => 'setup-item-pdf-receipts', 'icon' => $this->image('pdf-receipts@2x.min.png'), 'icon_alt' => __('PDF Receipts', 'give'), 'title' => __('PDF Receipts', 'give'), 'description' => __( 'PDF Receipts makes it easy for your donors to print their tax deductible receipts by making PDF downloadable copies of them easily available. Donors can get a link to their receipt provided to them in the confirmation email, there is also a link in the donation confirmation screen, and a link in their Donation History page.', 'give' ), 'action' => $this->render_template( 'action-link', [ 'target' => '_blank', 'href' => 'http://docs.givewp.com/setup-pdf-receipts', // UTM included. 'label' => __('Get PDF Receipts', 'give'), ] ), ] )) : '', in_array('custom-form-fields', $settings['addons']) ? wp_kses_post($this->render_template( 'row-item', [ 'class' => 'setup-item-form-fields-manager', 'icon' => $this->image('form-fields-manager@2x.min.png'), 'icon_alt' => __('Form Field Manager', 'give'), 'title' => __('Form Field Manager', 'give'), 'description' => __( 'Form Field Manager (FFM) allows you to add and manage additional fields for your GiveWP donation forms using an intuitive drag-and-drop interface. Form fields include simple fields such as checkboxes, dropdowns, radios, and more. The more complex form fields that you can add are file upload fields, Rich text editors (TinyMCE), and the powerful Repeater field.', 'give' ), 'action' => $this->render_template( 'action-link', [ 'target' => '_blank', 'href' => 'http://docs.givewp.com/setup-ffm', // UTM included. 'label' => __('Get Form Field Manager', 'give'), ] ), ] )) : '', in_array('multiple-currencies', $settings['addons']) ? wp_kses_post($this->render_template( 'row-item', [ 'class' => 'setup-item-currency-switcher', 'icon' => $this->image('currency-switcher@2x.min.png'), 'icon_alt' => __('Currency Switcher', 'give'), 'title' => __('Currency Switcher', 'give'), 'description' => __( 'Let donors choose from your selected currencies, increasing global donations with live exchange rates and extensive currency options.', 'give' ), 'action' => $this->render_template( 'action-link', [ 'target' => '_blank', 'href' => 'http://docs.givewp.com/setup-currency-switcher', // UTM included. 'label' => __('Get Currency Switcher', 'give'), ] ), ] )) : '', in_array('dedicate-donations', $settings['addons']) ? wp_kses_post($this->render_template( 'row-item', [ 'class' => 'setup-item-tributes', 'icon' => $this->image('tributes@2x.min.png'), 'icon_alt' => __('Tributes', 'give'), 'title' => __('Tributes', 'give'), 'description' => __( 'Allow donors to give to your cause via customizable tributes like “In honor of,” “In memory of,” or any dedication you prefer. Send eCards and produce customizable mailable cards that your donors and their honorees will love.', 'give' ), 'action' => $this->render_template( 'action-link', [ 'target' => '_blank', 'href' => 'http://docs.givewp.com/setup-tributes', // UTM included. 'label' => __('Get Tributes', 'give'), ] ), ] )) : '', wp_kses_post($this->render_template( 'row-item', [ 'class' => 'setup-item', 'icon' => $this->image('addons@2x.min.png'), 'icon_alt' => esc_html__('Add-ons', 'give'), 'title' => esc_html__('GiveWP Add-ons', 'give'), 'description' => esc_html__( 'Boost your fundraising efforts with powerful add-ons like Recurring Donations, Fee Recovery, Google Analytics, Mailchimp, and more. Explore our extensive library of 35+ add-ons to enhance your fundraising now.', 'give' ), 'action' => $this->render_template( 'action-link', [ 'target' => '_blank', 'href' => 'http://docs.givewp.com/setup-addons', // UTM included. 'label' => esc_html__('View all premium add-ons', 'give'), ] ), ] )), ], ] ); ?> <?php echo wp_kses_post($this->render_template( 'section', [ 'title' => esc_html__('Get the most out of GiveWP', 'give'), 'contents' => [ $this->render_template( 'row-item', [ 'class' => 'setup-item', 'icon' => $this->image('givewp101@2x.min.png'), 'icon_alt' => esc_html__('GiveWP Getting Started Guide', 'give'), 'title' => esc_html__('GiveWP Getting Started Guide', 'give'), 'description' => esc_html__( 'Learn the basics and advanced tips to optimize your fundraising with GiveWP.', 'give' ), 'action' => $this->render_template( 'action-link', [ 'target' => '_blank', 'href' => 'http://docs.givewp.com/getting-started', // UTM included. 'label' => __('Get started', 'give'), ] ), ] ), ], ] )); ?> <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- renders the dismiss form; its own values are escaped below, and wp_kses_post() would strip the form/input/button elements. echo $this->render_template( 'dismiss', [ 'action' => esc_url(admin_url('admin-post.php')), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- wp_nonce_field(..., false) returns trusted hidden <input> element(s); wp_kses_post() would strip them. 'nonce' => wp_nonce_field('dismiss_setup_page', $name = '_wpnonce', $referer = true, $echo = false), 'label' => esc_html__('Dismiss Setup Screen', 'give'), ] ) ?> </div>
Save File
Cancel