Sep 182011

Almost 2 months after the last version, Suffusion 3.8.3 is here. This is another big release with a hopefully small impact. As mentioned earlier, the focus of this release was on making the theme more framework-like. Here is the change log for this release:

  1. New Features
    1. Enhanced Breadcrumbs:
      After a slew of questions from lots of users regarding breadcrumb display, I went ahead and built some powerful breadcrumb functionality. If you have “Yoast Breadcrumbs” or “Breadcrumb Trail” your breadcrumbs will not be affected, but otherwise you can use Suffusion’s breadcrumbs. The breadcrumbs can be displayed on single posts, custom posts, archives (categories, date archives tags etc) and is fairly intuitive. They are not activated by default and can be switched on from Other Graphical Settings → Breadcrumbs and Page Navigation.
    2. Support for Native Custom Backgrounds:
      At the time of releasing 3.8.2 the feedback given to me was that I should use WP’s native Custom Background functionality. So I have gone ahead and provided that. If you define something in under Appearance → Background, it will override the settings within Suffusion.
    3. New Options:
      1. You can disable Featured Content on second/third etc pages from an archive view. In other words, only the first page of your category/tag etc will show the featured content. Toggle the option at Other Graphical Settings → Featured Content → Where to Show → First page / all pages.
      2. Along similar lines you can disable full content posts on second/third etc pages of a tiled/list/mosaic layout. Toggle this at Other Graphical Settings → Layout: Excerpt / List / Tile / Mosaic / Full → Full content posts on first page / all pages (for selections above).
      3. Quite surprisingly a feature that has existed since a long time was requested to be taken off recently, twice. Suffusion automatically adjusts images in their original aspect ratio. But some users didn’t want that. You can now disable the aspect ratio fix from Other Graphical Settings → Miscellaneous → Image Aspect Ratio.
      4. Another pilloried feature was the “Allowed HTML Tags” message that shows up at the bottom of the comment form. Several users don’t like it. So you can now remove it from Back-end Settings → Comment Settings.
      5. Suffusion’s Export/Import functionality used to operate only on non-id fields. With this release you can now have two kinds of exports: one that doesn’t export id-based options (useful if you have multiple active sites and just want the same look on them) and another that exports all options (useful if you are moving from DEV to PROD).
      6. You can now control whether the previous / next post should be restricted to the current category. You can also control whether you want the links above the content, below the content, in both places or not at all. See Other Graphical Settings → Breadcrumbs and Page Navigation → Previous / Next Posts.
  2. Bug Fixes
    The following bugs have been taken care of:
    1. There was a problem with Minima, where the display of Asides and some other Post Formats was getting hammered with multiple pullouts.
    2. If the last item in a post was a floated image, things after it were not being cleared properly.
    3. Nested list items in comments were not getting styled properly.
    4. In the “Featured Posts” widget the “Previous” and “Next” buttons were only showing if the slider index was activated.
    5. In the “Query Posts” widget the posts were not displaying in a random order if requested.
    6. If you assigned a “No Sidebars” layout to a single post it was not getting picked up.
    7. The Magazine template and the tile layout were getting incorrect widths for their excerpts if the number of sidebars they had was not the default.
    8. Due to an improper use of CSS in the comment form, labels from other plugins were getting formatted incorrectly.
    9. The image thumbnail functionality wasn’t behaving well in case the image title had special characters.
    10. In the “Static Tabbed Sidebar” if you attempted to put in a “Links” tab, it wasn’t possible to change its title.
    11. The Twitter widget was failing XHTML validation due to its JavaScript.
    12. Post thumbnails in IE were getting “squashed”.
  3. Code Housekeeping
    There was a major level of code housekeeping in this release:
    1. Framework Files
      For ease of use and modification I have broken out various oft changed pieces of code in Suffusion to their own files. All these files are in a folder called “custom”. If you want to modify any of them, simply create a folder called “custom” in your child theme, then copy the file from Suffusion that you want to change and proceed with making the changes. Easy. I will post an article in a few days showing how you can use these files. The following files have been created in Suffusion’s “custom” folder:
      1. byline-tile.php: Handles the byline display for the magazine layout and the tile layout.
      2. pagination-mosaic.php, pagination-comments.php and pagination-posts.php: Handle the display for pagination of the Mosaic layout, comments and posts.
      3. seo.php: Obviously, handles SEO aspects.
      4. pullout.php and pullout-page.php: Manage the display of “pullout” style bylines for posts and pages respectively.
      5. navigation.php: Contains the Navigation Menu code.
      6. post-header.php and post-footer.php: Respectively contain the elements to be displayed before and after the post content.
      7. breadcrumb-page.php and breadcrumb.php: Respectively contain the breadcrumb logic for pages and everything else.
      8. prev-next.php: Handles the previous and next page display.
      9. site-footer.php: Displays the credit at the bottom of your site.
    2. Load Optimization
      1. Core Load Optimization
        1. I optimized several aspects of the application load. The back-end, you will notice, has become sprightly. On the front-end by separating things into several files I only load files when absolutely necessary, making things a lot faster. I will fine-tune things further in subsequent releases.
        2. In addition to the framework-type files, I have also separated the functions that deal with BP compatibility into a separate file. This will not affect BP users, but will speed things up for non-BP users.
        3. I have for now disabled the “Version Checker”. I noticed that for some people this was causing memory issues, hence this action.
        4. I have removed a lot of redundant functions from the code, combined functions where possible etc.
        5. I have also removed the “FAQ” section of the Admin panel – the section had really old information and though Colin provided suggestions on how to make it better, maintaining that was simply too much of an overhead.
      2. Query Optimization
        In several cases I have fine-tuned the queries being executed in the database. The biggest example is the navigation bar, where I have drastically reduced the number. The net result is that the number of database queries being executed is very similar to several themes that are loaded with a lot less functionality.
      3. Script Optimization
        1. I performed major CSS optimization. Firstly I separated the BP-specific CSS to its own file. This will speed up things for non-BP users and will not affect BP users with a caching plugin.
        2. I also heavily optimized the CSS code for the navigation menus, taking out several lines of code.
        3. I combined some JS files to save server round-trips.
        4. Lastly I introduced sprites where possible. Note that things like body backgrounds, list bullets etc cannot be handled using sprites without errors, so you will still see non-sprite images.
  4. Changed Features
    1. Tables now occupy 100% of the width by default, in both, main content as well as comments.
    2. The login template bundled with the theme now redirects to the home page instead of the WP installation page upon successful login.
    3. Earlier there used to be an incompatibility between Suffusion and SEO plugins in terms of the use of wp_title. This has been addressed – whether or not you use Suffusion’s SEO, wp_title is the call that will always be used.
    4. Text is now left-aligned by default, instead of being justified.

