@shadyvb actually, please correct this line to be something like:

```php
$disabled = $disabled || empty( $GLOBALS['wp_rewrite']->permalink_structure );
```

As otherwise it would always override the previous line.