0x00 Why should I use Disqus?
Disqus is an American blog comment hosting service for web sites and online communities that use a networked platform. The company’s platform includes various features, such as social integration, social networking, user profiles, spam and moderation tools, analytics, email notifications, and mobile commenting.
In short, Disqus offers free and premium comment service which can be integrated into Wordpress, and this service can help you prevent from most spams that you could see when you are using original WordPress commenting system, and you don’t have to worry about increasing comments will take up your database’s space and slow down database’s reponse because comments data are stored on Disqus’ server. Moreover, your would increase your website page load speed using Disqus thanks to the removal of loading original commenting system logic and data.
0x01 How can I install Disqus on my WordPress site?
As a matter of fact, the Disqus Dev team has already offered you a plugin to help you setup Disqus on your WordPress site, so what I am writing another plugin for when there is already one to use?
- Disqus cannot be loaded normally at sometimes, because of poor network connection or some other reasons;
- Disqus cannot be accessed from some countries due to policy restriction;
- Disqus has great performance impact on page load speed score like PageSpeed.
Therefore, I am here to provide you a solution to import Disqus comment system to your site with minimum performance impact.
This plugin use Disqus RESTful API when Disqus server is unable to reach, using RESTful API will increase load speed significantly because only text data is fetched from remote, and this remote can be adjusted to adapt your network condition.
To install this plugin:
- Download DisqusJs WordPress plugin from here;
- Upload, Install and Activate this plugin through WordPress admin page -> Plugins -> Add new -> Upload Plugin;
- Open plugin configuration page from WordPress admin page -> Settings -> disqusjs
- Setting up Disqus for your site.
There are two key options you need to setup for disqus to run normally on your site.
- Disqus Shortname: this is identifier for DisqusJs to load your site, you will have a shortname when create site on https://disqus.com/admin/create/
- Disqus API Key: this create DisqusJs’s access to Disqus API, you can create one from: https://disqus.com/api/applications/register/;
And following are other optional settings:
- Disqus API Endpoint: This option is for some users who cannot access Disqus directly, those users would use this endpoint to access Disqus’ data. By default it is “https://disqus.edlinus.cn/api/”, you can change it to “https://disqus.skk.moe/disqus/” if disqus don’t load properly;
- Disqus Max Comment Nesting Level: This option’s default value is 4, if you want to see a more nested comment, you can change this value to bigger one;
- Disqus Admin User Name: Your site’s disqus admin user’s name, you can find it on Disqus – Settings – Account – Username;
- Disqus Admin Badge Name: A badge would be displayed on comment list if a user is your site’s disqus admin, this value should be consistent with Disqus Admin – Settings – Community – Moderator Badge Text.
The plugin framework is copy and pasted from pipDisqus by pipdig.