PluginProbe
Passster – Password Protect Pages and Content / 4.2.10
Passster – Password Protect Pages and Content v4.2.10
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.2.10, at inc/freemius-setup.php

94 lines 3.3 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 global $passster_fs;
7 if ( !isset( $passster_fs ) ) {
8 // Activate multisite network integration.
9 if ( !defined( 'WP_FS__PRODUCT_1938_MULTISITE' ) ) {
10 define( 'WP_FS__PRODUCT_1938_MULTISITE', true );
11 }
12 // Include Freemius SDK.
13 require_once dirname( __FILE__ ) . '/freemius/start.php';
14 $passster_fs = fs_dynamic_init( array(
15 'id' => '1938',
16 'slug' => 'content-protector',
17 'type' => 'plugin',
18 'public_key' => 'pk_9d9d6d17bd34372b199f36e37dd4b',
19 'is_premium' => false,
20 'premium_suffix' => '',
21 'has_addons' => false,
22 'has_paid_plans' => true,
23 'has_affiliation' => 'selected',
24 'menu' => array(
25 'contact' => false,
26 'support' => false,
27 ),
28 'is_live' => true,
29 ) );
30 }
31 return $passster_fs;
32 }
33
34 // Init Freemius.
35 passster_fs();
36 // Signal that SDK was initiated.
37 do_action( 'passster_fs_loaded' );
38 }
39 function passster_fs_settings_url() {
40 return admin_url( 'admin.php?page=passster-settings' );
41 }
42
43 passster_fs()->add_filter( 'connect_url', 'passster_fs_settings_url' );
44 passster_fs()->add_filter( 'after_skip_url', 'passster_fs_settings_url' );
45 passster_fs()->add_filter( 'after_connect_url', 'passster_fs_settings_url' );
46 passster_fs()->add_filter( 'after_pending_connect_url', 'passster_fs_settings_url' );
47 passster_fs()->add_filter( 'show_deactivation_subscription_cancellation', '__return_false' );
48 passster_fs()->add_filter( 'show_deactivation_feedback_form', '__return_false' );
49 /**
50 * Remove freemius pages.
51 *
52 * @param bool $is_visible indicates if visible or not.
53 * @param int $submenu_id current submenu id.
54 *
55 * @return bool
56 */
57 function passster_is_submenu_visible( $is_visible, $submenu_id ) {
58 return false;
59 }
60
61 passster_fs()->add_filter(
62 'is_submenu_visible',
63 'passster_is_submenu_visible',
64 10,
65 2
66 );
67 /**
68 * Add custom icon for Freemius.
69 *
70 * @return string
71 */
72 passster_fs()->add_filter( 'plugin_icon', function () {
73 return PASSSTER_PATH . '/assets/admin/passster-icon.png';
74 } );
75 passster_fs()->add_action( 'after_uninstall', function () {
76 global $wpdb;
77 // Delete option.
78 if ( is_multisite() ) {
79 delete_site_option( 'passster' );
80 } else {
81 delete_option( 'passster' );
82 }
83 // Delete tables.
84 $tables = [$wpdb->prefix . "passster_concurrent_logins", $wpdb->prefix . "passster_statistics"];
85 foreach ( $tables as $table ) {
86 $wpdb->query( "DROP TABLE IF EXISTS {$table}" );
87 }
88 // Delete all password lists.
89 $wpdb->query( "DELETE FROM {$wpdb->posts} WHERE post_type='password_lists'" );
90 // Delete all protected areas.
91 $wpdb->query( "DELETE FROM {$wpdb->posts} WHERE post_type='protected_areas'" );
92 // Delete all assigned meta
93 $wpdb->query( "DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE 'passster_%'" );
94 } );