How does the orb refinery work i built one and there hasn't been any increase in crystal and metal income on said planet ?
The refinery income is listed separately from the extractor income (similar to trade being listed separately from tax). Refineries also affect all planets neighbouring the one you build it at, so they can be extremely effective if there are lots of nearby planets. As a rule of thumb, you should aim to have at least 12 extractors in the area of effect around your refineries to get your money's worth.
Keep in mind also that each extractor can only support up to three refineries; beyond that they do not stack. Refinery income also ignores your extractor upgrade level and loyalty level, which may be good or bad (usually good).
Do trade ports work best on Terran planets or high populations ?
Unless the planet explicitly says that you get more or less trade income, all trade ports produce the same amount of income regardless of where they are built. As InfiniteVoid mentions, they also ignore loyalty. Most important is to set up long trade trade routes to boost the income produced by all trade ports.