Posts by: Andy Moyle

Weird characters appearing on WordPress posts

  |   By  |  0 Comments

If weird characters suddenly appear on your blog posts and pages. Don’t panic. You may see Don’t instead of Don’t for instance. This can happen when a database is restored or updated because the character set has been changed Here are some common examples… “ = left quote = “” = right quote = ” […]

Continue reading...

Finding bad code in a WordPress Install

  |   By  |  0 Comments

A premium WordPress plugin client was having some trouble with their site. Some of my Javascript had stopped working because of a javascript error from another plugin/theme. Unfortunately their javascript wasn’t enqueued and I was struggling to find how it had got there. I only had site access and no FTP or shell to search. […]

Continue reading...

Posting a WordPress shortcode without it being processed

  |   By  |  0 Comments

I often want to show a shortcode in a tutorial post without it actually processing the shortcode. For example Name EmailContact NumberSubjectMessageThis contact form only works with Javascript enabled In the old classic editor, you could switch to Text and use the html entities [ becomes [ ] becomes ] so you could use [contact_form] […]

Continue reading...

Spam free contact form

  |   By  |  0 Comments

I have recently updated my Never Loose Contact form plugin for WordPress websites. I originally wrote it because I wanted a simple Spam proof contact form that saved the messages to a database, in case the emails went AWOL. In it’s first few iterations it blocked contact form messages with more than 2 hyperlinks in […]

Continue reading...

Enabling the block editor for custom post types correctly

  |   By  |  0 Comments

While updating a WordPress plugin recently I wanted to enable the block editor for a custom post type. Strangely, it is not automatic.After a quick Google, I discovered I needed to add ‘show_in_rest’=>true and ‘supports’=>array(‘editor’) to the arguments for the register_post_type function. All well and good, but no title field appears at the top of […]

Continue reading...

Watch out for SQL injection hackers

  |   By  |  0 Comments

Watch out for SQL injection attacks

I got an error on a booking system for a conference I was trying to book into this week. I happen to live in a town that has an apostrophe in the name and it crashed the booking system and worse gave the query in the error on screen. OopsThe error message made it clear […]

Continue reading...

MySQL dates can’t be 0000-00-00

  |   By  |  0 Comments

After a recent upgrade, some of my MySQL queries stopped working – where it was a DATE column with a default already set to 0000-00-00. That’s not allowed for MySQL v5.7.11 and above. Not simple to change because the error keeps occuring. Here’s how I got round it UPDATE table SET column= “1000-01-01” WHERE column<“1000-01-01”; […]

Continue reading...