OA Vanilla and Wordpress plugins designed to work together?

My site is Wordpress using the WP-Members plugin and OneAll's plugin. Also on the same domain, but not as an embed, I have an install of Vanilla using OneAll's Vanilla plugin. I am working to troubleshoot signed in users not being recognized between platforms even though I have the SSO option selected. Would it work better if I installed Vanilla on a subdomain?

I'd appreciate any thoughts, experience hints, and suggestions. Site is at writingpractice.com and writingpractice.com/vanilla

Best Answers

  • Fred_PinelFred_PinelMember
    Answer ✓
    Hi Jerry,
    Hum, now I'm a little confused, so just to clarify, you need to have these 2 things:
    1- in file wp-content/plugins/oa-social-login/includes/admin.php, at about line 250
    //Get connection details
    $result = oa_social_login_do_api_request ($api_connection_handler, $api_resource_url, array ('api_key' => $api_key, 'api_secret' => $api_secret), 15);
    error_log(print_r($result, true));
    2- and in file wp-config.php:
    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);

    Then, click on the 'Verify API settings.
    And you should have a log file under wp-content.

    Thanks!
  • Jerry_JazJerry_JazMember
    Answer ✓
    So it was something on my host's side and they fixed it so now I am green on both. It was denying access to the port when sending my credentials, but not in the Curl/port check. Strange. Thanks for your time and help in reaching this point, Fred. I am going to open another thread for the next step which is, using FB as a test, it completes the sign-in and returns me to the site but I am at the login page again with no affirmation I have logged in. Also get a note that somebody tried to login and I need to fix FB. But FB is set up... sorry, I'll open a new thread. Be well.

