d> $info The system information, as produced by the * default logic and previous filters. * * @return array The filtered system information. */ public static function filter_include_migration_in_system_info( array $info = [] ): array { $phase = tribe( State::class )->get_phase(); // String not translated on purpose. $incomplete_label = 'Incomplete'; $status_map = [ State::PHASE_MIGRATION_COMPLETE => 'Completed', // String not translated on purpose. State::PHASE_MIGRATION_NOT_REQUIRED => 'Not Required', // String not translated on purpose. ]; $migration_status = [ 'Custom Tables Migration Status' => ! empty( $phase ) && ! empty( $status_map[ $phase ] ) ? $status_map[ $phase ] : $incomplete_label, ]; // Prevents problems in case we don't have sys info. if ( empty( $info ) ) { return $migration_status; } $migration_status = static::filter_include_migration_health_check_info( $migration_status ); return Common::array_insert_before_key( 'Settings', $info, $migration_status ); } /** * Adds some health check reports to assist in troubleshooting. * * @since 6.0.9 * * @param array $info The report data to add our health check to. * * @return array The modified report data. */ public static function filter_include_migration_health_check_info( array $info = [] ): array { $issue_reports = []; $health_check = tribe( Health_Check::class ); // Check if we have flagged as "migrated" but we show a mismatch of data in our tables. if ( ! $health_check->is_event_data_healthy() ) { $issue_reports[] = "Missing `Event` Table Data"; } if ( ! $health_check->is_occurrence_data_healthy() ) { $issue_reports[] = "Missing `Occurrences` Table Data"; } if ( $health_check->is_event_table_missing() ) { $issue_reports[] = "`Event` Table Missing"; } if ( $health_check->is_occurrence_table_missing() ) { $issue_reports[] = "`Occurrences` Table Missing"; } $reports = empty( $issue_reports ) ? 'Good!' : implode( ' | ', $issue_reports ); // Add health checks here. $migration_health_check = [ 'Custom Tables Health Check' => $reports // If no bad reports, it's good. ]; return array_merge( $info, $migration_health_check ); } /** * Handles the feature deactivation. * * @since 6.0.0 */ public static function deactivate() { $services = tribe(); // @todo Should we drop the tables here, gracefully, if no data was generated? $services->make( Schema_Builder::class )->clean(); } }
Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class "TEC\Events\Custom_Tables\V1\Activation" not found in /htdocs/wp-includes/class-wp-hook.php:307 Stack trace: #0 /htdocs/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array) #1 /htdocs/wp-includes/plugin.php(476): WP_Hook->do_action(Array) #2 /htdocs/wp-settings.php(598): do_action('init') #3 /htdocs/wp-config.php(78): require_once('/htdocs/wp-sett...') #4 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #5 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #6 /htdocs/index.php(17): require('/htdocs/wp-blog...') #7 {main} thrown in /htdocs/wp-includes/class-wp-hook.php on line 307