Using WordPress plugin CodeColorer under PHP 7

I decided to upgrade my web server containers to PHP 7 but ran into a problem with WordPress, all articles had no text. The problem seemed to be within the plugin CodeColorer since disabling it resolved the problem PHP Warning: &nbsp;preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /var/www/wp-content/plugins/codecolorer/codecolorer-core.php on line 50 In wp-content/plugins/codecolorer/codecolorer-core.php locate this code block: /** Search content for code tags and replace it */ function BeforeHighlightCodeBlock($content) { $content = preg_replace('#(\s*)\[cc([^\s\]_]*(?:_[^\s\]]*)?)([^\]]*)\](.*?)\[/cc\2\](\s*)#sie', '$this->PerformHighlightCodeBlock(\'\\4\', \'\\3\', $content, \'\\2\', \'\\1\', \'\\5\');', $content); $content = preg_replace('#(\s*)\<code(.*?)\>(.*?)\</code\>(\s*)#sie', '$this->PerformHighlightCodeBlock(\'\\3\', \'\\2\', $content, \'\', \'\\1\', \'\\4\');', $content); return $content; } and replace it with this ...

August 6, 2016 · 1 min · alj

New blog engine

Nowhere.dk has been using a lot of different software over the years (handwritten HTML files, home brewed CMS and various other CMS’es). Since I started this blog (again) I’ve been running Nanoblogger, a nice, small bash based blogging framework. But even if it has been working okay it is very limited in function (hence nano I guess). So I decided to switch to a new blog engine. The choice is: WordPress. Why? Because it has a large user base, easy to extend (more than 5000 plugins) and easy to make look like you want (lots and lots of themes). The downside is that it is PHP based and requires MySQL which might be a problem for my underpowered server. ...

February 3, 2009 · 1 min · alj