How to Limit Comment Length in WordPress

WordPress comments encourage discussions around your topic. However you may find that comments below a certain length or above a certain length are not very helpful. In this article, we will show you how to limit comment length in WordPress, so you can set both… Read More »

To leave a comment please visit How to Limit Comment Length in WordPress on WPBeginner.

WordPress comments encourage discussions around your topic. However you may find that comments below a certain length or above a certain length are not very helpful. In this article, we will show you how to limit comment length in WordPress, so you can set both minimum and maximum comment length limit for your WordPress site.

Why limit comment length in WordPress?

Set Comment Length Limits in WordPress

In our experience of moderating online discussions for the past decade, we have found that most helpful comments are above 60 characters and below 5000 characters in length.

When a person writes a one-word comment, it usually is not very helpful. In most cases, it is spam because the author is simply trying to earn a backlink from your site.

However when a person writes a comment above 5000 characters, its usually a rant / complaint that in most cases is not relevant to that particular article.

By setting comment length limits in WordPress, you can improve the quality of your comments.

Let’s take a look at how to control comment length in WordPress.

There are two methods to limit comment length in WordPress. The first method requires you to install a plugin. The second method uses a simple code snippet that you can add to your site.

Method 1: Limiting Comment Lenght Using a Plugin

First thing you need to do is install and activate Control Comment Length plugin. Upon activation, simply go to Settings » Control Comment Length to configure the plugin settings.

Controlling comment length in WordPress using a plugin

The plugin’s user interface is in German with English. You can set both minimum and maximum number of characters a comment can have. We recommend using 60 for minimum and 5000 for maximum character count.

You can also add messages that will be visible to users when there comments are either too short or too long. The plugin only provides these messages in the German language. You can replace it with your own message.

Method 2: Limit Comment Length Using Code Snippet

The second method is for users who don’t mind dealing with code code. We will add a filter hook to preprocess_comment. This filter is run before WordPress saves any comments to database or runs any other pre-processing on submitted comments. We will use it to check the comment length. If it is above or below the set comment length parameters, then we will show users an error message.

Simply add this code to your theme’s functions.php file or a site-specific plugin.

add_filter( 'preprocess_comment', 'wpb_preprocess_comment' );

function wpb_preprocess_comment($comment) {
    if ( strlen( $comment['comment_content'] ) > 5000 ) {
        wp_die('Comment is too long. Please keep your comment under 5000 characters.');
    }
if ( strlen( $comment['comment_content'] ) < 60 ) {
        wp_die('Comment is too short. Please use at least 60 characters.');
    }
    return $comment;
}

Comment too long error

We hope this article helped you limit comment length in WordPress. You may also want to checkout our guide on 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.

To leave a comment please visit How to Limit Comment Length in WordPress on WPBeginner.

What is Trolling?

If you engage in discussion on the Internet long enough, you’re bound to encounter it: someone calling someone else a troll.

The common interpretation of Troll is the Grimms’ Fairy Tales, Lord of the Rings, “hangs out under a bridge” type of troll.

Thus, a troll is someone who exists

If you engage in discussion on the Internet long enough, you're bound to encounter it: someone calling someone else a troll.

The common interpretation of Troll is the Grimms' Fairy Tales, Lord of the Rings, "hangs out under a bridge" type of troll.

Thus, a troll is someone who exists to hurt people, cause harm, and break a bunch of stuff because that's something brutish trolls just … do, isn't it?

In that sense, calling someone a Troll is not so different from the pre-Internet tactic of calling someone a monster – implying that they lack all the self-control and self-awareness a normal human being would have.

Pretty harsh.

That might be what the term is evolving to mean, but it's not the original intent.

The original definition of troll was not a beast, but a fisherman:

Troll

verb ˈtrōl

  1. to fish with a hook and line that you pull through the water

  2. to search for or try to get (something)

  3. to search through (something)

If you're curious why the fishing metaphor is so apt, check out this interview:

There's so much fishing going on here someone should have probably applied for a permit first.

  • He engages in the interview just enough to get the other person to argue with them. From there, he fishes for anything that can nudge the argument into some kind of car wreck that everyone can gawk at, generating lots of views and publicity.

  • He isn't interested in learning anything about the movie, or getting any insight, however fleeting, into this celebrity and how they approached acting or directing. Those are perfunctory concerns, quickly discarded on the way to their true goal: generating controversy, the more the better.

I almost feel sorry for Quentin Tarantino, who is so obviously passionate about what he does, because this guy is a classic troll.

  1. He came to generate argument.
  2. He doesn't truly care about the topic.

Some trolls can seem to care about a topic, because they hold extreme views on it, and will hold forth at great length on said topic, in excruciating detail, to anyone who will listen. For days. Weeks. Months. But this is an illusion.

The most striking characteristic of the worst trolls is that their position on a given topic is absolutely written in stone, immutable, and they will defend said position to the death in the face of any criticism, evidence, or reason.

(Protip: do not be that person. Please.)

Look. I'm not new to the Internet. I know nobody has ever convinced anybody to change their mind about anything through mere online discussion before. It's unpossible.

But I love discussion. And in any discussion that has a purpose other than gladiatorial opinion bloodsport, the most telling question you can ask of anyone is this:

Why are you here?

