Server IP : 104.21.14.48 / Your IP : 3.144.114.105 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/chroot/var/www/wp-content/plugins/defender-security/extra/shared-tasks/ |
Upload File : |
module.exports = function (grunt, wpmudev) { 'use strict'; var run_linter = function (cmd, done, fail, orig_args) { fail = !!fail; var task = (cmd || {}).cmd; if (grunt.task.exists(task)) { grunt.verbose.writeln("Has project-specific task " + task + ", defaulting to that"); var args = Array.prototype.slice.call(orig_args || {}).map(function (a) { return ':' + a; }); grunt.task.run(task + args.join('')); return done(); } grunt.log.write("Attempting to lint via system " + task + "... "); var which = require('which').sync, has_binary = false ; try { has_binary = !!which(task); } catch (e) { has_binary = false; } if (!has_binary) { grunt.log.writeln("SKIP".yellow); return done(); } grunt.log.writeln("OK".green); grunt.util.spawn(cmd, function (error, result) { if (error) { (fail ? grunt.fail.fatal : grunt.log.error)("Linting failed".red); } done(); }); }; grunt.registerTask('wpmudev_lint', function () { grunt.task.run('wpmudev_jshint'); grunt.task.run('wpmudev_phpcs'); }); grunt.registerTask('wpmudev_phpcs', function () { var done = this.async(), files = grunt.file.expand({ filter: 'isFile' }, ['**/*.php'].concat(wpmudev.files.not_meta())), standard = grunt.file.exists('phpcs.ruleset.xml') ? ['--standard=phpcs.ruleset.xml'] : [] ; run_linter({ cmd: 'phpcs', args: standard.concat(files), opts: { stdio: 'inherit' } }, done, true, arguments); }); grunt.registerTask('wpmudev_jshint', function () { var done = this.async(), files = grunt.file.expand({ filter: 'isFile' }, ['**/*.js'].concat(wpmudev.files.not_meta())) ; run_linter({ cmd: 'jshint', args: files, opts: { stdio: 'inherit' } }, done, true, arguments); }); };