Fixed: Sorry, this file type is not permitted for security reasons

The main reason behind this error in WordPress is more straightforward than it might seem. We can not know it, but WordPress has restrictions on the some types of files we can upload. The error "Sorry, this file type is not permitted for security reasons."  appears when we try to upload a prohibited file type like .svg, .svgz, .docs etc.

We can fix this issue using following methods:

1. Modify file types using a Plugin: There are several plugins capable of enabling you to upload prohibited file types, such as File Manager and Enhanced Media Library.

2. Use the upload_mimes filter by editing theme's functions.php file and paste below code:
function av_custom_mime_types( $mimes ) {
// Add new new allowed mime types
$mimes['doc'] = 'application/msword';
$mimes['svg'] = 'image/svg+xml';
$mimes['svgz'] = 'image/svg+xml';

// You can remove any particular mime type (Optional)
unset( $mimes['exe'] );

return $mimes;
add_filter( &…

Show loader image and disable page/section while waiting for ajax request

Show loader image and disable page or div section while waiting for ajax request.
Use below example code:

<!-- Image loader -->
<div id="loader" class="ajax_loader" style="display: none;">
  <img src="images/ajax-loader.gif" width="32px" height="32px" />

type: 'POST',
url: 'URL',
dataType: 'json',
data: user,
beforeSend: function(){
//Put your logic after success

Note: Include jquery.js before use above js

.ajax_loader{ position:absolute; width:100%; height:100%; left:0; top:0; background:rgba(0,0,0,.5);}
.ajax_loader img{ position:absolute; left:50%; top:50%;}

Fixed: this is incompatible with sql_mode=only_full_group_by in MySQL

When you execute a query having GROUP BY against a database in MySQL you could have encountered the error "this is incompatible with sql_mode=only_full_group_by” in MySQL". Below are the steps to fix the issue.

1. Edit MySQL configuration
sudo nano /etc/mysql/conf.d/mysql.cnf

2. Append below code and save and exit

3. Restart MySQL server
sudo service mysql restart

Nested promises in node.js

In node.js promises give you return statements and error throwing, which you lose with continuation passing style.
var createJob =  function(jobData){
    console.log('Job data should not be empty!');
let jobData = [];
let location = "San Francisco, CA California, US";
let locationArr = location.split(',');
let stateName = locationArr[1].trim();
let country = locationArr[2].trim();
  jobData['countryID'] = (countryID>0 ? countryID : null);
  getStateID(stateName,countryID).then( function (stateID){
jobData['stateID'] = (stateID>0 ? stateID : null);
return jobData;
function(error) {

function getCountryID(countryName){
  var promise = new Promise(function(resolve, reject) {
//You can write here your logic
resolve( 25 );//countryID
  return promise;   

function getStateID(stateName,countryID){
  var promise = new Promise(funct…

Convert array to string comma separated in JavaScript

You can use JavaScript Array toString() Method

var arrTags = ['Software Development and Engineering','Information Technology','Data Science and Analytics'];
var strTags = arrTags.toString();
OutPut: Software Development and Engineering,Information Technology,Data Science and Analytics

Add and use wow.js into WordPress theme

1. Download animate.min.css and wow.min.js from github (
2. Create a subfolder in your theme / child theme called css
3. Place animate.min.css there.
4. Create a subfolder in your theme / child theme called js
5. Place wow.min.js there.
6. Add the following lines to your theme / child theme's functions.php file

//* Enqueue WOW.js Animate.CSS and

function zeal_enqueue_scripts() {
wp_enqueue_style( 'wow-css', get_template_directory_uri(). '/css/animate.min.css' );
wp_enqueue_script('wow-js',get_template_directory_uri().'/js/wow.min.js', array(), '',true);
add_action( 'wp_enqueue_scripts', 'zeal_enqueue_scripts );

7. Add below JavaScript code before </body> tag to theme's footer.php

<script type="text/javascript">
var wow = new WOW({
boxClass:     'wow',      // animated element css class (default is wow)
animateClass: 'animated', // animation css class …