• John Powell

    (@digipark)


    Greg,

    After almost a year of working on this client project, we finally launched and it works really well. Thanks for a great (and flexible) product. My client charges for ads per character so we set up 36 ranges and I used a NinjaForm to do character count with some jQuery to auto-select the drop-down for redirects and php to filter and autoselect the right renewal package. Here’s the URL…
    https://cdaonline.org/product/prepare-your-classifieds-ad/

    I’m seeing a very odd issue and I’m hoping you have an idea where the issue is. I’m seeing the ‘nickname’ for the main admin user account changed to the first/last name of the last person to place an ad. Any ideas as to what could be causing that? It’s only the nickname, but still pretty unnerving that it’s changing in the admin account.

    Thanks…
    John M Powell
    Digipark.com

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    hmm can you let me know what WPAdverts version are you using? I remember we had a similar issue once but it was resolved some time (maybe 2-years) ago.

    Thread Starter John Powell

    (@digipark)

    Hi Greg,

    Core is on 1.4.5. The only update I see available in Plugins is WooCommerce Payments from 1.6.0 to 1.6.1.

    Thanks…
    John

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    hmm so you are using the latest WPAdverts version, I understand this happens only when you are adding an advert from the page with [adverts_add] shortcode (and you are logged in while doing it)?

    Also, can you let me know what other plugins you have installed?

    Thread Starter John Powell

    (@digipark)

    Greg,

    Yes – [adverts_add form_scheme=”classifieds-package-1″]

    When customers create an ad is when it appears to happen. It looks like it is taking a custom field and setting that as the root WP admin ‘NIckname’ and ‘Display name publicly as’ name. Changing that field after an ad has been posted does not appear to change it again.

    We have the following modules installed/enabled…
    WooCommerce Payments
    Custom Fields
    Emails
    reCAPTCHA
    Category Icons
    Mark As Sold

    I have other modules installed but not activated.

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    thanks for the details I am out of office today (independence day here in Poland :)), but I will be working again tomorrow, I will check that and let you know.

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    i am trying to replicate this issue, but so far i wasn’t able to do so, can you send me some more details?

    1. Does this happen to a logged-in user, anonymous user, a user who clicked “Create Account” checkbox or all of them?

    2. what is the name of the custom field which is being used to replace the admin nickname?

    3. if possible then you can try disabling the active modules/plugins and see when and if the problem goes away.

    Thread Starter John Powell

    (@digipark)

    Hi Greg. I hope you enjoyed your Independence Day. I took my son on a 2 week trip and am finally starting to catch up on work.

    So I did a query logger and found more info for you. I haven’t tested every situation you listed in #1 but it definitely happened on the first test I did, which was a new user checking the ‘create account’ box. I think you’ll see what is happening in the queries I captured.

    INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (39754, ‘adverts_person’, ‘Test Person’) – (0.00095415115356445 s)
    [Stack]: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/x/woocommerce.php’), x_get_view, X_View_Router::render, include(‘/themes/x/framework/views/integrity/woocommerce.php’), woocommerce_content, wc_get_template_part, load_template, require(‘/plugins/woocommerce/templates/content-single-product.php’), do_action(‘woocommerce_single_product_summary’), WP_Hook->do_action, WP_Hook->apply_filters, WC_Structured_Data->generate_product_data, do_shortcode, preg_replace_callback, do_shortcode_tag, shortcode_adverts_add, Adverts_Shortcode_Adverts_Add->main, Adverts_Shortcode_Adverts_Add->action_preview, Adverts_Post::save, adverts_save_single, update_post_meta, update_metadata, add_metadata

    INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (39755, ‘adverts_person’, ‘Test Person’) – (0.0013630390167236 s)
    [Stack]: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/x/woocommerce.php’), x_get_view, X_View_Router::render, include(‘/themes/x/framework/views/integrity/woocommerce.php’), woocommerce_content, wc_get_template_part, load_template, require(‘/plugins/woocommerce/templates/content-single-product.php’), do_action(‘woocommerce_after_single_product_summary’), WP_Hook->do_action, WP_Hook->apply_filters, woocommerce_output_product_data_tabs, wc_get_template, include(‘/themes/x/woocommerce/single-product/tabs/tabs.php’), woocommerce_product_description_tab, wc_get_template, include(‘/plugins/woocommerce/templates/single-product/tabs/description.php’), the_content, apply_filters(‘the_content’), WP_Hook->apply_filters, do_shortcode, preg_replace_callback, do_shortcode_tag, shortcode_adverts_add, Adverts_Shortcode_Adverts_Add->main, Adverts_Shortcode_Adverts_Add->action_preview, Adverts_Post::save, adverts_save_single, update_post_meta, update_metadata, add_metadata

    UPDATE wp_users SET user_pass = ‘##REMOVED##’, user_nicename = ‘admin’, user_email = ‘[email protected]’, user_url = ”, user_registered = ‘2015-11-23 08:09:29’, user_activation_key = ”, display_name = ‘Test Person’ WHERE ID = 1 – (0.00020790100097656 s)
    [Stack]: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), do_action(‘template_redirect’), WP_Hook->do_action, WP_Hook->apply_filters, adext_wc_payments_cart_redirect, adverts_create_user_from_post_id, apply_filters(‘adverts_create_user_from_post_id’), WP_Hook->apply_filters, _adverts_create_user_from_post_id, wp_update_user, wp_insert_user

    UPDATE wp_usermeta SET meta_value = ‘Test Person’ WHERE user_id = 1 AND meta_key = ‘nickname’ – (0.0012691020965576 s)
    [Stack]: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), do_action(‘template_redirect’), WP_Hook->do_action, WP_Hook->apply_filters, adext_wc_payments_cart_redirect, adverts_create_user_from_post_id, apply_filters(‘adverts_create_user_from_post_id’), WP_Hook->apply_filters, _adverts_create_user_from_post_id, wp_update_user, wp_insert_user, update_user_meta, update_metadata

    There are a number of UPDATE wp_usermeta’s after this which include ‘Test Person’ but they are massive and I believe the issue is already shown in the above queries.

    I hope this is enough info for you to figure out where the issue is. Thanks!

    John M Powell
    Digipark.com

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    thanks i can see where the nickname changes, but i am not sure why does this happen or rather why the user id in the query is set to 1.

    Can you send me a message via the contact form at https://wpadverts.com/contact? I will send you a code that should make a workaround for this

    BTW. When the user nickname changes does this also change the admin role to Subscriber? I am looking at the code and it should do both if the user_id if for some reason = 1.

    Thread Starter John Powell

    (@digipark)

    Thanks Greg. I just sent a request on your contact work. Agreed I saw the user_id = 1 which would be doing it. I don’t know the code above it but my guess is there’s a query to get the previously inserted user record and something doesn’t pull up correctly so it ends up with ‘1’.

    Nickname seems to be the only thing changing. We never lose Admin role on user id 1.

    Thanks!
    John

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    thanks for the message, you should receive a reply via email soon.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Nickname Changing on admin account’ is closed to new replies.