Node.js vs PHP

Web development is a wide field that incorporates many features you need comprehensive knowledge about. Node.js vs PHP are some of the most developed technologies that are mostly featured in web development activities. These two technologies take part in the development of the server-side. However, Node.js tend to serve the client-side and the server-side development. 

According to research, 34.88% of the available websites are currently hosted on PHP. In addition, PHP has been in existence for more than three decades, making it serve approximately 78% of the entire web. In terms of comparison, Node.js is relatively new in the industry compared to PHP, although it is growing significantly. 

What you must know about PHP errors to avoid scratching your forehead when something goes wrong

While pure object-oriented languages produce mainly exceptions to signal an error, PHP started out as procedural and so it has a wide range of errors that can be raised along with exceptions.

Errors are Human, But We Must Identify Them

There isn’t a programmer alive who hasn’t made errors when coding something at some point in their career. It is simply a part of the process, and it is important to recognize that we will all make these types of mistakes from time to time. That said, it is best to identify the errors as they occur so as to correct them at the moment. 

Getting started with PHP framework codeigniter

I have always worked with core PHP and was always reluctant to use any CMS (Joomla, Drupal, etc). Coincidentally I never got a chance to work on any of the frameworks in PHP. But in the current project at work, we have decided to use CodeIgniter.

CodeIgniter is a lightweight open source web application framework. In short, it gives you a directory structure of a proper MVC pattern along with a lightweight built-in templating engine of its own. MVC pattern helps developers to separate business logic and the presentation layer. It requires a very minimal setup, unlike the famous PHP framework, Zend. Zend is mostly used in developing enterprise applications and is a vast framework, hence making the learning curve more difficult. On the other hand, CodeIgniter is easy to set up and easier to learn.

How to Use MQTT in PHP

PHP is a widely-used open source multi-purpose scripting language that can be embedded in HTML and is especially suitable for web development.

This article mainly introduces how to use the php-mqtt/client client library in PHP projects to implement the functions of connection, subscription, unsubscribing, message receiving, and sending between the MQTT client and MQTT server.

How to Fix Post-Processing of Image Failed Error in WordPress

Are you seeing the ‘Post-Processing of Image Failed’ error in WordPress?

This error usually occurs when you are uploading an image file to WordPress using the built-in media uploader.

In this article, we will show you how to easily fix the ‘Post-Processing of Image Failed’ upload error in WordPress.

How to Fix Post-Processing of Image Failed Error in WordPress

What Causes the ‘Post-Processing of Image Failed’ Error?

When you add an image to a post or the media library on your WordPress website, several things happen. The image file is uploaded to your WordPress hosting server, an attachment page is created for the image, and a PHP image editing module performs some post-processing.

Unfortunately, sometimes during the image upload process you may see a WordPress error message like this:

‘Post-processing of the image likely failed because the server is busy or does not have enough resources. Uploading a smaller image may help. Suggested maximum size is 2500 pixels.’
The Post-Processing of Image Failed Error Message

Luckily, this WordPress error message provides quite a lot of detail. It tells you that the problem occurred when post-processing the image in WordPress and suggests there may be a problem with your web server.

The error message also suggests a possible solution. It recommends you upload a smaller image that is no larger than 2500 pixels in its longest dimension.

With that being said, let’s take a look at how to fix the ‘Post-Processing of Image Failed’ error in WordPress.

1. Make Sure The HTTP Error is Not Temporary

First, you should check to make sure that there are no special characters in the file name, such as an apostrophe. If it does, then you should rename the image file.

Next, you should wait a few minutes and then try uploading your image file again. If your server was simply busy as the message suggests, then it may have been caused by unusual traffic or low server resources.

Problems like these are automatically fixed on most WordPress hosting servers.

If you’re still having image upload issues after waiting a while, then you can try uploading a different file. You could also try clearing your browser cache or using a different web browser.

If you still see the ‘Post-Processing of Image Failed’ error after trying these steps, then the problem is not a temporary glitch, and you should read on to continue troubleshooting.

2. Increase WordPress Memory Limit