Did you join this discussion to learn? To listen? To understand other perspectives? Or are you here to berate us and recite your talking points over and over? Are you more interested in fighting over who is right than actually communicating?

If you really care about a topic, you should want to learn as much as you can about it, to understand its boundaries, and the endless perspectives and details that make up any interesting topic. Heck, I don't even want anyone to change your mind. But you do have to demonstrate to us that you are, at minimum, at least somewhat willing to entertain other people's perspectives, and potentially evolve your position on the topic to a more nuanced, complex one over time.

In other words, are you here in good faith?

People whose actions demonstrate that they are participating in bad faith – whether they are on the "right" side of the debate or not – need to be shown the door.

So now you know how to identify a troll, at least by the classic definition. But how do you handle a troll?

You walk away.

I'm afraid I don't have anything uniquely insightful to offer over that old chestnut, "Don't feed the trolls." Responding to a troll just gives them evidence of their success for others to enjoy, and powerful incentive to try it again to get a rise out of the next sucker and satiate their perverse desire for opinion bloodsport. Someone has to break the chain.

I'm all for giving people the benefit of the doubt. Just because someone has a controversial opinion, or seems kind of argumentative (guilty, by the way), doesn't automatically make them a troll. But their actions over time might.

(I also recognize that in matters of social justice, there is sometimes value in speaking out and speaking up, versus walking away.)

So the next time you encounter someone who can't stop arguing, who seems unable to generate anything other than heat and friction, whose actions amply demonstrate that they are no longer participating in the conversation in good faith … just walk away. Don't take the bait.

Even if sometimes, that troll is you.

[advertisement] How are you showing off your awesome? Create a Stack Overflow Careers profile and show off all of your hard work from Stack Overflow, Github, and virtually every other coding site. Who knows, you might even get recruited for a great new position!

Introducing Visual Studio Code for Windows, Mac, and Linux

Screen Shot 2015-04-28 at 11.33.49 PM

What a wonderful time to be developer. I’m down here at the BUILD Conference in San Francisco and Microsoft has just launched Visual Studio Code – a code-optimized editor for Windows, Mac, and Linux and a new member of the Visual Studio Family.

Visual Studio Code (I call it VSCode, myself) is a new free developer tool. It’s a code editor, but a very smart one. It’s cross-platform, built with TypeScript and Electron, and runs on Windows, Mac, and Linux.

Visual Studio Code has syntax highlighting for dozens of languages, the usual suspects like CoffeeScript, Python, Ruby, Jade, Clojure, Java, C++, R, Go, makefiles, shell scripts, PowerShell, bat, xml, you get the idea. It has more than just autocomplete (everyone has that, eh?) it has real IntelliSense. It also as IntelliSense for single files like HTML, CSS, LESS, SASS, and Markdown. There’s a huge array of languages that Visual Studio Code supports.

IMHO, the real power of this editor is its project IntelliSense for C#, TypeScript, JavaScript/node, JSON, etc. For example, when an ASP.NET 5 application is being edited in Visual Studio Code, the IntelliSense is provided by the open source projects Roslyn and OmniSharp. This means you get actual intelligent refactoring, navigation, and lots more. Visual Studio Code’s support for TypeScript is amazing because it has JavaScript and TypeScript at its heart.

Visual Studio Code has git support, diffs, interesting extensibility models through gulp, and is is a great debugger for JavaScript and Nodejs apps. They are also working on debugging support for things like the .NET Core CLR and Mono on all platforms.

This a code-focused and code-optimized lightweight tool, not a complete IDE. There’s no File | New Project or visual designers. If you live and work in the command line, you’ll want to check free tool out.

You can download Visual Studio Code now at http://code.visualstudio.com.

They’ll be blogging at http://blogs.msdn.com/b/vscode and you can email them feedback at [email protected] and follow them at @code.

Download Visual Studio Code and check the the docs to get started. Also note the docs for ASP.NET support and Node.js support. Visual Studio Code is a preview today, but it’s going to move FAST. It automatically updates and will be updating in weeks, not months.

And here’s some screenshots of Visual Studio Code because it’s awesome. Code what you like, how you like, on what you like, and you can run it all (by the way) in Azure. 😉

Screen Shot 2015-04-28 at 11.17.59 PM
Screen Shot 2015-04-28 at 11.28.35 PM

 

image

Have fun!


Sponsor: Big thanks to the folks over at Grape City for sponsoring the feed this week. GrapeCity provides amazing development tools to enhance and extend application functionality. Whether it is .NET, HTML5/JavaScript, Reporting or Spreadsheets, they’ve got you covered. Download your free trial of ComponentOne Studio, ActiveReports, Spread and Wijmo.


© 2015 Scott Hanselman. All rights reserved.
     
Screen Shot 2015-04-28 at 11.33.49 PM

What a wonderful time to be developer. I'm down here at the BUILD Conference in San Francisco and Microsoft has just launched Visual Studio Code - a code-optimized editor for Windows, Mac, and Linux and a new member of the Visual Studio Family.

Visual Studio Code (I call it VSCode, myself) is a new free developer tool. It's a code editor, but a very smart one. It's cross-platform, built with TypeScript and Electron, and runs on Windows, Mac, and Linux.

