pixelyoursite
Last commit date
containers_gtm
8 months ago
dist
3 weeks ago
includes
1 week ago
modules
1 week ago
notices
3 weeks ago
vendor
3 months ago
vendor_prefix
2 years ago
facebook-pixel-master.php
1 week ago
pixelyoursite.php
1 week ago
readme.txt
1 week ago
facebook-pixel-master.php
68 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Plugin Name: PixelYourSite |
| 5 | * Plugin URI: http://www.pixelyoursite.com/ |
| 6 | * Description: Meta Pixel & CAPI, GA4, and GTM support with ZERO CODING. Track events, WooCommerce/EDD ready, with Pinterest & Bing add-ons, plus consent support. |
| 7 | * Version: 11.2.0.6 |
| 8 | * Author: PixelYourSite |
| 9 | * Author URI: http://www.pixelyoursite.com |
| 10 | * License: GPLv3 |
| 11 | * |
| 12 | * Requires at least: 4.4 |
| 13 | * Tested up to: 7.0 |
| 14 | * |
| 15 | * WC requires at least: 2.6.0 |
| 16 | * WC tested up to: 10.7 |
| 17 | * |
| 18 | * Text Domain: pys |
| 19 | */ |
| 20 | |
| 21 | if ( ! defined( 'ABSPATH' ) ) { |
| 22 | exit; // Exit if accessed directly. |
| 23 | } |
| 24 | |
| 25 | function isPysProActive() { |
| 26 | |
| 27 | if ( ! function_exists( 'is_plugin_active' ) ) { |
| 28 | include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 29 | } |
| 30 | |
| 31 | return is_plugin_active( 'pixelyoursite-pro/pixelyoursite-pro.php' ); |
| 32 | |
| 33 | } |
| 34 | |
| 35 | register_activation_hook( __FILE__, 'pysFreeActivation' ); |
| 36 | function pysFreeActivation() { |
| 37 | |
| 38 | if ( isPysProActive() ) { |
| 39 | deactivate_plugins('pixelyoursite-pro/pixelyoursite-pro.php'); |
| 40 | } |
| 41 | \PixelYourSite\manageAdminPermissions(); |
| 42 | } |
| 43 | |
| 44 | if ( isPysProActive()) { |
| 45 | return; // exit early when PYS PRO is active |
| 46 | } |
| 47 | |
| 48 | add_action( 'before_woocommerce_init', function() { |
| 49 | if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { |
| 50 | |
| 51 | // HPOS |
| 52 | \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( |
| 53 | 'custom_order_tables', |
| 54 | __FILE__, |
| 55 | true |
| 56 | ); |
| 57 | |
| 58 | // Cache Product Objects |
| 59 | \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( |
| 60 | 'product_instance_caching', |
| 61 | __FILE__, |
| 62 | true |
| 63 | ); |
| 64 | } |
| 65 | }); |
| 66 | |
| 67 | require_once 'pixelyoursite.php'; |
| 68 |