=== Scholar Sync ===
Contributors: researchdigitallabs
Tags: scholar, faculty, publications, academic, citations
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically sync and display publications and citation metrics for researchers, labs, or an entire faculty.

== Description ==

Scholar Sync helps universities, research labs, and academic departments publish and maintain scholarly work on their WordPress site. Set up a researcher's profile in a few clicks — publications and citation metrics are imported automatically and kept in sync without any manual effort.

**Display modes:**

* **Single researcher** — a full publication list with citation count, h-index, and i10-index for one author (`[scholar-sync-scholar]`)
* **Group** — display a lab, faculty, or any curated set of researchers, either as a combined publication feed or as an author grid/directory (`[scholar-sync-group]`)

**Key features:**

* Profile setup in a 3 clicks — publications imported automatically
* Background sync keeps publications and citation metrics current
* Supports co-authors and research groups
* Manual add/edit for authors and individual articles
* Live preview with configurable display options (header, search, citations)

**Shortcode examples:**

Display a single researcher's publications:

    [scholar-sync-scholar id="42"]

Hide the header and citation counts:

    [scholar-sync-scholar id="42" header="0" cited-by="0"]

Display a group (a lab/faculty feed or a curated author directory):

    [scholar-sync-group id="12"]

**External services:**

This plugin communicates with the **scholar-sync.org** service to retrieve scholarly profile data (articles, citations, h-index) using the OpenAlex academic data source.

* Service URL: https://scholar-sync.org
* Terms of Service: https://scholar-sync.org/terms
* Privacy Policy: https://scholar-sync.org/privacy

Data sent to this service includes: the researcher's OpenAlex author ID (or name used to find the profile), your site ID (used to identify your installation), and the requested page/article range. No personal data of your site visitors is transmitted.

The plugin itself does not restrict or gate any built-in functionality. All sync frequency and quota limits are enforced entirely by the scholar-sync.org service and communicated back to the plugin as service responses.

This plugin also uses the **Freemius** licensing SDK to manage plan status and plugin updates. Freemius may receive your site URL, admin email, and WordPress/PHP environment details.

* Freemius Terms: https://freemius.com/terms/
* Freemius Privacy Policy: https://freemius.com/privacy/

== Installation ==

1. Upload the `scholar-sync` folder to the `/wp-content/plugins/` directory, or install via the WordPress plugin screen.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Navigate to **Scholars** in the WordPress admin menu.
4. Click **Add New** and enter a researcher's first and last name.
5. Click "Add" on the relevant profile in the search results.
6. The complete researcher profile with publication and co-authors will be created and previewed.
7. Click to create a page or copy shortcode to any post, page, or widget.

== Frequently Asked Questions ==

= Can I add authors manually without using the sync service? =

Yes. On the Add New screen, click **Add Manually** to enter an author's name, affiliations, thumbnail, and articles by hand. No limitation on the number of authors.

= Can I display only certain authors as a group? =

Yes. Create a group then add the authors you want to display: `[scholar-sync-group id="31"]`

= Is there a limit on the number of researchers I can add? =

No. You can create and manage an unlimited number of researcher profiles manually — there is no cap on the directory size. Manually created profiles are not subject to any limit.

= Does the plugin store data locally? =

Yes. All imported profile and article data is stored in your WordPress database, so the plugin continues to work even if the external service is temporarily unavailable.

= Does Scholar Sync support WordPress Multisite network activation? =

No. Activating Scholar Sync network-wide via the Network Admin will only set up the plugin on the main site. Each subsite must activate the plugin individually from its own admin dashboard. Network-wide ("activate for all sites") activation will cause the plugin to malfunction on all subsites except the main site.

= Is Scholar Sync free to use? =

Yes. All core features — syncing, manual authors and groups, and unlimited profiles — are free. Paid plans are available for higher sync frequency and request quotas; free-tier limits are enforced by the scholar-sync.org service and shown to you in the admin with a link to upgrade if you hit them.

== Screenshots ==

1. Researcher Directory — a grid of profiles, publication counts, and tags, kept in sync automatically.
2. Publications Feed — every paper listed with co-authors, citation counts, and one-click citations.
3. Live Preview & Customization — tweak display options for any researcher and get an instant, ready-to-use shortcode.
4. Add New Scholar — search by name and import a verified profile with publications already attached.
5. Sync History — a transparent log of every automatic and manual sync, so your data is always current.

== Credits ==

The following open-source libraries are bundled in the `public/js/` and `public/css/` directories:

* **Bootstrap 5.3.8** — MIT License — https://github.com/twbs/bootstrap
* **jQuery Validate 1.22.1** — MIT License — https://github.com/jquery-validation/jquery-validation

All libraries are included in minified form from their official distributions. Non-minified source files are available at the upstream GitHub URLs listed above.

== Changelog ==

= 1.0.3 =
* Added nonce and capability checks to admin views flagged in review.
* Removed ORDER BY interpolation; all queries use $wpdb->prepare() placeholders.
* Fixed article search to respect the author and active-status filters.

= 1.0.2 =
* Hardened database queries to use the %i identifier placeholder throughout.
* Restricted the public REST endpoints to return only public display fields.
* Tightened REST permission checks and input sanitization.
* Code standards and compatibility fixes.

= 1.0.0 =
* Initial public release.

== Upgrade Notice ==

= 1.0.3 =
Security and correctness fixes. Upgrade recommended.

= 1.0.2 =
Security and code-quality improvements. Upgrade recommended.

= 1.0.0 =
Initial release.