Media Library Assistant - Version 2.70

Version Description

  • New: A new Debug logging category has been created for "where-used" reporting.
  • New: The Att. Categories and Att. Tags taxonomies can now be displayed a columns on the Media/Library list mode admin submenu.
  • Fix: File downloads originating from a Bulk Action are now restricted to the site's uploads directory tree.
  • Fix: The "MLA Download ZIP Example" plugin has been updated to work with the current MLA version.
  • Fix: References to the FTJ Donate page now go to the plugin description page.
  • Fix: References to the WordPress get_terms() function have been updated to accomodate changes made in WP 4.5.0.
  • Fix: When Polylang is active, term assignment for "untranslated" taxonomies is no longer restricted to the default language.
  • Fix: On the Settings/Media Library Assistant Debug tab, the "Save Changes" button has been moved up for easier access when changing option settings.
  • Fix: For the Media/Edit Media admin submenu, duplicate database queries for the "Months" dropdown control have been eliminated.
Download this release

Release Info

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

Code changes from version 2.65 to 2.70

examples/plugins/alexa-paige-plugin.php CHANGED
@@ -19,7 +19,7 @@
19
  * alternatives to the standard WordPress tax_query.
20
  *
21
  * @package Alexa Paige Plugin for BuddyPress & rtMedia
22
- * @version 1.02
23
  */
24
 
25
  /*
@@ -27,7 +27,7 @@ Plugin Name: Alexa Paige Plugin for BuddyPress & rtMedia
27
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
28
  Description: Supports BuddyPress URLs and multi-taxonomy and term checkbox queries
29
  Author: David Lingren
30
- Version: 1.02
31
  Author URI: http://fairtradejudaica.org/our-story/staff/
32
 
33
  Copyright 2014 David Lingren
@@ -177,7 +177,7 @@ class AlexaPaigePlugin {
177
  $terms = array();
178
  $args = array( 'hide_empty' => false, 'exclude' => $exclude, 'include' => $include, );
179
  foreach( $taxonomies as $key => $taxonomy ) {
180
- $term_objects = get_terms( $taxonomy, $args );
181
  //error_log( "AlexaPaigePlugin::axp_checkbox_form term_objects [ {$taxonomy} ] = " . var_export( $term_objects, true ), 0 );
182
  if ( is_array( $term_objects ) ) {
183
  // Get the name for display purposes
@@ -790,7 +790,7 @@ class AlexaPaigePlugin {
790
  $slugs = explode( ',', $my_query_vars[ $taxonomy ] );
791
  foreach ( $slugs as $slug ) {
792
  $args = array( 'slug' => $slug, 'hide_empty' => false );
793
- $terms = array_merge( $terms, get_terms( $taxonomy, $args ) );
794
  }
795
 
796
  foreach( $terms as $term ) {
@@ -799,7 +799,7 @@ class AlexaPaigePlugin {
799
 
800
  if ( $include_children ) {
801
  $args = array( 'child_of' => $term->term_id, 'hide_empty' => false );
802
- $children = get_terms( 'attachment_category', $args );
803
  foreach( $children as $child ) {
804
  $ttids[] = $child->term_taxonomy_id;
805
  }
@@ -978,7 +978,7 @@ class AlexaPaigePlugin {
978
  $slugs = explode( ',', $my_query_vars[ $taxonomy ] );
979
  foreach ( $slugs as $slug ) {
980
  $args = array( 'slug' => $slug, 'hide_empty' => false );
981
- $terms = array_merge( $terms, get_terms( $taxonomy, $args ) );
982
  }
983
  //error_log( "AlexaPaigePlugin::double_query {$taxonomy} \$terms = " . var_export( $terms, true ), 0 );
984
 
@@ -988,7 +988,7 @@ class AlexaPaigePlugin {
988
 
989
  if ( $include_children ) {
990
  $args = array( 'child_of' => $term->term_id, 'hide_empty' => false );
991
- $children = get_terms( 'attachment_category', $args );
992
  foreach( $children as $child ) {
993
  $ttids[] = $child->term_taxonomy_id;
994
  }
19
  * alternatives to the standard WordPress tax_query.
20
  *
21
  * @package Alexa Paige Plugin for BuddyPress & rtMedia
22
+ * @version 1.03
23
  */
24
 
25
  /*
27
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
28
  Description: Supports BuddyPress URLs and multi-taxonomy and term checkbox queries
29
  Author: David Lingren
30
+ Version: 1.03
31
  Author URI: http://fairtradejudaica.org/our-story/staff/
32
 
33
  Copyright 2014 David Lingren
177
  $terms = array();
178
  $args = array( 'hide_empty' => false, 'exclude' => $exclude, 'include' => $include, );
179
  foreach( $taxonomies as $key => $taxonomy ) {
180
+ $term_objects = MLAQuery::mla_wp_get_terms( $taxonomy, $args );
181
  //error_log( "AlexaPaigePlugin::axp_checkbox_form term_objects [ {$taxonomy} ] = " . var_export( $term_objects, true ), 0 );
182
  if ( is_array( $term_objects ) ) {
183
  // Get the name for display purposes
790
  $slugs = explode( ',', $my_query_vars[ $taxonomy ] );
791
  foreach ( $slugs as $slug ) {
792
  $args = array( 'slug' => $slug, 'hide_empty' => false );
793
+ $terms = array_merge( $terms, MLAQuery::mla_wp_get_terms( $taxonomy, $args ) );
794
  }
795
 
796
  foreach( $terms as $term ) {
799
 
800
  if ( $include_children ) {
801
  $args = array( 'child_of' => $term->term_id, 'hide_empty' => false );
802
+ $children = MLAQuery::mla_wp_get_terms( 'attachment_category', $args );
803
  foreach( $children as $child ) {
804
  $ttids[] = $child->term_taxonomy_id;
805
  }
978
  $slugs = explode( ',', $my_query_vars[ $taxonomy ] );
979
  foreach ( $slugs as $slug ) {
980
  $args = array( 'slug' => $slug, 'hide_empty' => false );
981
+ $terms = array_merge( $terms, MLAQuery::mla_wp_get_terms( $taxonomy, $args ) );
982
  }
983
  //error_log( "AlexaPaigePlugin::double_query {$taxonomy} \$terms = " . var_export( $terms, true ), 0 );
984
 
988
 
989
  if ( $include_children ) {
990
  $args = array( 'child_of' => $term->term_id, 'hide_empty' => false );
991
+ $children = MLAQuery::mla_wp_get_terms( 'attachment_category', $args );
992
  foreach( $children as $child ) {
993
  $ttids[] = $child->term_taxonomy_id;
994
  }
examples/plugins/mla-a-z-cloud-example.php CHANGED
@@ -21,7 +21,7 @@
21
  * https://wordpress.org/support/topic/alphabetical-pagination-2
22
  *
23
  * @package MLA Child Term Hooks Example
24
- * @version 1.01
25
  */
26
 
27
  /*
@@ -29,7 +29,7 @@ Plugin Name: MLA A-Z Cloud and Collapse-o-Matic Example
29
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
30
  Description: Provides an "A-Z cloud/pagination" and expandable gallery example
31
  Author: David Lingren
32
- Version: 1.01
33
  Author URI: http://fairtradejudaica.org/our-story/staff/
34
 
35
  Copyright 2015 David Lingren
@@ -419,7 +419,7 @@ class MLAAtoZCloudExample {
419
  $slugs = explode( ',', $attr[ $taxonomy ] );
420
  foreach ( $slugs as $slug ) {
421
  $args = array( 'slug' => $slug, 'hide_empty' => false );
422
- $terms = array_merge( $terms, get_terms( $taxonomy, $args ) );
423
  }
424
 
425
  foreach( $terms as $term ) {
@@ -428,7 +428,7 @@ class MLAAtoZCloudExample {
428
 
429
  if ( $include_children ) {
430
  $args = array( 'child_of' => $term->term_id, 'hide_empty' => false );
431
- $children = get_terms( $taxonomy, $args );
432
  foreach( $children as $child ) {
433
  $ttids[] = $child->term_taxonomy_id;
434
  }
21
  * https://wordpress.org/support/topic/alphabetical-pagination-2
22
  *
23
  * @package MLA Child Term Hooks Example
24
+ * @version 1.02
25
  */
26
 
27
  /*
29
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
30
  Description: Provides an "A-Z cloud/pagination" and expandable gallery example
31
  Author: David Lingren
32
+ Version: 1.02
33
  Author URI: http://fairtradejudaica.org/our-story/staff/
34
 
35
  Copyright 2015 David Lingren
419
  $slugs = explode( ',', $attr[ $taxonomy ] );
420
  foreach ( $slugs as $slug ) {
421
  $args = array( 'slug' => $slug, 'hide_empty' => false );
422
+ $terms = array_merge( $terms, MLAQuery::mla_wp_get_terms( $taxonomy, $args ) );
423
  }
424
 
425
  foreach( $terms as $term ) {
428
 
429
  if ( $include_children ) {
430
  $args = array( 'child_of' => $term->term_id, 'hide_empty' => false );
431
+ $children = MLAQuery::mla_wp_get_terms( $taxonomy, $args );
432
  foreach( $children as $child ) {
433
  $ttids[] = $child->term_taxonomy_id;
434
  }
examples/plugins/mla-child-term-hooks-example.php CHANGED
@@ -16,7 +16,7 @@
16
  * https://wordpress.org/support/topic/automatic-hierarchical-display-for-hierarchical-taxonomies
17
  *
18
  * @package MLA Child Term Hooks Example
19
- * @version 1.01
20
  */
21
 
