PluginProbe
Wp Social Login and Register Social Counter / 2.0.0
Wp Social Login and Register Social Counter v2.0.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
334 lines 10.7 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: 2.0.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', '2.0.0');
18 define('WSLU_VERSION_PREVIOUS_STABLE_VERSION', '1.9.0');
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://www.facebook.com/groups/1319571704894531',
111 'title' => 'Join the Community',
112 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/community.png',
113 'description' => 'Join our Facebook group to get 20% discount coupon on premium products. Follow us to get more exciting offers.'
114 ])
115 ->set_page_grid([
116 'url' => 'https://www.youtube.com/playlist?list=PL3t2OjZ6gY8PnEdvPuCiz1goxm8wBTn-f',
117 'title' => 'Video Tutorials',
118 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/videos.png',
119 'description' => 'Learn the step by step process for developing your site easily from video tutorials.'
120 ])
121 ->set_page_grid(
122 array(
123 'url' => 'https://wpmet.com/plugin/wp-social/roadmaps#ideas',
124 'title' => 'Request a feature',
125 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/request.png',
126 'description' => 'Have any special feature in mind? Let us know through the feature request.'
127 )
128 )
129 ->set_page_grid([
130 'url' => 'https://wpmet.com/doc/wp-social/',
131 'title' => 'Documentation',
132 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/community.png',
133 'description' => 'Detailed documentation to help you understand the functionality of each feature.'
134 ])
135 ->set_page_grid(
136 array(
137 'url' => 'https://wpmet.com/plugin/wp-social/roadmaps/',
138 'title' => 'Public Roadmap',
139 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/roadmaps.png',
140 'description' => 'Check our upcoming new features, detailed development stories and tasks'
141 )
142 )
143 ->set_products(
144 array(
145 'url' => 'https://getgenie.ai/',
146 'title' => 'GetGenie',
147 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/onboard/assets/images/onboard/getgenie-logo.svg',
148 'description' => 'Your AI-Powered Content & SEO Assistant for WordPress',
149 )
150 )
151 ->set_products(
152 array(
153 'url' => 'https://wpmet.com/plugin/elementskit/',
154 'title' => 'WP Social',
155 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/onboard/assets/images/onboard/elementskit-logo.svg',
156 'description' => 'All-in-One drag and drop Addons for Elementor'
157 )
158 )
159 ->set_products(
160 array(
161 'url' => 'https://wpmet.com/plugin/shopengine/',
162 'title' => 'ShopEngine',
163 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/onboard/assets/images/onboard/shopengine-logo.svg',
164 'description' => 'Complete WooCommerce Solution for Elementor',
165 )
166 )
167 ->set_products(
168 array(
169 'url' => 'https://wpmet.com/plugin/metform/',
170 'title' => 'MetForm',
171 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/onboard/assets/images/onboard/metform-logo.svg',
172 'description' => 'Most flexible drag-and-drop form builder'
173 )
174 )
175 ->set_products(
176 array(
177 'url' => 'https://wpmet.com/plugin/wp-ultimate-review/?ref=wpmet',
178 'title' => 'Ultimate Review',
179 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/onboard/assets/images/onboard/ultimate-review-logo.svg',
180 'description' => 'Integrate various styled review system in your website'
181 )
182 )
183 ->set_products(
184 array(
185 'url' => 'https://products.wpmet.com/crowdfunding/?ref=wpmet',
186 'title' => 'Fundraising & Donation Platform',
187 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/onboard/assets/images/onboard/wp-fundraising-logo.svg',
188 'description' => 'Enable donation system in your website'
189 )
190 )
191 ->set_plugin_row_meta('Documentation', 'https://help.wpmet.com/docs-cat/wp-social/', ['target' => '_blank'])
192 ->set_plugin_row_meta('Facebook Community', 'https://wpmet.com/fb-group', ['target' => '_blank'])
193 ->set_plugin_row_meta('Rate the plugin �
194
195
196
197
198 ', 'https://wordpress.org/support/plugin/wp-social/reviews/#new-post', ['target' => '_blank'])
199 ->set_plugin_action_link('Settings', admin_url() . 'admin.php?page=wslu_global_setting')
200 ->set_plugin_action_link(($is_pro_active ? '' : 'Go Premium'), 'https://wpmet.com/plugin/wp-social', ['target' => '_blank', 'style' => 'color: #FCB214; font-weight: bold;'])
201 ->call();
202
203
204 $filter_string = ''; // elementskit,metform-pro
205 $filter_string .= ((!in_array('elementskit/elementskit.php', apply_filters('active_plugins', get_option('active_plugins')))) ? '' : ',elementskit');
206 $filter_string .= ((!in_array('wp-social/wp-social.php', apply_filters('active_plugins', get_option('active_plugins')))) ? '' : ',wp-social');
207 $filter_string .= (!class_exists('\MetForm\Plugin') ? '' : ',metform');
208 $filter_string .= (!class_exists('\MetForm_Pro\Plugin') ? '' : ',metform-pro');
209
210 /**
211 * Show WPMET stories widget in dashboard
212 */
213 \Wpmet\Libs\Stories::instance('wp-social')
214 ->set_filter($filter_string)
215 ->set_plugin('Wpsocial', 'https://wpmet.com/plugin/wp-social/')
216 ->set_api_url('https://api.wpmet.com/public/stories/')
217 ->call();
218
219
220 add_action('widgets_init', '\WP_Social\Inc\Counter_Widget::register');
221 add_action('widgets_init', '\WP_Social\Inc\Share_Widget::register');
222 add_action('widgets_init', '\WP_Social\Inc\Login_widget::register');
223
224
225 do_action('wslu_social/plugin_loaded');
226
227
228 \Wpmet\Libs\Banner::instance('wp-social')
229 ->set_filter($filter_string)
230 ->set_api_url('https://api.wpmet.com/public/jhanda/index.php')
231 ->set_plugin_screens('toplevel_page_wslu_global_setting')
232 ->set_plugin_screens('wp-social_page_wslu_share_setting')
233 ->set_plugin_screens('wp-social_page_wslu_counter_setting')
234 ->call();
235
236
237 \WP_Social\Plugin::instance()->enqueue();
238
239 // onboard style
240 if(isset($_GET['wp-social-met-onboard-steps']) && sanitize_text_field($_GET['wp-social-met-onboard-steps']) == 'loaded') {
241 \WP_Social\Lib\Onboard\Attr::instance();
242 }
243 }
244
245 add_action('plugins_loaded', 'wslu_social_init', 118);
246
247 endif;
248
249
250 /**
251 * Below code has no effect right now, but I am going to organize the code step by step
252 * So this will be the root access point
253 *
254 * - for now loading the language by this class
255 * -
256 *
257 */
258 if(!class_exists('\WP_Social')) {
259
260 class WP_Social {
261
262
263 /**
264 * Plugin plugins's root file
265 *
266 * @return string
267 */
268 static function plugin_file() {
269 return __FILE__;
270 }
271 /**
272 * Plugin plugins's root url.
273 *
274 * todo - WSLU_LOGIN_PLUGIN_URL will be replaced by this method
275 *
276 * @return mixed
277 */
278 static function plugin_url() {
279 return trailingslashit(plugin_dir_url(__FILE__));
280 }
281
282
283 /**
284 * Plugin plugins's root directory.
285 *
286 * todo - WSLU_LOGIN_PLUGIN will be replaced by this method
287 *
288 * @return mixed
289 */
290 static function plugin_dir() {
291 return trailingslashit(plugin_dir_path(__FILE__));
292 }
293
294
295 /**
296 * Lets start the plugin
297 *
298 *
299 */
300 public function __construct() {
301
302 add_action('init', [$this, 'i18n']);
303
304 //add_action('plugins_loaded', array($this, 'init'), 100);
305 }
306
307
308 /**
309 * Load text-domain
310 *
311 * Load plugin localization files.
312 * Fired by `init` action hook.
313 *
314 * @since 1.0.0
315 * @access public
316 */
317 public function i18n() {
318 // onboard
319 \WP_Social\Lib\Onboard\Onboard::instance()->init();
320 load_plugin_textdomain('wp-social', false, dirname(plugin_basename(__FILE__)) . '/languages/');
321 }
322
323
324 public static function is_pro_active() {
325
326 $is_pro_active = in_array('wp-social-pro/wp-social-pro.php', apply_filters('active_plugins', get_option('active_plugins')));
327
328 return $is_pro_active;
329 }
330 }
331 }
332
333 new \WP_Social();
334