PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.6.3
GiveWP – Donation Plugin and Fundraising Platform v2.6.3
4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / includes / admin / welcome.php
give / includes / admin Last commit date
add-ons 6 years ago donors 6 years ago emails 6 years ago forms 6 years ago payments 6 years ago reports 6 years ago settings 6 years ago shortcodes 6 years ago tools 6 years ago upgrades 6 years ago views 6 years ago abstract-admin-settings-page.php 6 years ago admin-actions.php 6 years ago admin-filters.php 6 years ago admin-footer.php 6 years ago admin-pages.php 6 years ago class-addon-activation-banner.php 6 years ago class-admin-settings.php 6 years ago class-api-keys-table.php 6 years ago class-blank-slate.php 6 years ago class-give-admin.php 6 years ago class-give-html-elements.php 6 years ago class-give-welcome.php 6 years ago class-i18n-module.php 6 years ago dashboard-widgets.php 6 years ago give-metabox-functions.php 6 years ago import-functions.php 6 years ago misc-functions.php 6 years ago plugins.php 6 years ago setting-page-functions.php 6 years ago welcome.php 6 years ago
welcome.php
704 lines
1 <?php
2 /**
3 * Give Welcome Page Class
4 *
5 * Displays on plugin activation
6 *
7 * @package Give
8 * @subpackage Admin/Welcome
9 * @copyright Copyright (c) 2016, GiveWP
10 * @license https://opensource.org/licenses/gpl-license GNU Public License
11 * @since 1.0
12 */
13
14 // Exit if accessed directly.
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 /**
20 * Give_Welcome Class
21 *
22 * A general class for About and Credits page.
23 *
24 * @since 1.0
25 */
26 class Give_Welcome {
27
28 /**
29 * @var string The capability users should have to view the page
30 */
31 public $minimum_capability = 'manage_options';
32
33 /**
34 * Get things started
35 *
36 * @since 1.0
37 */
38 public function __construct() {
39 add_action( 'admin_menu', array( $this, 'admin_menus' ) );
40 add_action( 'admin_head', array( $this, 'admin_head' ) );
41 add_action( 'admin_init', array( $this, 'welcome' ) );
42 }
43
44 /**
45 * Register the Dashboard Pages which are later hidden but these pages
46 * are used to render the Welcome and Credits pages.
47 *
48 * @access public
49 * @since 1.0
50 * @return void
51 */
52 public function admin_menus() {
53 list( $display_version ) = explode( '-', GIVE_VERSION );
54
55 // About Page
56 add_dashboard_page(
57 /* translators: %s: Give version */
58 sprintf( esc_html__( 'Welcome to GiveWP %s', 'give' ), $display_version ),
59 esc_html__( 'Welcome to Give', 'give' ),
60 $this->minimum_capability,
61 'give-about',
62 array( $this, 'about_screen' )
63 );
64
65 // Changelog Page
66 add_dashboard_page(
67 esc_html__( 'GiveWP Changelog', 'give' ),
68 esc_html__( 'GiveWP Changelog', 'give' ),
69 $this->minimum_capability,
70 'give-changelog',
71 array( $this, 'changelog_screen' )
72 );
73
74 // Getting Started Page
75 add_dashboard_page(
76 /* translators: %s: Give version */
77 sprintf( esc_html__( 'GiveWP %s - Getting Started Guide', 'give' ), $display_version ),
78 esc_html__( 'Getting started with Give', 'give' ),
79 $this->minimum_capability,
80 'give-getting-started',
81 array( $this, 'getting_started_screen' )
82 );
83
84 // Credits Page
85 add_dashboard_page(
86 /* translators: %s: Give version */
87 sprintf( esc_html__( 'GiveWP %s - Credits', 'give' ), $display_version ),
88 esc_html__( 'The people that build Give', 'give' ),
89 $this->minimum_capability,
90 'give-credits',
91 array( $this, 'credits_screen' )
92 );
93 }
94
95 /**
96 * Hide Individual Dashboard Pages
97 *
98 * @access public
99 * @since 1.0
100 * @return void
101 */
102 public function admin_head() {
103
104 remove_submenu_page( 'index.php', 'give-about' );
105 remove_submenu_page( 'index.php', 'give-changelog' );
106 remove_submenu_page( 'index.php', 'give-getting-started' );
107 remove_submenu_page( 'index.php', 'give-credits' );
108
109 }
110
111 /**
112 * Navigation tabs
113 *
114 * @access public
115 * @since 1.0
116 * @return void
117 */
118 public function tabs() {
119 $selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about';
120 ?>
121 <h2 class="nav-tab-wrapper">
122 <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>"
123 href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>">
124 <?php esc_html_e( 'About Give', 'give' ); ?>
125 </a>
126 <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>"
127 href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>">
128 <?php esc_html_e( 'Getting Started', 'give' ); ?>
129 </a>
130 <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>"
131 href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>">
132 <?php esc_html_e( 'Credits', 'give' ); ?>
133 </a>
134 <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>"
135 href="<?php echo esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-addons' ) ); ?>">
136 <?php esc_html_e( 'Add-ons', 'give' ); ?>
137 </a>
138 </h2>
139 <?php
140 }
141
142 /**
143 * Render About Screen
144 *
145 * @access public
146 * @since 1.0
147 * @return void
148 */
149 public function about_screen() {
150 list( $display_version ) = explode( '-', GIVE_VERSION );
151 ?>
152 <div class="wrap about-wrap">
153
154 <?php $this->get_welcome_header(); ?>
155
156 <p class="about-text">
157 <?php
158 printf(
159 /* translators: %s: http://docs.givewp.com/docs */
160 __( 'Thank you for activating or updating to the latest version of Give! If you\'re a first time user, welcome! You\'re well on your way to empowering your cause. We encourage you to check out the <a href="%s" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ),
161 esc_url( 'http://docs.givewp.com/docs' )
162 );
163 ?>
164 </p>
165
166 <?php give_get_newsletter(); ?>
167
168 <div class="give-badge">
169 <?php
170 printf(
171 /* translators: %s: Give version */
172 esc_html__( 'Version %s', 'give' ),
173 $display_version
174 );
175 ?>
176 </div>
177
178 <?php $this->tabs(); ?>
179
180 <div class="feature-section clearfix introduction">
181
182 <div class="video feature-section-item">
183 <img src="<?php echo GIVE_PLUGIN_URL . 'assets/dist/images/give-logo-photo-mashup.png'; ?>"
184 alt="<?php esc_attr_e( 'Give', 'give' ); ?>">
185 </div>
186
187 <div class="content feature-section-item last-feature">
188
189 <h3><?php esc_html_e( 'GiveWP - Democratizing Generosity', 'give' ); ?></h3>
190
191 <p><?php esc_html_e( 'GiveWP empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created GiveWP to provide a better donation experience for you and your users. Robust, flexible, and intuitive, the plugin is built from the ground up to be the goto donation solution for WordPress. Create powerful donation forms, embed them throughout your website, start a campaign, and exceed your fundraising goals with Give. This plugin is actively developed and proudly supported by folks who are dedicated to helping you and your cause.', 'give' ); ?></p>
192 <a href="https://givewp.com" target="_blank" class="button-secondary">
193 <?php esc_html_e( 'Learn More', 'give' ); ?>
194 <span class="dashicons dashicons-external"></span>
195 </a>
196
197 </div>
198
199 </div>
200 <!-- /.intro-section -->
201
202 <div class="feature-section clearfix">
203
204 <div class="content feature-section-item">
205
206 <h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3>
207
208 <p><?php esc_html_e( 'Before you get started with GiveWP we suggest you take a look at the online documentation. There you will find the getting started guide which will help you get up and running quickly. If you have a question, issue or bug with the Core plugin please submit an issue on the GiveWP website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p>
209
210 <h4>Find Out More:</h4>
211 <ul class="ul-disc">
212 <li><a href="https://givewp.com/"
213 target="_blank"><?php esc_html_e( 'Visit the GiveWP Website', 'give' ); ?></a></li>
214 <li><a href="https://givewp.com/features/"
215 target="_blank"><?php esc_html_e( 'View the GiveWP Features', 'give' ); ?></a></li>
216 <li><a href="https://givewp.com/documentation/"
217 target="_blank"><?php esc_html_e( 'Read the Documentation', 'give' ); ?></a></li>
218 </ul>
219
220 </div>
221
222 <div class="content feature-section-item last-feature">
223 <img src="<?php echo GIVE_PLUGIN_URL . '/assets/dist/images/admin/give-form-mockup.png'; ?>"
224 alt="<?php esc_attr_e( 'A GiveWP donation form', 'give' ); ?>">
225 </div>
226
227 </div>
228 <!-- /.feature-section -->
229
230
231 </div>
232 <?php
233 }
234
235 /**
236 * Render Changelog Screen
237 *
238 * @access public
239 * @since 1.0
240 * @return void
241 */
242 public function changelog_screen() {
243 list( $display_version ) = explode( '-', GIVE_VERSION );
244 ?>
245 <div class="wrap about-wrap">
246 <h1><?php echo get_admin_page_title(); ?></h1>
247
248 <p class="about-text">
249 <?php
250 printf(
251 /* translators: %s: Give version */
252 esc_html__( 'Thank you for updating to the latest version! GiveWP %s is ready to make your online store faster, safer, and better!', 'give' ),
253 $display_version
254 );
255 ?>
256 </p>
257 <div class="give-badge">
258 <?php
259 printf(
260 /* translators: %s: Give version */
261 esc_html__( 'Version %s', 'give' ),
262 $display_version
263 );
264 ?>
265 </div>
266
267 <?php $this->tabs(); ?>
268
269 <div class="changelog">
270 <h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3>
271
272 <div class="feature-section">
273 <?php echo $this->parse_readme(); ?>
274 </div>
275 </div>
276
277 <div class="return-to-dashboard">
278 <a href="
279 <?php
280 echo esc_url(
281 admin_url(
282 add_query_arg(
283 array(
284 'post_type' => 'give_forms',
285 'page' => 'give-settings',
286 ),
287 'edit.php'
288 )
289 )
290 );
291 ?>
292 "><?php esc_html_e( 'GiveWP Settings', 'give' ); ?></a>
293 </div>
294 </div>
295 <?php
296 }
297
298 /**
299 * Render Getting Started Screen
300 *
301 * @access public
302 * @since 1.0
303 * @return void
304 */
305 public function getting_started_screen() {
306 list( $display_version ) = explode( '-', GIVE_VERSION );
307 ?>
308 <div class="wrap about-wrap get-started">
309
310 <?php $this->get_welcome_header(); ?>
311
312 <p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
313
314 <?php give_get_newsletter(); ?>
315
316 <div class="give-badge">
317 <?php
318 printf(
319 /* translators: %s: Give version */
320 esc_html__( 'Version %s', 'give' ),
321 $display_version
322 );
323 ?>
324 </div>
325
326 <?php $this->tabs(); ?>
327
328 <p class="about-text"><?php printf( esc_html__( 'Getting started with GiveWP is easy! We put together this quick start guide to help first time users of the plugin. Our goal is to get you up and running in no time. Let\'s begin!', 'give' ), $display_version ); ?></p>
329
330 <div class="feature-section clearfix">
331
332 <div class="content feature-section-item">
333 <h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3>
334
335 <p><?php esc_html_e( 'GiveWP is driven by its powerful donation form building features. However, it is much more than just a "donation form." From the "Add Form" page you\'ll be able to choose how and where you want to receive your donations. You will also be able to set the preferred donation amounts.', 'give' ); ?></p>
336
337 <p><?php esc_html_e( 'All of these features begin by simply going to the menu and choosing "Donations > Add Form."', 'give' ); ?></p>
338 </div>
339
340 <div class="content feature-section-item last-feature">
341 <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/dist/images/admin/getting-started-add-new-form.png">
342 </div>
343
344 </div>
345 <!-- /.feature-section -->
346
347 <div class="feature-section clearfix">
348
349 <div class="content feature-section-item multi-level-gif">
350 <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/dist/images/admin/getting-started-new-form-multi-level.gif">
351 </div>
352
353 <div class="content feature-section-item last-feature">
354 <h3><?php esc_html_e( 'STEP 2: Customize Your Donation Forms', 'give' ); ?></h3>
355
356 <p><?php esc_html_e( 'Each donation form you create can be customized to receive either a pre-determined set donation amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the donation levels view where you can add as many levels as you\'d like with your own custom names and suggested amounts. As well, you can allow donors to give a custom amount and even set up donation goals.', 'give' ); ?></p>
357 </div>
358
359 </div>
360 <!-- /.feature-section -->
361
362 <div class="feature-section clearfix">
363
364 <div class="content feature-section-item add-content">
365 <h3><?php esc_html_e( 'STEP 3: Add Additional Content', 'give' ); ?></h3>
366
367 <p><?php esc_html_e( 'Every donation form you create with GiveWP can be used on its own stand-alone page, or it can be inserted into any other page or post throughout your site via a shortcode or widget.', 'give' ); ?></p>
368
369 <p><?php esc_html_e( 'You can choose these different modes by going to the "Form Content" section. From there, you can choose to add content before or after the donation form on a page, or choose "None" if you want to instead use the shortcode. You can find the shortcode in the top right column directly under the Publish/Save button. This feature gives you the most amount of flexibility with controlling your content on your website all within the same page.', 'give' ); ?></p>
370 </div>
371
372 <div class="content feature-section-item last-feature">
373 <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/dist/images/admin/getting-started-add-content.png">
374 </div>
375
376 </div>
377 <!-- /.feature-section -->
378
379 <div class="feature-section clearfix">
380
381 <div class="content feature-section-item display-options">
382 <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/dist/images/admin/getting-started-display-options.png">
383 </div>
384
385 <div class="content feature-section-item last-feature">
386 <h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3>
387
388 <p><?php esc_html_e( 'Lastly, you can present the form in a number of different ways that each create their own unique donor experience. The "Modal" display mode opens the credit card fieldset within a popup window. The "Reveal" mode will slide into place the additional fields. If you\'re looking for a simple button, then "Button" more is the way to go. This allows you to create a customizable "Donate Now" button which will open the donation form upon clicking. There\'s tons of possibilities here, give it a try!', 'give' ); ?></p>
389 </div>
390
391
392 </div>
393 <!-- /.feature-section -->
394
395
396 </div>
397 <?php
398 }
399
400 /**
401 * Render Credits Screen
402 *
403 * @access public
404 * @since 1.0
405 * @return void
406 */
407 public function credits_screen() {
408 list( $display_version ) = explode( '-', GIVE_VERSION );
409 ?>
410 <div class="wrap about-wrap">
411
412 <?php $this->get_welcome_header(); ?>
413
414 <p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly.', 'give' ); ?></p>
415
416 <?php give_get_newsletter(); ?>
417
418 <div class="give-badge">
419 <?php
420 printf(
421 /* translators: %s: Give version */
422 esc_html__( 'Version %s', 'give' ),
423 $display_version
424 );
425 ?>
426 </div>
427
428 <?php $this->tabs(); ?>
429
430 <p class="about-description">
431 <?php
432 printf(
433 /* translators: %s: https://github.com/impress-org/give */
434 __( 'GiveWP is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="%s" target="_blank">GitHub Repo</a>.', 'give' ),
435 esc_url( 'https://github.com/impress-org/give' )
436 );
437 ?>
438 </p>
439
440 <?php echo $this->contributors(); ?>
441 </div>
442 <?php
443 }
444
445
446 /**
447 * Parse the GIVE readme.txt file
448 *
449 * @since 1.0
450 * @return string $readme HTML formatted readme file
451 */
452 public function parse_readme() {
453 $file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
454
455 if ( ! $file ) {
456 $readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>';
457 } else {
458 $readme = file_get_contents( $file );
459 $readme = nl2br( esc_html( $readme ) );
460 $readme = explode( '== Changelog ==', $readme );
461 $readme = end( $readme );
462
463 $readme = give_get_format_md( $readme );
464 }
465
466 return $readme;
467 }
468
469
470 /**
471 * Render Contributors List
472 *
473 * @since 1.0
474 * @uses Give_Welcome::get_contributors()
475 * @return string $contributor_list HTML formatted list of all the contributors for GIVE
476 */
477 public function contributors() {
478 $contributors = $this->get_contributors();
479
480 if ( empty( $contributors ) ) {
481 return '';
482 }
483
484 $contributor_list = '<ul class="wp-people-group">';
485
486 foreach ( $contributors as $contributor ) {
487 $contributor_list .= '<li class="wp-person">';
488 $contributor_list .= sprintf(
489 '<a href="%1$s" target="_blank"><img src="%2$s" width="64" height="64" class="gravatar" alt="%3$s" /></a>',
490 esc_url( 'https://github.com/' . $contributor->login ),
491 esc_url( $contributor->avatar_url ),
492 esc_attr( $contributor->login )
493 );
494 $contributor_list .= sprintf(
495 '<a class="web" target="_blank" href="%1$s">%2$s</a>',
496 esc_url( 'https://github.com/' . $contributor->login ),
497 esc_html( $contributor->login )
498 );
499 $contributor_list .= '</li>';
500 }
501
502 $contributor_list .= '</ul>';
503
504 return $contributor_list;
505 }
506
507 /**
508 * Retreive list of contributors from GitHub.
509 *
510 * @access public
511 * @since 1.0
512 * @return array $contributors List of contributors
513 */
514 public function get_contributors() {
515 $contributors = Give_Cache::get( 'give_contributors', true );
516
517 if ( false !== $contributors ) {
518 return $contributors;
519 }
520
521 $response = wp_remote_get( 'https://api.github.com/repos/impress-org/give/contributors', array( 'sslverify' => false ) );
522
523 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
524 return array();
525 }
526
527 $contributors = json_decode( wp_remote_retrieve_body( $response ) );
528
529 if ( ! is_array( $contributors ) ) {
530 return array();
531 }
532
533 Give_Cache::set( 'give_contributors', $contributors, HOUR_IN_SECONDS, true );
534
535 return $contributors;
536 }
537
538 /**
539 * The header section for the welcome screen.
540 *
541 * @since 1.8.8
542 */
543 public function get_welcome_header() {
544 // Badge for welcome page
545 $badge_url = GIVE_PLUGIN_URL . 'assets/dist/images/give-badge.png';
546 ?>
547 <h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1>
548 <?php $this->social_media_elements(); ?>
549
550 <style type="text/css" media="screen">
551 /*<![CDATA[*/
552 .give-badge {
553 background: url('<?php echo $badge_url; ?>') no-repeat;
554 }
555
556 /*]]>*/
557 </style>
558 <script>
559 //FitVids
560 (function (e) {
561 "use strict";
562 e.fn.fitVids = function (t) {
563 var n = {customSelector: null, ignore: null};
564 if (!document.getElementById("fit-vids-style")) {
565 var r = document.head || document.getElementsByTagName("head")[0];
566 var i = ".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}";
567 var s = document.createElement("div");
568 s.innerHTML = '<p>x</p><style id="fit-vids-style">' + i + "</style>";
569 r.appendChild(s.childNodes[1])
570 }
571 if (t) {
572 e.extend(n, t)
573 }
574 return this.each(function () {
575 var t = ['iframe[src*="player.vimeo.com"]', 'iframe[src*="youtube.com"]', 'iframe[src*="youtube-nocookie.com"]', 'iframe[src*="kickstarter.com"][src*="video.html"]', "object", "embed"];
576 if (n.customSelector) {
577 t.push(n.customSelector)
578 }
579 var r = ".fitvidsignore";
580 if (n.ignore) {
581 r = r + ", " + n.ignore
582 }
583 var i = e(this).find(t.join(","));
584 i = i.not("object object");
585 i = i.not(r);
586 i.each(function () {
587 var t = e(this);
588 if (t.parents(r).length > 0) {
589 return
590 }
591 if (this.tagName.toLowerCase() === "embed" && t.parent("object").length || t.parent(".fluid-width-video-wrapper").length) {
592 return
593 }
594 if (!t.css("height") && !t.css("width") && (isNaN(t.attr("height")) || isNaN(t.attr("width")))) {
595 t.attr("height", 9);
596 t.attr("width", 16)
597 }
598 var n = this.tagName.toLowerCase() === "object" || t.attr("height") && !isNaN(parseInt(t.attr("height"), 10)) ? parseInt(t.attr("height"), 10) : t.height(),
599 i = !isNaN(parseInt(t.attr("width"), 10)) ? parseInt(t.attr("width"), 10) : t.width(),
600 s = n / i;
601 if (!t.attr("id")) {
602 var o = "fitvid" + Math.floor(Math.random() * 999999);
603 t.attr("id", o)
604 }
605 t.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top", s * 100 + "%");
606 t.removeAttr("height").removeAttr("width")
607 })
608 })
609 }
610 })(window.jQuery || window.Zepto);
611 jQuery(document).ready(function ($) {
612
613 // Target your .container, .wrapper, .post, etc.
614 $(".wrap").fitVids();
615
616 });
617
618 </script>
619 <?php
620 }
621
622
623 /**
624 * Social Media Like Buttons
625 *
626 * Various social media elements to Give
627 */
628 public function social_media_elements() {
629 ?>
630
631 <div class="social-items-wrap">
632
633 <iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fwpgive&amp;send=false&amp;layout=button_count&amp;width=100&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21&amp;appId=220596284639969"
634 scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;"
635 allowTransparency="true"></iframe>
636
637 <a href="https://twitter.com/givewp" class="twitter-follow-button" data-show-count="false">
638 <?php
639 printf(
640 /* translators: %s: Give twitter user @givewp */
641 esc_html_e( 'Follow %s', 'give' ),
642 '@givewp'
643 );
644 ?>
645 </a>
646 <script>!function (d, s, id) {
647 var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
648 if (!d.getElementById(id)) {
649 js = d.createElement(s);
650 js.id = id;
651 js.src = p + '://platform.twitter.com/widgets.js';
652 fjs.parentNode.insertBefore(js, fjs);
653 }
654 }(document, 'script', 'twitter-wjs');
655 </script>
656
657 </div>
658 <!--/.social-items-wrap -->
659
660 <?php
661 }
662
663
664 /**
665 * Sends user to the Welcome page on first activation of GIVE as well as each
666 * time GIVE is upgraded to a new version
667 *
668 * @access public
669 * @since 1.0
670 *
671 * @return void
672 */
673 public function welcome() {
674
675 // Bail if no activation redirect
676 if ( ! Give_Cache::get( '_give_activation_redirect', true ) || wp_doing_ajax() ) {
677 return;
678 }
679
680 // Delete the redirect transient
681 Give_Cache::delete( Give_Cache::get_key( '_give_activation_redirect' ) );
682
683 // Bail if activating from network, or bulk
684 if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
685 return;
686 }
687
688 $upgrade = get_option( 'give_version_upgraded_from' );
689
690 if ( ! $upgrade ) { // First time install
691 wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
692 exit;
693 } elseif ( ! give_is_setting_enabled( give_get_option( 'welcome' ) ) ) { // Welcome is disabled in settings
694
695 } else { // Welcome is NOT disabled in settings
696 wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
697 exit;
698 }
699 }
700
701 }
702
703 new Give_Welcome();
704