picowiki icon indicating copy to clipboard operation
picowiki copied to clipboard

Cannot make plugin

Open JMcrafter26 opened this issue 1 year ago • 0 comments

Hi, I wanted to create a seo plugin, but whenever I try to do something, I get a 500 server error, why?

Here is just some code for the demonstration (PluginSeo.php)

<?php
/**
 * Seo Plugin
 * This plugin auto-generates meta tags for SEO
 * Author: JMcrafter26
 */

class PluginSeo {
  static $version = '1.0.0';
  static function run( $wiki ) {
    $wiki->event('view_after', NULL, function($wiki) {
      // replace all <a> tags with rel="nofollow"
      $wiki->html = preg_replace('/<a(.*?)>/i', '<a$1 rel="nofollow">', $wiki->html);

      return $wiki;
    });
  }
}

What am I doing wrong? I just copied this from another plugin.

Please respond

JMcrafter26 avatar Oct 21 '23 20:10 JMcrafter26