This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /** |
||
4 | * Offline donation instruction setting backward compatibility. |
||
5 | * |
||
6 | * @since 2.0 |
||
7 | * |
||
8 | * @param string $notification_status |
||
9 | * @param Give_Email_Notification $email |
||
10 | * @param int $form_id |
||
11 | * |
||
12 | * @return string |
||
13 | */ |
||
14 | View Code Duplication | function _give_bc_offline_donation_instruction_notification_status( $notification_status, $email, $form_id ) { |
|
0 ignored issues
–
show
This function seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
15 | // Bailout. |
||
16 | if ( ! $form_id ) { |
||
17 | return $notification_status; |
||
18 | } |
||
19 | |||
20 | if ( ! get_post_meta( $form_id, '_give_offline-donation-instruction_notification', true ) ) { |
||
21 | $old_value = get_post_meta( $form_id, '_give_customize_offline_donations', true ); |
||
22 | $notification_status = give_is_setting_enabled( $old_value, array( 'enabled', 'global' ) ) |
||
0 ignored issues
–
show
array('enabled', 'global') is of type array<integer,string,{"0":"string","1":"string"}> , but the function expects a string|null .
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
![]() |
|||
23 | ? $old_value |
||
24 | : 'global'; |
||
25 | } |
||
26 | |||
0 ignored issues
–
show
|
|||
27 | |||
28 | return $notification_status; |
||
29 | } |
||
30 | |||
31 | add_filter( 'give__give_offline-donation-instruction_get_notification_status', '_give_bc_offline_donation_instruction_notification_status', 10, 3 ); |
||
32 | |||
33 | |||
34 | /** |
||
35 | * Offline donation instruction setting backward compatibility. |
||
36 | * |
||
37 | * @since 2.0 |
||
38 | * |
||
39 | * @param mixed $option_value |
||
40 | * @param string $option_name |
||
41 | * @param Give_Email_Notification $email |
||
42 | * @param int $form_id |
||
43 | * |
||
44 | * @return mixed |
||
45 | */ |
||
46 | function _give_bc_offline_donation_instruction_email_setting_values( $option_value, $option_name, $email, $form_id ) { |
||
47 | // Bailout. |
||
48 | if ( empty( $form_id ) || 'offline-donation-instruction' !== $email->config['id'] ) { |
||
49 | return $option_value; |
||
50 | } |
||
51 | |||
52 | switch ( $option_name ) { |
||
53 | View Code Duplication | case '_give_offline-donation-instruction_email_message': |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
54 | if ( ! get_post_meta( $form_id, $option_name, true ) && give_is_setting_enabled( $email->get_notification_status( $form_id ) ) ) { |
||
55 | $option_value = get_post_meta( $form_id, '_give_offline_donation_email', true ); |
||
56 | } |
||
57 | break; |
||
58 | |||
59 | View Code Duplication | case '_give_offline-donation-instruction_email_subject': |
|
0 ignored issues
–
show
This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
60 | if ( ! get_post_meta( $form_id, $option_name, true ) && give_is_setting_enabled( $email->get_notification_status( $form_id ) ) ) { |
||
61 | $option_value = get_post_meta( $form_id, '_give_offline_donation_subject', true ); |
||
62 | } |
||
63 | break; |
||
64 | } |
||
65 | |||
66 | return $option_value; |
||
67 | } |
||
68 | |||
69 | add_filter( 'give_email_setting_value', '_give_bc_offline_donation_instruction_email_setting_values', 10, 4 ); |
||
70 | |||
71 | |||
72 | /** |
||
73 | * Offline donation instruction setting for form metabox setting |
||
74 | * |
||
75 | * @since 2.0 |
||
76 | * |
||
77 | * @param $field_value |
||
78 | * @param $field |
||
79 | * @param $form_id |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | View Code Duplication | function _give_bc_offline_instruction_status_setting_value( $field_value, $field, $form_id ) { |
|
0 ignored issues
–
show
This function seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
84 | if ( ! get_post_meta( $form_id, $field['id'], true ) ) { |
||
85 | $old_value = get_post_meta( $form_id, '_give_customize_offline_donations', true ); |
||
86 | $field_value = give_is_setting_enabled( $old_value, array( 'enabled', 'global' ) ) |
||
0 ignored issues
–
show
array('enabled', 'global') is of type array<integer,string,{"0":"string","1":"string"}> , but the function expects a string|null .
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
![]() |
|||
87 | ? $old_value |
||
88 | : 'global'; |
||
89 | } |
||
90 | |||
91 | return $field_value; |
||
92 | } |
||
93 | |||
94 | add_filter( '_give_offline-donation-instruction_notification_field_value', '_give_bc_offline_instruction_status_setting_value', 10, 3 ); |
||
95 | |||
96 | |||
97 | /** |
||
98 | * Offline donation instruction setting for form metabox setting |
||
99 | * |
||
100 | * @since 2.0 |
||
101 | * |
||
102 | * @param $field_value |
||
103 | * @param $field |
||
104 | * @param $form_id |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | View Code Duplication | function _offline_donation_instruction_email_subject_setting_value( $field_value, $field, $form_id ) { |
|
0 ignored issues
–
show
This function seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
109 | if ( ! get_post_meta( $form_id, $field['id'], true ) ) { |
||
110 | $field_value = get_post_meta( $form_id, '_give_offline_donation_subject', true ); |
||
111 | } |
||
112 | |||
113 | return $field_value; |
||
114 | } |
||
115 | |||
116 | add_filter( '_give_offline-donation-instruction_email_subject_field_value', '_offline_donation_instruction_email_subject_setting_value', 10, 3 ); |
||
117 | |||
118 | |||
119 | /** |
||
120 | * Offline donation instruction setting for form metabox setting |
||
121 | * |
||
122 | * @since 2.0 |
||
123 | * |
||
124 | * @param $field_value |
||
125 | * @param $field |
||
126 | * @param $form_id |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | View Code Duplication | function _give_bc_offline_donation_instruction_email_message_setting_value( $field_value, $field, $form_id ) { |
|
0 ignored issues
–
show
This function seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
131 | if ( ! get_post_meta( $form_id, $field['id'], true ) ) { |
||
132 | $field_value = get_post_meta( $form_id, '_give_offline_donation_email', true ); |
||
133 | } |
||
134 | |||
135 | return $field_value; |
||
136 | } |
||
137 | |||
138 | add_filter( '_give_offline-donation-instruction_email_message_field_value', '_give_bc_offline_donation_instruction_email_message_setting_value', 10, 3 ); |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.