gutenblock
gutenblock copied to clipboard
WP Admin - Plugin update screen
Just a heads up -
Admin says update available -

Plugin details shows "Blocks" plugin

Might want to change the name of the blocks dir.
ncp(__dirname + '/../../plugin', `${process.cwd()}/blocks`, err => {
Thanks I think it’s because of the package definition name in the php file I need to change. Will look into it in a bit
hmm, is it really from the registerBlockType("${pluginName}", Block)
thats weird to me. Feel like it should be going by the plugin package name in the php file no?
I always thought it only got the name and version from the .php file but maybe not
https://www.cozmoslabs.com/1667-wordpress-automatic-updates-based-on-folder-name-is-that-a-problem
Also found this with a little more detail
https://wordpress.stackexchange.com/questions/56968/if-i-rename-a-plugin-in-its-main-php-file-do-i-still-get-update-notifications
The API uses a rather elaborate mechanism to match plugins against plugins it knows about, but these are the main things checked for: Plugin URI, Plugin Name, and Plugin slug (**the directory name the plugin is in**)
Change any of those and you reduce the chances of it finding a match, but it might still get it if two of them match, for example.
Info in the readme.txt is not used for this. The header of the plugin's PHP file itself is used.
I renamed the blocks dir and the notice no longer appears. I guess say I did have that other plugin installed prior it would use the blocks dir and create a collision.
thats annoying... will work on this later this week too
-
I think it would be best If you create an option in the
gutenblock init
command to let the developer define a folder name for the plugin, you would use it like thisgutenblock init my-plugin-folder
. -
Also change the default folder name to something like
gutenblock
.
If you could make a pr for this I will accept. Sorry it took so long, I don’t have much time to work on this but would like to keep it up to date.