22
  /*
@@ -24,7 +24,7 @@ Plugin Name: MLA Child Term Hooks Example
24
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
25
  Description: Creates a term-specific gallery of images assigned to child terms.
26
  Author: David Lingren
27
- Version: 1.01
28
  Author URI: http://fairtradejudaica.org/our-story/staff/
29
 
30
  Copyright 2014 David Lingren
@@ -178,7 +178,7 @@ class MLAChildTermHooksExample {
178
  $slugs = explode( ',', $my_query_vars[ $taxonomy ] );
179
  foreach ( $slugs as $slug ) {
180
  $args = array( 'slug' => $slug, 'hide_empty' => false );
181
- $terms = array_merge( $terms, get_terms( $taxonomy, $args ) );
182
  }
183
 
184
  foreach( $terms as $term ) {
@@ -189,7 +189,7 @@ class MLAChildTermHooksExample {
189
  $args = array( 'parent' => absint( $term->term_id ), 'hide_empty' => false );
190
  }
191
 
192
- $children = get_terms( 'attachment_category', $args );
193
  foreach( $children as $child ) {
194
  // Index by ttid to remove duplicates
195
  $ttids[ $child->term_taxonomy_id ] = $child->term_taxonomy_id;
16
  * https://wordpress.org/support/topic/automatic-hierarchical-display-for-hierarchical-taxonomies
17
  *
18
  * @package MLA Child Term Hooks Example
19
+ * @version 1.02
20
  */
21
 
22
  /*
24
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
25
  Description: Creates a term-specific gallery of images assigned to child terms.
26
  Author: David Lingren
27
+ Version: 1.02
28
  Author URI: http://fairtradejudaica.org/our-story/staff/
29
 
30
  Copyright 2014 David Lingren
178
  $slugs = explode( ',', $my_query_vars[ $taxonomy ] );
179
  foreach ( $slugs as $slug ) {
180
  $args = array( 'slug' => $slug, 'hide_empty' => false );
181
+ $terms = array_merge( $terms, MLAQuery::mla_wp_get_terms( $taxonomy, $args ) );
182
  }
183
 
184
  foreach( $terms as $term ) {
189
  $args = array( 'parent' => absint( $term->term_id ), 'hide_empty' => false );
190
  }
191
 
192
+ $children = MLAQuery::mla_wp_get_terms( 'attachment_category', $args );
193
  foreach( $children as $child ) {
194
  // Index by ttid to remove duplicates
195
  $ttids[ $child->term_taxonomy_id ] = $child->term_taxonomy_id;
examples/plugins/mla-hooks-example.php CHANGED
@@ -16,7 +16,7 @@
16
  * and illustrates some of the techniques you can use to customize the gallery display.
17
  *
18
  * @package MLA Gallery Hooks Example
19
- * @version 1.13
20
  */
21
 
22
  /*
@@ -24,7 +24,7 @@ Plugin Name: MLA Gallery Hooks Example
24
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
25
  Description: Provides examples of hooking the filters provided by the [mla_gallery] shortcode
26
  Author: David Lingren
27
- Version: 1.13
28
  Author URI: http://fairtradejudaica.org/our-story/staff/
29
 
30
  Copyright 2013 - 2017 David Lingren
@@ -492,7 +492,7 @@ class MLAGalleryHooksExample {
492
  $slugs = explode( ',', $my_query_vars[ $taxonomy ] );
493
  foreach ( $slugs as $slug ) {
494
  $args = array( 'slug' => $slug, 'hide_empty' => false );
495
- $terms = array_merge( $terms, get_terms( $taxonomy, $args ) );
496
  }
497
 
498
  $ttids = array();
@@ -502,7 +502,7 @@ class MLAGalleryHooksExample {
502
 
503
  if ( $tax_include_children ) {
504
  $args = array( 'child_of' => $term->term_id, 'hide_empty' => false );
505
- $children = get_terms( $taxonomy, $args );
506
  foreach( $children as $child ) {
507
  $ttids[ $child->term_taxonomy_id ] = $child->term_taxonomy_id;
508
  }
16
  * and illustrates some of the techniques you can use to customize the gallery display.
17
  *
18
  * @package MLA Gallery Hooks Example
19
+ * @version 1.14
20
  */
21
 
22
  /*
24
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
25
  Description: Provides examples of hooking the filters provided by the [mla_gallery] shortcode
26
  Author: David Lingren
27
+ Version: 1.14
28
  Author URI: http://fairtradejudaica.org/our-story/staff/
29
 
30
  Copyright 2013 - 2017 David Lingren
492
  $slugs = explode( ',', $my_query_vars[ $taxonomy ] );
493
  foreach ( $slugs as $slug ) {
494
  $args = array( 'slug' => $slug, 'hide_empty' => false );
495
+ $terms = array_merge( $terms, MLAQuery::mla_wp_get_terms( $taxonomy, $args ) );
496
  }
497
 
498
  $ttids = array();
502
 
503
  if ( $tax_include_children ) {
504
  $args = array( 'child_of' => $term->term_id, 'hide_empty' => false );
505
+ $children = MLAQuery::mla_wp_get_terms( $taxonomy, $args );
506
  foreach( $children as $child ) {
507
  $ttids[ $child->term_taxonomy_id ] = $child->term_taxonomy_id;
508
  }
examples/plugins/mla-tax-query-example.php CHANGED
@@ -54,7 +54,7 @@
54
  * https://wordpress.org/support/topic/504-time-out-issue/
55
  *
56
  * @package MLA tax query Example
57
- * @version 1.07
58
  */
59
 
60
  /*
@@ -62,7 +62,7 @@ Plugin Name: MLA tax query Example
62
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
63
  Description: Replaces the WP_Query tax_query with a more efficient, direct SQL query
64
  Author: David Lingren
65
- Version: 1.07
66
  Author URI: http://fairtradejudaica.org/our-story/staff/
67
 
68
  Copyright 2013 - 2017 David Lingren
@@ -345,10 +345,10 @@ class MLATaxQueryExample {
345
  foreach ( $slugs as $slug ) {
346
  if ( 0 === strpos( $slug, '/' ) ) {
347
  $args = array( 'slug' => substr( $slug, 1 ), 'hide_empty' => false );
348
- $excludes = array_merge( $excludes, get_terms( $taxonomy, $args ) );
349
  } else {
350
  $args = array( 'slug' => $slug, 'hide_empty' => false );
351
- $terms = array_merge( $terms, get_terms( $taxonomy, $args ) );
352
  }
353
  }
354
 
@@ -358,7 +358,7 @@ class MLATaxQueryExample {
358
 
359
  if ( $include_children ) {
360
  $args = array( 'child_of' => $term->term_id, 'hide_empty' => false );
361
- $children = get_terms( 'attachment_category', $args );
362
  foreach( $children as $child ) {
363
  $include_ttids[] = $child->term_taxonomy_id;
364
  }
@@ -371,7 +371,7 @@ class MLATaxQueryExample {
371
 
372
  if ( $include_children ) {
373
  $args = array( 'child_of' => $exclude->term_id, 'hide_empty' => false );
374
- $children = get_terms( 'attachment_category', $args );
375
  foreach( $children as $child ) {
376
  $exclude_ttids[] = $child->term_taxonomy_id;
377
  }
54
  * https://wordpress.org/support/topic/504-time-out-issue/
55
  *
56
  * @package MLA tax query Example
57
+ * @version 1.08
58
  */
59
 
60
  /*
62
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
63
  Description: Replaces the WP_Query tax_query with a more efficient, direct SQL query
64
  Author: David Lingren
65
+ Version: 1.08
66
  Author URI: http://fairtradejudaica.org/our-story/staff/
67
 
68
  Copyright 2013 - 2017 David Lingren
345
  foreach ( $slugs as $slug ) {
346
  if ( 0 === strpos( $slug, '/' ) ) {
347
  $args = array( 'slug' => substr( $slug, 1 ), 'hide_empty' => false );
348
+ $excludes = array_merge( $excludes, MLAQuery::mla_wp_get_terms( $taxonomy, $args ) );
349
  } else {
350
  $args = array( 'slug' => $slug, 'hide_empty' => false );
351
+ $terms = array_merge( $terms, MLAQuery::mla_wp_get_terms( $taxonomy, $args ) );
352
  }
353
  }
354
 
358
 
359
  if ( $include_children ) {
360
  $args = array( 'child_of' => $term->term_id, 'hide_empty' => false );
361
+ $children = MLAQuery::mla_wp_get_terms( 'attachment_category', $args );
362
  foreach( $children as $child ) {
363
  $include_ttids[] = $child->term_taxonomy_id;
364
  }
371
 
372
  if ( $include_children ) {
373
  $args = array( 'child_of' => $exclude->term_id, 'hide_empty' => false );
374
+ $children = MLAQuery::mla_wp_get_terms( 'attachment_category', $args );
375
  foreach( $children as $child ) {
376
  $exclude_ttids[] = $child->term_taxonomy_id;
377
  }
examples/plugins/mla-zip-archive-example.php CHANGED
@@ -1,22 +1,24 @@
1
  <?php
2
  /**
3
- * Provides an example of hooking the filters provided by the MLA_List_Table class
4
  *
5
- * In this example, a Bulk Action is created that downloads one or more files as a ZIP archive.
 
 
6
  *
7
  * @package MLA Download ZIP Example
8
- * @version 1.00
9
  */
10
 
