=== LabelGlow for Google Contacts ===
Contributors: eitanshavit
Tags: sync, share, contacts
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The intelligent sync service for Google Contacts. Sync a master contact list to your team's Google accounts and create dynamic shared labels.

== Description ==

**LabelGlow** automates the process of syncing contacts across your organization. It takes a master contact list (from a CSV file) and distributes it to the native Google Contacts of every authorized user on your team.

Its unique power lies in **Label Syncing**. You can assign contacts to specific labels like "Sales Team" or "Project Alpha." These labels sync directly to your users' Google accounts, creating instant, ready-made mailing lists in Gmail and searchable groups on their mobile devices.

### Key Features

*   **Centralized Management:** Control your organization's contacts from a single CSV file inside WordPress.
*   **Google Contacts Sync:** Automatically push contacts to your team's Google accounts.
*   **Label/Group Sync:** Create and sync contact groups/labels for easy segmentation.
*   **Mobile Ready:** Contacts synced by LabelGlow appear instantly on Android and iOS devices connected to the user's Google account.
*   **Secure:** Uses the official Google People API and OAuth 2.0. We never see or store your Google password.

### Free Version Features
*   **Unlimited Manual Syncing:** Run syncs on demand with a single click.
*   **Unlimited Contacts:** Sync thousands of contacts.
*   **Edit CSV Values in Dashboard:** Edit existing contacts without editing the CSV.
*   **Secure Google OAuth Connection**.

### Pro Features (Upgrade)
  
*   **Automatic Daily Background Sync:** Set it and forget it. Keeps contacts fresh automatically.
*   **Sync Audit Log:** Detailed history of all sync operations.
*   **Add Contacts from Dashboard:** Quickly add/edit/delete contacts without editing the CSV.
*   **Smart Google Label Mapping:** Create various Contact Labels (Sales, Support, etc.)

== Installation ==

Follow these steps carefully to set up the plugin.

**Prerequisites:**
*   You need a Google Cloud Platform account to create API credentials.

—
**Step 1: Google Cloud Project Setup**
—

1.  Go to the Google Cloud Console and create a new project (e.g., "LabelGlow Sync").
2.  Enable the **Google People API** for your project.
3.  Go to **APIs & Services > OAuth consent screen**. Configure it for your users. If your users are all within your Google Workspace, you can select "Internal". Otherwise, select "External".
4.  Go to **APIs & Services > Credentials**.
5.  Click **+ CREATE CREDENTIALS** and select **OAuth client ID**.
6.  For "Application type," choose **Web application**.
7.  Under **Authorized redirect URIs**, click **+ ADD URI**. This must be exact. Paste the following URL, replacing `your-domain.com` with your actual website address:
    `https://your-domain.com/wp-admin/admin-post.php?action=labelglow_oauth_callback`
8.  Click **Create**. A popup will appear with your **Client ID** and **Client Secret**. Copy these two values. You will need them in Step 3.

—
**Step 2: Plugin Installation**
—
1.  In your WordPress admin, go to **Plugins > Add New > Upload Plugin**.
2.  Upload the `labelglow.zip` file and activate the plugin.

—
**Step 3: Initial Configuration**
—
1.  Enter the license code in **LabelGlow > Account** to activate all plugin's features.
2.  After activating, go to the new **LabelGlow > Settings** menu in your WordPress admin.
3.  In the "Google API Credentials" section, paste the **Client ID** and **Client Secret** you copied from the Google Cloud Console. Click **Save Settings**.
4.  On the same page, in the "Manage Contacts CSV File" section, you will now see an upload form.
5.  Create your `company_contacts.csv` file locally. It must have the columns: `fullName`, `email`, `phone`, `labels`.
6.  Upload this CSV file using the form.

—
**Step 4: Authorizing Users**
—
1.  On the **LabelGlow > Settings** page, you will now see an "Authorization Link" section.
2.  Copy this URL.
3.  Send this URL to every employee who needs their contacts synced. They must click the link, sign in to their Google account, and grant permission.
4.  As users grant permission, they will appear in the list on the main **LabelGlow > LabelGlow Contact Sync** page.

—
**Step 5: Running a Sync & Editing Contacts**
—
1.  To edit contacts, go to **LabelGlow > Edit Contacts CSV**.
2.  To run a sync, go to **LabelGlow > Contact Sync**. Select the users you want to sync and click "Run Sync for Selected Users". A live log will appear showing the progress.


== External Services ==

This plugin relies on the following third-party services to function:

1. **Google People API (Google Contacts)**
   *   **What it does:** This service allows the plugin to sync the contacts from your CSV file into your Google Contacts account.
   *   **What data is sent:** The names, phone numbers, and email addresses from your uploaded CSV file are sent to Google's servers to be created as contacts.
   *   **Link to Terms:** [Google Terms of Service](https://policies.google.com/terms)
   *   **Link to Privacy Policy:** [Google Privacy Policy](https://policies.google.com/privacy)

2. **Freemius**
   *   **What it does:** This service handles the plugin's opt-in, usage tracking, and potential upgrades to the Pro version.
   *   **What data is sent:** If you opt-in, it may send your site URL, WordPress version, PHP version, and admin email address.
   *   **Link to Terms:** [Freemius Terms of Service](https://freemius.com/terms/)
   *   **Link to Privacy Policy:** [Freemius Privacy Policy](https://freemius.com/privacy/)



== Frequently Asked Questions ==

= Do I need a Google Workspace account? =
No, LabelGlow works with both free `@gmail.com` accounts and professional Google Workspace accounts.

= Is my data secure? =
Yes. We use the official Google People API. Your contact data is processed securely on your own server and is never sent to us. The only data we store is the secure authorization token required to perform the sync.

= How do I upgrade to Pro? =
You can upgrade directly from within the plugin settings page to unlock automatic syncing and higher user limits.

= How do I contact Support? =
Please visit the LabelGlow website for FAQ, Support and Troubleshooting.
https://labelglow.com

== Screenshots ==

1.  **LabelGlow Dashboard:** Manage your CSV.
2.  **Contact Sync:** Select users and run a sync operation.
3.  **Settings:** Configure various LabelGlow settings.

== Changelog ==

= 2.0.0 =
*   Major architectural upgrade.
*   Introduced Freemius integration for secure licensing.
*   Added Sync Audit Log for Pro users.
*   Improved security with cryptographic signature verification.
*   Optimized database locking to prevent sync conflicts.
*   "To prevent public access to the CSV files, the plugin creates a .htaccess file ('Deny from all') for Apache servers and an index.php file to prevent directory listing. The storage has been moved to the standard WordPress Uploads directory as requested."

= 1.6.0 =
*   Initial stable release.

== Upgrade Notice ==

= 2.0.0 =
Major update! LabelGlow 2.0.0 now supports multisite networks and introduces an automated background sync via our new Pro tier. File storage has also been securely migrated to the standard WP Uploads directory.