The error message suggests that your server may not have enough resources. Let’s increase the amount of memory that is available to WordPress.

You will need to increase the amount of memory PHP can use on your server. You can do this by adding the following code to your wp-config.php file.

define( 'WP_MEMORY_LIMIT', '256M' );

This code increases the WordPress memory limit to 256MB, which should be enough to fix any memory limit issues.

You might also like to check whether the file is larger than your website’s upload limit. To do this, see our guide on how to increase the maximum file upload size in WordPress.

Check current file upload size limit

If your WordPress hosting company does not allow you to increase memory limit, then you may need to switch to a managed WordPress hosting provider like SiteGround or WP Engine.

3. Optimize the Image to Make It Smaller

The error message says that uploading a smaller image may help. It recommends that the longest edge of your image should have no more than 2500 pixels.

When starting a new blog, many beginners simply upload images without optimizing them for the web. Not only can that cause an error message like this one, but these large image files will also make your website slower.

Having a slow website will hurt your overall SEO rankings.

To optimize the image, you will need to use an image editing software to save in the optimal file format (such as JPEG, PNG, or GIF), resize the image dimensions to a smaller size, and compress the image to make the file size smaller again.

For step by step instructions, see our guide on how to optimize images for web performance without losing quality. This covers how to optimize your images, as well as the best tools and practices to use for image optimization.

It’s important to note that sometimes this error message can be seen even when uploading smaller images. If you see the error even when uploading optimized images, then you’ll need to move to the next step of troubleshooting.

4. Change Image Editor Library Used by WordPress

WordPress post-processes images using two PHP modules, ImageMagick and GD Library. WordPress may use either one of them depending on which is available.

However, ImageMagick can run into memory issues that can cause errors during image uploads. To fix this, you can make the GD Library your default image editor.

You can do this by simply adding this code to your theme’s functions.php file or a site-specific plugin.

function wpb_image_editor_default_to_gd( $editors ) {
    $gd_editor = 'WP_Image_Editor_GD';
    $editors = array_diff( $editors, array( $gd_editor ) );
    array_unshift( $editors, $gd_editor );
    return $editors;
}
add_filter( 'wp_image_editors', 'wpb_image_editor_default_to_gd' );

After adding this code, you should try uploading the image again.

We hope this tutorial helped you learn how to fix the ‘Post-Processing of Image Failed’ error in WordPress. You may also want to see our guide on how to start a podcast in WordPress, and our detailed tutorial on how to easily create a staging site in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Fix Post-Processing of Image Failed Error in WordPress first appeared on WPBeginner.

Using PHP Headers When Serving JSON Data

Web browsers and other similar applications rely on headers to understand the content being served to them by a web server. While modern browsers will try to “guess” what format content is in and intelligently format it, it’s still good practice to use headers to ensure your application’s output is handled correctly. When sending a JSON Payload, the header is set using the following PHP code:

 
header('Content-type: application/json');


PHP page adding extra info from unknown source

I've converting my website to PHP from just static HTML. In the process, my PHP Index file is pulling old information from an unknown source Here is the specific problem. When I add a paragraph tag to my div id="main" section, I get "Get the Management Certification you need to make the next step in your career!" which isn't in my PHP file. When I inspect in Google Chrome, this is some how appears there

How To Execute JavaScript In Selenium PHP

There are cases where test scenarios may fail unexpectedly with Selenium commands (e.g., click operation on the button web element does not result in a click even though the button is enabled). Such issues are more pertinent when creating an XHR request or when attempting to access another frame. For overcoming such issues, you can execute JavaScript in Selenium through the JavaScriptExecutor interface. 

Introduction to JavaScriptExecutor

If locating or performing the required operations on the web elements does not work as expected with Selenium locators like XPath, Name, etc., the JavaScriptExecutor interface can be used to tackle the problem. JavaScriptExecutor is an interface that is available for all the languages that support the Selenium framework, including PHP.

Laravel Validation and Custom Rules

Hi, I’m Valerio Barbera, software engineer, founder, and CTO at Inspector.

