Archive for the ‘Web Site Software’ Category

Disabling Post Revisions: WordPress 3.0.4

Saturday, January 15th, 2011

I discovered that WordPress was again saving every revision of every post after I upgraded the   Tom’s Views   blog to WordPress 3.0.4, though I had disabled this feature during the last WordPress upgrade.  Click   here   for more details.  But apparently, in this latest version, the automatic retention of these revisions became enabled once more. So I turned off this feature by commenting out line 4404 in the wp-includes/post.php file as follows:

Line 4404 was:

          if ( ! WP_POST_REVISIONS )

but now, it’s:

        // if ( ! WP_POST_REVISIONS )

Then I deleted all the revisions that had been saved to this point since applying the WordPress upgrade from each blog database, by executing the following SQL statement:

DELETE FROM wp_posts WHERE post_type = “revision”;

I then logged out and back into each site’s admin id and verified that the revisions saved thus far no longer appear on the Edit Post screen. The deletion apparently worked.   These instructions have now been verified to work with WordPress 3.0.2.

That’s all.

Tom Hesley

Related Posts

Disabling Post Revisions: WordPress 3.0.3

Saturday, December 11th, 2010

I discovered that WordPress was again saving every revision of every post after I upgraded the   Tom’s Views   blog to WordPress 3.0.3, though I had disabled this feature during the last WordPress upgrade.  Click   here   for more details.  But apparently, in this latest version, the automatic retention of these revisions became enabled once more. So I turned off this feature by commenting out line 4404 in the wp-includes/post.php file as follows:

Line 4404 was:

          if ( ! WP_POST_REVISIONS )

but now, it’s:

        // if ( ! WP_POST_REVISIONS )

Then I deleted all the revisions that had been saved to this point since applying the WordPress upgrade from each blog database, by executing the following SQL statement:

DELETE FROM wp_posts WHERE post_type = “revision”;

I then logged out and back into each site’s admin id and verified that the revisions saved thus far no longer appear on the Edit Post screen. The deletion apparently worked.   These instructions have now been verified to work with WordPress 3.0.2.

That’s all.

Tom Hesley

Related Posts

Disabling Post Revisions: WordPress 3.0.2

Saturday, December 4th, 2010

I discovered that WordPress was again saving every revision of every post after I upgraded the   Tom’s Views   blog to WordPress 3.0.2, though I had disabled this feature during the last WordPress upgrade.  Click   here   for more details.  But apparently, in this latest version, the automatic retention of these revisions became enabled once more. So I turned off this feature by commenting out line 4404 in the wp-includes/post.php file as follows:

Line 4404 was:

          if ( ! WP_POST_REVISIONS )

but now, it’s:

        // if ( ! WP_POST_REVISIONS )

Then I deleted all the revisions that had been saved to this point from each blog database by executing the following SQL statement:

DELETE FROM wp_posts WHERE post_type = “revision”;

I then logged out and back into each site’s admin id and verified that the revisions saved thus far no longer appear on the Edit Post screen. The deletion apparently worked.   These instructions have now been verified to work with WordPress 3.0.2.

That’s all.

Tom Hesley

Related Posts

Disabling Post Revisions: WordPress 3.0.1

Sunday, October 31st, 2010

I discovered that WordPress was again saving every revision of every post after I upgraded the   Tom’s Views   blog to WordPress 3.0.1, though I had disabled this feature during the last WordPress upgrade.  Click   here   for more details.  But apparently, in this latest version, the automatic retention of these revisions became enabled once more. So I turned off this feature by commenting out line 4404 in the wp-includes/post.php file as follows:

Line 4404 was:

          if ( ! WP_POST_REVISIONS )

but now, it’s:

        // if ( ! WP_POST_REVISIONS )

Then I deleted all the revisions that had been saved to this point from each blog database by executing the following SQL statement:

DELETE FROM wp_posts WHERE post_type = ‘revision’;

I then logged out and back into each site’s admin id and verified that the revisions saved thus far no longer appear on the Edit Post screen. The deletion apparently worked.   These instructions have now been verified to work with WordPress 3.0.1.

That’s all.

Tom Hesley

Related Posts

Today’s Business: 2010-06-26

Saturday, June 26th, 2010

Today’s Activities

  • Shower.  DONE.
  • Cat duty.  DONE.
  • Do all pending laundry.  DONE.

Log

10:00 AM: I’m up.

