Title: Plugin needs fixes
Last modified: August 31, 2016

---

# Plugin needs fixes

 *  [essensx](https://wordpress.org/support/users/essensx/)
 * (@essensx)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/plugin-needs-fixes/)
 * Plugin uses file_exists to check if a directory exists, but it should use is_dir.
   Additionally, plugin does not cover all scenarios. Here is the fixed code:
 * function create_tmp_dir() {
    $this->tmp_dir = $this->get_plugin_path() . ‘/tmp/’;
   if ( ! is_writable( dirname( $this->tmp_dir ) ) ) { $this->tmp_dir = sys_get_temp_dir().‘/’;
   if ( ! is_dir( $this->tmp_dir ) ) wp_mkdir_p( $this->tmp_dir ); $this->tmp_dir.
   = self::nspace . ‘/’; } if ( ! is_dir( $this->tmp_dir ) ) wp_mkdir_p( $this->
   tmp_dir ); }
 * // this file is the interface to the combined CSS file that is written in the
   WP upload directories
 * $tmp_dir = ‘tmp/’;
    if ( ! is_writable( dirname( $tmp_dir ) ) ) $tmp_dir = sys_get_temp_dir().‘/’;
 * $filename = $_SERVER[‘HTTP_HOST’] . ‘-settings.dat’;
    $settings_path = $tmp_dir.
   $filename;
 * if ( ! file_exists( $settings_path ) ) {
    $settings_path = $tmp_dir . ‘combine-
   css/’ . $filename; }
 * if ( file_exists( $settings_path ) && strlen( $_GET[‘token’] ) == 32 ) {
    $settings
   = file_get_contents( $settings_path ); $settings = unserialize( $settings ); 
   $css_file = $settings[‘upload_path’] . $_GET[‘token’] . ‘.css’; if ( file_exists(
   $css_file ) ) { if ( $settings[‘compress’] == ‘Yes’ && extension_loaded( ‘zlib’))
   ob_start( ‘ob_gzhandler’ ); header( “Content-type: text/css” ); readfile( $css_file);
   if ( $settings[‘compress’] == ‘Yes’ && extension_loaded( ‘zlib’ ) ) ob_end_flush();}}
 * [https://wordpress.org/plugins/combine-css/](https://wordpress.org/plugins/combine-css/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [timmcdaniels](https://wordpress.org/support/users/timmcdaniels/)
 * (@timmcdaniels)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/plugin-needs-fixes/#post-7106398)
 * Thanks. Regarding file_exists it works for files or directories
 * [http://php.net/manual/en/function.file-exists.php](http://php.net/manual/en/function.file-exists.php)

Viewing 1 replies (of 1 total)

The topic ‘Plugin needs fixes’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/combine-css_202020.svg)
 * [Combine CSS](https://wordpress.org/plugins/combine-css/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/combine-css/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/combine-css/)
 * [Active Topics](https://wordpress.org/support/plugin/combine-css/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/combine-css/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/combine-css/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [timmcdaniels](https://wordpress.org/support/users/timmcdaniels/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/plugin-needs-fixes/#post-7106398)
 * Status: not resolved