PluginProbe
Passster – Password Protect Pages and Content / 4.1.4
Passster – Password Protect Pages and Content v4.1.4
4.3.15 4.3.14 4.3.12 4.3.13 4.3.11 4.3.10 4.3.9 4.3.8 4.3.7 4.3.6 4.3.5 trunk 3.5.4 3.5.5.2 3.5.5.8 3.5.5.9 4.0 4.1.4 4.2.10 4.2.11 4.2.12 4.2.13 4.2.14 4.2.15 4.2.16 All 47 releases
content-protector / inc / freemius-setup.php

freemius-setup.php in Passster – Password Protect Pages and Content 4.1.4, at inc/freemius-setup.php

107 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( !function_exists( 'passster_fs' ) ) {
4 // Create a helper function for easy SDK access.
5 function passster_fs()
6 {
7 global $passster_fs ;
8
9 if ( !isset( $passster_fs ) ) {
10 // Activate multisite network integration.
11 if ( !defined( 'WP_FS__PRODUCT_1938_MULTISITE' ) ) {
12 define( 'WP_FS__PRODUCT_1938_MULTISITE', true );
13 }
14 // Include Freemius SDK.
15 require_once dirname( __FILE__ ) . '/freemius/start.php';
16 $passster_fs = fs_dynamic_init( array(
17 'id' => '1938',
18 'slug' => 'content-protector',
19 'type' => 'plugin',
20 'public_key' => 'pk_9d9d6d17bd34372b199f36e37dd4b',
21 'is_premium' => false,
22 'premium_suffix' => '',
23 'has_addons' => false,
24 'has_paid_plans' => true,
25 'trial' => array(
26 'days' => 7,
27 'is_require_payment' => true,
28 ),
29 'has_affiliation' => 'selected',
30 'menu' => array(
31 'slug' => 'edit.php?post_type=protected_areas',
32 'contact' => false,
33 'support' => false,
34 'affiliation' => false,
35 ),
36 'is_live' => true,
37 ) );
38 }
39
40 return $passster_fs;
41 }
42
43 // Init Freemius.
44 passster_fs();
45 // Signal that SDK was initiated.
46 do_action( 'passster_fs_loaded' );
47 }
48
49 function passster_fs_settings_url()
50 {
51 return admin_url( 'admin.php?page=passster-settings' );
52 }
53
54 passster_fs()->add_filter( 'connect_url', 'passster_fs_settings_url' );
55 passster_fs()->add_filter( 'after_skip_url', 'passster_fs_settings_url' );
56 passster_fs()->add_filter( 'after_connect_url', 'passster_fs_settings_url' );
57 passster_fs()->add_filter( 'after_pending_connect_url', 'passster_fs_settings_url' );
58 passster_fs()->add_filter( 'show_deactivation_subscription_cancellation', '__return_false' );
59 passster_fs()->add_filter( 'show_deactivation_feedback_form', '__return_false' );
60 /**
61 * Remove freemius pages.
62 *
63 * @param bool $is_visible indicates if visible or not.
64 * @param int $submenu_id current submenu id.
65 *
66 * @return bool
67 */
68 function passster_is_submenu_visible( $is_visible, $submenu_id )
69 {
70 return false;
71 }
72
73 passster_fs()->add_filter(
74 'is_submenu_visible',
75 'passster_is_submenu_visible',
76 10,
77 2
78 );
79 /**
80 * Add custom icon for Freemius.
81 *
82 * @return string
83 */
84 passster_fs()->add_filter( 'plugin_icon', function () {
85 return PASSSTER_PATH . '/assets/admin/passster-logo.svg';
86 } );
87 passster_fs()->add_action( 'after_uninstall', function () {
88 $options = array( 'passster', 'passster_passwords_usage', 'passster_passwords_times' );
89
90 if ( is_multisite() ) {
91 foreach ( $options as $option ) {
92 delete_site_option( $option );
93 }
94 } else {
95 foreach ( $options as $option ) {
96 delete_option( $option );
97 }
98 }
99
100 global $wpdb ;
101 /* delete all password lists */
102 $wpdb->query( "DELETE FROM {$wpdb->posts} WHERE post_type='password_lists'" );
103 /* delete all protected areas */
104 $wpdb->query( "DELETE FROM {$wpdb->posts} WHERE post_type='protected_areas'" );
105 /* delete all assigned meta */
106 $wpdb->query( "DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE 'passster_%'" );
107 } );