About Joyce Cimbalista

This author has not yet filled in any details.
So far Joyce Cimbalista has created 40 entries.

Changing the URL of a WordPress website

Recently a client bought a new domain name and wanted the existing WordPress site to change its domain to use the new one instead of the current one. After much research, I created and followed a plan for changing the URL of a WordPress website.

Here are the steps I followed (one.com is the existing domain and two.com is the new domain):

  • Make sure the new domain is parked or pointing to default servers.
  • There are a few methods to change the WordPress Site URL and Home settings, but I chose changing it via PhpMyAdmin.
  • In the hosting, set the primary domain for the hosting to be two.com.
  • Set up a 301 permanent redirect for one.com to point to two.com.
  • Log in to the dashboard. Go to Permalinks and just Save/Update.
  • The SSL certificate adjusted automatically.

A few plugins needed settings adjusted, but that was it!

Implementing Form Script that Works with php 7

I recently upgraded hosting to php 7.0 since some of my WordPress sites were recommending the upgrade. The WordPress sites were fine, but one of my two last remaining HTML sites was using the Huggins Email Form php script, which isn’t compatible with php 7.0, and so the form started getting server 500 errors.

I looked up a resource I had used for a form for another HTML site, which was the ReusableContact Form Using Bootstrap And PHP.

Just download the zip file, and extract to the root directory for the site.

To test it, see the steps listed on the page where you got the zip file from.

To completely integrate it, I followed these steps:

  • Edit src/formhandler.php to change the email Subject and From.
  • Add any form field validations to handler.php.
  • If you’re using recaptcha, put the site key in the form (you’ll see the example in the formpage.html file), and put the secret key in handler.php.
  • Also, put the destination email address in handler.php.
  • Make sure you refer to the example formpage.html for including the link rels and script statements in the header and the recaptcha script in the body.

The next challenge was implementing a second form for that site. Fortunately the forms were on separate pages, so I didn’t need to use different form ids. I was able to use a generic Subject for both form emails, so no changes needed there. The second form worked fine. I suppose if I needed separate Subjects, separate recipients and separate field validation for each of the forms, then I’d need to figure out how to modify handler.php and formhandler.php. At some point, though, both of the remaining HTML sites will be converted to WordPress and I won’t need form scripts anymore!

 

Error trying to send your message with Contact Form 7 and reCAPTCHA v3

I’m using Contact Form 7 v5.1.1 on my WordPress sites along with reCAPTCHA v3, but when I test a contact form, I get the error: “There was an error trying to send your message. Please try again later.”

The error is outlined with an orange border, which means it’s a spam problem.

After going round and round with Post SMTP plugin, MailGun, and SendGrid, I finally find some information in this post about the Advanced noCAPTCHA Invisible CAPTCHA plugin. It’s an alternative that worked for me. Some users opted to revert back to reCAPTCHA v2 and/or older versions of Contact Form 7.

Install the Advanced noCAPTCHA Invisible CAPTCHA plugin. Remove any integration setup you have for Contact Form 7 with reCAPTCHA. Go to google.recaptcha.com and get your v3 keys and enter those in the settings of Advanced noCAPTCHA Invisible CAPTCHA.

My forms started working immediately. I no longer needed the Post SMTP plugin or SendGrid.

 

Why Google Tag Manager Isn’t Tracking Your YouTube Video Event

Tracking YouTube Videos with Google Tag ManagerWhile working on a recent project, I discovered one reason why Google Tag Manager may not be tracking your YouTube video event. Being new to Google Tag Manager and Video Tracking, I assumed the reason that playing the video on my page wasn’t triggering a video event was due to a newbie mistake. After Googling for a while, I read a couple of posts where it was mentioned that this could be due to the way the video is embedded in the page. The light bulb went off!

I was using InfusionSoft’s Landing Page Builder and had inserted a video element in the page. I had pasted the YouTube video URL into the field, but after saving, it had transformed the URL. To get around this, I added an HTML element into the page and pasted the YouTube embed code for the video. Saved it, tested, and success! Google Tag Manager triggered the video event! Using an HTML element allows you control over exactly how the video is embedded.

Another plus of embedding the video this way is that I can append “?rel=0” to the video URL so that when my client’s video stops playing, the suggested videos are other videos on her channel and not just random videos from YouTube.

 

YouTube Video Tracking with Google Tag Manager, Zapier, and InfusionSoft/Keap

Tracking YouTube Videos

