How To Dynamically Increase Memory Limits When Interfacing With WordPress Using XML-RPC (Windows Live Writer, Etc)
Updated: August 27th, 2012
Today's snippet is tremendously helpful if you are using an XML-RPC WordPress interface to read and publish your articles and are running into 500 Server Error issues due to running out of memory, manifesting themselves in something like this error message: "Invalid Server Response – The response to the metaWeblog.newMediaObject method received from the weblog server was invalid".
For example, my regular PHP memory allocation is 32MB or so, but if I load up Windows Live Writer, my favorite publishing tool, and ask it to load 1000 of the latest blog posts, I will undoubtedly get a server error back.
One solution would be to increase the memory allocated to PHP to something higher, like 256MB, which is how …
Updated: February 2nd, 2011
WordPress has a great way of letting you use simple text tags called shortcodes to provide a whole bunch of functionality, including custom PHP code. In this article, I'm assuming that you already know what shortcodes do and how they operate (if you don't, head over here: Shortcode_API).
One glaring omission in the way shortcodes are set up by default is that they only get triggered in the content of your post, leaving the sidebar and comments out. I'm sure this is done for security, so that your readers can't screw something up by posting shortcodes they're not supposed to – after all, shortcodes are PHP snippets on the backend.
However, let's assume you really know what you're doing …
Updated: December 25th, 2011
As a developer, I both love and hate Eclipse for its chaotic nature, buggy and sometimes unusable interface, but at the same time incredible usefulness and ability to serve as a single tool for all of my development, be it C++, PHP, Java, Android, Perl, etc.
One of the biggest problems with Eclipse is that there is no clear upgrade path from major versions, for example 3.5->3.6. What I ended up having to do for years is back up the old release, download and unpack the new release, and then try to migrate all the settings by importing and exporting left and right. Not so pleasant.
Turns out, as of Eclipse 3.3 (though I've only tried it with Eclipse 3.5), …
Updated: July 21st, 2020
Today, I was looking for a quick way to see HTTP response codes of a bunch of urls. Naturally, I turned to the curl command, which I would usually use like this:
curl -IL "URL" |
This command would send a HEAD request (-I), follow through all redirects (-L), and display some useful information in the end. Most of the time it's ideal:
curl -IL "http://www.google.com" HTTP/1.1 200 OK Date: Fri, 11 Jun 2010 03:58:55 GMT Expires: -1 Cache-Control: private, max-age=0 Content-Type: text/html; charset=ISO-8859-1 Server: gws X-XSS-Protection: 1; mode=block Transfer-Encoding: chunked |
HTTP/1.1 200 OK
Date: Fri, 11 Jun 2010 03:58:55 GMT
Expires: -1
Cache-Control:
…
How To Diagnose And Fix Incorrect Post Comment Counts In WordPress
Updated: September 16th, 2012
Introduction
If your WordPress comment counts got messed up, whether because of a plugin (I'm talking about you, DISQUS) or you messed with your database manually and did something wrong (yup, that's what I just did), fear not – I have a solution for you.
But first, a little background.
Comment Counts In WordPress
Here's how comment counts work in WP:
- Posts live in a table called wp_posts and each has an ID.
- Comments reside in a table called wp_comments, each referring to an ID in wp_posts.
- However, to make queries faster, the comment count is also cached in the wp_posts table, rather than getting calculated on every page load.
If this count ever gets out of sync with
…
How To Show Hidden/Invisible Files In Total Commander, Both Locally And On An FTP Server
Today I have 2 tips for Total Commander users:
- how to display hidden local directories and files and
- how to display hidden FTP directories and files
Really, Total Commander should just control this setting in one place but, unfortunately, it is not the case.
I usually prefer when my file manager shows me everything I have, so that I can be more in control and see the hidden directories, such as .svn or $Recycle.Bin, and files, such as .bashrc or pagefile.sys.
How To Display Hidden Local Directories And Files
- go to Configuration -> Options… -> Display
- put a check next to the "Show hidden/system files (for experts only)"
How To Display Hidden FTP Directories And Files
This one is a …
The Most Awesome VPN Tip: How To Make Windows Automatically Use Your Local WiFi/LAN Connection Directly For Requests That Don't Need To Go Through VPN
This tip can also be filed in the "post with the longest title that kind of makes sense but needs more explanation" category.
If you use a VPN (Virtual Private Network), this tip is for you.
The Problem
- you connect to a VPN to get access to your work/whatever network
- your connection is fast but the VPN connection is balls slow
- you try to stream a bit of online radio, go to a website, watch a video, or do anything, which is automatically routed through the VPN connection but everything TAKES AGES because the VPN connection is the limiting factor
- so not only are you frustrated by hiccupping radio, stuttering video, and a never disappearing progress bar but you're
…
My New Desktop Background On The iMac Running Window 7 – That's Right, It's Awesome
I got a new development machine at work – a 24" iMac. Since I am not an OSX fan at all, I immediately installed Windows 7 x64 on it and initiated a search for a fitting background image.
And then I found it:
Right click here and Save As to download the 1920×1200 version
And that's how you set up your iMac people.
Credit goes to Jonzy from DeviantArt….
Updated: July 26th, 2010
This is a quick recipe that I found pretty interesting and relatively unknown.
Everyone who uses SVN knows that most repositories are set up to allow viewing of their contents via a web browser. For example, here's the trunk of WP Plugins SVN: http://plugins.svn.wordpress.org/ and here is the current trunk version of a specific file, let's say http://plugins.svn.wordpress.org/stats/trunk/readme.txt.
The Problem
However, what if you wanted to view a specific revision of a file or directory in your browser?
Let's say I wanted revision 100,000 of http://plugins.svn.wordpress.org/stats/trunk/readme.txt
Normally, on a command line, you'd do something like
svn co http://plugins.svn.wordpress.org/stats/trunk/readme.txt stats cd stats; svn up -r100000 readme.txt |
or simply
Updated: July 30th, 2021
Introduction
In this review I'm going to take a look at a pair of 2010 thirtytwo Focus Boa snowboard boots that I picked up a few weeks ago, after spending a day demoing them in the snow at a resort in Tahoe.
Even though I am an avid snowboarder (I try to go to the snow almost every weekend during the winter), I haven't evaluated my gear in years. This season, however, I decided to take a look at my options with the snowboard boots.
The Upgrade
It was only after the shoelace on one of my 5 year old Salomon Dialogue boots snapped that I even considered checking out other boots. I was always *kind of* happy with …
How *Not* To Implement A Web Application That Handles External Authentication, Using BeTwittered.com As An Example
Today I'm going to look at how not to handle user authentication in a web application, taking BeTwittered.com authenticating with Twitter as an example (sorry, guys).
BeTwittered is a simple and comfortable gadget that you can add to your site, such as your iGoogle homepage.
Since BeTwittered is just a bridge between you and Twitter, it has to first log you into your account. Here is where things go horribly, horribly wrong.
1. BeTwittered does not use SSL to secure requests to its servers
All authentication information is transmitted to BeTwittered servers in plain text and is easily sniffable by an attacker, both on your own network and outside of it. You can read more about SSL encryption here….
Recently, I decided to conduct a Google experiment and write down what the search engines suggests for the phrase "why are" followed by all kinds of nationalities, races, and localities (alright, "recently" seems to be last March, as evident from the Google theme, but I only decided to post this now).
I did this just for fun and found most of the results funny, some hilarious, and some offensive and controversial.
However, all of them have a reason for being there – statistics. It's what people search for. The cream of the crop. Stereotypes, hilarities, it's all here.
If you can, please don't take them too close to heart. In fact, if you're a righteous conservative thinking of lecturing me, …
The Problem
If you use the Recent Comments sidebar widget in your WordPress installation, it's possible that you want to customize this widget's style.
You will quickly find, however, that as soon as you add the widget to your sidebar, it injects the following inline, hardcoded CSS into the containing page (using !important to make things worse):
<style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style> |
The code above comes from recent_comments_style() (found in wp-includes/default-widgets.php), which is in turn called by WP_Widget_Recent_Comments() in the same file (this is just an old-style PHP4 constructor – same as PHP5's __construct()), which is triggered when the Recent Comments widget is used:
WordPress Developers – How Do You Make A Living [Poll + Discussion]?
Updated: May 3rd, 2010
The Question
I'd like to pose this question to all WordPress developers – plugin, theme, as well as core ones:
How do you make your living?
And, for clarification, by this I mean: "what are your primary sources of income?"
Open Source
Open source is a beautiful concept but it often comes with a price tag or, rather, the inverse price tag: most of the time you are not being paid for your time (of course, there are exceptions, such as companies hiring dedicated open source developers and keeping them on their direct payroll).
Everyone has to make a living, however, and everyone has their ways.
Developers can benefit from such income sources as:
Follow-up To Loading CSS And JS Conditionally
First of all, I'd like to thank everyone who read and gave their 2 cents about the [Wordpress Plugin Development] How To Include CSS and JavaScript Conditionally And Only When Needed By The Posts post. The article was well received and will hopefully spark some optimizations around loading styles and scripts.
Here are some discussions and mentions around the web:
- an article on Weblog Tools Collection
- a forum post on WP Tavern
- twitter retweets
Sure, there are drawbacks to this method and it does require some more processing on the backend and it's not for everyone, which is why we should always strive for an even better solution.
I stand by my point of view that, for instance, my dedicated …