Free and open-source WordPress plugin to display random quotes from community zitat-service.de.
💡 Tip: There is a WordPress demo installation with plugin Random Quote from Zitat-Service running online at wp-demo.zitat-service.de.
💡 Tip: Help for the WordPress plugin installation and administration is available at github.com/muhme/quote_wordpress/wiki.
The public URL for the plugin in the WordPress Plugin Directory is wordpress.org/plugins/random-quote-zitat-service.
Change log is available as CHANGELOG.md.
- WordPress >= 6.1
- PHP >= 7.4
Tested are the versions:
- PHP 7.4 & WordPress 6.1
- PHP 8.2 & WordPress 6.6
There is a docker test and development environment prepared.
Docker, git, node >= v20 and npm must be installed (under Microsoft Windows in WSL2). To create your test and development environment run:
git clone https://github.com/muhme/quote_wordpress
cd quote_wordpress
docker compose up -d
Six Docker containers are running:
docker ps
NAMES IMAGE PORTS
quote_wp_wordpress quote_wordpress-wordpress 0.0.0.0:4080->80/tcp
quote_wp_min wordpress:6.1-php7.4-apache 0.0.0.0:4084->80/tcp
quote_wp_phpmyadmin phpmyadmin/phpmyadmin 0.0.0.0:4081->80/tcp
quote_wp_mariadb mariadb 3306/tcp
quote_wp_maildev maildev/maildev 0.0.0.0:1025->1025/tcp, 0.0.0.0:4082->1080/tcp
quote_wp_playwright mcr.microsoft.com/playwright 0.0.0.0:4083->80/tcp
Docker containers are:
- quote_wp_wordpress – WordPress latest version
- http://host.docker.internal:4080 – WordPress instance, ready for installation, test and development
- after
scripts/install.sh
the five admin usersadmin
,admin_de
,admin_es
,admin_ja
andadmin_uk
exist with the respective locales, password is alwaysadmin
- msmtp is used as a simple SMPT client
- A small WordPress plugin sets the sender email address (from field) fixed to '[email protected]' and fixes the problem of undeliverable address 'wordpress@localhost' inside Docker container. Installing it as must-use WordPress plugin to have it already actived.
- has gettext package, vim and ping installed
- quote_wp_min - minimum required PHP/WordPress version
- http://host.docker.internal:4084 – WordPress instance, ready for installation and test
- after
scripts/install.sh
the five admin usersadmin
,admin_de
,admin_es
,admin_ja
andadmin_uk
exist with the respective locales, password is alwaysadmin
- quote_wp_mariadb – MariaDB database
- database available as mariadb:3306
- user 'root', password 'root' and databases 'wordpress' and 'wp_min'
- quote_wp_phpmyadmin – phpmyadmin for database administration
- http://localhost:4081 – phpMyAdmin to work with the database
- quote_wp_maildev - MailDev for collecting and showing WordPress mails
- listening for mails on maildev:1025
- http://localhost:4082 – MailDev web interface
- quote_wp_playwright- for E2E testing
💡 Tip: To have WordPress working with HTTP and from localhost and inside Docker container, plus access WordPress from Playwright container the little trick is to use the URL http://host.docker.internal:4080
. The hostname host.docker.internal
is identical inside docker container and on host machine, if you make the following /etc/hosts
entry:
127.0.0.1 host.docker.internal
The command-line interface for WordPress WP-CLI is used for the script-based completion of the installation and other tasks. After creating the Docker containers quote_wp_wordpress
and quote_wp_min
run scripts/install.sh
once:
scripts/install.sh
*** Waiting for container quote_wp_wordpress
waiting for 1 resources: http://host.docker.internal:4080
*** Installing WP-CLI
*** Complete WordPress installation
Success: WordPress installed successfully.
*** Install additional languages
Language 'de_DE' installed.
Language 'es_ES' installed.
Language 'ja' installed.
Language 'uk' installed.
*** Create four additional admins with locales
*** Activate plugin random-quote-zitat-service
*** Recursivly chown to www-data
*** Waiting for container quote_wp_min
waiting for 1 resources: http://host.docker.internal:4084
*** Installing WP-CLI
*** Complete WordPress installation
Success: WordPress installed successfully.
*** Install additional languages
Language 'de_DE' installed.
Language 'es_ES' installed.
Language 'ja' installed.
Language 'uk' installed.
*** Create four additional admins with locales
*** Activate plugin random-quote-zitat-service
*** Recursivly chown to www-data
WordPress is installed with the five languages supported by the plugin. The plugin Random Quote from Zitat-Service
is installed and activated. There are five admin users, each of whom has set one of the languages. Users are admin
, admin_de
, admin_es
, admin_ja
and admin_uk
. Password is always admin
. Further details on I18n can be found under languages.
Automated Playwright tests are in subfolder test and and are described there.
Some bash-scripts are prepared for a pleasant and also faster development, see folder scripts and commented list of scripts there.
- update version number etc. in
- package.json
- readme.txt
- CHANGELOG.md
- random-quote-zitat-service.php
- src/block.json
- src/helper.php
- src/common.js
- languages/*.po*
scripts/pack.sh full
which is doing:- docker exec -it quote_wp_wordpress /var/www/html/wp-content/plugins/random-quote-zitat-service/scripts/i18n-create.sh
- ncu -> ncu -u && npm install
- npm audit -> npm audit -fix
- npm run lint:css
- npm run lint:js -> npm run lint:js:fix
- npm run format
- npm run build
- scripts/compose.sh build
- scripts/install.sh
- scripts/test.sh --workers=2
- scripts/pack.sh
- manual install the zipped plugin in empty WP, do Plugin Check (PCP) with all categories, do a short test
- git status / git diff / git commit -a / git push
💡 Tip: If a command fails in scripts/pack.sh full
this script stops.
If a common fix action is available it is shown after ->
.
The WordPress plugin fetches all data from api.zitat-service.de. Terms of use and privacy statement can be found in the Imprint.
The random quotes on the frontend of the WordPress website are fetched by PHP code that runs on the WordPress server. This means that the process of retrieving quotes does not involve tracking or recording any user-specific data. Instead, it operates within the server environment, ensuring user privacy and compliance with guidelines that prohibit tracking users without their consent.
The displayed quotes, along with their respective authors and sources, are linked externally to websites such as zitat-service.de and Wikipedia to provide users with additional context and information. It's important to note that all external links are activated only after manual verification by the admin team at zitat-service.de, ensuring the reliability and accuracy of the linked content.
GPLv3 License, Copyright (c) 2023 - 2024 Heiko Lübbe, see LICENSE.txt
Don't hesitate to ask if you have any questions or comments.