fbpx

Working on M Media hosted WordPress sites as a developer

Editing child-themes and plugins

At M Media, we believe that no editing should be made on live/production sites directly. Instead, we spin up a local server on our machines and then develop safely in an isolated enviorment. We then use a version-control software, like GitHub, to keep track of changes and to host our most up to date and working code.

In the case of themes and plugins, we publish the edited files to GitHub, at which point another plugin like git-updater.com pulls in the new version from GitHub to the appropriate production site or sites. This workflow ensures that we don’t make any serious breaking changes on production sites, and it leaves everyone feeling more confident in the code they write. Furthermore, using a version-control system like GitHub allows us to see exactly the changes that have been made, and if need be, rollback to a previous version.

To create a child theme, you can temporarily use a plugin like Child Theme Generator. As stated in the FAQ of this plugin, once the child theme is generated, you can safely remove this plugin. You should then create a backup of the site (using a plugin of your choice), download and install the site locally onto your machine, and continue to develop offline on your computer. Because you will only be working on your child-theme and plugins, you can host those specific files/directories on GitHub and use the workflow as described previously.

A quick note on plugins vs. themes

This document describes what a theme is, and what it’s not

Please note that your theme should mostly concern itself with the presentation of content. The majority of functionality, if not all of it, should be in a plugin, as per the official WordPress docs. Make sure to have a read through the documentation to fully appreciate the difference.

Editing code on production sites

While strongly not recommended, it is possible to edit files directly on WordPress using the built in code editor.

Editing core WordPress files and themes

It is not recommended to edit core WordPress files, as they are vital to the operation of WordPress and any changes may be automatically overwritten on next update. The same is true for themes not authored by you.

Using FTP

If the WordPress site is hosted on an M Media server, you will not have access to the File Transfer Protocol. This is both by design and as part of our security policy. Giving FTP access opens up the possibility to make serious breaking changes on client sites, so because of this FTP is unavailable on our servers. To edit files, consider using a more robust and industry-standard approach with a version-control system like GitHub.

Leave a Reply