Hope you like this release.

Now, back to Photonic, some other plugins and some theme skins.

Jul 242011

Version 3.8.2 of Suffusion was approved today. As promised this is a minor release with just some minor new features. The following are the list of changes:

  1. New Features
    1. New Widgets
      There are two new widgets and one revamped widget:
      1. Child Pages
        This might make some people happy. The Child Pages widget, if activated, can show you the child pages for the current page. Think of a use case where you are writing a book via WP. You could make a section of the book a parent page, then all the chapters in there child pages. If you have this widget activated, you will see the links to the chapters in the widget. Obviously, if you go to a different parent page you will see the child pages of that. What’s more – if your page has no child pages, or if you are viewing a post archive or a single post, the widget is automatically turned off. Of course, there is an option to turn it back on, but I don’t see a reason to use it. The title of this widget supports short-codes, so you can use one to dynamically control what is displayed.
      2. Query Users
        WordPress site owners with multiple users, rejoice! The Query Users widget can display all users of your blog by authentication level (Contributor, Editor etc). You can also choose to display the description for the user or simply display the Avatar. With certain tweaks you can make it behave like an “About Me” widget, wherein your Avatar is displayed along with your description and the number of posts you have written. The users displayed can be linked to either their regular WP Author pages or to the BP Profile pages (if you have BuddyPress installed).
      3. Query Posts
        This is really the old Category Posts widget. I have added capabilities such as filtering by tags, ordering by title, comments etc. With appropriate configurations you can make this behave like a “Recent Posts” widget or a “Popular Posts” widget. The advantage this offers is that it is capable of displaying thumbnails for your posts. I would have ideally liked to include a few more choices like displaying specific archives, or displaying the child posts for the current view, but those are for a later release.
    2. I have added support for manual excerpts in pages. This was just a simple one line addition – I should have thought of it long back.
    3. Another feature added is more framework-like. In case you are building a child theme of Suffusion, you can add an “Announcements Feed” to your style.css file and that can show up on installations of your child theme with a “New Version available” message, like the one you see in Suffusion’s option panel currently.
  2. Bug Fixes
    1. There was a small bug in the Featured Posts excerpt, which was not honouring the word limit defined in the options. Thanks to Justin Klein for the report and the fix.
    2. There has been a long-standing bug for IE8 that prevented native WP thumbnails from displaying. Hopefully this release fixes it.
    3. In a fix for IE7 while using the “No Sidebars” template I broke some functionality, wherein a page without comments would collapse in width. This has now been fixed.
  3. Code Housekeeping
    1. Again thanks to Justin Klein there has been an optimization in terms of database entry storing. Earlier, if posts were using the default template, an entry used to be saved in the database. I have modified the code so that “default” is not stored any longer.
    2. A ghost file called “mosaic.php” had been left in the theme in the last two releases. I have removed it.
    3. I have also switched to using WordPress’ native “contextual help” for the admin panels. What does this mean? When you view any options page in Suffusion, you will see a small link saying “Help” in the top right, near “Screen Options”. I have moved the help texts to that section instead of having the “?” icon near the options page headings. This has entailed removal of “jquery-dialog” from the back-end, hence one fewer JS file to load.
    4. I have cleaned up some miscellaneous comments and redundant code in the admin files.
  4. I have updated the translation file. Translators, please fire away.

The next few weeks I will focus on a plugin called Photonic. It is the photo-blogging plugin that I had promised.


Jul 052011

Version 3.8.1 went live today. This version addresses the issues reported with Version 3.8.0.

Truth be told I was a bit nervous about 3.8.0 because the change log for that version was almost 40 items long and since the development took over 4 months, I was concerned that what I had started developing in February might have been forgotten by June. Luckily nothing of that sort happened, and though there were bugs, they were nowhere as bad as 3.7.5/3.7.7.

So here is the list of changes:

  1. Bug Fixes
    1. In IE9, there was a stray closing comment tag (-->) appearing near the top of the page. This was due to the incorrect inclusion of a conditional script in IE for rounded corners.
    2. I had upgraded the JQuery Cycle scripts for featured content in the theme. This didn’t pose any problems in most cases, however some users reported that when the Featured Content Widget was being used with the “lite” version of the script, the script stopped cycling through images. I have rolled back the JQuery Cycle script, so hopefully there will be no issues.
    3. There was an undetected bug which would have caused JS errors in IE6 because I had forgotten to include a particular script. I have addressed this.
    4. Another “Featured Posts Widget” bug was causing the images to get squished when the widget was in the “Widget Area Below Header” or in the “Widget Area Above Footer”. I have addressed this. Props to “Kapusjon” on the support forum for helping me track this down!
  2. New Features
    1. I have enhanced the post_class() functionality in the theme. It now includes some classes for posts, such as category-xx-id (the id for the category), post-seq-x (the number of the post on a page), post-parity-odd (whether the post is in an odd location or even). You can take advantages of these classes for adding extra styles to your site.
  3. Code Changes
    1. I have removed output buffering where possible. This shouldn’t impact you as a user.
    2. I have replaced a query parameter in the Featured Content to ignore sticky posts – this is because the previous query parameter was deprecated.
    3. I have added a wp_reset_query() call to the Category Posts widget to account for any query changes to it.

