-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathtop-10.php
124 lines (111 loc) · 2.97 KB
/
top-10.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
<?php
/**
* Top 10.
*
* Count daily and total visits per post and display the most popular posts based on the number of views.
*
* @package Top_Ten
* @author Ajay D'Souza
* @license GPL-2.0+
* @link https://webberzone.com
* @copyright 2008-2024 Ajay D'Souza
*
* @wordpress-plugin
* Plugin Name: Top 10
* Plugin URI: https://webberzone.com/plugins/top-10/
* Description: Count daily and total visits per post and display the most popular posts based on the number of views
* Version: 4.0.2
* Author: WebberZone
* Author URI: https://webberzone.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: top-10
* Domain Path: /languages
* GitHub Plugin URI: https://github.com/WebberZone/top-10/
*/
namespace WebberZone\Top_Ten;
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Holds the version of Top 10.
*
* @since 3.1.0
*/
if ( ! defined( 'TOP_TEN_VERSION' ) ) {
define( 'TOP_TEN_VERSION', '4.0.2' );
}
/**
* Holds the filesystem directory path (with trailing slash) for Top 10
*
* @since 2.3.0
*/
if ( ! defined( 'TOP_TEN_PLUGIN_FILE' ) ) {
define( 'TOP_TEN_PLUGIN_FILE', __FILE__ );
}
/**
* Holds the filesystem directory path (with trailing slash) for Top 10
*
* @since 2.3.0
*/
if ( ! defined( 'TOP_TEN_PLUGIN_DIR' ) ) {
define( 'TOP_TEN_PLUGIN_DIR', plugin_dir_path( TOP_TEN_PLUGIN_FILE ) );
}
/**
* Holds the filesystem directory path (with trailing slash) for Top 10
*
* @since 2.3.0
*/
if ( ! defined( 'TOP_TEN_PLUGIN_URL' ) ) {
define( 'TOP_TEN_PLUGIN_URL', plugin_dir_url( TOP_TEN_PLUGIN_FILE ) );
}
/**
* Number of days of data to be saved in the daily tables.
*
* @since 3.0.0
*/
if ( ! defined( 'TOP_TEN_STORE_DATA' ) ) {
define( 'TOP_TEN_STORE_DATA', 180 );
}
/**
* Global variable holding the current database version of Top 10
*
* @since 1.0
*
* @var string
*/
global $tptn_db_version;
$tptn_db_version = '6.0';
// Load Freemius.
require_once TOP_TEN_PLUGIN_DIR . 'includes/load-freemius.php';
// Load the autoloader.
require_once TOP_TEN_PLUGIN_DIR . 'includes/autoloader.php';
if ( ! function_exists( __NAMESPACE__ . '\load_tptn' ) ) {
/**
* The main function responsible for returning the one true WebberZone Snippetz instance to functions everywhere.
*
* @since 3.3.0
*/
function load_tptn() {
Main::get_instance();
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\load_tptn' );
}
/*
*----------------------------------------------------------------------------
* Include files
*----------------------------------------------------------------------------
*/
require_once TOP_TEN_PLUGIN_DIR . 'includes/options-api.php';
require_once TOP_TEN_PLUGIN_DIR . 'includes/wz-pluggables.php';
require_once TOP_TEN_PLUGIN_DIR . 'includes/class-top-ten-query.php';
require_once TOP_TEN_PLUGIN_DIR . 'includes/functions.php';
/**
* Global variable holding the current settings for Top 10
*
* @since 1.9.3
*
* @var array
*/
global $tptn_settings;
$tptn_settings = tptn_get_settings();