We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<table class="widefat"> <thead> <tr> <tr> <th>File</th> <th>Permission</th> <th>Size</th> </tr> </thead> <tbody> <?php // ---- Root folder $iterator = new DirectoryIterator( ABSPATH ); // don't scan for these files types $filetypes = array("jpg", "png", "gif", "jpeg", "ico", "css", "txt"); foreach ($iterator as $fileinfo) { if (!$fileinfo->isDot()) { //get file extension $filetype = pathinfo($fileinfo, PATHINFO_EXTENSION); // get permissions in octal $stringy = substr(sprintf('%o', $fileinfo->getPerms()), -4); ?> </tr> <?php if (!in_array(strtolower($filetype), $filetypes)) { //output file name echo "<td>" . $fileinfo . "</td>"; //check for 777 ! and outputs perms if ($stringy == '0777'){ echo "<td>" . substr(sprintf('%o', $fileinfo->getPerms()), -4) . "<span class='red'> × </span>" . "</td>" ; }else{ echo "<td>" . substr(sprintf('%o', $fileinfo->getPerms()), -4) . "</td>" ; } //output file sizes echo "<td>" . number_format($fileinfo->getSize()/1024, 2) . " KB" . "</td>"; } } }?> </tbody> </table> </div> <!--TAB TWO --> <div> <table class="widefat"> <thead> <tr> <tr> <th>File</th> <th>Permission</th> <th>Size</th> </tr> </thead> <tbody> <?php // ---- wp-admin folder $it = new RecursiveDirectoryIterator( ABSPATH . "wp-admin"); foreach(new RecursiveIteratorIterator($it) as $file) { $filetype = pathinfo($file, PATHINFO_EXTENSION); $stringy = substr(sprintf('%o', $fileinfo->getPerms()), -4); ?> </tr> <?php if (!in_array(strtolower($filetype), $filetypes)) { echo "<td>" . $file . "</td>"; //check for 777 ! if ($stringy == '0777'){ echo "<td>" . substr(sprintf('%o', $fileinfo->getPerms()), -4) . "<span class='red'> × </span>" . "</td>" ; }else{ echo "<td>" . substr(sprintf('%o', $fileinfo->getPerms()), -4) . "</td>" ; } echo "<td>" . number_format($file->getSize()/1024, 2) . " KB" . "</td>"; } }?> </tbody> </table> </div> <!--TAB THREE--> <div> <table class="widefat"> <thead> <tr> <tr> <th>File</th> <th>Permission</th> <th>Size</th> </tr> </thead> <tbody> <?php // ---- wp-content folder $it = new RecursiveDirectoryIterator( ABSPATH . "wp-content" ); foreach(new RecursiveIteratorIterator($it) as $file) { $filetype = pathinfo($file, PATHINFO_EXTENSION); $stringy = substr(sprintf('%o', $fileinfo->getPerms()), -4); ?> </tr> <?php if (!in_array(strtolower($filetype), $filetypes)) { echo "<td>" . $file . "</td>"; //check for 777 ! if ($stringy == '0777'){ echo "<td>" . substr(sprintf('%o', $fileinfo->getPerms()), -4) . "<span class='red'> × </span>" . "</td>" ; }else{ echo "<td>" . substr(sprintf('%o', $fileinfo->getPerms()), -4) . "</td>" ; } echo "<td>" . number_format($file->getSize()/1024, 2) . " KB" . "</td>"; } }?> </tbody> </table> </div> <!--TAB FOUR--> <div> <table class="widefat"> <thead> <tr> <tr> <th>File</th> <th>Permission</th> <th>Size</th> </tr> </thead> <tbody> <?php // ---- wp-includes folder $it = new RecursiveDirectoryIterator( ABSPATH . "wp-includes" ); foreach(new RecursiveIteratorIterator($it) as $file) { $filetype = pathinfo($file, PATHINFO_EXTENSION); $stringy = substr(sprintf('%o', $fileinfo->getPerms()), -4); ?> </tr> <?php if (!in_array(strtolower($filetype), $filetypes)) { echo "<td>" . $file . "</td>"; //check for 777 ! if ($stringy == '0777'){ echo "<td>" . substr(sprintf('%o', $fileinfo->getPerms()), -4) . "<span class='red'> × </span>" . "</td>" ; }else{ echo "<td>" . substr(sprintf('%o', $fileinfo->getPerms()), -4) . "</td>" ; } echo "<td>" . number_format($file->getSize()/1024, 2) . " KB" . "</td>"; } }?> </tbody> </table>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: