WP Photo Album Plus - Version 8.2.02.004

Version Description

= 8.1.08 =

  • This version addresses various bug fixes, feature requests and security fixes.
Download this release

Release Info

Developer opajaap
Plugin Icon wp plugin WP Photo Album Plus
Version 8.2.02.004
Comparing to
See all releases

Code changes from version 8.2.02.003 to 8.2.02.004

blocks/potd/block.js CHANGED
@@ -1,18 +1,22 @@
1
  /**
2
  * WPPA potd block
3
  *
4
- * Version: 8.2.02.003
5
  */
6
 
 
7
  ( function ( blocks, editor, i18n, element, components, _, blockEditor ) {
8
- var __ = i18n.__;
9
  var el = element.createElement;
10
  var RichText = blockEditor.RichText;
11
  var useBlockProps = blockEditor.useBlockProps;
12
 
13
  blocks.registerBlockType( 'wp-photo-album-plus/potd', {
14
- title: __('WPPA Potd', 'wp-photo-album-plus'),
15
- icon: 'universal-access-alt',
 
 
 
16
  category: 'layout',
17
 
18
  attributes: {
@@ -41,11 +45,11 @@
41
  return el(
42
  'div',
43
  blockProps,
44
- el('h2',null,__('WPPA Photo of the day','wp-photo-album-plus')),
45
  wppaOnWidgets() ?
46
  el( RichText, {
47
  tagName: 'h3',
48
- placeholder: __('Enter widget caption', 'wp-photo-album-plus'),
49
  value: attributes.widgetTitle,
50
  onChange: function ( value ) {
51
  props.setAttributes( { widgetTitle: value,
@@ -53,7 +57,7 @@
53
  });
54
  },
55
  }) : null,
56
- el('small',null,__('Corresponding shortcode', 'wp-photo-album-plus')+': '+evaluate(props)),
57
  );
58
  },
59
 
@@ -83,6 +87,4 @@
83
  window.wp.components,
84
  window._,
85
  window.wp.blockEditor
86
- );
87
-
88
-
1
  /**
2
  * WPPA potd block
3
  *
4
+ * Version: 8.2.02.004
5
  */
6
 
7
+ jQuery(document).ready(function(){
8
  ( function ( blocks, editor, i18n, element, components, _, blockEditor ) {
9
+
10
  var el = element.createElement;
11
  var RichText = blockEditor.RichText;
12
  var useBlockProps = blockEditor.useBlockProps;
13
 
14
  blocks.registerBlockType( 'wp-photo-album-plus/potd', {
15
+ title: wppaTextPotd,
16
+ icon: el( 'img', {
17
+ src: wppaImageDirectory+'camera32.png',
18
+ style: { width: '24px', height: '24px' },
19
+ } ),
20
  category: 'layout',
21
 
22
  attributes: {
45
  return el(
46
  'div',
47
  blockProps,
48
+ el('h2',null,wppaTextPhotoOfTheDay),
49
  wppaOnWidgets() ?
50
  el( RichText, {
51
  tagName: 'h3',
52
+ placeholder: wppaTextEnterWidgetCaption,
53
  value: attributes.widgetTitle,
54
  onChange: function ( value ) {
55
  props.setAttributes( { widgetTitle: value,
57
  });
58
  },
59
  }) : null,
60
+ el('small',null,wppaTextCorrShortcode+': '+evaluate(props)),
61
  );
62
  },
63
 
87
  window.wp.components,
88
  window._,
89
  window.wp.blockEditor
90
+ )});
 
 
blocks/potd/index.php CHANGED
@@ -3,7 +3,7 @@
3
  * WPPA potd block
4
  * Generates a block with the shortcode for a potd box
5
  *
6
- * @package wp-photo-album-plus
7
  */
8
 
9
  defined( 'ABSPATH' ) || exit;
3
  * WPPA potd block
4
  * Generates a block with the shortcode for a potd box
5
  *
6
+ * Version: 8.2.02.004
7
  */
8
 
9
  defined( 'ABSPATH' ) || exit;
blocks/slideshow/block.js CHANGED
@@ -1,21 +1,27 @@
1
  /**
2
  * WPPA slideshow block
3
  *
4
- * Version: 8.2.02.003
5
  */
6
 
 
7
  ( function ( blocks, editor, i18n, element, components, _, blockEditor ) {
8
- var __ = i18n.__;
9
  var el = element.createElement;
10
  var RichText = blockEditor.RichText;
11
  var CheckboxControl = blockEditor.CheckboxControl;
12
  var useBlockProps = blockEditor.useBlockProps;
 
 
13
 
14
  blocks.registerBlockType( 'wp-photo-album-plus/slideshow', {
15
- title: __('WPPA Slideshow', 'wp-photo-album-plus'),
16
- icon: 'universal-access-alt',
 
 
 
17
  category: 'layout',
18
-
19
  attributes: {
20
  widgetTitle: {
21
  type: 'string',
@@ -56,11 +62,11 @@
56
  return el(
57
  'div',
58
  blockProps,
59
- el('h2',null,__('WPPA Simple slideshow', 'wp-photo-album-plus')),
60
  wppaOnWidgets() ?
61
  el( RichText, {
62
  tagName: 'h3',
63
- placeholder: __('Enter widget caption', 'wp-photo-album-plus'),
64
  value: attributes.widgetTitle,
65
  onChange: function ( value ) {
66
  props.setAttributes( { widgetTitle: value } );
@@ -69,7 +75,7 @@
69
  el(
70
  wp.components.SelectControl,
71
  {
72
- label: __( 'Select the album for the slideshow', 'wp-photo-album-plus' ),
73
  value: attributes.wppaAlbum,
74
  options: wppaSlideshowAlbumList,
75
  onChange: function( val ) {
@@ -79,21 +85,21 @@
79
  }
80
  ),
81
  el( wp.components.CheckboxControl, {
82
- label: __('Add filmstrip', 'wp-photo-album-plus' ),
83
  checked: attributes.filmstrip,
84
  onChange: function( value ) {
85
  props.setAttributes( { filmstrip: value } );
86
  },
87
  }),
88
  el( wp.components.CheckboxControl, {
89
- label: __('Cache this block', 'wp-photo-album-plus'),
90
- help: __('Cache uses WPPA embedded smart cache', 'wp-photo-album-plus'),
91
  checked: attributes.cacheIt,
92
  onChange: function ( value ) {
93
  props.setAttributes( { cacheIt: value } );
94
  },
95
  }),
96
- el('small',null,__( 'Corresponding shortcode', 'wp-photo-album-plus' )+': '+evaluate(props)),
97
  );
98
  },
99
 
@@ -145,6 +151,4 @@
145
  window.wp.components,
146
  window._,
147
  window.wp.blockEditor
148
- );
149
-
150
-
1
  /**
2
  * WPPA slideshow block
3
  *
4
+ * Version: 8.2.02.004
5
  */
6
 
7
+ jQuery(document).ready(function(){
8
  ( function ( blocks, editor, i18n, element, components, _, blockEditor ) {
9
+
10
  var el = element.createElement;
11
  var RichText = blockEditor.RichText;
12
  var CheckboxControl = blockEditor.CheckboxControl;
13
  var useBlockProps = blockEditor.useBlockProps;
14
+ var wppaSlideshowAlbumList = wppaAlbumList.slice();
15
+ wppaSlideshowAlbumList[0] = { label: wppaTextLastAlbumAdded, value: "0" };
16
 
17
  blocks.registerBlockType( 'wp-photo-album-plus/slideshow', {
18
+ title: wppaTextSlideshow,
19
+ icon: el( 'img', {
20
+ src: wppaImageDirectory+'camera32.png',
21
+ style: { width: '24px', height: '24px' },
22
+ } ),
23
  category: 'layout',
24
+
25
  attributes: {
26
  widgetTitle: {
27
  type: 'string',
62
  return el(
63
  'div',
64
  blockProps,
65
+ el('h2',null,wppaTextSimpleSlideshow),
66
  wppaOnWidgets() ?
67
  el( RichText, {
68
  tagName: 'h3',
69
+ placeholder: wppaTextEnterWidgetCaption,
70
  value: attributes.widgetTitle,
71
  onChange: function ( value ) {
72
  props.setAttributes( { widgetTitle: value } );
75
  el(
76
  wp.components.SelectControl,
77
  {
78
+ label: wppaTextSelectAlbum,
79
  value: attributes.wppaAlbum,
80
  options: wppaSlideshowAlbumList,
81
  onChange: function( val ) {
85
  }
86
  ),
87
  el( wp.components.CheckboxControl, {
88
+ label: wppaTextAddFilmstrip,
89
  checked: attributes.filmstrip,
90
  onChange: function( value ) {
91
  props.setAttributes( { filmstrip: value } );
92
  },
93
  }),
94
  el( wp.components.CheckboxControl, {
95
+ label: wppaTextCacheThisBlock,
96
+ help: wppaTextCacheUsesSmart,
97
  checked: attributes.cacheIt,
98
  onChange: function ( value ) {
99
  props.setAttributes( { cacheIt: value } );
100
  },
101
  }),
102
+ el('small',null,wppaTextCorrShortcode+': '+evaluate(props)),
103
  );
104
  },
105
 
151
  window.wp.components,
152
  window._,
153
  window.wp.blockEditor
154
+ )});
 
 
blocks/slideshow/index.php CHANGED
@@ -3,7 +3,7 @@
3
  * WPPA slideshow block
4
  * Generates a block with the shortcode for a slideshow box
5
  *
6
- * @package wp-photo-album-plus
7
  */
8
 
9
  defined( 'ABSPATH' ) || exit;
@@ -39,8 +39,11 @@ add_action( 'init', 'wp_photo_album_plus_slideshow_register_block' );
39
  function wppa_slideshow_block_js() {
40
  global $wpdb;
41
  static $been_here;
 
42
 
43
  if ( $been_here ) return;
 
 
44
 
45
  // Get all album names and ids
46
  $albums = $wpdb->get_results( "SELECT id, name
@@ -56,16 +59,17 @@ static $been_here;
56
 
57
  // Now make the list
58
  $the_js = '
59
- var wppaSlideshowAlbumList = [
60
- { label: "' . __('--- The last added album ---', 'wp-photo-album-plus') . '", value: "0" },';
61
  foreach( $albums as $album ) {
62
  $the_js .= '
63
  { label: "' . str_replace( '>', '>', addslashes( $album['name'] ) ) . '", value: "' . $album['id'] . '" },';
64
  }
65
  $the_js .= ']';
66
-
67
  wp_add_inline_script( 'wppa-admin', $the_js );
68
 
69
  $been_here = true;
 
70
 
71
  }
 
3
  * WPPA slideshow block
4
  * Generates a block with the shortcode for a slideshow box
5
  *
6
+ * Version: 8.2.02.004
7
  */
8
 
9
  defined( 'ABSPATH' ) || exit;
39
  function wppa_slideshow_block_js() {
40
  global $wpdb;
41
  static $been_here;
42
+ global $wppa_albumlist_created;
43
 
44
  if ( $been_here ) return;
45
+
46
+ if ( $wppa_albumlist_created ) return;
47
 
48
  // Get all album names and ids
49
  $albums = $wpdb->get_results( "SELECT id, name
59
 
60
  // Now make the list
61
  $the_js = '
62
+ var wppaAlbumList = ["dummy",';
 
63
  foreach( $albums as $album ) {
64
  $the_js .= '
65
  { label: "' . str_replace( '>', '>', addslashes( $album['name'] ) ) . '", value: "' . $album['id'] . '" },';
66
  }
67
  $the_js .= ']';
68
+
69
  wp_add_inline_script( 'wppa-admin', $the_js );
70
 
71
  $been_here = true;
72
+ $wppa_albumlist_created = true;
73
 
74
  }
75
+
blocks/upload/block.js CHANGED
@@ -1,18 +1,24 @@
1
  /**
2
  * WPPA Upload block
3
  *
4
- * Version: 8.2.02.003
5
  */
6
 
 
7
  ( function ( blocks, editor, i18n, element, components, _, blockEditor ) {
8
- var __ = i18n.__;
9
  var el = element.createElement;
10
  var RichText = blockEditor.RichText;
11
  var useBlockProps = blockEditor.useBlockProps;
 
 
12
 
13
  blocks.registerBlockType( 'wp-photo-album-plus/upload', {
14
- title: 'WPPA Upload',
15
- icon: 'universal-access-alt',
 
 
 
16
  category: 'layout',
17
  attributes: {
18
  widgetTitle: {
@@ -44,11 +50,11 @@
44
  return el(
45
  'div',
46
  blockProps,
47
- el('h2',null,__( 'WPPA Upload form', 'wp-photo-album-plus' )),
48
  wppaOnWidgets() ?
49
  el( RichText, {
50
  tagName: 'h3',
51
- placeholder: __( 'Enter widget caption', 'wp-photo-album-plus' ),
52
  value: attributes.widgetTitle,
53
  onChange: function ( value ) {
54
  props.setAttributes( { widgetTitle: value } );
@@ -57,7 +63,7 @@
57
  el(
58
  wp.components.SelectControl,
59
  {
60
- help: __( 'If you want to limit uploads to a specific album, select it here', 'wp-photo-album-plus' ),
61
  value: props.attributes.wppaAlbum,
62
  options: wppaUploadAlbumList,
63
  onChange: function( val ) {
@@ -68,7 +74,7 @@
68
  ),
69
  ( ! attributes.wppaAdminOnly ?
70
  el( wp.components.CheckboxControl, {
71
- label: __('Show to logged in users only?', 'wp-photo-album-plus'),
72
  checked: attributes.wppaLoginOnly,
73
  onChange: function ( value ) {
74
  props.setAttributes( { wppaLoginOnly: value } );
@@ -76,7 +82,7 @@
76
  }) : null
77
  ),
78
  el( wp.components.CheckboxControl, {
79
- label: __('Show to admin only?', 'wp-photo-album-plus'),
80
  checked: attributes.wppaAdminOnly,
81
  onChange: function ( value ) {
82
  props.setAttributes( { wppaAdminOnly: value } );
@@ -85,7 +91,7 @@
85
  }
86
  },
87
  }),
88
- el('small',null,__( 'Corresponding shortcode', 'wp-photo-album-plus' )+': '+ evaluate(props)),
89
  );
90
  },
91
 
@@ -130,6 +136,7 @@
130
  window.wp.components,
131
  window._,
132
  window.wp.blockEditor
133
- );
 
134
 
135
 
1
  /**
2
  * WPPA Upload block
3
  *
4
+ * Version: 8.2.02.004
5
  */
6
 
7
+ jQuery(document).ready(function(){
8
  ( function ( blocks, editor, i18n, element, components, _, blockEditor ) {
9
+
10
  var el = element.createElement;
11
  var RichText = blockEditor.RichText;
12
  var useBlockProps = blockEditor.useBlockProps;
13
+ var wppaUploadAlbumList = wppaAlbumList.slice();
14
+ wppaUploadAlbumList[0] = { label: wppaTextAlbumSelect, value: "0" };
15
 
16
  blocks.registerBlockType( 'wp-photo-album-plus/upload', {
17
+ title: wppaTextUpload,
18
+ icon: el( 'img', {
19
+ src: wppaImageDirectory+'camera32.png',
20
+ style: { width: '24px', height: '24px' },
21
+ } ),
22
  category: 'layout',
23
  attributes: {
24
  widgetTitle: {
50
  return el(
51
  'div',
52
  blockProps,
53
+ el('h2',null,wppaTextUploadForm),
54
  wppaOnWidgets() ?
55
  el( RichText, {
56
  tagName: 'h3',
57
+ placeholder: wppaTextEnterWidgetCaption,
58
  value: attributes.widgetTitle,
59
  onChange: function ( value ) {
60
  props.setAttributes( { widgetTitle: value } );
63
  el(
64
  wp.components.SelectControl,
65
  {
66
+ help: wppaTextUploadHelp,
67
  value: props.attributes.wppaAlbum,
68
  options: wppaUploadAlbumList,
69
  onChange: function( val ) {
74
  ),
75
  ( ! attributes.wppaAdminOnly ?
76
  el( wp.components.CheckboxControl, {
77
+ label: wppaTextLoginOnly,
78
  checked: attributes.wppaLoginOnly,
79
  onChange: function ( value ) {
80
  props.setAttributes( { wppaLoginOnly: value } );
82
  }) : null
83
  ),
84
  el( wp.components.CheckboxControl, {
85
+ label: wppaTextAdminOnly,
86
  checked: attributes.wppaAdminOnly,
87
  onChange: function ( value ) {
88
  props.setAttributes( { wppaAdminOnly: value } );
91
  }
92
  },
93
  }),
94
+ el('small',null,wppaTextCorrShortcode+': '+ evaluate(props)),
95
  );
96
  },
97
 
136
  window.wp.components,
137
  window._,
138
  window.wp.blockEditor
139
+ )});
140
+
141
 
142
 
blocks/upload/index.php CHANGED
@@ -3,7 +3,7 @@
3
  * WPPA Upload block
4
  * Generates a block with the shortcode for an upload box
5
  *
6
- * @package wp-photo-album-plus
7
  */
8
 
9
  defined( 'ABSPATH' ) || exit;
@@ -39,9 +39,12 @@ add_action( 'init', 'wp_photo_album_plus_upload_register_block' );
39
  function wppa_upload_block_js() {
40
  global $wpdb;
41
  static $been_here;
 
42
 
43
  if ( $been_here ) return;
44
 
 
 
45
  // Get all album names and ids
46
  $albums = $wpdb->get_results( "SELECT id, name
47
  FROM $wpdb->wppa_albums",
@@ -56,8 +59,7 @@ static $been_here;
56
 
57
  // Now make the list
58
  $the_js = '
59
- var wppaUploadAlbumList = [
60
- { label: "' . __('--- A selectionbox with all albums the user may upload to ---', 'wp-photo-album-plus') . '", value: "0" },';
61
  foreach( $albums as $album ) {
62
  $the_js .= '
63
  { label: "' . str_replace( '>', '>', addslashes( $album['name'] ) ) . '", value: "' . $album['id'] . '" },';
@@ -68,4 +70,6 @@ static $been_here;
68
 
69
  $been_here = true;
70
 
 
 
71
  }
3
  * WPPA Upload block
4
  * Generates a block with the shortcode for an upload box
5
  *
6
+ * Version 8.2.02.004
7
  */
8
 
9
  defined( 'ABSPATH' ) || exit;
39
  function wppa_upload_block_js() {
40
  global $wpdb;
41
  static $been_here;
42
+ global $wppa_albumlist_created;
43
 
44
  if ( $been_here ) return;
45
 
46
+ if ( $wppa_albumlist_created ) return;
47
+
48
  // Get all album names and ids
49
  $albums = $wpdb->get_results( "SELECT id, name
50
  FROM $wpdb->wppa_albums",
59
 
60
  // Now make the list
61
  $the_js = '
62
+ var wppaAlbumList = ["dummy",';
 
63
  foreach( $albums as $album ) {
64
  $the_js .= '
65
  { label: "' . str_replace( '>', '>', addslashes( $album['name'] ) ) . '", value: "' . $album['id'] . '" },';
70
 
71
  $been_here = true;
72
 
73
+ $wppa_albumlist_created = true;
74
+
75
  }
wppa-init.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
- * Version: 8.2.02.003
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
@@ -113,7 +113,6 @@ global $wppa_lang;
113
  global $wppa_locale;
114
  global $wp_version;
115
  global $locale;
116
- global $wppa_domain_loaded;
117
 
118
  // 'Our' usefull language info
119
  if ( wppa_get( 'wppalocale' ) ) {
@@ -463,14 +462,21 @@ global $wppa_lang;
463
  return $text;
464
  }
465
 
466
- function wppa_album_to_gallery( $text = '' ) {
 
 
 
 
467
 
468
- add_filter( 'gettext', 'wppa_translate' );
469
- add_filter( 'widget_title', 'wppa_translate', 1 );
470
- add_filter( 'translate_text', 'wppa_translate', 1 );
 
 
 
 
471
 
472
- if ( get_option( 'wppa_album_use_gallery', 'no' ) == 'yes' ) {
473
- $text = str_replace( array(
474
  __( 'Renew Album', 'wp-photo-album-plus' ),
475
  __( 'renew album', 'wp-photo-album-plus' ),
476
  __( 'A new album', 'wp-photo-album-plus' ),
@@ -489,8 +495,9 @@ function wppa_album_to_gallery( $text = '' ) {
489
  __( 'Album', 'wp-photo-album-plus' ),
490
  __( 'albums', 'wp-photo-album-plus' ),
491
  __( 'album', 'wp-photo-album-plus' ),
492
- ),
493
- array(
 
494
  __( 'Renew Gallery', 'wp-photo-album-plus' ),
495
  __( 'renew gallery', 'wp-photo-album-plus' ),
496
  __( 'A new gallery', 'wp-photo-album-plus' ),
@@ -509,24 +516,41 @@ function wppa_album_to_gallery( $text = '' ) {
509
  __( 'Gallery', 'wp-photo-album-plus' ),
510
  __( 'galleries', 'wp-photo-album-plus' ),
511
  __( 'gallery', 'wp-photo-album-plus' ),
512
- ),
513
- $text );
514
 
 
 
 
515
 
 
 
 
516
 
517
- $text = str_replace( '-'.$gallery.'-', '-'.$album.'-', $text ); // Fix links to wp
518
- }
 
 
 
 
 
 
 
 
 
 
 
 
519
 
520
  return $text;
521
  }
522
 
523
- function wppa_filter_translate() {
524
-
525
- if ( get_option( 'wppa_album_use_gallery', 'no' ) == 'yes' ) {
526
- add_filter( 'gettext', 'wppa_album_to_gallery', 100 );
527
- }
528
  }
529
- add_action( 'plugins_loaded', 'wppa_filter_translate' );
530
 
531
  // Fix All in one SEO tampers occur counter
532
  function wppa_fix_aioseo() {
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
+ * Version 8.2.01.005
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
113
  global $wppa_locale;
114
  global $wp_version;
115
  global $locale;
 
116
 
117
  // 'Our' usefull language info
118
  if ( wppa_get( 'wppalocale' ) ) {
462
  return $text;
463
  }
464
 
465
+ // Prepare translations for using Galery rather than Album
466
+ function wppa_filter_translate() {
467
+ global $wppa_album_gallery_texts_albums;
468
+ global $wppa_album_gallery_texts_gallery;
469
+ global $_gallery;
470
 
471
+ // Keep it album?
472
+ if ( get_option( 'wppa_album_use_gallery', 'no' ) == 'no' ) {
473
+ return;
474
+ }
475
+
476
+ // Been here before?
477
+ if ( !empty( $wppa_album_gallery_texts_albums ) ) return;
478
 
479
+ $wppa_album_gallery_texts_albums = array(
 
480
  __( 'Renew Album', 'wp-photo-album-plus' ),
481
  __( 'renew album', 'wp-photo-album-plus' ),
482
  __( 'A new album', 'wp-photo-album-plus' ),
495
  __( 'Album', 'wp-photo-album-plus' ),
496
  __( 'albums', 'wp-photo-album-plus' ),
497
  __( 'album', 'wp-photo-album-plus' ),
498
+ );
499
+
500
+ $wppa_album_gallery_texts_gallery = array(
501
  __( 'Renew Gallery', 'wp-photo-album-plus' ),
502
  __( 'renew gallery', 'wp-photo-album-plus' ),
503
  __( 'A new gallery', 'wp-photo-album-plus' ),
516
  __( 'Gallery', 'wp-photo-album-plus' ),
517
  __( 'galleries', 'wp-photo-album-plus' ),
518
  __( 'gallery', 'wp-photo-album-plus' ),
519
+ );
 
520
 
521
+ $_gallery = __( 'gallery', 'wp-photo-album-plus' );
522
+ }
523
+ add_action( 'plugins_loaded', 'wppa_filter_translate', 1 );
524
 
525
+ // Activate album to gallery conversion
526
+ // This must be done after wppa_filter_translate() has completed to avoid endless recursion
527
+ function wppa_activate_albtogal_conversion() {
528
 
529
+ add_filter( 'gettext', 'wppa_album_to_gallery', 100 );
530
+ }
531
+ add_action( 'plugins_loaded', 'wppa_activate_albtogal_conversion', 20 );
532
+
533
+ // Do the actual conversion from album to gallery
534
+ function wppa_album_to_gallery( $text = '' ) {
535
+ global $wppa_album_gallery_texts_albums;
536
+ global $wppa_album_gallery_texts_gallery;
537
+ global $_gallery;
538
+
539
+ $text = str_replace( $wppa_album_gallery_texts_albums,
540
+ $wppa_album_gallery_texts_gallery,
541
+ $text );
542
+ $text = str_replace( '-' . $_gallery . '-', '-album-', $text ); // Repair refs to wp (i.e. 'wp-photo-album-plus')
543
 
544
  return $text;
545
  }
546
 
547
+ // Prepare translations using qTranslate
548
+ function wppa_filter_qtranslate() {
549
+ add_filter( 'gettext', 'wppa_translate' );
550
+ add_filter( 'widget_title', 'wppa_translate', 1 );
551
+ add_filter( 'translate_text', 'wppa_translate', 1 );
552
  }
553
+ add_action( 'plugins_loaded', 'wppa_filter_qtranslate', 100 );
554
 
555
  // Fix All in one SEO tampers occur counter
556
  function wppa_fix_aioseo() {
wppa-scripts.php CHANGED
@@ -481,6 +481,9 @@ global $wpdb;
481
 
482
  // Format
483
  $result = wppa_compress_js( $result );
 
 
 
484
  $result = '
485
  <!-- wppa js inits -->
486
  <script>
@@ -489,6 +492,30 @@ global $wpdb;
489
  <!-- End wppa js inits -->
490
  ';
491
  echo $result;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
492
  }
493
  add_action( 'wp_head', 'wppa_initialize_javascript', 2 );
494
  add_action( 'admin_head', 'wppa_initialize_javascript', 2 );
481
 
482
  // Format
483
  $result = wppa_compress_js( $result );
484
+ wp_add_inline_script('jquery-core', $result);
485
+ wp_add_inline_script('wppa-admin', $result);
486
+ /*
487
  $result = '
488
  <!-- wppa js inits -->
489
  <script>
492
  <!-- End wppa js inits -->
493
  ';
494
  echo $result;
495
+ /* */
496
+
497
+ // Texts for block activations
498
+ $the_js = '
499
+ var
500
+ wppaTextSlideshow = "' . __( 'WPPA Slideshow', 'wp-photo-album-plus' ) . '",
501
+ wppaTextSimpleSlideshow = "' . __( 'WPPA Simple slideshow', 'wp-photo-album-plus' ) . '",
502
+ wppaTextEnterWidgetCaption = "' . __( 'Enter widget caption', 'wp-photo-album-plus' ) . '",
503
+ wppaTextSelectAlbum = "' . __( 'Select the album for the slideshow', 'wp-photo-album-plus' ) . '",
504
+ wppaTextAddFilmstrip = "' . __( 'Add filmstrip', 'wp-photo-album-plus' ) . '",
505
+ wppaTextCacheThisBlock = "' . __( 'Cache this block', 'wp-photo-album-plus' ) . '",
506
+ wppaTextCacheUsesSmart = "' . __( 'Cache uses WPPA embedded smart cache', 'wp-photo-album-plus' ) . '",
507
+ wppaTextCorrShortcode = "' . __( 'Corresponding shortcode', 'wp-photo-album-plus' ) . '",
508
+ wppaTextLastAlbumAdded = "' . __( '--- The last added album ---', 'wp-photo-album-plus' ) . '",
509
+ wppaTextAlbumSelect = "' . __( '--- A selectionbox with all albums the user may upload to ---', 'wp-photo-album-plus' ) . '",
510
+ wppaTextUploadForm = "' . __( 'WPPA Upload form', 'wp-photo-album-plus' ) . '",
511
+ wppaTextUploadHelp = "' . __( 'If you want to limit uploads to a specific album, select it here', 'wp-photo-album-plus' ) . '"
512
+ wppaTextLoginOnly = "' . __( 'Show to logged in users only?', 'wp-photo-album-plus' ) . '",
513
+ wppaTextAdminOnly = "' . __( 'Show to admin only?', 'wp-photo-album-plus' ) . '",
514
+ wppaTextUpload = "' . __( 'WPPA upload', 'wp-photo-album-plus' ) . '",
515
+ wppaTextPotd = "' . __( 'WPPA Potd', 'wp-photo-album-plus' ) . '",
516
+ wppaTextPhotoOfTheDay = "' . __( 'WPPA Photo of the day','wp-photo-album-plus' ) . '"';
517
+ wp_add_inline_script( 'wppa-admin', $the_js );
518
+
519
  }
520
  add_action( 'wp_head', 'wppa_initialize_javascript', 2 );
521
  add_action( 'admin_head', 'wppa_initialize_javascript', 2 );
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 8.2.02.003
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '8.2.02.002'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 8.2.02.004
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '8.2.02.004'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30