forked from elementor/activity-log
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aryo-activity-log.php
136 lines (112 loc) · 3.64 KB
/
aryo-activity-log.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<?php
/*
Plugin Name: ARYO Activity Log
Plugin URI: http://wordpress.org/plugins/aryo-activity-log/
Description: Get aware of any activities that are taking place on your dashboard! Imagine it like a black-box for your WordPress site. e.g. post was deleted, plugin was activated, user logged in or logged out - it's all these for you to see.
Author: Yakir Sitbon, Maor Chasen, Ariel Klikstein
Author URI: http://pojo.me/
Version: 2.1.16
Text Domain: aryo-aal
Domain Path: /language/
License: GPLv2 or later
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
define( 'ACTIVITY_LOG__FILE__', __FILE__ );
define( 'ACTIVITY_LOG_BASE', plugin_basename( ACTIVITY_LOG__FILE__ ) );
include( 'classes/class-aal-maintenance.php' );
include( 'classes/class-aal-activity-log-list-table.php' );
include( 'classes/class-aal-admin-ui.php' );
include( 'classes/class-aal-settings.php' );
include( 'classes/class-aal-api.php' );
include( 'classes/class-aal-hooks.php' );
include( 'classes/class-aal-notifications.php' );
include( 'classes/class-aal-help.php' );
// Integrations
include( 'classes/class-aal-integration-woocommerce.php' );
// Probably we should put this in a separate file
final class AAL_Main {
/**
* @var AAL_Main The one true AAL_Main
* @since 2.0.5
*/
private static $_instance = null;
/**
* @var AAL_Admin_Ui
* @since 1.0.0
*/
public $ui;
/**
* @var AAL_Hooks
* @since 1.0.1
*/
public $hooks;
/**
* @var AAL_Settings
* @since 1.0.0
*/
public $settings;
/**
* @var AAL_API
* @since 2.0.5
*/
public $api;
public function load_textdomain() {
load_plugin_textdomain( 'aryo-aal', false, basename( dirname( __FILE__ ) ) . '/language' );
}
protected function __construct() {
global $wpdb;
$this->ui = new AAL_Admin_Ui();
$this->hooks = new AAL_Hooks();
$this->settings = new AAL_Settings();
$this->api = new AAL_API();
$this->notifications = new AAL_Notifications();
$this->help = new AAL_Help();
// set up our DB name
$wpdb->activity_log = $wpdb->prefix . 'aryo_activity_log';
add_action( 'plugins_loaded', array( &$this, 'load_textdomain' ) );
}
/**
* Throw error on object clone
*
* The whole idea of the singleton design pattern is that there is a single
* object therefore, we don't want the object to be cloned.
*
* @since 2.0.7
* @return void
*/
public function __clone() {
// Cloning instances of the class is forbidden
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'aryo-aal' ), '2.0.7' );
}
/**
* Disable unserializing of the class
*
* @since 2.0.7
* @return void
*/
public function __wakeup() {
// Unserializing instances of the class is forbidden
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'aryo-aal' ), '2.0.7' );
}
/**
* @return AAL_Main
*/
public static function instance() {
if ( is_null( self::$_instance ) )
self::$_instance = new AAL_Main();
return self::$_instance;
}
}
AAL_Main::instance();
// EOF