Charles Tips – Adding Custom Shortcodes to WordPress

I wanted to create a custom HTML code function, so made one that will generate a line feed. I tested it to neaten up the output from my favorite WordPress statistics plugin: WP-Statistics by Verona Labs.

This shortcode gives the ability to add line feeds to WordPress page, post or report outputs to improve their readability. The function can easily be modified to generate any HTML output by doing this:

      • rename “newline” in the “add_shortcode” line to whatever you’d like the shortcode to be named
      • adjust the HTML code inside the quotes in the “return” line

In this example, we’ll create the line break shortcode.

Creating the Line Break Shortcode

Adding shortcodes in WordPress is easily accomplished by simply inserting the appropriate coding for the shortcode into your child theme’s functions.php file.

Note: Child themes should always be used. Changes made directly to the parent theme’s files are usually overwritten each time the parent theme is updated.

To add the code, first back up your site and then do the following:

      • Log into the WordPress Dashboard as an administrator
      • Navigate to Appearance > Theme Editor
      • Select Theme Functions (functions.php) under Theme Files in the right column
      • Add the short function code lines below
/* -- Start of line breaks shortcode --*/
function line_break_shortcode() {
return '<br />';
}
add_shortcode( 'newline', 'line_break_shortcode' );
/* -- End of line break shortcode --*/

Adding Line Breaks

Once the code has been added to your functions.php file, all you have to do is add the
shortcode in your text to generate a line feed at that point. The beauty of doing this as a shortcode is that it can be inserted in places that do not normally allow you to add them – like in the email output of the WP-Statistics plugin.

Note: When testing your output from the WP-Statistics plugin, there is a convenient feature that allows you to send output every minute to see what you will be sending. As a rule I normally have the report set to send daily.

A Working Example

There were a couple of WP-Statistics report items that were of particular interest to me. One is the last post date. This is handy as a reminder when one should add one or more posts to a site – especially a blog – so the site content doesn’t appear stale (or as an alternative, simply do not show blog post creation dates). Even if you are not displaying the post dates on the site, it is good to know when you last posted something.

An example of the report pattern I used was this (note that in some WordPress themes the “[” and “]” characters in the example below display as repeated – there should only be one “[” opening shortcode character and one “]” closing shortcode character surrounding the shortcode itself when you use it):

WP Statistics report for https://CharlesWorks.com WordPress site:
[newline]
_______________________________________________
[newline]
[newline]
Last post date: [wpstatistics stat=lpd]
[newline]
Total Site Posts: [wpstatistics stat=postcount]
[newline]
Total Site Pages: [wpstatistics stat=pagecount]
[newline]
Total Site Users: [wpstatistics stat=usercount]
[newline]
Online Users at Report Time: [wpstatistics stat=usersonline]
[newline]
_______________________________________________
[newline]
[newline]
Today's Visitors so far: [wpstatistics stat=visitors time=today]
[newline]
Today's Visits so far: [wpstatistics stat=visits time=today]
[newline]
Yesterday's Visitors: [wpstatistics stat=visitors time=yesterday]
[newline]
Yesterday's Visits: [wpstatistics stat=visits time=yesterday]
[newline]
_______________________________________________
[newline]
[newline]
Total Visitors: [wpstatistics stat=visitors time=total]
[newline]
Total Visits: [wpstatistics stat=visits time=total]
[newline]
_______________________________________________
[newline]
[newline]
End of WP Statistics Report.
[newline]

I used the underline characters to separate various parts of the output for clarity. This report pattern generated a nicer, more readable report that even looked great when viewing it on my cell phone.

While I initially added this function as a way to neaten up the output of the WP-Statistics email report – the function should work just about anyplace in WordPress except in the PHP coding itself.

Charles Tips – Adding Akismet comment spam protection

Akismet provides a convenient and free way to protect your personal WordPress site or blog from spam.

Many times we’d like to allow comments to be left on our WordPress site. The hassle with this can be the tremendous amounts of spam that come through the forms on websites.

Akismet is a compact WordPress plugin that filters the incoming comments. It is pretty straightforward to use and pretty easy to set up as well.

Install the Akismet plugin

The first step in this process is to ensure that the Akismet plugin is installed in your WordPress website:

      • Log into your WordPress website’s dashboard as an administrator
      • Click on Plugins in the left dashboard navigation column
      • Look and see if Akismet is listed – if it is – and it is not activated you can proceed to the Akismet Setup step below – otherwise
      • Click on Add New under Plugins in the dashboard navigation column
      • If you don’t see Akismet in the plugins, then in the text box to the right of the work Keyword in the row starting with Featured type in Akismet – then click on its Install Now button. Do not activate it yet.

Akismet Setup

To set up Akismet you will need an API code from the Akismet site. The first step in that process is to navigate to:
https://akismet.com/plans

This (as of the time of this writing) brings you to a page that should look similar to the screenshot below.

Akismet offering pricing page
Akismet offering pricing page

To get the free version of Akismet comment spam protection, you will need to click on the Get Personal button on the above page.

Once you’ve done that, you should see a page similar to the one below. Before attempting to fill out anything on this page, we need to set that $36 / YEAR to $0 / YEAR. Click on the $36 / YEAR box and drag it to the left.

Akismet Default $36 per year page
Akismet Default $36 per year page

Dragging that $36 / YEAR box to the left should change the page to display something like the one below showing 0$ / YEAR. You can also see that the information to fill in has changed.

Akismet $0 per year page
Akismet $0 per year page

Now fill in the information completely. Note that you need to be able to check all three checkboxes indicating the following:

      • you don’t have ads on your site
      • you don’t sell products/services on your site
      • you don’t promote a business on your site

If these are the case, then you will qualify for a free, personal plan.

All you have to do once you have gotten this far is follow the directions on the page below.

Akismet signup complete page
Akismet signup complete page

Finally, it is suggested that while on that settings page in Akismet, you can choose to show the number of approved comments beside each comment author and choose whether to show a privacy notice or not. Then just click the Save Changes button and you are on your way!

Charles Tips – SEO Scammers

Almost all businesses get the usual spam SEO (Search Engine Optimization) phone calls. Recently, one of my web clients took one. As a result of such calls, she emailed me. She expressed a lot of concern about having been told very negative things about her web traffic and website operation. It sounded like he was trying to get her to spend money. Money she’d never see a return on her investment for.

High-pressure sales tactics are something I have instructed staff in all our years in business to avoid. CharlesWorks policy forbids selling clients anything they don’t need. The difficulty is that there are so many spammers and scammers out there sending the same messages that people believe them. You can tell the same lie a thousand times and it’s still a lie.

Among the thousands of websites we’ve handled, her particular business is very unique – especially during the COVID-19 epidemic. Her classes are limited regarding how many people she can have in them at any given time. I told her that she is the one who knows best what should be on her website. And she is the one who knows best what she has to offer and when she can offer it.

The nature of her business, it seemed to me, is based more on a following she has developed over time. And she is limited as to how many people at a time she can physically handle. And – much as I hate to say this – COVID is going to remain a thought in many people’s minds – at least through this upcoming winter season. Things will change when a vaccine is widely available. However, common sense dictates it will be a while before everyone generally has access to it.

I suggested she shouldn’t spend more than she absolutely has to – to just keep her business operational. Those small business owners who can stay in business through this pandemic will be the ones who do great once they reach the other side of this.

It’s troubling that someone had pressured her enough to do work on her site that she became stressed over it. Sales people who proceed with such a hard sell attitude are clearly desperate for work. Desperate people are not working with their customer’s best interest in mind. My advise is to not talk to these people.

My suggestions for dealing with these really hard line sales calls are:

      • Say to them “Please remove me from your calling list.” Once you say those words, they are supposed to do so by law. I regularly tell spammers this, and they generally don’t bother to call back.
      • Block their number through whatever mechanism your telephone carrier has set up to do that. I do this on a pretty regular basis with the robocalls (which are actually illegal in most cases) and take a few minutes to report them at the https://www.donotcall.gov/report.html site.
      • Go to https://www.donotcall.gov where you can put your phone numbers on the National Do Not Call Registry. Mine have been on this for many years.

While these suggestions don’t stop all the spam calls you’ll get, they do stop many.

Every small business owner can and should review their website. They should ensure that everything is up to date for offerings and schedules. That only costs them a few minutes. Because CharlesWorks charges for changes by the minute, those kinds of changes only incur those minutes of charges.

I hope this is helpful to you!

Charles Tips – Checking Your Site

Something many folks overlook is occasionally checking their website’s functionality. I recommend doing this every couple weeks, but at minimum once a month.

Most websites and the servers they are on are subjected to ongoing software updates. Unless you are paying an additional fee for maintenance checks, it’s normal for things to occasionally break due to updates.

