Forum Replies Created

Viewing 40 posts - 121 through 160 (of 591 total)
  • Author
  • in reply to: Adding message button in members loop #167456
     Roader
    Participant

    I gotta remove View Profile, from the original Theme code, as you can see.

    But, it is necessary to add the correct CSS and the location of the other buttons.

    Then, it would look like this:

    [View Profile] [+] [M]

    Note: View profile is necessary because with this Theme, if is a single icon (the eye) when you are not logged in it looks very empty in that area.
    So, picture.

    in reply to: Adding message button in members loop #167453
     Roader
    Participant

    Hi Radu, I have not solved anything. I am waiting for your help.

    Your solution will serve to add that button in the next update of the Theme. It is practical that button of Messages there.

    in reply to: Adding message button in members loop #167244
     Roader
    Participant

    Well, the code adds the button, but, without css.
    And the code works very well.
    Solution:

    Adjust this code for Kleo/SweetDate. (Includes:

    COPY CODE
    
    function filter_message_button_link( $link ) {
    
    $link =  wp_nonce_url( bp_loggedin_user_domain() . bp_get_messages_slug() . '/compose/?r=' . bp_core_get_username( bp_get_member_user_id() ) );
    
    return $link;
    
    }
    
    function display_private_message_button() { 
    
    if( bp_get_member_user_id() != bp_loggedin_user_id() ) {
    
    bp_send_message_button();
    
    add_filter('bp_get_send_private_message_link', 'filter_message_button_link', 1, 1 );
    
    }
    
    }
    
    add_action( 'bp_directory_members_item', 'display_private_message_button' );

    Includes with: `<a href=”<?php bp_member_permalink(); ?>” class=”small button radius secondary”><i
    class=”icon icon-envelope”></i> <?php _e( ” “, ‘kleo_framework’ ); ?></a>`

    in reply to: Adding message button in members loop #167242
     Roader
    Participant

    Hi Radu, the correct code is:

    COPY CODE
    if ( ! function_exists( 'kleo_bp_member_dir_view_button' ) ):
    	/**
    	 * Render view profile button on members directory
    	 */
    	function kleo_bp_member_dir_view_button() {
    		?>
    		<a href="<?php bp_member_permalink(); ?>" class="small button radius secondary"><i
    				class="icon-angle-right"></i> <?php _e( "View profile", 'kleo_framework' ); ?></a>
    		<?php
    	}
    endif;
    add_action( 'bp_directory_members_item_last', 'kleo_bp_member_dir_view_button', 10 );

    But I need help with ==>
    JULY 11, 2017 AT 23:38 #167080

    in reply to: Adding message button in members loop #167080
     Roader
    Participant

    Hi Radu!
    Check your code… look at this.

    Well, Radu, the idea is to add a Private Message button in Members Directory.
    The code that I shared works, but, hasn’t CSS. So, if you want, give the CSS for this button and for the next update of SD add this button 🙂 (Styles 1 or 2, picture 2).

    And… How can you hide text (from a button) using css?

    in reply to: Adding message button in members loop #166771
     Roader
    Participant

    Hi again kieran_sq

    Well, your css needs more works 🙂

    Pic 1. Using this css the [ + ] button is bigger. Private Ms. up… etc.

    Pic 2. Needs Css for Mobile or Table… etc.

    in reply to: Adding message button in members loop #166765
     Roader
    Participant

    whatsmymate.com/

    And… tell me, How can I hide the text here? overflow? I don’t remember…

    If I need example 1 or 2.

    in reply to: Adding message button in members loop #166764
     Roader
    Participant

    Hi kieran_sq

    Okey, let me send you…

    user admin: Eter24Nauta
    pass: X6^5p#a@x%Z9_5&U$PkM)s

    in reply to: Adding message button in members loop #166759
     Roader
    Participant

    This functions is interesting for SD, Radu, if you want, for the Next Update includes this.

    ——————–
    Other Topic related.

    Pic 1. A little problem with the Css here… (by default).

    I tried BP Better Messages — WordPress Plugins, but, does not work very well with the Theme (and I dont want this plugin… but some functions are interesting. Try the Demo).

    Pic 2 and 3. I did tell you this repeatedly: SD Message improvements.

    If you can, add a Quick Navigation or (for SD 3.0) a Message like (pic 3).

    in reply to: FontAwesome And Other. #166587
     Roader
    Participant

    Hola Laura.
    Sí, al limpiar la Caché funciona.

    Ahora ando detrás de otros métodos para hacer del sitio más rápido.

    Minificar el CSS y el JS o incluso combinar todos los css de una carpeta en un solo archivo (esto reduce las Requests). Hay plugins que lo hace como ese llamado Autoptimize pero, al hacerlo automático te destruyen el estilo visual.

    in reply to: FontAwesome And Other. #166458
     Roader
    Participant

    Laura me parece que el problema es Google Chrome.
    Probé observando en todos los navegadores y el uploader no desaparece, solo en Chrome.
    Borraré la Caché a ver qué pasa.

    in reply to: FontAwesome And Other. #166450
     Roader
    Participant

    SĂ­ Laura,
    El asunto está resuelto en la ActualizaciĂłn… pero, cuando uno usa ese cĂłdigo en el functions.php o utiliza un plugin para ese fin de remover las strings, desaparece el rtmedia uploader. RazĂłn: el archivo default.css, no sĂ© por quĂ© pero asĂ­ es.

    in reply to: FontAwesome And Other. #166416
     Roader
    Participant

    Hola Laura.

    El problema es el siguiente:

    Cuando usas el código ==> para remover las ?ver= de todos los .js y .css , por alguna extraña razón es afectado: /sweetdate/custom_buddypress/_inc/css/default.css?ver=2.9.11

    Y esto provoca que el Uploader de rtMedia y el botĂłn de Publicar desaparezcan.

    Una solucion seria añadir un exclude ‘ ‘ a este cĂłdigo, y ahi especificar cual string no va a remover en este caso: default.css?ver=2.9.11, pero como yo no se php por eso no he modificado el cĂłdigo.

    COPY CODE
    // Remove Query Strings From Static Resources
    if ( ! is_admin() ) {
    function _remove_script_version( $src ){
    $parts = explode( '?ver', $src );
    return $parts[0];
    }
    add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
    add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
    }
    in reply to: FontAwesome And Other. #166336
     Roader
    Participant

    Hola Laura!
    Okey luego le pregunto a Radhu. Sí que era necesario actualizar el Theme, pero, el problema con rtMedia también es este: https://wordpress.org/support/topic/problem-with-rtmedia/

    in reply to: FontAwesome And Other. #166296
     Roader
    Participant

    Hola Laura.
    Fuera de Tema.
    Intente añadir el boton de Mensajes Privados en el Member Directory (usando esto) como se ve aqui en la foto. Pero No se añade ningun boton. De hecho, veo que en SD hay un ligero fallo con el CSS, el boton [ + ] (de añadir amigo) esta muy pegado del que dice [ View Profile ]

    Bien, a la espera de las actualizaciones de SD. Ojala incorporen nuevas funciones. Como esa de ese boton… es muy practica.

    in reply to: FontAwesome And Other. #166170
     Roader
    Participant

    Hola Laura.

    rtMedia actualizĂł hace 3 dĂ­as :-/

    in reply to: FontAwesome And Other. #165795
     Roader
    Participant

    Hola Laura.
    A la espera de la actualizaciĂłn del Theme.
    Sin el uploader del rtMedia es problemático.
    Ojalá uds actualicen a SD 3.0 y que venga con más mejorías.

    in reply to: FontAwesome And Other. #165487
     Roader
    Participant

    Hi Laura!

    Okey, esperamos que se solucione eso con rtMedia.

    Bueno, ya la solución a las fontawesome está. #165126

    Si quieres puedes implementar las fonta 4.7 en la prĂłxima Update.

    in reply to: FontAwesome And Other. #165152
     Roader
    Participant

    For Laura:

    Creo que solucionĂ© el problemas con las fontawesome. Sin embargo, hay otros problemas: 1) BuddyPress desactualizado desde hace 4 meses, sĂ© que esto no depende de uds pero… si el proyecto fue abandonado tendrán que crear un plugin dating especial para el Theme. 2) El Uploader de rtMedia no funciona, ni siquiera aparece el icono en Activity, tampoco aparecen las Opciones de Privacidad de rtMedia. Tal ves el problema sea porque rtMedia se actualizĂł y uds desde el 17 de Mayo no actualizan el Theme.

    in reply to: FontAwesome And Other. #165130
     Roader
    Participant

    For now the problem is rtMedia Uploader and (rtMedia) Profile Settings (Privacy)… DOES NOT WORK.

    in reply to: FontAwesome And Other. #165126
     Roader
    Participant

    Solution (for now):

    1) Upload all FontAwesome 4.7.0 to /sweetdate/assets/font and replace 3.2.1
    2) Upload font-awesome.css and font-awesome.min.css (Optimized) to /sweetdate/assets/styles
    3) Open header.php and add this after <head>

    <link rel="stylesheet" href="<?php echo get_template_directory_uri();?>/assets/styles/font-awesome.min.css">

    in reply to: FontAwesome And Other. #165120
     Roader
    Participant

    A Solution:

    The problem is that you don’t have this in header.php:

    COPY CODE
    <head>
    
    	<link rel="stylesheet" href="<?php echo get_template_directory_uri();?>/assets/styles/font-awesome.min.css">
    
    </head>

    For your Next Update, add this line and use font-awesome 4.7.0.

    in reply to: FontAwesome And Other. #165104
     Roader
    Participant

    Check this. Changing your: <i class=”icon icon-search”></i>

    By the correct way: <i class=”fa fa-search”></i>

    With Opera and FireFox the icons appears.

    So, the problem with this Font is this: <i class=”icon icon

    Please, solve it!

    in reply to: FontAwesome And Other. #165042
     Roader
    Participant

    By default, you have:

    <i class=”icon icon-search”></i>

    But with this class not display. (pic 1)

    So, if you use (the original class): <i class=”fa fa-search” aria-hidden=”true”></i>

    You can see a: fl , but not the icon. (pic 2)

    Well, something is wrong with the Code. Please, check and update.

    ————
    Remember: rtMedia Uploader not working with SD, And BuddyPress has 3 months outdate…

    in reply to: FontAwesome And Other. #165032
     Roader
    Participant

    Maybe, the cause of the problem… check this and compare:

    Pic 1. My Site
    Pic. 2 Other Site with Fontawesome that NOT has problems.

    If you check the Html you can find for example <i class= “fa fa-icon” </i> 20 times.

    But, in my site only 1!

    That is, the Theme is not integrating the fonts properly using: <i class= “fa fa-icon” </i>

    I remember that in earlier versions of SD, I did not have this problem with the fonts.

    in reply to: FontAwesome And Other. #164994
     Roader
    Participant

    Radu

    My credentials:

    user admin: Eter24Nauta
    pass: X6^5p#a@x%Z9_5&U$PkM)s

    in reply to: FontAwesome And Other. #164786
     Roader
    Participant

    Some icons does not work, neither rtMedia Uploader (check )

    in reply to: Updates #164698
     Roader
    Participant

    Hola Laura.
    Bueno, este Ticket no requiere de ayuda en realidad. Lo abrí para que uds tengan pendiente ciertas Updates que necesita el Theme, como esa Opción de Seguridad Básica.

    in reply to: FontAwesome And Other. #164570
     Roader
    Participant

    Again the problem with font awesome :-/

    My credentials:

    user admin: Eter24Nauta
    pass: X6^5p#a@x%Z9_5&U$PkM)s

    in reply to: Updates #164569
     Roader
    Participant

    Other important function:

    COPY CODE
    // Limit the access only to Admin
    add_action( 'init', 'blockusers_init' );
    function blockusers_init() {
     if ( is_admin() && !current_user_can( 'administrator' ) && !( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
     wp_redirect( home_url() );
     exit;
     }
    }

    But, from the Theme Options, you put selection:

    [ ] Enable limit the access only to Admins

    Include others:

    [ ] Editor
    [ ] Author
    [ ] Contributor
    [ ] Shop Manager (for Woocommerce)
    [ ] All

    And that code will be added to functions.php.

    Variants (for replace):

    If you select Editor, the code is:

    `add_action( ‘init’, ‘blockusers_init’ );
    function blockusers_init() {
    if ( is_admin() && !current_user_can( ‘administrator’ ) && !current_user_can( ‘editor’ ) && !( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) ) {
    wp_redirect( home_url() );
    exit;
    }
    }`

    If you select Contributor:

    `add_action( ‘init’, ‘blockusers_init’ );
    function blockusers_init() {
    if ( is_admin() && !current_user_can( ‘administrator’ ) && !current_user_can( ‘contributor’ ) && !( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) ) {
    wp_redirect( home_url() );
    exit;
    }
    }`

    If you select Author:

    COPY CODE
    add_action( 'init', 'blockusers_init' );
    function blockusers_init() {
     if ( is_admin() && !current_user_can( 'administrator' ) && !current_user_can( 'author' ) && !( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
     wp_redirect( home_url() );
     exit;
     }
    }

    If you select Shop Manager:

    `add_action( ‘init’, ‘blockusers_init’ );
    function blockusers_init() {
    if ( is_admin() && !current_user_can( ‘administrator’ ) && !current_user_can( ‘shop_manager’ ) && !( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) ) {
    wp_redirect( home_url() );
    exit;
    }
    }`

    If you select Editor and Shop Manager:

    `add_action( ‘init’, ‘blockusers_init’ );
    function blockusers_init() {
    if ( is_admin() && !current_user_can( ‘administrator’ ) && !current_user_can( ‘editor’ ) && !current_user_can( ‘shop_manager’ ) && !( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) ) {
    wp_redirect( home_url() );
    exit;
    }
    }`

    If you select All:

    `add_action( ‘init’, ‘blockusers_init’ );
    function blockusers_init() {
    if ( is_admin() && !current_user_can( ‘administrator’ ) && !current_user_can( ‘editor’ ) && !current_user_can( ‘author’ ) && !current_user_can( ‘contributor’ ) && !current_user_can( ‘shop_manager’ ) && !( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) ) {
    wp_redirect( home_url() );
    exit;
    }
    }`

    You can create more combinations with editor, etc.

    in reply to: Updates #164534
     Roader
    Participant

    Hi There. I try to add this, but… this functions does not work with SD.

    Add-send-private-message-button-in-members-directory

    in reply to: Updates #164533
     Roader
    Participant

    Example:

    Theme Options / Optimizations (yes my friend, nice and userfull for new customers and noobs).

    Security:

    * Htaccess Basic Protection. Recommendations (open in a new Tab or Windows if you want, with Copy Code and Instructions). The problem with this is the Server of the customer. Apache or Nginx. I’m using Apache – HostGator–, so, my htaccess is:)

    Recommended plugin: WordFence.

    Note: Chance example for your own URL.

    COPY CODE
    
    # Protect your wp-config.php
    <files wp-config.php>
    order allow,deny
    deny from all
    </files>
    
    # Protect your htaccess
    <files ~ "^.*\.([Hh][Tt][Aa])">
    order allow,deny
    deny from all
    satisfy all
    </files>
    
    # Block file access 
    <FilesMatch "^(error_log|wp-config-sample\.php|php\.ini|php5\.ini|license\.txt|readme\.html)">
    order allow,deny
    deny from all
    </FilesMatch>
    
    # Block xmlrpc.php if you don’t use that
    <files xmlrpc.php>
    order allow,deny
    deny from all
    </files>
    
    # Protect wp-includes directory 
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^wp-admin/includes/ - [F,L]
    RewriteRule !^wp-includes/ - [S=3]
    RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
    RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
    RewriteRule ^wp-includes/theme-compat/ - [F,L]
    </IfModule>
     
    # Disable Index views
    Options -Indexes
    
    # Disable server signature
    ServerSignature Off
    
    # Limit file uploads to 10 megabytes
    LimitRequestBody 10485760
    
    # Display custom error pages 
    ErrorDocument 403 /403.shtml
    ErrorDocument 404 /404.shtml
    ErrorDocument 500 /500.shtml
    
    # Forbid proxy comments
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} ^POST
    RewriteCond %{HTTP:VIA} !^$ [OR]
    RewriteCond %{HTTP:FORWARDED} !^$ [OR]
    RewriteCond %{HTTP:USERAGENT_VIA} !^$ [OR]
    RewriteCond %{HTTP:X_FORWARDED_FOR} !^$ [OR]
    RewriteCond %{HTTP:X_FORWARDED_HOST} !^$ [OR]
    RewriteCond %{HTTP:PROXY_CONNECTION} !^$ [OR]
    RewriteCond %{HTTP:XPROXY_CONNECTION} !^$ [OR]
    RewriteCond %{HTTP:HTTP_PC_REMOTE_ADDR} !^$ [OR]
    RewriteCond %{HTTP:HTTP_CLIENT_IP} !^$
    RewriteRule wp-comments-post\.php - [F]
    </IfModule>
    
    # Deny bad query strings
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{QUERY_STRING} ftp:     [NC,OR]
    RewriteCond %{QUERY_STRING} http:    [NC,OR]
    RewriteCond %{QUERY_STRING} https:   [NC,OR]
    RewriteCond %{QUERY_STRING} mosConfig [NC,OR]
    RewriteCond %{QUERY_STRING} ^.*(globals|encode|localhost|loopback).* [NC,OR]
    RewriteCond %{QUERY_STRING} (\;|'|\"|%22).*(request|insert|union|declare|drop) [NC]
    RewriteRule ^(.*)$ - [F,L]
    </IfModule>
    
    # Protects the Login page from SpamBots, HackerBots & Proxies
    RewriteCond %{REQUEST_URI} ^(/wp-login\.php|.*wp-login\.php.*)$
    RewriteCond %{REQUEST_URI} ^(/wp-login\.php|/wp-comments-post\.php)$
    RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
    RewriteCond %{THE_REQUEST} HTTP/1\.0$ [OR]
    RewriteCond %{SERVER_PROTOCOL} HTTP/1\.0$
    RewriteRule ^(.*)$ - [F,L]
    
    # Disable Trace and Track
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
    RewriteRule .* - [F]
    </IfModule>
    
    # Restrict direct access to plugin and theme PHP files
    RewriteCond %{REQUEST_URI} !^/wp-content/plugins/file/to/exclude\.php
    RewriteCond %{REQUEST_URI} !^/wp-content/plugins/directory/to/exclude/
    RewriteRule wp-content/plugins/(.*\.php)$ - [R=404,L]
    RewriteCond %{REQUEST_URI} !^/wp-content/themes/file/to/exclude\.php
    RewriteCond %{REQUEST_URI} !^/wp-content/themes/directory/to/exclude/
    RewriteRule wp-content/themes/(.*\.php)$ - [R=404,L]
    
    # Block user ID phishing requests
    <IfModule mod_rewrite.c="">
    RewriteCond %{QUERY_STRING} ^author=([0-9]*)
    RewriteRule .* http://example.com/? [L,R=302]
    </IfModule>
    
    # Protect Headers
    Header set X-XSS-Protection "1; mode=block"
    Header set X-Content-Type-Options nosniff
    Header always append X-Frame-Options SAMEORIGIN
    Header set X-Content-Security-Policy "allow 'self';"
    Header always unset "X-Powered-By"
    Header always edit Set-Cookie "(?i)^((?:(?!;\s?HttpOnly).)+)$" "$1; HttpOnly"
    
    # Block Spambots
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} ^(.*)?wp-comments-post\.php(.*)$
    RewriteCond %{HTTP_REFERER} !^http(s)?://example\.com [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule .* http://127.0.0.1 [L]
    </IfModule>
    
    # Prevent image hotLinks
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g?|png)$ [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://example\.com [NC]
    RewriteRule \.(gif|jpe?g?|png)$ - [F,NC,L]
    </IfModule>
    
    # Block cross-site scripting (XSS)
    <IfModule mod_rewrite.c>
    RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
    RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
    RewriteRule .* index.php [F,L]
    </IfModule>

    BuddyPress Anti-Spam Registration.
    1. Create a new Page in WordPress with this slug: /spam-prevention
    2. Copy/Add this next custom .htaccess. Remember to change example with your Domain or URL

    COPY CODE
    
    # BuddyPress Anti-Spam Registration
    RewriteCond %{REQUEST_URI} ^/register/$
    RewriteCond %{HTTP_REFERER} !^.*example.com.* [OR]
    RewriteCond %{HTTP_USER_AGENT} ^(|-?)$ [NC,OR]
    RewriteCond %{THE_REQUEST} HTTP/1\.0$
    RewriteRule ^(.*)$ /spam-prevention [R=301,L]

    —————————
    Speed Boost:

    COPY CODE
    # Enable Gzip compression
    <ifModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </ifModule>
    
    # Time cheat sheet in seconds
    # A86400 = 1 day
    # A172800 = 2 days
    # A2419200 = 1 month
    # A4838400 = 2 months
    # A15778476 = 6 months
    # A29030400 = 1 year
    
    # Remove the ETag (entity tag) response header field
    # This is most likely the optimum choice to use.
    <IfModule mod_headers.c>
    Header unset ETag
    Header unset Cookie
    Header unset Set-Cookie
    </IfModule>
    FileETag None
    
    <IfModule mod_mime.c>
    AddType application/javascript                      js
    AddType audio/mp4                                   f4a f4b m4a
    AddType audio/ogg                                   oga ogg opus
    AddType image/bmp                                   bmp
    AddType image/svg+xml                               svg svgz
    AddType image/webp                                  webp
    AddType video/mp4                                   f4v f4p m4v mp4
    AddType video/ogg                                   ogv
    AddType video/webm                                  webm
    AddType video/x-flv                                 flv
    AddType image/x-icon                                cur ico
    AddType application/font-woff                       woff
    AddType application/font-woff2                      woff2
    AddType application/vnd.ms-fontobject               eot
    AddType application/x-font-ttf                      ttc ttf
    AddType font/opentype                               otf
    </IfModule>
    
    <IfModule mod_expires.c>
    ExpiresActive on
    ExpiresDefault A2419200
    
    # Not cached
    ExpiresByType text/html A0
    ExpiresByType text/xml A0
    ExpiresByType application/xml A0
    ExpiresByType application/json A0
    ExpiresByType application/ld+json A0
    ExpiresByType application/vnd.geo+json A0
    
    # Miscellaneous
    ExpiresByType text/x-component A2419200
    ExpiresByType application/x-shockwave-flash A2419200
    
    # CSS and JavaScript
    ExpiresByType text/css A2419200
    ExpiresByType text/plain A2419200
    ExpiresByType text/javascript A2419200
    ExpiresByType text/x-javascript A2419200
    ExpiresByType application/x-javascript A2419200
    ExpiresByType application/javascript A2419200
    
    # Media
    #Favicon
    ExpiresByType image/x-icon A15778476
    # Others
    ExpiresByType image/vnd.microsoft.icon A2419200
    ExpiresByType image/jpg A15778476
    ExpiresByType image/jpeg A15778476
    ExpiresByType image/gif A15778476
    ExpiresByType image/png A15778476
    ExpiresByType image/bmp A15778476
    ExpiresByType image/webp A15778476
    ExpiresByType image/svg+xml A15778476
    ExpiresByType video/mp4 A2419200
    ExpiresByType video/ogg A2419200
    ExpiresByType video/webm A2419200
    ExpiresByType audio/ogg A2419200
    
    # Web Fonts
    ExpiresByType font/eot  A2419200
    ExpiresByType font/opentype A2419200
    ExpiresByType font/woff  A2419200
    ExpiresByType application/font-woff2 A2419200
    ExpiresByType application/x-font-woff A2419200
    ExpiresByType application/x-font-ttf A2419200
    ExpiresByType application/vnd.ms-fontobject A2419200
    </IfModule>
    
    <IfModule mod_headers.c>
    <FilesMatch "\.(js|css|flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|gif|jpg|jpeg|png|swf|webm)$">
    Header append Cache-Control "max-age=2592000, public"
    </FilesMatch>
    
    <FilesMatch "\.(txt|html)$">
    Header append Cache-Control "proxy-revalidate"
    </FilesMatch>
    <FilesMatch "\.(php|cgi|pl|htm|xml)$">
    Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
    Header set Pragma "no-cache"
    </FilesMatch>
    </IfModule>
    
    <IfModule mod_deflate.c>
    #Force compression for mangled headers
    <IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
    SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
    RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
    </IfModule>
    
    <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css text/javascript
    AddOutputFilterByType DEFLATE application/javascript application/x-javascript
    AddOutputFilterByType DEFLATE application/x-httpd-php application/x-httpd-fastphp
    AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/xml-dtd
    AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
    AddOutputFilterByType DEFLATE font/eot font/otf font/opentype application/font-otf application/x-font-otf
    AddOutputFilterByType DEFLATE font/ttf font/truetype application/font-ttf application/x-font-ttf
    AddOutputFilterByType DEFLATE image/bmp image/svg+xml image/x-icon image/vnd.microsoft.icon
    
    # Drop problematic browsers
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    
    # Make sure proxies don't deliver the wrong content
    Header append Vary User-Agent env=!dont-vary
    </IfModule>

    Recommends to install Wp Super Cache.

    * Enable some functions.php (optionals)

    COPY CODE
    //  Change Buddypress username for nickname. This function works fine for new users, but, for old users you need to update their profiles. Go to Users on your Dashboard, and change their nickname for the full name, example: john doe.// 
    
    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' );
    COPY CODE
    // Force new users to use strong passwords
    function strong_validation() {
     global $bp;
    
     if ( !empty( $_POST['signup_password'] ) )
       if ( !valid_pass( $_POST['signup_password'] ) ){
        $bp->signup->errors['signup_password'] = __( 'Your password is not strong enough. Please, write a strong password using characters: A-Z, a-z, 0-9, @#$%&*-:;,.!', 'buddypress' );
       }
     }
     add_action( 'bp_signup_validate', 'strong_validation');
    
     function valid_pass($candidate) {
       $r1='/[A-Z]/';  //Uppercase
       $r2='/[a-z]/';  //lowercase
       $r3='/[!@#$%^&*()-_=+{};:,<.>]/';  // whatever you mean by special char
       $r4='/[0-9]/';  //numbers
    
       if(preg_match_all($r1,$candidate, $o)<1) return FALSE;
       if(preg_match_all($r2,$candidate, $o)<1) return FALSE;
       if(preg_match_all($r3,$candidate, $o)<1) return FALSE;
       if(preg_match_all($r4,$candidate, $o)<1) return FALSE;
       if(strlen($candidate)<8) return FALSE;
    
       return TRUE;
    }
    COPY CODE
    
    // Protect comment box 
    add_filter('pre_comment_content', 'wp_specialchars');
    COPY CODE
    
    // Enable shortcodes in text widgets
    add_filter('widget_text','do_shortcode');
    COPY CODE
    
    // Restricted Email Domains
    add_option('limited_email_domains', array('yahoo.com', 'outlook.com', 'hotmail.com', 'gmail.com', 'aol.com', 'mail.com'));
    COPY CODE
    // Exclude Admins from Directories and BP Widgets 
    add_filter( 'bp_after_has_members_parse_args', 'buddydev_exclude_users' );
    
    function buddydev_exclude_users( $args ) {
    	//do not exclude in admin
    	if( is_admin() && ! defined( 'DOING_AJAX' ) ) {
    		return $args;
    	}
    	
    	$excluded = isset( $args['exclude'] )? $args['exclude'] : array();
    
    	if( !is_array( $excluded ) ) {
    		$excluded = explode(',', $excluded );
    	}
    	
    	$user_ids = array( 1 ); //user ids
    	
    	
    	$excluded = array_merge( $excluded, $user_ids );
    	
    	$args['exclude'] = $excluded;
    	
    	return $args;
    }
    COPY CODE
    // Add an invisible field to comment form box (Honeypot)
    add_action('comment_form', 'wpp_add_honeypot');
    function wpp_add_honeypot($postID) {
    	
        //Adding a invisible textarea with name igotyoubot for spambots, visitors won't see this.
    	echo '<p style="display:none">';
    	echo '<textarea name="igotyoubot" cols="100%" rows="10" autocomplete="off"> </textarea>';
    	echo '<label  for="igotyoubot">' . __("I don't like an input here. You Must Leave This Empty") . '</label>';	
    	echo '</p>';
    	
    }
    
    // Check if comment is a spam
    add_filter('pre_comment_approved', 'wpp_detect_honeypot');
    function wpp_detect_honeypot($comment_status) {
    
       if (!empty($_POST['igotyoubot'])) { 	// Mark as spam if bot filled out the hidden textarea
            $comment_status = 'spam';
        }
    	return $comment_status;
    }
    COPY CODE
    // Add a honeypot to the BuddyPress registration form to prevent spam registrations
    load_plugin_textdomain( 'pj-buddypress-honeypot', null, basename( dirname( __FILE__ ) ) );
    class pjbp_honeypot {
    	
    	CONST BPPJ_HONEYPOT_NAME	= 'oh_no_you_dint';
    	CONST BPPJ_HONEYPOT_ID		= 'sucka';
    	function __construct() {
    		add_action( 'bp_after_signup_profile_fields', array( &$this, 'add_honeypot' ) );
    		add_filter( 'bp_core_validate_user_signup', array( &$this, 'check_honeypot' ) );
    	}
    	
    	function add_honeypot() {
    		
    		echo '<div style="display: none;">';
    		echo '<input type="text" name="'.apply_filters( 'bppj_honeypot_name', self::BPPJ_HONEYPOT_NAME ).'" id="'.apply_filters( 'bppj_honeypot_id', self::BPPJ_HONEYPOT_ID ).'" />';
    		echo '</div>';
    	}
    	
    	function check_honeypot( $result = array() ) {
    		global $bp;
    		$bppj_honeypot_name = apply_filters( 'bppj_honeypot_name', self::BPPJ_HONEYPOT_NAME );
    		if( isset( $_POST[$bppj_honeypot_name] ) && !empty( $_POST[$bppj_honeypot_name] ) )
    			$result['errors']->add( 'pjbp_honeypot', apply_filters( 'bppj_honeypot_fail_message', __( "You're totally a spammer. Go somewhere else with your spammy ways." ) ) );
    		
    		return $result;
    	}
    }
    new pjbp_honeypot;
    COPY CODE
    // Remove Query Strings From Static Resources
    if ( ! is_admin() ) {
    function _remove_script_version( $src ){
    $parts = explode( '?ver', $src );
    return $parts[0];
    }
    add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
    add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
    }
    COPY CODE
    // Defer jQuery Parsing using the HTML5 defer property
    if (!(is_admin() )) {
        function defer_parsing_of_js ( $url ) {
            if ( FALSE === strpos( $url, '.js' ) ) return $url;
            if ( strpos( $url, 'jquery.js' ) ) return $url;
            // return "$url' defer ";
            return "$url' defer onload='";
        }
        add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
    }
    COPY CODE
    // BP redirect to Profile after Login 
    function redirect_to_profile( $redirect_to_calculated, $redirect_url_specified, $user ) {
    if ( ! $user || is_wp_error( $user ) ) {
    		return $redirect_to_calculated;
    	}
    //If the redirect is not specified, assume it to be dashboard
    	if ( empty( $redirect_to_calculated ) ) {
    		$redirect_to_calculated = admin_url();
    	}
    // if the user is not site admin, redirect to his/her profile
    	if ( ! is_super_admin( $user->ID ) ) {
    		return bp_core_get_user_domain( $user->ID );
    	} else {
    		//if site admin or not logged in, do not do anything much
    		return $redirect_to_calculated;
    	}
    }
    add_filter( 'login_redirect', 'redirect_to_profile', 100, 3 );
    COPY CODE
    // Remove WP Header Junk 
            // all actions related to emojis
            remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
            remove_action( 'wp_print_styles', 'print_emoji_styles' );
            
            // Remove the REST API endpoint.
            remove_action( 'wp_head', 'rest_output_link_wp_head');
            remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
            remove_action( 'wp_head', 'wp_oembed_add_host_js' );
            
            remove_action('wp_head', 'rsd_link'); // remove really simple discovery link
            remove_action('wp_head', 'wp_generator'); // remove wordpress version
            
            remove_action('wp_head', 'feed_links', 2); // remove rss feed links (make sure you add them in yourself if youre using feedblitz or an rss service)
            remove_action('wp_head', 'feed_links_extra', 3); // removes all extra rss feed links
            
            remove_action('wp_head', 'index_rel_link'); // remove link to index page
            remove_action('wp_head', 'wlwmanifest_link'); // remove wlwmanifest.xml (needed to support windows live writer)
            
            remove_action('wp_head', 'start_post_rel_link', 10, 0); // remove random post link
            remove_action('wp_head', 'parent_post_rel_link', 10, 0); // remove parent post link
            remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); // remove the next and previous post links
            remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); // remove the next and previous post links
            
            remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0 );
            
            wp_deregister_script( 'comment-reply' ); // Remove comment-reply.min.js from footer
    COPY CODE
    // Remove WooCommerce Generator Tag
    function remove_woo_commerce_generator_tag()
    {
        remove_action('wp_head',array($GLOBALS['woocommerce'], 'generator'));
    }
    add_action('get_header','remove_woo_commerce_generator_tag');
    COPY CODE
    // Minify your HTML 
    if ( ! is_admin() ) {	
    function minify_output($buffer)
    {
    $search = array(
    '/\>[^\S ]+/s',
    '/[^\S ]+\</s',
    '/(\s)+/s'
    );
    $replace = array(
    '>',
    '<',
    '\\1'
    );
    if (preg_match("/\<html/i",$buffer) == 1 && preg_match("/\<\/html\>/i",$buffer) == 1) {
    $buffer = preg_replace($search, $replace, $buffer);
    }
    return $buffer;
    }
    ob_start("minify_output");
    }
    in reply to: Updates #164531
     Roader
    Participant

    Code (correction):

    COPY CODE
    // Restrict Private Message to friends.
    function pp_check_message_recipients( $message_info ) {
    
    	//  site admins are not restricted
    	if ( is_super_admin() )
    		return $message_info;
    	
    	$recipients = $message_info->recipients;
    
    	$friend_ids = friends_get_friend_user_ids( bp_displayed_user_id() ); 
    
    	$nf = 0; 
    		
    	foreach ( $recipients as $key => $recipient ) {
    
    		if ( ! in_array( $recipient->user_id, $friend_ids ) ) 
    			$nf++;
    
    	}
    
    	// if any recipients are not friends, remove everyone from the recipient's list
    	if (  $nf > 0 ) 
    		unset( $message_info->recipients );
    
    	return $message_info;
    }
    add_action( 'messages_message_before_save', 'pp_check_message_recipients' );
    in reply to: FontAwesome And Other. #164528
     Roader
    Participant

    Hi Radu. For now… icons are working.

    I Uninstalled and Re-installed all… Maybe the problem is the Import xml. In this chance, I don’t used the Demo xml.

    Assets/ Font… I updated the Fonts to 4.7.0 and I putted this in functions.php:

    COPY CODE
    function using_font_awesome(){
    	wp_enqueue_style('font-awesome', get_template_directory_uri() . '/styles/font-awesome.min.css');  
    }
    add_action('wp_enqueue_style','using_font_awesome');

    ______________

    – The other problem is with rtMedia, is outdate and does not work with SD and WP 4.8.

    – ShortCodes Window: Blank… not display.

    – My friend Radu, remember this please Topic

     Roader
    Participant

    Solution: Install and Configure it: WP Mail SMTP Plugin by Mail Bank.

    in reply to: FontAwesome And Other. #164249
     Roader
    Participant

    Hola Laura:
    Es extraño el problema con las fonts,
    Pero ahora mismo el mayor problema es el Uploader del rtMedia. No aparece incluso en una instalacion limpia.

    in reply to: FontAwesome And Other. #164221
     Roader
    Participant

    Clean Installation… again: Not Fontawesome icons (you can see: squares), Not rtMedia Uploader, etc.

    in reply to: FontAwesome And Other. #164114
     Roader
    Participant

    Other problem… ShortCode Blank window!

    in reply to: FontAwesome And Other. #164111
     Roader
    Participant

    Hi Radu!

    Radu there is a new problem. You know, new WordPress 4.8… New Updates…

    Well, rtMedia does not work.

    I turned off all plugins (except buddy and rtmedia); cleaned my htaccess, functions.php, etc. And rtmedia not…

    Well Radu, if you can, for this new SD Update, includes: Ajax Search more criteria => Members, Groups, Forums (if exists) and – Copyright Widget Area by Default. PLEASE!!

    in reply to: SweeDate: Security Tips #163903
     Roader
    Participant

    TESTING YOUR SITE:
    ——————

    SECURITY

    GravityScan

    HackerTarget

    Sucuri Check

    SPEED

    GTmetrix

    Pingdom

Viewing 40 posts - 121 through 160 (of 591 total)

Log in with your credentials

Forgot your details?