Answers

  • Hi,
    Are you using our both our plugins on the 2 web sites, without modifications?
    What do you mean by "SSO option selected"? The plugins do not come with SSO support.

    Regards
  • image

    Odd where the test works but the use test fails. Any thoughts on this?
  • Hi,
    Could you provide us with extra information, by:
    - open the Network console (ctrl-shift-q on Firefox),
    - click the 'Verifiy API Settings',
    - inspect the AJAX request (dump a screenshot here for example).

    Or, you can log the error reply on the server.
    Add this line: error_log(print_r($result, true));
    in file wp-content/plugins/oa-social-login/includes/admin.php, at line 250 (after the $result = oa_social_login_do_api_request). This should look like:
    //Get connection details
    249 $result = oa_social_login_do_api_request ($api_connection_handler, $api_resource_url, array ('api_key' => $api_key, 'api_secret' => $api_secret), 15);
    250 error_log(print_r($result, true));
    For this to work, you need the following lines in the configuration file wp-config.php:
    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    (see https://codex.wordpress.org/Debugging_in_WordPress for details).

    Thanks, and sorry for the lengthy reply.
  • Feel like I am living in the Twilight Zone. I place the code in the respective files and saved them. activated the OA plugin and cleared the cache, logged out and ran through signing in via FB. It gave me the two brief windows that end with ...you're being redirected and I wasn't logged in. AND it did not create any on-screen errors nor was an error log created in the site files.

    I did read the WP link you included in your reply (which was not long at all, I am grateful for the help and the detail).

    I redid this a few times, turned off some other plugins which could interfere, but never did I see errors register on screen nor did it create an error log.

    I did receive the email stating I should fix the settings as someone had tried to log in using OA.

    The image shows my (shared) server PHP setup as tested.

    image
  • Hi,
    The code changes is supposed to log extra information when you click on the 'Verify API settings' only.
    So, what you experienced is normal.
    Could you try to verify the API settings again? (no need to disable the plugin, etc).
    The reason is that the error message shown can be caused by different things, and this would help determine what.

    Thanks.
  • I see, API verify is the command from the plugin. I thought it was from somewhere inside the Firefox Network console. So with the code in place, I pressed the button, Verify not AutoDetect, and from the Debugger >Sources>admin.js is this dump:

    jQuery(document).ready(function($) {

    /* Autodetect API Connection Handler */
    $('#oa_social_login_autodetect_api_connection_handler').click(function(){
    var message_string;
    var message_container;
    var is_success;

    var data = {
    _ajax_nonce: objectL10n.oa_social_login_ajax_nonce,
    action: 'autodetect_api_connection_handler'
    };

    message_container = jQuery('#oa_social_login_api_connection_handler_result');
    message_container.removeClass('success_message error_message').addClass('working_message');
    message_container.html(objectL10n.oa_admin_js_1);

    jQuery.post(ajaxurl,data, function(response) {
    /* CURL/FSOCKOPEN Radio Boxs */
    var radio_curl = jQuery("#oa_social_login_api_connection_handler_curl");
    var radio_fsockopen = jQuery("#oa_social_login_api_connection_handler_fsockopen");
    var radio_use_http_1 = jQuery("#oa_social_login_api_connection_handler_use_https_1");
    var radio_use_http_0 = jQuery("#oa_social_login_api_connection_handler_use_https_0");

    radio_curl.removeAttr("checked");
    radio_fsockopen.removeAttr("checked");
    radio_use_http_1.removeAttr("checked");
    radio_use_http_0.removeAttr("checked");

    /* CURL detected, HTTPS */
    if (response == 'success_autodetect_api_curl_https')
    {
    is_success = true;
    radio_curl.attr("checked", "checked");
    radio_use_http_1.attr("checked", "checked");
    message_string = objectL10n.oa_admin_js_201a;
    }
    /* CURL detected, HTTP */
    else if (response == 'success_autodetect_api_curl_http')
    {
    is_success = true;
    radio_curl.attr("checked", "checked");
    radio_use_http_0.attr("checked", "checked");
    message_string = objectL10n.oa_admin_js_201b;
    }
    /* CURL detected, ports closed */
    else if (response == 'error_autodetect_api_curl_ports_blocked')
    {
    is_success = false;
    radio_curl.attr("checked", "checked");
    message_string = objectL10n.oa_admin_js_201c;
    }
    /* FSOCKOPEN detected, HTTPS */
    else if (response == 'success_autodetect_api_fsockopen_https')
    {
    is_success = true;
    radio_fsockopen.attr("checked", "checked");
    radio_use_http_1.attr("checked", "checked");
    message_string = objectL10n.oa_admin_js_202a;
    }
    /* FSOCKOPEN detected, HTTP */
    else if (response == 'success_autodetect_api_fsockopen_http')
    {
    is_success = true;
    radio_fsockopen.attr("checked", "checked");
    radio_use_http_0.attr("checked", "checked");
    message_string = objectL10n.oa_admin_js_202b;
    }
    /* FSOCKOPEN detected, ports closed */
    else if (response == 'error_autodetect_api_fsockopen_ports_blocked')
    {
    is_success = false;
    radio_fsockopen.attr("checked", "checked");
    message_string = objectL10n.oa_admin_js_202c;
    }


    /* No handler detected */
    else
    {
    is_success = false;
    radio_curl.attr("checked", "checked");
    message_string = objectL10n.oa_admin_js_211;
    }

    message_container.removeClass('working_message');
    message_container.html(message_string);

    if (is_success){
    message_container.addClass('success_message');
    } else {
    message_container.addClass('error_message');
    }
    });
    return false;
    });

    /* Test API Settings */
    $('#oa_social_login_test_api_settings').click(function(){
    var message_string;
    var message_container;
    var is_success;

    var radio_fsockopen_val = jQuery("#oa_social_login_api_connection_handler_fsockopen:checked").val();
    var radio_use_http_0 = jQuery("#oa_social_login_api_connection_handler_use_https_0:checked").val();

    var subdomain = jQuery('#oa_social_login_settings_api_subdomain').val();
    var key = jQuery('#oa_social_login_settings_api_key').val();
    var secret = jQuery('#oa_social_login_settings_api_secret').val();
    var handler = (radio_fsockopen_val == 'fsockopen' ? 'fsockopen' : 'curl');
    var use_https = (radio_use_http_0 == '0' ? '0' : '1');

    var data = {
    _ajax_nonce: objectL10n.oa_social_login_ajax_nonce,
    action: 'check_api_settings',
    api_connection_handler: handler,
    api_connection_use_https: use_https,
    api_subdomain: subdomain,
    api_key: key,
    api_secret: secret
    };

    message_container = jQuery('#oa_social_login_api_test_result');
    message_container.removeClass('success_message error_message').addClass('working_message');
    message_container.html(objectL10n.oa_admin_js_1);

    jQuery.post(ajaxurl,data, function(response) {
    if (response == 'error_selected_handler_faulty'){
    is_success = false;
    message_string = objectL10n.oa_admin_js_116;
    }
    else if (response == 'error_not_all_fields_filled_out'){
    is_success = false;
    message_string = objectL10n.oa_admin_js_111;
    }
    else if (response == 'error_subdomain_wrong'){
    is_success = false;
    message_string = objectL10n.oa_admin_js_112;
    }
    else if (response == 'error_subdomain_wrong_syntax'){
    is_success = false;
    message_string = objectL10n.oa_admin_js_113;
    }
    else if (response == 'error_communication'){
    is_success = false;
    message_string = objectL10n.oa_admin_js_114;
    }
    else if (response == 'error_authentication_credentials_wrong'){
    is_success = false;
    message_string = objectL10n.oa_admin_js_115;
    }
    else {
    is_success = true;
    message_string = objectL10n.oa_admin_js_101;
    }

    message_container.removeClass('working_message');
    message_container.html(message_string);

    if (is_success){
    message_container.addClass('success_message');
    } else {
    message_container.addClass('error_message');
    }
    });
    return false;
    });
    });

    Hope I am barking up the right tree.
  • Hi,
    Yes, sorry for the confusing info.
    So, once you apply the change to the PHP file (~line 250 error_log(print_r($result, true));), and clicked on the verifying the API in Wordpress | Oneall settings, something should have been added to the server's log (not the browser, actually, for now, we can even forget about the browser and its console).

    So, do you see a wp-content/debug.log file in your server? (that's the one which should include the API verification result.)

    Thanks for your patience.
  • Jerry_JazJerry_JazMember
    edited September 2016
    Hey Fred

    The process above did not create the debug log. I deleted the two files (one I inserted on line 250 and the the other in the config file) and reinstalled them, all set to true. Cleared the cache. Tapped the API button and it returned an error. No log file was created. That is why I originally sent the PHP configuration to see if there was a setting I am unaware of that would prevent the log file from being created in the wp-content directory.

    I appreciate your time spent in sorting this mystery.

    Tomorrow I'll ask my host if he knows of a reason the file would not be generated.
  • Jerry_JazJerry_JazMember
    edited September 2016
    Yes, hum... No log file is generated. Enclosed are snaps of my code inserts.
    image
    image

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.