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