• Resolved Micemade

    (@anydog)


    Hi,

    It seems that usage of the relative path in plugin’s includes/integrations/Integrations.php file is causing errors with is_readable() method. The code:

    private function load_integrations() {
    
    	$registered_integrations = array(
    		'WC_Facebook_WPML_Injector' => '/includes/fbwpml.php',
    		Bookings::class             => '/includes/Integrations/Bookings.php',
    	);
    
    	foreach ( $registered_integrations as $class_name => $path ) {
    
    		if ( ! class_exists( $class_name ) && ! is_readable( $path ) ) {
    
    			$this->integrations[ $class_name ] = $this->plugin->load_class( $path, $class_name );
    			}
    		}
    	}

    Error notice:
    FastCGI sent in stderr: "PHP message: PHP Warning: is_readable(): open_basedir restriction in effect. File(/includes/fbwpml.php) is not within the allowed path(s): (/www/OUR_SITE/public:/www/OUR_SITE/mysqleditor:/www/OUR_SITE/web:/www/OUR_SITE/deploy:/www/OUR_SITE/deployment:/www/OUR_SITE/deployments:/usr/share:/tmp) in /www/OUR_SITE/public/wp-content/plugins/facebook-for-woocommerce/includes/Integrations/Integrations.php on line 61" while reading response header from upstream, client: 89.201.230.203, server: OUR_SITE_URL, request: "POST /?wc-ajax=get_refreshed_fragments HTTP/1.0", upstream: "fastcgi://unix:/var/run/php7.4-fpm-OUR_SITE.sock:", host: "OUR_SITE_URL", referrer: "OUR_SITE_URL"

    Where OUR_SITE and OUR_SITE_URL represent site name and site URL, respectively.

    Could your developers fix the relative paths for the next plugin update using plugin_dir_path( __DIR__ ), for example:

    'WC_Facebook_WPML_Injector' => plugin_dir_path( __DIR__ ) . 'includes/fbwpml.php'
    ,or similar solution, please?

    Thanks

    • This topic was modified 3 years, 7 months ago by Micemade.
    • This topic was modified 3 years, 7 months ago by Micemade.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @anydog,

    It seems that usage of the relative path in plugin’s includes/integrations/Integrations.php file is causing errors with is_readable() method.

    Thanks for reporting the problem. This has been already reported in GitHub here and is being looked at by our development team.
    Also, there’s a solution given in the thread that you can use as a temporary fix for now.

    Thanks.

    Thread Starter Micemade

    (@anydog)

    @sohanhossain Thank you for your fast reply and link to Github issues page.
    The solution there seems to be working.

    Hi @anydog

    Thank you for your fast reply and link to Github issues page.
    The solution there seems to be working.

    I’m glad to hear that!

    This thread will be marked as resolved. If you have any further questions, please don’t hesitate to contact us again.

    • This reply was modified 3 years, 7 months ago by Joao D - a11n.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Relative path in Integrations.php causing error’ is closed to new replies.