{"id":20601511,"url":"https://github.com/seravo/seravo-plugin","last_synced_at":"2025-04-04T07:05:45.024Z","repository":{"id":22779859,"uuid":"26125937","full_name":"Seravo/seravo-plugin","owner":"Seravo","description":"Enhances WordPress with Seravo specific features and integrations","archived":false,"fork":false,"pushed_at":"2025-02-05T11:18:46.000Z","size":3153,"stargazers_count":39,"open_issues_count":40,"forks_count":16,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-28T05:32:22.347Z","etag":null,"topics":["mu-plugins","php","seravo","wordpress","wp-palvelu"],"latest_commit_sha":null,"homepage":"https://seravo.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Seravo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-03T15:50:43.000Z","updated_at":"2025-03-10T11:07:38.000Z","dependencies_parsed_at":"2024-06-18T22:42:13.958Z","dependency_job_id":"2e73c50b-72d0-4cb8-9cdb-343affd41cfc","html_url":"https://github.com/Seravo/seravo-plugin","commit_stats":{"total_commits":923,"total_committers":50,"mean_commits":18.46,"dds":0.8125677139761647,"last_synced_commit":"ff26ae59a46bac7cd29d1c7c7a958a3220bf5d3d"},"previous_names":[],"tags_count":79,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seravo%2Fseravo-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seravo%2Fseravo-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seravo%2Fseravo-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Seravo%2Fseravo-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Seravo","download_url":"https://codeload.github.com/Seravo/seravo-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135142,"owners_count":20889420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mu-plugins","php","seravo","wordpress","wp-palvelu"],"created_at":"2024-11-16T09:10:43.273Z","updated_at":"2025-04-04T07:05:45.008Z","avatar_url":"https://github.com/Seravo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Seravo.com](https://seravo.com/wp-content/themes/seravo/images/seravo-banner-808x300.png)\n\n# Seravo Must-use Plugin\n\n[![Build Status](https://travis-ci.org/Seravo/seravo-plugin.svg?branch=master)](https://travis-ci.org/seravo/seravo-plugin) [![Latest Stable Version](https://poser.pugx.org/seravo/seravo-plugin/v/stable)](https://packagist.org/packages/seravo/seravo-plugin) [![Total Downloads](https://poser.pugx.org/seravo/seravo-plugin/downloads)](https://packagist.org/packages/seravo/seravo-plugin) [![Latest Unstable Version](https://poser.pugx.org/seravo/seravo-plugin/v/unstable)](https://packagist.org/packages/seravo/seravo-plugin) [![License](https://poser.pugx.org/seravo/seravo-plugin/license)](https://packagist.org/packages/seravo/seravo-plugin)\n\nEnhances WordPress with [Seravo.com](https://seravo.com/) specific features and integrations (also known as WP-palvelu.fi in Finland).\n\n# Installation\n\nIn order to use this with composer you need to add this mu-plugin:\n\nhttps://github.com/roots/bedrock/blob/master/web/app/mu-plugins/bedrock-autoloader.php\n\nThis is because WordPress won't use mu-plugins from their own folders.\n\nThen add this to your composer:\n\n```json\n{\n  \"require\": {\n    \"seravo/seravo-plugin\": \"*\"\n  },\n  \"extra\": {\n    \"installer-paths\": {\n      \"htdocs/wp-content/mu-plugins/{$name}/\": [\"type:wordpress-muplugin\"]\n    }\n  }\n}\n```\n\nSeravo'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`.\n\n\n# Features\n\n* Enforces canonical URLs\n* Enforces HTTPS, nags if PHP version is too low, shows a notice is object-cache is not enabled etc\n* Shows notifications from WP-palvelu.fi (@TODO: switch to Seravo.com)\n* Returns 401 (unauthorized) http status code after failed login.\n* Logs all login attempts to /data/log/wp-login.log\n* Hides Update nagging since that is handled by Seravo\n* Uses nocache headers if the site is in development mode\n* Adds Purge Cache -button in adminbar\n* Automatically shows the shadow instance switcher is there are any shadow instances.\n* Allows to list and reset shadow environments\n* Finds and suggests cruft files to remove from a site\n* Shows information about the database, table sizes etc\n* Show information about disk usage, server logs, updates, tests etc\n* And lots, lots more!\n\n## Filters\n\nYou can insert your own admin notice for users that are in shadow\n```php\nfunction my_shadow_admin_notice($admin_notice, $current_screen) {\n  return '\u003cdiv class=\"notice notice-error\"\u003e\u003cp\u003eThis is staging. All content edited here will be lost. Return to production to create or edit content.\u003c/p\u003e\u003c/div\u003e';\n}\nadd_filter( 'seravo_instance_switcher_admin_notice', 'my_shadow_admin_notice', 10, 2 );\n```\n\nCurrently the velocity of development is so high that documentation lacks badly behind. To find more filters, just search the source code for `apply_filters`.\n\n## Development\n\n### Using a real site for development\n\nSome 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.\n\nIn 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:\n```\nseravo-plugin$ find * | entr rsync -avz -e 'ssh -q -p 12345' * example@example.seravo.com:/data/wordpress/htdocs/wp-content/mu-plugins/seravo-plugin/\nsending incremental file list\nREADME.md\n\nsent 2,999 bytes  received 64 bytes  2,042.00 bytes/sec\ntotal size is 370,596  speedup is 120.99\n```\n\n### Installing development dependencies\n\nTo ease Seravo Plugin development, composer should be used to install development dependencies.\nRunning `composer install` installs PHPCS, PHPCBF, WordPress PHPCS standards and Rector.\n\n### Updating translations\n\nRemember to update translations of all public facing string by running inside Vagrant:\n```\ncd /data/wordpress/htdocs/wp-content/mu-plugins/seravo-plugin\nwp i18n make-pot . languages/seravo.pot\n```\n\n\u003e NOTE! If this fails on `PHP Fatal error:  Uncaught Error: Maximum function nesting level of '256' reached` temporarily remove the overly complex files with `rm js/cruft*`.\n\nTranslations 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.\n\n### Running Rector and PHPCS\n\nIf 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:\n\n```\nssh -q -p 12345 example@example.seravo.com 'cd '/data/wordpress/htdocs/wp-content/mu-plugins/seravo-plugin/ \u0026\u0026 phpcs\n........S.......WWWWWWWWWWEWWEWWWWW.WWEWWWW.W.WWEWWEWEW..... 60 / 68 (88%)\n......W.                                                     68 / 68 (100%)\n\nFILE: ...press/htdocs/wp-content/mu-plugins/seravo-plugin/lib/helpers.php\n----------------------------------------------------------------------\nFOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES\n----------------------------------------------------------------------\n 35 | WARNING | Filesystem function dirname() detected with dynamic\n    |         | parameter\n 35 | WARNING | Line exceeds 100 characters; contains 118 characters\n 44 | WARNING | Line exceeds 100 characters; contains 107 characters\n----------------------------------------------------------------------\n...\n```\n\nRector and PHPCS errors can be automatically fixed with `composer fix`. All Rector errors should be resolved\nbefore merging to master even if it's not part of CI tests.\n\n# Changelog\n\nSee git history and [release commit messages](https://github.com/Seravo/seravo-plugin/tags).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseravo%2Fseravo-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseravo%2Fseravo-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseravo%2Fseravo-plugin/lists"}