Saturday, September 10, 2016

SUMO Subscriptions – WooCommerce Subscription Plugin

SUMO Subscriptions for WooCommerce is the most comprehensive WooCommerce Subscription Plugin. It has tons of features using which you can sell subscriptions in your WooCommerce shop. Feel free to contact us with new feature requests.


Fixing the “Are You Sure You Want to Do This” Error in WordPress

The vaguest WordPress error you'll no doubt come across at some point, which also has a whole laundry list of probable causes, is…


“Are you sure you want to do this?”


What's frustrating about this particular error is that it could mean you made a small fixable mistake or, worse, that you've been hacked (though typically it's a security issue that's easily fixed and not always the case).


Today, we'll uncover the meaning of this mysterious error, when and why it happens, as well as troubleshoot techniques and fixes.



Getting an Error Accidentally on Purpose…


Unfortunately, the “Are you sure you want to do this?” error can happen while you're trying to accomplish a wide variety of tasks:



  • Publishing posts or pages

  • Inserting an image into a post

  • Customizing a theme

  • Creating tags or categories

  • Uploading a theme or plugin

  • Updating WordPress core or plugins and themes


This isn't by any means a complete list, but it should give you a good idea of when this error could occur.


When the error appears, it's the only thing that's displayed other than a link to try again, though, a second attempt usually doesn't work.



Are you sure you want to do this error
The vague error on an otherwise blank page.


It may seem as though this is an odd error in its phrasing since it's not specific. The phrasing makes sense because there are so many potential causes and most of the time it's an error that's caused on your end. Either you made a mistake or the developer who created the plugins and themes you use made the mistake.


The wording of the error is specifically set to make you pause and think about what happened and if it's possible that you made the mistake after all.


Here are some of the most common reasons for the error:



  • You selected an incorrect file when trying to upload a theme or plugin

  • An improperly coded theme or plugin

  • You reached your PHP memory limit

  • A security issue


Before exploring troubleshooting steps and fixes, it's important to explore the possibility that there's a security issue since this would be a serious problem that would require special attention in order to protect your site.


What's Security Got to Do with It?


In many cases, the error pops up when you try to complete an action that requires certain user permissions, but WordPress isn't able to verify that you have access.


WordPress uses security tokens, often called nonces. They're used to validate a user to verify that they are the owner of their account and they have the correct user role to complete the action they started.


If WordPress isn't able to verify the security tokens, the error displays.


If your site is the subject of an attack, especially in cases of cross-site scripting (XSS) or cross-site request forgery (CSRF) attacks, you might see the error in the midst of an attack.


It could also occur if a plugin or theme has a security vulnerability or isn't otherwise properly coded.


If this is the cause, installing and using a security plugin like Defender can help you locate and fix the vulnerability and end an attack in a few clicks. For other causes of the error, you can try the troubleshooting steps and fixes below.



SECURITY


Ultimate WordPress security with WP Defender


Defender protects you against evil bots and hackers with automated security scans, vulnerability reports, safety recommendations, blacklist monitoring and customized hardening in just a few clicks.


FIND OUT MORE




Holding Out for a (Super Support) Hero


Let's take a look at several troubleshooting methods and fixes to help you resolve this error. And if you run into any troubles along the way, contact our expert support team for any kind of WordPress-related issue.


If you're already a WPMU DEV member, our premium 24/7 support is better than free because it's already included in your membership. There's no need to sign up for anything else or fill out any forms. If you're not a member yet, you can still get premium support for free with our 14-day trial.


Fix #1: Clear Your Cache


It's not always a fix that works, but sometimes all it takes to resolve this error is to clear your browser's cache. If that doesn't work, you can try clearing your cookies as well. You can check out the post How do I clear my web browser's cache, cookies, and history? for details on how to do this across the major browsers.


Fix #2: Plugin or Theme Upload Error


If you tried to upload a theme or plugin and the error occurred, then the likeliest cause is that you tried uploading a plugin or theme package rather than the ZIP file for only the theme or plugin.


These packages often include the theme or plugin ZIP file along with other useful documents such as instructions, demo content, licensing information and other similar files. Unzip the package, then try uploading the plugin or theme file that you find among the extracted files.


Fix #3: PHP Memory Limit Reached


In cases where you may have reached your PHP memory limit, you can check out one of our other posts, How to Increase the Maximum Upload and PHP Memory Limit in WordPress, for the fix you need.


Fix #4: Revert to the Default Theme


You can also try to activate the default WordPress theme if you're using one you selected from the Theme Repository or from a theme developer.


In cases where you're having troubles accessing your plugins, you can access your site's files through FTP, SSH or cPanel. Rename your theme's folder under /wp-content/themes/your-theme/ to manually deactivate it temporarily.


You can name the folder anything you want, but it's a good idea to keep the original name intact so you don't forget which theme the folder is for when you go back to it later. For example, you can rename the folder to include -deactivate at the end or something similar.


If the error goes away, the theme you were previously using is the culprit.


To fix it, you would need to contact the developer and let them know so they can create a patch and release a fix.


Fix #5: Delete or Deactivate Your Plugins


Similarly, you can see if any plugins you're using are the cause of the error. Sometimes deactivating them doesn't quite do the trick even though it's the cause so the first thing you should try is deleting all the plugins you're using.


If you don't have access to your plugins page, you can use FTP, SSH or cPanel to delete the folders you find under /wp-content/plugins/. You can also rename the folders as described above if you really don't want to delete the plugins you have installed.


Try repeating the last action you tried before the error popped up. If everything goes off without a hitch, then one of the plugins you were using is responsible.


Install and activate them one-by-one until the error comes up again. If you renamed the plugin folders, change them back to the original title to re-activate them.


When you see the error, that's how you can determine that the last plugin you activated was the culprit. At this point, you would need to contact the plugin developer so they can fix the issue.


Fix #6: Reset Your Security Keys


Another fix you can try that usually does the trick is to reset your security keys. You can find the details in our post How to Tweak wp-config.php to Protect Your WordPress Site.


If you prefer an option that doesn't require touching code, you can install our Defender security plugin and reset your security keys in one click. Once it's activated, go to Defender > Hardener in your admin dashboard.



The Hardener page
You can harden your site's security with Defender.


Click on Update old security keys under the Issues section, then review how often you would like a reminder to update your security keys. This step is optional, but it's also helpful because it increases your site's security.


You can choose from the following times:



  • 30 days

  • 60 days

  • 90 days

  • 6 months

  • 1 year


Once you have made your selection in the drop down box, go ahead and click the Regenerate Security Keys button to update your site's security tokens automatically.



Section once the accordion tab for updating security keys has been clicked.
You can choose how often security keys should be updated.


Keep in mind that once the update is complete, you will need to log in again.


Once you're logged in, check to see if the issue has been resolved. Even if you're free and clear, don't uninstall Defender. It can help you keep your site secure on an ongoing basis.


You've Been Hacked!


If none of these troubleshooting steps or fixes resolve the error, you may have been hacked. You can go to Defender > Scan to start a search for any vulnerabilities. If any are found, you can patch them up immediately and in one click.


You may also find the following articles helpful for cleaning and securing a hacked site:



Keeping your site secure should be a priority since you could lose more than your site including your personal information and that of your users. These articles can help you keep your site and information safe.


Conclusion


There are a ton of reasons why the “Are you sure you want to do this?” error is displaying on your site, whether it's human error or the result of a security vulnerability. In any case, you're now armed with the tools you need to troubleshoot and fix this error.


It may also be helpful to note that Defender also features audit logs to help with the troubleshooting process and keep an eye on everything that happens on your site, from login attempts to creating new posts. You can check to see what users accessed and when to help you determine the cause of this annoying and equally mysterious error. Check out Track Hackers in Real-Time with Defender's All New Audit Logs for more details.


Saturday, September 3, 2016

Changing Your WordPress Database Prefix to Improve Security

WordPress database tables all begin with the wp_ prefix by default. Security gurus often recommend changing the prefix to secure your site, but is it really worth doing? Or is it all sizzle and no steak?


The idea is that changing the database prefix helps avoid nasty SQL injections since hackers usually use queries with the standard settings in their attack, but if the database details are unique the hacker would get an error.


While updating the fix is by no means the best or only solution for protecting your site, it's one step you can take to make your WordPress install that little bit more secure.


