PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.3.2
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.3.2
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 / class-charitable-install.php

class-charitable-install.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.3.2, at includes/class-charitable-install.php

85 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Charitable Install class.
4 *
5 * The responsibility of this class is to manage the events that need to happen
6 * when the plugin is activated.
7 *
8 * @package Charitable
9 * @subpackage Charitable/Charitable Install
10 * @copyright Copyright (c) 2015, Eric Daams
11 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
12 * @since 1.0.0
13 */
14 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
15
16 if ( ! class_exists( 'Charitable_Install' ) ) :
17
18 /**
19 * Charitable_Install
20 *
21 * @since 1.0.0
22 */
23 class Charitable_Install {
24
25 /**
26 * Install the plugin.
27 *
28 * @access public
29 * @since 1.0.0
30 */
31 public function __construct() {
32 $this->setup_roles();
33 $this->create_tables();
34 $this->setup_upgrade_log();
35
36 set_transient( 'charitable_install', 1, 0 );
37 }
38
39 /**
40 * Create wp roles and assign capabilities
41 *
42 * @return void
43 * @access protected
44 * @since 1.0.0
45 */
46 protected function setup_roles() {
47 require_once( 'users/class-charitable-roles.php' );
48 $roles = new Charitable_Roles();
49 $roles->add_roles();
50 $roles->add_caps();
51 }
52
53 /**
54 * Create database tables.
55 *
56 * @return void
57 * @access protected
58 * @since 1.0.0
59 */
60 protected function create_tables() {
61 require_once( 'db/abstract-class-charitable-db.php' );
62
63 require_once( 'db/class-charitable-campaign-donations-db.php' );
64 $table_helper = new Charitable_Campaign_Donations_DB();
65 $table_helper->create_table();
66
67 require_once( 'db/class-charitable-donors-db.php' );
68 $table_helper = new Charitable_Donors_DB();
69 $table_helper->create_table();
70 }
71
72 /**
73 * Set up the upgrade log.
74 *
75 * @return void
76 * @access protected
77 * @since 1.3.0
78 */
79 protected function setup_upgrade_log() {
80 require_once( 'admin/upgrades/class-charitable-upgrade.php' );
81 Charitable_Upgrade::get_instance()->populate_upgrade_log_on_install();
82 }
83 }
84
85 endif;