I recently worked on a project that started out with an InfusionSoft/Keap Campaign. My client wants to send out a series of emails, with each one containing a link to an InfusionSoft/Keap landing page containing a video. She wants to know whether the contact watches 90% of each of the videos. The videos are unlisted on YouTube.

After much searching, I found out that I could use Google Tag Manager for video tracking. GTM would then send the information to a Zapier webhook, which would then send the information to InfusionSoft/Keap.

Here is how I set it up:

InfusionSoft/Keap Steps:

In InfusionSoft/Keap, create the tag, such as Watched_Video. Using the new Landing Page Builder, create a landing page with a YouTube video embedded. Do Not Use the Video element for the video – use an HTML block and paste the embed code for the video into the block. It didn’t work using the Video element because IS reformats the URL that you paste into the Video element and then for some reason, Google Tag Manager can’t pick up on the video event.

When the Landing Page is complete, copy the Landing Page URL. Next, create an email. In the email, create a hyperlink to the Landing Page by pasting the Landing Page URL. Append the following to the URL:

?Email=~Contact.Email~

This will ensure that the contact’s email address can be picked up by Google Tag Manager and then passed back to Zapier and then to IS.

Zapier Steps

In Zapier, create a Zap. Step 1 is Trigger – Webhooks by Zapier. Choose Catch Hook.
Pick off a Child Key – leave blank.
View Webhook – looks like https://hooks.zapier.com/hooks/catch/1111111/pochxn/
Step 2 is Action – Infusionsoft App
Set up Infusionsoft Tag Existing Contact
Email (required)
Tag Names – it will go look for the tag in IS – in this example, the tag is “Watched_Video”.

Google Tag Manager Steps

Go to tagmanager.google.com, and create an account if you don’t have one.
It will give you script code that goes in head and in body of the page that contains the video, so go back to InfusionSoft and edit the Landing Page. In the last step (Launch), there are places to add code that goes in the Head and Body sections. Paste the GTM script code in those sections.

Create a container.

Configure the variables – they are not all turned on for the container by default. Once they’re turned on, then you can choose from them. To Configure them, go to Variables>Configure and then check them all off.

Create a custom user variable such as user_EmailAddr1

This is used to hold the contact’s email address and send it to Zapier.
Variable Type is URL.
Component Type is Query.
Query Key is Email (note that case is important here – look back at the text that we appended to the Landing Page URL – we used ‘Email’ not ’email’. So make sure to type it in correctly)
More Settings – Page URL/Default
Check the box URI-decode cookie
For now, you will have to leave “References to this variable” blank because we haven’t set up that tag yet. Once that tag is set up, come back here and make sure to enter the new tag as the Reference for user_EmailAddr1.

Create a Trigger

Give it a name, such as Watched Video 1
Select Trigger Type – YouTube Video
Track Start, Complete, Progress – put in 90 for 90 percent
Under Advanced, check this box: Add JavaScript API support to all YouTube videos
Trigger fires on some videos
Video URL contains – get the unique code from the video’s url, such as iNUGeTXXyTA
Video Percent greater than or equal to 90
Save

Create a new Tag called user_EmailCookie1.

Tag type is Custom Image (we’re not using an image, but this option handles URLS, which is what we need)
Image URL is the hook from Zapier: https://hooks.zapier.com/hooks/catch/1111111/pochxn/?email={{user_EmailAddr1}}
Append this to the URL: ?email={{user_EmailAddr1}}
That will send the email address of the contact to Zapier
Make sure to use the Custom User Variable that you created
Check the box Enable Cache Busting
Parameter should be gtmcb (not sure why, this was the default value)
Advanced settings should all be blank
Set the firing Trigger to be the one you set up.

Everything is set up now. Make sure everything you set up has been Saved, then Publish it.

Testing

Use Chrome Extension “Google Tag Assistant” to watch it in action.
GTA will show up automatically at the bottom of the page you’re testing since it detects the GTM script in the page.
If not, just click the GTA icon in the bar.

You should see the actions taking place and the tag being executed. Check in Zapier to ensure that the task was completed. Check in IS to make sure the contact was tagged.

Thank you to AKATheAlchemist, who has a video that explains the same type of setup.

 

Unknown Collation Error Migrating Newer MySQL DB to Older MySQL DB

Today I will explain how I was able to fix the Unknown collation error when importing a MySQL database.

I was moving a completed WordPress site this weekend from my hosting account to a client’s hosting account and was surprised to receive an error upon importing the database into the new empty database.

