PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.12
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.12
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.12, at includes/utilities/Skin.php

117 lines 2.3 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 parent::__construct();
37 }
38
39 /**
40 * Set the upgrader object and store it as a property in the parent class.
41 *
42 * @since 1.0.0
43 *
44 * @param object $upgrader The upgrader object (passed by reference).
45 */
46 public function set_upgrader( &$upgrader ) {
47 if ( is_object( $upgrader ) ) {
48 $this->upgrader =& $upgrader;
49 }
50 }
51
52 /**
53 * Set the upgrader result and store it as a property in the parent class.
54 *
55 * @since 1.0.0
56 *
57 * @param object $result The result of the install process.
58 */
59 public function set_result( $result ) {
60 $this->result = $result;
61 }
62
63 /**
64 * Empty out the header of its HTML content and only check to see if it has
65 * been performed or not.
66 *
67 * @since 1.0.0
68 */
69 public function header() {}
70
71 /**
72 * Empty out the footer of its HTML contents.
73 *
74 * @since 1.0.0
75 */
76 public function footer() {}
77
78 /**
79 * Instead of outputting HTML for errors, json_encode the errors and send them
80 * back to the Ajax script for processing.
81 *
82 * @since 1.0.0
83 *
84 * @param array $errors Array of errors with the install process.
85 */
86 public function error( $errors ) {
87
88 if ( ! empty( $errors ) ) {
89 echo wp_json_encode( array( 'error' => __( 'There was an error installing the addon....... Please try again.', 'charitable' ) ) );
90 /* log this for API issues */
91
92 if ( defined( 'CHARITABLE_DEBUG' ) && CHARITABLE_DEBUG ) {
93 // phpcs:disable
94 if ( charitable_is_debug() ) {
95 error_log( 'Charitable: There was an error installing the addon' );
96 error_log( print_r( $errors, true ) ); // phpcs:ignore
97 }
98 // phpcs:enable
99 }
100
101 die;
102 }
103 }
104
105 /**
106 * Empty out the feedback method to prevent outputting HTML strings as the install
107 * is progressing.
108 *
109 * @since 1.0.0
110 *
111 * @param string $string The feedback string.
112 * @param array ...$args The args.
113 */
114 public function feedback( $string, ...$args ) {}
115
116 }
117