diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php
index 3436e4f60..565ddaded 100644
--- a/classes/pref/prefs.php
+++ b/classes/pref/prefs.php
@@ -795,6 +795,7 @@ class Pref_Prefs extends Handler_Protected {
foreach ($tmppluginhost->get_plugins() as $name => $plugin) {
$about = $plugin->about();
+ $version = htmlspecialchars($this->_get_plugin_version($plugin));
if ($about[3] ?? false) {
$is_checked = in_array($name, $system_enabled) ? "checked" : "";
@@ -811,9 +812,11 @@ class Pref_Prefs extends Handler_Protected {
open_in_new = __("More info...") ?>
-
- = htmlspecialchars(T_sprintf("v%.2f, by %s", $about[0], $about[2])) ?>
-
+
+
+ = $version ?>
+
+
get_plugins() as $name => $plugin) {
$about = $plugin->about();
+ $version = htmlspecialchars($this->_get_plugin_version($plugin));
if (empty($about[3]) || $about[3] == false) {
@@ -875,9 +879,11 @@ class Pref_Prefs extends Handler_Protected {
open_in_new = __("More info...") ?>
-
- = htmlspecialchars(T_sprintf("v%.2f, by %s", $about[0], $about[2])) ?>
-
+
+
+ = $version ?>
+
+
["pipe", "w"], // STDOUT
+ 2 => ["pipe", "w"], // STDERR
+ ];
+
+ $proc = proc_open("git --no-pager log --pretty=\"%ct %h\" -n1 HEAD",
+ $descriptorspec, $pipes, $dir);
+
+ if (is_resource($proc)) {
+ $stdout = stream_get_contents($pipes[1]);
+ $stderr = stream_get_contents($pipes[2]);
+ $status = proc_close($proc);
+
+ if ($status == 0) {
+ list($timestamp, $commit) = explode(" ", $stdout);
+ return trim(strftime("%y.%m", (int)$timestamp) . "-$commit");
+ } else {
+ return T_sprintf("Git error [RC=%d]: %s", $status, $stderr);
+ }
+ }
+ }
+
+ function _get_plugin_version(Plugin $plugin) {
+ $about = $plugin->about();
+
+ if (!empty($about[0])) {
+ return T_sprintf("v%.2f, by %s", $about[0], $about[2]);
+ } else {
+ $ref = new ReflectionClass(get_class($plugin));
+
+ $plugin_dir = dirname($ref->getFileName());
+
+ if (basename($plugin_dir) == "plugins") {
+ return "";
+ }
+
+ if (is_dir("$plugin_dir/.git")) {
+ return T_sprintf("v%s, by %s", $this->_get_version_from_git($plugin_dir), $about[2]);
+ }
+ }
+ }
+
static function _get_updated_plugins() {
$root_dir = dirname(dirname(__DIR__)); # we're in classes/pref/
$plugin_dirs = array_filter(glob("$root_dir/plugins.local/*"), "is_dir");
diff --git a/plugins/af_comics/init.php b/plugins/af_comics/init.php
index c8a8f8637..8aba1416b 100755
--- a/plugins/af_comics/init.php
+++ b/plugins/af_comics/init.php
@@ -5,7 +5,7 @@ class Af_Comics extends Plugin {
private $filters = array();
function about() {
- return array(2.0,
+ return array(null,
"Fixes RSS feeds of assorted comic strips",
"fox");
}
diff --git a/plugins/af_fsckportal/init.php b/plugins/af_fsckportal/init.php
index 8caa617c6..4e81fde05 100644
--- a/plugins/af_fsckportal/init.php
+++ b/plugins/af_fsckportal/init.php
@@ -4,7 +4,7 @@ class Af_Fsckportal extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Remove feedsportal spamlinks from article content",
"fox");
}
diff --git a/plugins/af_proxy_http/init.php b/plugins/af_proxy_http/init.php
index 48c64567b..47e273b7e 100644
--- a/plugins/af_proxy_http/init.php
+++ b/plugins/af_proxy_http/init.php
@@ -8,7 +8,7 @@ class Af_Proxy_Http extends Plugin {
private $cache;
function about() {
- return array(1.0,
+ return array(null,
"Loads media served over plain HTTP via built-in secure proxy",
"fox");
}
diff --git a/plugins/af_psql_trgm/init.php b/plugins/af_psql_trgm/init.php
index 5611d8998..87415450b 100644
--- a/plugins/af_psql_trgm/init.php
+++ b/plugins/af_psql_trgm/init.php
@@ -7,7 +7,7 @@ class Af_Psql_Trgm extends Plugin {
private $default_min_length = 32;
function about() {
- return array(1.0,
+ return array(null,
"Marks similar articles as read (requires pg_trgm)",
"fox");
}
diff --git a/plugins/af_readability/init.php b/plugins/af_readability/init.php
index f8c7c125c..a39cc278e 100755
--- a/plugins/af_readability/init.php
+++ b/plugins/af_readability/init.php
@@ -10,7 +10,7 @@ class Af_Readability extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Try to inline article content using Readability",
"fox");
}
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php
index 507c495a0..79188b89e 100755
--- a/plugins/af_redditimgur/init.php
+++ b/plugins/af_redditimgur/init.php
@@ -8,7 +8,7 @@ class Af_RedditImgur extends Plugin {
private $fallback_preview_urls = [];
function about() {
- return array(1.0,
+ return array(null,
"Inline images (and other content) in Reddit RSS feeds",
"fox");
}
diff --git a/plugins/af_unburn/init.php b/plugins/af_unburn/init.php
index 386b6387f..0a6c1a5f1 100755
--- a/plugins/af_unburn/init.php
+++ b/plugins/af_unburn/init.php
@@ -3,7 +3,7 @@ class Af_Unburn extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Resolves feedburner and similar feed redirector URLs (requires CURL)",
"fox");
}
diff --git a/plugins/af_youtube_embed/init.php b/plugins/af_youtube_embed/init.php
index 6309aac02..b53a92f0e 100644
--- a/plugins/af_youtube_embed/init.php
+++ b/plugins/af_youtube_embed/init.php
@@ -3,7 +3,7 @@ class Af_Youtube_Embed extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Embed videos in Youtube RSS feeds (and whitelist Youtube iframes)",
"fox");
}
diff --git a/plugins/af_zz_noautoplay/init.php b/plugins/af_zz_noautoplay/init.php
index 491800708..505f9fcd9 100644
--- a/plugins/af_zz_noautoplay/init.php
+++ b/plugins/af_zz_noautoplay/init.php
@@ -3,7 +3,7 @@ class Af_Zz_NoAutoPlay extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Don't autoplay HTML5 videos",
"fox");
}
diff --git a/plugins/af_zz_vidmute/init.php b/plugins/af_zz_vidmute/init.php
index 48efff5ad..30eced5e7 100644
--- a/plugins/af_zz_vidmute/init.php
+++ b/plugins/af_zz_vidmute/init.php
@@ -3,7 +3,7 @@ class Af_Zz_VidMute extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Mute audio in HTML5 videos",
"fox");
}
diff --git a/plugins/auth_internal/init.php b/plugins/auth_internal/init.php
index bcaaa16f3..0cff439cf 100644
--- a/plugins/auth_internal/init.php
+++ b/plugins/auth_internal/init.php
@@ -4,7 +4,7 @@ class Auth_Internal extends Auth_Base {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Authenticates against internal tt-rss database",
"fox",
true);
diff --git a/plugins/auth_remote/init.php b/plugins/auth_remote/init.php
index 0ac51ce4e..3be7aa26e 100644
--- a/plugins/auth_remote/init.php
+++ b/plugins/auth_remote/init.php
@@ -4,7 +4,7 @@ class Auth_Remote extends Auth_Base {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Authenticates against remote password (e.g. supplied by Apache)",
"fox",
true);
diff --git a/plugins/auto_assign_labels/init.php b/plugins/auto_assign_labels/init.php
index 341895cef..786720d95 100755
--- a/plugins/auto_assign_labels/init.php
+++ b/plugins/auto_assign_labels/init.php
@@ -5,7 +5,7 @@ class Auto_Assign_Labels extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Assign labels automatically based on article title, content, and tags",
"fox");
}
diff --git a/plugins/bookmarklets/init.php b/plugins/bookmarklets/init.php
index 82ed6c97f..b90c40598 100644
--- a/plugins/bookmarklets/init.php
+++ b/plugins/bookmarklets/init.php
@@ -3,7 +3,7 @@ class Bookmarklets extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Easy feed subscription and web page sharing using bookmarklets",
"fox",
false,
diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php
index 2dbdb99cc..d94e60504 100755
--- a/plugins/cache_starred_images/init.php
+++ b/plugins/cache_starred_images/init.php
@@ -8,7 +8,7 @@ class Cache_Starred_Images extends Plugin {
private $max_cache_attempts = 5; // per-article
function about() {
- return array(1.0,
+ return array(null,
"Automatically cache media files in Starred articles",
"fox");
}
diff --git a/plugins/close_button/init.php b/plugins/close_button/init.php
index 2a5025cf6..c1169fc34 100644
--- a/plugins/close_button/init.php
+++ b/plugins/close_button/init.php
@@ -9,7 +9,7 @@ class Close_Button extends Plugin {
}
function about() {
- return array(1.0,
+ return array(null,
"Adds a button to close article panel",
"fox");
}
diff --git a/plugins/hotkeys_force_top/init.php b/plugins/hotkeys_force_top/init.php
index faddc9148..9c17307bd 100644
--- a/plugins/hotkeys_force_top/init.php
+++ b/plugins/hotkeys_force_top/init.php
@@ -3,7 +3,7 @@ class Hotkeys_Force_Top extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Force open article to the top",
"itsamenathan");
}
diff --git a/plugins/hotkeys_noscroll/init.php b/plugins/hotkeys_noscroll/init.php
index b31ee92ae..320847827 100644
--- a/plugins/hotkeys_noscroll/init.php
+++ b/plugins/hotkeys_noscroll/init.php
@@ -3,7 +3,7 @@ class Hotkeys_Noscroll extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"n/p (and up/down) hotkeys move between articles without scrolling",
"fox");
}
diff --git a/plugins/hotkeys_swap_jk/init.php b/plugins/hotkeys_swap_jk/init.php
index b1e3dbe04..19a3ab60a 100644
--- a/plugins/hotkeys_swap_jk/init.php
+++ b/plugins/hotkeys_swap_jk/init.php
@@ -4,7 +4,7 @@ class Hotkeys_Swap_JK extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Swap j and k hotkeys (for vi brethren)",
"fox");
}
diff --git a/plugins/mail/init.php b/plugins/mail/init.php
index 467f8294a..9835618d7 100644
--- a/plugins/mail/init.php
+++ b/plugins/mail/init.php
@@ -5,7 +5,7 @@ class Mail extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Share article via email",
"fox");
}
diff --git a/plugins/mailto/init.php b/plugins/mailto/init.php
index c34b400ce..514daacfc 100644
--- a/plugins/mailto/init.php
+++ b/plugins/mailto/init.php
@@ -3,7 +3,7 @@ class MailTo extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Share article via email (using mailto: links, invoking your mail client)",
"fox");
}
diff --git a/plugins/no_iframes/init.php b/plugins/no_iframes/init.php
index dd3502cbd..a8cef74ee 100644
--- a/plugins/no_iframes/init.php
+++ b/plugins/no_iframes/init.php
@@ -3,7 +3,7 @@ class No_Iframes extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Remove embedded iframes (unless whitelisted)",
"fox");
}
diff --git a/plugins/no_title_counters/init.php b/plugins/no_title_counters/init.php
index 86d2bdfc3..ff8dbe9fa 100644
--- a/plugins/no_title_counters/init.php
+++ b/plugins/no_title_counters/init.php
@@ -3,7 +3,7 @@ class No_Title_Counters extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Remove counters from window title (prevents tab flashing on new articles)",
"fox");
}
diff --git a/plugins/no_url_hashes/init.php b/plugins/no_url_hashes/init.php
index 54d6f4285..57d4c9927 100644
--- a/plugins/no_url_hashes/init.php
+++ b/plugins/no_url_hashes/init.php
@@ -3,7 +3,7 @@ class No_URL_Hashes extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Disable URL hash usage (e.g. #f=10, etc)",
"fox");
}
diff --git a/plugins/note/init.php b/plugins/note/init.php
index 52f7be3eb..f95ba9fa8 100644
--- a/plugins/note/init.php
+++ b/plugins/note/init.php
@@ -5,7 +5,7 @@ class Note extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Adds support for setting article notes",
"fox");
}
diff --git a/plugins/nsfw/init.php b/plugins/nsfw/init.php
index 7c5b8d00f..112c7d7c2 100644
--- a/plugins/nsfw/init.php
+++ b/plugins/nsfw/init.php
@@ -3,7 +3,7 @@ class NSFW extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Hide article content based on tags",
"fox",
false);
diff --git a/plugins/scored_oldest_first/init.php b/plugins/scored_oldest_first/init.php
index fc3b1f8db..bb9e840dc 100644
--- a/plugins/scored_oldest_first/init.php
+++ b/plugins/scored_oldest_first/init.php
@@ -21,7 +21,7 @@ class Scored_Oldest_First extends Plugin {
}
function about() {
- return array(1.0,
+ return array(null,
"Consider article score while sorting by oldest first",
"fox",
false,
diff --git a/plugins/share/init.php b/plugins/share/init.php
index 37799fba6..452fc6252 100644
--- a/plugins/share/init.php
+++ b/plugins/share/init.php
@@ -3,7 +3,7 @@ class Share extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Share article by unique URL",
"fox");
}
diff --git a/plugins/shorten_expanded/init.php b/plugins/shorten_expanded/init.php
index f816a838d..9673f581b 100644
--- a/plugins/shorten_expanded/init.php
+++ b/plugins/shorten_expanded/init.php
@@ -3,7 +3,7 @@ class Shorten_Expanded extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Shorten overly long articles in CDM/expanded",
"fox");
}
diff --git a/plugins/toggle_sidebar/init.php b/plugins/toggle_sidebar/init.php
index 19ca960e2..a6c919e03 100644
--- a/plugins/toggle_sidebar/init.php
+++ b/plugins/toggle_sidebar/init.php
@@ -4,7 +4,7 @@ class Toggle_Sidebar extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Adds a main toolbar button to toggle sidebar",
"fox");
}
diff --git a/plugins/vf_shared/init.php b/plugins/vf_shared/init.php
index 1112f6f2f..90179c08c 100644
--- a/plugins/vf_shared/init.php
+++ b/plugins/vf_shared/init.php
@@ -5,7 +5,7 @@ class VF_Shared extends Plugin {
private $host;
function about() {
- return array(1.0,
+ return array(null,
"Feed for all articles actively shared by URL",
"fox",
false);