33
2
mirror of https://github.com/joomla-extensions/jedchecker.git synced 2024-11-27 23:36:38 +00:00

Translating the extension + adding some explanations about the current rules being checked

This commit is contained in:
Daniel Dimitrov 2012-06-23 16:12:44 +02:00
parent 7beb755a7d
commit 841e3a96e5
7 changed files with 172 additions and 21 deletions

View File

@ -22,12 +22,17 @@ class jedcheckerRulesHtmlindexes {
*/ */
$indexes = array_replace($this->folders, $this->indexes); $indexes = array_replace($this->folders, $this->indexes);
echo 'those directories does not have an index file: <br />'; echo '<span class="rule">'.JText::_('COM_JEDCHECKER_RULE_SE1') . '</span><br />';
if(count($indexes)) {
foreach($indexes as $key => $index) { foreach($indexes as $key => $index) {
if(!$index) { if(!$index) {
echo $key . '<br />'; echo $key . '<br />';
} }
} }
} else {
echo '<span class="success">'.JText::_('COM_JEDCHECKER_EVERYTHING_SEEMS_TO_BE_FINE_WITH_THAT_RULE').'</span>';
}
} }

View File

@ -44,12 +44,17 @@ class jedcheckerRulesJexec
} }
echo 'The following files dont have the _JEXEC check:<br/>'; echo '<span class="rule">'.JText::_('COM_JEDCHECKER_RULE_PH2') .'</span><br/>';
if(count($this->missing)) {
// Echo all files which don't have the _JEXEC check // Echo all files which don't have the _JEXEC check
foreach($this->missing AS $file) foreach($this->missing AS $file)
{ {
echo $file.'<br/>'; echo $file.'<br/>';
} }
} else {
echo '<span class="success">'.JText::_('COM_JEDCHECKER_EVERYTHING_SEEMS_TO_BE_FINE_WITH_THAT_RULE').'</span>';
}
} }

View File

