Skip to main content

Installation & Activation

Requirements Checklist

Before installing, confirm your environment meets these requirements:

  • WordPress 5.0 or later
  • PHP 7.4 or later (8.0+ recommended)
  • MySQL 5.7+ or MariaDB 10.3+
  • WordPress permalink structure set to Post name (not Plain)
  • Site accessible over HTTPS — JWT tokens and the mobile app require a valid SSL certificate
  • mod_rewrite enabled (Apache) or equivalent rewrite rules (Nginx)

Installation

  1. Download the plugin ZIP from the 2DC distribution channel
  2. In WordPress Admin, go to Plugins → Add New → Upload Plugin
  3. Choose the ZIP file and click Install Now
  4. After installation completes, click Activate Plugin

Option B — Manual FTP Upload

  1. Extract the ZIP file to get the association-app-wp-plugin/ folder
  2. Upload the folder to /wp-content/plugins/
  3. In WordPress Admin, go to Plugins → Installed Plugins
  4. Find 2DC Association App and click Activate

Option C — WP-CLI

wp plugin install /path/to/association-app-wp-plugin.zip --activate

Required Dependencies

The plugin uses afragen/wp-dependency-installer to automatically detect and install its required dependencies on first activation.

JWT Authentication for WP REST API

DetailValue
Plugin slugjwt-authentication-for-wp-rest-api
Required versionLatest
Auto-installedYes — prompted on activation

You must also add the following constants to your wp-config.php for JWT to work:

// wp-config.php — add above "That's all, stop editing!"

define('JWT_AUTH_SECRET_KEY', 'your-secret-key-here');
define('JWT_AUTH_CORS_ENABLE', true);

Generate a strong secret key using a password manager or:

openssl rand -base64 64
caution

JWT_AUTH_SECRET_KEY must be a long, random string. Do not use a guessable value — it is used to sign all authentication tokens.


The plugin replaces WordPress's default /wp-json/ REST prefix with /api/. This requires pretty permalinks to be active.

  1. Go to WordPress Admin → Settings → Permalinks
  2. Select Post name (e.g. https://example.com/sample-post/)
  3. Click Save Changes

This flushes the rewrite rules and registers the custom /api/v1/* route prefix.

To verify the API is reachable, visit in your browser:

https://your-site.com/api/v1/sync/ping

You should receive a JSON response (not a 404).


Nginx Configuration

If your server uses Nginx instead of Apache, add the following rewrite rule to your server block so WordPress can handle /api/* requests:

location /api/ {
try_files $uri $uri/ /index.php?$args;
}

Plugin Auto-Updates

The plugin uses yahnis-elsts/plugin-update-checker to check for updates from the 2DC update server.

When a new version is available, WordPress Admin will show the standard Update Now notice under Plugins → Installed Plugins. Updates are applied the same way as any other plugin.


Verifying Activation

After activation, confirm everything is working:

  1. Settings page visible — Go to WordPress Admin → Settings and look for Association App in the menu
  2. REST API accessible — Visit https://your-site.com/api/v1/sync/ping — should return {"status":"ok"}
  3. Custom post types registered — Go to WordPress Admin and look for App: Events, App: Conferences, App: Documents, App: Companies in the left sidebar
  4. User roles created — Go to Users → All Users → Change role to… and confirm Association Member and Pending Review appear in the dropdown

Deactivation & Uninstallation

Deactivating the plugin disables all custom REST API endpoints and hides the custom post types. The data (posts, user meta, options) is preserved.

Deleting the plugin removes its files but does not automatically clean up:

  • wp_options entries (association settings, sync key, branding)
  • Custom post type posts (events, documents, companies, etc.)
  • Custom user meta fields (member profile data)
  • Custom user roles (association-member, pending-review)

To perform a full clean uninstall, remove the above data manually via the database or a cleanup script before or after deleting the plugin.