Visual Studio Code has syntax highlighting for dozens of languages, the usual suspects like CoffeeScript, Python, Ruby, Jade, Clojure, Java, C++, R, Go, makefiles, shell scripts, PowerShell, bat, xml, you get the idea. It has more than just autocomplete (everyone has that, eh?) it has real IntelliSense. It also as IntelliSense for single files like HTML, CSS, LESS, SASS, and Markdown. There's a huge array of languages that Visual Studio Code supports.

IMHO, the real power of this editor is its project IntelliSense for C#, TypeScript, JavaScript/node, JSON, etc. For example, when an ASP.NET 5 application is being edited in Visual Studio Code, the IntelliSense is provided by the open source projects Roslyn and OmniSharp. This means you get actual intelligent refactoring, navigation, and lots more. Visual Studio Code's support for TypeScript is amazing because it has JavaScript and TypeScript at its heart.

Visual Studio Code has git support, diffs, interesting extensibility models through gulp, and is is a great debugger for JavaScript and Nodejs apps. They are also working on debugging support for things like the .NET Core CLR and Mono on all platforms.

This a code-focused and code-optimized lightweight tool, not a complete IDE. There's no File | New Project or visual designers. If you live and work in the command line, you'll want to check free tool out.

You can download Visual Studio Code now at http://code.visualstudio.com.

They'll be blogging at http://blogs.msdn.com/b/vscode and you can email them feedback at [email protected] and follow them at @code.

Download Visual Studio Code and check the the docs to get started. Also note the docs for ASP.NET support and Node.js support. Visual Studio Code is a preview today, but it's going to move FAST. It automatically updates and will be updating in weeks, not months.

And here's some screenshots of Visual Studio Code because it's awesome. Code what you like, how you like, on what you like, and you can run it all (by the way) in Azure. ;)

Screen Shot 2015-04-28 at 11.17.59 PM

Screen Shot 2015-04-28 at 11.28.35 PM

 
image

Have fun!


Sponsor: Big thanks to the folks over at Grape City for sponsoring the feed this week. GrapeCity provides amazing development tools to enhance and extend application functionality. Whether it is .NET, HTML5/JavaScript, Reporting or Spreadsheets, they’ve got you covered. Download your free trial of ComponentOne Studio, ActiveReports, Spread and Wijmo.


© 2015 Scott Hanselman. All rights reserved.
     

8 Proven Methods to Promote Old Posts in WordPress

Want to increase your website traffic? One of the easiest and smartest method to get more pageviews is to promote your old evergreen articles. In this article, we will show you some of the best ways to promote old posts in WordPress. But before we… Read More »

To leave a comment please visit 8 Proven Methods to Promote Old Posts in WordPress on WPBeginner.

Want to increase your website traffic? One of the easiest and smartest method to get more pageviews is to promote your old evergreen articles. In this article, we will show you some of the best ways to promote old posts in WordPress.

Promote Old Posts in WordPress

But before we start, let’s take a look at why it’s important to promote old posts.

You see most people write a blog post, share it once or twice, and then leave it to die in their blog’s archive page.

Why let all your time, money, and efforts go to waste? Promoting older relevant articles allow you to maximize your traffic potential. Here are 8 proven methods to promote old posts in WordPress.

1. Regularly Share Your Old Posts on Social Media

Automatically share old WordPress posts

Most of your social media updates are seen by a fraction of your followers. Mainly because there is so much noise and not everyone is online at the same time.

That’s why it is recommended to share at various different times of the day. The Revive Old Post plugin automatically shares your old posts on social media networks like Twitter, Facebook, and LinkedIn. It spreads out your updates for different times allowing you to maximize your exposure.

For detailed instructions see our guide on how to automatically share your old WordPress posts.

2. Showcase Related Posts on Your Blog

Related Posts in WordPress

When you visit popular blogs like TechCrunch, Mashable, or even WPBeginner, you will notice that their is related content next to or below each article.

If a user has scrolled down to read your entire article, then they are engaged. Using a related posts plugin, you can provide them an opportunity to explore more of your website.

3. Display Your Popular Posts

List25 showing popular posts

It’s true that 20% of your website content gets 80% of your traffic. Some articles are simply more popular than others.

Why not get more traffic to them? You can start showcasing your most popular content with a few simple clicks. People coming to your website are more likely to read what many other users have already found interesting.

Here are some great popular posts plugins for WordPress that you can use.

4. Create Better 404 Pages

404 Error

Most WordPress themes come with a default 404 page template. A 404 page is displayed when a page that the user is looking for cannot be found.

You can use this opportunity to showcase the most important content of your website, and keep that visitor engaged. You can also add a search form on the page, so that users can locate the content they were looking for.

Here are detailed instructions on how to improve your 404 page template in WordPress.

5. Better WordPress Search

Improving WordPress search feature

The default search feature in WordPress is fairly limiting, but you can improve the search feature. There are two common approaches for that.

The first one is to use Google Custom Search form to replace the WordPress search. The other method is to use a search plugin like SearchWP.

Both of these solutions will help improve your WordPress search.

6. Custom Archive Pages

Custom archives page showing categories

Creating a custom archive page is one of the best way to highlight your old but still useful content.

You can show the most popular articles, most commented posts, recent posts, and so on. You can even display all your post categories / tags, add compact archives, and include a search form. This will help people not only in finding content, but will also help them understand what your blog is about. Don’t forget to add an email sign up form on the page.

You may also want to check out WPBeginner archives.

7. Interlink Old Articles

