This topic has 28 replies, 3 voices, and was last updated 7 years by Roader.

  • Author
  • #150802
     Roader
    Participant

    Hi Radu,

    For Security, I want to remove or hide  Author from the Blog.  Example:

    <a class=”url fn n” href=”http://whatsmymate.com/author/sweetadmin” title=”View all posts by User Demo” rel=”author”>User Demo</a>

    Yes, I know that using css I can “hide”, but, this does not resolve the problem, the Author Url follow there.

    For this reason I need a functions php   Code. 🙂

    Roles:  If is Admin, if is Editor…

    Subscriber is okey!

     

     

     

     

     

     

     

    Attachments:
    You must be logged in to view attached files.
    #150845
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! ?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #150933
     Radu
    Moderator

    Hi,

    By adding this function and modifying it: https://gist.githubusercontent.com/sqcodes/627efa93598c45dce583181727a29efc/raw/7f8e11c3bc1bed72709367059c159f1ba60fd172/sweetdate_entry_meta.php

    Rename the elements that you don’t need from the meta.

    The function will be added to functions.php in child theme

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #150979
     Roader
    Participant

    Umm Rename what?
    Only I want to hide author url… so, send me and exa.

    #150980
     Roader
    Participant

    $author = sprintf( ‘%3$s‘,

    Here ??? But does not work.

    #150983
     Roader
    Participant

    I want that this function affect only Admins, Editors, not Subscribers.

    #151099
     Radu
    Moderator

    Hi,

    What are you asking it seems to be custom, I cannot provide you a custom code with custom restriction rules, I can offer you some hints and guides, if you see any theme problems I’m here to help, for your case if you need to apply that change only for admins you will have to add the previews provided code in this kind of checks

    COPY CODE
    
    if( current_user_can('editor') || current_user_can('administrator') ) {  
        // stuff here for admins or editors
    }
    

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #151168
     Roader
    Participant
    COPY CODE
    if( current_user_can('editor') || current_user_can('administrator') ) {  
      $author = sprintf( '<a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a>',
    		esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    		esc_attr( sprintf( __( 'View all posts by %s', 'kleo_framework' ), get_the_author() ) ),
    		get_the_author()
    	);  
    }


    And the code is??
    Radu, remember, I dont know php…
    This feature is a solution for a problem of security, I know that you understand.

    #151262
     Roader
    Participant

    Good Morning or Night my friend Radu.

    You, as a developer, must provide three features: Security, Speed​​* and Easy Optimization.

    Here, let’s talk about Security.

    Many buy Themes 7THQ, but they are newbies, they do not know anything about Security.

    You should put a Warning in the Theme, which says:

    You can secure your site by installing any of these plugins:

    – All in one wordpress security and firewall.
    – Wordfence.

    – (For speed: Wp Super Cache, or whatever).

    (I.e.

    Well, now let’s go to the following:

    THE USER NAME MUST BE PRIVATE.

    At the moment there is a Vulnerability in both WordPress and BuddyPress.

    LOOK AT THE PHOTOS.

    If you publish something, and you click Right
    On the Public Name, the User Name is displayed in the URL.

    WordPress (Blog):

    www.yoursite.com/author/your-username

    SweetDate (Messages, WidGets, Comments, etc.):

    COPY CODE
    
    https://seventhqueen.com/demo/sweetdatewp/members/demo/messages/

    BuddyPress:

    www.yoursite.com/members/your-username

    BbPress:

    www.yoursite.com/forums/profile/your-username

    This is so wrong. IS NOT SAFE.

    If you go to the Profile of any user, it shows:

    Your Public Name
    @your-username

    This should not be like that.

    Therefore, you must create a PHP Function that FORCES to display only the NickName:

    Profile:

    Your Public Name
    @your-nickname

    URLs:

    COPY CODE
    
    www.yoursite.com/members/your-nickname
    
    www.yoursite.com/author/your-nickname
    
    www.yoursite.com/forums/profile/your-nickname
    
    seventhqueen.com/demo/sweetdatewp/members/YOUR-NICKNAME/messages/

    ********* PLEASE, CHECK THIS LINK

    ———-

    NickName and Public Name will be automatically created according to First Name and Last Name.

    The idea is that the Username of All users is Private.

    On the Registration Form (WP / BP).
    If a user enters his User Name just like the Full Name, he should receive an Alert:

    Please enter a different username, it can not be the same as your Full Name.

    ———

    NOTE:
    Includes (KLEO functions) reCaptcha

    In: Registration Forms, I forgot my Password, Login,

    So that they do not affect the Login for Subscribers.

    The All In On Wp Security and F plugin adds a Captcha but affects User Login.

    ———
    * SPEED: Check your Theme (sweetdate/demo) using GTmetrix and Page Speed ​​Insights.

    I. e. Minify Css and Js.

    I you want: Includes (only for specific css):
    LoadCSS.js

    This plugin: Speed Up – Optimize CSS Delivery by Simone Nigro, Resolves this request for PageSpeed, but, affects the Theme, because there are some sensitive CSS. So, you can adapt the Code.

    AND: Your Theme has problems with the Css for Mobile: Things misaligned, Buttons too large, etc. Remember that!

    Attachments:
    You must be logged in to view attached files.
    #151276
     Roader
    Participant

    For Public Messages or Mentions:

    Force to Display @your-nickname instead of @your-username.

    I’m waiting your php code.

    My friend, Remember, this petition is NOT only for me, it is for ALL your clients.

    Attachments:
    You must be logged in to view attached files.
    #151387
     Radu
    Moderator

    Hi,

    Please see what our support includes and doesn’t cover any custom work job. You can find out in the sweetdate/kleo ThemeForest page: https://themeforest.net/item/kleo-pro-community-focussed-multipurpose-buddypress-theme/6776630

    Your wishes list its custom and our product it’s meant for public communities like facebook, since they are points that you need to achieve in your project, not theme problems or theme questions.

    Please try to find a developer that can helps you to match your needs and please create only related to theme problems or questions otherwise, i won’t be able to help you, also if you don’t have a development knowledge we strongly recommend you to get a developer.

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #151394
     Roader
    Participant

    I know that Radu,

    And I know I’m telling you a lot.

    But this is a security issue that concerns everyone.

    Of course, you have the freedom to accept it or not,

    Or, you can recommend partial solutions.

    #151395
     Roader
    Participant

    If I found a PHP code to resolve this vulnerability, I would certainly share it here,
    But I find nothing.

    #151398
     Roader
    Participant

    Maybe… I dont know… you are the master in php… If you get something… let me know.

    COPY CODE
    if ( $comment->user_id != '0' ) {
        echo '<span class="some-class">' . get_user_meta( $comment->user_id, 'nickname', true ) . '</span>';
    } else {
        echo '<span class="other-class">' . get_comment_author_link() . '</span>';
    }

    Comment, Post, Activity, Profile…

    #151399
     Roader
    Participant
    #151423
     Roader
    Participant

    My friend Radu 😀

    This code work, but, only with Author (from Blog / Posts). In this example, you can see: author = user demo (nickname) instead sweetadmin (by default).

    This code does not work with: Comments, etc., BuddyPress and BbPress. So, PLEASE… Help with the others!

    Force with this, to show nickname only in Profile, /members/ , forums/profile, / comment-meta, etc.

    COPY CODE
    add_filter( 'request', 'wpse5742_request' );
    function wpse5742_request( $query_vars )
    {
        if ( array_key_exists( 'author_name', $query_vars ) ) {
            global $wpdb;
            $author_id = $wpdb->get_var( $wpdb->prepare( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key='nickname' AND meta_value = %s", $query_vars['author_name'] ) );
            if ( $author_id ) {
                $query_vars['author'] = $author_id;
                unset( $query_vars['author_name'] );    
            }
        }
        return $query_vars;
    }
    
    add_filter( 'author_link', 'wpse5742_author_link', 10, 3 );
    function wpse5742_author_link( $link, $author_id, $author_nicename )
    {
        $author_nickname = get_user_meta( $author_id, 'nickname', true );
        if ( $author_nickname ) {
            $link = str_replace( $author_nicename, $author_nickname, $link );
        }
        return $link;
    }
    Attachments:
    You must be logged in to view attached files.
    #151426
     Roader
    Participant
    #151432
     Roader
    Participant

    For Bp/Profile/ @username, I found this ===> BudyPress Username Changer Plugin
    And this plugin has problems…

    But, the best solution is to change this automatically using a sample code in functions.php

    I. e. Automatically: User BP Profile @name is = to your nickname.

    Attachments:
    You must be logged in to view attached files.
    #151436
     Roader
    Participant

    Other code, but not work from functions.php, maybe needs other lines.

    COPY CODE
    if ( $comment->user_id != '0' ) {
        echo '<span class="some-class">' . get_user_meta( $comment->user_id, 'nickname', true ) . '</span>';
    } else {
        echo '<span class="other-class">' . get_comment_author_link() . '</span>';
    }
    #151612
     Roader
    Participant

    Radu??

    #151749
     Radu
    Moderator

    Hi again,

    YES ? I’ve told you that there cannot be offered custom support, with that product problem or bug i can help you ?

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #151757
     Roader
    Participant

    Umm

    But you know Php, and I know that you can help, No only me, All.

    This is not a custom, is a problem of Security. If the problem is money, dont worry, When I can, I pay again for extended. But for now, Radu, I need to solve this, because this is a weak point.

    #151758
     Roader
    Participant

    Other problem, but I dont know if it is cause by the Theme: WordFence > force users to use strong passwd, Does Not Work.

    Then, this petition is not for customization, is for Security. And if you want, can include it in the next update.

    #151764
     Roader
    Participant

    Espero que LAURA lea esto:

    Laura, tu colega no entiende algo. Y es que esto es un error. El Tema o el WordPress o el Buddypress, demuestra el Nombre de Usuario con el que se inicia sesión de TODOS los usuarios. Eso hace vulnerable la página y las Cuentas de Usuarios.

    Lo otro, con el Tema, NO funciona Forzar a usar contraseñas fuertes, que es una Función de WordFence. Tampoco funciona un código php para SOLO aceptar dominios de emails válidos como yahoo.com.

    Tampoco funcionan los Captchas de All In One WP Security. Yo solo espero ayuda!

    #152121
     Radu
    Moderator

    Hi,

    Please write in English because not all understand Spanish

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #152159
     Roader
    Participant

    My friend Radu, the Solution for this Topic is:

    COPY CODE
    function set_default_display_name( $user_id ) {
    $user = get_userdata( $user_id );
    $name = sprintf( '%s %s', $user->first_name, $user->last_name );
    $nickname = sanitize_user( strtolower( str_replace( ' ', '', $name ) ) );
    $args = array(
    'ID' => $user_id,
    'display_name' => $name,
    'nickname' => $nickname,
    'user_nicename' => $nickname
    );
    wp_update_user( $args );
    }
    add_action( 'user_register', 'set_default_display_name' );
    #152160
     Roader
    Participant

    This code works fine with Newest Registered. For Oldest Registered, you need to change the nickname manually. If your username is masterkrisna, and your full name is Radu Maharaj, then, your nickname needs to be radumaharaj.

    #152232
     Radu
    Moderator

    Ok thanks you for providing solution

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #152267
     Roader
    Participant

    Other Measure:

    COPY CODE
    // BuddyPress Honeypot. Stop Spammers Registration. 
    function add_honeypot() {
        echo '';
    }
    add_action('bp_after_signup_profile_fields','add_honeypot');
    function check_honeypot() {
        if (!empty($_POST['system55'])) {
            global $bp;
            wp_redirect(home_url());
            exit;
        }
    }
    add_filter('bp_core_validate_user_signup','check_honeypot');
Viewing 29 posts - 1 through 29 (of 29 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?