PluginProbe ʕ •ᴥ•ʔ
Wp Social Login and Register Social Counter / 3.0.8
Wp Social Login and Register Social Counter v3.0.8
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 / wp-social.php
wp-social Last commit date
app 2 years ago assets 1 year ago base 5 years ago helper 3 years ago inc 1 year ago languages 1 year ago lib 1 year ago template 1 year 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 4 years ago readme.txt 1 year ago wp-social.php 1 year ago
wp-social.php
460 lines
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: 3.0.8
8 * Author URI: https://wpmet.com/
9 * Text Domain: wp-social
10 * Domain Path: /languages/
11 * License: GPLv3
12 * License URI: https://www.gnu.org/licenses/gpl-3.0.txt
13 **/
14
15
16 defined('ABSPATH') || exit;
17
18 define('WSLU_VERSION', '3.0.8');
19 define('WSLU_VERSION_PREVIOUS_STABLE_VERSION', '3.0.7');
20
21 define("WSLU_LOGIN_PLUGIN", plugin_dir_path(__FILE__));
22 define("WSLU_LOGIN_PLUGIN_URL", plugin_dir_url(__FILE__));
23
24
25 require(WSLU_LOGIN_PLUGIN . 'autoload.php');
26
27 require_once plugin_dir_path(__FILE__) . '/lib/notice/notice.php';
28 require_once plugin_dir_path(__FILE__) . '/lib/banner/banner.php';
29 require_once plugin_dir_path(__FILE__) . '/lib/pro-awareness/pro-awareness.php';
30 require_once plugin_dir_path(__FILE__) . '/lib/rating/rating.php';
31 require_once plugin_dir_path(__FILE__) . '/lib/stories/stories.php';
32 require_once plugin_dir_path(__FILE__) . '/lib/plugins/plugins.php';
33
34 // init notice class
35 \Oxaim\Libs\Notice::init();
36
37 if(!function_exists('xs_social_plugin_activate')) :
38 function xs_social_plugin_activate() {
39 $counter = new \WP_Social\Inc\Counter(false);
40 $counter->xs_counter_defalut_providers();
41 }
42
43 // custom function added
44 if(file_exists(WSLU_LOGIN_PLUGIN . 'inc/custom-function.php')) {
45 include(WSLU_LOGIN_PLUGIN . 'inc/custom-function.php');
46 }
47 endif;
48
49
50 function xs_social_plugin_deactivate() {
51 }
52
53 register_activation_hook(__FILE__, 'xs_social_plugin_activate');
54 register_deactivation_hook(__FILE__, 'xs_social_plugin_deactivate');
55
56
57 if(!function_exists('wslu_social_init')) :
58
59 function wslu_social_init() {
60
61 new \WP_Social\App\Legacy();
62
63 \WP_Social\Inc\Elementor\Elements::instance()->_init();
64
65 \WP_Social\App\API_Routes::instance()->init();
66
67 new \WP_Social\App\Route();
68
69 new \WP_Social\Inc\Admin_Settings();
70 new \WP_Social\Inc\Counter();
71 new \WP_Social\Inc\Share();
72
73 \WP_Social\Helper\Share_Style_Settings::instance()->init();
74 \WP_Social\Inc\Login::instance()->init();
75 \WP_Social\App\Avatar::instance()->init();
76
77 if( get_option( 'wp_social_user_consent_for_promotional_content', 'yes' ) == 'yes' ){
78 /**
79 * ----------------------------------------
80 * Ask for rating ⭐⭐⭐⭐⭐
81 * A rating notice will appear depends on
82 *
83 * @set_first_appear_day methods
84 * ----------------------------------------
85 */
86 \Wpmet\Libs\Rating::instance('wp-social')
87 ->set_plugin_logo('https://ps.w.org/wp-social/assets/icon-128x128.png')
88 ->set_plugin('Wpsocial', 'https://wordpress.org/plugins/wp-social')
89 ->set_allowed_screens('toplevel_page_wslu_global_setting')
90 ->set_allowed_screens('wp-social_page_wslu_share_setting')
91 ->set_allowed_screens('wp-social_page_wslu_counter_setting')
92 ->set_allowed_screens('wp-social_page_wp-social_get_help')
93 ->set_priority(50)
94 ->set_first_appear_day(7)
95 ->set_condition(true)
96 ->call();
97 }
98
99
100 \Wpmet\Libs\Pro_Awareness::init();
101
102
103 $is_pro_active = in_array('wp-social-pro/wp-social-pro.php', apply_filters('active_plugins', get_option('active_plugins')));
104
105 $pro_awareness = \Wpmet\Libs\Pro_Awareness::instance('wp-social');
106 if(version_compare($pro_awareness->get_version(), '1.2.0') >= 0) {
107 $pro_awareness
108 ->set_parent_menu_slug('wslu_global_setting')
109 ->set_plugin_file('wp-social/wp-social.php')
110 ->set_pro_link(
111 ($is_pro_active ? '' : 'https://wpmet.com/plugin/wp-social/')
112 )
113 ->set_default_grid_link('https://wpmet.com/support-ticket')
114 ->set_default_grid_thumbnail(WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/support.png')
115 ->set_page_grid([
116 'url' => 'https://www.facebook.com/groups/1319571704894531',
117 'title' => __('Join the Community', 'wp-social'),
118 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/community.png',
119 'description' => __('Join our Facebook group to get 20% discount coupon on premium products. Follow us to get more exciting offers.', 'wp-social')
120 ])
121 ->set_page_grid([
122 'url' => 'https://www.youtube.com/playlist?list=PL3t2OjZ6gY8PnEdvPuCiz1goxm8wBTn-f',
123 'title' => __('Video Tutorials', 'wp-social'),
124 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/videos.png',
125 'description' => __('Learn the step by step process for developing your site easily from video tutorials.', 'wp-social')
126 ])
127 ->set_page_grid(
128 array(
129 'url' => 'https://wpmet.com/plugin/wp-social/roadmaps#ideas',
130 'title' => __('Request a feature', 'wp-social'),
131 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/request.png',
132 'description' => __('Have any special feature in mind? Let us know through the feature request.', 'wp-social')
133 )
134 )
135 ->set_page_grid([
136 'url' => 'https://wpmet.com/doc/wp-social/',
137 'title' => __('Documentation', 'wp-social'),
138 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/community.png',
139 'description' => __('Detailed documentation to help you understand the functionality of each feature.', 'wp-social')
140 ])
141 ->set_page_grid(
142 array(
143 'url' => 'https://wpmet.com/plugin/wp-social/roadmaps/',
144 'title' => __('Public Roadmap', 'wp-social'),
145 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/pro-awareness/assets/roadmaps.png',
146 'description' => __('Check our upcoming new features, detailed development stories and tasks', 'wp-social')
147 )
148 )
149 ->set_products(
150 array(
151 'url' => 'https://getgenie.ai/',
152 'title' => __('GetGenie', 'wp-social'),
153 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/onboard/assets/images/onboard/getgenie-logo.svg',
154 'description' => __('Your AI-Powered Content & SEO Assistant for WordPress', 'wp-social'),
155 )
156 )
157 ->set_products(
158 array(
159 'url' => 'https://wpmet.com/plugin/elementskit/',
160 'title' => __('WP Social', 'wp-social'),
161 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/onboard/assets/images/onboard/elementskit-logo.svg',
162 'description' => __('All-in-One drag and drop Addons for Elementor', 'wp-social')
163 )
164 )
165 ->set_products(
166 array(
167 'url' => 'https://wpmet.com/plugin/shopengine/',
168 'title' => __('ShopEngine', 'wp-social'),
169 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/onboard/assets/images/onboard/shopengine-logo.svg',
170 'description' => __('Complete WooCommerce Solution for Elementor', 'wp-social'),
171 )
172 )
173 ->set_products(
174 array(
175 'url' => 'https://wpmet.com/plugin/metform/',
176 'title' => __('MetForm', 'wp-social'),
177 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/onboard/assets/images/onboard/metform-logo.svg',
178 'description' => __('Most flexible drag-and-drop form builder', 'wp-social')
179 )
180 )
181 ->set_products(
182 array(
183 'url' => 'https://wpmet.com/plugin/wp-ultimate-review/?ref=wpmet',
184 'title' => __('Ultimate Review', 'wp-social'),
185 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/onboard/assets/images/onboard/ultimate-review-logo.svg',
186 'description' => __('Integrate various styled review system in your website', 'wp-social')
187 )
188 )
189 ->set_products(
190 array(
191 'url' => 'https://products.wpmet.com/crowdfunding/?ref=wpmet',
192 'title' => __('Fundraising & Donation Platform', 'wp-social'),
193 'thumbnail' => WSLU_LOGIN_PLUGIN_URL . 'lib/onboard/assets/images/onboard/wp-fundraising-logo.svg',
194 'description' => __('Enable donation system in your website', 'wp-social')
195 )
196 )
197 ->set_plugin_row_meta('Documentation', 'https://help.wpmet.com/docs-cat/wp-social/', ['target' => '_blank'])
198 ->set_plugin_row_meta('Facebook Community', 'https://wpmet.com/fb-group', ['target' => '_blank'])
199 ->set_plugin_row_meta('Rate the plugin �
200
201
202
203
204 ', 'https://wordpress.org/support/plugin/wp-social/reviews/#new-post', ['target' => '_blank'])
205 ->set_plugin_action_link('Settings', admin_url() . 'admin.php?page=wslu_global_setting')
206 ->set_plugin_action_link(($is_pro_active ? '' : 'Go Premium'), 'https://wpmet.com/plugin/wp-social', ['target' => '_blank', 'style' => 'color: #FCB214; font-weight: bold;'])
207 ->call();
208 }
209
210
211 $apps_img_path = WSLU_LOGIN_PLUGIN_URL . 'assets/images/apps-page/';
212
213 /**
214 * Show our plugins menu for others wpmet plugins
215 */
216 \WP_Social\Wpmet\Libs\Plugins::instance()->init('wp-social')
217 ->set_parent_menu_slug('wslu_global_setting')
218 ->set_submenu_name('Our Plugins')
219 ->set_section_title('Time to Get More out of Your WordPress Website!')
220 ->set_section_description('Revamp your website with other top plugins from us. And guess what, they\'re absolutely free!')
221 ->set_items_per_row(4)
222 ->set_plugins(
223 [
224 'elementskit-lite/elementskit-lite.php' => [
225 'name' => esc_html__('ElementsKit', 'wp-social'),
226 'url' => 'https://wordpress.org/plugins/elementskit-lite/',
227 'icon' => $apps_img_path. 'elementskit.gif',
228 'desc' => esc_html__('All-in-one Elementor addon trusted by 1 Million+ users, makes your website builder process easier with ultimate freedom.
229 ', 'wp-social'),
230 'docs' => 'https://wpmet.com/doc/elementskit/',
231 ],
232 'getgenie/getgenie.php' => [
233 'name' => esc_html__('GetGenie', 'wp-social'),
234 'url' => 'https://wordpress.org/plugins/getgenie/',
235 'icon' => $apps_img_path.'getgenie.gif',
236 'desc' => esc_html__('Your personal AI assistant for content and SEO. Write content that ranks on Google with NLP keywords and SERP analysis data.', 'wp-social'),
237 'docs' => 'https://getgenie.ai/docs/',
238 ],
239 'gutenkit-blocks-addon/gutenkit-blocks-addon.php' => [
240 'name' => esc_html__('GutenKit', 'wp-social'),
241 'url' => 'https://wordpress.org/plugins/gutenkit-blocks-addon/',
242 'icon' => $apps_img_path. 'guten-kit.png',
243 'desc' => esc_html__('Gutenberg blocks, patterns, and templates that extend the page-building experience using the WordPress block editor.', 'wp-social'),
244 'docs' => 'https://wpmet.com/doc/gutenkit/',
245 ],
246 'shopengine/shopengine.php' => [
247 'name' => esc_html__('Shopengine', 'wp-social'),
248 'url' => 'https://wordpress.org/plugins/shopengine/',
249 'icon' => $apps_img_path. 'shopengine.gif',
250 'desc' => esc_html__('Complete WooCommerce solution for Elementor to fully customize any pages including cart, checkout, shop page, and so on.
251 ', 'wp-social'),
252 'docs' => 'https://wpmet.com/doc/shopengine/',
253 ],
254 'metform/metform.php' => [
255 'name' => esc_html__('MetForm', 'wp-social'),
256 'url' => 'https://wordpress.org/plugins/metform/',
257 'icon' => $apps_img_path. 'metform.png',
258 'desc' => esc_html__('Drag & drop form builder for Elementor to create contact forms, multi-step forms, and more — smoother, faster, and better!
259 ', 'wp-social'),
260 'docs' => 'https://wpmet.com/doc/metform/',
261 ],
262 'emailkit/EmailKit.php' => [
263 'name' => esc_html__('EmailKit', 'wp-social'),
264 'url' => 'https://wordpress.org/plugins/emailkit/',
265 'icon' => $apps_img_path . 'emailkit.png',
266 'desc' => esc_html__('Advanced email customizer for WooCommerce and WordPress. Build, customize, and send emails from WordPress to boost your sales!', 'wp-social'),
267 'docs' => 'https://wpmet.com/doc/emailkit/',
268 ],
269 'wp-ultimate-review/wp-ultimate-review.php' => [
270 'name' => esc_html__('WP Ultimate Review', 'wp-social'),
271 'url' => 'https://wordpress.org/plugins/wp-ultimate-review/',
272 'icon' => $apps_img_path . 'ultimate-review.png',
273 'desc' => esc_html__('Collect and showcase reviews on your website to build brand credibility and social proof with the easiest solution.
274 ', 'wp-social'),
275 'docs' => 'https://wpmet.com/doc/wp-ultimate-review/',
276 ],
277 'wp-fundraising-donation/wp-fundraising.php' => [
278 'name' => esc_html__('FundEngine', 'wp-social'),
279 'url' => 'https://wordpress.org/plugins/wp-fundraising-donation/',
280 'icon' => $apps_img_path . 'fundengine.png',
281 'desc' => esc_html__('Create fundraising, crowdfunding, and donation websites with PayPal and Stripe payment gateway integration.
282 ', 'wp-social'),
283 'docs' => 'https://wpmet.com/doc/fundengine/',
284 ],
285 'blocks-for-shopengine/shopengine-gutenberg-addon.php' => [
286 'name' => esc_html__('Blocks for ShopEngine', 'wp-social'),
287 'url' => 'https://wordpress.org/plugins/blocks-for-shopengine/',
288 'icon' => $apps_img_path. 'shopengine.gif',
289 'desc' => esc_html__('All in one WooCommerce solution for Gutenberg! Build your WooCommerce pages in a block editor with full customization.
290 ', 'wp-social'),
291 'docs' => 'https://wpmet.com/doc/shopengine/shopengine-gutenberg/',
292 ],
293 'genie-image-ai/genie-image-ai.php' => [
294 'name' => esc_html__('Genie Image', 'wp-social'),
295 'url' => 'https://wordpress.org/plugins/genie-image-ai/',
296 'icon' => $apps_img_path . 'genie-image.png',
297 'desc' => esc_html__('AI-powered text-to-image generator for WordPress with OpenAI’s DALL-E 2 technology to generate high-quality images in one click.', 'wp-social'),
298 'docs' => 'https://getgenie.ai/docs/',
299 ],
300 ]
301 )
302 ->call();
303
304
305 $filter_string = ''; // elementskit,metform-pro
306 $filter_string .= ((!in_array('elementskit/elementskit.php', apply_filters('active_plugins', get_option('active_plugins')))) ? '' : ',elementskit');
307 $filter_string .= ((!in_array('wp-social/wp-social.php', apply_filters('active_plugins', get_option('active_plugins')))) ? '' : ',wp-social');
308 $filter_string .= (!class_exists('\MetForm\Plugin') ? '' : ',metform');
309 $filter_string .= (!class_exists('\MetForm_Pro\Plugin') ? '' : ',metform-pro');
310
311 if( get_option( 'wp_social_user_consent_for_promotional_content', 'yes' ) == 'yes' ){
312 /**
313 * Show WPMET stories widget in dashboard
314 */
315 \Wpmet\Libs\Stories::instance('wp-social')
316 ->set_filter($filter_string)
317 ->set_plugin('Wpsocial', 'https://wpmet.com/plugin/wp-social/')
318 ->set_api_url('https://api.wpmet.com/public/stories/')
319 ->call();
320 }
321
322
323 add_action('widgets_init', '\WP_Social\Inc\Counter_Widget::register');
324 add_action('widgets_init', '\WP_Social\Inc\Share_Widget::register');
325 add_action('widgets_init', '\WP_Social\Inc\Login_widget::register');
326
327
328 do_action('wslu_social/plugin_loaded');
329
330 if( get_option( 'wp_social_user_consent_for_promotional_content', 'yes' ) == 'yes' ){
331 \Wpmet\Libs\Banner::instance('wp-social')
332 ->set_filter($filter_string)
333 ->set_api_url('https://api.wpmet.com/public/jhanda/index.php')
334 ->set_plugin_screens('toplevel_page_wslu_global_setting')
335 ->set_plugin_screens('wp-social_page_wslu_share_setting')
336 ->set_plugin_screens('wp-social_page_wslu_counter_setting')
337 ->call();
338 }
339
340
341 \WP_Social\Plugin::instance()->enqueue();
342
343 // onboard style
344 if(isset($_GET['wp-social-met-onboard-steps']) && sanitize_text_field($_GET['wp-social-met-onboard-steps']) == 'loaded') {
345 \WP_Social\Lib\Onboard\Attr::instance();
346 }
347
348 /**
349 * Initializes the Template Library of the Gutenkit plugin
350 *
351 * This code block checks if certain conditions are met and then initializes the Template Library of the Gutenkit plugin.
352 *
353 * Conditions:
354 * - The class '\WP_Social\Lib\Template_Library\Init' exists.
355 * - The plugin 'gutenkit-blocks-addon' is not active or install.
356 *
357 * If any of the above conditions are met, the Template Library is initialized by creating a new instance of
358 * the class '\WP_Social\Lib\Template_Library\Init'.
359 *
360 * @since 3.0.3
361 */
362 if ( get_option( 'wp_social_user_consent_for_promotional_content', 'yes' ) == 'yes' && class_exists('\WP_Social\Lib\Template_Library\Init' ) && ! did_action( 'gutenkit/init' ) ) {
363 new \WP_Social\Lib\Template_Library\Init();
364 }
365
366 add_action("wp-social/pro_awareness/before_grid_contents", function() {
367 include \WP_Social\Plugin::instance()->lib_dir() . 'user-consent-banner/consent-check-view.php';
368 });
369 }
370
371 add_action('plugins_loaded', 'wslu_social_init', 118);
372
373 endif;
374
375
376 /**
377 * Below code has no effect right now, but I am going to organize the code step by step
378 * So this will be the root access point
379 *
380 * - for now loading the language by this class
381 * -
382 *
383 */
384 if(!class_exists('\WP_Social')) {
385
386 class WP_Social {
387
388
389 /**
390 * Plugin plugins's root file
391 *
392 * @return string
393 */
394 static function plugin_file() {
395 return __FILE__;
396 }
397 /**
398 * Plugin plugins's root url.
399 *
400 * todo - WSLU_LOGIN_PLUGIN_URL will be replaced by this method
401 *
402 * @return mixed
403 */
404 static function plugin_url() {
405 return trailingslashit(plugin_dir_url(__FILE__));
406 }
407
408
409 /**
410 * Plugin plugins's root directory.
411 *
412 * todo - WSLU_LOGIN_PLUGIN will be replaced by this method
413 *
414 * @return mixed
415 */
416 static function plugin_dir() {
417 return trailingslashit(plugin_dir_path(__FILE__));
418 }
419
420
421 /**
422 * Lets start the plugin
423 *
424 *
425 */
426 public function __construct() {
427
428 add_action('init', [$this, 'i18n']);
429
430 //add_action('plugins_loaded', array($this, 'init'), 100);
431 }
432
433
434 /**
435 * Load text-domain
436 *
437 * Load plugin localization files.
438 * Fired by `init` action hook.
439 *
440 * @since 1.0.0
441 * @access public
442 */
443 public function i18n() {
444 // onboard
445 \WP_Social\Lib\Onboard\Onboard::instance()->init();
446 load_plugin_textdomain('wp-social', false, dirname(plugin_basename(__FILE__)) . '/languages/');
447 }
448
449
450 public static function is_pro_active() {
451
452 $is_pro_active = in_array('wp-social-pro/wp-social-pro.php', apply_filters('active_plugins', get_option('active_plugins')));
453
454 return $is_pro_active;
455 }
456 }
457 }
458
459 new \WP_Social();
460