WP Manifestindependent plugin directory
manifest / admin / wordpress-helfi-site-core

Helsinki Site Core

Opinionated default customizations for Helsinki WordPress sites

by ArtCloud · github.com/city-of-helsinki/wordpress-helfi-site-core

0stars
0forks

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.zip

Opinionated 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_title and wp_title with content from helsinki_site_core_search_meta_title filter
  • Provide translated n results for the search term x text via helsinki_site_core_search_meta_title filter

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_cache on helsinki_site_core_cache_clear action

Limit Login Attempts Reloaded

Limit Login Attempts Reloaded on wordpress.org

  • Daily scheduled operation to clear lockout logs

Matomo

  • Custom Settings > Helsinki Matomo menu page
  • helsinki_site_core_matomo[tracking][tracking_id] setting for storing Matomo ID
  • If tracking_id is given, the plugin adds Matomo script tag to wp_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

Polylang on wordpress.org

  • Remove pll_user script from user related admin views

Redirection

Redirection on wordpress.org

  • 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" div and provides source links as a replacement for screen readers

Two Factor

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

Yoast SEO on wordpress.org

  • On search page replace wpseo_title with content from helsinki_site_core_search_meta_title filter