diff --git a/amministrazionetrasparente.php b/amministrazionetrasparente.php index 976c7b6..57eb90d 100644 --- a/amministrazionetrasparente.php +++ b/amministrazionetrasparente.php @@ -3,7 +3,7 @@ Plugin Name: Amministrazione Trasparente Plugin URI: https://wordpress.org/plugins/amministrazione-trasparente/ Description: Soluzione completa per la pubblicazione online dei documenti ai sensi del D.lgs. n. 33 del 14/03/2013 -Version: 8.0.5 +Version: 8.0.10 Author: Marco Milesi Author Email: milesimarco@outlook.com Author URI: https://www.marcomilesi.com diff --git a/readme.txt b/readme.txt index 470637b..58c8e91 100644 --- a/readme.txt +++ b/readme.txt @@ -4,8 +4,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i Tags: amministrazione, aperta, trasparente, documenti, atti, spese, comuni, pa, amministrazioni, locali, pubblicazione, online, imprese, enti, scuola, università, comunità, montana, valle, modulo, software, gratuito, disposizioni, obbligo, legge, comune, modulo, decreto, 14 marzo, 2013, sovvenzioni, pubblici, pubblico, marco, milesi Requires at least: 4.2 Tested up to: 6.3 -Version: 8.0.5 -Stable tag: 8.0.5 +Version: 8.0.10 +Stable tag: 8.0.10 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -51,6 +51,10 @@ Puoi trovare la documentazione su [docs.wpgov.it](https://docs.wpgov.it/docs/cat == Changelog == > Questa è la lista completa di tutti gli aggiornamenti, test e correzioni. Ogni volta che una nuova versione viene rilasciata assicuratevi di aggiornare il prima possibile per usufruire delle ultime migliorie! += 8.0.10 20231003 = +* Corretto bug di mancata inizializzazione su nuove installazioni +* Correzioni e miglioramenti gestione impostazioni + = 8.0.5 20230830 = * Fixed security bug - CVSS 3.1 * Aggiunta data di ultima modifica nella lista amministrativa per il custom post type amm-trasparente diff --git a/settings.php b/settings.php index c136121..d212bf8 100644 --- a/settings.php +++ b/settings.php @@ -44,14 +44,24 @@ function at_setting_tabs( $id ) { at_setting_tabs( 2 ); echo '
'; - $e = filter_var_array( get_option('wpgov_at'), FILTER_SANITIZE_SPECIAL_CHARS); - print_r( $e ); + $a = get_option('wpgov_at'); + if ( is_array( $a ) ) { + $e = filter_var_array( get_option('wpgov_at'), FILTER_SANITIZE_SPECIAL_CHARS); + print_r( $e ); + } else { + echo 'Nessuna impostazione presente'; + } echo ''; echo '
'; - $e = filter_var_array( get_option('atGroupConf'), FILTER_SANITIZE_SPECIAL_CHARS); - print_r( $e ); - echo ''; + $a = get_option('atGroupConf'); + if ( is_array( $a ) ) { + $e = filter_var_array( $a, FILTER_SANITIZE_SPECIAL_CHARS); + print_r( $e ); + } else { + echo 'Nessuna configurazione presente'; + } + echo ''; } else if ( isset($_GET['at_action']) ) { @@ -73,7 +83,6 @@ function at_setting_tabs( $id ) { $selected_sections = array_merge( $selected_sections, $arrayTipologie ); $selected_sections_unique = array_unique( array_merge( $selected_sections, $arrayTipologie ) ); } - #array_walk_recursive( at_getGroupConf(), function($a) use ($selected_sections) { $selected_sections[] = $a; }); } $diff = array_diff_assoc($selected_sections, array_unique($selected_sections) ); @@ -92,11 +101,14 @@ function at_setting_tabs( $id ) { foreach( $atTerms as $term ) { if ( !in_array( $term->term_id, $selected_sections_unique ) ) { $alert_count .= '- '.esc_js($term->name) . '\n'; - $max = max( array_keys( $selected_sections_unique ) ); - $selected_sections_unique[ ++$max ] = $term->term_id; + if ( !empty( $selected_sections_unique) ) { + $max = max( array_keys( $selected_sections_unique ) ); + $selected_sections_unique[ ++$max ] = $term->term_id; + } + } } - $warning_count = '[Attenzione: '.(wp_count_terms( 'tipologie' ) - count( $selected_sections ) ).' tipologie non sono associate a un gruppo - Clicca qui per i dettagli]'; + $warning_count = '[Attenzione: '.(wp_count_terms( 'tipologie' ) - count( array_count_values( $selected_sections ) ) ).' tipologie non sono associate a un gruppo - Clicca qui per i dettagli]'; } else { $warning_count = '[OK]'; } @@ -122,8 +134,7 @@ function at_setting_tabs( $id ) { submit_button(); foreach ( at_get_taxonomy_groups() as $group ) { - echo '