=== NexaWP Connector ===
Contributors: NexaWP Manager
Donate link: https://nexawpmanager.com/donate
Tags: api, connection, security, CRM, remote management, multisite, wordpress management
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.26
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Securely connect and manage your WordPress sites remotely with NexaWP Manager.

== Description ==

NexaWP Connector is a powerful plugin that enables secure remote management of your WordPress sites through NexaWP Manager. It provides a robust API interface for managing plugins, themes, users, and more.

**Key Features:**

* Secure API connection with token-based authentication
* Remote plugin and theme management
* User management capabilities
* Core WordPress updates
* Backup management
* Security plugins compatibility (SecuPress, iThemes Security, Wordfence, etc.)
* Detailed site information and system status
* Multisite support
* Real-time site monitoring
* Database synchronization
* Site favicon retrieval

**Security First:**

* Token-based authentication
* Secure API endpoints
* Compatible with major security plugins
* IP whitelisting support
* Encrypted communication

**Professional Support:**

Visit [NexaWP Manager](https://nexawpmanager.com) for professional support and documentation.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/nexawp-connector` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to 'Settings' -> 'NexaWP Connector' to generate your API key.
4. Copy the generated API key to connect your site to NexaWP Manager.

== Frequently Asked Questions ==

= Is this plugin secure? =

Yes, NexaWP Connector uses secure token-based authentication and follows WordPress security best practices. All communications are encrypted and the plugin is compatible with major security plugins.

= How do I generate an API key? =

After activating the plugin, go to 'Settings' -> 'NexaWP Connector' and click on 'Generate API Key'. The key will be displayed only once for security reasons.

= Does it work with security plugins? =

Yes, NexaWP Connector is compatible with major security plugins including SecuPress, iThemes Security, Wordfence, and All In One WP Security.

= Can I use this with WordPress Multisite? =

Yes, NexaWP Connector fully supports WordPress Multisite installations.

= How can I disconnect my site? =

You can either regenerate the API key to invalidate the old connection or deactivate/delete the plugin entirely.

= Where can I find documentation? =

Complete documentation is available at [NexaWP Manager Documentation](https://nexawpmanager.com/quick-start).

== Screenshots ==

1. Settings page with API key management
2. Site connection status
3. System information display

== Changelog ==

= 1.0.26 =
* New: NexaWP Manager can now search the WordPress.org directory and install a plugin on your site, with or without activating it.

= 1.0.25 =
* Fix: on some servers, syncing the WordPress core, plugins, themes, users and backups failed while the site connection worked. They now work on these servers too.

= 1.0.24 =
* Fix: after an update made from NexaWP Manager, WP Rocket stays active and its page cache keeps working.

= 1.0.23 =
* Improvement: updating the NexaWP module is now safer; the previous version is restored automatically if anything goes wrong.
* New: NexaWP Manager now shows which plugins can be updated automatically, and tells you why when one cannot (for example an expired license).
* Fix: updating one plugin no longer temporarily hides the pending updates of the other plugins.
* Improvement: automatic updates of the NexaWP module itself are now more reliable.

= 1.0.22 =
* Fix: plugin and theme sync now also works on sites where a security plugin blocks premium update detection; the connector adapts automatically.

= 1.0.21 =
* Improvement: if a plugin or theme on the site is incompatible with premium update detection, the connector now disables it automatically for that site and everything else keeps working.

= 1.0.20 =
* Fix: updates for premium plugins (Crocoblock, WP Rocket and other licensed plugins) are now correctly detected and shown in NexaWP Manager.
* Fix: the connector can now update itself when the site and NexaWP Manager are hosted on the same infrastructure.

= 1.0.19 =
* Fix: quick connect retries automatically after a network hiccup and no longer shows the site as ready when the connection failed.
* Security: the API key is now encrypted at rest in the database.
* Improvement: cleaner full-screen connection screen.
* New: in-plugin "update available" banner with a one-click update button.
* New: the settings page and dashboard widget now detect when the site has been removed from NexaWP Manager and show a clear "Disconnected" status.
* New: German translation.
* Fix: per-plugin auto-update no longer turns itself back off.

= 1.0.18 =
* Fix : plugins that deactivated themselves after a remote update from NexaWP Manager (WP-Rocket, Newsletter, and any plugin whose activation hook performs license / requirements / DB checks). Reactivation is now silent (no activation hook re-run), matching WP core's own update flow. A non-silent fallback only kicks in if silent reactivation somehow didn't restore the active state.
* Fix : bulk update path now restores active state of each plugin after upgrade (it was simply ignoring the deactivation that Plugin_Upgrader performs).
* Same fix applied to plugin rollback path.

= 1.0.17 =
* Diagnostics endpoint now includes a runtime_guards probe: it re-runs the same set_time_limit(0) and ini_set('memory_limit', '2G') calls the backup uses, then reads the values back. Lets the operator see if the host silently blocks these overrides (common on shared hosting - leads to backups killed at the default max_execution_time, usually 60s, during the ZipArchive::close() phase).

= 1.0.16 =
* Backup progress reporting fixed: cadence is now adaptive (every 200 files in bulk, every 25 within the last 500, always on the very last file) so big sites no longer appear frozen at "N/total"
* Explicit "Finalizing archive (writing N files to disk)..." status is reported right before ZipArchive::close() so operators know the long flush phase is in progress, not stuck
* New /wp-json/nexawp/v1/diagnostics endpoint (API key auth) exposing PHP limits, memory usage, disk space, in-flight backup state with timestamps, and the 10 largest files under wp-content (= usual freeze culprits)

= 1.0.15 =
* Fix critical backup/restore bug: permalink_structure (/%postname%/) was corrupted by wpdb placeholder-escape leaking into the SQL dump
* Switched raw SQL dump to mysqli->real_escape_string() to preserve % characters
* Added post-restore sanitization to heal databases restored from backups produced by older versions

= 1.0.12 =
* Large backup support: increased memory limit to 2GB for backup and restore
* ZIP archive flushed every 500 files to prevent memory exhaustion on large sites
* Self-update endpoint for remote connector updates from the app
* Update cache cleared before plugin updates to fix stale transients
* WP_DEBUG check fixed for REST API context (update check no longer skipped)

= 1.0.11 =
* Fixed plugin update permissions
* Fixed theme update permissions
* Fixed bulk update and rollback permissions
* Improved security: admin user is only set after API key verification

= 1.0.10 =
* Fix plugin update - correct slug resolution for all plugins (slug to full file path)
* Fix plugin rollback - correct download URL and slug resolution
* Fix premium plugins - check existing transient before refreshing, better license error handling
* Fix theme screenshots - correct URL from WordPress, fallback to WordPress.org API with cache

= 1.0.9 =
* Full site backup - now backs up the entire WordPress installation (wp-admin, wp-includes, wp-content, root files) instead of only wp-content/plugins, themes, and uploads
* Full site restore - restores files to ABSPATH with wp-config.php protection (never overwritten during restore)
* Fixed backup/restore background processing reliability (ignore_user_abort + proper HTTP flush)
* Fixed restore failing when backup status was 'restored' or 'restore_failed'
* Added restore status endpoint for real-time progress tracking
* Excluded unnecessary directories from backup (cache, .git, node_modules, other backup plugins data)
* Increased max individual file size limit to 256 MB
* Added maintenance mode endpoint for plugin updates
* Fixed plugin reactivation after update - retry logic (up to 3 attempts) for WP-Rocket, WooCommerce, etc.
* Update response now includes detailed reactivation status (was_active, is_active, reactivation_failed flag)
* Fixed plugin sync for non-WordPress.org plugins (Crocoblock, ACF Pro, WPBakery, etc.)
* Fixed plugin slug format - uses clean slug instead of full file path
* Added icon caching (24h) and optimized icon fetching
* Added full internationalization (i18n) support with French (fr_FR) and Spanish (es_ES) translations
* Added .pot template file for easy community translations
* Removed all debug logging for production readiness
* Added custom confirmation modal replacing native browser dialogs
* API key generation blocked when WP_DEBUG is enabled
* Clean data removal on plugin deactivation and activation

= 1.0.8 =
* Added automatic update system from NexaWP Manager server
* Implemented custom update checker (bypasses WordPress.org repository)
* Added version compatibility checks for WordPress and PHP
* Improved plugin update notifications in WordPress admin
* Enhanced security for update downloads
* Added update rollback capability
* Performance optimizations for REST API endpoints
* Updated minimum PHP version requirement to 7.4
* Bug fixes and stability improvements

= 1.0.7 =
* Added database synchronization feature
* Added site favicon retrieval functionality
* Improved API performance
* Enhanced compatibility with latest WordPress version
* Bug fixes and stability improvements

= 1.0.6 =
* Added compatibility with major security plugins (SecuPress, iThemes, Wordfence)
* Improved API error handling and logging
* Enhanced CORS security
* Added system information details
* Performance optimizations

= 1.0.5 =
* Changed automatic connection gateway
* Improved reliability of API connections

= 1.0.4 =
* Relocated module menu to settings
* Enhanced user interface

= 1.0.3 =
* Added full translation support
* Implemented internationalization

= 1.0.2 =
* Enhanced API key security
* Added backup system
* Improved error handling

= 1.0.1 =
* Initial release

== Upgrade Notice ==

= 1.0.9 =
Major update - full site backup and restore, maintenance mode during updates, plugin reactivation fixes (WP-Rocket, WooCommerce), production cleanup. Upgrade recommended for all users.

= 1.0.7 =
Important update with new database synchronization and favicon retrieval features. Upgrade recommended for all users.

== Requirements ==

* WordPress 6.0 or higher
* PHP 7.4 or higher
* REST API enabled
* Pretty permalinks enabled

== Privacy ==

This plugin does not collect any personal data. It only creates and stores an API key in your WordPress database for connection with NexaWP Manager.

== Support ==

For support, please visit:
* [NexaWP Manager Website](https://nexawpmanager.com)
* [Documentation](https://nexawpmanager.com/docs)
* [Support Forum](https://nexawpmanager.com/support)

== License ==

NexaWP Connector is licensed under the GPL v2 or later.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
