Version Description
(2014-11-17) = * Enhanced: Improved the logging. * Enhanced: Improved the licensing fields. * Enhanced: Updated the EDD updater class to the latest version. * Fixed bug: Small random error when viewing the licenses page.
Download this release
Release Info
Developer | Mekku |
Plugin | WP RSS Aggregator |
Version | 4.6.5 |
Comparing to | |
See all releases |
Code changes from version 4.6.4 to 4.6.5
- changelog.txt +6 -0
- includes/admin-help.php +1 -1
- includes/admin-log.php +1 -1
- includes/feed-importing.php +1 -1
- includes/libraries/EDD_licensing/EDD_SL_Plugin_Updater.php +307 -132
- includes/licensing.php +28 -20
- readme.txt +7 -1
- wp-rss-aggregator.php +3 -3
changelog.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
4.6.4 (2014-11-10)
|
2 |
Enhanced: Added filters to the custom feed.
|
3 |
Enhanced: Updated some styles to improve the user interface.
|
1 |
+
4.6.5 (2014-11-17)
|
2 |
+
Enhanced: Improved the logging.
|
3 |
+
Enhanced: Improved the licensing fields.
|
4 |
+
Enhanced: Updated the EDD updater class to the latest version.
|
5 |
+
Fixed bug: Small random error when viewing the licenses page.
|
6 |
+
|
7 |
4.6.4 (2014-11-10)
|
8 |
Enhanced: Added filters to the custom feed.
|
9 |
Enhanced: Updated some styles to improve the user interface.
|
includes/admin-help.php
CHANGED
@@ -12,7 +12,7 @@
|
|
12 |
|
13 |
<h2><?php _e( 'Help & Support', WPRSS_TEXT_DOMAIN ); ?></h2>
|
14 |
<h3><?php _e( 'Documentation', WPRSS_TEXT_DOMAIN ) ?></h3>
|
15 |
-
<?php echo wpautop( __('In the <a href="www.wprssaggregator.com/documentation/">documentation area</a> on the WP RSS Aggregator website you will find comprehensive details on how to use the core plugin and all the add-ons.
|
16 |
|
17 |
There are also some videos to help you make a quick start to setting up and enjoying this plugin.', WPRSS_TEXT_DOMAIN) ) ?>
|
18 |
<h3><?php _e( 'Frequently Asked Questions (FAQ)', WPRSS_TEXT_DOMAIN ) ?></h3>
|
12 |
|
13 |
<h2><?php _e( 'Help & Support', WPRSS_TEXT_DOMAIN ); ?></h2>
|
14 |
<h3><?php _e( 'Documentation', WPRSS_TEXT_DOMAIN ) ?></h3>
|
15 |
+
<?php echo wpautop( __('In the <a href="http://www.wprssaggregator.com/documentation/">documentation area</a> on the WP RSS Aggregator website you will find comprehensive details on how to use the core plugin and all the add-ons.
|
16 |
|
17 |
There are also some videos to help you make a quick start to setting up and enjoying this plugin.', WPRSS_TEXT_DOMAIN) ) ?>
|
18 |
<h3><?php _e( 'Frequently Asked Questions (FAQ)', WPRSS_TEXT_DOMAIN ) ?></h3>
|
includes/admin-log.php
CHANGED
@@ -165,7 +165,7 @@
|
|
165 |
$date = date( 'd-m-Y H:i:s' );
|
166 |
$source = 'WPRSS' . ( ( strlen( $src ) > 0 )? " > $src" : '' ) ;
|
167 |
$str = "[$date] [$log_level_label] $source:\n";
|
168 |
-
$str .= "$message\n";
|
169 |
file_put_contents( wprss_log_file() , $str, FILE_APPEND );
|
170 |
|
171 |
add_action( 'shutdown', 'wprss_log_separator' );
|
165 |
$date = date( 'd-m-Y H:i:s' );
|
166 |
$source = 'WPRSS' . ( ( strlen( $src ) > 0 )? " > $src" : '' ) ;
|
167 |
$str = "[$date] [$log_level_label] $source:\n";
|
168 |
+
$str .= "$message\n\n";
|
169 |
file_put_contents( wprss_log_file() , $str, FILE_APPEND );
|
170 |
|
171 |
add_action( 'shutdown', 'wprss_log_separator' );
|
includes/feed-importing.php
CHANGED
@@ -37,7 +37,7 @@
|
|
37 |
}
|
38 |
|
39 |
update_post_meta( $feed_ID, 'wprss_feed_is_updating', $start_of_update = time() );
|
40 |
-
wprss_log_obj( 'Start of import time updated', $start_of_update, null, WPRSS_LOG_LEVEL_SYSTEM );
|
41 |
|
42 |
// Get the feed source URL from post meta, and filter it
|
43 |
$feed_url = get_post_meta( $feed_ID, 'wprss_url', true );
|
37 |
}
|
38 |
|
39 |
update_post_meta( $feed_ID, 'wprss_feed_is_updating', $start_of_update = time() );
|
40 |
+
wprss_log_obj( 'Start of import time updated', date( 'Y-m-d H:i:s', $start_of_update), null, WPRSS_LOG_LEVEL_SYSTEM );
|
41 |
|
42 |
// Get the feed source URL from post meta, and filter it
|
43 |
$feed_url = get_post_meta( $feed_ID, 'wprss_url', true );
|
includes/libraries/EDD_licensing/EDD_SL_Plugin_Updater.php
CHANGED
@@ -7,138 +7,313 @@
|
|
7 |
* Allows plugins to use their own update API.
|
8 |
*
|
9 |
* @author Pippin Williamson
|
10 |
-
* @version 1.
|
11 |
*/
|
12 |
class EDD_SL_Plugin_Updater {
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
}
|
7 |
* Allows plugins to use their own update API.
|
8 |
*
|
9 |
* @author Pippin Williamson
|
10 |
+
* @version 1.4
|
11 |
*/
|
12 |
class EDD_SL_Plugin_Updater {
|
13 |
+
private $api_url = '';
|
14 |
+
private $api_data = array();
|
15 |
+
private $name = '';
|
16 |
+
private $slug = '';
|
17 |
+
private $did_check = false;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Class constructor.
|
21 |
+
*
|
22 |
+
* @uses plugin_basename()
|
23 |
+
* @uses hook()
|
24 |
+
*
|
25 |
+
* @param string $_api_url The URL pointing to the custom API endpoint.
|
26 |
+
* @param string $_plugin_file Path to the plugin file.
|
27 |
+
* @param array $_api_data Optional data to send with API calls.
|
28 |
+
* @return void
|
29 |
+
*/
|
30 |
+
function __construct( $_api_url, $_plugin_file, $_api_data = null ) {
|
31 |
+
$this->api_url = trailingslashit( $_api_url );
|
32 |
+
$this->api_data = $_api_data;
|
33 |
+
$this->name = plugin_basename( $_plugin_file );
|
34 |
+
$this->slug = basename( $_plugin_file, '.php' );
|
35 |
+
$this->version = $_api_data['version'];
|
36 |
+
|
37 |
+
// Set up hooks.
|
38 |
+
add_action( 'admin_init', array( $this, 'init' ) );
|
39 |
+
add_action( 'admin_init', array( $this, 'show_changelog' ) );
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Set up WordPress filters to hook into WP's update process.
|
44 |
+
*
|
45 |
+
* @uses add_filter()
|
46 |
+
*
|
47 |
+
* @return void
|
48 |
+
*/
|
49 |
+
public function init() {
|
50 |
+
|
51 |
+
add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_update' ) );
|
52 |
+
add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
|
53 |
+
|
54 |
+
add_action( 'after_plugin_row_' . $this->name, array( $this, 'show_update_notification' ), 10, 2 );
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Check for Updates at the defined API endpoint and modify the update array.
|
59 |
+
*
|
60 |
+
* This function dives into the update API just when WordPress creates its update array,
|
61 |
+
* then adds a custom API call and injects the custom plugin data retrieved from the API.
|
62 |
+
* It is reassembled from parts of the native WordPress plugin update code.
|
63 |
+
* See wp-includes/update.php line 121 for the original wp_update_plugins() function.
|
64 |
+
*
|
65 |
+
* @uses api_request()
|
66 |
+
*
|
67 |
+
* @param array $_transient_data Update array build by WordPress.
|
68 |
+
* @return array Modified update array with custom plugin data.
|
69 |
+
*/
|
70 |
+
function check_update( $_transient_data ) {
|
71 |
+
|
72 |
+
if ( $this->did_check ) {
|
73 |
+
return $_transient_data;
|
74 |
+
}
|
75 |
+
|
76 |
+
if( ! is_object( $_transient_data ) ) {
|
77 |
+
$_transient_data = new stdClass;
|
78 |
+
}
|
79 |
+
|
80 |
+
if ( empty( $_transient_data->response ) || empty( $_transient_data->response[ $this->name ] ) ) {
|
81 |
+
|
82 |
+
$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
|
83 |
+
|
84 |
+
if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) {
|
85 |
+
|
86 |
+
$this->did_check = true;
|
87 |
+
|
88 |
+
if( version_compare( $this->version, $version_info->new_version, '<' ) ) {
|
89 |
+
|
90 |
+
$_transient_data->response[ $this->name ] = $version_info;
|
91 |
+
|
92 |
+
}
|
93 |
+
|
94 |
+
$_transient_data->last_checked = time();
|
95 |
+
$_transient_data->checked[ $this->name ] = $this->version;
|
96 |
+
|
97 |
+
}
|
98 |
+
|
99 |
+
}
|
100 |
+
|
101 |
+
return $_transient_data;
|
102 |
+
}
|
103 |
+
|
104 |
+
/**
|
105 |
+
* show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
|
106 |
+
*
|
107 |
+
* @param string $file
|
108 |
+
* @param array $plugin
|
109 |
+
*/
|
110 |
+
public function show_update_notification( $file, $plugin ) {
|
111 |
+
|
112 |
+
if( ! current_user_can( 'update_plugins' ) ) {
|
113 |
+
return;
|
114 |
+
}
|
115 |
+
|
116 |
+
if( ! is_multisite() ) {
|
117 |
+
return;
|
118 |
+
}
|
119 |
+
|
120 |
+
if ( $this->name != $file ) {
|
121 |
+
return;
|
122 |
+
}
|
123 |
+
|
124 |
+
// Remove our filter on the site transient
|
125 |
+
remove_filter( 'pre_site_transient_update_plugins', array( $this, 'check_update' ), 10 );
|
126 |
+
|
127 |
+
$update_cache = get_site_transient( 'update_plugins' );
|
128 |
+
|
129 |
+
if ( empty( $update_cache->response ) || empty( $update_cache->response[ $this->name ] ) ) {
|
130 |
+
|
131 |
+
$version_info = $this->api_request( 'plugin_latest_version', array( 'slug' => $this->slug ) );
|
132 |
+
|
133 |
+
if( version_compare( $this->version, $version_info->new_version, '<' ) ) {
|
134 |
+
|
135 |
+
$update_cache->response[ $this->name ] = $version_info;
|
136 |
+
|
137 |
+
}
|
138 |
+
|
139 |
+
$update_cache->last_checked = time();
|
140 |
+
$update_cache->checked[ $this->name ] = $this->version;
|
141 |
+
|
142 |
+
set_site_transient( 'update_plugins', $update_cache );
|
143 |
+
|
144 |
+
}
|
145 |
+
|
146 |
+
// Restore our filter
|
147 |
+
add_filter( 'pre_site_transient_update_plugins', array( $this, 'check_update' ) );
|
148 |
+
|
149 |
+
if ( ! empty( $update_cache->response[ $this->name ] ) && version_compare( $this->version, $version_info->new_version, '<' ) ) {
|
150 |
+
|
151 |
+
// build a plugin list row, with update notification
|
152 |
+
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' );
|
153 |
+
echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
|
154 |
+
|
155 |
+
$changelog_link = self_admin_url( 'index.php?edd_sl_action=view_plugin_changelog&plugin=' . $this->name . '&slug=' . $this->slug . '&TB_iframe=true&width=772&height=911' );
|
156 |
+
|
157 |
+
if ( empty( $version_info->download_link ) ) {
|
158 |
+
printf(
|
159 |
+
__( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a>.' ),
|
160 |
+
esc_html( $version_info->name ),
|
161 |
+
esc_url( $changelog_link ),
|
162 |
+
esc_html( $version_info->new_version )
|
163 |
+
);
|
164 |
+
} else {
|
165 |
+
printf(
|
166 |
+
__( 'There is a new version of %1$s available. <a target="_blank" class="thickbox" href="%2$s">View version %3$s details</a> or <a href="%4$s">update now</a>.' ),
|
167 |
+
esc_html( $version_info->name ),
|
168 |
+
esc_url( $changelog_link ),
|
169 |
+
esc_html( $version_info->new_version ),
|
170 |
+
esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) )
|
171 |
+
);
|
172 |
+
}
|
173 |
+
|
174 |
+
echo '</div></td></tr>';
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Updates information on the "View version x.x details" page with custom data.
|
181 |
+
*
|
182 |
+
* @uses api_request()
|
183 |
+
*
|
184 |
+
* @param mixed $_data
|
185 |
+
* @param string $_action
|
186 |
+
* @param object $_args
|
187 |
+
* @return object $_data
|
188 |
+
*/
|
189 |
+
function plugins_api_filter( $_data, $_action = '', $_args = null ) {
|
190 |
+
|
191 |
+
|
192 |
+
if ( $_action != 'plugin_information' ) {
|
193 |
+
|
194 |
+
return $_data;
|
195 |
+
|
196 |
+
}
|
197 |
+
|
198 |
+
if ( ! isset( $_args->slug ) || ( $_args->slug != $this->slug ) ) {
|
199 |
+
|
200 |
+
return $_data;
|
201 |
+
|
202 |
+
}
|
203 |
+
|
204 |
+
$to_send = array(
|
205 |
+
'slug' => $this->slug,
|
206 |
+
'is_ssl' => is_ssl(),
|
207 |
+
'fields' => array(
|
208 |
+
'banners' => false, // These will be supported soon hopefully
|
209 |
+
'reviews' => false
|
210 |
+
)
|
211 |
+
);
|
212 |
+
|
213 |
+
$api_response = $this->api_request( 'plugin_information', $to_send );
|
214 |
+
|
215 |
+
if ( false !== $api_response ) {
|
216 |
+
$_data = $api_response;
|
217 |
+
}
|
218 |
+
|
219 |
+
return $_data;
|
220 |
+
}
|
221 |
+
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Disable SSL verification in order to prevent download update failures
|
225 |
+
*
|
226 |
+
* @param array $args
|
227 |
+
* @param string $url
|
228 |
+
* @return object $array
|
229 |
+
*/
|
230 |
+
function http_request_args( $args, $url ) {
|
231 |
+
// If it is an https request and we are performing a package download, disable ssl verification
|
232 |
+
if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
|
233 |
+
$args['sslverify'] = false;
|
234 |
+
}
|
235 |
+
return $args;
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Calls the API and, if successfull, returns the object delivered by the API.
|
240 |
+
*
|
241 |
+
* @uses get_bloginfo()
|
242 |
+
* @uses wp_remote_post()
|
243 |
+
* @uses is_wp_error()
|
244 |
+
*
|
245 |
+
* @param string $_action The requested action.
|
246 |
+
* @param array $_data Parameters for the API action.
|
247 |
+
* @return false||object
|
248 |
+
*/
|
249 |
+
private function api_request( $_action, $_data ) {
|
250 |
+
|
251 |
+
global $wp_version;
|
252 |
+
|
253 |
+
$data = array_merge( $this->api_data, $_data );
|
254 |
+
|
255 |
+
if ( $data['slug'] != $this->slug )
|
256 |
+
return;
|
257 |
+
|
258 |
+
if ( empty( $data['license'] ) )
|
259 |
+
return;
|
260 |
+
|
261 |
+
if( $this->api_url == home_url() ) {
|
262 |
+
return false; // Don't allow a plugin to ping itself
|
263 |
+
}
|
264 |
+
|
265 |
+
$api_params = array(
|
266 |
+
'edd_action' => 'get_version',
|
267 |
+
'license' => $data['license'],
|
268 |
+
'item_name' => isset( $data['item_name'] ) ? $data['item_name'] : false,
|
269 |
+
'item_id' => isset( $data['item_id'] ) ? $data['item_id'] : false,
|
270 |
+
'slug' => $this->slug,
|
271 |
+
'author' => $data['author'],
|
272 |
+
'url' => home_url()
|
273 |
+
);
|
274 |
+
|
275 |
+
$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) );
|
276 |
+
|
277 |
+
if ( ! is_wp_error( $request ) ) {
|
278 |
+
$request = json_decode( wp_remote_retrieve_body( $request ) );
|
279 |
+
}
|
280 |
+
|
281 |
+
if ( $request && isset( $request->sections ) ) {
|
282 |
+
$request->sections = maybe_unserialize( $request->sections );
|
283 |
+
} else {
|
284 |
+
$request = false;
|
285 |
+
}
|
286 |
+
|
287 |
+
return $request;
|
288 |
+
}
|
289 |
+
|
290 |
+
public function show_changelog() {
|
291 |
+
|
292 |
+
|
293 |
+
if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
|
294 |
+
return;
|
295 |
+
}
|
296 |
+
|
297 |
+
if( empty( $_REQUEST['plugin'] ) ) {
|
298 |
+
return;
|
299 |
+
}
|
300 |
+
|
301 |
+
if( empty( $_REQUEST['slug'] ) ) {
|
302 |
+
return;
|
303 |
+
}
|
304 |
+
|
305 |
+
if( ! current_user_can( 'update_plugins' ) ) {
|
306 |
+
wp_die( __( 'You do not have permission to install plugin updates' ) );
|
307 |
+
}
|
308 |
+
|
309 |
+
$response = $this->api_request( 'plugin_latest_version', array( 'slug' => $_REQUEST['slug'] ) );
|
310 |
+
|
311 |
+
if( $response && isset( $response->sections['changelog'] ) ) {
|
312 |
+
echo '<div style="background:#fff;padding:10px;">' . $response->sections['changelog'] . '</div>';
|
313 |
+
}
|
314 |
+
|
315 |
+
|
316 |
+
exit;
|
317 |
+
}
|
318 |
+
|
319 |
}
|
includes/licensing.php
CHANGED
@@ -43,7 +43,9 @@ function wprss_edd_licensing_api( $addon, $license_key = NULL, $action = 'check_
|
|
43 |
$response = wp_remote_get( add_query_arg( $api_params, $store_url_constant ) );
|
44 |
|
45 |
// If the response is an error, return the value in the DB
|
46 |
-
if ( is_wp_error( $response ) )
|
|
|
|
|
47 |
|
48 |
// decode the license data
|
49 |
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
@@ -206,7 +208,7 @@ function wprss_license_key_field( $args ) {
|
|
206 |
function wprss_activate_license_button( $args ) {
|
207 |
$addon_id = $args[0];
|
208 |
$data = wprss_edd_check_license( $addon_id, NULL, 'ALL' );
|
209 |
-
$status = $data->license;
|
210 |
if ( $status === 'site_inactive' ) $status = 'inactive';
|
211 |
if ( $status === 'item_name_mismatch' ) $status = 'invalid';
|
212 |
|
@@ -234,23 +236,29 @@ function wprss_activate_license_button( $args ) {
|
|
234 |
<p>
|
235 |
<?php
|
236 |
$license_key = wprss_get_license_key( $addon_id );
|
237 |
-
$
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
<
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
</p>
|
255 |
|
256 |
<style type="text/css">
|
@@ -275,7 +283,7 @@ function wprss_activate_license_button( $args ) {
|
|
275 |
}
|
276 |
|
277 |
|
278 |
-
add_action( 'admin_init', 'wprss_process_addon_license' );
|
279 |
/**
|
280 |
* Handles the activation/deactivation process
|
281 |
*
|
43 |
$response = wp_remote_get( add_query_arg( $api_params, $store_url_constant ) );
|
44 |
|
45 |
// If the response is an error, return the value in the DB
|
46 |
+
if ( is_wp_error( $response ) ) {
|
47 |
+
return $license_status;
|
48 |
+
}
|
49 |
|
50 |
// decode the license data
|
51 |
$license_data = json_decode( wp_remote_retrieve_body( $response ) );
|
208 |
function wprss_activate_license_button( $args ) {
|
209 |
$addon_id = $args[0];
|
210 |
$data = wprss_edd_check_license( $addon_id, NULL, 'ALL' );
|
211 |
+
$status = is_string( $data ) ? $data : $data->license;
|
212 |
if ( $status === 'site_inactive' ) $status = 'inactive';
|
213 |
if ( $status === 'item_name_mismatch' ) $status = 'invalid';
|
214 |
|
236 |
<p>
|
237 |
<?php
|
238 |
$license_key = wprss_get_license_key( $addon_id );
|
239 |
+
if ( ! empty( $license_key ) ) :
|
240 |
+
if ( is_object( $data ) ) :
|
241 |
+
$acts_current = $data->site_count;
|
242 |
+
$acts_left = $data->activations_left;
|
243 |
+
$acts_limit = $data->license_limit;
|
244 |
+
$expires = $data->expires;
|
245 |
+
$expires = substr( $expires, 0, strpos( $expires, " " ) );
|
246 |
+
?>
|
247 |
+
<small>
|
248 |
+
<strong>Activations:</strong>
|
249 |
+
<?php echo $acts_current.'/'.$acts_limit; ?> (<?php echo $acts_left; ?> left)
|
250 |
+
<br/>
|
251 |
+
<strong>Expires on:</strong>
|
252 |
+
<code><?php echo $expires; ?></code>
|
253 |
+
<br/>
|
254 |
+
<strong>Registered to:</strong>
|
255 |
+
<?php echo $data->customer_name; ?> (<code><?php echo $data->customer_email; ?></code>)
|
256 |
+
</small>
|
257 |
+
<?php else: ?>
|
258 |
+
<small>Failed to get license information. This is a temporary problem. Check your internet connection and try again later.</small>
|
259 |
+
<?php endif; ?>
|
260 |
+
<?php endif;
|
261 |
+
?>
|
262 |
</p>
|
263 |
|
264 |
<style type="text/css">
|
283 |
}
|
284 |
|
285 |
|
286 |
+
add_action( 'admin_init', 'wprss_process_addon_license', 10 );
|
287 |
/**
|
288 |
* Handles the activation/deactivation process
|
289 |
*
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.wprssaggregator.com
|
|
5 |
Tags: rss, feeds, aggregation, rss to post, autoblog aggregator, rss import, feed aggregator, rss aggregator, multiple rss feeds, multi rss feeds, rss multi importer, feed import, feed import, multiple feed import, feed aggregation, rss feader, feed reader, feed to post, multiple feeds, multi feed importer, multi feed import, multi import, autoblogging, autoblogger
|
6 |
Requires at least: 3.3
|
7 |
Tested up to: 4.0
|
8 |
-
Stable tag: 4.6.
|
9 |
License: GPLv2 or later
|
10 |
The no.1 RSS feed importer for WordPress. Premium add-ons available for more functionality.
|
11 |
|
@@ -167,6 +167,12 @@ The full documentation section can be found on the [WP RSS Aggregator website](w
|
|
167 |
|
168 |
== Changelog ==
|
169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
170 |
= 4.6.4 (2014-11-10) =
|
171 |
* Enhanced: Added filters to the custom feed.
|
172 |
* Enhanced: Updated some styles to improve the user interface.
|
5 |
Tags: rss, feeds, aggregation, rss to post, autoblog aggregator, rss import, feed aggregator, rss aggregator, multiple rss feeds, multi rss feeds, rss multi importer, feed import, feed import, multiple feed import, feed aggregation, rss feader, feed reader, feed to post, multiple feeds, multi feed importer, multi feed import, multi import, autoblogging, autoblogger
|
6 |
Requires at least: 3.3
|
7 |
Tested up to: 4.0
|
8 |
+
Stable tag: 4.6.5
|
9 |
License: GPLv2 or later
|
10 |
The no.1 RSS feed importer for WordPress. Premium add-ons available for more functionality.
|
11 |
|
167 |
|
168 |
== Changelog ==
|
169 |
|
170 |
+
= 4.6.5 (2014-11-17) =
|
171 |
+
* Enhanced: Improved the logging.
|
172 |
+
* Enhanced: Improved the licensing fields.
|
173 |
+
* Enhanced: Updated the EDD updater class to the latest version.
|
174 |
+
* Fixed bug: Small random error when viewing the licenses page.
|
175 |
+
|
176 |
= 4.6.4 (2014-11-10) =
|
177 |
* Enhanced: Added filters to the custom feed.
|
178 |
* Enhanced: Updated some styles to improve the user interface.
|
wp-rss-aggregator.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP RSS Aggregator
|
4 |
Plugin URI: http://www.wprssaggregator.com
|
5 |
Description: Imports and aggregates multiple RSS Feeds using SimplePie
|
6 |
-
Version: 4.6.
|
7 |
Author: Jean Galea
|
8 |
Author URI: http://www.wprssaggregator.com
|
9 |
License: GPLv2
|
@@ -29,7 +29,7 @@
|
|
29 |
|
30 |
/**
|
31 |
* @package WPRSSAggregator
|
32 |
-
* @version 4.6.
|
33 |
* @since 1.0
|
34 |
* @author Jean Galea <info@wprssaggregator.com>
|
35 |
* @copyright Copyright (c) 2012-2014, Jean Galea
|
@@ -43,7 +43,7 @@
|
|
43 |
|
44 |
// Set the version number of the plugin.
|
45 |
if( !defined( 'WPRSS_VERSION' ) )
|
46 |
-
define( 'WPRSS_VERSION', '4.6.
|
47 |
|
48 |
// Set the database version number of the plugin.
|
49 |
if( !defined( 'WPRSS_DB_VERSION' ) )
|
3 |
Plugin Name: WP RSS Aggregator
|
4 |
Plugin URI: http://www.wprssaggregator.com
|
5 |
Description: Imports and aggregates multiple RSS Feeds using SimplePie
|
6 |
+
Version: 4.6.5
|
7 |
Author: Jean Galea
|
8 |
Author URI: http://www.wprssaggregator.com
|
9 |
License: GPLv2
|
29 |
|
30 |
/**
|
31 |
* @package WPRSSAggregator
|
32 |
+
* @version 4.6.5
|
33 |
* @since 1.0
|
34 |
* @author Jean Galea <info@wprssaggregator.com>
|
35 |
* @copyright Copyright (c) 2012-2014, Jean Galea
|
43 |
|
44 |
// Set the version number of the plugin.
|
45 |
if( !defined( 'WPRSS_VERSION' ) )
|
46 |
+
define( 'WPRSS_VERSION', '4.6.5', true );
|
47 |
|
48 |
// Set the database version number of the plugin.
|
49 |
if( !defined( 'WPRSS_DB_VERSION' ) )
|