Easy Updates Manager - Version 6.0.3

Version Description

Released 2016-05-17

  • Bug fix: Allow translations in logs (note: manual logging of translations is not currently possible).
  • Bug fix: Settings link causes PHP warning error in multisite.
Download this release

Release Info

Developer ronalfy
Plugin Icon 128x128 Easy Updates Manager
Version 6.0.3
Comparing to
See all releases

Code changes from version 6.0.1 to 6.0.3

Files changed (4) hide show
  1. includes/MPSUM_Admin.php +7 -2
  2. includes/MPSUM_Logs.php +39 -5
  3. main.php +1 -1
  4. readme.txt +10 -1
includes/MPSUM_Admin.php CHANGED
@@ -313,6 +313,11 @@ class MPSUM_Admin {
313
  */
314
  public function plugin_settings_link( $settings ) {
315
  $admin_anchor = sprintf( '<a href="%s">%s</a>', esc_url( $this->get_url() ), esc_html__( 'Configure', 'stops-core-theme-and-plugin-updates' ) );
316
- return array_merge( array( $admin_anchor ), $settings );
 
 
 
 
 
317
  }
318
- }
313
  */
314
  public function plugin_settings_link( $settings ) {
315
  $admin_anchor = sprintf( '<a href="%s">%s</a>', esc_url( $this->get_url() ), esc_html__( 'Configure', 'stops-core-theme-and-plugin-updates' ) );
316
+
317
+ if ( ! is_array( $settings ) ) {
318
+ return array( $admin_anchor );
319
+ } else {
320
+ return array_merge( array( $admin_anchor ), $settings );
321
+ }
322
  }
