guard( 'manage_options', 'manage_woocommerce' ); if ( $check ) { return $check; } $all = wpcafe_extension()->get(); $modules = array_filter( $all, fn( $ext ) => 'module' === ( $ext['type'] ?? '' ) ); $result = []; foreach ( $modules as $key => $module ) { $result[] = [ 'key' => $key, 'title' => $module['title'] ?? $key, 'description' => $this->truncate( $module['description'] ?? '', 150 ), 'status' => $module['status'] ?? 'off', 'is_pro' => (bool) ( $module['is_pro'] ?? false ), 'parent' => $module['parent'] ?? null, ]; } return [ 'modules' => $result ]; } }