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

Parsely integration not compatible with wp-parsely 3.17 #281

Open
dlh01 opened this issue Jan 27, 2025 · 3 comments
Open

Parsely integration not compatible with wp-parsely 3.17 #281

dlh01 opened this issue Jan 27, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@dlh01
Copy link
Member

dlh01 commented Jan 27, 2025

Description of the bug

The "Show Trending Content from Parsely" option in the query block does not work correctly with version 3.17 of the Parsely plugin. It looks like the Analytics_Posts_API class, which the integration depends on, was removed in that version (see Parsely/wp-parsely#2889).

Steps To Reproduce

Configure a WP Curate query block with "Show Trending Content from Parsely" enabled and no other parameters, and observe that the block displays a reverse-chron list of posts.

Additional Information

No response

@dlh01 dlh01 added the bug Something isn't working label Jan 27, 2025
@kevinfodness
Copy link
Member

Looks like the class was replaced with Parsely\Services\Content_API\Content_API_Service. It seems like we might need to do the following instead of creating a new instance of Analytics_Posts_API:

$parsely_content_api = $GLOBALS['parsely']->get_content_api();
$parsely_content_api->get_posts( /* args */ );

@kevinfodness
Copy link
Member

Also, we should ensure we support both v3.16 and below as well as v3.17 and above, so we should try to use the get_content_api method first, and if it doesn't exist, then fall back to the Analytics_Posts_API method that we were using previously, or switch to making the REST API call to Parse.ly directly, using the authentication information that the plugin provides.

@dlh01
Copy link
Member Author

dlh01 commented Jan 28, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants