Author: Nick

  • Cleaning up post content after Wix to WordPress import

    To deal with situations like:

  • Increase PHP memory limit in Laravel Valet

    In /opt/homebrew/etc/php/8.0/php.ini – or whichever PHP version you’re running – find and increase memory_limit to 512M or 1024M or whatever you need to debug. (If the memory_limit line is commented out – i.e. has a prefix of ; – make sure to remove it). You may also need to add the following line to your…

  • Fix 504 Gateway Timeout in Laravel Valet

    Add: In /opt/homebrew/etc/nginx/nginx.conf, right before: All credit to / solution from: https://github.com/laravel/valet/issues/315#issuecomment-1362039656 https://dev.to/aubreypwd/how-i-configured-niginx-valet-to-stop-the-504-gateway-time-out-during-long-xdebug-sessions-174i

  • Pull all remote git branches to local

    Used this when moving away from a git repository that it wasn’t possibly to transfer. Unfortunately the repository had a lot branches that I wanted to keep a copy of just in case. So I used the following bash script to pull them all down locally so I had a backup. Just replace username and…

  • Use –precise if wp search-replace does not get all matches

    I just discovered that you can add the –precise flag when using wp search-replace with WP-CLI. I’ve never needed to use this before, so I wouldn’t suggest using it by default, but I had a site that was stubbornly refusing to replace all instances of a test domain after switching to the production domain and…

  • Solving MySQL error with Laravel Valet on macOS Ventura

    After updating to macOS Ventura, everything seemed to be fine with my Laravel Valet (v4.1.2) setup, but after restarting / doing some other thing which screwed everything, I couldn’t connect to the database properly. I tried everything. In the end how I fixed it was abandoning MariaDB (& removing all any any traces of it),…

  • Resize Pagely images with URL parameters & PressThumb

    Pagely doesn’t resize images that are the wrong dimensions (height / width) on the fly. (Though, if PressThumb is enabled, it will convert them to ‘next gen’ formats and reduce the file size of the image automatically). For example, if you upload an image to the WordPress admin and then later on register a new…

  • Disable adding or updating plugins, themes or WordPress itself in the WordPress admin

    Add to wp-config.php: Useful when managing plugin updates via Composer.

  • Reset WordPress permalinks via WP-CLI

    wp rewrite flush To save having you to do it via Settings > Permalinks… Source: https://developer.wordpress.org/cli/commands/rewrite/

  • Solve 404 error for .well-known/apple-app-site-association file on SpinupWP with Nginx

    I love SpinupWP, but I discovered that the Nginx config was giving 404 errors for the .well-known files used by an app that used the same domain. To solve it – and the .well-known/assetlinks.json file not returning either – I added the following lines to the /etc/nginx/sites-available/{DOMAIN}/{DOMAIN} file for domain on the SpinupWP powered server…