* @license GPL-2.0+ * @link https://wpadpresso.com * * @wordpress-plugin * Plugin Name: AdPresso * Description: Manage and optimize your ads in WordPress * Version: 1.7.0 * Plugin URI: https://wpadpresso.com * Author: AdPresso * Text Domain: adpresso * Domain Path: /languages * License: GPLv2 or later * License URI: https://www.gnu.org/licenses/gpl-2.0.html * Requires at least: 6.5 * Requires PHP: 8.0 */ use AdPresso\Autoloader; use AdPresso\Infrastructure\Util; use AdPresso\Install\Installer; use AdPresso\Installation\Uninstall; use AdPresso\Plugin; use AdPresso\Pro\Installation\CapabilityManager; use AdPresso\Pro\Modules\TrafficGuard\TrafficGuardService; if ( !defined( 'ABSPATH' ) ) { exit; } if ( defined( 'ADPRESSO_FILE' ) ) { return; } const ADPRESSO_FILE = __FILE__; const ADPRESSO_VERSION = '1.7.0'; define( 'ADPRESSO_ABSPATH', dirname( ADPRESSO_FILE ) . '/' ); define( 'ADPRESSO_PLUGIN_BASENAME', plugin_basename( ADPRESSO_FILE ) ); define( 'ADPRESSO_BASE_URL', plugin_dir_url( ADPRESSO_FILE ) ); require_once __DIR__ . '/includes/class-autoloader.php'; Autoloader::get()->initialize(); if ( !function_exists( 'adpresso_fs' ) ) { /** * Freemius SDK. * * @return Freemius */ function adpresso_fs() : Freemius { global $adpresso_fs; if ( !isset( $adpresso_fs ) ) { // Activate multisite network integration. if ( !defined( 'WP_FS__PRODUCT_20563_MULTISITE' ) ) { define( 'WP_FS__PRODUCT_20563_MULTISITE', true ); } // Include Freemius SDK. // SDK is auto-loaded through Composer $adpresso_fs = fs_dynamic_init( [ 'id' => '20563', 'slug' => 'adpresso', 'premium_slug' => 'adpresso-pro', 'type' => 'plugin', 'public_key' => 'pk_b098a09412793005417a629ffc69d', 'is_premium' => false, 'premium_suffix' => 'Pro', 'has_addons' => false, 'has_paid_plans' => true, 'has_affiliation' => '', 'menu' => [ 'slug' => 'adpresso', 'contact' => false, 'support' => false, 'affiliation' => false, ], 'is_live' => true, 'is_org_compliant' => true, ] ); } return $adpresso_fs; } // Init Freemius. adpresso_fs(); require_once __DIR__ . '/includes/freemius-filters.php'; // Signal that SDK was initiated. do_action( 'adpresso_fs_loaded' ); } if ( !function_exists( 'adpresso' ) ) { /** * Returns the main instance of AdPresso. * * @return Plugin */ function adpresso() : Plugin { return Plugin::get(); } } $installer = new Installer(); register_activation_hook( ADPRESSO_FILE, [$installer, 'install'] ); // Updates never fire the activation hook: new tables and the asset-masking rebuild run on the next load instead. add_action( 'plugins_loaded', [$installer, 'check_for_updates'] ); // Before Pro boots (plugins_loaded:10), so TG never reads the not-yet-renamed legacy storage. add_action( 'plugins_loaded', [$installer, 'maybe_migrate_traffic_guard_storage'], 5 ); register_uninstall_hook( ADPRESSO_FILE, [Uninstall::class, 'uninstall_native'] ); $uninstaller = new Uninstall(); $uninstaller->initialize(); add_action( 'plugins_loaded', static function () { adpresso()->boot(); do_action( 'adpresso.loaded', adpresso() ); } );