Data validation is one of the fundamental features of any application and it is something developers manipulate almost every day. The value a software provides to users is often a function of the quality of data it is able to manage. Laravel ships with a lot of predefined validation rules you can immediately use in your controllers. 

How to Install and Setup W3 Total Cache for Beginners

Do you want to install and set up W3 Total Cache on your WordPress website?

W3 Total Cache is a popular WordPress caching plugin that helps you to improve your website speed and performance.

In this beginner’s guide, we’ll show you how to easily install and set up W3 Total Cache on your WordPress website.

W3 Total Cache installation and setup guide for WordPress beginners

Editor’s Note: We don’t use W3 Total Cache on our website anymore and have switched to WP Rocket which is a premium caching plugin. W3 Total Cache is still a fine solution that works well.

What is W3 Total Cache?

W3 Total Cache is one of the best WordPress caching plugins that allows you to easily improve WordPress performance and speed.

By default, WordPress uses PHP to dynamically generate each page on your website when it is requested by a user.

PHP is a server-side programming language. This means each user request increases the load on your server. This affects your website’s performance, user experience, and SEO.

WordPress caching plugins help you reduce this by skipping PHP and serving a cached copy of your webpage.

How caching works

It also allows you to easily connect your website to a CDN (content delivery network) to further improve your website performance.

Installing W3 Total Cache in WordPress

Before you install the W3 Total Cache plugin in WordPress, you’ll need to make sure that you deactivate any other caching plugin on your website. This would help you save server resources and prevent any plugin conflicts.

After that, you can go ahead and install and activate the W3 Total Cache plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.

Upon activation, W3 Total Cache will add a new menu item labeled ‘Performance’ to your WordPress admin sidebar. Clicking on it will launch the plugin’s setup wizard.

W3 Total Cache set up

Simply click on the Next button to continue.

First, you will be asked to turn on Page Cache. Click on the Test Page Cache button to continue.

Configure page cache

W3 Total Cache will show you different storage engine options. You need to choose one that saves you the most time. Usually, it will be the ‘Disk: Enhanced’ option for most shared hosting platforms.

Click on the Next button to continue.

Now, you will be given the option to Test Database Cache. We recommend choosing None. For most small to medium sized websites your MySQL server will be able to fetch data more quickly than the Database cache.

Database cache

Click on the Next button to move on to the next step.

This will bring you to the Object Cache section. Object Caching allows W3 Total Cache to store database queries for dynamic pages and reuse them to improve performance.

Object cache in W3 Total Cache

If the test result shows barely a few milliseconds difference then you can choose None.

Click on the next button to continue.

After that, click on the Test Browser Cache button and then select the ‘Enabled’ option under the test results.

Browser cache

This option requests user’s browsers to store a copy of the web page for a limited time. Loading a page from browser cache is much faster than loading it from your web server’s cache.

Click on the next button to move on to the next step.

Lastly, the setup wizard will ask you to enable lazy loading for images.

Now, WordPress comes with built-in lazy loading for images. However, some older browsers may not have support for that feature.

W3 Total Cache uses JavaScript to add lazy loading for images, which can be even faster and more efficient.

Enable Lazy Loading

After that, click on the Next button to finish the setup wizard and view W3 Total Cache dashboard.

Advanced Caching Options in W3 Total Cache

The basic settings would work for most websites. However, there are many advanced options that you can configure to further improve performance.

Let’s take a look at the most important ones.

Minifying JavaScript and CSS in W3 Total Cache

The term ‘minify’ is used to describe a method that makes your website file sizes smaller. It does this by removing white spaces, lines, and unnecessary characters from the source code.

Note: Minifiying JS and CSS files can potentially break your website. If you turn it on and your website doesn’t look right, then simply disable these options.

W3 Total Cache allows you to easily minify JavaScript, CSS, and HTML source code as well. However, we recommend only minifying JavaScript and CSS files.

Simply head over to Performance » Minify page and scroll down to the JS section.

Enable JS minify in W3 Total Cache

Check the box next to ‘JS minify settings’ to enable it.

Now, scroll down to the CSS section and enable CSS minify settings the same way.

Enable CSS minify

Don’t forget to click on the Save All Settings button to store your settings.

For alternate methods, see our guide on how to minify JavaScript and CSS files in WordPress.

Enable CDN Support in W3 Total Cache

CDNs or content delivery networks help you further improve your website performance by serving static files like images, CSS, JavaScript from a global network of servers.

This reduces the load on your WordPress hosting server and improves page load speed.

W3 Total Cache comes with built-in support for various CDN platforms.

We recommend using Bunny.net which is the best CDN solution on the market. This is what we use for our OptinMonster website.

First, you need to signup for a Bunny.net account. After signup, you need to create a Pull Zone for your website.

Bunny CDN dashboard

A pull zone adds a hostname to Bunny.net CDN. This hostname is then used to serve static files for your website.

Add a name for your pull zone and then provide your website’s domain name.

Create pullzone

After adding the pullzone, you need to visit the Performance » General Settings page and scroll down to the CDN section.

Enable CDN

Check the Enable box next to the CDN option and choose Generic Mirror next to the CDN Type option.

Don’t forget to click on the Save All Changes button to store your settings.

Next, you need to visit the Performance » CDN page and scroll down to the Configuration: Objects section.

Add CDN hostname

From here, you need to add the hostname you created earlier for your pullzone and click on the test mirror button.

W3 Total Cache will check the availability of your hostname, and will show the Test Passed message when it’s successful.

You can now click on the Save All Changes button to store your settings.

W3 Total Cache will now start serving your static resources from CDN server.

W3 Total Cache also works well with Cloudflare free CDN. Alternately, you can also use it with Sucuri which is the best website firewall service with built-in CDN service.

Troubleshooting W3 Total Cache Issues

Once you have configured W3 Total Cache properly, it should work seamlessly in the background to improve WordPress speed and boost performance.

Occasionally, you may come across issues where you don’t see changes you made to your website right away, or a plugin may not be working properly.

Most common reason for those issues is that you are probably seeing an old cached version of your website.

This can be easily fixed by clearing cache in WordPress.

Simply click on the Performance menu at the top and then select Purge All Caches option. W3 Total Cache will clear all cached content on your website.

Clear all cache in W3 Total Cache

If you are still seeing the old version of your website, then try clearing your browser cache too.

We hope this article helped you install and setup W3 Total Cache in WordPress. You may also want to see our complete WordPress security guide for beginners to strengthen your website security, or check out our comparison of the best GoDaddy alternatives that are cheaper and more reliable.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Install and Setup W3 Total Cache for Beginners first appeared on WPBeginner.

How to Find a Backdoor in a Hacked WordPress Site and Fix It

Has your WordPress website been hacked?

Hackers will often install a backdoor to make sure they can get back in even after you secure your website. Unless you can remove that backdoor, there’s no stopping them.

In this article, we’ll show you how to find a backdoor in a hacked WordPress site and fix it.

How to Find a Backdoor in a Hacked WordPress Site and Fix It

How to Tell if Your Website Has Been Hacked

If you are running a WordPress website, then you need to take security seriously. That’s because websites are attacked an average of 44 times every day.

You can learn best practices to keep your site safe in our ultimate WordPress security guide.

But what if your site has already been hacked?

Some signs your WordPress site has been hacked include a drop in website traffic or performance, added bad links or unknown files, a defaced home page, an inability to log in, suspicious new user accounts, and more.

Cleaning up a hacked website can be incredibly painful and difficult. We take you through the process step by step in our beginner’s guide to fixing your hacked WordPress site. You should also make sure you scan your site for any malware that the hackers left.

And don’t forget to close the backdoor.

A smart hacker knows that you’ll eventually clean up your website. The first thing they might do is install a backdoor, so they can sneak back in after you secure the front door to your WordPress website.

What Is a Backdoor?

A backdoor is code added to a website that allows a hacker to access the server while remaining undetected, and bypassing the normal login. It allows a hacker to regain access even after you find and remove the exploited plugin or vulnerability to your website.

Backdoors are the next step of a hack after the user has broken in. You can learn how they may have done that in our guide on how WordPress sites get hacked and how to prevent it.

Backdoors often survive WordPress upgrades. That means your site will remain vulnerable until you find and fix every backdoor.

How Do Backdoors Work?

Some backdoors are simply hidden admin usernames. They let the hacker log in as normal by typing a username and password. Because the username is hidden, you’re not even aware that someone else has access to your website.

More complex backdoors can allow the hacker to execute PHP code. They manually send the code to your website using their web browser.

Others have a full fledged user interface that allows them to send emails as your WordPress hosting server, execute SQL database queries, and much more.

Some hackers will leave more than one backdoor file. After they upload one, they will add another to ensure their access.

Where Are Backdoors Hidden?

In every case we’ve found, the backdoor was disguised to look like a WordPress file. The code for backdoors on a WordPress site are most commonly stored in the following locations:

  1. A WordPress theme, but probably not the the one you’re currently using. Code in a theme is not overwritten when you update WordPress, so it’s a good place to put a backdoor. That’s why we recommend deleting all inactive themes.
  2. WordPress plugins are another good place to hide a backdoor. Like themes, they’re not overwritten by WordPress updates, and many users are reluctant to upgrade plugins.
  3. The uploads folder may contain hundreds or thousands of media files, so it’s another good place to hide a backdoor. Bloggers almost never check its contents because they just upload an image and then use it in a post.
  4. The wp-config.php file contains sensitive information used to configure WordPress. It’s one of the most highly targeted files by hackers.
  5. The wp-includes folder contains PHP files required for WordPress to run properly. It’s another place that we find backdoors because most website owners don’t check to see what the folder contains.

Examples of Backdoors We’ve Found

Here are some examples of where hackers have uploaded backdoors. In one site we cleaned up, the backdoor was in the wp-includes folder. The file was called wp-user.php, which looks innocent enough, but that file doesn’t actually exist in a normal WordPress installation.

In another instance, we found a PHP file named hello.php in the uploads folder. It was disguised as the Hello Dolly plugin. What’s strange is that the hacker put it in the uploads folder instead of the plugins folder.

We’ve also found backdoors that don’t use the .php file extension. One example was a file named wp-content.old.tmp, and we’ve also found backdoors in files with a .zip extension.

As you can see, hackers can take very creative approaches when hiding a backdoor.

In most cases, the files were encoded with Base64 code that can perform all sorts of operations. For example, they can add spam links, add additional pages, redirect the main site to spammy pages, and more.

With that being said, let’s take a look at how to find a backdoor in a hacked WordPress site and fix it.

How to Find a Backdoor in a Hacked WordPress Site and Fix It

Now you know what a backdoor is and where it might be hidden. The difficult part is finding it! After that, cleaning it up is as easy as deleting the file or code.

1. Scan for Potentially Malicious Code

The easiest way to scan your website for backdoors and vulnerabilities is with a WordPress malware scanner plugin. We recommend Securi because it helped us block 450,000 WordPress attacks in 3 months, including 29,690 backdoor related attacks.

They offer a free Sucuri Security plugin for WordPress that lets you scan your website for common threats and harden your WordPress security. The paid version includes a server side scanner that runs once each day and looks for backdoors and other security issues.

Learn more in our guide on how to scan your WordPress site for potentially malicious code.

2. Delete Your Plugins Folder

Searching through your plugin folders looking for suspicious files and code is time consuming. And because hackers are so sneaky, there’s no guarantee you will find a backdoor.

The best thing you can do is delete your plugins directory, and then reinstall your plugins from scratch. This is the only way to know for sure that there are no backdoors in your plugins.

You can access your plugins directory using an FTP client or your WordPress host’s file manager. If you haven’t used FTP before, then you may want to see our guide on how to use FTP to upload files to WordPress.

You will need to use the software to navigate to your website’s wp-content folder. Once there, you should right click on the plugins folder and select ‘Delete’.

