@@ -895,12 +895,9 @@ private function extractHandlers( array $flow ): string {
895895 /**
896896 * Extract a concise config summary from flow handler configs.
897897 *
898- * Shows the key distinguishing config per handler type:
899- * - ticketmaster: coordinates + radius
900- * - dice_fm: city name
901- * - universal_web_scraper / web_scraper: source URL or venue name
902- * - rss: feed URL
903- * - upsert_event: location taxonomy term
898+ * Domain-agnostic: reads raw config values without assuming any
899+ * specific taxonomy, handler, or post type. Surfaces distinguishing
900+ * values like coordinates, city names, URLs, and taxonomy selections.
904901 *
905902 * @param array $flow Flow data.
906903 * @return string Config summary (max ~60 chars).
@@ -912,62 +909,55 @@ private function extractConfigSummary( array $flow ): string {
912909 foreach ( $ flow_config as $ step_data ) {
913910 $ handler_configs = $ step_data ['handler_configs ' ] ?? array ();
914911
915- foreach ( $ handler_configs as $ handler_slug => $ hconfig ) {
916- switch ( $ handler_slug ) {
917- case 'ticketmaster ' :
918- $ loc = $ hconfig ['location ' ] ?? '' ;
919- $ rad = $ hconfig ['radius ' ] ?? '' ;
920- if ( $ loc ) {
921- $ parts [] = $ loc . ( $ rad ? " r= {$ rad }" : '' );
922- }
923- break ;
912+ foreach ( $ handler_configs as $ hconfig ) {
913+ if ( ! is_array ( $ hconfig ) ) {
914+ continue ;
915+ }
924916
925- case 'dice_fm ' :
926- $ city = $ hconfig ['city ' ] ?? '' ;
927- if ( $ city ) {
928- $ parts [] = "city= {$ city }" ;
929- }
930- break ;
931-
932- case 'universal_web_scraper ' :
933- case 'web_scraper ' :
934- $ url = $ hconfig ['source_url ' ] ?? '' ;
935- $ name = $ hconfig ['venue_name ' ] ?? '' ;
936- if ( $ name ) {
937- $ parts [] = $ name ;
938- } elseif ( $ url ) {
939- // Show just the domain.
940- $ host = wp_parse_url ( $ url , PHP_URL_HOST );
941- $ parts [] = $ host ?: $ url ;
942- }
943- break ;
917+ // Coordinates (location field with lat,lon).
918+ if ( ! empty ( $ hconfig ['location ' ] ) && strpos ( $ hconfig ['location ' ], ', ' ) !== false ) {
919+ $ loc = $ hconfig ['location ' ];
920+ $ rad = $ hconfig ['radius ' ] ?? '' ;
921+ $ parts [] = $ loc . ( $ rad ? " r= {$ rad }" : '' );
922+ }
944923
945- case 'rss ' :
946- $ url = $ hconfig ['feed_url ' ] ?? $ hconfig ['url ' ] ?? '' ;
947- if ( $ url ) {
948- $ host = wp_parse_url ( $ url , PHP_URL_HOST );
949- $ parts [] = $ host ?: $ url ;
950- }
951- break ;
952-
953- case 'upsert_event ' :
954- $ loc_term = $ hconfig ['taxonomy_location_selection ' ] ?? '' ;
955- if ( $ loc_term && is_numeric ( $ loc_term ) ) {
956- $ term = get_term ( (int ) $ loc_term , 'location ' );
957- if ( $ term && ! is_wp_error ( $ term ) ) {
958- $ parts [] = "loc= {$ term ->name }" ;
959- }
960- } elseif ( $ loc_term && 'skip ' !== $ loc_term && 'ai_decides ' !== $ loc_term ) {
961- $ parts [] = "loc= {$ loc_term }" ;
924+ // City name.
925+ if ( ! empty ( $ hconfig ['city ' ] ) ) {
926+ $ parts [] = "city= {$ hconfig ['city ' ]}" ;
927+ }
928+
929+ // Source URL — show domain only.
930+ if ( ! empty ( $ hconfig ['source_url ' ] ) ) {
931+ $ host = wp_parse_url ( $ hconfig ['source_url ' ], PHP_URL_HOST );
932+ $ parts [] = $ host ?: $ hconfig ['source_url ' ];
933+ }
934+
935+ // Venue/source name.
936+ if ( ! empty ( $ hconfig ['venue_name ' ] ) ) {
937+ $ parts [] = $ hconfig ['venue_name ' ];
938+ }
939+
940+ // Feed URL — show domain only.
941+ $ feed_url = $ hconfig ['feed_url ' ] ?? $ hconfig ['url ' ] ?? '' ;
942+ if ( $ feed_url && empty ( $ hconfig ['source_url ' ] ) ) {
943+ $ host = wp_parse_url ( $ feed_url , PHP_URL_HOST );
944+ $ parts [] = $ host ?: $ feed_url ;
945+ }
946+
947+ // Taxonomy term selections (any taxonomy_*_selection key).
948+ foreach ( $ hconfig as $ key => $ val ) {
949+ if ( strpos ( $ key , 'taxonomy_ ' ) === 0 && strpos ( $ key , '_selection ' ) !== false ) {
950+ if ( ! empty ( $ val ) && 'skip ' !== $ val && 'ai_decides ' !== $ val ) {
951+ $ tax_name = str_replace ( array ( 'taxonomy_ ' , '_selection ' ), '' , $ key );
952+ $ parts [] = "{$ tax_name }= {$ val }" ;
962953 }
963- break ;
954+ }
964955 }
965956 }
966957 }
967958
968959 $ summary = implode ( ' | ' , array_unique ( $ parts ) );
969960
970- // Truncate if too long.
971961 if ( mb_strlen ( $ summary ) > 60 ) {
972962 $ summary = mb_substr ( $ summary , 0 , 57 ) . '... ' ;
973963 }
0 commit comments