Media Library Assistant - Version 0.41

Version Description

  • Fix: SQL View now created for automatic plugin upgrades
Download this release

Release Info

Developer dglingren
Plugin Icon 128x128 Media Library Assistant
Version 0.41
Comparing to
See all releases

Code changes from version 0.40 to 0.41

includes/class-mla-main.php CHANGED
@@ -38,7 +38,7 @@ class MLA {
38
  *
39
  * @var string
40
  */
41
- const CURRENT_MLA_VERSION = '0.40';
42
 
43
  /**
44
  * Minimum version of PHP required for this plugin
38
  *
39
  * @var string
40
  */
41
+ const CURRENT_MLA_VERSION = '0.41';
42
 
43
  /**
44
  * Minimum version of PHP required for this plugin
includes/class-mla-settings.php CHANGED
@@ -212,7 +212,8 @@ class MLASettings {
212
  self::mla_delete_option( 'attachment_tag' );
213
  } // version is less than .30
214
 
215
- self::mla_update_option( self::MLA_VERSION_OPTION, MLA::CURRENT_MLA_VERSION );
 
216
  }
217
 
218
  /**
@@ -232,13 +233,23 @@ class MLASettings {
232
  $result = $wpdb->query(
233
  $wpdb->prepare(
234
  "
235
- CREATE OR REPLACE VIEW {$view_name} AS
236
- SELECT post_id, meta_value
237
- FROM {$table_name}
238
- WHERE {$table_name}.meta_key = '_wp_attachment_image_alt'
239
  "
240
  )
241
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  }
243
 
244
  /**
@@ -254,25 +265,23 @@ class MLASettings {
254
  global $wpdb, $table_prefix;
255
 
256
  $view_name = $table_prefix . MLA_OPTION_PREFIX . self::MLA_ALT_TEXT_VIEW_SUFFIX;
257
- $table_name = $table_prefix . 'postmeta';
258
  $result = $wpdb->query(
259
  $wpdb->prepare(
260
  "
261
- CREATE OR REPLACE VIEW {$view_name} AS
262
- SELECT post_id, meta_value
263
- FROM {$table_name}
264
- WHERE {$table_name}.meta_key = '_wp_attachment_image_alt'
265
  "
266
  )
267
  );
268
 
269
- $result = $wpdb->query(
270
- $wpdb->prepare(
271
- "
272
- DROP VIEW {self::$mla_alt_text_view}
273
- "
274
- )
275
- );
 
 
276
  }
277
 
278
  /**
@@ -287,6 +296,8 @@ class MLASettings {
287
  $hook = add_submenu_page( 'options-general.php', 'Media Library Assistant Settings', 'Media Library Assistant', 'manage_options', self::MLA_SETTINGS_SLUG, 'MLASettings::mla_render_settings_page' );
288
 
289
  add_filter( 'plugin_action_links', 'MLASettings::mla_add_plugin_settings_link', 10, 2 );
 
 
290
  }
291
 
292
  /**
212
  self::mla_delete_option( 'attachment_tag' );
213
  } // version is less than .30
214
 
215
+ self::mla_update_option( self::MLA_VERSION_OPTION, MLA::CURRENT_MLA_VERSION );
216
+ self::mla_activation_hook();
217
  }
218
 
219
  /**
233
  $result = $wpdb->query(
234
  $wpdb->prepare(
235
  "
236
+ SHOW TABLES LIKE '{$view_name}'
 
 
 
237
  "
238
  )
239
  );
240
+
241
+ if ( 0 == $result ) {
242
+ $result = $wpdb->query(
243
+ $wpdb->prepare(
244
+ "
245
+ CREATE OR REPLACE VIEW {$view_name} AS
246
+ SELECT post_id, meta_value
247
+ FROM {$table_name}
248
+ WHERE {$table_name}.meta_key = '_wp_attachment_image_alt'
249
+ "
250
+ )
251
+ );
252
+ }
253
  }
254
 
255
  /**
265
  global $wpdb, $table_prefix;
266
 
267
  $view_name = $table_prefix . MLA_OPTION_PREFIX . self::MLA_ALT_TEXT_VIEW_SUFFIX;
 
268
  $result = $wpdb->query(
269
  $wpdb->prepare(
270
  "
271
+ SHOW TABLES LIKE '{$view_name}'
 
 
 
272
  "
273
  )
274
  );
275
 
276
+ if ( $result) {
277
+ $result = $wpdb->query(
278
+ $wpdb->prepare(
279
+ "
280
+ DROP VIEW {$view_name}
281
+ "
282
+ )
283
+ );
284
+ }
285
  }
286
 
287
  /**
296
  $hook = add_submenu_page( 'options-general.php', 'Media Library Assistant Settings', 'Media Library Assistant', 'manage_options', self::MLA_SETTINGS_SLUG, 'MLASettings::mla_render_settings_page' );
297
 
298
  add_filter( 'plugin_action_links', 'MLASettings::mla_add_plugin_settings_link', 10, 2 );
299
+
300
+
301
  }
302
 
303
  /**
index.php CHANGED
@@ -6,7 +6,7 @@
6
  * will the rest of the plugin be loaded and run.
7
  *
8
  * @package Media Library Assistant
9
- * @version 0.40
10
  */
11
 
12
  /*
@@ -14,7 +14,7 @@ Plugin Name: Media Library Assistant
14
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
15
  Description: Provides several enhancements to the handling of images and files held in the WordPress Media Library.
16
  Author: David Lingren
17
- Version: 0.40
18
  Author URI: http://fairtradejudaica.org/our-story/staff/
19
  */
20
 
6
  * will the rest of the plugin be loaded and run.
7
  *
8
  * @package Media Library Assistant
9
+ * @version 0.41
10
  */
11
 
12
  /*
14
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
15
  Description: Provides several enhancements to the handling of images and files held in the WordPress Media Library.
16
  Author: David Lingren
17
+ Version: 0.41
18
  Author URI: http://fairtradejudaica.org/our-story/staff/
19
  */
20
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://fairtradejudaica.org/make-a-difference/donate/
4
  Tags: attachments, documents, gallery, image, images, media, library, media library, media-tags, media tags, tags, media categories, categories
5
  Requires at least: 3.3
6
  Tested up to: 3.4.2
7
- Stable tag: 0.40
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -83,6 +83,9 @@ All of the MLA source code has been annotated with "DocBlocks", a special type o
83
 
84
  == Changelog ==
85
 
 
 
 
86
  = 0.40 =
87
  * New: Bulk Edit area; update author or parent, add, remove or replace taxonomy terms for several attachments at once
88
  * New: ALT Text is now a sortable column, and shows attachments with no ALT Text value
@@ -124,6 +127,9 @@ All of the MLA source code has been annotated with "DocBlocks", a special type o
124
 
125
  == Upgrade Notice ==
126
 
 
 
 
127
  = 0.40 =
128
  Upgrade for the new Bulk Edit area; add, remove or replace taxonomy terms for several attachments at once. Sort your media listing on ALT Text, exclude revisions from where-used reporting.
129
 
4
  Tags: attachments, documents, gallery, image, images, media, library, media library, media-tags, media tags, tags, media categories, categories
5
  Requires at least: 3.3
6
  Tested up to: 3.4.2
7
+ Stable tag: 0.41
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
83
 
84
  == Changelog ==
85
 
86
+ = 0.41 =
87
+ * Fix: SQL View now created for automatic plugin upgrades
88
+
89
  = 0.40 =
90
  * New: Bulk Edit area; update author or parent, add, remove or replace taxonomy terms for several attachments at once
91
  * New: ALT Text is now a sortable column, and shows attachments with no ALT Text value
127
 
128
  == Upgrade Notice ==
129
 
130
+ = 0.41 =
131
+ Upgrade for the new Bulk Edit area; add, remove or replace taxonomy terms for several attachments at once. Sort your media listing on ALT Text, exclude revisions from where-used reporting.
132
+
133
  = 0.40 =
134
  Upgrade for the new Bulk Edit area; add, remove or replace taxonomy terms for several attachments at once. Sort your media listing on ALT Text, exclude revisions from where-used reporting.
135