@ -16,7 +16,7 @@ JHtml::stylesheet('media/com_jedchecker/css/css.css');
JHtml::script('media/com_jedchecker/js/police.js'); JHtml::script('media/com_jedchecker/js/police.js');
?> ?>
<script type="text/javascript"> <script type="text/javascript">
Joomla.submitbutton = function(task) { Joomla.submitbutton = function (task) {
var options = <?php echo json_encode($this->jsOptions); ?>; var options = <?php echo json_encode($this->jsOptions); ?>;
if (task == 'police.check') { if (task == 'police.check') {
new police(options); new police(options);
@ -26,15 +26,94 @@ JHtml::script('media/com_jedchecker/js/police.js');
} }
</script> </script>
<form action="<?php echo JRoute::_('index.php?option=com_jedchecker&view=uploads'); ?>" <div class="fltlft width-60">
<form action="<?php echo JRoute::_('index.php?option=com_jedchecker&view=uploads'); ?>"
method="post" class="form form-validate" name="adminForm" id="adminForm" enctype="multipart/form-data"> method="post" class="form form-validate" name="adminForm" id="adminForm" enctype="multipart/form-data">
<fieldset>
<p>
<?php echo JText::sprintf('COM_JEDCHECKER_CONGRATS', 'http://extensions.joomla.org/index.php?option=com_content&id=50'); ?>
</p>
<p>
<?php echo JText::sprintf('COM_JEDCHECKER_CODE_STANDARDS', 'http://developer.joomla.org/coding-standards.html', 'https://github.com/compojoom/jedchecker'); ?>
</p>
<p>
<?php echo JText::_('COM_JEDCHECKER_HOW_TO_USE'); ?>
</p>
<ol>
<li> 1. <?php echo JText::_('COM_JEDCHECKER_STEP1'); ?></li>
<li> 2. <?php echo JText::_('COM_JEDCHECKER_STEP2'); ?></li>
<li> 3. <?php echo JText::_('COM_JEDCHECKER_STEP3'); ?></li>
</ol>
<input type="file" name="extension" class="required" />
<input type="file" name="extension" class="required"/>
<button onclick="Joomla.submitbutton('uploads.upload')"> <button onclick="Joomla.submitbutton('uploads.upload')">
submit <?php echo JText::_('JSUBMIT'); ?>
</button> </button>
<input type="hidden" name="task" value="" /> <input type="hidden" name="task" value=""/>
<?php echo JHTML::_('form.token'); ?> <?php echo JHTML::_('form.token'); ?>
</form> </fieldset>
</form>
</div>
<div class="fltrt width-40">
<div class="help">
<h2><?php echo JText::_('COM_JEDCHECKER_WALL_OF_HONOR'); ?></h2>
<p><?php echo JText::_('COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT'); ?></p>
<ul>
<li>Tobias Kuhn (<a href="http://projectfork.com" target="_blank">projectfork</a>)</li>
</ul>
</div>
</div>
<div id="prison" style="display:none;">
<div class="fltlft width-60">
<div id="police-check-result"></div>
</div>
<div class="fltrt width-40">
<div class="help">
<h2>
<?php echo JText::_('COM_JEDCHECKER_HOW_TO_INTERPRET_RESULTS'); ?>
</h2>
<ul>
<li>
<p>
<span class="rule"><?php echo JText::_('COM_JEDCHECKER_RULE_SE1'); ?></span><br />
<?php echo JText::_('COM_JEDCHECKER_RULE_SE1_DESC'); ?>
</p>
<div id="police-check-result"></div> <p>
<?php echo JText::_('COM_JEDCHECKER_RULE_SE1_MORE_INFO_INTERPRETING'); ?> <br />
<?php echo JText::_('COM_JEDCHECKER_RULE_SE1_MORE_INFO_INTERPRETING1'); ?><br />
<i>administrator/components/your_component</i> <br/>
<i>components/your_component</i> <br/>
<?php echo JText::_('COM_JEDCHECKER_RULE_SE1_MORE_INFO_INTERPRETING2'); ?><br />
<i>administrator</i><br/>
<i>administrator/components</i><br/>
<i>administrator/components/your_component</i><br/>
<i>components/</i><br/>
<i>components/your_component</i><br/>
<?php echo JText::_('COM_JEDCHECKER_RULE_SE1_MORE_INFO_INTERPRETING3'); ?><br />
<i>administrator/components/your_component</i><br/>
<i>components/your_component</i><br/>
<?php echo JText::_('COM_JEDCHECKER_RULE_SE1_MORE_INFO_INTERPRETING4'); ?>
</p>
</li>
<li>
<p>
<span class="rule"><?php echo JText::_('COM_JEDCHECKER_RULE_PH2'); ?></span><br />
<?php echo JText::_('COM_JEDCHECKER_RULE_PH2_DESC'); ?>
</p>
</li>
</ul>
</div>
</div>
</div>
<div class="clr"></div>
<div class="copyright">
<?php echo JText::sprintf('COM_JEDCHECKER_DEVELOPED_BY', 'https://compojoom.com'); ?> :)
</div>

View File

@ -36,5 +36,6 @@ class jedcheckerViewUploads extends JView
{ {
JToolBarHelper::custom('uploads.unzip', 'unzip', 'unzip', 'unzip', false); JToolBarHelper::custom('uploads.unzip', 'unzip', 'unzip', 'unzip', false);
JToolBarHelper::custom('police.check', 'police-check', 'police-check', 'check', false); JToolBarHelper::custom('police.check', 'police-check', 'police-check', 'check', false);
JToolBarHelper::title('JED checker');
} }
} }

View File