So in this post, I'm going to run you through why and how changing your WordPress database prefix can add to your site's security. If you missed the option in the famous 5-minute install, not to worry. I'll also cover how to make the change manually with phpMyAdmin, SQL queries, the wp-config.php file as well as the much easier, one-click method using our Defender plugin.



Keep in mind that at any point, if you get stuck trying anything in this post or anything, ever for that matter, you can ask our expert support team for help. If you're already a WPMU DEV member, you're all set to ask your question. If you're not a member yet, you can sign up for a premium account for free and ask away.


What's Prefix Got to Do with It?


To understand why changing your database's tables prefix could help as a part of your site's preventive measures against attacks, it's important to explore the both sides of the argument. Knowing the reasoning behind the amendment should give you a better idea of what it takes to keep your site secure.


That's all well and good, but why is it a popular practice to change the table prefix in the first place?


SQL Injections and the Common Recommendation


When you're checking out the pros and cons, it's important to note that the main reason why it's widely recommended to rename your table prefix is to prevent a hacker from overtaking your site with a successful SQL injection.


In short, when your site is vulnerable to an SQL injection, it means that a hacker can execute an SQL query from an unsanitized form on your site without your permission or knowledge. If a hacker can successfully run an unauthorized SQL query on your site, it means that there's an open connection to the target database. When this happens, a hacker can change whatever they want and gain full access and control over your site.


When this happens, a hacker can change and do whatever they want with your site since the database is fully exposed to them. They wouldn't necessarily have access to your files, but they would have full reign over your database.


They could gain full access and control to your site and the first task is usually changing the admin login credentials. This locks you out and lets them continue going about they way, making a wide range of changes from making your site turn into spam central and stealing personal information to infecting thousands of others sites where they can spam it up and steal all the more.


It's certainly something you want to protect your site from and you can get more details on SQL injections and its prevention by checking out The Ultimate Guide to WordPress Spam.


Cons


The main reason against renaming anything in the database is that if a hacker can execute an SQL injection on your site, there's already an open connection to your database. This means that if their first SQL query fails, it's easy enough for the hacker to run a query searching for the second half of the table names that are almost always identical to the default.


The second query could search for names including usermeta and postmeta. The search would turn up the full table name and voilĂ ! Your hacker reads your new prefix. From there, they could continue doing what they wanted.


This is also assuming they didn't have access to your files as well. If they did, they could easily find your new prefix there as well.


At the end of the day, if your site and database aren't vulnerable with an open connection, then it doesn't matter what your table prefix happens to be and if there is an open connection, a hacker could easily figure out what you named your prefix making it useless.


Pretty cut and dry, right? Well, not exactly. There are a couple factors and one major one that's left out of the picture here.



Changing your database prefix is just one small measure you can put in place to help prevent attacks on your WordPress site.
Changing your database prefix is just one small measure you can put in place to help prevent attacks on your WordPress site.


Pros


While it may seem like a pointless endeavor after considering the cons, it's not like there's no president for thinking renaming the prefix works.


For one, it's a suggestion in the WordPress Codex for Security Hardening. Also, code injection vulnerabilities have been detected in WordPress starting as early as the first version 0.7 and again in future versions such as 1.5.1 where one of the first known mentions of renaming the prefix to thwart attacks was published.


Vulnerabilities have been consistently squashed since WordPress' inception, but they started out being available on numerous sites for hackers to exploit. That's why adding a little precaution can be a valuable asset to your many security measures.


There's also a reason why renaming your table prefix has been lumped into the “security essentials” label for over ten years.


Hackers rarely find out about a site's vulnerability by visiting them through a known browser like the rest of us do every day. Instead, they commonly use a program they create that's commonly referred to as a bot. They start up the bot and it systematically goes to hundreds if not thousands of sites in the matter of minutes to automatically search for vulnerabilities.


Once a vulnerability is found such as the one that allows for an SQL injection, the bot then submits queries to hack all the vulnerable sites at the same time. Out of the sites that are successfully hacked, the bot continues from there.



SECURITY


Ultimate WordPress security with WP Defender


Defender protects you against evil bots and hackers with automated security scans, vulnerability reports, safety recommendations, blacklist monitoring and customized hardening in just a few clicks.


FIND OUT MORE




