Plugin Directory

Changeset 3266648


Ignore:
Timestamp:
04/04/2025 01:44:46 AM (11 months ago)
Author:
Fastmover
Message:

0.1.5 - Pull request merged from github

Location:
plugins-last-updated-column/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • plugins-last-updated-column/trunk/readme.md

    r3265996 r3266648  
    33=
    44---
    5 This plugin adds columns to the admin plugin's page to show when each plugin was last updated or upgraded.
    6 The functionality of this plugin was entirely [Karissa Skirmont](http://kissaskreations.com/ "Kissa's Kreations")'s idea.
     5This plugin adds two columns to the plugin's page in WordPress's admin to show when each plugin was "Last Updated" by the developer and when the plugin was "Last Upgraded" on the site. The "Last Updated" column will also show "Plugin not found" OR "Plugin has been closed!" if the plugin isn't on the repo anymore or has been closed.
     6
     7The first time you load the plugins page, it will load very slowly due to many API calls made to WordPress.org in order to retrieve the last updated information.
     8
     9This plugin makes 1 API call for each plugin installed. This data is cached for 24 hours, unless you manually clear the cache clearing via Admin Menu > Plugins > Plugin Columns.
     10
     11
     12The idea for this plugin's functionality and the artwork was by [Karissa Skirmont](http://karissaskirmont.com "karissaskirmont.com")'s of [Profoundly Purple](http://profoundlypurple.com "profoundlypurple.com").
     13Plugin Developed by [Steven Kohlmeyer](http://stevenkohlmeyer.com "stevenkohlmeyer.com") with contributions by [Michael Preslar (http://drzimp.com "drzimp.com")].
    714
    815[Plugin Page](https://wordpress.org/plugins/plugins-last-updated-column/#developers "Plugins Last Updated Column")
     
    2734---
    2835
    29 Changelot
     36Changelog
    3037=
     38* 0.1.5
     39  * Last Updated Column now displays if the plugin has been closed or isn't on the repo
     40  * getPluginsLastUpdated() now respects WP_DEBUG
     41  * Updated plugin description
    3142* 0.1.4
    3243  * Fixed security issue
  • plugins-last-updated-column/trunk/readme.txt

    r3265996 r3266648  
    11=== Plugins Last Updated Column ===
    2 Contributors: Fastmover, karissa
    3 Tags: plugins, plugins last updated, last updated, updated
     2
     3Contributors: Fastmover, karissa, drzimp
     4Tags: plugins, plugins last updated, last updated, updated, plugin closed
    45Requires at least: 3.7
    56Tested up to: 6.7.2
    6 Stable tag: 0.1.4
     7
     8Stable tag: 0.1.5
    79License: GPLv2 or later
    810License URI: http://www.gnu.org/licenses/gpl-2.0.html
    911
    10 This plugin adds columns to the admin plugin's page to show when each plugin was last updated and upgraded.
     12This plugin adds 2 columns to the admin plugin's page to show when each plugin was last updated and upgraded.
    1113
    1214== Description ==
    1315
    14 This plugin adds a column to the plugin's page in WordPress's admin to show when each plugin was last updated. This causes the plugins page to load very slowly on the first page load due to many API calls made to wordPress.org in order to retrieve the last updated information.  This plugin makes 1 API call for each plugin installed.  This data is cached for 24 hours. The functionality of this plugin was entirely [Karissa Skirmont](http://kissaskreations.com/ "Kissa's Kreations")'s idea. [Plugin Page](http://stevenkohlmeyer.com/plugins-last-updated-column/ "Plugins Last Updated Column").  Artwork compliments of [Karissa](http://kissaskreations.com/ "Kissa's Kreations")
     16This plugin adds two columns to the plugin's page in WordPress's admin to show when each plugin was "Last Updated" by the developer and when the plugin was "Last Upgraded" on the site. The "Last Updated" column will also show "Plugin not found" OR "Plugin has been closed!" if the plugin isn't on the repo anymore or has been closed.
     17
     18The first time you load the plugins page, it may load very slowly if you have a lot of plugins due to many API calls made to WordPress.org in order to retrieve the last updated information.
     19
     20This plugin makes 1 API call for each plugin installed. This data is cached for 24 hours, unless you manually clear the cache clearing via Admin Menu > Plugins > Plugin Columns.
     21
     22
     23The idea for this plugin's functionality and the artwork was by [Karissa Skirmont](http://karissaskirmont.com "karissaskirmont.com")'s of [Profoundly Purple](http://profoundlypurple.com "profoundlypurple.com").
     24Plugin Developed by [Steven Kohlmeyer](http://stevenkohlmeyer.com "stevenkohlmeyer.com") with contributions by [Michael Preslar (http://drzimp.com "drzimp.com")].
    1525
    1626== Installation ==
    1727
    18 1. Install this plugin either via the WordPress.org plugin directory, or by uploading the files to your server
    19 2. Activate the plugin through the 'Plugins' menu in WordPress
    20 3. That's it. You're ready to go!
     281. Install this plugin either via the WordPress.org plugin directory, or by uploading the files to your server.
     292. Activate the plugin through the 'Plugins' menu in WordPress. If in a Multisite install, "Network Activate" to show on ALL sites in the install or only Activate individually on a per site basis.
     303. That's it. You're ready to go clean up your plugin list of old or closed plugins!
    2131
    2232== Screenshots ==
    2333
    24 1. As you can see, the plugins table now has 2 columns on the right side labeled: Last Updated and Last Upgraded.
     341. The plugins table has 2 columns on the right side labeled: Last Updated and Last Upgraded.
    25352. A page dedicated to clearing cache on the Last Updated Column.
    26363. Shows a WordPress MultiSite Network Plugin page with last updated / last upgraded columns.
    2737
    2838== Changelog ==
     39
     40= 0.1.5 =
     41* Last Updated Column now displays if the plugin has been closed or isn't on the repo
     42* getPluginsLastUpdated() now respects WP_DEBUG
     43* Updated description
    2944
    3045= 0.1.4 =
     
    7590= 0.0.1 =
    7691* Plugin adds a last updated column to the plugins page of the admin.
     92
  • plugins-last-updated-column/trunk/sk-plugins-last-updated-column.php

    r3265996 r3266648  
    33 * Plugin Name: Plugins Last Updated Column
    44 * Plugin URI: http://stevenkohlmeyer.com/plugins-last-updated-column/
    5  * Description: This plugin adds a 'Last Updated' column to the admin plugins page.
    6  * Version: 0.1.4
     5 * Description: This plugin adds 'Last Updated' and 'Last Upgraded' columns to the admin plugins page.
     6 * Version: 0.1.5
    77 * Author: Fastmover
    88 * Author URI: http://StevenKohlmeyer.com
     
    1616class SK_Plugins_Last_Updated_Column
    1717{
    18     public $cacheTime    = 1800;
     18    public $cacheTime    = 86400;
    1919    public $slugUpdated  = "sk-plugin-last-updated ";
    2020    public $slugUpgraded = "sk-plugin-last-upgraded ";
     
    8686        <?php
    8787
    88         if ( $lastUpdated !== "-1" && $lastUpdated !== -1 ) {
     88        if ( $lastUpdated === false ) {
     89           ?>
     90           <span>Not Avail.</span>
     91           <?php
     92
     93        } elseif ( is_numeric( $lastUpdated ) )  {
     94            if ( $lastUpdated == -2 ) {
     95                ?>
     96                <strong class="plugin-last-updated-humanreadable" data-color="#ff0000"><strong>Plugin has been closed!</strong>
     97                <?php
     98        } elseif ( $lastUpdated == -3 ) {
     99                ?>
     100                <strong class="plugin-last-updated-humanreadable" data-color="#ff0000">Plugin not found</strong>
     101                <?php
     102            } else {
     103                ?>
     104                <span>Not Avail.</span>
     105                <?php
     106            }
     107
     108            } else {
    89109
    90110            if ( ! $this->currentDateTime ) {
     
    121141            ?>
    122142            <span><?php echo $dateLastUpdated; ?></span>
    123 
    124             <?php
    125 
    126         } else {
    127             ?>
    128             <span>Not Avail.</span>
    129             <?php
    130         }
    131 
    132         ?>
    133         <br/>
    134         <span class="plugin-last-updated-humanreadable" data-color="<?php echo $color; ?>"
    135               style="background-color: <?php echo $color; ?>"><?php echo $msg; ?></span>
     143            <br/>
     144            <span class="plugin-last-updated-humanreadable" data-color="<?php echo $color; ?>"
     145                  style="background-color: <?php echo $color; ?>"><?php echo $msg; ?></span>
    136146        <?php
     147        }
    137148    }
    138149
     
    185196    {
    186197
    187 
    188         if ( ! get_transient ( $this->slugUpdated . $pluginSlug ) ) {
     198        $retval = get_transient ( $this->slugUpdated . $pluginSlug );
     199
     200        if ( ( $retval !== false ) && ( ! defined('WP_DEBUG') || ! WP_DEBUG ) ) {
     201            return $retval;
     202        }
    189203
    190204            include_once ( ABSPATH . 'wp-admin/includes/plugin-install.php' );
     
    200214            /** Check for Errors & Display the results */
    201215            if ( is_wp_error ( $call_api ) ) {
    202                 set_transient ( $this->slugUpdated . $pluginSlug, -1, $this->cacheTime );
    203 
    204                 return -1;
     216
     217                /*
     218                 * plugin_api() doesn't differentiate between a network issue and a successful
     219                 * API request that returns json that contains a key of "error". Examples:
     220                 * {"error":"Plugin not found."}
     221                 *
     222                   {
     223                    "error": "closed",
     224                    "name": "Easy Testimonials",
     225                    "slug": "easy-testimonials",
     226                    "description": "This plugin has been closed as of July 19, 2024 and is not available for download. Reason: Security Issue.",
     227                    "closed": true,
     228                    "closed_date": "2024-07-19",
     229                    "reason": "security-issue",
     230                    "reason_text": "Security Issue"
     231                  }
     232
     233                 * Unfortunately, plugin_api() also doesn't pass the returned json into WP_Error,
     234                 * so we can't get the "reason" or "closed_date". Best we can do is check the
     235                 * error message and go from there.
     236                 */
     237
     238                $retval = false;
     239                $errmsg = $call_api->get_error_message();
     240
     241                if ( $errmsg == 'closed' ) {
     242                    $retval = -2;
     243                } elseif ( $errmsg == 'Plugin not found.' ) {
     244                    $retval = -3;
     245                }
     246
     247                if ( $retval !== false ) {
     248                    set_transient ( $this->slugUpdated . $pluginSlug, $retval, $this->cacheTime );
     249                }
     250
     251                return $retval;
    205252            } else {
    206253                if ( ! empty( $call_api->last_updated ) ) {
     
    210257                    return $call_api->last_updated;
    211258                } else {
    212                     set_transient ( $this->slugUpdated . $pluginSlug, -1, $this->cacheTime );
    213 
    214                     return -1;
    215                 }
    216             }
    217 
    218         } else {
    219             //Debugging purposes:
    220             //delete_transient( 'sk_plugins_last_updated' . $pluginSlug );
    221 
    222             return get_transient ( $this->slugUpdated . $pluginSlug );
    223         }
     259
     260                    return false;
     261                }
     262            }
    224263    }
    225264
Note: See TracChangeset for help on using the changeset viewer.