seravo / wp-palvelu-plugin
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-bugfix/php-compat-post
- 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-08-15 11:16:10 UTC
README
Seravo 必用插件
增强WordPress,添加Seravo.com特定的功能和集成(在芬兰称为WP-palvelu.fi)。
安装
为了使用此插件,您需要添加此mu-plugin
https://github.com/roots/bedrock/blob/master/web/app/mu-plugins/bedrock-autoloader.php
这是因为WordPress不会使用其自身文件夹中的mu-plugin。
然后将其添加到您的composer
{ "require": { "seravo/seravo-plugin": "*" }, "extra": { "installer-paths": { "htdocs/wp-content/mu-plugins/{$name}/": ["type:wordpress-muplugin"] } } }
Seravo的客户只需运行wp-seravo-plugin-update
即可获取最新(标记)版本。对于喜欢冒险的人,可以使用wp-seravo-plugin-update --dev
获取git master head。
功能
- 强制使用规范URL
- 强制使用HTTPS,如果PHP版本过低则提示,如果对象缓存未启用则显示通知等
- 显示来自WP-palvelu.fi的通知(待办:切换到Seravo.com)
- 登录失败后返回401(未授权)http状态码
- 将所有登录尝试记录到/data/log/wp-login.log
- 隐藏更新提示,因为这是由Seravo处理的
- 如果网站处于开发模式,则使用无缓存头
- 在管理栏中添加“清除缓存”按钮
- 如果存在任何影子实例,则自动显示影子实例切换器
- 允许列出和重置影子环境
- 查找并建议从网站中删除的垃圾文件
- 显示有关数据库、表大小等信息
- 显示有关磁盘使用情况、服务器日志、更新、测试等信息
- 等等,等等!
过滤器
您可以插入自己的管理员通知,用于在影子中的用户
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 );
目前开发速度非常快,文档严重落后。要找到更多过滤器,只需在源代码中搜索apply_filters
。
开发
使用真实站点进行开发
一些Seravo插件中的功能依赖于仅在真实生产站点上可用的API,因此不能在Vagrant箱或类似环境中进行测试。
为了在您的计算机和自己的编辑器中拥有git存储库,同时仍然能够看到在生产环境中运行的代码(在测试站点上),您可以使用以下命令。它将监视所有文件的变化,并自动将它们同步到远程服务器
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
安装开发依赖项
为了简化Seravo插件开发,应该使用composer安装开发依赖项。运行composer install
安装PHPCS、PHPCBF、WordPress PHPCS标准和Rector。
更新翻译
请记住,通过在Vagrant内部运行来更新所有面向公众的字符串的翻译
cd /data/wordpress/htdocs/wp-content/mu-plugins/seravo-plugin
wp i18n make-pot . languages/seravo.pot
注意!如果出现
PHP 致命错误:未捕获的错误:函数嵌套级别达到最大值 '256'
,请暂时使用rm js/cruft*
删除过于复杂的文件。
可以使用Poedit进行翻译。在编辑器中打开languages/seravo-fi.po
并选择从pot文件更新
,这将更新po文件。翻译完成后,将po文件编译到seravo-fi.mo
mo文件。
运行Rector和PHPCS
如果您已经使用composer install
在本地上安装了Rector和PHPCS,只需运行composer test
即可。或者,在本地Vagrant或Docker镜像中运行PHPCS,或在用于测试的相同远程站点上运行。
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
----------------------------------------------------------------------
...
可以使用 composer fix
自动修复 Rector 和 PHPCS 错误。在合并到 master 分支之前,即使它不是 CI 测试的一部分,也应该解决所有 Rector 错误。
变更日志
查看 git 历史记录和 发布提交信息。