But on the other hand, if some site admins have changed their table prefix, then the bot wouldn't be able to successfully execute their first query since it only accounted for the default settings and would move onto sites where the query worked. If your site were one of the ones where the prefix was changed, then your site would essentially be “safe” for the time being.


Keep in mind that in this situation, your site would still have a major vulnerability so if it's not patched up immediately, it's potentially only a matter of time until a hacker gets their squirmy  fingers in there – so to speak.


This is why changing your database table prefix isn't your be-it-end-all security solution. Far from it, actually. While it can help the fight against hackers, it's crucial to have a security plugin installed like Defender to truly secure your site.


While changing your database table prefix isn't the be-all-end-all of security measures, it's still worth the effort applying it to your site, among your other security essentials. Read on to find out how to make the change to your site.


Like I'm Gonna Lose You


Since you're going to be changing your database in a fundamental way that could completely break your site, it's important to make a backup of your entire site as if you were going to lose everything. That way, if you do, you can easily restore your site so you don't end up losing everything for good.


For details on how to create a full backup of your site, check out some of these articles:



Once you have created a backup of your site, you can start changing your table prefix.


The Files, They are A-Changing


To rename your table prefix, first start with your wp-config.php file. You can either download a copy to edit it, then reupload it to your site via FTP or the command line and SSH or you edit it directly in cPanel.


After logging into cPanel, go to Files > File Manager and locate your site's files. Click on the wp-config.php file from the list, then click Edit at the top of the page.


In the editor, locate the following line:




Change wp to whatever you want, but it's recommended that you keep the underscore after it intact. Your new prefix can contain letters, numbers and even underscores. For example, you could choose something like wp2748, il0ved0gs, sg7bn40dg or ug44_db87, but don't use these exact examples since they're public and everyone can see them including hackers.


Once you're happy with your changes, save the file. If you used FTP or SSH, upload the file back to your site and replace the old version.


You're not done yet and you may even notice your site is completely broken now. That's normal since your database's data doesn't match your changes. To fix this and finish renaming your prefix completely, go ahead and move on to updating your database.


Rolling in the Database


To start making the change to your prefixes in your database, log into phpMyAdmin so you can run some queries. For details on how to run SQL queries in phpMyAdmin, check out that section in one of our other posts 10 Tips for Keeping a Squeaky Clean WordPress (and Multisite!) Database.


You can enter your queries, line-by-line to change the main tables in your database. The structure you should follow for all your tables is below:




Don't forget to replace tablename with the actual name of the table as well as change newprefix to the new prefix you saved to your wp-config.php file.


For single installs of WordPress, you can enter these queries, but don't forget to change newprefix to the real prefix you created:




For Multisite networks, also add on these queries remembering to also replace newprefix with the new prefix you chose:




Beyond these queries, you also need to add any custom tables that plugins on your site have created as well as all the tables that are created for each subsite in your network.


Here's a list of the site tables you should also include in your queries list:



  • wp_#_commentmeta

  • wp_#_comments

  • wp_#_links

  • wp_#_options

  • wp_#_postmeta

  • wp_#_posts

  • wp_#_terms

  • wp_#_term_relationships

  • wp_#_term_taxonomy


Be sure to replace # with the site ID of your subsites. For example, you would include wp_2_commentmeta in your query for your subsite with the site ID of two.


For more information on database tables, check out one of our other posts MySQL and WordPress: Understanding How Databases Work.


Some Table That I Used to Know


When this part is done, you still need to update some entries in the options and usermeta tables mentioned above.


Update Options Table Entries


There are going to be quite a few entries you need to update in the options table and you can search for them with a query to make the process easier.


Use the following query to run a search on the options table and don't forget to update newprefix with the actual prefix you chose:




The search should retrieve a list of all the tables that need to be updated. You can click the edit buttons for each one to make the change.


Update Usermeta Table Entries


Similar to the options table, the usermeta table also needs many of its entries updated. Instead of looking for them one-by-one, you can search for them as well.


Here's the query you can use to search for entries that include the default prefix:




Be sure to rename newprefix to the real prefix you wrote into your wp-config.php file.


Finally, edit all the entries that appear in the search results to reflect your new prefix.


Won't Get Fooled Again


You're pretty well done updating your database table prefix to something completely custom, but the final step is to create one more full backup. Once that's done, you can go to your site and bask in its glory. While nothing has changed on the front end, you made a step toward a more secure site.


