The code must be optimized a little. Just to make an example, the code could be changed from

$module_name = 'wordpress_import';
$dir = drupal_get_path('module', $module_name) .'/tests';

to

$dir = drupal_get_path('module', 'wordpress_import') .'/tests';

especially when $module_name is used just once on the function code.

Comments

avpaderno’s picture

It would also be preferable to use if (is_null($r) {, rather than if ($r === NULL) {.

avpaderno’s picture

Also, if the string doesn't contain only spaces, and a zero, then

if ('' != trim($post)) {
  // ...
}

can be changed in

if (!trim($post)) {
  // ...
}
kmonty’s picture

Status: Active » Needs review
avpaderno’s picture

Version: 6.x-1.0 » 6.x-1.1

What I reported is still valid for the latest official release available.

lavamind’s picture

Status: Needs review » Closed (won't fix)

Release 6.x-1.x will not get any further enhancements, only bug fixes.

Version 2.0 already includes many optimizations, but feel free to submit other enhancements for that version.