vindi/vindi-woocommerce

View on GitHub
src/templates/admin-settings.html.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php if (!defined('ABSPATH')) {
exit;
}
Expected 1 space after closing parenthesis; found 0
if (!$settings->check_ssl()): ?>
<div class="error">
<p>
<strong><?php _e('Vindi WooCommerce Desabilitado', VINDI);?></strong>:
Line exceeds 120 characters; contains 221 characters
<?php printf(__('É necessário um <strong>Certificado SSL</strong> para ativar este método de pagamento em modo de produção. Por favor, verifique se um certificado SSL está instalado em seu servidor!', VINDI));?>
</p>
</div>
<?php endif;?>
 
<h3><?php _e('Vindi', VINDI);?></h3>
<p><?php _e('Utiliza a rede Vindi como meio de pagamento para cobranças.', VINDI);?></p>
<table class="form-table">
Line indented incorrectly; expected 4 spaces, found 2
<?php $settings->generate_settings_html();?>
</table>
<?php
$merchant = false;
$api_key = $settings->get_api_key();
if (!empty($api_key)) {
$merchant = get_transient('vindi_merchant');
}
 
?>
 
<div class="below-h2 <?php echo $merchant !== false ? 'updated' : 'error'; ?>">
Spaces must be used to indent lines; tabs are not allowed
<h3 class="wc-settings-sub-title title-1">
Spaces must be used to indent lines; tabs are not allowed
<?php _e('Link de configuração dos Eventos da Vindi', VINDI);?>
Spaces must be used to indent lines; tabs are not allowed
</h3>
 
Spaces must be used to indent lines; tabs are not allowed
<p><?php _e('Copie esse link e utilize-o para configurar os eventos nos Webhooks da Vindi.', VINDI);?></p>
 
<input type="text" value="<?php echo $settings->get_webhooks_url(); ?>" readonly="readonly"
onClick="this.select(); this.setSelectionRange(0, this.value.length); document.execCommand('copy');"/>
<hr>
Spaces must be used to indent lines; tabs are not allowed
<div class="test-return-infos">
Expected 1 space after closing parenthesis; found 0
<?php if ($merchant): ?>
<div>
<h3 class="wc-settings-sub-title title-2"><?php _e('Teste de conexão com a Vindi', VINDI);?></h3>
<p><?php _e('Conectado com sucesso!', VINDI)?></p>
</div>
<div>
<p><?php echo sprintf(__('Conta: <strong>%s</strong>', VINDI), $merchant['name']) ?></p>
</div>
<div>
<p><?php echo sprintf(__('Status: <strong>%s</strong>', VINDI), ucwords($merchant['status'])) ?></p>
</div>
Expected 1 space after ELSE keyword; 0 found
<?php else: ?>
<div>
<h3 class="wc-settings-sub-title title-2"><?php _e('Teste de conexão com a Vindi', VINDI);?></h3>
Line exceeds 120 characters; contains 124 characters
<p><?php echo sprintf(__('Falha na conexão! <br><strong>%s</strong>', VINDI), $settings->api->last_error); ?></p>
</div>
Line exceeds 120 characters; contains 128 characters
Expected 1 space after closing parenthesis; found 0
<?php if (isset($api_key) && strlen($api_key) === 43 && $settings->api->last_error !== "unauthorized|authorization"): ?>
<script type="text/javascript">
jQuery(document).ready(function(){
Line exceeds 120 characters; contains 138 characters
jQuery('.wc-settings-sub-title').parent().append('<div class="alert alert-info">Aguarde! Reconectando ao Vindi.</div>');
setTimeout(function(){jQuery("button[name='save']").click();},2e3);
});
Spaces must be used to indent lines; tabs are not allowed
</script>
Spaces must be used to indent lines; tabs are not allowed
Closing brace indented incorrectly; expected 8 spaces, found 10
Line indented incorrectly; expected 12 spaces, found 10
<?php endif;?>
<?php endif;?>
Spaces must be used to indent lines; tabs are not allowed
</div>
</div>