diff --git .travis.yml .travis.yml
index 7eeff03..3b65331 100644
--- .travis.yml
+++ .travis.yml
@@ -27,16 +27,22 @@ matrix:
   - php: hhvm
   - php: nightly
 before_install:
+- |
+  if [[ "$WP_TRAVISCI_CUSTOM_BEFORE_INSTALL_SRC" ]]; then
+    echo "Running custom BEFORE_INSTALL from $WP_TRAVISCI_CUSTOM_BEFORE_INSTALL_SRC"
+    wget -O /tmp/custom-before-install.sh "$WP_TRAVISCI_CUSTOM_BEFORE_INSTALL_SRC"
+    source /tmp/custom-before-install.sh
+  fi
 - WP_CORE_DIR=/tmp/wordpress/
 - git clone https://github.com/WordPress/twentysixteen.git src/wp-content/themes/twentysixteen
 - |
   if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
-      mysql -e "CREATE DATABASE wordpress_tests;" -uroot
-      cp wp-tests-config-sample.php wp-tests-config.php
-      sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
-      sed -i "s/yourusernamehere/travis/" wp-tests-config.php
-      sed -i "s/yourpasswordhere//" wp-tests-config.php
-      svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
+    mysql -e "CREATE DATABASE wordpress_tests;" -uroot
+    cp wp-tests-config-sample.php wp-tests-config.php
+    sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
+    sed -i "s/yourusernamehere/travis/" wp-tests-config.php
+    sed -i "s/yourpasswordhere//" wp-tests-config.php
+    svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
   fi
 - |
   if [[ "$WP_TRAVIS_OBJECT_CACHE" == "true" ]]; then
@@ -44,10 +50,30 @@ before_install:
     echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
   fi
 before_script:
+- |
+  if [[ "$WP_TRAVISCI_CUSTOM_BEFORE_SCRIPT_SRC" ]]; then
+    echo "Running custom BEFORE_SCRIPT from $WP_TRAVISCI_CUSTOM_BEFORE_SCRIPT_SRC"
+    wget -O /tmp/custom-before-script.sh "$WP_TRAVISCI_CUSTOM_BEFORE_SCRIPT_SRC"
+    source /tmp/custom-before-script.sh
+  fi
 - npm install -g npm
 - npm install -g grunt-cli
 - npm install
-script: grunt $WP_TRAVISCI
+script:
+- |
+  if [[ "$WP_TRAVISCI_CUSTOM_SCRIPT_SRC" ]]; then
+    echo "Running custom after_script from $WP_TRAVISCI_CUSTOM_SCRIPT_SRC"
+    wget -O /tmp/custom-script.sh "$WP_TRAVISCI_CUSTOM_SCRIPT_SRC"
+    source /tmp/custom-script.sh
+  fi
+- grunt $WP_TRAVISCI
+after_script:
+- |
+  if [[ "$WP_TRAVISCI_CUSTOM_AFTER_SCRIPT_SRC" ]]; then
+    echo "Running custom after_script from $WP_TRAVISCI_CUSTOM_AFTER_SCRIPT_SRC"
+    wget -O /tmp/custom-after-script.sh "$WP_TRAVISCI_CUSTOM_AFTER_SCRIPT_SRC"
+    source /tmp/custom-after-script.sh
+  fi
 notifications:
   slack:
     rooms:
