Easy Watermark - Version 1.0.11

Version Description

  • [Fixed] Watermark preview url fixed to work with non-standard WordPress installations
  • [Fixed] Error in Cache Busting feature.
Download this release

Release Info

Developer bracketspace
Plugin Icon Easy Watermark
Version 1.0.11
Comparing to
See all releases

Code changes from version 1.0.10 to 1.0.11

.github/workflows/legacy-develop.yml CHANGED
@@ -54,7 +54,7 @@ jobs:
54
  options: '--exclude-from=".build-excludes"'
55
  src: '.'
56
  dest: 'build'
57
- - name: Fix permissiong
58
  run: sudo chown -R $USER:$USER ./
59
  - name: Upload artifact
60
  uses: actions/upload-artifact@v1
54
  options: '--exclude-from=".build-excludes"'
55
  src: '.'
56
  dest: 'build'
57
+ - name: Fix permissions
58
  run: sudo chown -R $USER:$USER ./
59
  - name: Upload artifact
60
  uses: actions/upload-artifact@v1
.github/workflows/legacy-stable.yml CHANGED
@@ -54,6 +54,8 @@ jobs:
54
  options: '--exclude-from=".build-excludes"'
55
  src: '.'
56
  dest: 'build'
 
 
57
  - name: Upload artifact
58
  uses: actions/upload-artifact@v1
59
  with:
54
  options: '--exclude-from=".build-excludes"'
55
  src: '.'
56
  dest: 'build'
57
+ - name: Fix permissions
58
+ run: sudo chown -R $USER:$USER ./
59
  - name: Upload artifact
60
  uses: actions/upload-artifact@v1
61
  with:
easy-watermark.php CHANGED
@@ -6,7 +6,7 @@
6
  * Author URI: https://bracketspace.com/
7
  * Text Domain: easy-watermark
8
  * Domain Path: /languages
9
- * Version: 1.0.10
10
  * License: GPLv3 or later
11
  *
12
  * @package easy-watermark
6
  * Author URI: https://bracketspace.com/
7
  * Text Domain: easy-watermark
8
  * Domain Path: /languages
9
+ * Version: 1.0.11
10
  * License: GPLv3 or later
11
  *
12
  * @package easy-watermark
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=wojte
4
  Tags: watermark, image, picture, photo, media, gallery, signature, transparent, upload, admin
5
  Requires at least: 4.6
6
  Requires PHP: 5.6
7
- Tested up to: 5.6
8
- Stable tag: 1.0.10
9
  License: GPLv3 or later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
  Text Domain: easy-watermark
@@ -57,6 +57,10 @@ The plugin supports a few fonts:
57
 
58
  You can also place the text watermark in one of the 9 positions on the image, control the angle, color, opacity and size.
59
 
 
 
 
 
60
  == Installation ==
61
 
62
  Note: Easy Watermark requires GD extension installed and enabled on a server to work.
@@ -105,6 +109,13 @@ With 'Fit to Width' or 'Fit to Height' options watermark dimensions can be set a
105
  = What placeholders can I use in text watermark? =
106
  All available placeholders are listed in a box titled 'Placeholders' displayed while creating the Text Watermark.
107
 
 
 
 
 
 
 
 
108
  == Screenshots ==
109
 
110
  1. Image watermark settings
@@ -118,6 +129,10 @@ All available placeholders are listed in a box titled 'Placeholders' displayed w
118
 
119
  == Changelog ==
120
 
 
 
 
 
121
  = 1.0.10 =
122
  * [Added] Role existence checks during plugin activation.
123
  * [Added] Filter to prevent applying certain watermark.
4
  Tags: watermark, image, picture, photo, media, gallery, signature, transparent, upload, admin
5
  Requires at least: 4.6
6
  Requires PHP: 5.6
7
+ Tested up to: 5.8
8
+ Stable tag: 1.0.11
9
  License: GPLv3 or later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
11
  Text Domain: easy-watermark
57
 
58
  You can also place the text watermark in one of the 9 positions on the image, control the angle, color, opacity and size.
59
 
60
+ = Custom development =
61
+
62
+ BracketSpace - the company behind this plugin provides [custom WordPress plugin development services](https://bracketspace.com/custom-development/). We can create any custom plugin for you.
63
+
64
  == Installation ==
65
 
66
  Note: Easy Watermark requires GD extension installed and enabled on a server to work.
109
  = What placeholders can I use in text watermark? =
110
  All available placeholders are listed in a box titled 'Placeholders' displayed while creating the Text Watermark.
111
 
112
+ = Does the plugin work without the GD library? =
113
+ Unfortunately, no. It is planned though for one of the releases in the undefined future.
114
+
115
+ = Can you create a plugin for me? =
116
+
117
+ Yes! We're offering a [custom plugin development](https://bracketspace.com/custom-development/) services. Feel free to contact us to find out how we can help you.
118
+
119
  == Screenshots ==
120
 
121
  1. Image watermark settings
129
 
130
  == Changelog ==
131
 
132
+ = 1.0.11 =
133
+ * [Fixed] Watermark preview url fixed to work with non-standard WordPress installations
134
+ * [Fixed] Error in Cache Busting feature.
135
+
136
  = 1.0.10 =
137
  * [Added] Role existence checks during plugin activation.
138
  * [Added] Filter to prevent applying certain watermark.
src/classes/AttachmentProcessor/AttachmentProcessorGD.php CHANGED
@@ -445,7 +445,7 @@ class AttachmentProcessorGD extends AttachmentProcessor {
445
  $watermark_size['width'] = $new_width;
446
  $watermark_size['height'] = $new_height;
447
 
448
- unset( $tmp_image, $new_width, $nwe_height );
449
  }
450
 
451
  // Compute watermark offset.
445
  $watermark_size['width'] = $new_width;
446
  $watermark_size['height'] = $new_height;
447
 
448
+ unset( $tmp_image, $new_width, $new_height );
449
  }
450
 
451
  // Compute watermark offset.
src/classes/Dashboard/Dashboard.php CHANGED
@@ -81,7 +81,7 @@ class Dashboard {
81
  }
82
 
83
  /**
84
- * Displats options page content
85
  *
86
  * @return void
87
  */
81
  }
82
 
83
  /**
84
+ * Displays options page content
85
  *
86
  * @return void
87
  */
src/classes/Features/CacheBusting.php CHANGED
@@ -72,6 +72,22 @@ class CacheBusting {
72
 
73
  }
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  /**
76
  * Adds attachment version to the URL
77
  *
@@ -109,7 +125,7 @@ class CacheBusting {
109
  return false;
110
  }
111
 
112
- if ( true === $this->switch->get_value() ) {
113
  if ( is_array( $image ) && ! empty( $image ) && is_string( $image[0] ) ) {
114
  $image[0] = $this->add_attachment_version( $image[0], $attachment_id );
115
  } elseif ( is_string( $image ) ) {
@@ -135,7 +151,7 @@ class CacheBusting {
135
  */
136
  public function wp_calculate_image_srcset( $sources, $size_array, $image_src, $image_meta, $attachment_id ) {
137
 
138
- if ( true === $this->switch->get_value() ) {
139
  foreach ( $sources as &$source ) {
140
  $source['url'] = $this->add_attachment_version( $source['url'], $attachment_id );
141
  }
72
 
73
  }
74
 
75
+ /**
76
+ * Check if this feature is active
77
+ *
78
+ * @return boolean
79
+ */
80
+ private function is_active() {
81
+ /**
82
+ * The SwitchField object should be always available by the time this method
83
+ * is used. Hovewer there has been an issue reported that the
84
+ * `wp_get_attachment_image_src` method caused a fatal error because
85
+ * $this->switch was null. Just for safety, check if the SwitchField object
86
+ * is created, if not return `true` - the default value.
87
+ */
88
+ return $this->switch ? true === $this->switch->get_value() : true;
89
+ }
90
+
91
  /**
92
  * Adds attachment version to the URL
93
  *
125
  return false;
126
  }
127
 
128
+ if ( $this->is_active() ) {
129
  if ( is_array( $image ) && ! empty( $image ) && is_string( $image[0] ) ) {
130
  $image[0] = $this->add_attachment_version( $image[0], $attachment_id );
131
  } elseif ( is_string( $image ) ) {
151
  */
152
  public function wp_calculate_image_srcset( $sources, $size_array, $image_src, $image_meta, $attachment_id ) {
153
 
154
+ if ( $this->is_active() ) {
155
  foreach ( $sources as &$source ) {
156
  $source['url'] = $this->add_attachment_version( $source['url'], $attachment_id );
157
  }
src/classes/Features/WatermarkPreview.php CHANGED
@@ -55,7 +55,7 @@ class WatermarkPreview {
55
  }
56
  }
57
 
58
- return add_query_arg( $args, site_url( $base ) );
59
  }
60
 
61
  /**
55
  }
56
  }
57
 
58
+ return add_query_arg( $args, home_url( $base ) );
59
  }
60
 
61
  /**
src/classes/Placeholders/Abstracts/Placeholder.php CHANGED
@@ -143,7 +143,6 @@ abstract class Placeholder {
143
 
144
  if ( $this->is_resetable() ) {
145
  $this->value = null;
146
- $this->data = [];
147
  }
148
 
149
  }
143
 
144
  if ( $this->is_resetable() ) {
145
  $this->value = null;
 
146
  }
147
 
148
  }
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit41236c1453d2778f3e4bcd114cbfb3b0::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitfc0147afb354c48a40c96eb7211d8b4a::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -311,8 +311,10 @@ class ClassLoader
311
  spl_autoload_register(array($this, 'loadClass'), true, $prepend);
312
 
313
  if (null === $this->vendorDir) {
314
- //no-op
315
- } elseif ($prepend) {
 
 
316
  self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
317
  } else {
318
  unset(self::$registeredLoaders[$this->vendorDir]);
311
  spl_autoload_register(array($this, 'loadClass'), true, $prepend);
312
 
313
  if (null === $this->vendorDir) {
314
+ return;
315
+ }
316
+
317
+ if ($prepend) {
318
  self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
319
  } else {
320
  unset(self::$registeredLoaders[$this->vendorDir]);
vendor/composer/InstalledVersions.php CHANGED
@@ -25,12 +25,12 @@ class InstalledVersions
25
  private static $installed = array (
26
  'root' =>
27
  array (
28
- 'pretty_version' => '1.0.10',
29
- 'version' => '1.0.10.0',
30
  'aliases' =>
31
  array (
32
  ),
33
- 'reference' => '521a4a80ffcb55b1546c86e7841fa50f47fa3864',
34
  'name' => 'szaleq/easy-watermark',
35
  ),
36
  'versions' =>
@@ -62,12 +62,12 @@ private static $installed = array (
62
  ),
63
  'szaleq/easy-watermark' =>
64
  array (
65
- 'pretty_version' => '1.0.10',
66
- 'version' => '1.0.10.0',
67
  'aliases' =>
68
  array (
69
  ),
70
- 'reference' => '521a4a80ffcb55b1546c86e7841fa50f47fa3864',
71
  ),
72
  'underdev/requirements' =>
73
  array (
@@ -301,7 +301,6 @@ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegist
301
  $installed = array();
302
 
303
  if (self::$canGetVendors) {
304
-
305
  foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
306
  if (isset(self::$installedByVendor[$vendorDir])) {
307
  $installed[] = self::$installedByVendor[$vendorDir];
25
  private static $installed = array (
26
  'root' =>
27
  array (
28
+ 'pretty_version' => '1.0.11',
29
+ 'version' => '1.0.11.0',
30
  'aliases' =>
31
  array (
32
  ),
33
+ 'reference' => 'fa004b7fb4bc599c86e4403ae0b38495c26c83c2',
34
  'name' => 'szaleq/easy-watermark',
35
  ),
36
  'versions' =>
62
  ),
63
  'szaleq/easy-watermark' =>
64
  array (
65
+ 'pretty_version' => '1.0.11',
66
+ 'version' => '1.0.11.0',
67
  'aliases' =>
68
  array (
69
  ),
70
+ 'reference' => 'fa004b7fb4bc599c86e4403ae0b38495c26c83c2',
71
  ),
72
  'underdev/requirements' =>
73
  array (
301
  $installed = array();
302
 
303
  if (self::$canGetVendors) {
 
304
  foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
305
  if (isset(self::$installedByVendor[$vendorDir])) {
306
  $installed[] = self::$installedByVendor[$vendorDir];
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit41236c1453d2778f3e4bcd114cbfb3b0
6
  {
7
  private static $loader;
8
 
@@ -24,15 +24,15 @@ class ComposerAutoloaderInit41236c1453d2778f3e4bcd114cbfb3b0
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInit41236c1453d2778f3e4bcd114cbfb3b0', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
- spl_autoload_unregister(array('ComposerAutoloaderInit41236c1453d2778f3e4bcd114cbfb3b0', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
- call_user_func(\Composer\Autoload\ComposerStaticInit41236c1453d2778f3e4bcd114cbfb3b0::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitfc0147afb354c48a40c96eb7211d8b4a
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInitfc0147afb354c48a40c96eb7211d8b4a', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInitfc0147afb354c48a40c96eb7211d8b4a', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
+ call_user_func(\Composer\Autoload\ComposerStaticInitfc0147afb354c48a40c96eb7211d8b4a::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit41236c1453d2778f3e4bcd114cbfb3b0
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'M' =>
@@ -163,10 +163,10 @@ class ComposerStaticInit41236c1453d2778f3e4bcd114cbfb3b0
163
  public static function getInitializer(ClassLoader $loader)
164
  {
165
  return \Closure::bind(function () use ($loader) {
166
- $loader->prefixLengthsPsr4 = ComposerStaticInit41236c1453d2778f3e4bcd114cbfb3b0::$prefixLengthsPsr4;
167
- $loader->prefixDirsPsr4 = ComposerStaticInit41236c1453d2778f3e4bcd114cbfb3b0::$prefixDirsPsr4;
168
- $loader->prefixesPsr0 = ComposerStaticInit41236c1453d2778f3e4bcd114cbfb3b0::$prefixesPsr0;
169
- $loader->classMap = ComposerStaticInit41236c1453d2778f3e4bcd114cbfb3b0::$classMap;
170
 
171
  }, null, ClassLoader::class);
172
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitfc0147afb354c48a40c96eb7211d8b4a
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'M' =>
163
  public static function getInitializer(ClassLoader $loader)
164
  {
165
  return \Closure::bind(function () use ($loader) {
166
+ $loader->prefixLengthsPsr4 = ComposerStaticInitfc0147afb354c48a40c96eb7211d8b4a::$prefixLengthsPsr4;
167
+ $loader->prefixDirsPsr4 = ComposerStaticInitfc0147afb354c48a40c96eb7211d8b4a::$prefixDirsPsr4;
168
+ $loader->prefixesPsr0 = ComposerStaticInitfc0147afb354c48a40c96eb7211d8b4a::$prefixesPsr0;
169
+ $loader->classMap = ComposerStaticInitfc0147afb354c48a40c96eb7211d8b4a::$classMap;
170
 
171
  }, null, ClassLoader::class);
172
  }
vendor/composer/installed.php CHANGED
@@ -1,12 +1,12 @@
1
  <?php return array (
2
  'root' =>
3
  array (
4
- 'pretty_version' => '1.0.10',
5
- 'version' => '1.0.10.0',
6
  'aliases' =>
7
  array (
8
  ),
9
- 'reference' => '521a4a80ffcb55b1546c86e7841fa50f47fa3864',
10
  'name' => 'szaleq/easy-watermark',
11
  ),
12
  'versions' =>
@@ -38,12 +38,12 @@
38
  ),
39
  'szaleq/easy-watermark' =>
40
  array (
41
- 'pretty_version' => '1.0.10',
42
- 'version' => '1.0.10.0',
43
  'aliases' =>
44
  array (
45
  ),
46
- 'reference' => '521a4a80ffcb55b1546c86e7841fa50f47fa3864',
47
  ),
48
  'underdev/requirements' =>
49
  array (
1
  <?php return array (
2
  'root' =>
3
  array (
4
+ 'pretty_version' => '1.0.11',
5
+ 'version' => '1.0.11.0',
6
  'aliases' =>
7
  array (
8
  ),
9
+ 'reference' => 'fa004b7fb4bc599c86e4403ae0b38495c26c83c2',
10
  'name' => 'szaleq/easy-watermark',
11
  ),
12
  'versions' =>
38
  ),
39
  'szaleq/easy-watermark' =>
40
  array (
41
+ 'pretty_version' => '1.0.11',
42
+ 'version' => '1.0.11.0',
43
  'aliases' =>
44
  array (
45
  ),
46
+ 'reference' => 'fa004b7fb4bc599c86e4403ae0b38495c26c83c2',
47
  ),
48
  'underdev/requirements' =>
49
  array (