I would also like to get your inputs on features that you liked or would like to see improved in the previous release. I added a lot of them, like column control for individual posts and the magazine layout, enhancements to the Twitter and Category Posts widgets and byline information handling for the magazine template, the tile layout and post formats.

Jul 012011

Version 3.7.9 of Suffusion was approved today, and as things happen, shortly after approval I discovered a bug which I fixed. So the new version available is 3.8.0. This version should work on the upcoming WP 3.2 – I have made sure that the admin-side JS doesn’t break.

This version has a very long but hopefully low impact change log. The following are the changes:

  1. Bug Fixes
    1. There was a problem with selecting fonts that had spaces in their name in the back-end. This has been addressed.
    2. In IE7 if you were to use the “No Sidebars” template with the “Widget Area Below Header” enabled, there were markup issues. This has been addressed.
    3. The “pullout” style displays (like the Minima skin) had an error in the markup – it was missing a closing tag.
    4. The image resizer was incorrectly creating multiple copies of the source file if the file extension was in uppercase. Now it will not.
    5. I fixed a bug where the sidebars below Sidebar 1 and Sidebar 2 were incorrectly picking the styles defined for the upper sidebars.
    6. This is not a bug fix as such, but I removed the “Notifier Failed” message that was shown earlier in the options panel if my site was down.
    7. I fixed a minor problem where the options panel was sometimes showing incorrect values for default colours.
    8. The sitemap template was not showing contents properly without saving the options for it twice. Now that has been resolved.
    9. Another minor bug fixed is that in the Alternate Page Title handling. There was a small inaccuracy in the code that would prevent the alternate titles from working under some circumstances.
  2. Changed Features
    1. The “Edit” link earlier used to be displayed only on singular views (i.e. on pages and on single posts). I have now made it visible on the archive views too.
    2. I made the button bar in the back-end a lot less intrusive, based on user feedback. I also made the back-end fluid-width instead of fixed width.
    3. The Featured Content has always used the JQuery Cycle plugin. Cycle was meant to cycle through a series of images, so it displayed a blank box whenever you had a single post in your featured content. I worked around this – you can now have just one post in your featured content and it will work just fine.
    4. Code Housekeeping
      1. IE6-specific Cleanup
        1. In an effort to clean up for IE6, I replaced Microsoft Expressions with JavaScript. As an end user you will not see any impact, except that it speeds up a few things. Not that I expect you to use IE6, but even so.
        2. I also got the IE-specific fixes to enqueue instead of including them directly. Again, you can safely ignore this – it will not impact you as a user.
      2. I swapped out some of the admin panel checks with standard WP functions like checked() and selected().
      3. There are some minor CSS cleanups done.
      4. I have swapped out the use of $post->post_title with get_the_title(). so that the right filters are applied.
      5. I have removed the scripts for JQuery Accordion – it was something erroneously included in the first place, so removing it should have no impact on you.
    5. The replacement text for […] in excerpts now supports HTML in addition to plain text.
  3. New Features
    1. This is something that folks might like: I introduced a method to search for options in the back-end. It is not perfect, but it should help people find options a lot quicker. You will see a box called “Quick Search” in your options screens – that is where you can start typing what you are looking for.
    2. Magazine and Tile Layout
      1. Now there is byline support for the Tile Layout and the Magazine Template. Hopefully you will like what has been implemented. To save on real estate, this has been implemented as clickable icons, which you can click to see the details.
      2. Additional modifications to the Magazine Template include the ability to control the number of sidebars in there. This too makes its way after quite a few requests.
      3. Custom thumbnail sizes can now explicitly be defined for the Tile Layout. Earlier the thumbnail inherited the sizes from the Magazine layout.
    3. Widgets
      1. There is a new Flickr widget to help display your Flickr stream. It is not as fancy as what I had put together for the gallery short-code extension, but it does its job as it should.
      2. The Twitter Widget got a rewrite! It now displays your Avatar for your tweets, and the Avatar of the original tweeter in case of a retweet.
      3. The Category Posts widget (and the static category posts in the magazine layout) got a rewrite too! It now displays a post thumbnail, in addition to an excerpt if you wish. You can additionally control the length of the excerpt and make it different from that of a standard excerpt.
    4. Special Handling
      1. Support for post formats has been significantly improved. For each post format you can control how the bylines should appear etc. Check out Other Graphical Elements → Post Formats.
      2. You can now control the number of sidebars on single posts. In your “Edit Post” screen you will see a drop-down that says “Select the sidebar layout to apply to this post” under “Additional Options for Suffusion”. You can pick the layout you wish for that.
      3. You can now hide the page title for pages. In the “Edit Page” screen you will see a checkbox that says “Do not display the page title” under “Additional Options for Suffusion”, which upon selecting will hide the page title.
      4. For posts without a title, a specific “Permalink” is displayed. This is turned on by default and can be switched off in Other Graphical Elements → Post and Page Bylines.
    5. A search form has been added to the 404 page, as per WordPress requirements.
    6. For image attachments you can display all available image sizes at the top. Take a look at Templates → Attachments.
    7. Rounded corner support has been extended to IE9.
    8. There is a new “Mosaic Layout”. Consider this an apology for not including the photo-blogging features I had thought I would, but this was the least I felt I could do. The mosaic layout will display just the thumbnails of your posts in an archive view, nothing else. In many ways it is like the List Layout, except that this shows thumbnails instead of titles.
    9. There is a new short code that accompanies the Flickr Widget, called suffusion-flickr. It takes the same parameters as the widget, so you can pass the following
      1. id – Mandatory, can be obtained from using your photo stream’s URL
      2. type – Mandatory, legitimate values: user, group
      3. size – Optional, legitimate values: s (square), t (thumbnail), m (mid-size); default: s
      4. number – Optional, default 10
      5. order – Optional, legitimate values: latest, random; default: latest
      6. layout – Optional, legitimate values: h (horizontal), v (vertical), x (no layout – user-styled); default: x
    10. There are a couple of new filters: suffusion_comment_form_fields and suffusion_permalink_text. The former can be used if you want to override the fields in the comment form, while the latter can be used to override the “Permalink” text that you see for the newly introduced permalink byline.
    11. In the previous version I introduced WPML support for text fields entered on the admin side. In this release this support has been extended to fields that are of type “textarea” as well. E.g. The 404 page content under Templates → 404 is a text area, so the text you have there can be translated into multiple languages using WPML.
  4. Removed Features
    1. I removed the ability to load JS files in the footer, because this was causing a lot of dependency issues. Most caching plugins will let you do this, though, so you are not really losing out on much by means of functionality.

