PluginProbe
Wp Social Login and Register Social Counter / 1.9.0
Wp Social Login and Register Social Counter v1.9.0
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 All 70 releases
wp-social / wp-social.php

wp-social.php in Wp Social Login and Register Social Counter 1.9.0, at wp-social.php

267 lines 8.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 * Plugin Name: Wp Social
4 * Plugin URI: https://wpmet.com/
5 * Description: Wp Social Login / Social Sharing / Social Counter System for Facebook, Google, Twitter, Linkedin, Dribble, Pinterest, Wordpress, Instagram, GitHub, Vkontakte, Reddit and more providers.
6 * Author: Wpmet
7 * Version: 1.9.0
8 * Author URI: https://wpmet.com/
9 * Text Domain: wp-social
10 * License: GPL2+
11 * Domain Path: /languages/
12 **/
13
14
15 defined('ABSPATH') || exit;
16
17 define('WSLU_VERSION', '1.9.0');
18 define('WSLU_VERSION_PREVIOUS_STABLE_VERSION', '1.8.6');
19
20 define("WSLU_LOGIN_PLUGIN", plugin_dir_path(__FILE__));
21 define("WSLU_LOGIN_PLUGIN_URL", plugin_dir_url(__FILE__));
22
23
24 require(WSLU_LOGIN_PLUGIN . 'autoload.php');
25
26 require_once plugin_dir_path(__FILE__) . '/lib/notice/notice.php';
27 require_once plugin_dir_path(__FILE__) . '/lib/banner/banner.php';
28 require_once plugin_dir_path(__FILE__) . '/lib/pro-awareness/pro-awareness.php';
29 require_once plugin_dir_path(__FILE__) . '/lib/rating/rating.php';
30 require_once plugin_dir_path(__FILE__) . '/lib/stories/stories.php';
31
32 // init notice class
33 \Oxaim\Libs\Notice::init();
34
35 if(!function_exists('xs_social_plugin_activate')) :
36 function xs_social_plugin_activate() {
37 $counter = new \WP_Social\Inc\Counter(false);
38 $counter->xs_counter_defalut_providers();
39 }
40
41 // custom function added
42 if(file_exists(WSLU_LOGIN_PLUGIN . 'inc/custom-function.php')) {
43 include(WSLU_LOGIN_PLUGIN . 'inc/custom-function.php');
44 }
45 endif;
46
47
48 function xs_social_plugin_deactivate() {
49 }
50
51 register_activation_hook(__FILE__, 'xs_social_plugin_activate');
52 register_deactivation_hook(__FILE__, 'xs_social_plugin_deactivate');
53
54
55 if(!function_exists('wslu_social_init')) :
56
57 function wslu_social_init() {
58
59 new \WP_Social\App\Legacy();
60
61 \WP_Social\Inc\Elementor\Elements::instance()->_init();
62
63 \WP_Social\App\API_Routes::instance()->init();
64
65 new \WP_Social\App\Route();
66
67 new \WP_Social\Inc\Admin_Settings();
68 new \WP_Social\Inc\Counter();
69 new \WP_Social\Inc\Share();
70
71 \WP_Social\Helper\Share_Style_Settings::instance()->init();
72 \WP_Social\Inc\Login::instance()->init();
73 \WP_Social\App\Avatar::instance()->init();
74
75 /**
76 * ----------------------------------------
77 * Ask for rating ⭐⭐⭐⭐⭐
78 * A rating notice will appear depends on
79 *
80 * @set_first_appear_day methods
81 * ----------------------------------------
82 */
83 \Wpmet\Libs\Rating::instance('wp-social')
84 ->set_plugin_logo('https://ps.w.org/wp-social/assets/icon-128x128.png')
85 ->set_plugin('Wpsocial', 'https://wordpress.org/plugins/wp-social')
86 ->set_allowed_screens('toplevel_page_wslu_global_setting')
87 ->set_allowed_screens('wp-social_page_wslu_share_setting')
88 ->set_allowed_screens('wp-social_page_wslu_counter_setting')
89 ->set_allowed_screens('wp-social_page_wp-social_get_help')
90 ->set_priority(50)
91 ->set_first_appear_day(7)
92 ->set_condition(true)
93 ->call();
94
95
96 \Wpmet\Libs\Pro_Awareness::init();
97
98
99 $is_pro_active = in_array('wp-social-pro/wp-social-pro.php', apply_filters('active_plugins', get_option('active_plugins')));
100
101 \Wpmet\Libs\Pro_Awareness::instance('wp-social')
102 ->set_parent_menu_slug('wslu_global_setting')
103 ->set_plugin_file('wp-social/wp-social.php')
104 ->set_pro_link(
105 ($is_pro_active ? '' : 'https://wpmet.com/plugin/wp-social/')
106 )
107 ->set_default_grid_link('https://wpmet.com/support-ticket')
108 ->set_default_grid_thumbnail(WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/support.png')
109 ->set_page_grid([
110 'url' => 'https://help.wpmet.com/docs-cat/wp-social/',
111 'title' => 'Documentation',
112 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/community.png',
113 ])
114 ->set_page_grid([
115 'url' => 'https://www.facebook.com/groups/1319571704894531',
116 'title' => 'Join the Community',
117 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/community.png',
118 ])
119 ->set_page_grid([
120 'url' => 'https://www.youtube.com/playlist?list=PL3t2OjZ6gY8PnEdvPuCiz1goxm8wBTn-f',
121 'title' => 'Video Tutorials',
122 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/videos.png',
123 ])
124 ->set_plugin_row_meta('Documentation', 'https://help.wpmet.com/docs-cat/wp-social/', ['target' => '_blank'])
125 ->set_plugin_row_meta('Facebook Community', 'https://wpmet.com/fb-group', ['target' => '_blank'])
126 ->set_plugin_row_meta('Rate the plugin �
127
128
129
130
131 ', 'https://wordpress.org/support/plugin/wp-social/reviews/#new-post', ['target' => '_blank'])
132 ->set_plugin_action_link('Settings', admin_url() . 'admin.php?page=wslu_global_setting')
133 ->set_plugin_action_link(($is_pro_active ? '' : 'Go Premium'), 'https://wpmet.com/plugin/wp-social', ['target' => '_blank', 'style' => 'color: #FCB214; font-weight: bold;'])
134 ->call();
135
136
137 $filter_string = ''; // elementskit,metform-pro
138 $filter_string .= ((!in_array('elementskit/elementskit.php', apply_filters('active_plugins', get_option('active_plugins')))) ? '' : ',elementskit');
139 $filter_string .= ((!in_array('wp-social/wp-social.php', apply_filters('active_plugins', get_option('active_plugins')))) ? '' : ',wp-social');
140 $filter_string .= (!class_exists('\MetForm\Plugin') ? '' : ',metform');
141 $filter_string .= (!class_exists('\MetForm_Pro\Plugin') ? '' : ',metform-pro');
142
143 /**
144 * Show WPMET stories widget in dashboard
145 */
146 \Wpmet\Libs\Stories::instance('wp-social')
147 ->set_filter($filter_string)
148 ->set_plugin('Wpsocial', 'https://wpmet.com/plugin/wp-social/')
149 ->set_api_url('https://api.wpmet.com/public/stories/')
150 ->call();
151
152
153 add_action('widgets_init', '\WP_Social\Inc\Counter_Widget::register');
154 add_action('widgets_init', '\WP_Social\Inc\Share_Widget::register');
155 add_action('widgets_init', '\WP_Social\Inc\Login_widget::register');
156
157
158 do_action('wslu_social/plugin_loaded');
159
160
161 \Wpmet\Libs\Banner::instance('wp-social')
162 ->set_filter($filter_string)
163 ->set_api_url('https://api.wpmet.com/public/jhanda/index.php')
164 ->set_plugin_screens('toplevel_page_wslu_global_setting')
165 ->set_plugin_screens('wp-social_page_wslu_share_setting')
166 ->set_plugin_screens('wp-social_page_wslu_counter_setting')
167 ->call();
168
169
170 \WP_Social\Plugin::instance()->enqueue();
171
172 // onboard style
173 if(isset($_GET['wp-social-met-onboard-steps']) && $_GET['wp-social-met-onboard-steps'] == 'loaded') {
174 \WP_Social\Lib\Onboard\Attr::instance();
175 }
176 }
177
178 add_action('plugins_loaded', 'wslu_social_init', 118);
179
180 endif;
181
182
183 /**
184 * Below code has no effect right now, but I am going to organize the code step by step
185 * So this will be the root access point
186 *
187 * - for now loading the language by this class
188 * -
189 *
190 */
191 if(!class_exists('\WP_Social')) {
192
193 class WP_Social {
194
195
196 /**
197 * Plugin plugins's root file
198 *
199 * @return string
200 */
201 static function plugin_file() {
202 return __FILE__;
203 }
204 /**
205 * Plugin plugins's root url.
206 *
207 * todo - WSLU_LOGIN_PLUGIN_URL will be replaced by this method
208 *
209 * @return mixed
210 */
211 static function plugin_url() {
212 return trailingslashit(plugin_dir_url(__FILE__));
213 }
214
215
216 /**
217 * Plugin plugins's root directory.
218 *
219 * todo - WSLU_LOGIN_PLUGIN will be replaced by this method
220 *
221 * @return mixed
222 */
223 static function plugin_dir() {
224 return trailingslashit(plugin_dir_path(__FILE__));
225 }
226
227
228 /**
229 * Lets start the plugin
230 *
231 *
232 */
233 public function __construct() {
234
235 add_action('init', [$this, 'i18n']);
236
237 //add_action('plugins_loaded', array($this, 'init'), 100);
238 }
239
240
241 /**
242 * Load text-domain
243 *
244 * Load plugin localization files.
245 * Fired by `init` action hook.
246 *
247 * @since 1.0.0
248 * @access public
249 */
250 public function i18n() {
251 // onboard
252 \WP_Social\Lib\Onboard\Onboard::instance()->init();
253 load_plugin_textdomain('wp-social', false, dirname(plugin_basename(__FILE__)) . '/languages/');
254 }
255
256
257 public static function is_pro_active() {
258
259 $is_pro_active = in_array('wp-social-pro/wp-social-pro.php', apply_filters('active_plugins', get_option('active_plugins')));
260
261 return $is_pro_active;
262 }
263 }
264 }
265
266 new \WP_Social();
267