PluginProbe
PlugVersions – Easily roll back to previous versions of your plugins. / 0.3.0
PlugVersions – Easily roll back to previous versions of your plugins. v0.3.0
0.3.1 0.4.0 0.3.0 0.0.6.RC-1 0.0.7 0.0.8 0.1.0 0.2.0 0.2.1 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5 0.0.6
← All changes | admin/classes/class-plugversions-restoring-link.php +18 -0 0.0.8 → 0.3.0 View file →
@@ -1,8 +1,13 @@
1 1 <?php
2 2 /**
3 3 * Class to add the restoring link.
4 + * This class is responsible for adding a link to restore plugin versions in the plugins list.
5 + * It checks for existing plugin versions, adds action links to restore them,
6 + * and cleans up the plugins list by removing unzipped versions.
4 7 *
8 + * @version 0.0.8
9 + *
5 10 * @package Plugversions
6 11 */
7 12
8 13 defined( 'PLUGIN_REVISIONS_PLUGIN_DIR' ) || exit; // Exit if not accessed from PlugVersions.
@@ -8,8 +13,11 @@
8 13 defined( 'PLUGIN_REVISIONS_PLUGIN_DIR' ) || exit; // Exit if not accessed from PlugVersions.
9 14
10 15 /**
11 16 * Class PlugVersions Restoring Link
17 + * This class is used to add a link for restoring plugin versions.
18 + * It checks for existing plugin versions in the plugins directory,
19 + * adds action links to restore them, and cleans up the plugins list
12 20 *
13 21 *
14 22 * @version 0.0.6
15 23 * @package PlugVersions
@@ -33,8 +41,10 @@
33 41 public $plugins;
34 42
35 43 /**
36 44 * Main Constructor
45 + * This constructor initializes the class, checks for the plugin revision key,
46 + * populates the plugins data, and adds necessary filters for action links and cleaning the plugins list.
37 47 *
38 48 * @since 0.0.6
39 49 */
40 50 public function __construct() {
@@ -50,8 +60,11 @@
50 60 }
51 61
52 62 /**
53 63 * Populate plugins data
64 + * This function scans the plugins directory for plugin zip files that match the revision key.
65 + * It extracts the plugin name and version from the zip file names and organizes them into an array.
66 + * The array contains plugin names as keys, with their versions and zip file names as values.
54 67 *
55 68 * @since 0.0.6
56 69 */
57 70 public function populate_plugins() {
@@ -85,8 +98,10 @@
85 98 }
86 99
87 100 /**
88 101 * Remove unzipped versions from the plugins list
102 + * This function iterates through the plugins list and removes any plugin that has a name starting with 'pr-' followed by the revision key.
103 + * It ensures that only the original plugins remain in the list, excluding any unzipped versions created by the plugin revisions.
89 104 *
90 105 * @param array $plugins
91 106 * @param 0.0.8
92 107 */
@@ -100,8 +115,11 @@
100 115 }
101 116
102 117 /**
103 118 * Add action link to restore plugin version.
119 + * This function adds a link to the plugin action links in the plugins list.
120 + * It checks if the plugin has any versions available for restoration,
121 + * and if so, it adds a link to restore each version.
104 122 *
105 123 * @param array $actions
106 124 * @param string $plugin_file
107 125 * @param array $plugin_data