Skip to content

WordPress hack: Show all active plugins

    For maintenance or any other purposes, you might want to be able to know what plugins are currently active on a specific WordPress install. Here’s a handy snippet to get a list of active plugins in a matter of seconds. Simply paste this code where you want to display the active plugin list. Once saved, active plugins will be displayed. function wpr_active_site_plugins() { $the_plugs = get_option(‘active_plugins’); foreach($the_plugs as $key => $value) { $string = explode(‘/’,$value); // Folder name will be… Read More »WordPress hack: Show all active plugins

    WordPress shortcode to display user registration date

      If your site offers the possibility for users to register, you might at some point want to be able to display users’ registration date. Here’s a super simple code snippet to create a WordPress shortcode that will display registration date of a specific user. First, place the code below into your theme’s functions.php file and don’t forget to save. function wpb_user_registration_date($atts, $content = null ) { $userlogin = shortcode_atts( array( ‘user’ => FALSE, ), $atts ); $uname = $userlogin[‘user’]; if… Read More »WordPress shortcode to display user registration date

      WordPress tip: How to display a disclaimer on posts older than one year

        When you’re blogging, it can be a good idea to display a warning to your visitors stating that they are currently reading an old post which might not be up to date. Here’s an out-of-the-box solution to do it. Paste the following code in your single.php file, within the loop. Edited the text on line 7 as desired. <? $ageunix = get_the_time(‘U’); $days_old_in_seconds = ((time() – $ageunix)); $days_old = (($days_old_in_seconds/86400)); if ($days_old > 365) { echo ‘<div class=”disclaimer”>DISCLAIMER: this post… Read More »WordPress tip: How to display a disclaimer on posts older than one year

        close-comments

        Inform user about automatic comment closing time

          To prevent spammers from flooding old articles with useless comments you can set WordPress to close comments after a certain number of days: It might be surprising for some users if the comments are closed automatically so it might be a good idea to inform them about the remaining time. add_action( ‘comment_form_top’, ‘topic_closes_in’ ); function topic_closes_in() { global $post; if ($post->comment_status == ‘open’) { $close_comments_days_old = get_option( ‘close_comments_days_old’ ); $expires = strtotime( “{$post->post_date_gmt} GMT” ) + $close_comments_days_old * DAY_IN_SECONDS; printf(… Read More »Inform user about automatic comment closing time

          How to Test the Security of Your WordPress Site

            WordPress continues to be one of the most popular content management systems, claiming over 58% of the market share as of January 2017. However, this popularity also makes WordPress sites an attractive target for hackers. According to website security firm, Sucuri, 75% of all websites hacked in the first quarter of 2016 were built on the WordPress platform. Due to these statistics, many have criticized WordPress as being an insecure platform, but this is not actually the case. WordPress in… Read More »How to Test the Security of Your WordPress Site

            How to set up an affiliate site with wordpress

            How to Set up an Affiliate Site and Make Money With Your WordPress Site

              You’ve probably heard about the big name bloggers making tens of thousands of dollars every month with their website, but how exactly do they make their money? There are various ways you can make money from a website without physically selling products, but one of the most lucrative and easiest methods is by including affiliate links in your content. Affiliate links are links to products or services on another site that include a special tracking code so that a website… Read More »How to Set up an Affiliate Site and Make Money With Your WordPress Site

              How To Serve Legacy Code Only To Legacy Browsers

                While effective bundling of resources on the web has received a great deal of mindshare in recent times, how we ship front-end resources to our users has remained pretty much the same. The average weight of JavaScript and style resources that a website ships with is rising even though build tooling to optimize the website has never been better. With the marketshare of evergreen browsers rising fast and browsers launching support for new features in lockstep, is it time we… Read More »How To Serve Legacy Code Only To Legacy Browsers