Files
att-consent/att-consent.php
Steve Hanlon 83fe110dac Self-hosted auto-updates from Gitea via PUC + proprietary licence
Vendors YahnisElsts/plugin-update-checker v5.7 under vendor/ and wires
it to poll updates.json on the repo main branch. WP surfaces new
versions via Dashboard → Updates on its normal twice-daily cadence.

PUC is vendored (not a submodule) so Gitea's archive/main.zip — the
download target — includes it.

Also relicenses from GPL-2.0-or-later to a proprietary licence granting
use only to authorised sites, with all other rights reserved. Plugin
URI + Author URI switched from the placeholder github.com URL to the
canonical Gitea repo.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-07-16 12:51:13 +01:00

45 lines
1.6 KiB
PHP

<?php
/**
* Plugin Name: ATT Consent
* Plugin URI: https://git.h12e.com/steve/att-consent
* Description: Google Consent Mode v2 cookie consent with session attribution preservation, custom script management, and full gtag.js/GTM support.
* Version: 1.3.4
* Requires at least: 6.0
* Requires PHP: 7.4
* Author: ATT Consent
* Author URI: https://git.h12e.com/steve/att-consent
* License: Proprietary
* License URI: https://git.h12e.com/steve/att-consent/raw/branch/main/LICENSE
* Text Domain: att-consent
* Domain Path: /languages
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'ATT_CC_VERSION', '1.3.4' );
define( 'ATT_CC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'ATT_CC_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'ATT_CC_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
require_once ATT_CC_PLUGIN_DIR . 'includes/class-att-consent.php';
register_activation_hook( __FILE__, array( 'ATT_Consent', 'activate' ) );
register_deactivation_hook( __FILE__, array( 'ATT_Consent', 'deactivate' ) );
ATT_Consent::get_instance();
// Self-hosted updates from Gitea. Metadata JSON lives on the repo's main branch;
// PUC polls it twice a day and surfaces new versions via WP's normal update flow.
$att_cc_puc = ATT_CC_PLUGIN_DIR . 'vendor/plugin-update-checker/plugin-update-checker.php';
if ( file_exists( $att_cc_puc ) ) {
require_once $att_cc_puc;
\YahnisElsts\PluginUpdateChecker\v5\PucFactory::buildUpdateChecker(
'https://git.h12e.com/steve/att-consent/raw/branch/main/updates.json',
__FILE__,
'att-consent'
);
}
unset( $att_cc_puc );