There is one thing I am not pleased with for this release, and that is a lack of polish on some of the new functionality, like the enhanced Post Format support, the Mosaic Layout etc. Believe me, I would have done things much better if I had more time to spare, but having got caught up between releasing the theme to be WP 3.2-ready and adding features and working full-time elsewhere, I had to make some sacrifices. Rest assured that I will improve on these in the near future.

I would again like to reiterate something that I touched upon in my last few posts. Suffusion is almost 2 years old and has evolved into something that I am very proud of. However, due to several factors I believe now is the time to wind down the development of the theme:

  1. The theme has reached a level of complexity beyond which it will become more of a liability than an asset. So from now on, big ticket new features are a strict no-no, except for some things documented below.
  2. I am trying to reclaim some time for myself. Thanks to all volunteers on the forum (you know who you are!) the load on me has reduced quite a lot, however with every new feature comes a new set of support questions. Juggling between coding, supporting and working is turning out to be a strain.

However, in the light of the queries posted in response to my previous post I must hasten to point out:

  1. Incremental development will continue, like new skins, new templates, support for newer WP versions.
  2. Some big ticket items are still in scope for the theme, specifically in the area of sidebars, and making the theme more of a customizable framework.
  3. I will channel my energy into building some plugins that you can take with you to any theme. As mentioned in my last post I will bundle the photo-blogging features into a plugin. In addition I will build some plugins to manage fonts etc.
  4. I will improve theme documentation.
  5. I will also switch back to mini-releases instead of humongous ones. Though a lot of people don’t like frequent updates to the theme, from my experience over the last few releases, smaller updates are easier to process and definitely easier to support.


Feb 282011

I have had bugs in software before, but by any standards version 3.7.7 was awful. Just awful. As the saying goes, The road to hell is paved with good intentions. In Beta 2 I tried to put in a tweak related to Suhosin, so I split the options into multiple forms and thought I got it working. The Beta came and went by without alarms, so I submitted the code for approval, and then it proverbially hit the fan. Truth be told I was expecting issues with the TimThumb replacement, and there were a few. But I seriously blew it with regards to the option management, costing people hours of work. Not all people faced issues, mind you – particularly several people who simply upgraded their sites and left it at that. People who are subscribed to my feed knew how to downgrade the release, so that alleviated some concerns. People who had little image jiggery-pokery on their sites (like me) faced literally no issues, because they didn’t have to tweak anything.

But for all the rest, all I can offer you is an apology, and what I hope is a clean version – 3.7.8. If you have bought me a coffee and then realized it was not worth it due to this release, please send me an email through the support forum with a transaction id – I will issue an unconditional refund.

Here is what I have covered in 3.7.8:

  1. Thumbnail issues
    1. If images were not in the template path but in the local directory they were not being picked up and a warning message was being displayed. Thanks a lot to Bob Schecter for an impressive array of websites with a wide range of configurations, which he let me use so that I could track this down.
    2. If the image source was a secure HTTP location (HTTPS, like PicasaWeb), the image was not getting resized. This should be fine now. Thanks to Jürgen for the tip.
  2. Color issues
    1. The first issue was with the color picker. Thanks to various quirks in the use of Farbtastic, I rolled back to something that has been a part of Suffusion since release 2.0 – JSColor. If you now pick a color and save, the change will go through without you having to go through an elaborate charade.
    2. Colors were inconsistently getting prefixed with a “#”. I have made sure that this is no longer the case. Thanks to Kattsby for the tip regarding this.
  3. Option issues
    1. The biggest issue in the previous release was that the buttons to save/reset options had gone rogue and a lot of people have pointed this out. I have made sure of the following:
      1. Clicking “Save” in one screen will not blank out options in another screen.
      2. Clicking “Reset” will not empty the entire theme’s options.
      3. Exporting / Importing will now work.
    2. Another rather intermittent issue was the interference caused by a cookie used by the options panel while attempting to save things. I am only aware of 2 people facing this issue, mind you, and one of them (Mason) has confirmed that this has now been fixed.
    3. A minor issue was that if your options were saved, they needed to be saved twice for the auto-linked CSS to be updated.
    4. Quote characters around font names were being escaped, preventing the font from being loaded.
    5. Some people complained about a slowdown on IE. To counter this, I got rid of the JQuery Uniform script that I was using to make the admin panel look good. I will reconsider this once the changes introduced in this version stabilize.
  4. Miscellaneous issues
    1. There was a bug that was breaking the layout of the Widget Area Above Footer.
    2. There were some issues with the navigation menu’s appearance in the standard skins, particularly with respect to visited items and hover-over items.

Things that are not issues

