stories
4 years ago
action-button.html
1 year ago
action-link.html
1 year ago
activate-license.html
1 year ago
badge.html
1 year ago
dismiss.html
5 years ago
footer.html
5 years ago
index.html.php
1 year ago
row-item.html
5 years ago
section.html
1 year ago
sub-header.html
5 years ago
index.html.php
443 lines
| 1 | <?php |
| 2 | /** |
| 3 | * GiveWP Onboarding Setup Guide template file |
| 4 | * |
| 5 | * @since 3.15.0 Refactored to make it compatible with v3 forms. |
| 6 | * @since 2.8.0 |
| 7 | */ |
| 8 | |
| 9 | use Give\DonationForms\Models\DonationForm; |
| 10 | |
| 11 | /** |
| 12 | * Variables from onboarding PageView |
| 13 | * |
| 14 | * @var array $settings |
| 15 | */ |
| 16 | |
| 17 | ?> |
| 18 | <div class="wrap" class="give-setup-page"> |
| 19 | |
| 20 | <h1 class="wp-heading-inline"> |
| 21 | <?php |
| 22 | echo __('GiveWP Setup Guide', 'give'); ?> |
| 23 | </h1> |
| 24 | |
| 25 | <hr class="wp-header-end"> |
| 26 | |
| 27 | <?php |
| 28 | if (isset($_GET['give_setup_stripe_error'])) : ?> |
| 29 | <div class="notice notice-error"> |
| 30 | <p><?php |
| 31 | echo esc_html($_GET['give_setup_stripe_error']); ?></p> |
| 32 | </div> |
| 33 | <?php |
| 34 | endif; ?> |
| 35 | |
| 36 | <?php |
| 37 | /** |
| 38 | * Use this action to perform task before section loads. |
| 39 | * |
| 40 | * @since 2.10.0 |
| 41 | */ |
| 42 | do_action('give_setup_page_before_sections'); |
| 43 | ?> |
| 44 | |
| 45 | <!-- Configuration --> |
| 46 | <?php |
| 47 | if ($this->isFormConfigured()) { |
| 48 | $form = DonationForm::find((int)$settings['form_id']); |
| 49 | |
| 50 | $customizeFormURL = $form && $form->id ? admin_url('post.php?action=edit&post=' . $form->id) : admin_url('edit.php?post_type=give_forms&page=give-forms'); |
| 51 | } |
| 52 | |
| 53 | echo $this->render_template( |
| 54 | 'section', |
| 55 | [ |
| 56 | 'class' => !$this->isFormConfigured() ? 'current-step' : '', |
| 57 | 'title' => sprintf('%s 1: %s', __('Step', 'give'), __('Create your first donation form', 'give')), |
| 58 | 'badge' => ($this->isFormConfigured() |
| 59 | ? $this->render_template('badge', [ |
| 60 | 'class' => 'completed', |
| 61 | 'text' => esc_html__('Completed', 'give'), |
| 62 | ]) |
| 63 | : $this->render_template('badge', [ |
| 64 | 'class' => 'not-completed', |
| 65 | 'text' => esc_html__('Not Completed', 'give'), |
| 66 | ]) |
| 67 | ), |
| 68 | 'button' => ($this->isFormConfigured() |
| 69 | ? $this->render_template('action-button', [ |
| 70 | 'href' => esc_url($customizeFormURL), |
| 71 | 'text' => esc_html__('Customize form', 'give'), |
| 72 | 'target' => '_blank', |
| 73 | ]) |
| 74 | : $this->render_template('action-button', [ |
| 75 | 'href' => esc_url(admin_url('?page=give-onboarding-wizard')), |
| 76 | 'text' => esc_html__('Configure GiveWP', 'give'), |
| 77 | 'target' => '_blank', |
| 78 | ]) |
| 79 | ), |
| 80 | ] |
| 81 | ); |
| 82 | ?> |
| 83 | |
| 84 | <!-- Gateways --> |
| 85 | <?php |
| 86 | echo $this->render_template( |
| 87 | 'section', |
| 88 | [ |
| 89 | 'class' => ($this->isFormConfigured() && !($this->isStripeSetup() || $this->isPayPalSetup())) ? 'current-step' : '', |
| 90 | 'title' => sprintf('%s 2: %s', __('Step', 'give'), __('Connect a payment gateway', 'give')), |
| 91 | 'badge' => (($this->isStripeSetup() || $this->isPayPalSetup()) |
| 92 | ? $this->render_template('badge', [ |
| 93 | 'class' => 'completed', |
| 94 | 'text' => esc_html__('Completed', 'give'), |
| 95 | ]) |
| 96 | : $this->render_template('badge', [ |
| 97 | 'class' => 'not-completed', |
| 98 | 'text' => esc_html__('Not Completed', 'give'), |
| 99 | ]) |
| 100 | ), |
| 101 | 'contents' => [ |
| 102 | $this->render_template( |
| 103 | 'row-item', |
| 104 | [ |
| 105 | 'testId' => 'stripe', |
| 106 | 'class' => ($this->isStripeSetup()) ? 'stripe setup-item-completed' : 'stripe', |
| 107 | 'icon' => ($this->isStripeSetup()) |
| 108 | ? $this->image('check-circle.min.png') |
| 109 | : $this->image('stripe@2x.min.png'), |
| 110 | 'icon_alt' => esc_html__('Stripe', 'give'), |
| 111 | 'title' => esc_html__('Connect to Stripe', 'give'), |
| 112 | 'description' => esc_html__( |
| 113 | '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. Note: the FREE version of Stripe includes an additional 2% fee for processing one-time donations. Remove the fee by installing and activating the premium Stripe add-on.', |
| 114 | 'give' |
| 115 | ), |
| 116 | 'action' => ($this->isStripeSetup()) ? sprintf( |
| 117 | '<a href="%s"><i class="fab fa-stripe-s"></i> Stripe Settings</a>', |
| 118 | esc_url(add_query_arg( |
| 119 | [ |
| 120 | 'post_type' => 'give_forms', |
| 121 | 'page' => 'give-settings', |
| 122 | 'tab' => 'gateways', |
| 123 | 'section' => 'stripe-settings', |
| 124 | ], |
| 125 | admin_url('edit.php') |
| 126 | )) |
| 127 | ) |
| 128 | : sprintf( |
| 129 | '<a href="%s"><i class="fab fa-stripe-s"></i> Connect to Stripe</a>', |
| 130 | $this->stripeConnectURL() |
| 131 | ), |
| 132 | ] |
| 133 | ), |
| 134 | $this->render_template( |
| 135 | 'row-item', |
| 136 | [ |
| 137 | 'testId' => 'paypal', |
| 138 | 'class' => ($this->isPayPalSetup()) ? 'paypal setup-item-completed' : 'paypal', |
| 139 | 'icon' => ($this->isPayPalSetup()) |
| 140 | ? $this->image('check-circle.min.png') |
| 141 | : $this->image('paypal@2x.min.png'), |
| 142 | 'icon_alt' => esc_html__('PayPal', 'give'), |
| 143 | 'title' => esc_html__('Connect to PayPal', 'give'), |
| 144 | 'description' => esc_html__( |
| 145 | '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.', |
| 146 | 'give' |
| 147 | ), |
| 148 | 'action' => sprintf( |
| 149 | '<a href="%1$s"><i class="fab fa-paypal"></i> %2$s</a>', |
| 150 | esc_url(add_query_arg( |
| 151 | [ |
| 152 | 'post_type' => 'give_forms', |
| 153 | 'page' => 'give-settings', |
| 154 | 'tab' => 'gateways', |
| 155 | 'section' => 'paypal', |
| 156 | 'group' => 'paypal-commerce', |
| 157 | ], |
| 158 | admin_url('edit.php') |
| 159 | )), |
| 160 | ! $this->isPayPalSetup() ? esc_html__('Connect to PayPal', 'give') : esc_html__( |
| 161 | 'PayPal Settings', |
| 162 | 'give' |
| 163 | ) |
| 164 | ), |
| 165 | ] |
| 166 | ), |
| 167 | ], |
| 168 | 'footer' => $this->render_template( |
| 169 | 'footer', |
| 170 | [ |
| 171 | 'contents' => sprintf( |
| 172 | '<img src="%s" /><p><strong>%s</strong> %s</p> %s', |
| 173 | $this->image('payment-gateway.svg'), |
| 174 | __('Explore other payment gateways:', 'give'), |
| 175 | __('GiveWP has support for many others including Authorize.net, Square, Razorpay and more!', 'give'), |
| 176 | sprintf( |
| 177 | '<a href="%s" target="_blank">%s <i class="fa fa-chevron-right" aria-hidden="true"></i></a>', |
| 178 | 'http://docs.givewp.com/payment-gateways', // UTM included. |
| 179 | __('View all gateways', 'give') |
| 180 | ) |
| 181 | ), |
| 182 | ] |
| 183 | ), |
| 184 | ] |
| 185 | ); |
| 186 | ?> |
| 187 | |
| 188 | <!-- Resources --> |
| 189 | <?php |
| 190 | $needsActivation = true; |
| 191 | $licenses = get_option('give_licenses', []); |
| 192 | |
| 193 | foreach ($licenses as $license) { |
| 194 | if (empty($license['license_key'])) { |
| 195 | continue; |
| 196 | } |
| 197 | |
| 198 | $licenseKey = $license['license_key']; |
| 199 | $licenseStatus = $license['license']; |
| 200 | $expiresTimestamp = strtotime($license['expires']); |
| 201 | |
| 202 | $isLicenseInactive = $licenseStatus !== 'valid'; |
| 203 | $isLicenseExpired = $licenseStatus === 'expired' || $expiresTimestamp < time(); |
| 204 | |
| 205 | if (!$isLicenseInactive && !$isLicenseExpired) { |
| 206 | $needsActivation = false; |
| 207 | break; |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | echo $this->render_template( |
| 212 | 'section', |
| 213 | [ |
| 214 | 'title' => sprintf('%s 3: %s', __('Step', 'give'), __('Get more from your fundraising campaign with add-ons', 'give')), |
| 215 | 'badge' => $this->render_template('badge', [ |
| 216 | 'class' => 'optional', |
| 217 | 'text' => esc_html__('Optional', 'give'), |
| 218 | ]), |
| 219 | 'contents' => [ |
| 220 | (! empty($settings['addons'] || $needsActivation)) ? $this->render_template( |
| 221 | 'sub-header', |
| 222 | [ |
| 223 | 'text' => sprintf( |
| 224 | '%s%s', |
| 225 | (! empty($settings['addons']) ? esc_html__('Based on your selections, Give recommends the following add-ons to support your fundraising.', 'give') . ' ' : ''), |
| 226 | ($needsActivation ? $this->render_template('activate-license', |
| 227 | [ |
| 228 | 'text' => esc_html__('Already have an add-on license?', 'give'), |
| 229 | 'label' => esc_html__('Activate your license', 'give'), |
| 230 | 'href' => esc_url(admin_url('edit.php?post_type=give_forms&page=give-settings&tab=licenses')), |
| 231 | 'title' => esc_html__('Activate an Add-on License', 'give'), |
| 232 | 'description' => sprintf( |
| 233 | __('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'), |
| 234 | Give_License::get_account_url() |
| 235 | ), |
| 236 | 'nonce' => wp_nonce_field('give-license-activator-nonce', 'give_license_activator_nonce', true, false), |
| 237 | 'form-label' => esc_html__('License key', 'give'), |
| 238 | 'form-placeholder' => esc_html__('Enter your license key', 'give'), |
| 239 | 'form-submit-activate' => esc_html__('Activate License', 'give'), |
| 240 | 'form-submit-activating' => esc_html__('Verifying License...', 'give'), |
| 241 | 'form-submit-value' => esc_html__('Activate License', 'give'), |
| 242 | ] |
| 243 | ) : '') |
| 244 | ) |
| 245 | ] |
| 246 | ) : '', |
| 247 | in_array('recurring-donations', $settings['addons']) ? $this->render_template( |
| 248 | 'row-item', |
| 249 | [ |
| 250 | 'class' => 'setup-item-recurring-donations', |
| 251 | 'icon' => $this->image('recurring-donations@2x.min.png'), |
| 252 | 'icon_alt' => __('Recurring Donations', 'give'), |
| 253 | 'title' => __('Recurring Donations', 'give'), |
| 254 | 'description' => __( |
| 255 | '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.', |
| 256 | 'give' |
| 257 | ), |
| 258 | 'action' => $this->render_template( |
| 259 | 'action-link', |
| 260 | [ |
| 261 | 'target' => '_blank', |
| 262 | 'href' => 'http://docs.givewp.com/setup-recurring', // UTM included. |
| 263 | 'label' => __('Get Recurring Donations', 'give'), |
| 264 | ] |
| 265 | ), |
| 266 | ] |
| 267 | ) : '', |
| 268 | in_array('donors-cover-fees', $settings['addons']) ? $this->render_template( |
| 269 | 'row-item', |
| 270 | [ |
| 271 | 'class' => 'setup-item-fee-recovery', |
| 272 | 'icon' => $this->image('fee-recovery@2x.min.png'), |
| 273 | 'icon_alt' => __('Fee Recovery', 'give'), |
| 274 | 'title' => __('Fee Recovery', 'give'), |
| 275 | 'description' => __( |
| 276 | 'Maximize your donations by allowing donors to cover payment processing fees, ensuring more funds go directly to your cause.', |
| 277 | 'give' |
| 278 | ), |
| 279 | 'action' => $this->render_template( |
| 280 | 'action-link', |
| 281 | [ |
| 282 | 'target' => '_blank', |
| 283 | 'href' => 'http://docs.givewp.com/setup-fee-recovery', // UTM included. |
| 284 | 'label' => __('Get Fee Recovery', 'give'), |
| 285 | ] |
| 286 | ), |
| 287 | ] |
| 288 | ) : '', |
| 289 | in_array('pdf-receipts', $settings['addons']) ? $this->render_template( |
| 290 | 'row-item', |
| 291 | [ |
| 292 | 'class' => 'setup-item-pdf-receipts', |
| 293 | 'icon' => $this->image('pdf-receipts@2x.min.png'), |
| 294 | 'icon_alt' => __('PDF Receipts', 'give'), |
| 295 | 'title' => __('PDF Receipts', 'give'), |
| 296 | 'description' => __( |
| 297 | '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.', |
| 298 | 'give' |
| 299 | ), |
| 300 | 'action' => $this->render_template( |
| 301 | 'action-link', |
| 302 | [ |
| 303 | 'target' => '_blank', |
| 304 | 'href' => 'http://docs.givewp.com/setup-pdf-receipts', // UTM included. |
| 305 | 'label' => __('Get PDF Receipts', 'give'), |
| 306 | ] |
| 307 | ), |
| 308 | ] |
| 309 | ) : '', |
| 310 | in_array('custom-form-fields', $settings['addons']) ? $this->render_template( |
| 311 | 'row-item', |
| 312 | [ |
| 313 | 'class' => 'setup-item-form-fields-manager', |
| 314 | 'icon' => $this->image('form-fields-manager@2x.min.png'), |
| 315 | 'icon_alt' => __('Form Field Manager', 'give'), |
| 316 | 'title' => __('Form Field Manager', 'give'), |
| 317 | 'description' => __( |
| 318 | '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.', |
| 319 | 'give' |
| 320 | ), |
| 321 | 'action' => $this->render_template( |
| 322 | 'action-link', |
| 323 | [ |
| 324 | 'target' => '_blank', |
| 325 | 'href' => 'http://docs.givewp.com/setup-ffm', // UTM included. |
| 326 | 'label' => __('Get Form Field Manager', 'give'), |
| 327 | ] |
| 328 | ), |
| 329 | ] |
| 330 | ) : '', |
| 331 | in_array('multiple-currencies', $settings['addons']) ? $this->render_template( |
| 332 | 'row-item', |
| 333 | [ |
| 334 | 'class' => 'setup-item-currency-switcher', |
| 335 | 'icon' => $this->image('currency-switcher@2x.min.png'), |
| 336 | 'icon_alt' => __('Currency Switcher', 'give'), |
| 337 | 'title' => __('Currency Switcher', 'give'), |
| 338 | 'description' => __( |
| 339 | 'Let donors choose from your selected currencies, increasing global donations with live exchange rates and extensive currency options.', |
| 340 | 'give' |
| 341 | ), |
| 342 | 'action' => $this->render_template( |
| 343 | 'action-link', |
| 344 | [ |
| 345 | 'target' => '_blank', |
| 346 | 'href' => 'http://docs.givewp.com/setup-currency-switcher', // UTM included. |
| 347 | 'label' => __('Get Currency Switcher', 'give'), |
| 348 | ] |
| 349 | ), |
| 350 | ] |
| 351 | ) : '', |
| 352 | in_array('dedicate-donations', $settings['addons']) ? $this->render_template( |
| 353 | 'row-item', |
| 354 | [ |
| 355 | 'class' => 'setup-item-tributes', |
| 356 | 'icon' => $this->image('tributes@2x.min.png'), |
| 357 | 'icon_alt' => __('Tributes', 'give'), |
| 358 | 'title' => __('Tributes', 'give'), |
| 359 | 'description' => __( |
| 360 | '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.', |
| 361 | 'give' |
| 362 | ), |
| 363 | 'action' => $this->render_template( |
| 364 | 'action-link', |
| 365 | [ |
| 366 | 'target' => '_blank', |
| 367 | 'href' => 'http://docs.givewp.com/setup-tributes', // UTM included. |
| 368 | 'label' => __('Get Tributes', 'give'), |
| 369 | ] |
| 370 | ), |
| 371 | ] |
| 372 | ) : '', |
| 373 | $this->render_template( |
| 374 | 'row-item', |
| 375 | [ |
| 376 | 'class' => 'setup-item', |
| 377 | 'icon' => $this->image('addons@2x.min.png'), |
| 378 | 'icon_alt' => esc_html__('Add-ons', 'give'), |
| 379 | 'title' => esc_html__('GiveWP Add-ons', 'give'), |
| 380 | 'description' => esc_html__( |
| 381 | '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.', |
| 382 | 'give' |
| 383 | ), |
| 384 | 'action' => $this->render_template( |
| 385 | 'action-link', |
| 386 | [ |
| 387 | 'target' => '_blank', |
| 388 | 'href' => 'http://docs.givewp.com/setup-addons', // UTM included. |
| 389 | 'label' => esc_html__('View all premium add-ons', 'give'), |
| 390 | ] |
| 391 | ), |
| 392 | ] |
| 393 | ), |
| 394 | ], |
| 395 | ] |
| 396 | ); |
| 397 | ?> |
| 398 | |
| 399 | <?php |
| 400 | echo $this->render_template( |
| 401 | 'section', |
| 402 | [ |
| 403 | 'title' => __('Get the most out of GiveWP', 'give'), |
| 404 | 'contents' => [ |
| 405 | $this->render_template( |
| 406 | 'row-item', |
| 407 | [ |
| 408 | 'class' => 'setup-item', |
| 409 | 'icon' => $this->image('givewp101@2x.min.png'), |
| 410 | 'icon_alt' => esc_html__('GiveWP Getting Started Guide', 'give'), |
| 411 | 'title' => esc_html__('GiveWP Getting Started Guide', 'give'), |
| 412 | 'description' => esc_html__( |
| 413 | 'Learn the basics and advanced tips to optimize your fundraising with GiveWP.', |
| 414 | 'give' |
| 415 | ), |
| 416 | 'action' => $this->render_template( |
| 417 | 'action-link', |
| 418 | [ |
| 419 | 'target' => '_blank', |
| 420 | 'href' => 'http://docs.givewp.com/getting-started', // UTM included. |
| 421 | 'label' => __('Get started', 'give'), |
| 422 | ] |
| 423 | ), |
| 424 | ] |
| 425 | ), |
| 426 | ], |
| 427 | ] |
| 428 | ); |
| 429 | ?> |
| 430 | |
| 431 | <?php |
| 432 | echo $this->render_template( |
| 433 | 'dismiss', |
| 434 | [ |
| 435 | 'action' => admin_url('admin-post.php'), |
| 436 | 'nonce' => wp_nonce_field('dismiss_setup_page', $name = '_wpnonce', $referer = true, $echo = false), |
| 437 | 'label' => esc_html__('Dismiss Setup Screen', 'give'), |
| 438 | ] |
| 439 | ) |
| 440 | ?> |
| 441 | |
| 442 | </div> |
| 443 |