Tag Archives: web developer agency

3 Techniques that Minimize Downtime

downtime

Since users keep on expecting a stable and reliable service, many web developers and system admin attempt to create infrastructures that are more reliable and able to minimize downtime. In fact, minimizing downtime is necessary for increasing customer satisfaction and decreasing support request. Below, we provide you with three areas that are crucial when it comes to downtime and we also offer some improvements that you can apply on them. Check this out!

  1. Monitoring and Alerts

Nothing works better than properly monitoring your infrastructure. In this way, you can discover any issues before they really appear and affect your customers.  Furthermore, monitoring infrastructure will also aggregate and retain a record of stats such as application performance metrics, and system resource utilization. So, the main purpose is to look for anything weird.

Usually a client is interacted on each host that collects metrics for monitoring, and then reports back to a central server. These metrics will be stored in a database and available for many services like searching, alerting, and graphing. Fortunately, there is software that can help you monitor your infrastructure, such as:

  • Graphite

Graphite provides an API that has the support of dozens of applications and programming languages.  On the other hand, metrics are pushed, stored, and graphed in the central Graphite installation.

  • Prometheus

To pull data from a variety of community supported and official clients, you can use Prometheus. It has an alerting system that is built-in and is highly scale able. Besides, it comes with client libraries for several programming languages.

  1. Software Deployment Improvement

Believe it or not, software deployment strategies are one area that plays an important role on your downtime. Unfortunately, many people often overlook it.

Bear in mind that having a complex deployment process will result in the production environment leaving the development environment behind. This can cause any risky software releases since every deployment is a much larger set of changes that naturally brings a much higher risk of problem arising. No wonder this process can easily lead to numerous bugs that can slow down development and cause the unavailability of resources.

Therefore, the best solution for this situation is to set up some up-front planning. In order to sync your production environment with your development environment, you have to figure out a strategy that allows you to automate the workflow, code integration, deployment, and testing.

Here are some best practices regarding the continuous integration and delivery (CI/CD) and testing the software that help you start automating deployments:

  • Maintaining a Single Repository

To make sure that every person on the development team works on the same code and can test their changes easily, you can maintain a single repository.

  • Automating Testing and Build Processes

Don’t forget to automate your development and testing as this will simplify deployment in an environment similar to the final use-case. Besides, you will find it helpful, especially when debugging platform-specific issues.

  1. Implementing High Availability

Another strategy that you can apply to minimize downtime is to use the concept of high availability on the infrastructure which includes principles used in designing resilient and redundant systems.

In this case, the system should be able to detect and analyze the health of the system; it has to know precisely where the error is located. Furthermore, the system must be able to redirect traffic as this can help minimize downtime through reducing interruption.

In order to upgrade to a highly available infrastructure, you have to move to multiple web servers and a load balancer from a single server. The load balancer will show you regular health checks on web servers and routes traffic from those servers that are failing.

Moreover, you can also add resilience and redundancy to increase database resilience using database replication; surely, you will find different database models on different configurations of replication. However, many believe that group replication is the most interesting one, as you can read and write operations on a redundant cluster of servers. In this way, you can detect any failing servers and routing done to prevent downtime.

In conclusion, there are three areas that can lead you to less downtime. If you truly put attention on them, you will have happier clients and of course this will lead you to more revenue.

How to Automate WordPress Plugin Testing Using Codeception

Many web developers get excited and thrilled at the same time when it comes to releasing a new update to one of our plugins. They are excited since there are more features and improvements to be delivered to customers, yet, this also means starting of another round of manual and rigorous release testing. Therefore, you should know the best way to improve this testing process and one option is automation. In this article, you can reveal how to implement it, so make sure that you read all of the sections in this article.

Release Testing Relay
Since there is a 3-person testing relay, usually we approach release testing. You have to ensure that your current set up involves a Google spreadsheet for each product with worksheets for each of the plugins and addons. Each sheet has lots of test scripts to perform, covering the functionality and edge cases for the plugins.

The first person will run the scripts and look for any issues. If an issue is found, then the test is considered as a fail and raised on GitHub to be fixed. Once the first person has finished and the issues have been fixed, the next person in the relay can start their round of testing. This process will be continued and repeated until there are no bugs found. Hence, this test will surely take lots of time and cost.

The testing process above includes unit tests that use PHPUnit and run by Travis Cl every time code is pushed to our GitHub repositories. Even though it is highly automated and able to catch issues with code before the release testing stage, we still need real people to test it, as unit testing is only a small part of the big testing puzzle.

