1

When I try to install the plugin https://github.com/wp-graphql/wp-graphql-woocommerce using:

wp plugin install https://github.com/wp-graphql/wp-graphql-woocommerce/releases/download/v0.10.4/wp-graphql-woocommerce.zip

The plugin will be added with a random suffix added to the plugin-name /wp-content/plugins/wp-graphql-woocommerce-0ymkp2.

Is this by design or is something weird going on? Currently I am using curl to download the package and install it from the local file.

Dennie de Lange
  • 2,776
  • 2
  • 18
  • 31
  • Hi Dennie, I am also facing the same issue. Did you get any solution to this problem. I am installing the plugin from a local zip file. – Arsh Sharma Jul 06 '22 at 14:58

1 Answers1

0

I ran into this when I was creating a custom plugin. It appears to happen because Wordpress expects a subdirectory at the root of the plugin's .zip file that matches the slug of the plugin.

That is, instead of the .zip file containing:

includes/class-acf-schema-filters.php
includes/class-core-schema-filters.php
.
.
.
vendor/firebase/php-jwt/src/Key.php
vendor/firebase/php-jwt/src/SignatureInvalidException.php   
wp-graphql-woocommerce.php

It should instead contain:

wp-graphql-woocommerce/includes/class-acf-schema-filters.php
wp-graphql-woocommerce/includes/class-core-schema-filters.php
.
.
.
wp-graphql-woocommerce/vendor/firebase/php-jwt/src/Key.php
wp-graphql-woocommerce/vendor/firebase/php-jwt/src/SignatureInvalidException.php   
wp-graphql-woocommerce/wp-graphql-woocommerce.php

As soon as I changed my plugin to have a subdirectory at the root of the .zip file, Wordpress stopped renaming my plugin directory with a random suffix whenever I updated it.

ctc
  • 2,640
  • 1
  • 16
  • 18