11
  /*
12
  Plugin Name: MLA Download ZIP Example
13
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
14
- Description: Provides an example of hooking the filters provided by the MLA_List_Table class
15
  Author: David Lingren
16
- Version: 1.00
17
  Author URI: http://fairtradejudaica.org/our-story/staff/
18
 
19
- Copyright 2014 David Lingren
20
 
21
  This program is free software; you can redistribute it and/or modify
22
  it under the terms of the GNU General Public License as published by
@@ -154,9 +156,9 @@ class MLADownloadZIPExample {
154
  return;
155
  }
156
 
157
- $download_args = array( 'page' => MLA::ADMIN_PAGE_SLUG, 'mla_download_file' => urlencode( $archive_name ), 'mla_download_type' => 'application/zip', 'mla_download_disposition' => 'delete' );
158
 
159
- wp_redirect( add_query_arg( $download_args, wp_nonce_url( 'upload.php', MLA::MLA_ADMIN_NONCE ) ), 302 );
160
  exit;
161
  } // admin_init_action
162
 
1
  <?php
2
  /**
3
+ * Creates a Bulk Action that downloads one or more Media Library files as a ZIP archive.
4
  *
5
+ * Created for support topic "Att Categories menu returns 404 error"
6
+ * opened on 11/17/2014 by "activecontent".
7
+ * https://wordpress.org/support/topic/att-categories-menu-returns-404-error
8
  *
9
  * @package MLA Download ZIP Example
10
+ * @version 1.01
11
  */
12
 
13
  /*
14
  Plugin Name: MLA Download ZIP Example
15
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
16
+ Description: Creates a Bulk Action that downloads one or more Media Library files as a ZIP archive
17
  Author: David Lingren
18
+ Version: 1.01
19
  Author URI: http://fairtradejudaica.org/our-story/staff/
20
 
21
+ Copyright 2014, 2018 David Lingren
22
 
23
  This program is free software; you can redistribute it and/or modify
24
  it under the terms of the GNU General Public License as published by
156
  return;
157
  }
158
 
159
+ $download_args = array( 'page' => MLACore::ADMIN_PAGE_SLUG, 'mla_download_file' => urlencode( $archive_name ), 'mla_download_type' => 'application/zip', 'mla_download_disposition' => 'delete' );
160
 
161
+ wp_redirect( add_query_arg( $download_args, wp_nonce_url( 'upload.php', MLACore::MLA_ADMIN_NONCE_ACTION, MLACore::MLA_ADMIN_NONCE_NAME ) ), 302 );
162
  exit;
163
  } // admin_init_action
164
 
examples/plugins/smart-media-categories/public/class-smart-media-categories.php CHANGED
@@ -25,7 +25,7 @@ class Smart_Media_Categories {
25
  *
26
  * @var string
27
  */
28
- const VERSION = '1.1.1';
29
 
30
  /**
31
  * Unique identifier for your plugin.
25
  *
26
  * @var string
27
  */
28
+ const VERSION = '1.1.2';
29
 
30
  /**
31
  * Unique identifier for your plugin.
examples/plugins/woofixit.php CHANGED
@@ -72,7 +72,7 @@
72
  * https://wordpress.org/support/topic/regenerate-bulk-alt-text-with-product-name-product-category-keyword/
73
  *
74
  * @package WooCommerce Fixit
75
- * @version 2.01
76
  */
77
 
78
  /*
@@ -80,7 +80,7 @@ Plugin Name: WooCommerce Fixit
80
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
81
  Description: Adds "product:" and "product_terms:" custom substitution prefixes and adds a Tools/Woo Fixit submenu with buttons to perform a variety of MLA/WooCommerce repair and enhancement operations.
82
  Author: David Lingren
83
- Version: 2.01
84
  Author URI: http://fairtradejudaica.org/our-story/staff/
85
 
86
  Copyright 2014-2017 David Lingren
@@ -113,7 +113,7 @@ class Woo_Fixit {
113
  *
114
  * @var string
115
  */
116
- const CURRENT_VERSION = '2.01';
117
 
118
  /**
119
  * Slug prefix for registering and enqueueing submenu pages, style sheets and scripts
@@ -1979,7 +1979,7 @@ VALUES ( {$attachment},'_wp_attachment_image_alt','{$text}' )";
1979
 
1980
  if ( 'clear' != $action ) {
1981
  // Get the array of the Product Category term objects for comparison
1982
- $product_categories = get_terms( 'product_cat', array( 'orderby' => 'none', 'hide_empty' => 0, 'fields' => 'id=>name' ) );
1983
  } else {
1984
  $product_categories = array();
1985
  }
@@ -2139,7 +2139,7 @@ VALUES ( {$attachment},'_wp_attachment_image_alt','{$text}' )";
2139
  global $wpdb;
2140
 
2141
  // Get the array of the Att. Category term objects for comparison
2142
- $attachment_categories = get_terms( 'attachment_category', array( 'orderby' => 'none', 'hide_empty' => 0, 'fields' => 'id=>name' ) );
2143
 
2144
  $update_count = 0;
2145
  $terms_added = 0;
@@ -2191,7 +2191,7 @@ VALUES ( {$attachment},'_wp_attachment_image_alt','{$text}' )";
2191
  global $wpdb;
2192
 
2193
  // Get the array of the Att. Category term objects for comparison
2194
- $attachment_categories = get_terms( 'attachment_category', array( 'orderby' => 'none', 'hide_empty' => 0, 'fields' => 'id=>name' ) );
2195
 
2196
  $update_count = 0;
2197
  $terms_added = 0;
@@ -2245,7 +2245,7 @@ VALUES ( {$attachment},'_wp_attachment_image_alt','{$text}' )";
2245
  global $wpdb;
2246
 
2247
  // Get the array of the Att. Category term objects for comparison
2248
- $attachment_categories = get_terms( 'attachment_category', array( 'orderby' => 'none', 'hide_empty' => 0, 'fields' => 'id=>name' ) );
2249
 
2250
  $update_count = 0;
2251
  $delete_count = 0;
72
  * https://wordpress.org/support/topic/regenerate-bulk-alt-text-with-product-name-product-category-keyword/
73
  *
74
  * @package WooCommerce Fixit
75
+ * @version 2.02
76
  */
77
 
78
  /*
80
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
81
  Description: Adds "product:" and "product_terms:" custom substitution prefixes and adds a Tools/Woo Fixit submenu with buttons to perform a variety of MLA/WooCommerce repair and enhancement operations.
82
  Author: David Lingren
83
+ Version: 2.02
84
  Author URI: http://fairtradejudaica.org/our-story/staff/
85
 
86
  Copyright 2014-2017 David Lingren
113
  *
114
  * @var string
115
  */
116
+ const CURRENT_VERSION = '2.02';
117
 
118
  /**
119
  * Slug prefix for registering and enqueueing submenu pages, style sheets and scripts
1979
 
1980
  if ( 'clear' != $action ) {
1981
  // Get the array of the Product Category term objects for comparison
1982
+ $product_categories = MLAQuery::mla_wp_get_terms( 'product_cat', array( 'orderby' => 'none', 'hide_empty' => 0, 'fields' => 'id=>name' ) );
1983
  } else {
1984
  $product_categories = array();
1985
  }
2139
  global $wpdb;
2140
 
2141
  // Get the array of the Att. Category term objects for comparison
2142
+ $attachment_categories = MLAQuery::mla_wp_get_terms( 'attachment_category', array( 'orderby' => 'none', 'hide_empty' => 0, 'fields' => 'id=>name' ) );
2143
 
2144
  $update_count = 0;
2145
  $terms_added = 0;
2191
  global $wpdb;
2192
 
2193
  // Get the array of the Att. Category term objects for comparison
2194
+ $attachment_categories = MLAQuery::mla_wp_get_terms( 'attachment_category', array( 'orderby' => 'none', 'hide_empty' => 0, 'fields' => 'id=>name' ) );
2195
 
2196
  $update_count = 0;
2197
  $terms_added = 0;
2245
  global $wpdb;
2246
 
2247
  // Get the array of the Att. Category term objects for comparison
2248
+ $attachment_categories = MLAQuery::mla_wp_get_terms( 'attachment_category', array( 'orderby' => 'none', 'hide_empty' => 0, 'fields' => 'id=>name' ) );
2249
 
2250
  $update_count = 0;
2251
  $delete_count = 0;
examples/themes/twentytwelve-mla/content-jkeast-dropdown-simple.php CHANGED
@@ -74,7 +74,7 @@ function custom_taxonomy_dropdown( $taxonomy, $orderby = 'date', $order = 'DESC'
74
  'order' => $order,
75
  'exclude' => '120'
76
  );
77
- $terms = get_terms( $taxonomy, $args );
78
  $name = ( $name ) ? $name : $taxonomy;
79
  $y=0;
80
  if ( $terms ) {
@@ -96,7 +96,7 @@ function custom_taxonomy_dropdown( $taxonomy, $orderby = 'date', $order = 'DESC'
96
  custom_taxonomy_dropdown( 'attachment_category', 'date', 'ASC', '5', 'attachment_category', 'Select All');
97
  ?>
98
  <?php
99
- $terms = get_terms("attachment_category", "exclude=120");
100
 
101
  if ( !empty( $terms ) && !is_wp_error( $terms ) ){
102
  $xyz=0;
74
  'order' => $order,
75
  'exclude' => '120'
76
  );
77
+ $terms = MLAQuery::mla_wp_get_terms( $taxonomy, $args );
78
  $name = ( $name ) ? $name : $taxonomy;
79
  $y=0;
80
  if ( $terms ) {
96
  custom_taxonomy_dropdown( 'attachment_category', 'date', 'ASC', '5', 'attachment_category', 'Select All');
97
  ?>
98
  <?php
99
+ $terms = MLAQuery::mla_wp_get_terms("attachment_category", "exclude=120");
100
 
101
  if ( !empty( $terms ) && !is_wp_error( $terms ) ){
102
  $xyz=0;
examples/themes/twentytwelve-mla/content-jkeast-dropdown.php CHANGED
@@ -73,7 +73,7 @@ function custom_taxonomy_dropdown( $taxonomy, $orderby = 'date', $order = 'DESC'
73
  'order' => $order,
74
  'exclude' => '120'
75
  );
76
- $terms = get_terms( $taxonomy, $args );
77
  $name = ( $name ) ? $name : $taxonomy;
78
  $y=0;
79
  if ( $terms ) {
@@ -114,7 +114,7 @@ if ( $pos ) {
114
  custom_taxonomy_dropdown( 'attachment_category', 'date', 'ASC', '5', 'attachment_category', 'Select All', NULL, $selected );
115
  ?>
116
  <?php
117
- $terms = get_terms("attachment_category", "exclude=120");
118
 
119
  if ( !empty( $terms ) && !is_wp_error( $terms ) ){
120
  $xyz=0;
73
  'order' => $order,
74
  'exclude' => '120'
75
  );
76
+ $terms = MLAQuery::mla_wp_get_terms( $taxonomy, $args );
77
  $name = ( $name ) ? $name : $taxonomy;
78
  $y=0;
79
  if ( $terms ) {
114
  custom_taxonomy_dropdown( 'attachment_category', 'date', 'ASC', '5', 'attachment_category', 'Select All', NULL, $selected );
115
  ?>
116
  <?php
117
+ $terms = MLAQuery::mla_wp_get_terms("attachment_category", "exclude=120");
118
 
119
  if ( !empty( $terms ) && !is_wp_error( $terms ) ){
120
  $xyz=0;
examples/themes/twentytwelve-mla/functions.php CHANGED
@@ -279,7 +279,7 @@ function mla_taxonomy_terms_list( $attr = NULL ) {
279
  'taxonomy' => 'attachment_tag',
280
  ), $attr ) );
281
 
282
- $terms = get_terms( $taxonomy );
283
  if ( empty( $terms ) ) {
284
  return __( 'There are no non-empty taxonomy values', 'mla-child-theme' );
285
  }
279
  'taxonomy' => 'attachment_tag',
280
  ), $attr ) );
281
 
282
+ $terms = MLAQuery::mla_wp_get_terms( $taxonomy );
283
  if ( empty( $terms ) ) {
284
  return __( 'There are no non-empty taxonomy values', 'mla-child-theme' );
285
  }
examples/themes/twentytwelve-mla/style.css CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @package Media Library Assistant
7
  * @subpackage MLA_Child_Theme
8
- * @version 1.01
9
  * @since MLA 1.80
10
  */