Delete Your Plugins Folder

3. Delete Your Themes Folder

In the same way, instead of spending time searching for a backdoor among your theme files, it’s better just to delete them.

After you delete your plugin folder, simply highlight the themes folder and delete it in the same way.

You don’t know whether there was a backdoor in that folder, but if there was, it’s gone now. You just saved time and you eliminated an extra point of attack.

Now you can reinstall any themes that you need.

4. Search the Uploads Folder for PHP Files

Next, you should take a look through the uploads folder and make sure that there are no PHP files inside.

There is no good reason for a PHP file to be in this folder because it’s designed to store media files such as images. If you find a PHP file there, then it should be deleted.

Like the plugins and themes folders, you’ll find the uploads folder in the wp-content folder. Inside the folder you will find multiple folders for each year and month you have uploaded files. You will need to check each folder for PHP files.

Some FTP clients offer tools that will search the folder recursively. For example, if you use FileZilla, then you can right click the folder and select ‘Add files to queue’. Any files found in any subdirectories of the folder will be added to the queue in the bottom pane.

Make Sure There Are No PHP Files in the Uploads Folder

You can now scroll through the list looking for files with the .php extension.

Alternatively, advanced users who are familiar with SSH can write the following command:

find uploads -name "*.php" -print

5. Delete the .htaccess File

Some hackers may add redirect codes to your .htaccess file that will send your visitors to a different website.

Using an FTP client or file manager, simply delete the file from your website’s root directory, and it will be recreated automatically.

Delete the .htaccess File

If for some reason it isn’t recreated, then you should go to Settings » Permalinks in your WordPress admin panel. Clicking the ‘Save Changes’ button will save a new .htaccess file.

Recreate the .htaccess File if Necessary

6. Check the wp-config.php File

The wp-config.php file is a core WordPress file that contains information that allows WordPress to communicate with the database, the security keys for your WordPress installation, and developer options.

The file is found in your website’s root folder. You can view the file’s contents by selecting the Open or Edit options in your FTP client.

Look for Anything Out of Place in the wp-config.php File

Now you should look at the contents of the file carefully to see if there is anything that looks out of place. It might be helpful to compare the file with the default wp-config-sample.php file which is located in the same folder.

You should delete any code that you’re certain doesn’t belong.

7. Restore a Website Backup

If you have been making regular backups of your website and are still concerned that your website isn’t completely clean, then restoring a backup is a good solution.

You will need to completely delete your website and then restore a backup that was taken before your website was hacked. This isn’t an option for everyone, but it will leave you 100% confident that your site is safe.

For more information, see our beginner’s guide on how to restore WordPress from backup.

How to Prevent Hacks in the Future?

Now that you’ve cleaned up your website, it’s time to improve your site’s security to prevent hacks in the future. It doesn’t pay to be cheap or apathetic when it comes to website security.

1. Regularly Backup Your Website

If you don’t already make regular backups of your website, then today is the day to start.

WordPress does not come with a built-in backup solution. However, there are several great WordPress backup plugins which allow you to automatically backup and restore your WordPress website.

UpdraftPlus is one of the best WordPress backup plugins. It allows you to setup automatic backup schedules and will help you restore your WordPress site if something bad happens.

Learn more in our guide on how to backup and restore your WordPress site with UpdraftPlus.

Back Up Your Website With UpdraftPlus

2. Install a Security Plugin

You can’t possibly monitor everything that goes on your website when you’re busy working on your business. That’s why we recommend you use a security plugin like Sucuri.

We recommend Sucuri because they’re good at what they do. Major publications like CNN, USA Today, PC World, TechCrunch, The Next Web, and others agree. Plus, we rely on it ourselves to keep WPBeginner secure.

3. Make WordPress Login More Secure

It’s also important that you make your WordPress login more secure. The best way to start is to enforce the use of strong passwords when users create an account on your website. We also recommend you start using a password manager utility like 1Password.

The next thing you should do is add two-factor authentication. This will protect your website against stolen passwords and brute force attacks. It means that even if a hacker knows your username and password, they still won’t be able to log in to your website.

