-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathload-freemius.php
More file actions
74 lines (69 loc) · 2 KB
/
Copy pathload-freemius.php
File metadata and controls
74 lines (69 loc) · 2 KB
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
<?php
/**
* Initializes Freemius SDK for Contextual Related Posts Pro.
*
* @package WebberZone\Contextual_Related_Posts
*/
namespace WebberZone\Contextual_Related_Posts;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! function_exists( __NAMESPACE__ . '\\crp_freemius' ) ) {
/**
* Initialize Freemius SDK.
*/
function crp_freemius() {
global $crp_freemius;
if ( ! isset( $crp_freemius ) ) {
// Activate multisite network integration.
if ( ! defined( 'WP_FS__PRODUCT_15040_MULTISITE' ) ) {
define( 'WP_FS__PRODUCT_15040_MULTISITE', true );
}
// Include Freemius SDK.
require_once __DIR__ . '/vendor/freemius/start.php';
$crp_freemius = \fs_dynamic_init(
array(
'id' => '15040',
'slug' => 'contextual-related-posts',
'premium_slug' => 'contextual-related-posts-pro',
'type' => 'plugin',
'public_key' => 'pk_4aec305b9c97637276da2e55b723f',
'is_premium' => false,
'premium_suffix' => 'Pro',
'has_addons' => false,
'has_paid_plans' => true,
'menu' => array(
'slug' => 'crp_options_page',
'first-path' => ( is_multisite() && is_network_admin() ? '' : 'admin.php?page=crp_wizard' ),
'contact' => false,
'support' => false,
'network' => true,
),
'is_live' => true,
'is_org_compliant' => true,
)
);
}
$crp_freemius->add_filter( 'plugin_icon', __NAMESPACE__ . '\\crp_freemius_get_plugin_icon' );
$crp_freemius->add_filter( 'after_uninstall', __NAMESPACE__ . '\\crp_freemius_uninstall' );
return $crp_freemius;
}
/**
* Get the plugin icon.
*
* @return string
*/
function crp_freemius_get_plugin_icon() {
return __DIR__ . '/includes/admin/images/crp-icon.png';
}
/**
* Uninstall the plugin.
*/
function crp_freemius_uninstall() {
require_once __DIR__ . '/uninstaller.php';
}
// Init Freemius.
crp_freemius();
// Signal that SDK was initiated.
do_action( 'crp_freemius_loaded' );
}