• How to use the same WordPress code base for multiple local sites on Windows

    In this blog post I show how to use Windows Symbolic Links when developing and testing a plugin to run on WordPress and WordPress Multisite using a single code base; mklink /J target-dir source-dir

    Background

    • I’ve been developing WordPress plugins for over 4 years.
    • I now have multiple local test environments in my Windows machine.
    • Each is installed in a separate sub-directory of my Apache document root.
    • Some are WordPress 3.9, others WordPress 4.0, others bleeding edge
    • Some are WordPress Multisite

    I’m developing a new plugin that needs work in WordPress, WordPress Multisite from version 3.9 through 4.0.x to 4.1.

    I want to develop the code in one place and test concurrently on the other sites.

    Local development sites

    Directory root /wordpress /wpnn /wpms
    Version 3.9.1 4.0 nn 4.0
    Multisite?
    Contents BuddyPress Primary development whatever oik-ms
    Uses Symlinks

    Symbolic links

    I want to develop oik-clone in /wordpress and test it in /wpms.

    Since it’s a brand new plugin I just need to create the symbolic link.

    cd \wpms\wp-content\plugins
    mklink /J oik-clone \wordpress\wp-content\plugins\oik-clone
    
    Junction created for oik-clone <<===>> \wordpress\wp-content\plugins\oik-clone
    

    I then discovered that I wanted to develop some new code in the oik base plugin, since it’s common code that could be used by other plugins.

    The version in /wpms was 2.3, whereas in /wordpress it was already 2.4-alpha.1012.

    The pragmatic solution was to create a symbolic link to the latest version of the oik plugin.

    rename oik oik-v2.3
    mklink /J oik \wordpress\wp-content\plugins\oik
    Junction created for oik <<===>> \wordpress\wp-content\plugins\oik
    

    Note: I can tell that the directories are symbolically linked since dir on the plugins directory displays JUNCTION.

    17/10/2014  18:07         oik [\wordpress\wp-content\plugins\oik]
    15/10/2014  20:35         oik-clone [\wordpress\wp-content\plugins\oik-clone]
    

    BTW: I’ve removed document_root directory from the above examples.

    See also


    , ,

    Published:

    Last updated:

    October 24, 2014

Categories

Tide times from tidetimes.co.uk

Tide Times & Heights for Langstone Harbour on
Monday, 29 November 2021
High Tide:06:29 ( 4.20m )
Low Tide:12:19 ( 1.80m )
High Tide:18:54 ( 4.10m )

Tide times from tidetimes.org.uk

Tide Times & Heights for Northney on
29th November 2021
06:48 High Tide ( 4m )
12:15 Low Tide ( 1.67m )
19:11 High Tide ( 3.92m )