public function ajax_updatenext() { $time_start = microtime(true); $response["error"] = "none"; $response["file"] = "none"; $response["nextId"] = null; if (!empty($_POST["id"])) { $id = intval($_POST["id"]); if ($id < 1) { $i = 1; } $history = new History(); $themeInfo = $history->getFewInfo($id); if (!empty($themeInfo)) { $unzippath = TC_VAULTDIR . '/unzip/' . $themeInfo["hash"] . "/"; if (file_exists($unzippath)) { $nextId = $history->getNextId($themeInfo["id"]); $response["nextId"] = $nextId; $themeInfo = $history->loadThemeFromHash($themeInfo["hash"]); // need an objet and not an array $r = $themeInfo->initFromUnzippedArchive($unzippath, $themeInfo->zipfilename, $themeInfo->zipmimetype, $themeInfo->zipfilesize); // merchant... $this->fileValidator = new FileValidator($themeInfo); $this->fileValidator->validate(); if (UserMessage::getCount(ERRORLEVEL_FATAL) > 0) { $response["error"] = "fatal error:\n"; foreach (UserMessage::getMessages(ERRORLEVEL_FATAL) as $m) { $response["error"] .= "\n" . $m; } } else { if ($this->fileValidator->serialize(true)) { if (UserMessage::getCount(ERRORLEVEL_FATAL) > 0) { // at least one error occured while serializing (no thumbnail...) $response["error"] = "fatal error, could not serialize validation results:\n"; foreach (UserMessage::getMessages(ERRORLEVEL_FATAL) as $m) { $response["error"] .= "\n" . $m; } foreach (UserMessage::getMessages(ERRORLEVEL_CRITICAL) as $m) { $response["error"] .= "\n" . $m; } } else { $this->validationResults = $this->fileValidator->getValidationResults(I18N::getCurLang()); $themeInfo = $this->fileValidator->themeInfo; $response["name"] = $themeInfo->name; } } else { // at least one error occured while serializing (no thumbnail...) if (UserMessage::getCount(ERRORLEVEL_CRITICAL) > 0) { $response["error"] = "could not serialize validation results"; } foreach (UserMessage::getMessages(ERRORLEVEL_CRITICAL) as $m) { $response["error"] .= "\n" . $m; } } } } else { $response["error"] .= "No zip file " . $unzippath; } } else { if (UserMessage::getCount(ERRORLEVEL_FATAL) > 0) { // at least one error occured while serializing (no thumbnail...) $response["error"] = "could not execute validation:\n"; foreach (UserMessage::getMessages(ERRORLEVEL_FATAL) as $m) { $response["error"] .= "\n" . $m; } foreach (UserMessage::getMessages(ERRORLEVEL_CRITICAL) as $m) { $response["error"] .= "\n" . $m; } } else { $response["error"] = "could not execute validation (unknown error)."; } } } $time_end = microtime(true); $time = $time_end - $time_start; $response["duration"] = $time; //ob_clean(); header('Content-Type: application/json'); echo json_encode($response); }
function __($key, $lang = null) { $i18n = i18n::getinstance(); if (empty($lang)) { $lang = I18N::getCurLang(); } return $i18n->__($key, $lang); }
echo $script . "\n"; echo '</script>' . "\n"; } } ?> <div class="navbar navbar-inverse"> <!--<div class="navbar navbar-inverse">--> <div class="container"> <div class="navbar-header"> <a class="navbar-brand" href="<?php echo TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "index.php")); ?> "><img src="<?php echo TC_HTTPDOMAIN; ?> /img/headerlogo.png"></a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> <li><a href="<?php echo TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "contact")); ?> "><?php echo __("Contact us"); ?> </a></li> </ul> </div> </div> </div> <?php
public function ajax_sample() { $time_start = microtime(true); $response["error"] = "none"; $response["html"] = ""; $themeid = 1; if (isset($_POST["themeid"])) { $themeid = intval($_POST["themeid"]); } if ($themeid < 1) { $themeid = 1; } $checkid = $_POST["checkid"]; if (USE_DB) { $history = new History(); $themInfo = $history->getFewInfo($themeid); $hash = $themInfo["hash"]; $fileValidator = FileValidator::unserialize($hash); $fileValidator->validate($checkid); //if (UserMessage::getCount(ERRORLEVEL_FATAL) == 0) // serialize only if no fatal errors $validationResults = $fileValidator->getValidationResults(I18N::getCurLang()); if (count($validationResults->check_critical) > 0 || count($validationResults->check_warnings) > 0 || count($validationResults->check_info) > 0) { $url = TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => "en", "phpfile" => "results", "hash" => $hash)); $html = '<h2 style="color:#D00;">' . $themInfo["name"] . '<a href="' . $url . '" target="_blank" style="font-size:14px;margin-left:6px"><span class="glyphicon glyphicon-new-window"></span></a>' . '</h2>'; } if (count($validationResults->check_critical) > 0) { //$html .= '<h2 style="line-height:100px;color:#D00;">'.__("Critical alerts").'</h2>'; $html .= '<ol>'; foreach ($validationResults->check_critical as $check) { $html .= '<h4 style="color:#666;margin-top:40px;"><li>' . $check->title . ' : ' . $check->hint . '</li></h4>'; if (!empty($check->messages)) { $html .= '<p style="color:#c94b4b;">' . implode('<br/>', $check->messages) . '</p>'; } } $html .= '</ol>'; } if (count($validationResults->check_warnings) > 0) { //$html .= '<h2 style="line-height:100px;color:#eea43a;">'.__("Warnings").'</h2>'; $html .= '<ol>'; foreach ($validationResults->check_warnings as $check) { $html .= '<h4 style="color:#666;margin-top:40px;"><li>' . $check->title . ' : ' . $check->hint . '</li></h4>'; if (!empty($check->messages)) { $html .= '<p style="color:#eea43a;">' . implode('<br/>', $check->messages) . '</p>'; } } $html .= '</ol>'; } if (count($validationResults->check_info) > 0) { //$html .= '<h2 style="line-height:100px;color:#eea43a;">'.__("Warnings").'</h2>'; $html .= '<ol>'; foreach ($validationResults->check_info as $check) { $html .= '<h4 style="color:#666;margin-top:40px;"><li>' . $check->title . ' : ' . $check->hint . '</li></h4>'; if (!empty($check->messages)) { $html .= '<p style="color:#00b6e3;">' . implode('<br/>', $check->messages) . '</p>'; } } $html .= '</ol>'; } $response["html"] = $html; $prevId = $history->getPrevId($themeid); if (!empty($prevId)) { $themInfoNext = $history->getFewInfo($prevId); $response["next_id"] = $prevId; $response["next_name"] = $themInfoNext["name"]; } else { $response["next_id"] = null; $response["next_name"] = null; } } $time_end = microtime(true); $time = $time_end - $time_start; $response["duration"] = $time; //ob_clean(); header('Content-Type: application/json'); echo json_encode($response); }
public function render() { if (isset($_POST['send'])) { $errors = array(); if (isset($_SESSION['token_' . $_POST['token']])) { unset($_SESSION['token_' . $_POST['token']]); if (empty($_POST['name'])) { $errors['name'] = __("Required field"); } if (empty($_POST['email'])) { $errors['email'] = __("Required field"); } elseif (false === filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) { $errors['email'] = __("invalid email address"); } if (empty($_POST['message'])) { $errors['message'] = __("Required field"); } // Send email if (count($errors) == 0) { require_once TC_INCDIR . '/Swift-4.3.0/lib/swift_required.php'; $message = \Swift_Message::newInstance(); $message->setSubject('CONTACT THEMECHECK'); $message->setFrom(array('*****@*****.**' => 'Themecheck.org')); $text = "Contact from : " . htmlspecialchars($_POST['name']) . " : " . htmlspecialchars($_POST['email']) . "<br>"; if (!empty($_POST['website'])) { $text .= "Website: " . htmlspecialchars($_POST['website']) . "<br>"; } $text .= "<br>Message:<br>"; $text .= nl2br(htmlspecialchars($_POST['message'])); $message->setBody($text, 'text/html'); $to = array(); $to[TC_CONTACT_MAIL] = TC_CONTACT_NAME; $message->setTo($to); if (TC_ENVIRONMENT == 'dev') { // for unconfigured php.ini smtp use (xampp/wamp etc...): $transport = \Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')->setUsername('username')->setPassword('password'); } else { $transport = \Swift_SmtpTransport::newInstance(); } $mailer = \Swift_Mailer::newInstance($transport); $test = $mailer->send($message); echo '<div class="container"><div class="alert alert-success">' . __("Message sent. We'll contact you soon.") . '</div><a href="' . TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "index.php")) . '">' . __("Back to home page") . '</a></div>'; } } else { $errors['token'] = __("Invalid form"); } } if (!isset($_POST['send']) || count($errors) > 0) { $token = uniqid(true); $_SESSION['token_' . $token] = time(); ?> <div class="container"> <h1><?php echo __("Contact us"); ?> </h1> <br/><br/> <div id="contact-form"> <form method="post" action=""> <div class="row"> <div class="form-group <?php if (isset($errors['name'])) { ?> has-error<?php } ?> col-md-4 col-sm-6"> <label class="label-text control-label" for="name"><?php echo __("Name (required)"); ?> </label> <input type="text" class="name form-control" value="" id="name" name="name"> <?php if (isset($errors['name'])) { ?> <span class='control-label'><?php echo $errors['name']; ?> </span><?php } ?> </div> </div> <div class="row"> <div class="form-group <?php if (isset($errors['email'])) { ?> has-error<?php } ?> col-md-4 col-sm-6"> <label class="label-email control-label" for="email"><?php echo __("Email (required)"); ?> </label> <input type="text" class="email font-primary form-control" value="" id="email" name="email"> <?php if (isset($errors['email'])) { ?> <span class='control-label'><?php echo $errors['email']; ?> </span><?php } ?> </div> </div> <div class="row"> <div class="form-group <?php if (isset($errors['website'])) { ?> has-error<?php } ?> col-md-4 col-sm-6"> <label class="label-text control-label" for="website"><?php echo __("Website"); ?> </label> <input type="text" class="url font-primary form-control" value="" id="website" name="website"> <?php if (isset($errors['website'])) { ?> <span class='control-label'><?php echo $errors['website']; ?> </span><?php } ?> </div> </div> <div class="row"> <div class="form-group <?php if (isset($errors['message'])) { ?> has-error<?php } ?> col-md-9"> <label class="label-textarea control-label" for="message"><?php echo __("Message (required)"); ?> </label> <textarea rows="10" id="message" name="message" class="font-primary form-control"></textarea> <?php if (isset($errors['message'])) { ?> <span class='control-label'><?php echo $errors['message']; ?> </span><?php } ?> </div> </div> <p class="contact-submit form-group <?php if (isset($errors['token'])) { ?> has-error<?php } ?> "> <input type="submit" class="btn btn-primary" name="send" value="<?php echo __("Submit"); ?> "> <input type="hidden" name="token" value="<?php echo $token; ?> "> <?php if (isset($errors['token'])) { ?> <span class='control-label'><?php echo $errors['token']; ?> </span><?php } ?> </p> </form> </div> </div> <?php } }
</div> <div class="col-xs-4" style="text-align:center;"> <a href="https://github.com/themecheck/themecheck"><img src="<?php echo TC_HTTPDOMAIN; ?> /img/github48.png" alt="themecheck on github"><br/>Github</a> <br><br><a href="http://www.joomla.org" rel="nofollow">joomla.org</a> <br><a href="http://wordpress.org" rel="nofollow">wordpress.org</a> <br><a href="http://owasp.org" rel="nofollow">owasp.org</a> </div> <div class="col-xs-4" style="text-align:right;line-height:52px"> <?php if (!empty($controller->samepage_i18n[I18N::getCurLang()])) { $langs = ""; foreach ($controller->samepage_i18n as $l => $url) { if ($l == I18N::getCurLang()) { $langs .= strtoupper($l) . ' | '; } else { $langs .= '<a href="' . $url . '">' . strtoupper($l) . '</a> | '; } } echo trim($langs, ' |'); } ?> <br/> <iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fthemecheck.org&width=65&layout=box_count&action=like&show_faces=false&share=false&height=65&appId=244478959009718" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:65px; height:65px; float:right;" allowTransparency="true"></iframe> </div> </div> <p> </p> </footer>
public function render() { $max_size = Helpers::returnBytes(ini_get('upload_max_filesize')); if ($max_size > Helpers::returnBytes(ini_get('post_max_size'))) { $max_size = Helpers::returnBytes(ini_get('post_max_size')); } $max_size_MB = $max_size / (1024 * 1024); $token = uniqid(true); $_SESSION['token_' . $token] = time(); ?> <div class="jumbotron"> <div class="container"> <h1><?php echo __("Verify web themes and templates"); ?> </h1> <p><?php echo __("Themecheck.org is a quick service that lets you verify web themes or templates for security and code quality. This service is free and compatible with Wordpress themes and Joomla templates."); ?> <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"><?php echo __("More..."); ?> </a> </p> <div class="row"> <div id="collapseOne" class="panel-collapse collapse"> <div class="panel-body"> <div class="col-lg-6"> <h2><?php echo __("Website owners"); ?> </h2> <p><?php echo __("Check themes or templates you download before installing them on your site"); ?> </p> <ul> <li><?php echo __("Check code quality"); ?> </li> <li><?php echo __("Check presence of malware"); ?> </li> </ul> </div> <div class="col-lg-6"> <h2><?php echo __("Developers"); ?> </h2> <p><?php echo __("Your create or distribute themes ?"); ?> </p> <ul> <li><?php echo __("Themecheck.org helps you verify they satisfy CMS standards and common users needs."); ?> </li> <li><?php echo __("Share verification score on your site with ThemeCheck.org widget "); ?> <img src="<?php echo TC_HTTPDOMAIN; ?> /img/pictosuccess40.png"></li> </ul> </div> </div> </div> </div> </div> </div> <div class="container text-center"> <h2 ><?php echo __("Upload a zip file and get its verification score :"); ?> </h2><br/> <form role="form" class="text-center" action="<?php echo TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "results")); ?> " method="post" enctype="multipart/form-data"> <div class="form-group"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo Helpers::returnBytes(ini_get('upload_max_filesize')); ?> " /> <input type="file" name="file" id="file" class="filestyle" data-buttonText="<?php echo __("Select file"); ?> " data-classButton="btn btn-default btn-lg" data-classInput="input input-lg"> </div> <?php echo __("Maximum file size") . " : {$max_size_MB} MB"; ?> <br/><br/> <input type="checkbox" name="donotstore" value="donotstore"> <?php echo __('Forget uploaded data after results') . ' <a id="forgetresultsmoreinfo" data-container="body" data-toggle="popover" data-placement="right" data-content="' . __("<ul><li>No data will be kept on themecheck.org servers (or any other)<li>Validation won't be visible to the public<li>If you want to see the results in the future, you'll have to re-submit your file</ul>") . '" href="#!">( ? )</a>'; ?> <br> <br/> <button type="submit" class="btn btn-primary btn-lg" ><?php echo __("Submit"); ?> </button> <input type="hidden" name="token" value="<?php echo $token; ?> "/> </form> <?php // display recent validated file if history is available if (USE_DB) { $history = new History(); ?> <hr> <h2><?php echo __("Recently checked themes"); ?> </h2> <div class="row"> <form id="sortform"> <div style="font-size:20px;" class="col-sm-4 col-sm-offset-4"> wordpress <input type='checkbox' name='theme[]' value='wordpress' <?php if (isset($_SESSION['theme'])) { if (in_array("wordpress", $_SESSION['theme'])) { echo 'checked="checked"'; } } else { echo 'checked="checked"'; } ?> class='sortdropdown'/> joomla <input type='checkbox' name='theme[]' value='joomla' <?php if (isset($_SESSION['theme'])) { if (in_array("joomla", $_SESSION['theme'])) { echo 'checked="checked"'; } } else { echo 'checked="checked"'; } ?> class='sortdropdown'/> </div> <div class="col-sm-3 col-sm-offset-1 col-xs-12"> <select name='sort' class='sortdropdown form-control' style="width:180px;margin:auto"> <option value='id' <?php if (isset($_SESSION['sort']) && $_SESSION['sort'] == 'creationDate') { echo 'selected="selected"'; } ?> ><?php echo __("Newer first"); ?> </option> <option value='score' <?php if (isset($_SESSION['sort']) && $_SESSION['sort'] == 'score') { echo 'selected="selected"'; } ?> ><?php echo __("Higher scores first"); ?> </option> </select> </div> </form> </div> <div id="alreadyvalidated"> <?php if (isset($_SESSION['sort']) && isset($_SESSION['theme'])) { $pagination = $history->getSorted($_SESSION['sort'], $_SESSION['theme']); } else { $pagination = $history->getRecent(); } foreach ($pagination as $t) { echo $this->getThumb($t); } ?> </div> <div style="text-align:center;"><button type="button" id="seemore-btn" class="btn"> <?php echo __("See more"); ?> </button> </div> <?php } ?> </div> <!-- /container --> <script> $('#seemore-btn').click(function () { $.ajax({ type: "POST", url: "<?php echo TC_HTTPDOMAIN . '/ajax.php?controller=home&action=seemore'; ?> ", data: { olderthan: $("#alreadyvalidated div.validated-theme").last().data("id"), lang: "<?php echo I18N::getCurLang(); ?> " } }).done(function( obj ) { $("#alreadyvalidated").append(obj.html); if (obj.nomore) $("#seemore-btn").hide(); smallestid = obj.smallestid; }).fail(function() { console.log("ajax error"); }) }); $('.sortdropdown').on("change", function(){ $.ajax({ type: "POST", url: "<?php echo TC_HTTPDOMAIN . '/ajax.php?controller=home&action=sort'; ?> ", data: $("#sortform").serialize() }).done(function(obj){ $("#alreadyvalidated").html(obj.html); }); }) </script> <?php }
private function renderRulesSet($themeInfo, $validationResults) { ?> <div class="row" style="color:#888;font-weight:normal;margin:30px 0 0 0;background:#F8F8F8;border-radius: 3px;"> <div class="col-md-8 text-center" style=""> <br/> <?php $userMessage = UserMessage::getInstance(); echo UserMessage::getInstance()->getMessagesHtml(); $img = 'shieldperfect240.png'; $color = 'a6af11'; $text = sprintf(__('Validation score : %s%%'), intval($themeInfo->score)); if ($themeInfo->score < 100.0) { if ($themeInfo->score > 95) { $img = "shieldgreen240.png"; $color = 'cbd715'; } else { if ($themeInfo->score > 80) { $img = "shieldorange240.png"; $color = 'ff8214'; } else { $img = "shieldred240.png"; $color = 'ff1427'; } } if ($themeInfo->criticalCount > 0) { $text = sprintf(__('Validation score : %s%% (%s critical alerts)'), intval($themeInfo->score), $themeInfo->criticalCount); } else { $text = sprintf(__('Validation score : %s%%'), intval($themeInfo->score)); } } ?> <div class="shield1" style="width:201px;height:240px;background-image:url(<?php echo TC_HTTPDOMAIN; ?> /img/<?php echo $img; ?> );" title="<?php echo $text; ?> "> <div class="shield2" style="color:#<?php echo $color; ?> ;"> <?php if ($themeInfo->score < 100.0) { echo intval($themeInfo->score); } ?> </div> </div> <?php echo '<p "color:#' . $color . '">' . __("validation score") . ' : ' . intval($themeInfo->score) . ' %</p>'; echo '<p>' . sprintf(__("%s critical alerts. %s warnings."), $themeInfo->criticalCount, $themeInfo->warningsCount) . '</p>'; if (!isset($_POST["donotstore"]) && UserMessage::getCount(ERRORLEVEL_FATAL) == 0) { ?> <br/><br/> <?php echo __("Share this page with the following link :"); ?> <p> <?php echo '<a href="' . $this->samepage_i18n[I18N::getCurLang()] . '">' . $this->samepage_i18n[I18N::getCurLang()] . '</a>'; ?> </p> <?php echo __("Display this score on your website with the following HTML code that links to this page :"); ?> <p style="color:red"><i>( corrected 2014-06-09 )</i></p> <pre style="font-size:11px;width:70%;margin:auto;"><?php echo htmlspecialchars('<iframe src="' . TC_HTTPDOMAIN . '/score.php?lang=' . I18N::getCurLang() . '&id=' . $themeInfo->hash . '&size=big" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:240px; width:200px;" allowTransparency="true"></iframe>'); ?> </pre> <button class="btn" data-toggle="collapse" data-target="#moreembedoptions" style="height:20px;padding:1px;font-size:12px">more options</button> <div id="moreembedoptions" class="collapse"> <?php displayShield($themeInfo, I18N::getCurLang(), 80, '#', TC_HTTPDOMAIN . '/'); ?> <?php echo __("Medium size icon (default) :"); ?> <pre style="font-size:11px;width:70%;margin:auto;"><?php echo htmlspecialchars('<iframe src="' . TC_HTTPDOMAIN . '/score.php?id=' . $themeInfo->hash . '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px; width:67px;" allowTransparency="true"></iframe>'); ?> </pre> <?php displayShield($themeInfo, I18N::getCurLang(), 40, '#', TC_HTTPDOMAIN . '/'); ?> <?php echo __("Small size icon :"); ?> <pre style="font-size:11px;width:70%;margin:auto;"><?php echo htmlspecialchars('<iframe src="' . TC_HTTPDOMAIN . '/score.php?id=' . $themeInfo->hash . '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px; width:40px;" allowTransparency="true"></iframe>'); ?> </pre> <?php echo htmlspecialchars(__("You can switch language with <strong>lang</strong> parameter in iframe's url. So far <strong>fr</strong> and <strong>en</strong> are supported. Default value is <strong>en</strong>.")); ?> <pre style="font-size:11px;width:70%;margin:auto;"><?php echo htmlspecialchars('<iframe src="' . TC_HTTPDOMAIN . '/score.php?lang=' . I18N::getCurLang() . '&id=' . $themeInfo->hash . '" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:80px; width:67px;" allowTransparency="true"></iframe>'); ?> </pre> </div> <br/> <?php } else { echo '<br>' . __("These results were not saved on themecheck.org servers and will be lost when you quit this page."); } ?> </div> <div class="col-md-4" style="border-radius: 3px;background:#444; overflow:hidden; font-size:12px"> <?php $characteristics = array(); $characteristics[] = array(__("Theme name"), htmlspecialchars($themeInfo->name)); if ($themeInfo->themetype == TT_WORDPRESS) { if (empty($themeInfo->cmsVersion)) { $characteristics[] = array(__("Theme type"), __("Wordpress theme")); } else { $characteristics[] = array(__("Theme type"), __("Wordpress theme") . ' ' . $themeInfo->cmsVersion); } } else { if ($themeInfo->themetype == TT_WORDPRESS_CHILD) { if (empty($themeInfo->cmsVersion)) { $characteristics[] = array(__("Theme type"), __("Wordpress child theme")); } else { $characteristics[] = array(__("Theme type"), __("Wordpress child theme") . ' ' . $themeInfo->cmsVersion); } if (!empty($themeInfo->parentName)) { $url = TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => I18N::getCurLang(), "phpfile" => "results", "namesanitized" => $themeInfo->parentNameSanitized, "themetype" => $themeInfo->parentThemeType)); $characteristics[] = array(__("Parent theme name"), "<a href='" . $url . "'>" . htmlspecialchars($themeInfo->parentName) . "</a>"); } } else { if ($themeInfo->themetype == TT_JOOMLA) { if (empty($themeInfo->cmsVersion)) { $characteristics[] = array(__("Theme type"), __("Joomla template")); } else { $characteristics[] = array(__("Theme type"), __("Joomla template") . ' ' . $themeInfo->cmsVersion); } } } } $characteristics[] = array(__("File name"), htmlspecialchars($themeInfo->zipfilename, defined('ENT_HTML5') ? ENT_QUOTES | ENT_HTML5 : ENT_QUOTES)); $characteristics[] = array(__("File size"), $themeInfo->zipfilesize . ' ' . __('bytes')); $characteristics[] = array(__("MD5"), strtolower($themeInfo->hash_md5)); $characteristics[] = array(__("SHA1"), strtolower($themeInfo->hash_sha1)); if (empty($themeInfo->licenseUri)) { if (!empty($themeInfo->licenseText)) { $characteristics[] = array(__("License"), ThemeInfo::getLicenseName($themeInfo->license) . '<br>' . htmlspecialchars($themeInfo->licenseText)); } else { $characteristics[] = array(__("License"), ThemeInfo::getLicenseName($themeInfo->license)); } } else { if (!empty($themeInfo->licenseText)) { $characteristics[] = array(__("License"), '<a href="' . $themeInfo->licenseUri . '" rel="nofollow">' . ThemeInfo::getLicenseName($themeInfo->license) . '</a>' . '<br>' . htmlspecialchars($themeInfo->licenseText)); } else { $characteristics[] = array(__("License"), '<a href="' . $themeInfo->licenseUri . '" rel="nofollow">' . ThemeInfo::getLicenseName($themeInfo->license) . '</a>'); } } $characteristics[] = array(__("Files included"), htmlspecialchars($themeInfo->filesIncluded, defined('ENT_HTML5') ? ENT_QUOTES | ENT_HTML5 : ENT_QUOTES)); if (!empty($themeInfo->themeUri)) { if (strpos($themeInfo->themeUri, 'themeforest.net') !== false) { $characteristics[] = array(__("Theme URI"), '<a href="' . $themeInfo->themeUri . '?ref=peol">' . htmlspecialchars($themeInfo->themeUri) . '</a>'); } else { $characteristics[] = array(__("Theme URI"), '<a href="' . $themeInfo->themeUri . '">' . htmlspecialchars($themeInfo->themeUri) . '</a>'); } } if (!empty($themeInfo->version)) { $characteristics[] = array(__("Version"), htmlspecialchars($themeInfo->version)); } if (!empty($themeInfo->authorUri)) { $characteristics[] = array(__("Author URI"), '<a href="' . $themeInfo->authorUri . '">' . htmlspecialchars($themeInfo->authorUri) . '</a>'); } if (!empty($themeInfo->tags)) { $characteristics[] = array(__("Tags"), htmlspecialchars($themeInfo->tags)); } if (!empty($themeInfo->layout)) { if ($themeInfo->layout == 1) { $characteristics[] = array(__("Layout"), __("Fixed")); } else { if ($themeInfo->layout == 2) { $characteristics[] = array(__("Layout"), __("Fluid")); } else { if ($themeInfo->layout == 3) { $characteristics[] = array(__("Layout"), __("Responsive")); } } } } if (!empty($themeInfo->copyright)) { $characteristics[] = array(__("Copyright"), htmlspecialchars($themeInfo->copyright)); } if (!empty($themeInfo->creationDate)) { $characteristics[] = array(__("Creation date"), date("Y-m-d", $themeInfo->creationDate)); } if (!empty($themeInfo->modificationDate)) { $characteristics[] = array(__("Last file update"), date("Y-m-d", $themeInfo->modificationDate)); } if (!empty($themeInfo->validationDate)) { $characteristics[] = array(__("Last validation"), date("Y-m-d H:i", $themeInfo->validationDate)); } foreach ($characteristics as $c) { echo '<p style="text-transform:uppercase;margin:0;margin-top:10px;">' . $c[0] . '</p><span style="color:#CCC">' . $c[1] . '</span>'; } ?> </div> </div> <?php echo '<div class="row"><div class="col-md-12">'; if (count($validationResults->check_critical) > 0) { echo '<h2 style="line-height:100px;color:#D00;">' . __("Critical alerts") . '</h2>'; echo '<ol>'; foreach ($validationResults->check_critical as $check) { echo '<h4 style="color:#666;margin-top:40px;"><li>' . $check->title . ' : ' . $check->hint . '</li></h4>'; if (!empty($check->messages)) { echo '<p style="color:#c94b4b;">' . implode('<br/>', $check->messages) . '</p>'; } } echo '</ol>'; } if (count($validationResults->check_warnings) > 0) { echo '<h2 style="line-height:100px;color:#eea43a;">' . __("Warnings") . '</h2>'; echo '<ol>'; foreach ($validationResults->check_warnings as $check) { echo '<h4 style="color:#666;margin-top:40px;"><li>' . $check->title . ' : ' . $check->hint . '</li></h4>'; if (!empty($check->messages)) { echo '<p style="color:#eea43a;">' . implode('<br/>', $check->messages) . '</p>'; } } echo '</ol>'; } if (count($validationResults->check_info) > 0) { echo '<h2 style="line-height:100px;color:#00b6e3;">' . __("Info") . '</h2>'; echo '<ol>'; foreach ($validationResults->check_info as $check) { echo '<h4 style="color:#666;margin-top:40px;"><li>' . $check->title . ' : ' . $check->hint . '</li></h4>'; if (!empty($check->messages)) { echo '<p style="color:#00b6e3;">' . implode('<br/>', $check->messages) . '</p>'; } } echo '</ol>'; } echo '</div></div>'; }