• Resolved rezaei12

    (@rezaei12)


    Hi,

    I recently updated my website’s url in the general settings section on the wordpress dashboard.

    Under the wordpress address field I have http://arashmazinani.com, I recently updated the blog address field from http://arashmazinani.com to http://www.arashmazinani.com

    Since then the popular posts plugin has stopped working, i edited the blog address field back to http://arashmazinani.com and it started working fine, however when i changed it back it stopped working. It just stops updating with the most viewed posts.

    I tried deleting the plugin and reinstalling it from scratch but it still didn’t work

    any clues as to how i can get it to work again ?

    Thank you in advance

Viewing 12 replies - 1 through 12 (of 12 total)
  • Have you tried doing an SQL query on the database to change all instances of the old URL there?

    Thread Starter rezaei12

    (@rezaei12)

    no i haven’t how do i do that?

    I know how to do it in phpMyAdmin, so the first step is to make sure you have access to your database through that. I have the queries saved on my other computer and I’m away from home until later tonight, but I’m happy to post them for you once I get there 🙂

    Thread Starter rezaei12

    (@rezaei12)

    I’ve got access to phpMyAdmin and can find my wordpress database, what do i need to do next?

    Hi Rezaei12,

    I’m seeing popular posts on your list. Also checked your theme’s header and it seems to be catching each post view so there should not be any issues. Can you please turn on views count for a moment so I can see if it’s updating or not?

    By the way, my plugin does not store your site’s URL. In fact, WordPress Popular Posts uses bloginfo(‘url’) to output your blog’s URL so changing your domain from non-www to www should not be an issue to my plugin.

    May or may not help your issue, but this is what I run when I change a WP site’s URL (copy/paste into the SQL textarea in phpMyAdmin). I use this all the time with no problem whatsoever and don’t see what harm it could do, but since I don’t know all of the specifics of your host/installed plugins/etc., I make no guarantees…use at your own risk!

    UPDATE wp_options SET option_value = replace(option_value, 'arashmazinani.com', 'www.arashmazinani.com');
    
    UPDATE wp_posts SET guid = replace(guid, 'arashmazinani.com','www.arashmazinani.com');
    
    UPDATE wp_posts SET post_content = replace(post_content, 'arashmazinani.com', 'www.arashmazinani.com');
    Thread Starter rezaei12

    (@rezaei12)

    I’ve just added for the plugin to show the views as you requested Ikki24 hopefully you’ll be able to see that its not registering views on the account.

    I’m going to wait until you reply before i try and run the SQL query justbishop posted. Thanks for both of your help, i’m hoping it’s something that can be easily resolved.

    Thanks Rezaei. Indeed, my plugin seems unable to update views.

    I tracked down the issue to a WordPress function called admin_url, used by my plugin to update your popular posts cache. Even though you changed your site’s url to http://www.arashmazinani.com, admin_url still outputs http://arashmazinani.com which might be keeping my plugin from communicating with your blog’s admin core.

    Anyways, try this:

    Open wordpress-popular-posts.php using a text editor such as Notepad or Dreamweaver and find this code:

    jQuery.post(‘<?php echo admin_url(‘admin-ajax.php’); ?>’, {action: ‘wpp_update’, token: ‘<?php echo $nonce; ?>’, id: <?php echo $id; ?>});

    … and replace it with:

    jQuery.post(‘<?php echo bloginfo( ‘url’ ); ?>/wp-admin/admin-ajax.php’, {action: ‘wpp_update’, token: ‘<?php echo $nonce; ?>’, id: <?php echo $id; ?>});

    I believe that should do it.

    Please let me know the results.

    Thread Starter rezaei12

    (@rezaei12)

    hi i think it’s working now, can you just double check it for me?

    thanks for all your help

    Yes, it seems to be working now. Did you do anything?

    Thread Starter rezaei12

    (@rezaei12)

    I just followed your instructions above and replaced the code with the new code you wrote, then uploaded the php file and refreshed and it seems to be ok now.

    Thanks for the help

    Awesome, thanks for the update Rezaei!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: WordPress Popular Posts] Changed blog url, popular posts no longer working’ is closed to new replies.