Use Rocket-Nginx under RunCloud

Login as root then enter following commands. cd /etc/nginx-rc git clone https://github.com/satellitewp/rocket-nginx.git cd rocket-nginx cp rocket-nginx.ini.disabled rocket-nginx.ini php rocket-parser.php As of version 2.1.1 there is a typo in the rocket-nginx.ini , change media_header to medias_header My template: https://gist.github.com/Dibbyo456/2b08a4ff74665ccc40e0985b8f22292a Create file {app-name}.location.main-before.rocket.conf

Upgrade cURL to latest version on Ubuntu

Tested on Ubuntu 16.04 only. Login as root then do the following: mkdir latestcurl cd latestcurl apt build-dep curl If E: Unable to find a source package for curl error appears then do the following otherwise skip the below part. sed

Tweaking WP Rocket

Edit function get_subscribed_events() on /wp-rocket/inc/classes/subscriber/admin/Settings/class-page-subscriber.php //[ ‘add_imagify_page’, 9 ], Edit function render_page() on  /wp-rocket/inc/classes/admin/settings/class-page.php /*$this->heartbeat_section(); $this->addons_section(); $this->cloudflare_section(); $this->sucuri_section();*/ Add to functions.php or wp-rocket.php /** * Clean Up WP Rocket. */ add_action( ‘init’, function() { // Hide account info. defined( ‘WP_ROCKET_WHITE_LABEL_ACCOUNT’

Create Self-Signed SSL Certificate in Windows

Download Full version EXE (64 bit) from OpenSSL Installer for Windows. Install files at C:\Program Files\OpenSSL Change OPENSSL_CONF variable in ENV Path. Goto C:\Program Files\OpenSSL\bin Create file domains.ext enter this codes. change/add your domains. authorityKeyIdentifier=keyid,issuer basicConstraints=CA:FALSE keyUsage = digitalSignature, nonRepudiation,

Optimal Settings & Tweaking UpdraftPlus

Optimal Settings: Untick ❌ -> UpdraftPlus Automatic Backups Untick ❌ -> Automatic updates Tick ✅ -> Backup more databases Tick ✅ -> Delete local backup Tweaking: Add below codes to: updraftplus.php /* Disable top admin bar */ defined( ‘UPDRAFTPLUS_ADMINBAR_DISABLE’ )

Disable cURL SSL verification in WordPress

/** * Don’t verify SSL certificates */ add_action( ‘http_api_curl’, function( $handle ) { curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, false ); curl_setopt( $handle, CURLOPT_SSL_VERIFYHOST, false ); });

Things to do after installing RunCloud

Some few things I do after connecting a server to runcloud. MySQL Create /etc/mysql/conf.d/custom_config.cnf with the following contents: [mysqld] # Disable binary log skip-log-bin # Set default MySQL character set and collation # Source: https://coderwall.com/p/xdrjxg/proper-mysql-character-set-and-collation-setup character-set-server = utf8mb4 collation-server =

Add headers to certain directories in Nginx under RunCloud

Sometimes we wants to add custom http headers to certain directories and their files. For example: I wanted to add X-Robots-Tag header to some some private directories so it does not get indexed. I’ve tried many methods in the internet

My Sublime Text 3 settings & packages

Few days ago I changed my default text editor from Notepad++ to Sublime Text. The main reason I switched because I wanted to improve my development workflow and I must admit it very much did indeed. I have been using

Use WP Smush without slowing down WordPress

I use WP Smush to compress images in WordPress. But lately the plugin became extremely slow because of excessive database queries. The media library takes 10 seconds to open while the plugin is active but takes only 2 seconds when

WP Rocket Hooks

after_rocket_clean_post action is fired after clear cache of a post. add_action( ‘after_rocket_clean_post’, function( $post ) { if ( $post->post_name == ‘foo’ ) { rocket_clean_files( ‘https://example.com/foo/’ ); } }); after_rocket_clean_domain action is fired after clear cache of whole domain (clear all

WP Smush using WP-CLI

If you use WP Smush then you should know that you can use it via WP-CLI too. This feature became available since the version 3.1 Here are some commands: /** * Optimize image. * * ## OPTIONS * * [–type=<type>]

Remove any action or filter in WordPress

Sometimes we need to remove actions or filters added via Themes or Plugins. To remove a action or filter check mekshq.com’s guide. But sometimes that is not enough, sometimes some hooks are too stubborn to remove. In that case use