Author: Bunty ( Site Admin )

  • Comment Mention WordPress Plugin

    Comment Mention WordPress Plugin

    Now you can enable user mention functionality in post comments without using BuddyPress plugin.

    This plugin is useful for those who wanted to enable mention on their blog site.

    What this plugin does? Just type username followed by ‘@’ in comment box. It will send the email to mentioned user.

    Email setting is provided in backend. You can change email subject and content by your own.

    You can get this simple plugin from here.

  • Allow authors to preview the draft post

    In WordPress, only administrator of the site can preview of non-published posts.

    What if you want to allow preview for the author as well?

    Add code snippet from below gist to theme’s functions.php

    https://gist.github.com/BhargavBhandari90/557fd7e1155704e4f268c2016ac536c9

  • Check the largest value of autoload filed in options table

    Check the largest value of autoload filed in options table

    Below query can help you to find which field contains the largest value of autoload field in options table.

    SELECT
    option_name,
    LENGTH(option_value),
    autoload
    FROM
    wp_options
    WHERE
    autoload = 'yes'
    ORDER BY
    `LENGTH(option_value)`
    DESC
    

    NOTE: change your table prefix as per your site.

    WP-CLI:

    wp db query  "SELECT option_name, LENGTH(option_value), autoload FROM wp_options WHERE autoload = 'yes' ORDER BY  LENGTH(option_value) DESC;"
    
  • Errors were encountered while processing:

    [code language=”css”]
    dpkg: error processing package mariadb-server (–configure):
    dependency problems – leaving unconfigured
    Processing triggers for libc-bin (2.23-0ubuntu7) …
    No apport report written because the error message indicates its a followup error from a previous failure.
    Errors were encountered while processing:
    mariadb-server-10.1
    mariadb-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    2017-07-15 16:15:35,896 (INFO) ee : Oops Something went wrong!!
    2017-07-15 16:15:35,896 (ERROR) ee : Check logs for reason `tail /var/log/ee/ee.log` & Try Again!!!
    [/code]

     

    Solution:

    sudo -s
    cd /var/cache/debconf
    rm *.dat
    apt-get update && apt-get upgrade

     

    Ref: https://askubuntu.com/questions/104493/errors-were-encountered-while-processing-man-db

     

    Note: I couldn’t find the reason for that but got the solution. Anyone knows the reason?

  • Edit old commit message on github

    Edit old commit message on github

    Sometimes we make mistake in git commit message, especially spelling mistake. Even though I think twice before pressing the enter key after I write the commit message, I made spelling mistake twice or thrice. That’s my bad actually and I accept it.

    So let’s start changing old commit message from GitHub. One thing you need to note that this will edit your commit message from the particular branch only.

    Step 1: Open terminal or ( cmd for windows user ) and go to the particular repository.

     

    Step 2: run command git log

     

    Step 3: Choose a commit message which you want to change and count on which position that commit message is. Let’s say it is on 6th position.

     

    Step 4: run git rebase -i HEAD~7

    by running this message you will get output something like this:

    pick 0856faf Message 1
    pick 7ef84df Message 2
    pick 55930c2 Message 3
    pick 9bf24e0 Message 4
    pick 412fc71 Message 5
    pick 483f8b6 Message 6
    pick c101979 Message 7
    
    # Rebase 0c6220f..c101979 onto 0c6220f (7 command(s))
    #
    # Commands:
    # p, pick = use commit
    # r, reword = use commit, but edit the commit message
    # e, edit = use commit, but stop for amending
    # s, squash = use commit, but meld into previous commit
    # f, fixup = like "squash", but discard this commit's log message
    # x, exec = run command (the rest of the line) using shell
    # d, drop = remove commit
    #
    # These lines can be re-ordered; they are executed from top to bottom.
    #
    # If you remove a line here THAT COMMIT WILL BE LOST.
    #
    # However, if you remove everything, the rebase will be aborted.
    #
    # Note that empty commits are commented out
    

    Note: HEAD~7 because we want to edit 6th commit message. For a safe side, we add one more message.

     

    Step 5: Change command pick to reword , as we only want to change the commit message. Like as shown below and exit ( ctrl+X )

    pick 0856faf Message 1
    reword 7ef84df Message 2
    pick 55930c2 Message 3
    pick 9bf24e0 Message 4
    pick 412fc71 Message 5
    pick 483f8b6 Message 6
    pick c101979 Message 7
    
    ( You can edit multiple messages too. )
    

    Note: There are other options that you can do for commits. Those options you can see right below your commit message list.

     

    Step 6: After that, you will be asked to change your commit message. So edit it and save it ( ctrl+x ).

     

    Step 7: Now run git push --force origin

    ( use –force is compulsary. Otherwise there will be double commit message )

    Note: During push it will show some warnings. Ignore it as it is warning 😉 . Sit back and relax.

     

    Yepieeeeeee. Your message is changed

    If you have any issue then comment it. I will try my best to solve the issue.