Removing the URL field from comments

In WordPress, a commenter can leave their name, e-mail, URL, and comment by default.  The URL field isn’t useful, except maybe to spammers.  I looked for a way to get rid of it and found a wonderful post at http://techhacking.com/2011/02/04/wordpress-how-to-remove-the-website-field-from-the-comment-form/ that does the trick – and very painlessly at that.

The preferred method is to create a file called urlfilter.php and place it in the /wp-content/plugins/ folder.  In the file, the following contents should be added:

<?php
/*
Plugin Name: Remove Website Field
Description: Removes the website field from the comments form
*/
add_filter('comment_form_default_fields', 'url_filtered');
function url_filtered($fields)
{
 if(isset($fields['url']))
 unset($fields['url']);
 return $fields;
}
?>

In the Plugins menu in the Dashboard, Remove Website Field will now show up and just needs to be activated.  That’s it!  It doesn’t get a whole lot easier.

There is an alternate method.  It involves editing the /wp-includes/comment-template.php file to comment out (put two slashes at the beginning of the lines) two lines so they look like:

// 'url'    => '<p><label for="url">' . __( 'Website' ) . '</label>' .
// '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',

 

Block-Spam-By-Math-Reloaded

I installed the Block-Spam-By-Math-Reloaded plugin on this WordPress site a while ago.  It adds a simple math equation that a person has to answer before a comment will be uploaded for moderation.  I find it does indeed help curb the spam.  I still got a couple after installing it but that’s much better than getting three spam comments in one day before I installed it.

By default, it puts the equation after the post button which is unfortunate as a commenter may not see it before posting.  I looked through the php file but since I’m not versed in php, I could not figure out how to change it.  Fortunately, the author made it easy; I just didn’t figure that out until later.

In the WordPress Dashboard, go to Settings -> Block Spam by Math.  At the very bottom, there’s an option that says “Manually add a custom hook.”  It says in order to use that option, you have to open wp-includes/comment-template.php and find

<?php echo $args['comment_notes_after']; ?>

which is near the bottom of the file.  It says to add

<?php do_action( 'after_comment_box' ); ?>

after that line.  Once that’s done (and the option is selected), the math problem then gets moved to the space between the comment box and the post button which is really where it should be.

Thank you to my uncle for motivating me to figure out how to change it.

 

Instant On

I really have to say that the MacBook Pro impresses me to no end with the very short time it takes to turn on from being in standby.  It’s pretty much instantaneous and that’s with a traditional 5400-rpm hard drive.  I’ve never had a Windows PC that could even come close to that.  The restart time is very good too.

One thing that takes some getting used to is how cold the aluminum frame can be when I first put it on my lap while wearing shorts.  Plastic doesn’t get cold but metal sure does.  Metal is better at dissipating heat though so in the end, it’s a good thing.

 

File Sharing between Mac and Windows

I use public folders to share files between my Windows machines.  I couldn’t find a public folder that my HP laptop shared while using my MacBook Pro.  Apparently you have to jump through a couple hoops to get that to work.  Fortunately, I came across a site that explains the process well.

After going through those steps, the file sharing worked.  It would be nice if it worked by default but I guess workarounds are to be expected when working with two different platforms.

 

 

Comcast Bot Alert

I switched internet providers from AT&T DSL to Comcast cable a few weeks ago.  In a test at speedtest.net, I went from 2.73/0.43 Mb/s to 25.43/3.67 Mb/s.  Boy what a difference.  It’s like comparing a bicycle to a car traveling on the freeway.

Since then, I got an e-mail from Comcast Customer Central with the subject “Constant Guard Alert” which began, “Constant Guard from XFINITY identified one or more of your computers may be infected with a bot. . .”  I’m very careful with my computers and had trouble believing any of them were infected but anything’s possible.  The e-mail recommended I visit XFINITY.com/BotAssistance for information on removing malicious software from my computers.

They’ll be happy to take your money to fix the (potential) problem for you or they give you steps to take to do it yourself.  The steps are:

  1. Check for Operating System Updates
  2. Check Your Security Software
  3. Specialized Malware Removal Tools for Windows – http://www.microsoft.com/security/pc-security/malware-removal.aspx
  4. Add Advanced Software Protection – Immunet Protect and Secunia

Number one is always a good idea.  Windows comes out with security patches on “Patch Tuesday” which is the second Tuesday of each month.  They’ll release a security fix at additional times if needed.  Windows Defender updates come much more frequently.

Number two is a good idea as well.  I run an antivirus program on my Windows machines that connect to the internet.  I’ve primarily used Avast! and it has warned me about a few websites I’ve visited that it deemed dangerous.  Comcast offers Norton Security Suite for free to its customers.  Norton anti-virus products have slowed down systems I’ve used in the past so I’m not inclined to install it.

