[wp-hackers] Plugin Review Request: WP-Realtime-Sitemap

peter baylies pbaylies at gmail.com
Fri Sep 16 21:57:59 UTC 2011


Daniel,

A lot of this looks pretty good to me; one cosmetic detail I noticed about
your plugin -- it looks like a lot of code, but a fair bit of that relates
to configuring the plugin settings. You could clean this up by using, for
example, an array of setting ids coupled with a for() loop, to cut down on
redundant code. Also I'd suggest using a case default statement for the most
common case, and putting several case labels together in a row to take care
of other fairly common cases.

Example:

                                case 'tags_show_post_count':
                                        $values = array(
                                                true            =>
__('True', 'wp-realtime-sitemap'),
                                                false           => __('False
(Default)', 'wp-realtime-sitemap'),
                                        );
                                        break;

                                case 'tags_hide_empty':
                                        $values = array(
                                                true            => __('True
(Default)', 'wp-realtime-sitemap'),
                                                false           =>
__('False', 'wp-realtime-sitemap'),
                                        );
                                        break;

Try this instead:

                                case 'tags_show_post_count':
                                case 'tags_hide_empty':
                                        $values = array(
                                                true            => __('True
(Default)', 'wp-realtime-sitemap'),
                                                false           =>
__('False', 'wp-realtime-sitemap'),
                                        );
                                        break;

Cheers,

 -- Peter Baylies
Semper Fi Web Design

On Wed, Sep 14, 2011 at 1:32 AM, Aero Maxx <aero.maxx.d at gmail.com> wrote:

> Hello Everyone,
>
> This is my first plugin that I have ever written and I would like to write
> some more, but first I would like a bit of feedback on the first one, the
> plugin itself, the code and so on.
>
> Have tried to do things like 1 entry in the database instead of several
> individual options as have googled a lot when was writting it and this
> plugin is fairly old now.
>
> If I could get some feedback good or bad, I dont mind.
>
> http://wordpress.org/extend/**plugins/wp-realtime-sitemap/<http://wordpress.org/extend/plugins/wp-realtime-sitemap/>
>
> Thanks for your time
> Daniel.
> ______________________________**_________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.**com <wp-hackers at lists.automattic.com>
> http://lists.automattic.com/**mailman/listinfo/wp-hackers<http://lists.automattic.com/mailman/listinfo/wp-hackers>
>


More information about the wp-hackers mailing list