Interlink Your Articles

Building internal links is one of the most important SEO strategy. You need to make internal linking a habit.

It’s helpful to the user when you link to your old posts whenever it is relevant. People browse the web by clicking on one link to another. Make sure that there are plenty of your own links for them to click on.

Check out our guide on WordPress SEO tips for beginners for some more SEO advice.

8. Link Old Articles in Comments

Link to your articles in comments on your blog

When answering user comments on your own blog, you should try to use links to point them to other articles on your own website.

It’s not something you should force, rather it’s important to keep it in the back of your mind, and you will be surprised how many opportunities will come up.

This builds trust and increases your pageviews. This link you add is going to stay there and any future visitors with the same question will continue to click on that link.

We hope this article helped you fine some new ways to promote old posts on your WordPress site. You may also want to see our guide on 40 useful tools to manage and grow your WordPress blog.

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.

To leave a comment please visit 8 Proven Methods to Promote Old Posts in WordPress on WPBeginner.

How to Clone a WordPress Site in 7 Easy Steps

Generally speaking, cloning is considered an unethical practice. However, when you think of cloning in terms of making a duplicate WordPress site, a whole new world of completely ethical possibilities can open up for your business. In this article, we will show you how to clone… Read More »

To leave a comment please visit How to Clone a WordPress Site in 7 Easy Steps on WPBeginner.

Generally speaking, cloning is considered an unethical practice. However, when you think of cloning in terms of making a duplicate WordPress site, a whole new world of completely ethical possibilities can open up for your business. In this article, we will show you how to clone a WordPress site in 7 easy steps.

What Is Cloning, and Why Use It?

The idea behind cloning a WordPress site is simple: you make an exact copy or duplicate of one WordPress site and apply it to another site. Are there any good reasons to actually do this? Absolutely!

Clone a WordPress Site

One practical scenario is when you are moving a WordPress site to a new web host or a new domain name. Cloning a site will save you hours of work.

Another possible use is when you are developing a site for a client. Once the project is done you can clone the WordPress site to the client site.

Lastly, you can clone a live WordPress site to your local server for testing and development purposes.

Cloning a WordPress site is not that difficult at all, here is how you can do it with these simple steps.

Using BackupBuddy To Clone A WordPress Website

BackupBuddy

For this article, we will be using BackupBuddy plugin. BackupBuddy is a WordPress backup plugin which allows you to not only just backup your WordPress site, it also allows you to easily restore your site from a backup. We will show you how to use this site restoration tool to easily clone any WordPress site.

1. Installing and Setting up BackupBuddy

First thing you need to install and activate the BackupBuddy plugin. Upon activation, the plugin will add a new menu item labeled ‘BackupBuddy’ in your WordPress admin bar. Clicking on it will take you to BackupBuddy setup wizard.

BackupBuddy Setup Wizard

The setup wizard is very straight forward. First you need to provide an email address. After that you need to enter a password.

This password will be used when you restore your site. The next option is to choose a location where you want to store your WordPress backups. The last option allows you to set up automatic backups.

BackupBuddy allows you to store your backups on cloud services like Stash, Amazon, Rackspace, and Dropbox. You can also store your backups on your own server or email them to yourself.

Once you are done with the setup wizard, click on save settings button to continue.

2. Backup Your WordPress Site

BackupBuddy will automatically initiate the backup process when you finish the setup wizard. Upon completion it will show you the option to download your backup or send the backup to a remote destination.

Backup process initiated and completed

You can always create a fresh backup by visiting the BackupBuddy » Backup page.

Creating new backups in BackupBuddy

3. Preparing To Clone Your WordPress Site

BackupBuddy provides a very easy site cloning / migration tool. Simply visit the BackupBuddy » Restore/Migrate page to begin the cloning process.

First you need to download the importbuddy.php file to your computer.

Download importbuddy.php file to your computer

After that, you need to download the backup zip file from your existing backups shown on the same page.

Download the backup zip file to your computer

4. Upload Backup and Importbuddy to New Location

Now that you have a complete backup of your site in a zip format and your importbuddy.php file, the next step is to upload them to the new location.

This new location can be a live website, or a site on your local server. If it is a site on your local server, then you just need to copy and paste the files into a subfolder inside your htdocs or www folder, like this:

C:wampwwwmynewsite

If it is a live site, then you need to upload these files to the root directory using an FTP client.

No matter where you are copying the files, you need to make sure that the folder is completely empty and has no other files or folders inside it except importbuddy.php file and your backup zip file.

5. Running The Import Script

After uploading both files, you need to visit the importbuddy.php file in a web browser. It will be located at a URL like this:

http://www.example.com/importbuddy.php

Replace example.com with your own domain name.

Importbuddy password

You will be asked to enter your importbuddy password. This the password you created during step 1 or the password you entered when downloading importbuddy file during step 3.

After entering your password, you will notice that importbuddy has already found your backup zip file. Simply click on the Next Step button to continue.

Backup found and selected

Importbuddy will now extract your backup file when it is done, you need to click on the next button.

You will now reach the URL and database settings section.

Database and URL settings section

Importbuddy will automatically guess your new URL. It will also show your previous URL. Below that, you need to enter the new database settings. Enter the new database name, database username and password.

If you have not created a new database yet, then you can always login to your hosting account and create a database using cPanel. If you are moving the site to local server then you can create a new database using phpmyAdmin.

