Post Indexer fatal error undefined function post_indexer_get_log_directory

Hi,

I'm getting a fatal error when trying to Network Activate the Post Indexer 3.0.5.6 plugin on an updated WordPress 3.9 installation. This is the full error message:

strlen($closest); } function is_as_close($closest, $maybe_as_close) { return strlen($maybe_as_close) >= strlen($closest); } function open_csv($filename, $row_callback, $callback_param_array) { $success = FALSE; try { $csv_file = fopen($filename, 'r', TRUE); while(($row = fgetcsv($csv_file, 200 /*, delimiter, enclosure */)) !== FALSE) { $params = array_merge(array($row), $callback_param_array); call_user_func_array($row_callback, $params); } $success = TRUE; } catch(Exception $e) { if(is_dev_environment()) { report_error($e); } } if($csv_file !== FALSE) { fclose($csv_file); } return $success; } function current_directory() { return dirname($_SERVER['SCRIPT_NAME']); } function is_dev_environment() { return $_SERVER['SHU_SERVER_STATUS'] == "DEV"; } function report_error($e) { var_dump($e); } function is_current_page($path) { return $path == $_SERVER['SCRIPT_NAME'] || $path . "index.html" == $_SERVER['SCRIPT_NAME'] || $path . "/index.html" == $_SERVER['SCRIPT_NAME']; } function is_index_page() { return basename($_SERVER['SCRIPT_NAME']) == "index.html"; } function inside_section($section) { return strpos($_SERVER['REQUEST_URI'], "/$section/") === 0; } function is_ajax_request() { return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') || (isset($_GET['ajaxRequest']) && $_GET['ajaxRequest'] == 1); } function lightbox_header($lightbox_class) { global $_THEME; include('includes/ajax_header.php'); } function funnel_url() { return current_directory() . '/funnels.html'; } ?> Fatal error: Call to undefined function post_indexer_get_log_directory() in /data/u1/WWW/htdocs/testblogs/wp-content/plugins/post-indexer/classes/cron.postindexerrebuild.php on line 24

Maybe a missing include_once to post-indexer/includes/functions.php where the functions is defined?

Thanks,

Tom

  • Paul
    • The Green Incsub

    SHU

    Maybe a missing include_once to post-indexer/includes/functions.php where the functions is defined?

    Not possible. The functions.php is loaded in line 36 of the main plugin file post-indexer.php. If and config.php are loaded before anything else.

    A couple of options to debug this.

    1. Manually FTP to your server. Go to the plugin folder /wp-content/plugins/post-indexer. In the includes sub-folder you should see the file functions.php. Open it up. Line 567 is where the function starts in my version.

    2. Maybe a bad install? Deactivate then Delete the plugin and reinstall.

  • SHU
    • WPMU DEV Initiate

    Hi Paul,

    You're right, looking at the code it should work. I can see the function defined on line 567:

    $ nl wp-content/plugins/post-indexer/includes/functions.php | head -n 567 | tail -n 1
    567 function post_indexer_get_log_directory() {

    I've also tried deleting the plugin and re-installing but I'm still getting the same error.

    I'll check with our sysadmin as some of the stuff in that error message seems to be specific to our setup.

    Thanks,

    Tom

  • SHU
    • WPMU DEV Initiate

    Found the problem, the include_path included directories for other applications on this server, one of which had a includes/functions.php file, which was being included instead of the one in the Post Indexer plugin.

    After explicitly setting the include_path in my .htaccess file the plugin can be activated as expected.

    Thanks,

    Tom

  • Paul
    • The Green Incsub

    @SHU,

    Found the problem, the include_path included directories for other applications on this server, one of which had a includes/functions.php file, which was being included instead of the one in the Post Indexer plugin.

    Great!. Yeah, not a fan of the generic filename as that is the result. Will make a note to rename the functions.php to something more specific for the plugins like post-indexer-functions.php

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.