| @@ -48,13 +48,19 @@ | ||
| 48 | 48 | /** |
| 49 | 49 | * Initialize the promotion service |
| 50 | 50 | */ |
| 51 | 51 | public static function init() { |
| 52 | + // Gate every promotion surface behind `easy_invoice_show_upgrade_prompts`. | |
| 53 | + // White-label addon (Agency tier) flips this off so end-clients never see upsells. | |
| 54 | + if (!apply_filters('easy_invoice_show_upgrade_prompts', true)) { | |
| 55 | + return; | |
| 56 | + } | |
| 57 | + | |
| 52 | 58 | add_action('admin_notices', [__CLASS__, 'maybeShowPromotionBanner']); |
| 53 | 59 | add_action('wp_ajax_easy_invoice_dismiss_promotion', [__CLASS__, 'handleDismissPromotion']); |
| 54 | 60 | add_action('admin_enqueue_scripts', [__CLASS__, 'enqueueScripts']); |
| 55 | 61 | add_action('admin_menu', [__CLASS__, 'addUpgradeToProMenu']); |
| 56 | - | |
| 62 | + | |
| 57 | 63 | // Add plugin row action |
| 58 | 64 | add_filter('plugin_action_links_' . plugin_basename(EASY_INVOICE_PLUGIN_FILE), [__CLASS__, 'addPluginRowAction']); |
| 59 | 65 | } |
| 60 | 66 | |
| @@ -231,9 +237,9 @@ | ||
| 231 | 237 | public static function handleDismissPromotion() { |
| 232 | 238 | check_ajax_referer('easy_invoice_promotion_nonce', 'nonce'); |
| 233 | 239 | |
| 234 | 240 | if (!current_user_can('manage_options')) { |
| 235 | - wp_die(__('You do not have sufficient permissions to access this page.', 'easy-invoice')); | |
| 241 | + wp_die(esc_html__('You do not have sufficient permissions to access this page.', 'easy-invoice')); | |
| 236 | 242 | } |
| 237 | 243 | |
| 238 | 244 | $dismiss_count = get_option('easy_invoice_promotion_dismiss_count', 0); |
| 239 | 245 | $dismiss_count++; |