• Resolved TIV.NET INC.

    (@tivnetinc)


    In the function getABSPATH, this line:

    $path = “/”.$path.”/”;

    results in something like /C:/the-path/ when running under Windows.

    There is a WP function that does this correctly. The fix is simple:

    public function getABSPATH(){
    
      return \get_home_path();
    }

    And to make things even cleaner, replace all the occurrences of

    $path = ABSPATH;
    
    if($this->is_subdirectory_install()){
      $path = $this->getABSPATH();
    }

    with just $path = get_home_path();

    • This topic was modified 1 year, 1 month ago by TIV.NET INC..
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Emre Vona

    (@emrevona)

    I will try and let you know.

    Plugin Author Emre Vona

    (@emrevona)

    I added the change.

    https://plugins.trac.www.ads-software.com/browser/wp-fastest-cache/trunk/wpFastestCache.php#L2070

    Could you please download the following version to get the latest changes, and let me know after you’ve tested it?

    https://downloads.www.ads-software.com/plugin/wp-fastest-cache.zip

    Thread Starter TIV.NET INC.

    (@tivnetinc)

    @emrevona

    It works. Thanks.

    Plugin Author Emre Vona

    (@emrevona)

    You’re welcome ?? If you vote, it would make me so happy.

    https://www.ads-software.com/support/plugin/wp-fastest-cache/reviews/

    matmat0900

    (@matmat0900)

    @emrevona I think this problem occurred after adding these changes.
    In your code missing to add require_once ABSPATH . ‘wp-admin/includes/file.php’; in function public function getABSPATH(){}, please check it.

    My critical error is:

    [14-Mar-2024 06:48:59 UTC] PHP Fatal error: Uncaught Error: Call to undefined function get_home_path() in /mywebsite/web/app/plugins/wp-fastest-cache/wpFastestCache.php:2071
    Stack trace: 0 /mywebsite/web/app/plugins/wp-fastest-cache/wpFastestCache.php(1982): WpFastestCache->getABSPATH() 1 /mywebsite/web/wp/wp-includes/class-wp-hook.php(326): WpFastestCache->modify_htaccess_for_new_user() 2 /mywebsite/web/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 3 /mywebsite/web/wp/wp-includes/plugin.php(517): WP_Hook->do_action() 4 /mywebsite/web/wp/wp-includes/user.php(2471): do_action() 5 /mywebsite/web/wp/wp-includes/user.php(2594): wp_insert_user() 6 /mywebsite/web/wp/wp-includes/user.php(2939): wp_update_user() 7 /mywebsite/web/app/themes/venti/inc/api/controller/REST_Application_Controller.php(272): get_password_reset_key() 8 /mywebsite/web/wp/wp-includes/rest-api/class-wp-rest-server.php(1193): Api\Controller\REST_Application_Controller->reset_password() 9 /mywebsite/web/wp/wp-includes/rest-api/class-wp-rest-server.php(1041): WP_REST_Server->respond_to_request() 10 /mywebsite/web/wp/wp-includes/rest-api/class-wp-rest-server.php(431): WP_REST_Server->dispatch() 11 /mywebsite/web/wp/wp-includes/rest-api.php(424): WP_REST_Server->serve_request() 12 /mywebsite/web/wp/wp-includes/class-wp-hook.php(324): rest_api_loaded() 13 /mywebsite/web/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 14 /mywebsite/web/wp/wp-includes/plugin.php(565): WP_Hook->do_action() 15 /mywebsite/web/wp/wp-includes/class-wp.php(418): do_action_ref_array() 16 /mywebsite/web/wp/wp-includes/class-wp.php(813): WP->parse_request() 17 /mywebsite/web/wp/wp-includes/functions.php(1336): WP->main() 18 /mywebsite/web/wp/wp-blog-header.php(16): wp() 19 /mywebsite/web/index.php(6): require('…') 20 {main} thrown in /mywebsite/web/app/plugins/wp-fastest-cache/wpFastestCache.php on line 2071
    Plugin Author Emre Vona

    (@emrevona)

    Does the error appear on the page or in the error_log file? Could you please share a screenshot?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Bug: getABSPATH() on Windows’ is closed to new replies.