11
 
@@ -16,7 +16,7 @@ Description: Enhancements to the baseline theme, generated in response to MLA su
16
  Author: David Lingren
17
  Author URI: http://fairtradejudaica.org/our-story/staff/
18
  Template: twentytwelve
19
- Version: 1.01
20
  Tags: attachment, attachments, documents, gallery, image, images, media, library, media library, media-tags, media tags, tags, media categories, categories, IPTC, EXIF, GPS, PDF, meta, metadata, photo, photos, photograph, photographs, photoblog, photo albums, lightroom, photoshop, MIME, mime-type, icon, upload, file extensions
21
  Text Domain: mla-child-theme
22
  Domain Path: /languages
5
  *
6
  * @package Media Library Assistant
7
  * @subpackage MLA_Child_Theme
8
+ * @version 1.02
9
  * @since MLA 1.80
10
  */
11
 
16
  Author: David Lingren
17
  Author URI: http://fairtradejudaica.org/our-story/staff/
18
  Template: twentytwelve
19
+ Version: 1.02
20
  Tags: attachment, attachments, documents, gallery, image, images, media, library, media library, media-tags, media tags, tags, media categories, categories, IPTC, EXIF, GPS, PDF, meta, metadata, photo, photos, photograph, photographs, photoblog, photo albums, lightroom, photoshop, MIME, mime-type, icon, upload, file extensions
21
  Text Domain: mla-child-theme
22
  Domain Path: /languages
includes/class-mla-core.php CHANGED
@@ -21,7 +21,7 @@ class MLACore {
21
  *
22
  * @var string
23
  */
24
- const CURRENT_MLA_VERSION = '2.65';
25
 
26
  /**
27
  * Slug for registering and enqueueing plugin style sheets (moved from class-mla-main.php)
@@ -104,6 +104,15 @@ class MLACore {
104
  */
105
  const MLA_DEBUG_CATEGORY_REST = 0x00000020;
106
 
 
 
 
 
 
 
 
 
 
107
  /**
108
  * Slug for adding plugin submenu
109
  *
21
  *
22
  * @var string
23
  */
24
+ const CURRENT_MLA_VERSION = '2.70';
25
 
26
  /**
27
  * Slug for registering and enqueueing plugin style sheets (moved from class-mla-main.php)
104
  */
105
  const MLA_DEBUG_CATEGORY_REST = 0x00000020;
106
 
107
+ /**
108
+ * Constant to log where-used activity
109
+ *
110
+ * @since 2.41
111
+ *
112
+ * @var integer
113
+ */
114
+ const MLA_DEBUG_CATEGORY_WHERE_USED = 0x00000040;
115
+
116
  /**
117
  * Slug for adding plugin submenu
118
  *
includes/class-mla-data-query.php CHANGED
@@ -341,6 +341,27 @@ class MLAQuery {
341
  */
342
  private static $mla_list_table_items = NULL;
343
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
  /**
345
  * Get the total number of attachment posts
346
  *
@@ -1039,7 +1060,7 @@ class MLAQuery {
1039
  if ( $clean_request['mla_filter_term'] != 0 ) {
1040
  $tax_filter = MLACore::mla_taxonomy_support('', 'filter');
1041
  if ( $clean_request['mla_filter_term'] == -1 ) {
1042
- $term_list = get_terms( $tax_filter, array(
1043
  'fields' => 'ids',
1044
  'hide_empty' => false
1045
  ) );
@@ -1395,7 +1416,7 @@ class MLAQuery {
1395
  }
1396
 
1397
  // WordPress encodes special characters, e.g., "&" as HTML entities in term names
1398
- $the_terms = get_terms( $terms_search_parameters['taxonomies'], array( 'name__like' => _wp_specialchars( $phrase ), 'fields' => 'all', 'hide_empty' => false ) );
1399
 
1400
  if ( $is_wildcard_search ) {
1401
  remove_filter( 'terms_clauses', 'MLAQuery::mla_query_terms_clauses_filter', 0x7FFFFFFF );
341
  */
342
  private static $mla_list_table_items = NULL;
343
 
344
+ /**
345
+ * Retrieve the terms in a given taxonomy, adjusting for changes in WP 4.5.0
346
+ *
347
+ * @since 2.66
348
+ *
349
+ * @param mixed single taxonomy (string) or taxonomy list (array of strings)
350
+ * @param array arguments for taxonomy terms query
351
+ *
352
+ * @return array|int|WP_Error) List of WP_Term instances and their children. Will return WP_Error, if any of $taxonomies do not exist.
353
+ */
354
+ public static function mla_wp_get_terms( $taxonomy, $args ) {
355
+ if ( version_compare( get_bloginfo('version'), '4.5.0', '>=' ) ) {
356
+ $args['taxonomy'] = $taxonomy;
357
+ $terms = get_terms( $args );
358
+ } else {
359
+ $terms = get_terms( $taxonomy, $args );
360
+ }
361
+
362
+ return $terms;
363
+ }
364
+
365
  /**
366
  * Get the total number of attachment posts
367
  *
1060
  if ( $clean_request['mla_filter_term'] != 0 ) {
1061
  $tax_filter = MLACore::mla_taxonomy_support('', 'filter');
1062
  if ( $clean_request['mla_filter_term'] == -1 ) {
1063
+ $term_list = MLAQuery::mla_wp_get_terms( $tax_filter, array(
1064
  'fields' => 'ids',
1065
  'hide_empty' => false
1066
  ) );
1416
  }
1417
 
1418
  // WordPress encodes special characters, e.g., "&" as HTML entities in term names
1419
+ $the_terms = MLAQuery::mla_wp_get_terms( $terms_search_parameters['taxonomies'], array( 'name__like' => _wp_specialchars( $phrase ), 'fields' => 'all', 'hide_empty' => false ) );
1420
 
1421
  if ( $is_wildcard_search ) {
1422
  remove_filter( 'terms_clauses', 'MLAQuery::mla_query_terms_clauses_filter', 0x7FFFFFFF );
includes/class-mla-data-references.php CHANGED
@@ -89,9 +89,7 @@ class MLAReferences {
89
  return $references;
90
  }
91
 
92
- /*
93
- * Fill in Parent data
94
- */
95
  $parent_data = MLAQuery::mla_fetch_attachment_parent_data( $parent );
96
  if ( isset( $parent_data['parent_type'] ) ) {
97
  $references['parent_type'] = $parent_data['parent_type'];
@@ -135,23 +133,17 @@ class MLAReferences {
135
 
136
  $references['files'][ $references['base_file'] ] = $base_reference;
137
 
138
- /*
139
- * Process the where-used settings option
140
- */
141
  if ('checked' == MLACore::mla_get_option( MLACoreOptions::MLA_EXCLUDE_REVISIONS ) ) {
142
  $exclude_revisions = "(post_type <> 'revision') AND ";
143
  } else {
144
  $exclude_revisions = '';
145
  }
146
 
147
- /*
148
- * Accumulate reference test types, e.g., 0 = no tests, 4 = all tests
149
- */
150
  $reference_tests = 0;
151
 
152
- /*
153
- * Look for the "Featured Image(s)", if enabled
154
- */
155
  if ( MLACore::$process_featured_in ) {
156
  $reference_tests++;
157
  $features = $wpdb->get_results(
@@ -184,9 +176,7 @@ class MLAReferences {
184
  }
185
  } // $process_featured_in
186
 
187
- /*
188
- * Look for item(s) inserted in post_content
189
- */
190
  $references['inserted_option'] = $inserted_in_option;
191
  if ( MLACore::$process_inserted_in ) {
192
  $reference_tests++;
@@ -220,6 +210,9 @@ class MLAReferences {
220
  $query[] = ')';
221
  $query = join(' ', $query);
222
 
 
 
 
223
  $inserts = $wpdb->get_results(
224
  $wpdb->prepare( $query, $query_parameters )
225
  );
@@ -247,6 +240,8 @@ class MLAReferences {
247
  $like = like_escape( $file );
248
  }
249
 
 
 
250
  $inserts = $wpdb->get_results(
251
  $wpdb->prepare(
252
  "SELECT ID, post_type, post_status, post_title FROM {$wpdb->posts}
@@ -268,9 +263,7 @@ class MLAReferences {
268
  } // process intermediate sizes
269
  } // $process_inserted_in
270
 
271
- /*
272
- * Look for [mla_gallery] references
273
- */
274
  if ( MLACore::$process_mla_gallery_in ) {
275
  $reference_tests++;
276
  if ( self::_build_mla_galleries( MLACoreOptions::MLA_MLA_GALLERY_IN_TUNING, self::$mla_galleries, '[mla_gallery', $exclude_revisions ) ) {
@@ -290,9 +283,7 @@ class MLAReferences {
290
  }
291
  } // $process_mla_gallery_in
292
 
293
- /*
294
- * Look for [gallery] references
295
- */
296
  if ( MLACore::$process_gallery_in ) {
297
  $reference_tests++;
298
  if ( self::_build_mla_galleries( MLACoreOptions::MLA_GALLERY_IN_TUNING, self::$galleries, '[gallery', $exclude_revisions ) ) {
@@ -312,9 +303,7 @@ class MLAReferences {
312
  }
313
  } // $process_gallery_in
314
 
315
- /*
316
- * Evaluate and summarize reference tests
317
- */
318
  $errors = '';
319
  if ( 0 == $reference_tests ) {
320
  $references['tested_reference'] = false;
@@ -342,6 +331,9 @@ class MLAReferences {
342
 
343
  $save_id = $ID;
344
  $references = apply_filters( 'mla_fetch_attachment_references', $references, $ID, $parent );
 
 
 
345
  return $references;
346
  }
347
 
89
  return $references;
90
  }
91
 
92
+ // Fill in Parent data
 
 
93
  $parent_data = MLAQuery::mla_fetch_attachment_parent_data( $parent );
94
  if ( isset( $parent_data['parent_type'] ) ) {
95
  $references['parent_type'] = $parent_data['parent_type'];
133
 
134
  $references['files'][ $references['base_file'] ] = $base_reference;
135
 
136
+ // Process the where-used settings option
 
 
137
  if ('checked' == MLACore::mla_get_option( MLACoreOptions::MLA_EXCLUDE_REVISIONS ) ) {
138
  $exclude_revisions = "(post_type <> 'revision') AND ";
139
  } else {
140
  $exclude_revisions = '';
141
  }
142
 
143
+ // Accumulate reference test types, e.g., 0 = no tests, 4 = all tests
 
 
144
  $reference_tests = 0;
145
 
146
+ // Look for the "Featured Image(s)", if enabled
 
 
147
  if ( MLACore::$process_featured_in ) {
148
  $reference_tests++;
149
  $features = $wpdb->get_results(
176
  }
177
  } // $process_featured_in
178
 
179
+ // Look for item(s) inserted in post_content
 
 
180
  $references['inserted_option'] = $inserted_in_option;
181
  if ( MLACore::$process_inserted_in ) {
182
  $reference_tests++;
210
  $query[] = ')';
211
  $query = join(' ', $query);
212
 
213
+ MLACore::mla_debug_add( __LINE__ . " MLAReferences::mla_fetch_attachment_references_handler( {$ID}, {$parent}, {$add_references} ) inserts base query = " . var_export( $query, true ), MLACore::MLA_DEBUG_CATEGORY_WHERE_USED );
214
+ MLACore::mla_debug_add( __LINE__ . " MLAReferences::mla_fetch_attachment_references_handler( {$ID}, {$parent}, {$add_references} ) inserts base parms = " . var_export( $query_parameters, true ), MLACore::MLA_DEBUG_CATEGORY_WHERE_USED );
215
+
216
  $inserts = $wpdb->get_results(
217
  $wpdb->prepare( $query, $query_parameters )
218
  );
240
  $like = like_escape( $file );
241
  }
242
 
243
+ MLACore::mla_debug_add( __LINE__ . " MLAReferences::mla_fetch_attachment_references_handler( {$ID}, {$file}, {$like} ) inserts enabled", MLACore::MLA_DEBUG_CATEGORY_WHERE_USED );
244
+
245
  $inserts = $wpdb->get_results(
246
  $wpdb->prepare(
247
  "SELECT ID, post_type, post_status, post_title FROM {$wpdb->posts}
263
  } // process intermediate sizes
264
  } // $process_inserted_in
265
 
266
+ // Look for [mla_gallery] references
 
 
267
  if ( MLACore::$process_mla_gallery_in ) {
268
  $reference_tests++;
269
  if ( self::_build_mla_galleries( MLACoreOptions::MLA_MLA_GALLERY_IN_TUNING, self::$mla_galleries, '[mla_gallery', $exclude_revisions ) ) {
283
  }
284
  } // $process_mla_gallery_in
285
 
286
+ // Look for [gallery] references
 
 
287
  if ( MLACore::$process_gallery_in ) {
288
  $reference_tests++;
289
  if ( self::_build_mla_galleries( MLACoreOptions::MLA_GALLERY_IN_TUNING, self::$galleries, '[gallery', $exclude_revisions ) ) {
303
  }
304
  } // $process_gallery_in
305
 
306
+ // Evaluate and summarize reference tests
 
 
307
  $errors = '';
308
  if ( 0 == $reference_tests ) {
309
  $references['tested_reference'] = false;
331
 
332
  $save_id = $ID;
333
  $references = apply_filters( 'mla_fetch_attachment_references', $references, $ID, $parent );
334
+
335
+ MLACore::mla_debug_add( __LINE__ . " MLAReferences::mla_fetch_attachment_references_handler( {$ID}, {$parent}, {$add_references} ) references = " . var_export( $references, true ), MLACore::MLA_DEBUG_CATEGORY_WHERE_USED );
336
+
337
  return $references;
338
  }
339
 
includes/class-mla-data.php CHANGED
@@ -3961,7 +3961,7 @@ class MLAData {
3961
  continue;
3962
  }
3963
 
3964
- $_term = get_terms( $taxonomy, array(
3965
  'name' => $tag,
3966
  'fields' => 'ids',
3967
  'hide_empty' => false,
3961
  continue;
3962
  }
3963
 
3964
+ $_term = MLAQuery::mla_wp_get_terms( $taxonomy, array(
3965
  'name' => $tag,
3966
  'fields' => 'ids',
3967
  'hide_empty' => false,
includes/class-mla-main.php CHANGED
@@ -754,13 +754,27 @@ class MLA {
754
  * @return void echos file contents and calls exit();
755
  */
756
  private static function _process_mla_download_file() {
 
757
  if ( isset( $_REQUEST['mla_download_file'] ) && isset( $_REQUEST['mla_download_type'] ) ) {
758
  if( ini_get( 'zlib.output_compression' ) ) {
759
  ini_set( 'zlib.output_compression', 'Off' );
760
  }
761
 
762
  $file_name = stripslashes( $_REQUEST['mla_download_file'] );
 
 
 
 
 
 
 
 
 
 
 
 
763
 
 
764
  header('Pragma: public'); // required
765
  header('Expires: 0'); // no cache
766
  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
@@ -777,23 +791,20 @@ class MLA {
777
  if ( isset( $_REQUEST['mla_download_disposition'] ) && 'delete' == $_REQUEST['mla_download_disposition'] ) {
778
  @unlink( $file_name );
779
  }
780
-
781
- exit();
782
  } else {
783
- $message = __( 'ERROR', 'media-library-assistant' ) . ': ' . 'download argument(s) not set.';
 
 
 
 
 
 
 
 
 
 
784
  }
785
-
786
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
787
- echo '<html xmlns="http://www.w3.org/1999/xhtml">';
788
- echo '<head>';
789
- echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
790
- echo '<title>Download Error</title>';
791
- echo '</head>';
792
- echo '';
793
- echo '<body>';
794
- echo $message;
795
- echo '</body>';
796
- echo '</html> ';
797
  exit();
798
  }
799
 
754
  * @return void echos file contents and calls exit();
755
  */
756
  private static function _process_mla_download_file() {
757
+ $message = '';
758
  if ( isset( $_REQUEST['mla_download_file'] ) && isset( $_REQUEST['mla_download_type'] ) ) {
759
  if( ini_get( 'zlib.output_compression' ) ) {
760
  ini_set( 'zlib.output_compression', 'Off' );
761
  }
762
 
763
  $file_name = stripslashes( $_REQUEST['mla_download_file'] );
764
+ $match_name = str_replace( '\\', '/', $file_name );
765
+ $upload_dir = wp_upload_dir();
766
+ $allowed_path = str_replace( '\\', '/', $upload_dir['basedir'] );
767
+
768
+ if ( 0 !== strpos( $match_name, $allowed_path ) ) {
769
+ $message = __( 'ERROR', 'media-library-assistant' ) . ': ' . 'download path out of bounds.';
770
+ } elseif ( false !== strpos( $match_name, '..' ) ) {
771
+ $message = __( 'ERROR', 'media-library-assistant' ) . ': ' . 'download path invalid.';
772
+ }
773
+ } else {
774
+ $message = __( 'ERROR', 'media-library-assistant' ) . ': ' . 'download argument(s) not set.';
775
+ }
776
 
777
+ if ( empty( $message ) ) {
778
  header('Pragma: public'); // required
779
  header('Expires: 0'); // no cache
780
  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
791
  if ( isset( $_REQUEST['mla_download_disposition'] ) && 'delete' == $_REQUEST['mla_download_disposition'] ) {
792
  @unlink( $file_name );
793
  }
 
 
794
  } else {
795
+ echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
796
+ echo '<html xmlns="http://www.w3.org/1999/xhtml">';
797
+ echo '<head>';
798
+ echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
799
+ echo '<title>Download Error</title>';
800
+ echo '</head>';
801
+ echo '';
802
+ echo '<body>';
803
+ echo $message;
804
+ echo '</body>';
805
+ echo '</html> ';
806
  }
807
+
 
 
 
 
 
 
 
 
 
 
 
808
  exit();
809
  }
810
 
includes/class-mla-media-modal.php CHANGED
@@ -76,31 +76,56 @@ class MLAModal {
76
  add_filter( 'media_view_settings', 'MLAModal::mla_media_view_settings_filter', 10, 2 );
77
  add_filter( 'media_view_strings', 'MLAModal::mla_media_view_strings_filter', 10, 2 );
78
  add_action( 'wp_enqueue_media', 'MLAModal::mla_wp_enqueue_media_action', 10, 0 );
 
79
  add_action( 'print_media_templates', 'MLAModal::mla_print_media_templates_action', 10, 0 );
80
  add_action( 'admin_init', 'MLAModal::mla_admin_init_action' );
81
  } // Media Modal support enabled
82
  }
83
 
84
  /**
85
- * Display a monthly dropdown for filtering items
86
  *
87
- * Adapted from /wp-admin/includes/class-wp-list-table.php function months_dropdown()
88
  *
89
- * @since 1.20
90
  *
91
- * @param string post_type, e.g., 'attachment'
 
 
92
  *
93
- * @return array ( value => label ) pairs
94
  */
95
- private static function _months_dropdown( $post_type ) {
96
- global $wpdb, $wp_locale;
 
97
 
98
- $months = $wpdb->get_results( $wpdb->prepare( "
 
 
 
 
99
  SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
100
  FROM $wpdb->posts
101
  WHERE post_type = %s
102
  ORDER BY post_date DESC
103
- ", $post_type ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
 
105
  $month_count = count( $months );
106
  $month_array = array( '0' => __( 'Show all dates', 'media-library-assistant' ) );
@@ -121,7 +146,7 @@ class MLAModal {
121
  sprintf( __( '%1$s %2$d', 'media-library-assistant' ), $wp_locale->get_month( $month ), $year );
122
  }
123
 
124
- return apply_filters( 'mla_media_modal_months_dropdown', $month_array, $post_type );
125
  }
126
 
127
  /**
@@ -134,12 +159,10 @@ class MLAModal {
134
  * @return array ( 'class' => $class_array, 'value' => $value_array, 'text' => $text_array )
135
  */
136
  public static function mla_terms_options( $markup ) {
137
- //error_log( __LINE__ . ' mla_terms_options markup = ' . var_export( $markup, true ), 0 );
138
  $match_count = preg_match_all( "#\<option(( class=\"([^\"]+)\" )|( ))value=((\'([^\']+)\')|(\"([^\"]+)\"))([^\>]*)\>([^\<]*)\<.*#", $markup, $matches );
139
  if ( ( $match_count == false ) || ( $match_count == 0 ) ) {
140
  return array( 'class' => array( '' ), 'value' => array( '0' ), 'text' => array( 'Show all terms' ) );
141
  }
142
- //error_log( __LINE__ . ' mla_terms_options matches = ' . var_export( $matches, true ), 0 );
143
 
144
  $class_array = array();
145
  $value_array = array();
76
  add_filter( 'media_view_settings', 'MLAModal::mla_media_view_settings_filter', 10, 2 );
77
  add_filter( 'media_view_strings', 'MLAModal::mla_media_view_strings_filter', 10, 2 );
78
  add_action( 'wp_enqueue_media', 'MLAModal::mla_wp_enqueue_media_action', 10, 0 );
79
+ add_filter( 'media_library_months_with_files', 'MLAModal::mla_media_library_months_with_files_filter', 10, 1 );
80
  add_action( 'print_media_templates', 'MLAModal::mla_print_media_templates_action', 10, 0 );
81
  add_action( 'admin_init', 'MLAModal::mla_admin_init_action' );
82
  } // Media Modal support enabled
83
  }
84
 
85
  /**
86
+ * Allows overriding the list of months displayed in the media library.
87
  *
88
+ * Called from /wp-includes/media.php function wp_enqueue_media()
89
  *
90
+ * @since 2.66
91
  *
92
+ * @param array|null An array of objects with `month` and `year`
93
+ * properties, or `null` (or any other non-array value)
94
+ * for default behavior.
95
  *
96
+ * @return array objects with `month` and `year` properties.
97
  */
98
+ public static function mla_media_library_months_with_files_filter( $months = NULL ) {
99
+ global $wpdb;
100
+ static $library_months_with_files = NULL;
101
 
102
+ if ( is_array( $library_months_with_files ) ) {
103
+ return $library_months_with_files;
104
+ }
105
+
106
+ $library_months_with_files = $wpdb->get_results( $wpdb->prepare( "
107
  SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
108
  FROM $wpdb->posts
109
  WHERE post_type = %s
110
  ORDER BY post_date DESC
111
+ ", 'attachment' ) );
112
+
113
+ return $library_months_with_files;
114
+ }
115
+
116
+ /**
117
+ * Display a monthly dropdown for filtering items
118
+ *
119
+ * Adapted from /wp-admin/includes/class-wp-list-table.php function months_dropdown()
120
+ *
121
+ * @since 1.20
122
+ *
123
+ * @return array ( value => label ) pairs
124
+ */
125
+ private static function _months_dropdown() {
126
+ global $wp_locale;
127
+
128
+ $months = self::mla_media_library_months_with_files_filter();
129
 
130
  $month_count = count( $months );
131
  $month_array = array( '0' => __( 'Show all dates', 'media-library-assistant' ) );
146
  sprintf( __( '%1$s %2$d', 'media-library-assistant' ), $wp_locale->get_month( $month ), $year );
147
  }
148
 
149
+ return apply_filters( 'mla_media_modal_months_dropdown', $month_array, 'attachment' );
150
  }
151
 
152
  /**
159
  * @return array ( 'class' => $class_array, 'value' => $value_array, 'text' => $text_array )
160
  */
161
  public static function mla_terms_options( $markup ) {
 
162
  $match_count = preg_match_all( "#\<option(( class=\"([^\"]+)\" )|( ))value=((\'([^\']+)\')|(\"([^\"]+)\"))([^\>]*)\>([^\<]*)\<.*#", $markup, $matches );
163
  if ( ( $match_count == false ) || ( $match_count == 0 ) ) {
164
  return array( 'class' => array( '' ), 'value' => array( '0' ), 'text' => array( 'Show all terms' ) );
165
  }
 
166
 
167
  $class_array = array();
168
  $value_array = array();
includes/class-mla-objects.php CHANGED
@@ -56,6 +56,7 @@ class MLAObjects {
56
  'hierarchical' => true,
57
  'labels' => $labels,
58
  'show_ui' => true,
 
59
  'query_var' => true,
60
  'rewrite' => true,
61
  'update_count_callback' => '_update_generic_term_count'
@@ -85,12 +86,13 @@ class MLAObjects {
85
  ) );
86
 
87
  $args = apply_filters( 'mla_attachment_tag_arguments', array(
88
- 'hierarchical' => false,
89
- 'labels' => $labels,
90
- 'show_ui' => true,
91
- 'query_var' => true,
92
- 'rewrite' => true,
93
- 'update_count_callback' => '_update_generic_term_count'
 
94
  ) );
95
 
96
  register_taxonomy( 'attachment_tag', $object_type, $args );
56
  'hierarchical' => true,
57
  'labels' => $labels,
58
  'show_ui' => true,
59
+ 'show_admin_column' => true,
60
  'query_var' => true,
61
  'rewrite' => true,
62
  'update_count_callback' => '_update_generic_term_count'
86
  ) );
87
 
88
  $args = apply_filters( 'mla_attachment_tag_arguments', array(
89
+ 'hierarchical' => false,
90
+ 'labels' => $labels,
91
+ 'show_ui' => true,
92
+ 'show_admin_column' => true,
93
+ 'query_var' => true,
94
+ 'rewrite' => true,
95
+ 'update_count_callback' => '_update_generic_term_count'
96
  ) );
97
 
98
  register_taxonomy( 'attachment_tag', $object_type, $args );
includes/class-mla-options.php CHANGED
@@ -1220,15 +1220,17 @@ return "MLAOptions::mla_custom_field_option_handler( $action, $key ) deprecated.
1220
  * @return integer term_id for the term name
1221
  */
1222
  private static function _get_term_id( $term_name, $term_parent, $taxonomy, &$post_terms ) {
1223
- static $term_cache = array();
1224
 
1225
  // WordPress encodes special characters, e.g., "&" as HTML entities in term names
1226
  $term_name = _wp_specialchars( $term_name );
1227
 
 
1228
  if ( isset( $term_cache[ $taxonomy ] ) && isset( $term_cache[ $taxonomy ][ $term_parent ] ) && isset( $term_cache[ $taxonomy ][ $term_parent ][ $term_name ] ) ) {
1229
  return $term_cache[ $taxonomy ][ $term_parent ][ $term_name ];
1230
  }
1231
 
 
1232
  if ( is_array( $post_terms ) ) {
1233
  $term_id = 0;
1234
  foreach( $post_terms as $post_term ) {
@@ -1243,8 +1245,9 @@ return "MLAOptions::mla_custom_field_option_handler( $action, $key ) deprecated.
1243
  }
1244
  }
1245
 
 
1246
  if ( 0 === $term_parent ) {
1247
- $post_term = get_term_by( 'name', $term_name, $taxonomy );
1248
  if ( false !== $post_term ) {
1249
  $term_cache[ $taxonomy ][ $term_parent ][ $term_name ] = $post_term->term_id;
1250
  return $post_term->term_id;
1220
  * @return integer term_id for the term name
1221
  */
1222
  private static function _get_term_id( $term_name, $term_parent, $taxonomy, &$post_terms ) {
1223
+ static $term_cache = array(); // [ $taxonomy ][ $term_parent ][ $term_name ]
1224
 
1225
  // WordPress encodes special characters, e.g., "&" as HTML entities in term names
1226
  $term_name = _wp_specialchars( $term_name );
1227
 
1228
+ // Is this term alerady in the cache?
1229
  if ( isset( $term_cache[ $taxonomy ] ) && isset( $term_cache[ $taxonomy ][ $term_parent ] ) && isset( $term_cache[ $taxonomy ][ $term_parent ][ $term_name ] ) ) {
1230
  return $term_cache[ $taxonomy ][ $term_parent ][ $term_name ];
1231
  }
1232
 
1233
+ // Is this term already assigned to the item?
1234
  if ( is_array( $post_terms ) ) {
1235
  $term_id = 0;
1236
  foreach( $post_terms as $post_term ) {
1245
  }
1246
  }
1247
 
1248
+ // Consider get_terms() or (just term_exists() for both cases)
1249
  if ( 0 === $term_parent ) {
1250
+ $post_term = get_term_by( 'name', $term_name, $taxonomy ); // Consider get_terms() for identical names
1251
  if ( false !== $post_term ) {
1252
  $term_cache[ $taxonomy ][ $term_parent ][ $term_name ] = $post_term->term_id;
1253
  return $post_term->term_id;
includes/class-mla-polylang-support.php CHANGED
@@ -803,7 +803,8 @@ class MLA_Polylang {
803
  */
804
  private static function _add_relevant_term( $term, $translations = NULL ) {
805
  global $polylang;
806
-
 
807
  if ( ! is_object( $term ) ) {
808
  return false;
809
  }
@@ -822,8 +823,19 @@ class MLA_Polylang {
822
  }
823
 
824
  if ( empty( $translations ) ) {
825
- $language_code = pll_default_language();
826
- $translations[ $language_code ] = (object) array( 'element_id' => $term->term_id );
 
 
 
 
 
 
 
 
 
 
 
827
  }
828
  }
829
 
@@ -1227,7 +1239,6 @@ class MLA_Polylang {
1227
 
1228
  self::$tax_input[ $language ][ $taxonomy ] = $term_changes;
1229
  } // language
1230
-
1231
  } // foreach taxonomy
1232
 
1233
  MLACore::mla_debug_add( __LINE__ . " MLA_Polylang::_build_tax_input( {$post_id} ) self::\$tax_input = " . var_export( self::$tax_input, true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
803
  */
804
  private static function _add_relevant_term( $term, $translations = NULL ) {
805
  global $polylang;
806
+ static $languages = NULL;
807
+
808
  if ( ! is_object( $term ) ) {
809
  return false;
810
  }
823
  }
824
 
825
  if ( empty( $translations ) ) {
826
+ if ( $polylang->model->is_translated_taxonomy( $term->taxonomy ) ) {
827
+ $language_code = pll_default_language();
828
+ $translations[ $language_code ] = (object) array( 'element_id' => $term->term_id );
829
+ } else {
830
+ // Handle untranslated taxonomies
831
+ if ( empty( $languages ) ) {
832
+ $languages = $polylang->model->get_languages_list( array( 'fields' => 'slug' ) );
833
+ }
834
+
835
+ foreach( $languages as $language_code ) {
836
+ $translations[ $language_code ] = (object) array( 'element_id' => $term->term_id );
837
+ }
838
+ }
839
  }
840
  }
841
 
1239
 
1240
  self::$tax_input[ $language ][ $taxonomy ] = $term_changes;
1241
  } // language
 
1242
  } // foreach taxonomy
1243
 
1244
  MLACore::mla_debug_add( __LINE__ . " MLA_Polylang::_build_tax_input( {$post_id} ) self::\$tax_input = " . var_export( self::$tax_input, true ), MLACore::MLA_DEBUG_CATEGORY_AJAX );
includes/class-mla-settings.php CHANGED
@@ -1069,7 +1069,7 @@ class MLASettings {
1069
  'Donate to FTJ' => __( 'Donate to FTJ', 'media-library-assistant' ),
1070
  'Donate' => __( 'Donate', 'media-library-assistant' ),
1071
  /* translators: 1: donation hyperlink */
1072
- 'This plugin was' => sprintf( __( 'This plugin was inspired by my work on the WordPress web site for our nonprofit, Fair Trade Judaica. If you find the Media Library Assistant plugin useful and would like to support a great cause, consider a %1$s to our work. Thank you!', 'media-library-assistant' ), '<a href="http://fairtradejudaica.org/make-a-difference/donate/" title="' . __( 'Donate to FTJ', 'media-library-assistant' ) . '" target="_blank" style="font-weight:bold">' . __( 'tax-deductible donation', 'media-library-assistant' ) . '</a>' ),
1073
  'shortcode_list' => '',
1074
  'form_url' => admin_url( 'options-general.php' ) . '?page=mla-settings-menu-general&mla_tab=general',
1075
  'options_list' => '',
1069
  'Donate to FTJ' => __( 'Donate to FTJ', 'media-library-assistant' ),
1070
  'Donate' => __( 'Donate', 'media-library-assistant' ),
1071
  /* translators: 1: donation hyperlink */
1072
+ 'This plugin was' => sprintf( __( 'This plugin was inspired by my work on the WordPress web site for our nonprofit, Fair Trade Judaica. If you find the Media Library Assistant plugin useful and would like to support a great cause, consider a %1$s to our work. Thank you!', 'media-library-assistant' ), '<a href="http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/" title="' . __( 'Donate to FTJ', 'media-library-assistant' ) . '" target="_blank" style="font-weight:bold">' . __( 'tax-deductible donation', 'media-library-assistant' ) . '</a>' ),
1073
  'shortcode_list' => '',
1074
  'form_url' => admin_url( 'options-general.php' ) . '?page=mla-settings-menu-general&mla_tab=general',
1075
  'options_list' => '',
includes/class-mla-shortcode-support.php CHANGED
@@ -4596,7 +4596,7 @@ class MLAShortcode_Support {
4596
  }
4597
 
4598
  if ( isset( $tax_query_element['terms'] ) && is_array( $tax_query_element['terms'] ) && in_array( 'no.terms.assigned', $tax_query_element['terms'] ) ) {
4599
- $tax_query[ $tax_query_key ]['terms'] = get_terms( $tax_query_taxonomy, array(
4600
  'fields' => 'ids',
4601
  'hide_empty' => false
4602
  ) );
@@ -4681,7 +4681,7 @@ class MLAShortcode_Support {
4681
  }
4682
 
4683
  if ( 'no.terms.assigned' === $value ) {
4684
- $term_list = get_terms( $key, array(
4685
  'fields' => 'ids',
4686
  'hide_empty' => false
4687
  ) );
4596
  }
4597
 
4598
  if ( isset( $tax_query_element['terms'] ) && is_array( $tax_query_element['terms'] ) && in_array( 'no.terms.assigned', $tax_query_element['terms'] ) ) {
4599
+ $tax_query[ $tax_query_key ]['terms'] = MLAQuery::mla_wp_get_terms( $tax_query_taxonomy, array(
4600
  'fields' => 'ids',
4601
  'hide_empty' => false
4602
  ) );
4681
  }
4682
 
4683
  if ( 'no.terms.assigned' === $value ) {
4684
+ $term_list = MLAQuery::mla_wp_get_terms( $key, array(
4685
  'fields' => 'ids',
4686
  'hide_empty' => false
4687
  ) );
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 2.65
10
  */
11
 
12
  /*
@@ -16,7 +16,7 @@ Description: Enhances the Media Library; powerful [mla_gallery] [mla_tag_cloud]
16
  Author: David Lingren, Fair Trade Judaica
17
  Text Domain: media-library-assistant
18
  Domain Path: /languages
19
- Version: 2.65
20
  Author URI: http://fairtradejudaica.org/our-story/staff/
21
 
22
  Copyright 2011-2017 David Lingren
6
  * will the rest of the plugin be loaded and run.
7
  *
8
  * @package Media Library Assistant
9
+ * @version 2.70
10
  */
11
 
12
  /*
16
  Author: David Lingren, Fair Trade Judaica
17
  Text Domain: media-library-assistant
18
  Domain Path: /languages
19
+ Version: 2.70
20
  Author URI: http://fairtradejudaica.org/our-story/staff/
21
 
22
  Copyright 2011-2017 David Lingren
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === Media Library Assistant ===
2
  Contributors: dglingren
3
- Donate link: http://fairtradejudaica.org/make-a-difference/donate/
4
  Tags: attachments, gallery, images, media, media library, tag cloud, media-tags, media tags, tags, media categories, categories, IPTC, EXIF, XMP, GPS, PDF, metadata, photos, photographs, photoblog, photo albums, lightroom, MIME, mime-type, icon, upload, file extensions, WPML, Polylang
5
  Requires at least: 3.5.0
6
  Tested up to: 4.9.1
7
  Requires PHP: 5.3
8
- Stable tag: 2.65
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -55,7 +55,7 @@ The Media Library Assistant provides several enhancements for managing the Media
55
 
56
  The Assistant is designed to work like the standard Media Library pages, so the learning curve is short and gentle. Contextual help is provided on every new screen to highlight new features.
57
 
58
- This plugin was inspired by my work on the WordPress web site for our nonprofit, Fair Trade Judaica. If you find the Media Library Assistant plugin useful and would like to support a great cause, consider a [<strong>tax-deductible</strong> donation](http://fairtradejudaica.org/make-a-difference/donate/ "Support Our Work") to our work. Thank you!
59
 
60
  == Installation ==
61
 
@@ -183,13 +183,19 @@ All of the MLA source code has been annotated with "DocBlocks", a special type o
183
 
184
  == Changelog ==
185
 
186
- = 2.65 =
187
- * New: The "MLA Tax Query Example" plugin has been enhanced to handle multi-column orderby parameters.
188
- * Fix: **Corrected an "ajax.fail error"** in the Media/Assistant "Set Parent" function and the Media/Edit Media screen.
189
- * Fix: For the Media/Assistant admin submenu, some taxonomy term queries have been eliminated to improve performance.
190
- * Fix: In the "Smart Medis Categories" example plugin, WordPress "deprecated" messages have been removed when loading the Settings screen.
191
-
192
- = 2.60 - 2.64 =
 
 
 
 
 
 
193
  * 2.64 - For `[mla_gallery]`, corrects v2.63 problem that applied `mla_named_transfer` to all `link=file` and `link=download` galleries.
194
  * 2.63 - Download by name and pretty links, str_replace format option, disable mapping rules, debug tab. Eight enhancements in all, nine fixes.
195
  * 2.62 - Corrects a PHP Fatal Error when loading MLA Media Manager enhancements for "front-end" use.
@@ -279,8 +285,8 @@ All of the MLA source code has been annotated with "DocBlocks", a special type o
279
 
280
  == Upgrade Notice ==
281
 
282
- = 2.65 =
283
- Corrects an "ajax.fail error" in the Media/Assistant "Set Parent" function and the Media/Edit Media screen. One other enhancement, two other fixes.
284
 
285
  == Other Notes ==
286
 
1
  === Media Library Assistant ===
2
  Contributors: dglingren
3
+ Donate link: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
4
  Tags: attachments, gallery, images, media, media library, tag cloud, media-tags, media tags, tags, media categories, categories, IPTC, EXIF, XMP, GPS, PDF, metadata, photos, photographs, photoblog, photo albums, lightroom, MIME, mime-type, icon, upload, file extensions, WPML, Polylang
5
  Requires at least: 3.5.0
6
  Tested up to: 4.9.1
7
  Requires PHP: 5.3
8
+ Stable tag: 2.70
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
55
 
56
  The Assistant is designed to work like the standard Media Library pages, so the learning curve is short and gentle. Contextual help is provided on every new screen to highlight new features.
57
 
58
+ This plugin was inspired by my work on the WordPress web site for our nonprofit, Fair Trade Judaica. If you find the Media Library Assistant plugin useful and would like to support a great cause, consider a [<strong>tax-deductible</strong> donation](http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/ "Support Our Work") to our work. Thank you!
59
 
60
  == Installation ==
61
 
183
 
184
  == Changelog ==
185
 
186
+ = 2.70 =
187
+ * New: A new Debug logging category has been created for "where-used" reporting.
188
+ * New: The Att. Categories and Att. Tags taxonomies can now be displayed a columns on the Media/Library list mode admin submenu.
189
+ * Fix: File downloads originating from a Bulk Action are now restricted to the site's uploads directory tree.
190
+ * Fix: The "MLA Download ZIP Example" plugin has been updated to work with the current MLA version.
191
+ * Fix: References to the FTJ Donate page now go to the plugin description page.
192
+ * Fix: References to the WordPress `get_terms()` function have been updated to accomodate changes made in WP 4.5.0.
193
+ * Fix: When Polylang is active, term assignment for "untranslated" taxonomies is no longer restricted to the default language.
194
+ * Fix: On the Settings/Media Library Assistant Debug tab, the "Save Changes" button has been moved up for easier access when changing option settings.
195
+ * Fix: For the Media/Edit Media admin submenu, duplicate database queries for the "Months" dropdown control have been eliminated.
196
+
197
+ = 2.60 - 2.65 =
198
+ * 2.65 - Corrects an "ajax.fail error" in the Media/Assistant "Set Parent" function and the Media/Edit Media screen. One other enhancement, two other fixes.
199
  * 2.64 - For `[mla_gallery]`, corrects v2.63 problem that applied `mla_named_transfer` to all `link=file` and `link=download` galleries.
200
  * 2.63 - Download by name and pretty links, str_replace format option, disable mapping rules, debug tab. Eight enhancements in all, nine fixes.
201
  * 2.62 - Corrects a PHP Fatal Error when loading MLA Media Manager enhancements for "front-end" use.
285
 
286
  == Upgrade Notice ==
287
 
288
+ = 2.70 =
289
+ Improved file download security, Polylang fixes. Two enhancements, seven fixes.
290
 
291
  == Other Notes ==
292
 
tpls/admin-display-settings-page.tpl CHANGED
@@ -4,7 +4,7 @@
4
  <div class="wrap">
5
  <div id="icon-options-general" class="icon32"><br/></div>
6
  <div id="donate-button-div" class="alignright clear">
7
- <a title="[+Support Our Work+]" class="button button-large button-primary" href="http://fairtradejudaica.org/make-a-difference/donate/">[+Donate+]</a>
8
  </div>
9
  <h1>[+Media Library Assistant+] [+version+][+development+] [+Settings+]</h1>
10
  [+messages+]
@@ -122,7 +122,7 @@
122
  <table width="700" border="0" cellpadding="10">
123
  <tr>
124
  <td>
125
- <a title="[+Donate to FTJ+]" class="button button-large button-primary" href="http://fairtradejudaica.org/make-a-difference/donate/">[+Donate+]</a>
126
  </td>
127
  <td>[+This plugin was+]</td>
128
  </tr>
@@ -136,6 +136,10 @@
136
  [+options_list+]
137
  </table>
138
  <p>[+You can find+]</p>
 
 
 
 
139
  <h3>[+Debug Settings+]</h3>
140
  <table class="optiontable">
141
  [+settings_list+]
@@ -154,10 +158,6 @@
154
  </td>
155
  </tr>
156
  </table>
157
- <p class="submit mla-settings-submit">
158
- <input name="mla-debug-options-save" class="button-primary" id="mla-debug-options-save" type="submit" value="[+Save Changes+]" />
159
- </p>
160
- <div class="mla-settings-help">[+Click Save Changes+]</div>
161
  [+_wpnonce+]
162
  [+_wp_http_referer+]
163
  </form>
4
  <div class="wrap">
5
  <div id="icon-options-general" class="icon32"><br/></div>
6
  <div id="donate-button-div" class="alignright clear">
7
+ <a title="[+Support Our Work+]" class="button button-large button-primary" href="http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/" target="_blank">[+Donate+]</a>
8
  </div>
9
  <h1>[+Media Library Assistant+] [+version+][+development+] [+Settings+]</h1>
10
  [+messages+]
122
  <table width="700" border="0" cellpadding="10">
123
  <tr>
124
  <td>
125
+ <a title="[+Donate to FTJ+]" class="button button-large button-primary" href="http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/" target="_blank">[+Donate+]</a>
126
  </td>
127
  <td>[+This plugin was+]</td>
128
  </tr>
136
  [+options_list+]
137
  </table>
138
  <p>[+You can find+]</p>
139
+ <p class="submit mla-settings-submit">
140
+ <input name="mla-debug-options-save" class="button-primary" id="mla-debug-options-save" type="submit" value="[+Save Changes+]" />
141
+ </p>
142
+ <div class="mla-settings-help">[+Click Save Changes+]</div>
143
  <h3>[+Debug Settings+]</h3>
144
  <table class="optiontable">
145
  [+settings_list+]
158
  </td>
159
  </tr>
160
  </table>
 
 
 
 
161
  [+_wpnonce+]
162
  [+_wp_http_referer+]
163
  </form>
tpls/documentation-settings-tab.tpl CHANGED
@@ -6748,6 +6748,10 @@ The MLA_DEBUG_LEVEL is also used to turn categories of debug messages on and off
6748
  <td class="mla-doc-table-label">32, or 0x0020</td>
6749
  <td>writes MLA-specific messages to the log for WP REST API calls identified by <code>/wp-json/</code> in the SERVER_URI.</td>
6750
  </tr>
 
 
 
 
6751
  </table>
6752
  <p>
6753
  You can pick the logging categories you want by adding the above values together. For example, to log only PHP messages you can use <code>define( 'MLA_DEBUG_LEVEL', 1 );</code> or <code>define( 'MLA_DEBUG_LEVEL', 0x0001 );</code>. To add the "AJAX" messages you can use <code>define( 'MLA_DEBUG_LEVEL', 3 );</code> or <code>define( 'MLA_DEBUG_LEVEL', 0x0003 );</code>. The hexadecimal notation ( 0x0003 ) can be easier to understand when several options are involved.
6748
  <td class="mla-doc-table-label">32, or 0x0020</td>
6749
  <td>writes MLA-specific messages to the log for WP REST API calls identified by <code>/wp-json/</code> in the SERVER_URI.</td>
6750
  </tr>
6751
+ <tr>
6752
+ <td class="mla-doc-table-label">64, or 0x0040</td>
6753
+ <td>writes MLA-specific messages to the log for "where-used" reference collection.</td>
6754
+ </tr>
6755
  </table>
6756
  <p>
6757
  You can pick the logging categories you want by adding the above values together. For example, to log only PHP messages you can use <code>define( 'MLA_DEBUG_LEVEL', 1 );</code> or <code>define( 'MLA_DEBUG_LEVEL', 0x0001 );</code>. To add the "AJAX" messages you can use <code>define( 'MLA_DEBUG_LEVEL', 3 );</code> or <code>define( 'MLA_DEBUG_LEVEL', 0x0003 );</code>. The hexadecimal notation ( 0x0003 ) can be easier to understand when several options are involved.