Posted on Leave a comment

Fixing Image Upload Issues in WordPress

One of the prevalent issues in WordPress is the image upload issue. Fortunately, it is quite easy to fix. Follow this article to the end to find out how.

Change file permission for upload folder

When your media gallery displays blank, here is a way to fix it.

Access WordPress files using the FTP. Locate wp-content; open the “Uploads” folder; right-click on it and choose File Permissions. Then set the number to 744; mark “recurse into subdirectories”, select “Apply to directories only” and click OK. Afterward, reload your library and try uploading an image. Note that in some cases, setting to 744 may not work; therefore, you can repeat the process but set the permission to 755.

Resize and Rename Image OR Increase Max file size

If you are unable to upload one image while others upload properly, there are two quick fixes for this. If it’s because of the image size, that means you need to resize the image. Also, you may need to increase the max file size.

Meanwhile, it may also be due to the name of the image as WordPress doesn’t allow special characters like ($, &, #, *, …); in that case, you will need to rename the image.

Increase the memory limit or Set Thread to on Processor

If you see an HTTP error when uploading an image, increasing the WordPress memory limit or setting an image processor to use one Thread can help fix the issue. To increase the WordPress memory limit, access your site with FTP; open the folder containing the WordPress files and locate wp-config to input the code: define(‘WP_MEMORY_LIMIT’, ‘256M’)

Other Solutions

The other solutions you can try include:

  1. Use your browser uploader for your image. In your WordPress dashboard, go to Media > Add New and click browser uploader.
  2. Clear browser and WordPress cache.
Posted on Leave a comment

How to Fix “Error 404 Not Found” in WordPress

Error 404 Not Found is one of the most frequent errors in WordPress. It happens majorly when you navigate from the Homepage to another page of your website. If you get this error, you can fix it in three ways as discussed below:

Reset Your WordPress Permalinks

To reset your WordPress Permalinks, you need to change it temporarily to default and thereafter change it back to your previous permalinks.

Access your WordPress Dashboard; go to Settings > Permalinks; select Default settings and click Save Changes. Afterwards, you can go ahead to select previous permalinks type and save your changes once again. Now, reload the pages that initially brought up the error to see if the issue has been fixed.

Modify .htaccess

If the error still persists, you need to edit the .htaccess file. This can be done by accessing the file through FTP. All you need do is to navigate to your WordPress root folder and look for the .htaccess file. Right click on the file and select View/Edit. Replace the code with the one provided below.

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# End WordPress

Disable WordPress Themes and Plugins

If the second method still doesn’t solve the issue. You may need to disable your WordPress themes and plugins. To do this, access your dashboard; go to Plugins > All Plugins and follow the process below to disable the plugins. For each plugin, click Deactivate and check the site to see if error 404 has disappeared. If the error still persists, re-activate the plugin you disabled and move on to deactivate the next one. Repeat the process till you find the plugin responsible for the problem or till you are done with all the plugins.

If you don’t have access to your dashboard, you can use FTP to locate the plugins and themes’ folders in the public_html/wp-content directory. Open the plugin folder and rename the folders in there; this will disable each of the plugins. Do the same for the themes’ folder.

Posted on Leave a comment

What Types of Testing are Useful for WordPress?

For any application or system that will be put to use, there is a need to first carry out a test. In fact, this is a fundamental axiom and it is true in all ramifications. When it comes to WordPress, the different types of tests have consistently increased over the years. Therefore, this article will discuss the various testing types that can be utilised for WordPress.

What is Testing in Web Development?

Testing is the use of various tools or means to make sure that changes to your code or website are working as expected. 

Testing Types

To ensure that the changes you make to your code work very well, there are several testing types that you can use. Each type of testing has its features, advantages, as well as its  disadvantages. However, in this article, we have covered the testing types most suitable for WordPress.

Manual or Automated Types

Manual testing is done by an individual clicking through the application or interacting with the software and APIs with the appropriate tools. It is costly as it requires someone to set up an environment and execute the tests themselves, and it is prone to human error because the tester can omit steps in the script or make typos.

Automated tests are more robust and reliable than manual tests. They are carried out using a machine that executes a test script already written, meaning that the quality of your automated tests largely depends on how well the test script has been written.

Automated testing is a crucial component of continuous integration and continuous delivery, and it’s a great way to scale your application as you add new features to it. But one can not underestimate the value in doing some manual testing.

Now lets, zoom into specific kinds of testing;

Unit Testing

Unit testings are very low-level tests, close to the source of your application. They consist of testing specific methods as well as functions of the classes, modules or components used by your software. Unit tests can be run quickly using a continuous integration server, and they are generally cheap to automate.

Unit testing is useful for WordPress core and Plugin Development. This is possible because the goal of unit testing lies in the actual code and module components of development. It is an essential testing done by developers. In more precise terms, Unit testing can be seen as a foundation for all other tests.

Integration Testing

Integration tests help in verifying that the services and modules used by your application are working together as expected. For instance, you may be testing the interaction with the database or trying to make sure that microservices work well together. Integrated tests are generally expensive to run as there is a need to have multiple parts of the application up and running. 

The relevance of Integration testing in WordPress is significant; however, since it’s expensive, the bulk of integration testing is done by the WordPress community, usually from the source of development. 

Functional Testing

Functional tests have a direct focus on an application’s business requirements. The tests only verify the output of action and never check the system’s intermediate states when performing the action.

Although both functional and integration tests require interaction between multiple components of the application, there is a difference between them. While an integration test will verify that you can query the database, a functional test would expect to have a specific value from the database clearly defined by the product requirements.

End-to-End Tests

End-to-end testing replicates a user behaviour with the software in a complete application environment. The tests verify that different user flows work as expected. This can be as simple as loading a web page or logging in or much more complex scenarios checking email notifications, online payments, etc.

End-to-end tests are handy, but they’re expensive to perform and can be hard to maintain when they’re automated. It is recommended to have a few critical end-to-end tests and rely more on low-level types of testing (integration and unit tests) to identify breaking changes quickly.

Similar to system testing, End-to-End Testing involves testing of the complete application environment in a way that mimics real-world use, such as using network communications, interacting with a database, or interacting with other hardware, applications, or systems if appropriate.

At this juncture, we must emphasise that Functional testing is the same as End to End testing for us. This checks that the whole software is working. Some may even categorise this as System testing.

Why not Do Everything with End-to-End Testing?

Well, the downside to this is that it is too slow and not cost-effective. Therefore, for a large project, it might take too much time and money. However, for small projects, it is sufficient.

Other Testing

For the essence of completion, here is a list of other testings that may be useful in WordPress;

  • Performance Testing
  • Load Testing
  • Security Testing
  • Compatibility Testing
  • Install Testing
  • Recovery Testing

Conclusion

To conclude this article, it is essential to discuss the primary objective of testing. First, is to ensure that users can truly make use of an application. Second, is to check that your system does not break when unexpected actions are performed. What will happen when a user makes a typo, uses the wrong API or tries to save an incomplete form? These are the reasons for the test. In addition, you need to ensure that no one can easily compromise the data or get inappropriate access to resources. An excellent testing suite like one provided by Testup will be of great value.