Changeset 3347111
- Timestamp:
- 08/19/2025 03:19:02 PM (7 months ago)
- Location:
- easy-invoice
- Files:
-
- 46 added
- 2 deleted
- 6 edited
- 1 copied
-
tags/2.0.3 (copied) (copied from easy-invoice/trunk)
-
tags/2.0.3/easy-invoice.php (modified) (9 diffs)
-
tags/2.0.3/includes/Admin/EasyInvoiceAdmin.php (modified) (36 diffs)
-
tags/2.0.3/includes/Migration (added)
-
tags/2.0.3/includes/Migration/MigrationInit.php (added)
-
tags/2.0.3/includes/Migration/MigrationLoader.php (added)
-
tags/2.0.3/includes/Migration/MigrationRunner.php (added)
-
tags/2.0.3/includes/Migration/MigrationStatus.php (added)
-
tags/2.0.3/includes/Migration/MigrationTest.php (added)
-
tags/2.0.3/includes/Migration/Src (added)
-
tags/2.0.3/includes/Migration/Src/AbstractMigration.php (added)
-
tags/2.0.3/includes/Migration/Src/ClientMigration.php (added)
-
tags/2.0.3/includes/Migration/Src/DataCleanupMigration.php (added)
-
tags/2.0.3/includes/Migration/Src/MetaMigration.php (added)
-
tags/2.0.3/includes/Migration/Src/MigrationInterface.php (added)
-
tags/2.0.3/includes/Migration/Src/OptionsMigration.php (added)
-
tags/2.0.3/includes/Migration/Src/PostTypeMigration.php (added)
-
tags/2.0.3/includes/Migration/Src/ProOptionsMigration.php (added)
-
tags/2.0.3/includes/Migration/Src/SettingsMigration.php (added)
-
tags/2.0.3/includes/Migration/Src/ValueTransformer.php (added)
-
tags/2.0.3/includes/Migration/VersionChecker.php (added)
-
tags/2.0.3/includes/Migration/assets (added)
-
tags/2.0.3/includes/Migration/assets/migration.css (added)
-
tags/2.0.3/includes/Migration/assets/migration.js (added)
-
tags/2.0.3/includes/Migration/templates (added)
-
tags/2.0.3/includes/Migration/templates/migration-page.php (added)
-
tags/2.0.3/includes/migration (deleted)
-
tags/2.0.3/readme.txt (modified) (2 diffs)
-
trunk/easy-invoice.php (modified) (9 diffs)
-
trunk/includes/Admin/EasyInvoiceAdmin.php (modified) (36 diffs)
-
trunk/includes/Migration (added)
-
trunk/includes/Migration/MigrationInit.php (added)
-
trunk/includes/Migration/MigrationLoader.php (added)
-
trunk/includes/Migration/MigrationRunner.php (added)
-
trunk/includes/Migration/MigrationStatus.php (added)
-
trunk/includes/Migration/MigrationTest.php (added)
-
trunk/includes/Migration/Src (added)
-
trunk/includes/Migration/Src/AbstractMigration.php (added)
-
trunk/includes/Migration/Src/ClientMigration.php (added)
-
trunk/includes/Migration/Src/DataCleanupMigration.php (added)
-
trunk/includes/Migration/Src/MetaMigration.php (added)
-
trunk/includes/Migration/Src/MigrationInterface.php (added)
-
trunk/includes/Migration/Src/OptionsMigration.php (added)
-
trunk/includes/Migration/Src/PostTypeMigration.php (added)
-
trunk/includes/Migration/Src/ProOptionsMigration.php (added)
-
trunk/includes/Migration/Src/SettingsMigration.php (added)
-
trunk/includes/Migration/Src/ValueTransformer.php (added)
-
trunk/includes/Migration/VersionChecker.php (added)
-
trunk/includes/Migration/assets (added)
-
trunk/includes/Migration/assets/migration.css (added)
-
trunk/includes/Migration/assets/migration.js (added)
-
trunk/includes/Migration/templates (added)
-
trunk/includes/Migration/templates/migration-page.php (added)
-
trunk/includes/migration (deleted)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-invoice/tags/2.0.3/easy-invoice.php
r3346980 r3347111 4 4 * Plugin URI: https://matrixaddons.com/plugins/easy-invoice 5 5 * Description: A beautiful, full-featured invoicing solution for WordPress. Create professional invoices, quotes, and manage payments with ease. 6 * Version: 2.0. 26 * Version: 2.0.3 7 7 * Author: MatrixAddons 8 8 * Author URI: https://matrixaddons.com … … 25 25 26 26 // Define plugin constants. 27 define( 'EASY_INVOICE_VERSION', '2.0. 2' );27 define( 'EASY_INVOICE_VERSION', '2.0.3' ); 28 28 define( 'EASY_INVOICE_PLUGIN_FILE', __FILE__ ); 29 29 define( 'EASY_INVOICE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); … … 56 56 $plugin = \EasyInvoice\EasyInvoice::getInstance(); 57 57 $plugin->init(); 58 58 59 59 // Initialize service providers. 60 60 $invoice_service_provider = new \EasyInvoice\Providers\InvoiceServiceProvider(); … … 66 66 $client_service_provider = new \EasyInvoice\Providers\ClientServiceProvider(); 67 67 $client_service_provider->register(); 68 68 69 69 $invoice_number_service_provider = new \EasyInvoice\Providers\InvoiceNumberServiceProvider(); 70 70 $invoice_number_service_provider->register(); 71 71 72 72 $quote_number_service_provider = new \EasyInvoice\Providers\QuoteNumberServiceProvider(); 73 73 $quote_number_service_provider->register(); 74 74 75 75 $quote_service_provider = new \EasyInvoice\Providers\QuoteServiceProvider(); 76 76 $quote_service_provider->register(); 77 77 78 78 // Initialize EmailManager 79 79 $email_manager = \EasyInvoice\Services\EmailManager::getInstance(); 80 80 81 81 // Initialize form manager 82 82 //$form_manager = \EasyInvoice\Forms\FormManager::getInstance(); 83 83 // $form_manager->setInvoiceNumberServiceProvider($invoice_number_service_provider); 84 84 85 85 // Initialize controllers. 86 86 $payment_controller = new \EasyInvoice\Controllers\PaymentController(); 87 87 $payment_controller->init(); 88 88 89 89 $settings_controller = new \EasyInvoice\Controllers\SettingsController(); 90 90 $settings_controller->init(); 91 91 92 92 $quote_controller = new \EasyInvoice\Controllers\QuoteController(); 93 93 $quote_controller->init(); 94 94 95 95 // Initialize shortcode manager 96 96 $shortcode_manager = new \EasyInvoice\Shortcodes\ShortcodeManager(); 97 97 98 98 } 99 99 add_action( 'init', 'easy_invoice_init' ); … … 103 103 */ 104 104 function easy_invoice_payment_gateway_log_handler($message, $level, $gateway_name) { 105 $log_message = sprintf('[%s] Easy Invoice %s Gateway: %s', 106 date('Y-m-d H:i:s'), 107 ucfirst($gateway_name), 105 $log_message = sprintf('[%s] Easy Invoice %s Gateway: %s', 106 date('Y-m-d H:i:s'), 107 ucfirst($gateway_name), 108 108 $message 109 109 ); 110 110 111 111 if (defined('WP_DEBUG') && WP_DEBUG) { 112 112 error_log($log_message); … … 117 117 // Initialize migration system 118 118 if ( class_exists( 'EasyInvoice\Migration\MigrationInit' ) ) { 119 119 120 EasyInvoice\Migration\MigrationInit::init(); 120 121 } … … 155 156 // Initialization of post types so rewrite rules can be flushed properly. 156 157 \EasyInvoice\EasyInvoice::getInstance()->registerPostTypes(); 157 158 158 159 // Initialize default settings 159 160 $settings_controller = new \EasyInvoice\Controllers\SettingsController(); 160 161 $settings_controller->initializeSettings(); 161 162 162 163 // Record first install timestamp (do not overwrite if it already exists) 163 164 if (!get_option('easy_invoice_installed')) { 164 165 update_option('easy_invoice_installed', current_time('mysql')); 165 166 } 166 167 167 168 // Check if this is a fresh installation or an upgrade 168 169 $stored_version = get_option('easy_invoice_version', ''); 169 170 170 171 // If no version is stored, this is a fresh installation 171 172 if (empty($stored_version)) { … … 175 176 // This is an upgrade. Do NOT bump version here; migration will set it when completed. 176 177 } 177 178 178 179 // Flush rewrite rules. 179 180 flush_rewrite_rules(); … … 190 191 // Flush rewrite rules. 191 192 flush_rewrite_rules(); 192 193 193 194 // Clear scheduled events 194 195 \EasyInvoice\Services\QuoteExpirationService::clear_schedule(); -
easy-invoice/tags/2.0.3/includes/Admin/EasyInvoiceAdmin.php
r3344524 r3347111 25 25 /** 26 26 * Invoice controller instance 27 * 27 * 28 28 * @var InvoiceController 29 29 */ 30 30 private $invoice_controller; 31 31 32 32 /** 33 33 * Quote controller instance 34 * 34 * 35 35 * @var QuoteController 36 36 */ 37 37 private $quote_controller; 38 38 39 39 /** 40 40 * Client controller instance 41 * 41 * 42 42 * @var ClientController 43 43 */ 44 44 private $client_controller; 45 45 46 46 /** 47 47 * Settings controller instance 48 * 48 * 49 49 * @var SettingsController 50 50 */ 51 51 private $settings_controller; 52 52 53 53 /** 54 54 * Report controller instance 55 * 55 * 56 56 * @var ReportController 57 57 */ 58 58 private $report_controller; 59 59 60 60 /** 61 61 * Dashboard controller instance 62 * 62 * 63 63 * @var DashboardController 64 64 */ 65 65 private $dashboard_controller; 66 66 67 67 /** 68 68 * Payment controller instance 69 * 69 * 70 70 * @var PaymentController 71 71 */ 72 72 private $payment_controller; 73 73 74 74 /** 75 75 * Constructor … … 84 84 $this->payment_controller = new PaymentController(); 85 85 } 86 86 87 87 /** 88 88 * Initialize the admin class … … 91 91 // Add menu items 92 92 add_action('admin_menu', array($this, 'registerMenuPages')); 93 93 94 94 // Register admin assets 95 95 $admin_assets = new AdminAssets(); 96 96 $admin_assets->register(); 97 97 98 98 // Register invoice preview page 99 99 add_action('admin_init', array($this, 'registerPreviewPage')); 100 100 101 101 // Ensure proper page titles to avoid WordPress core issues 102 102 add_filter('admin_title', array($this, 'setAdminTitle')); 103 103 104 104 // Hide admin UI 105 105 add_action('admin_head', array($this, 'hideAdminUi')); 106 106 107 107 // Initialize controllers 108 108 $this->invoice_controller->init(); … … 113 113 $this->dashboard_controller->init(); 114 114 $this->payment_controller->init(); 115 115 116 116 // Main content hook 117 117 add_action('easy_invoice_admin_main_content', array($this, 'mainPageContent')); 118 118 } 119 119 120 120 /** 121 121 * Register admin menu pages … … 132 132 25 133 133 ); 134 134 135 135 // Dashboard submenu 136 136 add_submenu_page( … … 142 142 array($this, 'displayMainPage') 143 143 ); 144 144 145 145 // All invoices submenu 146 146 add_submenu_page( … … 152 152 array($this, 'displayMainPage') 153 153 ); 154 154 155 155 // Add new invoice submenu 156 156 add_submenu_page( … … 162 162 array($this, 'displayMainPage') 163 163 ); 164 164 165 165 // All quotes submenu 166 166 add_submenu_page( … … 172 172 array($this, 'displayMainPage') 173 173 ); 174 174 175 175 // Add new quote submenu 176 176 add_submenu_page( … … 182 182 array($this, 'displayMainPage') 183 183 ); 184 184 185 185 // Payments submenu 186 186 add_submenu_page( … … 192 192 array($this, 'displayMainPage') 193 193 ); 194 194 195 195 // Add new payment submenu 196 196 add_submenu_page( … … 202 202 array($this, 'displayMainPage') 203 203 ); 204 204 205 205 // Clients submenu 206 206 add_submenu_page( … … 212 212 array($this, 'displayMainPage') 213 213 ); 214 214 215 215 // Hidden submenu pages - not shown in the menu but accessible 216 216 add_submenu_page( … … 222 222 array($this, 'displayMainPage') 223 223 ); 224 224 225 225 add_submenu_page( 226 226 'easy-invoice', // Use main menu as parent to avoid title issues … … 231 231 array($this, 'displayMainPage') 232 232 ); 233 233 234 234 add_submenu_page( 235 235 'easy-invoice', // Use main menu as parent to avoid title issues … … 240 240 array($this, 'displayPreviewPage') 241 241 ); 242 242 243 243 add_submenu_page( 244 244 'easy-invoice', // Use main menu as parent to avoid title issues … … 249 249 array($this, 'displayMainPage') 250 250 ); 251 251 252 252 add_submenu_page( 253 253 'easy-invoice', … … 267 267 array($this, 'displayMainPage') 268 268 ); 269 269 270 270 // Email Settings submenu items - these will appear as submenu items under Email Settings 271 271 add_submenu_page( … … 277 277 array($this, 'displayMainPage') 278 278 ); 279 279 280 280 add_submenu_page( 281 281 PagesSlugs::EMAIL_SETTINGS, // Parent is Email Settings … … 286 286 array($this, 'displayMainPage') 287 287 ); 288 288 289 289 add_submenu_page( 290 290 PagesSlugs::EMAIL_SETTINGS, // Parent is Email Settings … … 295 295 array($this, 'displayMainPage') 296 296 ); 297 297 298 298 add_submenu_page( 299 299 PagesSlugs::EMAIL_SETTINGS, // Parent is Email Settings … … 304 304 array($this, 'displayMainPage') 305 305 ); 306 306 307 307 add_submenu_page( 308 308 PagesSlugs::EMAIL_SETTINGS, // Parent is Email Settings … … 313 313 array($this, 'displayMainPage') 314 314 ); 315 315 316 316 // Settings submenu 317 317 add_submenu_page( … … 323 323 array($this, 'displayMainPage') 324 324 ); 325 325 326 326 // License submenu 327 327 add_submenu_page( … … 333 333 array($this, 'displayMainPage') 334 334 ); 335 335 336 336 // Free vs Pro submenu - only show in free version 337 337 if (!easy_invoice_has_pro()) { … … 346 346 } 347 347 } 348 348 349 349 /** 350 350 * Register invoice preview page … … 353 353 //add_action('admin_action_easy_invoice_preview', array($this, 'displayPreviewPage')); 354 354 } 355 355 356 356 /** 357 357 * Display main page … … 360 360 include EASY_INVOICE_PLUGIN_DIR . 'templates/main-template.php'; 361 361 } 362 362 363 363 /** 364 364 * Display preview page … … 367 367 $this->invoice_controller->display(['page' => PagesSlugs::INVOICE_PREVIEW]); 368 368 } 369 369 370 370 /** 371 371 * Display license page … … 374 374 include EASY_INVOICE_PLUGIN_DIR . 'templates/admin/license-page.php'; 375 375 } 376 376 377 377 /** 378 378 * Handle main page content based on the current page … … 385 385 $this->dashboard_controller->display(['page' => PagesSlugs::DASHBOARD]); 386 386 break; 387 387 388 388 case PagesSlugs::ALL_INVOICES: 389 389 $this->invoice_controller->display(['page' => PagesSlugs::ALL_INVOICES]); 390 390 break; 391 391 392 392 case PagesSlugs::INVOICE_NEW: 393 393 $this->invoice_controller->display(['page' => PagesSlugs::INVOICE_NEW]); 394 394 break; 395 395 396 396 case PagesSlugs::INVOICE_PREVIEW: 397 397 $this->invoice_controller->display(['page' => PagesSlugs::INVOICE_PREVIEW]); 398 398 break; 399 399 400 400 case PagesSlugs::ALL_QUOTES: 401 401 $this->quote_controller->display(['page' => PagesSlugs::ALL_QUOTES]); 402 402 break; 403 403 404 404 case PagesSlugs::QUOTE_NEW: 405 405 $this->quote_controller->display(['page' => PagesSlugs::QUOTE_NEW]); 406 406 break; 407 407 408 408 case PagesSlugs::QUOTE_PREVIEW: 409 409 $this->quote_controller->display(['page' => PagesSlugs::QUOTE_PREVIEW]); 410 410 break; 411 411 412 412 case PagesSlugs::PAYMENTS: 413 413 if (isset($_GET['action'])) { … … 417 417 } 418 418 break; 419 419 420 420 case PagesSlugs::PAYMENT_NEW: 421 421 $this->payment_controller->display(['page' => PagesSlugs::PAYMENT_NEW]); 422 422 break; 423 423 424 424 case PagesSlugs::CLIENTS: 425 425 $this->client_controller->display(['page' => PagesSlugs::CLIENTS]); 426 426 break; 427 427 428 428 case PagesSlugs::CLIENT_EDIT: 429 429 $this->client_controller->display(['page' => PagesSlugs::CLIENT_EDIT]); 430 430 break; 431 431 432 432 case PagesSlugs::CLIENT_VIEW: 433 433 $this->client_controller->display(['page' => PagesSlugs::CLIENT_VIEW]); 434 434 break; 435 435 436 436 case PagesSlugs::REPORTS: 437 437 $this->report_controller->display(['page' => PagesSlugs::REPORTS]); 438 438 break; 439 439 440 440 case PagesSlugs::SETTINGS: 441 441 $this->settings_controller->display(['page' => PagesSlugs::SETTINGS]); 442 442 break; 443 443 444 444 case PagesSlugs::LICENSE: 445 445 $this->displayLicensePage(); 446 446 break; 447 447 448 448 case PagesSlugs::EMAIL_SETTINGS: 449 449 case PagesSlugs::EMAIL_SETTINGS_GENERAL: … … 453 453 $this->settings_controller->display(['page' => PagesSlugs::SETTINGS, 'subsection' => $page]); 454 454 break; 455 455 456 456 case 'easy-invoice-migration': 457 include EASY_INVOICE_PLUGIN_DIR . 'includes/ migration/templates/migration-page.php';458 break; 459 457 include EASY_INVOICE_PLUGIN_DIR . 'includes/Migration/templates/migration-page.php'; 458 break; 459 460 460 case 'easy-invoice-free-vs-pro': 461 461 include EASY_INVOICE_PLUGIN_DIR . 'templates/admin/free-vs-pro-page.php'; 462 462 break; 463 463 464 464 default: 465 465 $this->dashboard_controller->display(['page' => PagesSlugs::DASHBOARD]); … … 467 467 } 468 468 } 469 469 470 470 /** 471 471 * Set proper admin title to avoid WordPress core issues 472 * 472 * 473 473 * @param string $title The current admin title 474 474 * @return string The modified admin title … … 476 476 public function setAdminTitle($title) { 477 477 $current_page = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : ''; 478 478 479 479 // Only modify titles for our plugin pages 480 480 if (strpos($current_page, 'easy-invoice') === 0 || strpos($current_page, 'easy-quote') === 0) { … … 498 498 'easy-invoice-free-vs-pro' => __('Free vs Pro', 'easy-invoice'), 499 499 ]; 500 500 501 501 if (isset($page_titles[$current_page])) { 502 502 return $page_titles[$current_page] . ' - ' . get_bloginfo('name'); 503 503 } 504 504 } 505 505 506 506 return $title; 507 507 } 508 508 509 509 /** 510 510 * Hide the WordPress admin UI for our custom pages -
easy-invoice/tags/2.0.3/readme.txt
r3346980 r3347111 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 2.0. 27 Stable tag: 2.0.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 135 135 == Changelog == 136 136 137 = 2.0.3 - 2025-08-19 = 138 * Fixed - migration issue fixed 137 139 138 140 = 2.0.2 - 2025-08-19 = -
easy-invoice/trunk/easy-invoice.php
r3346980 r3347111 4 4 * Plugin URI: https://matrixaddons.com/plugins/easy-invoice 5 5 * Description: A beautiful, full-featured invoicing solution for WordPress. Create professional invoices, quotes, and manage payments with ease. 6 * Version: 2.0. 26 * Version: 2.0.3 7 7 * Author: MatrixAddons 8 8 * Author URI: https://matrixaddons.com … … 25 25 26 26 // Define plugin constants. 27 define( 'EASY_INVOICE_VERSION', '2.0. 2' );27 define( 'EASY_INVOICE_VERSION', '2.0.3' ); 28 28 define( 'EASY_INVOICE_PLUGIN_FILE', __FILE__ ); 29 29 define( 'EASY_INVOICE_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); … … 56 56 $plugin = \EasyInvoice\EasyInvoice::getInstance(); 57 57 $plugin->init(); 58 58 59 59 // Initialize service providers. 60 60 $invoice_service_provider = new \EasyInvoice\Providers\InvoiceServiceProvider(); … … 66 66 $client_service_provider = new \EasyInvoice\Providers\ClientServiceProvider(); 67 67 $client_service_provider->register(); 68 68 69 69 $invoice_number_service_provider = new \EasyInvoice\Providers\InvoiceNumberServiceProvider(); 70 70 $invoice_number_service_provider->register(); 71 71 72 72 $quote_number_service_provider = new \EasyInvoice\Providers\QuoteNumberServiceProvider(); 73 73 $quote_number_service_provider->register(); 74 74 75 75 $quote_service_provider = new \EasyInvoice\Providers\QuoteServiceProvider(); 76 76 $quote_service_provider->register(); 77 77 78 78 // Initialize EmailManager 79 79 $email_manager = \EasyInvoice\Services\EmailManager::getInstance(); 80 80 81 81 // Initialize form manager 82 82 //$form_manager = \EasyInvoice\Forms\FormManager::getInstance(); 83 83 // $form_manager->setInvoiceNumberServiceProvider($invoice_number_service_provider); 84 84 85 85 // Initialize controllers. 86 86 $payment_controller = new \EasyInvoice\Controllers\PaymentController(); 87 87 $payment_controller->init(); 88 88 89 89 $settings_controller = new \EasyInvoice\Controllers\SettingsController(); 90 90 $settings_controller->init(); 91 91 92 92 $quote_controller = new \EasyInvoice\Controllers\QuoteController(); 93 93 $quote_controller->init(); 94 94 95 95 // Initialize shortcode manager 96 96 $shortcode_manager = new \EasyInvoice\Shortcodes\ShortcodeManager(); 97 97 98 98 } 99 99 add_action( 'init', 'easy_invoice_init' ); … … 103 103 */ 104 104 function easy_invoice_payment_gateway_log_handler($message, $level, $gateway_name) { 105 $log_message = sprintf('[%s] Easy Invoice %s Gateway: %s', 106 date('Y-m-d H:i:s'), 107 ucfirst($gateway_name), 105 $log_message = sprintf('[%s] Easy Invoice %s Gateway: %s', 106 date('Y-m-d H:i:s'), 107 ucfirst($gateway_name), 108 108 $message 109 109 ); 110 110 111 111 if (defined('WP_DEBUG') && WP_DEBUG) { 112 112 error_log($log_message); … … 117 117 // Initialize migration system 118 118 if ( class_exists( 'EasyInvoice\Migration\MigrationInit' ) ) { 119 119 120 EasyInvoice\Migration\MigrationInit::init(); 120 121 } … … 155 156 // Initialization of post types so rewrite rules can be flushed properly. 156 157 \EasyInvoice\EasyInvoice::getInstance()->registerPostTypes(); 157 158 158 159 // Initialize default settings 159 160 $settings_controller = new \EasyInvoice\Controllers\SettingsController(); 160 161 $settings_controller->initializeSettings(); 161 162 162 163 // Record first install timestamp (do not overwrite if it already exists) 163 164 if (!get_option('easy_invoice_installed')) { 164 165 update_option('easy_invoice_installed', current_time('mysql')); 165 166 } 166 167 167 168 // Check if this is a fresh installation or an upgrade 168 169 $stored_version = get_option('easy_invoice_version', ''); 169 170 170 171 // If no version is stored, this is a fresh installation 171 172 if (empty($stored_version)) { … … 175 176 // This is an upgrade. Do NOT bump version here; migration will set it when completed. 176 177 } 177 178 178 179 // Flush rewrite rules. 179 180 flush_rewrite_rules(); … … 190 191 // Flush rewrite rules. 191 192 flush_rewrite_rules(); 192 193 193 194 // Clear scheduled events 194 195 \EasyInvoice\Services\QuoteExpirationService::clear_schedule(); -
easy-invoice/trunk/includes/Admin/EasyInvoiceAdmin.php
r3344524 r3347111 25 25 /** 26 26 * Invoice controller instance 27 * 27 * 28 28 * @var InvoiceController 29 29 */ 30 30 private $invoice_controller; 31 31 32 32 /** 33 33 * Quote controller instance 34 * 34 * 35 35 * @var QuoteController 36 36 */ 37 37 private $quote_controller; 38 38 39 39 /** 40 40 * Client controller instance 41 * 41 * 42 42 * @var ClientController 43 43 */ 44 44 private $client_controller; 45 45 46 46 /** 47 47 * Settings controller instance 48 * 48 * 49 49 * @var SettingsController 50 50 */ 51 51 private $settings_controller; 52 52 53 53 /** 54 54 * Report controller instance 55 * 55 * 56 56 * @var ReportController 57 57 */ 58 58 private $report_controller; 59 59 60 60 /** 61 61 * Dashboard controller instance 62 * 62 * 63 63 * @var DashboardController 64 64 */ 65 65 private $dashboard_controller; 66 66 67 67 /** 68 68 * Payment controller instance 69 * 69 * 70 70 * @var PaymentController 71 71 */ 72 72 private $payment_controller; 73 73 74 74 /** 75 75 * Constructor … … 84 84 $this->payment_controller = new PaymentController(); 85 85 } 86 86 87 87 /** 88 88 * Initialize the admin class … … 91 91 // Add menu items 92 92 add_action('admin_menu', array($this, 'registerMenuPages')); 93 93 94 94 // Register admin assets 95 95 $admin_assets = new AdminAssets(); 96 96 $admin_assets->register(); 97 97 98 98 // Register invoice preview page 99 99 add_action('admin_init', array($this, 'registerPreviewPage')); 100 100 101 101 // Ensure proper page titles to avoid WordPress core issues 102 102 add_filter('admin_title', array($this, 'setAdminTitle')); 103 103 104 104 // Hide admin UI 105 105 add_action('admin_head', array($this, 'hideAdminUi')); 106 106 107 107 // Initialize controllers 108 108 $this->invoice_controller->init(); … … 113 113 $this->dashboard_controller->init(); 114 114 $this->payment_controller->init(); 115 115 116 116 // Main content hook 117 117 add_action('easy_invoice_admin_main_content', array($this, 'mainPageContent')); 118 118 } 119 119 120 120 /** 121 121 * Register admin menu pages … … 132 132 25 133 133 ); 134 134 135 135 // Dashboard submenu 136 136 add_submenu_page( … … 142 142 array($this, 'displayMainPage') 143 143 ); 144 144 145 145 // All invoices submenu 146 146 add_submenu_page( … … 152 152 array($this, 'displayMainPage') 153 153 ); 154 154 155 155 // Add new invoice submenu 156 156 add_submenu_page( … … 162 162 array($this, 'displayMainPage') 163 163 ); 164 164 165 165 // All quotes submenu 166 166 add_submenu_page( … … 172 172 array($this, 'displayMainPage') 173 173 ); 174 174 175 175 // Add new quote submenu 176 176 add_submenu_page( … … 182 182 array($this, 'displayMainPage') 183 183 ); 184 184 185 185 // Payments submenu 186 186 add_submenu_page( … … 192 192 array($this, 'displayMainPage') 193 193 ); 194 194 195 195 // Add new payment submenu 196 196 add_submenu_page( … … 202 202 array($this, 'displayMainPage') 203 203 ); 204 204 205 205 // Clients submenu 206 206 add_submenu_page( … … 212 212 array($this, 'displayMainPage') 213 213 ); 214 214 215 215 // Hidden submenu pages - not shown in the menu but accessible 216 216 add_submenu_page( … … 222 222 array($this, 'displayMainPage') 223 223 ); 224 224 225 225 add_submenu_page( 226 226 'easy-invoice', // Use main menu as parent to avoid title issues … … 231 231 array($this, 'displayMainPage') 232 232 ); 233 233 234 234 add_submenu_page( 235 235 'easy-invoice', // Use main menu as parent to avoid title issues … … 240 240 array($this, 'displayPreviewPage') 241 241 ); 242 242 243 243 add_submenu_page( 244 244 'easy-invoice', // Use main menu as parent to avoid title issues … … 249 249 array($this, 'displayMainPage') 250 250 ); 251 251 252 252 add_submenu_page( 253 253 'easy-invoice', … … 267 267 array($this, 'displayMainPage') 268 268 ); 269 269 270 270 // Email Settings submenu items - these will appear as submenu items under Email Settings 271 271 add_submenu_page( … … 277 277 array($this, 'displayMainPage') 278 278 ); 279 279 280 280 add_submenu_page( 281 281 PagesSlugs::EMAIL_SETTINGS, // Parent is Email Settings … … 286 286 array($this, 'displayMainPage') 287 287 ); 288 288 289 289 add_submenu_page( 290 290 PagesSlugs::EMAIL_SETTINGS, // Parent is Email Settings … … 295 295 array($this, 'displayMainPage') 296 296 ); 297 297 298 298 add_submenu_page( 299 299 PagesSlugs::EMAIL_SETTINGS, // Parent is Email Settings … … 304 304 array($this, 'displayMainPage') 305 305 ); 306 306 307 307 add_submenu_page( 308 308 PagesSlugs::EMAIL_SETTINGS, // Parent is Email Settings … … 313 313 array($this, 'displayMainPage') 314 314 ); 315 315 316 316 // Settings submenu 317 317 add_submenu_page( … … 323 323 array($this, 'displayMainPage') 324 324 ); 325 325 326 326 // License submenu 327 327 add_submenu_page( … … 333 333 array($this, 'displayMainPage') 334 334 ); 335 335 336 336 // Free vs Pro submenu - only show in free version 337 337 if (!easy_invoice_has_pro()) { … … 346 346 } 347 347 } 348 348 349 349 /** 350 350 * Register invoice preview page … … 353 353 //add_action('admin_action_easy_invoice_preview', array($this, 'displayPreviewPage')); 354 354 } 355 355 356 356 /** 357 357 * Display main page … … 360 360 include EASY_INVOICE_PLUGIN_DIR . 'templates/main-template.php'; 361 361 } 362 362 363 363 /** 364 364 * Display preview page … … 367 367 $this->invoice_controller->display(['page' => PagesSlugs::INVOICE_PREVIEW]); 368 368 } 369 369 370 370 /** 371 371 * Display license page … … 374 374 include EASY_INVOICE_PLUGIN_DIR . 'templates/admin/license-page.php'; 375 375 } 376 376 377 377 /** 378 378 * Handle main page content based on the current page … … 385 385 $this->dashboard_controller->display(['page' => PagesSlugs::DASHBOARD]); 386 386 break; 387 387 388 388 case PagesSlugs::ALL_INVOICES: 389 389 $this->invoice_controller->display(['page' => PagesSlugs::ALL_INVOICES]); 390 390 break; 391 391 392 392 case PagesSlugs::INVOICE_NEW: 393 393 $this->invoice_controller->display(['page' => PagesSlugs::INVOICE_NEW]); 394 394 break; 395 395 396 396 case PagesSlugs::INVOICE_PREVIEW: 397 397 $this->invoice_controller->display(['page' => PagesSlugs::INVOICE_PREVIEW]); 398 398 break; 399 399 400 400 case PagesSlugs::ALL_QUOTES: 401 401 $this->quote_controller->display(['page' => PagesSlugs::ALL_QUOTES]); 402 402 break; 403 403 404 404 case PagesSlugs::QUOTE_NEW: 405 405 $this->quote_controller->display(['page' => PagesSlugs::QUOTE_NEW]); 406 406 break; 407 407 408 408 case PagesSlugs::QUOTE_PREVIEW: 409 409 $this->quote_controller->display(['page' => PagesSlugs::QUOTE_PREVIEW]); 410 410 break; 411 411 412 412 case PagesSlugs::PAYMENTS: 413 413 if (isset($_GET['action'])) { … … 417 417 } 418 418 break; 419 419 420 420 case PagesSlugs::PAYMENT_NEW: 421 421 $this->payment_controller->display(['page' => PagesSlugs::PAYMENT_NEW]); 422 422 break; 423 423 424 424 case PagesSlugs::CLIENTS: 425 425 $this->client_controller->display(['page' => PagesSlugs::CLIENTS]); 426 426 break; 427 427 428 428 case PagesSlugs::CLIENT_EDIT: 429 429 $this->client_controller->display(['page' => PagesSlugs::CLIENT_EDIT]); 430 430 break; 431 431 432 432 case PagesSlugs::CLIENT_VIEW: 433 433 $this->client_controller->display(['page' => PagesSlugs::CLIENT_VIEW]); 434 434 break; 435 435 436 436 case PagesSlugs::REPORTS: 437 437 $this->report_controller->display(['page' => PagesSlugs::REPORTS]); 438 438 break; 439 439 440 440 case PagesSlugs::SETTINGS: 441 441 $this->settings_controller->display(['page' => PagesSlugs::SETTINGS]); 442 442 break; 443 443 444 444 case PagesSlugs::LICENSE: 445 445 $this->displayLicensePage(); 446 446 break; 447 447 448 448 case PagesSlugs::EMAIL_SETTINGS: 449 449 case PagesSlugs::EMAIL_SETTINGS_GENERAL: … … 453 453 $this->settings_controller->display(['page' => PagesSlugs::SETTINGS, 'subsection' => $page]); 454 454 break; 455 455 456 456 case 'easy-invoice-migration': 457 include EASY_INVOICE_PLUGIN_DIR . 'includes/ migration/templates/migration-page.php';458 break; 459 457 include EASY_INVOICE_PLUGIN_DIR . 'includes/Migration/templates/migration-page.php'; 458 break; 459 460 460 case 'easy-invoice-free-vs-pro': 461 461 include EASY_INVOICE_PLUGIN_DIR . 'templates/admin/free-vs-pro-page.php'; 462 462 break; 463 463 464 464 default: 465 465 $this->dashboard_controller->display(['page' => PagesSlugs::DASHBOARD]); … … 467 467 } 468 468 } 469 469 470 470 /** 471 471 * Set proper admin title to avoid WordPress core issues 472 * 472 * 473 473 * @param string $title The current admin title 474 474 * @return string The modified admin title … … 476 476 public function setAdminTitle($title) { 477 477 $current_page = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : ''; 478 478 479 479 // Only modify titles for our plugin pages 480 480 if (strpos($current_page, 'easy-invoice') === 0 || strpos($current_page, 'easy-quote') === 0) { … … 498 498 'easy-invoice-free-vs-pro' => __('Free vs Pro', 'easy-invoice'), 499 499 ]; 500 500 501 501 if (isset($page_titles[$current_page])) { 502 502 return $page_titles[$current_page] . ' - ' . get_bloginfo('name'); 503 503 } 504 504 } 505 505 506 506 return $title; 507 507 } 508 508 509 509 /** 510 510 * Hide the WordPress admin UI for our custom pages -
easy-invoice/trunk/readme.txt
r3346980 r3347111 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 2.0. 27 Stable tag: 2.0.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 135 135 == Changelog == 136 136 137 = 2.0.3 - 2025-08-19 = 138 * Fixed - migration issue fixed 137 139 138 140 = 2.0.2 - 2025-08-19 =
Note: See TracChangeset
for help on using the changeset viewer.