Archive Page 2 of 31

Darkleech and Apache

According to recent blog posts published here and here by researchers from security firm Securi, Darkleech uses rogue Apache modules to inject malicious payloads into the webpages of the sites it infects and to maintain control of compromised systems. Disinfecting Web servers can prove extremely difficult since the malware takes control of the secure shell (SSH) mechanism that legitimate administrators use to make technical changes and update content to a site.

via Exclusive: Ongoing malware attack targeting Apache hijacks 20,000 sites

Automatic Theme Fallbacks for Post Formats in WordPress 3.6

WordPress 3.6 adding post format content to main content automatically

Today I noticed that WordPress (3.6-alpha-23883) has started automatically adding content to my posts that use post format other than the standard “post” and have some of the new meta fields filled out. Then I found this ticket #23347 which along with the attached patches explained everything — posts of the following post format: link, image, quote, video and audio will have post_formats_compat applied to the_content filter in wp-includes/default-filters.php, which means that all themes that don’t explicitly define

add_theme_support( 'structured-post-formats', array( 'link', 'image', 'etc...' ) )

will have that meta information prepended or appended automatically to post content.

Solution

Simply remove post_formats_compat from the_content filter, like so:

remove_filter( 'the_content', 'post_formats_compat', 7 );

or mark your theme as being aware of that new post format meta:

add_theme_support( 'structured-post-formats', array( 'link', 'image', 'quote', 'video', 'audio' ) );

Major Rewrite of Widget Context

banner-772x250

Update: Widget Context 0.8.1 has been released that fixes the following issues:

  • Widget context controls were not added to widgets that were created using legacy method.
  • Word count context was not working correctly.

I am happy to announce version 0.8 of Widget Context plugin which is almost a complete rewrite of the plugin. Many bugs have been fixed and new ones might have been introduced, so please use this forum on WordPress.org to report bugs and send your feedback. Patches and pull requests are more than welcome on GitHub.

New Plugin: Widget Output Cache

Screenshot of server response times, WordPress

Like it or not but many WordPress widgets, plugins and themes are poorly coded and do crazy things like remote HTTP requests and multiple database queries on every page load which drastically decreases the performance of your website.

One solution is to simply fix the plugin or theme and send a patch to the original author in hopes of it actually being included in the next release of the plugin or theme. A more generic solution is to use the crude PHP output buffering together with WordPress transients to store and retrieve complete widget output from database or non-persistant object cache.

While this is certainly not the most elegant solution, it definitely is the quickest to implement thanks to the widget_display_callback filter.

Widget Output Cache is a plugin that does exactly that.

Allow Plugins to Short-circuit wp_nav_menu

Database queries necessary for wp_nav_menu

I  just submitted my second WordPress core patch that adds a short-circuit filter at the top of wp_nav_menu which enables plugins to retrieve rendered menu output from a transient or non-persistent cache instead of relying on relatively complex database query that returns one of the most static items of every website.

Why is this important?

To illustrate the complexity of menu retrieval, here is a list of all database queries that are run on every page load:

  1. Retrieve term object of the nav_menu taxonomy that corresponds to the specific menu name.
  2. Retrieve menu item IDs (not complete post objects, yet) that are in the particular term.
  3. Query for menu item post objects with the specific IDs and retrieve three post_meta values per each menu item.
  4. Retrieve post and term objects corresponding to each menu item (map every nav_menu_item post to the actual post, page or archive page).

and here are the corresponding query samples:  Read more »

Page 2 of 31