-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathcontextual-related-posts.php
139 lines (121 loc) · 3.46 KB
/
contextual-related-posts.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
137
138
139
<?php
/**
* Contextual Related Posts.
*
* Contextual Related Posts is the best related posts plugin for WordPress that
* allows you to display a list of related posts on your website and in your feed.
*
* @package Contextual_Related_Posts
* @author Ajay D'Souza
* @license GPL-2.0+
* @link https://webberzone.com
* @copyright 2009-2025 Ajay D'Souza
*
* @wordpress-plugin
* Plugin Name: Contextual Related Posts
* Plugin URI: https://webberzone.com/plugins/contextual-related-posts/
* Description: Display related posts on your website or in your feed. Increase reader retention and reduce bounce rates.
* Version: 3.6.1
* Author: WebberZone
* Author URI: https://webberzone.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: contextual-related-posts
* Domain Path: /languages
*/
namespace WebberZone\Contextual_Related_Posts;
if ( ! defined( 'WPINC' ) ) {
die;
}
/**
* Holds the version of Contextual Related Posts.
*
* @since 2.9.3
*/
if ( ! defined( 'CRP_VERSION' ) ) {
define( 'CRP_VERSION', '3.6.1' );
}
/**
* Holds the filesystem directory path (with trailing slash) for Contextual Related Posts.
*
* @since 2.3.0
*/
if ( ! defined( 'CRP_PLUGIN_FILE' ) ) {
define( 'CRP_PLUGIN_FILE', __FILE__ );
}
/**
* Holds the filesystem directory path (with trailing slash) for Contextual Related Posts.
*
* @since 2.3.0
*/
if ( ! defined( 'CRP_PLUGIN_DIR' ) ) {
define( 'CRP_PLUGIN_DIR', plugin_dir_path( CRP_PLUGIN_FILE ) );
}
/**
* Holds the filesystem directory path (with trailing slash) for Contextual Related Posts.
*
* @since 2.3.0
*/
if ( ! defined( 'CRP_PLUGIN_URL' ) ) {
define( 'CRP_PLUGIN_URL', plugin_dir_url( CRP_PLUGIN_FILE ) );
}
/**
* Maximum words to match in the content.
*
* @since 2.3.0
*/
if ( ! defined( 'CRP_MAX_WORDS' ) ) {
define( 'CRP_MAX_WORDS', 100 );
}
/**
* CRP Cache expiration time.
*
* @since 3.0.0
*/
if ( ! defined( 'CRP_CACHE_TIME' ) ) {
define( 'CRP_CACHE_TIME', MONTH_IN_SECONDS );
}
/**
* CRP Database version.
*
* @since 3.5.0
*/
if ( ! defined( 'CRP_DB_VERSION' ) ) {
define( 'CRP_DB_VERSION', '1.0' );
}
// Load Freemius.
require_once plugin_dir_path( __FILE__ ) . 'includes/load-freemius.php';
// Load the autoloader.
require_once plugin_dir_path( __FILE__ ) . 'includes/autoloader.php';
if ( ! function_exists( __NAMESPACE__ . '\load' ) ) {
/**
* The main function responsible for returning the one true WebberZone Snippetz instance to functions everywhere.
*
* @since 3.5.0
*/
function load() {
\WebberZone\Contextual_Related_Posts\Main::get_instance();
}
add_action( 'plugins_loaded', __NAMESPACE__ . '\load' );
}
/*
*----------------------------------------------------------------------------
* Include files
*----------------------------------------------------------------------------
*/
require_once plugin_dir_path( __FILE__ ) . 'includes/options-api.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-crp-query.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/functions.php';
// Register activation hook.
register_activation_hook( __FILE__, __NAMESPACE__ . '\Admin\Activator::activation_hook' );
// Register deactivation hook.
register_deactivation_hook( __FILE__, __NAMESPACE__ . '\Admin\Activator::deactivation_hook' );
/**
* Global variable holding the current settings for Contextual Related Posts
*
* @since 1.8.10
*
* @var array
*/
global $crp_settings;
$crp_settings = crp_get_settings();