Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a check to confirm plugin is available through dotorg #5

Open
maxinacube opened this issue Aug 20, 2020 · 1 comment
Open

Add a check to confirm plugin is available through dotorg #5

maxinacube opened this issue Aug 20, 2020 · 1 comment
Assignees

Comments

@maxinacube
Copy link

When triggering the extension, check if the plugins available for update are on dotorg

Some plugins allow updating through the WordPress Admin even though they are not available for direct download from the WordPress plugin repo. When gathering the slugs for the wpackagist composer list, we should loop through and hit https://api.wordpress.org/plugins/info/1.0/{slug}.json to check for a returned error before including it in the composer/packagist list.

@maxinacube maxinacube self-assigned this Aug 20, 2020
@maxinacube
Copy link
Author

@aaronware I pushed to the issue/5 branch

What I'm trying to do is reach out to the API in content.js and append a skipComposer true or false to the pluginData object based on the response.

From there, popup.js should look for the pluginData.skipComposer value to determine if the plugin should be included in the composer.json copy via the copyComposerPackages function

Another issue that I started seeing today - even after switching back to master to exclude my changes - is a JS error within the extension's popup.html

Unchecked runtime.lastError: The message port closed before a response was received.

Error handling response: TypeError: Cannot read property 'length' of undefined at chrome-extension://kknpefnigljpgndhdkicepfnhnnhcdhd/popup.js:44:64

popup.js line trigger the above error:
chrome.browserAction.setBadgeText({text: (response.length).toString(), tabId: tabs[0].id});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant