ButlerBlog

chad butler's weblog

  • About
  • Blog
  • WordPress Plugins
  • Contact

WP-Members 2.2.2 code improvement release

By Chad Butler 22 Comments

With the launch of WP-Members 2.2, there were some significant changes from the 2.0/2.1 releases.  Most notably was the return of the admin panel.  This is due to adding some customization settings that weren’t there before.  But when you add things like an admin panel, that can make a plugin that previously was efficient in a single file become a bloated mess.

So, steps were taken to clean up some of the new code I created for 2.2.  This involves breaking out the admin functions to a separate file, as well as the install functions.  Plugin developers take note: it is more efficient for the plugin in general to separate these process into their own files that only load when needed.  The admin file is not loaded unless the user can edit options and the install file is only loaded if the install activation hook is, well… hooked.

Also, since we are now playing with the WP database, we don’t want to leave any nasty traces behind if the user were to uninstall the plugin; not that anyone would want to delete such a fantastic plugin 😉  I added the WP required uninstall.php file to cleanup the database as the plugin is deleted.  This also gives you the ability to do a clean install without directly touching your database, if that becomes necessary.

Another big improvement, I was able to eliminate about 200 lines of code by rewriting some of the primary functions to reduce redundancy and/or be more efficient.

All of these changes are code cleanup type changes and really have no effect on the end-user views or functionality (either by the site admin or the site user); that is unless you’ve tweaked the code of your install.  (Note: the install process does not touch your customized settings so anything you have set in the database should remain untouched.  But if you made code changes to anything that does output, you are going to overwrite these changes by upgrading – but that’s no different that any other plugin, really.)

An undocumented change at this point is the addition of some <div> tags for CSS.  The messages given for form validation and the like have always had a <div class=”wpmem_msg”> for users to define in their theme’s CSS.  This release adds <div class=”wpmem_login”> and <div class=”wpmem_reg”> around the login form (also used for password change and reset) and the registration form.  I opted not to define this as an ID since a user may possibly have at some point more than one instance on a page, so rather these are classes.  Also, these are presently undocumented changes as I’m not sure if they will stay exactly as they are.  So here is the caveat – if you need more style control over the plugin’s output for login form and registration form, the CSS classes are there for you, but their specification may possibly change in future versions so you may need to make fresh updates down the road.

That’s all for now.  I am now only working on the 2.3 release which will include the following features:

  • Notify admin of new user registration
  • Hold new user registrations for moderation/approval
  • Time-based user expirations (tentative – may be pushed back to future release)
  • Trial period (tentative – may be pushed back to future release)
  • Turn off registration (for admins that manage users elsewhere and only want the inline login process)
  • Toggle to show excerpts on pages/posts if not logged in (helpful for SEO/Social Media)
  • Facebook
  • Twitter
  • Email
  • Print
  • More
  • LinkedIn
  • Reddit
  • Tumblr
  • Pocket
  • Pinterest

Filed Under: WP-Members Tagged With: plugin, plugins, WP-Members

  • « Previous Page
  • 1
  • 2
  • 3
  • 4

Join Us!

I will never share your information. No spam. No junk. No kidding. Unsubscribe anytime.

Recent Posts:

  • YouTube Success: Key Tips for Enhancing Video Optimization and Visibility
  • Mobile App vs. Mobile Website Ideal Choice for your Business
  • Top Strategies to Boost Your Brand’s Visibility and Impact
  • Advanced Blogging Strategies: Using Analytics, A/B Testing, and Conversion Optimization Techniques to Grow Your Audience
  • Unlock Real-Time Process Insights to Save Time and Money
  • How Writers Can Attract More Audience Attention
  • Dress for Success – Even at Home
  • Mastering the Art of Crafting SMART Marketing Goals
  • Rediscover Your Brand Story: 7 Tips for Refreshing Your Company Identity
  • Creating Engaging Content: Tips for a Successful Content Marketing Strategy

Archives

  • About
  • Blog
  • Archive
  • Contact

Site powered by WordPress, running on the Genesis Framework from StudioPress.

Unless otherwise noted, content on this site is © 2006-2025 ButlerBlog and may not be reproduced without express written permission from the author.

Some content may include affiliate links for which this site receives a small commission.