Fix php bugs for widgets and shortcodes