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.