Changeset 3425395
- Timestamp:
- 12/22/2025 01:20:54 PM (3 months ago)
- Location:
- post-export-import-with-media
- Files:
-
- 39 added
- 9 edited
-
tags/1.2.0 (added)
-
tags/1.2.0/assets (added)
-
tags/1.2.0/assets/css (added)
-
tags/1.2.0/assets/css/admin.css (added)
-
tags/1.2.0/assets/css/recommendations.css (added)
-
tags/1.2.0/assets/js (added)
-
tags/1.2.0/assets/js/admin-clean.js (added)
-
tags/1.2.0/assets/js/admin-download-buttons.js (added)
-
tags/1.2.0/assets/js/admin.js (added)
-
tags/1.2.0/assets/js/pages.js (added)
-
tags/1.2.0/assets/js/recommendations.js (added)
-
tags/1.2.0/assets/js/settings.js (added)
-
tags/1.2.0/assets/js/themes-plugins.js (added)
-
tags/1.2.0/includes (added)
-
tags/1.2.0/includes/class-admin-download-buttons.php (added)
-
tags/1.2.0/includes/class-admin-menu.php (added)
-
tags/1.2.0/includes/class-ajax-handler.php (added)
-
tags/1.2.0/includes/class-generic-recommendations.php (added)
-
tags/1.2.0/includes/class-main.php (added)
-
tags/1.2.0/includes/class-media-handler.php (added)
-
tags/1.2.0/includes/class-page-handler.php (added)
-
tags/1.2.0/includes/class-post-handler.php (added)
-
tags/1.2.0/includes/class-settings-handler.php (added)
-
tags/1.2.0/includes/class-themes-plugins-handler.php (added)
-
tags/1.2.0/includes/class-widgets-menus-handler.php (added)
-
tags/1.2.0/languages (added)
-
tags/1.2.0/languages/post-export-import-with-media.pot (added)
-
tags/1.2.0/post-export-import-with-media.php (added)
-
tags/1.2.0/readme.txt (added)
-
trunk/assets/css/admin.css (modified) (3 diffs)
-
trunk/assets/js/admin-clean.js (added)
-
trunk/assets/js/admin-download-buttons.js (added)
-
trunk/assets/js/pages.js (added)
-
trunk/assets/js/settings.js (added)
-
trunk/assets/js/themes-plugins.js (added)
-
trunk/includes/class-admin-download-buttons.php (added)
-
trunk/includes/class-admin-menu.php (modified) (5 diffs)
-
trunk/includes/class-ajax-handler.php (modified) (2 diffs)
-
trunk/includes/class-main.php (modified) (5 diffs)
-
trunk/includes/class-media-handler.php (modified) (8 diffs)
-
trunk/includes/class-page-handler.php (added)
-
trunk/includes/class-post-handler.php (modified) (17 diffs)
-
trunk/includes/class-settings-handler.php (added)
-
trunk/includes/class-themes-plugins-handler.php (added)
-
trunk/includes/class-widgets-menus-handler.php (added)
-
trunk/languages/post-export-import-with-media.pot (modified) (4 diffs)
-
trunk/post-export-import-with-media.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-export-import-with-media/trunk/assets/css/admin.css
r3418865 r3425395 379 379 .peiwm-step-number { 380 380 background: var(--primary-color); 381 color: white;381 color: #a46565; 382 382 width: 2.5rem; 383 383 height: 2.5rem; … … 480 480 .peiwm-log-entry.peiwm-log-info { 481 481 color: var(--primary-color); 482 } 483 484 /* Settings Groups */ 485 .peiwm-settings-groups { 486 margin: 1.5rem 0; 487 padding: 1.5rem; 488 background: rgba(255, 255, 255, 0.7); 489 border-radius: 12px; 490 border: 1px solid rgba(0, 0, 0, 0.1); 491 } 492 493 .peiwm-settings-groups h4 { 494 margin: 0 0 1rem 0; 495 color: var(--text-primary); 496 font-size: 1.1rem; 497 font-weight: 600; 498 } 499 500 .peiwm-checkbox-grid { 501 display: grid; 502 grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 503 gap: 1rem; 504 } 505 506 .peiwm-settings-preview { 507 margin: 1.5rem 0; 508 padding: 1.5rem; 509 background: rgba(59, 130, 246, 0.1); 510 border: 1px solid rgba(59, 130, 246, 0.2); 511 border-radius: 12px; 512 } 513 514 .peiwm-settings-preview h4 { 515 margin: 0 0 1rem 0; 516 color: var(--primary-color); 517 font-size: 1.1rem; 518 font-weight: 600; 482 519 } 483 520 … … 1224 1261 } 1225 1262 } 1263 1264 /* T 1265 hemes & Plugins Specific Styles */ 1266 .peiwm-theme-options, 1267 .peiwm-plugin-options { 1268 margin: 15px 0; 1269 } 1270 1271 .peiwm-selection-grid { 1272 margin: 15px 0; 1273 max-height: 300px; 1274 overflow-y: auto; 1275 border: 1px solid #ddd; 1276 border-radius: 4px; 1277 padding: 10px; 1278 background: #f9f9f9; 1279 } 1280 1281 .peiwm-import-options { 1282 margin: 15px 0; 1283 padding: 15px; 1284 background: #f0f8ff; 1285 border: 1px solid #b3d9ff; 1286 border-radius: 4px; 1287 } 1288 1289 .peiwm-active-label { 1290 color: #00a32a; 1291 font-weight: 600; 1292 font-size: 0.9em; 1293 } 1294 1295 .peiwm-checkbox-grid { 1296 display: grid; 1297 grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 1298 gap: 10px; 1299 max-height: 250px; 1300 overflow-y: auto; 1301 } 1302 1303 .peiwm-checkbox-label { 1304 display: flex; 1305 align-items: flex-start; 1306 padding: 10px; 1307 border: 1px solid #ddd; 1308 border-radius: 4px; 1309 background: #fff; 1310 cursor: pointer; 1311 transition: all 0.2s ease; 1312 } 1313 1314 .peiwm-checkbox-label:hover { 1315 border-color: #0073aa; 1316 background: #f0f8ff; 1317 } 1318 1319 .peiwm-checkbox-label input[type="checkbox"], 1320 .peiwm-checkbox-label input[type="radio"] { 1321 margin: 0 10px 0 0; 1322 flex-shrink: 0; 1323 } 1324 1325 .peiwm-checkbox-text { 1326 flex: 1; 1327 line-height: 1.4; 1328 } 1329 1330 .peiwm-checkbox-description { 1331 display: block; 1332 color: #666; 1333 font-size: 0.9em; 1334 margin-top: 4px; 1335 } 1336 1337 /* Progress and Log Enhancements */ 1338 .peiwm-log-entry.peiwm-log-success { 1339 color: var(--success-color); 1340 } 1341 1342 .peiwm-log-entry.peiwm-log-error { 1343 color: var(--error-color); 1344 } 1345 1346 .peiwm-log-entry.peiwm-log-warning { 1347 color: #f59e0b; 1348 } 1349 1350 .peiwm-log-entry.peiwm-log-info { 1351 color: #0073aa; 1352 } 1353 1354 /* Button Container Improvements */ 1355 .button-container { 1356 display: flex; 1357 gap: 10px; 1358 align-items: center; 1359 flex-wrap: wrap; 1360 margin: 15px 0; 1361 } 1362 1363 .button-container .button { 1364 margin: 0; 1365 } 1366 1367 /* Section Spacing */ 1368 .peiwm-section+.peiwm-section { 1369 margin-top: 40px; 1370 padding-top: 30px; 1371 border-top: 2px solid #e1e1e1; 1372 } 1373 1374 /* Export/Import Section Styling */ 1375 .peiwm-export-section, 1376 .peiwm-import-section { 1377 background: #fff; 1378 border: 1px solid #e1e1e1; 1379 border-radius: 6px; 1380 padding: 20px; 1381 margin: 20px 0; 1382 } 1383 1384 .peiwm-export-section h3, 1385 .peiwm-import-section h3 { 1386 margin-top: 0; 1387 color: #23282d; 1388 border-bottom: 1px solid #e1e1e1; 1389 padding-bottom: 10px; 1390 } 1391 1392 /* Responsive Design */ 1393 @media (max-width: 768px) { 1394 .peiwm-checkbox-grid { 1395 grid-template-columns: 1fr; 1396 } 1397 1398 .button-container { 1399 flex-direction: column; 1400 align-items: stretch; 1401 } 1402 1403 .button-container .button { 1404 width: 100%; 1405 text-align: center; 1406 } 1407 } 1408 1409 /* Med 1410 ia Statistics Styles */ 1411 .peiwm-stats-section { 1412 background: #fff; 1413 border: 1px solid #e1e1e1; 1414 border-radius: 6px; 1415 padding: 20px; 1416 margin: 20px 0; 1417 } 1418 1419 .peiwm-stats-section h3 { 1420 margin-top: 0; 1421 color: #23282d; 1422 border-bottom: 1px solid #e1e1e1; 1423 padding-bottom: 10px; 1424 } 1425 1426 .peiwm-stats { 1427 min-height: 100px; 1428 } 1429 1430 .peiwm-stats-loader { 1431 display: flex; 1432 flex-direction: column; 1433 align-items: center; 1434 justify-content: center; 1435 padding: 40px 20px; 1436 text-align: center; 1437 } 1438 1439 .peiwm-stats-loader-spinner { 1440 width: 32px; 1441 height: 32px; 1442 border: 3px solid #f3f3f3; 1443 border-top: 3px solid #0073aa; 1444 border-radius: 50%; 1445 animation: spin 1s linear infinite; 1446 margin-bottom: 15px; 1447 } 1448 1449 @keyframes spin { 1450 0% { 1451 transform: rotate(0deg); 1452 } 1453 1454 100% { 1455 transform: rotate(360deg); 1456 } 1457 } 1458 1459 .peiwm-stats-loader-text { 1460 font-size: 16px; 1461 font-weight: 600; 1462 color: #23282d; 1463 margin-bottom: 5px; 1464 } 1465 1466 .peiwm-stats-loader-subtext { 1467 font-size: 14px; 1468 color: #666; 1469 } 1470 1471 .peiwm-stats-grid { 1472 display: grid; 1473 grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 1474 gap: 20px; 1475 margin-bottom: 30px; 1476 } 1477 1478 .peiwm-stat-item { 1479 background: #f8f9fa; 1480 border: 1px solid #e9ecef; 1481 border-radius: 8px; 1482 padding: 20px; 1483 text-align: center; 1484 transition: all 0.2s ease; 1485 } 1486 1487 .peiwm-stat-item:hover { 1488 border-color: #0073aa; 1489 box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1); 1490 } 1491 1492 .peiwm-stat-number { 1493 font-size: 28px; 1494 font-weight: 700; 1495 color: #0073aa; 1496 margin-bottom: 8px; 1497 line-height: 1; 1498 } 1499 1500 .peiwm-stat-label { 1501 font-size: 14px; 1502 font-weight: 600; 1503 color: #23282d; 1504 text-transform: uppercase; 1505 letter-spacing: 0.5px; 1506 margin-bottom: 4px; 1507 } 1508 1509 .peiwm-stat-detail { 1510 font-size: 12px; 1511 color: #666; 1512 word-break: break-all; 1513 } 1514 1515 .peiwm-file-types { 1516 background: #f8f9fa; 1517 border-radius: 8px; 1518 padding: 20px; 1519 } 1520 1521 .peiwm-file-types h4 { 1522 margin: 0 0 15px 0; 1523 color: #23282d; 1524 font-size: 16px; 1525 } 1526 1527 .peiwm-file-types-list { 1528 display: grid; 1529 grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 1530 gap: 10px; 1531 } 1532 1533 .peiwm-file-type-item { 1534 display: flex; 1535 justify-content: space-between; 1536 align-items: center; 1537 background: #fff; 1538 border: 1px solid #e9ecef; 1539 border-radius: 4px; 1540 padding: 8px 12px; 1541 font-size: 13px; 1542 } 1543 1544 .peiwm-file-type-name { 1545 font-weight: 600; 1546 color: #23282d; 1547 } 1548 1549 .peiwm-file-type-count { 1550 background: #0073aa; 1551 color: #fff; 1552 border-radius: 12px; 1553 padding: 2px 8px; 1554 font-size: 11px; 1555 font-weight: 600; 1556 min-width: 20px; 1557 text-align: center; 1558 } 1559 1560 .peiwm-stats-error { 1561 background: #fff2cd; 1562 border: 1px solid #f0ad4e; 1563 border-radius: 4px; 1564 padding: 15px; 1565 color: #8a6d3b; 1566 text-align: center; 1567 font-weight: 600; 1568 } 1569 1570 #peiwm-refresh-stats { 1571 margin-top: 15px; 1572 } 1573 1574 #peiwm-refresh-stats:disabled { 1575 opacity: 0.6; 1576 cursor: not-allowed; 1577 } 1578 1579 /* Responsive Design for Stats */ 1580 @media (max-width: 768px) { 1581 .peiwm-stats-grid { 1582 grid-template-columns: 1fr; 1583 } 1584 1585 .peiwm-file-types-list { 1586 grid-template-columns: 1fr; 1587 } 1588 1589 .peiwm-stat-number { 1590 font-size: 24px; 1591 } 1592 } 1593 1594 /* Settings Section Styles */ 1595 .peiwm-settings-section { 1596 background: #fff; 1597 border: 1px solid #e1e1e1; 1598 border-radius: 6px; 1599 padding: 20px; 1600 margin: 20px 0; 1601 } 1602 1603 .peiwm-settings-section .form-table { 1604 margin-top: 0; 1605 } 1606 1607 .peiwm-settings-section .form-table th { 1608 padding-left: 0; 1609 font-weight: 600; 1610 } 1611 1612 .peiwm-settings-section .form-table td { 1613 padding-left: 0; 1614 } 1615 1616 .peiwm-settings-section .description { 1617 margin-top: 8px; 1618 font-style: italic; 1619 color: #666; 1620 } 1621 1622 /* Admin Download Buttons Styles (for themes.php and plugins.php) */ 1623 .peiwm-download-theme-btn { 1624 background: #0073aa !important; 1625 color: #fff !important; 1626 border: none !important; 1627 border-radius: 3px !important; 1628 font-size: 11px !important; 1629 padding: 4px 8px !important; 1630 margin-left: 5px !important; 1631 text-decoration: none !important; 1632 display: inline-block !important; 1633 transition: background-color 0.2s ease !important; 1634 } 1635 1636 .peiwm-download-theme-btn:hover { 1637 background: #005177 !important; 1638 color: #fff !important; 1639 } 1640 1641 .peiwm-download-theme-btn:disabled { 1642 background: #ccc !important; 1643 cursor: not-allowed !important; 1644 } 1645 1646 .peiwm-download-plugin { 1647 color: #666; 1648 } 1649 1650 .peiwm-download-plugin-btn { 1651 color: #0073aa; 1652 text-decoration: none; 1653 font-size: 13px; 1654 } 1655 1656 .peiwm-download-plugin-btn:hover { 1657 color: #005177; 1658 text-decoration: underline; 1659 } 1660 1661 /* Responsive adjustments */ 1662 @media (max-width: 768px) { 1663 .peiwm-download-theme-btn { 1664 font-size: 10px !important; 1665 padding: 3px 6px !important; 1666 } 1667 } 1668 1669 /* 1670 Widgets & Menus Export Options */ 1671 .peiwm-export-options { 1672 display: flex; 1673 gap: 10px; 1674 flex-wrap: wrap; 1675 margin: 15px 0; 1676 } 1677 1678 .peiwm-export-options .button { 1679 margin: 0; 1680 } 1681 1682 /* Responsive adjustments for export options */ 1683 @media (max-width: 768px) { 1684 .peiwm-export-options { 1685 flex-direction: column; 1686 } 1687 1688 .peiwm-export-options .button { 1689 width: 100%; 1690 text-align: center; 1691 } 1692 } -
post-export-import-with-media/trunk/includes/class-admin-menu.php
r3418865 r3425395 42 42 add_action( 'admin_menu', array( $this, 'add_admin_menu' ) ); 43 43 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) ); 44 add_action( 'current_screen', array( $this, 'protect_plugin_pages' ) ); 45 } 46 47 /** 48 * Protect our plugin pages from null post warnings 49 */ 50 public function protect_plugin_pages() { 51 $screen = get_current_screen(); 52 53 // Check if we're on one of our plugin pages 54 if ( $screen && ( 55 strpos( $screen->id, 'peiwm' ) !== false || 56 strpos( $screen->id, 'export-import' ) !== false || 57 $screen->id === 'toplevel_page_peiwm-secure' || 58 strpos( $screen->id, 'peiwm-' ) !== false 59 ) ) { 60 // Add multiple protection layers for our pages 61 add_action( 'admin_head', array( $this, 'ensure_valid_post_object' ), 1 ); 62 add_action( 'admin_footer', array( $this, 'ensure_valid_post_object' ), 1 ); 63 add_action( 'wp_ajax_peiwm_import_widgets_menus', array( $this, 'ensure_valid_post_object' ), 1 ); 64 65 // Monitor and fix global post throughout page lifecycle 66 add_action( 'wp_loaded', array( $this, 'monitor_global_post' ), 999 ); 67 } 68 } 69 70 /** 71 * Ensure valid post object exists 72 */ 73 public function ensure_valid_post_object() { 74 global $post; 75 76 if ( null === $post || ! is_object( $post ) ) { 77 $post = new WP_Post( (object) array( 78 'ID' => 0, 79 'post_status' => 'publish', 80 'post_type' => 'post', 81 'post_title' => '', 82 'post_content' => '', 83 'post_excerpt' => '', 84 'post_author' => get_current_user_id(), 85 'post_date' => current_time( 'mysql' ), 86 'post_modified' => current_time( 'mysql' ), 87 'post_name' => '', 88 'post_parent' => 0, 89 'menu_order' => 0, 90 'comment_status' => 'closed', 91 'ping_status' => 'closed', 92 'comment_count' => 0, 93 'post_date_gmt' => current_time( 'mysql', 1 ), 94 'post_modified_gmt' => current_time( 'mysql', 1 ), 95 'post_content_filtered' => '', 96 'post_password' => '', 97 'to_ping' => '', 98 'pinged' => '', 99 'guid' => '', 100 'post_mime_type' => '', 101 'filter' => 'raw' 102 ) ); 103 } 104 } 105 106 /** 107 * Monitor and maintain global post state 108 */ 109 public function monitor_global_post() { 110 // Set up a periodic check to ensure post object remains valid 111 add_action( 'wp_footer', array( $this, 'ensure_valid_post_object' ), 999 ); 112 add_action( 'admin_footer', array( $this, 'ensure_valid_post_object' ), 999 ); 44 113 } 45 114 … … 58 127 ); 59 128 129 // Add pages submenu 130 add_submenu_page( 131 'peiwm-secure', 132 esc_html__( 'Pages Export/Import', 'post-export-import-with-media' ), 133 esc_html__( 'Pages Export/Import', 'post-export-import-with-media' ), 134 'manage_options', 135 'peiwm-pages', 136 array( $this, 'pages_page' ) 137 ); 138 139 // Add settings submenu 140 add_submenu_page( 141 'peiwm-secure', 142 esc_html__( 'WordPress Settings', 'post-export-import-with-media' ), 143 esc_html__( 'WordPress Settings', 'post-export-import-with-media' ), 144 'manage_options', 145 'peiwm-settings', 146 array( $this, 'settings_page' ) 147 ); 148 149 // Add themes & plugins submenu 150 add_submenu_page( 151 'peiwm-secure', 152 esc_html__( 'Themes & Plugins Backup', 'post-export-import-with-media' ), 153 esc_html__( 'Themes & Plugins', 'post-export-import-with-media' ), 154 'manage_options', 155 'peiwm-themes-plugins', 156 array( $this, 'themes_plugins_page' ) 157 ); 158 60 159 // Add recommendations submenu 61 160 add_submenu_page( … … 75 174 */ 76 175 public function enqueue_admin_scripts( $hook ) { 77 // Main plugin page 176 // Main plugin page (Posts & Media) 78 177 if ( 'toplevel_page_peiwm-secure' === $hook ) { 79 178 wp_enqueue_script( … … 108 207 } 109 208 209 // Pages page 210 if ( 'export-import-posts_page_peiwm-pages' === $hook ) { 211 wp_enqueue_script( 212 'peiwm-pages-js', 213 PEIWM_PLUGIN_URL . 'assets/js/pages.js', 214 array( 'jquery' ), 215 PEIWM_VERSION, 216 true 217 ); 218 219 wp_enqueue_style( 220 'peiwm-admin-css', 221 PEIWM_PLUGIN_URL . 'assets/css/admin.css', 222 array(), 223 PEIWM_VERSION 224 ); 225 226 wp_localize_script( 'peiwm-pages-js', 'peiwm_ajax', array( 227 'ajax_url' => admin_url( 'admin-ajax.php' ), 228 'nonce' => wp_create_nonce( 'peiwm_secure_nonce' ), 229 'strings' => array( 230 'select_file' => esc_html__( 'Please select a file to import.', 'post-export-import-with-media' ), 231 'file_too_large' => esc_html__( 'File is too large. Please select a file smaller than 500MB.', 'post-export-import-with-media' ), 232 'select_json' => esc_html__( 'Please select a JSON file.', 'post-export-import-with-media' ), 233 'processing' => esc_html__( 'Processing...', 'post-export-import-with-media' ), 234 'success' => esc_html__( 'Success!', 'post-export-import-with-media' ), 235 'error' => esc_html__( 'Error:', 'post-export-import-with-media' ), 236 'complete' => esc_html__( 'Complete!', 'post-export-import-with-media' ), 237 'confirm_delete' => esc_html__( 'Are you sure you want to delete all items? This action cannot be undone.', 'post-export-import-with-media' ), 238 ), 239 ) ); 240 } 241 242 // Settings page 243 if ( 'export-import-posts_page_peiwm-settings' === $hook ) { 244 wp_enqueue_script( 245 'peiwm-settings-js', 246 PEIWM_PLUGIN_URL . 'assets/js/settings.js', 247 array( 'jquery' ), 248 PEIWM_VERSION, 249 true 250 ); 251 252 wp_enqueue_style( 253 'peiwm-admin-css', 254 PEIWM_PLUGIN_URL . 'assets/css/admin.css', 255 array(), 256 PEIWM_VERSION 257 ); 258 259 wp_localize_script( 'peiwm-settings-js', 'peiwm_ajax', array( 260 'ajax_url' => admin_url( 'admin-ajax.php' ), 261 'nonce' => wp_create_nonce( 'peiwm_secure_nonce' ), 262 'strings' => array( 263 'select_file' => esc_html__( 'Please select a file to import.', 'post-export-import-with-media' ), 264 'file_too_large' => esc_html__( 'File is too large. Please select a file smaller than 500MB.', 'post-export-import-with-media' ), 265 'select_json' => esc_html__( 'Please select a JSON file.', 'post-export-import-with-media' ), 266 'processing' => esc_html__( 'Processing...', 'post-export-import-with-media' ), 267 'success' => esc_html__( 'Success!', 'post-export-import-with-media' ), 268 'error' => esc_html__( 'Error:', 'post-export-import-with-media' ), 269 'complete' => esc_html__( 'Complete!', 'post-export-import-with-media' ), 270 'confirm_delete' => esc_html__( 'Are you sure you want to delete all items? This action cannot be undone.', 'post-export-import-with-media' ), 271 ), 272 ) ); 273 } 274 275 // Themes & Plugins page 276 if ( 'export-import-posts_page_peiwm-themes-plugins' === $hook ) { 277 wp_enqueue_script( 278 'peiwm-themes-plugins-js', 279 PEIWM_PLUGIN_URL . 'assets/js/themes-plugins.js', 280 array( 'jquery' ), 281 PEIWM_VERSION, 282 true 283 ); 284 285 wp_enqueue_style( 286 'peiwm-admin-css', 287 PEIWM_PLUGIN_URL . 'assets/css/admin.css', 288 array(), 289 PEIWM_VERSION 290 ); 291 292 wp_localize_script( 'peiwm-themes-plugins-js', 'peiwm_ajax', array( 293 'ajax_url' => admin_url( 'admin-ajax.php' ), 294 'nonce' => wp_create_nonce( 'peiwm_secure_nonce' ), 295 'strings' => array( 296 'select_file' => esc_html__( 'Please select a file to import.', 'post-export-import-with-media' ), 297 'file_too_large' => esc_html__( 'File is too large. Please select a file smaller than 500MB.', 'post-export-import-with-media' ), 298 'select_zip' => esc_html__( 'Please select a ZIP file.', 'post-export-import-with-media' ), 299 'processing' => esc_html__( 'Processing...', 'post-export-import-with-media' ), 300 'success' => esc_html__( 'Success!', 'post-export-import-with-media' ), 301 'error' => esc_html__( 'Error:', 'post-export-import-with-media' ), 302 'complete' => esc_html__( 'Complete!', 'post-export-import-with-media' ), 303 'confirm_delete' => esc_html__( 'Are you sure you want to delete all items? This action cannot be undone.', 'post-export-import-with-media' ), 304 ), 305 ) ); 306 } 307 110 308 // Recommendations page 111 309 if ( 'export-import-posts_page_peiwm-recommendations' === $hook ) { … … 335 533 <li><?php echo esc_html__( '✓ Run the System Test first to ensure your server can handle large files', 'post-export-import-with-media' ); ?></li> 336 534 <li><?php echo esc_html__( '✓ Existing images with the same filename will be reused automatically', 'post-export-import-with-media' ); ?></li> 535 <li><?php echo esc_html__( '✓ If you enable "Download missing images from original URLs" and ensure the source site is live, media will be fetched directly from the original URLs. This means you won’t need to import media files separately, though the process may take additional time to download and complete.', 'post-export-import-with-media' ); ?></li> 337 536 </ul> 338 537 </div> 339 538 </div> 539 </div> 540 </div> 541 542 <?php $this->render_modal_templates(); ?> 543 <?php 544 } 545 546 /** 547 * Render pages page 548 */ 549 public function pages_page() { 550 if ( ! current_user_can( 'manage_options' ) ) { 551 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'post-export-import-with-media' ) ); 552 } 553 554 ?> 555 <div class="wrap peiwm-admin"> 556 <h1><?php echo esc_html__( 'Pages Export/Import', 'post-export-import-with-media' ); ?></h1> 557 558 <div class="peiwm-container"> 559 <!-- Pages Section --> 560 <div class="peiwm-section"> 561 <h2><?php echo esc_html__( 'Pages Export/Import', 'post-export-import-with-media' ); ?></h2> 562 563 <div class="peiwm-export-section"> 564 <h3><?php echo esc_html__( 'Export Pages', 'post-export-import-with-media' ); ?></h3> 565 <p><?php echo esc_html__( 'Export all pages with their metadata, featured images, and hierarchy.', 'post-export-import-with-media' ); ?></p> 566 <button type="button" id="peiwm-export-pages" class="button button-primary"> 567 <?php echo esc_html__( 'Export Pages', 'post-export-import-with-media' ); ?> 568 </button> 569 </div> 570 571 <div class="peiwm-import-section"> 572 <h3><?php echo esc_html__( 'Import Pages', 'post-export-import-with-media' ); ?></h3> 573 <p><?php echo esc_html__( 'Import pages from a previously exported JSON file.', 'post-export-import-with-media' ); ?></p> 574 <div class="button-container"> 575 <input type="file" id="peiwm-pages-file" accept=".json" style="display: none;"> 576 <button type="button" id="peiwm-select-pages-file" class="button button-secondary"> 577 <?php echo esc_html__( 'Select JSON File', 'post-export-import-with-media' ); ?> 578 </button> 579 <button type="button" id="peiwm-import-pages" class="button button-primary" style="display: none;"> 580 <?php echo esc_html__( 'Start Import', 'post-export-import-with-media' ); ?> 581 </button> 582 </div> 583 584 <div class="peiwm-import-options" style="margin-top: 1rem;"> 585 <label class="peiwm-checkbox-label"> 586 <input type="checkbox" id="peiwm-download-missing-page-images"> 587 <span class="peiwm-checkbox-text"> 588 <?php echo esc_html__( 'Download missing images from original URLs', 'post-export-import-with-media' ); ?> 589 <small class="peiwm-checkbox-description"> 590 <?php echo esc_html__( 'If images are not found in media library, try to download them from their original locations', 'post-export-import-with-media' ); ?> 591 </small> 592 </span> 593 </label> 594 </div> 595 596 <div id="peiwm-pages-progress" class="peiwm-progress" style="display: none;"> 597 <h4><?php echo esc_html__( 'Import Progress', 'post-export-import-with-media' ); ?></h4> 598 <div class="peiwm-progress-bar"> 599 <div class="peiwm-progress-fill"></div> 600 </div> 601 <p class="peiwm-progress-text"><?php echo esc_html__( 'Starting...', 'post-export-import-with-media' ); ?></p> 602 <div class="peiwm-log"></div> 603 </div> 604 </div> 605 606 <div class="peiwm-delete-section"> 607 <h3><?php echo esc_html__( 'Delete All Pages', 'post-export-import-with-media' ); ?></h3> 608 <p><?php echo esc_html__( 'Permanently delete all pages from your website. This action cannot be undone.', 'post-export-import-with-media' ); ?></p> 609 <button type="button" id="peiwm-delete-pages" class="button button-secondary peiwm-danger-button"> 610 <?php echo esc_html__( 'Delete All Pages', 'post-export-import-with-media' ); ?> 611 </button> 612 613 <div id="peiwm-delete-pages-progress" class="peiwm-progress" style="display: none;"> 614 <h4><?php echo esc_html__( 'Deletion Progress', 'post-export-import-with-media' ); ?></h4> 615 <div class="peiwm-progress-bar"> 616 <div class="peiwm-progress-fill"></div> 617 </div> 618 <p class="peiwm-progress-text"><?php echo esc_html__( 'Starting...', 'post-export-import-with-media' ); ?></p> 619 <div class="peiwm-log"></div> 620 </div> 621 </div> 622 </div> 623 </div> 624 </div> 625 626 <?php $this->render_modal_templates(); ?> 627 <?php 628 } 629 630 /** 631 * Render settings page 632 */ 633 public function settings_page() { 634 if ( ! current_user_can( 'manage_options' ) ) { 635 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'post-export-import-with-media' ) ); 636 } 637 638 ?> 639 <div class="wrap peiwm-admin"> 640 <h1><?php echo esc_html__( 'WordPress Settings Export/Import', 'post-export-import-with-media' ); ?></h1> 641 642 <div class="peiwm-container"> 643 <!-- Settings Section --> 644 <div class="peiwm-section"> 645 <h2><?php echo esc_html__( 'WordPress Settings Export/Import', 'post-export-import-with-media' ); ?></h2> 646 647 <div class="peiwm-export-section"> 648 <h3><?php echo esc_html__( 'Export Settings', 'post-export-import-with-media' ); ?></h3> 649 <p><?php echo esc_html__( 'Export WordPress configuration settings from General, Writing, Reading, Discussion, Media, Permalinks, and Privacy sections.', 'post-export-import-with-media' ); ?></p> 650 651 <div class="peiwm-settings-groups"> 652 <h4><?php echo esc_html__( 'Select Settings Groups to Export:', 'post-export-import-with-media' ); ?></h4> 653 <div class="peiwm-checkbox-grid"> 654 <label class="peiwm-checkbox-label"> 655 <input type="checkbox" name="export_settings_groups[]" value="general" checked> 656 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'General Settings', 'post-export-import-with-media' ); ?></span> 657 </label> 658 <label class="peiwm-checkbox-label"> 659 <input type="checkbox" name="export_settings_groups[]" value="writing" checked> 660 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'Writing Settings', 'post-export-import-with-media' ); ?></span> 661 </label> 662 <label class="peiwm-checkbox-label"> 663 <input type="checkbox" name="export_settings_groups[]" value="reading" checked> 664 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'Reading Settings', 'post-export-import-with-media' ); ?></span> 665 </label> 666 <label class="peiwm-checkbox-label"> 667 <input type="checkbox" name="export_settings_groups[]" value="discussion" checked> 668 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'Discussion Settings', 'post-export-import-with-media' ); ?></span> 669 </label> 670 <label class="peiwm-checkbox-label"> 671 <input type="checkbox" name="export_settings_groups[]" value="media" checked> 672 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'Media Settings', 'post-export-import-with-media' ); ?></span> 673 </label> 674 <label class="peiwm-checkbox-label"> 675 <input type="checkbox" name="export_settings_groups[]" value="permalinks" checked> 676 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'Permalink Settings', 'post-export-import-with-media' ); ?></span> 677 </label> 678 <label class="peiwm-checkbox-label"> 679 <input type="checkbox" name="export_settings_groups[]" value="privacy" checked> 680 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'Privacy Settings', 'post-export-import-with-media' ); ?></span> 681 </label> 682 </div> 683 </div> 684 685 <button type="button" id="peiwm-export-settings" class="button button-primary"> 686 <?php echo esc_html__( 'Export Settings', 'post-export-import-with-media' ); ?> 687 </button> 688 </div> 689 690 <div class="peiwm-import-section"> 691 <h3><?php echo esc_html__( 'Import Settings', 'post-export-import-with-media' ); ?></h3> 692 <p><?php echo esc_html__( 'Import WordPress settings from a previously exported JSON file.', 'post-export-import-with-media' ); ?></p> 693 <div class="button-container"> 694 <input type="file" id="peiwm-settings-file" accept=".json" style="display: none;"> 695 <button type="button" id="peiwm-select-settings-file" class="button button-secondary"> 696 <?php echo esc_html__( 'Select JSON File', 'post-export-import-with-media' ); ?> 697 </button> 698 <button type="button" id="peiwm-import-settings" class="button button-primary" style="display: none;"> 699 <?php echo esc_html__( 'Start Import', 'post-export-import-with-media' ); ?> 700 </button> 701 </div> 702 703 <div id="peiwm-settings-preview" class="peiwm-settings-preview" style="display: none;"> 704 <h4><?php echo esc_html__( 'Settings Preview & Selection:', 'post-export-import-with-media' ); ?></h4> 705 <div id="peiwm-settings-groups-selection"></div> 706 </div> 707 708 <div id="peiwm-settings-progress" class="peiwm-progress" style="display: none;"> 709 <h4><?php echo esc_html__( 'Import Progress', 'post-export-import-with-media' ); ?></h4> 710 <div class="peiwm-progress-bar"> 711 <div class="peiwm-progress-fill"></div> 712 </div> 713 <p class="peiwm-progress-text"><?php echo esc_html__( 'Starting...', 'post-export-import-with-media' ); ?></p> 714 <div class="peiwm-log"></div> 715 </div> 716 </div> 717 </div> 718 719 <!-- Widgets & Menus Section --> 720 <div class="peiwm-section"> 721 <h2><?php echo esc_html__( 'Widgets & Navigation Menus', 'post-export-import-with-media' ); ?></h2> 722 723 <div class="peiwm-export-section"> 724 <h3><?php echo esc_html__( 'Export Widgets & Menus', 'post-export-import-with-media' ); ?></h3> 725 <p><?php echo esc_html__( 'Export your widgets and navigation menus configuration.', 'post-export-import-with-media' ); ?></p> 726 727 <div class="peiwm-export-options"> 728 <button type="button" id="peiwm-export-widgets" class="button button-primary"> 729 <?php echo esc_html__( 'Export Widgets Only', 'post-export-import-with-media' ); ?> 730 </button> 731 <button type="button" id="peiwm-export-nav-menus" class="button button-primary"> 732 <?php echo esc_html__( 'Export Menus Only', 'post-export-import-with-media' ); ?> 733 </button> 734 <button type="button" id="peiwm-export-widgets-menus" class="button button-primary"> 735 <?php echo esc_html__( 'Export Both', 'post-export-import-with-media' ); ?> 736 </button> 737 </div> 738 </div> 739 740 <div class="peiwm-import-section"> 741 <h3><?php echo esc_html__( 'Import Widgets & Menus', 'post-export-import-with-media' ); ?></h3> 742 <p><?php echo esc_html__( 'Import widgets and navigation menus from a previously exported JSON file.', 'post-export-import-with-media' ); ?></p> 743 744 <div class="button-container"> 745 <input type="file" id="peiwm-widgets-menus-file" accept=".json" style="display: none;"> 746 <button type="button" id="peiwm-select-widgets-menus-file" class="button button-secondary"> 747 <?php echo esc_html__( 'Select JSON File', 'post-export-import-with-media' ); ?> 748 </button> 749 <button type="button" id="peiwm-import-widgets-menus" class="button button-primary" style="display: none;"> 750 <?php echo esc_html__( 'Start Import', 'post-export-import-with-media' ); ?> 751 </button> 752 </div> 753 754 <div class="peiwm-import-options" id="peiwm-widgets-menus-import-options" style="display: none;"> 755 <label class="peiwm-checkbox-label"> 756 <input type="checkbox" id="peiwm-replace-existing-widgets-menus" checked> 757 <span class="peiwm-checkbox-text"> 758 <?php echo esc_html__( 'Replace existing widgets and menus', 'post-export-import-with-media' ); ?> 759 <small class="peiwm-checkbox-description"><?php echo esc_html__( 'Clear existing widgets and menus before importing', 'post-export-import-with-media' ); ?></small> 760 </span> 761 </label> 762 </div> 763 764 <div id="peiwm-widgets-menus-progress" class="peiwm-progress" style="display: none;"> 765 <h4><?php echo esc_html__( 'Import Progress', 'post-export-import-with-media' ); ?></h4> 766 <div class="peiwm-progress-bar"> 767 <div class="peiwm-progress-fill"></div> 768 </div> 769 <p class="peiwm-progress-text"><?php echo esc_html__( 'Starting...', 'post-export-import-with-media' ); ?></p> 770 <div class="peiwm-log"></div> 771 </div> 772 </div> 773 </div> 774 </div> 775 </div> 776 777 <?php $this->render_modal_templates(); ?> 778 <?php 779 } 780 781 /** 782 * Render themes & plugins page 783 */ 784 public function themes_plugins_page() { 785 if ( ! current_user_can( 'manage_options' ) ) { 786 wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'post-export-import-with-media' ) ); 787 } 788 ?> 789 <div class="wrap peiwm-admin"> 790 <h1><?php echo esc_html__( 'Themes & Plugins Backup', 'post-export-import-with-media' ); ?></h1> 791 792 <div class="peiwm-container"> 793 794 795 <!-- Themes Section --> 796 <div class="peiwm-section"> 797 <h2><?php echo esc_html__( 'Themes Backup', 'post-export-import-with-media' ); ?></h2> 798 799 <div class="peiwm-export-section"> 800 <h3><?php echo esc_html__( 'Export Themes', 'post-export-import-with-media' ); ?></h3> 801 <p><?php echo esc_html__( 'Create a backup of your themes as a ZIP file.', 'post-export-import-with-media' ); ?></p> 802 803 <div class="peiwm-theme-options"> 804 <label class="peiwm-checkbox-label"> 805 <input type="radio" name="theme_export_type" value="active" checked> 806 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'Active Theme Only', 'post-export-import-with-media' ); ?></span> 807 </label> 808 <label class="peiwm-checkbox-label"> 809 <input type="radio" name="theme_export_type" value="all"> 810 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'All Installed Themes', 'post-export-import-with-media' ); ?></span> 811 </label> 812 <label class="peiwm-checkbox-label"> 813 <input type="radio" name="theme_export_type" value="selected"> 814 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'Selected Themes', 'post-export-import-with-media' ); ?></span> 815 </label> 816 </div> 817 818 <div id="peiwm-theme-selection" class="peiwm-selection-grid" style="display: none;"> 819 <!-- Theme selection will be populated by JavaScript --> 820 </div> 821 822 <button type="button" id="peiwm-export-themes" class="button button-primary"> 823 <?php echo esc_html__( 'Export Themes', 'post-export-import-with-media' ); ?> 824 </button> 825 826 <div id="peiwm-themes-export-progress" class="peiwm-progress" style="display: none;"> 827 <h4><?php echo esc_html__( 'Export Progress', 'post-export-import-with-media' ); ?></h4> 828 <div class="peiwm-progress-bar"> 829 <div class="peiwm-progress-fill"></div> 830 </div> 831 <p class="peiwm-progress-text"><?php echo esc_html__( 'Starting...', 'post-export-import-with-media' ); ?></p> 832 <div class="peiwm-log"></div> 833 </div> 834 </div> 835 836 <div class="peiwm-import-section"> 837 <h3><?php echo esc_html__( 'Import Themes', 'post-export-import-with-media' ); ?></h3> 838 <p><?php echo esc_html__( 'Import themes from a previously exported ZIP file.', 'post-export-import-with-media' ); ?></p> 839 840 <div class="button-container"> 841 <input type="file" id="peiwm-themes-file" accept=".zip" style="display: none;"> 842 <button type="button" id="peiwm-select-themes-file" class="button button-secondary"> 843 <?php echo esc_html__( 'Select ZIP File', 'post-export-import-with-media' ); ?> 844 </button> 845 <button type="button" id="peiwm-import-themes" class="button button-primary" style="display: none;"> 846 <?php echo esc_html__( 'Start Import', 'post-export-import-with-media' ); ?> 847 </button> 848 </div> 849 850 <div class="peiwm-import-options" id="peiwm-themes-import-options" style="display: none;"> 851 <label class="peiwm-checkbox-label"> 852 <input type="checkbox" id="peiwm-replace-existing-themes" checked> 853 <span class="peiwm-checkbox-text"> 854 <?php echo esc_html__( 'Replace existing themes', 'post-export-import-with-media' ); ?> 855 <small class="peiwm-checkbox-description"><?php echo esc_html__( 'Overwrite themes that already exist', 'post-export-import-with-media' ); ?></small> 856 </span> 857 </label> 858 <label class="peiwm-checkbox-label"> 859 <input type="checkbox" id="peiwm-activate-imported-theme"> 860 <span class="peiwm-checkbox-text"> 861 <?php echo esc_html__( 'Activate imported theme', 'post-export-import-with-media' ); ?> 862 <small class="peiwm-checkbox-description"><?php echo esc_html__( 'Switch to the first imported theme', 'post-export-import-with-media' ); ?></small> 863 </span> 864 </label> 865 </div> 866 867 <div id="peiwm-themes-import-progress" class="peiwm-progress" style="display: none;"> 868 <h4><?php echo esc_html__( 'Import Progress', 'post-export-import-with-media' ); ?></h4> 869 <div class="peiwm-progress-bar"> 870 <div class="peiwm-progress-fill"></div> 871 </div> 872 <p class="peiwm-progress-text"><?php echo esc_html__( 'Starting...', 'post-export-import-with-media' ); ?></p> 873 <div class="peiwm-log"></div> 874 </div> 875 </div> 876 </div> 877 878 <!-- Plugins Section --> 879 <div class="peiwm-section"> 880 <h2><?php echo esc_html__( 'Plugins Backup', 'post-export-import-with-media' ); ?></h2> 881 882 <div class="peiwm-export-section"> 883 <h3><?php echo esc_html__( 'Export Plugins', 'post-export-import-with-media' ); ?></h3> 884 <p><?php echo esc_html__( 'Create a backup of your plugins as a ZIP file.', 'post-export-import-with-media' ); ?></p> 885 886 <div class="peiwm-plugin-options"> 887 <label class="peiwm-checkbox-label"> 888 <input type="radio" name="plugin_export_type" value="active" checked> 889 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'Active Plugins Only', 'post-export-import-with-media' ); ?></span> 890 </label> 891 <label class="peiwm-checkbox-label"> 892 <input type="radio" name="plugin_export_type" value="all"> 893 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'All Installed Plugins', 'post-export-import-with-media' ); ?></span> 894 </label> 895 <label class="peiwm-checkbox-label"> 896 <input type="radio" name="plugin_export_type" value="selected"> 897 <span class="peiwm-checkbox-text"><?php echo esc_html__( 'Selected Plugins', 'post-export-import-with-media' ); ?></span> 898 </label> 899 </div> 900 901 <div id="peiwm-plugin-selection" class="peiwm-selection-grid" style="display: none;"> 902 <!-- Plugin selection will be populated by JavaScript --> 903 </div> 904 905 <button type="button" id="peiwm-export-plugins" class="button button-primary"> 906 <?php echo esc_html__( 'Export Plugins', 'post-export-import-with-media' ); ?> 907 </button> 908 909 <div id="peiwm-plugins-export-progress" class="peiwm-progress" style="display: none;"> 910 <h4><?php echo esc_html__( 'Export Progress', 'post-export-import-with-media' ); ?></h4> 911 <div class="peiwm-progress-bar"> 912 <div class="peiwm-progress-fill"></div> 913 </div> 914 <p class="peiwm-progress-text"><?php echo esc_html__( 'Starting...', 'post-export-import-with-media' ); ?></p> 915 <div class="peiwm-log"></div> 916 </div> 917 </div> 918 919 <div class="peiwm-import-section"> 920 <h3><?php echo esc_html__( 'Import Plugins', 'post-export-import-with-media' ); ?></h3> 921 <p><?php echo esc_html__( 'Import plugins from a previously exported ZIP file.', 'post-export-import-with-media' ); ?></p> 922 923 <div class="button-container"> 924 <input type="file" id="peiwm-plugins-file" accept=".zip" style="display: none;"> 925 <button type="button" id="peiwm-select-plugins-file" class="button button-secondary"> 926 <?php echo esc_html__( 'Select ZIP File', 'post-export-import-with-media' ); ?> 927 </button> 928 <button type="button" id="peiwm-import-plugins" class="button button-primary" style="display: none;"> 929 <?php echo esc_html__( 'Start Import', 'post-export-import-with-media' ); ?> 930 </button> 931 </div> 932 933 <div class="peiwm-import-options" id="peiwm-plugins-import-options" style="display: none;"> 934 <label class="peiwm-checkbox-label"> 935 <input type="checkbox" id="peiwm-replace-existing-plugins" checked> 936 <span class="peiwm-checkbox-text"> 937 <?php echo esc_html__( 'Replace existing plugins', 'post-export-import-with-media' ); ?> 938 <small class="peiwm-checkbox-description"><?php echo esc_html__( 'Overwrite plugins that already exist', 'post-export-import-with-media' ); ?></small> 939 </span> 940 </label> 941 <label class="peiwm-checkbox-label"> 942 <input type="checkbox" id="peiwm-activate-imported-plugins"> 943 <span class="peiwm-checkbox-text"> 944 <?php echo esc_html__( 'Activate imported plugins', 'post-export-import-with-media' ); ?> 945 <small class="peiwm-checkbox-description"><?php echo esc_html__( 'Automatically activate plugins after import', 'post-export-import-with-media' ); ?></small> 946 </span> 947 </label> 948 </div> 949 950 <div id="peiwm-plugins-import-progress" class="peiwm-progress" style="display: none;"> 951 <h4><?php echo esc_html__( 'Import Progress', 'post-export-import-with-media' ); ?></h4> 952 <div class="peiwm-progress-bar"> 953 <div class="peiwm-progress-fill"></div> 954 </div> 955 <p class="peiwm-progress-text"><?php echo esc_html__( 'Starting...', 'post-export-import-with-media' ); ?></p> 956 <div class="peiwm-log"></div> 957 </div> 958 </div> 959 </div> 960 961 <!-- Settings Section --> 962 <div class="peiwm-section"> 963 <h2><?php echo esc_html__( 'Settings', 'post-export-import-with-media' ); ?></h2> 964 965 <div class="peiwm-settings-section"> 966 <form method="post" action="options.php"> 967 <?php settings_fields( 'peiwm_admin_download_buttons' ); ?> 968 969 <div class="download-btn-active"> 970 <h4 for=""><?php echo esc_html__( 'Admin Download Buttons', 'post-export-import-with-media' ); ?></h4> 971 <label> 972 <input type="checkbox" name="peiwm_enable_admin_download_buttons" value="1" <?php checked( get_option( 'peiwm_enable_admin_download_buttons', false ) ); ?>> 973 <?php echo esc_html__( 'Add download buttons to WordPress Themes and Plugins pages', 'post-export-import-with-media' ); ?> 974 </label> 975 <p class="description"> 976 <?php echo esc_html__( 'When enabled, download buttons will appear on the Appearance > Themes and Plugins pages, allowing you to download individual themes and plugins as ZIP files.', 'post-export-import-with-media' ); ?> 977 </p> 978 </div> 979 980 <?php submit_button(); ?> 981 </form> 982 </div> 983 </div> 984 340 985 </div> 341 986 </div> -
post-export-import-with-media/trunk/includes/class-ajax-handler.php
r3418865 r3425395 125 125 global $wp_filesystem; 126 126 if ( ! WP_Filesystem() ) { 127 wp_reset_postdata(); // Reset before throwing exception 127 128 throw new Exception( esc_html__( 'Failed to initialize filesystem', 'post-export-import-with-media' ) ); 128 129 } … … 150 151 } 151 152 } 153 154 // Reset global post data after processing 155 wp_reset_postdata(); 152 156 153 157 // Sort file types by count -
post-export-import-with-media/trunk/includes/class-main.php
r3418865 r3425395 42 42 $this->load_dependencies(); 43 43 $this->init_hooks(); 44 $this->init_global_post_protection(); 45 } 46 47 /** 48 * Initialize global post protection to prevent null post warnings 49 */ 50 private function init_global_post_protection() { 51 // Add early hook to protect against null post access 52 add_action( 'init', array( $this, 'setup_global_post_protection' ), 1 ); 53 add_action( 'admin_init', array( $this, 'setup_admin_post_protection' ), 1 ); 54 55 // Add custom error handler for null post warnings 56 add_action( 'plugins_loaded', array( $this, 'setup_error_suppression' ), 1 ); 57 } 58 59 /** 60 * Setup error suppression for null post warnings 61 */ 62 public function setup_error_suppression() { 63 // Only in admin context and for our plugin pages 64 if ( is_admin() ) { 65 // Set custom error handler to suppress null post warnings 66 set_error_handler( array( $this, 'custom_error_handler' ), E_WARNING ); 67 } 68 } 69 70 /** 71 * Custom error handler to suppress null post property warnings 72 * 73 * @param int $errno Error number 74 * @param string $errstr Error message 75 * @param string $errfile Error file 76 * @param int $errline Error line 77 * @return bool True to suppress error, false to continue normal handling 78 */ 79 public function custom_error_handler( $errno, $errstr, $errfile, $errline ) { 80 // Check if this is a null post property warning 81 if ( $errno === E_WARNING && 82 ( strpos( $errstr, 'Attempt to read property "post_status" on null' ) !== false || 83 strpos( $errstr, 'Attempt to read property "ID" on null' ) !== false || 84 strpos( $errstr, 'Attempt to read property' ) !== false && strpos( $errstr, 'on null' ) !== false ) ) { 85 86 // Suppress these specific warnings 87 return true; 88 } 89 90 // Let other errors be handled normally 91 return false; 92 } 93 94 /** 95 * Setup global post protection 96 */ 97 public function setup_global_post_protection() { 98 // Ensure global post is never null in admin context 99 if ( is_admin() ) { 100 add_action( 'wp_loaded', array( $this, 'ensure_valid_global_post' ), 1 ); 101 add_action( 'admin_head', array( $this, 'ensure_valid_global_post' ), 1 ); 102 } 103 } 104 105 /** 106 * Setup admin-specific post protection 107 */ 108 public function setup_admin_post_protection() { 109 // Protect against null post in admin context 110 add_action( 'current_screen', array( $this, 'ensure_valid_global_post' ), 1 ); 111 add_action( 'admin_enqueue_scripts', array( $this, 'ensure_valid_global_post' ), 1 ); 112 } 113 114 /** 115 * Ensure global post is never null to prevent warnings 116 */ 117 public function ensure_valid_global_post() { 118 global $post; 119 120 // If post is null, create a minimal valid post object 121 if ( null === $post ) { 122 $post = new stdClass(); 123 $post->ID = 0; 124 $post->post_status = 'publish'; 125 $post->post_type = 'post'; 126 $post->post_title = ''; 127 $post->post_content = ''; 128 $post->post_excerpt = ''; 129 $post->post_author = 0; 130 $post->post_date = current_time( 'mysql' ); 131 $post->post_modified = current_time( 'mysql' ); 132 $post->post_name = ''; 133 $post->post_parent = 0; 134 $post->menu_order = 0; 135 $post->comment_status = 'closed'; 136 $post->ping_status = 'closed'; 137 $post->comment_count = 0; 138 } 44 139 } 45 140 … … 52 147 require_once PEIWM_PLUGIN_PATH . 'includes/class-ajax-handler.php'; 53 148 require_once PEIWM_PLUGIN_PATH . 'includes/class-post-handler.php'; 149 require_once PEIWM_PLUGIN_PATH . 'includes/class-page-handler.php'; 54 150 require_once PEIWM_PLUGIN_PATH . 'includes/class-media-handler.php'; 151 require_once PEIWM_PLUGIN_PATH . 'includes/class-settings-handler.php'; 152 require_once PEIWM_PLUGIN_PATH . 'includes/class-themes-plugins-handler.php'; 153 require_once PEIWM_PLUGIN_PATH . 'includes/class-widgets-menus-handler.php'; 154 require_once PEIWM_PLUGIN_PATH . 'includes/class-admin-download-buttons.php'; 55 155 require_once PEIWM_PLUGIN_PATH . 'includes/class-generic-recommendations.php'; 56 156 } … … 68 168 // Admin init 69 169 add_action( 'admin_init', array( $this, 'admin_init' ) ); 170 171 // Register settings 172 add_action( 'admin_init', array( $this, 'register_settings' ) ); 173 174 // Fix wp-editor script conflict 175 add_action( 'admin_enqueue_scripts', array( $this, 'fix_script_conflicts' ), 1 ); 70 176 } 71 177 … … 83 189 PEIWM_Post_Handler::get_instance(); 84 190 191 // Initialize page handler 192 PEIWM_Page_Handler::get_instance(); 193 85 194 // Initialize media handler 86 195 PEIWM_Media_Handler::get_instance(); 87 196 197 // Initialize settings handler 198 PEIWM_Settings_Handler::get_instance(); 199 200 // Initialize themes & plugins handler 201 PEIWM_Themes_Plugins_Handler::get_instance(); 202 203 // Initialize widgets & menus handler 204 PEIWM_Widgets_Menus_Handler::get_instance(); 205 206 // Initialize admin download buttons 207 PEIWM_Admin_Download_Buttons::get_instance(); 208 88 209 // Initialize recommendations 89 new Recommendations(); 210 if ( class_exists( 'Recommendations' ) ) { 211 new Recommendations(); 212 } 90 213 } 91 214 … … 105 228 $role->add_cap( 'peiwm_manage' ); 106 229 } 230 } 231 232 /** 233 * Fix script conflicts 234 * 235 * @param string $hook Current admin page hook 236 */ 237 public function fix_script_conflicts( $hook ) { 238 // Prevent wp-editor script conflict on widgets page 239 if ( in_array( $hook, array( 'widgets.php', 'customize.php' ), true ) ) { 240 wp_dequeue_script( 'wp-editor' ); 241 } 242 } 243 244 /** 245 * Register plugin settings 246 */ 247 public function register_settings() { 248 register_setting( 'peiwm_admin_download_buttons', 'peiwm_enable_admin_download_buttons' ); 107 249 } 108 250 -
post-export-import-with-media/trunk/includes/class-media-handler.php
r3418865 r3425395 97 97 98 98 if ( empty( $attachments ) ) { 99 wp_reset_postdata(); // Reset before returning error 99 100 wp_send_json_error( array( 'message' => esc_html__( 'No media files found to export', 'post-export-import-with-media' ) ) ); 100 101 } … … 155 156 $zip->close(); 156 157 158 // Reset global post data after processing attachments 159 wp_reset_postdata(); 160 157 161 if ( $added_files === 0 ) { 158 162 wp_delete_file( $zip_path ); … … 204 208 'name' => isset( $_FILES['media_file']['name'] ) ? sanitize_file_name( wp_unslash( $_FILES['media_file']['name'] ) ) : '', 205 209 'type' => isset( $_FILES['media_file']['type'] ) ? sanitize_mime_type( wp_unslash( $_FILES['media_file']['type'] ) ) : '', 206 'tmp_name' => isset( $_FILES['media_file']['tmp_name'] ) ? $_FILES['media_file']['tmp_name'] : '', 210 'tmp_name' => isset( $_FILES['media_file']['tmp_name'] ) ? $_FILES['media_file']['tmp_name'] : '', // phpcs:ignore tmp_name as its system path 207 211 'error' => isset( $_FILES['media_file']['error'] ) ? absint( $_FILES['media_file']['error'] ) : UPLOAD_ERR_NO_FILE, 208 212 'size' => isset( $_FILES['media_file']['size'] ) ? absint( $_FILES['media_file']['size'] ) : 0, … … 409 413 410 414 if ( empty( $attachments ) ) { 415 wp_reset_postdata(); // Reset before returning 411 416 wp_send_json_success( array( 'message' => esc_html__( 'No media files found to delete', 'post-export-import-with-media' ) ) ); 412 417 } … … 423 428 } 424 429 } 430 431 // Reset global post data after processing 432 wp_reset_postdata(); 425 433 426 434 $message = sprintf( … … 580 588 ) ); 581 589 582 return ! empty( $existing ); 590 $result = ! empty( $existing ); 591 wp_reset_postdata(); // Always reset after get_posts 592 return $result; 583 593 } 584 594 … … 648 658 if ( is_wp_error( $attachment_id ) ) { 649 659 wp_delete_file( $target_file ); 660 wp_reset_postdata(); // Reset before returning error 650 661 return $attachment_id; 651 662 } 663 664 // Reset global post data after attachment creation 665 wp_reset_postdata(); 652 666 653 667 // Set the _wp_attached_file meta field correctly … … 660 674 $metadata = wp_generate_attachment_metadata( $attachment_id, $target_file ); 661 675 wp_update_attachment_metadata( $attachment_id, $metadata ); 676 677 // Reset global post data after metadata operations 678 wp_reset_postdata(); 662 679 663 680 // Import custom meta if available -
post-export-import-with-media/trunk/includes/class-post-handler.php
r3418865 r3425395 105 105 } 106 106 107 // Reset global post data to prevent conflicts 108 wp_reset_postdata(); 109 107 110 wp_send_json_success( array( 108 111 'data' => $export_data, … … 128 131 129 132 try { 130 $post_data_raw = isset( $_POST['post_data'] ) ? wp_unslash( $_POST['post_data'] ) : ''; // we have sanitize below with sanitize_post_data133 $post_data_raw = isset( $_POST['post_data'] ) ? wp_unslash( $_POST['post_data'] ) : ''; //phpcs:ignore we have sanitize below with sanitize_post_data 131 134 $download_missing_images = isset( $_POST['download_missing_images'] ) && $_POST['download_missing_images'] === '1'; 132 135 … … 145 148 } 146 149 147 $sanitized_post_data = $this->sanitize_post_data( $post_data ); 150 $sanitized_post_data = $this->sanitize_post_data( $post_data ); // Sanitize input data properly 148 151 149 152 // Check if post already exists … … 156 159 157 160 if ( ! empty( $existing_posts ) ) { 161 wp_reset_postdata(); // Reset before returning 158 162 wp_send_json_success( array( 159 163 'status' => 'skipped', … … 161 165 ) ); 162 166 } 167 168 // Reset post data after check 169 wp_reset_postdata(); 163 170 164 171 // Insert post … … 175 182 176 183 if ( is_wp_error( $post_id ) ) { 184 wp_reset_postdata(); // Reset before throwing exception 177 185 throw new Exception( sprintf( 178 186 esc_html__( 'Failed to create post: %s', 'post-export-import-with-media' ), … … 180 188 ) ); 181 189 } 190 191 // Reset after post creation 192 wp_reset_postdata(); 182 193 183 194 // Set post format … … 218 229 'post_content' => $updated_content, 219 230 ) ); 231 // Reset after post update 232 wp_reset_postdata(); 220 233 } 221 234 … … 261 274 262 275 try { 263 $image_data_raw = isset( $_POST['image_data'] ) ? wp_unslash( $_POST['image_data'] ) : ''; // we have sanitize below with sanitize_file_name276 $image_data_raw = isset( $_POST['image_data'] ) ? wp_unslash( $_POST['image_data'] ) : ''; //phpcs:ignore we have sanitize below with sanitize_file_name 264 277 $post_id = isset( $_POST['post_id'] ) ? absint( $_POST['post_id'] ) : 0; 265 278 … … 278 291 } 279 292 280 $filename = isset( $image_data['filename'] ) ? sanitize_file_name( $image_data['filename'] ) : ''; 293 $filename = isset( $image_data['filename'] ) ? sanitize_file_name( $image_data['filename'] ) : ''; // Sanitize input data properly 281 294 if ( empty( $filename ) ) { 282 295 throw new Exception( esc_html__( 'No filename provided', 'post-export-import-with-media' ) ); … … 346 359 347 360 if ( empty( $posts ) ) { 361 wp_reset_postdata(); // Reset before returning 348 362 wp_send_json_success( array( 'message' => esc_html__( 'No posts found to delete', 'post-export-import-with-media' ) ) ); 349 363 } … … 360 374 } 361 375 } 376 377 // Reset global post data after operations 378 wp_reset_postdata(); 362 379 363 380 $message = sprintf( … … 752 769 753 770 if ( ! empty( $attachments ) ) { 771 wp_reset_postdata(); // Reset before returning 754 772 return $attachments[0]->ID; 755 773 } 774 775 // Reset after first query 776 wp_reset_postdata(); 756 777 757 778 // If not found, try searching by post title (filename without extension) … … 764 785 765 786 if ( ! empty( $attachments ) ) { 787 wp_reset_postdata(); // Reset before returning 766 788 return $attachments[0]->ID; 767 789 } 790 791 // Reset after second query 792 wp_reset_postdata(); 768 793 769 794 // Last resort: search by filename in post_title … … 774 799 ) ); 775 800 776 return ! empty( $attachments ) ? $attachments[0]->ID : null; 801 $result = ! empty( $attachments ) ? $attachments[0]->ID : null; 802 wp_reset_postdata(); // Always reset at the end 803 return $result; 777 804 } 778 805 … … 960 987 $metadata = wp_generate_attachment_metadata( $attachment_id, $file_path ); 961 988 wp_update_attachment_metadata( $attachment_id, $metadata ); 989 990 // Reset global post data after metadata operations 991 wp_reset_postdata(); 962 992 } 963 993 … … 991 1021 remove_filter( 'http_request_timeout', array( $this, 'set_import_timeout' ) ); 992 1022 remove_filter( 'http_request_args', array( $this, 'set_import_request_args' ) ); 1023 1024 // Reset global post data after media_sideload_image (creates attachment posts) 1025 wp_reset_postdata(); 993 1026 994 1027 if ( is_wp_error( $attachment_id ) ) { -
post-export-import-with-media/trunk/languages/post-export-import-with-media.pot
r3418865 r3425395 3 3 msgstr "" 4 4 "Project-Id-Version: \n" 5 "POT-Creation-Date: 2025-12- 13 17:06+0600\n"5 "POT-Creation-Date: 2025-12-22 19:18+0600\n" 6 6 "PO-Revision-Date: 2023-11-15 13:18+0600\n" 7 7 "Last-Translator: \n" … … 25 25 "X-Poedit-SearchPathExcluded-8: .git\n" 26 26 27 #: includes/class-admin-menu.php:51 27 #: includes/class-admin-download-buttons.php:99 28 msgid "Downloading..." 29 msgstr "" 30 31 #: includes/class-admin-download-buttons.php:100 32 msgid "Download" 33 msgstr "" 34 35 #: includes/class-admin-download-buttons.php:101 36 msgid "Download failed" 37 msgstr "" 38 39 #: includes/class-admin-download-buttons.php:244 40 #: includes/class-admin-download-buttons.php:289 41 #: includes/class-ajax-handler.php:65 includes/class-ajax-handler.php:102 42 #: includes/class-ajax-handler.php:182 includes/class-ajax-handler.php:219 43 #: includes/class-generic-recommendations.php:57 44 #: includes/class-media-handler.php:80 includes/class-media-handler.php:189 45 #: includes/class-media-handler.php:319 includes/class-media-handler.php:400 46 #: includes/class-media-handler.php:463 includes/class-page-handler.php:68 47 #: includes/class-page-handler.php:125 includes/class-page-handler.php:260 48 #: includes/class-page-handler.php:590 includes/class-post-handler.php:68 49 #: includes/class-post-handler.php:125 includes/class-post-handler.php:268 50 #: includes/class-post-handler.php:346 includes/class-settings-handler.php:154 51 #: includes/class-settings-handler.php:227 52 #: includes/class-settings-handler.php:378 53 #: includes/class-themes-plugins-handler.php:65 54 #: includes/class-themes-plugins-handler.php:105 55 #: includes/class-themes-plugins-handler.php:150 56 #: includes/class-themes-plugins-handler.php:193 57 #: includes/class-themes-plugins-handler.php:236 58 #: includes/class-themes-plugins-handler.php:270 59 #: includes/class-widgets-menus-handler.php:142 60 #: includes/class-widgets-menus-handler.php:170 61 #: includes/class-widgets-menus-handler.php:196 62 #: includes/class-widgets-menus-handler.php:239 63 #: includes/class-widgets-menus-handler.php:279 64 #: includes/class-widgets-menus-handler.php:319 65 msgid "Security check failed" 66 msgstr "" 67 68 #: includes/class-admin-download-buttons.php:248 69 #: includes/class-admin-download-buttons.php:293 70 #: includes/class-ajax-handler.php:69 includes/class-ajax-handler.php:106 71 #: includes/class-ajax-handler.php:186 includes/class-ajax-handler.php:223 72 #: includes/class-media-handler.php:84 includes/class-media-handler.php:193 73 #: includes/class-media-handler.php:323 includes/class-media-handler.php:404 74 #: includes/class-media-handler.php:467 includes/class-page-handler.php:72 75 #: includes/class-page-handler.php:129 includes/class-page-handler.php:264 76 #: includes/class-page-handler.php:594 includes/class-post-handler.php:72 77 #: includes/class-post-handler.php:129 includes/class-post-handler.php:272 78 #: includes/class-post-handler.php:350 includes/class-settings-handler.php:158 79 #: includes/class-settings-handler.php:231 80 #: includes/class-settings-handler.php:382 81 #: includes/class-themes-plugins-handler.php:69 82 #: includes/class-themes-plugins-handler.php:109 83 #: includes/class-themes-plugins-handler.php:154 84 #: includes/class-themes-plugins-handler.php:197 85 #: includes/class-themes-plugins-handler.php:240 86 #: includes/class-themes-plugins-handler.php:274 87 #: includes/class-widgets-menus-handler.php:146 88 #: includes/class-widgets-menus-handler.php:174 89 #: includes/class-widgets-menus-handler.php:200 90 #: includes/class-widgets-menus-handler.php:243 91 #: includes/class-widgets-menus-handler.php:283 92 #: includes/class-widgets-menus-handler.php:323 93 msgid "Permission denied" 94 msgstr "" 95 96 #: includes/class-admin-download-buttons.php:254 97 msgid "Theme slug not provided" 98 msgstr "" 99 100 #: includes/class-admin-download-buttons.php:261 101 msgid "Theme not found" 102 msgstr "" 103 104 #: includes/class-admin-download-buttons.php:267 105 msgid "Failed to create theme backup" 106 msgstr "" 107 108 #: includes/class-admin-download-buttons.php:274 109 #, php-format 110 msgid "Theme \"%s\" ready for download" 111 msgstr "" 112 113 #: includes/class-admin-download-buttons.php:280 114 msgid "Theme download failed. Please try again." 115 msgstr "" 116 117 #: includes/class-admin-download-buttons.php:299 118 msgid "Plugin file not provided" 119 msgstr "" 120 121 #: includes/class-admin-download-buttons.php:306 122 msgid "Plugin not found" 123 msgstr "" 124 125 #: includes/class-admin-download-buttons.php:313 126 msgid "Failed to create plugin backup" 127 msgstr "" 128 129 #: includes/class-admin-download-buttons.php:320 130 #, php-format 131 msgid "Plugin \"%s\" ready for download" 132 msgstr "" 133 134 #: includes/class-admin-download-buttons.php:326 135 msgid "Plugin download failed. Please try again." 136 msgstr "" 137 138 #: includes/class-admin-menu.php:120 28 139 msgid "WP Post Export Import" 29 140 msgstr "" 30 141 31 #: includes/class-admin-menu.php: 52142 #: includes/class-admin-menu.php:121 32 143 msgid "Export/Import Posts" 33 144 msgstr "" 34 145 35 #: includes/class-admin-menu.php:63 146 #: includes/class-admin-menu.php:132 includes/class-admin-menu.php:133 147 #: includes/class-admin-menu.php:556 includes/class-admin-menu.php:561 148 msgid "Pages Export/Import" 149 msgstr "" 150 151 #: includes/class-admin-menu.php:142 includes/class-admin-menu.php:143 152 msgid "WordPress Settings" 153 msgstr "" 154 155 #: includes/class-admin-menu.php:152 includes/class-admin-menu.php:790 156 msgid "Themes & Plugins Backup" 157 msgstr "" 158 159 #: includes/class-admin-menu.php:153 160 msgid "Themes & Plugins" 161 msgstr "" 162 163 #: includes/class-admin-menu.php:162 36 164 msgid "Plugin Recommendations" 37 165 msgstr "" 38 166 39 #: includes/class-admin-menu.php: 64167 #: includes/class-admin-menu.php:163 40 168 msgid "Recommendations" 41 169 msgstr "" 42 170 43 #: includes/class-admin-menu.php:98 171 #: includes/class-admin-menu.php:197 includes/class-admin-menu.php:230 172 #: includes/class-admin-menu.php:263 includes/class-admin-menu.php:296 44 173 msgid "Please select a file to import." 45 174 msgstr "" 46 175 47 #: includes/class-admin-menu.php:99 176 #: includes/class-admin-menu.php:198 includes/class-admin-menu.php:231 177 #: includes/class-admin-menu.php:264 includes/class-admin-menu.php:297 48 178 msgid "File is too large. Please select a file smaller than 500MB." 49 179 msgstr "" 50 180 51 #: includes/class-admin-menu.php:1 00181 #: includes/class-admin-menu.php:199 includes/class-admin-menu.php:298 52 182 msgid "Please select a ZIP file." 53 183 msgstr "" 54 184 55 #: includes/class-admin-menu.php:101 185 #: includes/class-admin-menu.php:200 includes/class-admin-menu.php:233 186 #: includes/class-admin-menu.php:266 includes/class-admin-menu.php:299 56 187 msgid "Processing..." 57 188 msgstr "" 58 189 59 #: includes/class-admin-menu.php:102 includes/class-admin-menu.php:404 190 #: includes/class-admin-menu.php:201 includes/class-admin-menu.php:234 191 #: includes/class-admin-menu.php:267 includes/class-admin-menu.php:300 192 #: includes/class-admin-menu.php:1049 60 193 msgid "Success!" 61 194 msgstr "" 62 195 63 #: includes/class-admin-menu.php:103 196 #: includes/class-admin-menu.php:202 includes/class-admin-menu.php:235 197 #: includes/class-admin-menu.php:268 includes/class-admin-menu.php:301 64 198 msgid "Error:" 65 199 msgstr "" 66 200 67 #: includes/class-admin-menu.php:104 201 #: includes/class-admin-menu.php:203 includes/class-admin-menu.php:236 202 #: includes/class-admin-menu.php:269 includes/class-admin-menu.php:302 68 203 msgid "Complete!" 69 204 msgstr "" 70 205 71 #: includes/class-admin-menu.php:105 206 #: includes/class-admin-menu.php:204 includes/class-admin-menu.php:237 207 #: includes/class-admin-menu.php:270 includes/class-admin-menu.php:303 72 208 msgid "Are you sure you want to delete all items? This action cannot be undone." 73 209 msgstr "" 74 210 75 #: includes/class-admin-menu.php:142 includes/class-admin-menu.php:352 211 #: includes/class-admin-menu.php:232 includes/class-admin-menu.php:265 212 msgid "Please select a JSON file." 213 msgstr "" 214 215 #: includes/class-admin-menu.php:340 includes/class-admin-menu.php:551 216 #: includes/class-admin-menu.php:635 includes/class-admin-menu.php:786 217 #: includes/class-admin-menu.php:997 76 218 msgid "You do not have sufficient permissions to access this page." 77 219 msgstr "" 78 220 79 #: includes/class-admin-menu.php: 147221 #: includes/class-admin-menu.php:345 80 222 msgid "Export/Import Posts & Media" 81 223 msgstr "" 82 224 83 #: includes/class-admin-menu.php: 152225 #: includes/class-admin-menu.php:350 84 226 msgid "Posts Export/Import" 85 227 msgstr "" 86 228 87 #: includes/class-admin-menu.php: 155 includes/class-admin-menu.php:15888 #: includes/class-admin-menu.php: 308229 #: includes/class-admin-menu.php:353 includes/class-admin-menu.php:356 230 #: includes/class-admin-menu.php:506 89 231 msgid "Export Posts" 90 232 msgstr "" 91 233 92 #: includes/class-admin-menu.php: 156234 #: includes/class-admin-menu.php:354 93 235 msgid "Export all posts with their metadata and featured images." 94 236 msgstr "" 95 237 96 #: includes/class-admin-menu.php: 163238 #: includes/class-admin-menu.php:361 97 239 msgid "Import Posts" 98 240 msgstr "" 99 241 100 #: includes/class-admin-menu.php: 164242 #: includes/class-admin-menu.php:362 101 243 msgid "Import posts from a previously exported JSON file." 102 244 msgstr "" 103 245 104 #: includes/class-admin-menu.php:168 246 #: includes/class-admin-menu.php:366 includes/class-admin-menu.php:577 247 #: includes/class-admin-menu.php:696 includes/class-admin-menu.php:747 105 248 msgid "Select JSON File" 106 249 msgstr "" 107 250 108 #: includes/class-admin-menu.php:171 includes/class-admin-menu.php:249 251 #: includes/class-admin-menu.php:369 includes/class-admin-menu.php:447 252 #: includes/class-admin-menu.php:580 includes/class-admin-menu.php:699 253 #: includes/class-admin-menu.php:750 includes/class-admin-menu.php:846 254 #: includes/class-admin-menu.php:929 109 255 msgid "Start Import" 110 256 msgstr "" 111 257 112 #: includes/class-admin-menu.php: 179258 #: includes/class-admin-menu.php:377 includes/class-admin-menu.php:588 113 259 msgid "Download missing images from original URLs" 114 260 msgstr "" 115 261 116 #: includes/class-admin-menu.php: 181262 #: includes/class-admin-menu.php:379 includes/class-admin-menu.php:590 117 263 msgid "If images are not found in media library, try to download them from their original locations" 118 264 msgstr "" 119 265 120 #: includes/class-admin-menu.php:188 includes/class-admin-menu.php:254 266 #: includes/class-admin-menu.php:386 includes/class-admin-menu.php:452 267 #: includes/class-admin-menu.php:597 includes/class-admin-menu.php:709 268 #: includes/class-admin-menu.php:765 includes/class-admin-menu.php:868 269 #: includes/class-admin-menu.php:951 121 270 msgid "Import Progress" 122 271 msgstr "" 123 272 124 #: includes/class-admin-menu.php:192 includes/class-admin-menu.php:209 125 #: includes/class-admin-menu.php:258 includes/class-admin-menu.php:275 273 #: includes/class-admin-menu.php:390 includes/class-admin-menu.php:407 274 #: includes/class-admin-menu.php:456 includes/class-admin-menu.php:473 275 #: includes/class-admin-menu.php:601 includes/class-admin-menu.php:618 276 #: includes/class-admin-menu.php:713 includes/class-admin-menu.php:769 277 #: includes/class-admin-menu.php:831 includes/class-admin-menu.php:872 278 #: includes/class-admin-menu.php:914 includes/class-admin-menu.php:955 126 279 msgid "Starting..." 127 280 msgstr "" 128 281 129 #: includes/class-admin-menu.php: 198282 #: includes/class-admin-menu.php:396 130 283 msgid "Delete Posts" 131 284 msgstr "" 132 285 133 #: includes/class-admin-menu.php: 199286 #: includes/class-admin-menu.php:397 134 287 msgid "⚠️ Warning: This will permanently delete all posts. This action cannot be undone." 135 288 msgstr "" 136 289 137 #: includes/class-admin-menu.php: 201290 #: includes/class-admin-menu.php:399 138 291 msgid "Delete All Posts" 139 292 msgstr "" 140 293 141 #: includes/class-admin-menu.php: 205 includes/class-admin-menu.php:271294 #: includes/class-admin-menu.php:403 includes/class-admin-menu.php:469 142 295 msgid "Delete Progress" 143 296 msgstr "" 144 297 145 #: includes/class-admin-menu.php: 216298 #: includes/class-admin-menu.php:414 146 299 msgid "Media Export/Import" 147 300 msgstr "" 148 301 149 #: includes/class-admin-menu.php: 219302 #: includes/class-admin-menu.php:417 150 303 msgid "Media Statistics" 151 304 msgstr "" 152 305 153 #: includes/class-admin-menu.php: 223306 #: includes/class-admin-menu.php:421 154 307 msgid "Loading media statistics..." 155 308 msgstr "" 156 309 157 #: includes/class-admin-menu.php: 224310 #: includes/class-admin-menu.php:422 158 311 msgid "Analyzing your media library" 159 312 msgstr "" 160 313 161 #: includes/class-admin-menu.php: 228314 #: includes/class-admin-menu.php:426 162 315 msgid "Refresh Stats" 163 316 msgstr "" 164 317 165 #: includes/class-admin-menu.php: 233 includes/class-admin-menu.php:236318 #: includes/class-admin-menu.php:431 includes/class-admin-menu.php:434 166 319 msgid "Export Media" 167 320 msgstr "" 168 321 169 #: includes/class-admin-menu.php: 234322 #: includes/class-admin-menu.php:432 170 323 msgid "Export all media files with their metadata as a ZIP file." 171 324 msgstr "" 172 325 173 #: includes/class-admin-menu.php: 241326 #: includes/class-admin-menu.php:439 174 327 msgid "Import Media" 175 328 msgstr "" 176 329 177 #: includes/class-admin-menu.php: 242330 #: includes/class-admin-menu.php:440 178 331 msgid "Import media files from a previously exported ZIP file. Maximum file size: 500MB." 179 332 msgstr "" 180 333 181 #: includes/class-admin-menu.php:246 334 #: includes/class-admin-menu.php:444 includes/class-admin-menu.php:843 335 #: includes/class-admin-menu.php:926 182 336 msgid "Select ZIP File" 183 337 msgstr "" 184 338 185 #: includes/class-admin-menu.php: 264339 #: includes/class-admin-menu.php:462 186 340 msgid "Delete Media" 187 341 msgstr "" 188 342 189 #: includes/class-admin-menu.php: 265343 #: includes/class-admin-menu.php:463 190 344 msgid "⚠️ Warning: This will permanently delete all media files from the library. This action cannot be undone." 191 345 msgstr "" 192 346 193 #: includes/class-admin-menu.php: 267347 #: includes/class-admin-menu.php:465 194 348 msgid "Delete All Media" 195 349 msgstr "" 196 350 197 #: includes/class-admin-menu.php: 283351 #: includes/class-admin-menu.php:481 198 352 msgid "System Test" 199 353 msgstr "" 200 354 201 #: includes/class-admin-menu.php: 284355 #: includes/class-admin-menu.php:482 202 356 msgid "Test your server configuration to ensure compatibility." 203 357 msgstr "" 204 358 205 #: includes/class-admin-menu.php: 286359 #: includes/class-admin-menu.php:484 206 360 msgid "Test Configuration" 207 361 msgstr "" 208 362 209 #: includes/class-admin-menu.php: 293363 #: includes/class-admin-menu.php:491 210 364 msgid "How to Use This Plugin" 211 365 msgstr "" 212 366 213 #: includes/class-admin-menu.php: 294367 #: includes/class-admin-menu.php:492 214 368 msgid "Follow these steps for successful export and import with all images intact:" 215 369 msgstr "" 216 370 217 #: includes/class-admin-menu.php: 300371 #: includes/class-admin-menu.php:498 218 372 msgid "Export Media Files" 219 373 msgstr "" 220 374 221 #: includes/class-admin-menu.php: 301375 #: includes/class-admin-menu.php:499 222 376 msgid "First, export all your media files using the \"Export Media\" button above. This creates a ZIP file with all images, videos, and documents." 223 377 msgstr "" 224 378 225 #: includes/class-admin-menu.php: 309379 #: includes/class-admin-menu.php:507 226 380 msgid "Next, export your posts using the \"Export Posts\" button. This creates a JSON file with all post content and image references." 227 381 msgstr "" 228 382 229 #: includes/class-admin-menu.php: 316383 #: includes/class-admin-menu.php:514 230 384 msgid "Import Media First" 231 385 msgstr "" 232 386 233 #: includes/class-admin-menu.php: 317387 #: includes/class-admin-menu.php:515 234 388 msgid "On your destination site, import the media ZIP file first. This ensures all images are available before importing posts." 235 389 msgstr "" 236 390 237 #: includes/class-admin-menu.php: 324391 #: includes/class-admin-menu.php:522 238 392 msgid "Import Posts Last" 239 393 msgstr "" 240 394 241 #: includes/class-admin-menu.php: 325395 #: includes/class-admin-menu.php:523 242 396 msgid "Finally, import the posts JSON file. The plugin will automatically link posts to the previously imported images." 243 397 msgstr "" 244 398 245 #: includes/class-admin-menu.php: 331399 #: includes/class-admin-menu.php:529 246 400 msgid "Pro Tips" 247 401 msgstr "" 248 402 249 #: includes/class-admin-menu.php: 333403 #: includes/class-admin-menu.php:531 250 404 msgid "✓ Always import media before posts for complete image restoration" 251 405 msgstr "" 252 406 253 #: includes/class-admin-menu.php: 334407 #: includes/class-admin-menu.php:532 254 408 msgid "✓ The plugin will show which images are missing during post import" 255 409 msgstr "" 256 410 257 #: includes/class-admin-menu.php: 335411 #: includes/class-admin-menu.php:533 258 412 msgid "✓ Run the System Test first to ensure your server can handle large files" 259 413 msgstr "" 260 414 261 #: includes/class-admin-menu.php: 336415 #: includes/class-admin-menu.php:534 262 416 msgid "✓ Existing images with the same filename will be reused automatically" 263 417 msgstr "" 264 418 265 #: includes/class-admin-menu.php:361 419 #: includes/class-admin-menu.php:535 420 msgid "✓ If you enable \"Download missing images from original URLs\" and ensure the source site is live, media will be fetched directly from the original URLs. This means you won’t need to import media files separately, though the process may take additional time to download and complete." 421 msgstr "" 422 423 #: includes/class-admin-menu.php:564 includes/class-admin-menu.php:567 424 msgid "Export Pages" 425 msgstr "" 426 427 #: includes/class-admin-menu.php:565 428 msgid "Export all pages with their metadata, featured images, and hierarchy." 429 msgstr "" 430 431 #: includes/class-admin-menu.php:572 432 msgid "Import Pages" 433 msgstr "" 434 435 #: includes/class-admin-menu.php:573 436 msgid "Import pages from a previously exported JSON file." 437 msgstr "" 438 439 #: includes/class-admin-menu.php:607 includes/class-admin-menu.php:610 440 msgid "Delete All Pages" 441 msgstr "" 442 443 #: includes/class-admin-menu.php:608 444 msgid "Permanently delete all pages from your website. This action cannot be undone." 445 msgstr "" 446 447 #: includes/class-admin-menu.php:614 448 msgid "Deletion Progress" 449 msgstr "" 450 451 #: includes/class-admin-menu.php:640 includes/class-admin-menu.php:645 452 msgid "WordPress Settings Export/Import" 453 msgstr "" 454 455 #: includes/class-admin-menu.php:648 includes/class-admin-menu.php:686 456 msgid "Export Settings" 457 msgstr "" 458 459 #: includes/class-admin-menu.php:649 460 msgid "Export WordPress configuration settings from General, Writing, Reading, Discussion, Media, Permalinks, and Privacy sections." 461 msgstr "" 462 463 #: includes/class-admin-menu.php:652 464 msgid "Select Settings Groups to Export:" 465 msgstr "" 466 467 #: includes/class-admin-menu.php:656 includes/class-settings-handler.php:418 468 msgid "General Settings" 469 msgstr "" 470 471 #: includes/class-admin-menu.php:660 includes/class-settings-handler.php:423 472 msgid "Writing Settings" 473 msgstr "" 474 475 #: includes/class-admin-menu.php:664 includes/class-settings-handler.php:428 476 msgid "Reading Settings" 477 msgstr "" 478 479 #: includes/class-admin-menu.php:668 includes/class-settings-handler.php:433 480 msgid "Discussion Settings" 481 msgstr "" 482 483 #: includes/class-admin-menu.php:672 includes/class-settings-handler.php:438 484 msgid "Media Settings" 485 msgstr "" 486 487 #: includes/class-admin-menu.php:676 includes/class-settings-handler.php:443 488 msgid "Permalink Settings" 489 msgstr "" 490 491 #: includes/class-admin-menu.php:680 includes/class-settings-handler.php:448 492 msgid "Privacy Settings" 493 msgstr "" 494 495 #: includes/class-admin-menu.php:691 496 msgid "Import Settings" 497 msgstr "" 498 499 #: includes/class-admin-menu.php:692 500 msgid "Import WordPress settings from a previously exported JSON file." 501 msgstr "" 502 503 #: includes/class-admin-menu.php:704 504 msgid "Settings Preview & Selection:" 505 msgstr "" 506 507 #: includes/class-admin-menu.php:721 508 msgid "Widgets & Navigation Menus" 509 msgstr "" 510 511 #: includes/class-admin-menu.php:724 512 msgid "Export Widgets & Menus" 513 msgstr "" 514 515 #: includes/class-admin-menu.php:725 516 msgid "Export your widgets and navigation menus configuration." 517 msgstr "" 518 519 #: includes/class-admin-menu.php:729 520 msgid "Export Widgets Only" 521 msgstr "" 522 523 #: includes/class-admin-menu.php:732 524 msgid "Export Menus Only" 525 msgstr "" 526 527 #: includes/class-admin-menu.php:735 528 msgid "Export Both" 529 msgstr "" 530 531 #: includes/class-admin-menu.php:741 532 msgid "Import Widgets & Menus" 533 msgstr "" 534 535 #: includes/class-admin-menu.php:742 536 msgid "Import widgets and navigation menus from a previously exported JSON file." 537 msgstr "" 538 539 #: includes/class-admin-menu.php:758 540 msgid "Replace existing widgets and menus" 541 msgstr "" 542 543 #: includes/class-admin-menu.php:759 544 msgid "Clear existing widgets and menus before importing" 545 msgstr "" 546 547 #: includes/class-admin-menu.php:797 548 msgid "Themes Backup" 549 msgstr "" 550 551 #: includes/class-admin-menu.php:800 includes/class-admin-menu.php:823 552 msgid "Export Themes" 553 msgstr "" 554 555 #: includes/class-admin-menu.php:801 556 msgid "Create a backup of your themes as a ZIP file." 557 msgstr "" 558 559 #: includes/class-admin-menu.php:806 560 msgid "Active Theme Only" 561 msgstr "" 562 563 #: includes/class-admin-menu.php:810 564 msgid "All Installed Themes" 565 msgstr "" 566 567 #: includes/class-admin-menu.php:814 568 msgid "Selected Themes" 569 msgstr "" 570 571 #: includes/class-admin-menu.php:827 includes/class-admin-menu.php:910 572 msgid "Export Progress" 573 msgstr "" 574 575 #: includes/class-admin-menu.php:837 576 msgid "Import Themes" 577 msgstr "" 578 579 #: includes/class-admin-menu.php:838 580 msgid "Import themes from a previously exported ZIP file." 581 msgstr "" 582 583 #: includes/class-admin-menu.php:854 584 msgid "Replace existing themes" 585 msgstr "" 586 587 #: includes/class-admin-menu.php:855 588 msgid "Overwrite themes that already exist" 589 msgstr "" 590 591 #: includes/class-admin-menu.php:861 592 msgid "Activate imported theme" 593 msgstr "" 594 595 #: includes/class-admin-menu.php:862 596 msgid "Switch to the first imported theme" 597 msgstr "" 598 599 #: includes/class-admin-menu.php:880 600 msgid "Plugins Backup" 601 msgstr "" 602 603 #: includes/class-admin-menu.php:883 includes/class-admin-menu.php:906 604 msgid "Export Plugins" 605 msgstr "" 606 607 #: includes/class-admin-menu.php:884 608 msgid "Create a backup of your plugins as a ZIP file." 609 msgstr "" 610 611 #: includes/class-admin-menu.php:889 612 msgid "Active Plugins Only" 613 msgstr "" 614 615 #: includes/class-admin-menu.php:893 616 msgid "All Installed Plugins" 617 msgstr "" 618 619 #: includes/class-admin-menu.php:897 620 msgid "Selected Plugins" 621 msgstr "" 622 623 #: includes/class-admin-menu.php:920 624 msgid "Import Plugins" 625 msgstr "" 626 627 #: includes/class-admin-menu.php:921 628 msgid "Import plugins from a previously exported ZIP file." 629 msgstr "" 630 631 #: includes/class-admin-menu.php:937 632 msgid "Replace existing plugins" 633 msgstr "" 634 635 #: includes/class-admin-menu.php:938 636 msgid "Overwrite plugins that already exist" 637 msgstr "" 638 639 #: includes/class-admin-menu.php:944 640 msgid "Activate imported plugins" 641 msgstr "" 642 643 #: includes/class-admin-menu.php:945 644 msgid "Automatically activate plugins after import" 645 msgstr "" 646 647 #: includes/class-admin-menu.php:963 648 msgid "Settings" 649 msgstr "" 650 651 #: includes/class-admin-menu.php:970 652 msgid "Admin Download Buttons" 653 msgstr "" 654 655 #: includes/class-admin-menu.php:973 656 msgid "Add download buttons to WordPress Themes and Plugins pages" 657 msgstr "" 658 659 #: includes/class-admin-menu.php:976 660 msgid "When enabled, download buttons will appear on the Appearance > Themes and Plugins pages, allowing you to download individual themes and plugins as ZIP files." 661 msgstr "" 662 663 #: includes/class-admin-menu.php:1006 266 664 msgid "Discover powerful plugins to enhance your WordPress experience and boost your site's functionality" 267 665 msgstr "" 268 666 269 #: includes/class-admin-menu.php: 383667 #: includes/class-admin-menu.php:1028 270 668 msgid "Confirmation" 271 669 msgstr "" 272 670 273 #: includes/class-admin-menu.php: 387671 #: includes/class-admin-menu.php:1032 274 672 msgid "Are you sure you want to proceed?" 275 673 msgstr "" 276 674 277 #: includes/class-admin-menu.php: 391675 #: includes/class-admin-menu.php:1036 278 676 msgid "Cancel" 279 677 msgstr "" 280 678 281 #: includes/class-admin-menu.php: 394679 #: includes/class-admin-menu.php:1039 282 680 msgid "Confirm" 283 681 msgstr "" 284 682 285 #: includes/class-admin-menu.php: 409683 #: includes/class-admin-menu.php:1054 286 684 msgid "Operation completed successfully!" 287 685 msgstr "" 288 686 289 #: includes/class-admin-menu.php: 413687 #: includes/class-admin-menu.php:1058 290 688 msgid "OK" 291 689 msgstr "" 292 690 293 #: includes/class-admin-menu.php: 423691 #: includes/class-admin-menu.php:1068 294 692 msgid "Error" 295 693 msgstr "" 296 694 297 #: includes/class-admin-menu.php: 428695 #: includes/class-admin-menu.php:1073 298 696 msgid "An error occurred." 299 697 msgstr "" 300 698 301 #: includes/class-admin-menu.php: 432699 #: includes/class-admin-menu.php:1077 302 700 msgid "Close" 303 msgstr ""304 305 #: includes/class-ajax-handler.php:65 includes/class-ajax-handler.php:102306 #: includes/class-ajax-handler.php:178 includes/class-ajax-handler.php:215307 #: includes/class-generic-recommendations.php:57308 #: includes/class-media-handler.php:80 includes/class-media-handler.php:185309 #: includes/class-media-handler.php:315 includes/class-media-handler.php:396310 #: includes/class-media-handler.php:455 includes/class-post-handler.php:68311 #: includes/class-post-handler.php:122 includes/class-post-handler.php:255312 #: includes/class-post-handler.php:333313 msgid "Security check failed"314 msgstr ""315 316 #: includes/class-ajax-handler.php:69 includes/class-ajax-handler.php:106317 #: includes/class-ajax-handler.php:182 includes/class-ajax-handler.php:219318 #: includes/class-media-handler.php:84 includes/class-media-handler.php:189319 #: includes/class-media-handler.php:319 includes/class-media-handler.php:400320 #: includes/class-media-handler.php:459 includes/class-post-handler.php:72321 #: includes/class-post-handler.php:126 includes/class-post-handler.php:259322 #: includes/class-post-handler.php:337323 msgid "Permission denied"324 701 msgstr "" 325 702 … … 328 705 msgstr "" 329 706 330 #: includes/class-ajax-handler.php:12 7707 #: includes/class-ajax-handler.php:128 331 708 msgid "Failed to initialize filesystem" 332 709 msgstr "" 333 710 334 #: includes/class-ajax-handler.php:1 69711 #: includes/class-ajax-handler.php:173 335 712 msgid "Failed to get media statistics" 336 713 msgstr "" 337 714 338 #: includes/class-ajax-handler.php:1 88 includes/class-ajax-handler.php:225715 #: includes/class-ajax-handler.php:192 includes/class-ajax-handler.php:229 339 716 msgid "File not specified" 340 717 msgstr "" 341 718 342 #: includes/class-ajax-handler.php:19 5 includes/class-ajax-handler.php:232719 #: includes/class-ajax-handler.php:199 includes/class-ajax-handler.php:236 343 720 msgid "File not found" 344 721 msgstr "" … … 404 781 msgstr "" 405 782 406 #: includes/class-media-handler.php: 99783 #: includes/class-media-handler.php:100 407 784 msgid "No media files found to export" 408 785 msgstr "" 409 786 410 #: includes/class-media-handler.php:10 6787 #: includes/class-media-handler.php:107 411 788 msgid "Could not create export directory" 412 789 msgstr "" 413 790 414 #: includes/class-media-handler.php:11 4791 #: includes/class-media-handler.php:115 415 792 msgid "Could not create ZIP file" 416 793 msgstr "" 417 794 418 #: includes/class-media-handler.php:1 59795 #: includes/class-media-handler.php:163 419 796 msgid "No valid media files found to export" 420 797 msgstr "" 421 798 422 #: includes/class-media-handler.php:1 76799 #: includes/class-media-handler.php:180 423 800 msgid "Media export failed" 424 801 msgstr "" 425 802 426 #: includes/class-media-handler.php:19 5803 #: includes/class-media-handler.php:199 427 804 msgid "No file uploaded" 428 805 msgstr "" 429 806 430 #: includes/class-media-handler.php: 199807 #: includes/class-media-handler.php:203 431 808 msgid "ZipArchive class is not available on this server" 432 809 msgstr "" 433 810 434 #: includes/class-media-handler.php:2 26811 #: includes/class-media-handler.php:230 435 812 msgid "Upload directory is not writable" 436 813 msgstr "" 437 814 438 #: includes/class-media-handler.php:231 815 #: includes/class-media-handler.php:235 816 #: includes/class-themes-plugins-handler.php:529 817 #: includes/class-themes-plugins-handler.php:675 439 818 msgid "Failed to create temporary directory" 440 819 msgstr "" 441 820 442 #: includes/class-media-handler.php:24 0821 #: includes/class-media-handler.php:244 443 822 msgid "Temporary file not found or invalid" 444 823 msgstr "" 445 824 446 #: includes/class-media-handler.php:246 825 #: includes/class-media-handler.php:250 826 #: includes/class-themes-plugins-handler.php:538 827 #: includes/class-themes-plugins-handler.php:684 447 828 msgid "Failed to move uploaded file" 448 829 msgstr "" 449 830 450 #: includes/class-media-handler.php:25 5831 #: includes/class-media-handler.php:259 451 832 #, php-format 452 833 msgid "Failed to open ZIP file - file may be corrupted (Error: %d)" 453 834 msgstr "" 454 835 455 #: includes/class-media-handler.php:26 3836 #: includes/class-media-handler.php:267 456 837 msgid "Failed to extract ZIP contents" 457 838 msgstr "" 458 839 459 #: includes/class-media-handler.php:27 3840 #: includes/class-media-handler.php:277 460 841 msgid "Invalid media export file - metadata not found" 461 842 msgstr "" 462 843 463 #: includes/class-media-handler.php:28 2844 #: includes/class-media-handler.php:286 464 845 #, php-format 465 846 msgid "Invalid JSON in metadata file: %s" 466 847 msgstr "" 467 848 468 #: includes/class-media-handler.php:29 0849 #: includes/class-media-handler.php:294 469 850 msgid "Invalid media data format" 470 851 msgstr "" 471 852 472 #: includes/class-media-handler.php:3 28853 #: includes/class-media-handler.php:332 473 854 msgid "Invalid batch ID" 474 855 msgstr "" 475 856 476 #: includes/class-media-handler.php:33 4857 #: includes/class-media-handler.php:338 477 858 msgid "Batch not found or expired" 478 859 msgstr "" 479 860 480 #: includes/class-media-handler.php:34 1861 #: includes/class-media-handler.php:345 481 862 msgid "File index not found" 482 863 msgstr "" 483 864 484 #: includes/class-media-handler.php:35 3865 #: includes/class-media-handler.php:357 485 866 #, php-format 486 867 msgid "Source file not found: %s (looking in: %s)" 487 868 msgstr "" 488 869 489 #: includes/class-media-handler.php:36 4870 #: includes/class-media-handler.php:368 490 871 msgid "File already exists in media library" 491 872 msgstr "" 492 873 493 #: includes/class-media-handler.php:41 1874 #: includes/class-media-handler.php:416 494 875 msgid "No media files found to delete" 495 876 msgstr "" 496 877 497 #: includes/class-media-handler.php:4 27878 #: includes/class-media-handler.php:435 498 879 #, php-format 499 880 msgid "Deleted %d media files successfully" 500 881 msgstr "" 501 882 502 #: includes/class-media-handler.php:4 33883 #: includes/class-media-handler.php:441 503 884 #, php-format 504 885 msgid ". Failed to delete %d files." 505 886 msgstr "" 506 887 507 #: includes/class-media-handler.php:446 includes/class-post-handler.php:383 888 #: includes/class-media-handler.php:454 includes/class-page-handler.php:314 889 #: includes/class-post-handler.php:400 508 890 msgid "Delete operation failed. Please try again." 509 891 msgstr "" 510 892 511 #: includes/class-media-handler.php:4 75893 #: includes/class-media-handler.php:483 512 894 msgid "Cleanup completed" 513 895 msgstr "" 514 896 515 #: includes/class-media-handler.php:4 87897 #: includes/class-media-handler.php:495 516 898 msgid "File is too large (exceeds upload_max_filesize)" 517 899 msgstr "" 518 900 519 #: includes/class-media-handler.php:4 89901 #: includes/class-media-handler.php:497 520 902 msgid "File is too large (exceeds MAX_FILE_SIZE)" 521 903 msgstr "" 522 904 523 #: includes/class-media-handler.php:49 1905 #: includes/class-media-handler.php:499 524 906 msgid "File was only partially uploaded" 525 907 msgstr "" 526 908 527 #: includes/class-media-handler.php: 493909 #: includes/class-media-handler.php:501 528 910 msgid "No file was uploaded" 529 911 msgstr "" 530 912 531 #: includes/class-media-handler.php: 495913 #: includes/class-media-handler.php:503 532 914 msgid "Missing temporary folder" 533 915 msgstr "" 534 916 535 #: includes/class-media-handler.php: 497917 #: includes/class-media-handler.php:505 536 918 msgid "Failed to write file to disk" 537 919 msgstr "" 538 920 539 #: includes/class-media-handler.php: 499921 #: includes/class-media-handler.php:507 540 922 msgid "File upload stopped by extension" 541 923 msgstr "" 542 924 543 #: includes/class-media-handler.php:50 1925 #: includes/class-media-handler.php:509 544 926 msgid "Unknown upload error" 545 927 msgstr "" 546 928 547 #: includes/class-media-handler.php:5 14929 #: includes/class-media-handler.php:522 548 930 msgid "File is too large. Maximum size is 500MB." 549 931 msgstr "" 550 932 551 #: includes/class-media-handler.php:52 0933 #: includes/class-media-handler.php:528 552 934 msgid "Only ZIP files are allowed" 553 935 msgstr "" 554 936 555 #: includes/class-media-handler.php:5 25937 #: includes/class-media-handler.php:533 556 938 msgid "Invalid file type. Only ZIP files are allowed." 557 939 msgstr "" 558 940 559 #: includes/class-media-handler.php:6 18941 #: includes/class-media-handler.php:628 560 942 msgid "Could not create upload directory" 561 943 msgstr "" 562 944 563 #: includes/class-media-handler.php:6 26945 #: includes/class-media-handler.php:636 564 946 msgid "Source file not found" 565 947 msgstr "" 566 948 567 #: includes/class-media-handler.php:6 30949 #: includes/class-media-handler.php:640 568 950 msgid "Source is a directory, not a file" 569 951 msgstr "" 570 952 571 #: includes/class-media-handler.php:6 34953 #: includes/class-media-handler.php:644 572 954 msgid "Could not copy file to upload directory" 573 955 msgstr "" 574 956 575 #: includes/class-p ost-handler.php:113957 #: includes/class-page-handler.php:116 includes/class-post-handler.php:116 576 958 msgid "Export failed. Please try again." 577 959 msgstr "" 578 960 579 #: includes/class-post-handler.php:134 961 #: includes/class-page-handler.php:137 962 msgid "No page data provided" 963 msgstr "" 964 965 #: includes/class-page-handler.php:143 includes/class-page-handler.php:608 966 #: includes/class-post-handler.php:143 includes/class-post-handler.php:286 967 #: includes/class-settings-handler.php:245 968 #: includes/class-widgets-menus-handler.php:258 969 #: includes/class-widgets-menus-handler.php:298 970 #: includes/class-widgets-menus-handler.php:338 971 msgid "Invalid JSON data provided" 972 msgstr "" 973 974 #: includes/class-page-handler.php:147 975 msgid "Invalid page data" 976 msgstr "" 977 978 #: includes/class-page-handler.php:164 979 msgid "Page already exists" 980 msgstr "" 981 982 #: includes/class-page-handler.php:188 983 #, php-format 984 msgid "Failed to create page: %s" 985 msgstr "" 986 987 #: includes/class-page-handler.php:251 includes/class-post-handler.php:259 988 msgid "Import failed. Please check the file format." 989 msgstr "" 990 991 #: includes/class-page-handler.php:276 992 msgid "No pages found to delete" 993 msgstr "" 994 995 #: includes/class-page-handler.php:295 996 #, php-format 997 msgid "Deleted %d pages successfully" 998 msgstr "" 999 1000 #: includes/class-page-handler.php:301 1001 #, php-format 1002 msgid ". Failed to delete %d pages." 1003 msgstr "" 1004 1005 #: includes/class-page-handler.php:602 includes/class-post-handler.php:280 1006 msgid "No image data provided" 1007 msgstr "" 1008 1009 #: includes/class-page-handler.php:612 includes/class-post-handler.php:290 1010 msgid "Invalid image data" 1011 msgstr "" 1012 1013 #: includes/class-page-handler.php:617 includes/class-post-handler.php:295 1014 msgid "No filename provided" 1015 msgstr "" 1016 1017 #: includes/class-post-handler.php:137 580 1018 msgid "No post data provided" 581 1019 msgstr "" 582 1020 583 #: includes/class-post-handler.php:140 includes/class-post-handler.php:273 584 msgid "Invalid JSON data provided" 585 msgstr "" 586 587 #: includes/class-post-handler.php:144 1021 #: includes/class-post-handler.php:147 588 1022 msgid "Invalid post data" 589 1023 msgstr "" 590 1024 591 #: includes/class-post-handler.php:16 01025 #: includes/class-post-handler.php:164 592 1026 msgid "Post already exists" 593 1027 msgstr "" 594 1028 595 #: includes/class-post-handler.php:1 781029 #: includes/class-post-handler.php:186 596 1030 #, php-format 597 1031 msgid "Failed to create post: %s" 598 1032 msgstr "" 599 1033 600 #: includes/class-post-handler.php:246 601 msgid "Import failed. Please check the file format." 602 msgstr "" 603 604 #: includes/class-post-handler.php:267 605 msgid "No image data provided" 606 msgstr "" 607 608 #: includes/class-post-handler.php:277 609 msgid "Invalid image data" 610 msgstr "" 611 612 #: includes/class-post-handler.php:282 613 msgid "No filename provided" 614 msgstr "" 615 616 #: includes/class-post-handler.php:348 1034 #: includes/class-post-handler.php:362 617 1035 msgid "No posts found to delete" 618 1036 msgstr "" 619 1037 620 #: includes/class-post-handler.php:3 641038 #: includes/class-post-handler.php:381 621 1039 #, php-format 622 1040 msgid "Deleted %d posts successfully" 623 1041 msgstr "" 624 1042 625 #: includes/class-post-handler.php:3 701043 #: includes/class-post-handler.php:387 626 1044 #, php-format 627 1045 msgid ". Failed to delete %d posts." 628 1046 msgstr "" 1047 1048 #: includes/class-settings-handler.php:218 1049 msgid "Settings export failed. Please try again." 1050 msgstr "" 1051 1052 #: includes/class-settings-handler.php:239 1053 msgid "No settings data provided" 1054 msgstr "" 1055 1056 #: includes/class-settings-handler.php:249 1057 msgid "Invalid settings data format" 1058 msgstr "" 1059 1060 #: includes/class-settings-handler.php:354 1061 #, php-format 1062 msgid "Settings import completed: %d imported, %d skipped, %d failed" 1063 msgstr "" 1064 1065 #: includes/class-settings-handler.php:406 1066 msgid "Failed to get settings preview" 1067 msgstr "" 1068 1069 #: includes/class-settings-handler.php:419 1070 msgid "Site title, tagline, admin email, timezone, date/time formats" 1071 msgstr "" 1072 1073 #: includes/class-settings-handler.php:424 1074 msgid "Default category, post format, email posting settings" 1075 msgstr "" 1076 1077 #: includes/class-settings-handler.php:429 1078 msgid "Homepage settings, posts per page, RSS settings, search engine visibility" 1079 msgstr "" 1080 1081 #: includes/class-settings-handler.php:434 1082 msgid "Comments, pingbacks, avatars, moderation settings" 1083 msgstr "" 1084 1085 #: includes/class-settings-handler.php:439 1086 msgid "Image sizes, upload folder organization" 1087 msgstr "" 1088 1089 #: includes/class-settings-handler.php:444 1090 msgid "URL structure, category and tag bases" 1091 msgstr "" 1092 1093 #: includes/class-settings-handler.php:449 1094 msgid "Privacy policy page" 1095 msgstr "" 1096 1097 #: includes/class-themes-plugins-handler.php:96 1098 msgid "Failed to get themes list" 1099 msgstr "" 1100 1101 #: includes/class-themes-plugins-handler.php:141 1102 msgid "Failed to get plugins list" 1103 msgstr "" 1104 1105 #: includes/class-themes-plugins-handler.php:164 1106 msgid "No themes selected for export" 1107 msgstr "" 1108 1109 #: includes/class-themes-plugins-handler.php:170 1110 msgid "Failed to create themes backup" 1111 msgstr "" 1112 1113 #: includes/class-themes-plugins-handler.php:178 1114 #, php-format 1115 msgid "Successfully exported %d theme(s)" 1116 msgstr "" 1117 1118 #: includes/class-themes-plugins-handler.php:184 1119 msgid "Themes export failed. Please try again." 1120 msgstr "" 1121 1122 #: includes/class-themes-plugins-handler.php:207 1123 msgid "No plugins selected for export" 1124 msgstr "" 1125 1126 #: includes/class-themes-plugins-handler.php:213 1127 msgid "Failed to create plugins backup" 1128 msgstr "" 1129 1130 #: includes/class-themes-plugins-handler.php:221 1131 #, php-format 1132 msgid "Successfully exported %d plugin(s)" 1133 msgstr "" 1134 1135 #: includes/class-themes-plugins-handler.php:227 1136 msgid "Plugins export failed. Please try again." 1137 msgstr "" 1138 1139 #: includes/class-themes-plugins-handler.php:245 1140 #: includes/class-themes-plugins-handler.php:279 1141 msgid "No file uploaded or upload error" 1142 msgstr "" 1143 1144 #: includes/class-themes-plugins-handler.php:261 1145 msgid "Themes import failed. Please try again." 1146 msgstr "" 1147 1148 #: includes/class-themes-plugins-handler.php:295 1149 msgid "Plugins import failed. Please try again." 1150 msgstr "" 1151 1152 #: includes/class-themes-plugins-handler.php:519 1153 #: includes/class-themes-plugins-handler.php:665 1154 msgid "ZipArchive class not available" 1155 msgstr "" 1156 1157 #: includes/class-themes-plugins-handler.php:547 1158 #: includes/class-themes-plugins-handler.php:693 1159 msgid "Failed to open ZIP file" 1160 msgstr "" 1161 1162 #: includes/class-themes-plugins-handler.php:630 1163 #, php-format 1164 msgid "Themes import completed: %d imported, %d skipped, %d failed" 1165 msgstr "" 1166 1167 #: includes/class-themes-plugins-handler.php:637 1168 #, php-format 1169 msgid ". Activated theme: %s" 1170 msgstr "" 1171 1172 #: includes/class-themes-plugins-handler.php:779 1173 #, php-format 1174 msgid "Plugins import completed: %d imported, %d skipped, %d failed" 1175 msgstr "" 1176 1177 #: includes/class-themes-plugins-handler.php:786 1178 #, php-format 1179 msgid ". Activated %d plugin(s)" 1180 msgstr "" 1181 1182 #: includes/class-widgets-menus-handler.php:156 1183 msgid "Widgets exported successfully" 1184 msgstr "" 1185 1186 #: includes/class-widgets-menus-handler.php:160 1187 msgid "Widgets export failed. Please try again." 1188 msgstr "" 1189 1190 #: includes/class-widgets-menus-handler.php:183 1191 msgid "Navigation menus exported successfully" 1192 msgstr "" 1193 1194 #: includes/class-widgets-menus-handler.php:187 1195 msgid "Navigation menus export failed. Please try again." 1196 msgstr "" 1197 1198 #: includes/class-widgets-menus-handler.php:226 1199 msgid "Widgets and navigation menus exported successfully" 1200 msgstr "" 1201 1202 #: includes/class-widgets-menus-handler.php:230 1203 msgid "Widgets and menus export failed. Please try again." 1204 msgstr "" 1205 1206 #: includes/class-widgets-menus-handler.php:252 1207 msgid "No widgets data provided" 1208 msgstr "" 1209 1210 #: includes/class-widgets-menus-handler.php:292 1211 msgid "No menus data provided" 1212 msgstr "" 1213 1214 #: includes/class-widgets-menus-handler.php:332 1215 msgid "No data provided" 1216 msgstr "" 1217 1218 #: includes/class-widgets-menus-handler.php:358 1219 #, php-format 1220 msgid "Import completed: %d widgets and %d menus imported" 1221 msgstr "" 1222 1223 #: includes/class-widgets-menus-handler.php:492 1224 msgid "No widgets data found" 1225 msgstr "" 1226 1227 #: includes/class-widgets-menus-handler.php:545 1228 #, php-format 1229 msgid "Widgets import completed: %d imported, %d skipped, %d failed" 1230 msgstr "" 1231 1232 #: includes/class-widgets-menus-handler.php:574 1233 msgid "No menus data found" 1234 msgstr "" 1235 1236 #: includes/class-widgets-menus-handler.php:642 1237 #, php-format 1238 msgid "Navigation menus import completed: %d imported, %d skipped, %d failed" 1239 msgstr "" -
post-export-import-with-media/trunk/post-export-import-with-media.php
r3418865 r3425395 3 3 * Plugin Name: Post Export Import with Media 4 4 * 5 * @author sambyte6 * @copyright 2024- sambyte5 * @author wpazleen 6 * @copyright 2024- wpazleen 7 7 * @license GPL-2.0-or-later 8 8 * @package Post_Export_Import_With_Media … … 12 12 * Plugin URI: https://wordpress.org/plugins/post-export-import-with-media/ 13 13 * Description: Post Export Import with Media: A secure plugin to export and import WordPress posts and media files with real-time progress. 14 * Version: 1. 1.014 * Version: 1.2.0 15 15 * Requires at least: 6.7 16 16 * Requires PHP: 7.4 17 * Author: sambyte18 * Author URI: https://profiles.wordpress.org/ sambyte/17 * Author: wpazleen 18 * Author URI: https://profiles.wordpress.org/wpazleen/ 19 19 * Text Domain: post-export-import-with-media 20 20 * Domain Path: /languages/ … … 30 30 // Define plugin constants for better maintainability 31 31 if ( ! defined( 'PEIWM_VERSION' ) ) { 32 define( 'PEIWM_VERSION', '1. 1.0' );32 define( 'PEIWM_VERSION', '1.2.0' ); 33 33 } 34 34 -
post-export-import-with-media/trunk/readme.txt
r3418865 r3425395 1 1 === Post Export Import with Media === 2 Contributors: sambyte3 Tags: export-media, media, post-export2 Contributors: wpazleen, sambyte 3 Tags: export-media, import, post-export, page-export, migration 4 4 Requires at least: 6.7 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable Tag: 1. 1.07 Stable Tag: 1.2.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Easily export and import WP posts with their media files- secure, fast, and with real-time progress.11 Easily export and import WP posts, pages, media, widgets, menus, themes, plugins & settings with their media files- secure, fast, and with real-time progress. 12 12 13 13 == Description == 14 **Post Export Import with Media** is a simple yet powerful WordPress plugin that helps you securely transfer posts along with their media files between WordPress sites. Unlike the default exporter, this plugin ensures that images and attachments are included, so you don’t end up with broken links or missing media. 14 **Post Export Import with Media** is a simple yet powerful WordPress plugin that helps you securely transfer posts, pages, media, widgets, menus, themes, plugins & settings along with their media files between WordPress sites. Unlike the default exporter, this plugin ensures that images and attachments are included, so you don’t end up with broken links or missing media. 15 16 Whether you're moving to a new host, creating staging sites, or backing up your content, this plugin handles everything with professional-grade reliability and user-friendly interface. 15 17 16 18 ### ✨ Key Features 17 - Export and import posts with all attached media files 19 - Export and import posts with all attached media files, metadata, categories, tags, and custom fields 20 - Automatic media file detection and download during import 18 21 - Real-time progress tracking for smooth migration 22 - Smart image handling - reuses existing media, downloads missing files 23 - Support for featured images and inline content images 24 - Bulk delete functionality with confirmation dialogs 19 25 - Secure data handling to prevent errors or data loss 20 26 - Lightweight and beginner-friendly interface 21 27 - Works for bloggers, developers, and site administrators 22 28 23 Whether you’re moving a blog to a new domain, setting up a staging site, or backing up your posts with media, this plugin makes the process seamless and reliable. 29 #### **Pages Export/Import** 30 * Complete page hierarchy preservation 31 * Template assignments and page metadata 32 * Featured images and content images handling 33 * Parent-child page relationships maintained 34 * Custom page attributes and settings 35 36 #### **WordPress Settings Backup** 37 * 7 settings categories: General, Writing, Reading, Discussion, Media, Permalinks, Privacy 38 * Site icon export/import with URL information 39 * Selective import - choose which settings to import 40 * Detailed import logs showing success/failure for each setting 41 * Handles deprecated WordPress options automatically 42 43 #### **Widgets & Navigation Menus** 44 * Complete widget configuration export/import 45 * Widget positions and sidebar assignments 46 * Navigation menu structure with all items 47 * Menu locations and theme assignments 48 * Menu item hierarchy and custom properties 49 * Support for all widget types including custom HTML, media widgets 50 51 #### **Themes & Plugins Backup** 52 * Export active theme, all themes, or selected themes 53 * Export active plugins, all plugins, or selected plugins 54 * ZIP file creation with proper directory structure 55 * Import with replace existing or keep both options 56 * Automatic theme/plugin activation after import 57 58 #### **Advanced Admin Features** 59 * **Admin Download Buttons** - Add download buttons to WordPress themes.php and plugins.php pages 60 * **Media Statistics** - Comprehensive media library analysis with file types, sizes, and usage 61 * **System Configuration Test** - Check server capabilities and requirements 62 * **Plugin Recommendations** - Curated list of useful WordPress plugins 63 64 ### 🎯 **Perfect For** 65 66 * **Web Developers** - Quickly clone sites for development and testing 67 * **Site Migrations** - Move WordPress sites between hosts seamlessly 68 * **Backup Solutions** - Create complete site backups including media 69 * **Staging Sites** - Duplicate production sites for safe testing 70 * **Client Handoffs** - Package complete sites for client delivery 71 * **Multi-site Management** - Sync content between multiple WordPress installations 72 73 ### 🔧 **Technical Excellence** 74 75 * **Security First** - All operations use WordPress nonces and capability checks 76 * **Memory Efficient** - Handles large sites without memory issues 77 * **Cross-Platform** - Works on Windows, Linux, and macOS servers 78 * **Error Recovery** - Comprehensive error handling and user feedback 79 * **Progress Tracking** - Real-time updates during long operations 80 * **Clean Code** - Well-documented, maintainable codebase following WordPress standards 81 82 ### 📊 **Real-time Progress & Logging** 83 84 Every operation provides detailed feedback: 85 * Progress bars showing completion percentage 86 * Timestamped logs with success/warning/error indicators 87 * Detailed statistics (items imported, skipped, failed) 88 * Clear error messages with actionable solutions 89 * Import/export summaries with file information 90 91 ### 🎨 **User Experience** 92 93 * **Intuitive Interface** - Clean, modern admin interface 94 * **Responsive Design** - Works perfectly on desktop and mobile 95 * **Modal Confirmations** - Safe operations with confirmation dialogs 96 * **Detailed Help** - Comprehensive descriptions and usage instructions 97 * **Professional Styling** - Matches WordPress admin design language 24 98 25 99 … … 58 132 == Changelog == 59 133 134 ### 1.2.0 – 22 Dec 2025 135 - **WordPress Pages Export & Import** 136 - Export WordPress pages 137 - Import pages into any WordPress site without data loss 138 - Preserves page content, titles, and other structure 139 - Ideal for site migration, staging, and backups 140 141 - **WordPress Settings Export & Import** 142 - Backup and restore core WordPress settings 143 - Quickly replicate configurations across multiple sites 144 - Useful for development, testing, and production environments 145 146 - **Widgets & Navigation Menus Export & Import** 147 - Export all active widgets and sidebar configurations 148 - Backup navigation menus and menu locations 149 - Seamlessly restore widgets and menus on another site 150 151 - **Themes & Plugins Backup** 152 - Create backups of installed WordPress themes and plugins 153 - Add download buttons to WordPress themes and plugins pages to download in one click 154 - Restore themes and plugins in case of accidental deletion or site failure 155 - Simplifies site recovery and version management 156 60 157 ### 1.1.0 – 13 Dec 2025 61 158 - **New:** Download missing images from original URLs
Note: See TracChangeset
for help on using the changeset viewer.