323
+ }
includes/MPSUM_Logs.php CHANGED
@@ -106,7 +106,6 @@ class MPSUM_Logs {
106
  break;
107
  case 'plugin':
108
  foreach( $results as $plugin ) {
109
- error_log( print_r( $plugin, true ) );
110
  $status = is_wp_error( $plugin->result ) ? 0: 1;
111
  $version = isset( $plugin->item->new_version ) ? $plugin->item->new_version : '0.00';
112
  $name = ( isset( $plugin->name ) && !empty( $plugin->name ) ) ? $plugin->name : $plugin->item->slug;
@@ -133,7 +132,6 @@ class MPSUM_Logs {
133
  break;
134
  case 'theme':
135
  foreach( $results as $theme ) {
136
- error_log( print_r( $theme, true ) );
137
  $status = ( is_wp_error( $theme->result ) || empty( $theme->result ) ) ? 0: 1;
138
  if ( 0 == $status ) {
139
  $theme_data_from_cache = wp_get_themes();
@@ -165,12 +163,15 @@ class MPSUM_Logs {
165
  break;
166
  case 'translation':
167
  foreach( $results as $translation ) {
 
168
  $status = is_wp_error( $translation->result ) ? 0: 1;
169
- $version = ( 1 == $status ) ? $translation->item->new_version : '';
 
 
170
  $wpdb->insert(
171
  $tablename,
172
  array(
173
- 'name' => $translation->name,
174
  'type' => $type,
175
  'version' => $version,
176
  'action' => 'automatic',
@@ -192,6 +193,39 @@ class MPSUM_Logs {
192
  }
193
  }
194
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  public function manual_updates( $upgrader_object, $options ) {
196
  if ( !isset( $options[ 'action' ] ) || 'update' !== $options[ 'action' ] ) return;
197
  global $wpdb;
@@ -367,4 +401,4 @@ class MPSUM_Logs {
367
  $sql = "drop table if exists $tablename";
368
  $wpdb->query( $sql );
369
  }
370
- }
106
  break;
107
  case 'plugin':
108
  foreach( $results as $plugin ) {
 
109
  $status = is_wp_error( $plugin->result ) ? 0: 1;
110
  $version = isset( $plugin->item->new_version ) ? $plugin->item->new_version : '0.00';
111
  $name = ( isset( $plugin->name ) && !empty( $plugin->name ) ) ? $plugin->name : $plugin->item->slug;
132
  break;
133
  case 'theme':
134
  foreach( $results as $theme ) {
 
135
  $status = ( is_wp_error( $theme->result ) || empty( $theme->result ) ) ? 0: 1;
136
  if ( 0 == $status ) {
137
  $theme_data_from_cache = wp_get_themes();
163
  break;
164
  case 'translation':
165
  foreach( $results as $translation ) {
166
+
167
  $status = is_wp_error( $translation->result ) ? 0: 1;
168
+ $version = ( 1 == $status ) ? $translation->item->version : '';
169
+ $slug = $translation->item->slug;
170
+ $name = $this->get_name_for_update( $translation->item->type, $translation->item->slug );
171
  $wpdb->insert(
172
  $tablename,
173
  array(
174
+ 'name' => $name . ' (' . $translation->item->language . ')',
175
  'type' => $type,
176
  'version' => $version,
177
  'action' => 'automatic',
193
  }
194
  }
195
 
196
+ /**
197
+ * Get the name of an translation item being updated.
198
+ *
199
+ * @since 6.0.3
200
+ * @access private
201
+ *
202
+ * @param string type of translation update
203
+ * @param string $slug of item
204
+ * @return string The name of the item being updated.
205
+ */
206
+ private function get_name_for_update( $type, $slug ) {
207
+ if ( ! function_exists( 'get_plugins' ) ) {
208
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
209
+ }
210
+ switch ( $type ) {
211
+ case 'core':
212
+ return 'WordPress'; // Not translated
213
+
214
+ case 'theme':
215
+ $theme = wp_get_theme( $slug );
216
+ if ( $theme->exists() )
217
+ return $theme->Get( 'Name' );
218
+ break;
219
+ case 'plugin':
220
+ $plugin_data = get_plugins( '/' . $slug );
221
+ $plugin_data = reset( $plugin_data );
222
+ if ( $plugin_data )
223
+ return $plugin_data['Name'];
224
+ break;
225
+ }
226
+ return '';
227
+ }
228
+
229
  public function manual_updates( $upgrader_object, $options ) {
230
  if ( !isset( $options[ 'action' ] ) || 'update' !== $options[ 'action' ] ) return;
231
  global $wpdb;
401
  $sql = "drop table if exists $tablename";
402
  $wpdb->query( $sql );
403
  }
404
+ }
main.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Easy Updates Manager
4
  Plugin URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
5
  Description: Manage and disable WordPress updates, including core, plugin, theme, and automatic updates - Works with Multisite and has built-in logging features.
6
  Author: Easy Updates Manager Team
7
- Version: 6.0.1
8
  Requires at least: 4.4
9
  Author URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
10
  Contributors: kidsguide, ronalfy
4
  Plugin URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
5
  Description: Manage and disable WordPress updates, including core, plugin, theme, and automatic updates - Works with Multisite and has built-in logging features.
6
  Author: Easy Updates Manager Team
7
+ Version: 6.0.3
8
  Requires at least: 4.4
9
  Author URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
10
  Contributors: kidsguide, ronalfy
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: kidsguide, ronalfy, roary86, bigwing
3
  Tags: updates manager, easy updates manager, disable updates manager, disable updates, update control, plugin updates, theme updates, core updates, automatic updates, multisite, logs
4
  Requires at least: 4.4
5
  Tested up to: 4.5
6
- Stable tag: 6.0.1
7
  License: GPLv2 or later
8
  Donate link: https://mediaron.com/contribute/
9
 
@@ -105,6 +105,12 @@ For additional information and FAQs for Easy Updates Manager check out our <a hr
105
 
106
  == Changelog ==
107
 
 
 
 
 
 
 
108
  = 6.0.1 =
109
  Released 2016-05-15
110
 
@@ -199,6 +205,9 @@ In version 5.0.0 we completely re-wrote the plugin to offer a faster and more se
199
 
200
  == Upgrade Notice ==
201
 
 
 
 
202
  = 6.0.1 =
203
  Bug fix: Resetting options and enabling logs does not enable logging.
204
 
3
  Tags: updates manager, easy updates manager, disable updates manager, disable updates, update control, plugin updates, theme updates, core updates, automatic updates, multisite, logs
4
  Requires at least: 4.4
5
  Tested up to: 4.5
6
+ Stable tag: 6.0.3
7
  License: GPLv2 or later
8
  Donate link: https://mediaron.com/contribute/
9
 
105
 
106
  == Changelog ==
107
 
108
+ = 6.0.3 =
109
+ Released 2016-05-17
110
+
111
+ * Bug fix: Allow translations in logs (note: manual logging of translations is not currently possible).
112
+ * Bug fix: Settings link causes PHP warning error in multisite.
113
+
114
  = 6.0.1 =
115
  Released 2016-05-15
116
 
205
 
206
  == Upgrade Notice ==
207
 
208
+ = 6.0.3 =
209
+ Allow translation logging for automatic updates. Fix PHP warning on plugins page in multisite.
210
+
211
  = 6.0.1 =
212
  Bug fix: Resetting options and enabling logs does not enable logging.
213