10:15 AM: Facebooked a while this morning.  Friend count is now 223.  My official Facebook page I created yesterday has 12 subscribers so far.

11:00 AM: Arranged for someone in Nephew Garrett’s family to drive me to Altoona tomorrow to pick up [Emmy] at the train.

11:15 AM: Helped brother-in-law Richard with a swimming pool heating project he’s working on today.  I have several circulating pumps here, and he  wondered if any of them are big enough to move water between his pool and the solar collectors on his garage roof nearby.  He has a very large pump that would indeed do the job.  But it’s likely too big and would thus cost too much to operate.  Plus, it would pump the water too fast, so that the sun would have insufficient time to warm the water in the collectors before returning it to the pool.  My pumps each offer at most ten feet of head (they can’t pump water higher than ten feet).  But his collectors are higher than that; perhaps thirteen to fifteen feet above ground.  So after Googling around and reading specs on various pumps, we decided that mine here are definitely too small — unless we use two of them in series to extend the head.  He might decide to do this.  But at the moment, he’s looking for a cheaper solution.  Aren’t we always doing that?

11:30 AM: [Emmy] called to say hi and that she’s in the process of packing for her trip here tomorrow.  We’ve all told her: Bring your swimsuit!  :-)

12:40 PM: Got the laundry under way.  Today, there are a couple of Mom’s loads, and the sheets and pillow cases on my bed.

01:05 PM: Completed the weekly system backups (details  here), and the weekly site statistics report (see that   here).

03:00 PM: Just upgraded blogs from WordPress 2.9.2 to 3.0. No major problems; although I must again disable automatic saving of post revisions. If I revise a post 20 times, then 20 copies of it are stored; bloating the DB and slowing performance. But the code has changed significantly in 3.0. So I’ll have to figure out how to turn this off in 3.0. :-( If anyone knows how, I welcome your input. :-)

04:40 PM: I figured out how to disable the saving of post revisions.  See details   here.

05:50 PM: iPodded at the pavilion.  Nice afternoon, and the dogs were quiet too.  :-)

06:10 PM: Watched tonight’s episode of   NBC’s Nightly News   on the DVR.

06:15 PM: Nap time.

07:00 PM: I’m back up again and eating supper now.

10:00 PM: Watched    Larry King   on  CNN tonight, doing his interview with Lady Gaga.  Good show.

12:00 AM: Posted a link entry on my Facebook business page to the   Why So Fast The Fall   piece on the   Tom’s Love Quest   blog.

12:30 AM: Put clean sheets and pillow cases on the bed

01:00 AM: Monitored the site stats over the past 24 hours, and observed a moderate increases in traffic.  But I’ve received no clicks from people visiting my sites; so no revenue yet since the ad campaign began this past Friday.  I’ll continue watching and tuning, and next week, I’ll call Google and take advantage of the free offer of consultation on how to make my campaign more profitable.

02:00 AM: Facebooked some more.  Friend count is now 229.

02:15 AM: Okay, time to get off of here for the night.  May your rest be effective and thus refreshing, and we’ll pick this up again in less than twelve hours.  Take care and good night.

Tom Hesley

Received Mail and Shipments

  • Revised blank prescription FAX forms from Mom’s medical insurance company.  That’s all today.  :-)

Related Posts

Disabling Post Revisions: WordPress 3.0

Saturday, June 26th, 2010

I discovered that WordPress was again saving every revision of every post after I upgraded the   Tom’s Views   blog to WordPress 3.0, though I had disabled this feature back in March.  Click   here   for more details.  But apparently, in this latest version, the automatic retention of these revisions became enabled once more. So I turned off this feature by commenting out line 4398 in the wp-includes/post.php file as follows:

Line 4398 was:

          if ( ! WP_POST_REVISIONS )

but now, it’s:

        // if ( ! WP_POST_REVISIONS )

Then I deleted all the revisions that had been saved to this point from each blog database by executing the following SQL statement:

DELETE FROM wp_posts WHERE post_type = ‘revision’;

I then logged out and back into each site’s admin id and verified that the revisions saved thus far no longer appear on the Edit Post screen. The deletion apparently worked.   These instructions have now been verified to work with WordPress 3.0.

That’s all.

Tom Hesley

Related Posts

Disabling Post Revisions: WordPress 2.9.2

Monday, May 10th, 2010

I discovered that WordPress was again saving every revision of every post, though I had disabled this feature back in March.  Click   here   for more details.  But apparently, in the upgrade to 2.9.2, the automatic retention of these revisions became enabled once more. So I turned off this feature by adding the following lines of code to the wp-config.php file at lines 27 and 28 for each of my blogs:

