PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 2.2.2
GiveWP – Donation Plugin and Fundraising Platform v2.2.2
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 7 years ago emails 7 years ago forms 7 years ago payments 7 years ago reports 7 years ago settings 7 years ago shortcodes 7 years ago tools 7 years ago upgrades 7 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 7 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 7 years ago class-admin-settings.php 7 years ago class-api-keys-table.php 8 years ago class-blank-slate.php 8 years ago class-give-settings.php 7 years ago class-i18n-module.php 8 years ago dashboard-widgets.php 8 years ago give-metabox-functions.php 7 years ago plugins.php 7 years ago welcome.php 8 years ago
welcome.php
678 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/"
208 target="_blank"><?php esc_html_e( 'Visit the Give Website', 'give' ); ?></a></li>
209 <li><a href="https://givewp.com/features/"
210 target="_blank"><?php esc_html_e( 'View the Give Features', 'give' ); ?></a></li>
211 <li><a href="https://givewp.com/documentation/"
212 target="_blank"><?php esc_html_e( 'Read the Documentation', 'give' ); ?></a></li>
213 </ul>
214
215 </div>
216
217 <div class="content feature-section-item last-feature">
218 <img src="<?php echo GIVE_PLUGIN_URL . '/assets/dist/images/admin/give-form-mockup.png' ?>"
219 alt="<?php esc_attr_e( 'A Give donation form', 'give' ); ?>">
220 </div>
221
222 </div>
223 <!-- /.feature-section -->
224
225
226 </div>
227 <?php
228 }
229
230 /**
231 * Render Changelog Screen
232 *
233 * @access public
234 * @since 1.0
235 * @return void
236 */
237 public function changelog_screen() {
238 list( $display_version ) = explode( '-', GIVE_VERSION );
239 ?>
240 <div class="wrap about-wrap">
241 <h1><?php echo get_admin_page_title(); ?></h1>
242
243 <p class="about-text"><?php
244 printf(
245 /* translators: %s: Give version */
246 esc_html__( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ),
247 $display_version
248 );
249 ?></p>
250 <div class="give-badge"><?php
251 printf(
252 /* translators: %s: Give version */
253 esc_html__( 'Version %s', 'give' ),
254 $display_version
255 );
256 ?></div>
257
258 <?php $this->tabs(); ?>
259
260 <div class="changelog">
261 <h3><?php esc_html_e( 'Full Changelog', 'give' ); ?></h3>
262
263 <div class="feature-section">
264 <?php echo $this->parse_readme(); ?>
265 </div>
266 </div>
267
268 <div class="return-to-dashboard">
269 <a href="<?php echo esc_url( admin_url( add_query_arg( array(
270 'post_type' => 'give_forms',
271 'page' => 'give-settings'
272 ), 'edit.php' ) ) ); ?>"><?php esc_html_e( 'Give Settings', 'give' ); ?></a>
273 </div>
274 </div>
275 <?php
276 }
277
278 /**
279 * Render Getting Started Screen
280 *
281 * @access public
282 * @since 1.0
283 * @return void
284 */
285 public function getting_started_screen() {
286 list( $display_version ) = explode( '-', GIVE_VERSION );
287 ?>
288 <div class="wrap about-wrap get-started">
289
290 <?php $this->get_welcome_header() ?>
291
292 <p class="about-text"><?php esc_html_e( 'Welcome to the getting started guide.', 'give' ); ?></p>
293
294 <?php give_get_newsletter(); ?>
295
296 <div class="give-badge"><?php
297 printf(
298 /* translators: %s: Give version */
299 esc_html__( 'Version %s', 'give' ),
300 $display_version
301 );
302 ?></div>
303
304 <?php $this->tabs(); ?>
305
306 <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>
307
308 <div class="feature-section clearfix">
309
310 <div class="content feature-section-item">
311 <h3><?php esc_html_e( 'STEP 1: Create a New Form', 'give' ); ?></h3>
312
313 <p><?php esc_html_e( 'Give 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>
314
315 <p><?php esc_html_e( 'All of these features begin by simply going to the menu and choosing "Donations > Add Form."', 'give' ); ?></p>
316 </div>
317
318 <div class="content feature-section-item last-feature">
319 <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/dist/images/admin/getting-started-add-new-form.png">
320 </div>
321
322 </div>
323 <!-- /.feature-section -->
324
325 <div class="feature-section clearfix">
326
327 <div class="content feature-section-item multi-level-gif">
328 <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/dist/images/admin/getting-started-new-form-multi-level.gif">
329 </div>
330
331 <div class="content feature-section-item last-feature">
332 <h3><?php esc_html_e( 'STEP 2: Customize Your Donation Forms', 'give' ); ?></h3>
333
334 <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>
335 </div>
336
337 </div>
338 <!-- /.feature-section -->
339
340 <div class="feature-section clearfix">
341
342 <div class="content feature-section-item add-content">
343 <h3><?php esc_html_e( 'STEP 3: Add Additional Content', 'give' ); ?></h3>
344
345 <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>
346
347 <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>
348 </div>
349
350 <div class="content feature-section-item last-feature">
351 <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/dist/images/admin/getting-started-add-content.png">
352 </div>
353
354 </div>
355 <!-- /.feature-section -->
356
357 <div class="feature-section clearfix">
358
359 <div class="content feature-section-item display-options">
360 <img src="<?php echo GIVE_PLUGIN_URL; ?>assets/dist/images/admin/getting-started-display-options.png">
361 </div>
362
363 <div class="content feature-section-item last-feature">
364 <h3><?php esc_html_e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3>
365
366 <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>
367 </div>
368
369
370 </div>
371 <!-- /.feature-section -->
372
373
374 </div>
375 <?php
376 }
377
378 /**
379 * Render Credits Screen
380 *
381 * @access public
382 * @since 1.0
383 * @return void
384 */
385 public function credits_screen() {
386 list( $display_version ) = explode( '-', GIVE_VERSION );
387 ?>
388 <div class="wrap about-wrap">
389
390 <?php $this->get_welcome_header() ?>
391
392 <p class="about-text"><?php esc_html_e( 'Thanks to all those who have contributed code directly or indirectly.', 'give' ); ?></p>
393
394 <?php give_get_newsletter(); ?>
395
396 <div class="give-badge"><?php
397 printf(
398 /* translators: %s: Give version */
399 esc_html__( 'Version %s', 'give' ),
400 $display_version
401 );
402 ?></div>
403
404 <?php $this->tabs(); ?>
405
406 <p class="about-description"><?php
407 printf(
408 /* translators: %s: https://github.com/WordImpress/give */
409 __( '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' ),
410 esc_url( 'https://github.com/WordImpress/give' )
411 );
412 ?></p>
413
414 <?php echo $this->contributors(); ?>
415 </div>
416 <?php
417 }
418
419
420 /**
421 * Parse the GIVE readme.txt file
422 *
423 * @since 1.0
424 * @return string $readme HTML formatted readme file
425 */
426 public function parse_readme() {
427 $file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null;
428
429 if ( ! $file ) {
430 $readme = '<p>' . esc_html__( 'No valid changlog was found.', 'give' ) . '</p>';
431 } else {
432 $readme = file_get_contents( $file );
433 $readme = nl2br( esc_html( $readme ) );
434 $readme = explode( '== Changelog ==', $readme );
435 $readme = end( $readme );
436
437 $readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme );
438 $readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme );
439 $readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme );
440 $readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme );
441 $readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme );
442 }
443
444 return $readme;
445 }
446
447
448 /**
449 * Render Contributors List
450 *
451 * @since 1.0
452 * @uses Give_Welcome::get_contributors()
453 * @return string $contributor_list HTML formatted list of all the contributors for GIVE
454 */
455 public function contributors() {
456 $contributors = $this->get_contributors();
457
458 if ( empty( $contributors ) ) {
459 return '';
460 }
461
462 $contributor_list = '<ul class="wp-people-group">';
463
464 foreach ( $contributors as $contributor ) {
465 $contributor_list .= '<li class="wp-person">';
466 $contributor_list .= sprintf(
467 '<a href="%1$s" target="_blank"><img src="%2$s" width="64" height="64" class="gravatar" alt="%3$s" /></a>',
468 esc_url( 'https://github.com/' . $contributor->login ),
469 esc_url( $contributor->avatar_url ),
470 esc_attr( $contributor->login )
471 );
472 $contributor_list .= sprintf(
473 '<a class="web" target="_blank" href="%1$s">%2$s</a>',
474 esc_url( 'https://github.com/' . $contributor->login ),
475 esc_html( $contributor->login )
476 );
477 $contributor_list .= '</li>';
478 }
479
480 $contributor_list .= '</ul>';
481
482 return $contributor_list;
483 }
484
485 /**
486 * Retreive list of contributors from GitHub.
487 *
488 * @access public
489 * @since 1.0
490 * @return array $contributors List of contributors
491 */
492 public function get_contributors() {
493 $contributors = Give_Cache::get( 'give_contributors', true );
494
495 if ( false !== $contributors ) {
496 return $contributors;
497 }
498
499 $response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) );
500
501 if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
502 return array();
503 }
504
505 $contributors = json_decode( wp_remote_retrieve_body( $response ) );
506
507 if ( ! is_array( $contributors ) ) {
508 return array();
509 }
510
511 Give_Cache::set( 'give_contributors', $contributors, HOUR_IN_SECONDS, true );
512
513 return $contributors;
514 }
515
516 /**
517 * The header section for the welcome screen.
518 *
519 * @since 1.8.8
520 */
521 public function get_welcome_header() {
522 // Badge for welcome page
523 $badge_url = GIVE_PLUGIN_URL . 'assets/dist/images/give-badge.png';
524 ?>
525 <h1 class="welcome-h1"><?php echo get_admin_page_title(); ?></h1>
526 <?php $this->social_media_elements(); ?>
527
528 <style type="text/css" media="screen">
529 /*<![CDATA[*/
530 .give-badge {
531 background: url('<?php echo $badge_url; ?>') no-repeat;
532 }
533
534 /*]]>*/
535 </style>
536 <script>
537 //FitVids
538 (function (e) {
539 "use strict";
540 e.fn.fitVids = function (t) {
541 var n = {customSelector: null, ignore: null};
542 if (!document.getElementById("fit-vids-style")) {
543 var r = document.head || document.getElementsByTagName("head")[0];
544 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%;}";
545 var s = document.createElement("div");
546 s.innerHTML = '<p>x</p><style id="fit-vids-style">' + i + "</style>";
547 r.appendChild(s.childNodes[1])
548 }
549 if (t) {
550 e.extend(n, t)
551 }
552 return this.each(function () {
553 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"];
554 if (n.customSelector) {
555 t.push(n.customSelector)
556 }
557 var r = ".fitvidsignore";
558 if (n.ignore) {
559 r = r + ", " + n.ignore
560 }
561 var i = e(this).find(t.join(","));
562 i = i.not("object object");
563 i = i.not(r);
564 i.each(function () {
565 var t = e(this);
566 if (t.parents(r).length > 0) {
567 return
568 }
569 if (this.tagName.toLowerCase() === "embed" && t.parent("object").length || t.parent(".fluid-width-video-wrapper").length) {
570 return
571 }
572 if (!t.css("height") && !t.css("width") && (isNaN(t.attr("height")) || isNaN(t.attr("width")))) {
573 t.attr("height", 9);
574 t.attr("width", 16)
575 }
576 var n = this.tagName.toLowerCase() === "object" || t.attr("height") && !isNaN(parseInt(t.attr("height"), 10)) ? parseInt(t.attr("height"), 10) : t.height(),
577 i = !isNaN(parseInt(t.attr("width"), 10)) ? parseInt(t.attr("width"), 10) : t.width(),
578 s = n / i;
579 if (!t.attr("id")) {
580 var o = "fitvid" + Math.floor(Math.random() * 999999);
581 t.attr("id", o)
582 }
583 t.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top", s * 100 + "%");
584 t.removeAttr("height").removeAttr("width")
585 })
586 })
587 }
588 })(window.jQuery || window.Zepto);
589 jQuery(document).ready(function ($) {
590
591 // Target your .container, .wrapper, .post, etc.
592 $(".wrap").fitVids();
593
594 });
595
596 </script>
597 <?php }
598
599
600 /**
601 * Social Media Like Buttons
602 *
603 * Various social media elements to Give
604 */
605 public function social_media_elements() { ?>
606
607 <div class="social-items-wrap">
608
609 <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"
610 scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;"
611 allowTransparency="true"></iframe>
612
613 <a href="https://twitter.com/givewp" class="twitter-follow-button" data-show-count="false"><?php
614 printf(
615 /* translators: %s: Give twitter user @givewp */
616 esc_html_e( 'Follow %s', 'give' ),
617 '@givewp'
618 );
619 ?></a>
620 <script>!function (d, s, id) {
621 var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
622 if (!d.getElementById(id)) {
623 js = d.createElement(s);
624 js.id = id;
625 js.src = p + '://platform.twitter.com/widgets.js';
626 fjs.parentNode.insertBefore(js, fjs);
627 }
628 }(document, 'script', 'twitter-wjs');
629 </script>
630
631 </div>
632 <!--/.social-items-wrap -->
633
634 <?php
635 }
636
637
638 /**
639 * Sends user to the Welcome page on first activation of GIVE as well as each
640 * time GIVE is upgraded to a new version
641 *
642 * @access public
643 * @since 1.0
644 *
645 * @return void
646 */
647 public function welcome() {
648
649 // Bail if no activation redirect
650 if ( ! Give_Cache::get( '_give_activation_redirect', true ) || wp_doing_ajax() ) {
651 return;
652 }
653
654 // Delete the redirect transient
655 Give_Cache::delete( Give_Cache::get_key( '_give_activation_redirect' ) );
656
657 // Bail if activating from network, or bulk
658 if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) {
659 return;
660 }
661
662 $upgrade = get_option( 'give_version_upgraded_from' );
663
664 if ( ! $upgrade ) { // First time install
665 wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
666 exit;
667 } elseif ( ! give_is_setting_enabled( give_get_option( 'welcome' ) ) ) { // Welcome is disabled in settings
668
669 } else { // Welcome is NOT disabled in settings
670 wp_safe_redirect( admin_url( 'index.php?page=give-about' ) );
671 exit;
672 }
673 }
674
675 }
676
677 new Give_Welcome();
678