Although it's not the only security measure you should take, it's an added measure that can help protect you against hack bots that systematically try and infiltrate sites and their databases en masse.


If you visit a site and you get a “permissions” or “database connection not established” error, you forgot to rename one of the tables or entry prefixes. It's important to go back into phpMyAdmin and search for the tables or entries you forgot to change. You can also check out How to Fix “Error Establishing Database Connection” for WordPress to get more details.


Some plugins rely on the default database prefix so if you're sure you haven't missed updating and tables or entries, you can disable all your plugins and re-enable them one-by-one until your site breaks. The last plugin you activated is the culprit and you should consider deleting it and finding an alternative.


If you would rather not touch any code, you can use our Defender plugin to update your database table prefix in one click and to also secure your site further to make sure you don't get burned by hackers in the future.


To change your prefix in Defender, install and activate it, create a full backup of your site, then go to Defender > Hardener and click on the Change default database prefix bar to reveal more information.



The Hardener page.
Click the options on the list to harden your site's security.


You should see some more information and an option dynamically appear.


Enter the new prefix you want to include and update in your database, then click the Update button. That's all you need to do. At this point, Defender works to change your database and wp-config.php file for you and it should only take a couple seconds.



The change prefix option in Defender.
You can enter the new prefix that you want, then click the Update button to complete the change.


When the job's done, you'll see the option moved to the Resolved section toward the bottom of the page. Be sure to create another backup when you're done.


If you run into troubles along the way, feel completely free to ask our support team. After all, that's what they're there for and there's someone available to help you 24/7. If you need to ask a question in the middle of the night, don't worry, we don't mind one bit!


The Truth About A/B Testing

As an agency, your job is to deliver value to your clients. However, whenever you take on a new client's site you are likely to be making it worse. Yes, you are more likely to fail with a redesign.


“Wait…how's that even possible?” you might ask yourself.


Well, if you look at A/B testing where the original design is A and the new design is B, B's fail 80 percent of the time. Even the superstars of A/B testing fail six times out of 10.


The reality in A/B testing is, it takes many tries to reach success.


The truth about A/B testing

During a redesign of a client's site, you're more likely to enter a cycle of trying and failing multiple times until you reach success.


So how you break the cycle and reach success?


Knowing online business sales will go down the moment you change the design of a site, here's a combative way to break the cycle so you can achieve profitability and deliver more value to your clients.


Create An Iterative Professional Services Project


The Truth About A/B Testing


With an iterative professional services project you can drive more value per customer and drive value for your business. This type of project allows you to keep testing each redesign of a site to find the new design, new content structure, and new messaging that results in more sales for the client.


If you keep A/B testing, despite failure, you have a 100 percent chance of making your customer's online business better (it just might take multiple times to get it right).


This results in more revenue for you, because you have more pages to design and build, and then the client has a 100 percent chance of increasing sales. It's a win-win solution!


For more insights on A/B testing, check out these informative webinars: 



The post The Truth About A/B Testing appeared first on WP Engine.

How to Block Disposable Email Addresses in WordPress

Recently, one of our readers asked if it's possible to block disposable email addresses in WordPress? Disposable email addresses are temporary email accounts used by spammers to create fake WordPress accounts. In this article, we will show you how to effectively block disposable email addresses in WordPress.


Block disposable email addresses in WordPress


What are Disposable Email Addresses and Why Block Them in WordPress


Most websites require an email address to create user accounts. This allows website owners to verify accounts by sending them a link to that email address.


Spammers found a workaround to that requirement in shape of disposable emails. These temporary email accounts are available for a short duration allowing spammers to verify an account.


If you run a WordPress membership site or allow user registration, then people can use those disposable email accounts to create fake user accounts on your website.


You can block spam user registrations using different plugins. However by blocking disposable email addresses, you can significantly reduce spam user registrations on your website.


Having said that, let's take a look at how to block disposable email addresses in WordPress.


Blocking Disposable Email Addresses in WordPress


First thing you need to do is install and activate the Ban Hammer plugin. For more details, see our step by step guide on how to install a WordPress plugin.


Upon activation, you need to visit Tools » Ban Hammer page to configure plugin settings.


Settings page for Ban Hammer plugin