Number three provides links to scan your system with Microsoft Safety Scanner as well as a link to remove malicious software.

Comcast does note at the bottom of step four that it does not endorse nor support those products.  At least it gives you more options to find potential problems if you think you have a problem.

I didn’t try the products in step four but I did run the scanner in step three.  It didn’t find anything on either computer.  I then looked the subject up on the web and found many people got the same e-mail but no one seems to have found a bot.  I guess it seems to be a false positive with Comcast’s scanner or perhaps it’s their way to get people to be more security conscious.

 

Windows Performance Analyzer

As I continue to transfer things from my HP laptop to my MacBook Pro, I find myself getting pretty annoyed at the boot times of the HP and the constant disk activity.  I thought maybe it was Avast!, my anti-virus program, causing some of the trouble.  It was using a fair amount of disk activity according to Windows Resource Monitor.  Since I can’t keep it disabled during a restart to test the idea, I uninstalled it.  The long boot time persisted.

I ran msconfig and enabled Diagnostic startup.  The resulting boot time was much improved.  I mean MUCH improved.  To me, boot time is the time it takes from turning the machine on until the constant (or near constant) disk activity ends.  My reasoning is that even though the desktop shows, if the hard drive is thrashing, I cannot really do anything useful because of the extreme delay in launching anything.  The keyboard is also not very responsive during such times so in reality, it’s pretty much unusable until the drive finally stops.  That being said, the boot times I list don’t necessarily give me that.  Sometimes the hard disk continues to go even after the official boot is over.

I wanted to see what was causing the huge delay.  I have previously read about Windows Performance Analysis Tools (or Windows Performance Analyzer) but never found a good source to tell me how I use it to measure boot time.  I know it does other things too but that’s really the only thing I care about at the moment.

The MSDN site doesn’t put it into simple enough terms for me to really get.  For example, their detailed walkthrough didn’t tell me anything about boot time and the things they did write didn’t help me a whole lot.  Fortunately, I finally found a post that made sense at http://superuser.com/questions/104820/microsoft-performance-analysis-how-do-i-know-when-the-boot-process-is-done.

The download link for the analyzer can be found at http://msdn.microsoft.com/en-us/performance/cc752957.  Installation instructions can be found on many sites, including http://social.technet.microsoft.com/wiki/contents/articles/4847.aspx.  Basically, you don’t need to install the whole Windows Software Development Kit (SDK).  You only need Windows Performance Toolkit but you have to download the whole SDK to get that installation option.

An explanation of the options and flags of the Windows Performance Analyzer can be found at http://msdn.microsoft.com/en-us/library/windows/desktop/ff191001(v=vs.85).aspx.

To get a baseline for comparison:

  • I opened a command prompt
  • typed cd\temp (to go to the temp directory)
  • typed xbootmgr -trace boot -traceFlags base+cswitch+compact_cswitch -postDelay 180 -numRuns 5

That takes what the post on superuser suggested and adds a longer delay and runs it five times in succession.  The default delay is 120 seconds but my boot seems longer than that so I gave it an extra 60 seconds.  Running it five times gives me a better average than running it just once.

Also following the post, to read some meaningful results:

  • I opened a command prompt
  • typed cd\temp
  • typed xperf -i “boot_base+cswitch+compact_cswitch_1.etl” -o boot_1.xml -a boot (for each file, changing the number as necessary; using the up arrow key which repeats the previous command makes that easy)
  • opened the boot_1.xml file in Internet Explorer
  • searched for PreSMSS (using CTRL-F)
  • collapsed that tree and the following four trees
  • read the interval endTimes

The post explained that the boot process consists of five stages – PreSMSS, SMSSInit, WinLogonInit, ExplorerInit, and PostExplorerPeriod.  It said, “The end of ExplorerInit means the desktop is displayed” and that PostExplorerPeriod is the last phase, ending when the system accumulates 10 seconds of 80% or more idle time.  So the bottom line is that the boot time is the endTime of the PostExplorerPeriod minus 10 seconds (10000 ms).  Also note you really need to have Windows configured to automatically log in so that doesn’t skew the tests.

It gave me an error that said, “Gave up waiting for Win7RTM physical prefetcher after 300 seconds.”  I found a post at http://forum.sysinternals.com/xbootmgr-gave-up-waiting-for-win7rtm-physical_topic23586.html that talked about it.  The fix was at http://social.msdn.microsoft.com/Forums/en-US/wptk_v4/thread/447f8512-9a33-43bd-a1cf-f0ca25b4b33a.  It says to change HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SysMain using RegEdit.  The default value is 2.  The post says to change to 0 but I chose to change it to 3 instead.  My value did fix the problem.

