Social Login - Version 6.2.0

Version Description

  • Fix for Unresolved Error in Insert Query
Download this release

Release Info

Developer cyberlord92
Plugin Icon 128x128 Social Login
Version 6.2.0
Comparing to
See all releases

Code changes from version 6.1.0 to 6.2.0

Files changed (2) hide show
  1. miniorange_openid_sso_settings.php +72 -77
  2. readme.txt +7 -1
miniorange_openid_sso_settings.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Social Login, Social Sharing by miniOrange
5
  * Plugin URI: https://www.miniorange.com
6
  * Description: Allow your users to login, comment and share with Facebook, Google, Twitter, LinkedIn etc using customizable buttons.
7
- * Version: 6.1.0
8
  * Author: miniOrange
9
  * Author URI: https://www.miniorange.com
10
  * License: GPL2
@@ -29,7 +29,6 @@ class Miniorange_OpenID_SSO {
29
  add_action( 'admin_enqueue_scripts', array( $this, 'mo_openid_plugin_settings_script' ) );
30
  add_action( 'wp_enqueue_scripts', array( $this, 'mo_openid_plugin_settings_style' ) ,5);
31
  add_action( 'wp_enqueue_scripts', array( $this, 'mo_openid_plugin_script' ) ,5);
32
- add_action( 'upgrader_process_complete', array( $this, 'mo_openid_plugin_updates' ), 1 );
33
 
34
  register_deactivation_hook(__FILE__, array( $this, 'mo_openid_deactivate'));
35
  register_activation_hook( __FILE__, array( $this, 'mo_openid_activate' ) );
@@ -202,9 +201,78 @@ class Miniorange_OpenID_SSO {
202
  delete_option( 'mo_openid_admin_customer_valid');
203
  delete_option( 'mo_openid_admin_customer_plan');
204
  }
205
-
 
 
 
206
  function mo_openid_activate() {
207
- add_option('Activated_Plugin','Plugin-Slug');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  }
209
 
210
  function mo_openid_add_social_login(){
@@ -363,79 +431,6 @@ class Miniorange_OpenID_SSO {
363
  function mo_login_widget_text_domain(){
364
  load_plugin_textdomain('flw', FALSE, basename( dirname( __FILE__ ) ) .'/languages');
365
  }
366
-
367
- // create mo_openid_linked_user if it doesn't exist
368
- // + add entries in wp_mo_openid_linked_user table
369
- // + remove columns app name and identifier from wp_users table
370
- function mo_openid_plugin_updates(){
371
-
372
- global $wpdb;
373
- $table_name = $wpdb->prefix . 'mo_openid_linked_user';
374
- $charset_collate = $wpdb->get_charset_collate();
375
-
376
- if($wpdb->get_var("show tables like '$table_name'") != $table_name)
377
- {
378
- $sql = "CREATE TABLE $table_name (
379
- id mediumint(9) NOT NULL AUTO_INCREMENT,
380
- linked_social_app varchar(55) NOT NULL,
381
- linked_email varchar(55) NOT NULL,
382
- user_id mediumint(10) NOT NULL,
383
- identifier VARCHAR(100) NOT NULL,
384
- PRIMARY KEY (id)
385
- ) $charset_collate;";
386
-
387
- require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
388
- dbDelta($sql);
389
- }
390
-
391
- $identifier = $wpdb->get_var("SELECT COLUMN_NAME
392
- FROM information_schema.COLUMNS
393
- WHERE
394
- TABLE_NAME = '$wpdb->users'
395
- AND COLUMN_NAME = 'identifier'");
396
-
397
- if(strcasecmp( $identifier, "identifier") == 0 ){
398
-
399
- $count= $wpdb->get_var("SELECT count(ID) FROM $wpdb->users WHERE identifier not LIKE ''");
400
- $result= $wpdb->get_results("SELECT * FROM $wpdb->users WHERE identifier not LIKE ''");
401
-
402
- for($icnt = 0; $icnt < $count; $icnt = $icnt + 1){
403
-
404
- $provider = $result[$icnt]->provider;
405
- $split_app_name = explode('_', $provider);
406
- $provider = strtolower($split_app_name[0]);
407
- $user_email = $result[$icnt]->user_email;
408
- $ID = $result[$icnt]->ID;
409
- $identifier = $result[$icnt]->identifier;
410
-
411
- $output = $wpdb->insert(
412
- $table_name,
413
- array(
414
- 'linked_social_app' => $provider,
415
- 'linked_email' => $user_email,
416
- 'user_id' => $ID,
417
- 'identifier' => $identifier
418
- ),
419
- array(
420
- '%s',
421
- '%s',
422
- '%d',
423
- '%s'
424
- )
425
- );
426
- if($output === false){
427
- /*$wpdb->show_errors();
428
- $wpdb->print_error();
429
- exit;*/
430
- wp_die('Error in insert Query');
431
- }
432
-
433
- }
434
- $wpdb->get_var("ALTER TABLE $wpdb->users DROP COLUMN provider");
435
- $wpdb->get_var("ALTER TABLE $wpdb->users DROP COLUMN identifier");
436
-
437
- }
438
- }
439
 
440
  public function mo_oauth_check_empty_or_null( $value ) {
441
  if( ! isset( $value ) || empty( $value ) ) {
4
  * Plugin Name: Social Login, Social Sharing by miniOrange
5
  * Plugin URI: https://www.miniorange.com
6
  * Description: Allow your users to login, comment and share with Facebook, Google, Twitter, LinkedIn etc using customizable buttons.
7
+ * Version: 6.2.0
8
  * Author: miniOrange
9
  * Author URI: https://www.miniorange.com
10
  * License: GPL2
29
  add_action( 'admin_enqueue_scripts', array( $this, 'mo_openid_plugin_settings_script' ) );
30
  add_action( 'wp_enqueue_scripts', array( $this, 'mo_openid_plugin_settings_style' ) ,5);
31
  add_action( 'wp_enqueue_scripts', array( $this, 'mo_openid_plugin_script' ) ,5);
 
32
 
33
  register_deactivation_hook(__FILE__, array( $this, 'mo_openid_deactivate'));
34
  register_activation_hook( __FILE__, array( $this, 'mo_openid_activate' ) );
201
  delete_option( 'mo_openid_admin_customer_valid');
202
  delete_option( 'mo_openid_admin_customer_plan');
203
  }
204
+
205
+ // create mo_openid_linked_user if it doesn't exist
206
+ // + add entries in wp_mo_openid_linked_user table
207
+ // + remove columns app name and identifier from wp_users table
208
  function mo_openid_activate() {
209
+ add_option('Activated_Plugin','Plugin-Slug');
210
+
211
+ global $wpdb;
212
+ $table_name = $wpdb->prefix . 'mo_openid_linked_user';
213
+ $charset_collate = $wpdb->get_charset_collate();
214
+
215
+ if($wpdb->get_var("show tables like '$table_name'") != $table_name) {
216
+ $sql = "CREATE TABLE $table_name (
217
+ id mediumint(9) NOT NULL AUTO_INCREMENT,
218
+ linked_social_app varchar(55) NOT NULL,
219
+ linked_email varchar(55) NOT NULL,
220
+ user_id mediumint(10) NOT NULL,
221
+ identifier VARCHAR(100) NOT NULL,
222
+ PRIMARY KEY (id)
223
+ ) $charset_collate;";
224
+
225
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
226
+ dbDelta($sql);
227
+ }
228
+
229
+ $identifier = $wpdb->get_var("SELECT COLUMN_NAME
230
+ FROM information_schema.COLUMNS
231
+ WHERE
232
+ TABLE_NAME = '$wpdb->users'
233
+ AND COLUMN_NAME = 'identifier'");
234
+
235
+ if(strcasecmp( $identifier, "identifier") == 0 ){
236
+
237
+ $count= $wpdb->get_var("SELECT count(ID) FROM $wpdb->users WHERE identifier not LIKE ''");
238
+ $result= $wpdb->get_results("SELECT * FROM $wpdb->users WHERE identifier not LIKE ''");
239
+
240
+ for($icnt = 0; $icnt < $count; $icnt = $icnt + 1){
241
+
242
+ $provider = $result[$icnt]->provider;
243
+ $split_app_name = explode('_', $provider);
244
+ $provider = strtolower($split_app_name[0]);
245
+ $user_email = $result[$icnt]->user_email;
246
+ $ID = $result[$icnt]->ID;
247
+ $identifier = $result[$icnt]->identifier;
248
+
249
+ $output = $wpdb->insert(
250
+ $table_name,
251
+ array(
252
+ 'linked_social_app' => $provider,
253
+ 'linked_email' => $user_email,
254
+ 'user_id' => $ID,
255
+ 'identifier' => $identifier
256
+ ),
257
+ array(
258
+ '%s',
259
+ '%s',
260
+ '%d',
261
+ '%s'
262
+ )
263
+ );
264
+ if($output === false){
265
+ /*$wpdb->show_errors();
266
+ $wpdb->print_error();
267
+ exit;*/
268
+ wp_die('Error in insert Query');
269
+ }
270
+
271
+ }
272
+ $wpdb->get_var("ALTER TABLE $wpdb->users DROP COLUMN provider");
273
+ $wpdb->get_var("ALTER TABLE $wpdb->users DROP COLUMN identifier");
274
+
275
+ }
276
  }
277
 
278
  function mo_openid_add_social_login(){
431
  function mo_login_widget_text_domain(){
432
  load_plugin_textdomain('flw', FALSE, basename( dirname( __FILE__ ) ) .'/languages');
433
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
 
435
  public function mo_oauth_check_empty_or_null( $value ) {
436
  if( ! isset( $value ) || empty( $value ) ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.miniorange.com
4
  Tags: social login, social, facebook, twitter, login
5
  Requires at least: 2.0.2
6
  Tested up to: 4.9.4
7
- Stable tag: 6.1.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -160,6 +160,9 @@ Please email us at info@miniorange.com. You can also submit your query from the
160
 
161
 
162
  == Changelog ==
 
 
 
163
  = 6.1.0 =
164
  * Fix for Error in Insert Query
165
 
@@ -443,6 +446,9 @@ Please email us at info@miniorange.com. You can also submit your query from the
443
  * First version of Social Login, Social Sharing plugin.
444
 
445
  == Upgrade Notice ==
 
 
 
446
  = 6.1.0 =
447
  * Fix for Error in Insert Query
448
 
4
  Tags: social login, social, facebook, twitter, login
5
  Requires at least: 2.0.2
6
  Tested up to: 4.9.4
7
+ Stable tag: 6.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
160
 
161
 
162
  == Changelog ==
163
+ = 6.2.0 =
164
+ * Fix for Unresolved Error in Insert Query
165
+
166
  = 6.1.0 =
167
  * Fix for Error in Insert Query
168
 
446
  * First version of Social Login, Social Sharing plugin.
447
 
448
  == Upgrade Notice ==
449
+ = 6.2.0 =
450
+ * Fix for Unresolved Error in Insert Query
451
+
452
  = 6.1.0 =
453
  * Fix for Error in Insert Query
454