• The three load functions – load_styles, load_scripts, and load_modules produce errors on my server:

    Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(..) is not within the allowed path(s): (/var/www/<MY WEBSITE>/httpdocs:/tmp) in /var/www/<MY WEBSITE>/httpdocs/wp-content/plugins/pricing-table/libs/class.plugin.php on line 29
    [and also 27 and forty-something]

    It seems to me that the problem is that the function scours the directory and messes up is_dir when feeding it the .. directory.

    This error is actually extremely easy to fix. I just added if ($file == '..') continue; But I have a suspicion you could just switch the extension evaluation and the directory test:

    if( end(explode(".",$file))=='css' && !is_dir($file) )
    	wp_enqueue_style(uniqid(),$cssurl.$file);

    OR

    function load_styles(){
        $dir = is_admin()?'admin':'site';
        $cssdir = $this->plugin_dir.'/css/'.$dir.'/';
        $cssurl = $this->plugin_url.'/css/'.$dir.'/';
        $files = scandir($cssdir);
        foreach($files as $file){
    	if ($file == '..')   // * Added lines
    		continue;    // *
            if(!is_dir($file)&&end(explode(".",$file))=='css')
    		wp_enqueue_style(uniqid(),$cssurl.$file);
        }
    }

    Hope this helps y’all fix the problem.

    http://wordpress.org/extend/plugins/pricing-table/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Pricing Table] is_dir error loading modules’ is closed to new replies.