The average ExplorerInit endTime of my five runs was 49.2 seconds.  The average PostExplorerPeriod endTime, subtracting the 10 seconds, was 123.9 seconds, which is just over 2 minutes.  That means the services, start-up items, whatever, takes an average of 74.7 seconds.  Put another way, I get to stare at my desktop and not do anything useful for 74.7 seconds.  That’s without an anti-virus installed.  I have a lot of patience but come on . . .  My MacBook Pro easily boots in less than 30 seconds – in a usable form and with a traditional 5400 RPM hard drive, not an SSD.

Running the five tests while in Diagnostic startup, the average ExplorerInit endtime was 39.2 seconds (10 seconds less than before) and the average PostExplorerPeriod endtime (minus 10 seconds) was 42.6 seconds (81.3 seconds less than before).  Much better numbers!

Now, to try to find the culprit(s), I selectively started to enable things.  I started by launching msconfig and going to the services tab.  I wanted to start with Microsoft’s stuff so I clicked on the Service heading to sort the list, then the Manufacturer heading and found there were 139 entries for Microsoft.  Ouch!  Of those, three were already selected (Group Policy Client, RPC Endpoint Mapper, and Task Scheduler).  I selected the first 20 unchecked Microsoft items (Windows Live ID Sign-In Assistant through Desktop Windows Manager Session Manager).  The first one is from “Microsoft Corp.” and the rest are from “Microsoft Corporation” which is why the first one isn’t in alphabetical order.  Because the results of each test are close, I decided to change the number of runs to three instead of five in the interest of time.  The average PostExplorerPeriod endTime (minus 10) was 45.4 seconds (up 2.8).  That was pretty good.

I enabled the next 20 unchecked Microsoft items (DHCP Client through Internet Connection Sharing (ICS)).  The average was 46.2 (up 0.8).  Still pretty good.

I continued enabling 20 at a time until I saw a significant difference in times.  It came when I enabled Security Center through UPnP Device Host.  The average was 57.4.  Something in there (or several things) caused a good 9 second delay from the previous 20 items.  I selectively unchecked some of them and reran the tests.

SQL Server (SQLEXPRESS) added 7.6 seconds.  It was installed with Microsoft Visual Studio; it doesn’t come with a standard Windows installation.  After unchecking that, I continued to enable a few things at a time and reran the tests.  I found the following items took a lot of time:

  • Windows Event Log – 6.2 seconds
  • Windows Management Instrumentation – 3.0 seconds
  • Windows Search – 3.7 seconds
  • WLAN Auto Config – 13.0 seconds
  • 3 Apple services – 2.3 seconds

I then slowly checked things in the Startup tab.  I found the following:

  • Google Update – 1.7 seconds
  • HP Quick Launch Buttons – 1.6 seconds
  • HP Wireless Assistant – 5.2 seconds
  • iTunes – 1.3 seconds
  • Microsoft Sidebar – 4.8 seconds

The rest of the items took less than a second each, sometimes significantly less.  In the end, many of the items are necessary but it goes to show that if you’re bugged by the time your system takes to boot, it can be worth taking a look at as there are definitely things I don’t need to run that I will be leaving turned off.

 

CLMLSvc.exe and TVAgent.exe

When I turn my HP laptop on, the hard drive goes on and on for far too long.  Typing “resmon” in the run command to get the Resource Monitor, I watched the what was causing the activity by watching the Disk Activity in the Disk tab.  One thing that stood out was CLMLSvc.exe.  I searched for it and saw many posts complaining about it but none of them said how to make it go away.  It’s part of CyberLink’s Media Library Service.  I’ve never used it and yet it’s been taking away from my time by running upon every boot and caused me to listen to the hard drive thrash about.

I tried to disable it from automatically starting but interestingly enough, I was unable to find it.  I ran System Configuration (Run -> sysconfig) and disabled all startup items but it still ran.  It has to be in services but I only saw one Cyberlink entry and that didn’t seem to be it.  The only thing I really know for sure is that whatever causes it to launch, it requires Windows Event Log to also be running.  When I disabled Windows Event Log, the Cyberlink process didn’t run.

Since that’s not the best solution, I came up with a better workaround.  I searched the hard drive for its location and found it at

  • Program Files (x86)\Hewlett-Packard\TouchSmart\Media\Kernel\CLMLSvc.exe

I changed its extension by renaming the file to “CLMLSvc.exe.goaway”.  The system can’t run what it can’t find.  After effectively disabling it, I checked the Resource Monitor again and I found TVAgent.exe also taking up a lot of disk activity time.  That’s also something I have never used.  I searched the hard drive for it and found it at

  • Program Files (x86)\Hewlett-Packard\Media\Live TV\TVAgent.exe

I renamed it “TVAgentexe.goaway” and it too stopped running.  Now when I boot up my computer, it still takes a while but the hard drive doesn’t continue to grind away for a long time after boot up.

I hope this information can save someone else from having to listen to their hard drive  grind away needlessly upon bootup.