Now you need to enter a custom error message to show when someone uses a disposable email address.


Next, you need to enter the domain names you want to block. You can find a list of the most commonly used burner email providers as a txt file on GitHub.


Simply copy the list of domains and paste them under blacklisted emails box on plugin's settings page. You can also add any other domains that are not included in this list.


Don't forget to click on the Update Options button to store your settings.


Any users who now try to register using a disposable email address will see the error message you defined earlier.


Disposable email address error


We hope this article helped you learn how to block disposable email addresses in WordPress. You may also want to see these 12 vital tips and tools to combat comment spam 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 Block Disposable Email Addresses in WordPress appeared first on WPBeginner.


Listed Best Drag And Drop WordPress Themes For Your E-Business

While designing a website, you need to put all-out efforts for keeping it advanced and adapt to all advanced features. And it requires integration of distinct features and functionalities within the website using some plugins, added software and some technologies. However, not all the developers are so proficient in keeping a tab and creating each and every feature of the site so meticulously and finely. And this where these pre-built themes come into the light.


Saturday, August 27, 2016

How to Add Web Push Notification to Your WordPress Site

Have you noticed the web push notifications used on popular websites like Facebook? Recently one of our readers asked if it was possible to add web push notifications in WordPress. Ofcourse, it is. In this article, we will show you how to add web push notification to your WordPress site.


Adding web push notifications to a WordPress site


Why Add Web Push Notifications to Your WordPress Site?


Web push notifications are clickable messages displayed on top of user's Desktop. They can be shown even when user's browser is not open.


Web push notifications displayed on Desktop with Google Chrome, Firefox, and Safari web browsers


Aside from desktop, Web push notifications also work on mobile browsers.


Popular sites including Facebook, Pinterest, LinkedIn, and many others are already using web push notifications. It is proving to be more engaging than SMS, email marketing, and other social media. According to a survey, push notifications have a 50% open rate on mobile devices.


This means more engaged audience for your WordPress site and significant boost in your overall page views and returning visitors.


Having said that, let's take a look at how to add web push notifications to a WordPress site.


Setting up Web Push Notifications in WordPress with OneSignal


OneSignal is a free service that allows you to add push notifications to any website, web, or mobile apps.


First thing you need to do is install and activate the OneSignal plugin. For more details, see our step by step guide on how to install a WordPress plugin.


Upon activation, the plugin will add a new menu item labeled OneSignal in your WordPress admin bar. Clicking on it will take you to plugin's settings page.


OneSignal WordPress plugin settings


The settings page is divided into Setup and Configuration tabs. The setup tab is actually detailed documentation on how to setup OneSignal push notifications in WordPress. It has the same steps that we will show you in this tutorial.


To setup OneSignal, you will need to add different API keys and application IDs into the plugin settings.


Let's get started.


Step 1: Create Google Keys


First you need to visit Google Services Wizard website.


Creating Google services app


Simply provide a name for your app and add an Android package name. OneSignal does not use Android package name, but it is a required field.


Next, choose your country and region, then click on the 'Choose and configure services' button.


This will bring you to the next screen where you will be asked to select Google services you want to use with your app. You need to click on 'Enable Google Cloud Messaging' button.


Enable cloud messaging


You will now see your server API key and Sender ID.


Server API and Sender ID


You need to copy your Sender ID and paste it in WordPress plugin's Configuration tab under Google Project Number field.


You also need to copy your Server API key and paste it in a text file on your computer. You will need this API key later in this tutorial.


Step 2: Setting up Chrome and Firefox Push Notifications


We will now setup push notifications on Chrome and Firefox. First you need to visit OneSignal website and create your free account.


Once you have created your account, you need to login and click on 'Add a new app' button.


Add new OneSignal app


You will be asked to enter a name for your app. You can use any name you want and then click on 'Create' button to continue.


App name


On the next page, you will be asked to select a platform to configure. You need to select 'Website Push' and then click on the next button to continue.


Website Push


After which you will be asked to select browser platform. You will see Google Chrome and Mozilla Firefox in one box and Safari in another box.


You need to click on Google Chrome and Mozilla Firefox box. We will show you how to setup Safari, later in this article.


Select browser platform


Click on the next button to continue.


