PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.8
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.8
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/models/FrmEmailStats.php +14 -66 6.346.8 View file →
@@ -2,9 +2,8 @@
2 2 /**
3 3 * Stats email class
4 4 *
5 5 * @since 6.7
6 - *
7 6 * @package Formidable
8 7 */
9 8
10 9 if ( ! defined( 'ABSPATH' ) ) {
@@ -80,9 +79,9 @@
80 79 $this->prev_from_date = gmdate( 'Y-m-d', strtotime( $this->prev_to_date . '-' . $date_minus . ' days' ) );
81 80 }
82 81
83 82 /**
84 - * @return false|string
83 + * @return mixed
85 84 */
86 85 protected function get_inner_content() {
87 86 $args = $this->get_content_args();
88 87
@@ -91,17 +90,11 @@
91 90 return ob_get_clean();
92 91 }
93 92
94 93 protected function get_content_args() {
95 - $args = parent::get_content_args();
94 + $args = parent::get_content_args();
95 +
96 96 $entries_count = FrmEmailSummaryHelper::get_entries_count( $this->from_date, $this->to_date );
97 - $entries_stat = array(
98 - 'entries' => array(
99 - 'label' => __( 'Entries created', 'formidable' ),
100 - 'count' => $entries_count,
101 - 'compare' => 0,
102 - ),
103 - );
104 97
105 98 $args['inbox_msg'] = $this->has_inbox_msg ? FrmEmailSummaryHelper::get_latest_inbox_message() : false;
106 99 $args['from_date'] = $this->from_date;
107 100 $args['to_date'] = $this->to_date;
@@ -107,9 +100,15 @@
107 100 $args['to_date'] = $this->to_date;
108 101 $args['top_forms'] = FrmEmailSummaryHelper::get_top_forms( $this->from_date, $this->to_date );
109 102 $args['top_forms_label'] = $this->get_top_forms_label();
110 103 $args['dashboard_url'] = site_url() . '/wp-admin/admin.php?page=formidable';
111 - $args['stats'] = isset( $args['stats'] ) ? array_merge( $entries_stat, $args['stats'] ) : $entries_stat;
104 + $args['stats'] = array(
105 + 'entries' => array(
106 + 'label' => __( 'Entries created', 'formidable' ),
107 + 'count' => $entries_count,
108 + 'compare' => 0,
109 + ),
110 + );
112 111
113 112 if ( $this->has_out_of_date_plugins ) {
114 113 $args['out_of_date_plugins'] = FrmEmailSummaryHelper::get_out_of_date_plugins();
115 114 $args['plugins_url'] = site_url() . '/wp-admin/plugins.php';
@@ -124,10 +123,8 @@
124 123 /**
125 124 * Adds entries comparison data.
126 125 *
127 126 * @param array $stats Statistics section data.
128 - *
129 - * @return void
130 127 */
131 128 protected function add_entries_comparison_data( &$stats ) {
132 129 if ( ! $this->has_comparison ) {
133 130 return;
@@ -132,9 +129,9 @@
132 129 if ( ! $this->has_comparison ) {
133 130 return;
134 131 }
135 132
136 - $prev_entries_count = FrmEmailSummaryHelper::get_entries_count( $this->prev_from_date, $this->prev_to_date );
133 + $prev_entries_count = FrmEmailSummaryHelper::get_entries_count( $this->prev_from_date, $this->prev_to_date );
137 134 $stats['entries']['compare'] = $this->get_compare_diff( $stats['entries']['count'], $prev_entries_count );
138 135 }
139 136
140 137 /**
@@ -140,13 +137,11 @@
140 137 /**
141 138 * Adds payments count and total data.
142 139 *
143 140 * @param array $stats Statistics section data.
144 - *
145 - * @return void
146 141 */
147 142 protected function add_payments_data( &$stats ) {
148 - $payment_data = FrmEmailSummaryHelper::get_payments_data( $this->from_date, $this->to_date );
143 + $payment_data = FrmEmailSummaryHelper::get_payments_data( $this->from_date, $this->to_date );
149 144 $stats['payments_count'] = array(
150 145 'label' => __( 'Payments collected', 'formidable' ),
151 146 'count' => $payment_data['count'],
152 147 'compare' => 0,
@@ -163,9 +158,9 @@
163 158 );
164 159 }
165 160
166 161 if ( $this->has_comparison ) {
167 - $prev_payment_data = FrmEmailSummaryHelper::get_payments_data( $this->prev_from_date, $this->prev_to_date );
162 + $prev_payment_data = FrmEmailSummaryHelper::get_payments_data( $this->prev_from_date, $this->prev_to_date );
168 163
169 164 if ( ! $payment_data['count'] && ! $prev_payment_data['count'] ) {
170 165 // Maybe this site doesn't collect payment, hide these sections.
171 166 unset( $stats['payments_count'] );
@@ -201,10 +196,9 @@
201 196 /**
202 197 * Gets formatted price.
203 198 *
204 199 * @param float $amount Amount.
205 - * @param array|string $currency Currency string value or array.
206 - *
200 + * @param string|array $currency Currency string value or array.
207 201 * @return string
208 202 */
209 203 protected function get_formatted_price( $amount, $currency ) {
210 204 if ( ! is_array( $currency ) ) {
@@ -218,9 +212,8 @@
218 212 * Gets comparison diff between 2 values.
219 213 *
220 214 * @param float $current Current value.
221 215 * @param float $prev Previous value.
222 - *
223 216 * @return float
224 217 */
225 218 public function get_compare_diff( $current, $prev ) {
226 219 if ( ! $current && ! $prev ) {
@@ -241,50 +234,5 @@
241 234 *
242 235 * @return string
243 236 */
244 237 abstract protected function get_top_forms_label();
245 -
246 - /**
247 - * @since 6.11.1
248 - *
249 - * @return int
250 - */
251 - public function get_date_range() {
252 - return $this->date_range;
253 - }
254 -
255 - /**
256 - * @since 6.11.1
257 - *
258 - * @return string
259 - */
260 - public function get_from_date() {
261 - return $this->from_date;
262 - }
263 -
264 - /**
265 - * @since 6.11.1
266 - *
267 - * @return string
268 - */
269 - public function get_to_date() {
270 - return $this->to_date;
271 - }
272 -
273 - /**
274 - * @since 6.11.1
275 - *
276 - * @return string
277 - */
278 - public function get_prev_from_date() {
279 - return $this->prev_from_date;
280 - }
281 -
282 - /**
283 - * @since 6.11.1
284 - *
285 - * @return string
286 - */
287 - public function get_prev_to_date() {
288 - return $this->prev_to_date;
289 - }
290 238 }