Apologies for necrobumping. This was the first search result I hit looking for a solution.
I ended up using https://www.dokuwiki.org/plugin:embeddedphp to include a short script to sort by file size (looking for stubs as candidate pages for wiki maintenance). The codes a bit more verbose than it needs to be -- I also use the built up array elsewhere to sort by date modified to look for old pages that could use a retouch.
global $conf;
$my_pages = file($conf['indexdir'] . '/page.idx');
$my_dates_html = array();
foreach($my_pages as $id => $page) {
$key = trim($page);
if(preg_match("/^(wiki|playground)/", $key)) {
continue;
}
$date = p_get_metadata($key,"date", 0);
if(!$date) { continue; }
$fn_size = filesize(wikiFN($key));
$mdate = $date['modified'];
$cdate = $date['created'];
$html = date("Y-m-d", $cdate) . " -- " .
date("Y-m-d", $mdate) . " " .
$fn_size . " ".
"<a href='?id=" . $key . "'>" . $key . "</a><br>\n";
array_push($my_dates_html,
array("date"=>$mdate,
"cdate"=>$cdate,
"size" =>$fn_size,
"html"=>$html));
}
usort($my_dates_html, fn($a, $b) => $a['size'] <=> $b['size']);
echo "<br><br><h2>Smallest Pages</h2>";
$cnt = 0;
foreach($my_dates_html as $id => $a){
echo $a["html"];
if(++$cnt>15) { break; }
}