Last updated:

Dragcheck Admin Rows — My First WordPress Plugin on Official Repository

dragcheck banner

Having a WordPress plugin in the official repository, and so, becoming, an author on the platform, is exciting.

You joined a community of thousands of developers, with something new to propose and to share for free to the world.

Because plugin validation is manual (a human is controlling the code quality of your project), you also proved that you can follow project standards and guidelines, and that you have a certain rigor in coding.

Since two weeks, I am developing two add-ons for a BadgeOS WordPress plugin, with the ambition to sell them. By making them premium, the doors of the WordPress repo are closed to them. You may be aware that I love Open Source projects and I share most of my code related projects for free, but sometimes, you have to earn money. To be part of the authors community, I needed another project.

For the form tables in my add-ons, I wanted to have dragcheck features, in order to make rows selection quicker. It allows you to click a checkbox and to drag the mouse to apply it’s value to the other checkboxes. It is a nice ergonomic tricks that, IMHO, strongly enhanced user experience. I also think that it will become something that the users expect to be able to do in general, as more and more softwares implement it.
After a bit of research and coding, I succeeded to do this by implementing a jQuery plugin, dragcheck by aleximplode, into my add-on.

I then realize that default Admin WordPress Tables, such as the ones we can found on Users, Medias, Posts, Pages, Comments and Plugins pages, didn’t have this feature. Nothing more needed for auto-assigning this mission to myself, and to start to code a dedicated plugin. Because it is an enhancement of WordPress behavior that could potentially be used on all WordPress installations, sharing it for free in open source was the thing to do. Nice !

As I already had a custom plugin template and already faced the most commons difficulties (implementing jQuery scripts in backend, using object oriented PHP class and WordPress hooks…), I succeeded to make it pretty quickly (a working version in 16 minutes), but you know, you start coding a simple thing, and then other ideas come to mind. These selection checkboxes are pretty small, aren’t they ? What if it would also be able to colorize the background of selected rows ?

After few tests, I decided that the most optimized way possible was to just add a class to the rows that had a selected checkbox, using jQuery. This way, anyone would be able to style the rows according to their desire (colorizing the whole background, or just the first cell, being able to have different color on different pages). I didn’t included any stylesheet in the plugin as there is a lot of ways to load custom Admin CSS (plugin, enqueued stylesheet…) and I don’t want my script to load more resources that required.

Few hours of jQuery laters it works as expected, and also worked with the Select All checkbox.

What you can do with a bit of custom CSS and my Dragcheck plugin.

It was ready for sharing, and I proposed it on Only, few hours laters, moment of truth : it was accepted !

A bit of learning on how SVN repo works, how to properly format the readme, and a bit of designing banners and icons… And then:

dragcheck plugin page
Voilà ! I made this plugin. 😀
dragcheck on add plugins page
You can install it rigth from the WordPress Add Plugins page, as any other plugins on the official repo.

I know, it is a simple plugin (no HTML, no CSS, no database calls, just a PHP page and a jQuery script), it is not as complex (and as useful) as my others plugins in development, but having the feeling to give something back to the community (who already share so many great plugins for free !), is very nice.

You can find the plugin on the WordPress Repo: Dragcheck Admin Rows « WordPress Plugins

To make the collaboration easier, I also uploaded the project on GitHub.

Thanks to aleximplode who shared its scripts for free in first place. To be honest, he does the hard job. 😀

I hope you will find this plugin useful, and don’t hesitate to leave a public review on the official repo !

Back my add-ons now. 😛