Closed MattOndo closed 1 year ago
When you say "the path it provides is correct, all the way to and including the plugin directory", do you mean that it only includes the directory path? It should also include the plugin file name. In other words, it should be the fully qualified file name of the main plugin file.
@YahnisElsts ahah! I misunderstood the direction in another thread. The 2nd parameter I used was to the plugin directory, it did not include the main plugin file name. I updated to the following and the errors no longer persist. Thank you so much for the quick response!
✅ Solution:
if (! file_exists($composer = PLUGIN_PATH . 'vendor/autoload.php')) {
wp_die(__('Error locating autoloader. Please contact the plugin\'s maintainer or <a href="mailto:email@domain.com">email@domain.com</a>', 'plugin-name'));
}
require $composer;
$UpdateChecker = Puc_v4_Factory::buildUpdateChecker(
'https://wpupdates.evercommerce.com/wp-update-server/?action=get_metadata&slug=updox-calculators',
PLUGIN_PATH . "plugin-name.php",
'plugin-name',
);
Using
"yahnis-elsts/plugin-update-checker": "^4.9"
I am running into this issue where I get the following errors, the first two display four times each when debug is enabled:The update checker code (my code below) lives in a subdirectory, specifically within
/includes/class-plugin-name.php
. I am using a defined constantPLUGIN_PATH
to provide it with the correct path to the plugin directory (as per another thread I found here). The path it provides is correct, all the way to and including the plugin director:/path/to/wp-content/plugins/plugin-name/
.Note that the composer autoload is included elsewhere
The logs show when the URL is hit it's missing some data, however, the "download" functionality still works. I see all others we have configured are pulling in version numbers, hostnames, and have a number of other parameters on the last cell. Logs below:
The header info in the main plugin file,
plugin-name.php
is as follows:Best I can tell, the header info is correct and the file definitely exists. Am I passing in the correct pathname to the 2nd parameter? If so, do I need to tweak anything else based on this being in a subdirectory? Help is much appreciated!