Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot make plugin #8

Open
JMcrafter26 opened this issue Oct 21, 2023 · 0 comments
Open

Cannot make plugin #8

JMcrafter26 opened this issue Oct 21, 2023 · 0 comments

Comments

@JMcrafter26
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant