jlnd
Forum Replies Created
-
Forum: Plugins
In reply to: [3D Tag Cloud] 404 errors with multisite setupThe code in my post messed up the display of this page.
Forum: Plugins
In reply to: [WordPress Social Login] Multisite compatible?It is supposed to be and I’ve been running version 1.2.1 on a multisite WP instance for about a year, but right now version 2.1.3 is not working for me and I’ve seen a few others who have reported issues. I just discovered a bug that I believe is at the root of the problem with this plugin on multi-site setups. I posted a comment about it here:
http://wordpress.org/support/topic/unable-to-authenticate?replies=4As far as I can tell, there’s no way this version or version 2.0.3 are functional in a multi-site setup so I think it’s unlikely that the developer is doing good testing for multisite. I believe version 2.0.3 was released on January 25th, so either there aren’t enough users running this plugin on a multi-site setup to raise a fuss, or the developer isn’t being very responsive to multisite issues.
That said, I know that 1.2.1 works. I would highly recommend the older version of the plugin and the new features look really cool, once the multisite bugs are fixed.
Forum: Plugins
In reply to: [WordPress Social Login] unable to authenticateI did some in-depth digging and I think I have found the source of this bug. As far as I can tell this bug was present in WordPress Social Login version 2.0.3 as well as 2.1.3, and I believe it would prevent any WordPress Multisite from working properly with WordPress Social Login.
The source of the problem is within the wsl_get_user_by_meta function in wordpress-social-login/includes/services/wsl.user.data.php:
In the line…
$sql = “SELECT user_id FROM
{$wpdb->prefix}usermetaWHERE meta_key = ‘%s’ AND meta_value = ‘%s'”;$wpdb->prefix should be $wpdb->base_prefix or $wpdb->usermeta.
For a non-multisite WP instance, $wpdb->prefix and $wpdb->base_prefix are interchangeable, but for a wpMu setup $wpdb->prefix returns the prefix for the blog-specific tables (e.g. “wp_3_”) whereas $wpdb->base_prefix returns the table prefix for the WP instance (e.g. “wp_”). And $wpdb->usermeta returns the name of the usermeta table (e.g. “wp_usermeta”).
I actually think most, if not all, of the 26 occurrences of $wpdb->prefix in the plugin need to be corrected.
I switched from this plugin to the Google+ Blog plugin (http://www.minimali.se/google+blog/). I’d recommend giving it a try. It doesn’t have as many features, but it works pretty reliably. I haven’t been impressed with the speed of new development, but it’s pretty solid as it is.
Forum: Plugins
In reply to: [The Google+ plugin] [Plugin: The Google plugin] Doesn't ImportA potential solution here:
I spent hours troubleshooting an issue similar to this. Perhaps it’s the same problem you were having. I hope this helps…
The token that Google was returning did not contain an attribute that The Google+ Plugin was expecting. I solved this by changing line 126 of lib/external/google/auth/apiOAuth2.php from…
if (! isset($accessToken[‘access_token’]) || ! isset($accessToken[‘expires_in’]) || ! isset($accessToken[‘refresh_token’])) {
… to …
if (! isset($accessToken[‘access_token’]) || ! isset($accessToken[‘expires_in’]) ) {
Once I did that, everything started working as intended. I’m not sure if this is a good long term fix or if it will cause other problems, but it’s working for me for now.
@enderpal444, I don’t use Buddy Press so I’m not positive but you might be able to get things to work by rearranging the priority order of your filters. In the code above, try changing the 10 in the last line to 15.
If that works, it might be necessary to customize the function a bit to only use the social avatar if buddy press doesn’t have one. To do so, add the following code at the 4th line (the blank line)…
// Only continue if there is no buddy press avatar
if( $avatar != ” && strpos($avatar, ‘gravatar’) === false ) {
return $avatar;
}Are you managing your menu items through wp-admin > Appearance > Menus? If so, you can add a new “Custom Link”. Enter URL: “/wp-login.php?redirect_to=destination_page” Label: “Log In” and click “Add to Menu”. That will add a Log In link to your menu, and when you finish logging in, you’d be directed to the destination_page (destination_page is a placeholder for whatever URL you want to enter).
But the new Log In link will not use SimpleModal Login, so you’ll need to do one more thing… In the upper-right corner of the Menus admin page, click “Screen Options” and make sure “CSS Classes” is checked. Then, in your menu list, click the disclosure triangle (down arrow) next to “Log In”. For “CSS Classes”, enter “simplemodal-login”.
If you want to be able to return the user back to the same page rather than a single destiation, you may need to add a function to your theme’s functions.php. Follow the directions on this page: http://wpfirstaid.com/tag/wp_nav_menu/ except, instead of adding a link to “Home” you’d be adding a link to “Login” and use wp_loginout($_SERVER[‘REQUEST_URI’], false) where the instructions have home_url( ‘/’ ) .
Forum: Fixing WordPress
In reply to: [SimpleModal Login] Why i get empty_bothI think this plugin has some issues. It hasn’t been updated in more than a year. Here’s another report of this same bug from more than a year ago:
http://wordpress.org/support/topic/plugin-simplemodal-login-empty_both-message?replies=13
Most of the functionality works for me, but registering a new user does not. I get the “empty_both” error message. Looking at the code, it looks to me like “empty_both” in js/default.js should be “empty_all” but even that is only correcting the error message. The cause of the error message appears to me to be that the registration form fields are wrong. If you go to WordPress’s registration page, the Username field is “user_name”, but in the simplemodal login registration box is “user_login”.
Forum: Plugins
In reply to: [WordPress Social Login] [Plugin: WordPress Social Login] Cannot see avatarsI posted my solution to this here…
This should work…
/wp-login.php?redirect_to=/
Forum: Plugins
In reply to: WordPress Social Login : Twitter Authentification failedI had this issue in some of my testing. I found that things worked again after doing this…
Log in to Twitter.com
Go to Settings > Applications and click “Revoke Access” for your app.
Then, in WordPress, delete the user account.
Then, delete your browser cookies.
Then go to your site’s /wp-login page and try again.Email is not one of the fields that LinkedIn makes available to pull in via their API:
https://developer.linkedin.com/documents/profile-fields (In the code comments of the plugin there’s a note that “Currently only Facebook, Google, Yhaoo and Foursquare do provide the verified user email.”) So the WP Social Login plugin generates a fake email for the user. The code is in wordpress-social-login/includes/plugin.auth.php.Perhaps the email field could just be left blank, but maybe that would keep the login process from continuing properly. I’ll be testing this soon.
The wsl_user_custom_avatar function in wordpress-social-login/includes/plugin.ui.php, which is borrowed from the Social Login plugin, only gets the social networking avatar for comments on the front end. It does not get the avatar for the user’s admin bar or in the admin area users list, etc.
To make the social networking avatars work throughout, you can put this code into your theme or a custom plugin…
// remove WordPress Social Login's get_avatar filter so that we can add our own remove_filter( 'get_avatar', 'wsl_user_custom_avatar' ); function my_user_custom_avatar($avatar, $id_or_email, $size, $default, $alt) { global $comment; if( get_option ('wsl_settings_users_avatars') && !empty ($avatar)) { //Check if we are in a comment if (!is_null ($comment) && !empty ($comment->user_id)) { $user_id = $comment->user_id; } elseif(!empty ($id_or_email)) { if ( is_numeric($id_or_email) ) { $user_id = (int) $id_or_email; } elseif ( is_string( $id_or_email ) && ( $user = get_user_by( 'email', $id_or_email ) ) ) { $user_id = $user->ID; } elseif ( is_object( $id_or_email ) && ! empty( $id_or_email->user_id ) ) { $user_id = (int) $id_or_email->user_id; } } // Get the thumbnail provided by WordPress Social Login if ($user_id) { if (($user_thumbnail = get_user_meta ($user_id, 'wsl_user_image', true)) !== false) { if (strlen (trim ($user_thumbnail)) > 0) { $user_thumbnail = preg_replace ('#src=([\'"])([^\\1]+)\\1#Ui', "src=\\1" . $user_thumbnail . "\\1", $avatar); return $user_thumbnail; } } } } // No avatar found. Return unfiltered. return $avatar; } add_filter ( 'get_avatar', 'my_user_custom_avatar', 10, 5);…Or, if you want to hack the WSL plugin, you could replace the content of the wsl_user_custom_avatar function in wordpress-social-login/includes/plugin.ui.php with the content of the my_user_custom_avatar function above.
Yep. I upgraded to 2.17 and am having the same issue again. I have WordPress 3.3.1. It’s a multi-site installation. I activated the plugin for the network. I went to Network Admin / Security / System Tweaks page (/wp-admin/network/admin.php?page=BWPS-tweaks) and checked a couple of checkboxes. When I clicked save, my choices were erased.
In fact, after making a few more changes I clicked save and my whole site became inaccessible. After reading the apache error logs and tracing the problem back to the source I found that the following lines were missing from wp-config.php…
/** Absolute path to the WordPress directory. */
if ( !defined(‘ABSPATH’) )
define(‘ABSPATH’, dirname(__FILE__) . ‘/’);/** Sets up WordPress vars and included files. */
require_once(ABSPATH . ‘wp-settings.php’);Restored those lines and got my site back.