Developers
You can add custom themes and plugins provided:
- The theme or plugin meets our custom code guidelines.
- We only review provided files and not links to plugins/themes
- You will be entirely responsible for applying necessary updates
- If the theme or plugin is a premium (paid) product, you take the risk of purchasing it, even if we decline installation
- We reserve the right to decline installation of a theme/plugin if it doesn’t meet our code guidelines and/or if there already is a CampusPress alternative available
Table of Contents
Submitting Themes
We use Git for managing code. To add themes to your network, please head over to BitBucket and register. Then email contact@campuspress.com with your email address and CampusPress network URL.
All theme additions and edits should be submitted via BitBucket as pull requests with “campuspress”(contact@campuspress.com) user selected as reviewer.
Please see a detailed guide in BitBucket Usage Guide section below.
Once submitted, our team will review the theme (and all subsequent edits) for security and reliability before pushing live and/or placing on a staging environment.
Depending on the queue and complexity of the theme or plugin (or edit) this can take up to 24 hours (or more for complex use cases). Please keep in mind this important review timeline when launching new sites or changes.
Note: Divi is common plugin in our networks but we have it under “divi” folder name instead of default “Divi”. Please keep it in mind when adding Divi child themes.
Requesting Plugins
All plugin requests can be made the same way as submitting themes, using relevant BitBucket repository (please see a detailed guide in BitBucket Usage Guide Section below):
- PR must include request for code review in PR comment.
- new plugins submitted that way without such comment will be rejected.
Plugin requests can also be submitted by a super admin via email to contact@campuspress.com and include the following information:
- A link to the site where the plugin can be downloaded from.
- Reason why you would like the plugin added.
All plugins must pass our code review guidelines to be installed on CampusPress. Please email contact@campuspress.com before purchasing any plugins.
Code Guidelines
During the review process, we’ll check to ensure that all themes and plugins adhere to the WordPress Theme Guidelines and WordPress Coding Standards.
In addition, the theme or plugin must not rely on 3rd party services, phone home, and must:
- not automatically upgrade or modify theme files;
- not change timeout of wp_remote_* calls;
- not ever change wp_feed_cache_transient_lifetime (hook to the filter);
- not use SHOW TABLES, instead use SHOW TABLES LIKE ‘wp_xyz’;
- not use DESC to describe table, instead use DESCRIBE;
- not change WP_DEBUG, error_reporting or display_errors;
- not remove default roles (remove_role);
- not flush rewrite rules ($wp_rewrite->flush_rules is not allowed);
- not flush cache (wp_cache_flush is not allowed);
- not contain SQL queries. Themes should use WordPress built in functions for fetching post, pages, attachments, users and respective meta tags;
- not create new tables or modify table schema;
- not use filesystem functions listed here;
- not store files in the server file system. Themes must always make use of WordPress attachments if it accepts file uploads;
- not use error_log function;
- not try to get all sites in networks at once with something like “get_sites( array( ‘number’ => 0 ) )” (it can lead to time out on large networks);
We reserve the right to modify the list of checks above. If we discover performance or security issues after approval and the theme or plugin complies to all of the checks, we will collaborate with you on the next steps and best options.
We try to make checks as thorough as possible. However if we discover a theme or plugin does not follow our guidelines after approval we reserve the right to temporarily remove it until it complies to all the checks.
Theme/Plugin Updates
We require you to increase the version parameter for files like CSS, JS, and images when updating your theme/plugin. For CSS it’s best to use wp_enqueue_style function and for JS wp_enqueue_script. Both of them have $ver parameter useful for increasing version. For paths to files like images and fonts, it’s best to change the path from, for example, “images/image.jpg” to “images/image.jpg?ver=2”. It’s worth noting that this also applies to paths in CSS files.
To bump version in many places at once, its best to create a function like “get_{theme/plugin_slug}_ver() { return 2; }” or define constant like “{THEME/PLUGIN}_VER” and use it when needed. Relying on “wp_get_theme()->get(‘Version’)” or “get_file_data” is not the best as this info is cached and takes more time to refresh.
For themes that have been added and used on the network, it is not a good idea to change the main folder’s names. That’s because WordPress stores this info in DB and after a change like this it’s impossible for the system to find the correct theme. It applies to regular themes, child themes and parent themes.
Theme/Plugin Update Workflow
If you are making changes to an existing custom theme, or upgrading a theme, it is better to do all the theme testing on a development network rather than on your production network.
Your work flow would look like the following:
- Submit pull requests in Bitbucket to the Development network.
- Test the updates on your Development network.
- Submit pull requests to the Production network.
- Check update on your Production network.
Email contact@campuspress.com if you need a Development network for testing theme and plugin updates.
BitBucket Usage Guide
We recommend using SourceTree or GitKraken applications. Both are available for free for Windows and MacOS (GitKraken also for Linux) system.
SourceTree: https://www.sourcetreeapp.com/
GitKraken: https://www.gitkraken.com/git-client
The following guide is based on the SourceTree app on Windows system and assumes you already have access to BitBucket repository granted, the application is installed on your computer and you did not connect the BitBucket account to the application during installation.
Note, please:
- some parts of application may look or be named slightly differently depending on the application version and operating system
- below guide is intended for new users who either never used BitBucket/GIT before or have very little experience using it
- If you are an experienced BitBucket/GIT user you may already have a different ways of interacting with it that better suit your needs; that’s fine and we do not require use of recommended applications or following this exact workflow – except the general guide included at the very end of this article
Preparation Steps
If you are always working from the same computer, these preparatory steps need to be taken only once.
- Create a folder on your computer where the repository files will be stored locally.
- Next, in the SourceTree app, switch to the “Remote” tab and click on the “Add an account” icon.
- In the popup that will show, you can leave the settings as they are by default, then just click the “Refresh OAuth Token” button.
- This will take you to the Bitbucket website first, and then back to the SourceTree app.
Once your account is connected, you’ll see a list of your repositories.
- Select the one you want to work with — production or development — and click on the “Clone” link next to it.
- In the “Clone” form on the next screen, specify the target folder — the one you created at the very beginning (you can use the “Browse” button for that). Other settings can remain as they are by default.
- Click “Clone” and wait for the process to complete.
You should now see your repository in the SourceTree app, and the repository files, your site files, inside the folder you previously created on your local drive.
Updating existing theme
Whenever you are updating a theme or adding a new one, you do not need to go through above preparatory process anymore unless you are using a different device on which you do not have SouceTree app set up yet.
If it’s already installed and connected to your BitBucket account, follow the steps below.
Note: if you have already updated the theme this way previously you can use an existing custom branch that you created before or you can create another new one if you prefer.
We strongly recommend making updates on the dev network (dev deployment branch) first and testing them there. Once you test and confirm updates on the dev network, just create another PR (see point 7 below) but this time to the production/live deployment branch in order to apply updates to the production network.
- In order to update theme files, first make sure you have the updated files ready on your local drive.
- Next, create a new branch in the repository by:
- going to the Bitbucket site
- entering the relevant repository
- clicking the “Create” button and selecting “Branch” from the dropdown list
- In the branch form:
- you can keep the branch type as “Other”
- make sure to select deployment production branch as a source
- give your new branch a meaningful name so you can easily recognize it later
- then click “Create“, and in the next step, click “Check out in SourceTree“
- this will open the SourceTree app and a “URL Actions” popup, where you need to click the “Checkout” button
- once that’s done, the SourceTree app will open and you’ll see your new branch
- Now, pull the branch from the remote repository to your local one to make sure it’s complete and up to date. To do this, right-click on the branch name and select the “Pull from origin” option.
- The next step is to add the theme files to the repository folder on your local drive: simply drop them into the folder – the one where your repository is stored (as in step 1 of “Preparation steps”) and agree to overwrite existing ones if necessary.
- Once that’s done, you need to commit the changes in the SourceTree app to confirm them.
To do that, make sure your branch is selected (it should be bold):
- click on the “Commit” icon in the top-left corner — you’ll see a list of unstaged files (these are the ones that were changed)
- click “Stage All“
- then click the “Commit” button in the bottom-right corner and wait for the process to complete
- Once the commit is complete, you’ll see a number next to your branch name — this means you need to push the branch to the remote repository.
To do this, right-click on the branch name and select the “Push to origin” option and in the popup, click “Push” again.
- Your changes are now uploaded to the Bitbucket repository, so it’s time to deploy them.
To do that, you need to create a Pull Request:
- go back to the Bitbucket site
- click the “Create” button at the top and select “Pull Request“
- select your new branch as the source branch
- select one of the deployment branches (production or development, depending on the environment you’re working with) as the destination
- give the request a useful description
- and remember to add CampusPress as a reviewer using the Reviewers option below the description — this is critical!
- Click “Create Pull Request“.
And that’s it. Once you see the overview screen, all that’s left is to wait for our engineers to review and approve your Pull Request.
You’ll receive an email notification once it’s done.
Adding a new theme
We strongly recommend adding themes first to the dev network (dev deployment branch) and testing them there. Once you test and confirm changes on the dev network, just create another PR (see point 7 below) but this time to the production/live deployment branch in order to apply new themes to the production network.
- First, prepare your new theme files — download and extract them to your local device into a convenient location so you have them at hand.
- The next step is to create a new branch in your repository.
To do that:
- go back to the Bitbucket site
- enter the repository you’re working with
- click on the “Create” button and select “Branch“
- in the branch creation form, you can leave the type as “Other“, but make sure to select the correct branch from the “From” list – make sure to always create new branch from the deployment production branch!
- give your branch a meaningful name
- then click “Create“
- wait until the process completes
- then click the “Checkout in SourceTree” button — this will open a popup in the SourceTree application called “URL Actions“, where you’ll need to click the “Checkout” button
- this will take you back to the SourceTree app, and you’ll see your new branch already active (its name will be bold)
- To make sure your new branch contains all the up-to-date files, pull the branch content from the remote repository by right-clicking on the branch name and selecting the “Pull from origin” option.
- Once that’s done, you need to add the theme files to the repository.
To do that, simply open the repository folder on your local machine and copy the theme files into it. Now it’s time to apply the changes.
- The first step is to commit the changes. To do this:
- click on the “Commit” icon in the top-left corner of the SourceTree app
- you’ll see a list of unstaged files (these are newly added or changed files)
- click “Stage All“, then click “Commit” again — this time the button in the bottom-right corner
- wait until the commit process completes
- Now that all changes are committed, it’s time to push them back to the remote repository.
To do that, right-click on the branch name, select “Push to origin“, and confirm.
- All that’s left is to deploy the changes to the site by creating a Pull Request.
To do this:
- go back to the Bitbucket website
- select your repository
- click the blue “Create” button at the top and select “Pull Request“
- in the form that shows up, select your new branch as the source branch
- then select one of the deployment branches as the target — dev or production, depending if you are about to test the changes or they are already tested and ready to be deployed to your live (production) network
- give your Pull Request a meaningful name
- since you’re adding a new theme, write a short comment in the description requesting a code review for the new theme
- add CampusPress as a reviewer right below the description box — this is critical!
- Once that’s done, click the “Create Pull Request” button. When you see the overview screen, it’s finished.
Now all that’s left is to wait for our engineers to review and deploy your new theme. You’ll receive an email notification when it’s done.
Updating/adding plugins
The process is exactly the same as with themes (as described above) except you would work with different repositories.
General Guide/Summary:
This is a summary of the general steps (common for plugins and themes) for updating/adding themes and plugins via BitBucket repositories. They are the same regardless of the way/application that you are using to interact with repositories.
- Create or Select a Branch: Start by creating a new branch or selecting an existing one that aligns with your current work.
- Pull the Branch Locally: Pull the selected branch to your local environment to ensure you are working with the latest code.
- Commit Your Changes: Make and commit the necessary changes to your local branch.
- Push to Bitbucket: Push your local branch back to Bitbucket.
- Prepare for Deployment: Create a pull request (PR) to the appropriate deployment/[dev-network] branch for deploying changes to the testing network. Add “contact@campuspress.com” as a reviewer for the PR.
- Test After Merge: Wait for up to 1 hour after CampusPress merges the pull request, then proceed to test the changes on the testing network.
- Deploy to Production: If everything looks ok, Create a pull request (PR) to the appropriate deployment/[production] branch for deploying changes to the production network.Add “contact@campuspress.com” as a reviewer for the PR.