// Disable post revisions.
define(’WP_POST_REVISIONS’, false);

 I also changed line 618 in the wp-settings.php file from

$default_constants = array( ‘WP_POST_REVISIONS’ => true );

to

$default_constants = array( ‘WP_POST_REVISIONS’ => false );

Also note that the line number has not changed from what it was in WordPress 2.9.1.

Then I deleted all the revisions that had been saved to this point from each blog database by executing the following SQL statement:

DELETE FROM wp_posts WHERE post_type = “revision”;

I then logged out and back into each site’s admin id and verified that the revisions saved thus far no longer appear on the Edit Post screen. The deletion apparently worked.   These instructions have been verified to work with WordPress 2.9.2.

That’s all.

Tom

Related Posts

Deleting Self Pingbacks

Friday, April 16th, 2010

So, I’m talking to [Emmy] the other night, and she says that she doesn’t like so many of those “automated” comments on my posts, because they make it harder to find real comments (from other humans). 

I looked into the matter and found that I had 1060 of these pingbacks, strewn throughout my collection of posts for this, the   Tom’s Diary   blog.  Upon examination, I discovered that all of those were pingbacks from this blog,   to   this blog; thus the term:  self pingback

In short, a pingback is a special comment attached to a particular post, which is generated by WordPress whenever another blog (or another post in thisblog) links to the subject post.  Upon reviewing the WordPress documentation and goggling around for “independent” explanations of pingbacks, I determined that these self pingbacks probably aren’t that useful; especially since most of them referenced my daily revisions posts, which give little more information than the names of revised documents that day.  Therefore, I figure that I don’t need these, because when I write a post, I always add links to other relevant posts to it, and so, need not rely on any self pingbacks in the comments beneath to provide those links. 

Subsequently, I deleted all self pingbacks from this blog.  This involved a couple steps; the first of which was to run an SQL script on the   wp_comments   table in the blog’s database.  That script was as follows:

DELETE FROM `wp_comments`WHERE  `comment_author` LIKE "%Diary%"

Note that you’d have to modify this statement for your particular blog’s name.  Since this blog is called   Tom’s Diary   and since I knew that nobody left any non self pingbacks with the string “Diary” in the author’s name, I surmised that this would be safe.  It deleted 1060 comment records.

Well, immediately after this, I thought I was done, but soon realized that the comment counts displayed beneath each post on the blog had become incorrect.  The self pingbacks had been deleted alright.  But the count of comments in the affected posts had not been decremented to reflect this.  I had assumed that the WordPress database would have triggers to automatically update the counts.  But It appears not to. 

So I wrote a non destructive SQL script, to get a count of the post records whose comment count field did not match the actual number of comments associated with that post in the   wp_comments   table. 

SELECT count( * ) FROM `wp_posts`
          WHERE `comment_count` <> (
          SELECT COUNT( * )
          FROM `wp_comments`
          WHERE `comment_post_ID` = `wp_posts`.`ID` )

I verified that I got what appeared to be a reasonable count of disagreeing records. 

Next, I rewrote the above SQL that, instead of just displaying a a count,  actually update the counts in the offending records as follows;

UPDATE `wp_posts` SET `comment_count` =
          (SELECT COUNT( * )
          FROM `wp_comments`
          WHERE `comment_post_ID` = `wp_posts`.`ID` )

What this does is that, for each post, it counts the number of comments that list that post in their   comment_post_ID   field, and assigns that value to the comment_count field. 

This seems to have done the trick, as the ten or fifteen posts I examined that had comments noe display the correct number below, and there appear to be no missing comments either. 

Thanks for the tip,   [Emmy]. 

I’ll need to run the above SQL against the databases for my other blogs as well, and will note in the comments below when I finish that. 

Of course, there’s still the problem of preventing the self pingbacks from being written to the database in the first place.  I read of some plugins for WordPress that may solve this problem.  So I’ll look into them at some point and install them. 

Take care.

Tom Hesley

Related Posts

Today’s Business: 2010-04-02

Friday, April 2nd, 2010

Today’s Activities

  • Shower.  DONE.
  • Cat duty. DONE.
  • Pay all (9) pending bills.  DONE.
  • Set up automatic monthly bill payments for Mom’s medical insurance premiums.  IN PROGRESS.
  • Pick up Mom’s prescription order.  DONE.

 

