• This plugin is perfect for keeping any CSS you add to your site out of your theme. For those that don’t know, if you add custom CSS into the ‘custom CSS’ box found in many theme options panels, you will lose all of that customization when you switch to a different theme. With this plugin that doesn’t happen: all of your customizations remain.

    Was a little surprised the CSS is added to the head instead of the plugin creating a a custom.css file. But, after thinking about it, I think this is the better way to handle it since it is one less file to pull across the wire.

    I have not yet checked to see if the plugin cleans up after itself, or if it leaves anything behind in the database. Maybe John can respond to that? Otherwise, I’ll delete it and check the database to see.

    My only other suggestion would be offer a check box that allows the user to give the developer and plugin recognition by adding a comment to the injected CSS, like /* added using Simple Custom CSS plugin by John Regan */. Some people might not like it, and others may like to help get the word out.

    Thanks for making this and keeping it lightweight.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Regan

    (@johnregan3)

    Thanks @tristandenyer!

    I printed the CSS to the header to ensure it superceeded any other styles. Admittedly, I’m not a huge fan of doing that. I like to keep things nice and neat. I thought about creating a psuedo-css file (called something like style.php) which would echo the styles into using PHP, but that would require seeking out wp-load.php in that file, which would add an extra load on the site.

    However, I think I’ve found a work-around. I’m looking at dynamically creating a psuedo-stylesheet that will be enqueued like a stylesheet, and show up in the Page source as a link to a css file (e.g., <link rel=”style.css” />), but it will actually be generated within the single PHP file this plugin includes–it still will not create another file. I’ll probably release that within a week or so. I won’t affect any settings that already exist, it will just be a cleaner way to apply the CSS.

    I opted to not delete the Options field on deactivation because I know sometimes people deactivate plugins when they’re tracking down bugs, and if you’ve done a lot of work on your CSS, it would be a bummer to lose it all. I figure it’s just one options field, with (typically) a lightweight level of content. I’ve seen plugins use a checkbox that says “delete all data from database when deactivated.” I might try that.

    Thanks for the idea about adding the option to add credit to the CSS. I wasn’t sure if that kind of thing would be a bother or not. I want to be careful that I keep the “Simple” in “Simple Custom CSS.” ??

    I really appreciate the input. It really helps me out. I want to make Plugins that people love!

    Thread Starter tristandenyer

    (@tristandenyer)

    Cool. I think handling the CSS would be good either way. In my reviews I just like to mention the details I find in plugins/programs that others may want to know before installing it.

    I think adding a credit is the price one should pay for a free plugin. You could still make it optional, but seriously, you a lot of spent time on this and all I did was click a few buttons and type a couple lines to get the benefits of it. A small credit line that is viewed mostly by devs and bots is worth it to me.

    I think keeping the options field in the database on deactivation is a wise choice. I was just thinking that on deleting the plugin a clean-up script would be nice. It’s not much data, but it’s still data. The checkbox opt-in-to-delete idea would be awesome, and is something I think WP should consider as a feature required for all plugins: opt-in to have the plugin clean up after itself, or leave the data in place.

    Thanks again! It really is simple. And if you made zero changes to it, it would still be awesome and very useful.

    Plugin Author John Regan

    (@johnregan3)

    Ha! Thanks for bringing this up. I hate to admit it, but I didn’t know register_unistall_hook() existed. I thought there was only activation and deactivation hooks. I’m going to add this to the next version!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Super lightweight, works great’ is closed to new replies.