forked from rafasashi/user-session-synchronizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser-session-synchronizer.php
80 lines (64 loc) · 2.36 KB
/
user-session-synchronizer.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
<?php
/*
* Plugin Name: User Session Synchronizer
* Version: 1.3.8
* Plugin URI: https://github.com/rafasashi/user-session-synchronizer/archive/master.zip
* Description: Keep the user logged in from one wordpress to another by synchronizing user data and cookie session.
* Author: Rafasashi
* Author URI: https://www.linkedin.com/in/raphaeldartigues
* Requires at least: 4.3
* Tested up to: 4.7
*
* Text Domain: user-session-synchronizer
* Domain Path: /lang/
*
* @package WordPress
* @author Rafasashi
* @since 1.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Minimum version required
*
*/
if ( get_bloginfo('version') < 4.3 ) return;
/**
* Add donation link
*
*/
add_filter('plugin_row_meta', function ( $links, $file ){
if ( strpos( $file, basename( __FILE__ ) ) !== false ) {
$new_links = array( '<a href="https://www.paypal.me/recuweb" target="_blank">' . __( 'Donate', 'cleanlogin' ) . '</a>' );
$links = array_merge( $links, $new_links );
}
return $links;
}, 10, 2);
// Load plugin class files
require_once( 'includes/class-user-session-synchronizer.php' );
require_once( 'includes/class-user-session-synchronizer-email-verification.php' );
require_once( 'includes/class-user-session-synchronizer-settings.php' );
require_once( 'includes/class-user-session-synchronizer-session-control.php' );
// Load plugin libraries
require_once( 'includes/lib/class-user-session-synchronizer-admin-api.php' );
require_once( 'includes/lib/class-user-session-synchronizer-post-type.php' );
require_once( 'includes/lib/class-user-session-synchronizer-taxonomy.php' );
/**
* Returns the main instance of User_Session_Synchronizer to prevent the need to use globals.
*
* @since 1.0.0
* @return object User_Session_Synchronizer
*/
function User_Session_Synchronizer () {
$instance = User_Session_Synchronizer::instance( __FILE__, '1.0.0' );
if ( is_null( $instance->emailVerification ) ) {
$instance->emailVerification = User_Session_Synchronizer_Email_Verification::instance( $instance );
}
if ( is_null( $instance->settings ) ) {
$instance->settings = User_Session_Synchronizer_Settings::instance( $instance );
}
if ( is_null( $instance->sessionControl ) ) {
$instance->sessionControl = User_Session_Synchronizer_Session_Control::instance( $instance );
}
return $instance;
}
User_Session_Synchronizer();