PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
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/FrmInstallerSkin.php +27 -20 6.25 → trunk View file →
@@ -11,9 +11,9 @@
11 11 exit;
12 12 }
13 13
14 14 if ( ! class_exists( 'WP_Upgrader_Skin' ) ) {
15 - // this is to prevent a unit test from failing
15 + // This is to prevent a unit test from failing
16 16 return;
17 17 }
18 18
19 19 class FrmInstallerSkin extends WP_Upgrader_Skin {
@@ -23,8 +23,10 @@
23 23 *
24 24 * @since 3.04.02
25 25 *
26 26 * @param object $upgrader The upgrader object (passed by reference).
27 + *
28 + * @return void
27 29 */
28 30 public function set_upgrader( &$upgrader ) {
29 31 if ( is_object( $upgrader ) ) {
30 32 $this->upgrader =& $upgrader;
@@ -35,9 +37,11 @@
35 37 * Set the upgrader result and store it as a property in the parent class.
36 38 *
37 39 * @since 3.04.02
38 40 *
39 - * @param object $result The result of the install process.
41 + * @param bool|string|WP_Error $result The result of the install process.
42 + *
43 + * @return void
40 44 */
41 45 public function set_result( $result ) {
42 46 $this->result = $result;
43 47 }
@@ -65,27 +69,30 @@
65 69 *
66 70 * @param string|\WP_Error $errors The WP Error object of errors with the install process.
67 71 */
68 72 public function error( $errors ) {
69 - if ( ! empty( $errors ) ) {
70 - if ( ! is_string( $errors ) ) {
71 - $error = $errors->get_error_message();
72 - $message = $errors->get_error_data();
73 - $errors = $error . ' ' . $message;
74 - }
75 - echo json_encode(
76 - array(
77 - 'error' => $errors,
78 - 'message' => $errors,
79 - 'success' => false,
80 - )
81 - );
82 - if ( wp_doing_ajax() ) {
83 - wp_die();
84 - } else {
85 - die();
86 - }
73 + if ( ! $errors ) {
74 + return;
87 75 }
76 +
77 + if ( ! is_string( $errors ) ) {
78 + $error = $errors->get_error_message();
79 + $message = $errors->get_error_data();
80 + $errors = $error . ' ' . $message;
81 + }
82 + echo json_encode(
83 + array(
84 + 'error' => $errors,
85 + 'message' => $errors,
86 + 'success' => false,
87 + )
88 + );
89 +
90 + if ( ! wp_doing_ajax() ) {
91 + die();
92 + }
93 +
94 + wp_die();
88 95 }
89 96
90 97 /**
91 98 * Empty out the feedback method to prevent outputting HTML strings as the install