0) ); foreach ( $terms as $term ) { if ( isset( $_POST['XMLGEN_' . $term->name] ) ) { creafilexml( $term->name ); echo '

'; printf( esc_html__( 'Il seguente file .xml è generato: %s', 'avcp' ), '' . esc_html( $term->name ) . '' ); echo "

"; break; } } } if ( isset( $_POST['avcp_reset_log_nonce'] ) && wp_verify_nonce( $_POST['avcp_reset_log_nonce'], 'avcp_reset_log_action' ) && isset( $_POST['AVCP-RESET-LOG'] ) ) { delete_option( 'anac_log' ); echo '

' . esc_html__( 'Log eliminati', 'avcp' ) . '

'; } } $basexmlurl = avcp_get_basexmlurl(); ?>







📖 | 💻
'avcp', 'posts_per_page' => -1, 'fields' => 'ids', 'post_status' => 'any', ) ); if ( ! empty( $post_ids ) ) { foreach ( $post_ids as $post_id ) { if ( !has_term( '', 'annirif', $post_id ) ) { $offending_posts[] = $post_id; } } } if ( count( $offending_posts ) > 0 ) { $message = sprintf( esc_html__( 'Ci sono %d gare registrate senza anno di riferimento da correggere!', 'avcp' ), number_format_i18n( count( $offending_posts ) ) ); echo '

' . esc_html( $message ) . '

'; echo '
    '; foreach ( $offending_posts as $id ) { $title_esc = esc_html( get_the_title( $id ) ); if ( !$title_esc ) { $title_esc = esc_html__( '(Nessun titolo)', 'avcp' ); } echo '
  • ' . $title_esc . '
  • '; } echo '
'; } $offending_ditte = array(); // Check for 'ditte' terms missing 'avcp_codice_fiscale' term meta and collect them $ditte_terms = get_terms( array( 'taxonomy' => 'ditte', 'hide_empty' => false, ) ); if ( ! is_wp_error( $ditte_terms ) && ! empty( $ditte_terms ) ) { foreach ( $ditte_terms as $dterm ) { $term_meta = get_option( "taxonomy_$dterm->term_id" ); $codice = ( is_array( $term_meta ) && isset( $term_meta['avcp_codice_fiscale'] ) ) ? $term_meta['avcp_codice_fiscale'] : ''; // Fallback: check term meta (standard WP storage) if ( empty( $codice ) ) { $codice = get_term_meta( $dterm->term_id, 'avcp_codice_fiscale', true ); } if ( empty( $codice ) ) { $offending_ditte[] = $dterm->term_id; } } } if ( ! empty( $offending_ditte ) && count( $offending_ditte ) > 0 ) { $msg2 = sprintf( esc_html__( 'Ci sono %d ditte senza codice fiscale da correggere!', 'avcp' ), number_format_i18n( count( $offending_ditte) ) ); echo '

' . esc_html( $msg2 ) . '

'; echo '
    '; foreach ( $offending_ditte as $id ) { $name_esc = esc_html( get_term( $id )->name ); if ( !$name_esc ) { $name_esc = esc_html__( '(Nessun nome)', 'avcp' ); } $link_esc = esc_url( get_edit_term_link( $id, 'ditte' ) ); echo '
  • ' . $name_esc . '
  • '; } echo '
'; } $terms = get_terms( 'annirif', array('hide_empty' => 0) ); ?>
name ) ); if ( ! $file_exists && $term->name < date('Y') - 2 ) { continue; } echo ''; echo ''; // XSD version if ( $term->name >= 2021 ) { $xsd_dir = '1_3'; $xsd_ver = 'v 1.3'; } elseif ( $term->name >= 2019 ) { $xsd_dir = '1_1'; $xsd_ver = 'v 1.1'; } else { $xsd_dir = '1_0'; $xsd_ver = 'v 1.0'; } // XSD validation echo ''; echo ''; // Software validation echo ''; // Generation date echo ''; // Action echo ''; echo ''; // XSD errors if ( $errors ) { echo ''; } } ?>
' . esc_html( $term->name ) . ' '; $errors = false; if ( $file_exists ) { $xml = new DOMDocument(); $xml->load( avcp_get_basexmlpath( $term->name ) ); if ( $xml->schemaValidate( ABSPATH . '/wp-content/plugins/avcp/includes/XSD/' . $xsd_dir . '/datasetAppaltiL190.xsd' ) ) { echo ''; } else { echo ''; $errors = libxml_get_errors(); } } echo '' . esc_html( $xsd_ver ) . ''; if ( $file_exists ) { $args = array( 'post_type' => 'avcp', 'tax_query' => array( array( 'taxonomy' => 'annirif', 'field' => 'name', 'terms' => $term->name, ), ), 'posts_per_page' => -1, ); $query = new WP_Query( $args ); $error = false; if ( $query->have_posts() ) { foreach ( $query->posts as $post ) { $datainizio = get_post_meta( $post->ID, 'avcp_data_inizio', true ); $datafine = get_post_meta( $post->ID, 'avcp_data_fine', true ); if ( empty( $datainizio ) || empty( $datafine ) ) { $error = true; echo '' . esc_html__( 'Errore campo data', 'avcp' ) . '
' . esc_html( get_the_title( $post->ID ) ) . '
'; } if ( strlen( get_the_title( $post->ID ) ) >= 250 ) { $error = true; echo '' . esc_html__( 'Titolo oltre 250 caratteri', 'avcp' ) . '
' . esc_html( get_the_title( $post->ID ) ) . '
'; } } } if ( ! $error ) { echo ''; } } echo '
' . ( $file_exists && filemtime( avcp_get_basexmlpath( $term->name ) ) ? esc_html( date( "d/m/Y H:i", filemtime( avcp_get_basexmlpath( $term->name ) ) ) ) : '-' ) . ''; if ( $term->name >= date('Y') - 2 ) { echo ''; } echo '
'; foreach ( $errors as $err ) { print esc_html( libxml_display_error( $err ) ); } libxml_clear_errors(); echo '

