@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @since 1.0 |
36 | 36 | */ |
37 | 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' ) ); |
|
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 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -51,38 +51,38 @@ discard block |
||
51 | 51 | public function admin_menus() { |
52 | 52 | // About Page |
53 | 53 | add_dashboard_page( |
54 | - __( 'Welcome to Give', 'give' ), |
|
55 | - __( 'Welcome to Give', 'give' ), |
|
54 | + __('Welcome to Give', 'give'), |
|
55 | + __('Welcome to Give', 'give'), |
|
56 | 56 | $this->minimum_capability, |
57 | 57 | 'give-about', |
58 | - array( $this, 'about_screen' ) |
|
58 | + array($this, 'about_screen') |
|
59 | 59 | ); |
60 | 60 | |
61 | 61 | // Changelog Page |
62 | 62 | add_dashboard_page( |
63 | - __( 'Give Changelog', 'give' ), |
|
64 | - __( 'Give Changelog', 'give' ), |
|
63 | + __('Give Changelog', 'give'), |
|
64 | + __('Give Changelog', 'give'), |
|
65 | 65 | $this->minimum_capability, |
66 | 66 | 'give-changelog', |
67 | - array( $this, 'changelog_screen' ) |
|
67 | + array($this, 'changelog_screen') |
|
68 | 68 | ); |
69 | 69 | |
70 | 70 | // Getting Started Page |
71 | 71 | add_dashboard_page( |
72 | - __( 'Getting started with Give', 'give' ), |
|
73 | - __( 'Getting started with Give', 'give' ), |
|
72 | + __('Getting started with Give', 'give'), |
|
73 | + __('Getting started with Give', 'give'), |
|
74 | 74 | $this->minimum_capability, |
75 | 75 | 'give-getting-started', |
76 | - array( $this, 'getting_started_screen' ) |
|
76 | + array($this, 'getting_started_screen') |
|
77 | 77 | ); |
78 | 78 | |
79 | 79 | // Credits Page |
80 | 80 | add_dashboard_page( |
81 | - __( 'The people that build Give', 'give' ), |
|
82 | - __( 'The people that build Give', 'give' ), |
|
81 | + __('The people that build Give', 'give'), |
|
82 | + __('The people that build Give', 'give'), |
|
83 | 83 | $this->minimum_capability, |
84 | 84 | 'give-credits', |
85 | - array( $this, 'credits_screen' ) |
|
85 | + array($this, 'credits_screen') |
|
86 | 86 | ); |
87 | 87 | } |
88 | 88 | |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function admin_head() { |
97 | 97 | |
98 | - remove_submenu_page( 'index.php', 'give-about' ); |
|
99 | - remove_submenu_page( 'index.php', 'give-changelog' ); |
|
100 | - remove_submenu_page( 'index.php', 'give-getting-started' ); |
|
101 | - remove_submenu_page( 'index.php', 'give-credits' ); |
|
98 | + remove_submenu_page('index.php', 'give-about'); |
|
99 | + remove_submenu_page('index.php', 'give-changelog'); |
|
100 | + remove_submenu_page('index.php', 'give-getting-started'); |
|
101 | + remove_submenu_page('index.php', 'give-credits'); |
|
102 | 102 | |
103 | 103 | // Badge for welcome page |
104 | - $badge_url = GIVE_PLUGIN_URL . 'assets/images/give-badge.png'; |
|
104 | + $badge_url = GIVE_PLUGIN_URL.'assets/images/give-badge.png'; |
|
105 | 105 | |
106 | 106 | ?> |
107 | 107 | <style type="text/css" media="screen"> |
@@ -215,20 +215,20 @@ discard block |
||
215 | 215 | * @return void |
216 | 216 | */ |
217 | 217 | public function tabs() { |
218 | - $selected = isset( $_GET['page'] ) ? $_GET['page'] : 'give-about'; |
|
218 | + $selected = isset($_GET['page']) ? $_GET['page'] : 'give-about'; |
|
219 | 219 | ?> |
220 | 220 | <h1 class="nav-tab-wrapper"> |
221 | - <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-about' ), 'index.php' ) ) ); ?>"> |
|
222 | - <?php _e( "About Give", 'give' ); ?> |
|
221 | + <a class="nav-tab <?php echo $selected == 'give-about' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-about'), 'index.php'))); ?>"> |
|
222 | + <?php _e("About Give", 'give'); ?> |
|
223 | 223 | </a> |
224 | - <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-getting-started' ), 'index.php' ) ) ); ?>"> |
|
225 | - <?php _e( 'Getting Started', 'give' ); ?> |
|
224 | + <a class="nav-tab <?php echo $selected == 'give-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-getting-started'), 'index.php'))); ?>"> |
|
225 | + <?php _e('Getting Started', 'give'); ?> |
|
226 | 226 | </a> |
227 | - <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'give-credits' ), 'index.php' ) ) ); ?>"> |
|
228 | - <?php _e( 'Credits', 'give' ); ?> |
|
227 | + <a class="nav-tab <?php echo $selected == 'give-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(add_query_arg(array('page' => 'give-credits'), 'index.php'))); ?>"> |
|
228 | + <?php _e('Credits', 'give'); ?> |
|
229 | 229 | </a> |
230 | - <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( null, 'index.php' ) ) . 'edit.php?post_type=give_forms&page=give-addons'; ?>"> |
|
231 | - <?php _e( 'Add-ons', 'give' ); ?> |
|
230 | + <a class="nav-tab <?php echo $selected == 'give-add-ons' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url(admin_url(null, 'index.php')).'edit.php?post_type=give_forms&page=give-addons'; ?>"> |
|
231 | + <?php _e('Add-ons', 'give'); ?> |
|
232 | 232 | </a> |
233 | 233 | </h1> |
234 | 234 | <?php |
@@ -242,20 +242,20 @@ discard block |
||
242 | 242 | * @return void |
243 | 243 | */ |
244 | 244 | public function about_screen() { |
245 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
245 | + list($display_version) = explode('-', GIVE_VERSION); |
|
246 | 246 | ?> |
247 | 247 | <div class="wrap about-wrap"> |
248 | - <h1 class="welcome-h1"><?php printf( __( 'Welcome to Give %s', 'give' ), $display_version ); ?></h1> |
|
248 | + <h1 class="welcome-h1"><?php printf(__('Welcome to Give %s', 'give'), $display_version); ?></h1> |
|
249 | 249 | |
250 | 250 | <?php give_social_media_elements() ?> |
251 | 251 | |
252 | - <div class="about-text"><?php printf( __( '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. </You>We encourage you to check out the <a href="%s" title="View the Give plugin documentation online" target="_blank">plugin documentation</a> and getting started guide below.', 'give' ), 'https://givewp.com/documenation/' ); ?></div> |
|
252 | + <div class="about-text"><?php printf(__('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. </You>We encourage you to check out the <a href="%s" title="View the Give plugin documentation online" target="_blank">plugin documentation</a> and getting started guide below.', 'give'), 'https://givewp.com/documenation/'); ?></div> |
|
253 | 253 | |
254 | - <p class="newsletter-intro"><?php _e( 'Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give' ); ?></p> |
|
254 | + <p class="newsletter-intro"><?php _e('Be sure to sign up for the Give newsletter below to stay informed of important updates and news.', 'give'); ?></p> |
|
255 | 255 | |
256 | 256 | <?php give_get_newsletter() ?> |
257 | 257 | |
258 | - <div class="give-badge"><?php printf( __( 'Version %s', 'give' ), $display_version ); ?></div> |
|
258 | + <div class="give-badge"><?php printf(__('Version %s', 'give'), $display_version); ?></div> |
|
259 | 259 | |
260 | 260 | |
261 | 261 | |
@@ -264,15 +264,15 @@ discard block |
||
264 | 264 | <div class="feature-section clearfix introduction"> |
265 | 265 | |
266 | 266 | <div class="video feature-section-item"> |
267 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form"> |
|
267 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-form-mockup.png' ?>" title="A Give donation form" alt="A Give donation form"> |
|
268 | 268 | |
269 | 269 | </div> |
270 | 270 | |
271 | 271 | <div class="content feature-section-item last-feature"> |
272 | 272 | |
273 | - <h3><?php _e( 'Give - Democratizing Generosity', 'give' ); ?></h3> |
|
273 | + <h3><?php _e('Give - Democratizing Generosity', 'give'); ?></h3> |
|
274 | 274 | |
275 | - <p><?php _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> |
|
275 | + <p><?php _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> |
|
276 | 276 | <a href="https://givewp.com" target="_blank" class="button-secondary" title="Visit the Give Website">Learn More |
277 | 277 | <span class="dashicons dashicons-external"></span></a> |
278 | 278 | |
@@ -285,9 +285,9 @@ discard block |
||
285 | 285 | |
286 | 286 | <div class="content feature-section-item"> |
287 | 287 | |
288 | - <h3><?php _e( 'Getting to Know Give', 'give' ); ?></h3> |
|
288 | + <h3><?php _e('Getting to Know Give', 'give'); ?></h3> |
|
289 | 289 | |
290 | - <p><?php _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 an 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> |
|
290 | + <p><?php _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 an 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> |
|
291 | 291 | <a href="https://givewp.com/documentation" target="_blank" class="button-secondary" title="Visit the Give Website">View Documentation |
292 | 292 | <span class="dashicons dashicons-external"></span></a> |
293 | 293 | |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | |
296 | 296 | <div class="content feature-section-item last-feature"> |
297 | 297 | |
298 | - <img src="<?php echo GIVE_PLUGIN_URL . '/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give"> |
|
298 | + <img src="<?php echo GIVE_PLUGIN_URL.'/assets/images/give-logo-photo-mashup.png' ?>" title="Give" alt="Give"> |
|
299 | 299 | |
300 | 300 | </div> |
301 | 301 | |
@@ -315,18 +315,18 @@ discard block |
||
315 | 315 | * @return void |
316 | 316 | */ |
317 | 317 | public function changelog_screen() { |
318 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
318 | + list($display_version) = explode('-', GIVE_VERSION); |
|
319 | 319 | ?> |
320 | 320 | <div class="wrap about-wrap"> |
321 | - <h1><?php _e( 'Give Changelog', 'give' ); ?></h1> |
|
321 | + <h1><?php _e('Give Changelog', 'give'); ?></h1> |
|
322 | 322 | |
323 | - <div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give' ), $display_version ); ?></div> |
|
324 | - <div class="give-badge"><?php printf( __( 'Version %s', 'give' ), $display_version ); ?></div> |
|
323 | + <div class="about-text"><?php printf(__('Thank you for updating to the latest version! Give %s is ready to make your online store faster, safer, and better!', 'give'), $display_version); ?></div> |
|
324 | + <div class="give-badge"><?php printf(__('Version %s', 'give'), $display_version); ?></div> |
|
325 | 325 | |
326 | 326 | <?php $this->tabs(); ?> |
327 | 327 | |
328 | 328 | <div class="changelog"> |
329 | - <h3><?php _e( 'Full Changelog', 'give' ); ?></h3> |
|
329 | + <h3><?php _e('Full Changelog', 'give'); ?></h3> |
|
330 | 330 | |
331 | 331 | <div class="feature-section"> |
332 | 332 | <?php echo $this->parse_readme(); ?> |
@@ -334,10 +334,10 @@ discard block |
||
334 | 334 | </div> |
335 | 335 | |
336 | 336 | <div class="return-to-dashboard"> |
337 | - <a href="<?php echo esc_url( admin_url( add_query_arg( array( |
|
337 | + <a href="<?php echo esc_url(admin_url(add_query_arg(array( |
|
338 | 338 | 'post_type' => 'give_forms', |
339 | 339 | 'page' => 'give-settings' |
340 | - ), 'edit.php' ) ) ); ?>"><?php _e( 'Go to Give Settings', 'give' ); ?></a> |
|
340 | + ), 'edit.php'))); ?>"><?php _e('Go to Give Settings', 'give'); ?></a> |
|
341 | 341 | </div> |
342 | 342 | </div> |
343 | 343 | <?php |
@@ -351,35 +351,35 @@ discard block |
||
351 | 351 | * @return void |
352 | 352 | */ |
353 | 353 | public function getting_started_screen() { |
354 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
354 | + list($display_version) = explode('-', GIVE_VERSION); |
|
355 | 355 | ?> |
356 | 356 | <div class="wrap about-wrap get-started"> |
357 | - <h1 class="welcome-h1"><?php printf( __( 'Give %s - Getting Started Guide', 'give' ), $display_version ); ?></h1> |
|
357 | + <h1 class="welcome-h1"><?php printf(__('Give %s - Getting Started Guide', 'give'), $display_version); ?></h1> |
|
358 | 358 | |
359 | 359 | <?php give_social_media_elements() ?> |
360 | 360 | |
361 | - <div class="about-text"><?php _e( 'Welcome to the getting started guide.', 'give' ); ?></div> |
|
361 | + <div class="about-text"><?php _e('Welcome to the getting started guide.', 'give'); ?></div> |
|
362 | 362 | |
363 | - <p class="newsletter-intro"><?php _e( 'Don\'t forget to sign up for the newsletter!', 'give' ); ?>.</p> |
|
363 | + <p class="newsletter-intro"><?php _e('Don\'t forget to sign up for the newsletter!', 'give'); ?>.</p> |
|
364 | 364 | |
365 | 365 | <?php give_get_newsletter() ?> |
366 | 366 | |
367 | - <div class="give-badge"><?php printf( __( 'Version %s', 'give' ), $display_version ); ?></div> |
|
367 | + <div class="give-badge"><?php printf(__('Version %s', 'give'), $display_version); ?></div> |
|
368 | 368 | |
369 | 369 | <?php $this->tabs(); ?> |
370 | 370 | |
371 | 371 | |
372 | - <div class="about-text"><?php printf( __( '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 ); ?></div> |
|
372 | + <div class="about-text"><?php printf(__('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); ?></div> |
|
373 | 373 | |
374 | 374 | |
375 | 375 | <div class="feature-section clearfix"> |
376 | 376 | |
377 | 377 | <div class="content feature-section-item"> |
378 | - <h3><?php _e( 'STEP 1: Create a New Form', 'give' ); ?></h3> |
|
378 | + <h3><?php _e('STEP 1: Create a New Form', 'give'); ?></h3> |
|
379 | 379 | |
380 | - <p><?php _e( 'Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give' ); ?></p> |
|
380 | + <p><?php _e('Give is driven by it\'s powerful form building features. But it is not simply a "form". From the "Add New Form" page you\'ll be able to choose how and where you want to receive your donations. You\'ll be able to set the donation amounts. You even get to choose whether you want to create a whole page for your form, or embed it on a different page of your site.', 'give'); ?></p> |
|
381 | 381 | |
382 | - <p><?php _e( 'But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give' ); ?></p> |
|
382 | + <p><?php _e('But all of these features begin simply by going to the menu and choosing "Add New Form."', 'give'); ?></p> |
|
383 | 383 | </div> |
384 | 384 | |
385 | 385 | <div class="content feature-section-item last-feature"> |
@@ -396,9 +396,9 @@ discard block |
||
396 | 396 | </div> |
397 | 397 | |
398 | 398 | <div class="content feature-section-item last-feature"> |
399 | - <h3><?php _e( 'STEP 2: Choose Your Levels', 'give' ); ?></h3> |
|
399 | + <h3><?php _e('STEP 2: Choose Your Levels', 'give'); ?></h3> |
|
400 | 400 | |
401 | - <p><?php _e( 'Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give' ); ?></p> |
|
401 | + <p><?php _e('Each Form can be set to receive either a pre-determined amount or have multiple suggested levels of giving. Choosing "Multi-level Donation" opens up the levels section where you can add as many levels as you like with your own custom names and amounts.', 'give'); ?></p> |
|
402 | 402 | </div> |
403 | 403 | |
404 | 404 | </div> |
@@ -407,11 +407,11 @@ discard block |
||
407 | 407 | <div class="feature-section clearfix"> |
408 | 408 | |
409 | 409 | <div class="content feature-section-item add-content"> |
410 | - <h3><?php _e( 'STEP 3: Landing Page or Shortcode Mode?', 'give' ); ?></h3> |
|
410 | + <h3><?php _e('STEP 3: Landing Page or Shortcode Mode?', 'give'); ?></h3> |
|
411 | 411 | |
412 | - <p><?php _e( 'Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give' ); ?></p> |
|
412 | + <p><?php _e('Every form you create in Give can either become it\'s own stand-alone page, or it can be inserted into any other page or post throughout your site as a Shortcode.', 'give'); ?></p> |
|
413 | 413 | |
414 | - <p><?php _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> |
|
414 | + <p><?php _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> |
|
415 | 415 | </div> |
416 | 416 | |
417 | 417 | <div class="content feature-section-item last-feature"> |
@@ -428,9 +428,9 @@ discard block |
||
428 | 428 | </div> |
429 | 429 | |
430 | 430 | <div class="content feature-section-item last-feature"> |
431 | - <h3><?php _e( 'STEP 4: Configure Your Display Options', 'give' ); ?></h3> |
|
431 | + <h3><?php _e('STEP 4: Configure Your Display Options', 'give'); ?></h3> |
|
432 | 432 | |
433 | - <p><?php _e( 'Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give' ); ?></p> |
|
433 | + <p><?php _e('Lastly, you can present the form in a lot of different ways. With the "Display Options" section you can configure how the credit card field appears, the submit button text, which Gateway you want to use, whether Guests (non-logged in users) can donate or not, and a log-in form.', 'give'); ?></p> |
|
434 | 434 | </div> |
435 | 435 | |
436 | 436 | |
@@ -450,26 +450,26 @@ discard block |
||
450 | 450 | * @return void |
451 | 451 | */ |
452 | 452 | public function credits_screen() { |
453 | - list( $display_version ) = explode( '-', GIVE_VERSION ); |
|
453 | + list($display_version) = explode('-', GIVE_VERSION); |
|
454 | 454 | ?> |
455 | 455 | <div class="wrap about-wrap"> |
456 | - <h1 class="welcome-h1"><?php printf( __( 'Give %s - Credits', 'give' ), $display_version ); ?></h1> |
|
456 | + <h1 class="welcome-h1"><?php printf(__('Give %s - Credits', 'give'), $display_version); ?></h1> |
|
457 | 457 | |
458 | 458 | <?php give_social_media_elements() ?> |
459 | 459 | |
460 | - <div class="about-text"><?php printf( __( 'Thanks to all those who have contributed code directly or indirectly. ', 'give' ), $display_version ); ?></div> |
|
460 | + <div class="about-text"><?php printf(__('Thanks to all those who have contributed code directly or indirectly. ', 'give'), $display_version); ?></div> |
|
461 | 461 | |
462 | - <div class="about-text"><?php _e( 'Welcome to the getting started guide.', 'give' ); ?></div> |
|
462 | + <div class="about-text"><?php _e('Welcome to the getting started guide.', 'give'); ?></div> |
|
463 | 463 | |
464 | 464 | <p class="newsletter-intro">Be sure to sign up for the Give newsletter below to stay informed of important updates and news.</p> |
465 | 465 | |
466 | 466 | <?php give_get_newsletter() ?> |
467 | 467 | |
468 | - <div class="give-badge"><?php printf( __( 'Version %s', 'give' ), $display_version ); ?></div> |
|
468 | + <div class="give-badge"><?php printf(__('Version %s', 'give'), $display_version); ?></div> |
|
469 | 469 | |
470 | 470 | <?php $this->tabs(); ?> |
471 | 471 | |
472 | - <p class="about-description"><?php _e( 'Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="https://github.com/WordImpress/give" target="_blank">GitHub Repo</a>.', 'give' ); ?></p> |
|
472 | + <p class="about-description"><?php _e('Give is created by a dedicated team of developers. If you are interested in contributing please visit the <a href="https://github.com/WordImpress/give" target="_blank">GitHub Repo</a>.', 'give'); ?></p> |
|
473 | 473 | |
474 | 474 | <?php echo $this->contributors(); ?> |
475 | 475 | </div> |
@@ -484,21 +484,21 @@ discard block |
||
484 | 484 | * @return string $readme HTML formatted readme file |
485 | 485 | */ |
486 | 486 | public function parse_readme() { |
487 | - $file = file_exists( GIVE_PLUGIN_DIR . 'readme.txt' ) ? GIVE_PLUGIN_DIR . 'readme.txt' : null; |
|
487 | + $file = file_exists(GIVE_PLUGIN_DIR.'readme.txt') ? GIVE_PLUGIN_DIR.'readme.txt' : null; |
|
488 | 488 | |
489 | - if ( ! $file ) { |
|
490 | - $readme = '<p>' . __( 'No valid changlog was found.', 'give' ) . '</p>'; |
|
489 | + if ( ! $file) { |
|
490 | + $readme = '<p>'.__('No valid changlog was found.', 'give').'</p>'; |
|
491 | 491 | } else { |
492 | - $readme = file_get_contents( $file ); |
|
493 | - $readme = nl2br( esc_html( $readme ) ); |
|
494 | - $readme = explode( '== Changelog ==', $readme ); |
|
495 | - $readme = end( $readme ); |
|
496 | - |
|
497 | - $readme = preg_replace( '/`(.*?)`/', '<code>\\1</code>', $readme ); |
|
498 | - $readme = preg_replace( '/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme ); |
|
499 | - $readme = preg_replace( '/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme ); |
|
500 | - $readme = preg_replace( '/= (.*?) =/', '<h4>\\1</h4>', $readme ); |
|
501 | - $readme = preg_replace( '/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme ); |
|
492 | + $readme = file_get_contents($file); |
|
493 | + $readme = nl2br(esc_html($readme)); |
|
494 | + $readme = explode('== Changelog ==', $readme); |
|
495 | + $readme = end($readme); |
|
496 | + |
|
497 | + $readme = preg_replace('/`(.*?)`/', '<code>\\1</code>', $readme); |
|
498 | + $readme = preg_replace('/[\040]\*\*(.*?)\*\*/', ' <strong>\\1</strong>', $readme); |
|
499 | + $readme = preg_replace('/[\040]\*(.*?)\*/', ' <em>\\1</em>', $readme); |
|
500 | + $readme = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $readme); |
|
501 | + $readme = preg_replace('/\[(.*?)\]\((.*?)\)/', '<a href="\\2">\\1</a>', $readme); |
|
502 | 502 | } |
503 | 503 | |
504 | 504 | return $readme; |
@@ -515,21 +515,21 @@ discard block |
||
515 | 515 | public function contributors() { |
516 | 516 | $contributors = $this->get_contributors(); |
517 | 517 | |
518 | - if ( empty( $contributors ) ) { |
|
518 | + if (empty($contributors)) { |
|
519 | 519 | return ''; |
520 | 520 | } |
521 | 521 | |
522 | 522 | $contributor_list = '<ul class="wp-people-group">'; |
523 | 523 | |
524 | - foreach ( $contributors as $contributor ) { |
|
524 | + foreach ($contributors as $contributor) { |
|
525 | 525 | $contributor_list .= '<li class="wp-person">'; |
526 | - $contributor_list .= sprintf( '<a href="%s" title="%s">', |
|
527 | - esc_url( 'https://github.com/' . $contributor->login ), |
|
528 | - esc_html( sprintf( __( 'View %s', 'give' ), $contributor->login ) ) |
|
526 | + $contributor_list .= sprintf('<a href="%s" title="%s">', |
|
527 | + esc_url('https://github.com/'.$contributor->login), |
|
528 | + esc_html(sprintf(__('View %s', 'give'), $contributor->login)) |
|
529 | 529 | ); |
530 | - $contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) ); |
|
530 | + $contributor_list .= sprintf('<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url($contributor->avatar_url), esc_html($contributor->login)); |
|
531 | 531 | $contributor_list .= '</a>'; |
532 | - $contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) ); |
|
532 | + $contributor_list .= sprintf('<a class="web" href="%s">%s</a>', esc_url('https://github.com/'.$contributor->login), esc_html($contributor->login)); |
|
533 | 533 | $contributor_list .= '</a>'; |
534 | 534 | $contributor_list .= '</li>'; |
535 | 535 | } |
@@ -547,25 +547,25 @@ discard block |
||
547 | 547 | * @return array $contributors List of contributors |
548 | 548 | */ |
549 | 549 | public function get_contributors() { |
550 | - $contributors = get_transient( 'give_contributors' ); |
|
550 | + $contributors = get_transient('give_contributors'); |
|
551 | 551 | |
552 | - if ( false !== $contributors ) { |
|
552 | + if (false !== $contributors) { |
|
553 | 553 | return $contributors; |
554 | 554 | } |
555 | 555 | |
556 | - $response = wp_remote_get( 'https://api.github.com/repos/WordImpress/Give/contributors', array( 'sslverify' => false ) ); |
|
556 | + $response = wp_remote_get('https://api.github.com/repos/WordImpress/Give/contributors', array('sslverify' => false)); |
|
557 | 557 | |
558 | - if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) { |
|
558 | + if (is_wp_error($response) || 200 != wp_remote_retrieve_response_code($response)) { |
|
559 | 559 | return array(); |
560 | 560 | } |
561 | 561 | |
562 | - $contributors = json_decode( wp_remote_retrieve_body( $response ) ); |
|
562 | + $contributors = json_decode(wp_remote_retrieve_body($response)); |
|
563 | 563 | |
564 | - if ( ! is_array( $contributors ) ) { |
|
564 | + if ( ! is_array($contributors)) { |
|
565 | 565 | return array(); |
566 | 566 | } |
567 | 567 | |
568 | - set_transient( 'give_contributors', $contributors, 3600 ); |
|
568 | + set_transient('give_contributors', $contributors, 3600); |
|
569 | 569 | |
570 | 570 | return $contributors; |
571 | 571 | } |
@@ -584,24 +584,24 @@ discard block |
||
584 | 584 | |
585 | 585 | |
586 | 586 | // Bail if no activation redirect |
587 | - if ( ! get_transient( '_give_activation_redirect' ) ) { |
|
587 | + if ( ! get_transient('_give_activation_redirect')) { |
|
588 | 588 | return; |
589 | 589 | } |
590 | 590 | |
591 | 591 | // Delete the redirect transient |
592 | - delete_transient( '_give_activation_redirect' ); |
|
592 | + delete_transient('_give_activation_redirect'); |
|
593 | 593 | |
594 | 594 | // Bail if activating from network, or bulk |
595 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
595 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
596 | 596 | return; |
597 | 597 | } |
598 | 598 | |
599 | - $upgrade = get_option( 'give_version_upgraded_from' ); |
|
599 | + $upgrade = get_option('give_version_upgraded_from'); |
|
600 | 600 | |
601 | - if ( ! $upgrade ) { // First time install |
|
602 | - wp_safe_redirect( admin_url( 'index.php?page=give-about' ) ); |
|
601 | + if ( ! $upgrade) { // First time install |
|
602 | + wp_safe_redirect(admin_url('index.php?page=give-about')); |
|
603 | 603 | exit; |
604 | - } elseif( isset( $give_options['disable_welcome'] ) ) { // Welcome is disabled in settings |
|
604 | + } elseif (isset($give_options['disable_welcome'])) { // Welcome is disabled in settings |
|
605 | 605 | |
606 | 606 | } else { // Welcome is NOT disabled in settings |
607 | 607 | wp_safe_redirect(admin_url('index.php?page=give-about')); |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Scripts |
|
4 | - * |
|
5 | - * @package Give |
|
6 | - * @subpackage Functions |
|
7 | - * @copyright Copyright (c) 2015, WordImpress |
|
8 | - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
9 | - * @since 1.0 |
|
10 | - */ |
|
3 | + * Scripts |
|
4 | + * |
|
5 | + * @package Give |
|
6 | + * @subpackage Functions |
|
7 | + * @copyright Copyright (c) 2015, WordImpress |
|
8 | + * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
9 | + * @since 1.0 |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -28,93 +28,93 @@ discard block |
||
28 | 28 | |
29 | 29 | global $give_options; |
30 | 30 | |
31 | - $js_dir = GIVE_PLUGIN_URL . 'assets/js/frontend/'; |
|
32 | - $js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/'; |
|
33 | - $scripts_footer = ( give_get_option( 'scripts_footer' ) == 'on' ) ? true : false; |
|
31 | + $js_dir = GIVE_PLUGIN_URL.'assets/js/frontend/'; |
|
32 | + $js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/'; |
|
33 | + $scripts_footer = (give_get_option('scripts_footer') == 'on') ? true : false; |
|
34 | 34 | |
35 | 35 | // Use minified libraries if SCRIPT_DEBUG is turned off |
36 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
36 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
37 | 37 | |
38 | 38 | //Localize / PHP to AJAX vars |
39 | - $localize_give_checkout = apply_filters( 'give_global_script_vars', array( |
|
39 | + $localize_give_checkout = apply_filters('give_global_script_vars', array( |
|
40 | 40 | 'ajaxurl' => give_get_ajax_url(), |
41 | - 'checkout_nonce' => wp_create_nonce( 'give_checkout_nonce' ), |
|
42 | - 'currency_sign' => give_currency_filter( '' ), |
|
41 | + 'checkout_nonce' => wp_create_nonce('give_checkout_nonce'), |
|
42 | + 'currency_sign' => give_currency_filter(''), |
|
43 | 43 | 'currency_pos' => give_get_currency_position(), |
44 | - 'thousands_separator' => isset( $give_options['thousands_separator'] ) ? $give_options['thousands_separator'] : ',', |
|
45 | - 'decimal_separator' => isset( $give_options['decimal_separator'] ) ? $give_options['decimal_separator'] : '.', |
|
46 | - 'no_gateway' => __( 'Please select a payment method', 'give' ), |
|
47 | - 'bad_minimum' => __( 'The minimum donation amount for this form is', 'give' ), |
|
48 | - 'general_loading' => __( 'Loading...', 'give' ), |
|
49 | - 'purchase_loading' => __( 'Please Wait...', 'give' ), |
|
44 | + 'thousands_separator' => isset($give_options['thousands_separator']) ? $give_options['thousands_separator'] : ',', |
|
45 | + 'decimal_separator' => isset($give_options['decimal_separator']) ? $give_options['decimal_separator'] : '.', |
|
46 | + 'no_gateway' => __('Please select a payment method', 'give'), |
|
47 | + 'bad_minimum' => __('The minimum donation amount for this form is', 'give'), |
|
48 | + 'general_loading' => __('Loading...', 'give'), |
|
49 | + 'purchase_loading' => __('Please Wait...', 'give'), |
|
50 | 50 | 'give_version' => GIVE_VERSION |
51 | - ) ); |
|
52 | - $localize_give_ajax = apply_filters( 'give_global_ajax_vars', array( |
|
51 | + )); |
|
52 | + $localize_give_ajax = apply_filters('give_global_ajax_vars', array( |
|
53 | 53 | 'ajaxurl' => give_get_ajax_url(), |
54 | - 'loading' => __( 'Loading', 'give' ), |
|
54 | + 'loading' => __('Loading', 'give'), |
|
55 | 55 | // General loading message |
56 | - 'select_option' => __( 'Please select an option', 'give' ), |
|
56 | + 'select_option' => __('Please select an option', 'give'), |
|
57 | 57 | // Variable pricing error with multi-purchase option enabled |
58 | - 'default_gateway' => give_get_default_gateway( null ), |
|
59 | - 'permalinks' => get_option( 'permalink_structure' ) ? '1' : '0', |
|
60 | - 'number_decimals' => apply_filters( 'give_format_amount_decimals', 2 ) |
|
61 | - ) ); |
|
58 | + 'default_gateway' => give_get_default_gateway(null), |
|
59 | + 'permalinks' => get_option('permalink_structure') ? '1' : '0', |
|
60 | + 'number_decimals' => apply_filters('give_format_amount_decimals', 2) |
|
61 | + )); |
|
62 | 62 | |
63 | 63 | //DEBUG is On |
64 | - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { |
|
64 | + if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) { |
|
65 | 65 | |
66 | - if ( give_is_cc_verify_enabled() ) { |
|
67 | - wp_register_script( 'give-cc-validator', $js_plugins . 'jquery.payment' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
68 | - wp_enqueue_script( 'give-cc-validator' ); |
|
66 | + if (give_is_cc_verify_enabled()) { |
|
67 | + wp_register_script('give-cc-validator', $js_plugins.'jquery.payment'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
68 | + wp_enqueue_script('give-cc-validator'); |
|
69 | 69 | } |
70 | 70 | |
71 | - wp_register_script( 'give-float-labels', $js_plugins . 'float-labels' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
72 | - wp_enqueue_script( 'give-float-labels' ); |
|
71 | + wp_register_script('give-float-labels', $js_plugins.'float-labels'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
72 | + wp_enqueue_script('give-float-labels'); |
|
73 | 73 | |
74 | - wp_register_script( 'give-blockui', $js_plugins . 'jquery.blockUI' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
75 | - wp_enqueue_script( 'give-blockui' ); |
|
74 | + wp_register_script('give-blockui', $js_plugins.'jquery.blockUI'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
75 | + wp_enqueue_script('give-blockui'); |
|
76 | 76 | |
77 | - wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
78 | - wp_enqueue_script( 'give-qtip' ); |
|
77 | + wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
78 | + wp_enqueue_script('give-qtip'); |
|
79 | 79 | |
80 | - wp_register_script( 'give-accounting', $js_plugins . 'accounting' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
81 | - wp_enqueue_script( 'give-accounting' ); |
|
80 | + wp_register_script('give-accounting', $js_plugins.'accounting'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
81 | + wp_enqueue_script('give-accounting'); |
|
82 | 82 | |
83 | - wp_register_script( 'give-magnific', $js_plugins . 'jquery.magnific-popup' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
84 | - wp_enqueue_script( 'give-magnific' ); |
|
83 | + wp_register_script('give-magnific', $js_plugins.'jquery.magnific-popup'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
84 | + wp_enqueue_script('give-magnific'); |
|
85 | 85 | |
86 | - wp_register_script( 'give-checkout-global', $js_dir . 'give-checkout-global' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
87 | - wp_enqueue_script( 'give-checkout-global' ); |
|
86 | + wp_register_script('give-checkout-global', $js_dir.'give-checkout-global'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
87 | + wp_enqueue_script('give-checkout-global'); |
|
88 | 88 | |
89 | 89 | //General scripts |
90 | - wp_register_script( 'give-scripts', $js_dir . 'give' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
91 | - wp_enqueue_script( 'give-scripts' ); |
|
90 | + wp_register_script('give-scripts', $js_dir.'give'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
91 | + wp_enqueue_script('give-scripts'); |
|
92 | 92 | |
93 | 93 | // Load AJAX scripts, if enabled |
94 | - wp_register_script( 'give-ajax', $js_dir . 'give-ajax' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
95 | - wp_enqueue_script( 'give-ajax' ); |
|
94 | + wp_register_script('give-ajax', $js_dir.'give-ajax'.$suffix.'.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
95 | + wp_enqueue_script('give-ajax'); |
|
96 | 96 | |
97 | 97 | //Localize / Pass AJAX vars from PHP |
98 | - wp_localize_script( 'give-checkout-global', 'give_global_vars', $localize_give_checkout ); |
|
99 | - wp_localize_script( 'give-ajax', 'give_scripts', $localize_give_ajax ); |
|
98 | + wp_localize_script('give-checkout-global', 'give_global_vars', $localize_give_checkout); |
|
99 | + wp_localize_script('give-ajax', 'give_scripts', $localize_give_ajax); |
|
100 | 100 | |
101 | 101 | |
102 | 102 | } else { |
103 | 103 | |
104 | 104 | //DEBUG is OFF (one JS file to rule them all!) |
105 | - wp_register_script( 'give', $js_dir . 'give.all.min.js', array( 'jquery' ), GIVE_VERSION, $scripts_footer ); |
|
106 | - wp_enqueue_script( 'give' ); |
|
105 | + wp_register_script('give', $js_dir.'give.all.min.js', array('jquery'), GIVE_VERSION, $scripts_footer); |
|
106 | + wp_enqueue_script('give'); |
|
107 | 107 | |
108 | 108 | //Localize / Pass AJAX vars from PHP |
109 | - wp_localize_script( 'give', 'give_global_vars', $localize_give_checkout ); |
|
110 | - wp_localize_script( 'give', 'give_scripts', $localize_give_ajax ); |
|
109 | + wp_localize_script('give', 'give_global_vars', $localize_give_checkout); |
|
110 | + wp_localize_script('give', 'give_scripts', $localize_give_ajax); |
|
111 | 111 | |
112 | 112 | } |
113 | 113 | |
114 | 114 | |
115 | 115 | } |
116 | 116 | |
117 | -add_action( 'wp_enqueue_scripts', 'give_load_scripts' ); |
|
117 | +add_action('wp_enqueue_scripts', 'give_load_scripts'); |
|
118 | 118 | |
119 | 119 | /** |
120 | 120 | * Register Styles |
@@ -126,47 +126,47 @@ discard block |
||
126 | 126 | */ |
127 | 127 | function give_register_styles() { |
128 | 128 | |
129 | - if ( give_get_option( 'disable_css', false ) ) { |
|
129 | + if (give_get_option('disable_css', false)) { |
|
130 | 130 | return; |
131 | 131 | } |
132 | 132 | |
133 | 133 | // Use minified libraries if SCRIPT_DEBUG is turned off |
134 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
134 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
135 | 135 | |
136 | - $file = 'give' . $suffix . '.css'; |
|
136 | + $file = 'give'.$suffix.'.css'; |
|
137 | 137 | $templates_dir = give_get_theme_template_dir_name(); |
138 | 138 | |
139 | - $child_theme_style_sheet = trailingslashit( get_stylesheet_directory() ) . $templates_dir . $file; |
|
140 | - $child_theme_style_sheet_2 = trailingslashit( get_stylesheet_directory() ) . $templates_dir . 'give.css'; |
|
141 | - $parent_theme_style_sheet = trailingslashit( get_template_directory() ) . $templates_dir . $file; |
|
142 | - $parent_theme_style_sheet_2 = trailingslashit( get_template_directory() ) . $templates_dir . 'give.css'; |
|
143 | - $give_plugin_style_sheet = trailingslashit( give_get_templates_dir() ) . $file; |
|
139 | + $child_theme_style_sheet = trailingslashit(get_stylesheet_directory()).$templates_dir.$file; |
|
140 | + $child_theme_style_sheet_2 = trailingslashit(get_stylesheet_directory()).$templates_dir.'give.css'; |
|
141 | + $parent_theme_style_sheet = trailingslashit(get_template_directory()).$templates_dir.$file; |
|
142 | + $parent_theme_style_sheet_2 = trailingslashit(get_template_directory()).$templates_dir.'give.css'; |
|
143 | + $give_plugin_style_sheet = trailingslashit(give_get_templates_dir()).$file; |
|
144 | 144 | |
145 | 145 | // Look in the child theme directory first, followed by the parent theme, followed by the Give core templates directory |
146 | 146 | // Also look for the min version first, followed by non minified version, even if SCRIPT_DEBUG is not enabled. |
147 | 147 | // This allows users to copy just give.css to their theme |
148 | - if ( file_exists( $child_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $child_theme_style_sheet_2 ) ) ) ) { |
|
149 | - if ( ! empty( $nonmin ) ) { |
|
150 | - $url = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . 'give.css'; |
|
148 | + if (file_exists($child_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($child_theme_style_sheet_2)))) { |
|
149 | + if ( ! empty($nonmin)) { |
|
150 | + $url = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.'give.css'; |
|
151 | 151 | } else { |
152 | - $url = trailingslashit( get_stylesheet_directory_uri() ) . $templates_dir . $file; |
|
152 | + $url = trailingslashit(get_stylesheet_directory_uri()).$templates_dir.$file; |
|
153 | 153 | } |
154 | - } elseif ( file_exists( $parent_theme_style_sheet ) || ( ! empty( $suffix ) && ( $nonmin = file_exists( $parent_theme_style_sheet_2 ) ) ) ) { |
|
155 | - if ( ! empty( $nonmin ) ) { |
|
156 | - $url = trailingslashit( get_template_directory_uri() ) . $templates_dir . 'give.css'; |
|
154 | + } elseif (file_exists($parent_theme_style_sheet) || ( ! empty($suffix) && ($nonmin = file_exists($parent_theme_style_sheet_2)))) { |
|
155 | + if ( ! empty($nonmin)) { |
|
156 | + $url = trailingslashit(get_template_directory_uri()).$templates_dir.'give.css'; |
|
157 | 157 | } else { |
158 | - $url = trailingslashit( get_template_directory_uri() ) . $templates_dir . $file; |
|
158 | + $url = trailingslashit(get_template_directory_uri()).$templates_dir.$file; |
|
159 | 159 | } |
160 | - } elseif ( file_exists( $give_plugin_style_sheet ) || file_exists( $give_plugin_style_sheet ) ) { |
|
161 | - $url = trailingslashit( give_get_templates_url() ) . $file; |
|
160 | + } elseif (file_exists($give_plugin_style_sheet) || file_exists($give_plugin_style_sheet)) { |
|
161 | + $url = trailingslashit(give_get_templates_url()).$file; |
|
162 | 162 | } |
163 | 163 | |
164 | - wp_register_style( 'give-styles', $url, array(), GIVE_VERSION, 'all' ); |
|
165 | - wp_enqueue_style( 'give-styles' ); |
|
164 | + wp_register_style('give-styles', $url, array(), GIVE_VERSION, 'all'); |
|
165 | + wp_enqueue_style('give-styles'); |
|
166 | 166 | |
167 | 167 | } |
168 | 168 | |
169 | -add_action( 'wp_enqueue_scripts', 'give_register_styles' ); |
|
169 | +add_action('wp_enqueue_scripts', 'give_register_styles'); |
|
170 | 170 | |
171 | 171 | /** |
172 | 172 | * Load Admin Scripts |
@@ -180,93 +180,93 @@ discard block |
||
180 | 180 | * |
181 | 181 | * @return void |
182 | 182 | */ |
183 | -function give_load_admin_scripts( $hook ) { |
|
183 | +function give_load_admin_scripts($hook) { |
|
184 | 184 | |
185 | 185 | global $wp_version, $post, $post_type; |
186 | 186 | |
187 | 187 | //Directories of assets |
188 | - $js_dir = GIVE_PLUGIN_URL . 'assets/js/admin/'; |
|
189 | - $js_plugins = GIVE_PLUGIN_URL . 'assets/js/plugins/'; |
|
190 | - $css_dir = GIVE_PLUGIN_URL . 'assets/css/'; |
|
188 | + $js_dir = GIVE_PLUGIN_URL.'assets/js/admin/'; |
|
189 | + $js_plugins = GIVE_PLUGIN_URL.'assets/js/plugins/'; |
|
190 | + $css_dir = GIVE_PLUGIN_URL.'assets/css/'; |
|
191 | 191 | |
192 | 192 | // Use minified libraries if SCRIPT_DEBUG is turned off |
193 | - $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; |
|
193 | + $suffix = (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) ? '' : '.min'; |
|
194 | 194 | |
195 | 195 | //Global Admin: |
196 | - wp_register_style( 'give-admin-bar-notification', $css_dir . 'adminbar-style.css' ); |
|
197 | - wp_enqueue_style( 'give-admin-bar-notification' ); |
|
196 | + wp_register_style('give-admin-bar-notification', $css_dir.'adminbar-style.css'); |
|
197 | + wp_enqueue_style('give-admin-bar-notification'); |
|
198 | 198 | |
199 | 199 | //Give Admin Only: |
200 | - if ( ! apply_filters( 'give_load_admin_scripts', give_is_admin_page(), $hook ) ) { |
|
200 | + if ( ! apply_filters('give_load_admin_scripts', give_is_admin_page(), $hook)) { |
|
201 | 201 | return; |
202 | 202 | } |
203 | 203 | |
204 | 204 | //CSS |
205 | - wp_register_style( 'jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $suffix . '.css' ); |
|
206 | - wp_enqueue_style( 'jquery-ui-css' ); |
|
207 | - wp_register_style( 'give-admin', $css_dir . 'give-admin' . $suffix . '.css', GIVE_VERSION ); |
|
208 | - wp_enqueue_style( 'give-admin' ); |
|
209 | - wp_register_style( 'jquery-chosen', $css_dir . 'chosen' . $suffix . '.css', array(), GIVE_VERSION ); |
|
210 | - wp_enqueue_style( 'jquery-chosen' ); |
|
211 | - wp_enqueue_style( 'thickbox' ); |
|
205 | + wp_register_style('jquery-ui-css', $css_dir.'jquery-ui-fresh'.$suffix.'.css'); |
|
206 | + wp_enqueue_style('jquery-ui-css'); |
|
207 | + wp_register_style('give-admin', $css_dir.'give-admin'.$suffix.'.css', GIVE_VERSION); |
|
208 | + wp_enqueue_style('give-admin'); |
|
209 | + wp_register_style('jquery-chosen', $css_dir.'chosen'.$suffix.'.css', array(), GIVE_VERSION); |
|
210 | + wp_enqueue_style('jquery-chosen'); |
|
211 | + wp_enqueue_style('thickbox'); |
|
212 | 212 | |
213 | 213 | //JS |
214 | - wp_register_script( 'jquery-chosen', $js_plugins . 'chosen.jquery' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION ); |
|
215 | - wp_enqueue_script( 'jquery-chosen' ); |
|
214 | + wp_register_script('jquery-chosen', $js_plugins.'chosen.jquery'.$suffix.'.js', array('jquery'), GIVE_VERSION); |
|
215 | + wp_enqueue_script('jquery-chosen'); |
|
216 | 216 | |
217 | - wp_register_script( 'give-admin-scripts', $js_dir . 'admin-scripts' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
218 | - wp_enqueue_script( 'give-admin-scripts' ); |
|
217 | + wp_register_script('give-admin-scripts', $js_dir.'admin-scripts'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
218 | + wp_enqueue_script('give-admin-scripts'); |
|
219 | 219 | |
220 | - wp_register_script( 'jquery-flot', $js_plugins . 'jquery.flot' . $suffix . '.js' ); |
|
221 | - wp_enqueue_script( 'jquery-flot' ); |
|
220 | + wp_register_script('jquery-flot', $js_plugins.'jquery.flot'.$suffix.'.js'); |
|
221 | + wp_enqueue_script('jquery-flot'); |
|
222 | 222 | |
223 | - wp_register_script( 'give-qtip', $js_plugins . 'jquery.qtip' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
224 | - wp_enqueue_script( 'give-qtip' ); |
|
223 | + wp_register_script('give-qtip', $js_plugins.'jquery.qtip'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
224 | + wp_enqueue_script('give-qtip'); |
|
225 | 225 | |
226 | - wp_enqueue_script( 'jquery-ui-datepicker' ); |
|
227 | - wp_enqueue_script( 'thickbox' ); |
|
226 | + wp_enqueue_script('jquery-ui-datepicker'); |
|
227 | + wp_enqueue_script('thickbox'); |
|
228 | 228 | |
229 | 229 | //Forms CPT Script |
230 | - if ( $post_type === 'give_forms' ) { |
|
231 | - wp_register_script( 'give-admin-forms-scripts', $js_dir . 'admin-forms' . $suffix . '.js', array( 'jquery' ), GIVE_VERSION, false ); |
|
232 | - wp_enqueue_script( 'give-admin-forms-scripts' ); |
|
230 | + if ($post_type === 'give_forms') { |
|
231 | + wp_register_script('give-admin-forms-scripts', $js_dir.'admin-forms'.$suffix.'.js', array('jquery'), GIVE_VERSION, false); |
|
232 | + wp_enqueue_script('give-admin-forms-scripts'); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | //Localize strings & variables for JS |
236 | - wp_localize_script( 'give-admin-scripts', 'give_vars', array( |
|
237 | - 'post_id' => isset( $post->ID ) ? $post->ID : null, |
|
236 | + wp_localize_script('give-admin-scripts', 'give_vars', array( |
|
237 | + 'post_id' => isset($post->ID) ? $post->ID : null, |
|
238 | 238 | 'give_version' => GIVE_VERSION, |
239 | - 'quick_edit_warning' => __( 'Sorry, not available for variable priced forms.', 'give' ), |
|
240 | - 'delete_payment' => __( 'Are you sure you wish to delete this payment?', 'give' ), |
|
241 | - 'delete_payment_note' => __( 'Are you sure you wish to delete this note?', 'give' ), |
|
242 | - 'revoke_api_key' => __( 'Are you sure you wish to revoke this API key?', 'give' ), |
|
243 | - 'regenerate_api_key' => __( 'Are you sure you wish to regenerate this API key?', 'give' ), |
|
244 | - 'resend_receipt' => __( 'Are you sure you wish to resend the donation receipt?', 'give' ), |
|
245 | - 'copy_download_link_text' => __( 'Copy these links to your clipboard and give them to your donor', 'give' ), |
|
246 | - 'delete_payment_download' => sprintf( __( 'Are you sure you wish to delete this %s?', 'give' ), give_get_forms_label_singular() ), |
|
247 | - 'one_price_min' => __( 'You must have at least one price', 'give' ), |
|
248 | - 'one_file_min' => __( 'You must have at least one file', 'give' ), |
|
249 | - 'one_field_min' => __( 'You must have at least one field', 'give' ), |
|
250 | - 'one_option' => sprintf( __( 'Choose a %s', 'give' ), give_get_forms_label_singular() ), |
|
251 | - 'one_or_more_option' => sprintf( __( 'Choose one or more %s', 'give' ), give_get_forms_label_plural() ), |
|
252 | - 'numeric_item_price' => __( 'Item price must be numeric', 'give' ), |
|
253 | - 'numeric_quantity' => __( 'Quantity must be numeric', 'give' ), |
|
254 | - 'currency_sign' => give_currency_filter( '' ), |
|
255 | - 'currency_pos' => isset( $give_options['currency_position'] ) ? $give_options['currency_position'] : 'before', |
|
239 | + 'quick_edit_warning' => __('Sorry, not available for variable priced forms.', 'give'), |
|
240 | + 'delete_payment' => __('Are you sure you wish to delete this payment?', 'give'), |
|
241 | + 'delete_payment_note' => __('Are you sure you wish to delete this note?', 'give'), |
|
242 | + 'revoke_api_key' => __('Are you sure you wish to revoke this API key?', 'give'), |
|
243 | + 'regenerate_api_key' => __('Are you sure you wish to regenerate this API key?', 'give'), |
|
244 | + 'resend_receipt' => __('Are you sure you wish to resend the donation receipt?', 'give'), |
|
245 | + 'copy_download_link_text' => __('Copy these links to your clipboard and give them to your donor', 'give'), |
|
246 | + 'delete_payment_download' => sprintf(__('Are you sure you wish to delete this %s?', 'give'), give_get_forms_label_singular()), |
|
247 | + 'one_price_min' => __('You must have at least one price', 'give'), |
|
248 | + 'one_file_min' => __('You must have at least one file', 'give'), |
|
249 | + 'one_field_min' => __('You must have at least one field', 'give'), |
|
250 | + 'one_option' => sprintf(__('Choose a %s', 'give'), give_get_forms_label_singular()), |
|
251 | + 'one_or_more_option' => sprintf(__('Choose one or more %s', 'give'), give_get_forms_label_plural()), |
|
252 | + 'numeric_item_price' => __('Item price must be numeric', 'give'), |
|
253 | + 'numeric_quantity' => __('Quantity must be numeric', 'give'), |
|
254 | + 'currency_sign' => give_currency_filter(''), |
|
255 | + 'currency_pos' => isset($give_options['currency_position']) ? $give_options['currency_position'] : 'before', |
|
256 | 256 | 'currency_decimals' => give_currency_decimal_filter(), |
257 | - 'new_media_ui' => apply_filters( 'give_use_35_media_ui', 1 ), |
|
258 | - 'remove_text' => __( 'Remove', 'give' ), |
|
259 | - 'type_to_search' => sprintf( __( 'Type to search %s', 'give' ), give_get_forms_label_plural() ), |
|
260 | - ) ); |
|
257 | + 'new_media_ui' => apply_filters('give_use_35_media_ui', 1), |
|
258 | + 'remove_text' => __('Remove', 'give'), |
|
259 | + 'type_to_search' => sprintf(__('Type to search %s', 'give'), give_get_forms_label_plural()), |
|
260 | + )); |
|
261 | 261 | |
262 | - if ( function_exists( 'wp_enqueue_media' ) && version_compare( $wp_version, '3.5', '>=' ) ) { |
|
262 | + if (function_exists('wp_enqueue_media') && version_compare($wp_version, '3.5', '>=')) { |
|
263 | 263 | //call for new media manager |
264 | 264 | wp_enqueue_media(); |
265 | 265 | } |
266 | 266 | |
267 | 267 | } |
268 | 268 | |
269 | -add_action( 'admin_enqueue_scripts', 'give_load_admin_scripts', 100 ); |
|
269 | +add_action('admin_enqueue_scripts', 'give_load_admin_scripts', 100); |
|
270 | 270 | |
271 | 271 | /** |
272 | 272 | * Admin Give Icon |
@@ -283,14 +283,14 @@ discard block |
||
283 | 283 | ?> |
284 | 284 | <style type="text/css" media="screen"> |
285 | 285 | |
286 | - <?php if( version_compare( $wp_version, '3.8-RC', '>=' ) || version_compare( $wp_version, '3.8', '>=' ) ) { ?> |
|
286 | + <?php if (version_compare($wp_version, '3.8-RC', '>=') || version_compare($wp_version, '3.8', '>=')) { ?> |
|
287 | 287 | @font-face { |
288 | 288 | font-family: 'give-icomoon'; |
289 | - src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?-ngjl88'; ?>'); |
|
290 | - src: url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'), |
|
291 | - url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'), |
|
292 | - url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.ttf?-ngjl88'; ?>') format('truetype'), |
|
293 | - url('<?php echo GIVE_PLUGIN_URL . '/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg'); |
|
289 | + src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?-ngjl88'; ?>'); |
|
290 | + src: url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.eot?#iefix-ngjl88'?>') format('embedded-opentype'), |
|
291 | + url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.woff?-ngjl88'; ?>') format('woff'), |
|
292 | + url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.ttf?-ngjl88'; ?>') format('truetype'), |
|
293 | + url('<?php echo GIVE_PLUGIN_URL.'/assets/fonts/icomoon.svg?-ngjl88#icomoon'; ?>') format('svg'); |
|
294 | 294 | font-weight: normal; |
295 | 295 | font-style: normal; |
296 | 296 | } |
@@ -309,4 +309,4 @@ discard block |
||
309 | 309 | <?php |
310 | 310 | } |
311 | 311 | |
312 | -add_action( 'admin_head', 'give_admin_icon' ); |
|
312 | +add_action('admin_head', 'give_admin_icon'); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | * @see Give_Cron::weekly_events() |
30 | 30 | */ |
31 | 31 | public function __construct() { |
32 | - add_filter( 'cron_schedules', array( $this, 'add_schedules' ) ); |
|
33 | - add_action( 'wp', array( $this, 'schedule_Events' ) ); |
|
32 | + add_filter('cron_schedules', array($this, 'add_schedules')); |
|
33 | + add_action('wp', array($this, 'schedule_Events')); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @return array |
44 | 44 | */ |
45 | - public function add_schedules( $schedules = array() ) { |
|
45 | + public function add_schedules($schedules = array()) { |
|
46 | 46 | // Adds once weekly to the existing schedules. |
47 | 47 | $schedules['weekly'] = array( |
48 | 48 | 'interval' => 604800, |
49 | - 'display' => __( 'Once Weekly', 'easy-digital-downloads' ) |
|
49 | + 'display' => __('Once Weekly', 'easy-digital-downloads') |
|
50 | 50 | ); |
51 | 51 | |
52 | 52 | return $schedules; |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | * @return void |
73 | 73 | */ |
74 | 74 | private function weekly_events() { |
75 | - if ( ! wp_next_scheduled( 'give_weekly_scheduled_events' ) ) { |
|
76 | - wp_schedule_event( current_time( 'timestamp' ), 'weekly', 'give_weekly_scheduled_events' ); |
|
75 | + if ( ! wp_next_scheduled('give_weekly_scheduled_events')) { |
|
76 | + wp_schedule_event(current_time('timestamp'), 'weekly', 'give_weekly_scheduled_events'); |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | * @return void |
86 | 86 | */ |
87 | 87 | private function daily_events() { |
88 | - if ( ! wp_next_scheduled( 'give_daily_scheduled_events' ) ) { |
|
89 | - wp_schedule_event( current_time( 'timestamp' ), 'daily', 'give_daily_scheduled_events' ); |
|
88 | + if ( ! wp_next_scheduled('give_daily_scheduled_events')) { |
|
89 | + wp_schedule_event(current_time('timestamp'), 'daily', 'give_daily_scheduled_events'); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Install Function |
|
4 | - * |
|
5 | - * @package Give |
|
6 | - * @subpackage Functions/Install |
|
7 | - * @copyright Copyright (c) 2015, WordImpress |
|
8 | - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
9 | - * @since 1.0 |
|
10 | - */ |
|
3 | + * Install Function |
|
4 | + * |
|
5 | + * @package Give |
|
6 | + * @subpackage Functions/Install |
|
7 | + * @copyright Copyright (c) 2015, WordImpress |
|
8 | + * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
|
9 | + * @since 1.0 |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -32,25 +32,25 @@ discard block |
||
32 | 32 | give_setup_post_types(); |
33 | 33 | |
34 | 34 | // Clear the permalinks |
35 | - flush_rewrite_rules( false ); |
|
35 | + flush_rewrite_rules(false); |
|
36 | 36 | |
37 | 37 | // Add Upgraded From Option |
38 | - $current_version = get_option( 'give_version' ); |
|
39 | - if ( $current_version ) { |
|
40 | - update_option( 'give_version_upgraded_from', $current_version ); |
|
38 | + $current_version = get_option('give_version'); |
|
39 | + if ($current_version) { |
|
40 | + update_option('give_version_upgraded_from', $current_version); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | // Setup some default options |
44 | 44 | $options = array(); |
45 | 45 | |
46 | 46 | // Checks if the Success Page option exists AND that the page exists |
47 | - if ( ! get_post( give_get_option( 'success_page' ) ) ) { |
|
47 | + if ( ! get_post(give_get_option('success_page'))) { |
|
48 | 48 | |
49 | 49 | // Purchase Confirmation (Success) Page |
50 | 50 | $success = wp_insert_post( |
51 | 51 | array( |
52 | - 'post_title' => __( 'Donation Confirmation', 'give' ), |
|
53 | - 'post_content' => __( 'Thank you for your donation! [give_receipt]', 'give' ), |
|
52 | + 'post_title' => __('Donation Confirmation', 'give'), |
|
53 | + 'post_content' => __('Thank you for your donation! [give_receipt]', 'give'), |
|
54 | 54 | 'post_status' => 'publish', |
55 | 55 | 'post_author' => 1, |
56 | 56 | 'post_type' => 'page', |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | // Checks if the Failure Page option exists AND that the page exists |
66 | - if ( ! get_post( give_get_option( 'failure_page' ) ) ) { |
|
66 | + if ( ! get_post(give_get_option('failure_page'))) { |
|
67 | 67 | |
68 | 68 | // Failed Purchase Page |
69 | 69 | $failed = wp_insert_post( |
70 | 70 | array( |
71 | - 'post_title' => __( 'Transaction Failed', 'give' ), |
|
72 | - 'post_content' => __( 'Your transaction failed, please try again or contact site support.', 'give' ), |
|
71 | + 'post_title' => __('Transaction Failed', 'give'), |
|
72 | + 'post_content' => __('Your transaction failed, please try again or contact site support.', 'give'), |
|
73 | 73 | 'post_status' => 'publish', |
74 | 74 | 'post_author' => 1, |
75 | 75 | 'post_type' => 'page', |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | // Checks if the History Page option exists AND that the page exists |
84 | - if ( ! get_post( give_get_option( 'history_page' ) ) ) { |
|
84 | + if ( ! get_post(give_get_option('history_page'))) { |
|
85 | 85 | // Purchase History (History) Page |
86 | 86 | $history = wp_insert_post( |
87 | 87 | array( |
88 | - 'post_title' => __( 'Donation History', 'give' ), |
|
88 | + 'post_title' => __('Donation History', 'give'), |
|
89 | 89 | 'post_content' => '[donation_history]', |
90 | 90 | 'post_status' => 'publish', |
91 | 91 | 'post_author' => 1, |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | //Fresh Install? Setup Test Mode, Base Country (US), Test Gateway, Currency |
101 | - if ( empty( $current_version ) ) { |
|
101 | + if (empty($current_version)) { |
|
102 | 102 | $options['base_country'] = 'US'; |
103 | 103 | $options['test_mode'] = 1; |
104 | 104 | $options['currency'] = 'USD'; |
@@ -115,12 +115,12 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | // Populate some default values |
118 | - update_option( 'give_settings', array_merge( $give_options, $options ) ); |
|
119 | - update_option( 'give_version', GIVE_VERSION ); |
|
118 | + update_option('give_settings', array_merge($give_options, $options)); |
|
119 | + update_option('give_version', GIVE_VERSION); |
|
120 | 120 | |
121 | 121 | //Update Version Number |
122 | - if ( $current_version ) { |
|
123 | - update_option( 'give_version_upgraded_from', $current_version ); |
|
122 | + if ($current_version) { |
|
123 | + update_option('give_version_upgraded_from', $current_version); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | // Create Give roles |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $roles->add_caps(); |
130 | 130 | |
131 | 131 | $api = new Give_API(); |
132 | - update_option( 'give_default_api_version', 'v' . $api->get_version() ); |
|
132 | + update_option('give_default_api_version', 'v'.$api->get_version()); |
|
133 | 133 | |
134 | 134 | // Create the customers database |
135 | 135 | @Give()->customers->create_table(); |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | Give()->session->use_php_sessions(); |
139 | 139 | |
140 | 140 | // Add a temporary option to note that Give pages have been created |
141 | - set_transient( '_give_installed', $options, 30 ); |
|
141 | + set_transient('_give_installed', $options, 30); |
|
142 | 142 | |
143 | 143 | |
144 | - if ( ! $current_version ) { |
|
145 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; |
|
144 | + if ( ! $current_version) { |
|
145 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrade-functions.php'; |
|
146 | 146 | |
147 | 147 | // When new upgrade routines are added, mark them as complete on fresh install |
148 | 148 | $upgrade_routines = array( |
@@ -150,20 +150,20 @@ discard block |
||
150 | 150 | 'upgrade_give_offline_status' |
151 | 151 | ); |
152 | 152 | |
153 | - foreach ( $upgrade_routines as $upgrade ) { |
|
154 | - give_set_upgrade_complete( $upgrade ); |
|
153 | + foreach ($upgrade_routines as $upgrade) { |
|
154 | + give_set_upgrade_complete($upgrade); |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | // Bail if activating from network, or bulk |
158 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { |
|
158 | + if (is_network_admin() || isset($_GET['activate-multi'])) { |
|
159 | 159 | return; |
160 | 160 | } |
161 | 161 | // Add the transient to redirect |
162 | - set_transient( '_give_activation_redirect', true, 30 ); |
|
162 | + set_transient('_give_activation_redirect', true, 30); |
|
163 | 163 | |
164 | 164 | } |
165 | 165 | |
166 | -register_activation_hook( GIVE_PLUGIN_FILE, 'give_install' ); |
|
166 | +register_activation_hook(GIVE_PLUGIN_FILE, 'give_install'); |
|
167 | 167 | |
168 | 168 | /** |
169 | 169 | * Post-installation |
@@ -175,14 +175,14 @@ discard block |
||
175 | 175 | */ |
176 | 176 | function give_after_install() { |
177 | 177 | |
178 | - if ( ! is_admin() ) { |
|
178 | + if ( ! is_admin()) { |
|
179 | 179 | return; |
180 | 180 | } |
181 | 181 | |
182 | - $give_options = get_transient( '_give_installed' ); |
|
182 | + $give_options = get_transient('_give_installed'); |
|
183 | 183 | |
184 | 184 | // Exit if not in admin or the transient doesn't exist |
185 | - if ( false === $give_options ) { |
|
185 | + if (false === $give_options) { |
|
186 | 186 | return; |
187 | 187 | } |
188 | 188 | |
@@ -190,13 +190,13 @@ discard block |
||
190 | 190 | @Give()->customers->create_table(); |
191 | 191 | |
192 | 192 | // Delete the transient |
193 | - delete_transient( '_give_installed' ); |
|
193 | + delete_transient('_give_installed'); |
|
194 | 194 | |
195 | - do_action( 'give_after_install', $give_options ); |
|
195 | + do_action('give_after_install', $give_options); |
|
196 | 196 | |
197 | 197 | } |
198 | 198 | |
199 | -add_action( 'admin_init', 'give_after_install' ); |
|
199 | +add_action('admin_init', 'give_after_install'); |
|
200 | 200 | |
201 | 201 | |
202 | 202 | /** |
@@ -211,11 +211,11 @@ discard block |
||
211 | 211 | |
212 | 212 | global $wp_roles; |
213 | 213 | |
214 | - if ( ! is_object( $wp_roles ) ) { |
|
214 | + if ( ! is_object($wp_roles)) { |
|
215 | 215 | return; |
216 | 216 | } |
217 | 217 | |
218 | - if ( ! array_key_exists( 'give_manager', $wp_roles->roles ) ) { |
|
218 | + if ( ! array_key_exists('give_manager', $wp_roles->roles)) { |
|
219 | 219 | |
220 | 220 | // Create Give shop roles |
221 | 221 | $roles = new Give_Roles; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | |
227 | 227 | } |
228 | 228 | |
229 | -add_action( 'admin_init', 'give_install_roles_on_network' ); |
|
229 | +add_action('admin_init', 'give_install_roles_on_network'); |
|
230 | 230 | |
231 | 231 | /** |
232 | 232 | * Network Activated New Site Setup |
@@ -242,12 +242,12 @@ discard block |
||
242 | 242 | * @param $site_id |
243 | 243 | * @param $meta |
244 | 244 | */ |
245 | -function on_create_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { |
|
246 | - if ( is_plugin_active_for_network( GIVE_PLUGIN_BASENAME ) ) { |
|
247 | - switch_to_blog( $blog_id ); |
|
245 | +function on_create_blog($blog_id, $user_id, $domain, $path, $site_id, $meta) { |
|
246 | + if (is_plugin_active_for_network(GIVE_PLUGIN_BASENAME)) { |
|
247 | + switch_to_blog($blog_id); |
|
248 | 248 | give_install(); |
249 | 249 | restore_current_blog(); |
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
253 | -add_action( 'wpmu_new_blog', 'on_create_blog', 10, 6 ); |
|
254 | 253 | \ No newline at end of file |
254 | +add_action('wpmu_new_blog', 'on_create_blog', 10, 6); |
|
255 | 255 | \ No newline at end of file |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -28,66 +28,66 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return void |
30 | 30 | */ |
31 | -function give_complete_purchase( $payment_id, $new_status, $old_status ) { |
|
32 | - if ( $old_status == 'publish' || $old_status == 'complete' ) { |
|
31 | +function give_complete_purchase($payment_id, $new_status, $old_status) { |
|
32 | + if ($old_status == 'publish' || $old_status == 'complete') { |
|
33 | 33 | return; |
34 | 34 | } // Make sure that payments are only completed once |
35 | 35 | |
36 | 36 | // Make sure the payment completion is only processed when new status is complete |
37 | - if ( $new_status != 'publish' && $new_status != 'complete' ) { |
|
37 | + if ($new_status != 'publish' && $new_status != 'complete') { |
|
38 | 38 | return; |
39 | 39 | } |
40 | 40 | |
41 | - $payment_meta = give_get_payment_meta( $payment_id ); |
|
42 | - $creation_date = get_post_field( 'post_date', $payment_id, 'raw' ); |
|
43 | - $completed_date = give_get_payment_completed_date( $payment_id ); |
|
44 | - $user_info = give_get_payment_meta_user_info( $payment_id ); |
|
45 | - $donor_id = give_get_payment_customer_id( $payment_id ); |
|
46 | - $amount = give_get_payment_amount( $payment_id ); |
|
41 | + $payment_meta = give_get_payment_meta($payment_id); |
|
42 | + $creation_date = get_post_field('post_date', $payment_id, 'raw'); |
|
43 | + $completed_date = give_get_payment_completed_date($payment_id); |
|
44 | + $user_info = give_get_payment_meta_user_info($payment_id); |
|
45 | + $donor_id = give_get_payment_customer_id($payment_id); |
|
46 | + $amount = give_get_payment_amount($payment_id); |
|
47 | 47 | |
48 | - do_action( 'give_pre_complete_purchase', $payment_id ); |
|
48 | + do_action('give_pre_complete_purchase', $payment_id); |
|
49 | 49 | |
50 | - $price_id = isset( $_POST['give-price-id'] ) ? (int) $_POST['give-price-id'] : false; |
|
50 | + $price_id = isset($_POST['give-price-id']) ? (int) $_POST['give-price-id'] : false; |
|
51 | 51 | |
52 | 52 | // Ensure these actions only run once, ever |
53 | - if ( empty( $completed_date ) ) { |
|
53 | + if (empty($completed_date)) { |
|
54 | 54 | |
55 | - if ( ! give_is_test_mode() || apply_filters( 'give_log_test_payment_stats', false ) ) { |
|
55 | + if ( ! give_is_test_mode() || apply_filters('give_log_test_payment_stats', false)) { |
|
56 | 56 | |
57 | - give_record_sale_in_log( $payment_meta['form_id'], $payment_id, $price_id, $creation_date ); |
|
58 | - give_increase_purchase_count( $payment_meta['form_id'] ); |
|
59 | - give_increase_earnings( $payment_meta['form_id'], $amount ); |
|
57 | + give_record_sale_in_log($payment_meta['form_id'], $payment_id, $price_id, $creation_date); |
|
58 | + give_increase_purchase_count($payment_meta['form_id']); |
|
59 | + give_increase_earnings($payment_meta['form_id'], $amount); |
|
60 | 60 | |
61 | 61 | } |
62 | 62 | |
63 | - do_action( 'give_complete_form_donation', $payment_meta['form_id'], $payment_id, $payment_meta ); |
|
63 | + do_action('give_complete_form_donation', $payment_meta['form_id'], $payment_id, $payment_meta); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | |
67 | 67 | // Clear the total earnings cache |
68 | - delete_transient( 'give_earnings_total' ); |
|
68 | + delete_transient('give_earnings_total'); |
|
69 | 69 | // Clear the This Month earnings (this_monththis_month is NOT a typo) |
70 | - delete_transient( md5( 'give_earnings_this_monththis_month' ) ); |
|
71 | - delete_transient( md5( 'give_earnings_todaytoday' ) ); |
|
70 | + delete_transient(md5('give_earnings_this_monththis_month')); |
|
71 | + delete_transient(md5('give_earnings_todaytoday')); |
|
72 | 72 | |
73 | 73 | |
74 | 74 | // Increase the donor's purchase stats |
75 | - Give()->customers->increment_stats( $donor_id, $amount ); |
|
75 | + Give()->customers->increment_stats($donor_id, $amount); |
|
76 | 76 | |
77 | - give_increase_total_earnings( $amount ); |
|
77 | + give_increase_total_earnings($amount); |
|
78 | 78 | |
79 | 79 | // Ensure this action only runs once ever |
80 | - if ( empty( $completed_date ) ) { |
|
80 | + if (empty($completed_date)) { |
|
81 | 81 | |
82 | 82 | // Save the completed date |
83 | - give_update_payment_meta( $payment_id, '_give_completed_date', current_time( 'mysql' ) ); |
|
83 | + give_update_payment_meta($payment_id, '_give_completed_date', current_time('mysql')); |
|
84 | 84 | |
85 | - do_action( 'give_complete_purchase', $payment_id ); |
|
85 | + do_action('give_complete_purchase', $payment_id); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | } |
89 | 89 | |
90 | -add_action( 'give_update_payment_status', 'give_complete_purchase', 100, 3 ); |
|
90 | +add_action('give_update_payment_status', 'give_complete_purchase', 100, 3); |
|
91 | 91 | |
92 | 92 | |
93 | 93 | /** |
@@ -101,19 +101,19 @@ discard block |
||
101 | 101 | * |
102 | 102 | * @return void |
103 | 103 | */ |
104 | -function give_record_status_change( $payment_id, $new_status, $old_status ) { |
|
104 | +function give_record_status_change($payment_id, $new_status, $old_status) { |
|
105 | 105 | |
106 | 106 | // Get the list of statuses so that status in the payment note can be translated |
107 | 107 | $stati = give_get_payment_statuses(); |
108 | - $old_status = isset( $stati[ $old_status ] ) ? $stati[ $old_status ] : $old_status; |
|
109 | - $new_status = isset( $stati[ $new_status ] ) ? $stati[ $new_status ] : $new_status; |
|
108 | + $old_status = isset($stati[$old_status]) ? $stati[$old_status] : $old_status; |
|
109 | + $new_status = isset($stati[$new_status]) ? $stati[$new_status] : $new_status; |
|
110 | 110 | |
111 | - $status_change = sprintf( __( 'Status changed from %s to %s', 'give' ), $old_status, $new_status ); |
|
111 | + $status_change = sprintf(__('Status changed from %s to %s', 'give'), $old_status, $new_status); |
|
112 | 112 | |
113 | - give_insert_payment_note( $payment_id, $status_change ); |
|
113 | + give_insert_payment_note($payment_id, $status_change); |
|
114 | 114 | } |
115 | 115 | |
116 | -add_action( 'give_update_payment_status', 'give_record_status_change', 100, 3 ); |
|
116 | +add_action('give_update_payment_status', 'give_record_status_change', 100, 3); |
|
117 | 117 | |
118 | 118 | /** |
119 | 119 | * Reduces earnings and donation stats when a donation is refunded |
@@ -126,40 +126,40 @@ discard block |
||
126 | 126 | * |
127 | 127 | * @return void |
128 | 128 | */ |
129 | -function give_undo_donation_on_refund( $payment_id, $new_status, $old_status ) { |
|
129 | +function give_undo_donation_on_refund($payment_id, $new_status, $old_status) { |
|
130 | 130 | |
131 | - if ( 'publish' != $old_status && 'revoked' != $old_status ) { |
|
131 | + if ('publish' != $old_status && 'revoked' != $old_status) { |
|
132 | 132 | return; |
133 | 133 | } |
134 | 134 | |
135 | - if ( 'refunded' != $new_status ) { |
|
135 | + if ('refunded' != $new_status) { |
|
136 | 136 | return; |
137 | 137 | } |
138 | 138 | |
139 | 139 | // Set necessary vars |
140 | - $payment_meta = give_get_payment_meta( $payment_id ); |
|
141 | - $amount = give_get_payment_amount( $payment_id ); |
|
140 | + $payment_meta = give_get_payment_meta($payment_id); |
|
141 | + $amount = give_get_payment_amount($payment_id); |
|
142 | 142 | |
143 | 143 | // Undo this purchase |
144 | - give_undo_purchase( $payment_meta['form_id'], $payment_id ); |
|
144 | + give_undo_purchase($payment_meta['form_id'], $payment_id); |
|
145 | 145 | |
146 | 146 | // Decrease total earnings |
147 | - give_decrease_total_earnings( $amount ); |
|
147 | + give_decrease_total_earnings($amount); |
|
148 | 148 | |
149 | 149 | // Decrement the stats for the donor |
150 | - $donor_id = give_get_payment_customer_id( $payment_id ); |
|
150 | + $donor_id = give_get_payment_customer_id($payment_id); |
|
151 | 151 | |
152 | - if ( $donor_id ) { |
|
152 | + if ($donor_id) { |
|
153 | 153 | |
154 | - Give()->customers->decrement_stats( $donor_id, $amount ); |
|
154 | + Give()->customers->decrement_stats($donor_id, $amount); |
|
155 | 155 | |
156 | 156 | } |
157 | 157 | |
158 | 158 | // Clear the This Month earnings (this_monththis_month is NOT a typo) |
159 | - delete_transient( md5( 'give_earnings_this_monththis_month' ) ); |
|
159 | + delete_transient(md5('give_earnings_this_monththis_month')); |
|
160 | 160 | } |
161 | 161 | |
162 | -add_action( 'give_update_payment_status', 'give_undo_donation_on_refund', 100, 3 ); |
|
162 | +add_action('give_update_payment_status', 'give_undo_donation_on_refund', 100, 3); |
|
163 | 163 | |
164 | 164 | |
165 | 165 | /** |
@@ -172,13 +172,13 @@ discard block |
||
172 | 172 | * @param $new_status the status of the payment, probably "publish" |
173 | 173 | * @param $old_status the status of the payment prior to being marked as "complete", probably "pending" |
174 | 174 | */ |
175 | -function give_clear_user_history_cache( $payment_id, $new_status, $old_status ) { |
|
176 | - $user_info = give_get_payment_meta_user_info( $payment_id ); |
|
175 | +function give_clear_user_history_cache($payment_id, $new_status, $old_status) { |
|
176 | + $user_info = give_get_payment_meta_user_info($payment_id); |
|
177 | 177 | |
178 | - delete_transient( 'give_user_' . $user_info['id'] . '_purchases' ); |
|
178 | + delete_transient('give_user_'.$user_info['id'].'_purchases'); |
|
179 | 179 | } |
180 | 180 | |
181 | -add_action( 'give_update_payment_status', 'give_clear_user_history_cache', 10, 3 ); |
|
181 | +add_action('give_update_payment_status', 'give_clear_user_history_cache', 10, 3); |
|
182 | 182 | |
183 | 183 | /** |
184 | 184 | * Updates all old payments, prior to 1.2, with new |
@@ -192,32 +192,32 @@ discard block |
||
192 | 192 | * |
193 | 193 | * @return void |
194 | 194 | */ |
195 | -function give_update_old_payments_with_totals( $data ) { |
|
196 | - if ( ! wp_verify_nonce( $data['_wpnonce'], 'give_upgrade_payments_nonce' ) ) { |
|
195 | +function give_update_old_payments_with_totals($data) { |
|
196 | + if ( ! wp_verify_nonce($data['_wpnonce'], 'give_upgrade_payments_nonce')) { |
|
197 | 197 | return; |
198 | 198 | } |
199 | 199 | |
200 | - if ( get_option( 'give_payment_totals_upgraded' ) ) { |
|
200 | + if (get_option('give_payment_totals_upgraded')) { |
|
201 | 201 | return; |
202 | 202 | } |
203 | 203 | |
204 | - $payments = give_get_payments( array( |
|
204 | + $payments = give_get_payments(array( |
|
205 | 205 | 'offset' => 0, |
206 | - 'number' => - 1, |
|
206 | + 'number' => -1, |
|
207 | 207 | 'mode' => 'all' |
208 | - ) ); |
|
208 | + )); |
|
209 | 209 | |
210 | - if ( $payments ) { |
|
211 | - foreach ( $payments as $payment ) { |
|
212 | - $meta = give_get_payment_meta( $payment->ID ); |
|
213 | - give_update_payment_meta( $payment->ID, '_give_payment_total', $meta['amount'] ); |
|
210 | + if ($payments) { |
|
211 | + foreach ($payments as $payment) { |
|
212 | + $meta = give_get_payment_meta($payment->ID); |
|
213 | + give_update_payment_meta($payment->ID, '_give_payment_total', $meta['amount']); |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | |
217 | - add_option( 'give_payment_totals_upgraded', 1 ); |
|
217 | + add_option('give_payment_totals_upgraded', 1); |
|
218 | 218 | } |
219 | 219 | |
220 | -add_action( 'give_upgrade_payments', 'give_update_old_payments_with_totals' ); |
|
220 | +add_action('give_upgrade_payments', 'give_update_old_payments_with_totals'); |
|
221 | 221 | |
222 | 222 | /** |
223 | 223 | * Updates week-old+ 'pending' orders to 'abandoned' |
@@ -226,29 +226,29 @@ discard block |
||
226 | 226 | * @return void |
227 | 227 | */ |
228 | 228 | function give_mark_abandoned_donations() { |
229 | - $args = array( |
|
229 | + $args = array( |
|
230 | 230 | 'status' => 'pending', |
231 | - 'number' => - 1, |
|
231 | + 'number' => -1, |
|
232 | 232 | 'fields' => 'ids' |
233 | 233 | ); |
234 | 234 | |
235 | - add_filter( 'posts_where', 'give_filter_where_older_than_week' ); |
|
235 | + add_filter('posts_where', 'give_filter_where_older_than_week'); |
|
236 | 236 | |
237 | - $payments = give_get_payments( $args ); |
|
237 | + $payments = give_get_payments($args); |
|
238 | 238 | |
239 | - remove_filter( 'posts_where', 'give_filter_where_older_than_week' ); |
|
239 | + remove_filter('posts_where', 'give_filter_where_older_than_week'); |
|
240 | 240 | |
241 | - if ( $payments ) { |
|
242 | - foreach ( $payments as $payment ) { |
|
243 | - $gateway = give_get_payment_gateway( $payment ); |
|
241 | + if ($payments) { |
|
242 | + foreach ($payments as $payment) { |
|
243 | + $gateway = give_get_payment_gateway($payment); |
|
244 | 244 | //Skip offline gateway payments |
245 | - if ( $gateway == 'offline' ) { |
|
245 | + if ($gateway == 'offline') { |
|
246 | 246 | continue; |
247 | 247 | } |
248 | 248 | //Non-offline get marked as 'abandoned' |
249 | - give_update_payment_status( $payment, 'abandoned' ); |
|
249 | + give_update_payment_status($payment, 'abandoned'); |
|
250 | 250 | } |
251 | 251 | } |
252 | 252 | } |
253 | 253 | |
254 | -add_action( 'give_weekly_scheduled_events', 'give_mark_abandoned_donations' ); |
|
255 | 254 | \ No newline at end of file |
255 | +add_action('give_weekly_scheduled_events', 'give_mark_abandoned_donations'); |
|
256 | 256 | \ No newline at end of file |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | */ |
14 | 14 | |
15 | 15 | // Exit if accessed directly |
16 | -if ( ! defined( 'ABSPATH' ) ) { |
|
16 | +if ( ! defined('ABSPATH')) { |
|
17 | 17 | exit; |
18 | 18 | } |
19 | 19 | |
@@ -25,18 +25,18 @@ discard block |
||
25 | 25 | */ |
26 | 26 | function give_show_upgrade_notices() { |
27 | 27 | |
28 | - if ( isset( $_GET['page'] ) && $_GET['page'] == 'give-upgrades' ) { |
|
28 | + if (isset($_GET['page']) && $_GET['page'] == 'give-upgrades') { |
|
29 | 29 | return; |
30 | 30 | } // Don't show notices on the upgrades page |
31 | 31 | |
32 | - $give_version = get_option( 'give_version' ); |
|
32 | + $give_version = get_option('give_version'); |
|
33 | 33 | |
34 | - if ( ! $give_version ) { |
|
34 | + if ( ! $give_version) { |
|
35 | 35 | // 1.0 is the first version to use this option so we must add it |
36 | 36 | $give_version = '1.0'; |
37 | 37 | } |
38 | 38 | |
39 | - $give_version = preg_replace( '/[^0-9.].*/', '', $give_version ); |
|
39 | + $give_version = preg_replace('/[^0-9.].*/', '', $give_version); |
|
40 | 40 | |
41 | 41 | /* |
42 | 42 | * NOTICE: |
@@ -47,18 +47,18 @@ discard block |
||
47 | 47 | */ |
48 | 48 | |
49 | 49 | //v1.3.2 Upgrades |
50 | - if ( version_compare( $give_version, '1.3.2', '<' ) || ! give_has_upgrade_completed( 'upgrade_give_payment_customer_id' ) ) { |
|
50 | + if (version_compare($give_version, '1.3.2', '<') || ! give_has_upgrade_completed('upgrade_give_payment_customer_id')) { |
|
51 | 51 | printf( |
52 | - '<div class="updated"><p>' . __( 'Give needs to upgrade the donor database, click <a href="%s">here</a> to start the upgrade.', 'give' ) . '</p></div>', |
|
53 | - esc_url( admin_url( 'index.php?page=give-upgrades&give-upgrade=upgrade_give_payment_customer_id' ) ) |
|
52 | + '<div class="updated"><p>'.__('Give needs to upgrade the donor database, click <a href="%s">here</a> to start the upgrade.', 'give').'</p></div>', |
|
53 | + esc_url(admin_url('index.php?page=give-upgrades&give-upgrade=upgrade_give_payment_customer_id')) |
|
54 | 54 | ); |
55 | 55 | } |
56 | 56 | |
57 | 57 | //v1.3.4 Upgrades //ensure the user has gone through 1.3.4 |
58 | - if ( version_compare( $give_version, '1.3.4', '<' ) || ( ! give_has_upgrade_completed( 'upgrade_give_offline_status' ) && give_has_upgrade_completed( 'upgrade_give_payment_customer_id' ) ) ) { |
|
58 | + if (version_compare($give_version, '1.3.4', '<') || ( ! give_has_upgrade_completed('upgrade_give_offline_status') && give_has_upgrade_completed('upgrade_give_payment_customer_id'))) { |
|
59 | 59 | printf( |
60 | - '<div class="updated"><p>' . __( 'Give needs to upgrade the transaction database, click <a href="%s">here</a> to start the upgrade.', 'give' ) . '</p></div>', |
|
61 | - esc_url( admin_url( 'index.php?page=give-upgrades&give-upgrade=upgrade_give_offline_status' ) ) |
|
60 | + '<div class="updated"><p>'.__('Give needs to upgrade the transaction database, click <a href="%s">here</a> to start the upgrade.', 'give').'</p></div>', |
|
61 | + esc_url(admin_url('index.php?page=give-upgrades&give-upgrade=upgrade_give_offline_status')) |
|
62 | 62 | ); |
63 | 63 | } |
64 | 64 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | } |
70 | 70 | |
71 | -add_action( 'admin_notices', 'give_show_upgrade_notices' ); |
|
71 | +add_action('admin_notices', 'give_show_upgrade_notices'); |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * Triggers all upgrade functions |
@@ -80,26 +80,26 @@ discard block |
||
80 | 80 | */ |
81 | 81 | function give_trigger_upgrades() { |
82 | 82 | |
83 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
84 | - wp_die( __( 'You do not have permission to do Give upgrades', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
83 | + if ( ! current_user_can('manage_give_settings')) { |
|
84 | + wp_die(__('You do not have permission to do Give upgrades', 'give'), __('Error', 'give'), array('response' => 403)); |
|
85 | 85 | } |
86 | 86 | |
87 | - $give_version = get_option( 'give_version' ); |
|
87 | + $give_version = get_option('give_version'); |
|
88 | 88 | |
89 | - if ( ! $give_version ) { |
|
89 | + if ( ! $give_version) { |
|
90 | 90 | // 1.0 is the first version to use this option so we must add it |
91 | 91 | $give_version = '1.0'; |
92 | - add_option( 'give_version', $give_version ); |
|
92 | + add_option('give_version', $give_version); |
|
93 | 93 | } |
94 | 94 | |
95 | - update_option( 'give_version', GIVE_VERSION ); |
|
95 | + update_option('give_version', GIVE_VERSION); |
|
96 | 96 | |
97 | - if ( DOING_AJAX ) { |
|
98 | - die( 'complete' ); |
|
97 | + if (DOING_AJAX) { |
|
98 | + die('complete'); |
|
99 | 99 | } // Let AJAX know that the upgrade is complete |
100 | 100 | } |
101 | 101 | |
102 | -add_action( 'wp_ajax_give_trigger_upgrades', 'give_trigger_upgrades' ); |
|
102 | +add_action('wp_ajax_give_trigger_upgrades', 'give_trigger_upgrades'); |
|
103 | 103 | |
104 | 104 | /** |
105 | 105 | * Check if the upgrade routine has been run for a specific action |
@@ -110,15 +110,15 @@ discard block |
||
110 | 110 | * |
111 | 111 | * @return bool If the action has been added to the completed actions array |
112 | 112 | */ |
113 | -function give_has_upgrade_completed( $upgrade_action = '' ) { |
|
113 | +function give_has_upgrade_completed($upgrade_action = '') { |
|
114 | 114 | |
115 | - if ( empty( $upgrade_action ) ) { |
|
115 | + if (empty($upgrade_action)) { |
|
116 | 116 | return false; |
117 | 117 | } |
118 | 118 | |
119 | 119 | $completed_upgrades = give_get_completed_upgrades(); |
120 | 120 | |
121 | - return in_array( $upgrade_action, $completed_upgrades ); |
|
121 | + return in_array($upgrade_action, $completed_upgrades); |
|
122 | 122 | |
123 | 123 | } |
124 | 124 | |
@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | * |
132 | 132 | * @return bool If the function was successfully added |
133 | 133 | */ |
134 | -function give_set_upgrade_complete( $upgrade_action = '' ) { |
|
134 | +function give_set_upgrade_complete($upgrade_action = '') { |
|
135 | 135 | |
136 | - if ( empty( $upgrade_action ) ) { |
|
136 | + if (empty($upgrade_action)) { |
|
137 | 137 | return false; |
138 | 138 | } |
139 | 139 | |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | $completed_upgrades[] = $upgrade_action; |
142 | 142 | |
143 | 143 | // Remove any blanks, and only show uniques |
144 | - $completed_upgrades = array_unique( array_values( $completed_upgrades ) ); |
|
144 | + $completed_upgrades = array_unique(array_values($completed_upgrades)); |
|
145 | 145 | |
146 | - return update_option( 'give_completed_upgrades', $completed_upgrades ); |
|
146 | + return update_option('give_completed_upgrades', $completed_upgrades); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | */ |
155 | 155 | function give_get_completed_upgrades() { |
156 | 156 | |
157 | - $completed_upgrades = get_option( 'give_completed_upgrades' ); |
|
157 | + $completed_upgrades = get_option('give_completed_upgrades'); |
|
158 | 158 | |
159 | - if ( false === $completed_upgrades ) { |
|
159 | + if (false === $completed_upgrades) { |
|
160 | 160 | $completed_upgrades = array(); |
161 | 161 | } |
162 | 162 | |
@@ -175,30 +175,30 @@ discard block |
||
175 | 175 | */ |
176 | 176 | function give_v132_upgrade_give_payment_customer_id() { |
177 | 177 | global $wpdb; |
178 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
179 | - wp_die( __( 'You do not have permission to do Give upgrades', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
178 | + if ( ! current_user_can('manage_give_settings')) { |
|
179 | + wp_die(__('You do not have permission to do Give upgrades', 'give'), __('Error', 'give'), array('response' => 403)); |
|
180 | 180 | } |
181 | 181 | |
182 | - ignore_user_abort( true ); |
|
182 | + ignore_user_abort(true); |
|
183 | 183 | |
184 | - if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) { |
|
185 | - @set_time_limit( 0 ); |
|
184 | + if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) { |
|
185 | + @set_time_limit(0); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | //UPDATE DB METAKEYS |
189 | 189 | $sql = "UPDATE $wpdb->postmeta SET meta_key = '_give_payment_customer_id' WHERE meta_key = '_give_payment_donor_id'"; |
190 | - $query = $wpdb->query( $sql ); |
|
190 | + $query = $wpdb->query($sql); |
|
191 | 191 | |
192 | - update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) ); |
|
193 | - give_set_upgrade_complete( 'upgrade_give_payment_customer_id' ); |
|
194 | - delete_option( 'give_doing_upgrade' ); |
|
195 | - wp_redirect( admin_url() ); |
|
192 | + update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION)); |
|
193 | + give_set_upgrade_complete('upgrade_give_payment_customer_id'); |
|
194 | + delete_option('give_doing_upgrade'); |
|
195 | + wp_redirect(admin_url()); |
|
196 | 196 | exit; |
197 | 197 | |
198 | 198 | |
199 | 199 | } |
200 | 200 | |
201 | -add_action( 'give_upgrade_give_payment_customer_id', 'give_v132_upgrade_give_payment_customer_id' ); |
|
201 | +add_action('give_upgrade_give_payment_customer_id', 'give_v132_upgrade_give_payment_customer_id'); |
|
202 | 202 | |
203 | 203 | /** |
204 | 204 | * Upgrades the Offline Status |
@@ -212,14 +212,14 @@ discard block |
||
212 | 212 | |
213 | 213 | global $wpdb; |
214 | 214 | |
215 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
216 | - wp_die( __( 'You do not have permission to do Give upgrades', 'give' ), __( 'Error', 'give' ), array( 'response' => 403 ) ); |
|
215 | + if ( ! current_user_can('manage_give_settings')) { |
|
216 | + wp_die(__('You do not have permission to do Give upgrades', 'give'), __('Error', 'give'), array('response' => 403)); |
|
217 | 217 | } |
218 | 218 | |
219 | - ignore_user_abort( true ); |
|
219 | + ignore_user_abort(true); |
|
220 | 220 | |
221 | - if ( ! give_is_func_disabled( 'set_time_limit' ) && ! ini_get( 'safe_mode' ) ) { |
|
222 | - @set_time_limit( 0 ); |
|
221 | + if ( ! give_is_func_disabled('set_time_limit') && ! ini_get('safe_mode')) { |
|
222 | + @set_time_limit(0); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | // Get abandoned offline payments |
@@ -229,32 +229,32 @@ discard block |
||
229 | 229 | $where .= "AND ( p.post_status = 'abandoned' )"; |
230 | 230 | $where .= "AND ( m.meta_key = '_give_payment_gateway' AND m.meta_value = 'offline' )"; |
231 | 231 | |
232 | - $sql = $select . $join . $where; |
|
233 | - $found_payments = $wpdb->get_col( $sql ); |
|
232 | + $sql = $select.$join.$where; |
|
233 | + $found_payments = $wpdb->get_col($sql); |
|
234 | 234 | |
235 | 235 | |
236 | - foreach ( $found_payments as $payment ) { |
|
236 | + foreach ($found_payments as $payment) { |
|
237 | 237 | |
238 | 238 | //Only change ones marked abandoned since our release last week |
239 | 239 | //because the admin may have marked some abandoned themselves |
240 | - $modified_time = get_post_modified_time( 'U', false, $payment ); |
|
240 | + $modified_time = get_post_modified_time('U', false, $payment); |
|
241 | 241 | |
242 | 242 | //1450124863 = 12/10/2015 20:42:25 |
243 | - if ( $modified_time >= 1450124863 ) { |
|
243 | + if ($modified_time >= 1450124863) { |
|
244 | 244 | |
245 | - give_update_payment_status( $payment, 'pending' ); |
|
245 | + give_update_payment_status($payment, 'pending'); |
|
246 | 246 | |
247 | 247 | } |
248 | 248 | |
249 | 249 | } |
250 | 250 | |
251 | - update_option( 'give_version', preg_replace( '/[^0-9.].*/', '', GIVE_VERSION ) ); |
|
252 | - give_set_upgrade_complete( 'upgrade_give_offline_status' ); |
|
253 | - delete_option( 'give_doing_upgrade' ); |
|
254 | - wp_redirect( admin_url() ); |
|
251 | + update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION)); |
|
252 | + give_set_upgrade_complete('upgrade_give_offline_status'); |
|
253 | + delete_option('give_doing_upgrade'); |
|
254 | + wp_redirect(admin_url()); |
|
255 | 255 | exit; |
256 | 256 | |
257 | 257 | |
258 | 258 | } |
259 | 259 | |
260 | -add_action( 'give_upgrade_give_offline_status', 'give_v134_upgrade_give_offline_status' ); |
|
260 | +add_action('give_upgrade_give_offline_status', 'give_v134_upgrade_give_offline_status'); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) { |
|
14 | +if ( ! defined('ABSPATH')) { |
|
15 | 15 | exit; |
16 | 16 | } |
17 | 17 | |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | function give_system_info_callback() { |
26 | 26 | |
27 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
27 | + if ( ! current_user_can('manage_give_settings')) { |
|
28 | 28 | return; |
29 | 29 | } |
30 | 30 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | <textarea readonly="readonly" onclick="this.focus(); this.select()" id="system-info-textarea" name="give-sysinfo" title="To copy the system info, click below then press Ctrl + C (PC) or Cmd + C (Mac)."><?php echo give_tools_sysinfo_get(); ?></textarea> |
33 | 33 | <p class="submit"> |
34 | 34 | <input type="hidden" name="give-action" value="download_sysinfo" /> |
35 | - <?php submit_button( 'Download System Info File', 'secondary', 'give-download-sysinfo', false ); ?> |
|
35 | + <?php submit_button('Download System Info File', 'secondary', 'give-download-sysinfo', false); ?> |
|
36 | 36 | </p> |
37 | 37 | <style> |
38 | 38 | .give_forms_page_give-settings .give-submit-wrap { |
@@ -55,63 +55,63 @@ discard block |
||
55 | 55 | function give_tools_sysinfo_get() { |
56 | 56 | global $wpdb, $give_options; |
57 | 57 | |
58 | - if ( ! class_exists( 'Browser' ) ) { |
|
59 | - require_once GIVE_PLUGIN_DIR . 'includes/libraries/browser.php'; |
|
58 | + if ( ! class_exists('Browser')) { |
|
59 | + require_once GIVE_PLUGIN_DIR.'includes/libraries/browser.php'; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $browser = new Browser(); |
63 | 63 | |
64 | 64 | // Get theme info |
65 | - if ( get_bloginfo( 'version' ) < '3.4' ) { |
|
66 | - $theme_data = get_theme_data( get_stylesheet_directory() . '/style.css' ); |
|
67 | - $theme = $theme_data['Name'] . ' ' . $theme_data['Version']; |
|
65 | + if (get_bloginfo('version') < '3.4') { |
|
66 | + $theme_data = get_theme_data(get_stylesheet_directory().'/style.css'); |
|
67 | + $theme = $theme_data['Name'].' '.$theme_data['Version']; |
|
68 | 68 | } else { |
69 | 69 | $theme_data = wp_get_theme(); |
70 | - $theme = $theme_data->Name . ' ' . $theme_data->Version; |
|
70 | + $theme = $theme_data->Name.' '.$theme_data->Version; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | // Try to identify the hosting provider |
74 | 74 | $host = give_get_host(); |
75 | 75 | |
76 | - $return = '### Begin System Info ###' . "\n\n"; |
|
76 | + $return = '### Begin System Info ###'."\n\n"; |
|
77 | 77 | |
78 | 78 | // Start with the basics... |
79 | - $return .= '-- Site Info' . "\n\n"; |
|
80 | - $return .= 'Site URL: ' . site_url() . "\n"; |
|
81 | - $return .= 'Home URL: ' . home_url() . "\n"; |
|
82 | - $return .= 'Multisite: ' . ( is_multisite() ? 'Yes' : 'No' ) . "\n"; |
|
79 | + $return .= '-- Site Info'."\n\n"; |
|
80 | + $return .= 'Site URL: '.site_url()."\n"; |
|
81 | + $return .= 'Home URL: '.home_url()."\n"; |
|
82 | + $return .= 'Multisite: '.(is_multisite() ? 'Yes' : 'No')."\n"; |
|
83 | 83 | |
84 | - $return = apply_filters( 'give_sysinfo_after_site_info', $return ); |
|
84 | + $return = apply_filters('give_sysinfo_after_site_info', $return); |
|
85 | 85 | |
86 | 86 | // Can we determine the site's host? |
87 | - if ( $host ) { |
|
88 | - $return .= "\n" . '-- Hosting Provider' . "\n\n"; |
|
89 | - $return .= 'Host: ' . $host . "\n"; |
|
87 | + if ($host) { |
|
88 | + $return .= "\n".'-- Hosting Provider'."\n\n"; |
|
89 | + $return .= 'Host: '.$host."\n"; |
|
90 | 90 | |
91 | - $return = apply_filters( 'give_sysinfo_after_host_info', $return ); |
|
91 | + $return = apply_filters('give_sysinfo_after_host_info', $return); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | // The local users' browser information, handled by the Browser class |
95 | - $return .= "\n" . '-- User Browser' . "\n\n"; |
|
95 | + $return .= "\n".'-- User Browser'."\n\n"; |
|
96 | 96 | $return .= $browser; |
97 | 97 | |
98 | - $return = apply_filters( 'give_sysinfo_after_user_browser', $return ); |
|
98 | + $return = apply_filters('give_sysinfo_after_user_browser', $return); |
|
99 | 99 | |
100 | 100 | // WordPress configuration |
101 | - $return .= "\n" . '-- WordPress Configuration' . "\n\n"; |
|
102 | - $return .= 'Version: ' . get_bloginfo( 'version' ) . "\n"; |
|
103 | - $return .= 'Language: ' . ( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' ) . "\n"; |
|
104 | - $return .= 'Permalink Structure: ' . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . "\n"; |
|
105 | - $return .= 'Active Theme: ' . $theme . "\n"; |
|
106 | - $return .= 'Show On Front: ' . get_option( 'show_on_front' ) . "\n"; |
|
101 | + $return .= "\n".'-- WordPress Configuration'."\n\n"; |
|
102 | + $return .= 'Version: '.get_bloginfo('version')."\n"; |
|
103 | + $return .= 'Language: '.(defined('WPLANG') && WPLANG ? WPLANG : 'en_US')."\n"; |
|
104 | + $return .= 'Permalink Structure: '.(get_option('permalink_structure') ? get_option('permalink_structure') : 'Default')."\n"; |
|
105 | + $return .= 'Active Theme: '.$theme."\n"; |
|
106 | + $return .= 'Show On Front: '.get_option('show_on_front')."\n"; |
|
107 | 107 | |
108 | 108 | // Only show page specs if frontpage is set to 'page' |
109 | - if ( get_option( 'show_on_front' ) == 'page' ) { |
|
110 | - $front_page_id = get_option( 'page_on_front' ); |
|
111 | - $blog_page_id = get_option( 'page_for_posts' ); |
|
109 | + if (get_option('show_on_front') == 'page') { |
|
110 | + $front_page_id = get_option('page_on_front'); |
|
111 | + $blog_page_id = get_option('page_for_posts'); |
|
112 | 112 | |
113 | - $return .= 'Page On Front: ' . ( $front_page_id != 0 ? get_the_title( $front_page_id ) . ' (#' . $front_page_id . ')' : 'Unset' ) . "\n"; |
|
114 | - $return .= 'Page For Posts: ' . ( $blog_page_id != 0 ? get_the_title( $blog_page_id ) . ' (#' . $blog_page_id . ')' : 'Unset' ) . "\n"; |
|
113 | + $return .= 'Page On Front: '.($front_page_id != 0 ? get_the_title($front_page_id).' (#'.$front_page_id.')' : 'Unset')."\n"; |
|
114 | + $return .= 'Page For Posts: '.($blog_page_id != 0 ? get_the_title($blog_page_id).' (#'.$blog_page_id.')' : 'Unset')."\n"; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | // Make sure wp_remote_post() is working |
@@ -120,200 +120,200 @@ discard block |
||
120 | 120 | $params = array( |
121 | 121 | 'sslverify' => false, |
122 | 122 | 'timeout' => 60, |
123 | - 'user-agent' => 'Give/' . GIVE_VERSION, |
|
123 | + 'user-agent' => 'Give/'.GIVE_VERSION, |
|
124 | 124 | 'body' => $request |
125 | 125 | ); |
126 | 126 | |
127 | - $response = wp_remote_post( 'https://www.paypal.com/cgi-bin/webscr', $params ); |
|
127 | + $response = wp_remote_post('https://www.paypal.com/cgi-bin/webscr', $params); |
|
128 | 128 | |
129 | - if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) { |
|
129 | + if ( ! is_wp_error($response) && $response['response']['code'] >= 200 && $response['response']['code'] < 300) { |
|
130 | 130 | $WP_REMOTE_POST = 'wp_remote_post() works'; |
131 | 131 | } else { |
132 | 132 | $WP_REMOTE_POST = 'wp_remote_post() does not work'; |
133 | 133 | } |
134 | 134 | |
135 | - $return .= 'Remote Post: ' . $WP_REMOTE_POST . "\n"; |
|
136 | - $return .= 'Table Prefix: ' . 'Length: ' . strlen( $wpdb->prefix ) . ' Status: ' . ( strlen( $wpdb->prefix ) > 16 ? 'ERROR: Too long' : 'Acceptable' ) . "\n"; |
|
137 | - $return .= 'Admin AJAX: ' . ( give_test_ajax_works() ? 'Accessible' : 'Inaccessible' ) . "\n"; |
|
138 | - $return .= 'WP_DEBUG: ' . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . "\n"; |
|
139 | - $return .= 'Memory Limit: ' . WP_MEMORY_LIMIT . "\n"; |
|
140 | - $return .= 'Registered Post Stati: ' . implode( ', ', get_post_stati() ) . "\n"; |
|
135 | + $return .= 'Remote Post: '.$WP_REMOTE_POST."\n"; |
|
136 | + $return .= 'Table Prefix: '.'Length: '.strlen($wpdb->prefix).' Status: '.(strlen($wpdb->prefix) > 16 ? 'ERROR: Too long' : 'Acceptable')."\n"; |
|
137 | + $return .= 'Admin AJAX: '.(give_test_ajax_works() ? 'Accessible' : 'Inaccessible')."\n"; |
|
138 | + $return .= 'WP_DEBUG: '.(defined('WP_DEBUG') ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set')."\n"; |
|
139 | + $return .= 'Memory Limit: '.WP_MEMORY_LIMIT."\n"; |
|
140 | + $return .= 'Registered Post Stati: '.implode(', ', get_post_stati())."\n"; |
|
141 | 141 | |
142 | - $return = apply_filters( 'give_sysinfo_after_wordpress_config', $return ); |
|
142 | + $return = apply_filters('give_sysinfo_after_wordpress_config', $return); |
|
143 | 143 | |
144 | 144 | // GIVE configuration |
145 | - $return .= "\n" . '-- Give Configuration' . "\n\n"; |
|
146 | - $return .= 'Version: ' . GIVE_VERSION . "\n"; |
|
147 | - $return .= 'Upgraded From: ' . get_option( 'give_version_upgraded_from', 'None' ) . "\n"; |
|
148 | - $return .= 'Test Mode: ' . ( give_is_test_mode() ? "Enabled\n" : "Disabled\n" ); |
|
149 | - $return .= 'Currency Code: ' . give_get_currency() . "\n"; |
|
150 | - $return .= 'Currency Position: ' . give_get_option( 'currency_position', 'before' ) . "\n"; |
|
151 | - $return .= 'Decimal Separator: ' . give_get_option( 'decimal_separator', '.' ) . "\n"; |
|
152 | - $return .= 'Thousands Separator: ' . give_get_option( 'thousands_separator', ',' ) . "\n"; |
|
145 | + $return .= "\n".'-- Give Configuration'."\n\n"; |
|
146 | + $return .= 'Version: '.GIVE_VERSION."\n"; |
|
147 | + $return .= 'Upgraded From: '.get_option('give_version_upgraded_from', 'None')."\n"; |
|
148 | + $return .= 'Test Mode: '.(give_is_test_mode() ? "Enabled\n" : "Disabled\n"); |
|
149 | + $return .= 'Currency Code: '.give_get_currency()."\n"; |
|
150 | + $return .= 'Currency Position: '.give_get_option('currency_position', 'before')."\n"; |
|
151 | + $return .= 'Decimal Separator: '.give_get_option('decimal_separator', '.')."\n"; |
|
152 | + $return .= 'Thousands Separator: '.give_get_option('thousands_separator', ',')."\n"; |
|
153 | 153 | |
154 | - $return = apply_filters( 'give_sysinfo_after_give_config', $return ); |
|
154 | + $return = apply_filters('give_sysinfo_after_give_config', $return); |
|
155 | 155 | |
156 | 156 | // GIVE pages |
157 | - $return .= "\n" . '-- Give Page Configuration' . "\n\n"; |
|
158 | - $return .= 'Success Page: ' . ( ! empty( $give_options['success_page'] ) ? get_permalink( $give_options['success_page'] ) . "\n" : "Unset\n" ); |
|
159 | - $return .= 'Failure Page: ' . ( ! empty( $give_options['failure_page'] ) ? get_permalink( $give_options['failure_page'] ) . "\n" : "Unset\n" ); |
|
160 | - $return .= 'Give Forms Slug: ' . ( defined( 'GIVE_SLUG' ) ? '/' . GIVE_SLUG . "\n" : "/donations\n" ); |
|
157 | + $return .= "\n".'-- Give Page Configuration'."\n\n"; |
|
158 | + $return .= 'Success Page: '.( ! empty($give_options['success_page']) ? get_permalink($give_options['success_page'])."\n" : "Unset\n"); |
|
159 | + $return .= 'Failure Page: '.( ! empty($give_options['failure_page']) ? get_permalink($give_options['failure_page'])."\n" : "Unset\n"); |
|
160 | + $return .= 'Give Forms Slug: '.(defined('GIVE_SLUG') ? '/'.GIVE_SLUG."\n" : "/donations\n"); |
|
161 | 161 | |
162 | - $return = apply_filters( 'give_sysinfo_after_give_pages', $return ); |
|
162 | + $return = apply_filters('give_sysinfo_after_give_pages', $return); |
|
163 | 163 | |
164 | 164 | // GIVE gateways |
165 | - $return .= "\n" . '-- Give Gateway Configuration' . "\n\n"; |
|
165 | + $return .= "\n".'-- Give Gateway Configuration'."\n\n"; |
|
166 | 166 | |
167 | 167 | $active_gateways = give_get_enabled_payment_gateways(); |
168 | - if ( $active_gateways ) { |
|
169 | - $default_gateway_is_active = give_is_gateway_active( give_get_default_gateway( null ) ); |
|
170 | - if ( $default_gateway_is_active ) { |
|
171 | - $default_gateway = give_get_default_gateway( null ); |
|
172 | - $default_gateway = $active_gateways[ $default_gateway ]['admin_label']; |
|
168 | + if ($active_gateways) { |
|
169 | + $default_gateway_is_active = give_is_gateway_active(give_get_default_gateway(null)); |
|
170 | + if ($default_gateway_is_active) { |
|
171 | + $default_gateway = give_get_default_gateway(null); |
|
172 | + $default_gateway = $active_gateways[$default_gateway]['admin_label']; |
|
173 | 173 | } else { |
174 | 174 | $default_gateway = 'Test Payment'; |
175 | 175 | } |
176 | 176 | |
177 | 177 | $gateways = array(); |
178 | - foreach ( $active_gateways as $gateway ) { |
|
178 | + foreach ($active_gateways as $gateway) { |
|
179 | 179 | $gateways[] = $gateway['admin_label']; |
180 | 180 | } |
181 | 181 | |
182 | - $return .= 'Enabled Gateways: ' . implode( ', ', $gateways ) . "\n"; |
|
183 | - $return .= 'Default Gateway: ' . $default_gateway . "\n"; |
|
182 | + $return .= 'Enabled Gateways: '.implode(', ', $gateways)."\n"; |
|
183 | + $return .= 'Default Gateway: '.$default_gateway."\n"; |
|
184 | 184 | } else { |
185 | - $return .= 'Enabled Gateways: None' . "\n"; |
|
185 | + $return .= 'Enabled Gateways: None'."\n"; |
|
186 | 186 | } |
187 | 187 | |
188 | - $return = apply_filters( 'give_sysinfo_after_give_gateways', $return ); |
|
188 | + $return = apply_filters('give_sysinfo_after_give_gateways', $return); |
|
189 | 189 | |
190 | 190 | // GIVE Templates |
191 | - $dir = get_stylesheet_directory() . '/give_templates/*'; |
|
192 | - if ( is_dir( $dir ) && ( count( glob( "$dir/*" ) ) !== 0 ) ) { |
|
193 | - $return .= "\n" . '-- Give Template Overrides' . "\n\n"; |
|
191 | + $dir = get_stylesheet_directory().'/give_templates/*'; |
|
192 | + if (is_dir($dir) && (count(glob("$dir/*")) !== 0)) { |
|
193 | + $return .= "\n".'-- Give Template Overrides'."\n\n"; |
|
194 | 194 | |
195 | - foreach ( glob( $dir ) as $file ) { |
|
196 | - $return .= 'Filename: ' . basename( $file ) . "\n"; |
|
195 | + foreach (glob($dir) as $file) { |
|
196 | + $return .= 'Filename: '.basename($file)."\n"; |
|
197 | 197 | } |
198 | 198 | |
199 | - $return = apply_filters( 'give_sysinfo_after_give_templates', $return ); |
|
199 | + $return = apply_filters('give_sysinfo_after_give_templates', $return); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | // Must-use plugins |
203 | 203 | $muplugins = get_mu_plugins(); |
204 | - if ( count( $muplugins > 0 ) ) { |
|
205 | - $return .= "\n" . '-- Must-Use Plugins' . "\n\n"; |
|
204 | + if (count($muplugins > 0)) { |
|
205 | + $return .= "\n".'-- Must-Use Plugins'."\n\n"; |
|
206 | 206 | |
207 | - foreach ( $muplugins as $plugin => $plugin_data ) { |
|
208 | - $return .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "\n"; |
|
207 | + foreach ($muplugins as $plugin => $plugin_data) { |
|
208 | + $return .= $plugin_data['Name'].': '.$plugin_data['Version']."\n"; |
|
209 | 209 | } |
210 | 210 | |
211 | - $return = apply_filters( 'give_sysinfo_after_wordpress_mu_plugins', $return ); |
|
211 | + $return = apply_filters('give_sysinfo_after_wordpress_mu_plugins', $return); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | // WordPress active plugins |
215 | - $return .= "\n" . '-- WordPress Active Plugins' . "\n\n"; |
|
215 | + $return .= "\n".'-- WordPress Active Plugins'."\n\n"; |
|
216 | 216 | |
217 | 217 | $plugins = get_plugins(); |
218 | - $active_plugins = get_option( 'active_plugins', array() ); |
|
218 | + $active_plugins = get_option('active_plugins', array()); |
|
219 | 219 | |
220 | - foreach ( $plugins as $plugin_path => $plugin ) { |
|
221 | - if ( ! in_array( $plugin_path, $active_plugins ) ) { |
|
220 | + foreach ($plugins as $plugin_path => $plugin) { |
|
221 | + if ( ! in_array($plugin_path, $active_plugins)) { |
|
222 | 222 | continue; |
223 | 223 | } |
224 | 224 | |
225 | - $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n"; |
|
225 | + $return .= $plugin['Name'].': '.$plugin['Version']."\n"; |
|
226 | 226 | } |
227 | 227 | |
228 | - $return = apply_filters( 'give_sysinfo_after_wordpress_plugins', $return ); |
|
228 | + $return = apply_filters('give_sysinfo_after_wordpress_plugins', $return); |
|
229 | 229 | |
230 | 230 | // WordPress inactive plugins |
231 | - $return .= "\n" . '-- WordPress Inactive Plugins' . "\n\n"; |
|
231 | + $return .= "\n".'-- WordPress Inactive Plugins'."\n\n"; |
|
232 | 232 | |
233 | - foreach ( $plugins as $plugin_path => $plugin ) { |
|
234 | - if ( in_array( $plugin_path, $active_plugins ) ) { |
|
233 | + foreach ($plugins as $plugin_path => $plugin) { |
|
234 | + if (in_array($plugin_path, $active_plugins)) { |
|
235 | 235 | continue; |
236 | 236 | } |
237 | 237 | |
238 | - $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n"; |
|
238 | + $return .= $plugin['Name'].': '.$plugin['Version']."\n"; |
|
239 | 239 | } |
240 | 240 | |
241 | - $return = apply_filters( 'give_sysinfo_after_wordpress_plugins_inactive', $return ); |
|
241 | + $return = apply_filters('give_sysinfo_after_wordpress_plugins_inactive', $return); |
|
242 | 242 | |
243 | - if ( is_multisite() ) { |
|
243 | + if (is_multisite()) { |
|
244 | 244 | // WordPress Multisite active plugins |
245 | - $return .= "\n" . '-- Network Active Plugins' . "\n\n"; |
|
245 | + $return .= "\n".'-- Network Active Plugins'."\n\n"; |
|
246 | 246 | |
247 | 247 | $plugins = wp_get_active_network_plugins(); |
248 | - $active_plugins = get_site_option( 'active_sitewide_plugins', array() ); |
|
248 | + $active_plugins = get_site_option('active_sitewide_plugins', array()); |
|
249 | 249 | |
250 | - foreach ( $plugins as $plugin_path ) { |
|
251 | - $plugin_base = plugin_basename( $plugin_path ); |
|
250 | + foreach ($plugins as $plugin_path) { |
|
251 | + $plugin_base = plugin_basename($plugin_path); |
|
252 | 252 | |
253 | - if ( ! array_key_exists( $plugin_base, $active_plugins ) ) { |
|
253 | + if ( ! array_key_exists($plugin_base, $active_plugins)) { |
|
254 | 254 | continue; |
255 | 255 | } |
256 | 256 | |
257 | - $plugin = get_plugin_data( $plugin_path ); |
|
258 | - $return .= $plugin['Name'] . ': ' . $plugin['Version'] . "\n"; |
|
257 | + $plugin = get_plugin_data($plugin_path); |
|
258 | + $return .= $plugin['Name'].': '.$plugin['Version']."\n"; |
|
259 | 259 | } |
260 | 260 | |
261 | - $return = apply_filters( 'give_sysinfo_after_wordpress_ms_plugins', $return ); |
|
261 | + $return = apply_filters('give_sysinfo_after_wordpress_ms_plugins', $return); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | // Server configuration (really just versioning) |
265 | - $return .= "\n" . '-- Webserver Configuration' . "\n\n"; |
|
266 | - $return .= 'PHP Version: ' . PHP_VERSION . "\n"; |
|
267 | - $return .= 'MySQL Version: ' . $wpdb->db_version() . "\n"; |
|
268 | - $return .= 'Webserver Info: ' . $_SERVER['SERVER_SOFTWARE'] . "\n"; |
|
265 | + $return .= "\n".'-- Webserver Configuration'."\n\n"; |
|
266 | + $return .= 'PHP Version: '.PHP_VERSION."\n"; |
|
267 | + $return .= 'MySQL Version: '.$wpdb->db_version()."\n"; |
|
268 | + $return .= 'Webserver Info: '.$_SERVER['SERVER_SOFTWARE']."\n"; |
|
269 | 269 | |
270 | - $return = apply_filters( 'give_sysinfo_after_webserver_config', $return ); |
|
270 | + $return = apply_filters('give_sysinfo_after_webserver_config', $return); |
|
271 | 271 | |
272 | 272 | // PHP configs... now we're getting to the important stuff |
273 | - $return .= "\n" . '-- PHP Configuration' . "\n\n"; |
|
274 | - $return .= 'Safe Mode: ' . ( ini_get( 'safe_mode' ) ? 'Enabled' : 'Disabled' . "\n" ); |
|
275 | - $return .= 'Memory Limit: ' . ini_get( 'memory_limit' ) . "\n"; |
|
276 | - $return .= 'Upload Max Size: ' . ini_get( 'upload_max_filesize' ) . "\n"; |
|
277 | - $return .= 'Post Max Size: ' . ini_get( 'post_max_size' ) . "\n"; |
|
278 | - $return .= 'Upload Max Filesize: ' . ini_get( 'upload_max_filesize' ) . "\n"; |
|
279 | - $return .= 'Time Limit: ' . ini_get( 'max_execution_time' ) . "\n"; |
|
280 | - $return .= 'Max Input Vars: ' . ini_get( 'max_input_vars' ) . "\n"; |
|
281 | - $return .= 'Display Errors: ' . ( ini_get( 'display_errors' ) ? 'On (' . ini_get( 'display_errors' ) . ')' : 'N/A' ) . "\n"; |
|
282 | - |
|
283 | - $return = apply_filters( 'give_sysinfo_after_php_config', $return ); |
|
273 | + $return .= "\n".'-- PHP Configuration'."\n\n"; |
|
274 | + $return .= 'Safe Mode: '.(ini_get('safe_mode') ? 'Enabled' : 'Disabled'."\n"); |
|
275 | + $return .= 'Memory Limit: '.ini_get('memory_limit')."\n"; |
|
276 | + $return .= 'Upload Max Size: '.ini_get('upload_max_filesize')."\n"; |
|
277 | + $return .= 'Post Max Size: '.ini_get('post_max_size')."\n"; |
|
278 | + $return .= 'Upload Max Filesize: '.ini_get('upload_max_filesize')."\n"; |
|
279 | + $return .= 'Time Limit: '.ini_get('max_execution_time')."\n"; |
|
280 | + $return .= 'Max Input Vars: '.ini_get('max_input_vars')."\n"; |
|
281 | + $return .= 'Display Errors: '.(ini_get('display_errors') ? 'On ('.ini_get('display_errors').')' : 'N/A')."\n"; |
|
282 | + |
|
283 | + $return = apply_filters('give_sysinfo_after_php_config', $return); |
|
284 | 284 | |
285 | 285 | // PHP extensions and such |
286 | - $return .= "\n" . '-- PHP Extensions' . "\n\n"; |
|
287 | - $return .= 'cURL: ' . ( function_exists( 'curl_init' ) ? 'Supported' : 'Not Supported' ) . "\n"; |
|
286 | + $return .= "\n".'-- PHP Extensions'."\n\n"; |
|
287 | + $return .= 'cURL: '.(function_exists('curl_init') ? 'Supported' : 'Not Supported')."\n"; |
|
288 | 288 | |
289 | 289 | //cURL version |
290 | - if ( function_exists( 'curl_init' ) && function_exists( 'curl_version' ) ) { |
|
290 | + if (function_exists('curl_init') && function_exists('curl_version')) { |
|
291 | 291 | $curl_values = curl_version(); |
292 | - $return .= 'cURL Version: ' . $curl_values["version"] . "\n"; |
|
292 | + $return .= 'cURL Version: '.$curl_values["version"]."\n"; |
|
293 | 293 | } |
294 | - $return .= 'fsockopen: ' . ( function_exists( 'fsockopen' ) ? 'Supported' : 'Not Supported' ) . "\n"; |
|
295 | - $return .= 'SOAP Client: ' . ( class_exists( 'SoapClient' ) ? 'Installed' : 'Not Installed' ) . "\n"; |
|
296 | - $return .= 'Suhosin: ' . ( extension_loaded( 'suhosin' ) ? 'Installed' : 'Not Installed' ) . "\n"; |
|
294 | + $return .= 'fsockopen: '.(function_exists('fsockopen') ? 'Supported' : 'Not Supported')."\n"; |
|
295 | + $return .= 'SOAP Client: '.(class_exists('SoapClient') ? 'Installed' : 'Not Installed')."\n"; |
|
296 | + $return .= 'Suhosin: '.(extension_loaded('suhosin') ? 'Installed' : 'Not Installed')."\n"; |
|
297 | 297 | |
298 | - $return = apply_filters( 'give_sysinfo_after_php_ext', $return ); |
|
298 | + $return = apply_filters('give_sysinfo_after_php_ext', $return); |
|
299 | 299 | |
300 | 300 | // Session stuff |
301 | - $return .= "\n" . '-- Session Configuration' . "\n\n"; |
|
302 | - $return .= 'Give Use Sessions: ' . ( defined( 'GIVE_USE_PHP_SESSIONS' ) && GIVE_USE_PHP_SESSIONS ? 'Enforced' : ( Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled' ) ) . "\n"; |
|
303 | - $return .= 'Session: ' . ( isset( $_SESSION ) ? 'Enabled' : 'Disabled' ) . "\n"; |
|
301 | + $return .= "\n".'-- Session Configuration'."\n\n"; |
|
302 | + $return .= 'Give Use Sessions: '.(defined('GIVE_USE_PHP_SESSIONS') && GIVE_USE_PHP_SESSIONS ? 'Enforced' : (Give()->session->use_php_sessions() ? 'Enabled' : 'Disabled'))."\n"; |
|
303 | + $return .= 'Session: '.(isset($_SESSION) ? 'Enabled' : 'Disabled')."\n"; |
|
304 | 304 | |
305 | 305 | // The rest of this is only relevant is session is enabled |
306 | - if ( isset( $_SESSION ) ) { |
|
307 | - $return .= 'Session Name: ' . esc_html( ini_get( 'session.name' ) ) . "\n"; |
|
308 | - $return .= 'Cookie Path: ' . esc_html( ini_get( 'session.cookie_path' ) ) . "\n"; |
|
309 | - $return .= 'Save Path: ' . esc_html( ini_get( 'session.save_path' ) ) . "\n"; |
|
310 | - $return .= 'Use Cookies: ' . ( ini_get( 'session.use_cookies' ) ? 'On' : 'Off' ) . "\n"; |
|
311 | - $return .= 'Use Only Cookies: ' . ( ini_get( 'session.use_only_cookies' ) ? 'On' : 'Off' ) . "\n"; |
|
306 | + if (isset($_SESSION)) { |
|
307 | + $return .= 'Session Name: '.esc_html(ini_get('session.name'))."\n"; |
|
308 | + $return .= 'Cookie Path: '.esc_html(ini_get('session.cookie_path'))."\n"; |
|
309 | + $return .= 'Save Path: '.esc_html(ini_get('session.save_path'))."\n"; |
|
310 | + $return .= 'Use Cookies: '.(ini_get('session.use_cookies') ? 'On' : 'Off')."\n"; |
|
311 | + $return .= 'Use Only Cookies: '.(ini_get('session.use_only_cookies') ? 'On' : 'Off')."\n"; |
|
312 | 312 | } |
313 | 313 | |
314 | - $return = apply_filters( 'give_sysinfo_after_session_config', $return ); |
|
314 | + $return = apply_filters('give_sysinfo_after_session_config', $return); |
|
315 | 315 | |
316 | - $return .= "\n" . '### End System Info ###'; |
|
316 | + $return .= "\n".'### End System Info ###'; |
|
317 | 317 | |
318 | 318 | return $return; |
319 | 319 | } |
@@ -327,17 +327,17 @@ discard block |
||
327 | 327 | */ |
328 | 328 | function give_tools_sysinfo_download() { |
329 | 329 | |
330 | - if ( ! current_user_can( 'manage_give_settings' ) ) { |
|
330 | + if ( ! current_user_can('manage_give_settings')) { |
|
331 | 331 | return; |
332 | 332 | } |
333 | 333 | |
334 | 334 | nocache_headers(); |
335 | 335 | |
336 | - header( 'Content-Type: text/plain' ); |
|
337 | - header( 'Content-Disposition: attachment; filename="give-system-info.txt"' ); |
|
336 | + header('Content-Type: text/plain'); |
|
337 | + header('Content-Disposition: attachment; filename="give-system-info.txt"'); |
|
338 | 338 | |
339 | - echo wp_strip_all_tags( $_POST['give-sysinfo'] ); |
|
339 | + echo wp_strip_all_tags($_POST['give-sysinfo']); |
|
340 | 340 | give_die(); |
341 | 341 | } |
342 | 342 | |
343 | -add_action( 'give_download_sysinfo', 'give_tools_sysinfo_download' ); |
|
344 | 343 | \ No newline at end of file |
344 | +add_action('give_download_sysinfo', 'give_tools_sysinfo_download'); |
|
345 | 345 | \ No newline at end of file |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | */ |
41 | 41 | |
42 | 42 | // Exit if accessed directly |
43 | -if ( ! defined( 'ABSPATH' ) ) { |
|
43 | +if ( ! defined('ABSPATH')) { |
|
44 | 44 | exit; |
45 | 45 | } |
46 | 46 | |
47 | -if ( ! class_exists( 'Give' ) ) : /** |
|
47 | +if ( ! class_exists('Give')) : /** |
|
48 | 48 | * Main Give Class |
49 | 49 | * |
50 | 50 | * @since 1.0 |
@@ -142,11 +142,11 @@ discard block |
||
142 | 142 | * @return Give |
143 | 143 | */ |
144 | 144 | public static function instance() { |
145 | - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Give ) ) { |
|
145 | + if ( ! isset(self::$instance) && ! (self::$instance instanceof Give)) { |
|
146 | 146 | self::$instance = new Give; |
147 | 147 | self::$instance->setup_constants(); |
148 | 148 | |
149 | - add_action( 'plugins_loaded', array( self::$instance, 'load_textdomain' ) ); |
|
149 | + add_action('plugins_loaded', array(self::$instance, 'load_textdomain')); |
|
150 | 150 | |
151 | 151 | self::$instance->includes(); |
152 | 152 | self::$instance->roles = new Give_Roles(); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function __clone() { |
179 | 179 | // Cloning instances of the class is forbidden |
180 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' ); |
|
180 | + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'give'), '1.0'); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | public function __wakeup() { |
191 | 191 | // Unserializing instances of the class is forbidden |
192 | - _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'give' ), '1.0' ); |
|
192 | + _doing_it_wrong(__FUNCTION__, __('Cheatin’ huh?', 'give'), '1.0'); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
@@ -202,33 +202,33 @@ discard block |
||
202 | 202 | private function setup_constants() { |
203 | 203 | |
204 | 204 | // Plugin version |
205 | - if ( ! defined( 'GIVE_VERSION' ) ) { |
|
206 | - define( 'GIVE_VERSION', '1.3.5' ); |
|
205 | + if ( ! defined('GIVE_VERSION')) { |
|
206 | + define('GIVE_VERSION', '1.3.5'); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | // Plugin Folder Path |
210 | - if ( ! defined( 'GIVE_PLUGIN_DIR' ) ) { |
|
211 | - define( 'GIVE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
|
210 | + if ( ! defined('GIVE_PLUGIN_DIR')) { |
|
211 | + define('GIVE_PLUGIN_DIR', plugin_dir_path(__FILE__)); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | // Plugin Folder URL |
215 | - if ( ! defined( 'GIVE_PLUGIN_URL' ) ) { |
|
216 | - define( 'GIVE_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
|
215 | + if ( ! defined('GIVE_PLUGIN_URL')) { |
|
216 | + define('GIVE_PLUGIN_URL', plugin_dir_url(__FILE__)); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | // Plugin Basename aka: "give/give.php" |
220 | - if ( ! defined( 'GIVE_PLUGIN_BASENAME' ) ) { |
|
221 | - define( 'GIVE_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); |
|
220 | + if ( ! defined('GIVE_PLUGIN_BASENAME')) { |
|
221 | + define('GIVE_PLUGIN_BASENAME', plugin_basename(__FILE__)); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | // Plugin Root File |
225 | - if ( ! defined( 'GIVE_PLUGIN_FILE' ) ) { |
|
226 | - define( 'GIVE_PLUGIN_FILE', __FILE__ ); |
|
225 | + if ( ! defined('GIVE_PLUGIN_FILE')) { |
|
226 | + define('GIVE_PLUGIN_FILE', __FILE__); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | // Make sure CAL_GREGORIAN is defined |
230 | - if ( ! defined( 'CAL_GREGORIAN' ) ) { |
|
231 | - define( 'CAL_GREGORIAN', 1 ); |
|
230 | + if ( ! defined('CAL_GREGORIAN')) { |
|
231 | + define('CAL_GREGORIAN', 1); |
|
232 | 232 | } |
233 | 233 | } |
234 | 234 | |
@@ -242,103 +242,103 @@ discard block |
||
242 | 242 | private function includes() { |
243 | 243 | global $give_options; |
244 | 244 | |
245 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/register-settings.php'; |
|
245 | + require_once GIVE_PLUGIN_DIR.'includes/admin/register-settings.php'; |
|
246 | 246 | $give_options = give_get_settings(); |
247 | 247 | |
248 | - require_once GIVE_PLUGIN_DIR . 'includes/post-types.php'; |
|
249 | - require_once GIVE_PLUGIN_DIR . 'includes/scripts.php'; |
|
250 | - require_once GIVE_PLUGIN_DIR . 'includes/ajax-functions.php'; |
|
251 | - require_once GIVE_PLUGIN_DIR . 'includes/actions.php'; |
|
252 | - require_once GIVE_PLUGIN_DIR . 'includes/api/class-give-api.php'; |
|
253 | - |
|
254 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-roles.php'; |
|
255 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-template-loader.php'; |
|
256 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-donate-form.php'; |
|
257 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db.php'; |
|
258 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-db-customers.php'; |
|
259 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-customer.php'; |
|
260 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-stats.php'; |
|
261 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-session.php'; |
|
262 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-html-elements.php'; |
|
263 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-logging.php'; |
|
264 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-license-handler.php'; |
|
265 | - require_once GIVE_PLUGIN_DIR . 'includes/class-give-cron.php'; |
|
266 | - |
|
267 | - require_once GIVE_PLUGIN_DIR . 'includes/country-functions.php'; |
|
268 | - require_once GIVE_PLUGIN_DIR . 'includes/template-functions.php'; |
|
269 | - require_once GIVE_PLUGIN_DIR . 'includes/misc-functions.php'; |
|
270 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/functions.php'; |
|
271 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/template.php'; |
|
272 | - require_once GIVE_PLUGIN_DIR . 'includes/forms/widget.php'; |
|
273 | - require_once GIVE_PLUGIN_DIR . 'includes/shortcodes.php'; |
|
274 | - require_once GIVE_PLUGIN_DIR . 'includes/formatting.php'; |
|
275 | - require_once GIVE_PLUGIN_DIR . 'includes/price-functions.php'; |
|
276 | - require_once GIVE_PLUGIN_DIR . 'includes/error-tracking.php'; |
|
277 | - require_once GIVE_PLUGIN_DIR . 'includes/process-purchase.php'; |
|
278 | - require_once GIVE_PLUGIN_DIR . 'includes/login-register.php'; |
|
279 | - require_once GIVE_PLUGIN_DIR . 'includes/user-functions.php'; |
|
280 | - |
|
281 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/functions.php'; |
|
282 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/actions.php'; |
|
283 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payment-stats.php'; |
|
284 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-payments-query.php'; |
|
285 | - require_once GIVE_PLUGIN_DIR . 'includes/payments/class-donators-gravatars.php'; |
|
286 | - |
|
287 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/functions.php'; |
|
288 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/actions.php'; |
|
289 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/paypal-standard.php'; |
|
290 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/offline-donations.php'; |
|
291 | - require_once GIVE_PLUGIN_DIR . 'includes/gateways/manual.php'; |
|
292 | - |
|
293 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-emails.php'; |
|
294 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/class-give-email-tags.php'; |
|
295 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/functions.php'; |
|
296 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/template.php'; |
|
297 | - require_once GIVE_PLUGIN_DIR . 'includes/emails/actions.php'; |
|
298 | - |
|
299 | - if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { |
|
300 | - |
|
301 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-footer.php'; |
|
302 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/welcome.php'; |
|
303 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-pages.php'; |
|
304 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-admin-notices.php'; |
|
305 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/class-api-keys-table.php'; |
|
306 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/admin-actions.php'; |
|
307 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/system-info.php'; |
|
308 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/export-functions.php'; |
|
309 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/add-ons.php'; |
|
310 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/dashboard-widgets.php'; |
|
311 | - |
|
312 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/actions.php'; |
|
313 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/payments/payments-history.php'; |
|
314 | - |
|
315 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customers.php'; |
|
316 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customer-functions.php'; |
|
317 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/customers/customer-actions.php'; |
|
318 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/metabox.php'; |
|
319 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/forms/dashboard-columns.php'; |
|
320 | - |
|
321 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/reports.php'; |
|
322 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/pdf-reports.php'; |
|
323 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-give-graph.php'; |
|
324 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/graphing.php'; |
|
325 | - |
|
326 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/abstract-shortcode-generator.php'; |
|
327 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/class-shortcode-button.php'; |
|
328 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-form.php'; |
|
329 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-goal.php'; |
|
330 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-login.php'; |
|
331 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-register.php'; |
|
332 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-profile-editor.php'; |
|
333 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-donation-history.php'; |
|
334 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/shortcodes/shortcode-give-receipt.php'; |
|
335 | - |
|
336 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrade-functions.php'; |
|
337 | - require_once GIVE_PLUGIN_DIR . 'includes/admin/upgrades/upgrades.php'; |
|
248 | + require_once GIVE_PLUGIN_DIR.'includes/post-types.php'; |
|
249 | + require_once GIVE_PLUGIN_DIR.'includes/scripts.php'; |
|
250 | + require_once GIVE_PLUGIN_DIR.'includes/ajax-functions.php'; |
|
251 | + require_once GIVE_PLUGIN_DIR.'includes/actions.php'; |
|
252 | + require_once GIVE_PLUGIN_DIR.'includes/api/class-give-api.php'; |
|
253 | + |
|
254 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-roles.php'; |
|
255 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-template-loader.php'; |
|
256 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-donate-form.php'; |
|
257 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db.php'; |
|
258 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-db-customers.php'; |
|
259 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-customer.php'; |
|
260 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-stats.php'; |
|
261 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-session.php'; |
|
262 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-html-elements.php'; |
|
263 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-logging.php'; |
|
264 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-license-handler.php'; |
|
265 | + require_once GIVE_PLUGIN_DIR.'includes/class-give-cron.php'; |
|
266 | + |
|
267 | + require_once GIVE_PLUGIN_DIR.'includes/country-functions.php'; |
|
268 | + require_once GIVE_PLUGIN_DIR.'includes/template-functions.php'; |
|
269 | + require_once GIVE_PLUGIN_DIR.'includes/misc-functions.php'; |
|
270 | + require_once GIVE_PLUGIN_DIR.'includes/forms/functions.php'; |
|
271 | + require_once GIVE_PLUGIN_DIR.'includes/forms/template.php'; |
|
272 | + require_once GIVE_PLUGIN_DIR.'includes/forms/widget.php'; |
|
273 | + require_once GIVE_PLUGIN_DIR.'includes/shortcodes.php'; |
|
274 | + require_once GIVE_PLUGIN_DIR.'includes/formatting.php'; |
|
275 | + require_once GIVE_PLUGIN_DIR.'includes/price-functions.php'; |
|
276 | + require_once GIVE_PLUGIN_DIR.'includes/error-tracking.php'; |
|
277 | + require_once GIVE_PLUGIN_DIR.'includes/process-purchase.php'; |
|
278 | + require_once GIVE_PLUGIN_DIR.'includes/login-register.php'; |
|
279 | + require_once GIVE_PLUGIN_DIR.'includes/user-functions.php'; |
|
280 | + |
|
281 | + require_once GIVE_PLUGIN_DIR.'includes/payments/functions.php'; |
|
282 | + require_once GIVE_PLUGIN_DIR.'includes/payments/actions.php'; |
|
283 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-payment-stats.php'; |
|
284 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-payments-query.php'; |
|
285 | + require_once GIVE_PLUGIN_DIR.'includes/payments/class-donators-gravatars.php'; |
|
286 | + |
|
287 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/functions.php'; |
|
288 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/actions.php'; |
|
289 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/paypal-standard.php'; |
|
290 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/offline-donations.php'; |
|
291 | + require_once GIVE_PLUGIN_DIR.'includes/gateways/manual.php'; |
|
292 | + |
|
293 | + require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-emails.php'; |
|
294 | + require_once GIVE_PLUGIN_DIR.'includes/emails/class-give-email-tags.php'; |
|
295 | + require_once GIVE_PLUGIN_DIR.'includes/emails/functions.php'; |
|
296 | + require_once GIVE_PLUGIN_DIR.'includes/emails/template.php'; |
|
297 | + require_once GIVE_PLUGIN_DIR.'includes/emails/actions.php'; |
|
298 | + |
|
299 | + if (is_admin() || (defined('WP_CLI') && WP_CLI)) { |
|
300 | + |
|
301 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-footer.php'; |
|
302 | + require_once GIVE_PLUGIN_DIR.'includes/admin/welcome.php'; |
|
303 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-pages.php'; |
|
304 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-admin-notices.php'; |
|
305 | + require_once GIVE_PLUGIN_DIR.'includes/admin/class-api-keys-table.php'; |
|
306 | + require_once GIVE_PLUGIN_DIR.'includes/admin/admin-actions.php'; |
|
307 | + require_once GIVE_PLUGIN_DIR.'includes/admin/system-info.php'; |
|
308 | + require_once GIVE_PLUGIN_DIR.'includes/admin/export-functions.php'; |
|
309 | + require_once GIVE_PLUGIN_DIR.'includes/admin/add-ons.php'; |
|
310 | + require_once GIVE_PLUGIN_DIR.'includes/admin/dashboard-widgets.php'; |
|
311 | + |
|
312 | + require_once GIVE_PLUGIN_DIR.'includes/admin/payments/actions.php'; |
|
313 | + require_once GIVE_PLUGIN_DIR.'includes/admin/payments/payments-history.php'; |
|
314 | + |
|
315 | + require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customers.php'; |
|
316 | + require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customer-functions.php'; |
|
317 | + require_once GIVE_PLUGIN_DIR.'includes/admin/customers/customer-actions.php'; |
|
318 | + require_once GIVE_PLUGIN_DIR.'includes/admin/forms/metabox.php'; |
|
319 | + require_once GIVE_PLUGIN_DIR.'includes/admin/forms/dashboard-columns.php'; |
|
320 | + |
|
321 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/reports.php'; |
|
322 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/pdf-reports.php'; |
|
323 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/class-give-graph.php'; |
|
324 | + require_once GIVE_PLUGIN_DIR.'includes/admin/reporting/graphing.php'; |
|
325 | + |
|
326 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/abstract-shortcode-generator.php'; |
|
327 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/class-shortcode-button.php'; |
|
328 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-form.php'; |
|
329 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-goal.php'; |
|
330 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-login.php'; |
|
331 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-register.php'; |
|
332 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-profile-editor.php'; |
|
333 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-donation-history.php'; |
|
334 | + require_once GIVE_PLUGIN_DIR.'includes/admin/shortcodes/shortcode-give-receipt.php'; |
|
335 | + |
|
336 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrade-functions.php'; |
|
337 | + require_once GIVE_PLUGIN_DIR.'includes/admin/upgrades/upgrades.php'; |
|
338 | 338 | |
339 | 339 | } |
340 | 340 | |
341 | - require_once GIVE_PLUGIN_DIR . 'includes/install.php'; |
|
341 | + require_once GIVE_PLUGIN_DIR.'includes/install.php'; |
|
342 | 342 | |
343 | 343 | } |
344 | 344 | |
@@ -351,26 +351,26 @@ discard block |
||
351 | 351 | */ |
352 | 352 | public function load_textdomain() { |
353 | 353 | // Set filter for Give's languages directory |
354 | - $give_lang_dir = dirname( plugin_basename( GIVE_PLUGIN_FILE ) ) . '/languages/'; |
|
355 | - $give_lang_dir = apply_filters( 'give_languages_directory', $give_lang_dir ); |
|
354 | + $give_lang_dir = dirname(plugin_basename(GIVE_PLUGIN_FILE)).'/languages/'; |
|
355 | + $give_lang_dir = apply_filters('give_languages_directory', $give_lang_dir); |
|
356 | 356 | |
357 | 357 | // Traditional WordPress plugin locale filter |
358 | - $locale = apply_filters( 'plugin_locale', get_locale(), 'give' ); |
|
359 | - $mofile = sprintf( '%1$s-%2$s.mo', 'give', $locale ); |
|
358 | + $locale = apply_filters('plugin_locale', get_locale(), 'give'); |
|
359 | + $mofile = sprintf('%1$s-%2$s.mo', 'give', $locale); |
|
360 | 360 | |
361 | 361 | // Setup paths to current locale file |
362 | - $mofile_local = $give_lang_dir . $mofile; |
|
363 | - $mofile_global = WP_LANG_DIR . '/give/' . $mofile; |
|
362 | + $mofile_local = $give_lang_dir.$mofile; |
|
363 | + $mofile_global = WP_LANG_DIR.'/give/'.$mofile; |
|
364 | 364 | |
365 | - if ( file_exists( $mofile_global ) ) { |
|
365 | + if (file_exists($mofile_global)) { |
|
366 | 366 | // Look in global /wp-content/languages/give folder |
367 | - load_textdomain( 'give', $mofile_global ); |
|
368 | - } elseif ( file_exists( $mofile_local ) ) { |
|
367 | + load_textdomain('give', $mofile_global); |
|
368 | + } elseif (file_exists($mofile_local)) { |
|
369 | 369 | // Look in local /wp-content/plugins/give/languages/ folder |
370 | - load_textdomain( 'give', $mofile_local ); |
|
370 | + load_textdomain('give', $mofile_local); |
|
371 | 371 | } else { |
372 | 372 | // Load the default language files |
373 | - load_plugin_textdomain( 'give', false, $give_lang_dir ); |
|
373 | + load_plugin_textdomain('give', false, $give_lang_dir); |
|
374 | 374 | } |
375 | 375 | } |
376 | 376 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | */ |
11 | 11 | |
12 | 12 | // Exit if accessed directly |
13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
13 | +if ( ! defined('ABSPATH')) { |
|
14 | 14 | exit; |
15 | 15 | } |
16 | 16 | |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | function give_add_ons_page() { |
26 | 26 | ob_start(); ?> |
27 | 27 | <div class="wrap" id="give-add-ons"> |
28 | - <h2><?php _e( 'Give Add-ons', 'give' ); ?> |
|
29 | - — <a href="https://givewp.com/addons/" class="button-primary give-view-addons-all" title="<?php _e( 'Browse All Add-ons', 'give' ); ?>" target="_blank"><?php _e( 'View All Add-ons', 'give' ); ?> |
|
28 | + <h2><?php _e('Give Add-ons', 'give'); ?> |
|
29 | + — <a href="https://givewp.com/addons/" class="button-primary give-view-addons-all" title="<?php _e('Browse All Add-ons', 'give'); ?>" target="_blank"><?php _e('View All Add-ons', 'give'); ?> |
|
30 | 30 | <span class="dashicons dashicons-external"></span></a> |
31 | 31 | </h2> |
32 | 32 | |
33 | - <p><?php _e( 'The following Add-ons extend the functionality of Give.', 'give' ); ?></p> |
|
33 | + <p><?php _e('The following Add-ons extend the functionality of Give.', 'give'); ?></p> |
|
34 | 34 | <?php echo give_add_ons_get_feed(); ?> |
35 | 35 | </div> |
36 | 36 | <?php |
@@ -48,18 +48,18 @@ discard block |
||
48 | 48 | function give_add_ons_get_feed() { |
49 | 49 | |
50 | 50 | $addons_debug = false; //set to true to debug |
51 | - $cache = get_transient( 'give_add_ons_feed' ); |
|
51 | + $cache = get_transient('give_add_ons_feed'); |
|
52 | 52 | |
53 | - if ( $cache === false || $addons_debug === true && WP_DEBUG === true ) { |
|
54 | - $feed = wp_remote_get( 'https://givewp.com/downloads/feed/', array( 'sslverify' => false ) ); |
|
53 | + if ($cache === false || $addons_debug === true && WP_DEBUG === true) { |
|
54 | + $feed = wp_remote_get('https://givewp.com/downloads/feed/', array('sslverify' => false)); |
|
55 | 55 | |
56 | - if ( ! is_wp_error( $feed ) ) { |
|
57 | - if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) { |
|
58 | - $cache = wp_remote_retrieve_body( $feed ); |
|
59 | - set_transient( 'give_add_ons_feed', $cache, 3600 ); |
|
56 | + if ( ! is_wp_error($feed)) { |
|
57 | + if (isset($feed['body']) && strlen($feed['body']) > 0) { |
|
58 | + $cache = wp_remote_retrieve_body($feed); |
|
59 | + set_transient('give_add_ons_feed', $cache, 3600); |
|
60 | 60 | } |
61 | 61 | } else { |
62 | - $cache = '<div class="error"><p>' . __( 'There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give' ) . '</div>'; |
|
62 | + $cache = '<div class="error"><p>'.__('There was an error retrieving the Give Add-ons list from the server. Please try again later.', 'give').'</div>'; |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 |