' . esc_html__( 'Another copy of WinnyPlus is already active. Deactivate and delete the older copy (the plugin folder named winnyplus-connect), then keep this one.', 'winnyplus' ) . '
'; } ); return; } define( 'WINNYPLUS_CONNECT_VERSION', '3.15.3' ); define( 'WINNYPLUS_CONNECT_PLUGIN_FILE', __FILE__ ); define( 'WINNYPLUS_CONNECT_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'WINNYPLUS_CONNECT_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); require_once WINNYPLUS_CONNECT_PLUGIN_DIR . 'includes/class-wpc-links.php'; require_once WINNYPLUS_CONNECT_PLUGIN_DIR . 'includes/class-wpc-icons.php'; require_once WINNYPLUS_CONNECT_PLUGIN_DIR . 'includes/class-wpc-overview.php'; require_once WINNYPLUS_CONNECT_PLUGIN_DIR . 'includes/class-wpc-crypto.php'; require_once WINNYPLUS_CONNECT_PLUGIN_DIR . 'includes/class-wpc-connection.php'; require_once WINNYPLUS_CONNECT_PLUGIN_DIR . 'includes/class-wpc-attribution.php'; require_once WINNYPLUS_CONNECT_PLUGIN_DIR . 'includes/class-wpc-events.php'; require_once WINNYPLUS_CONNECT_PLUGIN_DIR . 'includes/class-wpc-api.php'; require_once WINNYPLUS_CONNECT_PLUGIN_DIR . 'includes/class-wpc-rest.php'; require_once WINNYPLUS_CONNECT_PLUGIN_DIR . 'includes/class-wpc-hooks.php'; require_once WINNYPLUS_CONNECT_PLUGIN_DIR . 'includes/class-wpc-admin.php'; /** * WooCommerce's High-Performance Order Storage and the block checkout: the plugin reads orders through WooCommerce's own order objects and * touches no order table directly, so it declares both as supported (otherwise WooCommerce warns that the plugin is incompatible). */ function winnyplus_connect_declare_woocommerce_compatibility() { if ( class_exists( '\\Automattic\\WooCommerce\\Utilities\\FeaturesUtil' ) ) { \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', WINNYPLUS_CONNECT_PLUGIN_FILE, true ); \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', WINNYPLUS_CONNECT_PLUGIN_FILE, true ); } } add_action( 'before_woocommerce_init', 'winnyplus_connect_declare_woocommerce_compatibility' ); /** * Versions before 3.15 named their options with a short prefix ("wpc_"). Once, the values move to the new names, so a store that is already * connected stays connected. */ function winnyplus_connect_migrate_legacy_options() { if ( get_option( 'winnyplus_connect_migrated' ) ) { return; } foreach ( array( 'connection', 'enabled_events', 'last_sent_at' ) as $name ) { $old = get_option( 'wpc_' . $name, null ); if ( null !== $old && false === get_option( 'winnyplus_connect_' . $name, false ) ) { add_option( 'winnyplus_connect_' . $name, $old, '', false ); } delete_option( 'wpc_' . $name ); } foreach ( array( 'wpc_db_version', 'wpc_log_removed', 'wpc_overview_last' ) as $old ) { delete_option( $old ); } update_option( 'winnyplus_connect_migrated', '1' ); } add_action( 'plugins_loaded', 'winnyplus_connect_migrate_legacy_options', 5 ); /** * What the plugin tells a store's privacy policy: the site's owner adds it to their own policy (Settings > Privacy). */ function winnyplus_connect_privacy_policy_content() { if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) { return; } $content = '' . esc_html__( 'This store is connected to a WinnyPlus account. When a customer places an order, adds a product to the cart, opens the checkout, or registers, the store sends that event to WinnyPlus: the order, cart or customer details (name, phone, email, address, the products and totals) and, when known, where the customer came from (for example a link from Facebook, a search engine or a direct visit).', 'winnyplus' ) . '
'; $content .= '' . esc_html__( 'To remember where a visitor came from, the store sets one first-party cookie, winnyplus_connect_attr, which lasts 30 days. It holds the campaign parameters of the visit link, the referring website and the landing page, and nothing that identifies the visitor. You can stop it from being set with the winnyplus_connect_capture_attribution filter, for example until the visitor has agreed to marketing cookies.', 'winnyplus' ) . '
'; $content .= '' . esc_html__( 'WinnyPlus keeps the data to provide the services the store owner subscribes to, under its terms and privacy policy.', 'winnyplus' ) . '
'; wp_add_privacy_policy_content( 'WinnyPlus Connect', wp_kses_post( wpautop( $content, false ) ) ); } add_action( 'admin_init', 'winnyplus_connect_privacy_policy_content' ); /** * تفعيل البلج إن */ function winnyplus_connect_activate_plugin() { if ( false === get_option( 'winnyplus_connect_enabled_events' ) ) { add_option( 'winnyplus_connect_enabled_events', array() ); } } register_activation_hook( __FILE__, 'winnyplus_connect_activate_plugin' ); /** * The translations bundled with the plugin. The file for the site's language is loaded directly, so it works before (and alongside) any translation * WordPress.org provides for the plugin. */ function winnyplus_connect_load_textdomain() { $locale = determine_locale(); load_textdomain( 'winnyplus', WINNYPLUS_CONNECT_PLUGIN_DIR . 'languages/winnyplus-' . $locale . '.mo' ); } add_action( 'plugins_loaded', 'winnyplus_connect_load_textdomain' ); /** * تنبيه لو ووكومرس مش مفعّل */ function winnyplus_connect_check_woocommerce() { if ( ! class_exists( 'WooCommerce' ) ) { echo '' . esc_html__( 'WinnyPlus Connect requires WooCommerce to be activated in order to work properly.', 'winnyplus' ) . '