After entering your database information, click on the test database settings button. If you entered all information correctly, then you will see test results like this:

Test database settings

Click on the next step button to continue. Importbuddy will now import your WordPress database and show you the success message. After that you can click on the next step button.

Importbuddy will run some tests and show your new cloned site’s URL to verify that everything is working fine.

6. Test Your Cloned Site

Test your new site by visiting the link shown on the last step of importbuddy process. Check that your single posts links are working fine. Visit the WordPress admin area to see if you can perform all administration tasks.

If you run into any issues check out our guide on how to fix common WordPress errors.

7. Delete Temporary Files

On the importbuddy screen, click on the cleanup and remove temporary files button. This will delete importbuddy and all temporary files it created during the cloning process.

That’s all, you have successfully cloned your WordPress site. You may also want to check out our list of 40 useful tools to manage and grow your WordPress blog.

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.

To leave a comment please visit How to Clone a WordPress Site in 7 Easy Steps on WPBeginner.

WordPress 4.2.1 – Security Release Fixes Zero Day XSS Vulnerability – Update Now

Just 3 days after the release of WordPress 4.2, a security researcher found a Zero day XSS Vulnerability that affects WordPress 4.2, 4.1.2, 4.1.1, 4.1.3, and 3.9.3. This allows an attacker to inject JavaScript into comments and hack your site. WordPress team responded fast and… Read More »

To leave a comment please visit WordPress 4.2.1 – Security Release Fixes Zero Day XSS Vulnerability – Update Now on WPBeginner.

Just 3 days after the release of WordPress 4.2, a security researcher found a Zero day XSS Vulnerability that affects WordPress 4.2, 4.1.2, 4.1.1, 4.1.3, and 3.9.3. This allows an attacker to inject JavaScript into comments and hack your site. WordPress team responded fast and fixed the security issue in WordPress 4.2.1, and we strongly recommend that you update your sites immediately.

WordPress XSS Security

Jouko Pynnönen, a security researcher at Klikki Oy, who reported the issue described it as:

If triggered by a logged-in administrator, under default settings the attacker can leverage the vulnerability to execute arbitrary code on the server via the plugin and theme editors.

Alternatively the attacker could change the administrator’s password, create new administrator accounts, or do whatever else the currently logged-in administrator can do on the target system.

This particular vulnerability is similar to the one reported by Cedric Van Bockhaven which was patched in the WordPress 4.1.2 security release.

Unfortunately, they did not use proper security disclosure and instead posted the exploit publicly on their site. This means that those who do not upgrade their site will be in serious risks.

If you haven’t disabled automatic updates, then your site will automatically update.

Once again, we strongly advise that you update your site to WordPress 4.2.1. Make sure to backup your site before you update.

To leave a comment please visit WordPress 4.2.1 – Security Release Fixes Zero Day XSS Vulnerability – Update Now on WPBeginner.

Running Suave.io and F# with FAKE in Azure Web Apps with Git and the Deploy Button

I was told by some lovely folks in the F# community that there is a nice web framework called Suave.io. Best name ever, eh? Suave is a clean, lightweight, and very F#y (pronounced F-Sharp-ie, I say) in its syntax.

Frameworks like this do well when they are easy to deploy, especially for Hello World. I always find that if a framework can quickly and easily give me a sense of accomplishment I’ll be more likely to stick with it. I like to “fall into the pit of success.”

I wanted to see if I could make Suave on Azure work easily as well. With the help of Steffan Forkman and the encouragement of the F# community (who have felt historically that support for F# in Visual Studio and Azure has been lacking) I put this little proof of concept together. I used the HttpPlatformHandler that is available in Azure Web Apps now by default, along with a basic Kudu Deployment Script from my Ruby/Middleman post.

Most of the F# community uses a NuGet alternative called Paket that is more F#-friendly. There’s also a tiny Paket.Bootstrapper so I could curl things down, then run Paket like this, as part of an Azure Web App deployment. This script modified from Steffan:

@echo off
cls

mkdir .paket
REM TODO - might want to do an IF EXISTS *or* a SHA check
curl https://github.com/fsprojects/Paket/releases/download/1.2.0/paket.bootstrapper.exe -L --insecure -o .paketpaket.bootstrapper.exe

.paketpaket.bootstrapper.exe prerelease
if errorlevel 1 (
exit /b %errorlevel%
)

.paketpaket.exe restore
if errorlevel 1 (
exit /b %errorlevel%
)

Then we need web.config to tell Azure Web Apps (IIS8+) to start FAKE to get F# and Suave going. Note the use of %HOME%, full paths and the %HTTP_PLATFORM_PORT%:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<remove name="httpplatformhandler" />
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform stdoutLogEnabled="false" stdoutLogFile="fake.log" startupTimeLimit="20" processPath="%HOME%sitewwwrootpackagesFAKEtoolsFAKE.exe"
arguments="%HOME%sitewwwrootbuild.fsx port=%HTTP_PLATFORM_PORT%">
<environmentVariables>
<environmentVariable name="WhateverYouLike" value="GoesHere"/>
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>

I added logging but it’s off by default. You can use it to debug if you have issues, as the FAKE.exe output will go into a series of log files. You can then access them with the Kudu debug console.

