I’ve recently switched our servers from Apache to NGINX. While testing our WP Form Builder Add-on, I found that my web server took pretty long time for the mail function to process, however, on the local server, everything works pretty smooth.
While digging Google, I found the solution which fixed this issue. If you are facing the same problem, follow the steps below to resolve it.
Log in to your server via SSH as root user and run the following command:
nano /etc/hosts
You will find an entry that looks like this
127.0.0.1 localhost
All you need to do is add localhost. local domain after this so it should look like this:
127.0.0.1 localhost localhost.localdomain
Press CTRL+X and then Y to save the file. Now, your server mail should process in nanoseconds.
Sometimes, a small fix with a few characters here and there can waste hours. I thought I’d share this here so that it will save some of your time.
Working on a WordPress project where the client demands all images within a post should extend and touch window borders, actually full-size images. Applying DIV with jQuery and CSS works. The wrapper has a margin of 20px on both sides and it is not possible to remove the margin otherwise, all other elements will require a 20px margin.
Sometimes server acts weird and stops some services due to any issue. I faced this issue with my iogoos.com WordPress demo sites server, where MySQL service stops after running the clean script to remove demo sites after three days. So I created a Cron Job on my GCP VM Ubuntu Droplet to check if and start MySQL service if it’s not running. I scheduled this to run the check every minute. Here’s the code and steps to set up this cron job.
NOTE: You must have ssh access to your server. GCP provides ssh access as soon as you create a droplet.
Creating Shell Script
Step 1: Open Terminal and login to your server as root via ssh.
Step 2: Create shell script file.
cd ~
nano mysqlfix.sh
This will let you create a shell script in the root directory for the root user. You can use any name as per your preferences for the .sh file.
Step 3: Write the script to check and restart MySQL and send an email alert.
#!/bin/bash
PATH=/usr/sbin:/usr/bin:/sbin:/bin
if [[ ! "$(/usr/sbin/service mysql status)" =~ "start/running" ]]
then
echo "MySQL restarted" | mail -s "Email Subject" email@domain.com
sudo service mysql start
fi
Make sure you change the Email Subject and email address.
Step 4: Once you are done with the script press CTRL + x and you will be asked to save the changes. Type Y and hit enter. You will be returned to the terminal and mysqlfix.sh file will be created in the root directory.
Step 5: Give this file executable permissions
chmod +x mysqlfix.sh
Testing the Script
Now our script is ready, let’s test if this runs fine.
Enter following commands in the terminal:
/usr/sbin/service mysql status
The terminal will print something like this: mysql start/running, process 2409
/usr/sbin/service mysql stop
This will stop MySQL service, to verify run the status command again and it will print something like this: mysql stop/waiting
~/mysqlfix.sh
This will run the script we created to check and restart the service. You should get an email with the subject and message to the email address you specified in the script.
Run the status command again and it should print mysql start/running, process ####
If everything goes well in this step, let’s create the cron job to run our script every minute.
Create Cron Job
Step 1: Installing the cron job
Make sure you are logged into your server via ssh as root, then type the following command in terminal:
crontab -e
Once you see the crontab screen type the following line at the end of this file:
*/1 * * * * /root/mysqlfix.sh
Press CTRL + x and you will be asked to save the changes, press Y and hit enter. You will see the following line in terminal: crontab: installing new crontab
Now our cron job is installed.
To test if it runs fine, Type following command:
/usr/sbin/service mysql stop
This will stop MySQL service on your server. Now you should wait for one minute and get an email with the subject and message we specified in the mysqlfix.sh file.
Today we spend most of our time online, either on our personal computers, in-office work-station and most of the time on mobile phones. Today there’s a web or mobile app for almost everything and we use almost all of them in our daily routine.
Most of the applications store our information to personalize the content as per our profile and interests. To keep our data secure and hidden from others, they provide us with a form to create a username and password.
Do you use a super-strong password or just an easy one that you can remember and someone else can guess to hack into your account?
I couldn’t believe that most internet users use one of the passwords below to keep their accounts secure.
123456
password
12345678
abc123789
I hope you are not one of these people and actually have a really strong password. However, in this article, I am going to explain an easy way to create a super-strong password that you can easily remember.
A super-strong password must be alphanumeric and must contain capital letters and special characters. Now how can we create a password that contains everything so we don’t forget and get locked down from the applications we use.
What do you think of this password?
1l^^|<nW8106
Do you think it’s a super-strong password? Can you remember this every time you are asked to punch this password?
If you think you can’t, then let me explain how this password is created and make your life a lot easier and more secure.
I Love My Kids and Wife 1981 2006
Here’s a simple line that I can remember always. Of course, I love my kids and wife, and I was born in 1981 and got married in 2006 which is why I have a wife and kids 😉
Now let’s create a password out of it:
I was replaced by 1
L is in lower case
M is replaced by ^^ (Shift + 6 twice)
n for and
W is uppercase as she’s important 🙂
81 is the YY format of my birth year
60 is the YY format of my anniversary
Combining all these characters makes this jumbled text a super-strong password.
NOTE: This is just an example and I request you, not to use this line for your password as a lot of people will read this post.
Be a little creative and think of phrases that you can not forget and try to replace the characters with symbols. Once done, do write your new password at least 10 times somewhere, and then destroy that file or paper to make sure you do remember what you have set and no one has access to it.
Now you have a super-strong password, so go on, enjoy the current technology and be SAFE. Do share this trick with your friends and family and help them avoid common mistakes and get webbed.
Recently I was updating my plugins on my local server and somehow the page got refreshed and my WordPress installation got stuck at the following message:
“Briefly unavailable for scheduled maintenance. Check back in a minute.”
You can easily bypass this message via the following steps:
On your local or web server, browse to the main installation (root) directory for WordPress.
On local if you have enabled hidden files, you will need to enable hidden files.
You will see a file named .maintenance in the root directory.
Simply delete this file to bypass the above mentioned message and you can access your WordPress dashboard and site as you normally do.
You can choose to perform the upgrades again and make sure the page should not get refreshed. If it does again follow the step again.
Explore IOGOOS uitmate WordPress Development Services
Here’s a code snippet to flatten or merge a multidimensional array. This is useful when we need to find if a value exists in any of the nodes in a multidimensional array.
I use this function in my Paid Content Packages WordPress Plugin to find out if any of the packages have any page or post assigned.
PHP Function:
function flattenArray($arrayToFlatten) {
$flatArray = array();
foreach($arrayToFlatten as $element) {
if (is_array($element)) {
$flatArray = array_merge($flatArray, flattenArray($element));
} else {
$flatArray[] = $element;
}
}
return $flatArray;
}
There are shorter versions of this function available, however, I like to use code that is clear and easy to read. Hope this helps you if you are finding a solution to this.
Once we have the list of the links, we can do whatever we want to do. In my case, I had to check if any of the links are broken on a WordPress page so I wrote a custom WordPress plugin for a client which checks first grab the links on a page and then check if the response status is 200 or 400 via wp_remote_get() call.
Another task was to find all images on a page, check the file size and if it’s large then crop the image and replace it with the new and improved version.
We can modify the above code to grab all image URLs on a page. All we need to do is change the DOM element from:
$hrefs = $xpath->evaluate( "/html/body//a" );
to
$hrefs = $xpath->evaluate( "/html/body//img" );
and
$url = $href->getAttribute( 'href' );
to
$url = $href->getAttribute( 'src' );
and we will get all the links in the src attribute of the images used on the page. Once I have the URLs, I used the PHP filesize function to determine the size and then wrote a script to crop the image, reduce file size and replace the same in its location.
I hope this code will help you if you are working on a similar task.
Since the Year 2000 or probably even a couple of years before it, the world experienced a boost in terms of economy, lifestyle, and technology due to globalization. From the technological point of view, one could easily call the years that followed ‘The Technology Age’. The technological advances made in this phase were and are still considered to be impeccable. It started with chunky mobile cellular devices, which have now been thinned out to a slice of cheese; and televisions which were huge blocks of plastic have now been utilized to the utmost even bringing out virtual reality by Artificial Intelligence.
The latest such development in this side of the world was the introduction of Artificial Intelligence to our lives. Interestingly, when we speak about Artificial Intelligence or AI, we generally think of a multi billionaire’s pe robot Jarvis, or even utterly popular OS One from the movie Her, but peeking behind these norms, one can notice intimate relations and interactions we have with AI.
Little do we care, or rather know, that our everyday lives, from waking up to reading the morning news, everything is powered through AI. In today’s day and age, the importance of cell phones overpowers any other form of inclinations we push ourselves to. Everything you see or go through on social media platforms is powered by artificial intelligence. The complex calculations form out an algorithm based on your likes and dislikes. The algorithm or the “entity” feeds on your taste, studies it, and offers you exclusive content. For example, one of the best algorithms out there, Spotify, literally feeds on your like, your music habits, and your taste to give you specially curated playlists. Even Facebook and Google maintain algorithms to understand their customer base to provide them with content, posts, and pages or news of similar interest.
Advertisements for products you like, videos based on your watch history, music based on your recent listens, social content based on your activities, everything with your intention is powered by artificial intelligence.
Artificial Intelligence to a certain extent is the fire of the modern generation. I say that because this ‘entity’ or ‘intelligence’ is not going to stop anytime soon. The interesting and at the same time, concerning thing of AI is the fact that not only is it easy for AI to read you, but also subconsciously it feeds on you to manipulate your tastes in accordance. No matter what, AI is here to stay, and who knows it might bring us bigger advancements to our livelihoods someday.
In today’s world, technological innovation happens in a short amount of time. The use of the online platform, as well as expanding visual aspects and upgrades. Today, not only SEO Experts are leading the way in terms of innovation, but website designing services appear to be providing useful high technology resources to help them enhance their businesses.
User experience has advanced considerably over the years and has risen exponentially. This industry now comprises a number of innovative tools and strategies that customers want to use to improve their industries.
Let’s check what the new web design services techniques have entered into the world of website designing:
Scrolling
Because no one wants to fix their attention on a casual swipe all the time, scrolling pretty damn comes with a deep understanding of a page. As a result, the trendiest and most popular style in web design is a scroll that is maintained to a minimum. A brief duration of browsing, on the other hand, is ideal for quickly capturing all of the available points. Today, many long-scrolling websites have been converted to use the short-scrolling technique!
Card Design
The card-styled layout is more appealing to people nowadays. Pinterest was the first to use this design. Card-styled page layouts make new waves in the online design world, and they’re also compact and convenient because they present information in little chunks. The cards appear to be content containers since they express information in the shape of a rectangle, allowing consumers to quickly grasp the idea.
Attractiveness
It is critical to make your page visually appealing in order to capture the attention of visitors. The use of high-definition visuals in web pages is the latest technological trend. Adding the piece of information and making use of photographs is also becoming more significant, and has been identified as the year’s fastest-rising trend. In addition, emphasizing the pattern with clearer and stronger hues in various forms such as typefaces, images, and animations substantially improves attractiveness.
Iconography
It is not new for web design companies to include icons on their websites, but it has become increasingly common in recent years. Now, site designers from website designing services are experimenting with a variety of large-sized icons in SVG formats, making the page look more appealing and inviting.
Animation that buzzes
The majority of today’s websites are almost expressive and imaginary. It will be quite difficult until you can tell the difference between actual and animated shapes. As we all know, web design is continually evolving, making it possible to change the website’s structure according to the preferences and needs of users. In website designing services, visual also includes the task of producing graphics that appears to be real but is not.
Designs that are responsive
It has become a necessary component of making your website design responsive. Engaging web pages are thought to fulfill the objective of developing a link between users and your company in the world of website designing services. You may provide value to the end-user by using these types of sites. Small notifications, email alerts, or a light beep are all examples designed to evaluate that can help users connect not just with your brand but also with the gadget.
Font rendering
Font Typo is efficiently heading in this direction, thanks to the reduced interfaces. Vivid, strong, and massive typography is truly ruling the web design this year since its visual appeal blends in nicely with other aspects on the page. It also has the function of communicating with visitors more specifically and making the message more understandable.
Developing Design in Small Sections
Instead of developing the complete page, professional web designers are now adopting the practice of partitioning design into discrete modules and components. These little modules outline how the site’s navigation will work and how the search function will work. It has emerged as one of the year’s most popular industry trends, to which web designers are progressively reacting.