Tropical Web Works

  • Home
    • Blog
  • Services
    • Turnkey Service
    • WordPress Site Maintenance
  • Portfolio
  • About
  • Contact
You are here: Home / Archives for WordPress

Contact Form 7 and Validation Errors

May 1, 2016 by Sonja Ray Leave a Comment

The WordPress plugin Contact Form 7 version 4.4 introduced a new Configuration Validator. This feature checks contact form configurations to find errors that might result in mail delivery failures or other problems. When you first update your Contact Form 7 plugin to version 4.4 or later, you are invited to validate your forms. When the validator reports that there are errors, it’s not always obvious what the problem is.

First, note that the validator checks for configuration settings that can cause problems in some hosting and mail environments, usually as a result of anti-spam/anti-scam email settings. Just because an error is reported, it doesn’t mean that your form won’t work. The validator does nothing to your form. If it worked before, the likelihood is that it still works. But be aware that if the mail server that handles your Contact Form 7 emails is changed to use stricter mail policies, your form could stop working. So it’s a good idea to pay attention to any reported errors and fix them.

This email address does not belong to the same domain as the site

The most common error I’ve encountered so far is “This email address does not belong to the same domain as the site.” See the image below:

The most common configuration error seems to be "This email address does not belong to the same domain as the site."
The most common configuration error seems to be “This email address does not belong to the same domain as the site.”

This means that the email address used for the From: field is set to a different domain than the website on which the form is used. When creating a new contact form, it’s common to put a tag for the user’s email (as they entered it in the form itself) as the From address. But many email providers and email programs flag as spam any email that’s coming from a different domain than the domain in the From field.

For example:

A person named Jane Doe, in filling out my contact form, enters janedoe@example.com as her email, which has the input name “your-email.” The Contact Form 7 “Mail” settings use [your-email] as the From address. Contact Form 7 would use that to plug in janedoe@example.com as the From email address. But the email is actually being sent to me from the mailserver for tropicalwebworks.com. This could result in a delivery failure if the mail server and/or email program settings consider that only email from tropicalwebworks.com should be sent out from tropicalwebworks.com. So I should put something like noreply@tropicalwebworks.com as the From address.

But but but……. if I use that as the From address, then when I receive Jane’s email, I can’t just hit “Reply” to get back to Jane, because the reply would go to noreply@tropicalwebworks.com.

The fix for this is easy. You simply add Reply-To: [your-email] or Reply-To: [your-name] <[your-email]> in the Additional Headers field in your mail settings.

Use the Additional Headers field to add the user's email address as the Reply-To: address.
Use the Additional Headers field to add the user’s email address as the Reply-To: address.

When you set up your Contact Form 7 form like this, then when you hit “Reply” in your email program, the reply will go to the user’s email address, not to yourself, AND you avoid tripping anti-spam triggers.

This field can be empty depending on user input

Another common error is “This field can be empty depending on user input.” See the screenshot:

"This field can be empty depending on user input" is another common validation error.
“This field can be empty depending on user input” is another common validation error.

This error often appears for the Subject: field, and it happens when the form contains a field for the user to fill in a subject but doesn’t make that field required. The fields To:, From:, and Subject: must contain something. Additionally, the “Message Body” should generally not be left blank either, but it’s not as critical as the other fields. This particular error is easily fixed by adding an asterisk in affected form field to make the field required, like so:

Make the field required by adding an asterisk after the field type.
Make the field required by adding an asterisk after the field type.

This field has syntax errors

The most head-scratching error that I’ve encountered so far is “This field has syntax errors.” See the screenshot:

This field has syntax errors.
This field has syntax errors.

This one almost made me crazy. It said the Additional Headers field had syntax errors regardless of whether I put Reply-To: [your-email] or Reply-To: [your-name] <[your-email]> or Reply-To: <[your-email]>. I know that all 3 of those variations work just fine, because I use them elsewhere without getting validation errors. I tried deleting everything from the Additional Headers field, saving the form, and re-adding it. I tried every variation I could think of. I tried renaming the email field — I tried youremail, myemail, testemail. I tried putting a return character at the end, and two return characters. Nope. No matter what I tried, I still got this maddening validation error. I examined and re-examined the mail settings in other forms where I use this exact same setting, and I couldn’t find a single difference.

Finally, I noticed something. In the form itself, the email field in the offending form was [text* your-email]. In the forms without configuration errors, the email field was [email* your-email].

So, it turns out, the solution to the mysterious syntax error message is to make sure that the email field is designated as an email field, not as a text field.

Be sure to set the email field in your form to be type "email" and not type "text."
Be sure to set the email field in your form to be type “email” and not type “text.”

At last, victory is mine! No configuration errors. Test to make sure the dang form actually works, and I’m good to go.

Filed Under: WordPress

Using WordPress Shortcodes To Make Complex Things Easy

February 3, 2016 by Sonja Ray Leave a Comment

MLS Listings can be displayed on a page by using a simple shortcode.
MLS Listings can be displayed on a page by using a simple shortcode.

I’ve been digging deeply into WordPress over the past few years, learning how to integrate custom programming and database functions into the WordPress framework. The biggest challenge for me was figuring out how to do complex things like allowing visitors to search the MLS database of real estate for sale. This involves first displaying a search form, then having that form submission result in a search of the MLS database for properties matching the criteria in the form, then displaying the search results (with pagination), with each listing containing a link to a details page for that listing. And then the details page has to pull the listing’s details from the MLS database and display all the details. And all the photos.

And to make it more complicated, my real estate clients also need to be able to display MLS listings on pages based on pre-defined searches — for example, all the single-family homes for sale in Punta Gorda that are on the water and have a pool, or all the condos in Port Charlotte under $200,000. My real estate clients are Realtors, not website programmers, so that part had to be easy for them. I’ve learned that making complex things easy can sometimes be harder than doing the complex thing in the first place.

It turned out that once I got my head around how WordPress’s shortcodes work, it wasn’t that hard. Tedious, yes, but not that difficult.

Here’s what a Realtor might put on a page to show single-family waterfront homes in Punta Gorda with a pool:

[showlistings city="Punta Gorda" proptype="SFH" waterfront="y" pool="y"]

Simple enough for almost anyone. Behind the scenes, it’s a bit more complex. When WordPress sees that shortcode in a page or post, it triggers a whole pile of code that searches the MLS database for properties meeting those search criteria and displays them on the page. And triggering that code isn’t particularly difficult.

First, I register the shortcode with WordPress in the functions.php file — identifying the name of the shortcode (in this case, “showlistings”) and the php function that will be triggered by that shortcode. It looks like this:

add_shortcode( 'showlistings', 'getMLSListings' );

Then I add the php function that finds out what search criteria were used in the shortcode, searches the database for properties matching those critera, and displays matching listings on the page. That function looks like this:
function getMLSListings($atts) {
(Hundreds of lines of code here to read the attributes of the shortcode, search the database, and display the listings)
}

First the function checks the attributes ($atts) of the shortcode to find out that the shortcode says “Punta Gorda” for city, “SFH” (which stands for single-family homes) for property type, “y” for waterfront, and “y” for pool. Then using those criteria, it builds the database query, connects to the database, runs the query, gets the links for the photos, and outputs the whole shebang to the WordPress page.

From my pre-WordPress days, I already had code written to search the MLS database and display the listings. It needed changes to make it display nicely within WordPress and to bring it up to date by making it mobile-responsive, but that wasn’t too terribly difficult.

Also, since I keep the MLS listings in a whole separate database from the WordPress site’s database, I had to learn how to access a different database from within WordPress. Prior to that project, I had never previously had to access two different databases within one site. But I have found over the years that I can learn just about anything from Google University. I love the internet, I love Google, and I love all the people out there who write all those helpful tutorials and informational articles that help me find out what I need to know.

I’ve recently had to set my sights on javascript and learning to integrate custom javascript and jQuery within WordPress. That’s a whole ‘nother kettle of fish. I’ve never been a javascript master, and it’s taken me a lot of effort to figure out how to do various things with javascript & jQuery. But that’s a topic for another day.

This is the result of a [showlistings] shortcode:

MLS Listings can be displayed on a page by using a simple shortcode.
My Realtor clients can display MLS Listings on a page by using a simple shortcode.

Filed Under: MySQL, PHP, WordPress

Finally, The Cobbler’s Children Get Shoes!

February 2, 2016 by Sonja Ray Leave a Comment

The cobbler's child finally got a pair of shoes.
The cobbler’s child finally got a pair of shoes.

Long after my website began looking outdated, I have finally created a new and improved Tropical Web Works site! The old saying is often true that the cobbler’s children have no shoes, because the cobbler is so busy making shoes for his paying customers that he has no time to make shoes for his own children.

I’ve been moving toward using WordPress for most of my clients’ sites. This site itself now runs on WordPress, using a carefully selected set of plugins, such as SuperCache to speed up the site, some spam-prevention plugins, a backup plugin, and several others.

I used the Agency Pro child theme with the Genesis framework. It’s no secret that I’ve long been a fan of the StudioPress Genesis themes, and I’m diggin’ this theme. I have a “splashy” home page without the long wait and search engine penalties of a Flash/splash page. It’s easy to highlight my recent client work. The site is fully responsive so that it displays nicely on smart phones, tablets, laptops, and big desktop screens. It takes advantage of some of the newest CSS and HTML properties.

And… with any luck… it will encourage me to practice what I preach. I tell my clients to keep their sites updated — but I don’t. I tell my clients they need to blog regularly — but I haven’t. I tell my clients they need to have mobile-friendly sites — but I didn’t. I tell my clients they need a business Facebook page  and post to it regularly — but I didn’t.

This is what I felt like over the weekend.
This is what I felt like over the weekend.

This cobbler is busy enough with client work during the week that I cobbled together my new website over a week-end, so there might be some problems. I haven’t done quality testing as extensively as I would for a client’s site before taking it live. So yes… I still have a touch of cobbler syndrome. Recognizing I have a problem is the first step toward solving it.

 

Filed Under: WordPress

StudioPress Themes

July 21, 2011 by Sonja Ray 4 Comments

The Charlotte Harbor Community Sailing Center uses the Lifestyle theme.
The Charlotte Harbor Community Sailing Center uses the Lifestyle theme.

I broke down not long ago and bought the StudioPress Pro Plus All-Theme Package — a collection of themes that are all based on StudioPress’s Genesis framework. I have not previously been a WordPress power-user, and I hadn’t previously used WordPress all that much. So I’ve been reluctant to spend money on commercial themes when there are so many free themes readily available. But something about the StudioPress design approach, and their attention to detail and customizability has been catching my eye for a long time.

When I realized how powerful and capable WordPress has become, I knew I needed a collection of themes that I could customize and re-use over and over, so that I didn’t have to keep spending hours hunting for a suitable theme, and then more hours learning how to customize it.

The StudioPress designs are attractive: clean and elegant, not cluttered. The themes are fully widgetized, with plenty of built-in customization options, plus a special plug-in to take advantage of the “hooks” that the Genesis framework uses. They’re mobile responsible and built with HTML5, so they’re able to take advantage of all of the most recent technological advances in website architecture.

There’s a built-in subscription form. Default layout options – Content-Sidebar, Sidebar-Content-Sidebar, extra custom menus in the header. Drop-down menus. Many of the StudioPress themes offer color choices and other extras. Oh, and they’re very search-engine optimized.

One of my favorite aspects is that StudioPress explicitly allows me to use these themes on clients’ sites. I can send a client to the main StudioPress Themes page and tell them, pick out any one that you like, they’re all already paid for.

I created a site for the Charlotte Harbor Community Sailing Center on the Lifestyle Theme. I have to say, I love the Lifestyle theme. I’ve used the Lifestyle theme for several client sites, and I’ll probably switch a couple of others over to Lifestyle. It’s a very clean, elegant design, easy on the eyes, easy to customize, and easy to navigate. Magazine Pro is another favorite. This site uses Agency Pro.

StudioPress Premium WordPress Themes

Filed Under: WordPress

WordPress Upgrade

July 17, 2008 by Sonja Ray Leave a Comment

WordPress version 2.6 just came out. I installed it from scratch on a new blog. The installation went beautifully, and I liked the new Admin interface. [Read more…]

Filed Under: Rants, Software, WordPress

Tropical Web Works

  • Home
  • Services
    • WordPress Site Maintenance
    • Full-Service Website Design & Development
  • Portfolio
  • About Tropical Web Works
  • SEO
  • FAQs
  • Glossary
  • Blog
  • Contact

Recent Posts

  • Corr Commercial Advisors September 25, 2019
  • Blue Water Surfing November 8, 2016
  • Charlotte Harbor Boat Storage November 8, 2016
  • “Your mailbox quota is full” Scam May 5, 2016
  • Contact Form 7 and Validation Errors May 1, 2016

Topics

Search

Top Posts & Pages

  • Website Design That Works

Facebook

  • Facebook

Get Started Today

We'd love to hear about your upcoming project. Tell us about it by filling out our contact form. Or, email us at sonja@tropicalwebworks.com or give us a call at 941-916-5671.

Tropical Web Works

  • Home
  • Portfolio
  • Services
  • About Tropical Web Works
  • FAQs
  • Search Engine Optimization
  • Glossary
  • Blog
  • Links
  • Portfolio
  • Search Engines
  • Technology
  • Rants
Copyright © 2003-2026 Tropical Web Works. All rights reserved.
Designed by Tropical Web Works • Privacy Policy • Archives