The error was:

Unknown collation: ‘utf8mb4_unicode_520_ci’

Upon Googling it, I discovered that this is a typical error when importing a database from a newer version of MySQL to an older version of MySQL.

The solution was pretty simple. Export the database in a format that is compatible to both, which turned out to be MYSQL40.  I also chose that format when importing the database. Worked fine and I was back on track again.

Update: 2/25/2019

I just did another export/import to move a development site to ‘live’.

This time I got this error: ERROR 1115 (42000): Unknown character set: ‘utf8mb4’

One of the solutions I found while googling was to edit the exported SQL file with a text editor and replace all ‘utf8mb4’ with ‘utf8’.

So I tried that, and then got the same error as before: Unknown Collation: ‘Utf8_unicode_520_ci’

A different solution that the one I used originally was to edit the exported SQL file and replace ‘utf8_unicode_520_ci‘ with ‘utf8_unicode_ci‘.

So I imported the modified SQL file and it worked!

 

Changing WordPress Max File Upload Size

I was Googling around, looking for an easier way to change the max file upload size when uploading files to the WordPress Media library and ran across this post on Brian’s Tips and Tricks for Web Developers website.

You can easily change PHP values by going to the Select PHP Options page under Select PHP version in the Software section of cPanel. When you’re on the Select PHP version page, choose Switch to PHP Options at the top right.

Click on the value, make a selection, Apply and Save.

Troubleshooting Reasons for an Unusually Large WordPress Database

My client informed me that when she viewed her website, it was displaying the “Error Establishing Database Connection” message.

When I went to wp-admin, it was displaying another similar message about the database. I logged into the Control Panel and was able to view the database in PHPMYADMIN. I checked to make sure the database name, username, and password matched. Called GoDaddy and found out that the database was over the limit allowed by the hosting plan and so the database user was disabled. We had one week to resolve the issue either by reducing the size of the large WordPress database or moving to a hosting plan that had unlimited database space.

I  browsed the database using PHPMyAdmin, and eventually found that there were over 1 million records in wp_posts! Next, I asked the client to move to a higher level hosting plan and got the site back online. There were only about 1,000 actual posts when viewing Posts from the Dashboard. I continued to browse wp_posts and finally something caught my eye. There were lots of posts of Post-type Http, and a field contained ‘core_control_http_log_item’. I Googled the character string and came up with one match! Googled translated the page from French and I found the answer. It was the Core Control plugin, which had been active for several months and had been logging activity in the database. I had been using it to debug Paypal connection problems and had not disabled it.

Next, I had to remove all posts of post-type http. I used the query:

DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = ‘http’.

I hope this may help someone else who discovers that they have a large WordPress database that shouldn’t be so excessive in size and need to find the reason why.

How to Troubleshoot Contact Form 7 Configuration Error

Process of Elimination for Contact Form 7 Configuration Error

I use the Contact Form 7 plugin on almost all of the WordPress sites I create. Recently, I was creating a very long form, saving frequently, and then noticed there was a configuration error: “Multiple form controls are in a single label element. ”

I looked through the code and nothing jumped out at me that could have been wrong.

So I thought, how am I going to find the error? There were almost 50 input fields!

Answer: Process of elimination

I opened up Notepad, copied the entire form, and pasted it into Notepad.

Next I went back to the form, and deleted all but the top several fields. Saved it. No error.

This told me that the error was somewhere in the remaining part of the form.

I copied the next few fields from Notepad and pasted it at the bottom of the form.

Saved again. The error showed up! So now I knew the error was in the fields I had just pasted.

So, I used this process to isolate the part of the form with the error. It saved a lot of time that I would have spent going over the code repeatedly, looking for some problem.

I hope this tip will save you time. It can be applied in situations other than just html forms, too.

Turned out the error was a misplacement of the closing ‘label’ tag.

Embedding Javascript HubSpot Contact form into DNN page

I found that just pasting the HubSpot javascript code into the DotNetNuke HTML module wouldn’t work – the editor just erases the javascript.

After Googling around for an hour or two, I found this article, How to Integrate HubSpot Forms with LeadPages, by Mike Hollis, on DoInbound.com’s blog. He created a ‘quick little script’ that converts the HubSpot Javascript to HTML. I plugged in the Portal ID and Form ID, copied the resulting HTML, pasted it into the HTML module, and it worked!

Thanks Mike!