Skip to content

Commit

Permalink
Update Manager updated
Browse files Browse the repository at this point in the history
  • Loading branch information
xxsimoxx committed Jan 10, 2020
1 parent 7642fda commit 6619fd7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cpcompatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: CPcompatibility
* Plugin URI: https://software.gieffeedizioni.it
* Description: Tweaks for working with CP: wpcli compatibility, plugin checks.
* Version: 0.1.3
* Version: 0.1.4
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Author: Gieffe edizioni srl
Expand Down
27 changes: 18 additions & 9 deletions inc/UpdateClient.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
/**
* -----------------------------------------------------------------------------
* Purpose: Remote client to communicate with the Update Manager plugin.
* Package: CodePotent\UpdateManager
* Version: 1.0.0
* Author: Code Potent
* Author URI: https://codepotent.com
* -----------------------------------------------------------------------------
Expand All @@ -13,7 +11,7 @@
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Full
* text of the license is available at https://www.gnu.org/licenses/gpl-2.0.txt.
* -----------------------------------------------------------------------------
* Copyright © 2019 - CodePotent
* Copyright © 2019 - Code Potent
* -----------------------------------------------------------------------------
* ____ _ ____ _ _
* / ___|___ __| | ___| _ \ ___ | |_ ___ _ __ | |_
Expand All @@ -24,8 +22,16 @@
* -----------------------------------------------------------------------------
*/

/**
*
* Note: this is not the original file.
* It's modified to remove text domain.
*
*/


// EDIT: Make this unique. Example: YourDevName\YourPluginName;
namespace XXSimoXX\CPCompatibilityUpdate;
namespace XXSimoXX\CPCompatibility\UpdateClient;

// EDIT: URL where Update Manager is installed; with trailing slash!
const UPDATE_SERVER = 'https://software.gieffeedizioni.it/';
Expand All @@ -42,8 +48,7 @@
* integrated update path for end-users of your ClassicPress plugins. This class
* is intended for plugins that will be receiving updates directly from a remote
* server, such as GitHub or your own site. The Update Manager ensures that your
* updates look great with all the right images and texts. If you need some more
* context, skip to: https://codepotent.com/classicpress/plugins/update-manager/
* updates look great with all the right images and texts.
*
* @author John Alarcon
*/
Expand Down Expand Up @@ -88,7 +93,7 @@ private function __construct() {
// Plugin identifier; ie, plugin-folder/plugin-file.php.
'id' => $this->get_plugin_identifier(),
// Leave as-is.
'api' => '1.0.0',
'api' => '1.1.0',
// Leave as-is – tutorial can be created with enough interest.
'post' => [],
];
Expand Down Expand Up @@ -138,7 +143,7 @@ private function init() {

// Print footer scripts; see comments on the method.
add_action('admin_print_footer_scripts', [$this, 'print_admin_scripts']);

// Filter the plugin admin row.
add_filter('plugin_row_meta', [$this, 'filter_plugin_row_meta'], 10, 2);

Expand Down Expand Up @@ -334,7 +339,7 @@ public function filter_plugin_row_meta($plugin_meta, $plugin_file) {
// Add the link to the plugin's own row, if not already existing.
if ($this->identifier === $plugin_file) {
$anchors_string = implode('', $plugin_meta);
$anchor_text = esc_html('View details', 'codepotent-update-manager');
$anchor_text = esc_html__('View details');
if (!preg_match('|(\<a[ \s\S\d]*)('.$anchor_text.')(<\/a>)|', $anchors_string)) {
$plugin_meta[] = '<a class="thickbox" href="'.admin_url('/plugin-install.php?tab=plugin-information&plugin='.$this->server_slug.'&TB_iframe=true&width=600&height=550').'">'.$anchor_text.'</a>';
}
Expand Down Expand Up @@ -556,6 +561,10 @@ public function get_plugin_images($type, $plugin) {
$image_path = untrailingslashit(WP_PLUGIN_DIR).'/'.$plugin.'/images';
$image_url = untrailingslashit(WP_PLUGIN_URL).'/'.$plugin.'/images';

// Allow directory location to be filtered.
$image_path = apply_filters('codepotent_update_manager_image_path', $image_path);
$image_url = apply_filters('codepotent_update_manager_image_url', $image_url);

// Banner and icon images are keyed differently; it's a core thing.
$image_qualities = [
'icon' => ['default', '1x', '2x'],
Expand Down
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=== cpcompatibility ===
Plugin Name: CPcompatibility
Description: Tweaks for working with CP: wpcli compatibility, plugin checks.
Version: 0.1.3
Version: 0.1.4
Text Domain: cpc
Domain Path: /languages
Requires PHP: 5.6
Expand All @@ -10,7 +10,7 @@ Tested: 4.9.99
Author: Gieffe edizioni
Author URI: https://www.gieffeedizioni.it
Plugin URI: https://software.gieffeedizioni.it
Download link: https://github.com/xxsimoxx/cpcompatibility/releases/download/v0.1.3/cpcompatibility.zip
Download link: https://github.com/xxsimoxx/cpcompatibility/releases/download/v0.1.4/cpcompatibility.zip
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -29,13 +29,18 @@ This plugin is for fixing some compatibility issues for ClassicPress.
* Mark plugins not compatible with WP version 4.9 in plugins admin page
* Add a menu under "tools" that displays top 200 plugins from wp.org and their compatibility

To help us know the number of active installations of this plugin, we collect and store anonymized data when the plugin check in for updates. The date and unique plugin identifier are stored as plain text and the requesting URL is stored as a non-reversible hashed value. This data is stored for up to 28 days.

== Screenshots ==

1. Plugin Page
2. Most popular plugins and their compatibility

== Changelog ==

= 0.1.4 =
* Updated Update Manager

= 0.1.3 =
* Minor fixes

Expand Down

0 comments on commit 6619fd7

Please sign in to comment.