Forums

WP-RelativeDate
Sorry Lester, but the code in this plugin is awful (2 posts)

  1. archon810
    Member
    Posted 1 year ago #

    The problems:
    - lots and lots of unnecessary repetition. Seriously, the code could have been 1/4 of the size and complexity
    - filters are forced and added automatically - the plugin forces itself onto 4 date formats widely used in WordPress. I had to turn them all off manually and then call appropriate functions by hand, as it was messing with existing dates:

    // Remove all automatic RelativeDate plugin functions
    remove_filter('the_date', 'relative_post_date', 999, 4);
    remove_filter('the_time', 'relative_post_time', 999);
    remove_filter('get_comment_time', 'relative_comment_time', 999);
    remove_filter('get_comment_date', 'relative_comment_date', 999);

    - after all this, there is actually no function to convert a given date to relative date on the fly - there is no way to pass anything to the plugin, as it only contains a few prebuilt functions

    All of the above is quite upsetting, since I respect you as a developer and you've written many plugins. I hope one day you decide to evolve it and take it to the next level.

    http://wordpress.org/extend/plugins/wp-relativedate/

  2. Lester Chan
    Member
    Posted 1 year ago #

    Hmm, this plugin was written sometime back and when I went back to look at the code, I have to agree with you, it is pretty awful and lots of duplication. If I have the time, I will rewrite it. Feel free to contribute a patch as well =)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic