Support » Plugin: Import and export users and customers » bad bugs. bad software design. do not use in production environment!

  • Very bad bugs with this plugin. How this can score 5 Stars is beyond me. Goes to show you have to be careful with the WP community – lot’s of n00bs around.

    This user import plugin get’s mixed up when you use Mailadresses for Usernames, and ignores named fields such as user_login. It also get’s mixed up if columns aren’t in a specific order.

    Bottom line:
    Badly designed and programmed plugin. Or this version (1.5.1) is buggy as hell. This is alpha stage software.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Javier Carazo

    (@carazo)

    modparlor,

    Sorry for the delay answering, but I was out in a trip.

    Thanks for your review, it gives me a new vision of my plugin, but yes, I have to tell you that maybe you don’t know how to use the plugin and I am sure you are this kind of person who think: I know much more than the rest (I tell you it for this: be careful with the WP community – lot’s of n00bs around).

    Surely not. Where are your plugins? What have you done for WordPress?

    With this kind of reviews everybody loose. There is no good plugins to do it in WordPress and this one is the only one which is being updated.

    And yes, maybe I will discontinue this plugin thanks to your review.

    Plugin Author Javier Carazo

    (@carazo)

    Ok, please read all our threads answering problems and solving it.

    I think we try to do the best… so I will never understand your.

    modparlor is not popular in the Internet I cannot see what have you done for this or any other community, surely it would be great software.

    We will continue working to improve it everyday, have a nice day!

    Thread Starter modparlor

    (@modparlor)

    How about assigning each colum in the CSV to a field in the DB and giving it consistant naming – LIKE THE ONE USED IN THE DB? … OK, so consistant won’t be possible, this is WordPress. But I think it’s not to much asked to do a proper assignment to DB fields and a line or two of explainations of those fields – that way your little script could easyly work relyably.

    Whatever you do, a file-import into a DB should never get mixed up simply because the fields are in a ‘wrong’ order and this isn’t even documented. … Maybe I’m wrong and the relevante DB fields have changed in 4.2.x (this was the version I used the plugin in) – but I doubt it.

    I’ve added a DB Import Class from a project of mine in this post as code below. Pay attention to the openFile(…) function and the >>>>first line is fieldnames<<<< comment, the getImportLine(…) function and the getAttributeList(…) function. This is definitely not the best DB import, but this is how it should be done. I appreciate your free plugin, but sorry dude, bad code is bad code.

    You may use this code whereever you may need it in this plugin. Hope to see an improved update soon. ;;-)

    <?php
    	class DbImport
    	{
    		private $importSourceIsFile = false;
    		private $importFile;
    		private $fileFieldNames;
    		private $fileFieldNameCount;
    
    		private $importResult;
    		private $entities = array(
    			"primaerdb_firma",
    			"primaerdb_adresse",
    // ... and so forth (array of relevant tables)
    // ... and so forth (array of relevant tables)
    // ... and so forth (array of relevant tables)
    // ... and so forth (array of relevant tables)
    // ... and so forth (array of relevant tables)
    			"primaerdb_homepages"
    		);
    		private $allAttribs = array();
    		private $entityIsActive = array();
    
    		private $ursprung;
    
    		private $dataErrorCount=0;
    		private $importCount=0;
    
    		public function __construct()
    		{
    			foreach ($this->entities as $entity)
    			{
    				$this->allAttribs[$entity] = $this->getAttributeList($entity);
    			}
    
    			foreach ($this->entities as $entity)
    			{
    				$this->entityIsActive[$entity] = false;
    			}
    			FB_select("SET NAMES 'utf8'");
    		}
    
    		public function doImport($isTest = false)
    		{
    			while($importLine = $this->getImportLine())
    			{
    				$obj_imp_adresse = new Import_adresse();
    				$importBranch = array();
    
    				foreach ($this->entities as $entity)
    				{
    					foreach($this->allAttribs[$entity] as $attribute)
    					{
    						if(isset($importLine[$entity."-".$attribute]))
    						{
    							$importBranch[$entity][$attribute] = $importLine[$entity."-".$attribute];
    							$this->entityIsActive[$entity] = true;
    						} else {
    							$importBranch[$entity][$attribute] = "";
    						}
    						if (
    							("primaerdb_firma" == $entity)
    							&&
    							("strUrsprung" == $attribute)
    						){
    							$importBranch[$entity][$attribute] = $this->ursprung;
    						}
    					}
    				}
    
    				if ($this->entityIsActive['primaerdb_firma'] && $this->entityIsActive['primaerdb_adresse'])
    				{
    					$this->importCount++;
    					// Firm
    					$obj_imp_adresse->insert_firma($importBranch['primaerdb_firma']);
    
    					// Address
    					$obj_imp_adresse->insert_adresse($importBranch['primaerdb_adresse']);
    
    					// Partner
    					if ($this->entityIsActive['primaerdb_ansprechpartner'])
    					{
    						$obj_imp_adresse->insert_ansprechpartner($importBranch['primaerdb_ansprechpartner']);
    					}
    
    					// Kontakt
    					if ($this->entityIsActive['primaerdb_kontakt'])
    					{
    						$obj_imp_adresse->insert_kontakt($importBranch['primaerdb_kontakt']);
    					}
    
    					// Industry
    					if ($this->entityIsActive['primaerdb_branche'])
    					{
    						$obj_imp_adresse->insert_branche($importBranch['primaerdb_branche']);
    					}
    
    					//.... and so forth ....
    					//.... and so forth ....
    					//.... and so forth ....
    				}
    				unset($obj_imp_adresse);
    			}
    
    			$out = "";
    			$out .= "\nAmount of imported datasets: ".$this->importCount;
    			$out .= "\nAmount of datasets *not* imported: ".$this->dataErrorCount."\n";
    			return $out;
    		}
    		public function openFile($filename)
    		{
    			$this->importFile = fopen($filename ,"r");
    
    			#Erste Zeile sind Feldnamen (>>>>first line is fieldnames<<<<):
    			$getLine = fgets($this->importFile);
    
    			//Whitespace removal special for corrupted data
    			$fNames = explode(";", $getLine);
    			foreach($fNames as $fName)
    			{
    				$this->fileFieldNames[] = trim($fName);
    			}
    
    			$this->fileFieldNameCount = count($this->fileFieldNames);
    
    			$this->ursprung = "Datei: $filename";
    			$this->importSourceIsFile = true;
    		}
    		public function openTable($tableName)
    		{
    			$host = "db.mydomain.com";
    			$db = "firmen_db_csv_import";
    			# Import Host definieren, importResult holen:
    			$DB_HOSTS=Array(new dbHost($host, $db,"admin","PASSWORD"));
    			$this->importResult = FB_select("SELECT * FROM $tableName");
    
    			$this->ursprung = "Host: $host, DB: $db, Tabelle: $tableName";
    			$this->importSourceIsFile = false;
    		}
    		private function getImportLine()
    		{
    			if($this->importSourceIsFile)
    			{
    				$lineArray = array();
    				$thisLine = $this->getValidFileLine();
    
    				for($i = 0; $i < $this->fileFieldNameCount; $i++)
    				{
    					$lineArray[$this->fileFieldNames[$i]] = $thisLine[$i];
    				}
    				return $lineArray;
    			} else {
    				return mysql_fetch_assoc($this->importResult);
    			}
    		}
    		private function getValidFileLine()
    		{
    			$getLine = fgets($this->importFile);
    			$rLine = explode(";", $getLine);
    
    			if(count($rLine) != $this->fileFieldNameCount)
    			{
    				$rLine = $this->getValidFileLine();
    				$this->dataErrorCount++;
    			}
    			return $rLine;
    		}
    		private function getAttributeList($entity)
    		{
    			$sql = "SHOW COLUMNS FROM $entity";
    			$result = FB_select($sql);
    			$rM = array();
    			while($attrib = mysql_fetch_assoc($result))
    			{
    				if(
    					(false === strpos($attrib['Field'], "_id"))
    					&&
    					(false === strpos($attrib['Field'], "dTimestamp"))
    				){
    					$rM[] = $attrib['Field'];
    				}
    			}
    			return $rM;
    		}
    	}
    ?>

    Plugin Author Javier Carazo

    (@carazo)

    modparlor,

    The problem about this is that you don’t understand anything about it.

    It is a waste of time continue with this thread because now I have understood you don’t know what is it, what is WordPress and what should be a review of a plugin made free for everyone.

    The worst of this is that you have given us a bad review and you don’t understand how all this world works.

    Thanks to all the rest who with no money but with good reviews and good works allow us continue working for everybody.

    If there were more people like you in this community, it will never had advanced.

    It is terrible to do free work and really hard work and later read this kind of reviews of people who don’t do anything for the community.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘bad bugs. bad software design. do not use in production environment!’ is closed to new replies.