Give – Donation Plugin and Fundraising Platform - Version 2.11.2

Version Description

Download this release

Release Info

Developer jason_the_adams
Plugin Icon 128x128 Give – Donation Plugin and Fundraising Platform
Version 2.11.2
Comparing to
See all releases

Code changes from version 2.11.1 to 2.11.2

Dockerfile DELETED
@@ -1,2 +0,0 @@
1
- FROM php:7.2-cli-alpine
2
- RUN apk add --update --no-cache zip git bash openssh
 
 
cypress.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "env": {
3
- "wp_user": "admin",
4
- "wp_pass": "password",
5
- "site": {
6
- "url": "http://localhost:8888"
7
- }
8
- },
9
- "fixturesFolder": "tests/e2e/fixtues",
10
- "integrationFolder": "tests/e2e/integration",
11
- "pluginsFolder": "tests/e2e/plugins",
12
- "screenshotsFolder": "tests/e2e/screenshots",
13
- "videosFolder": "tests/e2e/videos",
14
- "supportFile": "tests/e2e/support/index.js"
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
give.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
6
  * Author: GiveWP
7
  * Author URI: https://givewp.com/
8
- * Version: 2.11.1
9
  * Text Domain: give
10
  * Domain Path: /languages
11
  *
@@ -265,7 +265,7 @@ final class Give {
265
  private function setup_constants() {
266
  // Plugin version.
267
  if ( ! defined( 'GIVE_VERSION' ) ) {
268
- define( 'GIVE_VERSION', '2.11.1' );
269
  }
270
 
271
  // Plugin Root File.
5
  * Description: The most robust, flexible, and intuitive way to accept donations on WordPress.
6
  * Author: GiveWP
7
  * Author URI: https://givewp.com/
8
+ * Version: 2.11.2
9
  * Text Domain: give
10
  * Domain Path: /languages
11
  *
265
  private function setup_constants() {
266
  // Plugin version.
267
  if ( ! defined( 'GIVE_VERSION' ) ) {
268
+ define( 'GIVE_VERSION', '2.11.2' );
269
  }
270
 
271
  // Plugin Root File.
includes/admin/plugins.php CHANGED
@@ -24,13 +24,13 @@ if ( ! defined( 'ABSPATH' ) ) {
24
  * @return array An array of updated action links.
25
  */
26
  function give_plugin_action_links( $actions ) {
27
- $new_actions = array(
28
  'settings' => sprintf(
29
  '<a href="%1$s">%2$s</a>',
30
  admin_url( 'edit.php?post_type=give_forms&page=give-settings' ),
31
  __( 'Settings', 'give' )
32
  ),
33
- );
34
 
35
  return array_merge( $new_actions, $actions );
36
  }
@@ -53,16 +53,16 @@ function give_plugin_row_meta( $plugin_meta, $plugin_file ) {
53
  return $plugin_meta;
54
  }
55
 
56
- $new_meta_links = array(
57
  sprintf(
58
  '<a href="%1$s" target="_blank">%2$s</a>',
59
  esc_url(
60
  add_query_arg(
61
- array(
62
  'utm_source' => 'plugins-page',
63
  'utm_medium' => 'plugin-row',
64
  'utm_campaign' => 'admin',
65
- ),
66
  'https://givewp.com/documentation/'
67
  )
68
  ),
@@ -72,17 +72,17 @@ function give_plugin_row_meta( $plugin_meta, $plugin_file ) {
72
  '<a href="%1$s" target="_blank">%2$s</a>',
73
  esc_url(
74
  add_query_arg(
75
- array(
76
  'utm_source' => 'plugins-page',
77
  'utm_medium' => 'plugin-row',
78
  'utm_campaign' => 'admin',
79
- ),
80
  'https://givewp.com/addons/'
81
  )
82
  ),
83
  __( 'Add-ons', 'give' )
84
  ),
85
- );
86
 
87
  return array_merge( $plugin_meta, $new_meta_links );
88
  }
@@ -133,7 +133,7 @@ function give_recently_activated_addons() {
133
  // Check if action is set.
134
  if ( isset( $_REQUEST['action'] ) ) {
135
  $plugin_action = ( '-1' !== $_REQUEST['action'] ) ? $_REQUEST['action'] : ( isset( $_REQUEST['action2'] ) ? $_REQUEST['action2'] : '' );
136
- $plugins = array();
137
 
138
  switch ( $plugin_action ) {
139
  case 'activate': // Single add-on activation.
@@ -178,7 +178,7 @@ add_action( 'activated_plugin', 'give_recently_activated_addons', 10 );
178
  function give_filter_addons_do_filter_addons( $plugin_menu ) {
179
  global $plugins;
180
 
181
- $give_addons = wp_list_pluck( give_get_plugins( array( 'only_add_on' => true ) ), 'Name' );
182
 
183
  if ( ! empty( $give_addons ) ) {
184
  foreach ( $plugins['all'] as $file => $plugin_data ) {
@@ -360,11 +360,11 @@ function give_get_plugin_upgrade_notice( $new_version ) {
360
  */
361
  function give_parse_plugin_update_notice( $content, $new_version ) {
362
  $version_parts = explode( '.', $new_version );
363
- $check_for_notices = array(
364
  $version_parts[0] . '.0',
365
  $version_parts[0] . '.0.0',
366
  $version_parts[0] . '.' . $version_parts[1] . '.' . '0',
367
- );
368
 
369
  // Regex to extract Upgrade notice from the readme.txt file.
370
  $notice_regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( $new_version ) . '\s*=|$)~Uis';
@@ -444,7 +444,7 @@ add_action( 'admin_head', 'give_plugin_notice_css' );
444
  * @return mixed|array list of recently activated add-on
445
  */
446
  function give_get_recently_activated_addons() {
447
- return get_option( 'give_recently_activated_addons', array() );
448
  }
449
 
450
  /**
@@ -459,7 +459,7 @@ function give_deactivation_popup() {
459
  give_die();
460
  }
461
 
462
- $results = array();
463
 
464
  // Start output buffering.
465
  ob_start();
@@ -522,7 +522,7 @@ function give_deactivation_popup() {
522
  );
523
  ?>
524
  </p>
525
- <textarea disabled name="user-reason" class="widefat" rows="6"></textarea disabled>
526
  </div>
527
  </div>
528
 
@@ -543,7 +543,7 @@ function give_deactivation_popup() {
543
  );
544
  ?>
545
  </p>
546
- <textarea disabled name="user-reason" class="widefat" rows="6"></textarea disabled>
547
  </div>
548
  </div>
549
 
@@ -555,7 +555,7 @@ function give_deactivation_popup() {
555
 
556
  <div class="give-survey-extra-field">
557
  <p><?php esc_html_e( "Please describe why you're deactivating Give", 'give' ); ?></p>
558
- <textarea disabled name="user-reason" class="widefat" rows="6"></textarea disabled>
559
  </div>
560
  </div>
561
 
@@ -626,14 +626,14 @@ function give_deactivation_form_submit() {
626
  */
627
  $response = wp_remote_post(
628
  'http://survey.givewp.com/wp-json/give/v2/survey/',
629
- array(
630
- 'body' => array(
631
  'radio_value' => $radio_value,
632
  'user_reason' => $user_reason,
633
  'current_user_email' => $user_email,
634
  'site_url' => $site_url,
635
- ),
636
- )
637
  );
638
 
639
  // Check if the data is sent and stored correctly.
@@ -641,21 +641,14 @@ function give_deactivation_form_submit() {
641
 
642
  if ( 'true' === $response ) {
643
  if ( '1' === $delete_data ) {
644
- wp_send_json_success(
645
- array(
646
- 'delete_data' => true,
647
- )
648
- );
649
- } else {
650
- wp_send_json_success(
651
- array(
652
- 'delete_data' => false,
653
- )
654
- );
655
  }
656
- } else {
657
- wp_send_json_error();
658
  }
 
 
659
  }
660
 
661
  add_action( 'wp_ajax_deactivation_form_submit', 'give_deactivation_form_submit' );
24
  * @return array An array of updated action links.
25
  */
26
  function give_plugin_action_links( $actions ) {
27
+ $new_actions = [
28
  'settings' => sprintf(
29
  '<a href="%1$s">%2$s</a>',
30
  admin_url( 'edit.php?post_type=give_forms&page=give-settings' ),
31
  __( 'Settings', 'give' )
32
  ),
33
+ ];
34
 
35
  return array_merge( $new_actions, $actions );
36
  }
53
  return $plugin_meta;
54
  }
55
 
56
+ $new_meta_links = [
57
  sprintf(
58
  '<a href="%1$s" target="_blank">%2$s</a>',
59
  esc_url(
60
  add_query_arg(
61
+ [
62
  'utm_source' => 'plugins-page',
63
  'utm_medium' => 'plugin-row',
64
  'utm_campaign' => 'admin',
65
+ ],
66
  'https://givewp.com/documentation/'
67
  )
68
  ),
72
  '<a href="%1$s" target="_blank">%2$s</a>',
73
  esc_url(
74
  add_query_arg(
75
+ [
76
  'utm_source' => 'plugins-page',
77
  'utm_medium' => 'plugin-row',
78
  'utm_campaign' => 'admin',
79
+ ],
80
  'https://givewp.com/addons/'
81
  )
82
  ),
83
  __( 'Add-ons', 'give' )
84
  ),
85
+ ];
86
 
87
  return array_merge( $plugin_meta, $new_meta_links );
88
  }
133
  // Check if action is set.
134
  if ( isset( $_REQUEST['action'] ) ) {
135
  $plugin_action = ( '-1' !== $_REQUEST['action'] ) ? $_REQUEST['action'] : ( isset( $_REQUEST['action2'] ) ? $_REQUEST['action2'] : '' );
136
+ $plugins = [];
137
 
138
  switch ( $plugin_action ) {
139
  case 'activate': // Single add-on activation.
178
  function give_filter_addons_do_filter_addons( $plugin_menu ) {
179
  global $plugins;
180
 
181
+ $give_addons = wp_list_pluck( give_get_plugins( [ 'only_add_on' => true ] ), 'Name' );
182
 
183
  if ( ! empty( $give_addons ) ) {
184
  foreach ( $plugins['all'] as $file => $plugin_data ) {
360
  */
361
  function give_parse_plugin_update_notice( $content, $new_version ) {
362
  $version_parts = explode( '.', $new_version );
363
+ $check_for_notices = [
364
  $version_parts[0] . '.0',
365
  $version_parts[0] . '.0.0',
366
  $version_parts[0] . '.' . $version_parts[1] . '.' . '0',
367
+ ];
368
 
369
  // Regex to extract Upgrade notice from the readme.txt file.
370
  $notice_regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( $new_version ) . '\s*=|$)~Uis';
444
  * @return mixed|array list of recently activated add-on
445
  */
446
  function give_get_recently_activated_addons() {
447
+ return get_option( 'give_recently_activated_addons', [] );
448
  }
449
 
450
  /**
459
  give_die();
460
  }
461
 
462
+ $results = [];
463
 
464
  // Start output buffering.
465
  ob_start();
522
  );
523
  ?>
524
  </p>
525
+ <textarea disabled name="user-reason" class="widefat" rows="6"></textarea>
526
  </div>
527
  </div>
528
 
543
  );
544
  ?>
545
  </p>
546
+ <textarea disabled name="user-reason" class="widefat" rows="6"></textarea>
547
  </div>
548
  </div>
549
 
555
 
556
  <div class="give-survey-extra-field">
557
  <p><?php esc_html_e( "Please describe why you're deactivating Give", 'give' ); ?></p>
558
+ <textarea disabled name="user-reason" class="widefat" rows="6"></textarea>
559
  </div>
560
  </div>
561
 
626
  */
627
  $response = wp_remote_post(
628
  'http://survey.givewp.com/wp-json/give/v2/survey/',
629
+ [
630
+ 'body' => [
631
  'radio_value' => $radio_value,
632
  'user_reason' => $user_reason,
633
  'current_user_email' => $user_email,
634
  'site_url' => $site_url,
635
+ ],
636
+ ]
637
  );
638
 
639
  // Check if the data is sent and stored correctly.
641
 
642
  if ( 'true' === $response ) {
643
  if ( '1' === $delete_data ) {
644
+ give_update_option( 'uninstall_on_delete', 'enabled' );
645
+ wp_send_json_success( [ 'delete_data' => true ] );
 
 
 
 
 
 
 
 
 
646
  }
647
+
648
+ wp_send_json_success( [ 'delete_data' => false ] );
649
  }
650
+
651
+ wp_send_json_error();
652
  }
653
 
654
  add_action( 'wp_ajax_deactivation_form_submit', 'give_deactivation_form_submit' );
languages/give.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Give - Donation Plugin plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Give - Donation Plugin 2.11.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/givewp\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2021-05-25T18:15:47+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: give\n"
2
  # This file is distributed under the same license as the Give - Donation Plugin plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Give - Donation Plugin 2.11.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/givewp\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2021-06-08T17:50:23+00:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.5.0\n"
15
  "X-Domain: give\n"
output.log CHANGED
@@ -5,13 +5,12 @@ https://docs.docker.com/engine/reference/commandline/login/#credentials-store
5
 
6
  Login Succeeded
7
  Pulling docker.pkg.github.com/impress-org/givewp/php-actions_composer_givewp:php-7.2-build2
8
- Error response from daemon: manifest for docker.pkg.github.com/impress-org/givewp/php-actions_composer_givewp:php-7.2-build2 not found: manifest unknown: Docker image reference php-actions_composer_givewp:php-7.2-build2 not found under repo "impress-org"
9
- Dockerfile:
10
- FROM php:7.2-cli-alpine
11
- RUN apk add --update --no-cache zip git bash openssh
12
- Sending build context to Docker daemon 36.33MB
13
- Step 1/2 : FROM php:7.2-cli-alpine
14
- 7.2-cli-alpine: Pulling from library/php
15
  801bfaa63ef2: Pulling fs layer
16
  30e209609427: Pulling fs layer
17
  320f26ee9b1c: Pulling fs layer
@@ -21,30 +20,33 @@ c88517be8365: Pulling fs layer
21
  142abe9b67c6: Pulling fs layer
22
  181891da1ea0: Pulling fs layer
23
  2a0fa75da19b: Pulling fs layer
 
24
  4612e05a72cf: Waiting
25
  f1478d838f46: Waiting
26
  c88517be8365: Waiting
27
  142abe9b67c6: Waiting
28
- 181891da1ea0: Waiting
29
  2a0fa75da19b: Waiting
30
- 320f26ee9b1c: Verifying Checksum
31
- 320f26ee9b1c: Download complete
32
- 801bfaa63ef2: Verifying Checksum
33
- 801bfaa63ef2: Download complete
34
  30e209609427: Verifying Checksum
35
  30e209609427: Download complete
36
- 801bfaa63ef2: Pull complete
 
37
  4612e05a72cf: Download complete
 
 
38
  c88517be8365: Verifying Checksum
39
  c88517be8365: Download complete
40
  181891da1ea0: Verifying Checksum
41
  181891da1ea0: Download complete
42
- f1478d838f46: Verifying Checksum
43
- f1478d838f46: Download complete
44
- 2a0fa75da19b: Verifying Checksum
45
- 2a0fa75da19b: Download complete
46
  142abe9b67c6: Verifying Checksum
47
  142abe9b67c6: Download complete
 
 
 
 
 
48
  30e209609427: Pull complete
49
  320f26ee9b1c: Pull complete
50
  4612e05a72cf: Pull complete
@@ -53,60 +55,10 @@ c88517be8365: Pull complete
53
  142abe9b67c6: Pull complete
54
  181891da1ea0: Pull complete
55
  2a0fa75da19b: Pull complete
56
- Digest: sha256:2eb165856ea5cbb2a7dd916d7e2a74ec9db1c5d1f5bd3871f50b0fe0a37fd356
57
- Status: Downloaded newer image for php:7.2-cli-alpine
58
- ---> bf1223dcd6fd
59
- Step 2/2 : RUN apk add --update --no-cache zip git bash openssh
60
- ---> Running in a7b3cb10d55b
61
- fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
62
- fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
63
- (1/13) Installing readline (8.0.4-r0)
64
- (2/13) Installing bash (5.0.17-r0)
65
- Executing bash-5.0.17-r0.post-install
66
- (3/13) Installing expat (2.2.9-r1)
67
- (4/13) Installing pcre2 (10.35-r0)
68
- (5/13) Installing git (2.26.3-r0)
69
- (6/13) Installing openssh-keygen (8.3_p1-r2)
70
- (7/13) Installing openssh-client (8.3_p1-r2)
71
- (8/13) Installing openssh-sftp-server (8.3_p1-r2)
72
- (9/13) Installing openssh-server-common (8.3_p1-r2)
73
- (10/13) Installing openssh-server (8.3_p1-r2)
74
- (11/13) Installing openssh (8.3_p1-r2)
75
- (12/13) Installing unzip (6.0-r8)
76
- (13/13) Installing zip (3.0-r8)
77
- Executing busybox-1.31.1-r19.trigger
78
- OK: 34 MiB in 43 packages
79
- Removing intermediate container a7b3cb10d55b
80
- ---> 6a9d37cf2b6f
81
- Successfully built 6a9d37cf2b6f
82
- Successfully tagged docker.pkg.github.com/impress-org/givewp/php-actions_composer_givewp:php-7.2-build2
83
- The push refers to repository [docker.pkg.github.com/impress-org/givewp/php-actions_composer_givewp]
84
- 3214f3941042: Preparing
85
- 0a1e5e00585b: Preparing
86
- 6cfea6e4001e: Preparing
87
- 5b838bbb8048: Preparing
88
- 493cc3941b45: Preparing
89
- 5d718d40b44e: Preparing
90
- 24e52497c24f: Preparing
91
- 86d905c1f58e: Preparing
92
- 22573737ba76: Preparing
93
- 777b2c648970: Preparing
94
- 5d718d40b44e: Waiting
95
- 24e52497c24f: Waiting
96
- 86d905c1f58e: Waiting
97
- 22573737ba76: Waiting
98
- 777b2c648970: Waiting
99
- 6cfea6e4001e: Pushed
100
- 493cc3941b45: Pushed
101
- 0a1e5e00585b: Pushed
102
- 3214f3941042: Pushed
103
- 5b838bbb8048: Pushed
104
- 24e52497c24f: Pushed
105
- 86d905c1f58e: Pushed
106
- 5d718d40b44e: Pushed
107
- 22573737ba76: Pushed
108
- 777b2c648970: Pushed
109
- php-7.2-build2: digest: sha256:f1169d1e7b3706fc60eb8b36299e6588e4f656cacfdaf9c5ff1c42fb2ca3034d size: 2414
110
  Docker tag: docker.pkg.github.com/impress-org/givewp/php-actions_composer_givewp:php-7.2-build2
111
  No private keys supplied
112
  Command: composer install --no-progress --no-interaction
5
 
6
  Login Succeeded
7
  Pulling docker.pkg.github.com/impress-org/givewp/php-actions_composer_givewp:php-7.2-build2
8
+ WARNING: ⚠️ Failed to pull manifest by the resolved digest. This registry does not
9
+ appear to conform to the distribution registry specification; falling back to
10
+ pull by tag. This fallback is DEPRECATED, and will be removed in a future
11
+ release. Please contact admins of https://docker.pkg.github.com. ⚠️
12
+
13
+ php-7.2-build2: Pulling from impress-org/givewp/php-actions_composer_givewp
 
14
  801bfaa63ef2: Pulling fs layer
15
  30e209609427: Pulling fs layer
16
  320f26ee9b1c: Pulling fs layer
20
  142abe9b67c6: Pulling fs layer
21
  181891da1ea0: Pulling fs layer
22
  2a0fa75da19b: Pulling fs layer
23
+ 136539a47de8: Pulling fs layer
24
  4612e05a72cf: Waiting
25
  f1478d838f46: Waiting
26
  c88517be8365: Waiting
27
  142abe9b67c6: Waiting
 
28
  2a0fa75da19b: Waiting
29
+ 136539a47de8: Waiting
30
+ 181891da1ea0: Waiting
 
 
31
  30e209609427: Verifying Checksum
32
  30e209609427: Download complete
33
+ 320f26ee9b1c: Verifying Checksum
34
+ 320f26ee9b1c: Download complete
35
  4612e05a72cf: Download complete
36
+ f1478d838f46: Verifying Checksum
37
+ f1478d838f46: Download complete
38
  c88517be8365: Verifying Checksum
39
  c88517be8365: Download complete
40
  181891da1ea0: Verifying Checksum
41
  181891da1ea0: Download complete
42
+ 801bfaa63ef2: Verifying Checksum
 
 
 
43
  142abe9b67c6: Verifying Checksum
44
  142abe9b67c6: Download complete
45
+ 801bfaa63ef2: Pull complete
46
+ 2a0fa75da19b: Verifying Checksum
47
+ 2a0fa75da19b: Download complete
48
+ 136539a47de8: Verifying Checksum
49
+ 136539a47de8: Download complete
50
  30e209609427: Pull complete
51
  320f26ee9b1c: Pull complete
52
  4612e05a72cf: Pull complete
55
  142abe9b67c6: Pull complete
56
  181891da1ea0: Pull complete
57
  2a0fa75da19b: Pull complete
58
+ 136539a47de8: Pull complete
59
+ Digest: sha256:f1169d1e7b3706fc60eb8b36299e6588e4f656cacfdaf9c5ff1c42fb2ca3034d
60
+ Status: Downloaded newer image for docker.pkg.github.com/impress-org/givewp/php-actions_composer_givewp:php-7.2-build2
61
+ docker.pkg.github.com/impress-org/givewp/php-actions_composer_givewp:php-7.2-build2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  Docker tag: docker.pkg.github.com/impress-org/givewp/php-actions_composer_givewp:php-7.2-build2
63
  No private keys supplied
64
  Command: composer install --no-progress --no-interaction
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: donation, fundraising, crowdfunding, givewp, give
5
  Requires at least: 4.9
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
- Stable tag: 2.11.1
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -232,6 +232,10 @@ The 2% fee on Stripe donations only applies to donations taken via our free Stri
232
 
233
  == Changelog ==
234
 
 
 
 
 
235
  = 2.11.1: May 24th, 2021 =
236
  * New: You can now enable billing details for PayPal Donations in Settings > Payment Gateways > PayPal
237
  * Fix: Donor Dashboard is *really* translatable this time. Honestly.
5
  Requires at least: 4.9
6
  Tested up to: 5.7
7
  Requires PHP: 5.6
8
+ Stable tag: 2.11.2
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
232
 
233
  == Changelog ==
234
 
235
+ = 2.11.2: June 8th, 2021 =
236
+ * Fix: Our new system for logging exceptions now handles critical errors better
237
+ * Fix: Uninstalling GiveWP no longer throws an exception
238
+
239
  = 2.11.1: May 24th, 2021 =
240
  * New: You can now enable billing details for PayPal Donations in Settings > Payment Gateways > PayPal
241
  * Fix: Donor Dashboard is *really* translatable this time. Honestly.
src/Framework/Exceptions/UncaughtExceptionLogger.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  namespace Give\Framework\Exceptions;
4
 
 
5
  use Exception;
6
  use Give\Framework\Exceptions\Contracts\LoggableException;
7
  use Give\Framework\Exceptions\Traits\Loggable;
@@ -29,11 +30,12 @@ class UncaughtExceptionLogger {
29
  /**
30
  * Handles an uncaught exception by checking if the Exception is native to GiveWP and then logging it if it is
31
  *
 
32
  * @since 2.11.1
33
  *
34
- * @param Exception $exception
35
  */
36
- public function handleException( Exception $exception ) {
37
  if ( $exception instanceof LoggableException ) {
38
  /** @var LoggableException|Loggable $exception */
39
  Log::error( $exception->getLogMessage(), $exception->getLogContext() );
2
 
3
  namespace Give\Framework\Exceptions;
4
 
5
+ use Error;
6
  use Exception;
7
  use Give\Framework\Exceptions\Contracts\LoggableException;
8
  use Give\Framework\Exceptions\Traits\Loggable;
30
  /**
31
  * Handles an uncaught exception by checking if the Exception is native to GiveWP and then logging it if it is
32
  *
33
+ * @since 2.11.2 remove parameter typing as it may be an Error
34
  * @since 2.11.1
35
  *
36
+ * @param Exception|Error $exception
37
  */
38
+ public function handleException( $exception ) {
39
  if ( $exception instanceof LoggableException ) {
40
  /** @var LoggableException|Loggable $exception */
41
  Log::error( $exception->getLogMessage(), $exception->getLogContext() );
uninstall.php CHANGED
@@ -3,10 +3,10 @@
3
  * Uninstall Give
4
  *
5
  * @package Give
6
- * @subpackage Uninstall
7
  * @copyright Copyright (c) 2016, GiveWP
8
  * @license https://opensource.org/licenses/gpl-license GNU Public License
9
- * @since 1.0
10
  */
11
 
12
  // Exit if accessed directly.
@@ -25,6 +25,9 @@ include_once( 'give.php' );
25
  */
26
  give()->init();
27
 
 
 
 
28
  global $wpdb, $wp_roles;
29
 
30
 
@@ -35,8 +38,11 @@ if ( give_is_setting_enabled( give_get_option( 'uninstall_on_delete' ) ) ) {
35
  $give_post_types = [ 'give_forms', 'give_payment' ];
36
  foreach ( $give_post_types as $post_type ) {
37
 
38
- $give_taxonomies = array_merge( $give_taxonomies, get_object_taxonomies( $post_type ) );
39
- $items = get_posts(
 
 
 
40
  [
41
  'post_type' => $post_type,
42
  'post_status' => 'any',
@@ -55,7 +61,19 @@ if ( give_is_setting_enabled( give_get_option( 'uninstall_on_delete' ) ) ) {
55
  // Delete All the Terms & Taxonomies.
56
  foreach ( array_unique( array_filter( $give_taxonomies ) ) as $taxonomy ) {
57
 
58
- $terms = $wpdb->get_results( $wpdb->prepare( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy ) );
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
  // Delete Terms.
61
  if ( $terms ) {
@@ -87,20 +105,9 @@ if ( give_is_setting_enabled( give_get_option( 'uninstall_on_delete' ) ) ) {
87
  remove_role( $role );
88
  }
89
 
90
- // Remove all database tables.
91
- $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}give_donors" );
92
- $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}give_donormeta" );
93
- $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}give_donationmeta" );
94
- $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}give_formmeta" );
95
- $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}give_comments" );
96
- $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}give_commentmeta" );
97
- $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}give_sequential_ordering" );
98
- $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}give_sessions" );
99
-
100
- // Remove tables which are supported with backward compatibility.
101
- $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}give_customers" );
102
- $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}give_customermeta" );
103
- $wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}give_paymentmeta" );
104
 
105
  // Cleanup Cron Events.
106
  wp_clear_scheduled_hook( 'give_daily_scheduled_events' );
@@ -111,7 +118,11 @@ if ( give_is_setting_enabled( give_get_option( 'uninstall_on_delete' ) ) ) {
111
  // Get all options.
112
  $give_option_names = $wpdb->get_col(
113
  $wpdb->prepare(
114
- "SELECT option_name FROM {$wpdb->options} where option_name LIKE '%%%s%%'",
 
 
 
 
115
  'give'
116
  )
117
  );
3
  * Uninstall Give
4
  *
5
  * @package Give
6
+ * @since 1.0
7
  * @copyright Copyright (c) 2016, GiveWP
8
  * @license https://opensource.org/licenses/gpl-license GNU Public License
9
+ * @subpackage Uninstall
10
  */
11
 
12
  // Exit if accessed directly.
25
  */
26
  give()->init();
27
 
28
+ // Prevent checking for plugin updates
29
+ remove_filter( 'pre_set_site_transient_update_plugins', 'give_check_addon_updates', 999 );
30
+
31
  global $wpdb, $wp_roles;
32
 
33
 
38
  $give_post_types = [ 'give_forms', 'give_payment' ];
39
  foreach ( $give_post_types as $post_type ) {
40
 
41
+ foreach ( get_object_taxonomies( $post_type ) as $taxonomy ) {
42
+ $give_taxonomies[] = $taxonomy;
43
+ }
44
+
45
+ $items = get_posts(
46
  [
47
  'post_type' => $post_type,
48
  'post_status' => 'any',
61
  // Delete All the Terms & Taxonomies.
62
  foreach ( array_unique( array_filter( $give_taxonomies ) ) as $taxonomy ) {
63
 
64
+ $terms = $wpdb->get_results(
65
+ $wpdb->prepare(
66
+ "
67
+ SELECT t.*, tt.*
68
+ FROM $wpdb->terms AS t
69
+ INNER JOIN $wpdb->term_taxonomy AS tt
70
+ ON t.term_id = tt.term_id
71
+ WHERE tt.taxonomy IN ('%s')
72
+ ORDER BY t.name ASC
73
+ ",
74
+ $taxonomy
75
+ )
76
+ );
77
 
78
  // Delete Terms.
79
  if ( $terms ) {
105
  remove_role( $role );
106
  }
107
 
108
+ // Remove all give database tables.
109
+ $give_tables = $wpdb->get_col( "SHOW TABLES LIKE '{$wpdb->prefix}give_%'" );
110
+ $wpdb->query( 'DROP TABLE ' . implode( ',', $give_tables ) );
 
 
 
 
 
 
 
 
 
 
 
111
 
112
  // Cleanup Cron Events.
113
  wp_clear_scheduled_hook( 'give_daily_scheduled_events' );
118
  // Get all options.
119
  $give_option_names = $wpdb->get_col(
120
  $wpdb->prepare(
121
+ "
122
+ SELECT option_name
123
+ FROM {$wpdb->options}
124
+ WHERE option_name LIKE '%%%s%%'
125
+ ",
126
  'give'
127
  )
128
  );
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit16093b8bf7c5fd5d0454285e938a9ac9::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit524d27a703974037f559cb4708b2d0ba::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -338,7 +338,7 @@ class ClassLoader
338
  * Loads the given class or interface.
339
  *
340
  * @param string $class The name of the class
341
- * @return bool|null True if loaded, null otherwise
342
  */
343
  public function loadClass($class)
344
  {
@@ -347,6 +347,8 @@ class ClassLoader
347
 
348
  return true;
349
  }
 
 
350
  }
351
 
352
  /**
338
  * Loads the given class or interface.
339
  *
340
  * @param string $class The name of the class
341
+ * @return true|null True if loaded, null otherwise
342
  */
343
  public function loadClass($class)
344
  {
347
 
348
  return true;
349
  }
350
+
351
+ return null;
352
  }
353
 
354
  /**
vendor/composer/InstalledVersions.php CHANGED
@@ -1,399 +1,337 @@
1
  <?php
2
 
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
 
13
  namespace Composer;
14
 
15
  use Composer\Autoload\ClassLoader;
16
  use Composer\Semver\VersionParser;
17
 
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
  class InstalledVersions
26
  {
27
- private static $installed = array (
28
- 'root' =>
29
- array (
30
- 'pretty_version' => '2.11.1',
31
- 'version' => '2.11.1.0',
32
- 'aliases' =>
33
- array (
34
- ),
35
- 'reference' => '6aadab82502cede4fbf7878c72e5f9a0f03c0ff9',
36
- 'name' => 'impress-org/give',
37
- ),
38
- 'versions' =>
39
- array (
40
- 'composer/installers' =>
41
- array (
42
- 'pretty_version' => 'v1.10.0',
43
- 'version' => '1.10.0.0',
44
- 'aliases' =>
45
- array (
46
- ),
47
- 'reference' => '1a0357fccad9d1cc1ea0c9a05b8847fbccccb78d',
48
- ),
49
- 'ergebnis/faker' =>
50
- array (
51
- 'replaced' =>
52
- array (
53
- 0 => '1.9.2',
54
- ),
55
- ),
56
- 'fakerphp/faker' =>
57
- array (
58
- 'pretty_version' => 'v1.9.2',
59
- 'version' => '1.9.2.0',
60
- 'aliases' =>
61
- array (
62
- ),
63
- 'reference' => '84220cf137a9344acffb10374e781fed785ff307',
64
- ),
65
- 'fzaninotto/faker' =>
66
- array (
67
- 'replaced' =>
68
- array (
69
- 0 => '1.9.2',
70
- ),
71
- ),
72
- 'impress-org/give' =>
73
- array (
74
- 'pretty_version' => '2.11.1',
75
- 'version' => '2.11.1.0',
76
- 'aliases' =>
77
- array (
78
- ),
79
- 'reference' => '6aadab82502cede4fbf7878c72e5f9a0f03c0ff9',
80
- ),
81
- 'kjohnson/format-object-list' =>
82
- array (
83
- 'pretty_version' => '0.1.0',
84
- 'version' => '0.1.0.0',
85
- 'aliases' =>
86
- array (
87
- ),
88
- 'reference' => 'aaf83123acbe4551379498345fea538f536f16f0',
89
- ),
90
- 'myclabs/php-enum' =>
91
- array (
92
- 'pretty_version' => '1.6.6',
93
- 'version' => '1.6.6.0',
94
- 'aliases' =>
95
- array (
96
- ),
97
- 'reference' => '32c4202886c51fbe5cc3a7c34ec5c9a4a790345e',
98
- ),
99
- 'paypal/paypal-checkout-sdk' =>
100
- array (
101
- 'pretty_version' => '1.0.1',
102
- 'version' => '1.0.1.0',
103
- 'aliases' =>
104
- array (
105
- ),
106
- 'reference' => 'ed6a55075448308b87a8b59dcb7fedf04a048cb1',
107
- ),
108
- 'paypal/paypalhttp' =>
109
- array (
110
- 'pretty_version' => '1.0.0',
111
- 'version' => '1.0.0.0',
112
- 'aliases' =>
113
- array (
114
- ),
115
- 'reference' => '1ad9b846a046f09d6135cbf2cbaa7701bbc630a3',
116
- ),
117
- 'roundcube/plugin-installer' =>
118
- array (
119
- 'replaced' =>
120
- array (
121
- 0 => '*',
122
- ),
123
- ),
124
- 'shama/baton' =>
125
- array (
126
- 'replaced' =>
127
- array (
128
- 0 => '*',
129
- ),
130
- ),
131
- 'stripe/stripe-php' =>
132
- array (
133
- 'pretty_version' => 'v6.43.1',
134
- 'version' => '6.43.1.0',
135
- 'aliases' =>
136
- array (
137
- ),
138
- 'reference' => '42fcdaf99c44bb26937223f8eae1f263491d5ab8',
139
- ),
140
- 'tecnickcom/tcpdf' =>
141
- array (
142
- 'pretty_version' => '6.4.1',
143
- 'version' => '6.4.1.0',
144
- 'aliases' =>
145
- array (
146
- ),
147
- 'reference' => '5ba838befdb37ef06a16d9f716f35eb03cb1b329',
148
- ),
149
- ),
150
- );
151
- private static $canGetVendors;
152
- private static $installedByVendor = array();
153
-
154
-
155
-
156
-
157
-
158
-
159
-
160
- public static function getInstalledPackages()
161
- {
162
- $packages = array();
163
- foreach (self::getInstalled() as $installed) {
164
- $packages[] = array_keys($installed['versions']);
165
- }
166
-
167
- if (1 === \count($packages)) {
168
- return $packages[0];
169
- }
170
-
171
- return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
172
- }
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
- public static function isInstalled($packageName)
183
- {
184
- foreach (self::getInstalled() as $installed) {
185
- if (isset($installed['versions'][$packageName])) {
186
- return true;
187
- }
188
- }
189
-
190
- return false;
191
- }
192
-
193
-
194
-
195
-
196
-
197
-
198
-
199
-
200
-
201
-
202
-
203
-
204
-
205
-
206
- public static function satisfies(VersionParser $parser, $packageName, $constraint)
207
- {
208
- $constraint = $parser->parseConstraints($constraint);
209
- $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
210
-
211
- return $provided->matches($constraint);
212
- }
213
-
214
-
215
-
216
-
217
-
218
-
219
-
220
-
221
-
222
-
223
- public static function getVersionRanges($packageName)
224
- {
225
- foreach (self::getInstalled() as $installed) {
226
- if (!isset($installed['versions'][$packageName])) {
227
- continue;
228
- }
229
-
230
- $ranges = array();
231
- if (isset($installed['versions'][$packageName]['pretty_version'])) {
232
- $ranges[] = $installed['versions'][$packageName]['pretty_version'];
233
- }
234
- if (array_key_exists('aliases', $installed['versions'][$packageName])) {
235
- $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
236
- }
237
- if (array_key_exists('replaced', $installed['versions'][$packageName])) {
238
- $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
239
- }
240
- if (array_key_exists('provided', $installed['versions'][$packageName])) {
241
- $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
242
- }
243
-
244
- return implode(' || ', $ranges);
245
- }
246
-
247
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
248
- }
249
-
250
-
251
-
252
-
253
-
254
- public static function getVersion($packageName)
255
- {
256
- foreach (self::getInstalled() as $installed) {
257
- if (!isset($installed['versions'][$packageName])) {
258
- continue;
259
- }
260
-
261
- if (!isset($installed['versions'][$packageName]['version'])) {
262
- return null;
263
- }
264
-
265
- return $installed['versions'][$packageName]['version'];
266
- }
267
-
268
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
269
- }
270
-
271
-
272
-
273
-
274
-
275
- public static function getPrettyVersion($packageName)
276
- {
277
- foreach (self::getInstalled() as $installed) {
278
- if (!isset($installed['versions'][$packageName])) {
279
- continue;
280
- }
281
-
282
- if (!isset($installed['versions'][$packageName]['pretty_version'])) {
283
- return null;
284
- }
285
-
286
- return $installed['versions'][$packageName]['pretty_version'];
287
- }
288
-
289
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
290
- }
291
-
292
-
293
-
294
-
295
-
296
- public static function getReference($packageName)
297
- {
298
- foreach (self::getInstalled() as $installed) {
299
- if (!isset($installed['versions'][$packageName])) {
300
- continue;
301
- }
302
-
303
- if (!isset($installed['versions'][$packageName]['reference'])) {
304
- return null;
305
- }
306
-
307
- return $installed['versions'][$packageName]['reference'];
308
- }
309
-
310
- throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
311
- }
312
-
313
-
314
-
315
-
316
-
317
- public static function getRootPackage()
318
- {
319
- $installed = self::getInstalled();
320
-
321
- return $installed[0]['root'];
322
- }
323
-
324
-
325
-
326
-
327
-
328
-
329
-
330
-
331
- public static function getRawData()
332
- {
333
- @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
334
-
335
- return self::$installed;
336
- }
337
-
338
-
339
-
340
-
341
-
342
-
343
-
344
- public static function getAllRawData()
345
- {
346
- return self::getInstalled();
347
- }
348
-
349
-
350
-
351
-
352
-
353
-
354
-
355
-
356
-
357
-
358
-
359
-
360
-
361
-
362
-
363
-
364
-
365
-
366
-
367
- public static function reload($data)
368
- {
369
- self::$installed = $data;
370
- self::$installedByVendor = array();
371
- }
372
-
373
-
374
-
375
-
376
-
377
- private static function getInstalled()
378
- {
379
- if (null === self::$canGetVendors) {
380
- self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
381
- }
382
-
383
- $installed = array();
384
-
385
- if (self::$canGetVendors) {
386
- foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
387
- if (isset(self::$installedByVendor[$vendorDir])) {
388
- $installed[] = self::$installedByVendor[$vendorDir];
389
- } elseif (is_file($vendorDir.'/composer/installed.php')) {
390
- $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
391
- }
392
- }
393
- }
394
-
395
- $installed[] = self::$installed;
396
-
397
- return $installed;
398
- }
399
  }
1
  <?php
2
 
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
 
13
  namespace Composer;
14
 
15
  use Composer\Autoload\ClassLoader;
16
  use Composer\Semver\VersionParser;
17
 
18
+ /**
19
+ * This class is copied in every Composer installed project and available to all
20
+ *
21
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
22
+ *
23
+ * To require it's presence, you can require `composer-runtime-api ^2.0`
24
+ */
25
  class InstalledVersions
26
  {
27
+ private static $installed;
28
+ private static $canGetVendors;
29
+ private static $installedByVendor = array();
30
+
31
+ /**
32
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
33
+ *
34
+ * @return string[]
35
+ * @psalm-return list<string>
36
+ */
37
+ public static function getInstalledPackages()
38
+ {
39
+ $packages = array();
40
+ foreach (self::getInstalled() as $installed) {
41
+ $packages[] = array_keys($installed['versions']);
42
+ }
43
+
44
+ if (1 === \count($packages)) {
45
+ return $packages[0];
46
+ }
47
+
48
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
49
+ }
50
+
51
+ /**
52
+ * Returns a list of all package names with a specific type e.g. 'library'
53
+ *
54
+ * @param string $type
55
+ * @return string[]
56
+ * @psalm-return list<string>
57
+ */
58
+ public static function getInstalledPackagesByType($type)
59
+ {
60
+ $packagesByType = array();
61
+
62
+ foreach (self::getInstalled() as $installed) {
63
+ foreach ($installed['versions'] as $name => $package) {
64
+ if (isset($package['type']) && $package['type'] === $type) {
65
+ $packagesByType[] = $name;
66
+ }
67
+ }
68
+ }
69
+
70
+ return $packagesByType;
71
+ }
72
+
73
+ /**
74
+ * Checks whether the given package is installed
75
+ *
76
+ * This also returns true if the package name is provided or replaced by another package
77
+ *
78
+ * @param string $packageName
79
+ * @param bool $includeDevRequirements
80
+ * @return bool
81
+ */
82
+ public static function isInstalled($packageName, $includeDevRequirements = true)
83
+ {
84
+ foreach (self::getInstalled() as $installed) {
85
+ if (isset($installed['versions'][$packageName])) {
86
+ return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
87
+ }
88
+ }
89
+
90
+ return false;
91
+ }
92
+
93
+ /**
94
+ * Checks whether the given package satisfies a version constraint
95
+ *
96
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
97
+ *
98
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
99
+ *
100
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
101
+ * @param string $packageName
102
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
103
+ * @return bool
104
+ */
105
+ public static function satisfies(VersionParser $parser, $packageName, $constraint)
106
+ {
107
+ $constraint = $parser->parseConstraints($constraint);
108
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
109
+
110
+ return $provided->matches($constraint);
111
+ }
112
+
113
+ /**
114
+ * Returns a version constraint representing all the range(s) which are installed for a given package
115
+ *
116
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
117
+ * whether a given version of a package is installed, and not just whether it exists
118
+ *
119
+ * @param string $packageName
120
+ * @return string Version constraint usable with composer/semver
121
+ */
122
+ public static function getVersionRanges($packageName)
123
+ {
124
+ foreach (self::getInstalled() as $installed) {
125
+ if (!isset($installed['versions'][$packageName])) {
126
+ continue;
127
+ }
128
+
129
+ $ranges = array();
130
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
131
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
132
+ }
133
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
134
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
135
+ }
136
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
137
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
138
+ }
139
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
140
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
141
+ }
142
+
143
+ return implode(' || ', $ranges);
144
+ }
145
+
146
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
147
+ }
148
+
149
+ /**
150
+ * @param string $packageName
151
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
152
+ */
153
+ public static function getVersion($packageName)
154
+ {
155
+ foreach (self::getInstalled() as $installed) {
156
+ if (!isset($installed['versions'][$packageName])) {
157
+ continue;
158
+ }
159
+
160
+ if (!isset($installed['versions'][$packageName]['version'])) {
161
+ return null;
162
+ }
163
+
164
+ return $installed['versions'][$packageName]['version'];
165
+ }
166
+
167
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
168
+ }
169
+
170
+ /**
171
+ * @param string $packageName
172
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
173
+ */
174
+ public static function getPrettyVersion($packageName)
175
+ {
176
+ foreach (self::getInstalled() as $installed) {
177
+ if (!isset($installed['versions'][$packageName])) {
178
+ continue;
179
+ }
180
+
181
+ if (!isset($installed['versions'][$packageName]['pretty_version'])) {
182
+ return null;
183
+ }
184
+
185
+ return $installed['versions'][$packageName]['pretty_version'];
186
+ }
187
+
188
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
189
+ }
190
+
191
+ /**
192
+ * @param string $packageName
193
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
194
+ */
195
+ public static function getReference($packageName)
196
+ {
197
+ foreach (self::getInstalled() as $installed) {
198
+ if (!isset($installed['versions'][$packageName])) {
199
+ continue;
200
+ }
201
+
202
+ if (!isset($installed['versions'][$packageName]['reference'])) {
203
+ return null;
204
+ }
205
+
206
+ return $installed['versions'][$packageName]['reference'];
207
+ }
208
+
209
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
210
+ }
211
+
212
+ /**
213
+ * @param string $packageName
214
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
215
+ */
216
+ public static function getInstallPath($packageName)
217
+ {
218
+ foreach (self::getInstalled() as $installed) {
219
+ if (!isset($installed['versions'][$packageName])) {
220
+ continue;
221
+ }
222
+
223
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
224
+ }
225
+
226
+ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
227
+ }
228
+
229
+ /**
230
+ * @return array
231
+ * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
232
+ */
233
+ public static function getRootPackage()
234
+ {
235
+ $installed = self::getInstalled();
236
+
237
+ return $installed[0]['root'];
238
+ }
239
+
240
+ /**
241
+ * Returns the raw installed.php data for custom implementations
242
+ *
243
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
244
+ * @return array[]
245
+ * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
246
+ */
247
+ public static function getRawData()
248
+ {
249
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
250
+
251
+ if (null === self::$installed) {
252
+ // only require the installed.php file if this file is loaded from its dumped location,
253
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
254
+ if (substr(__DIR__, -8, 1) !== 'C') {
255
+ self::$installed = include __DIR__ . '/installed.php';
256
+ } else {
257
+ self::$installed = array();
258
+ }
259
+ }
260
+
261
+ return self::$installed;
262
+ }
263
+
264
+ /**
265
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
266
+ *
267
+ * @return array[]
268
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
269
+ */
270
+ public static function getAllRawData()
271
+ {
272
+ return self::getInstalled();
273
+ }
274
+
275
+ /**
276
+ * Lets you reload the static array from another file
277
+ *
278
+ * This is only useful for complex integrations in which a project needs to use
279
+ * this class but then also needs to execute another project's autoloader in process,
280
+ * and wants to ensure both projects have access to their version of installed.php.
281
+ *
282
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
283
+ * the data it needs from this class, then call reload() with
284
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
285
+ * the project in which it runs can then also use this class safely, without
286
+ * interference between PHPUnit's dependencies and the project's dependencies.
287
+ *
288
+ * @param array[] $data A vendor/composer/installed.php data set
289
+ * @return void
290
+ *
291
+ * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
292
+ */
293
+ public static function reload($data)
294
+ {
295
+ self::$installed = $data;
296
+ self::$installedByVendor = array();
297
+ }
298
+
299
+ /**
300
+ * @return array[]
301
+ * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
302
+ */
303
+ private static function getInstalled()
304
+ {
305
+ if (null === self::$canGetVendors) {
306
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
307
+ }
308
+
309
+ $installed = array();
310
+
311
+ if (self::$canGetVendors) {
312
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
313
+ if (isset(self::$installedByVendor[$vendorDir])) {
314
+ $installed[] = self::$installedByVendor[$vendorDir];
315
+ } elseif (is_file($vendorDir.'/composer/installed.php')) {
316
+ $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
317
+ if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
318
+ self::$installed = $installed[count($installed) - 1];
319
+ }
320
+ }
321
+ }
322
+ }
323
+
324
+ if (null === self::$installed) {
325
+ // only require the installed.php file if this file is loaded from its dumped location,
326
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
327
+ if (substr(__DIR__, -8, 1) !== 'C') {
328
+ self::$installed = require __DIR__ . '/installed.php';
329
+ } else {
330
+ self::$installed = array();
331
+ }
332
+ }
333
+ $installed[] = self::$installed;
334
+
335
+ return $installed;
336
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  }
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit16093b8bf7c5fd5d0454285e938a9ac9
6
  {
7
  private static $loader;
8
 
@@ -24,15 +24,15 @@ class ComposerAutoloaderInit16093b8bf7c5fd5d0454285e938a9ac9
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInit16093b8bf7c5fd5d0454285e938a9ac9', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
- spl_autoload_unregister(array('ComposerAutoloaderInit16093b8bf7c5fd5d0454285e938a9ac9', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
- call_user_func(\Composer\Autoload\ComposerStaticInit16093b8bf7c5fd5d0454285e938a9ac9::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit524d27a703974037f559cb4708b2d0ba
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInit524d27a703974037f559cb4708b2d0ba', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit524d27a703974037f559cb4708b2d0ba', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
+ call_user_func(\Composer\Autoload\ComposerStaticInit524d27a703974037f559cb4708b2d0ba::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit16093b8bf7c5fd5d0454285e938a9ac9
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'S' =>
@@ -96,9 +96,9 @@ class ComposerStaticInit16093b8bf7c5fd5d0454285e938a9ac9
96
  public static function getInitializer(ClassLoader $loader)
97
  {
98
  return \Closure::bind(function () use ($loader) {
99
- $loader->prefixLengthsPsr4 = ComposerStaticInit16093b8bf7c5fd5d0454285e938a9ac9::$prefixLengthsPsr4;
100
- $loader->prefixDirsPsr4 = ComposerStaticInit16093b8bf7c5fd5d0454285e938a9ac9::$prefixDirsPsr4;
101
- $loader->classMap = ComposerStaticInit16093b8bf7c5fd5d0454285e938a9ac9::$classMap;
102
 
103
  }, null, ClassLoader::class);
104
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit524d27a703974037f559cb4708b2d0ba
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'S' =>
96
  public static function getInitializer(ClassLoader $loader)
97
  {
98
  return \Closure::bind(function () use ($loader) {
99
+ $loader->prefixLengthsPsr4 = ComposerStaticInit524d27a703974037f559cb4708b2d0ba::$prefixLengthsPsr4;
100
+ $loader->prefixDirsPsr4 = ComposerStaticInit524d27a703974037f559cb4708b2d0ba::$prefixDirsPsr4;
101
+ $loader->classMap = ComposerStaticInit524d27a703974037f559cb4708b2d0ba::$classMap;
102
 
103
  }, null, ClassLoader::class);
104
  }
vendor/composer/installed.php CHANGED
@@ -1,124 +1,119 @@
1
- <?php return array (
2
- 'root' =>
3
- array (
4
- 'pretty_version' => '2.11.1',
5
- 'version' => '2.11.1.0',
6
- 'aliases' =>
7
- array (
 
 
 
8
  ),
9
- 'reference' => '6aadab82502cede4fbf7878c72e5f9a0f03c0ff9',
10
- 'name' => 'impress-org/give',
11
- ),
12
- 'versions' =>
13
- array (
14
- 'composer/installers' =>
15
- array (
16
- 'pretty_version' => 'v1.10.0',
17
- 'version' => '1.10.0.0',
18
- 'aliases' =>
19
- array (
20
- ),
21
- 'reference' => '1a0357fccad9d1cc1ea0c9a05b8847fbccccb78d',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  ),
23
- 'ergebnis/faker' =>
24
- array (
25
- 'replaced' =>
26
- array (
27
- 0 => '1.9.2',
28
- ),
29
- ),
30
- 'fakerphp/faker' =>
31
- array (
32
- 'pretty_version' => 'v1.9.2',
33
- 'version' => '1.9.2.0',
34
- 'aliases' =>
35
- array (
36
- ),
37
- 'reference' => '84220cf137a9344acffb10374e781fed785ff307',
38
- ),
39
- 'fzaninotto/faker' =>
40
- array (
41
- 'replaced' =>
42
- array (
43
- 0 => '1.9.2',
44
- ),
45
- ),
46
- 'impress-org/give' =>
47
- array (
48
- 'pretty_version' => '2.11.1',
49
- 'version' => '2.11.1.0',
50
- 'aliases' =>
51
- array (
52
- ),
53
- 'reference' => '6aadab82502cede4fbf7878c72e5f9a0f03c0ff9',
54
- ),
55
- 'kjohnson/format-object-list' =>
56
- array (
57
- 'pretty_version' => '0.1.0',
58
- 'version' => '0.1.0.0',
59
- 'aliases' =>
60
- array (
61
- ),
62
- 'reference' => 'aaf83123acbe4551379498345fea538f536f16f0',
63
- ),
64
- 'myclabs/php-enum' =>
65
- array (
66
- 'pretty_version' => '1.6.6',
67
- 'version' => '1.6.6.0',
68
- 'aliases' =>
69
- array (
70
- ),
71
- 'reference' => '32c4202886c51fbe5cc3a7c34ec5c9a4a790345e',
72
- ),
73
- 'paypal/paypal-checkout-sdk' =>
74
- array (
75
- 'pretty_version' => '1.0.1',
76
- 'version' => '1.0.1.0',
77
- 'aliases' =>
78
- array (
79
- ),
80
- 'reference' => 'ed6a55075448308b87a8b59dcb7fedf04a048cb1',
81
- ),
82
- 'paypal/paypalhttp' =>
83
- array (
84
- 'pretty_version' => '1.0.0',
85
- 'version' => '1.0.0.0',
86
- 'aliases' =>
87
- array (
88
- ),
89
- 'reference' => '1ad9b846a046f09d6135cbf2cbaa7701bbc630a3',
90
- ),
91
- 'roundcube/plugin-installer' =>
92
- array (
93
- 'replaced' =>
94
- array (
95
- 0 => '*',
96
- ),
97
- ),
98
- 'shama/baton' =>
99
- array (
100
- 'replaced' =>
101
- array (
102
- 0 => '*',
103
- ),
104
- ),
105
- 'stripe/stripe-php' =>
106
- array (
107
- 'pretty_version' => 'v6.43.1',
108
- 'version' => '6.43.1.0',
109
- 'aliases' =>
110
- array (
111
- ),
112
- 'reference' => '42fcdaf99c44bb26937223f8eae1f263491d5ab8',
113
- ),
114
- 'tecnickcom/tcpdf' =>
115
- array (
116
- 'pretty_version' => '6.4.1',
117
- 'version' => '6.4.1.0',
118
- 'aliases' =>
119
- array (
120
- ),
121
- 'reference' => '5ba838befdb37ef06a16d9f716f35eb03cb1b329',
122
- ),
123
- ),
124
  );
1
+ <?php return array(
2
+ 'root' => array(
3
+ 'pretty_version' => '2.11.2',
4
+ 'version' => '2.11.2.0',
5
+ 'type' => 'wordpress-plugin',
6
+ 'install_path' => __DIR__ . '/../../',
7
+ 'aliases' => array(),
8
+ 'reference' => 'c244c4643d630f0c6f4d0a9c67d70ee49a238c17',
9
+ 'name' => 'impress-org/give',
10
+ 'dev' => false,
11
  ),
12
+ 'versions' => array(
13
+ 'composer/installers' => array(
14
+ 'pretty_version' => 'v1.10.0',
15
+ 'version' => '1.10.0.0',
16
+ 'type' => 'composer-plugin',
17
+ 'install_path' => __DIR__ . '/./installers',
18
+ 'aliases' => array(),
19
+ 'reference' => '1a0357fccad9d1cc1ea0c9a05b8847fbccccb78d',
20
+ 'dev_requirement' => false,
21
+ ),
22
+ 'ergebnis/faker' => array(
23
+ 'dev_requirement' => false,
24
+ 'replaced' => array(
25
+ 0 => '1.9.2',
26
+ ),
27
+ ),
28
+ 'fakerphp/faker' => array(
29
+ 'pretty_version' => 'v1.9.2',
30
+ 'version' => '1.9.2.0',
31
+ 'type' => 'library',
32
+ 'install_path' => __DIR__ . '/../fakerphp/faker',
33
+ 'aliases' => array(),
34
+ 'reference' => '84220cf137a9344acffb10374e781fed785ff307',
35
+ 'dev_requirement' => false,
36
+ ),
37
+ 'fzaninotto/faker' => array(
38
+ 'dev_requirement' => false,
39
+ 'replaced' => array(
40
+ 0 => '1.9.2',
41
+ ),
42
+ ),
43
+ 'impress-org/give' => array(
44
+ 'pretty_version' => '2.11.2',
45
+ 'version' => '2.11.2.0',
46
+ 'type' => 'wordpress-plugin',
47
+ 'install_path' => __DIR__ . '/../../',
48
+ 'aliases' => array(),
49
+ 'reference' => 'c244c4643d630f0c6f4d0a9c67d70ee49a238c17',
50
+ 'dev_requirement' => false,
51
+ ),
52
+ 'kjohnson/format-object-list' => array(
53
+ 'pretty_version' => '0.1.0',
54
+ 'version' => '0.1.0.0',
55
+ 'type' => 'library',
56
+ 'install_path' => __DIR__ . '/../kjohnson/format-object-list',
57
+ 'aliases' => array(),
58
+ 'reference' => 'aaf83123acbe4551379498345fea538f536f16f0',
59
+ 'dev_requirement' => false,
60
+ ),
61
+ 'myclabs/php-enum' => array(
62
+ 'pretty_version' => '1.6.6',
63
+ 'version' => '1.6.6.0',
64
+ 'type' => 'library',
65
+ 'install_path' => __DIR__ . '/../myclabs/php-enum',
66
+ 'aliases' => array(),
67
+ 'reference' => '32c4202886c51fbe5cc3a7c34ec5c9a4a790345e',
68
+ 'dev_requirement' => false,
69
+ ),
70
+ 'paypal/paypal-checkout-sdk' => array(
71
+ 'pretty_version' => '1.0.1',
72
+ 'version' => '1.0.1.0',
73
+ 'type' => 'library',
74
+ 'install_path' => __DIR__ . '/../paypal/paypal-checkout-sdk',
75
+ 'aliases' => array(),
76
+ 'reference' => 'ed6a55075448308b87a8b59dcb7fedf04a048cb1',
77
+ 'dev_requirement' => false,
78
+ ),
79
+ 'paypal/paypalhttp' => array(
80
+ 'pretty_version' => '1.0.0',
81
+ 'version' => '1.0.0.0',
82
+ 'type' => 'library',
83
+ 'install_path' => __DIR__ . '/../paypal/paypalhttp',
84
+ 'aliases' => array(),
85
+ 'reference' => '1ad9b846a046f09d6135cbf2cbaa7701bbc630a3',
86
+ 'dev_requirement' => false,
87
+ ),
88
+ 'roundcube/plugin-installer' => array(
89
+ 'dev_requirement' => false,
90
+ 'replaced' => array(
91
+ 0 => '*',
92
+ ),
93
+ ),
94
+ 'shama/baton' => array(
95
+ 'dev_requirement' => false,
96
+ 'replaced' => array(
97
+ 0 => '*',
98
+ ),
99
+ ),
100
+ 'stripe/stripe-php' => array(
101
+ 'pretty_version' => 'v6.43.1',
102
+ 'version' => '6.43.1.0',
103
+ 'type' => 'library',
104
+ 'install_path' => __DIR__ . '/../stripe/stripe-php',
105
+ 'aliases' => array(),
106
+ 'reference' => '42fcdaf99c44bb26937223f8eae1f263491d5ab8',
107
+ 'dev_requirement' => false,
108
+ ),
109
+ 'tecnickcom/tcpdf' => array(
110
+ 'pretty_version' => '6.4.1',
111
+ 'version' => '6.4.1.0',
112
+ 'type' => 'library',
113
+ 'install_path' => __DIR__ . '/../tecnickcom/tcpdf',
114
+ 'aliases' => array(),
115
+ 'reference' => '5ba838befdb37ef06a16d9f716f35eb03cb1b329',
116
+ 'dev_requirement' => false,
117
+ ),
118
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  );