wordpress/wp-content/themes/basic/themify/class-themify-cache.php
/**
     * Scripts output, if cache exsists will return cached file, else will cache then return cached file
     *
     * @param array
     *
     * return array
     */
Scripts output, if cache exsists will return cached file, else will cache then return cached file
@param array

return array
Scripts output if cache exsists will return cached file else will cache then return cached file @param array return array
public static function scripts($todo) {
        if (!empty($todo) && !self::disable_cache()) {
            $dir = self::get_page_cache_dir();
            if (!$dir) {
                return $todo;
            }
            global $wp_scripts; 
            $fname = self::$is_footer ? 'footer' : 'header';
            $cache_dir = self::create_scripts_dir('scripts', $fname);
            $file_path = self::get_cache_dir(true);
            $file_path.= $dir . pathinfo($cache_dir, PATHINFO_BASENAME);
            if (is_file($cache_dir)) {
                if(!self::check_cache($cache_dir, FALSE)){
                    $cache_dir = self::get_cache_dir();
                    self::removeDirectory($cache_dir. 'scripts/');
                    self::removeDirectory($cache_dir. 'styles/');
                    return $todo;
                } 
                $is_own = self::is_minify_all();
                foreach ($todo as $k=>$handler) {
                    if (isset($wp_scripts->registered[$handler])) {
                        if($is_own || (!$is_own && self::is_themify_file($wp_scripts->registered[$handler]->src,$handler))){
                            unset($wp_scripts->registered[$handler]);
                            $wp_scripts->done[] = $handler;
                            unset($todo[$k]);
                        }
                    }
                }
                $wp_scripts->groups['themify_cache_' . $fname] = self::$is_footer;
                wp_enqueue_script('themify_cache_' . $fname, $file_path, array(),THEMIFY_VERSION, self::$is_footer);
                self::$script_iscreated = true;
                if($is_own){
                    $todo = array('themify_cache_' . $fname);
                }
                else{
                    $todo[] = 'themify_cache_' . $fname;
                }
            }
        }
        return $todo;
    }
public static function scripts ( $ todo ) { if ( ! empty ( $ todo ) && ! self :: disable_cache ( ) ) { $ dir = self :: get_page_cache_dir ( ) ; if ( ! $ dir ) { return $ todo ; } global $ wp_scripts ; $ fname = self :: $ is_footer ? 'footer' : 'header' ; $ cache_dir = self :: create_scripts_dir ( 'scripts' , $ fname ) ; $ file_path = self :: get_cache_dir ( true ) ; $ file_path .= $ dir . pathinfo ( $ cache_dir , PATHINFO_BASENAME ) ; if ( is_file ( $ cache_dir ) ) { if ( ! self :: check_cache ( $ cache_dir , FALSE ) ) { $ cache_dir = self :: get_cache_dir ( ) ; self :: removeDirectory ( $ cache_dir . 'scripts/' ) ; self :: removeDirectory ( $ cache_dir . 'styles/' ) ; return $ todo ; } $ is_own = self :: is_minify_all ( ) ; foreach ( $ todo as $ k => $ handler ) { if ( isset ( $ wp_scripts -> registered [ $ handler ] ) ) { if ( $ is_own || ( ! $ is_own && self :: is_themify_file ( $ wp_scripts -> registered [ $ handler ] -> src , $ handler ) ) ) { unset ( $ wp_scripts -> registered [ $ handler ] ) ; $ wp_scripts -> done [ ] = $ handler ; unset ( $ todo [ $ k ] ) ; } } } $ wp_scripts -> groups [ 'themify_cache_' . $ fname ] = self :: $ is_footer ; wp_enqueue_script ( 'themify_cache_' . $ fname , $ file_path , array ( ) , THEMIFY_VERSION , self :: $ is_footer ) ; self :: $ script_iscreated = true ; if ( $ is_own ) { $ todo = array ( 'themify_cache_' . $ fname ) ; } else { $ todo [ ] = 'themify_cache_' . $ fname ; } } } return $ todo ; }
Scripts output, if cache exsists will return cached file, else will cache then return cached file
 @param array
Scripts output if cache exsists will return cached file else will cache then return cached file @param array