Skip to content

API Restrictions Issue #1

Description

@petertwise

Currently Google API restrictions by IP are breaking the data fetch.

From @basscl 2025-01-30

I think the issue is that file_get_contents doesn't send referer.
If instead of

$gcal_raw = file_get_contents($gcal_url);
$gcal_raw = json_decode($gcal_raw);

we do

$args = array(
      'headers' => array(
        'referer' => site_url()
      )
    );
$gcal_raw = wp_remote_get( $gcal_url, $args );
$gcal_raw = isset( $gcal_raw['body'] ) ? json_decode( $gcal_raw['body'] ) : array();

Then we should be able to keep the API restrictions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions