PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / trunk
Wp Social Login and Register Social Counter vtrunk
trunk 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.10 1.3.11 1.3.2 1.3.3 1.3.4 1.3.6 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.4 1.4.5 1.4.6 1.4.8 1.4.9 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.8.0 1.8.1 1.8.2 1.8.3 1.8.5 1.8.6 1.9.0 2.0.0 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.8 2.2.9 3.0.0 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0
wp-social / plugin.php
wp-social Last commit date
app 2 months ago assets 2 months ago base 5 years ago helper 2 months ago inc 3 months ago languages 2 months ago lib 7 months ago template 2 months ago traits 5 years ago xs_migration 3 years ago autoload.php 5 years ago instruction.txt 4 years ago keys.php 4 years ago phpcs.xml 3 years ago plugin.php 7 months ago readme.txt 1 month ago wp-social.php 2 months ago
plugin.php
112 lines
1 <?php
2
3 namespace WP_Social;
4
5 defined('ABSPATH') || exit;
6
7 class Plugin {
8
9 private static $instance;
10
11 public static function instance() {
12 if(!self::$instance) {
13 self::$instance = new static();
14 }
15
16 return self::$instance;
17 }
18
19 public function plugin_url() {
20
21 return trailingslashit(plugin_dir_url(__FILE__));
22 }
23
24 public function plugin_dir() {
25
26 return trailingslashit(plugin_dir_path(__FILE__));
27 }
28
29 public function lib_url() {
30
31 return $this->plugin_url() . 'lib/';
32 }
33
34 public function lib_dir() {
35
36 return $this->plugin_dir() . 'lib/';
37 }
38
39 public function account_url(){
40 return 'https://account.wpmet.com';
41 }
42
43 public function package_type() {
44 return apply_filters( 'wp-social/core/package_type', 'free');
45 }
46
47 public function enqueue() {
48
49 add_action( 'admin_enqueue_scripts', [$this, 'load_admin_scripts'] );
50
51 add_action( 'wp_enqueue_scripts', [$this, 'load_public_scripts'] );
52 }
53
54
55 public function load_admin_scripts() {
56 wp_enqueue_style( 'wps-wp-dashboard', WSLU_LOGIN_PLUGIN_URL . 'assets/css/wps-wp-dashboard.css', [], WSLU_VERSION );
57
58 wp_register_script( 'wslu_admin', WSLU_LOGIN_PLUGIN_URL. 'assets/js/admin-main.js', array('jquery', 'jquery-ui-sortable'), WSLU_VERSION );
59 wp_register_script( 'xs_login_custom_js1', WSLU_LOGIN_PLUGIN_URL. 'assets/js/admin-login-custom.js', array('jquery'), WSLU_VERSION );
60 wp_register_script( 'wp_social_select2_js', WSLU_LOGIN_PLUGIN_URL. 'assets/select2/script/select2-min.js', array('jquery'), WSLU_VERSION );
61 wp_register_script( 'wp_social_sortable_js', WSLU_LOGIN_PLUGIN_URL. 'assets/js/sortable.min.js', array('jquery'), WSLU_VERSION );
62
63 wp_localize_script('xs_login_custom_js1', 'rest_api_conf', array(
64 'siteurl' => get_option('siteurl'),
65 'nonce' => wp_create_nonce('wp_rest'),
66 'root' => get_rest_url(),
67 ));
68
69 wp_localize_script('wslu_admin', 'wsluAdminObj', [
70 'resturl' => get_rest_url(),
71 'rest_nonce' => wp_create_nonce('wp_rest'),
72 ]);
73
74 wp_enqueue_script( 'xs_login_custom_js1' );
75 wp_enqueue_script( 'wp_social_select2_js' );
76 wp_enqueue_script( 'wp_social_sortable_js' );
77 wp_enqueue_script( 'wslu_admin' );
78
79
80 wp_register_style( 'xs_login_custom_css1', WSLU_LOGIN_PLUGIN_URL. 'assets/css/admin-login-custom.css',[], WSLU_VERSION );
81 wp_register_style( 'wp_social_select2_css', WSLU_LOGIN_PLUGIN_URL. 'assets/select2/css/select2-min.css',[], WSLU_VERSION );
82 wp_register_style( 'xs_login_custom_css_icon', WSLU_LOGIN_PLUGIN_URL. 'assets/css/font-icon.css',[], WSLU_VERSION );
83 wp_register_style( 'xs_login_custom_css2', WSLU_LOGIN_PLUGIN_URL. 'assets/css/admin.css',[], WSLU_VERSION );
84 wp_register_style( 'xs_login_custom_css3', WSLU_LOGIN_PLUGIN_URL. 'assets/css/admin-responsive.css',[], WSLU_VERSION );
85
86 wp_enqueue_style( 'xs_login_custom_css1' );
87 wp_enqueue_style( 'wp_social_select2_css' );
88 wp_enqueue_style( 'xs_login_custom_css2' );
89 wp_enqueue_style( 'xs_login_custom_css3' );
90 wp_enqueue_style( 'xs_login_custom_css_icon' );
91 }
92
93
94 public function load_public_scripts() {
95
96 wp_register_script( 'xs_social_custom', WSLU_LOGIN_PLUGIN_URL. 'assets/js/social-front.js', array('jquery'), WSLU_VERSION );
97
98 wp_localize_script('xs_social_custom', 'rest_api_conf', array(
99 'siteurl' => get_option('siteurl'),
100 'nonce' => wp_create_nonce('wp_rest'),
101 'root' => get_rest_url(),
102 ));
103
104 wp_localize_script('xs_social_custom', 'wsluFrontObj', [
105 'resturl' => get_rest_url(),
106 'rest_nonce' => wp_create_nonce('wp_rest'),
107 ]);
108
109 wp_enqueue_script( 'xs_social_custom' );
110 }
111 }
112