-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
114 lines (97 loc) · 2.54 KB
/
index.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
<?php
/*
Plugin Name: Nashaat Activity Log
Description: Log and view different WordPress activity on your site
Version: 1.2.4
Author: Kalimah Apps
Author URI: https://github.com/kalimahapps
License: GPLv2 or later
Text Domain: nashaat
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
include_once ABSPATH . 'wp-admin/includes/plugin.php';
define( 'NASHAAT_MAIN_FILE', __FILE__ );
require_once 'constants.php';
require_once 'setup.class.php';
add_action( 'nashaat_init', 'nashaat_initiate_log' );
/**
* Initiate log classes
*
* @return void
*/
function nashaat_initiate_log() {
try {
new NashaatPostHooks();
new NashaatWidgetHooks();
new NashaatUserHooks();
new NashaatThemeHooks();
new NashaatTaxonomyHooks();
new NashaatSystemHooks();
new NashaatPluginHooks();
new NashaatOptionsHooks();
new NashaatMenuHooks();
new NashaatMediaHooks();
new NashaatCommentHooks();
// WooCommerce
new NashaatWCSettings();
new NashaatWCOrders();
new NashaatWCProduct();
new NashaatWCCoupon();
new NashaatWCVariations();
// Gravity
if ( is_plugin_active( 'gravityforms/gravityforms.php' ) ) {
new NashaatGravity();
new NashaatGravityForms();
new NashaatGravityConfirmations();
new NashaatGravityNotifications();
new NashaatGravitySettings();
new NashaatGravityFormSettings();
new NashaatGravityImportExport();
}
// User switching
if ( is_plugin_active( 'user-switching/user-switching.php' ) ) {
new NashaatUserSwitching();
}
// WP Crontrol
if ( is_plugin_active( 'wp-crontrol/wp-crontrol.php' ) ) {
new NashaatWpCrontrolEvents();
new NashaatWpCrontrolSchedules();
}
// Yoast Duplicate Post
if ( is_plugin_active( 'duplicate-post/duplicate-post.php' ) ) {
new NashaatDuplicatePost();
new NashaatDuplicatePostSettings();
}
} catch ( \Throwable $th ) {
echo esc_html( $th->getMessage() );
}
}
$includes = array(
'render-log-info.class',
'translation.class',
'functions',
'util.trait',
'logs-table-base.class',
'logs-table.class',
'settings.class',
'base-hook.class',
'nashaat.class'
);
foreach ( $includes as $filename ) {
include_once NASHAAT_PLUGIN_PATH . "includes/{$filename}.php";
}
$dir_iterator = new RecursiveDirectoryIterator( NASHAAT_PLUGIN_PATH . '/hooks/' );
$iterator = new RecursiveIteratorIterator( $dir_iterator, RecursiveIteratorIterator::SELF_FIRST );
foreach ( $iterator as $file ) {
if ( ! $file->isFile() ) {
continue;
}
include_once $file->getPathname();
}
try {
new NashaatLog( new NashaatSettings() );
} catch ( \Throwable $th ) {
echo esc_html( $th->getMessage() );
}