Helsinki Site Core
Opinionated default customizations for Helsinki WordPress sites
by ArtCloud · github.com/city-of-helsinki/wordpress-helfi-site-core
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/city-of-helsinki/wordpress-helfi-site-core/archive/refs/heads/main.zipOpinionated default customizations for Helsinki WordPress sites.
Intended to be used as a Must Use plugin on every Helsinki WordPress site.
Features
WordPress core customizations with actions and filters.
Block Editor
- Add Blocks admin menu item
- Disable full screen editor by default
Dashboard
- Remove Welcome Panel
- Remove PHP nag widget
- Disable default widgets other than Right Now and Activity
Login
- Use generic login error message
- Use
home_url()as header url - Use custom logo or site name as header text
- Use custom styles for header
Notices
- Remove WordPress update nag
- Remove admin footer text
- Remove update footer text
Password rules
Checked when a user tries to either reset or update their password.
- At least one digit, 0-9.
- At least one lowercase character, a-z.
- At least one uppercase character, A-Z.
- At least 12 characters long.
- At least 8 unique characters.
- At least one special character, !@#$%^&*()-_'[]{}<>~`+=,.;:/?|.
- At most 255 characters long.
- At most 2 consecutive repeating characters. E.g. "%s" is not allowed.
Filtering the rule set
apply_filters( 'helsinki_site_core_password_rules', Password_Rule_Interface[] $rules, Password_Rules_Factory $factory )
Filters list of password rules for Password_Validator.
Tests
See tests/Passwords.
Plugins
- Plugin activation and deactivation action links removed
- Plugin activation and deactivation bulk actions removed
- Use constant or filters to change site core behaviour, read more.
Search
- Replace search page
document_titleandwp_titlewith content fromhelsinki_site_core_search_meta_titlefilter - Provide translated n results for the search term x text via
helsinki_site_core_search_meta_titlefilter
Toolbar
- Remove search item
- Remove WP item
Users
- Disable user contact methods
- Disable user url field
- Disable user description field
- Disable user avatars
- Disable and hide Confirm use of weak password checkbox
- Enforce strong passwords
WP Head
- Remove unnecessary links and meta data from
wp_head()
Integrations
Plugin integrations with actions and filters.
Cache Enabler
Cache Enabler on wordpress.org
- Execute
cache_enabler_clear_site_cacheonhelsinki_site_core_cache_clearaction
Limit Login Attempts Reloaded
Limit Login Attempts Reloaded on wordpress.org
- Daily scheduled operation to clear lockout logs
Matomo
- Custom
Settings > Helsinki Matomomenu page helsinki_site_core_matomo[tracking][tracking_id]setting for storing Matomo ID- If
tracking_idis given, the plugin adds Matomo script tag towp_head
# Modify tracking code config
apply_filters( 'helsinki_site_core_matomo_tracking_code_config', Tracking_Code_Config $config, array $settings )
# Modify tracking code
apply_filters( 'helsinki_site_core_matomo_tracking_code', Tracking_Code $tracking_code, Tracking_Code_Config $config )
Polylang
- Remove
pll_userscript from user related admin views
Redirection
- Overwrite plugin options to prevent IP logging and HTTP header information logging
- Prevent IP or HTTP header information from being stored to log entries
Smash Balloon
Smash Balloon social media plugins
- Wraps social media feeds in a
aria-hidden="true"divand provides source links as a replacement for screen readers
Two Factor
- Forces email as the only allowed two factor method
- Checks, if the current user has email 2FA enabled, force enabling it if not, and requires user to re-authenticate afterwards
- Disables 2FA options on user profile page
To conditionally disable 2FA enforcement for a user hook to the following filter.
apply_filters( 'helsinki_site_core_force_enable_two_factor', bool $force, WP_User $user )
Yoast SEO
- On search page replace
wpseo_titlewith content fromhelsinki_site_core_search_meta_titlefilter