Changeset 3485668
- Timestamp:
- 03/18/2026 12:36:03 PM (11 days ago)
- Location:
- freelancebo-sentra-control/trunk
- Files:
-
- 4 added
- 10 edited
-
admin/views/blocklist.php (modified) (2 diffs)
-
admin/views/dashboard.php (modified) (1 diff)
-
admin/views/events.php (modified) (1 diff)
-
admin/views/firewall.php (modified) (3 diffs)
-
admin/views/scans.php (modified) (5 diffs)
-
admin/views/settings.php (modified) (5 diffs)
-
admin/views/status.php (modified) (4 diffs)
-
freelancebo-sentra-control.php (modified) (17 diffs)
-
includes/class-sentra-api-client.php (modified) (1 diff)
-
languages (added)
-
languages/freelancebo-sentra-control-it_IT.mo (added)
-
languages/freelancebo-sentra-control-it_IT.po (added)
-
languages/freelancebo-sentra-control.pot (added)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
freelancebo-sentra-control/trunk/admin/views/blocklist.php
r3485648 r3485668 4 4 5 5 <div class="sentra-actions"> 6 <button class="sentra-btn sentra-btn-danger" id="sentra-add-ip-btn"><span class="dashicons dashicons-plus-alt2" style="margin-top:2px;"></span> Blocca IP</button>7 <button class="sentra-btn sentra-btn-primary" id="sentra-refresh-bl" style="background:#666;"><span class="dashicons dashicons-update" style="margin-top:2px;"></span> Aggiorna</button>6 <button class="sentra-btn sentra-btn-danger" id="sentra-add-ip-btn"><span class="dashicons dashicons-plus-alt2" style="margin-top:2px;"></span> <?php echo esc_html__( 'Block IP', 'freelancebo-sentra-control' ); ?></button> 7 <button class="sentra-btn sentra-btn-primary" id="sentra-refresh-bl" style="background:#666;"><span class="dashicons dashicons-update" style="margin-top:2px;"></span> <?php echo esc_html__( 'Refresh', 'freelancebo-sentra-control' ); ?></button> 8 8 </div> 9 9 10 10 <div id="sentra-add-ip-form" style="display:none; background:#fff; padding:20px; border:1px solid #ddd; border-radius:8px; margin-bottom:20px;"> 11 <h3 style="margin-top:0;"> Blocca Indirizzo IP</h3>11 <h3 style="margin-top:0;"><?php echo esc_html__( 'Block IP Address', 'freelancebo-sentra-control' ); ?></h3> 12 12 <div class="sentra-form-row"> 13 13 <input type="text" id="sentra-block-ip" placeholder="Indirizzo IP (es: 192.168.1.100)" style="flex:1;"> 14 14 <input type="text" id="sentra-block-reason" placeholder="Motivo (opzionale)" style="flex:1;"> 15 <button class="sentra-btn sentra-btn-danger" id="sentra-save-block"> Blocca</button>16 <button class="sentra-btn" id="sentra-cancel-block" style="background:#ccc; color:#333;"> Annulla</button>15 <button class="sentra-btn sentra-btn-danger" id="sentra-save-block"><?php echo esc_html__( 'Block', 'freelancebo-sentra-control' ); ?></button> 16 <button class="sentra-btn" id="sentra-cancel-block" style="background:#ccc; color:#333;"><?php echo esc_html__( 'Cancel', 'freelancebo-sentra-control' ); ?></button> 17 17 </div> 18 18 </div> … … 20 20 <table class="sentra-table" id="sentra-blocklist-table"> 21 21 <thead> 22 <tr><th> Indirizzo IP</th><th>Motivo</th><th>Origine</th><th>Data</th><th></th></tr>22 <tr><th><?php echo esc_html__( 'IP Address', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Reason', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Source', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Date', 'freelancebo-sentra-control' ); ?></th><th></th></tr> 23 23 </thead> 24 <tbody><tr><td colspan="5" class="sentra-loading"> Caricamento...</td></tr></tbody>24 <tbody><tr><td colspan="5" class="sentra-loading"><?php echo esc_html__( 'Loading...', 'freelancebo-sentra-control' ); ?></td></tr></tbody> 25 25 </table> 26 26 </div> -
freelancebo-sentra-control/trunk/admin/views/dashboard.php
r3485648 r3485668 4 4 5 5 <?php if (!Sentra::instance()->is_configured()): ?> 6 <div class="notice notice-warning"><p> Plugin non configurato. <a href="<?php echo esc_url(admin_url('admin.php?page=sentra-settings')); ?>">Vai alle Impostazioni</a></p></div>6 <div class="notice notice-warning"><p><?php echo esc_html__( 'Plugin not configured.', 'freelancebo-sentra-control' ); ?> <a href="<?php echo esc_url(admin_url('admin.php?page=sentra-settings')); ?>"><?php echo esc_html__( 'Go to Settings', 'freelancebo-sentra-control' ); ?></a></p></div> 7 7 <?php else: ?> 8 8 9 <div id="sentra-dashboard-cards" class="sentra-cards"><div class="sentra-loading"> Caricamento...</div></div>9 <div id="sentra-dashboard-cards" class="sentra-cards"><div class="sentra-loading"><?php echo esc_html__( 'Loading...', 'freelancebo-sentra-control' ); ?></div></div> 10 10 11 <h2> Ultimi Eventi</h2>11 <h2><?php echo esc_html__( 'Latest Events', 'freelancebo-sentra-control' ); ?></h2> 12 12 <table class="sentra-table" id="sentra-recent-events"> 13 13 <thead> 14 <tr><th> Tipo</th><th>Severità</th><th>IP</th><th>Dettagli</th><th>Data</th></tr>14 <tr><th><?php echo esc_html__( 'Type', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Severity', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'IP', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Details', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Date', 'freelancebo-sentra-control' ); ?></th></tr> 15 15 </thead> 16 <tbody><tr><td colspan="5" class="sentra-loading"> Caricamento...</td></tr></tbody>16 <tbody><tr><td colspan="5" class="sentra-loading"><?php echo esc_html__( 'Loading...', 'freelancebo-sentra-control' ); ?></td></tr></tbody> 17 17 </table> 18 18 -
freelancebo-sentra-control/trunk/admin/views/events.php
r3485648 r3485668 1 1 <?php if (!defined('ABSPATH')) exit; ?> 2 2 <div class="wrap sentra-wrap"> 3 <h1><span class="dashicons dashicons-list-view"></span> Eventi di Sicurezza</h1>3 <h1><span class="dashicons dashicons-list-view"></span> <?php echo esc_html__( 'Security Events', 'freelancebo-sentra-control' ); ?></h1> 4 4 5 5 <div class="sentra-actions"> 6 6 <select id="sentra-severity-filter"> 7 <option value=""> Tutte le severità</option>8 <option value="critical"> Critici</option>9 <option value="high"> Alti</option>10 <option value="medium"> Medi</option>11 <option value="low"> Bassi</option>12 <option value="info"> Info</option>7 <option value=""><?php echo esc_html__( 'All severities', 'freelancebo-sentra-control' ); ?></option> 8 <option value="critical"><?php echo esc_html__( 'Critical', 'freelancebo-sentra-control' ); ?></option> 9 <option value="high"><?php echo esc_html__( 'High', 'freelancebo-sentra-control' ); ?></option> 10 <option value="medium"><?php echo esc_html__( 'Medium', 'freelancebo-sentra-control' ); ?></option> 11 <option value="low"><?php echo esc_html__( 'Low', 'freelancebo-sentra-control' ); ?></option> 12 <option value="info"><?php echo esc_html__( 'Info', 'freelancebo-sentra-control' ); ?></option> 13 13 </select> 14 <button class="sentra-btn sentra-btn-primary" id="sentra-refresh-events"><span class="dashicons dashicons-update" style="margin-top:2px;"></span> Aggiorna</button>14 <button class="sentra-btn sentra-btn-primary" id="sentra-refresh-events"><span class="dashicons dashicons-update" style="margin-top:2px;"></span> <?php echo esc_html__( 'Refresh', 'freelancebo-sentra-control' ); ?></button> 15 15 </div> 16 16 17 17 <table class="sentra-table" id="sentra-events-table"> 18 18 <thead> 19 <tr><th> Tipo</th><th>Severità</th><th>IP Sorgente</th><th>URI</th><th>Dettagli</th><th>Data</th></tr>19 <tr><th><?php echo esc_html__( 'Type', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Severity', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Source IP', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'URI', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Details', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Date', 'freelancebo-sentra-control' ); ?></th></tr> 20 20 </thead> 21 <tbody><tr><td colspan="6" class="sentra-loading"> Caricamento...</td></tr></tbody>21 <tbody><tr><td colspan="6" class="sentra-loading"><?php echo esc_html__( 'Loading...', 'freelancebo-sentra-control' ); ?></td></tr></tbody> 22 22 </table> 23 23 </div> -
freelancebo-sentra-control/trunk/admin/views/firewall.php
r3485648 r3485668 1 1 <?php if (!defined('ABSPATH')) exit; ?> 2 2 <div class="wrap sentra-wrap"> 3 <h1><span class="dashicons dashicons-shield-alt"></span> Regole Firewall</h1>3 <h1><span class="dashicons dashicons-shield-alt"></span> <?php echo esc_html__( 'Firewall Rules', 'freelancebo-sentra-control' ); ?></h1> 4 4 5 5 <div class="sentra-actions"> 6 <button class="sentra-btn sentra-btn-primary" id="sentra-add-rule-btn"><span class="dashicons dashicons-plus-alt2" style="margin-top:2px;"></span> Nuova Regola</button>7 <button class="sentra-btn sentra-btn-primary" id="sentra-refresh-rules" style="background:#666;"><span class="dashicons dashicons-update" style="margin-top:2px;"></span> Aggiorna</button>6 <button class="sentra-btn sentra-btn-primary" id="sentra-add-rule-btn"><span class="dashicons dashicons-plus-alt2" style="margin-top:2px;"></span> <?php echo esc_html__( 'New Rule', 'freelancebo-sentra-control' ); ?></button> 7 <button class="sentra-btn sentra-btn-primary" id="sentra-refresh-rules" style="background:#666;"><span class="dashicons dashicons-update" style="margin-top:2px;"></span> <?php echo esc_html__( 'Refresh', 'freelancebo-sentra-control' ); ?></button> 8 8 </div> 9 9 10 10 <div id="sentra-add-rule-form" style="display:none; background:#fff; padding:20px; border:1px solid #ddd; border-radius:8px; margin-bottom:20px;"> 11 <h3 style="margin-top:0;"> Aggiungi Regola</h3>11 <h3 style="margin-top:0;"><?php echo esc_html__( 'Add Rule', 'freelancebo-sentra-control' ); ?></h3> 12 12 <div class="sentra-form-row"> 13 13 <input type="text" id="sentra-rule-name" placeholder="Nome regola" style="flex:1;"> … … 21 21 <input type="text" id="sentra-rule-pattern" placeholder="Pattern regex (es: eval\s*\()" style="flex:1; font-family:monospace;"> 22 22 <select id="sentra-rule-action"> 23 <option value="block"> Blocca</option>24 <option value="log"> Solo Log</option>23 <option value="block"><?php echo esc_html__( 'Block', 'freelancebo-sentra-control' ); ?></option> 24 <option value="log"><?php echo esc_html__( 'Log Only', 'freelancebo-sentra-control' ); ?></option> 25 25 </select> 26 26 <input type="number" id="sentra-rule-priority" value="100" style="width:80px;" title="Priorità"> 27 27 </div> 28 28 <div class="sentra-form-row"> 29 <button class="sentra-btn sentra-btn-success" id="sentra-save-rule"> Salva Regola</button>30 <button class="sentra-btn" id="sentra-cancel-rule" style="background:#ccc; color:#333;"> Annulla</button>29 <button class="sentra-btn sentra-btn-success" id="sentra-save-rule"><?php echo esc_html__( 'Save Rule', 'freelancebo-sentra-control' ); ?></button> 30 <button class="sentra-btn" id="sentra-cancel-rule" style="background:#ccc; color:#333;"><?php echo esc_html__( 'Cancel', 'freelancebo-sentra-control' ); ?></button> 31 31 </div> 32 32 </div> … … 34 34 <table class="sentra-table" id="sentra-rules-table"> 35 35 <thead> 36 <tr><th> Nome</th><th>Tipo</th><th>Pattern</th><th>Azione</th><th>Priorità</th><th>Origine</th><th></th></tr>36 <tr><th><?php echo esc_html__( 'Name', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Type', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Pattern', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Action', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Priority', 'freelancebo-sentra-control' ); ?></th><th><?php echo esc_html__( 'Source', 'freelancebo-sentra-control' ); ?></th><th></th></tr> 37 37 </thead> 38 <tbody><tr><td colspan="7" class="sentra-loading"> Caricamento...</td></tr></tbody>38 <tbody><tr><td colspan="7" class="sentra-loading"><?php echo esc_html__( 'Loading...', 'freelancebo-sentra-control' ); ?></td></tr></tbody> 39 39 </table> 40 40 </div> -
freelancebo-sentra-control/trunk/admin/views/scans.php
r3485648 r3485668 4 4 ?> 5 5 <div class="wrap sentra-wrap"> 6 <h1><span class="dashicons dashicons-shield"></span> Scansioni Sicurezza</h1>6 <h1><span class="dashicons dashicons-shield"></span> <?php echo esc_html__( 'Security Scans', 'freelancebo-sentra-control' ); ?></h1> 7 7 8 8 <div id="sentra-scan-progress" style="display:none;" class="sentra-progress-bar"> 9 9 <span class="spinner is-active" style="float:none; margin:0 8px 0 0;"></span> 10 <strong id="sentra-scan-progress-text"> Scansione in corso...</strong>10 <strong id="sentra-scan-progress-text"><?php echo esc_html__( 'Scanning...', 'freelancebo-sentra-control' ); ?></strong> 11 11 </div> 12 12 … … 15 15 <div class="sentra-auto-scan-config" style="margin-bottom:20px; background:#f8fafc; border:1px solid #e2e8f0; border-radius:8px; padding:16px; display:flex; align-items:center; gap:16px; flex-wrap:wrap;"> 16 16 <span class="dashicons dashicons-clock" style="font-size:20px; color:#7c3aed;"></span> 17 <strong style="color:#1e293b;"> Scansione automatica giornaliera:</strong>17 <strong style="color:#1e293b;"><?php echo esc_html__( 'Daily automatic scan:', 'freelancebo-sentra-control' ); ?></strong> 18 18 <select id="sentra-auto-scan-type" style="padding:6px 12px; border:1px solid #cbd5e1; border-radius:6px; font-size:14px;"> 19 <option value=""> Disattivata</option>20 <option value="vulnerability"> Vulnerabilità</option>21 <option value="malware"> Malware</option>22 <option value="integrity"> Integrità</option>19 <option value=""><?php echo esc_html__( 'Disabled', 'freelancebo-sentra-control' ); ?></option> 20 <option value="vulnerability"><?php echo esc_html__( 'Vulnerabilities', 'freelancebo-sentra-control' ); ?></option> 21 <option value="malware"><?php echo esc_html__( 'Malware', 'freelancebo-sentra-control' ); ?></option> 22 <option value="integrity"><?php echo esc_html__( 'Integrity', 'freelancebo-sentra-control' ); ?></option> 23 23 </select> 24 24 <span id="sentra-auto-scan-status" style="font-size:13px; color:#6b7280;"></span> 25 25 <span style="flex:1;"></span> 26 <span style="font-size:12px; color:#9ca3af;"> Max 1 scansione al giorno per sito</span>26 <span style="font-size:12px; color:#9ca3af;"><?php echo esc_html__( 'Max 1 scan per day per site', 'freelancebo-sentra-control' ); ?></span> 27 27 </div> 28 28 <!-- Main Tabs --> 29 29 <div class="sentra-main-tabs"> 30 30 <button class="sentra-main-tab active" data-tab="vulnerability"> 31 <span class="dashicons dashicons-shield"></span> Vulnerabilità31 <span class="dashicons dashicons-shield"></span> <?php echo esc_html__( 'Vulnerabilities', 'freelancebo-sentra-control' ); ?> 32 32 <span class="sentra-main-tab-count" id="sentra-vuln-count"></span> 33 33 </button> 34 34 <button class="sentra-main-tab" data-tab="malware"> 35 <span class="dashicons dashicons-warning"></span> Malware35 <span class="dashicons dashicons-warning"></span> <?php echo esc_html__( 'Malware', 'freelancebo-sentra-control' ); ?> 36 36 <span class="sentra-main-tab-count" id="sentra-malware-count"></span> 37 37 </button> 38 38 <button class="sentra-main-tab" data-tab="integrity"> 39 <span class="dashicons dashicons-yes-alt"></span> Integrità39 <span class="dashicons dashicons-yes-alt"></span> <?php echo esc_html__( 'Integrity', 'freelancebo-sentra-control' ); ?> 40 40 <span class="sentra-main-tab-count" id="sentra-integrity-count"></span> 41 41 </button> … … 46 46 <div class="sentra-panel-header"> 47 47 <div class="sentra-panel-info"> 48 <span class="sentra-panel-label"> Ultima scansione:</span>49 <strong><?php echo esc_html(get_option('sentra_last_vuln_scan', 'Mai')); ?></strong>48 <span class="sentra-panel-label"><?php echo esc_html__( 'Last scan:', 'freelancebo-sentra-control' ); ?></span> 49 <strong><?php echo esc_html(get_option('sentra_last_vuln_scan', __( 'Never', 'freelancebo-sentra-control' ))); ?></strong> 50 50 </div> 51 51 <div class="sentra-actions"> 52 <label class="sentra-toggle-resolved"><input type="checkbox" id="sentra-show-resolved-vuln"> Mostra risolti</label>53 <button class="sentra-btn" id="sentra-scan-vuln" style="background:#7c3aed; color:#fff;"><span class="dashicons dashicons-shield" style="margin-top:2px;"></span> Avvia Scansione</button>52 <label class="sentra-toggle-resolved"><input type="checkbox" id="sentra-show-resolved-vuln"> <?php echo esc_html__( 'Show resolved', 'freelancebo-sentra-control' ); ?></label> 53 <button class="sentra-btn" id="sentra-scan-vuln" style="background:#7c3aed; color:#fff;"><span class="dashicons dashicons-shield" style="margin-top:2px;"></span> <?php echo esc_html__( 'Start Scan', 'freelancebo-sentra-control' ); ?></button> 54 54 </div> 55 55 </div> … … 61 61 <div class="sentra-panel-header"> 62 62 <div class="sentra-panel-info"> 63 <span class="sentra-panel-label"> Ultima scansione:</span>64 <strong><?php echo esc_html(get_option('sentra_last_malware_scan', 'Mai')); ?></strong>63 <span class="sentra-panel-label"><?php echo esc_html__( 'Last scan:', 'freelancebo-sentra-control' ); ?></span> 64 <strong><?php echo esc_html(get_option('sentra_last_malware_scan', __( 'Never', 'freelancebo-sentra-control' ))); ?></strong> 65 65 </div> 66 66 <div class="sentra-actions"> 67 <label class="sentra-toggle-resolved"><input type="checkbox" id="sentra-show-resolved-malware"> Mostra risolti</label>68 <button class="sentra-btn sentra-btn-danger" id="sentra-scan-malware"><span class="dashicons dashicons-warning" style="margin-top:2px;"></span> Avvia Scansione</button>67 <label class="sentra-toggle-resolved"><input type="checkbox" id="sentra-show-resolved-malware"> <?php echo esc_html__( 'Show resolved', 'freelancebo-sentra-control' ); ?></label> 68 <button class="sentra-btn sentra-btn-danger" id="sentra-scan-malware"><span class="dashicons dashicons-warning" style="margin-top:2px;"></span> <?php echo esc_html__( 'Start Scan', 'freelancebo-sentra-control' ); ?></button> 69 69 </div> 70 70 </div> … … 76 76 <div class="sentra-panel-header"> 77 77 <div class="sentra-panel-info"> 78 <span class="sentra-panel-label"> Ultima verifica:</span>79 <strong><?php echo esc_html(get_option('sentra_last_integrity_scan', 'Mai')); ?></strong>78 <span class="sentra-panel-label"><?php echo esc_html__( 'Last check:', 'freelancebo-sentra-control' ); ?></span> 79 <strong><?php echo esc_html(get_option('sentra_last_integrity_scan', __( 'Never', 'freelancebo-sentra-control' ))); ?></strong> 80 80 </div> 81 81 <div class="sentra-actions"> 82 <label class="sentra-toggle-resolved"><input type="checkbox" id="sentra-show-resolved-integrity"> Mostra risolti</label>83 <button class="sentra-btn sentra-btn-primary" id="sentra-scan-integrity"><span class="dashicons dashicons-yes-alt" style="margin-top:2px;"></span> Avvia Verifica</button>82 <label class="sentra-toggle-resolved"><input type="checkbox" id="sentra-show-resolved-integrity"> <?php echo esc_html__( 'Show resolved', 'freelancebo-sentra-control' ); ?></label> 83 <button class="sentra-btn sentra-btn-primary" id="sentra-scan-integrity"><span class="dashicons dashicons-yes-alt" style="margin-top:2px;"></span> <?php echo esc_html__( 'Start Check', 'freelancebo-sentra-control' ); ?></button> 84 84 </div> 85 85 </div> -
freelancebo-sentra-control/trunk/admin/views/settings.php
r3485648 r3485668 1 1 <?php if (!defined('ABSPATH')) exit; ?> 2 2 <div class="wrap"> 3 <h1><span class="dashicons dashicons-shield" style="font-size:30px;margin-right:8px;"></span> FreelanceBo Sentra Control - Impostazioni</h1>3 <h1><span class="dashicons dashicons-shield" style="font-size:30px;margin-right:8px;"></span> FreelanceBo Sentra Control - <?php echo esc_html__( 'Settings', 'freelancebo-sentra-control' ); ?></h1> 4 4 5 5 <form method="post" action="options.php"> … … 13 13 value="<?php echo esc_attr(get_option('sentra_server_url', '')); ?>" 14 14 class="regular-text" placeholder="https://your-server.com" /> 15 <p class="description"> URL del server FreelanceBo Sentra Control (HTTPS obbligatorio).</p>15 <p class="description"><?php echo esc_html__( 'FreelanceBo Sentra Control server URL (HTTPS required).', 'freelancebo-sentra-control' ); ?></p> 16 16 </td> 17 17 </tr> … … 22 22 value="<?php echo esc_attr(get_option('sentra_api_key', '')); ?>" 23 23 class="regular-text" /> 24 <p class="description"> Chiave API del sito (fornita dalla console).</p>24 <p class="description"><?php echo esc_html__( 'Site API key (provided by the console).', 'freelancebo-sentra-control' ); ?></p> 25 25 </td> 26 26 </tr> … … 34 34 placeholder="<?php echo $sentra_has_secret ? '••••••••••••••••' : ''; ?>" /> 35 35 <p class="description"> 36 Secret per la firma HMAC delle richieste.36 <?php echo esc_html__( 'Secret for HMAC request signing.', 'freelancebo-sentra-control' ); ?> 37 37 <?php if ($sentra_has_secret): ?> 38 <strong> Secret già configurato.</strong> Lascia vuoto per mantenerlo, oppure inserisci un nuovo valore per sostituirlo.38 <strong><?php echo esc_html__( 'Secret already configured.', 'freelancebo-sentra-control' ); ?></strong> <?php echo esc_html__( 'Leave blank to keep it, or enter a new value to replace it.', 'freelancebo-sentra-control' ); ?> 39 39 <?php endif; ?> 40 40 </p> … … 43 43 </table> 44 44 45 <?php submit_button( 'Salva Impostazioni'); ?>45 <?php submit_button( __( 'Save Settings', 'freelancebo-sentra-control' ) ); ?> 46 46 </form> 47 47 48 48 <?php if (get_option('sentra_api_key') && get_option('sentra_api_secret') && get_option('sentra_server_url')): ?> 49 49 <hr> 50 <h2> Test Connessione</h2>50 <h2><?php echo esc_html__( 'Test Connection', 'freelancebo-sentra-control' ); ?></h2> 51 51 <p> 52 <button type="button" class="button" id="sentra-test-connection"> Testa Connessione</button>52 <button type="button" class="button" id="sentra-test-connection"><?php echo esc_html__( 'Test Connection', 'freelancebo-sentra-control' ); ?></button> 53 53 <input type="hidden" id="sentra-test-nonce" value="<?php echo esc_attr(wp_create_nonce('sentra_test')); ?>" /> 54 54 <span id="sentra-test-result" style="margin-left:10px;"></span> -
freelancebo-sentra-control/trunk/admin/views/status.php
r3485648 r3485668 15 15 16 16 $sentra_configured = !empty(get_option('sentra_api_key')) && !empty(get_option('sentra_api_secret')) && !empty(get_option('sentra_server_url')); 17 $sentra_last_hb = get_option('sentra_last_heartbeat', 'Mai');18 $sentra_last_sync = get_option('sentra_last_sync', 'Mai');17 $sentra_last_hb = get_option('sentra_last_heartbeat', __( 'Never', 'freelancebo-sentra-control' )); 18 $sentra_last_sync = get_option('sentra_last_sync', __( 'Never', 'freelancebo-sentra-control' )); 19 19 $sentra_last_error = get_option('sentra_last_heartbeat_error', ''); 20 20 $sentra_rules_count = count(get_option('sentra_firewall_rules', [])); … … 22 22 ?> 23 23 <div class="wrap"> 24 <h1><span class="dashicons dashicons-shield" style="font-size:30px;margin-right:8px;"></span> FreelanceBo Sentra Control - Stato</h1>24 <h1><span class="dashicons dashicons-shield" style="font-size:30px;margin-right:8px;"></span> FreelanceBo Sentra Control - <?php echo esc_html__( 'Status', 'freelancebo-sentra-control' ); ?></h1> 25 25 26 26 <div class="card" style="max-width:600px;"> 27 <h2> Connessione</h2>27 <h2><?php echo esc_html__( 'Connection', 'freelancebo-sentra-control' ); ?></h2> 28 28 <table class="widefat striped"> 29 29 <tr> 30 <td><strong> Configurato</strong></td>30 <td><strong><?php echo esc_html__( 'Configured', 'freelancebo-sentra-control' ); ?></strong></td> 31 31 <td><?php echo $sentra_configured ? '<span style="color:green;">✔ Si</span>' : '<span style="color:red;">✘ No</span>'; ?></td> 32 32 </tr> 33 33 <tr> 34 <td><strong> Server URL</strong></td>34 <td><strong><?php echo esc_html__( 'Server URL', 'freelancebo-sentra-control' ); ?></strong></td> 35 35 <td><?php echo esc_html(get_option('sentra_server_url', '-')); ?></td> 36 36 </tr> 37 37 <tr> 38 <td><strong> Ultimo Heartbeat</strong></td>38 <td><strong><?php echo esc_html__( 'Last Heartbeat', 'freelancebo-sentra-control' ); ?></strong></td> 39 39 <td><?php echo esc_html($sentra_last_hb); ?></td> 40 40 </tr> 41 41 <tr> 42 <td><strong> Ultima Sincronizzazione</strong></td>42 <td><strong><?php echo esc_html__( 'Last Synchronization', 'freelancebo-sentra-control' ); ?></strong></td> 43 43 <td><?php echo esc_html($sentra_last_sync); ?></td> 44 44 </tr> 45 45 <?php if ($sentra_last_error): ?> 46 46 <tr> 47 <td><strong> Ultimo Errore</strong></td>47 <td><strong><?php echo esc_html__( 'Last Error', 'freelancebo-sentra-control' ); ?></strong></td> 48 48 <td style="color:red;"><?php echo esc_html($sentra_last_error); ?></td> 49 49 </tr> … … 53 53 54 54 <div class="card" style="max-width:600px;margin-top:20px;"> 55 <h2> Protezione</h2>55 <h2><?php echo esc_html__( 'Protection', 'freelancebo-sentra-control' ); ?></h2> 56 56 <table class="widefat striped"> 57 57 <tr> 58 <td><strong> Regole Firewall Attive</strong></td>58 <td><strong><?php echo esc_html__( 'Active Firewall Rules', 'freelancebo-sentra-control' ); ?></strong></td> 59 59 <td><?php echo intval($sentra_rules_count); ?></td> 60 60 </tr> 61 61 <tr> 62 <td><strong> IP Bloccati</strong></td>62 <td><strong><?php echo esc_html__( 'Blocked IPs', 'freelancebo-sentra-control' ); ?></strong></td> 63 63 <td><?php echo intval($sentra_blocked_count); ?></td> 64 64 </tr> 65 65 <tr> 66 <td><strong> Versione Plugin</strong></td>66 <td><strong><?php echo esc_html__( 'Plugin Version', 'freelancebo-sentra-control' ); ?></strong></td> 67 67 <td><?php echo esc_html(SENTRA_VERSION); ?></td> 68 68 </tr> 69 69 <tr> 70 <td><strong> Versione WordPress</strong></td>70 <td><strong><?php echo esc_html__( 'WordPress Version', 'freelancebo-sentra-control' ); ?></strong></td> 71 71 <td><?php global $wp_version; echo esc_html($wp_version); ?></td> 72 72 </tr> 73 73 <tr> 74 <td><strong> Versione PHP</strong></td>74 <td><strong><?php echo esc_html__( 'PHP Version', 'freelancebo-sentra-control' ); ?></strong></td> 75 75 <td><?php echo esc_html(phpversion()); ?></td> 76 76 </tr> … … 82 82 <?php wp_nonce_field('sentra_force_heartbeat'); ?> 83 83 <input type="hidden" name="sentra_action" value="force_heartbeat" /> 84 <button type="submit" class="button button-primary"> Invia Heartbeat Ora</button>84 <button type="submit" class="button button-primary"><?php echo esc_html__( 'Send Heartbeat Now', 'freelancebo-sentra-control' ); ?></button> 85 85 </form> 86 86 </div> -
freelancebo-sentra-control/trunk/freelancebo-sentra-control.php
r3485648 r3485668 4 4 * Plugin URI: https://freelancebo.it 5 5 * Description: WordPress security agent - connects to FreelanceBo Sentra Control central console for WAF, malware scanning, brute force protection, and file integrity monitoring. 6 * Version: 2.1. 46 * Version: 2.1.5 7 7 * Author: Freelancebo 8 8 * License: GPL-2.0-or-later … … 12 12 if (!defined('ABSPATH')) exit; 13 13 14 define("SENTRA_VERSION", "2.1. 4");14 define("SENTRA_VERSION", "2.1.5"); 15 15 define('SENTRA_PLUGIN_DIR', plugin_dir_path(__FILE__)); 16 16 define('SENTRA_PLUGIN_URL', plugin_dir_url(__FILE__)); 17 18 // Load translations 19 add_action( 'init', function() { 20 load_plugin_textdomain( 'freelancebo-sentra-control', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 21 }); 17 22 18 23 // Load classes … … 115 120 ); 116 121 // Dashboard submenu (same as parent) 117 $this->page_hooks['dashboard'] = add_submenu_page('sentra', 'Dashboard', 'Dashboard', 'manage_options', 'sentra', [$this, 'render_dashboard_page']);118 $this->page_hooks['events'] = add_submenu_page('sentra', 'Eventi', 'Eventi', 'manage_options', 'sentra-events', [$this, 'render_events_page']);119 $this->page_hooks['firewall'] = add_submenu_page('sentra', 'Firewall', 'Firewall', 'manage_options', 'sentra-firewall', [$this, 'render_firewall_page']);120 $this->page_hooks['blocklist'] = add_submenu_page('sentra', 'IP Blocklist', 'IP Blocklist', 'manage_options', 'sentra-blocklist', [$this, 'render_blocklist_page']);121 $this->page_hooks['scans'] = add_submenu_page('sentra', 'Scansioni', 'Scansioni', 'manage_options', 'sentra-scans', [$this, 'render_scans_page']);122 $this->page_hooks['settings'] = add_submenu_page('sentra', 'Impostazioni', 'Impostazioni', 'manage_options', 'sentra-settings', [$this, 'render_settings_page']);122 $this->page_hooks['dashboard'] = add_submenu_page('sentra', 'Dashboard', __( 'Dashboard', 'freelancebo-sentra-control' ), 'manage_options', 'sentra', [$this, 'render_dashboard_page']); 123 $this->page_hooks['events'] = add_submenu_page('sentra', __( 'Events', 'freelancebo-sentra-control' ), __( 'Events', 'freelancebo-sentra-control' ), 'manage_options', 'sentra-events', [$this, 'render_events_page']); 124 $this->page_hooks['firewall'] = add_submenu_page('sentra', __( 'Firewall', 'freelancebo-sentra-control' ), __( 'Firewall', 'freelancebo-sentra-control' ), 'manage_options', 'sentra-firewall', [$this, 'render_firewall_page']); 125 $this->page_hooks['blocklist'] = add_submenu_page('sentra', __( 'IP Blocklist', 'freelancebo-sentra-control' ), __( 'IP Blocklist', 'freelancebo-sentra-control' ), 'manage_options', 'sentra-blocklist', [$this, 'render_blocklist_page']); 126 $this->page_hooks['scans'] = add_submenu_page('sentra', __( 'Scans', 'freelancebo-sentra-control' ), __( 'Scans', 'freelancebo-sentra-control' ), 'manage_options', 'sentra-scans', [$this, 'render_scans_page']); 127 $this->page_hooks['settings'] = add_submenu_page('sentra', __( 'Settings', 'freelancebo-sentra-control' ), __( 'Settings', 'freelancebo-sentra-control' ), 'manage_options', 'sentra-settings', [$this, 'render_settings_page']); 123 128 } 124 129 … … 137 142 $url = esc_url_raw($url); 138 143 if (!empty($url) && strpos($url, 'https://') !== 0) { 139 add_settings_error('sentra_server_url', 'invalid_url', 'Il Server URL deve usare HTTPS.');144 add_settings_error('sentra_server_url', 'invalid_url', __( 'Server URL must use HTTPS.', 'freelancebo-sentra-control' )); 140 145 return get_option('sentra_server_url', ''); 141 146 } … … 151 156 check_ajax_referer('sentra_test', '_wpnonce'); 152 157 if (!current_user_can('manage_options')) { 153 wp_send_json_error( 'Non autorizzato');158 wp_send_json_error( __( 'Unauthorized', 'freelancebo-sentra-control' ) ); 154 159 } 155 160 156 161 if (!$this->api_client->is_configured()) { 157 wp_send_json_error( 'Server URL o chiavi API non configurate');162 wp_send_json_error( __( 'Server URL or API keys not configured', 'freelancebo-sentra-control' ) ); 158 163 } 159 164 … … 168 173 $heartbeat = new Sentra_Heartbeat($this->api_client); 169 174 $heartbeat->send_heartbeat(); 170 wp_send_json_success( 'Connessione riuscita!');175 wp_send_json_success( __( 'Connection successful!', 'freelancebo-sentra-control' ) ); 171 176 } else { 172 wp_send_json_error( 'Risposta inattesa dal server');177 wp_send_json_error( __( 'Unexpected response from server', 'freelancebo-sentra-control' ) ); 173 178 } 174 179 } … … 270 275 public function ajax_run_scan() { 271 276 check_ajax_referer('sentra_admin', '_nonce'); 272 if (!current_user_can('manage_options')) wp_send_json_error( 'Non autorizzato');273 if (!$this->is_configured()) wp_send_json_error( 'Plugin non configurato');277 if (!current_user_can('manage_options')) wp_send_json_error( __( 'Unauthorized', 'freelancebo-sentra-control' ) ); 278 if (!$this->is_configured()) wp_send_json_error( __( 'Plugin not configured', 'freelancebo-sentra-control' ) ); 274 279 275 280 $scan_type = sanitize_text_field(wp_unslash($_POST['scan_type'] ?? 'malware')); 276 281 $valid_types = ['malware', 'integrity', 'vulnerability']; 277 282 if (!in_array($scan_type, $valid_types, true)) { 278 wp_send_json_error( 'Tipo scansione non valido');283 wp_send_json_error( __( 'Invalid scan type', 'freelancebo-sentra-control' ) ); 279 284 } 280 285 … … 285 290 $scanner->run_scan(); 286 291 wp_send_json_success([ 287 'message' => 'Scansione malware completata',292 'message' => __( 'Malware scan completed', 'freelancebo-sentra-control' ), 288 293 'findings' => intval(get_option('sentra_last_malware_findings', 0)), 289 294 ]); … … 292 297 $integrity->run_scan(); 293 298 wp_send_json_success([ 294 'message' => 'Verifica integrita completata',299 'message' => __( 'Integrity check completed', 'freelancebo-sentra-control' ), 295 300 'changes' => intval(get_option('sentra_last_integrity_changes', 0)), 296 301 ]); … … 299 304 $findings = $vuln->run_scan(); 300 305 wp_send_json_success([ 301 'message' => 'Scansione vulnerabilita completata',306 'message' => __( 'Vulnerability scan completed', 'freelancebo-sentra-control' ), 302 307 'findings' => count($findings), 303 308 ]); … … 307 312 public function ajax_resolve_finding() { 308 313 check_ajax_referer('sentra_admin', '_nonce'); 309 if (!current_user_can('manage_options')) wp_send_json_error( 'Non autorizzato');314 if (!current_user_can('manage_options')) wp_send_json_error( __( 'Unauthorized', 'freelancebo-sentra-control' ) ); 310 315 311 316 $check_id = sanitize_text_field(wp_unslash($_POST['check_id'] ?? '')); 312 317 $action = sanitize_text_field(wp_unslash($_POST['resolve_action'] ?? 'resolve')); 313 318 314 if (empty($check_id)) wp_send_json_error( 'ID mancante');315 if (!in_array($action, ['resolve', 'unresolve'], true)) wp_send_json_error( 'Azione non valida');319 if (empty($check_id)) wp_send_json_error( __( 'ID missing', 'freelancebo-sentra-control' ) ); 320 if (!in_array($action, ['resolve', 'unresolve'], true)) wp_send_json_error( __( 'Invalid action', 'freelancebo-sentra-control' ) ); 316 321 317 322 $resolved = get_option('sentra_resolved_findings', []); … … 333 338 public function ajax_set_auto_scan() { 334 339 check_ajax_referer('sentra_admin', '_nonce'); 335 if (!current_user_can('manage_options')) wp_send_json_error( 'Non autorizzato');336 if (!$this->is_configured()) wp_send_json_error( 'Plugin non configurato');340 if (!current_user_can('manage_options')) wp_send_json_error( __( 'Unauthorized', 'freelancebo-sentra-control' ) ); 341 if (!$this->is_configured()) wp_send_json_error( __( 'Plugin not configured', 'freelancebo-sentra-control' ) ); 337 342 338 343 $scan_type = sanitize_text_field(wp_unslash($_POST['auto_scan_type'] ?? '')); 339 344 $valid = ['', 'vulnerability', 'malware', 'integrity']; 340 if (!in_array($scan_type, $valid, true)) wp_send_json_error( 'Tipo non valido');345 if (!in_array($scan_type, $valid, true)) wp_send_json_error( __( 'Invalid type', 'freelancebo-sentra-control' ) ); 341 346 342 347 update_option('sentra_auto_scan_type', $scan_type); … … 350 355 } 351 356 352 wp_send_json_success(['auto_scan_type' => $scan_type, 'message' => 'Impostazione salvata']);357 wp_send_json_success(['auto_scan_type' => $scan_type, 'message' => __( 'Setting saved', 'freelancebo-sentra-control' )]); 353 358 } 354 359 … … 359 364 public function ajax_api_proxy() { 360 365 check_ajax_referer('sentra_admin', '_nonce'); 361 if (!current_user_can('manage_options')) wp_send_json_error( 'Non autorizzato');366 if (!current_user_can('manage_options')) wp_send_json_error( __( 'Unauthorized', 'freelancebo-sentra-control' ) ); 362 367 363 368 $method = strtoupper(sanitize_text_field(wp_unslash($_POST['method'] ?? 'GET'))); … … 372 377 } 373 378 374 if (empty($path)) wp_send_json_error( 'Path mancante');379 if (empty($path)) wp_send_json_error( __( 'Path missing', 'freelancebo-sentra-control' ) ); 375 380 376 381 // Validate HTTP method 377 382 if (!in_array($method, ['GET', 'POST', 'PUT', 'DELETE'], true)) { 378 wp_send_json_error( 'Metodo non consentito');383 wp_send_json_error( __( 'Method not allowed', 'freelancebo-sentra-control' ) ); 379 384 } 380 385 … … 382 387 // Also block path traversal sequences 383 388 if (strpos($path, '..') !== false) { 384 wp_send_json_error( 'Path non valido');389 wp_send_json_error( __( 'Invalid path', 'freelancebo-sentra-control' ) ); 385 390 } 386 391 … … 393 398 } 394 399 if (!$allowed) { 395 wp_send_json_error( 'Path non consentito');400 wp_send_json_error( __( 'Path not allowed', 'freelancebo-sentra-control' ) ); 396 401 } 397 402 -
freelancebo-sentra-control/trunk/includes/class-sentra-api-client.php
r3485648 r3485668 18 18 public function request($method, $path, $body = null) { 19 19 if (empty($this->server_url)) { 20 return ['error' => 'Server URL non configurato'];20 return ['error' => __( 'Server URL not configured', 'freelancebo-sentra-control' )]; 21 21 } 22 22 if (strpos($path, '..') !== false) { 23 return ['error' => 'Path non valido'];23 return ['error' => __( 'Invalid path', 'freelancebo-sentra-control' )]; 24 24 } 25 25 $url = $this->server_url . $path; -
freelancebo-sentra-control/trunk/readme.txt
r3485648 r3485668 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 2.1. 47 Stable tag: 2.1.5 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 74 74 75 75 == Changelog == 76 77 = 2.1.5 = 78 * Added full internationalization (i18n) support 79 * Added Italian translation (it_IT) 80 * All user-facing strings are now translatable 81 * Added languages/ directory with .pot and .mo files 82 83 = 2.1.5 = 84 * Added full internationalization (i18n) support with Italian translation 76 85 77 86 = 2.1.4 =
Note: See TracChangeset
for help on using the changeset viewer.