PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.0
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.0
1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 1.8.0 All 210 releases
charitable / includes / utilities / Skin.php

Skin.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.0, at includes/utilities/Skin.php

118 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Skin class.
4 *
5 * @since 1.0.0
6 *
7 * @package Charitable
8 * @author Charitable Team
9 */
10
11 // Exit if accessed directly.
12 if ( ! defined( 'ABSPATH' ) ) {
13
14 exit;
15
16 }
17
18 /**
19 * Skin class.
20 *
21 * @since 1.0.0
22 *
23 * @package Charitable
24 * @author Charitable Team
25 */
26 class Charitable_Skin extends WP_Upgrader_Skin {
27
28 /**
29 * Primary class constructor.
30 *
31 * @since 1.0.0
32 *
33 * @param array $args Empty array of args (we will use defaults).
34 */
35 public function __construct( $args = array() ) {
36
37 parent::__construct();
38
39 }
40
41 /**
42 * Set the upgrader object and store it as a property in the parent class.
43 *
44 * @since 1.0.0
45 *
46 * @param object $upgrader The upgrader object (passed by reference).
47 */
48 public function set_upgrader( &$upgrader ) {
49
50 if ( is_object( $upgrader ) ) {
51 $this->upgrader =& $upgrader;
52 }
53
54 }
55
56 /**
57 * Set the upgrader result and store it as a property in the parent class.
58 *
59 * @since 1.0.0
60 *
61 * @param object $result The result of the install process.
62 */
63 public function set_result( $result ) {
64
65 $this->result = $result;
66
67 }
68
69 /**
70 * Empty out the header of its HTML content and only check to see if it has
71 * been performed or not.
72 *
73 * @since 1.0.0
74 */
75 public function header() {}
76
77 /**
78 * Empty out the footer of its HTML contents.
79 *
80 * @since 1.0.0
81 */
82 public function footer() {}
83
84 /**
85 * Instead of outputting HTML for errors, json_encode the errors and send them
86 * back to the Ajax script for processing.
87 *
88 * @since 1.0.0
89 *
90 * @param array $errors Array of errors with the install process.
91 */
92 public function error( $errors ) {
93
94 if ( ! empty( $errors ) ) {
95 echo wp_json_encode( array( 'error' => __( 'There was an error installing the addon....... Please try again.', 'charitable' ) ) );
96 /* log this for API issues */
97
98 error_log( 'Charitable: There was an error installing the addon' );
99 error_log( print_r( $errors, true ) );
100
101 die;
102 }
103
104 }
105
106 /**
107 * Empty out the feedback method to prevent outputting HTML strings as the install
108 * is progressing.
109 *
110 * @since 1.0.0
111 *
112 * @param string $string The feedback string.
113 * @param array ...$args The args.
114 */
115 public function feedback( $string, ...$args ) {}
116
117 }
118