WordPress.org

Ready to get started?Download WordPress

Forums

Like This
Cannot redeclare class MostLikedPosts (1 post)

  1. Gyn3r
    Member
    Posted 5 months ago #

    So, this is probably not a real issue since why would anyone use more than one ‘like’ plugin, but I thought I should let you know anyway.

    I tried to activate your plugin while also using another ‘like' plugin, WTI Like Post. It seems they both have classes named MostLikedPosts, which generates the following error:

    Fatal error: Cannot redeclare class MostLikedPosts in /my/path/wp-content/plugins/roses-like-this/widget.php on line 116

    It’s good practice to group your functions together in a class to avoid name conflicts with other plugins:

    http://wordpress.stackexchange.com/questions/26186/should-all-plugins-be-encapsulated-in-a-class

    :)

    http://wordpress.org/plugins/roses-like-this/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.