Changeset 655267
- Timestamp:
- 01/19/2013 11:00:53 AM (13 years ago)
- Location:
- aeiou
- Files:
-
- 3 edited
- 5 copied
-
tags/0.3 (copied) (copied from aeiou/trunk)
-
tags/0.3/index.php (copied) (copied from aeiou/trunk/index.php) (4 diffs)
-
tags/0.3/languages (copied) (copied from aeiou/trunk/languages)
-
tags/0.3/parsers.php (copied) (copied from aeiou/trunk/parsers.php) (2 diffs)
-
tags/0.3/readme.txt (copied) (copied from aeiou/trunk/readme.txt) (2 diffs)
-
trunk/index.php (modified) (4 diffs)
-
trunk/parsers.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
aeiou/tags/0.3/index.php
r654798 r655267 5 5 Description: AEIOU is a powerfull plugin that export all wordpress users info into an XML file including user metadatas and allow to import the same xml file into a new wordpress keeping the metadata of each user. The plugin is able to export buddypress xprofile data too. 6 6 Author: toSend.it di Luisa Marra 7 Version: 0. 27 Version: 0.3 8 8 Author URI: http://tosend.it 9 9 */ … … 11 11 if(!class_exists('AEIOU')){ 12 12 class AEIOU{ 13 const VERSION = '0. 2';13 const VERSION = '0.3'; 14 14 const LANG_DOMAIN = 'AEIOU'; 15 15 … … 39 39 private function toXMLItem($user){ 40 40 echo("\t<user base_id=\"{$user->ID}\">\n"); 41 echo("\t\t<user_login><![CDATA[{$user->user_login}]]></user_login>\n"); 41 echo("\t\t<user_login><![CDATA[{$user->user_login}]]></user_login>\n"); 42 /* 43 * I should export Password too (as requested by user) 44 */ 45 if(isset($_GET['pwd'])) echo("<user_pass><![CDATA[{$user->user_pass}]]></user_pass>\n"); 46 47 echo("\t\t<user_nicename><![CDATA[{$user->user_nicename}]]></user_nicename>\n"); 48 echo("\t\t<user_email><![CDATA[{$user->user_email}]]></user_email>\n"); 49 echo("\t\t<user_url><![CDATA[{$user->user_url}]]></user_url>\n"); 50 echo("\t\t<user_registered><![CDATA[{$user->user_registered}]]></user_registered>\n"); 51 echo("\t\t<user_activation_key><![CDATA[{$user->user_activation_key}]]></user_activation_key>\n"); 52 echo("\t\t<user_status><![CDATA[{$user->user_status}]]></user_status>\n"); 53 echo("\t\t<display_name><![CDATA[{$user->display_name}]]></display_name>\n"); 54 55 if($this->exportMetadata || $this->exportOptions){ 42 56 /* 43 * I should export Password too(as requested by user)57 * I should export metadata (as requested by user) 44 58 */ 45 if(isset($_GET['pwd'])) echo("<user_pass><![CDATA[{$user->user_pass}]]></user_pass>\n"); 46 47 echo("\t\t<user_nicename><![CDATA[{$user->user_nicename}]]></user_nicename>\n"); 48 echo("\t\t<user_email><![CDATA[{$user->user_email}]]></user_email>\n"); 49 echo("\t\t<user_url><![CDATA[{$user->user_url}]]></user_url>\n"); 50 echo("\t\t<user_registered><![CDATA[{$user->user_registered}]]></user_registered>\n"); 51 echo("\t\t<user_activation_key><![CDATA[{$user->user_activation_key}]]></user_activation_key>\n"); 52 echo("\t\t<user_status><![CDATA[{$user->user_status}]]></user_status>\n"); 53 echo("\t\t<display_name><![CDATA[{$user->display_name}]]></display_name>\n"); 54 55 if($this->exportMetadata || $this->exportOptions){ 59 echo("\t\t<metadata>"); 60 global $wpdb; 61 $umeta = get_user_meta($user->ID); 62 foreach($umeta as $key => $value){ 63 $isOption = preg_match("#^" . preg_quote($wpdb->prefix) ."#", $key); 64 if( ($isOption && $this->exportOptions) || (!$isOption && $this->exportMetadata) ){ 65 66 echo("\t\t\t<meta "); 67 68 if(preg_match("#^" . preg_quote($wpdb->prefix) ."#", $key)){ 69 /* 70 * If the value is an option i should remove the db prefix from the option 71 * name and add the attribute option to allow the importer to understand 72 * when a node is an option or a setting. 73 */ 74 echo('option="true" '); 75 echo('global="false" '); 76 $key =substr($key, strlen($wpdb->prefix)); 77 } 78 echo("key=\"$key\"><![CDATA["); 79 $value = $value[0]; 80 echo base64_encode($value); 81 echo("]]></meta>\n"); 82 } 83 84 } 85 86 echo("\t\t</metadata>"); 87 } 88 if( class_exists('BuddyPress') ){ 89 if(class_exists('BP_XProfile_Group') && $this->exportXProfile ){ 56 90 /* 57 * I should export metadata (as requested by user) 58 */ 59 echo("\t\t<metadata>"); 60 global $wpdb; 61 $umeta = get_user_meta($user->ID); 62 foreach($umeta as $key => $value){ 63 $isOption = preg_match("#^" . preg_quote($wpdb->prefix) ."#", $key); 64 if( ($isOption && $this->exportOptions) || (!$isOption && $this->exportMetadata) ){ 91 * I should export xprofile data too. 92 */ 93 $groups = BP_XProfile_Group::get( array( 94 'fetch_fields' => true 95 ) ); 96 /* 97 * Fetching all groups 98 */ 99 echo("\t\t<xprofile>"); 100 foreach($groups as $group){ 101 $groupName = $group->name; 102 if(!empty($group->fields)){ 65 103 66 echo("\t\t\t<meta "); 67 68 if(preg_match("#^" . preg_quote($wpdb->prefix) ."#", $key)){ 69 /* 70 * If the value is an option i should remove the db prefix from the option 71 * name and add the attribute option to allow the importer to understand 72 * when a node is an option or a setting. 73 */ 74 echo('option="true" '); 75 echo('global="false" '); 76 $key =substr($key, strlen($wpdb->prefix)); 77 } 78 echo("key=\"$key\"><![CDATA["); 79 $value = $value[0]; 80 echo base64_encode($value); 81 echo("]]></meta>\n"); 82 } 83 84 } 85 86 echo("\t\t</metadata>"); 87 } 88 if( class_exists('BuddyPress') ){ 89 if(class_exists('BP_XProfile_Group') && $this->exportXProfile ){ 90 /* 91 * I should export xprofile data too. 92 */ 93 $groups = BP_XProfile_Group::get( array( 94 'fetch_fields' => true 95 ) ); 96 /* 97 * Fetching all groups 98 */ 99 echo("\t\t<xprofile>"); 100 foreach($groups as $group){ 101 $groupName = $group->name; 102 if(!empty($group->fields)){ 103 104 /* 105 * Has fields in group 106 */ 107 foreach($group->fields as $field){ 108 $value = xprofile_get_field_data($field->id, $user->ID, 'array'); 109 echo("<field group=\"$groupName\" name=\"{$field->name}\">"); 110 $value = serialize($value); 111 #$value = base64_encode($value); 112 echo $value; 113 echo("</field>"); 114 } 104 /* 105 * Has fields in group 106 */ 107 foreach($group->fields as $field){ 108 $value = xprofile_get_field_data($field->id, $user->ID, 'array'); 109 echo("<field group=\"$groupName\" name=\"{$field->name}\">"); 110 $value = serialize($value); 111 #$value = base64_encode($value); 112 echo $value; 113 echo("</field>"); 115 114 } 116 115 } 117 echo("\t\t</xprofile>");118 116 } 119 120 } 121 117 echo("\t\t</xprofile>"); 118 119 } 120 } 121 122 do_action('aeiou_export_extra_data', $user); 122 123 echo("\t</user>\n\n"); 123 124 } … … 130 131 * Make the XML but ensure it will be downloaded 131 132 */ 133 134 $url = site_url(); 135 $url = preg_replace('#[^a-z0-9_\-.]+#i','_', $url); 136 $date = date('Y-m-d-h-i-s'); 137 132 138 header("Cache-Control: public"); 133 139 header("Content-Description: File Transfer"); 134 140 header('Content-type: application/xml; encoding=utf-8'); 135 header("Content-Disposition: attachment; filename=aeiou_ users.xml");141 header("Content-Disposition: attachment; filename=aeiou_{$url}_{$date}.xml"); 136 142 header("Content-Transfer-Encoding: binary"); 137 143 -
aeiou/tags/0.3/parsers.php
r654798 r655267 9 9 $internal_errors = libxml_use_internal_errors(true); 10 10 $xml = simplexml_load_file( $file ); 11 11 12 // halt if loading produces an error 12 13 if ( ! $xml ){ … … 97 98 * Since version 0.2 (can extend import object threating further informations from xml file) 98 99 */ 100 99 101 $userRow = apply_filters('aeiou_filter_row', $userRow, $user); 100 102 -
aeiou/tags/0.3/readme.txt
r654798 r655267 5 5 Requires at least: 3.4 6 6 Tested up to: 3.5 7 Stable tag: 0. 27 Stable tag: 0.3 8 8 License: GPLv2 9 9 … … 42 42 == Changelog == 43 43 44 = 0.3 (2013-01-19) = 45 * **New:** Added action aeiou_export_extra_data 46 * **New:** Now the export filename has the website name and the current date time. 47 * **Update:** Update software version 48 49 44 50 = 0.2 (2013-01-18) = 45 51 * **New:** Now you can export and import BuddyPress XProfile data too. If fields or group does not exists they will be created and the field will become of generic type `text` -
aeiou/trunk/index.php
r654798 r655267 5 5 Description: AEIOU is a powerfull plugin that export all wordpress users info into an XML file including user metadatas and allow to import the same xml file into a new wordpress keeping the metadata of each user. The plugin is able to export buddypress xprofile data too. 6 6 Author: toSend.it di Luisa Marra 7 Version: 0. 27 Version: 0.3 8 8 Author URI: http://tosend.it 9 9 */ … … 11 11 if(!class_exists('AEIOU')){ 12 12 class AEIOU{ 13 const VERSION = '0. 2';13 const VERSION = '0.3'; 14 14 const LANG_DOMAIN = 'AEIOU'; 15 15 … … 39 39 private function toXMLItem($user){ 40 40 echo("\t<user base_id=\"{$user->ID}\">\n"); 41 echo("\t\t<user_login><![CDATA[{$user->user_login}]]></user_login>\n"); 41 echo("\t\t<user_login><![CDATA[{$user->user_login}]]></user_login>\n"); 42 /* 43 * I should export Password too (as requested by user) 44 */ 45 if(isset($_GET['pwd'])) echo("<user_pass><![CDATA[{$user->user_pass}]]></user_pass>\n"); 46 47 echo("\t\t<user_nicename><![CDATA[{$user->user_nicename}]]></user_nicename>\n"); 48 echo("\t\t<user_email><![CDATA[{$user->user_email}]]></user_email>\n"); 49 echo("\t\t<user_url><![CDATA[{$user->user_url}]]></user_url>\n"); 50 echo("\t\t<user_registered><![CDATA[{$user->user_registered}]]></user_registered>\n"); 51 echo("\t\t<user_activation_key><![CDATA[{$user->user_activation_key}]]></user_activation_key>\n"); 52 echo("\t\t<user_status><![CDATA[{$user->user_status}]]></user_status>\n"); 53 echo("\t\t<display_name><![CDATA[{$user->display_name}]]></display_name>\n"); 54 55 if($this->exportMetadata || $this->exportOptions){ 42 56 /* 43 * I should export Password too(as requested by user)57 * I should export metadata (as requested by user) 44 58 */ 45 if(isset($_GET['pwd'])) echo("<user_pass><![CDATA[{$user->user_pass}]]></user_pass>\n"); 46 47 echo("\t\t<user_nicename><![CDATA[{$user->user_nicename}]]></user_nicename>\n"); 48 echo("\t\t<user_email><![CDATA[{$user->user_email}]]></user_email>\n"); 49 echo("\t\t<user_url><![CDATA[{$user->user_url}]]></user_url>\n"); 50 echo("\t\t<user_registered><![CDATA[{$user->user_registered}]]></user_registered>\n"); 51 echo("\t\t<user_activation_key><![CDATA[{$user->user_activation_key}]]></user_activation_key>\n"); 52 echo("\t\t<user_status><![CDATA[{$user->user_status}]]></user_status>\n"); 53 echo("\t\t<display_name><![CDATA[{$user->display_name}]]></display_name>\n"); 54 55 if($this->exportMetadata || $this->exportOptions){ 59 echo("\t\t<metadata>"); 60 global $wpdb; 61 $umeta = get_user_meta($user->ID); 62 foreach($umeta as $key => $value){ 63 $isOption = preg_match("#^" . preg_quote($wpdb->prefix) ."#", $key); 64 if( ($isOption && $this->exportOptions) || (!$isOption && $this->exportMetadata) ){ 65 66 echo("\t\t\t<meta "); 67 68 if(preg_match("#^" . preg_quote($wpdb->prefix) ."#", $key)){ 69 /* 70 * If the value is an option i should remove the db prefix from the option 71 * name and add the attribute option to allow the importer to understand 72 * when a node is an option or a setting. 73 */ 74 echo('option="true" '); 75 echo('global="false" '); 76 $key =substr($key, strlen($wpdb->prefix)); 77 } 78 echo("key=\"$key\"><![CDATA["); 79 $value = $value[0]; 80 echo base64_encode($value); 81 echo("]]></meta>\n"); 82 } 83 84 } 85 86 echo("\t\t</metadata>"); 87 } 88 if( class_exists('BuddyPress') ){ 89 if(class_exists('BP_XProfile_Group') && $this->exportXProfile ){ 56 90 /* 57 * I should export metadata (as requested by user) 58 */ 59 echo("\t\t<metadata>"); 60 global $wpdb; 61 $umeta = get_user_meta($user->ID); 62 foreach($umeta as $key => $value){ 63 $isOption = preg_match("#^" . preg_quote($wpdb->prefix) ."#", $key); 64 if( ($isOption && $this->exportOptions) || (!$isOption && $this->exportMetadata) ){ 91 * I should export xprofile data too. 92 */ 93 $groups = BP_XProfile_Group::get( array( 94 'fetch_fields' => true 95 ) ); 96 /* 97 * Fetching all groups 98 */ 99 echo("\t\t<xprofile>"); 100 foreach($groups as $group){ 101 $groupName = $group->name; 102 if(!empty($group->fields)){ 65 103 66 echo("\t\t\t<meta "); 67 68 if(preg_match("#^" . preg_quote($wpdb->prefix) ."#", $key)){ 69 /* 70 * If the value is an option i should remove the db prefix from the option 71 * name and add the attribute option to allow the importer to understand 72 * when a node is an option or a setting. 73 */ 74 echo('option="true" '); 75 echo('global="false" '); 76 $key =substr($key, strlen($wpdb->prefix)); 77 } 78 echo("key=\"$key\"><![CDATA["); 79 $value = $value[0]; 80 echo base64_encode($value); 81 echo("]]></meta>\n"); 82 } 83 84 } 85 86 echo("\t\t</metadata>"); 87 } 88 if( class_exists('BuddyPress') ){ 89 if(class_exists('BP_XProfile_Group') && $this->exportXProfile ){ 90 /* 91 * I should export xprofile data too. 92 */ 93 $groups = BP_XProfile_Group::get( array( 94 'fetch_fields' => true 95 ) ); 96 /* 97 * Fetching all groups 98 */ 99 echo("\t\t<xprofile>"); 100 foreach($groups as $group){ 101 $groupName = $group->name; 102 if(!empty($group->fields)){ 103 104 /* 105 * Has fields in group 106 */ 107 foreach($group->fields as $field){ 108 $value = xprofile_get_field_data($field->id, $user->ID, 'array'); 109 echo("<field group=\"$groupName\" name=\"{$field->name}\">"); 110 $value = serialize($value); 111 #$value = base64_encode($value); 112 echo $value; 113 echo("</field>"); 114 } 104 /* 105 * Has fields in group 106 */ 107 foreach($group->fields as $field){ 108 $value = xprofile_get_field_data($field->id, $user->ID, 'array'); 109 echo("<field group=\"$groupName\" name=\"{$field->name}\">"); 110 $value = serialize($value); 111 #$value = base64_encode($value); 112 echo $value; 113 echo("</field>"); 115 114 } 116 115 } 117 echo("\t\t</xprofile>");118 116 } 119 120 } 121 117 echo("\t\t</xprofile>"); 118 119 } 120 } 121 122 do_action('aeiou_export_extra_data', $user); 122 123 echo("\t</user>\n\n"); 123 124 } … … 130 131 * Make the XML but ensure it will be downloaded 131 132 */ 133 134 $url = site_url(); 135 $url = preg_replace('#[^a-z0-9_\-.]+#i','_', $url); 136 $date = date('Y-m-d-h-i-s'); 137 132 138 header("Cache-Control: public"); 133 139 header("Content-Description: File Transfer"); 134 140 header('Content-type: application/xml; encoding=utf-8'); 135 header("Content-Disposition: attachment; filename=aeiou_ users.xml");141 header("Content-Disposition: attachment; filename=aeiou_{$url}_{$date}.xml"); 136 142 header("Content-Transfer-Encoding: binary"); 137 143 -
aeiou/trunk/parsers.php
r654798 r655267 9 9 $internal_errors = libxml_use_internal_errors(true); 10 10 $xml = simplexml_load_file( $file ); 11 11 12 // halt if loading produces an error 12 13 if ( ! $xml ){ … … 97 98 * Since version 0.2 (can extend import object threating further informations from xml file) 98 99 */ 100 99 101 $userRow = apply_filters('aeiou_filter_row', $userRow, $user); 100 102 -
aeiou/trunk/readme.txt
r654798 r655267 5 5 Requires at least: 3.4 6 6 Tested up to: 3.5 7 Stable tag: 0. 27 Stable tag: 0.3 8 8 License: GPLv2 9 9 … … 42 42 == Changelog == 43 43 44 = 0.3 (2013-01-19) = 45 * **New:** Added action aeiou_export_extra_data 46 * **New:** Now the export filename has the website name and the current date time. 47 * **Update:** Update software version 48 49 44 50 = 0.2 (2013-01-18) = 45 51 * **New:** Now you can export and import BuddyPress XProfile data too. If fields or group does not exists they will be created and the field will become of generic type `text`
Note: See TracChangeset
for help on using the changeset viewer.