WordPress.org

Support

[Resolved] Stats aren't updating

  • My stats don’t seem to be updating. To confirm this, yesterday I took a screen capture of my Top 10 Overall Posts and the numbers are the same today as they were yesterday. The Daily Popular Posts page is blank (no stats shown). My website is live and otherwise working properly. Google Analytics is showing I had 144 unique visitors yesterday, so I know people are hitting my site. Any suggestions how to fix this?

    http://wordpress.org/extend/plugins/top-10/

Viewing 15 replies - 1 through 15 (of 18 total)
  • Actually, my site is now getting a Malware warning according to http://www.securi.net. It says “Malware found on javascript file: http://www.adamsleatherworks.com/wp-content/plugins/top-10/top-10-addcount.js.php?top_ten_id=8“.

    My site:
    http://www.adamsleatherworks.com

    The security site I checked it with:
    http://www.securi.net

    esmi

    @esmi

    Forum Moderator

    The malware warning may be a false positive. FTP into your site (or use whatever file management application your host provides) & rename the wp-content/plugins/top-10 folder.

    Deactivating the plugin cleared the Malware warning on Sucuri. I could try deleting the plugin, then reinstalling it, but I don’t want to reset my page view counts and I’m not sure what/how to backup the table to save my page counts. Looking forward to your feedback/suggestions.

    I renamed the top-10 folder and re-ran the securi scanner – there are no threats listed now. I assume the plugin is inoperable with the folder renamed, so what should I try now?

    esmi

    @esmi

    Forum Moderator

    Try deleting the plugin’s folder inside wp-content/plugins by FTP AND then uploading a fresh copy. Bear in mind that I’m not the plugin’s author, so this is more of a general troubleshooting tip given that you seem to have been missing a few files.

    I did as you suggested – deleted the plugin folder via my cPanel, then uploaded a fresh zip from here: http://wordpress.org/extend/plugins/top-10/

    Still getting the threat warning. 🙁

    I appreciate your help, by the way!

    Plugin Author Ajay

    @ajay

    I checked out what the error displayed is:

    Site error detected.
    Details: http://sucuri.net/malware/php-error-fatal-error
    <b>Warning</b>: require(/home/EXAMPLE/public_html/wp-config.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in <b>/home/EXAMPLE/public_html/wp-content/plugins/top-10/top-10-addcount.js.php</b> on line <b>18</b><br />

    The malware is a false positive like emsi mentioned. Securi is detecting this because it believes that the script addcount is forcibly trying to include the wp-config.php file.

    The actual issue is that the plugin can’t find the wp-config.php file to include it.

    Could you please check the exact location of wp-config.php
    Is it in /public_html/ or is it in a subfolder?

    esmi

    @esmi

    Forum Moderator

    The error message suggests that you’re still missing files. Have you moved your wp-config.php file?

    I moved it up one folder, which I believe is allowed in the plugin’s coding – I don’t know much about coding, but I did open the file in question and it looks like the descriptive text allows for the user to move it up one folder. It’s in the root directory of my site. It worked fine for a while – it’s logged almost 10,000 views on my home page already, but just recently stopped working. I have not moved my wp-config.php file since I built the site and the plugin has been working fine till just recently.

    FYI – the following is copied from the plugin’s “Overall Popular Posts” page in the dashboard showing the page visits.

    Home (9,683)
    Sig Sauer P938 Holster: New Gun Model (3,165)
    How to Make Leather Holsters (2,002)
    Gallery (1,374)
    DIY: Pancake Holster (1,360)
    Pancake: Standard (1,156)
    Gun Models List (1,072)
    Avenger: Standard (816)
    Tippmann Boss Leather Hand Stitcher (807)
    Avenger: Ultimate (675)

    The “Daily Popular Posts” page is blank since it’s not currently tracking anything.

    As you can see, it was working fine. I posted to my blog on 2012/12/07 – that page receive 79 total views (that were actually tracked), then I posted another blog post on 2013/01/02 – that page hasn’t logged any views, but I know that’s not accurate. So, I believe a plugin update of some kind between mid-December and early January must have broken something… 🙁

    esmi

    @esmi

    Forum Moderator

    I moved it up one folder, which I believe is allowed in the plugin’s coding

    I suspect that this particular plugin can’t handle that move. Could be that the plugin author has made an assumption as to the location of wp-config.php. 🙁

    Plugin Author Ajay

    @ajay

    particlerealities,

    I’ve changed the way the plugin has detected the wp-config to what was a more recommended method.

    My question remains.

    I assume that your wp-config is not located in:

    /public_html/wp-config.php

    But, actually one folder higher?

    Ajay – yes, as I stated previously, I moved it up one folder to the root of my website. It is not in the /public_html/ folder – it is one folder higher.

    Plugin Author Ajay

    @ajay

    Please backup your site first

    Could you please edit this line:

    $wp_config_path = dirname( dirname( dirname( __FILE__ ) ) );

    and replace with:

    $wp_config_path = dirname ( dirname( dirname( dirname( __FILE__ ) ) ) );

    And test again?

    Alternatively, please try this code:
    Replace

    // Build the wp-config.php path from a plugin/theme
    $wp_config_path = dirname( dirname( dirname( __FILE__ ) ) );
    $wp_config_filename = '/wp-config.php';
    
    // Check if the file exists in the root or one level up
    if( !file_exists( $wp_config_path . $wp_config_filename ) ) {
        // Just in case the user may have placed wp-config.php one more level up from the root
        $wp_config_filename = dirname( $wp_config_path ) . $wp_config_filename;
    }
    // Require the wp-config.php file
    require( $wp_config_filename );

    with:

    while(!is_file('wp-config.php')){
    
      if(is_dir('../')) chdir('../');
    
      else die('Could not find WordPress.');
    
    }
    
    include( 'wp-config.php' );

    You can load http://www.adamsleatherworks.com/wp-content/plugins/top-10/top-10-addcount.js.php?top_ten_id=8 to see if it still throws the error.

    Plugin Author Ajay

    @ajay

    And, yet another solution for this. Note the added lines for the ABSPATH definition

    Edit the lines 12-16.

    // Check if the file exists in the root or one level up
    if( !file_exists( $wp_config_path . $wp_config_filename ) ) {
        // Define ABSPATH since the wp-config.php file is one level up
        define( 'ABSPATH', $wp_config_path . "/" );
        // Just in case the user may have placed wp-config.php one more level up from the root
        $wp_config_filename = dirname( $wp_config_path ) . $wp_config_filename;
    }

    Source: http://kynatro.com/blog/2012/12/11/finally-a-practical-use-for-wordpress-secret-shortinit-constant/

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘[Resolved] Stats aren't updating’ is closed to new replies.
Skip to toolbar