Changeset 2732013
- Timestamp:
- 05/26/2022 03:42:58 PM (4 years ago)
- Location:
- advanced-import
- Files:
-
- 40 added
- 6 edited
-
tags/1.3.7 (added)
-
tags/1.3.7/LICENSE.txt (added)
-
tags/1.3.7/admin (added)
-
tags/1.3.7/admin/class-advanced-import-admin.php (added)
-
tags/1.3.7/admin/class-advanced-import-tracking.php (added)
-
tags/1.3.7/admin/class-elementor-import.php (added)
-
tags/1.3.7/admin/class-reset.php (added)
-
tags/1.3.7/admin/index.php (added)
-
tags/1.3.7/advanced-import.php (added)
-
tags/1.3.7/assets (added)
-
tags/1.3.7/assets/css (added)
-
tags/1.3.7/assets/css/advanced-import-admin.min.css (added)
-
tags/1.3.7/assets/js (added)
-
tags/1.3.7/assets/js/advanced-import-admin.min.js (added)
-
tags/1.3.7/assets/library (added)
-
tags/1.3.7/assets/library/isotope (added)
-
tags/1.3.7/assets/library/isotope/isotope.pkgd.min.js (added)
-
tags/1.3.7/assets/library/sweetalert2 (added)
-
tags/1.3.7/assets/library/sweetalert2/sweetalert2.all.js (added)
-
tags/1.3.7/assets/library/sweetalert2/sweetalert2.all.min.js (added)
-
tags/1.3.7/example.php (added)
-
tags/1.3.7/includes (added)
-
tags/1.3.7/includes/class-advanced-import-activator.php (added)
-
tags/1.3.7/includes/class-advanced-import-cron.php (added)
-
tags/1.3.7/includes/class-advanced-import-deactivator.php (added)
-
tags/1.3.7/includes/class-advanced-import-i18n.php (added)
-
tags/1.3.7/includes/class-advanced-import-loader.php (added)
-
tags/1.3.7/includes/class-advanced-import.php (added)
-
tags/1.3.7/includes/class-theme-template-library-base.php (added)
-
tags/1.3.7/includes/functions-advanced-import.php (added)
-
tags/1.3.7/includes/index.php (added)
-
tags/1.3.7/includes/theme-template-library (added)
-
tags/1.3.7/includes/theme-template-library/acmethemes.php (added)
-
tags/1.3.7/includes/theme-template-library/cosmoswp.php (added)
-
tags/1.3.7/index.php (added)
-
tags/1.3.7/languages (added)
-
tags/1.3.7/languages/advanced-import.pot (added)
-
tags/1.3.7/readme.txt (added)
-
tags/1.3.7/uninstall.php (added)
-
trunk/admin/class-advanced-import-admin.php (modified) (4 diffs)
-
trunk/admin/class-elementor-import.php (modified) (3 diffs)
-
trunk/advanced-import.php (modified) (2 diffs)
-
trunk/includes/class-advanced-import-cron.php (added)
-
trunk/includes/class-advanced-import.php (modified) (1 diff)
-
trunk/includes/functions-advanced-import.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
advanced-import/trunk/admin/class-advanced-import-admin.php
r2715268 r2732013 1469 1469 } 1470 1470 1471 /*check if already exists by post_name*/ 1472 if ( empty( $post_data['post_title'] ) && ! empty( $post_data['post_name'] ) ) { 1473 global $wpdb; 1474 $sql = " 1475 SELECT ID, post_name, post_parent, post_type 1476 FROM $wpdb->posts 1477 WHERE post_name = %s 1478 AND post_type = %s 1479 "; 1480 $pages = $wpdb->get_results( 1481 $wpdb->prepare( 1482 $sql, 1483 array( 1484 $post_data['post_name'], 1485 $post_type, 1486 ) 1487 ), 1488 OBJECT_K 1489 ); 1490 1491 $foundid = 0; 1492 foreach ( (array) $pages as $page ) { 1493 if ( $page->post_name == $post_data['post_name'] && empty( $page->post_title ) ) { 1494 $foundid = $page->ID; 1495 } 1496 } 1497 1498 /*if we have found id by post_name, imported_post_id and return*/ 1499 if ( $foundid ) { 1500 $this->imported_post_id( $post_data['post_id'], $foundid ); 1501 return true; 1502 } 1503 } 1504 1505 /* 1506 check if already exists by post_name and post_title*/ 1471 $foundid = 0; 1472 1473 /* 1474 check if already exists by post_name and post_title*/ 1507 1475 /*don't use post_exists because it will dupe up on media with same name but different slug*/ 1508 1476 if ( ! empty( $post_data['post_title'] ) && ! empty( $post_data['post_name'] ) ) { … … 1527 1495 ); 1528 1496 1529 $foundid = 0;1530 1497 foreach ( (array) $pages as $page ) { 1531 1498 if ( $page->post_name == $post_data['post_name'] ) { 1532 1499 $foundid = $page->ID; 1533 1500 } 1534 }1535 1536 /*if we have found id by post_name and post_title, imported_post_id and return*/1537 $elementor_library_id = '';1538 if ( $foundid && 'elementor_library' != $post_type ) {1539 $this->imported_post_id( $post_data['post_id'], $foundid );1540 return true;1541 }1542 if ( $foundid && 'elementor_library' == $post_type ) {1543 $elementor_library_id = $foundid;1544 1501 } 1545 1502 } … … 1643 1600 break; 1644 1601 1602 /*TODO*/ 1645 1603 case 'elementor_library': 1646 1604 if ( empty( $elementor_library_id ) ) { … … 1818 1776 1819 1777 /*finally insert post data*/ 1820 $post_id = wp_insert_post( $post_data, true ); 1778 1779 if( $foundid > 0 ){ 1780 $post_data['ID'] = $foundid; 1781 /*finally insert post data*/ 1782 $post_id = wp_update_post( $post_data, true ); 1783 } 1784 else{ 1785 $post_id = wp_insert_post( $post_data, true ); 1786 } 1821 1787 if ( ! is_wp_error( $post_id ) ) { 1822 1788 -
advanced-import/trunk/admin/class-elementor-import.php
r2715268 r2732013 119 119 * @param array $item current array of demo list. 120 120 * @param string $key 121 * @return string121 * @return array 122 122 */ 123 123 public function elementor_data( $elementor_data ) { … … 208 208 } 209 209 210 return wp_json_encode( $elementor_data );210 return $elementor_data; 211 211 } 212 212 … … 216 216 * @param array $item current array of demo list. 217 217 * @param string $key 218 * @return string218 * @return void 219 219 */ 220 220 public function process_elementor_posts() { -
advanced-import/trunk/advanced-import.php
r2715268 r2732013 15 15 * Plugin URI: https://addonspress.com/item/advanced-import 16 16 * Description: Easily import demo data starter site packages or Migrate your site data 17 * Version: 1.3. 617 * Version: 1.3.7 18 18 * Author: AddonsPress 19 19 * Author URI: https://addonspress.com/ … … 25 25 26 26 /*Define Constants for this plugin*/ 27 define( 'ADVANCED_IMPORT_VERSION', '1.3. 6' );27 define( 'ADVANCED_IMPORT_VERSION', '1.3.7' ); 28 28 define( 'ADVANCED_IMPORT_PLUGIN_NAME', 'advanced-import' ); 29 29 define( 'ADVANCED_IMPORT_PATH', plugin_dir_path( __FILE__ ) ); -
advanced-import/trunk/includes/class-advanced-import.php
r2715268 r2732013 176 176 */ 177 177 require_once ADVANCED_IMPORT_PATH . 'includes/functions-advanced-import.php'; 178 require_once ADVANCED_IMPORT_PATH . 'includes/class-advanced-import-cron.php'; 178 179 179 180 /** -
advanced-import/trunk/includes/functions-advanced-import.php
r2715268 r2732013 46 46 } 47 47 } 48 49 function advanced_import_add_log( $entry, $file = 'advanced-import.log', $mode = 'default' ) { 50 // Get WordPress uploads directory. 51 $upload_dir = wp_upload_dir(); 52 $upload_dir = $upload_dir['basedir']; 53 // If the entry is array, json_encode. 54 if ( is_array( $entry ) ) { 55 $entry = json_encode( $entry ); 56 } 57 // Write the log file. 58 $file = $upload_dir . '/' . $file; 59 if ( 'default' === $mode ) { 60 if ( file_exists( $file ) ) { 61 $mode = 'a'; 62 } else { 63 $mode = 'w'; 64 } 65 } 66 67 $file = fopen( $file, $mode ); 68 $bytes = fwrite( $file, $entry . "\n" ); 69 fclose( $file ); 70 return $bytes; 71 } -
advanced-import/trunk/readme.txt
r2715268 r2732013 5 5 Tags: import, advanced import, demo import, theme import, widget import, customizer import 6 6 Requires at least: 5.0 7 Tested up to: 5.97 Tested up to: 6.0 8 8 Requires PHP: 5.6.20 9 Stable tag: 1.3. 69 Stable tag: 1.3.7 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 225 225 == Changelog == 226 226 227 = 1.3.7 - 2022-05-26 = 228 * Updated : Tested up WordPress 6 229 * Fixed : Elementor imports in some cases 230 227 231 = 1.3.6 - 2022-04-27 = 228 232 * Updated : Reset plugin via ajax
Note: See TracChangeset
for help on using the changeset viewer.