Codeception
Codeception is better known as a behavior-driven testing framework that automates acceptance, functional, and unit testing. Similar to Behat, codeception is also written in PHP, the test is clear and very descriptive.

Although there are only some elements that can be clicked and it doesn’t handle JavaScript interactions, by using the WebDriver module, your acceptance tests can be run.

Installation
At the first time, you may find that setting this up can take much time, but after it ends, you will discover that writing tests is so much faster.  Like PHPUnit, we have Codeception installed in our repository using composer:

Aside from that, we also install WPBrowser, a set of WordPress extensions for Codeception. This extension provides helpful methods allowing the test ‘actor’ to interact easily with a WordPress site.

Environment
It is better for you to roll your own bash script to set up everything needed to run your acceptance tests, instead of using the WPBrowser’s WPLoader module to set up the test WordPress site. The script applies WP-CLI and includes:

  1. Installing WordPress in a tmp directory inside your repo (.gitignored of course)
  2. Build your plugins from source and install them on the site
  3. Download either PhantomJS or Selenium and fire it up to be used by the WebDriver module.
  4. Run Codeception tests
  5. Shut down PhantomJS or Selenium
  6. Kill any Firefox instances

Installation
You can find more requirements for the projects with detailed installation steps in the README.md. After everything is installed, you can fire up the test by running sh run-tests.sh.

The Scenario
The main test file, known as a ‘cept’ is a file that contains all the steps and assertions for a given scenario. The scenario is to test the core functionality of WP offload S3 Lite – upload a file to the WordPress Media Library and make sure that it gets offloaded to S3:

The steps are very understandable and show clearly the process that show what an actual tester would do, such as login, add a file to the media library, ensure that the URL is rewritten to an S3 URL, then check with AWS to find out if the file has been uploaded.

In conclusion
As it is stated above, you will need a hard work to get this all set up. Remember that the scenario above only for a single site install of WordPress. Therefore, a custom database module for Codeception is needed to make switching between databases and installs during testing as convenient as possible.

You also require script maintenance as code and product usability changes over time. Hence, the best solution is to replace two out of the three of your human testers with automated tests using Codeception. This will surely give more advantages to your release testing process.

7 Common On-Site Search Mistakes and How to Fix Them

Common-On-Site-Search-Mistakes-and-How-to-Fix-Them_ywf

Search function is necessary in any website; therefore, you need to be more careful as search function could be damaging your conversion rates. However, when it is well optimized, you can enhance the search function, the usability and enjoyment of your site. As a web developer, you surely want more users enjoy your site, right? Learn how to optimize on-site search and avoid the common mistake that may occur.

It isn’t Visible
First, make sure that your search form isn’t invisible. Creating a search form that is hard to find will frustrate your users. So, ideally your search bar should be located near to the top and left side, the closer, the better. While the search box might not be the first thing that users will see, but you need to be smart to know where you can place it. The right location should be within normal reading patterns.

It isn’t Easy
Anything that places an obstacle between your user and completing their search detracts from its accessibility. So, make sure that any text would disappear once the user starts typing. On the other hand, it is important to increase the accessibility of your search bar include cosmetic changes like color use and text readability. Then, make sure they are sharp and contrasting.

Auto-Suggestions Aren’t Provided
With auto-suggestions, you can speed up the search process significantly for the user, especially if you offer multiple models or versions of a core product. In fact, the less time users must spend typing in their query, the longer they can spend engaging with the content they’re trying to find.

The 404 Isn’t Helpful
You can maximize the usage of 404 pages. It can be useful and beneficial for your users. For instance, you can place links to main directories, offer suggestions for reworking the search query, or direct them to your contact page. The point is to offer solution or answer to your users.

Results Aren’t Straightforward
It is important to create familiar and dressed down search result pages. Hide the bells and whistles of your engine under an advanced search link and, if possible, have the search menu expand without leaving the page. Make sure that the search results landing page is easy to read on first pass, providing legible, plain fonts, and clean composition so that results can be assessed individually.

Filters and Sorting Methods are separated
Since users don’t want to perform any additional work, ensure that sorting options, such as date, popularity, and etc. can be accessed from the same page. Place the options on the top left corner at the start of the search results to increase visibility.

No Search Variation
Always provide your users with variation search results. For example, when a user types “black dress”, you can offer them with alternative search query options and results (such as “black” and “dress”) in separate sections.

By this way, Google can provide closest equivalent, even if you don’t have the product or information they’re looking for. Providing something close, even if not exactly what they searched is more beneficial than an empty results page.