When something goes wrong, the natural inclination is to assign to it all faults, real and perceived. Something similar happened with the last releases, and because the core faults with Suffusion were so severe, a lot of issues from other places were ascribed to the theme. Not that I blame any of you for it. The following are NOT issues with Suffusion:

  1. If your admin panel stops loading after printing the top bar, the culprit is, in all likelihood a plugin. There is a lot of literature around this on the web, but it bears repeating, particularly because Suffusion’s options panel is more complex and detailed than most other themes’ panels, and having an incorrect script interfering can really mess things up.

    A lot of people upgraded to WP 3.1 and Suffusion 3.7.7 at the same time. Now, WP 3.1 uses a new version of JQuery libraries. Some plugins and themes don’t include JQuery the right way. The somewhat correct way to include JS in WordPress is by using the wp_enqueue_script function. The truly correct way to include JS is to use wp_enqueue_script with the right hooks. Here is what I mean:

    1. The absolutely wrong way:
      function print_my_script() {
      	echo "<link media='all' href='' type='text/css' rel='stylesheet' />"; 

      The problem is that the above will load JQuery potentially twice. Plus you might be loading JQuery after something needs it, thereby resulting in errors. The only situation when this might be required is if you need conditional JavaScript (like something for IE), which is not the case in the above.

    2. The sometimes correct way:
      add_action('init', 'my_enqueue_scripts');
      function my_enqueue_scripts() {
          wp_deregister_script( 'jquery' ); // Will remove WP's standard JQuery
          wp_register_script( 'jquery', ''); // Will register Google CDN's JQuery, version 1.5
          wp_enqueue_script( 'jquery' );// Will queue it up for printing.

      The trouble with the above is that the script is going to get enqueued for all pages, admin or otherwise.

    3. The almost correct way:
      add_action('admin_menu', 'my_plugin_menu');
      function my_plugin_menu() {
      	add_options_page('My Plugin Options', 'My Plugin', 'manage_options', 'my-unique-identifier', 'my_plugin_options');
      	add_action("admin_print_scripts", 'my_admin_script_loader');
      function my_admin_script_loader() {
          wp_deregister_script( 'jquery' ); // Will remove WP's standard JQuery
          wp_register_script( 'jquery', ''); // Will register Google CDN's JQuery, version 1.5
          wp_enqueue_script( 'jquery' );// Will queue it up for printing.

      The only problem with the above is that it will queue up the CDN JQuery for all admin pages. What if another plugin is relying on a different version of JQuery? A lot of developers get this one wrong.

    4. The truly correct way:
      add_action('admin_menu', 'my_plugin_menu');
      function my_plugin_menu() {
      	$options_manager = add_options_page('My Plugin Options', 'My Plugin', 'manage_options', 'my-unique-identifier', 'my_plugin_options');
      	add_action("admin_print_scripts-$options_manager", 'my_admin_script_loader');
      function my_admin_script_loader() {
          wp_deregister_script( 'jquery' ); // Will remove WP's standard JQuery
          wp_register_script( 'jquery', ''); // Will register Google CDN's JQuery, version 1.5
          wp_enqueue_script( 'jquery' );// Will queue it up for printing.

      If you notice, the only difference with #c is the way the admin_print_scripts hook is used. By appending the options page to it, we are saying that the JQuery script should be used only for this particular plugin’s admin screens.

    What has been happening is that a few plugins have followed route b or c above, causing a proliferation of bad JavaScript across the admin pages. With the WP upgrade these plugins now have conflicting JS. This unfortunately causes the correctly coded themes/plugins to break because they rely on the native version of JQuery, which the bad plugin has overwritten on all pages. If you are facing this, you should try deactivating your plugins, then reactivate them one by one to see which one is wrong. If you isolate the broken one, feel free to point the above instructions to the author.

  2. Header height and margin between top of content and top of page: If you had set your options to show a certain header height and margin, please note that the option has moved from Blog Features → Sizes and Margins to Theme Skinning → Header. What has happened as a part of this move is that the control switch has changed. So under Theme Skinning → Header you have to set the options to use “Custom Styles” for the setting to continue to be effective.

Thanks for all of you who had patience with me during the last one week. Thanks are also in order to all of you who provided detailed reports of the issues that you faced. I wish some of you had participated in the beta testing. Apologies if you don’t see your name above – it is just that there were so many people reporting the issues that I couldn’t fit everyone in here.

Feb 222011

Version 3.7.7 was released earlier today. This release mostly has bug fixes for 3.7.5. The following are the changes:

  1. I have included a workaround for a rather weird critical bug affecting some installations. The symptoms of the bug are that the header in the options page loads up, then nothing happens. I tracked it down to a bug due to those installations failing to load the jquery.cookie.js file. What makes this bug weird is that the file is there, yet accessing it returns a 404 error. What makes the bug (and the fix) weirder is that if I yank that file and put its contents in another place, the bug resolves itself.
  2. There was a bug that wasn’t updating the options CSS if you had set it to be auto-generated. This has been addressed.
  3. Resized images were not being generated in the default settings. If, however, you saved options on, say, the Featured Content page, the images would show up fine. I have fixed this issue.
  4. I have added basic post-format support without any special treatment, so as to be ready for WP 3.1. Further handling of post formats will be done in subsequent releases.
  5. Another fix is for folks on PHP 4.x. There was a call to a feature (instanceof) that came up in PHP 5, so people on PHP 4 were getting a critical error.

Hope this takes care of the issues with 3.7.5.

Feb 212011

Version 3.7.5 was approved earlier today. I know that the beta releases were for 3.7.4, however 3.7.4 didn’t pass the approvals required by the Review Team, so I had to release 3.7.5. This is quite a big release with lots of changes. However, unlike other big releases this has more to do with code housekeeping rather than brand new functionality. Before you read further, here is a warning:

This release changes the whole look of the code behind the scenes. It has been beta-tested, but bugs always come up. In case this release critically breaks some functionality, please downgrade to the previous version and log a bug on the support forum. You can download the old version, then replace the contents of your wp-content/themes/suffusion folder with the unzipped suffusion folder that you get from the downloaded file.

Without much ado, here is the change list:

  1. Code Housekeeping
    1. Switch to native WordPress APIs
      I have removed a lot of custom or third party code from a lot of areas and started using native WordPress areas. Here are the changes:
      1. Settings API
        One of the 2 biggest changes this release is a nice looking backend. For this I moved to the Settings API that WordPress provides. This was a huge and high impact change, because I had to decommission a tried and tested options engine in favour of something that has not been implemented by anyone on such a large scale. All uses of the Settings API on the web are for simple cases where you require only one options page. Anything more complex makes developers pick up a custom approach, or an approach that only superficially uses the Settings API.
        I can thump my chest here as the first theme with such a complex back-end to utilize the Settings API in all its glory. The only place where the API is not used is in the Custom Types section, which only partly uses the API. I will port it over in a subsequent release – for now it is not critical.

      2. No TimThumb
        This is the second big change, and potentially more high impact than the first. TimThumb, though popular has some security holes, particularly with its old versions. Recently the WP review team started cracking down on themes relying solely on TimThumb. I introduced TimThumb into the mix more than a year back, but I had also introduced support for the native post thumbnail functionality of WP almost as soon as it was introduced. This helped me avoid the axe. With this release Suffusion bids adieu to TimThumb.
        I have put together a resizing algorithm based on a method suggested by a contributor on WordPress Trac. I had to modify it a good bit to make it work the way I wanted and so that it did not break how your existing images looked.

      3. No “file open” operations
        Again, the WP review team has been cracking its whip to get file open operations removed. As a result I have had to think out of the box to make code behave to my liking. I have had to replace inbuilt CURL calls with the WP HTTP API, and where this really posed a challenge was regarding storing of the generated CSS and storing the resized file for the image resizing.

    2. Use of more modern functions
      A few functions have been deprecated by the WP development team. I have replaced all such functions with their new variants:
      1. get_bloginfo('wpurl')site_url()
      2. get_bloginfo('template_url')get_template_directory_uri()
      3. get_bloginfo('url'), bloginfo('url')get_template_directory_uri() 

    3. Removal of backwards compatibility
      As stated in a previous post, WordPress 3.0 has been out for more than 8 months now and version 3.1 is almost upon us. So if you haven’t upgraded your WP installation now is the time to do it. This latest release of Suffusion will not work on anything older than 2.9. I have removed function/class existence checks for all these versions:

      1. 3.0.x – get_template_part, comment_form, wp_nav_menu, wp_login_form, get_nav_menu_locations, wp_get_nav_menus, register_post_type, register_taxonomy, post_type_exists and register_nav_menu
      2. 2.9.x – add_theme_support, get_the_post_thumbnail
      3. 2.8.x – class WP_Widget
    4. Function names are now more consistent. All functions within Suffusion are either prefixed with suffusion or suf.
  2. Feature Changes
    1. Reorganized the Options Menu (again)
      Trust me – I did not want to do this. Suffusion started out with one link under the Appearance section of the admin page. I then pulled it out to give Suffusion its own menu when I introduced Custom Post Type support. I initially had horizontal tabs at the top and vertical tabs within each page, but I switched it out when the page got sluggish.
      This change consumed a lot of my development time in what was already an intensive exercise. But I believe I got it right this time:
      1. New Menu Position (aka Older Menu Position)
      2. New Tab Design
      3. Moved items
        There has been some upheaval in the options sections. Notably:
        1. Introduction – This is the same as the Introduction section of the old options
        2. Theme Skinning – Earlier you had a tab called Theme Skinning under Visual Effects. Theme Skinning is now a section of its own and deals almost explicitly with setting up the colors of various components (aka “skinning”). All former individual sub-sections under the old Theme Skinning are now tabs under the new Theme Skinning. For example you have Body Background, Main Wrapper etc.
          The main purpose of this split was to avoid Suhosin-related issues. You can click on the “Notes” button near the section title as shown above for more information.
        3. Visual Effects Other Graphical Elements – This has mostly the remainder of the items of the former Visual Effects section. In addition it has picked up items from the former Blog Features that dealt with graphical aspects, like Featured Content, Post and Page Bylines, layout options etc. You can click on the “Notes” button near the section title as shown above for more information.
        4. Sidebars and Widgets Sidebar Configuration – This is the same as the former Sidebars and Widgets section, except for the fact that the Static Tabbed Sidebar has been moved from the former Blog Features page to here.
        5. Blog Features Back-end Settings – This is a heavily stripped down version of the former Blog Features. Most of the older options have moved to Other Graphical Elements. You can click on the “Notes” button near the section title as shown above for more information.
        6. Templates – This is the same as the old versions.
        7. Custom Types – This is the same as the old versions.
    2. No Translations
      Translations are no longer a part of the core theme. They have all been moved to the translations page. Additionally, at no impact to you the translation text domain has changed from “suf_theme” to “suffusion”.
    3. Changes to Default Settings
      Some changes were required to the default settings to make it pass the review process, and some others were needed for ease of use.
      1. JQuery Masonry is switched off by default instead of being switched on.
      2. By default both navigation menus are switched off. This was one change I did not want to make, however I did so to avoid a lengthy back and forth exchange.
    4. Made the blog title use h1/h2 tags instead of div tags.
    5. I have renamed the classes category-info and tag-info to info-category and info-tag respectively. This is to avoid weird styling issues if you have a category or a tag named info. Please make note of this if you have used Custom Styles for these elements.
    6. Goodbye Marvin!
      For those familiar with lore, Marvin the Paranoid Android used to reassure you not to panic. Unfortunately, since the photo of Marvin was not GPL’ed, I had to remove him from the introductory screen (though I had provided the appropriate credits to Buena Vista).
  3. New Features
    1. Sidebar Control
      There is a new capability to control the number of sidebars on different views like the blog, category, tag, date archive and search. For example you can now have 2 sidebars across your site, but only one sidebar on the blog page. Check the settings under Sidebar Configuration → Sidebar Layout. All in all the ability to manage sidebars for specific pages/views has improved from previous versions, and in the next release or two you should have something very flexible. I might write up an article on how to effectively tweak sidebars shortly – let’s see.
    2. You can now upload an image directly from the options pages instead of entering a URL. Of course, entering a URL works too.
    3. New Notifiers
      Added the following notifiers:
      1. New versions – Tells you when a new version is available and points you to the release notes. The reason for this is that some people complained about frequent updates (though old-timers will note that I have significantly slowed down) – this is for them to check out what the latest version has, so that they can make an informed decision about upgrading.
      2. Translations – If you are using WP in a language other than Americanized English, you are pointed to the right locations to pick up the correct translations.
      3. BuddyPress – If you are using BP, this provides you information about making Suffusion work with it.
    4. Added options to control the “Posted By” format. See Other Graphical Elements → Post and Page Bylines for more information.
    5. Added better WPML integration. There are texts that you set in the back-end, like the labels for your comment forms etc. I have added WPML support for them, so that you can translate those strings in the back-end.
    6. Added zoom-crop capability (aka proportional resizing) for images in featured content, magazine headlines and magazine excerpts. See the respective sections for setup options.
    7. There is dual JQuery UI support, for version 1.7.3 (WP 3.0.x) and 1.8.7 (WP 3.1.x).
    8. You can now control the number of headlines you want to display in the headlines section of the Magazine template.
    9. There are a couple of new filters: suffusion_author_information and suffusion_category_information. They can be used by you to tweak the information that appears at the top of the Author page and the Category pages.
    10. There is a new option to force compatibility mode in IE8. You will find the option in Back-end Settings → SEO / Meta Settings.
    11. There are a couple of options more dealing with the generated CSS. You can choose to cache the generated CSS, include it directly in the HTML, include it via a link etc.
  4. Bug Fixes
    1. There was a bug earlier that was causing the title set through Suffusion’s SEO to clash with the title set by different SEO plugins. This should now be fine.
    2. In the Magazine template if you were displaying headlines, the first headline was not being selected by default. This has now been fixed.
    3. The $post variable was getting overwritten if the Ad Hoc Widgets were used to display things like featured posts or category blocks.
    4. I have fixed a bug where if you looked at a page in BP you would see an incorrect HTML title.
    5. I have included what is hopefully a patch for a WP problem (not a Suffusion problem) affecting a very small percentage of users. With the bug kicking in, users were unable to reliably see the child pages for a given page in the breadcrumb because WP fails to provide the ancestry relationships properly.
    6. I have also included a patch for a NEXTGen Gallery bug. I have often expressed my dislike for this plugin thanks to a variety of reasons. In this case including the fix at my end seems to be a much easier thing to do than wait for the NGG guys to put it in. The fix deals with viewing NGG, when used with themes employing max-width and min-width on IE8 without compatibility mode.
  5. Removed Options
    I have decided that I will periodically do a review of redundant options in the theme and cull them. Options that have much better plugin-based alternatives and options that have significant maintenance overhead will be removed.
    1. Compression options for JS, CSS and the site as a whole have been removed. Sorry, but those serve very limited functionality and are incapable of generating compressed content for files from external plugins. If you are looking to do any of these, you can try using W3 Total Cache or some similar plugin. The only compression-specific option introduced is to minify the generated CSS into 1 line, so that you don’t add hundreds of lines into your source code – just one long line will be present.
    2. Removed the option to load JQuery via CDN. This was becoming extremely ungainly. If you want to use CDN versions, please use a plugin.

I do understand that this is a pretty big release. So if you have upgraded and something has broken badly, please do not hesitate to downgrade (and report the problem on the Support Forum). This isn’t meant to alarm you, for most code-related issues can be fixed and I have taken a lot of care to keep the code good. This is just to assuage your concerns that if something goes wrong, it makes best sense to follow the advice on the introductory page of the options: Don’t Panic.

Dec 202010

Version 3.7.3 is another security patch that was released yesterday. The following are the changes:

  1. Apparently there was a problem with my checked in code in 3.7.2, so the site optimization check for CSS files didn’t go through correctly. This has now been corrected.
  2. I fixed a problem where the edit link for pages was not clickable.

You are strongly encouraged to do this upgrade.

Dec 162010

For once this is an important security patch, hence I made this release by disrupting my regular theme development. Here are the changes:

  1. Added some security checks to ensure that the site optimization activities would take only CSS files for compression/zipping.
  2. Fixed a bug with the byline pullout in IE7, where the pullout was lying over the content.
  3. Fixed a bug with the SEO settings where if the theme’s SEO was disabled, it was not printing any title.
  4. Changed a Twitter icon file name to have only lower case characters, so that it works with all operating systems

I encourage you to download this patch. For now the translations are in the theme. I will remove them from the next version.

Nov 302010

Suffusion Version 3.7.1 was released earlier today. These are the key changes in this version:

  1. New Features
    There were a handful of new features in this release
    1. Pullout-style Bylines
      I added a new way to display page and post byline information (the byline information comprises of “Posted By”, “Category”, “Tag” etc). You can now display the information as a “pullout” instead of in the corners. Here is a snapshot of how this looks:
      For the Minima skin the pullouts are enabled by default. If you don’t like it, or if you like it enough to enable it for other skins, go to Blog Features → Post and Page Bylines → Position of Meta Information (including date) and pick how you want to show it.
      Note that with this you can now display the publishing date of the post for the Minima skin, which was earlier not possible without a hack.
    2. New Attachment Template
      Suffusion earlier used to default to a generic attachment page. In this release there is a special attachment template that displays an apt icon for the type of attachment you have. I have made this functionality extremely flexible. For example if your attachment is an audio file, you can set the attachment page to display an embedded player to play the file. If your attachment is an image file you can choose to show EXIF data for the image.
      In addition, you can define your own handling functions for different mime types. There are functions existing for the basic mime types: suffusion_image_attachment (for image attachments), suffusion_audio_attachment (for audio attachments), suffusion_video_attachment (for video attachments), suffusion_text_attachment (for text attachments) and suffusion_application_attachment (for application attachments). You could define other functions in your child theme like suffusion_vnd_ms_powerpoint_attachment (for Microsoft PowerPoint attachments).
      You can control the settings from Templates → Attachment.
    3. JQuery Masonry
      JQuery Masonry is a very interesting add-on that I had been wanting to add for a while now. This release I finally was able to get it in. This add-on automatically adjusts layout for floated elements. So you will not see fewer empty spaces in the horizontal widget areas (Widget Area Below Header etc), when the widgets are of different heights.
    4. New Filter Hooks
      A lot of new filter hooks were added for better child theme support:
      1. suffusion_can_display_top_navigation
      2. suffusion_can_display_main_navigation
      3. suffusion_can_display_sliding_panel
      4. suffusion_can_display_left_sidebars
      5. suffusion_can_display_right_sidebars
      6. suffusion_can_display_widgets_above_header
      7. suffusion_can_display_widget_area_below_header
      8. suffusion_can_display_widget_area_above_footer
      9. suffusion_can_display_open_header
      10. suffusion_can_display_closed_header
      11. suffusion_can_display_breadcrumb_navigation
      12. suffusion_can_display_hierarchical_navigation

      If you are using a child theme, you can hook in your custom functions through these and prevent a particular widget area from being displayed.

  2. Changed Functionality
    This is mostly technical mumbo-jumbo, so you can skip this section if you are not interested.
    1. Selective removal of backward compatibility
      I have removed the following as per my previous announcement:
      1. function_exists checks for functions such as register_sidebar and dynamic_sidebar. These functions have existed since version 2.2 of WP and hence a function_exists check for these was overkill.
      2. Some other checks using function_exists have been removed, where very old WP functions were being checked for existence.
      3. A call to automatic_feed_links has been removed. This was a weird requirement, since the replacement for this function has only been available since WP 3.0, so for backward compatibility up to 2.9, I had to fall back on an older approach!
    2. Replacement with new functions
      The following functions from older versions of WP have been replaced with better/new variants, as per Theme Review recommendations:
      1. get_option("home")home_url()
      2. bloginfo("template_directory")get_template_directory_uri()
      3. bloginfo("stylesheet_directory")get_stylesheet_directory_uri()
      4. get_bloginfo("rss2_url")get_feed_link("rss2")
    3. CSS Optimization
      I have dome a good bit of CSS optimization by using a generic class for sidebars. I will be doing further optimizations to reduce CSS size in the next few releases.
  3. Bug Fixes
    1. The biggest bug fix for this release was for one that was causing the Double Right Sidebar layout to position the sidebars outside the content.
    2. Thanks to a tip from one user on the support forum, I managed to fix an unexpected bug with the Google Translator widget not working. That has now been fixed and it works as expected.
    3. There was a bug due to which disabling Suffusion’s SEO settings was not working for document titles. This has been fixed.
    4. There are a couple of rendering rendering issues on WebKit-based browsers (Safari and Chrome) that have been fixed. The first was a gap of 2 pixels between the bottom of the navigation bar items and the lower border of the navigation bars. The second was where setting the CSS max-width and min-width parameters with a fixed width layout was causing issues.
    5. Under some settings the navigation bar was not stretching across the width of the wrapper. This too has been fixed.
    6. The HTML attribute “height” has been removed from image HTML tags. This makes sure that the aspect ratio is preserved if you have a large image and it is being scaled down to fit into the dimensions of your content so that it doesn’t overflow.
    7. Another minor bug fix was where the home page wasn’t getting highlighted if it was a text link.
    8. Under certain rare cases there was a debug message showing up saying “Call-time pass-by-reference has been deprecated”. One such case was when the WP-United plugin was being used. I put in some code so that this wouldn’t happen, so hopefully this bug is now fixed.

Now for some upcoming changes. Note that these changes are quite high impact, however they haven’t been made yet.

  1. Removal of TimThumb Support
    TimThumb is the most widely used open-source PHP-based image resizing script available. But for various reasons the script doesn’t find favour with the WP theme approvers. Their requirement is that if your theme is not backwards compatible you MUST use WP’s native “post_thumbnail” feature. That would have been fine in the normal course of things, except that this is a fairly half-baked feature in WP at present. It has several shortcomings:
    1. It doesn’t apply to custom fields. So you cannot use it to have one thumbnail for an excerpt, a different thumbnail for the same post in the featured post section and yet another picture in the main content.
    2. It is not dynamic. In other words, images of a particular size are generated when a post is saved, but if you were to demand an image of a different size, you would have to first register that size, then fetch the generated image. This is a double-edged shortcoming, though. It prevents users from specifying any size they want and filling up the WP installation’s folder with all the generated images.
    3. Not being dynamic presents another challenge. Existing posts in your blog will not work without being modified specifically to work with the post_thumbnail functionality. That is a real pain.

    Nonetheless, this is something that has to be fixed, because the theme reviewers are planning to completely outlaw TimThumb in a few weeks. I am working on some alternatives, so hopefully I will have something by the next release.

  2. Moving Translations out of the Core Theme
    Suffusion has translations in 23 different languages at the time of writing this post. Though this means the theme has an excellent user base, it also means that the zipped theme file I upload to the repository is around 400KB larger than it could have been.
    So I am going to keep the translation files separate from the main theme. That would require you to download the translation that you need explicitly from this site. Luckily the translations don’t change very often, so this is mostly an infrequent annoyance. Version 3.7.1 had some translation-related changes, so I am expecting translators to post their updates. Once they do so, I will distribute them here so that you can make the update as appropriate.

That’s it for this release. Keep watching this space for the two main items I wrote about above.