Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier Setup #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions App/Api/TrufiApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public function query(string|array $query, string|array $variables = null): arra
if (is_wp_error($response)) {
return null;
} else {
$_responseCode = wp_remote_retrieve_response_code($response);
if ($_responseCode !== 200) {
throw new \Exception('Received API response ' . $_responseCode);
}
$_body = wp_remote_retrieve_body($response);
return json_decode($_body, true);
}
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ We are a non-profit NGO founded by a group of German and Bolivian volunteers in
2. Use the regular Wordpress plugin installation process to install the .zip file.
3. Navigate to Wordpress administration and then configuration.
4. Set the required values for this plugin, such as the Graphql server URL.
1. If your are using OpenTripPlanner v1, the Graphql URL might be something like `https://yourotp.example.com/otp/routers/default/index/graphql`
2. You need to create a new empty base page for the routes

## Testing

You can test if the plugin works by accessing the URL path `/wp-sitemap-routes-1.xml` of your page.

## Contributing

Expand Down