Finally, you should limit login attempts in WordPress. WordPress allows users to enter passwords as many times as they want. Locking a user out after five failed login attempts will significantly reduce a hacker’s chance of working out your login details.

4. Protect Your WordPress Admin Area

Protecting the admin area from unauthorized access allows you to block many common security threats. We have a long list of tips on how you can keep WordPress admin safe.

For example, you can password protect the wp-admin directory. This adds another layer of protection to the most important entry point to your website.

You can also limit access to the admin area to the IP addresses used by your team. This is another way to lock out hackers who discover your username and password.

5. Disable Theme and Plugin Editors

Did you know that WordPress comes with a built-in theme and plugin editor? This plain text editor allows you to edit your theme and plugin files directly from the WordPress dashboard.

While this is helpful, it can lead potential security issues. For example, if a hacker breaks into your WordPress admin area, then they can use the built-in editor to gain access to all your WordPress data.

After that, they will be able to distribute malware or launch DDoS attacks from your WordPress website.

To improve WordPress security, we recommend removing the built-in file editors completely.

6. Disable PHP Execution in Certain WordPress Folders

By default, PHP scripts can be run in any folder on your website. You can make your website more secure by disabling PHP execution in folders that don’t need it.

For example, WordPress never needs to run code stored in your uploads folder. If you disable PHP execution for that folder, then a hacker won’t be able to run a backdoor even if they successfully uploaded one there.

7. Keep Your Website Up to Date

Every new version of WordPress is safer than the previous one. Whenever a security vulnerability is reported, the core WordPress team works diligently to release an update that fixes the issue.

This means that if you are not keeping WordPress up to date, then you are using software with known security vulnerabilities. Hackers can search for websites running the older version and use the vulnerabilty to gain access.

That’s why you should always use the latest version of WordPress.

Don’t just keep WordPress up to date. You need to make sure that you also keep your WordPress plugins and themes current.

We hope this tutorial helped you learn how to find and fix a backdoor in a hacked WordPress website. You may also want to learn how to move WordPress from HTTP to HTTPS, or check out our list of WordPress errors and how to fix them.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Find a Backdoor in a Hacked WordPress Site and Fix It first appeared on WPBeginner.

Filter results in MySQL with PHP

Hello everyone!
I working on a social network alike page whare I want to implement a messaging system.
I can do all that and I have it working.

What I want is, when I get two or more messages from someone. I only want to display the lates message from that member in the message list.
Right now it shows all three in the list like this.

Message from Willy
Message from Willy
Message from Tom
Message from Willy

But I only want to show one for all like this.

Message from Willy
Message from Tom

Even though Willy has sent many message.
Please help!

Using SingleStoreDB as a JSON Document Database

Abstract

Continuing our series on the multi-model capabilities of SingleStoreDB, we'll discuss SingleStoreDB's support for JSON data in this article.

We'll build a small inventory system to model an online store that sells various electronic equipment. This example is derived from an excellent tutorial available on DigitalOcean. We'll apply that tutorial to SingleStoreDB, and we'll see that it is effortless to store, retrieve and query JSON data using SingleStoreDB. We'll also build a quick visual front-end to our inventory system using Laravel and PHP.

Node.js vs. PHP: Modernity vs. Tradition

For many years, both PHP and JavaScript have been on top of web development technologies popularity lists. These languages have a large audience, there's no shortage of developers using them daily, and the number of projects implemented with their use is uncountable. Besides, there are dozens of pretty popular frameworks that allow developers to make more with less coding, such as Laravel (PHP) or React (JS), for example.

The thing is, PHP and JS are often considered phenomena from different worlds. JS is often seen as a tool exclusively for creating the frontend part of the web application and implementing user interaction functionality. PHP, in its turn, is a server scripting language that steers everything related to the back-end. However, there's a scenario where JS and PHP can compete in the same field. Node.js is a JavaScript framework that enables executing JS code on the server, making it an alternative to PHP. Today, we'll consider both these technologies' main pros and cons and the types of projects they will better suit.