| @@ -134,9 +134,9 @@ | ||
| 134 | 134 | </a> |
| 135 | 135 | </div> |
| 136 | 136 | <?php if (KING_ADDONS_EXT_HEADER_FOOTER_BUILDER): ?> |
| 137 | 137 | <div class="kng-nav-item kng-nav-item-current"> |
| 138 | - <a href="<?php echo admin_url('edit.php?post_type=king-addons-el-hf'); ?>"> | |
| 138 | + <a href="<?php echo admin_url('admin.php?page=king-addons-el-hf'); ?>"> | |
| 139 | 139 | <div class="kng-nav-item-txt"><?php echo esc_html__('Free Header & Footer Builder', 'king-addons'); ?></div> |
| 140 | 140 | </a> |
| 141 | 141 | </div> |
| 142 | 142 | <?php endif; ?> |
| @@ -236,9 +236,9 @@ | ||
| 236 | 236 | <?php if (!$is_premium_active): ?> |
| 237 | 237 | <div class="promo-wrapper"> |
| 238 | 238 | <div class="promo-txt"><?php |
| 239 | 239 | esc_html_e('Unlock Premium Templates', 'king-addons'); |
| 240 | - echo '<ul><li>$4.99/month</li>'; | |
| 240 | + echo '<ul><li>$6.99/month</li>'; | |
| 241 | 241 | echo '<li>Unlimited Downloads</li>'; |
| 242 | 242 | echo '<li>Keep all templates forever</li></ul>'; |
| 243 | 243 | ?></div> |
| 244 | 244 | <a class="purchase-btn" |
| @@ -436,9 +436,9 @@ | ||
| 436 | 436 | |
| 437 | 437 | echo '<span class="pr-popup-title">Want This Premium Template?</span>'; |
| 438 | 438 | echo '<br><span class="pr-popup-desc">'; |
| 439 | 439 | echo 'Get <span class="pr-popup-desc-b">unlimited downloads</span> for just'; |
| 440 | - echo ' <span class="pr-popup-desc-b">$4.99/month'; | |
| 440 | + echo ' <span class="pr-popup-desc-b">$6.99/month'; | |
| 441 | 441 | echo '</span> — keep them <span class="pr-popup-desc-b">even after</span> your subscription ends!'; |
| 442 | 442 | echo '</span><span class="pr-popup-desc" style="font-size: 16px;opacity: 0.6;">Trusted by 20,000+ users</span>'; |
| 443 | 443 | ?></div> |
| 444 | 444 | <a class="purchase-btn" |
| @@ -768,8 +768,13 @@ | ||
| 768 | 768 | // Check if this is for existing page (from popup import) |
| 769 | 769 | $existing_page_id = isset($import_data['existing_page_id']) ? intval($import_data['existing_page_id']) : 0; |
| 770 | 770 | $create_new_page = isset($import_data['create_new_page']) ? (bool)$import_data['create_new_page'] : true; |
| 771 | 771 | |
| 772 | + if ($existing_page_id && !current_user_can('edit_post', $existing_page_id)) { | |
| 773 | + wp_send_json_error('Insufficient permissions'); | |
| 774 | + return; | |
| 775 | + } | |
| 776 | + | |
| 772 | 777 | delete_transient('elementor_import_content'); |
| 773 | 778 | delete_transient('elementor_import_images'); |
| 774 | 779 | delete_transient('elementor_import_total_images'); |
| 775 | 780 | delete_transient('elementor_import_images_processed'); |
| @@ -788,9 +793,9 @@ | ||
| 788 | 793 | set_transient('elementor_import_elementor_version', $elementor_version, 60 * 60); |
| 789 | 794 | set_transient('elementor_import_existing_page_id', $existing_page_id, 60 * 60); |
| 790 | 795 | set_transient('elementor_import_create_new_page', $create_new_page, 60 * 60); |
| 791 | 796 | |
| 792 | - error_log('King Addons Import: Initialized ' . ($create_new_page ? 'new page' : 'existing page') . ' import. Existing page ID: ' . $existing_page_id); | |
| 797 | + // error_log('King Addons Import: Initialized ' . ($create_new_page ? 'new page' : 'existing page') . ' import. Existing page ID: ' . $existing_page_id); | |
| 793 | 798 | |
| 794 | 799 | wp_send_json_success([ |
| 795 | 800 | 'message' => 'Import initialized.', |
| 796 | 801 | 'images' => $image_data, |
| @@ -991,9 +996,9 @@ | ||
| 991 | 996 | // New behavior - for existing page, just signal completion |
| 992 | 997 | // Content and images are processed and stored in transients |
| 993 | 998 | // Will be merged by king_addons_merge_with_existing_page endpoint |
| 994 | 999 | |
| 995 | - error_log('King Addons Import: Image processing completed for existing page. Content ready for merge.'); | |
| 1000 | + // error_log('King Addons Import: Image processing completed for existing page. Content ready for merge.'); | |
| 996 | 1001 | |
| 997 | 1002 | wp_send_json_success([ |
| 998 | 1003 | 'message' => "Image processing completed! Content ready for merge.", |
| 999 | 1004 | 'images_processed' => $images_processed, |
| @@ -1099,9 +1104,9 @@ | ||
| 1099 | 1104 | } |
| 1100 | 1105 | |
| 1101 | 1106 | return $attach_id; |
| 1102 | 1107 | } catch (Exception $e) { |
| 1103 | - error_log('[KING_ADDONS_ERROR] ' . $e->getMessage()); | |
| 1108 | + // error_log('[KING_ADDONS_ERROR] ' . $e->getMessage()); | |
| 1104 | 1109 | return false; |
| 1105 | 1110 | } |
| 1106 | 1111 | } |
| 1107 | 1112 | |
| @@ -1287,15 +1292,15 @@ | ||
| 1287 | 1292 | } else { |
| 1288 | 1293 | $install_id = 0; |
| 1289 | 1294 | } |
| 1290 | 1295 | |
| 1291 | - error_log('King Addons Premium Section: Using install_id: ' . $install_id . ' for premium section: ' . $section_key); | |
| 1296 | + // error_log('King Addons Premium Section: Using install_id: ' . $install_id . ' for premium section: ' . $section_key); | |
| 1292 | 1297 | } elseif ($section_plan === 'free') { |
| 1293 | 1298 | $api_url = 'https://api.kingaddons.com/get-section-free.php'; |
| 1294 | 1299 | $install_id = 0; |
| 1295 | - error_log('King Addons Free Section: Fetching free section: ' . $section_key); | |
| 1300 | + // error_log('King Addons Free Section: Fetching free section: ' . $section_key); | |
| 1296 | 1301 | } else { |
| 1297 | - error_log('King Addons Section Error: Premium section requires premium license. Section: ' . $section_key . ', Plan: ' . $section_plan . ', Premium Active: ' . ($is_premium_active ? 'Yes' : 'No')); | |
| 1302 | + // error_log('King Addons Section Error: Premium section requires premium license. Section: ' . $section_key . ', Plan: ' . $section_plan . ', Premium Active: ' . ($is_premium_active ? 'Yes' : 'No')); | |
| 1298 | 1303 | wp_send_json_error('Premium section requires premium license'); |
| 1299 | 1304 | return; |
| 1300 | 1305 | } |
| 1301 | 1306 | |
| @@ -1316,12 +1321,12 @@ | ||
| 1316 | 1321 | |
| 1317 | 1322 | $body = wp_remote_retrieve_body($response); |
| 1318 | 1323 | $data = json_decode($body, true); |
| 1319 | 1324 | |
| 1320 | - error_log('King Addons Section API Response: ' . substr($body, 0, 500) . (strlen($body) > 500 ? '...' : '')); | |
| 1325 | + // error_log('King Addons Section API Response: ' . substr($body, 0, 500) . (strlen($body) > 500 ? '...' : '')); | |
| 1321 | 1326 | |
| 1322 | 1327 | if (!$data) { |
| 1323 | - error_log('King Addons Section Error: Failed to decode JSON response'); | |
| 1328 | + // error_log('King Addons Section Error: Failed to decode JSON response'); | |
| 1324 | 1329 | wp_send_json_error('Invalid JSON response from section API'); |
| 1325 | 1330 | return; |
| 1326 | 1331 | } |
| 1327 | 1332 | |
| @@ -1326,9 +1331,9 @@ | ||
| 1326 | 1331 | } |
| 1327 | 1332 | |
| 1328 | 1333 | if (!isset($data['success']) || !$data['success']) { |
| 1329 | 1334 | $error_message = isset($data['message']) ? $data['message'] : 'Unknown API error'; |
| 1330 | - error_log('King Addons Section Error: API returned error: ' . $error_message); | |
| 1335 | + // error_log('King Addons Section Error: API returned error: ' . $error_message); | |
| 1331 | 1336 | wp_send_json_error('Section API error: ' . $error_message); |
| 1332 | 1337 | return; |
| 1333 | 1338 | } |
| 1334 | 1339 | |