• We started using WordPress popular posts on our site a few days ago. Our site is fairly popular getting millions of pageviews, we were surprised why it still showed no data so far.

    For anyone who is having this issue here is how you fix it:

    Using your preferred text editor, open the file wordpress-popular-posts.php. At line 1123, change the entire line from this

    register_activation_hook('WordPressPopularPosts', 'wpp_install');

    to this:

    register_activation_hook(__FILE__ , array('WordPressPopularPosts', 'wpp_install'));

    Basically the plugin is not being able to create a database table to store the data.

    Credit: Northlake

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi Syed Balkhi,

    Exactly what I was looking for. Thanks so much!

    Thanks a lot Syed. I spent some days trying to fix the problem in my site Konexión Rock Perú, and now I read your text and it was resolved in seconds. Thanks again!!!

    Another question about this plugin. Some weeks ago I had lots of problems due to timthumb.php. Finally I deleted all site and I installed all new and I was publishing again old posts, but Popular Posts now show visits from 0. Can I do anything to change the initial number of visits???
    Thanks…

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hola konexionrock, entiendo que reinstalaste el sitio web desde cero según tu comentario anterior. Hiciste algún respaldo de tu base de datos? De lo contrario no podrás recuperar la data recolectada por mi plugin.

    Saludos!

    Hola. Gracias x la respuesta. Bueno, hice un backup, pero no quise recuperar nada de allí porque antes de reisntalar de cero, reinstale jalando la base de datos y me salía error por todos lados. Eso fue lo que me llevó a borrar todo y reinstalar de cero. Lo único que tengo anotado “a mano” son las cantidades de visitas que llevaba cada post a ver si es posiblre restaurar los valores manualmente, pero ya me dirás si es posible o no. Un abrazo…

    Plugin Author Hector Cabrera

    (@hcabrera)

    No problem, para eso estamos.

    Fíjate, conseguí este link donde indican cómo restaurar una sola tabla (en nuestro caso, serían dos) en la BD sin afectar al resto de la data. Reproduzco aquí los pasos con pequeñas modificaciones para adaptarlas a lo que necesitas:

    1. Haz un respaldo de tu BD (ya lo has hecho).
    2. Haz una copia de tu respaldo donde se encuentra la data que deseas transferir a la BD.
    3. Utilizando un programa como Block de Notas o Dreamweaver, abre la copia que acabamos de crear y borra todo excepto las referencias a las tablas wp_popularpostsdata y wp_popularpostsdatacache. Dentro del archivo, busca CREATE TABLE IF NOT EXISTS wp_popularpostsdata y justo debajo de ese bloque de código deberías encontrar otro que comienza con INSERT INTO wp_popularpostsdata. Ambos bloques crean la tabla wp_popularpostsdata y restauran su contenido con INSERT. Lo mismo va con la tabla wp_popularpostsdatacache que mencioné antes. El archivo, luego de que lo termines de editar, debería verse más o menos así (dependiendo de la cantidad de registros que tengas):


    — Estructura de tabla para la tabla wp_popularpostsdata

    CREATE TABLE IF NOT EXISTS wp_popularpostsdata (
    postid int(10) NOT NULL,
    day datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
    last_viewed datetime NOT NULL DEFAULT ‘0000-00-00 00:00:00’,
    pageviews int(10) DEFAULT ‘1’,
    UNIQUE KEY id (postid)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;


    — Volcar la base de datos para la tabla wp_popularpostsdata

    INSERT INTO wp_popularpostsdata (postid, day, last_viewed, pageviews) VALUES
    (32, ‘2011-11-23 12:29:38’, ‘2011-11-23 15:17:31’, 26),
    (36, ‘2011-11-23 12:28:10’, ‘2011-11-23 14:57:36’, 7),
    (39, ‘2011-11-23 13:00:20’, ‘2011-11-23 13:00:20’, 1);

    — ——————————————————–


    — Estructura de tabla para la tabla wp_popularpostsdatacache

    CREATE TABLE IF NOT EXISTS wp_popularpostsdatacache (
    id int(10) NOT NULL,
    day date NOT NULL,
    pageviews int(10) DEFAULT ‘1’,
    UNIQUE KEY id (id,day)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8;


    — Volcar la base de datos para la tabla wp_popularpostsdatacache

    INSERT INTO wp_popularpostsdatacache (id, day, pageviews) VALUES
    (32, ‘2011-11-23’, 26),
    (36, ‘2011-11-23’, 7),
    (39, ‘2011-11-23’, 1);

    — ——————————————————–

    4. Una vez editado el archivo, guárdalo y utiliza la función Import (o Importar, si tu phpMyAdmin está en español) de phpMyAdmin. Esto estaría restaurando sólo las dos tablas que necesita mi plugin con la data que ya había recolectado, dejando el resto de tu blog intacto.

    Sigue las instrucciones con paciencia, yo probé y funcionó sin ningún tipo de errores así que ánimo y ya luego me cuentas que tal te fue.

    I have been banging my head against a wall all day about this, and after the quick fix above, it now works!

    Thank you!

    He dejado sin efecto lo consultado. Lo veo muy difícil y peligroso para mí. Gracias de todas maneras…
    Lo importante ahora es que acabo de actualizar a la versión 2.2.0 y el plugin falla, no muestra las estadísticas totales en el widget donde está definida esa función. 🙁
    ¿Alguna solución?

    GRACIAS!!!

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hola konexionrock,

    Fue una omisión de mi parte que causó esta falla. Acabo de actualizar el plugin a la versión 2.2.1, por favor actualiza y me comentas que tal.

    I’m using the latest version of the plugin which includes this hack, but I still get the “Sorry, no data” message. Google Analytics shows traffic. Any ideas?

    Plugin Author Hector Cabrera

    (@hcabrera)

    Hi there,

    Have you checked that the tables wp_popularposts and wp_popularpostsdata have been created in your database?

    When I pasted the entire code into Dreamweaver to match the line 1123, it didn’t show what you were saying.

    Mine appeared at 1137 and said:

    //register_activation_hook('WordpressPopularPosts', 'wpp_install');
    	register_activation_hook(__FILE__ , array('WordPressPopularPosts', 'wpp_install'));

    I changed both of those lines to say

    register_activation_hook(__FILE__ , array('WordPressPopularPosts', 'wpp_install'));

    but no go 🙁

    What next Hector? Thanks in advance.

    Brad

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: WordPress Popular Posts] Fix: Sorry, No Data so Far can be fixed like this’ is closed to new replies.