Most website owners are not paying additional fees for such maintenance. This means you really need to take the time to check:

– that the site appears to work properly
– that your hours of operation are correct
– that any website forms are working
– that email addresses are correct

The site operation and forms are most susceptible to software updates. If you have a good web developer, the fixes will happen quickly and it will not cost you too much.

Website maintenance should be thought of like automotive maintenance. We get oil changes. We get inspections. We even make modifications and do repairs to keep our vehicle operating the way we want. And our older vehicles can cost more to upkeep – just like older websites. As websites age, more work needs to be done to keep them secure and working as originally intended.

So check your site every now and then to keep things working and have the correct information out there!

Charles Tips – Engagement

Engagement, in military terms, is described as a fight or battle between armed forces. In web terms, engagement could be thought of as the process of getting an idea across to accomplish a goal.

There are a couple major goals with websites, as I see it. One is to simply share information. Another is to sell products. Make no mistake about it – whether you are selling widgets or ice-cream or trying to increase your congregation – the goal is the essentially the same – getting people engaged.

The first, sharing information, definitely is a precursor to the second. I’d like to focus on the second here.

Websites that are more engaging with their visitors will encourage more sales. With that in mind, it follows that engagement is a result of information and aesthetics.

Aesthetics costs for a website can vary greatly. Graphic design can be time consuming. This equates to higher labor costs. Information in written form, however, is usually the least expensive part of website development. Text can usually be pasted into web pages. This is not usually as labor intensive. Having more information in text format on a website usually equates to more exposure to the public. This is because website visitors can arrive using search engines. And the search engines find your site based upon pertinent content – mostly text.

In a nutshell, if you want an engaging website – which will increase your probability of success on the web – make sure there is plenty of information in text form on it. Search engines will help get folks there and your aesthetics can do the rest.

Charles Tips – Blogging

A popular website sales pitch over the past ten or so years has been about blogging. Many web developers believe that blogging is an absolute must to get found on the web. However, believing doesn’t necessarily make it a fact.

Whether blogging will be a benefit your particular web presence is complicated. There are a number of factors to consider.

A major factor is that blogging requires time to be effective. The time has to be spent by someone entering blog material pertinent to your business or topic into your website. Otherwise you have to pay someone to keep up with it.

Keeping blogs interesting to keep site visitors engaged is another ongoing endeavor. Site visitors won’t return if the material doesn’t hold their interests.

The real power of blogging lies with search engine placement. Search engines rank websites on how pertinent they are to a particular topic or search terms. Search terms are generally words or phrases people type into search engines when they are looking for something. The more pertinent – the higher the ranking. Having more pertinent material on a site increases ranking.

So when considering whether a blog is right for your web presence or not, bear in mind that a blog must be an ongoing, continuing effort. It may be just as effective to simply have a lot of static material on your site explaining details about all your offerings.

Charles Tips – Scamming Web Developers

Most of the articles I submit are to help the average web user or website owner learn a few web related tidbits. This one is geared toward web developers.

The scam asks about doing web development and whether it can be paid via credit card. It lets you know right away that they have a good budget to make the site. They also tell you they want it to be like a particular other site that you can check out to see what the project will entail.

Then the scam is presented – the scammer needs a favor. When you write back and ask what that favor is, here is a verbatim response I received:

“The favor i need from you is. i would give you my card info’s to charge for $7,700 plus credit card company charges, so $2,000 would be a down payment for my website design and the remaining $5,500 you would help me send it to the project consultant that has the text content and the logo for my website so once he has the $5,500 he would send the text content and logo needed for my website to you also the funds would be sent to him via Instant Transfer or Cashier Check into his account, sending of funds would be after funds clears into your account And also $200tip for your stress So i will be looking forward to read back from you. Thanks”

Then I indicate my credit card company doesn’t allow such transactions. I never hear from them again…

Most scams are built upon the greediness of the mark – purposely using poor grammar and presenting what looks like it’ll be a easy way to make some quick cash. That’s how they trick you out of your money. We all know the old saying: If it sounds too good to be true, it probably is.

Charles Tips – Hit and Run

Most of us think “hit and run” refers to a car accident. We’ve been using that phrase in the web world since starting this business in 1998.

Most of our web clients have been victimized by website hit and runs. That’s where a web developer hits you up for the cost of building your website and – if you’re lucky enough to have them complete the project – they run.

The main reason is because that initial developer really doesn’t have a robust grasp of the website development field. They stop being responsive to you because they simply don’t know how to modify or alter their work. This usually happens because they used quick templates that they simply don’t know how to adjust or modify.

In most cases I’ve seen, these so-called web developers are part timers doing a little web work on the side. They may provide what seems like a fantastic deal at the time – but leave you high and dry when the time comes that you need changes made to your website.

Although there are no guarantees you’ll never experience this – there are a few things you can check on. First of all see if they are a legitimate business. You can check this and other factors at https://cwcorner.com and in the upper right corner hit the magnifying glass and type “legitimate” and hit enter.

Don’t be the victim of a hit and run – you can minimize it happening to you by checking the potential web developer out before getting involved with them.

Charles Tips – Persistent Scammers

I’ve written several articles about specific scams that are occurring on a regular basis on the Internet. They seem to subside for a short time – a very short time – and then a wave of them happens again.

One of the worst – as far as I am concerned – are the ones where the email recipient is being told they must verify their email. These have some common traits with most Internet scams:

1) A sense of urgency – they want you to take care of this immediately

2) A time limit – they give you within 24 hours to act

3) A threat – they tell you your email will be locked.

The first thing you have to understand is that nearly everyone gets these on occasion. I have received them myself in which they are made to look like they are from CharlesWorks. So when our clients get these they tend to become very worried very quickly.

I can’t stress enough that most legitimate companies will not send out messages like these. To fall prey to these can be a real nightmare. With access to one’s email these days the bad guys can wreak havoc in one’s life. The worst cases are called identity theft!

Don’t be the unfortunate one who falls prey to these scammers. If you have been “notified” of something serious – call your provider up and speak with a representative. Just like at my company – it’s a lot easier for us to allay your fears than to have to try to clean up the mess that can happen with compromised accounts.

Charles Tips – Trademark and Copyright Familiarity

In the web world, copyrights and trademarks can get business owners in hot water. Many experienced web developers have an awareness of when legal assistance may be required to resolve such issues.

While I am not an attorney, I can say with a fair degree of certainty what items are safe to use on one’s website.

First and foremost are graphics that you create yourself or have created for you by someone you hire to produce them. However, an exception to that is if the graphic created is similar enough to a copyrighted work to create confusion to the viewer.

Next are photographs. Usually using your own photographs is pretty safe. Photos not taken by you is always risky unless you have permission to do so.

There are various sources on the Internet for pictures and graphics that allow unlicensed or licensed use – otherwise “free to use” graphics or photos. Pixabay.com is one example. It has many items that can be used covering many topics, classifications and so forth.

I recommend you use an experienced, seasoned web developer. A general familiarity with trademark and copyright issues is more apt to be found by using a seasoned website developer. When in doubt, as a business owner you should consult a trademark or copyright attorney.

Charles Tips – WordPress Proficiency and Training

We’ve mentioned the term WordPress previously. Over 1/3 of all websites on the planet are built using WordPress. It is the most popular website platform. The platform is the environment in which a piece of software is executed.

An important aspect of website operation is determining whether the platform is optimized for your WordPress coding. That’s difficult for most people other than server operators to know. We recommend you find out two things from your web developer:

First is whether the latest version possible of PHP is used. That’s the actual programming language WordPress is written/coded in. PHP doesn’t have to be the very latest, as there are always new versions being developed. However, your WordPress themes and plugins may not work on the very newest version. But if you are using a version of PHP 5.x you may be asking for security issues. If the plugins and themes won’t run on the newer PHP 7.x then you really need to consider upgrading your site to use newer plugins or themes. WordPress itself is kept up better than most software and works great with the very latest PHP versions.

Second is to check that your WordPress installation is running on a Linux based system. Over twenty years in this business has shown us that there are far fewer issues with WordPress operating in Linux based servers rather than Windows based servers.

Hopefully your web developer is proficient with WordPress through experience and training. He or she should know the answers to these questions. If not, we routinely reassure our clients on such matters.

And, finally, the CharlesWorks team wishes you and yours a very safe and happy 2020!

Charles Tips – Partial Hour Webwork Billing

We hear lots of hype about how the economy is doing so great these days. However, it isn’t necessarily true for all and many have to watch their spending.

Paying expensive expensive maintenance fees
It’s better in YOUR pocket!

One thing to watch is minimum labor/service rates. Checking out how you’re billed for webwork can save you a lot on money over time.

