WordPress is arguably the most popular content management system on the web. According to Forbes, over 60 million websites globally are powered by it. Numbers like this show that WordPress is no doubt a leading contender when it comes to Content Management Systems (CMS). A major attraction of WordPress is its large pool of plugins. Want to build an eCommerce store? There’s WooCommerce. How about a job portal? There’s WP Job Manager. In this tutorial, we will learn how to build a plugin that counts the number of times users log in to a WordPress powered site with the login stats displayed in a custom column in user list page. Plugin Development The majority of files in a WordPress plugin consist of PHP files, located in /wp-content/plugins/ directory. In our example, the file will be called wordpress-login-count.php. I assume you’re comfortable with connecting to your server using FTP/SFTP/SCP or SSH. If you want to follow along, create the plugin PHP file wordpress-login-count.php. The complete plugin will be available for download at the end of this tutorial. First off, include the plugin header. Without the header, WordPress will not recognize the plugin.
Share This