Custom WordPress plugin no longer retrieves collections

Hi all,

I am new to a web development project for WordPress. The site was developed by some other folks. They developed a custom Zotero plugin that uses the Custom Fields option to retrieve collections from the Zotero library via the following:

The word 'zotero' is provided as the key, and the collection key (found at the end of the URL, e.g., (https://www.zotero.org/groups/connecticuthistory/items/collectionKey/BJH4WZEZ)) as the value. The plugin then brings in the categorized sub-collections as references at the bottom of the post where the custom field is used.

Inexplicably, the references have disappeared on all of the posts as of a few days ago. We have not updated WordPress or any plugins, and have not installed any new plugins. We have not altered any code in the templates either that would have affected the PHP that adds the references. We are running WordPress 4.1.1.

The issue is appearing on our dev site and the live site. I have restored the dev site to its state on Monday via the WPEngine backup, and the references are still missing, which leads me to believe that it is an issue with the way the plugin retrieves the collection from Zotero. Since we have not altered anything on our end, the only logical conclusion I can come to is that something has changed with Zotero.

Does anyone have suggestions as to what might be going on - has Zotero rolled out any updates this week?
  • Or if you're referring to a 403 for a request without an API key, it's because the group has 'libraryReading' set to 'members' instead of 'all'. Those were previously available to anonymous users via the API — though they weren't shown on the website — and we fixed that this week.
  • edited March 19, 2015
    Thanks for the suggestions.. after looking through the plugin a little more closely it appears that whoever developed it used a transparent proxy to access the Zotero collections instead of an API. The code comments say //act as transparent proxy until JS lib can make requests directly to api which leads me to believe it was developed before API requests could be made ?? Regardlesss, I am really hesitant to change anything related to the way collections are requested without knowing how it all works fully.

    Either way, this is the first interaction I've ever had with Zotero development and associated libraries. Does anyone have suggestions for where I might find PHP or JS examples of API requests to collections?
  • The API docs have both sample requests and links to various API libraries for Zotero:
    https://www.zotero.org/support/dev/web_api/v3/start
  • If the change dstillman referenced is actually the issue, and the library is not actually private (since the output is a public website) you could just change the Zotero library to be publicly readable.
  • Also, that proxy comment is from libZotero, but I was under the impression that connecticuthistory.org made requests from PHP, which shouldn't need that functionality.
  • edited March 19, 2015
    Ok, I just changed the Library Reading setting to "Anyone on the Internet" from "Any Group Member" and the references all appear again at the bottom of the posts - so that fixed it! Thank you Dan and fcheslack.

    I'll have to make sure that it's ok for the library to be publicly visible but I don't think that should be a problem. A much easier fix!

    If there is a need to redo the request code I will check out the documentation that Adam provided, thanks.

    Sorry, just realized I posted under a different profile. Thanks for the help everyone.
  • fcheslack, I'll have to take another look and see. There's not much documentation so I've spent quite awhile trying to figure out where all the variables are and what they are referencing.

This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.

Sign In or Register to comment.