// y hace diversos h2 con variaciones del título... sin cerrar el

*/ // Comprobar que contanga etiquetas HTML o será sospechoso // Es requisito que tenga contenido $longitud_minima = 200; if ( ! $contenido ) { $errores[] = __( 'No content generated.', 'ai-content-creator' ); } else { if ( strlen( $contenido ) <= $longitud_minima ) { $errores[] = __( 'Generated content is unusually short.', 'ai-content-creator' ); } if ( ! aicc_contiene_html( $contenido ) ) { $errores[] = __( 'Generated content does not appear to be an HTML document.', 'ai-content-creator' ); /* } else { $errores[] = __( 'Generated content appears to be an HTML document.', 'ai-content-creator' ); */ } } if ( aicc_modo_debug() ) { echo '[modo_debug] Errores:
'; echo '

' . nl2br( esc_html ( var_export( $errores, true ) ) ) . '
'; /* if ( ! $errores ) { $errores[] = __( 'No errors generated.', 'ai-content-creator' ); } */ } return $errores; } function aicc_advertencias_validacion_contenido( $contenido ) { // Devuelve un array con la lista de advertencias detectadas si los hubiera $advertencias = array (); if ( aicc_menciona_recursos_externos( $contenido ) ) { $advertencias[] = __( 'The content mentions external resources that have not been validated. Check their functionality manually or configure an external post-production system for validation.', 'ai-content-creator' ); } if ( aicc_modo_debug() ) { echo 'Advertencias:
'; echo '
' . nl2br( esc_html ( var_export( $advertencias, true ) ) ) . '
'; } return $advertencias; } function aicc_notificaciones_validacion_contenido( $contenido ) { // Devuelve un array con la lista de notificaciones generadas si los hubiera $notificaciones = array (); if ( $contenido ) { //$notificaciones[] = __( 'There is no external post-production system configured to validate the created HTML code.', 'ai-content-creator' ); } if ( aicc_modo_debug() ) { echo 'Notificaciones:
'; echo '
' . nl2br( esc_html ( var_export( $notificaciones, true ) ) ) . '
'; } return $notificaciones; } function aicc_validar_contenido_auto( $contenido ) { // Validar el contenido de un artículo automáticamente if ( aicc_errores_validacion_contenido( $contenido ) ) { $valida = 0; } else { $valida = 1; } return $valida; } function aicc_contiene_html( $contenido ) { $contiene_html = false; // str_contains requiere PHP 8 if ( str_contains( strtolower( $contenido ), '

' ) || str_contains( strtolower( $contenido ), '
' ) || str_contains( strtolower( $contenido ), '

' ) || str_contains( strtolower( $contenido ), '

' ) || str_contains( strtolower( $contenido ), '