@ -2,3 +2,25 @@
COM_JEDCHECKER_UPLOAD_WAS_SUCCESSFUL="Upload was successful" COM_JEDCHECKER_UPLOAD_WAS_SUCCESSFUL="Upload was successful"
COM_JEDCHECKER_UNZIP_SUCCESS="Unzip was successful! Now go ahead and click that check button!" COM_JEDCHECKER_UNZIP_SUCCESS="Unzip was successful! Now go ahead and click that check button!"
COM_JEDCHECKER_UNZIP_FAILED="Unzip failed"; COM_JEDCHECKER_UNZIP_FAILED="Unzip failed";
COM_JEDCHECKER_CONGRATS="Congratulations! If you use this component then you've most probably developed a Joomla!® extension! Now comes the &quot;hard&quot; part - getting it listed in the Joomla Extension Directory (JED). The JED has strict requirements to the extensions that get listed there. Those requirements can be found <a href='%s' target='_blank'>here</a>. Currently extensions are being manually tested for code problems. This component is an attempt to simplify your and the JED editors life's by automatically checking the code for common errors in extensions."
COM_JEDCHECKER_CODE_STANDARDS="However our goal is not only to test the extensions against common code errors that prevent it from getting listed in the JED. Our goal is to also have code standards checks such as the <a href='%s' target='_blank'>JPlatform has</a>. This would ensure that joomla extension developers are aware of the JPlatform coding standards and this could raise the quality bar in our Joomla community even higher! For this we will need you! Have a look at the <a href='%s' target='_blank'>github project page</a>. Fork the component! Add your code checks and send us your pull requests!"
COM_JEDCHECKER_HOW_TO_USE="So how to use this component???"
COM_JEDCHECKER_STEP1="Upload your component/plugin/module zip file by using the upload form below"
COM_JEDCHECKER_STEP2="Click on unzip"
COM_JEDCHECKER_STEP3="Click on check and review the results"
COM_JEDCHECKER_WALL_OF_HONOR="Wall of honor"
COM_JEDCHECKER_PEOPLE_THAT_HAVE_HELPED_WITH_THE_DEVELOPMENT="People that have helped with the development of this component"
COM_JEDCHECKER_HOW_TO_INTERPRET_RESULTS="How to interpret the results?"
COM_JEDCHECKER_RULE_SE1="Rule:SE1 - Extension is missing index.html file in all folders"
COM_JEDCHECKER_RULE_SE1_DESC="If you want your extension to be listed on the JED, then you should make sure that all your extension folders contain an index.html file. - Developers don't like this rule at all - it fills your package with index.html files, which in terms slows down the installation process etc. But index.html files provide protection for badly configured hosts (one could argue if we need to try to do anything for those), but as long the joomla CMS comes with those files the JED is going to require that extensions also have those."
COM_JEDCHECKER_RULE_SE1_MORE_INFO_INTERPRETING="The JEDchecker checks every single folder in your package for the presence of index.html files,but this doesn't mean that all folders need to have an index.html file. For example - language folders don't need to have an index.html file, because the joomla CMS has index.html files in those locations.If your package has the following structure:"
COM_JEDCHECKER_RULE_SE1_MORE_INFO_INTERPRETING1="Properly reading the JEDchecker results for SE1:"
COM_JEDCHECKER_RULE_SE1_MORE_INFO_INTERPRETING2="If the JEDchecker tells you that you have missing index.html in the following folders:"
COM_JEDCHECKER_RULE_SE1_MORE_INFO_INTERPRETING3="You actually need to worry only about"
COM_JEDCHECKER_RULE_SE1_MORE_INFO_INTERPRETING4="as those 2 folders won't have the index.html files when your component gets installed"
COM_JEDCHECKER_RULE_PH2="Rule PH2 - PHP Files missing JEXEC security"
COM_JEDCHECKER_RULE_PH2_DESC="All the PHP files in your extension needs to have a defined('_JEXEC') or die(); statement in the beginning of each file. This ensures that the file cannot be opened outside of the joomla installation and this way increases the security of your site."
COM_JEDCHECKER_EVERYTHING_SEEMS_TO_BE_FINE_WITH_THAT_RULE="Congrats! Everything seems to be fine with that rule!"
COM_JEDCHECKER_DEVELOPED_BY="JEDchecker is primary developed by <a href='%s'>compojoom.com</a>"

View File

@ -4,3 +4,40 @@
.icon-32-police-check { .icon-32-police-check {
background-image: url(../icons/inspect.png); background-image: url(../icons/inspect.png);
} }
#adminForm {
background: #FFF;
}
#police-check-result {
background: #F6F6F6;
border: 1px solid #CCC;
}
#police-check-result div:nth-child(odd){
border-bottom: 1px solid #CCCCCC;
}
#police-check-result div:nth-child(even){
background: #EBF1F2;
}
#police-check-result div {
padding: 5px 10px 5px;
}
.help {
padding: 5px;
border: 1px solid #CCCCCC;
background: #FFF;
margin-left: 10px;
}
.copyright {
line-height: 160%;
margin: 10px;
text-align: center;
}
.rule {
font-weight: bold;
}

View File

@ -16,6 +16,7 @@ var police = new Class({
this.options.rules.each(function(rule){ this.options.rules.each(function(rule){
self.check(rule); self.check(rule);
}); });
new Fx.Scroll(window).toElement(document.id('police-check-result'));
}, },
check: function(rule) { check: function(rule) {
@ -28,6 +29,7 @@ var police = new Class({
html: result html: result
}); });
div.inject(document.id('police-check-result')); div.inject(document.id('police-check-result'));
document.id('prison').setStyle('display', 'block');
} }
}).send(); }).send();
} }