| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | /* |
| 3 | 3 | * Plugin Name: IvyForms - The innovative Contact Form Builder |
| 4 | 4 | * Plugin URI: https://ivyforms.com |
| 5 | 5 | * Description: Transform your WordPress site with IvyForms: a powerful, user-friendly plugin for creating and managing customizable forms effortlessly. |
| 6 | - * Version: 0.7 | |
| 6 | + * Version: 1.5.1 | |
| 7 | 7 | * Requires PHP: 7.4 |
| 8 | 8 | * Author: Melograno Ventures |
| 9 | 9 | * Author URI: https://melograno.io/ |
| 10 | 10 | * License: GPLv2 or later |
| @@ -27,9 +27,11 @@ | ||
| 27 | 27 | */ |
| 28 | 28 | namespace IvyForms; |
| 29 | 29 | |
| 30 | 30 | use Exception; |
| 31 | +use IvyForms\Infrastructure\WP\MCP\McpFeatureGate; | |
| 31 | 32 | use IvyForms\Plugin\Plugin; |
| 33 | +use WP\MCP\Core\McpAdapter; | |
| 32 | 34 | |
| 33 | 35 | if ( ! defined( 'ABSPATH' ) ) |
| 34 | 36 | { |
| 35 | 37 | exit; // Exit if accessed directly. |
| @@ -49,16 +51,19 @@ | ||
| 49 | 51 | { |
| 50 | 52 | define('IVYFORMS_TEMPLATES_IMAGES_URL', plugin_dir_url(__FILE__) . 'frontend/src/assets/images/templates/'); |
| 51 | 53 | } |
| 52 | 54 | |
| 53 | -if (!defined('IVYFORMS_TEMPLATES_URL')) | |
| 55 | +if (!defined('IVYFORMS_DEV')) | |
| 54 | 56 | { |
| 55 | - define('IVYFORMS_TEMPLATES_URL', 'https://ivyforms.com/form-templates'); | |
| 57 | + define('IVYFORMS_DEV', false); | |
| 56 | 58 | } |
| 57 | 59 | |
| 58 | -if (!defined('IVYFORMS_DEV')) | |
| 59 | -{ | |
| 60 | - define('IVYFORMS_DEV', false); | |
| 60 | +// Google Sheets OAuth middleware (override in wp-config.php for hosted/staging). | |
| 61 | +if (!defined('IVYFORMS_GOOGLE_SHEETS_MIDDLEWARE_URL')) { | |
| 62 | + define( | |
| 63 | + 'IVYFORMS_GOOGLE_SHEETS_MIDDLEWARE_URL', | |
| 64 | + IVYFORMS_DEV ? 'http://localhost:8080' : 'https://middleware.ivyforms.com' | |
| 65 | + ); | |
| 61 | 66 | } |
| 62 | 67 | |
| 63 | 68 | // Const for plugin slug |
| 64 | 69 | if (!defined('IVYFORMS_PLUGIN_SLUG')) |
| @@ -75,17 +80,43 @@ | ||
| 75 | 80 | define('IVYFORMS_SITE_URL', get_site_url()); |
| 76 | 81 | } |
| 77 | 82 | |
| 78 | 83 | if (!defined('IVYFORMS_VERSION')) { |
| 79 | - define('IVYFORMS_VERSION', '0.7'); | |
| 84 | + define('IVYFORMS_VERSION', '1.5.1'); | |
| 80 | 85 | } |
| 81 | 86 | |
| 87 | +// Stripe and PayPal are released. Square stays "Coming soon" on the Integrations page. | |
| 88 | +// Set this to false in wp-config.php to hide Stripe, PayPal, the Payments page and the Payment Method field. | |
| 89 | +if (!defined('IVYFORMS_PAYMENTS_ENABLED')) { | |
| 90 | + define('IVYFORMS_PAYMENTS_ENABLED', true); | |
| 91 | +} | |
| 82 | 92 | |
| 93 | +if (!defined('IVYFORMS_MCP_MIN_WP_VERSION')) { | |
| 94 | + define('IVYFORMS_MCP_MIN_WP_VERSION', '6.9'); | |
| 95 | +} | |
| 96 | + | |
| 97 | +if (!defined('MELOGRANO_BI_GATE_URL')) { | |
| 98 | + define('MELOGRANO_BI_GATE_URL', 'https://bi.melograno.io'); | |
| 99 | +} | |
| 100 | + | |
| 101 | +if (!defined('IVYFORMS_MIDDLEWARE_URL')) { | |
| 102 | + define( | |
| 103 | + 'IVYFORMS_MIDDLEWARE_URL', | |
| 104 | + IVYFORMS_DEV ? 'https://middleware-dev.ivyforms.com' : 'https://middleware.ivyforms.com' | |
| 105 | + ); | |
| 106 | +} | |
| 107 | + | |
| 83 | 108 | require_once IVYFORMS_PATH . '/backend/scope-vendor/autoload.php'; |
| 84 | 109 | require_once IVYFORMS_PATH . '/backend/vendor/autoload.php'; |
| 85 | 110 | |
| 111 | +if (class_exists(McpAdapter::class) && McpFeatureGate::isEnabled()) { | |
| 112 | + McpAdapter::instance(); | |
| 113 | + add_action('mcp_adapter_init', array('\IvyForms\Infrastructure\WP\MCP\IvyFormsMcpServerRegistrar', 'init')); | |
| 114 | + add_action('wp_abilities_api_categories_init', array('\IvyForms\Infrastructure\WP\MCP\IvyFormsAbilitiesRegistrar', 'registerCategories')); | |
| 115 | + add_action('wp_abilities_api_init', array('\IvyForms\Infrastructure\WP\MCP\IvyFormsAbilitiesRegistrar', 'registerAbilities')); | |
| 116 | +} | |
| 117 | + | |
| 86 | 118 | try { |
| 87 | 119 | Plugin::getInstance(); |
| 88 | 120 | } catch (Exception $e) { |
| 89 | 121 | echo 'ERROR: ' . esc_html($e->getMessage()); |
| 90 | -} | |
| 91 | - | |
| 122 | +} | |