WordPress plugin demovox is a tool to collect signatures for Swiss popular initiatives by offering the visitor a personalized signature sheet.
This Plugin was developed by the Socialist Party of Switzerland, it was initially built for the popular initiative Prämien-Entlastungs-Initiative in 2019. It has been used for numerous others since, like umverkehR (2020) and AHVx13 (2020) by SGB, to name a few.
- PHP >= 7.0 (feature "Hashid" requires >= 7.1.3)
- MySQL >= 5.6.5
- WordPress >= 4.9
- SSL certificate for HTTPS (non-https is only allowed for development)
- Optional feature requires the PHP modules "GMP" or "BC Math"
Simply install the WordPress plugin demovox from within the Plugin manager of your WordPress installation. You can find the admin manual or the prebuilt Zip-File for manual installation on demovox.ch.
If this plugin is of help for you, please consider a donation and write a review on the demovox WordPress plugin page.
Please send us a pull request for any improvements on the plugin.
- Pull
demovox
from git - Use the webserver
wordpress
container fromdocker-compose.yaml
(for development purposes), which includes a WordPress webserver and mailhog for mail testing. Or use your own webserver (see below). - Install required project packages and generate assets with grunt (see below)
- Activate the plugin through the 'Plugins' menu in local WordPress
- Place shortcodes [demovox_form] on a page or use the automatically generated page
- Optionally use and [demovox_count] to show the number of collected signatures and [demovox_optin] for opt-in edit form
- Configure the plugin in WordPress admin. Allow non-https access in the advanced settings of the plugin and disable "Redirect clients to secure HTTPS".
You can use your own webserver (see requirements above) and map the demovox directory to [WordPressDir]/wp-content/plugins/demovox
.
While developing, you might want to work on a web server without SSL. Enable WP_DEBUG
in wp-config.php
and you probably want to disable WP_DEBUG_DISPLAY
. Then
open the Advanced settings of the plugin in the WordPress backend and disable "Redirect clients to secure HTTPS".
Start buildserver
from docker/docker-compose.yaml
. The plugin is monted in /var/demovox/
If you don't want to use the docker container, install the following build dependencies:
Python, Ruby,
node.js (use v8.10.0 as po2mo fails with higher versions), composer,
gettext.
Install required NPM packages with npm install grunt-cli sass -g
Go to demovox directory (e.g. cd /var/demovox/
)
npm install
composer install --no-dev
Install required packages for tests:
composer install
bin/install-wp-tests.sh <db-name> <db-user> <db-pass> [db-host]
Generate minified JS and CSS files and compile .mo translation files:
grunt buildAssets
Build plugin snapshot in demovox/buildWpOrg
which can be uploaded to the WordPress.org repository:
grunt buildWpOrg
There are just a few PHPUnit tests available yet, feel free to contribute some and send a pull-request to increase the test coverage.
grunt test
Build plugin snapshot as ZIP in demovox/demovox.zip
, which can be uploaded to a remote WordPress installation:
grunt buildZip
Show all other available commands:
grunt buildZip
See README.txt and commit log.
See also the list of contributors who participated in this project. Thanks to @dbu for code review.
This project is licensed under the GPLv3 License - see the LICENSE.txt file for details.