menu_icon(), 30 ); } /** * Inline SVG mark for the Adbot admin menu item. * Kept monochrome so WordPress can recolor it for active/hover states. * Motif: a rounded "target" with a bolt — tracking + automation. */ private function menu_icon(): string { $svg = '' . '' . '' . ''; return 'data:image/svg+xml;base64,' . base64_encode( $svg ); } public function render_page(): void { echo '
'; } public function enqueue_assets( string $hook_suffix ): void { if ( 'toplevel_page_adbot' !== $hook_suffix ) { return; } $asset_file = ADBOT_PLUGIN_DIR . 'build/index.asset.php'; if ( ! file_exists( $asset_file ) ) { return; } $asset = include $asset_file; wp_enqueue_script( 'adbot-admin', ADBOT_PLUGIN_URL . 'build/index.js', $asset['dependencies'], $asset['version'], true ); wp_set_script_translations( 'adbot-admin', 'adbot-tracking-platform', ADBOT_PLUGIN_DIR . 'languages' ); wp_enqueue_style( 'adbot-admin', ADBOT_PLUGIN_URL . 'build/index.css', [ 'wp-components' ], $asset['version'] ); $images_url = ADBOT_PLUGIN_URL . 'assets/images/'; wp_localize_script( 'adbot-admin', 'adbotAdmin', [ 'restUrl' => esc_url_raw( rest_url( 'adbot/v1/' ) ), 'restRoot' => trailingslashit( esc_url_raw( rest_url() ) ), 'nonce' => wp_create_nonce( 'wp_rest' ), 'pluginUrl' => ADBOT_PLUGIN_URL, 'version' => ADBOT_VERSION, 'siteUrl' => get_site_url(), 'siteName' => get_bloginfo( 'name' ), // Display price for the "Unlock fixes" step (whole currency units). // The actual charge is authoritative on the backend; this is the // shown amount and can be overridden via the ADBOT_FIX_PRICE / // ADBOT_FIX_CURRENCY constants in wp-config.php. 'fixPrice' => (int) ( defined( 'ADBOT_FIX_PRICE' ) ? ADBOT_FIX_PRICE : 4950 ), 'currency' => (string) ( defined( 'ADBOT_FIX_CURRENCY' ) ? ADBOT_FIX_CURRENCY : 'ZAR' ), 'brand' => [ 'name' => __( 'Tracking', 'adbot-tracking-platform' ), 'tagline' => __( 'Automated Google Analytics and Tag Manager setup', 'adbot-tracking-platform' ), /* translators: Logo image for screen readers. */ 'logoAlt' => __( 'Tracking setup logo', 'adbot-tracking-platform' ), 'logoUrl' => esc_url_raw( $images_url . 'adbot/adbot.jpg' ), 'setupTitle' => __( 'Tracking setup', 'adbot-tracking-platform' ), ], 'images' => [ 'adbot' => esc_url_raw( $images_url . 'adbot/adbot.jpg' ), 'gtm' => esc_url_raw( $images_url . 'google-products/google-tag-manager.svg' ), 'ga4' => esc_url_raw( $images_url . 'google-products/ga4-logo.svg' ), 'gads' => esc_url_raw( $images_url . 'google-products/gads-logo.svg' ), 'gsc' => esc_url_raw( $images_url . 'google-products/gsc-logo.svg' ), ], ] ); } }