Skip to content

Commit b57599b

Browse files
committed
Rename plugin from PluginWP to LastFMProfileBlocks and update related files
1 parent 90fcba0 commit b57599b

29 files changed

+713
-1158
lines changed

README.md

Lines changed: 21 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,40 @@
1-
[![Build and Test](https://github.com/jrtashjian/pluginwp/actions/workflows/build-and-test.yml/badge.svg?branch=master)](https://github.com/jrtashjian/pluginwp/actions/workflows/build-and-test.yml)
1+
# LastFM Profile Blocks
22

3-
# PluginWP Foundation
3+
## Requirements
44

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+
167

178
## Installation
189

19-
### Requirements
10+
**Automatic installation**
2011

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.”
2313

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.
2515

26-
**Create your plugin project:**
16+
**Manual installation**
2717

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).
2919

30-
```sh
31-
git clone https://github.com/jrtashjian/pluginwp.git yourpluginslug
32-
cd yourpluginslug
33-
```
20+
## Development
3421

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:
4123
```
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
4725
```
4826

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:
5328
```
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
5930
```
6031

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
6835
```
6936

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+
```

composer.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
{
2-
"name": "pluginwp/pluginwp",
3-
"type": "wordpress-plugin",
2+
"name": "jrtashjian/lastfm-profile-blocks",
3+
"type": "wordpress-plugin",
44
"license": "GPL-2.0-or-later",
55
"authors": [
66
{
7-
"name": "Plugin Author",
8-
"homepage": "https://pluginwp.com"
7+
"name": "JR Tashjian",
8+
"homepage": "https://jrtashjian.com"
99
}
1010
],
1111
"autoload": {
1212
"psr-4": {
13-
"PluginWP\\": "includes"
13+
"LastFMProfileBlocks\\": "includes"
1414
},
1515
"classmap": [
1616
"vendor_prefixed/"
1717
]
1818
},
1919
"autoload-dev": {
2020
"psr-4": {
21-
"PluginWP\\Tests\\": "phpunit/includes"
21+
"LastFMProfileBlocks\\Tests\\": "phpunit/includes"
2222
}
2323
},
2424
"require": {
2525
"league/container": "^4.2"
2626
},
2727
"require-dev": {
2828
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
29-
"johnpbloch/wordpress-core": "^6.1",
29+
"johnpbloch/wordpress-core": "^6.8",
3030
"phpcompatibility/phpcompatibility-wp": "^2.1",
3131
"wp-cli/wp-cli-bundle": "^2.6",
3232
"wp-coding-standards/wpcs": "^3.0",
@@ -43,23 +43,26 @@
4343
"sort-packages": true
4444
},
4545
"scripts": {
46+
"pre-install-cmd": [
47+
"mkdir -p vendor_prefixed"
48+
],
4649
"lint": "phpcs --standard=phpcs.xml.dist",
4750
"lint-prefixed": "phpcs --standard=phpcs-prefixed.xml.dist",
4851
"format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",
4952
"test": "phpunit",
50-
"makepot": "wp i18n make-pot . --exclude=\"node_modules,vendor\" --headers='{\"Last-Translator\":\"info@pluginwp.com\",\"Language-Team\":\"info@pluginwp.com\",\"Report-Msgid-Bugs-To\":\"https://pluginwp.com/contact\"}'",
53+
"makepot": "wp i18n make-pot . --exclude=\"node_modules,vendor\" --headers='{\"Last-Translator\":\"hello@jrtashjian.com\",\"Language-Team\":\"hello@jrtashjian.com\",\"Report-Msgid-Bugs-To\":\"https://jrtashjian.com/contact\"}'",
5154
"build-release": [
5255
"rm -r ./vendor",
5356
"@composer dump-autoload",
5457
"wp dist-archive ./",
5558
"@composer install"
5659
],
5760
"phpscoper": [
58-
"rm -rf ./vendor ./vendor_prefixed",
61+
"rm -rf ./vendor_prefixed",
5962
"@composer install --no-autoloader --no-dev --prefer-dist",
6063
"php-scoper add-prefix --force",
6164
"rm -rf ./vendor",
6265
"@composer dump-autoload --optimize"
6366
]
6467
}
65-
}
68+
}

includes/Application.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
/**
33
* The Application class.
44
*
5-
* @package PluginWP
5+
* @package LastFMProfileBlocks
66
*/
77

8-
namespace PluginWP;
8+
namespace LastFMProfileBlocks;
99

10-
use PluginWP\Dependencies\League\Container\Container;
11-
use PluginWP\Dependencies\League\Container\DefinitionContainerInterface;
10+
use LastFMProfileBlocks\Dependencies\League\Container\Container;
11+
use LastFMProfileBlocks\Dependencies\League\Container\DefinitionContainerInterface;
1212

1313
/**
1414
* The Application class.
@@ -57,11 +57,11 @@ public static function get_instance() {
5757
/**
5858
* Set the shared instance of the container.
5959
*
60-
* @param \PluginWP\Dependencies\League\Container\DefinitionContainerInterface|null $container The Dependency Injection Container.
60+
* @param \LastFMProfileBlocks\Dependencies\League\Container\DefinitionContainerInterface|null $container The Dependency Injection Container.
6161
*
62-
* @return \PluginWP\Dependencies\League\Container\DefinitionContainerInterface|static
62+
* @return \LastFMProfileBlocks\Dependencies\League\Container\DefinitionContainerInterface|static
6363
*/
64-
public static function set_instance( DefinitionContainerInterface $container = null ) {
64+
public static function set_instance( ?DefinitionContainerInterface $container = null ) {
6565
static::$instance = $container;
6666
return static::$instance;
6767
}
@@ -111,21 +111,21 @@ public function base_url( $path = '' ) {
111111
* Callback for plugin activation.
112112
*/
113113
public function activation() {
114-
do_action( 'pluginwp_activate' );
114+
do_action( 'lastfm_profile_blocks_activate' );
115115
}
116116

117117

118118
/**
119119
* Callback for plugin deactivation.
120120
*/
121121
public function deactivation() {
122-
do_action( 'pluginwp_deactivate' );
122+
do_action( 'lastfm_profile_blocks_deactivate' );
123123
}
124124

125125
/**
126126
* Load language files.
127127
*/
128128
public function load_text_domain() {
129-
load_plugin_textdomain( 'pluginwp', false, $this->base_path( 'languages' ) );
129+
load_plugin_textdomain( 'lastfm_profile_blocks', false, $this->base_path( 'languages' ) );
130130
}
131131
}

includes/BlockLibrary/BlockLibraryServiceProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
/**
33
* The BlockLibraryServiceProvider class.
44
*
5-
* @package PluginWP
5+
* @package LastFMProfileBlocks
66
*/
77

8-
namespace PluginWP\BlockLibrary;
8+
namespace LastFMProfileBlocks\BlockLibrary;
99

10-
use PluginWP\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
11-
use PluginWP\Dependencies\League\Container\ServiceProvider\BootableServiceProviderInterface;
10+
use LastFMProfileBlocks\Dependencies\League\Container\ServiceProvider\AbstractServiceProvider;
11+
use LastFMProfileBlocks\Dependencies\League\Container\ServiceProvider\BootableServiceProviderInterface;
1212

1313
/**
1414
* The BlockLibraryServiceProvider class.

0 commit comments

Comments
 (0)