| @@ -7,10 +7,13 @@ | ||
| 7 | 7 | * @package EasyInvoice |
| 8 | 8 | * @since 1.0.0 |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | + exit; | |
| 13 | +} | |
| 11 | 14 | // Get current page |
| 12 | -$current_page = $_GET['page'] ?? ''; | |
| 15 | +$current_page = isset($_GET['page']) ? sanitize_key(wp_unslash($_GET['page'])) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 13 | 16 | |
| 14 | 17 | // Check if Pro plugin wants to override the content |
| 15 | 18 | $pro_content = apply_filters('easy_invoice_license_page_content', ''); |
| 16 | 19 | ?> |
| @@ -17,22 +20,19 @@ | ||
| 17 | 20 | |
| 18 | 21 | <div class="wrap easy-invoice-admin"> |
| 19 | 22 | <div class="easy-invoice-content"> |
| 20 | 23 | <?php if (!empty($pro_content)): ?> |
| 21 | - <!-- Pro plugin has provided content --> | |
| 22 | - <?php echo $pro_content; ?> | |
| 24 | + <?php echo $pro_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- markup rendered by Easy Invoice Pro's license screen. ?> | |
| 23 | 25 | <?php else: ?> |
| 24 | - <!-- Free Version Message --> | |
| 25 | 26 | <div class="free-version-card"> |
| 26 | 27 | <div class="card-header"> |
| 27 | - <h2><?php _e('You\'re Using the Free Version', 'easy-invoice'); ?></h2> | |
| 28 | - <p><?php _e('No license activation required. You can continue using all free features.', 'easy-invoice'); ?></p> | |
| 28 | + <h2><?php esc_html_e('You\'re Using the Free Version', 'easy-invoice'); ?></h2> | |
| 29 | + <p><?php esc_html_e('No license activation required. You can continue using all free features.', 'easy-invoice'); ?></p> | |
| 29 | 30 | </div> |
| 30 | 31 | |
| 31 | 32 | <div class="card-content"> |
| 32 | - <!-- Premium Features List --> | |
| 33 | 33 | <div class="premium-features"> |
| 34 | - <h3><?php _e('Upgrade to Pro and Unlock These Premium Features:', 'easy-invoice'); ?></h3> | |
| 34 | + <h3><?php esc_html_e('Upgrade to Pro and Unlock These Premium Features:', 'easy-invoice'); ?></h3> | |
| 35 | 35 | <div class="features-grid"> |
| 36 | 36 | <div class="feature-item"> |
| 37 | 37 | <div class="feature-icon"> |
| 38 | 38 | <svg class="w-6 h-6" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| @@ -40,10 +40,10 @@ | ||
| 40 | 40 | <path d="M17 5H9.5C8.57174 5 7.6815 5.36875 7.02513 6.02513C6.36875 6.6815 6 7.57174 6 8.5C6 9.42826 6.36875 10.3185 7.02513 10.9749C7.6815 11.6313 8.57174 12 9.5 12H14.5C15.4283 12 16.3185 12.3687 16.9749 13.0251C17.6313 13.6815 18 14.5717 18 15.5C18 16.4283 17.6313 17.3185 16.9749 17.9749C16.3185 18.6313 15.4283 19 14.5 19H6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> |
| 41 | 41 | </svg> |
| 42 | 42 | </div> |
| 43 | 43 | <div class="feature-content"> |
| 44 | - <h4><?php _e('Recurring Invoices', 'easy-invoice'); ?></h4> | |
| 45 | - <p><?php _e('Automatically generate and send recurring invoices on schedule.', 'easy-invoice'); ?></p> | |
| 44 | + <h4><?php esc_html_e('Recurring Invoices', 'easy-invoice'); ?></h4> | |
| 45 | + <p><?php esc_html_e('Automatically generate and send recurring invoices on schedule.', 'easy-invoice'); ?></p> | |
| 46 | 46 | </div> |
| 47 | 47 | </div> |
| 48 | 48 | |
| 49 | 49 | <div class="feature-item"> |
| @@ -53,10 +53,10 @@ | ||
| 53 | 53 | <path d="M14 2V8H20" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> |
| 54 | 54 | </svg> |
| 55 | 55 | </div> |
| 56 | 56 | <div class="feature-content"> |
| 57 | - <h4><?php _e('Advanced PDF Customization', 'easy-invoice'); ?></h4> | |
| 58 | - <p><?php _e('Customize PDF templates with your branding, colors, and layout preferences.', 'easy-invoice'); ?></p> | |
| 57 | + <h4><?php esc_html_e('Advanced PDF Customization', 'easy-invoice'); ?></h4> | |
| 58 | + <p><?php esc_html_e('Customize PDF templates with your branding, colors, and layout preferences.', 'easy-invoice'); ?></p> | |
| 59 | 59 | </div> |
| 60 | 60 | </div> |
| 61 | 61 | |
| 62 | 62 | <div class="feature-item"> |
| @@ -66,10 +66,10 @@ | ||
| 66 | 66 | <circle cx="9" cy="7" r="4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> |
| 67 | 67 | </svg> |
| 68 | 68 | </div> |
| 69 | 69 | <div class="feature-content"> |
| 70 | - <h4><?php _e('Multiple Payment Gateways', 'easy-invoice'); ?></h4> | |
| 71 | - <p><?php _e('Accept payments via PayPal, Stripe, Square, Authorize.Net, and more.', 'easy-invoice'); ?></p> | |
| 70 | + <h4><?php esc_html_e('Multiple Payment Gateways', 'easy-invoice'); ?></h4> | |
| 71 | + <p><?php esc_html_e('Accept payments via PayPal, Stripe, Square, Authorize.Net, and more.', 'easy-invoice'); ?></p> | |
| 72 | 72 | </div> |
| 73 | 73 | </div> |
| 74 | 74 | |
| 75 | 75 | <div class="feature-item"> |
| @@ -81,10 +81,10 @@ | ||
| 81 | 81 | <line x1="3" y1="10" x2="21" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> |
| 82 | 82 | </svg> |
| 83 | 83 | </div> |
| 84 | 84 | <div class="feature-content"> |
| 85 | - <h4><?php _e('Partial Payments', 'easy-invoice'); ?></h4> | |
| 86 | - <p><?php _e('Allow customers to pay invoices in installments with flexible payment options.', 'easy-invoice'); ?></p> | |
| 85 | + <h4><?php esc_html_e('Partial Payments', 'easy-invoice'); ?></h4> | |
| 86 | + <p><?php esc_html_e('Allow customers to pay invoices in installments with flexible payment options.', 'easy-invoice'); ?></p> | |
| 87 | 87 | </div> |
| 88 | 88 | </div> |
| 89 | 89 | |
| 90 | 90 | <div class="feature-item"> |
| @@ -95,10 +95,10 @@ | ||
| 95 | 95 | <path d="M23 21V19C23 18.1137 22.6485 17.2628 22.0237 16.6425C21.3989 16.0221 20.5471 15.6722 19.66 15.6722C18.7729 15.6722 17.9211 16.0221 17.2963 16.6425C16.6715 17.2628 16.32 18.1137 16.32 19V21" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> |
| 96 | 96 | </svg> |
| 97 | 97 | </div> |
| 98 | 98 | <div class="feature-content"> |
| 99 | - <h4><?php _e('Client Portal', 'easy-invoice'); ?></h4> | |
| 100 | - <p><?php _e('Give clients access to view invoices, make payments, and manage their account.', 'easy-invoice'); ?></p> | |
| 99 | + <h4><?php esc_html_e('Client Portal', 'easy-invoice'); ?></h4> | |
| 100 | + <p><?php esc_html_e('Give clients access to view invoices, make payments, and manage their account.', 'easy-invoice'); ?></p> | |
| 101 | 101 | </div> |
| 102 | 102 | </div> |
| 103 | 103 | |
| 104 | 104 | <div class="feature-item"> |
| @@ -109,10 +109,10 @@ | ||
| 109 | 109 | <path d="M6 20V14" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> |
| 110 | 110 | </svg> |
| 111 | 111 | </div> |
| 112 | 112 | <div class="feature-content"> |
| 113 | - <h4><?php _e('Advanced Reports', 'easy-invoice'); ?></h4> | |
| 114 | - <p><?php _e('Detailed analytics, revenue reports, and business insights.', 'easy-invoice'); ?></p> | |
| 113 | + <h4><?php esc_html_e('Advanced Reports', 'easy-invoice'); ?></h4> | |
| 114 | + <p><?php esc_html_e('Detailed analytics, revenue reports, and business insights.', 'easy-invoice'); ?></p> | |
| 115 | 115 | </div> |
| 116 | 116 | </div> |
| 117 | 117 | </div> |
| 118 | 118 | </div> |
| @@ -118,9 +118,9 @@ | ||
| 118 | 118 | </div> |
| 119 | 119 | |
| 120 | 120 | <div class="upgrade-actions"> |
| 121 | 121 | <a href="https://matrixaddons.com/plugins/easy-invoice/#free-vs-pro" target="_blank" class="upgrade-button"> |
| 122 | - <?php _e('Upgrade to Pro', 'easy-invoice'); ?> | |
| 122 | + <?php esc_html_e('Upgrade to Pro', 'easy-invoice'); ?> | |
| 123 | 123 | </a> |
| 124 | 124 | </div> |
| 125 | 125 | </div> |
| 126 | 126 | </div> |
| @@ -129,18 +129,45 @@ | ||
| 129 | 129 | </div> |
| 130 | 130 | |
| 131 | 131 | <style> |
| 132 | 132 | /* License Page Styles */ |
| 133 | -.easy-invoice-admin { | |
| 133 | + | |
| 134 | +/* | |
| 135 | + * These used to target `.easy-invoice-admin` and `.easy-invoice-content` directly. | |
| 136 | + * Both are global app-shell classes used by every Easy Invoice screen, so this | |
| 137 | + * page-specific stylesheet was restyling the whole shell — it just happened to | |
| 138 | + * only load here. | |
| 139 | + * | |
| 140 | + * The damage: `.easy-invoice-admin` is a flex item (`flex: 1`, see | |
| 141 | + * templates/main-template.php) whose default `min-width: auto` means it cannot | |
| 142 | + * shrink below its content. Adding 20px of horizontal padding here pushed its | |
| 143 | + * min-content width to 439px, so on a 390px phone the licence screen — and only | |
| 144 | + * the licence screen — overflowed by 49px. | |
| 145 | + * | |
| 146 | + * Scoped to this page's own container instead, with the padding kept but no | |
| 147 | + * longer able to inflate the shell. | |
| 148 | + */ | |
| 149 | +.easy-invoice-license-manager { | |
| 134 | 150 | max-width: 1000px; |
| 135 | 151 | margin: 0 auto; |
| 136 | 152 | padding: 20px; |
| 153 | + /* A flex item must be allowed to shrink below its content, or long licence | |
| 154 | + keys and wide cards force the whole page wider than the viewport. */ | |
| 155 | + min-width: 0; | |
| 137 | 156 | } |
| 138 | 157 | |
| 139 | -.easy-invoice-content { | |
| 158 | +.easy-invoice-license-manager .easy-invoice-content, | |
| 159 | +.easy-invoice-license-manager.easy-invoice-content { | |
| 140 | 160 | display: flex; |
| 141 | 161 | flex-direction: column; |
| 142 | 162 | gap: 30px; |
| 163 | + min-width: 0; | |
| 164 | +} | |
| 165 | + | |
| 166 | +@media (max-width: 782px) { | |
| 167 | + .easy-invoice-license-manager { | |
| 168 | + padding: 12px; | |
| 169 | + } | |
| 143 | 170 | } |
| 144 | 171 | |
| 145 | 172 | /* Free Version Styles */ |
| 146 | 173 | .free-version-card { |