bonny/gardener
Composer 安装命令:
composer require bonny/gardener
包简介
Cleanup for WordPress frontend and backend
README 文档
README
🏡 🌳 🌻 Gardener 🌻 🌳 🏡
– Opinionated cleanup for WordPress
Gardener
one employed to care for the gardens or grounds of a home, business concern, or other property
– https://www.merriam-webster.com/dictionary/gardener
Gardener is a WordPress plugin that adds theme support for an opinionated cleanup of the WordPress admin and frontend.
No feature is added or modified by default. Support for each feature must be added manually and if this plugin is uninstalled it will not break anything.
Installation and usage
Install using composer:
composer require bonny/gardener
(Or you can just download the plugin and place it in your wp plugins folder.)
Add support for wanted features in your functions.php:
add_theme_support('gardener-remove-emoji');
add_theme_support('gardener-relative-links');
add_theme_support('gardener-cleanup-upload-filenames');
add_theme_support('gardener-cleanup-dashboard');
add_theme_support('gardener-hide-posts');
add_theme_support('gardener-hide-comments');
add_theme_support('gardener-enhance-login-screen');
TODO
- Add all wanted features.
- Document features incl. screenshots.
- Tests would be nice.
Features
Relative links
add_theme_support('gardener-relative-links');
- Change links and images added in Gutenberg and TinyMCE to use relative paths, instead of absolute. This is a benefit when developing a website on several domains, so you don't have to change all links from http://beta.example.com/ to http://example.com/.
Screenshot
"Coming soon."Remove emoji
add_theme_support('gardener-remove-emoji');
- Remove emoji related things.
- Removes print_emoji_detection_script, print_emoji_styles.
Cleanup-upload-filenames
add_theme_support('gardener-cleanup-upload-filenames');
Make file names of media attachments work better with more server configs because for example MacOS does not treat UPPERCASE or lowercase chars different, but a Linux server will. So if you transfer uploads to a server suddenly they stop working and give you 404 errors.
When enabled this feature will
- Only keep basic printable ASCII characters.
- Remove international chars like "åäö".
- Remove strange chars like
åorå(they look very much like the Swedish letteråbut they are not). - Remove percent signs "%".
- Make file names lowercase.
- Example: instead of
/uploads/svenska tecken och mellanslag åäöÅÄÖ hej citattecken';.jpgyour file will be uploaded as/uploads/svenska-tecken-och-mellanslag-aaoaao-hej-citattecken.jpg. Another example is the fileIngen-ko-på-isen-1b-2.jpgthat will be changed toingen-ko-pa-isen-1b-2.jpg(Funny bonus story: the previous filename is from a real project and it was the whole reason why I started working on this feature!).
Cleanup dashboard
add_theme_support('gardener-cleanup-dashboard');
- Removes unwanted dashboard meta boxes, like QuickPress, plugins, recent drafts, incoming links, news and events, WPML meta box if WPML is installed.
- Removes the text "Thank you for creating with WordPress" at the bottom.
Hide posts
add_theme_support('gardener-hide-posts');
- Hide posts links from admin menu and from admin bar (New -> Post).
Hide comments
add_theme_support('gardener-hide-comments');
- Hide comments from admin menu.
Enhance login screen
add_theme_support('gardener-enhance-login-screen', [
'message' => "Welcome to ACME Co website. Please login!",
'image' => '84x84px-login-image.png',
'image_width => 200,
'image_height => 75,
]);
- Changes link to wordpress.org to a link back to the homepage of the site.
- Add support for local client image above login fields.
- Uses image
login-client-logo.pngfrom theme folder if it exists, or any image using theimageargument.
- Uses image
- Arguments are optional.
Other similar plugins
This plugin is not unique. The following plugins are similar popular plugins:
- https://github.com/littlebizzy/speed-demon
- https://github.com/roots/soil
- https://github.com/wordplate/plate
Changelog
- 0.4 Add feature
gardener-hide-commentsthat hides the comments menu item. - 0.3 Use
login_headertextinstead oflogin_headertitlebecauselogin_headertitleis deprecated since WordPress version 5.2.0. - 0.2.1 Add support for custom login image size.
- 0.2 Add support for feature hide posts.
- 0.1 First version
bonny/gardener 适用场景与选型建议
bonny/gardener 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 386 次下载、GitHub Stars 达 12, 最近一次更新时间为 2019 年 04 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 bonny/gardener 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bonny/gardener 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 386
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2019-04-17