Log

05:20 AM: I’m up. My weight did not change from yesterday.  It’s still 173.5 Lbs.    See   here   for a summary of the progress on this goal so far in 2010.

05:25 AM: Read more of the   Classics For Pleasure    book overnight. 

07:15 AM: Spent the past hour writing out bills (9 of them).  Then, went back to bed for a bit. 

08:30 AM: I’m back up again, working on yearly accounting chores for Mom’s bills. 

09:15 AM: Sister Jojo just arrived.  We’re heading out shopping this morning.

02:00 PM: We’re back from the shopping trip.  Details provided   here

04:50 PM: Watched today’s episode of   The Young and the Restless   on the DVR, as well as the 2010-03-10 episode of   Dr. Phi, titled   What’s Wrong With People? 

04:52 PM: Nice and warm this afternoon outside; the temperature is 81.3 degrees on our east porch at the moment, which makes this the warmest day of the year here so far.  Sweet. 

05:50 PM: Watched the 2010-03-11 episode of   Dr. Phil   on the DVR. 

07:30 PM: iPodded at the pavilion for an hour and a half.  While the WiFi reception is much improved, the stations still drop now and then.  Some of this is not due to the WiFi, and I suspect that when the Internet gets congested (such as in the evening around here), more drops appear.  However, I’m still seeing more of these at the pavilion than here at the house.  So another attempt to further improve reception out in the yard is needed.  Details later.

07:45 PM: Upgraded all my blogs to the   Google XML Site Maps Generator Plugin, version 3.2.3.  I’ve been very pleased with the site map files this software automatically generates and keeps updated as I add posts to the blogs.  Kudos to the developers.  You can see the site map for this blog, that was produced with this plugin   here

09:45 PM: Chatted with [Emmy] on the phone.   Boy, it’s hot up here tonight; a sign of a hot day earlier.  :-)

10:15 PM: Got a late bath.  I’m still tired though.  Guess I didn’t get enough zzzzzs last night. 

11:15 PM: Removed extra hyphen character from the home page and archive page title tags, for all blogs. 

11:50 PM: Going to bed. So take care and have a great evening.  I’ll see you again tomorrow. 

Tom

Received Mail and Shipments

  • Post card from Capri Salon & Boutique, inviting us to visit their new location in Altoona.  Perhaps.
  • A letter confirming that a credit card of mine that I’d requested be closed, is in fact, closed. 

Related Posts

Today’s Business: 2010-02-25

Thursday, February 25th, 2010

Today’s Activities

  • Shower.  DONE.
  • Schedule appointment for Mom with the retina specialists in Johnstown for sometime in April, 2010. 

 

Log

07:50 AM: I’m up. My weight is unchanged from yesterday.  It’s still  177.0 Lbs.

09:00 AM: I applied a software change to all my blogs that shortens all title tags for single posts; it eliminates the string:  Blog Archive  as well as one separator character from the titles.  This should fix the issues raised by my hosting provider about some of my title tags containing too many characters.  Presumably now, search engines will index more of my posts.  I’m not sure that this is actually true.  But the IT folks at my hosting company know lots more about this stuff than I do.  So I’ll take their word for it and bring the blogs into compliance.  Next thing to do, they suggest, is to remove all duplicate titles.  I did this for   Tom’s Diary  so far.  I’ll get to work on   Tom’s Love Quest   now.

11:20 AM: Spent the past couple hours categorizing posts on the   Tom’s Love Quest   blog.  I added categories for AffirmationsAloneness,  Cheating,   and   Loneliness   among others.    

01:30 PM: Watched today’s episode of   The Young and the Restless   with   [Emmy].

02:50 PM: We dined at our favorite Indian restaurant: Tamarind Flavor of India, on Craig Street in Oakland.  Yum.

03:00 PM: Categorized more posts on the   Tom’s Love Quest   blog.  Now, there are just 18 left to do.   Details   here.

04:00 PM: Watched today’s episode of   Dr. Phil.

06:00 PM: Made numerous revisions to the   Tom’s Love Quest   blog.

07:30 PM: Watched tonight’s episodes of    NBC’s Nightly News    and   The CBS Evening News   TV news shows.

12:25 AM: Read four more chapters of the book:  The Drunkard’s Walk: How Randomness Rules Our Lives   by Leonard Mlodinow.

12:30 AM: Bed time.  See you tomorrow. 

Tom Hesley

Related Posts