diff --git a/.editorconfig b/.editorconfig index bcb7b46..d47cf54 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,6 +19,9 @@ indent_style = tab indent_size = 4 indent_style = tab +[*.neon] +indent_style = tab + [*.xml] indent_style = tab diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7418494..7eaf88e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: tests: # https://github.com/actions/virtual-environments - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 defaults: run: working-directory: ./Extensions @@ -54,16 +54,13 @@ jobs: - name: PHPStan run: composer run-script phpstan - - name: PHPStan Next Level - run: composer run-script phpstan-next - # NPM tests - name: Uses Node.js uses: actions/setup-node@v3 with: # https://nodejs.org/en/about/releases/ - node-version: '18' + node-version: '22' cache: 'npm' cache-dependency-path: 'Extensions/package-lock.json' diff --git a/README.md b/README.md index 07ef0a9..8494f25 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,10 @@ There are some FreshRSS extensions out there, developed by community members: * [Pocket Button](https://github.com/christian-putzke/freshrss-pocket-button): Add articles to Pocket with one simple button click or a keyboard shortcut. +### By [@huffstler](https://github.com/huffstler) + +* [Star To Pocket](https://github.com/huffstler/xExtension-StarToPocket): Like the extension above, but sends articles to Pocket when they are starred. Also works with FreshRSS client applications! + ### By [@Joedmin](https://github.com/Joedmin/) * [Readeck Button](https://github.com/Joedmin/xExtension-readeck-button): Add articles to a selected Readeck instance with one simple button click or a keyboard shortcut. @@ -149,3 +153,7 @@ There are some FreshRSS extensions out there, developed by community members: ### By [@lukasMega](https://github.com/lukasMega) * [Word Highlighter](https://github.com/lukasMega/Extensions-FreshRSS-): Gives you ability to highlight user-defined words (using [mark.js](https://github.com/julkue/mark.js)) + +### By [@LiangWei88](https://github.com/LiangWei88) + +* [ArticleSummary](https://github.com/LiangWei88/xExtension-ArticleSummary): A powerful article summarization plugin for FreshRSS that allows users to generate summaries using a language model API conforming to the OpenAI API specification. diff --git a/composer.json b/composer.json index 5b04d66..daa8bee 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "WebSub" ], "require": { - "php": ">=7.4", + "php": ">=8.1", "ext-ctype": "*", "ext-curl": "*", "ext-dom": "*", @@ -45,28 +45,26 @@ "ext-pdo_pgsql": "*" }, "require-dev": { - "php": ">=7.4", + "php": ">=8.1", "ext-phar": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "phpstan/phpstan": "^1.11", - "phpstan/phpstan-strict-rules": "^1.6", - "squizlabs/php_codesniffer": "^3.9" + "phpstan/phpstan": "^2", + "phpstan/phpstan-strict-rules": "^2", + "squizlabs/php_codesniffer": "^3" }, "scripts": { "php-lint": "find . -type d -name 'vendor' -prune -o -name '*.php' -print0 | xargs -0 -n1 -P4 php -l 1>/dev/null", "phtml-lint": "find . -type d -name 'vendor' -prune -o -name '*.phtml' -print0 | xargs -0 -n1 -P4 php -l 1>/dev/null", "phpcs": "phpcs . -s", "phpcbf": "phpcbf . -p -s", - "phpstan": "phpstan analyse --memory-limit 512M .", - "phpstan-next": "phpstan analyse --memory-limit 512M -c phpstan-next.neon .", - "phpstan-third-party": "phpstan analyse --memory-limit 512M -c phpstan-third-party.neon .", + "phpstan": "phpstan analyse .", + "phpstan-third-party": "phpstan analyse -c phpstan-third-party.neon .", "test": [ "@php-lint", "@phtml-lint", "@phpcs", - "@phpstan", - "@phpstan-next" + "@phpstan" ], "fix": [ "@phpcbf" diff --git a/composer.lock b/composer.lock index dfb526d..66e0097 100644 --- a/composer.lock +++ b/composer.lock @@ -4,25 +4,25 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "52101009acffc9684a721cc20ec9e731", + "content-hash": "02054632764558c26a4fbecc0e408c09", "packages": [], "packages-dev": [ { "name": "phpstan/phpstan", - "version": "1.11.10", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "640410b32995914bde3eed26fa89552f9c2c082f" + "reference": "cd6e973e04b4c2b94c86e8612b5a65f0da0e08e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/640410b32995914bde3eed26fa89552f9c2c082f", - "reference": "640410b32995914bde3eed26fa89552f9c2c082f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cd6e973e04b4c2b94c86e8612b5a65f0da0e08e7", + "reference": "cd6e973e04b4c2b94c86e8612b5a65f0da0e08e7", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -63,32 +63,31 @@ "type": "github" } ], - "time": "2024-08-08T09:02:50+00:00" + "time": "2025-01-05T16:43:48+00:00" }, { "name": "phpstan/phpstan-strict-rules", - "version": "1.6.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "363f921dd8441777d4fc137deb99beb486c77df1" + "reference": "ed6fea0ad4ad9c7e25f3ad2e7c4d420cf1e67fe3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/363f921dd8441777d4fc137deb99beb486c77df1", - "reference": "363f921dd8441777d4fc137deb99beb486c77df1", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/ed6fea0ad4ad9c7e25f3ad2e7c4d420cf1e67fe3", + "reference": "ed6fea0ad4ad9c7e25f3ad2e7c4d420cf1e67fe3", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", - "phpstan/phpstan": "^1.11" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.0.4" }, "require-dev": { - "nikic/php-parser": "^4.13.0", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-deprecation-rules": "^1.1", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5" + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^9.6" }, "type": "phpstan-extension", "extra": { @@ -110,22 +109,22 @@ "description": "Extra strict and opinionated rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.6.0" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.1" }, - "time": "2024-04-20T06:37:51+00:00" + "time": "2024-12-12T20:21:10+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.2", + "version": "3.11.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" + "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", - "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1368f4a58c3c52114b86b1abe8f4098869cb0079", + "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079", "shasum": "" }, "require": { @@ -192,7 +191,7 @@ "type": "open_collective" } ], - "time": "2024-07-21T23:26:44+00:00" + "time": "2024-12-11T16:04:26+00:00" } ], "aliases": [], @@ -201,7 +200,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.4", + "php": ">=8.1", "ext-ctype": "*", "ext-curl": "*", "ext-dom": "*", @@ -224,7 +223,7 @@ "ext-zlib": "*" }, "platform-dev": { - "php": ">=7.4", + "php": ">=8.1", "ext-phar": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*" diff --git a/extensions.json b/extensions.json index 0fcb6d7..ec2763f 100644 --- a/extensions.json +++ b/extensions.json @@ -12,6 +12,17 @@ "method": "git", "directory": "." }, + { + "name": "ArticleSummary", + "author": "Liang", + "description": "A powerful article summarization plugin for FreshRSS that allows users to generate summaries using a language model API conforming to the OpenAI API specification.", + "version": "0.1.2", + "entrypoint": "ArticleSummary", + "type": "user", + "url": "https://github.com/LiangWei88/xExtension-ArticleSummary", + "method": "git", + "directory": "." + }, { "name": "Auto Refresh", "author": "Essa AlAwadi", @@ -181,7 +192,7 @@ "name": "Image Proxy", "author": "Frans de Jonge", "description": "No insecure content warnings or disappearing images.", - "version": "0.7.3", + "version": "1.0", "entrypoint": "ImageProxy", "type": "user", "url": "https://github.com/FreshRSS/Extensions", @@ -280,7 +291,7 @@ "name": "Pocket Button", "author": "Christian Putzke", "description": "Add articles to Pocket with one simple button click or a keyboard shortcut.", - "version": "0.5", + "version": "0.6", "entrypoint": "PocketButton", "type": "user", "url": "https://github.com/christian-putzke/freshrss-pocket-button", @@ -291,7 +302,7 @@ "name": "Quick Collapse", "author": "romibi and Marien Fressinaud", "description": "Quickly change from folded to unfolded articles", - "version": "0.2.2", + "version": "0.2.3", "entrypoint": "QuickCollapse", "type": "user", "url": "https://github.com/FreshRSS/Extensions", @@ -313,7 +324,7 @@ "name": "Readable", "author": "printfuck", "description": "Fetch article content for selected feeds with readability or mercury", - "version": "0.3", + "version": "0.4", "entrypoint": "Readable", "type": "user", "url": "https://github.com/printfuck/xExtension-Readable", @@ -324,7 +335,7 @@ "name": "Readeck Button", "author": "Joedmin", "description": "Add articles to Readeck with one simple button click or a keyboard shortcut.", - "version": "0.6", + "version": "0.7", "entrypoint": "ReadeckButton", "type": "user", "url": "https://github.com/Joedmin/xExtension-readeck-button", @@ -390,7 +401,7 @@ "name": "Share By Email", "author": "Marien Fressinaud", "description": "Improve the sharing by email system.", - "version": "0.2.3", + "version": "0.3.1", "entrypoint": "ShareByEmail", "type": "user", "url": "https://github.com/FreshRSS/Extensions", @@ -419,6 +430,17 @@ "method": "git", "directory": "xExtension-SmartMobileMenu" }, + { + "name": "StarToPocket", + "author": "Pat Hough", + "description": "An extension that sends an article to Pocket when you Star (Favorite) it.", + "version": "1", + "entrypoint": "StarToPocket", + "type": "user", + "url": "https://github.com/huffstler/xExtension-StarToPocket", + "method": "git", + "directory": "." + }, { "name": "Sticky Feeds", "author": "Marien Fressinaud", @@ -445,7 +467,7 @@ "name": "ThreePanesView", "author": "nicofrand", "description": "Adds a third vertical pane along the articles list, to display the articles content.", - "version": "1.14", + "version": "1.15", "entrypoint": "ThreePanesView", "type": "user", "url": "https://framagit.org/nicofrand/xextension-threepanesview", @@ -476,8 +498,8 @@ }, { "name": "TranslateTitlesCN", - "version": "0.2", - "description": "Translate article titles of the specified feed into Chinese, using DeepLX or Google Translate.", + "version": "0.3.1", + "description": "Translate article titles of the specified feed into Chinese.", "author": "jacob2826", "website": "https://github.com/jacob2826/FreshRSS-TranslateTitlesCN", "entrypoint": "TranslateTitles", @@ -501,7 +523,7 @@ "name": "Wallabag Button", "author": "Joedmin", "description": "Add articles to Wallabag with one simple button click or a keyboard shortcut.", - "version": "0.2", + "version": "0.4", "entrypoint": "WallabagButton", "type": "user", "url": "https://github.com/Joedmin/xExtension-wallabag-button", @@ -534,7 +556,7 @@ "name": "YouTube Video Feed", "author": "Kevin Papst", "description": "Embed YouTube feeds inside article content.", - "version": "0.12", + "version": "0.13", "entrypoint": "YouTube", "type": "user", "url": "https://github.com/FreshRSS/Extensions", diff --git a/generate.php b/generate.php index 5796b27..5447066 100755 --- a/generate.php +++ b/generate.php @@ -29,7 +29,7 @@ try { } foreach ($repositories as $repository) { - if (null === $url = ($repository['url'] ?? null)) { + if (!is_array($repository) || !is_string($url = ($repository['url'] ?? null))) { continue; } if (TYPE_GIT === ($repository['type'] ?? null)) { @@ -54,7 +54,7 @@ foreach ($gitRepositories as $key => $gitRepository) { } $directory = basename(dirname($metadataFile)); $metadata['url'] = $gitRepository; - $metadata['version'] = strval($metadata['version']); + $metadata['version'] = is_scalar($metadata['version'] ?? null) ? strval($metadata['version']) : ''; $metadata['method'] = TYPE_GIT; $metadata['directory'] = ($directory === sha1($gitRepository)) ? '.' : $directory; $extensions[] = $metadata; diff --git a/phpstan-next.neon b/phpstan-next.neon deleted file mode 100644 index 49062ba..0000000 --- a/phpstan-next.neon +++ /dev/null @@ -1,9 +0,0 @@ -includes: - - phpstan.neon - -parameters: - level: 9 - excludePaths: - analyse: - - xExtension-ImageProxy/configure.phtml - - xExtension-ImageProxy/extension.php diff --git a/phpstan-third-party.neon b/phpstan-third-party.neon index 494f2ca..d616007 100644 --- a/phpstan-third-party.neon +++ b/phpstan-third-party.neon @@ -1,5 +1,8 @@ parameters: - level: 0 + phpVersion: + min: 80100 # PHP 8.1 + max: 80499 # PHP 8.4 + level: 0 # https://phpstan.org/user-guide/rule-levels fileExtensions: - php - phtml @@ -9,13 +12,13 @@ parameters: excludePaths: analyse: - ../FreshRSS - - third-party/*/vendor/* + - third-party/*/vendor/*? analyseAndScan: - - .git/ - - node_modules/ - - symbolic/ - - third-party/*/tests/* - - tmp/ + - .git/*? + - node_modules/*? + - symbolic/*? + - third-party/*/tests/*? + - tmp/*? - vendor/ - xExtension-* dynamicConstantNames: diff --git a/phpstan.dist.neon b/phpstan.dist.neon new file mode 100644 index 0000000..8146830 --- /dev/null +++ b/phpstan.dist.neon @@ -0,0 +1,43 @@ +parameters: + phpVersion: + min: 80100 # PHP 8.1 + max: 80499 # PHP 8.4 + level: 10 # https://phpstan.org/user-guide/rule-levels + fileExtensions: + - php + - phtml + paths: + - ../FreshRSS + - . + excludePaths: + analyse: + - ../FreshRSS + analyseAndScan: + - .git/*? + - node_modules/*? + - symbolic/*? + - third-party/*? + - tmp/*? + - vendor/ + dynamicConstantNames: + - TYPE_GIT + checkBenevolentUnionTypes: true + checkMissingOverrideMethodAttribute: true + checkTooWideReturnTypesInProtectedAndPublicMethods: true + reportAnyTypeWideningInVarTag: true + treatPhpDocTypesAsCertain: false + strictRules: + disallowedEmpty: false + disallowedLooseComparison: false + disallowedShortTernary: false + exceptions: + check: + missingCheckedExceptionInThrows: true + tooWideThrowType: true + implicitThrows: false + checkedExceptionClasses: + - 'Minz_Exception' + ignoreErrors: + - '#Only booleans are allowed in (a negated boolean|a ternary operator condition|an elseif condition|an if condition|&&|\|\|), (bool|false|int(<[0-9, max]+>)?|true|null|\|)+ given.*#' +includes: + - vendor/phpstan/phpstan-strict-rules/rules.neon diff --git a/phpstan.neon b/phpstan.neon deleted file mode 100644 index 2a16f17..0000000 --- a/phpstan.neon +++ /dev/null @@ -1,48 +0,0 @@ -parameters: - # TODO: Increase rule-level https://phpstan.org/user-guide/rule-levels - level: 1 - phpVersion: 80399 # TODO: Remove line when moving composer.json to PHP 8+ - fileExtensions: - - php - - phtml - paths: - - ../FreshRSS - - . - excludePaths: - analyse: - - ../FreshRSS - - vendor/ - analyseAndScan: - - .git/ - - node_modules/ - - symbolic/ - - third-party/ - - tmp/ - dynamicConstantNames: - - TYPE_GIT - checkMissingOverrideMethodAttribute: true - reportMaybesInPropertyPhpDocTypes: false - treatPhpDocTypesAsCertain: false - strictRules: - allRules: false - booleansInConditions: true - closureUsesThis: true - disallowedConstructs: false - disallowedLooseComparison: false - matchingInheritedMethodNames: true - noVariableVariables: true - numericOperandsInArithmeticOperators: true - overwriteVariablesWithLoop: true - requireParentConstructorCall: true - strictCalls: true - switchConditionsMatchingType: true - uselessCast: true - exceptions: - check: - missingCheckedExceptionInThrows: false # TODO pass - tooWideThrowType: true - implicitThrows: false - checkedExceptionClasses: - - 'Minz_Exception' -includes: - - vendor/phpstan/phpstan-strict-rules/rules.neon diff --git a/repositories.json b/repositories.json index b01bbd1..6641fac 100644 --- a/repositories.json +++ b/repositories.json @@ -55,6 +55,9 @@ }, { "url": "https://github.com/christian-putzke/freshrss-pocket-button", "type": "git" +}, { + "url": "https://github.com/huffstler/xExtension-StarToPocket", + "type": "git" }, { "url": "https://github.com/Joedmin/xExtension-readeck-button", "type": "git" @@ -88,4 +91,7 @@ }, { "url": "https://github.com/kalvn/freshrss-mark-previous-as-read", "type": "git" +}, { + "url": "https://github.com/LiangWei88/xExtension-ArticleSummary", + "type": "git" }] diff --git a/xExtension-ImageProxy/README.md b/xExtension-ImageProxy/README.md index 493be3d..ea38521 100644 --- a/xExtension-ImageProxy/README.md +++ b/xExtension-ImageProxy/README.md @@ -6,6 +6,7 @@ To use it, upload this entire directory to the FreshRSS `./extensions` directory ## Changelog +* 1.0 Breaking changes due to significant code upgrade: settings must be saved again * 0.7.3 Turkish language support added ## Configuration settings diff --git a/xExtension-ImageProxy/configure.phtml b/xExtension-ImageProxy/configure.phtml index 0923d0a..1042e30 100644 --- a/xExtension-ImageProxy/configure.phtml +++ b/xExtension-ImageProxy/configure.phtml @@ -7,26 +7,30 @@