Conditions | 1 |
Paths | 1 |
Total Lines | 53 |
Code Lines | 37 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
78 | public function getForm() |
||
79 | { |
||
80 | return new \EE_Form_Section_Proper( |
||
81 | array( |
||
82 | 'name' => 'invalid_checkout_access', |
||
83 | 'html_id' => 'invalid_checkout_access', |
||
84 | 'layout_strategy' => new \EE_Admin_Two_Column_Layout(), |
||
85 | 'subsections' => array( |
||
86 | 'invalid_checkout_access_hdr' => new \EE_Form_Section_HTML( |
||
87 | \EEH_HTML::h2(esc_html__('Invalid Checkout Access', 'event_espresso')) |
||
88 | ), |
||
89 | 'ee_bot_checkout_data' => new \EE_Text_Area_Input( |
||
90 | array( |
||
91 | 'html_label_text' => esc_html__('Invalid Checkout Data', 'event_espresso'), |
||
92 | 'default' => var_export( |
||
93 | get_option(InvalidCheckoutAccess::OPTION_KEY, array()), |
||
94 | true |
||
95 | ), |
||
96 | 'required' => false, |
||
97 | 'html_help_text' => esc_html__( |
||
98 | 'Event Espresso blocks any attempt to directly access the registration checkout page, that is NOT from a Ticket Selector or for a return visit for a valid transaction. These are not valid requests accessing your checkout page, so we track the IP addresses, what web page they just came from, and the number of times that they have attempted to access your registration page. This information may help you with protecting your site by other means, such as firewalls, etc, but please note that IP addresses are almost guaranteed to be spoofed by malicious agents.', |
||
99 | 'event_espresso' |
||
100 | ), |
||
101 | ) |
||
102 | ), |
||
103 | 'track_invalid_checkout_access' => new \EE_Yes_No_Input( |
||
104 | array( |
||
105 | 'html_label_text' => __('Track Invalid Checkout Access?', 'event_espresso'), |
||
106 | 'html_help_text' => esc_html__( |
||
107 | 'Controls whether or not invalid attempts to directly access the registration checkout page should be tracked. Setting this to "No" means that the above data will no longer be collected.', |
||
108 | 'event_espresso' |
||
109 | ), |
||
110 | 'default' => \EE_Config::instance() |
||
111 | ->registration |
||
112 | ->track_invalid_checkout_access(), |
||
113 | 'display_html_label_text' => false, |
||
114 | ) |
||
115 | ), |
||
116 | 'delete_invalid_checkout_data' => new \EE_Yes_No_Input( |
||
117 | array( |
||
118 | 'html_label_text' => __('Reset Invalid Checkout Data', 'event_espresso'), |
||
119 | 'html_help_text' => esc_html__( |
||
120 | 'Setting this to "Yes" will delete all existing invalid checkout access data.', |
||
121 | 'event_espresso' |
||
122 | ), |
||
123 | 'default' => false, |
||
124 | 'display_html_label_text' => false, |
||
125 | ) |
||
126 | ), |
||
127 | ), |
||
128 | ) |
||
129 | ); |
||
130 | } |
||
131 | |||
191 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.