WordPress | Dmytro Shteflyuk's Home https://kpumuk.info In my blog I'll try to describe about interesting technologies, my discovery in IT and some useful things about programming. Tue, 08 Sep 2015 00:38:55 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 Weekly Link Dump #1 https://kpumuk.info/links/weekly-link-dump-1/ https://kpumuk.info/links/weekly-link-dump-1/#comments Mon, 14 Sep 2009 09:48:01 +0000 http://kpumuk.info/?p=971 This is a first link dump in this blog, where I will list all interesting links that I have found in Internet. I plan to post link dumps once a week, so stay tuned to read most useful stuff with no effort. Todays topics are: organizing your CSS, top mistakes made by WordPress plugins authors, […]

The post Weekly Link Dump #1 first appeared on Dmytro Shteflyuk's Home.]]>
This is a first link dump in this blog, where I will list all interesting links that I have found in Internet. I plan to post link dumps once a week, so stay tuned to read most useful stuff with no effort. Todays topics are: organizing your CSS, top mistakes made by WordPress plugins authors, ways MySQL uses indexes, and the git version control advantages over the Subversion.

Beautiful CSS: Organizing Your Stylesheets

When I first took the plunge into CSS several years ago, one of my biggest frustrations was stylesheet organization. I scoured source code from popular sites trying to figure how they accomplished various layout effects. But tracking back and forth from stylesheets to HTML proved to be a difficult task. Unfortunately , that separation of style and content that makes CSS so awesome can also make it difficult to understand. Adding to that difficulty is the fact that each designer may have a different way of organizing stylesheets. If you inherit someone else’s site, this can cause some problems. In a perfect world everyone’s CSS would be well-organized, easy to scale, and easy to understand. We may not be able to attain such CSS Nirvana but we can at least make it easier on ourselves and those we work with by following this set of guidelines.

A nice article about organization of your CSS code. Author recommends to split your CSS code to several sections (universal styles, library styles, template layouts, individual page styles.) Also he proposes to indent styles related to nested HTML elements.

Top 10 Most Common Coding Mistakes in WordPress Plugins

As promised, I’m going to share a list of the most common mistakes, errors, misunderstandings, bad habits or wrong design decisions I’ve encountered while reviewing all these 43 plugins. Some are highly critical stuff (I’ve contacted 3 plugins authors after finding serious security holes in their plugin), some are more potential annoyances than real bugs, or are just causing a waste of server resources that could be avoided, but all have something in common: they’re trivial to fix. I’ve classified them in two parts: 10 bad code signs, plus a bonus with design decisions that suck. If you consider yourself a semi experienced coder or better, be sure to skip this article, you’re not going to learn a thing.

A comprehensive list of common pitfalls of WordPress plugins authors. If you maintain a plugin, please read this article carefully, most of mistakes are quite common (yes, I found several issues with my ones

3 ways MySQL uses indexes

I often see people confuse different ways MySQL can use indexing, getting wrong ideas on what query performance they should expect. There are 3 main ways how MySQL can use the indexes for query execution, which are not mutually exclusive, in fact some queries will use indexes for all 3 purposes listed here.

You should read it. Period! Article covers all ways how MySQL uses indexes: filtering rows, sorting data, and reading data.

Why You Should Switch from Subversion to Git

You may have heard some hubbub over distributed version control systems recently. You may dismiss it as the next hot thing, the newest flavor of kool-aid currently quenching the collective thirst of the bandwagon jumpers. You, however, have been using Subversion quite happily for some time now. It has treated you pretty well, you know it just fine and you are comfortable with it – I mean, it’s just version control, right?

Yet another article about git and what features make it so wonderful tool for any developer. Author covers main features of this version control system, and explains how it could improve your work and boost your productivity. Hey Subversion (SourceSafe, CVS, etc) users, I do not accept any excuses, you definitely should read it. Yes, right now!

The post Weekly Link Dump #1 first appeared on Dmytro Shteflyuk's Home.]]>
https://kpumuk.info/links/weekly-link-dump-1/feed/ 1
CodeColorer updated to version 0.5.1 https://kpumuk.info/wordpress/codecolorer-update-to-version-051/ Sun, 01 Apr 2007 14:29:37 +0000 http://kpumuk.info/wordpress/codecolorer-update-to-version-051/ Right after publishing my previous post about WordPress plugins updates, I found that GeSHi library has been updated, therefor I have updated CodeColorer too. From GeSHi news: This release adds a couple of new languages, X++ and Rails, and fixes a few bugs in other languages. Ruby support is improved also. Here is the example […]

The post CodeColorer updated to version 0.5.1 first appeared on Dmytro Shteflyuk's Home.]]>
Right after publishing my previous post about WordPress plugins updates, I found that GeSHi library has been updated, therefor I have updated CodeColorer too.

From GeSHi news:

This release adds a couple of new languages, X++ and Rails, and fixes a few bugs in other languages. Ruby support is improved also.

Here is the example of Rails syntax highlighting:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class User < ActiveRecord::Base
  include AccessManager
 
  attr_accessible :email, :first_name, :last_name, :country, :birthday, :home_page, :preferred_name

  has_many :videos
                         
  validates_presence_of :login, :role, :email
  validates_format_of :email, :with => /^[^@]+@.+\..+$/
  validates_presence_of :password :if => :validate_password?
  validates_length_of :password, :in => 5..100, :if => :validate_password?

  def initialize(attributes = nil)
    super
    @new_password = false
  end
 
  def self.authorize(login, password)
    User.find :first, :conditions => ['(login = ? OR email = ?) AND password = ? AND is_active = 1', login, login, password]
  end
 
  protected
 
    def validate_password?
      @new_password
    end
end

Let’s update!

The post CodeColorer updated to version 0.5.1 first appeared on Dmytro Shteflyuk's Home.]]>
WordPress plugins updates https://kpumuk.info/wordpress/wordpress-plugins-updates/ Sun, 01 Apr 2007 14:29:48 +0000 http://kpumuk.info/development/wordpress-plugins-updates/ Today I finished reorganization of my blog and now all my WordPress plugins moved to separate page. Check it if you are using my plugins in your blog. In this post I’ll describe which plugins I have at this moment. sCategory Permalink Plugin allows to select category which will be used to generate permalink on […]

The post WordPress plugins updates first appeared on Dmytro Shteflyuk's Home.]]>
Today I finished reorganization of my blog and now all my WordPress plugins moved to separate page. Check it if you are using my plugins in your blog. In this post I’ll describe which plugins I have at this moment.

sCategory Permalink

Plugin allows to select category which will be used to generate permalink on post edit page. Use custom permalink option %scategory% on Options/Permalinks options page. Current version is 0.2.1. more »

CodeColorer

CodeColorer is the plugin which allows you to insert code snippets into the post with nice syntax highlighting. Current version is 0.5.0. more »

Ad Rotator

This widget is intended to display random HTML code from a given group of HTML-chunks on sidebar. Basically it shows different HTML every time you requesting page. Current version is 1.0.1. more »

The post WordPress plugins updates first appeared on Dmytro Shteflyuk's Home.]]>
WordPress Plugins: sCategory Permalink – select category for permalink generation https://kpumuk.info/wordpress/wordpress-plugins-scategory-permalink-select-category-for-permalink-generation/ https://kpumuk.info/wordpress/wordpress-plugins-scategory-permalink-select-category-for-permalink-generation/#comments Sat, 18 Nov 2006 09:12:39 +0000 http://kpumuk.info/projects/wordpress/wordpress-plugins-scategory-permalink-select-category-for-permalink-generation/ I’m starting publishing custom WordPress plugins used in this blog, and today it will be “sCategory Permalink”. I like permalink option of WordPress %category% (and using it here), but it has one great limitation – when this option is selected, WordPress uses category with lowest ID for permalink generation! Just imagine following scenario: you have […]

The post WordPress Plugins: sCategory Permalink – select category for permalink generation first appeared on Dmytro Shteflyuk's Home.]]>
I’m starting publishing custom WordPress plugins used in this blog, and today it will be “sCategory Permalink”. I like permalink option of WordPress %category% (and using it here), but it has one great limitation – when this option is selected, WordPress uses category with lowest ID for permalink generation! Just imagine following scenario: you have category “Development” (common for all posts related to software building), and several specific categories, for example “PHP”, “AJAX”, “JavaScript”. You have Development category ID greater than any of other categories IDs, therefor specific categories used for URL generation. But one day you decided to start learning Ruby on Rails and post about this in your blog. It’s the problem, because when you will create category “Ruby on Rails”, its ID will be greater then ID of “Development”. Now you have to take decision: to abandon posting in both categories at the same time, or to update “Development” category ID. Lastest can be done in two ways: remove category from WordPress administration area and re-add it (and then you need to go through all of your posts and add needed to this category), or update ID in database (there are several tables related on category ID). But now you can relax! Just download and install plugin!

Installation

  1. Download and unpack plugin files to wp-content/plugins/scategory_permalink directory.

  2. Enable “sCategory Permalink” plugin on your Plugins page in Site Admin.

  3. Go to the Options/Permalinks page in Site Admin and use %scategory% option in Custom text field (you can look here for other options). In this blog I’m using /%scategory%/%postname%/.

  4. Now on Write Post page near the categories checkboxes radio button will appear:
    sCategory Permalink
    Select radio button near category which will be used in permalink.

  5. Have fun!

Download

You could always download latest version of the plugin here.

The post WordPress Plugins: sCategory Permalink – select category for permalink generation first appeared on Dmytro Shteflyuk's Home.]]>
https://kpumuk.info/wordpress/wordpress-plugins-scategory-permalink-select-category-for-permalink-generation/feed/ 17
WordPress Widgets: Ad Rotator https://kpumuk.info/wordpress/wordpress-widgets-ad-rotator/ https://kpumuk.info/wordpress/wordpress-widgets-ad-rotator/#comments Mon, 01 May 2006 13:16:23 +0000 http://kpumuk.info/wordpress/wordpress-widgets-ad-rotator/ Automattic has released fine plugin for WordPress — WordPress Widgets which can be used to personalize your blog without knowing HTML. You don’t need to edit your WordPress theme at all! Just choose required widget, drag and drop it to sidebar. There are many widgets already created by different developers which you can use on […]

The post WordPress Widgets: Ad Rotator first appeared on Dmytro Shteflyuk's Home.]]>
Automattic has released fine plugin for WordPress — WordPress Widgets which can be used to personalize your blog without knowing HTML. You don’t need to edit your WordPress theme at all! Just choose required widget, drag and drop it to sidebar. There are many widgets already created by different developers which you can use on your blog.

I failed to find widget which can get several chunks of HTML code and show one of them on sidebar therefor I decided to create it myself. You can download Ad Rotator plugin, then you need to unpack, copy adrotator.php to your BLOG_DIR/wp-content/plugins/widgets/ directory and activate it on Plugins page.

You can see the sample on this blog: there are several of my favourite books from Amazon on sidebar, and only one of them is shown at time.

Edit window looks like following:

Ad Rotator edit window

You can enter title of the your widget, and HTML-code to display. Different chunks are separated with <--more--> code.

Download

You could always download latest version of the plugin here.

The post WordPress Widgets: Ad Rotator first appeared on Dmytro Shteflyuk's Home.]]>
https://kpumuk.info/wordpress/wordpress-widgets-ad-rotator/feed/ 49