I like running “azure site log tail YOURSITE” with the Azure Cross Platform command line. It lets me see the deployment and output as it happens.

FAKE and F# in Azure Web Apps

Here is Steffan’s build.fsx:

// --------------------------------------------------------------------------------------
// FAKE build script
// --------------------------------------------------------------------------------------

#r @"packages/FAKE/tools/FakeLib.dll"

open System
open System.IO
open Fake

Environment.CurrentDirectory <- __SOURCE_DIRECTORY__

// Step 2. Use the packages

#r "packages/Suave/lib/net40/Suave.dll"

open Suave // always open suave
open Suave.Http.Successful // for OK-result
open Suave.Web // for config
open Suave.Types
open System.Net

let port = Sockets.Port.Parse <| getBuildParamOrDefault "port" "8083"

let serverConfig =
{ defaultConfig with
bindings = [ HttpBinding.mk HTTP IPAddress.Loopback port ]
}

startWebServer serverConfig (OK "Hello World! It's Suave.io on Azure Websites. <a href='https://github.com/shanselman/suavebootstrapper'>So easy to setup. Just click Deploy.</a>")

I just added the Azure Deploy button to my Readme.md like this. This is markdown, of course, but could be HTML

[![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/) 

And you can try this yourself by visiting the repository here and pressing Deploy to Azure, or hit it here:

Hopefully this is a decent clear start towards easily deploying F# Web Apps to Azure via Git, and/or the Deploy Button.

Your thoughts?


Sponsor: Big thanks to the folks over at Grape City for sponsoring the feed this week. GrapeCity provides amazing development tools to enhance and extend application functionality. Whether it is .NET, HTML5/JavaScript, Reporting or Spreadsheets, they’ve got you covered. Download your free trial of ComponentOne Studio, ActiveReports, Spread and Wijmo.


© 2015 Scott Hanselman. All rights reserved.
     

I was told by some lovely folks in the F# community that there is a nice web framework called Suave.io. Best name ever, eh? Suave is a clean, lightweight, and very F#y (pronounced F-Sharp-ie, I say) in its syntax.

Frameworks like this do well when they are easy to deploy, especially for Hello World. I always find that if a framework can quickly and easily give me a sense of accomplishment I'll be more likely to stick with it. I like to "fall into the pit of success."

I wanted to see if I could make Suave on Azure work easily as well. With the help of Steffan Forkman and the encouragement of the F# community (who have felt historically that support for F# in Visual Studio and Azure has been lacking) I put this little proof of concept together. I used the HttpPlatformHandler that is available in Azure Web Apps now by default, along with a basic Kudu Deployment Script from my Ruby/Middleman post.

Most of the F# community uses a NuGet alternative called Paket that is more F#-friendly. There's also a tiny Paket.Bootstrapper so I could curl things down, then run Paket like this, as part of an Azure Web App deployment. This script modified from Steffan:

@echo off

cls

mkdir .paket
REM TODO - might want to do an IF EXISTS *or* a SHA check
curl https://github.com/fsprojects/Paket/releases/download/1.2.0/paket.bootstrapper.exe -L --insecure -o .paketpaket.bootstrapper.exe

.paketpaket.bootstrapper.exe prerelease
if errorlevel 1 (
exit /b %errorlevel%
)

.paketpaket.exe restore
if errorlevel 1 (
exit /b %errorlevel%
)

Then we need web.config to tell Azure Web Apps (IIS8+) to start FAKE to get F# and Suave going. Note the use of %HOME%, full paths and the %HTTP_PLATFORM_PORT%:

<?xml version="1.0" encoding="UTF-8"?>

<configuration>
<system.webServer>
<handlers>
<remove name="httpplatformhandler" />
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform stdoutLogEnabled="false" stdoutLogFile="fake.log" startupTimeLimit="20" processPath="%HOME%sitewwwrootpackagesFAKEtoolsFAKE.exe"
arguments="%HOME%sitewwwrootbuild.fsx port=%HTTP_PLATFORM_PORT%">
<environmentVariables>
<environmentVariable name="WhateverYouLike" value="GoesHere"/>
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>

I added logging but it's off by default. You can use it to debug if you have issues, as the FAKE.exe output will go into a series of log files. You can then access them with the Kudu debug console.

I like running "azure site log tail YOURSITE" with the Azure Cross Platform command line. It lets me see the deployment and output as it happens.

FAKE and F# in Azure Web Apps

Here is Steffan's build.fsx:

// --------------------------------------------------------------------------------------

// FAKE build script
// --------------------------------------------------------------------------------------

#r @"packages/FAKE/tools/FakeLib.dll"

open System
open System.IO
open Fake

Environment.CurrentDirectory <- __SOURCE_DIRECTORY__

// Step 2. Use the packages

#r "packages/Suave/lib/net40/Suave.dll"

open Suave // always open suave
open Suave.Http.Successful // for OK-result
open Suave.Web // for config
open Suave.Types
open System.Net

let port = Sockets.Port.Parse <| getBuildParamOrDefault "port" "8083"

let serverConfig =
{ defaultConfig with
bindings = [ HttpBinding.mk HTTP IPAddress.Loopback port ]
}

startWebServer serverConfig (OK "Hello World! It's Suave.io on Azure Websites. <a href='https://github.com/shanselman/suavebootstrapper'>So easy to setup. Just click Deploy.</a>")

I just added the Azure Deploy button to my Readme.md like this. This is markdown, of course, but could be HTML

[![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/) 

And you can try this yourself by visiting the repository here and pressing Deploy to Azure, or hit it here:

Hopefully this is a decent clear start towards easily deploying F# Web Apps to Azure via Git, and/or the Deploy Button.

Your thoughts?


Sponsor: Big thanks to the folks over at Grape City for sponsoring the feed this week. GrapeCity provides amazing development tools to enhance and extend application functionality. Whether it is .NET, HTML5/JavaScript, Reporting or Spreadsheets, they’ve got you covered. Download your free trial of ComponentOne Studio, ActiveReports, Spread and Wijmo.



© 2015 Scott Hanselman. All rights reserved.
     

How to Disable Emojis in WordPress 4.2

Last week, WordPress 4.2 was released, and it came with the new Emoji feature that allowed you to use the new Emojis in WordPress. This may be a neat feature for some, but a lot of business owners simply don’t need Emojis. Specially considering that… Read More »

To leave a comment please visit How to Disable Emojis in WordPress 4.2 on WPBeginner.

Last week, WordPress 4.2 was released, and it came with the new Emoji feature that allowed you to use the new Emojis in WordPress. This may be a neat feature for some, but a lot of business owners simply don’t need Emojis. Specially considering that Emoji support loads an additional JavaScript on every page which slightly slows down your site. That’s why in this article, we will show you how to disable Emojis in WordPress 4.2.

What Are Emoji?

Emojis supported in WordPress since version 4.2

Emojis are the tiny icons or smileys used on the internet. Originating from Japan, Emoji have made their way into the unicode character set, iOS, Android, and even on desktop computers.

Since version 4.2, WordPress now supports 4-bit unicode characters. The primary reason for this is to add native support for Chinese, Japanese, and Korean language character sets.

Using Emoji’s natively is simply a neat feature that came as a byproduct of a necessity for a large group of users.

Having that said, there is also a large group of business users like ourselves who don’t want to slow down our WordPress site for prettier smileys.

Let’s take a look at how to disable Emoji support in WordPress.

Disabling Emojis in WordPress 4.2

When we say disabling Emoji in WordPress, we mean disabling the extra checks and scripts used by WordPress to handle Emojis. You can still use Emoji on your site, and the browsers that support them will still be able to display them.

You just won’t have the advanced Emoji characters.

First thing you need to do is install and activate the Classic Smilies plugin. Simply activating this plugin will disable the emoji support on WordPress 4.2 and later versions.

It works out of the box, and there are no settings for you to configure.

Several users reported that the WordPress 4.2 Emoji support broke their old smilies. The advantage of Classic Smilies plugin is that it brings back the old smilies while disabling the new scripts and styles that most people don’t even need.

Now if you want to disable Emoji support altogether, then you can use the plugin Disable Emojis. This disables ALL emoji support in WordPress.

We hope this article helped you disable Emoji on your WordPress site. You may also want to check out our list of 21 plugins to efficiently manage WordPress multi-author blogs.

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.

To leave a comment please visit How to Disable Emojis in WordPress 4.2 on WPBeginner.

Bad UX and User Self-Blame – “I’m sorry, I’m not a computer person.”

You're evil, little man.In my recent podcast with UX expert and psychologist Dr. Danielle Smith the topic of “user self-blame” came up. This is that feeling when a person is interacting with a computer and something goes wrong and they blame themselves. I’d encourage you to listen to the show, she was a great guest and brought up a lot of these points.

Self-blame when using technology has gotten so bad that when something goes wrong, regular folks just assume it was their fault.

My dad got some kind of evil “PC Tech Hotline” on his machine today because some web site told him his “Google was out of date and that he should update his Google.” So he did. And he feels super bad. Now, in this case, it was a malicious thing so it would be really hard to figure out how to solve this for all users. It’s like getting mugged on the way to your car. It happens to the best folks in the best situations, it can’t always be controlled. But it shouldn’t cause the person to blame themselves!

People now publically and happily self-identify as computer people and non-computer people. I’ll meet someone at a dinner and we’ll be chatting and something technical will come up and they’ll happily offer up “Oh, I’m not a computer person.”

Older people and people who are new to technology often blame themselves for mistakes. Often they’ll write down directions step by step and won’t deviate from them. My wife did that recently with a relatively simple (for a techie) task. She wanted to record a lecture with a portable device, load the WAV onto the PC, even out the speech patterns, save it as a smaller file (MP3), then put it in Dropbox. She ended up writing two pages of notes while we went over it, then gave up after 30+ min, blaming herself. I do this task now.

Get a Tablet

Advanced users might say, you should get them a tablet/iPad. But this is a band-aid on cancer. That’s like saying, better put the training wheels back on. And a helmet!

Tablets might get a user email and basic browsing and protect them from basic threats, but most also restrict them to one task at a time. And tablets have hidden UX patterns as well that advanced users use, like four-fingered-swipes and the like. I’ve seen my great aunt accidentally end up in the iPad task switcher and FREAK OUT. It’s her fault, right?

 Um....

This harkens back to the middle ages when the average person couldn’t read. Only the monks cloistered away had this magical ability. What have we done as techies to make regular folks feel so isolated and afraid of all these transformative devices?

I’m not a techie

When users blame themselves they don’t feel safe within their own computer. They don’t feel they can explore the computer without fear. Going into Settings is a Bad Idea because they might really mess it up. This UX trepidation builds up over the years until the user is at a dinner party and declares publically that they “aren’t a computer person.” And once that’s been said, it’s pretty hard to convince them otherwise.

Googling: Why are users so...and google recommends "stupid"

Even Google, the most ubiquitous search engine, with the most basic of user interfaces can cause someone to feel dumb. Google is a huge database and massive intelligence distilled down to a the simplest of UI – textbox and a button. And really, it’s just a textbox these days!

But have all had that experience where we google for something for an hour, declare defeat, then ask a friend for help. They always find what we want on the first try. Was it our fault that we didn’t use the right keywords? That we didn’t know to not be so specific?

I think one of the main issues is that of abstractions. For us, as techies, there’s abstractions but they are transparent. For our non-technical friends, the whole technical world is a big black box. While they may have a conceptual model in their mind on how something works, if that doesn’t line up with the technical reality, well, they’ll be googling for a while and will never find what they need.

Sadly, it seems it’s the default behavior  for a user to just assume its their fault. We’re the monks up on the hill, right? We must know something they don’t. Computers are hard.

How do YOU think we can prevent users from blaming themselves when they fail to complete a task with software


Sponsor: Big thanks to our friends at Raygun for sponsoring the feed this week. I use Raygun myself and I encourage you to explore their stuff, it’s really something special. Get full stack error reporting with Raygun! Detect and diagnose problems across your entire application. Raygun supports every major programming language and platform – Try Raygun FREE!


© 2015 Scott Hanselman. All rights reserved.
     

You're evil, little man.In my recent podcast with UX expert and psychologist Dr. Danielle Smith the topic of "user self-blame" came up. This is that feeling when a person is interacting with a computer and something goes wrong and they blame themselves. I'd encourage you to listen to the show, she was a great guest and brought up a lot of these points.

Self-blame when using technology has gotten so bad that when something goes wrong, regular folks just assume it was their fault.

My dad got some kind of evil "PC Tech Hotline" on his machine today because some web site told him his "Google was out of date and that he should update his Google." So he did. And he feels super bad. Now, in this case, it was a malicious thing so it would be really hard to figure out how to solve this for all users. It's like getting mugged on the way to your car. It happens to the best folks in the best situations, it can't always be controlled. But it shouldn't cause the person to blame themselves!

People now publically and happily self-identify as computer people and non-computer people. I'll meet someone at a dinner and we'll be chatting and something technical will come up and they'll happily offer up "Oh, I'm not a computer person."

Older people and people who are new to technology often blame themselves for mistakes. Often they'll write down directions step by step and won't deviate from them. My wife did that recently with a relatively simple (for a techie) task. She wanted to record a lecture with a portable device, load the WAV onto the PC, even out the speech patterns, save it as a smaller file (MP3), then put it in Dropbox. She ended up writing two pages of notes while we went over it, then gave up after 30+ min, blaming herself. I do this task now.

Get a Tablet

Advanced users might say, you should get them a tablet/iPad. But this is a band-aid on cancer. That's like saying, better put the training wheels back on. And a helmet!

Tablets might get a user email and basic browsing and protect them from basic threats, but most also restrict them to one task at a time. And tablets have hidden UX patterns as well that advanced users use, like four-fingered-swipes and the like. I've seen my great aunt accidentally end up in the iPad task switcher and FREAK OUT. It's her fault, right?

 Um....

This harkens back to the middle ages when the average person couldn't read. Only the monks cloistered away had this magical ability. What have we done as techies to make regular folks feel so isolated and afraid of all these transformative devices?

I'm not a techie

When users blame themselves they don't feel safe within their own computer. They don't feel they can explore the computer without fear. Going into Settings is a Bad Idea because they might really mess it up. This UX trepidation builds up over the years until the user is at a dinner party and declares publically that they "aren't a computer person." And once that's been said, it's pretty hard to convince them otherwise.

Googling: Why are users so...and google recommends "stupid"

Even Google, the most ubiquitous search engine, with the most basic of user interfaces can cause someone to feel dumb. Google is a huge database and massive intelligence distilled down to a the simplest of UI - textbox and a button. And really, it's just a textbox these days!

But have all had that experience where we google for something for an hour, declare defeat, then ask a friend for help. They always find what we want on the first try. Was it our fault that we didn't use the right keywords? That we didn't know to not be so specific?

I think one of the main issues is that of abstractions. For us, as techies, there's abstractions but they are transparent. For our non-technical friends, the whole technical world is a big black box. While they may have a conceptual model in their mind on how something works, if that doesn't line up with the technical reality, well, they'll be googling for a while and will never find what they need.

Sadly, it seems it's the default behavior  for a user to just assume its their fault. We're the monks up on the hill, right? We must know something they don't. Computers are hard.

How do YOU think we can prevent users from blaming themselves when they fail to complete a task with software


Sponsor: Big thanks to our friends at Raygun for sponsoring the feed this week. I use Raygun myself and I encourage you to explore their stuff, it's really something special. Get full stack error reporting with Raygun! Detect and diagnose problems across your entire application. Raygun supports every major programming language and platform - Try Raygun FREE!



© 2015 Scott Hanselman. All rights reserved.