You gain the most advantage for yourself by finding a web company that bills by the minute. Billing by the full hour – or even worse yet – a minimum of more than an hour – is the absolute worst for you as an end web client.

By the minute billing means if a task takes 14 minutes you are billed for 14/60 of the hourly rate. While some complicated website tasks take lots of time – but smaller tasks usually do not take long to do – like changing phone numbers, updating hours, adding or taking down specials, minor modifications to how something looks and the likes of that.

There are companies that will bill you for only the work they do for you – billing you by the minute.

I started doing it that way from the time I started my business in 1998. The business experienced considerable growth. One day, a competitor in my field told me I was “shooting myself in the foot” by charging that way. I ran into him a number of years later. He wasn’t in the web business any more.

There are many companies out there that do business fairly. If you’re paying minimum labor times or so called maintenance plans, then my suggestion is to look for a web company that will treat you fairly. You’ll save a lot of money in the long term.

Charles Tips – Inflated Maintenance Plans

Along with all the many scams out there on the Internet are what I’d call the “inflated monthly maintenance plans”.

Paying expensive expensive maintenance fees
Paying expensive expensive maintenance fees

These are usually fixed monthly pricing plans that include hosting and website maintenance. Such plans are touted as providing the business owner with a means to budget ongoing website maintenance, so-to-speak.

I’ve seen many of these offerings since 1998. I’ve also spoken with many website owners who have had such plans. They’re almost never advantageous to the business owner.

In most cases, business website owners had paid up to several hundred dollars a month for these plans – for many years in some cases. Most never had any work done to their websites. Those who did have work done indicated it was far less value than they had paid for with their “budget”.

Put specifically in dollar terms, some had paid thousands of dollars for only about a hundred dollar’s worth of web updates over time. For that reason I highly recommend businesses avoid such plans.

In short, be very careful about doing business with web companies or web developers that want to sell you these inflated monthly maintenance plans. Paying for website work on an as-you-need-it basis will almost always cost you much, much less in the long term.

Charles Tips – The big SEO Scam

I’ve mentioned SEO (Search Engine Optimization) throughout many articles. While it is important – I believe it’s the most abused area of website development.

SEO scammers are great liars
SEO scammers are great liars

It’s important for your business website to be found in the search engines. That is best and most inexpensively done by having pertinent material in your website so the search engines see your website as pertinent or closely related to a topic.

There are many unscrupulous individuals and companies out there selling just plain bogus SEO. It’s often impossible to discern the truth. There are no regulations or meaningful certifications in this field.

As an example – let’s say you receive a dozen Viagra spam messages in a month. Does that mean you need it? Certainly just because a number of spam messages are saying you need something doesn’t turn it into a fact.

Why would you believe the same about SEO regarding your search placements on the Internet? Our web clients are bombarded with spam and with phone calls saying they need this and that for their websites. Some fall prey to these sales pitches and some even go out of business as a result of spending hundreds of dollars each month on scams.

Your web developer should care about you as a client – should want you to be as successful as possible and not up-selling you right out of business.

The worst part of the SEO scams is they can oftentimes hurt your placement with the search engines.

Don’t fall prey to the scamsters selling these bogus “services”. Check with your web developer FIRST about such offers to find out if they are for real or whether you actually need them.

Charles Tips – No Domain or Hosting Contracts

Two components of a website are the domain and hosting. Websites are accessed easiest with these.

Domain names are labels typed into web browsers that point to a particular website. Usually they’re a word or words pertinent to the website. Each domain is unique. There can only one of each in the world.

Hosting is a server space for a website. It’s available 24-7 for anyone anytime it is accessed. Websites usually contain coding that shows what the site visitor would view as a website.

Finally, the website coding can reside in the hosted web space. That’s what makes the site appear. Or the coding may just jump off (redirect) to go to a different address.

My favorite analogy is to a house. There’s an address (domain name). It’s rented each month (hosting) so one can show off its furniture (web coding). It doesn’t matter whether there’s a little or lots of furniture – they pay rent (hosting).

No Written Hosting or Domain Contracts Required
No Written Hosting or Domain Contracts Required at CharlesWorks

Does your web company require hosting or domain contracts? Reputable ones won’t. They’re willing to ALWAYS provide the best service to you instead of just before contract renewals.

Contact your hoster to determine whether they’ve locked you in or you’re free to move where you can get the best service.