In the next step, you will be asked to enter your WordPress site url, Google Server API key, and URL for your default notification icon image.


App settings


If your website does not support SSL/HTTPS, then you need to check the box next to 'My site is not fully HTTPS' option. You can also setup SSL on your website if you like, but it's not required.


Google Chrome does not support web push notifications for non-ssl or http websites. OneSignal solves this problem by subscribing users to a subdomain on their own https domain.


Checking 'My site is not fully HTTPS' option will display HTTP fallback options. You will need to choose a subdomain for your app and enter Google Project Number or Sender ID you generated in the first step.


http fallback options


Click on the Save button to continue. Now you can exit this dialog box. You will be prompted with a notice that your setup isn't complete yet and can be resumed later. Click Yes to close the dialog box.


Step 3: Getting OneSignal Keys


You now need to get OneSignal Keys for your website. From your app dashboard click on App Settings.


App Settings link


This will take you to your app settings page. You need to click on the Keys and IDs tab.


Keys and IDs


This will show your OneSignal App ID and Rest API Key.


App ID and Rest API Key


You need to copy and paste them in OneSignal WordPress plugin's configuration tab on your site.


Step 4: Setting up Safari Web Push Notifications


Remember we skipped Safari web push notification settings. Now we will show you how to setup Safari web push notifications.


Login to your OneSignal account and go to your App Settings page. Scroll down to web platforms and click on the configure button next to Apple Safari.


Configure Apple Safari


This will bring up a dialog box where you will be asked to enter your site name and site url.


Safari web push notification settings


Then you need to check the box next to 'I'd like to upload my own notification icons' option.


You will now see an option to upload different icon sizes. These are square images, use Photoshop or any image editing program to create icons in the exact sizes.


Click on choose file buttons to upload all your icons.


Upload notification icons for Safari web push notification


Click on the Save button and then close the dialog box.


Refresh the App Settings page and scroll down to Web Platforms section. This time you will see 'Web ID' under Apple Safari.


Safari web ID


You need to copy this web ID and paste it in Configuration tab of OneSignal plugin on your site.


That's all, you have successfully setup OneSignal web push notifications for your WordPress site.


Step 5: Testing Web Push Notifications on Your WordPress Site


By default, OneSignal plugin will add a subscription icon to your WordPress site. Visit your website in a supported browser and then click on the subscribe button.


Subscribe push notifications button


You will see the default 'thank you for subscribing' message.


Now login to OneSignal account. Click on your app name, and then on App Settings.


Scroll down to the web platforms section and click on the configure button next to Google Chrome and Firefox.


Configure web push notifications for Chrome and Firefox


You will see the platform configuration screen which you filled in earlier. Simply click on Save button and then click on Continue.


testing web push notifications


You will be asked to select target SDK. You need to select WordPress and then click on Next.


Select WordPress


Since you only have one subscriber at the moment your subscriber ID will be automatically filled.


Click on the next button, and you will reach the 'Test Settings' step.


Click on 'Send Test Notification' button.


Send test notification


One Signal will now send a web push notification.


The notifications appearance may differ depending on which browser you used to subscribe. When the notification appears on your computer screen you need to click on it.


Test notification


It will take you to confirmation screen, showing that you have successfully setup OneSignal web push notifications for your website.


Success message


Return back to the configure screen on OneSignal website and click on 'Check Notification Status' button.


Check notification status


You will now see another success message which indicates that you have successfully added web push notifications to your WordPress site.


How to Send Web Push Notifications in WordPress with OneSignal


The OneSignal web push notifications plugin on your WordPress site will automatically send a notification to all subscribers when you publish a new post.


You can also manually send notifications from your OneSignal App Dashboard. Login to your OneSignal account and click on your app name.


From the menu on your left, click on the 'New Message' button.


Sending a new web push notification message


This will bring you to the new message screen. You can enter a title and some content for your notification.


Write your new push notification message in OneSignal


You can also click on the Options, Segment, Schedule/Send Later to further customize your web push notification.


For example, you can link it to a particular page on your site, send it to a particular segment of your users, or schedule it to be sent at a specific time.


We hope this article helped you add web push notification your WordPress site. You may also want to see our list of the best membership plugins for 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 Add Web Push Notification to Your WordPress Site appeared first on WPBeginner.