PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.1.0
GiveWP – Donation Plugin and Fundraising Platform v2.1.0
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
donors 8 years ago emails 8 years ago forms 8 years ago payments 8 years ago reports 8 years ago settings 8 years ago shortcodes 8 years ago tools 8 years ago upgrades 8 years ago views 8 years ago EDD_SL_Plugin_Updater.php 8 years ago abstract-admin-settings-page.php 8 years ago add-ons.php 8 years ago admin-actions.php 8 years ago admin-filters.php 8 years ago admin-footer.php 8 years ago admin-pages.php 8 years ago class-addon-activation-banner.php 8 years ago class-admin-settings.php 8 years ago class-api-keys-table.php 8 years ago class-blank-slate.php 8 years ago class-give-settings.php 8 years ago class-i18n-module.php 8 years ago dashboard-widgets.php 8 years ago give-metabox-functions.php 8 years ago plugins.php 8 years ago welcome.php 8 years ago
welcome.php
675 lines
1 <?php
2 /**
3 * Give Welcome Page Class
4 *
5 * Displays on plugin activation
6 * @package Give
7 * @subpackage Admin/Welcome
8 * @copyright Copyright (c) 2016, WordImpress
9 * @license https://opensource.org/licenses/gpl-license GNU Public License
10 * @since 1.0
11 */
12
13 // Exit if accessed directly.
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17
18 /**
19 * Give_Welcome Class
20 *
21 * A general class for About and Credits page.
22 *
23 * @since 1.0
24 */
25 class Give_Welcome {
26
27 /**
28 * @var string The capability users should have to view the page
29 */
30 public $minimum_capability = 'manage_options';
31
32 /**
33 * Get things started
34 *
35 * @since 1.0
36 */
37 public function __construct() {
38 add_action( 'admin_menu', array( $this, 'admin_menus' ) );
39 add_action( 'admin_head', array( $this, 'admin_head' ) );
40 add_action( 'admin_init', array( $this, 'welcome' ) );
41 }
42
43 /**
44 * Register the Dashboard Pages which are later hidden but these pages
45 * are used to render the Welcome and Credits pages.
46 *
47 * @access public
48 * @since 1.0
49 * @return void
50 */
51 public function admin_menus() {
52 list( $display_version ) = explode( '-', GIVE_VERSION );
53
54 // About Page
55 add_dashboard_page(
56 /* translators: %s: Give version */
57 sprintf( esc_html__( 'Welcome to Give %s', 'give' ), $display_version ),
58 esc_html__( 'Welcome to Give', 'give' ),
59 $this->minimum_capability,
60 'give-about',
61 array( $this, 'about_screen' )
62 );
63
64 // Changelog Page
65 add_dashboard_page(
66 esc_html__( 'Give Changelog', 'give' ),
67 esc_html__( 'Give Changelog', 'give' ),
68 $this->minimum_capability,
69 'give-changelog',
70 array( $this, 'changelog_screen' )
71 );
72
73 // Getting Started Page
74 add_dashboard_page(
75 /* translators: %s: Give version */
76 sprintf( esc_html__( 'Give %s - Getting Started Guide', 'give' ), $display_version ),
77 esc_html__( 'Getting started with Give', 'give' ),
78 $this->minimum_capability,
79 'give-getting-started',
80 array( $this, 'getting_started_screen' )
81 );
82
83 // Credits Page
84 add_dashboard_page(
85 /* translators: %s: Give version */
86 sprintf( esc_html__( 'Give %s - Credits', 'give' ), $display_version ),
87 esc_html__( 'The people that build Give', 'give' ),
88 $this->minimum_capability,
89 'give-credits',
90 array( $this, 'credits_screen' )
91 );
92 }
93
94 /**
95 * Hide Individual Dashboard Pages
96 *
97 * @access public
98 * @since 1.0
99 * @return void
100 */
101 public function admin_head() {
102
103 remove_submenu_page( 'index.php', 'give-about' );
104 remove_submenu_page( 'index.php', 'give-changelog' );
105 remove_submenu_page( 'index.php', 'give-getting-started' );
106 remove_submenu_page( 'index.php', 'give-credits' );
107
108 }
109
110 /**
111 * Navigation tabs
112 *
113 * @access public
114 * @since 1.0
115 * @return void
116 */
117 public function tabs() {
118 $selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about';
119 ?>
120 <h2 class="nav-tab-wrapper">
121 <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>"
122 href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>">
123 <?php esc_html_e( 'About Give', 'give' ); ?>
124 </a>
125 <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>"
126 href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>">
127 <?php esc_html_e( 'Getting Started', 'give' ); ?>
128 </a>
129 <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>"
130 href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>">
131 <?php esc_html_e( 'Credits', 'give' ); ?>
132 </a>
133 <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>"
134 href="<?php echo esc_url( admin_url( 'edit.php?post_type=give_forms&page=give-addons' ) ); ?>">
135 <?php esc_html_e( 'Add-ons', 'give' ); ?>
136 </a>
137 </h2>
138 <?php
139 }
140
141 /**
142 * Render About Screen
143 *
144 * @access public
145 * @since 1.0
146 * @return void
147 */
148 public function about_screen() {
149 list( $display_version ) = explode( '-', GIVE_VERSION );
150 ?>
151 <div class="wrap about-wrap">
152
153 <?php $this->get_welcome_header() ?>
154
155 <p class="about-text"><?php
156 printf(
157 /* translators: %s: http://docs.givewp.com/docs */
158 __( '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' ),
159 esc_url( 'http://docs.givewp.com/docs' )
160 );
161 ?></p>
162
163 <?php give_get_newsletter(); ?>
164
165 <div class="give-badge"><?php
166 printf(
167 /* translators: %s: Give version */
168 esc_html__( 'Version %s', 'give' ),
169 $display_version
170 );
171 ?></div>
172
173 <?php $this->tabs(); ?>
174
175 <div class="feature-section clearfix introduction">
176
177 <div class="video feature-section-item">
178 <img src="<?php echo GIVE_PLUGIN_URL . 'assets/dist/images/give-logo-photo-mashup.png' ?>"
179 alt="<?php esc_attr_e( 'Give', 'give' ); ?>">
180 </div>
181
182 <div class="content feature-section-item last-feature">
183
184 <h3><?php esc_html_e( 'Give - Democratizing Generosity', 'give' ); ?></h3>
185
186 <p><?php esc_html_e( 'Give empowers you to easily accept donations and setup fundraising campaigns, directly within WordPress. We created Give 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>
187 <a href="https://givewp.com" target="_blank" class="button-secondary">
188 <?php esc_html_e( 'Learn More', 'give' ); ?>
189 <span class="dashicons dashicons-external"></span>
190 </a>
191
192 </div>
193
194 </div>
195 <!-- /.intro-section -->
196
197 <div class="feature-section clearfix">
198
199 <div class="content feature-section-item">
200
201 <h3><?php esc_html_e( 'Getting to Know Give', 'give' ); ?></h3>
202
203 <p><?php esc_html_e( 'Before you get started with Give 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 Give website. We also welcome your feedback and feature requests. Welcome to Give. We hope you much success with your cause.', 'give' ); ?></p>
204
205 <h4>Find Out More:</h4>
206 <ul class="ul-disc">
207 <li><a href="https://givewp.com/" target="_blank"><?php esc_html_e( 'Visit the Give Website', 'give' ); ?></a></li>
208 <li><a href="https://givewp.com/features/" target="_blank"><?php esc_html_e( 'View the Give Features', 'give' ); ?></a></li>
209 <li><a href="https://givewp.com/documentation/" target="_blank"><?php esc_html_e( 'Read the Documentation', 'give' ); ?></a></li>
210 </ul>
211
212 </div>
213
214 <div class="content feature-section-item last-feature">
215 <img src="<?php echo GIVE_PLUGIN_URL . '/assets/dist/images/admin/give-form-mockup.png' ?>"
216 alt="<?php esc_attr_e( 'A Give donation form', 'give' ); ?>">
217 </div>
218
219 </div>
220 <!-- /.feature-section -->
221
222
223 </div>
224 <?php
225 }
226
227 /**
228 * Render Changelog Screen
229 *
230 * @access public
231 * @since 1.0
232 * @return void
233 */
234 public function changelog_screen() {
235 list( $display_version ) = explode( '-', GIVE_VERSION );
236 ?>
237 <div class="wrap about-wrap">
238 <h1><?php echo get_admin_page_title(); ?></h1>
239
240 <p class="about-text"><?php
241 printf(
242 /* translators: %s: Give version */
243 esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ),
244 $display_version
245 );
246 ?></p>
247 <div class="give-badge"><?php
248 printf(
249 /* translators: %s: Give version */
250 esc_html__( 'Version %s', 'give' ),
251 $display_version
252 );
253 ?></div>
254
255 <?php $this->tabs(); ?>
256
257 <div class="changelog">
258 <h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3>
259
260 <div class="feature-section">
261 <?php echo $this->parse_readme(); ?>
262 </div>
263 </div>
264
265 <div class="return-to-dashboard">
266 <a href="<?php echo esc_url( admin_url( add_query_arg( array(
267 'post_type' => 'give_forms',
268 'page' => 'give-settings'
269 ), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Give Settings', 'give' ); ?></a>
270 </div>
271 </div>
272 <?php
273 }
274
275 /**
276 * Render Getting Started Screen
277 *
278 * @access public
279 * @since 1.0
280 * @return void
281 */
282 public function getting_started_screen() {
283 list( $display_version ) = explode( '-', GIVE_VERSION );
284 ?>
285 <div class="wrap about-wrap get-started">
286
287 <?php $this->get_welcome_header() ?>
288
289 <p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
290
291 <?php give_get_newsletter(); ?>
292
293 <div class="give-badge"><?php
294 printf(
295 /* translators: %s: Give version */
296 esc_html__( 'Version %s', 'give' ),
297 $display_version
298 );
299 ?></div>
300
301 <?php $this->tabs(); ?>
302
303 <p class="about-text"><?php printf( esc_html__( 'Getting started with Give 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>
304
305 <div class="feature-section clearfix">
306
307 <div class="content feature-section-item">
308 <h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3>
309
310 <p><?php esc_html_e( 'Give is driven by it\'s 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>
311
312 <p><?php esc_html_e( 'All of these features begin by simply going to the menu and choosing "Donations > Add Form".', 'give' ); ?></p>
313 </div>
314
315 <div class="content feature-section-item last-feature">
316 <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/dist/images/admin/getting-started-add-new-form.png">
317 </div>
318
319 </div>
320 <!-- /.feature-section -->
321
322 <div class="feature-section clearfix">
323
324 <div class="content feature-section-item multi-level-gif">
325 <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/dist/images/admin/getting-started-new-form-multi-level.gif">
326 </div>
327
328 <div class="content feature-section-item last-feature">
329 <h3><?php esc_html_e( 'STEP 2: Customize Your Donation Forms', 'give' ); ?></h3>
330
331 <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>
332 </div>
333
334 </div>
335 <!-- /.feature-section -->
336
337 <div class="feature-section clearfix">
338
339 <div class="content feature-section-item add-content">
340 <h3><?php esc_html_e( 'STEP 3: Add Additional Content', 'give' ); ?></h3>
341
342 <p><?php esc_html_e( 'Every donation form you create with Give 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>
343
344 <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 if you choose "None" perhaps 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>
345 </div>
346
347 <div class="content feature-section-item last-feature">
348 <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/dist/images/admin/getting-started-add-content.png">
349 </div>
350
351 </div>
352 <!-- /.feature-section -->
353
354 <div class="feature-section clearfix">
355
356 <div class="content feature-section-item display-options">
357 <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/dist/images/admin/getting-started-display-options.png">
358 </div>
359
360 <div class="content feature-section-item last-feature">
361 <h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3>
362
363 <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>
364 </div>
365
366
367 </div>
368 <!-- /.feature-section -->
369
370
371 </div>
372 <?php
373 }
374
375 /**
376 * Render Credits Screen
377 *
378 * @access public
379 * @since 1.0
380 * @return void
381 */
382 public function credits_screen() {
383 list( $display_version ) = explode( '-', GIVE_VERSION );
384 ?>
385 <div class="wrap about-wrap">
386
387 <?php $this->get_welcome_header() ?>
388
389 <p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly.', 'give' ); ?></p>
390
391 <?php give_get_newsletter(); ?>
392
393 <div class="give-badge"><?php
394 printf(
395 /* translators: %s: Give version */
396 esc_html__( 'Version %s', 'give' ),
397 $display_version
398 );
399 ?></div>
400
401 <?php $this->tabs(); ?>
402
403 <p class="about-description"><?php
404 printf(
405 /* translators: %s: https://github.com/WordImpress/give */
406 __( 'Give 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' ),
407 esc_url( 'https://github.com/WordImpress/give' )
408 );
409 ?></p>
410
411 <?php echo $this->contributors(); ?>
412 </div>
413 <?php
414 }
415
416
417 /**
418 * Parse the GIVE readme.txt file
419 *
420 * @since 1.0
421 * @return string $readme HTML formatted readme file
422 */
423 public function parse_readme() {
424 $file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
425
426 if ( ! $file ) {
427 $readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>';
428 } else {
429 $readme = file_get_contents( $file );
430 $readme = nl2br( esc_html( $readme ) );
431 $readme = explode( '== Changelog ==', $readme );
432 $readme = end( $readme );
433
434 $readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme );
435 $readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme );
436 $readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme );
437 $readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme );
438 $readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme );
439 }
440
441 return $readme;
442 }
443
444
445 /**
446 * Render Contributors List
447 *
448 * @since 1.0
449 * @uses Give_Welcome::get_contributors()
450 * @return string $contributor_list HTML formatted list of all the contributors for GIVE
451 */
452 public function contributors() {
453 $contributors = $this->get_contributors();
454
455 if ( empty( $contributors ) ) {
456 return '';
457 }
458
459 $contributor_list = '<ul class="wp-people-group">';
460
461 foreach ( $contributors as $contributor ) {
462 $contributor_list .= '<li class="wp-person">';
463 $contributor_list .= sprintf(
464 '<a href="%1$s" target="_blank"><img src="%2$s" width="64" height="64" class="gravatar" alt="%3$s" /></a>',
465 esc_url( 'https://github.com/' . $contributor->login ),
466 esc_url( $contributor->avatar_url ),
467 esc_attr( $contributor->login )
468 );
469 $contributor_list .= sprintf(
470 '<a class="web" target="_blank" href="%1$s">%2$s</a>',
471 esc_url( 'https://github.com/' . $contributor->login ),
472 esc_html( $contributor->login )
473 );
474 $contributor_list .= '</li>';
475 }
476
477 $contributor_list .= '</ul>';
478
479 return $contributor_list;
480 }
481
482 /**
483 * Retreive list of contributors from GitHub.
484 *
485 * @access public
486 * @since 1.0
487 * @return array $contributors List of contributors
488 */
489 public function get_contributors() {
490 $contributors = Give_Cache::get( 'give_contributors', true );
491
492 if ( false !== $contributors ) {
493 return $contributors;
494 }
495
496 $response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) );
497
498 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
499 return array();
500 }
501
502 $contributors = json_decode( wp_remote_retrieve_body( $response ) );
503
504 if ( ! is_array( $contributors ) ) {
505 return array();
506 }
507
508 Give_Cache::set( 'give_contributors', $contributors, HOUR_IN_SECONDS, true );
509
510 return $contributors;
511 }
512
513 /**
514 * The header section for the welcome screen.
515 *
516 * @since 1.8.8
517 */
518 public function get_welcome_header() {
519 // Badge for welcome page
520 $badge_url = GIVE_PLUGIN_URL . 'assets/dist/images/give-badge.png';
521 ?>
522 <h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1>
523 <?php $this->social_media_elements(); ?>
524
525 <style type="text/css" media="screen">
526 /*<![CDATA[*/
527 .give-badge {
528 background: url('<?php echo $badge_url; ?>') no-repeat;
529 }
530
531 /*]]>*/
532 </style>
533 <script>
534 //FitVids
535 (function (e) {
536 "use strict";
537 e.fn.fitVids = function (t) {
538 var n = {customSelector: null, ignore: null};
539 if (!document.getElementById("fit-vids-style")) {
540 var r = document.head || document.getElementsByTagName("head")[0];
541 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%;}";
542 var s = document.createElement("div");
543 s.innerHTML = '<p>x</p><style id="fit-vids-style">' + i + "</style>";
544 r.appendChild(s.childNodes[1])
545 }
546 if (t) {
547 e.extend(n, t)
548 }
549 return this.each(function () {
550 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"];
551 if (n.customSelector) {
552 t.push(n.customSelector)
553 }
554 var r = ".fitvidsignore";
555 if (n.ignore) {
556 r = r + ", " + n.ignore
557 }
558 var i = e(this).find(t.join(","));
559 i = i.not("object object");
560 i = i.not(r);
561 i.each(function () {
562 var t = e(this);
563 if (t.parents(r).length > 0) {
564 return
565 }
566 if (this.tagName.toLowerCase() === "embed" && t.parent("object").length || t.parent(".fluid-width-video-wrapper").length) {
567 return
568 }
569 if (!t.css("height") && !t.css("width") && (isNaN(t.attr("height")) || isNaN(t.attr("width")))) {
570 t.attr("height", 9);
571 t.attr("width", 16)
572 }
573 var n = this.tagName.toLowerCase() === "object" || t.attr("height") && !isNaN(parseInt(t.attr("height"), 10)) ? parseInt(t.attr("height"), 10) : t.height(),
574 i = !isNaN(parseInt(t.attr("width"), 10)) ? parseInt(t.attr("width"), 10) : t.width(),
575 s = n / i;
576 if (!t.attr("id")) {
577 var o = "fitvid" + Math.floor(Math.random() * 999999);
578 t.attr("id", o)
579 }
580 t.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top", s * 100 + "%");
581 t.removeAttr("height").removeAttr("width")
582 })
583 })
584 }
585 })(window.jQuery || window.Zepto);
586 jQuery(document).ready(function ($) {
587
588 // Target your .container, .wrapper, .post, etc.
589 $(".wrap").fitVids();
590
591 });
592
593 </script>
594 <?php }
595
596
597 /**
598 * Social Media Like Buttons
599 *
600 * Various social media elements to Give
601 */
602 public function social_media_elements() { ?>
603
604 <div class="social-items-wrap">
605
606 <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"
607 scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;"
608 allowTransparency="true"></iframe>
609
610 <a href="https://twitter.com/givewp" class="twitter-follow-button" data-show-count="false"><?php
611 printf(
612 /* translators: %s: Give twitter user @givewp */
613 esc_html_e( 'Follow %s', 'give' ),
614 '@givewp'
615 );
616 ?></a>
617 <script>!function (d, s, id) {
618 var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
619 if (!d.getElementById(id)) {
620 js = d.createElement(s);
621 js.id = id;
622 js.src = p + '://platform.twitter.com/widgets.js';
623 fjs.parentNode.insertBefore(js, fjs);
624 }
625 }(document, 'script', 'twitter-wjs');
626 </script>
627
628 </div>
629 <!--/.social-items-wrap -->
630
631 <?php
632 }
633
634
635 /**
636 * Sends user to the Welcome page on first activation of GIVE as well as each
637 * time GIVE is upgraded to a new version
638 *
639 * @access public
640 * @since 1.0
641 *
642 * @return void
643 */
644 public function welcome() {
645
646 // Bail if no activation redirect
647 if ( ! Give_Cache::get( '_give_activation_redirect', true ) || wp_doing_ajax() ) {
648 return;
649 }
650
651 // Delete the redirect transient
652 Give_Cache::delete( Give_Cache::get_key( '_give_activation_redirect' ) );
653
654 // Bail if activating from network, or bulk
655 if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
656 return;
657 }
658
659 $upgrade = get_option( 'give_version_upgraded_from' );
660
661 if ( ! $upgrade ) { // First time install
662 wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
663 exit;
664 } elseif ( ! give_is_setting_enabled( give_get_option( 'welcome' ) ) ) { // Welcome is disabled in settings
665
666 } else { // Welcome is NOT disabled in settings
667 wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
668 exit;
669 }
670 }
671
672 }
673
674 new Give_Welcome();
675