PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 3.2.1
Wp Social Login and Register Social Counter v3.2.1
3.2.1 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 weeks ago assets 2 weeks ago base 5 years ago helper 2 weeks ago inc 2 weeks ago languages 2 weeks ago lib 2 weeks ago template 2 weeks ago traits 5 years ago xs_migration 3 years ago autoload.php 5 years ago instruction.txt 5 years ago keys.php 5 years ago phpcs.xml 3 years ago plugin.php 2 weeks ago readme.txt 2 weeks ago wp-social.php 2 weeks ago
plugin.php
124 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('xs_login_custom_js1', 'xsLoginCustomI18n', array(
70 'settings' => __('Settings', 'wp-social'),
71 'gettingStarted' => __('Getting Started', 'wp-social'),
72 'waiting' => __('Waiting...', 'wp-social'),
73 'error' => __('Error!!!', 'wp-social'),
74 'unexpectedError' => __('Unexpected error, please reload the page and retry', 'wp-social'),
75 ));
76
77 wp_localize_script('wslu_admin', 'wsluAdminObj', [
78 'resturl' => get_rest_url(),
79 'rest_nonce' => wp_create_nonce('wp_rest'),
80 'i18n' => [
81 'search' => __('Search...', 'wp-social'),
82 'errorText' => __('Error:', 'wp-social'),
83 ],
84 ]);
85
86 wp_enqueue_script( 'xs_login_custom_js1' );
87 wp_enqueue_script( 'wp_social_select2_js' );
88 wp_enqueue_script( 'wp_social_sortable_js' );
89 wp_enqueue_script( 'wslu_admin' );
90
91
92 wp_register_style( 'xs_login_custom_css1', WSLU_LOGIN_PLUGIN_URL. 'assets/css/admin-login-custom.css',[], WSLU_VERSION );
93 wp_register_style( 'wp_social_select2_css', WSLU_LOGIN_PLUGIN_URL. 'assets/select2/css/select2-min.css',[], WSLU_VERSION );
94 wp_register_style( 'xs_login_custom_css_icon', WSLU_LOGIN_PLUGIN_URL. 'assets/css/font-icon.css',[], WSLU_VERSION );
95 wp_register_style( 'xs_login_custom_css2', WSLU_LOGIN_PLUGIN_URL. 'assets/css/admin.css',[], WSLU_VERSION );
96 wp_register_style( 'xs_login_custom_css3', WSLU_LOGIN_PLUGIN_URL. 'assets/css/admin-responsive.css',[], WSLU_VERSION );
97
98 wp_enqueue_style( 'xs_login_custom_css1' );
99 wp_enqueue_style( 'wp_social_select2_css' );
100 wp_enqueue_style( 'xs_login_custom_css2' );
101 wp_enqueue_style( 'xs_login_custom_css3' );
102 wp_enqueue_style( 'xs_login_custom_css_icon' );
103 }
104
105
106 public function load_public_scripts() {
107
108 wp_register_script( 'xs_social_custom', WSLU_LOGIN_PLUGIN_URL. 'assets/js/social-front.js', array('jquery'), WSLU_VERSION );
109
110 wp_localize_script('xs_social_custom', 'rest_api_conf', array(
111 'siteurl' => get_option('siteurl'),
112 'nonce' => wp_create_nonce('wp_rest'),
113 'root' => get_rest_url(),
114 ));
115
116 wp_localize_script('xs_social_custom', 'wsluFrontObj', [
117 'resturl' => get_rest_url(),
118 'rest_nonce' => wp_create_nonce('wp_rest'),
119 ]);
120
121 wp_enqueue_script( 'xs_social_custom' );
122 }
123 }
124