Check if WordPress is infected

If you feel that your worpress was hacked or infected by malware, there are few basic steps you should follow:

1.- execute an online malware scanner:
for example:
https://sitecheck.sucuri.net

2.- Check integrity of core php files and restore original files if possible (if not, reinstall same version of wordpress):
for example:
access your server using SSH and perform the following command:
find ./ -type f -mtime -15 (15 is 15days, put the amount of days that fit better your case)

3.- Manually remove changes in your pages.
with online malware scanners you can find which pages are affected.
You may also find some wordpress pluggins that may help you clean SPAM injected links in your pages.

4.- it’s always recommended to upgrade wordpress to latest version, but for some compatibility issues is not always a possible option.

 

If you found a good way to solve this wordpress problem, comment with your solution and hints.

Delete Revisions in BBpress, Without any Plugin!

I needed to do this in one of the forums I manage. I made a research and this is the quick solution that will let you delete revisions.

This methods don’t physically delete revisions from your database, it hides them to shop up in your forum. I believe this is a better solution to all forum administrators because it keeps a log of all edits that users made.

Before deleting revisions:

before deleting revisions

After deleting revisions:

after delete revisions

Solution 1: Delete Revisions (All Revisions)

This one is the fastest way completely remove all revisions. It worked perfectly for me. This is the solution I’m using to remove revisions in my forum.

open your functions.php file in your theme:
wp-content/themes/xxx-your-theme-xxx/functions.php

and add this code at the end

// Reurn a empty array of revisions
function bbp_remove_revision_log( $r='' ) {
return( array() );
}

add_filter( 'bbp_get_reply_revisions',   'bbp_remove_revision_log', 20, 1 );
add_filter( 'bbp_get_topic_revisions', 'bbp_remove_revision_log', 20, 1 );

Solution 2: Remove Revisions (All But the Last)

Use this solution if you want to show that a post has a revision, but don’t want to delete all revisions, just remove the oldest.

open your functions.php file in your theme:
wp-content/themes/xxx-your-theme-xxx/functions.php

and add this code at the end

// Only return the last entry for revision log
function bbp_trim_revision_log( $r='' ) {
$revisions_arr = array( end( $r ));
reset( $r );

return( $revisions_arr );
}

add_filter( 'bbp_get_reply_revisions', 'bbp_trim_revision_log', 20, 1 );
add_filter( 'bbp_get_topic_revisions', 'bbp_trim_revision_log', 20, 1 );

Solution 3: Hide Revisions by CSS  (Disable All Revisions)

This method disable the revisions div, and will hide all revisions.

Edit your themes CSS

.bbp-reply-revision-log {

display: none;

}

References:

https://bbpress.org/forums/topic/too-many-revision-statements-how-to-remove-all-but-1/
https://bbpress.org/forums/topic/removing-log-of-edits-to-forum/

Hope this post was useful for you. If you have any problem deleting revisions, or found a better solutions, let me know.

¿Cómo Cambiar el Password de MySQL en Mac OS X?

ARTICULO ACTUALIZADO. Probado en OSX 10.9.2
———————————————–

No te preocupes, cambiar la clave de root de MySQL en OSX es bien facil, y no eres al primero que necesita hacerlo. … yo mientras escribo esto, lo estoy haciendo 😉

0.- Abre el terminal, y copia y pega los siguientes comandos.

1.- Para el servicio de MySQL

sudo /usr/local/mysql/support-files/mysql.server stop

2.- arrancalo de nuevo en safe mode

sudo /usr/local/mysql/support-files/mysql.server start –skip-grant-tables

3.- abre el cliente mysql

/usr/local/mysql/bin/mysql

4.- ahora aparecerá el prompt de mysql : mysql>  , y escribe en el:

FLUSH PRIVILEGES;

5.- pulsa enter y después

ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘mypasswordnuevo’;

6.- pulsa enter y Listo!!

 

Para comprobar si se ha cambiado correctamente puedes hacer lo siguiente:

sudo /usr/local/mysql/support-files/mysql.server stop
sudo /usr/local/mysql/support-files/mysql.server start
/usr/local/mysql/support-files/mysql -u root -p

y escribe mypasswordnuevo

 

SI NO TE HA FUNCIONADO, prueba los siguientes métodos alternativos.

Los mismos pasos de antes, pero sustituyendo el paso 5.- por el siguiente:

5.-

UPDATE mysql.user SET Password=’mypasswordnuevo’ WHERE User=’root’;
FLUSH PRIVILEGES;

Y si tampoco funciona, prueba lo siguiente en el paso 5.-

5.-

UPDATE mysql.user SET authentication_string = ‘mypasswordnuevo’
WHERE User = ‘root’ AND Host = ‘localhost’;
FLUSH PRIVILEGES;

 

 

si deseas manejar las bases de datos de forma visual, descargate phpmyadmin, lo pones en la carpeta de apache, abrelo en tu navegador, e introduce el usuario root y la clave que acabas de poner.

si te ha servido de ayuda, déjame un comentario abajo 😉

 

Fuentes:
https://stackoverflow.com/questions/6474775/setting-the-mysql-root-user-password-on-os-x
https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html

phpBB to BBpress migration + SEO 301 redirects

In this Article I will explain how I successfully migrated a forum from PHPbb to BBpress in 5 minutes. It was easiest than I ever thought. After migrating to BBpress I just add few lines of code in a template file of phpBB to make a clean SEO redirect to the new forum. All worked like charm.

Be careful: Why to move from phpBB to BBpress?

I supose you already spend some time taking this decision, but remember this quick comparison phpBB Vs BBpress:

«bbpress is SIMPLICITY», «PHPbb is POWERFUL».

if you want to migrate a small starting community from phpBB to BBpress, it’s OK, if you want to migrate a large big community, maybe users will not understand the lack of functionality they are used to have in your phpBB forum.

In my case, I did a migration of a phpBB forum to wordpress BBpress because it was a in the early days of the creation of a community, the simplicity benefit of bbpress, worpress blogging integration, and the flexibility to add and mould the website towards the needs of the future community.

The migration from phpBB to BBpress:

STEP 1.- Installation of bbpress (Skip if you already installed it):

  • Install wordpress,
  • settings–> permalinks –>select post name
Captura de pantalla 2016-02-27 17.45.30

settings to migrate phpbb to bbpress

 

  • install bbpress
  • settings–> forums –>configure as I show in the screenshot
bbpress configuration

migrate phpbb to bbpress: configure bbpress like this

STEP 2.- And the only one step to migrate from phpbb to bbpress is:

TIPS:
1.- choose a different URL for the new forum. for example, if you used /forum/ in phpBB, use /forums/ in bbpress
2.- don’t delete your phpBB forum.
3.- as an extra, in phpbb you could disable registration of new users, and add a message in the /styles/prosilver/template/overall_header.html   file.

Preserving the SEO after moving from PHPbb to BBpress

It’s very easy!!!

and this is very important, not only to avoid penalizations, but to correctly direct potential users that come from SERP results in google to the new forum and don’t loose or frustrate visitors after the phpBB to BBpress migration.

STEP 3.- SEO 301 redirect

Open/edit:
/styles/prosilver/template/overall_header.html

search for:

// Send vars to template
$template->assign_vars(array(
‘FORUM_ID’ => $forum_id,

and just above this lines add this piece of code:

##################################
$titleac = trim($topic_data[‘topic_title’]);
$relativeurl = str_replace(‘ ‘,’-‘,$titleac);
$relativeurl = strtolower($relativeurl);
header(«HTTP/1.1 301 Moved Permanently»);
header(«Location: http://www.YOURDOMAIN.com/forums/topic/».$relativeurl.»/»);
#####################################

Links:
Comparison from the bbpress comunity point of view: https://bbpress.org/forums/topic/bbpress-vs-phpbb/
If this tutorial mof moving phpBB to BBpress was useful for you, please just let me know with a comment