sb2-media/wordpress-starter-plugin
Composer 安装命令:
composer require sb2-media/wordpress-starter-plugin
包简介
Central repository for crafting plugins to extend and customize WordPress.
关键字:
README 文档
README
** In development. Not ready for production.
Central repository for crafting plugins to extend and customize WordPress
Features
- Pimple container dependency injection
- Built-in initialization tasks
- System environment compatibility check
- Plugin constants with ability to add more
- Enqueue manager for enqueuing styles and scripts into WordPress
- Localization - includes a
.potfile as a starting point for internationalization - Class to handle all activation/deactivation/installation tasks
- Modules
- Config - abstracts the runtime configuration out of the modules and into the
configfolder - Event Management - interact with the WordPress Plugin API
- File and template loader
- Config - abstracts the runtime configuration out of the modules and into the
- Composer autoloader
- Follows PSR-4 coding standards
- Includes Laravel Mix for simple webpack implementation
- Custom post type functionality - configured via config file
Requirements
Make sure all dependencies have been installed before moving on:
Installation
- From the command line navigate to your WordPress
mu-pluginsdirectory. - Run this command:
composer create-project sb2-media/wordpress-starter-plugin. - Rename the
wordpress-starter-plugindirectory toyour-plugin-name. - Change into the plugin directory:
cd your-plugin-name. - Update the
package.jsonfile with your info. - Update the main plugin header in
plugin.phpwith your plugin info. - Run
npm install. - Run
npm run dev. - Global search and replace
SB2Media\Hubnamespaces withYourCompanyName\YourPluginName. - Update
composer.jsonwith relevant information including the namespaces defined in theautoloadsection. They must match the namespaces used in the previous step. - Run
composer dump-autoload -o. - In the WordPress dashboard, navigate to the Plugins page and locate the menu item that reads “Your Plugin Name.”
- Click on Activate.
Note that this will activate the source code of the starter plugin, but because it has no real functionality no menu items, meta boxes, or custom post types will be added.
Usage
Enqueuing Assets
Default behavior for enqueueing assets is via two configuration files found in the config folder. Front-end and back-end assets can be defined in enqueue.php and admin-enqueue.php, respectively. Adding multiple files is as simple as adding another entry in the configuration array. This is well-documented in each file.
Alternatively (or in conjunction with), assets can be enqueued via the EnqueueManager class' enqueueStyles and enqueueScripts methods. These are best called in the Plugin class' enqueueAssets and enqueueAdminAssets methods.
Each asset to be enqueued should be placed in the appropriate assets/sass (default for css), assets/css and/or assets/js subfolders. These filed must also be defined in webpack.mix.js in the plugin's root directory and compiled into the appropriate dist/ subfolder by executing npm run dev or npm run production on the command line.
Recommended Tools
i18n Tools
The WordPress Starter Plugin uses a variable to store the text domain used when internationalizing strings throughout. To take advantage of this method, there are tools that are recommended for providing correct, translatable files:
Any of the above tools should provide you with the proper tooling to internationalize the plugin.
License
The WordPress Starter Plugin is licensed under the GPL v2 or later.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
A copy of the license is included in the root of the plugin’s directory. The file is named LICENSE.
Assets
The assets/images directory contains three files.
banner-772x250.pngis used to represent the plugin’s header image.icon-256x256.pngis a used to represent the plugin’s icon image (which is new as of WordPress 4.0).screenshot-1.pngis used to represent a single screenshot of the plugin that corresponds to the “Screenshots” heading in your pluginREADME.txt.
Credits
This starter plugin was originally based on The WordPress Plugin Boilerplate which was started in 2011 by Tom McFarlin. The current version of the Boilerplate was developed in conjunction with Josh Eaton, Ulrich Pogson, and Brad Vincent. The fork which this is directly forked from was developed by Luís Rodrigues.
This plugin also uses code and concepts adapted from Carl Alexander and Tonya Mork's Fulcrum plugin.
sb2-media/wordpress-starter-plugin 适用场景与选型建议
sb2-media/wordpress-starter-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 31 次下载、GitHub Stars 达 6, 最近一次更新时间为 2017 年 08 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「wordpress」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sb2-media/wordpress-starter-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sb2-media/wordpress-starter-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sb2-media/wordpress-starter-plugin 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Plugin for YOURLS. Default tools to use in some laemmi plugins
Must-use plugin integrating WordPress with the Upsun platform: environment awareness, router-cache friendliness, safe preview clones, deploy migrations, Site Health checks, and a wp upsun CLI command.
Allows polling user for event dates and times.
Support swipe touch gestures to navigate in paginated lists and on Tidypics image pages.
Add a postscript to every email notification sent out to users.
统计信息
- 总下载量: 31
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2017-08-15