• My site has been acting strange sense updating Top Ten, I am seeing these errors in my logs often:

    [07-Feb-2015 01:11:24 UTC] WordPress database error Multiple primary key defined for query ALTER IGNORE TABLE wp_h1cnvw9agj_top_ten ADD PRIMARY KEY (postnumber) made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘plugins_loaded’), call_user_func_array, tptn_update_db_check, tptn_activation_hook
    [07-Feb-2015 01:11:24 UTC] WordPress database error Can’t DROP ‘accessedid’; check that column/key exists for query ALTER TABLE wp_h1cnvw9agj_top_ten_daily DROP COLUMN accessedid made by require(‘wp-blog-header.php’), require_once(‘wp-load.php’), require_once(‘wp-config.php’), require_once(‘wp-settings.php’), do_action(‘plugins_loaded’), call_user_func_array, tptn_update_db_check, tptn_activation_hook

    Any Idea what is causing this? I’d just use a different plugin, but, I really like this one!

    Thanks ( hellaclips.com)

    https://wordpress.org/plugins/top-10/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ajay

    (@ajay)

    It appears to be that the upgrade of the plugin didn’t go through properly. But, it’s also very old code there

    Are you using v2.0.3?

    Thread Starter nate_hellaclips

    (@nate_hellaclips)

    getting more errors, this one pops up a lot trying to display view counts in my homage loop. It worked fine until the other day, I upgraded to your new version to try and fix it, but it didn’t fix the problem

    [09-Feb-2015 19:50:08 UTC] PHP Fatal error: Call to undefined function get_tptn_post_count_only() in /home/content/p3nexnas06_data03/33/2162633/html/wp-content/themes/hellaclips/home.php on line 125

    Plugin Author Ajay

    (@ajay)

    Hi,

    I’m very confused by the above error. It looks like your theme has some kind of inbuilt support for Top 10. The error is coming on home.php of your theme.

    However, with Top 10 activated this definitely shouldn’t be the case since that function is very much active.

    Can you perform a clean install of Top 10 by deactivating and deleting the plugin from within your WordPress interface and reinstalling. Please backup you WordPress database before this.

    Also make sure that “Delete counter data on uninstall” is NOT selected otherwise it will clean out the counts.

    Thread Starter nate_hellaclips

    (@nate_hellaclips)

    Hi there,

    I have some more info for you.

    We migrated our site to wordpress from custom CMS and wanted to keep our old post view figures ($hcviews). To combine the old view count with the new ones generated by your plugin I wrote this function in my functions.php

    function get_post_views() {
        $tptnviews = get_tptn_post_count_only( get_the_ID(), 'total' );
        $hcviews = get_post_meta( get_the_ID(), 'post_views', true);
    
        if( $hcviews > 0) {
          return $tptnviews + $hcviews;
        }elseif ($tptnviews > 0 && $hcviews == 0) {
            return $tptnviews;
        } else{
          return 800;
        }
    }

    This didnt get me the results I wanted when called in my loop ( get post views() ) So I resorted to just using your plugins get_tptn_post_count_only() in my homepage post loop to display each posts view count. ( This wasn’t optimum however because our old posts weren’t displaying an accurate view count ) . Then recently, our view count got really wonky and stopped displaying accurate information all together, displaying 0 or a random inaccurate low number. I checked our logs and saw the original error message posted above.

    Plugin Author Ajay

    (@ajay)

    What happens when you deactivate the plugin?

    And, what happens if you try another theme?

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Php errors’ is closed to new replies.