| @@ -1,6 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 4 | + exit; | |
| 5 | +} | |
| 3 | 6 | // General plugin logic, feature toggles, repository/service getters, plugin state, etc. |
| 4 | 7 | |
| 5 | 8 | function easy_invoice_should_show_quote_adjust_field(): bool { |
| 6 | 9 | return \EasyInvoice\Controllers\SettingsController::shouldShowQuoteAdjustField(); |
| @@ -108,9 +111,12 @@ | ||
| 108 | 111 | * @since 1.0.0 |
| 109 | 112 | * @return bool |
| 110 | 113 | */ |
| 111 | 114 | function easy_invoice_has_pro(): bool { |
| 112 | - return class_exists('EasyInvoicePro'); | |
| 115 | + // The main class is hoisted even when Pro's file bails out early (it | |
| 116 | + // refuses to run against a free plugin older than it needs), so also | |
| 117 | + // require a class that only its autoloader provides. | |
| 118 | + return class_exists('EasyInvoicePro') && class_exists('\\EasyInvoicePro\\Updater\\License'); | |
| 113 | 119 | } |
| 114 | 120 | |
| 115 | 121 | /** |
| 116 | 122 | * Convert various boolean values to a consistent boolean |