: OK'; } else { echo esc_html__( 'Presenza cartella /avcp', 'avcp' ) . ': NON TROVATA'; $system_ok = false; } echo '
'; if ( is_writable( $dir ) ) { echo esc_html__( 'Permessi scrittura cartella /avcp', 'avcp' ) . ': OK'; } else { echo esc_html__( 'Permessi scrittura cartella /avcp', 'avcp' ) . ': NON CORRISPONDENTI'; $system_ok = false; } echo '
'; if ( file_exists( $file ) ) { echo esc_html__( 'Presenza index.php /avcp', 'avcp' ) . ': OK'; } else { echo esc_html__( 'Presenza index.php /avcp', 'avcp' ) . ': NON TROVATO'; $system_ok = false; } echo '
'; $urlcheck = get_site_url() . '/avcp/index.php'; $agent = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; pt-pt) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27"; if ( is_callable( 'curl_init' ) ) { $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, $urlcheck ); curl_setopt( $ch, CURLOPT_USERAGENT, $agent ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_VERBOSE, false ); curl_setopt( $ch, CURLOPT_TIMEOUT, 5 ); curl_exec( $ch ); $httpcode = curl_getinfo( $ch, CURLINFO_HTTP_CODE ); curl_close( $ch ); if ( $httpcode == 200 ) { echo esc_html__( 'Test Accesso pubblico /avcp', 'avcp' ) . ': OK [200]'; } elseif ( $httpcode == 500 ) { echo esc_html__( 'Test Accesso pubblico /avcp', 'avcp' ) . ': ERRORE 500 ISE'; $headers = @get_headers( $urlcheck ); echo ' - ' . esc_html( @$headers[0] ); $system_ok = false; } else { echo esc_html__( 'Test Accesso pubblico /avcp', 'avcp' ) . ': ERRORE ' . esc_html( $httpcode ) . ''; $headers = @get_headers( $urlcheck ); echo ' - ' . esc_html( @$headers[0] ); $system_ok = false; } } else { echo esc_html__( 'Test Accesso pubblico /avcp', 'avcp' ) . ': CURL_INIT MANCANTE'; $system_ok = false; } if ( $system_ok ) { echo '


' . esc_html__( 'Nessun problema trovato.', 'avcp' ) . '
'; } else { echo '

' . esc_html__( 'Sono stati trovati alcuni problemi critici. Affinchè AVCP funzioni correttamente è necessario risolvere al più presto questi problemi.', 'avcp' ) . '

'; } ?>

array(), 'strong' => array(), 'em' => array(), 'a' => array( 'href' => array(), 'title' => array(), 'target' => array(), 'rel' => array(), ), 'br' => array(), ); echo '
' . wp_kses( $log, $allowed_tags ) . '
'; } else { echo '
' . esc_html__( 'Nessun log presente.', 'avcp' ) . '
'; } ?>

level ) { case LIBXML_ERR_WARNING: $return .= "Warning $error->code: "; break; case LIBXML_ERR_ERROR: $return .= "Error $error->code: "; break; case LIBXML_ERR_FATAL: $return .= "Fatal Error $error->code: "; break; } $return .= trim( $error->message ); if ( $error->file ) { $return .= " in $error->file"; } $return .= " on line $error->line"; return $return; } // Enable user error handling libxml_use_internal_errors( true ); ?>