1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
||
10 | class WC_Services_Installer { |
||
11 | |||
12 | /** |
||
13 | * The instance of the Jetpack class. |
||
14 | * |
||
15 | * @var Jetpack |
||
16 | */ |
||
17 | private $jetpack; |
||
18 | |||
19 | /** |
||
20 | * The singleton instance of this class. |
||
21 | * |
||
22 | * @var WC_Services_Installer |
||
23 | */ |
||
24 | private static $instance = null; |
||
25 | |||
26 | /** |
||
27 | * Returns the singleton instance of this class. |
||
28 | * |
||
29 | * @return object The WC_Services_Installer object. |
||
30 | */ |
||
31 | public static function init() { |
||
37 | |||
38 | /** |
||
39 | * Constructor |
||
40 | */ |
||
41 | public function __construct() { |
||
46 | |||
47 | /** |
||
48 | * Runs on Jetpack being ready to load its packages. |
||
49 | * |
||
50 | * @param Jetpack $jetpack object. |
||
51 | */ |
||
52 | public function on_jetpack_loaded( $jetpack ) { |
||
55 | |||
56 | /** |
||
57 | * Verify the intent to install WooCommerce Services, and kick off installation. |
||
58 | */ |
||
59 | public function try_install() { |
||
102 | |||
103 | /** |
||
104 | * Set up installation error admin notice. |
||
105 | */ |
||
106 | public function add_error_notice() { |
||
111 | |||
112 | /** |
||
113 | * Notify the user that the installation of WooCommerce Services failed. |
||
114 | */ |
||
115 | public function error_notice() { |
||
122 | |||
123 | /** |
||
124 | * Download and install the WooCommerce Services plugin. |
||
125 | * |
||
126 | * @return bool result of installation |
||
127 | */ |
||
128 | private function install() { |
||
146 | |||
147 | /** |
||
148 | * Activate the WooCommerce Services plugin. |
||
149 | * |
||
150 | * @return bool result of activation |
||
151 | */ |
||
152 | private function activate() { |
||
158 | } |
||
159 | |||
161 |