|
1 |
| -[](https://github.com/jrtashjian/pluginwp/actions/workflows/build-and-test.yml) |
| 1 | +# LastFM Profile Blocks |
2 | 2 |
|
3 |
| -# PluginWP Foundation |
| 3 | +## Requirements |
4 | 4 |
|
5 |
| -🚧 [**UNDER DEVELOPMENT**](https://github.com/jrtashjian/pluginwp/issues/1) 🚧 |
6 |
| - |
7 |
| -PluginWP is a modern starting point for building WordPress plugins using React and the [block editor components](https://github.com/WordPress/gutenberg/tree/trunk/packages). It brings a more maintainable and scalable approach to plugin development by introducing concepts from Laravel, such as the [Service Container](https://laravel.com/docs/8.x/container) and [Service Providers](https://laravel.com/docs/8.x/providers). |
8 |
| - |
9 |
| -## Features |
10 |
| - |
11 |
| -- Modern PHP architecture inspired by Laravel |
12 |
| -- React-based block editor components |
13 |
| -- Composer and npm support |
14 |
| -- Pre-configured build tools and scripts |
15 |
| -- Easy-to-follow structure for scalable plugin development |
| 5 | +- PHP 7.4+ |
| 6 | +- [WordPress](http://wordpress.org/) 6.8+ |
16 | 7 |
|
17 | 8 | ## Installation
|
18 | 9 |
|
19 |
| -### Requirements |
| 10 | +**Automatic installation** |
20 | 11 |
|
21 |
| -- [Node.js](https://nodejs.org) |
22 |
| -- [Composer](https://getcomposer.org) |
| 12 | +To do an automatic install of LastFM Profile Blocks, log in to your WordPress dashboard, navigate to the Plugins menu, and click “Add New.” |
23 | 13 |
|
24 |
| -### Quick Start |
| 14 | +In the search field type “LastFM Profile Blocks,” then click “Search Plugins.” Once you’ve found us, you can click “Install Now” and WordPress will take it from there. |
25 | 15 |
|
26 |
| -**Create your plugin project:** |
| 16 | +**Manual installation** |
27 | 17 |
|
28 |
| -Clone this repository or click [Use this template](https://github.com/jrtashjian/pluginwp/generate) to create a new project on GitHub. |
| 18 | +Manual installation method requires [downloading the LastFM Profile Blocks plugin](https://wordpress.org/plugins/lastfm-profile-blocks) and uploading it to your web server via your favorite FTP application. The WordPress codex contains [instructions on how to do this here](https://wordpress.org/support/article/managing-plugins/#manual-plugin-installation). |
29 | 19 |
|
30 |
| -```sh |
31 |
| -git clone https://github.com/jrtashjian/pluginwp.git yourpluginslug |
32 |
| -cd yourpluginslug |
33 |
| -``` |
| 20 | +## Development |
34 | 21 |
|
35 |
| -**Customize plugin details:** |
36 |
| - |
37 |
| -Replace all occurrences of `PluginWP Author` with your actual author name: |
38 |
| - |
39 |
| -```sh |
40 |
| -find . -type f -not -path "./.git/*" -exec sed -i 's/PluginWP Author/Actual Author Name/g' {} + |
| 22 | +Clone this repository: |
41 | 23 | ```
|
42 |
| - |
43 |
| -Replace all occurrences of `PluginWP` with your plugin slug (e.g., `YourPluginSlug`): |
44 |
| - |
45 |
| -```sh |
46 |
| -find . -type f -not -path "./.git/*" -exec sed -i 's/PluginWP/YourPluginSlug/g' {} + |
| 24 | +git clone https://github.com/jrtashjian/lastfm-profile-blocks.git |
47 | 25 | ```
|
48 | 26 |
|
49 |
| -Replace all occurrences of `pluginwp` with your lowercase plugin slug (e.g., `yourpluginslug`): |
50 |
| - |
51 |
| -```sh |
52 |
| -find . -type f -not -path "./.git/*" -exec sed -i 's/pluginwp/yourpluginslug/g' {} + |
| 27 | +Install [PHP-Scoper](https://github.com/humbug/php-scoper) globally and run it to prefix required dependencies: |
53 | 28 | ```
|
54 |
| - |
55 |
| -Finally, rename the main plugin file: |
56 |
| - |
57 |
| -```sh |
58 |
| -mv pluginwp.php yourpluginslug.php |
| 29 | +composer global require humbug/php-scoper && composer run phpscoper |
59 | 30 | ```
|
60 | 31 |
|
61 |
| -## Setup |
62 |
| - |
63 |
| -Install the necessary dependencies: |
64 |
| - |
65 |
| -```sh |
66 |
| -composer install |
67 |
| -npm install |
| 32 | +Install the necessary Node.js and Composer dependencies: |
| 33 | +``` |
| 34 | +composer install && npm install |
68 | 35 | ```
|
69 | 36 |
|
70 |
| -## Available CLI Commands |
71 |
| - |
72 |
| -### Composer Scripts |
73 |
| - |
74 |
| -- `composer lint` : Run PHP_CodeSniffer on all PHP files using `phpcs.xml.dist`. |
75 |
| -- `composer lint-prefixed` : Run PHP_CodeSniffer on prefixed vendor files using `phpcs-prefixed.xml.dist`. |
76 |
| -- `composer format` : Automatically fix fixable PHP coding standard issues using PHPCBF. |
77 |
| -- `composer test` : Run the PHPUnit test suite. |
78 |
| -- `composer makepot` : Generate a .pot file for translations using WP-CLI. |
79 |
| -- `composer build-release` : Build a distributable plugin archive. |
80 |
| -- `composer phpscoper` : Run PHP-Scoper to prefix vendor dependencies. |
81 |
| - |
82 |
| -### NPM Scripts |
83 |
| - |
84 |
| -- `npm run build` : Compile all scripts and styles for distribution. |
85 |
| -- `npm run build:analyze-bundles` : Build and analyze bundle sizes with webpack-bundle-analyzer. |
86 |
| -- `npm run start` : Start the development build process. |
87 |
| -- `npm run format:php` : Run Composer's `format` script inside the wp-env container. |
88 |
| -- `npm run lint:css` : Lint all SCSS files using WordPress stylelint config. |
89 |
| -- `npm run lint:css:fix` : Lint and automatically fix SCSS files. |
90 |
| -- `npm run lint:js` : Lint JavaScript files using WordPress ESLint config. |
91 |
| -- `npm run lint:js:fix` : Lint and automatically fix JavaScript files. |
92 |
| -- `npm run lint:php` : Run Composer's `lint` script inside the wp-env container. |
93 |
| -- `npm run lint:php:prefixed` : Run Composer's `lint-prefixed` script inside the wp-env container. |
94 |
| -- `npm run mailhog` : Start a MailHog SMTP testing server in Docker. |
95 |
| -- `npm run packages-update` : Update all @wordpress packages to the specified dist-tag. |
96 |
| -- `npm run test:php` : Run all PHP linting and unit tests. |
97 |
| -- `npm run test:unit:php:coverage` : Run PHPUnit with code coverage report. |
98 |
| -- `npm run test:unit:php:setup` : Start wp-env with Xdebug for code coverage. |
99 |
| -- `npm run test:unit:php` : Run PHPUnit setup and then the test suite. |
100 |
| -- `npm run wp-env` : Start and manage the local WordPress environment using @wordpress/env. |
101 |
| -- `npm run version` : Update version numbers and stage changes for commit. |
102 |
| - |
103 |
| -For more details, see the `scripts` section in `composer.json` and `package.json`. |
104 |
| - |
105 |
| -## Contributing |
106 |
| - |
107 |
| -Contributions are welcome! Please open issues or submit pull requests to help improve this project. |
108 |
| - |
109 |
| -## License |
110 |
| -This project is open source and available under the [GNU General Public License v2.0 or later (GPL-2.0+)](LICENSE). |
111 |
| - |
112 |
| ---- |
113 |
| - |
114 |
| -Now go build something awesome! 🚀 |
| 37 | +Run the development build which will watch for changes: |
| 38 | +``` |
| 39 | +npm run start |
| 40 | +``` |
0 commit comments