Skip to content

[WordPressPluginUpdate] fix: broken bridge#2572

Merged
dvikan merged 1 commit intoRSS-Bridge:masterfrom
dvikan:wordpress-plugin
Apr 3, 2022
Merged

[WordPressPluginUpdate] fix: broken bridge#2572
dvikan merged 1 commit intoRSS-Bridge:masterfrom
dvikan:wordpress-plugin

Conversation

@dvikan
Copy link
Contributor

@dvikan dvikan commented Mar 31, 2022

I think they removed the changelog html page. Or maybe it
was a redirect. Anyways, this change uses their json api
to fetch plugin data.

I think they removed the changelog html page. Or maybe it
was a redirect. Anyways, this change uses their json api
to fetch plugin data.
@github-actions
Copy link

Pull request artifacts

file last change
WordPressPluginUpdate-current-context1 2022-03-31, 01:24:53
WordPressPluginUpdate-pr-context1 2022-03-31, 01:24:53

@yamanq
Copy link
Contributor

yamanq commented Mar 31, 2022

I think the changelog was just moved into the development tab (see archive). I think this bridge needs to parse the changelog data to be useful (to get description, date). However, it seems that the RSS link on the #developers page is a little more complete in that regard.

@dvikan
Copy link
Contributor Author

dvikan commented Mar 31, 2022

Ah I didnt see that. I think that's basically commits in the wordpress.org plugins repo?

https://plugins.trac.wordpress.org/log/feedzy-rss-feeds?format=rss&rev=2702413&limit=100&mode=stop_on_copy

@yamanq
Copy link
Contributor

yamanq commented Mar 31, 2022

The small diff below gets it close to working on many plugins. Based on how it's used in the code, the parameter is meant to be the slug, not the full URL.

Since the changelog format differs between plugins, the ideal solution might be to parse the JSON as you did, and then use those version numbers to find more details from the changelog. However, I think that the RSS feed on the site is probably enough.

diff --git a/bridges/WordPressPluginUpdateBridge.php b/bridges/WordPressPluginUpdateBridge.php
index e347a90..50d9e9a 100644
--- a/bridges/WordPressPluginUpdateBridge.php
+++ b/bridges/WordPressPluginUpdateBridge.php
@@ -10,8 +10,8 @@ class WordPressPluginUpdateBridge extends BridgeAbstract {
        const PARAMETERS = array(
                array(
                        'pluginUrl' => array(
-                               'name' => 'URL to the plugin',
-                               'exampleValue' => 'https://wordpress.org/plugins/wp-rss-aggregator/',
+                               'name' => 'Slug of the plugin',
+                               'exampleValue' => 'wp-rss-aggregator',
                                'required' => true
                        )
                )
@@ -20,11 +20,11 @@ class WordPressPluginUpdateBridge extends BridgeAbstract {
        public function collectData(){
 
                $request = str_replace('/', '', $this->getInput('pluginUrl'));
-               $page = self::URI . $request . '/changelog/';
+               $page = self::URI . $request . '/';
 
                $html = getSimpleHTMLDOM($page);
 
-               $content = $html->find('.block-content', 0);
+               $content = $html->find('.plugin-changelog', 0);
 
                $item = array();
                $item['content'] = '';

@dvikan
Copy link
Contributor Author

dvikan commented Mar 31, 2022

The json also contains a large blog of the entire changelog. We could include the entire changelog on each feed item?
But I noticed that created huge amount of data for e.g. kismet.

The rss feeds doesnt contain changelog. They are VCS commits.

The previous solution parsed the changelog by hand. But formats differ. It's basically entirely written by the author with a WYSIWYG editor.

@dvikan dvikan merged commit 7b168a2 into RSS-Bridge:master Apr 3, 2022
@dvikan dvikan deleted the wordpress-plugin branch April 3, 2022 07:38
IAM-marco pushed a commit to IAM-marco/rss-bridge that referenced this pull request Jun 17, 2022
I think they removed the changelog html page. Or maybe it
was a redirect. Anyways, this change uses their json api
to fetch plugin data.
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

Successfully merging this pull request may close these issues.

2 participants