• Remco Tolsma

    (@remcotolsma)


    The theme check feature takes a lot of time when we use Bower and Node.js (Grunt) for theme development. The /bower_components/ and the /node_modules/ folders contains a lot of files. I guess the listdir function is scanning al these folders and files. Is there a way we can ignore these folders/files?

    https://plugins.trac.ww.wp.xz.cn/browser/theme-check/tags/20141222.1/checkbase.php#L153

    I already developed a quick PHP 5.4+ fix, but it would be nice of something like this could integrated in this plugin.

    $filter = array( 'bower_components', 'node_modules' );
    
    $dir_iterator = new \RecursiveCallbackFilterIterator(
    	$dir_iterator,
    	function( $item ) use ( $filter ) {
    		return ! in_array( $item->getBaseName(), $filter );
    	}
    );

    https://ww.wp.xz.cn/plugins/theme-check/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Samuel Wood (Otto)

    (@otto42)

    ww.wp.xz.cn Admin

    No, those checks should indeed cause errors and failures.

    Theme-check is primarily developed for use here on ww.wp.xz.cn, because all themes uploaded to the directory are run through it at the time of that upload. If it skipped those, then you would be able to include those directories in released versions of themes, which you obviously should not do.

    More likely is that I’d add a check to cause a hard failure on a theme containing those directories.

    Thread Starter Remco Tolsma

    (@remcotolsma)

    Ok, sounds good. But still it would be nice if you could improve the listdir() function. An /node_modules/ folder can grow quickly over 150+ MB with more then 30.000 files. With that many files the theme check feature will take forever. It took me quit some time to figure out that the large /node_modules/ folder was causing this issue. I guess more users could have this issue. If the listdir() function can ignore the /bower_components/**/* and /node_modules/**/* files that would be great. You can then still add a hard failure on existance of the folders /bower_components/ and /node_modules/.

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    ww.wp.xz.cn Admin

    I develop theme check on GitHub. Feel free to help me out, if you like.

    https://github.com/Otto42/theme-check

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Theme development with Bower, Node.js, etc.’ is closed to new replies.