Tag Archives: WordPress

TPC! Memory Usage 0.9.1 released

After receiving countless emails from supportive users (some nice, some not so nice!), I put the TPC! Memory Usage project back on my ticker.  Despite the vast number of updates to WordPress since December 2010, the Memory Usage plugin has retained the top spot in its niche.  To this day, TPC! Memory Usage is used regularly with only one noticeable problem—a missing bar graph background in the dashboard widget.  As of release 0.9.1, the background has been fixed, and the compatibility data updated for WordPress 3.8.

So… what’s in store for the future?  First, I need to refactor the code to take care of a few notices outputted in debug mode.  In addition, some of the Zend Framework dependencies may be updated, or even eliminated.  Lastly, I’ll put my ear back to the community.  In other words, tell me what you want, and we’ll see what we can do to reach that goal!

Download TPC! Memory Usage 0.9.1 for WordPress

Using SSH instead of FTP for WordPress updates

Under certain server configurations and conditions, WordPress may require an FTP connection to retrieve and process core, plugin, and theme updates.  If you only see an option for FTP on this screen, do not despair.  You are not alone!  If a server is without the libssl2 library and PECL’s ssh2 package, the SSH2 option will not be listed.  While there are WordPress plugins that mimic this capability using various PHP libraries, implementations at the server level often provide better security and performance.

  1. Download libssh2 (C library implementing SSH2 protocol)
  2. At the command line, type the following
    # Unzip the libssh2 archive
    tar -xf libssh2-1.4.3.tar.gz
    
    # Change directory to libssh2 source
    cd libssh2-1.4.3
    
    # Compile libssh2
    ./configure
    make && make install
    
    # Install ssh2 PECL library
    pecl install ssh2-beta
    

After that, the SSH2 option should appear on the WordPress update screen.
WordPress SSH updates

Using memcached with WordPress

wp-settings.php
wp-settings.php

Today, I decided to implement a popular distributed caching system called memcached.  Memcached allows PHP objects and variables to be stored in memory, which when used properly, can decrease page load time and server load.  Memcached can also work as a central cache for a cluster of servers.  File-based caching systems work by generating static files, and storing them in a local directory to be served in place of the dynamic content.  This can reduce the number of database queries, and help avoid having to process the script with each new request; however, there is a downside. Continue reading Using memcached with WordPress

jQuery Tablesorter helper function for WordPress

In one of my projects, I converted WordPress into a reporting engine, which is used at 20 car dealerships to track Internet sales.  During development, I found that I was writing the same code over and over again for the jQuery Tablesorter plugin, which allows you to sort tables using a simple JavaScript call.

First, I would have to queue the script file, then add the appropriate JavaScript. To ensure the JavaScript was executed at the right time, I had to create a function to use it with add_action().  I found this to be tedious and unnecessary, and wrote a simple helper function to remedy this.  The following function was added to /wp-admin/includes/template.php, but if you use it, it will most likely go in a plugin or theme include.  This will prevent it from being overwritten during WordPress upgrades. Continue reading jQuery Tablesorter helper function for WordPress

TPC! Memory Usage 0.4 for WordPress released!

We just released TPC! Memory Usage 0.4, which in addition to providing memory usage monitoring, provides WordPress users with a detailed System Info screen within the WordPress administration panel.  The system information screen includes information on web server, PHP, MySQL, and WordPress statuses and settings.  A link has been provided from the dashboard widget for easy access.  We also added additional information on the notification feature in the FAQ section on WordPress.org due to some confusion. Continue reading TPC! Memory Usage 0.4 for WordPress released!

How Zend Server CE breaks WordPress Permalinks and how to fix it

Recently, I switched to Zend Server CE from a manually installed AMP package (Apache/MySQL/PHP) to make use of Zend’s lightweight environment and easy install package. In doing this, I found that it broke the permalinks associated with WordPress.  Despite mod_rewrite being enabled, and the “Pretty Permalinks” code being in the .htaccess file, it still didn’t work.

404 Error

To fix this problem do the following:

  1. Open up httpd.conf.  (On Windows, the default location of this file is C:Program FilesZendApache2conf.)
  2. Find the line with <Directory />.
  3. Make sure +FollowSymLinks is present on the Options line.  (i.e. Options +FollowSymLinks)
  4. Change AllowOverride None to AllowOverride All.
  5. Restart Apache.

AllowOverride controls how .htaccess files are used.  When AllowOverride is set to None, users cannot override the configurations set in httpd.conf for particular directories.  While the .htaccess in this client’s WordPress directory was correct, Apache wasn’t allowing it to override the default settings as stated in httpd.conf.  It is definitely worth it to learn more about how to configure Apache so that you can have a secure and well-performing environment, especially if a lot of developers work on the same production server.

If you have similar experience, we would love to hear what you have to say.  Perhaps it will save someone else a minute or even a few hours.