seravo / seravo-plugin
Enhances WordPress with Seravo.com specific features and integrations
Installs: 140 013
Dependents: 1
Suggesters: 0
Security: 0
Stars: 38
Watchers: 9
Forks: 16
Open Issues: 40
Type:wordpress-muplugin
Requires
- php: >=7.0
Requires (Dev)
- dev-master
- 1.10.2
- v1.10.1
- 1.10.0
- 1.9.44
- 1.9.43
- 1.9.42
- 1.9.41
- 1.9.40
- 1.9.39
- 1.9.38
- v1.9.37
- 1.9.36
- 1.9.35
- 1.9.34
- 1.9.33
- 1.9.32
- 1.9.31
- 1.9.30
- 1.9.29
- 1.9.28
- 1.9.27
- 1.9.26
- 1.9.25
- 1.9.24
- 1.9.23
- 1.9.22
- 1.9.21
- 1.9.20
- 1.9.19
- 1.9.18
- 1.9.17
- 1.9.16
- 1.9.15
- 1.9.14
- 1.9.13
- 1.9.12
- 1.9.11
- 1.9.10
- 1.9.9
- 1.9.8
- 1.9.7
- 1.9.6
- 1.9.5
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.0
- 1.7.0
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.8
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3
- 1.2
- 1.1
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0
- dev-testing/acceptance
- dev-test-ci-docker
- dev-backup/actual-composer
- dev-feature/last-login-country
- dev-seravo-plugin-2/rewrite-cruftplugins
- dev-dev-sami
- dev-santeri-dev
- dev-search-replace-escaped
- dev-search-replace-hook
- dev-bugfix/seravo-class-everywhere
- dev-feature/stronger-passwords
- dev-feature/cruft-quarantine
- dev-feature/cache-keys
- dev-feature/thirdparty-aiosp
- dev-feature/rcp-bypass
- dev-feature/postbox-5.5-format
- dev-feature/exec_with_output
- dev-fix/custom-toolbox
- dev-feature/extend-cruft-remover
- dev-fix/shadows-box
- dev-feature/wpml-cache
- dev-testi/demo-branch
- dev-seravo-toolbox-translations-update
- dev-bugfix/https-redirect
- dev-dev-seravo-toolbox
- dev-feature/custom-welcome-panel
- dev-feature/full-width-postboxes
- dev-dev-mikkov
- dev-dev-samuli-whitelabel
- dev-dev-samuli-toolbox
- dev-dev-samuli
- dev-bugfix/clarify-tests-message
- dev-feature/instance-data-moving
- dev-dev-markus
- dev-demobranch
- dev-dev-leo
- dev-dev-nasusa-cruft-files
- dev-dev/introduce-control-panel
- dev-bugfix/check-url-attr
- dev-bugfix/reports-local
- dev-dev-maf-backups
- dev-dev-maf-notification-factory
- dev-dev-maf-2
- dev-dev-maf-updates
- dev-dev-nasusa-fix-code
- dev-dev-maf
- dev-dev-maf-login-notification
- dev-dev-maf-shui
- dev-feature/improved-site-information
- dev-feature/shadow-notice-after-12h
- dev-feature/crawl-delay
- dev-feature/whitelist-ipgeoblock
- dev-bug/fix-83
- dev-feature/screenshot-comparison
- dev-feature/site-info
- dev-feature-shadow-pull
- dev-dev-leo-2
- dev-feature-cruft-remove-inactive-plugins
- dev-feature-shadows
- dev-nasusa-master
- dev-feature/pwnedpasswords
- dev-fix-reports-page-style
- dev-update_instance_switching_feature
- dev-add_nonce_to_update_page_form
- dev-feature-update-checker
- dev-feature-vagrant-load-missing-pictures-from-prod
- dev-feature-add-wpdb-injector
This package is auto-updated.
Last update: 2024-12-15 11:59:26 UTC
README
Seravo Must-use Plugin
Enhances WordPress with Seravo.com specific features and integrations (also known as WP-palvelu.fi in Finland).
Installation
In order to use this with composer you need to add this mu-plugin:
https://github.com/roots/bedrock/blob/master/web/app/mu-plugins/bedrock-autoloader.php
This is because WordPress won't use mu-plugins from their own folders.
Then add this to your composer:
{ "require": { "seravo/seravo-plugin": "*" }, "extra": { "installer-paths": { "htdocs/wp-content/mu-plugins/{$name}/": ["type:wordpress-muplugin"] } } }
Seravo's customers can simply run wp-seravo-plugin-update
to get the latest (tagged) release. For the adventurous, get the git master head with wp-seravo-plugin-update --dev
.
Features
- Enforces canonical URLs
- Enforces HTTPS, nags if PHP version is too low, shows a notice is object-cache is not enabled etc
- Shows notifications from WP-palvelu.fi (@TODO: switch to Seravo.com)
- Returns 401 (unauthorized) http status code after failed login.
- Logs all login attempts to /data/log/wp-login.log
- Hides Update nagging since that is handled by Seravo
- Uses nocache headers if the site is in development mode
- Adds Purge Cache -button in adminbar
- Automatically shows the shadow instance switcher is there are any shadow instances.
- Allows to list and reset shadow environments
- Finds and suggests cruft files to remove from a site
- Shows information about the database, table sizes etc
- Show information about disk usage, server logs, updates, tests etc
- And lots, lots more!
Filters
You can insert your own admin notice for users that are in shadow
function my_shadow_admin_notice($admin_notice, $current_screen) { return '<div class="notice notice-error"><p>This is staging. All content edited here will be lost. Return to production to create or edit content.</p></div>'; } add_filter( 'seravo_instance_switcher_admin_notice', 'my_shadow_admin_notice', 10, 2 );
Currently the velocity of development is so high that documentation lacks badly behind. To find more filters, just search the source code for apply_filters
.
Development
Using a real site for development
Some of the features in the Seravo Plugin depend on the API that is available only on a real production site, and thus cannot be tested inside a Vagrant box or the like.
In order to have the git repository on your own computer and in your own editor, while still being able to see the code running on a test site (in the production environment) you can use the command below. It will watch all files for changes and automatically rsync them to the remote server:
seravo-plugin$ find * | entr rsync -avz -e 'ssh -q -p 12345' * example@example.seravo.com:/data/wordpress/htdocs/wp-content/mu-plugins/seravo-plugin/
sending incremental file list
README.md
sent 2,999 bytes received 64 bytes 2,042.00 bytes/sec
total size is 370,596 speedup is 120.99
Installing development dependencies
To ease Seravo Plugin development, composer should be used to install development dependencies.
Running composer install
installs PHPCS, PHPCBF, WordPress PHPCS standards and Rector.
Updating translations
Remember to update translations of all public facing string by running inside Vagrant:
cd /data/wordpress/htdocs/wp-content/mu-plugins/seravo-plugin
wp i18n make-pot . languages/seravo.pot
NOTE! If this fails on
PHP Fatal error: Uncaught Error: Maximum function nesting level of '256' reached
temporarily remove the overly complex files withrm js/cruft*
.
Translations can be done for instance by using Poedit. On editor open languages/seravo-fi.po
and select Update from pot file
which will update the po file. After translating compile the po file to seravo-fi.mo
mo file.
Running Rector and PHPCS
If you have Rector and PHPCS installed locally with composer install
, simply run composer test
. Alternatively run PHPCS inside local Vagrant or Docker image, or on the same remote site used for testing:
ssh -q -p 12345 example@example.seravo.com 'cd '/data/wordpress/htdocs/wp-content/mu-plugins/seravo-plugin/ && phpcs
........S.......WWWWWWWWWWEWWEWWWWW.WWEWWWW.W.WWEWWEWEW..... 60 / 68 (88%)
......W. 68 / 68 (100%)
FILE: ...press/htdocs/wp-content/mu-plugins/seravo-plugin/lib/helpers.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
35 | WARNING | Filesystem function dirname() detected with dynamic
| | parameter
35 | WARNING | Line exceeds 100 characters; contains 118 characters
44 | WARNING | Line exceeds 100 characters; contains 107 characters
----------------------------------------------------------------------
...
Rector and PHPCS errors can be automatically fixed with composer fix
. All Rector errors should be resolved
before merging to master even if it's not part of CI tests.
Changelog
See git history and release commit messages.