Esempio n. 1
0
        if ($themeInfo->themetype == 1) {
            echo '[WP] ';
        }
        if ($themeInfo->themetype == 2) {
            echo '[Joomla] ';
        }
        if ($themeInfo->themetype == 4) {
            echo '[WP child] ';
        }
        echo $themeInfo->namesanitized;
        ?>
');
		</script>
		<?php 
        $href = TC_HTTPDOMAIN . '/' . Route::getInstance()->assemble(array("lang" => $lang, "phpfile" => "results", "hash" => $hash));
        displayShield($themeInfo, $lang, $size, $href, '');
    } else {
        ?>
<script>
			ga('send', 'pageview');
		</script><?php 
        echo __("Error : non existant id.", $lang);
    }
} else {
    ?>
<script>
			ga('send', 'pageview');
		</script><?php 
    echo __("Error : invalid id.", $lang);
}
?>
Esempio n. 2
0
    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>';
    }