-
Author
-
January 26, 2017 at 00:11 #150802RoaderParticipant
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.January 26, 2017 at 08:05 #150845LauraModeratorHello, 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 solutionLaura 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 🙂
January 26, 2017 at 18:18 #150933RaduModeratorHi,
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 solutionJanuary 27, 2017 at 00:11 #150979RoaderParticipantUmm Rename what?
Only I want to hide author url… so, send me and exa.January 27, 2017 at 00:17 #150980RoaderParticipant$author = sprintf( ‘%3$s‘,
Here ??? But does not work.
January 27, 2017 at 00:20 #150983RoaderParticipantI want that this function affect only Admins, Editors, not Subscribers.
January 27, 2017 at 14:57 #151099RaduModeratorHi,
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 CODEif( 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 solutionJanuary 27, 2017 at 22:03 #151168RoaderParticipantCOPY CODEif( 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.January 29, 2017 at 19:03 #151262RoaderParticipantGood 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 CODEhttps://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-usernameThis should not be like that.
Therefore, you must create a PHP Function that FORCES to display only the NickName:
Profile:
Your Public Name
@your-nicknameURLs:
COPY CODEwww.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) reCaptchaIn: 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.jsThis 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.January 29, 2017 at 19:13 #151276RoaderParticipantFor 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.January 30, 2017 at 18:02 #151387RaduModeratorHi,
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
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJanuary 30, 2017 at 18:48 #151394RoaderParticipantI 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.
January 30, 2017 at 18:50 #151395RoaderParticipantIf I found a PHP code to resolve this vulnerability, I would certainly share it here,
But I find nothing.January 30, 2017 at 18:56 #151398RoaderParticipantMaybe… I dont know… you are the master in php… If you get something… let me know.
COPY CODEif ( $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…
January 30, 2017 at 18:57 #151399RoaderParticipantOther…. MAYBE… ??
https://developer.wordpress.org/reference/functions/the_author_nickname/
January 30, 2017 at 21:40 #151423RoaderParticipantMy 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 CODEadd_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.January 31, 2017 at 01:06 #151432RoaderParticipantFor 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.January 31, 2017 at 01:25 #151436RoaderParticipantOther code, but not work from functions.php, maybe needs other lines.
COPY CODEif ( $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>'; }
February 2, 2017 at 19:35 #151749RaduModeratorHi 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 solutionFebruary 2, 2017 at 21:45 #151757RoaderParticipantUmm
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.
February 2, 2017 at 21:50 #151758RoaderParticipantOther 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.
February 3, 2017 at 03:57 #151764RoaderParticipantEspero 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!
February 6, 2017 at 15:52 #152121RaduModeratorHi,
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 solutionFebruary 6, 2017 at 19:03 #152159RoaderParticipantMy friend Radu, the Solution for this Topic is:
COPY CODEfunction 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' );
February 6, 2017 at 19:07 #152160RoaderParticipantThis 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.
February 7, 2017 at 17:39 #152232RaduModeratorOk 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 solutionFebruary 7, 2017 at 22:34 #152267RoaderParticipantOther 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');
-
AuthorPosts
You must be logged in to reply to this topic.