WordPress Plugin Designs and Memory Leaks

I recently discovered that CataBlog was using more and more of PHP's allocated memory. This meant that each page that was loaded while the CataBlog PHP Class (plugin) was activated it would use about 200k extra memory, continuously compounding on top of itself. Eventually WordPress would run out of available PHP memory and complain that it needed more.

I was able to isolate the procedure that was eating up so much memory and replace it with a more efficient one. This involved not loading in the WordPressDataBase class commonly known as the global $wpdb into CataBlog every time the class was instantiated. Instead the global version is now referenced in each of CataBlog's individual methods, I believe this is not an ideal solution, but the memory leak is now gone.

I apologize for any problems people are having with the plugin, but please do not delete your WordPress installation if any plugin breaks it. Instead you should have FTP access and simply go to your WordPress plugins folder wp-directory/wp-content/plugins/ and manually delete or move the folder named catablog. Thanks, and I hope that CataBlog's new features and future enhancements will encourage you to try it and hopefully it develops into a popular and full featured WordPress plugins.

This entry was posted in Bug Fix, Development. Bookmark the permalink.

5 Responses to WordPress Plugin Designs and Memory Leaks

  1. Alejandro says:

    Hi, im using your plugin, its really cool and fit my simply needs, but, im trying to figure out how i can isolate the [catablog] to use in some other place neither a post or a page something link i can put in tags … can you help me?

    really thanks for this tiny, simple, useful, plugin!!

    PS: should be really cool if you add a custom input text on the catalog creation, like “price” or something you can add some extra text

  2. Alejandro says:

    *… something link i can put inside PHP tags … can you help me? …

    • Zach says:

      Hi Alejandro,

      My guess is that you are looking for a way to use CataBlog in your template code. Currently I have not made any direct methods to do this. I would start by making a new CataBlog class and then you can call methods through the class directly. Since I am currently on vacation I will not be working on the plugin until late August, so this will be something you must figure out on your own, so sorry. Good luck and let me know if you are successful.

      Also, keep in mind that the description field will render HTML tags so you can make multiple paragraph tags with different CSS classes for custom designs and layouts.

  3. Have you already setup a fan page on Facebook ?-.-,~

Leave a Reply

Your email address will not be published. Required fields are marked *

Please wrap any HTML markup or code with the pre-formatted tag: <pre> </pre>