After upgrading WordPress to the newest version, I received the following error message when trying to edit pages and posts in the WordPress dashboard: The editor has encountered an unexpected error. TypeError: Cannot read property ‘DotTip’ of undefined I am presented with three options/buttons: Attempt Recovery, Copy Post Text, Copy Error. Very strange to see Continue reading →
PHP
PHP, or Hypertext Preprocessor, is a sever-side scripting language used to serve the user dynamic web pages. A lot of content management systems are written (partially) in PHP, such as Wordpress, Drupal and Joomla.
Create an Automatic Night Mode on your website
Thanks to a very simple piece of JavaScript code, you can change the (background) colour of your website to reflect the time of day. Your website visitors will see a different version of your website: a dark mode during evening/nights, and a white/bright mode during the day. Here are the steps to follow to have Continue reading →
Resolve WordPress error message: ‘PHP Update Required’
If you recently opened your WordPress dashboard, you may be seen an new banner that warns you about a required PHP update. The message says the following: WordPress has detected that your site is running on an outdated version of PHP.What is PHP and how does it affect my site?PHP is the programming language we Continue reading →
Detect iOS device (iPhone/iPad) in PHP
To detect if the device a user is using is an iOS device, you can use the following code snippet in PHP: This will check if in the user agent string the words ‘iPhone’ or ‘iPad’ occur. You can use this code snippet in your web development projects in order to detect whether your visitor is browser Continue reading →
Hide all WordPress update notifications in dashboard
WordPress has a build-in upgrade system. This system automatically informs you when there is an upgrade available for WordPress, or one of the themes or plugins that are installed on your WordPress installation. To disable this update notification, there is no switch in the settings menu or anywhere else in the admin dashboard. To prevent Continue reading →
Syntaxhighlighter Evolved: change scripts to CDN
I try to maximise my efforts when it comes to page load times. As such, I’m a big fan and user of CloudFlare because it greatly reduced the loading times of my webpages. For the Syntaxhighlighter Evolved WordPress plug-in, I wanted to switch the scripts needed to CDNJS, the CloudFlare CDN for scripts and other static Continue reading →
WordPress: If homepage or index.php
To display content in WordPress only on the homepage (example.com) or on the index page (index.php), use the following code snippet: WordPress: If homepage or index.php was last modified: December 25th, 2015 by Thomas
Update DirectAdmin to PHP 7.0 (CustomBuild)
The web is about to get a whole lot faster! Just this week, HTTP version 2 was released, promising faster page load times. Now it’s PHP which is getting a huge upgrade, which comes with a bunch of new features and improvements. If your server runs DirectAdmin and you are looking to upgrade your PHP Continue reading →
Fix Image Upload “HTTP Error” on WordPress
When uploading an image on my WordPress blog, I received a general error that said HTTP error. As a result, the image upload failed. Luckily, I quickly found a fix. I recently upgraded my PHP version because of the speed improvement and the security patches. So I first tried looking for a permission mismatch somewhere, Continue reading →
Hide “Customize” menu option in WordPress
With the WordPress 4.3 release, the WordPress.org development team made some visual changes to this great CMS. One of them is the addition of a Customize option in the top admin bar, right next to your site’s name. Customize link added in the toolbar to swiftly make changes to your site. It’s great if you frequently make Continue reading →
Show current total of nline visitors with PHP
The following (free) PHP script shows the total number of unique visitors that are currently online on your website, based on their IP address. The first step is to create a file called visitors.db and to change its permissions to 666 via FTP (e.g. with the use of the FTP client FileZilla). This file will be Continue reading →
Google Search Console – “Missing: Updated” WordPress fix
In Google Search Console under Search Appearance > Structured Data, I found many errors for my WordPress website. The errors were all the same, Missing: Updated. This means that for each WordPress blogpost or article, that page did not have the updated microdata. So to resolve this error message, I had to add the missing updated field Continue reading →
Add a canonical tag to WordPress header.php
Adding the canonical tag to your WordPress blog might be essential if you do not want search engines to see your content twice (= duplicate content) and thus giving you a penalty as such. To add this tag, simply go to your theme’s folder and find header.php. Now, add the following somewhere after <head> but Continue reading →
Show file in plain text instead of execute/download in Apache
PHP files, PDF files and others will all be executed or downloaded. If you want to show a file in plain text instead, such as a PHP file, you should instruct Apache to do so. In your .htaccess file, you should instruct your webserver to serve files with a certain extension as plain text to Continue reading →
Output PHP errors on your pages
To output any PHP errors you might have, simply add the following at the top of your PHP file Or add the following to your php.ini file: This should display the errors. Make sure to restart your webserver; if you have Apache, use: Output PHP errors on your pages was last modified: November 27th, 2014 Continue reading →
Change default uploads folder in WordPress
To change the default folder where uploads are stored on your webserver when using WordPress as your CMS, open wp-config.php and add the following line of code: In this case, the folder where uploads are stored is called ‘uploads’ and can be found at example.org/uploads/ and are then, based on your settings, saved in a Continue reading →
Repair a broken WordPress database
If you WordPress blog MySQL database is broken, maybe as a result of manual tweaking, and you get errors, you can let WordPress fix your broken database all by itself. To do so, open wp-config.php and add the following line at the end of that file: This will ‘allow’ your WordPress installation to perform a Continue reading →
WordPress text widget missing after site move
I moved a WordPress database over to a new home and apparently, all of my text widgets where missing. This might also happen when you try to edit your WordPress database in PHPMyAdmin (for example, you tried to manually edit a text widget in your database instead of the UI). To fix this, go to Continue reading →
Add a custom logo to WordPress’ wp-admin login page
The default image you find when you go to example.org/wp-admin is the WordPress logo. To change this is an image of your choice, let’s say the logo of your company, simply add the following code to your functions.php file which can be found in the wp-content/themes/your-theme directory. Of course, make sure that the /wp-admin/images/wordpress-logo.png file Continue reading →