diff --git a/README.md b/README.md
index ca86b6a..d987fd3 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,13 @@
=== PDF Compressor & Watermark - iLovePDF ===
Plugin Name: Image Compressor & Optimizer - iLovePDF
-Version: 2.1.1
+Version: 2.1.2
Author: iLovePDF
Author URI: https://www.ilovepdf.com/
Contributors: iLovePDF
Tags: compress, watermark, optimize, performance, pdf optimizer
Requires at least: 5.3
-Tested up to: 6.5.3
-Stable tag: 2.1.1
+Tested up to: 6.5.5
+Stable tag: 2.1.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
diff --git a/README.txt b/README.txt
index bdb107a..15fee79 100644
--- a/README.txt
+++ b/README.txt
@@ -1,13 +1,13 @@
=== PDF Compressor & Watermark - iLovePDF ===
Plugin Name: Image Compressor & Optimizer - iLovePDF
-Version: 2.1.1
+Version: 2.1.2
Author: iLovePDF
Author URI: https://www.ilovepdf.com/
Contributors: iLovePDF
Tags: compress, watermark, optimize, performance, pdf optimizer
Requires at least: 5.3
-Tested up to: 6.5.3
-Stable tag: 2.1.1
+Tested up to: 6.5.5
+Stable tag: 2.1.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -82,6 +82,14 @@ We will send you an email before limit is reached. When limit is reached, no mor
== Changelog ==
+== 2.1.2 ==
+Improved
+* Update Libraries.
+* Now IlovePDF will use credits to process the files.
+
+Fixed
+* A problem was solved with the option to create backup, where in some cases the option was not stored in the database.
+
== 2.1.1 ==
Improved
* Update Libraries.
diff --git a/admin/functions-compress.php b/admin/functions-compress.php
index 620181f..8584dae 100644
--- a/admin/functions-compress.php
+++ b/admin/functions-compress.php
@@ -30,7 +30,7 @@ function ilove_pdf_compress_pdf( $id_file, $auto = false, $bulk = false ) {
} else {
try {
// you can call task class directly
- // to get your key pair, please visit https://developer.ilovepdf.com/user/projects
+ // to get your key pair, please visit https://iloveapi.com/user/projects
$my_task = new CompressTask( get_option( 'ilovepdf_user_public_key', true ), get_option( 'ilovepdf_user_private_key', true ) );
// file var keeps info about server file id, name...
diff --git a/admin/functions-watermark.php b/admin/functions-watermark.php
index 5d07e5d..8eefcec 100644
--- a/admin/functions-watermark.php
+++ b/admin/functions-watermark.php
@@ -32,7 +32,7 @@ function ilove_pdf_watermark_pdf( $id_file, $auto = false, $bulk = false ) {
try {
// you can call task class directly
- // to get your key pair, please visit https://developer.ilovepdf.com/user/projects
+ // to get your key pair, please visit https://iloveapi.com/user/projects
$my_task = new WatermarkTask( get_option( 'ilovepdf_user_public_key', true ), get_option( 'ilovepdf_user_private_key', true ) );
// file var keeps info about server file id, name...
diff --git a/admin/general-settings.php b/admin/general-settings.php
index dce711e..5360529 100644
--- a/admin/general-settings.php
+++ b/admin/general-settings.php
@@ -158,7 +158,7 @@ function ilove_pdf_popup_buymore_action() {
-
';
+ ';
}
add_action( 'admin_footer', 'ilove_pdf_popup_buymore_action' );
diff --git a/admin/partials/ilove-pdf-settings-display.php b/admin/partials/ilove-pdf-settings-display.php
index 4f61344..c466f51 100644
--- a/admin/partials/ilove-pdf-settings-display.php
+++ b/admin/partials/ilove-pdf-settings-display.php
@@ -62,12 +62,12 @@ function ilove_pdf_content_page_setting() {
-
+
@@ -78,7 +78,7 @@ function ilove_pdf_content_page_setting() {
$paid_files = ( $stats['files_used'] < $stats['free_files_limit'] ) ? 0 : $stats['files_used'] - $stats['free_files_limit'];
?>
-
/ Yearly subscription.', 'ilove-pdf' ) : __( 'processed files this month. Monthly subscription.', 'ilove-pdf' ), 'ilove_pdf_expanded_alowed_tags' ); ?>
+
/ Yearly subscription.', 'ilove-pdf' ) : __( 'credits used this month. Monthly subscription.', 'ilove-pdf' ), 'ilove_pdf_expanded_alowed_tags' ); ?>
@@ -87,12 +87,12 @@ function ilove_pdf_content_page_setting() {
- () »
-
+ () »
+
diff --git a/admin/partials/ilove-pdf-statistics-display.php b/admin/partials/ilove-pdf-statistics-display.php
index 9d4d222..428832b 100644
--- a/admin/partials/ilove-pdf-statistics-display.php
+++ b/admin/partials/ilove-pdf-statistics-display.php
@@ -44,12 +44,12 @@ function ilove_pdf_content_page_statistics() {
-
+
@@ -60,7 +60,7 @@ function ilove_pdf_content_page_statistics() {
$paid_files = ( $stats['files_used'] < $stats['free_files_limit'] ) ? 0 : $stats['files_used'] - $stats['free_files_limit'];
?>
-
/ Yearly subscription.', 'ilove-pdf' ) : __( 'processed files this month. Monthly subscription.', 'ilove-pdf' ), 'ilove_pdf_expanded_alowed_tags' ); ?>
+
/ Yearly subscription.', 'ilove-pdf' ) : __( 'credits used this month. Monthly subscription.', 'ilove-pdf' ), 'ilove_pdf_expanded_alowed_tags' ); ?>
@@ -69,12 +69,12 @@ function ilove_pdf_content_page_statistics() {
-
() »
-
+
() »
+
Tools
diff --git a/ilove-pdf.php b/ilove-pdf.php
index a56d368..63908c0 100644
--- a/ilove-pdf.php
+++ b/ilove-pdf.php
@@ -13,9 +13,9 @@
*
* @wordpress-plugin
* Plugin Name: iLovePDF
- * Plugin URI: https://developer.ilovepdf.com/
+ * Plugin URI: https://iloveapi.com/
* Description: Compress your PDF files and Stamp Images or text into PDF files. This is the Official iLovePDF plugin for WordPress. You can optimize all your PDF and stamp them automatically as you do in ilovepdf.com.
- * Version: 2.1.1
+ * Version: 2.1.2
* Requires at least: 5.3
* Requires PHP: 7.4
* Author: ILovePDF
@@ -52,6 +52,41 @@ function ilove_pdf_activate() {
}
register_activation_hook( __FILE__, 'ilove_pdf_activate' );
+/**
+ * Plugin update.
+ *
+ * Fires when the upgrader process is complete.
+ *
+ * @since 2.1.2
+ *
+ * @param object $upgrader_object Reference to the plugin upgrader object.
+ * @param array $options {
+ * Array of plugin update options.
+ *
+ * @type string $action Type of action. Default 'update'.
+ * @type string $type Type of plugin being updated. Default 'plugin'.
+ * @type string $slug Slug of the plugin being updated. Default ''.
+ * }
+ */
+function ilove_pdf_upgrade_plugin( $upgrader_object, $options ) {
+ if ( 'update' === $options['action'] && 'plugin' === $options['type'] ) {
+ foreach ( $options['plugins'] as $each_plugin ) {
+ if ( ILOVE_PDF_PLUGIN_NAME === $each_plugin ) {
+
+ $get_options = get_option( 'ilove_pdf_display_general_settings', array() );
+
+ if ( ! isset( $get_options['ilove_pdf_general_backup'] ) ) {
+ $get_options['ilove_pdf_general_backup'] = 1;
+ }
+
+ update_option( 'ilove_pdf_display_general_settings', $get_options );
+
+ }
+ }
+ }
+}
+add_action( 'upgrader_process_complete', 'ilove_pdf_upgrade_plugin', 10, 2 );
+
/**
* The code that runs during plugin deactivation.
* This action is documented in includes/class-ilove-pdf-deactivator.php
diff --git a/includes/Ilove_Pdf.php b/includes/Ilove_Pdf.php
index fcb54c4..5be7ee5 100644
--- a/includes/Ilove_Pdf.php
+++ b/includes/Ilove_Pdf.php
@@ -74,7 +74,7 @@ class Ilove_Pdf {
public function __construct() {
$this->plugin_name = 'ilove-pdf';
- $this->version = 'wp.2.1.1';
+ $this->version = 'wp.2.1.2';
$this->load_dependencies();
$this->set_locale();
diff --git a/includes/Ilove_Pdf_Activator.php b/includes/Ilove_Pdf_Activator.php
index 6d79e40..3c293c3 100644
--- a/includes/Ilove_Pdf_Activator.php
+++ b/includes/Ilove_Pdf_Activator.php
@@ -126,11 +126,7 @@ public static function set_default_values_watermark_settings() {
*/
public static function set_default_values_general_settings() {
- $get_options = get_option( 'ilove_pdf_display_general_settings' );
-
- if ( ! is_array( $get_options ) ) {
- $get_options = array();
- }
+ $get_options = get_option( 'ilove_pdf_display_general_settings', array() );
if ( ! isset( $get_options['ilove_pdf_general_backup'] ) ) {
$get_options['ilove_pdf_general_backup'] = 1;
diff --git a/package.json b/package.json
index 479e7df..239ab79 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,6 @@
"gulp-sass": "^5.1.0",
"gulp-uglify": "^3.0.2",
"merge-stream": "^2.0.0",
- "sass": "^1.77.1"
+ "sass": "^1.77.7"
}
}
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 75d3644..175ed62 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -2,27 +2,27 @@
"packages": [
{
"name": "firebase/php-jwt",
- "version": "v6.10.0",
- "version_normalized": "6.10.0.0",
+ "version": "v6.10.1",
+ "version_normalized": "6.10.1.0",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
- "reference": "a49db6f0a5033aef5143295342f1c95521b075ff"
+ "reference": "500501c2ce893c824c801da135d02661199f60c5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/firebase/php-jwt/zipball/a49db6f0a5033aef5143295342f1c95521b075ff",
- "reference": "a49db6f0a5033aef5143295342f1c95521b075ff",
+ "url": "https://api.github.com/repos/firebase/php-jwt/zipball/500501c2ce893c824c801da135d02661199f60c5",
+ "reference": "500501c2ce893c824c801da135d02661199f60c5",
"shasum": ""
},
"require": {
- "php": "^7.4||^8.0"
+ "php": "^8.0"
},
"require-dev": {
- "guzzlehttp/guzzle": "^6.5||^7.4",
+ "guzzlehttp/guzzle": "^7.4",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.5",
- "psr/cache": "^1.0||^2.0",
+ "psr/cache": "^2.0||^3.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0"
},
@@ -30,7 +30,7 @@
"ext-sodium": "Support EdDSA (Ed25519) signatures",
"paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
},
- "time": "2023-12-01T16:26:39+00:00",
+ "time": "2024-05-18T18:05:11+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -62,7 +62,7 @@
],
"support": {
"issues": "https://github.com/firebase/php-jwt/issues",
- "source": "https://github.com/firebase/php-jwt/tree/v6.10.0"
+ "source": "https://github.com/firebase/php-jwt/tree/v6.10.1"
},
"install-path": "../firebase/php-jwt"
},
@@ -402,17 +402,17 @@
},
{
"name": "ilovepdf/ilovepdf-php",
- "version": "v1.2.4",
- "version_normalized": "1.2.4.0",
+ "version": "v1.2.6",
+ "version_normalized": "1.2.6.0",
"source": {
"type": "git",
"url": "https://github.com/ilovepdf/ilovepdf-php.git",
- "reference": "23eceed19a94cab2cba224d38846787491e2c7f2"
+ "reference": "b9ab2bcb17f187a6a48b862deeb1e1f96794345c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ilovepdf/ilovepdf-php/zipball/23eceed19a94cab2cba224d38846787491e2c7f2",
- "reference": "23eceed19a94cab2cba224d38846787491e2c7f2",
+ "url": "https://api.github.com/repos/ilovepdf/ilovepdf-php/zipball/b9ab2bcb17f187a6a48b862deeb1e1f96794345c",
+ "reference": "b9ab2bcb17f187a6a48b862deeb1e1f96794345c",
"shasum": ""
},
"require": {
@@ -425,7 +425,7 @@
"phpunit/phpunit": "^9.5",
"vimeo/psalm": "^4.21"
},
- "time": "2024-04-04T10:59:30+00:00",
+ "time": "2024-06-20T12:42:02+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -447,7 +447,7 @@
"homepage": "https://ilovepdf.com/",
"support": {
"issues": "https://github.com/ilovepdf/ilovepdf-php/issues",
- "source": "https://github.com/ilovepdf/ilovepdf-php/tree/v1.2.4"
+ "source": "https://github.com/ilovepdf/ilovepdf-php/tree/v1.2.6"
},
"install-path": "../ilovepdf/ilovepdf-php"
},
@@ -503,17 +503,17 @@
},
{
"name": "phpstan/extension-installer",
- "version": "1.3.1",
- "version_normalized": "1.3.1.0",
+ "version": "1.4.1",
+ "version_normalized": "1.4.1.0",
"source": {
"type": "git",
"url": "https://github.com/phpstan/extension-installer.git",
- "reference": "f45734bfb9984c6c56c4486b71230355f066a58a"
+ "reference": "f6b87faf9fc7978eab2f7919a8760bc9f58f9203"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f45734bfb9984c6c56c4486b71230355f066a58a",
- "reference": "f45734bfb9984c6c56c4486b71230355f066a58a",
+ "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/f6b87faf9fc7978eab2f7919a8760bc9f58f9203",
+ "reference": "f6b87faf9fc7978eab2f7919a8760bc9f58f9203",
"shasum": ""
},
"require": {
@@ -526,7 +526,7 @@
"php-parallel-lint/php-parallel-lint": "^1.2.0",
"phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0"
},
- "time": "2023-05-24T08:59:17+00:00",
+ "time": "2024-06-10T08:20:49+00:00",
"type": "composer-plugin",
"extra": {
"class": "PHPStan\\ExtensionInstaller\\Plugin"
@@ -544,23 +544,23 @@
"description": "Composer plugin for automatic installation of PHPStan extensions",
"support": {
"issues": "https://github.com/phpstan/extension-installer/issues",
- "source": "https://github.com/phpstan/extension-installer/tree/1.3.1"
+ "source": "https://github.com/phpstan/extension-installer/tree/1.4.1"
},
"install-path": "../phpstan/extension-installer"
},
{
"name": "phpstan/phpstan",
- "version": "1.11.0",
- "version_normalized": "1.11.0.0",
+ "version": "1.11.7",
+ "version_normalized": "1.11.7.0",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
- "reference": "666cb1703742cea9cc80fee631f0940e1592fa6e"
+ "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/666cb1703742cea9cc80fee631f0940e1592fa6e",
- "reference": "666cb1703742cea9cc80fee631f0940e1592fa6e",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/52d2bbfdcae7f895915629e4694e9497d0f8e28d",
+ "reference": "52d2bbfdcae7f895915629e4694e9497d0f8e28d",
"shasum": ""
},
"require": {
@@ -569,7 +569,7 @@
"conflict": {
"phpstan/phpstan-shim": "*"
},
- "time": "2024-05-13T06:02:22+00:00",
+ "time": "2024-07-06T11:17:41+00:00",
"bin": [
"phpstan",
"phpstan.phar"
@@ -897,23 +897,23 @@
},
{
"name": "symfony/polyfill-php73",
- "version": "v1.29.0",
- "version_normalized": "1.29.0.0",
+ "version": "v1.30.0",
+ "version_normalized": "1.30.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "21bd091060673a1177ae842c0ef8fe30893114d2"
+ "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2",
- "reference": "21bd091060673a1177ae842c0ef8fe30893114d2",
+ "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1",
+ "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
- "time": "2024-01-29T20:11:03+00:00",
+ "time": "2024-05-31T15:07:36+00:00",
"type": "library",
"extra": {
"thanks": {
@@ -956,7 +956,7 @@
"shim"
],
"support": {
- "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0"
+ "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0"
},
"funding": [
{
diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php
index be3b6f2..c99adce 100644
--- a/vendor/composer/installed.php
+++ b/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => 'ilovepdf/ilovepdf-wp',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
- 'reference' => '97f36de86f0d00145a3a1ec5ba064e2d22d65a6d',
+ 'reference' => 'c465fc260ea39457acb659733b1f8cb99325ae4a',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -11,9 +11,9 @@
),
'versions' => array(
'firebase/php-jwt' => array(
- 'pretty_version' => 'v6.10.0',
- 'version' => '6.10.0.0',
- 'reference' => 'a49db6f0a5033aef5143295342f1c95521b075ff',
+ 'pretty_version' => 'v6.10.1',
+ 'version' => '6.10.1.0',
+ 'reference' => '500501c2ce893c824c801da135d02661199f60c5',
'type' => 'library',
'install_path' => __DIR__ . '/../firebase/php-jwt',
'aliases' => array(),
@@ -47,9 +47,9 @@
'dev_requirement' => false,
),
'ilovepdf/ilovepdf-php' => array(
- 'pretty_version' => 'v1.2.4',
- 'version' => '1.2.4.0',
- 'reference' => '23eceed19a94cab2cba224d38846787491e2c7f2',
+ 'pretty_version' => 'v1.2.6',
+ 'version' => '1.2.6.0',
+ 'reference' => 'b9ab2bcb17f187a6a48b862deeb1e1f96794345c',
'type' => 'library',
'install_path' => __DIR__ . '/../ilovepdf/ilovepdf-php',
'aliases' => array(),
@@ -58,7 +58,7 @@
'ilovepdf/ilovepdf-wp' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
- 'reference' => '97f36de86f0d00145a3a1ec5ba064e2d22d65a6d',
+ 'reference' => 'c465fc260ea39457acb659733b1f8cb99325ae4a',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -74,18 +74,18 @@
'dev_requirement' => true,
),
'phpstan/extension-installer' => array(
- 'pretty_version' => '1.3.1',
- 'version' => '1.3.1.0',
- 'reference' => 'f45734bfb9984c6c56c4486b71230355f066a58a',
+ 'pretty_version' => '1.4.1',
+ 'version' => '1.4.1.0',
+ 'reference' => 'f6b87faf9fc7978eab2f7919a8760bc9f58f9203',
'type' => 'composer-plugin',
'install_path' => __DIR__ . '/../phpstan/extension-installer',
'aliases' => array(),
'dev_requirement' => true,
),
'phpstan/phpstan' => array(
- 'pretty_version' => '1.11.0',
- 'version' => '1.11.0.0',
- 'reference' => '666cb1703742cea9cc80fee631f0940e1592fa6e',
+ 'pretty_version' => '1.11.7',
+ 'version' => '1.11.7.0',
+ 'reference' => '52d2bbfdcae7f895915629e4694e9497d0f8e28d',
'type' => 'library',
'install_path' => __DIR__ . '/../phpstan/phpstan',
'aliases' => array(),
@@ -155,9 +155,9 @@
'dev_requirement' => false,
),
'symfony/polyfill-php73' => array(
- 'pretty_version' => 'v1.29.0',
- 'version' => '1.29.0.0',
- 'reference' => '21bd091060673a1177ae842c0ef8fe30893114d2',
+ 'pretty_version' => 'v1.30.0',
+ 'version' => '1.30.0.0',
+ 'reference' => 'ec444d3f3f6505bb28d11afa41e75faadebc10a1',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/polyfill-php73',
'aliases' => array(),
diff --git a/vendor/firebase/php-jwt/CHANGELOG.md b/vendor/firebase/php-jwt/CHANGELOG.md
index 644fa0b..2662b05 100644
--- a/vendor/firebase/php-jwt/CHANGELOG.md
+++ b/vendor/firebase/php-jwt/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## [6.10.1](https://github.com/firebase/php-jwt/compare/v6.10.0...v6.10.1) (2024-05-18)
+
+
+### Bug Fixes
+
+* ensure ratelimit expiry is set every time ([#556](https://github.com/firebase/php-jwt/issues/556)) ([09cb208](https://github.com/firebase/php-jwt/commit/09cb2081c2c3bc0f61e2f2a5fbea5741f7498648))
+* ratelimit cache expiration ([#550](https://github.com/firebase/php-jwt/issues/550)) ([dda7250](https://github.com/firebase/php-jwt/commit/dda725033585ece30ff8cae8937320d7e9f18bae))
+
## [6.10.0](https://github.com/firebase/php-jwt/compare/v6.9.0...v6.10.0) (2023-11-28)
diff --git a/vendor/firebase/php-jwt/README.md b/vendor/firebase/php-jwt/README.md
index 701de23..4fd1407 100644
--- a/vendor/firebase/php-jwt/README.md
+++ b/vendor/firebase/php-jwt/README.md
@@ -17,7 +17,7 @@ composer require firebase/php-jwt
```
Optionally, install the `paragonie/sodium_compat` package from composer if your
-php is < 7.2 or does not have libsodium installed:
+php env does not have libsodium installed:
```bash
composer require paragonie/sodium_compat
diff --git a/vendor/firebase/php-jwt/composer.json b/vendor/firebase/php-jwt/composer.json
index e23dfe3..816cfd0 100644
--- a/vendor/firebase/php-jwt/composer.json
+++ b/vendor/firebase/php-jwt/composer.json
@@ -20,7 +20,7 @@
],
"license": "BSD-3-Clause",
"require": {
- "php": "^7.4||^8.0"
+ "php": "^8.0"
},
"suggest": {
"paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present",
@@ -32,10 +32,10 @@
}
},
"require-dev": {
- "guzzlehttp/guzzle": "^6.5||^7.4",
+ "guzzlehttp/guzzle": "^7.4",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.5",
- "psr/cache": "^1.0||^2.0",
+ "psr/cache": "^2.0||^3.0",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0"
}
diff --git a/vendor/firebase/php-jwt/src/CachedKeySet.php b/vendor/firebase/php-jwt/src/CachedKeySet.php
index ee529f9..65bab74 100644
--- a/vendor/firebase/php-jwt/src/CachedKeySet.php
+++ b/vendor/firebase/php-jwt/src/CachedKeySet.php
@@ -212,15 +212,21 @@ private function rateLimitExceeded(): bool
}
$cacheItem = $this->cache->getItem($this->rateLimitCacheKey);
- if (!$cacheItem->isHit()) {
- $cacheItem->expiresAfter(1); // # of calls are cached each minute
+
+ $cacheItemData = [];
+ if ($cacheItem->isHit() && \is_array($data = $cacheItem->get())) {
+ $cacheItemData = $data;
}
- $callsPerMinute = (int) $cacheItem->get();
+ $callsPerMinute = $cacheItemData['callsPerMinute'] ?? 0;
+ $expiry = $cacheItemData['expiry'] ?? new \DateTime('+60 seconds', new \DateTimeZone('UTC'));
+
if (++$callsPerMinute > $this->maxCallsPerMinute) {
return true;
}
- $cacheItem->set($callsPerMinute);
+
+ $cacheItem->set(['expiry' => $expiry, 'callsPerMinute' => $callsPerMinute]);
+ $cacheItem->expiresAt($expiry);
$this->cache->save($cacheItem);
return false;
}
diff --git a/vendor/firebase/php-jwt/src/JWT.php b/vendor/firebase/php-jwt/src/JWT.php
index 2634920..e9d7563 100644
--- a/vendor/firebase/php-jwt/src/JWT.php
+++ b/vendor/firebase/php-jwt/src/JWT.php
@@ -251,6 +251,9 @@ public static function sign(
return \hash_hmac($algorithm, $msg, $key, true);
case 'openssl':
$signature = '';
+ if (!\is_resource($key) && !openssl_pkey_get_private($key)) {
+ throw new DomainException('OpenSSL unable to validate key');
+ }
$success = \openssl_sign($msg, $signature, $key, $algorithm); // @phpstan-ignore-line
if (!$success) {
throw new DomainException('OpenSSL unable to sign data');
diff --git a/vendor/ilovepdf/ilovepdf-php/samples/sign_management.php b/vendor/ilovepdf/ilovepdf-php/samples/sign_management.php
index 2b39d07..349f83e 100644
--- a/vendor/ilovepdf/ilovepdf-php/samples/sign_management.php
+++ b/vendor/ilovepdf/ilovepdf-php/samples/sign_management.php
@@ -7,7 +7,7 @@
use Ilovepdf\SignatureManagement;
$signatureRequest = new SignatureManagement("publickey", "secretkey");
-$signatureToken = "signaturetoken";
+$signatureToken = "token_requester";
$receiverToken = "receivertoken";
// Get a list of all created signature requests
diff --git a/vendor/ilovepdf/ilovepdf-php/src/Ilovepdf.php b/vendor/ilovepdf/ilovepdf-php/src/Ilovepdf.php
index 174ea3c..71e7256 100644
--- a/vendor/ilovepdf/ilovepdf-php/src/Ilovepdf.php
+++ b/vendor/ilovepdf/ilovepdf-php/src/Ilovepdf.php
@@ -4,6 +4,7 @@
use Ilovepdf\Exceptions\DownloadException;
use Ilovepdf\Exceptions\ProcessException;
+use Ilovepdf\Exceptions\SignatureException;
use Ilovepdf\Exceptions\StartException;
use Ilovepdf\Exceptions\TaskException;
use Ilovepdf\Exceptions\UploadException;
@@ -45,7 +46,7 @@ class Ilovepdf
*/
public static $apiVersion = 'v1';
- const VERSION = 'php.1.2.3';
+ const VERSION = 'php.1.2.6';
/**
* @var string|null
@@ -264,7 +265,7 @@ public function sendRequest(string $method, string $endpoint, array $params = []
}
//signature exception
if(strpos($endpoint, 'signature') !== false){
- throw new ProcessException($responseBody->error->type, $responseBody, $response->getStatusCode());
+ throw new SignatureException($responseBody->error->type, $responseBody, $response->getStatusCode());
}
if (isset($responseBody->error) && isset($responseBody->error->type)) {
diff --git a/vendor/ilovepdf/ilovepdf-php/src/PdfocrTask.php b/vendor/ilovepdf/ilovepdf-php/src/PdfocrTask.php
new file mode 100644
index 0000000..261271f
--- /dev/null
+++ b/vendor/ilovepdf/ilovepdf-php/src/PdfocrTask.php
@@ -0,0 +1,74 @@
+tool = 'pdfocr';
+ parent::__construct($publicKey, $secretKey, $makeStart);
+ }
+
+ /**
+ * Add a language to ocr
+ *
+ * @param string $lang values:['eng','afr','amh','ara','asm','aze','aze_cyrl','bel','ben','bod','bos','bre','bul','cat','ceb','ces','chi_sim','chi_tra','chr','cos','cym','dan','deu','deu_latf','dzo','ell','enm','epo','equ','est','eus','fao','fas','fil','fin','fra','frm','fry','gla','gle','glg','grc','guj','hat','heb','hin','hrv','hun','hye','iku','ind','isl','ita','ita_old','jav','jpn','kan','kat','kat_old','kaz','khm','kir','kmr','kor','kor_vert','lao','lat','lav','lit','ltz','mal','mar','mkd','mlt','mon','mri','msa','mya','nep','nld','nor','oci','ori','pan','pol','por','pus','que','ron','rus','san','sin','slk','slv','snd','spa','spa_old','sqi','srp','srp_latn','sun','swa','swe','syr','tam','tat','tel','tgk','tgl','tha','tir','ton','tur','uig','ukr','urd','uzb','uzb_cyrl','vie','yid','yor'] default: "pages"
+ * @return $this
+ */
+ public function addLanguage($lang): self
+ {
+ if($lang == null || ! in_array($lang, $this->ocrLanguageValues)){
+ throw new \InvalidArgumentException();
+ }
+ if(!in_array($lang, $this->ocr_languages)){
+ $this->ocr_languages[] = $lang;
+ }
+
+ return $this;
+ }
+
+
+
+ /**
+ * Add a language to ocr
+ *
+ * @param string[] $langs values:['eng','afr','amh','ara','asm','aze','aze_cyrl','bel','ben','bod','bos','bre','bul','cat','ceb','ces','chi_sim','chi_tra','chr','cos','cym','dan','deu','deu_latf','dzo','ell','enm','epo','equ','est','eus','fao','fas','fil','fin','fra','frm','fry','gla','gle','glg','grc','guj','hat','heb','hin','hrv','hun','hye','iku','ind','isl','ita','ita_old','jav','jpn','kan','kat','kat_old','kaz','khm','kir','kmr','kor','kor_vert','lao','lat','lav','lit','ltz','mal','mar','mkd','mlt','mon','mri','msa','mya','nep','nld','nor','oci','ori','pan','pol','por','pus','que','ron','rus','san','sin','slk','slv','snd','spa','spa_old','sqi','srp','srp_latn','sun','swa','swe','syr','tam','tat','tel','tgk','tgl','tha','tir','ton','tur','uig','ukr','urd','uzb','uzb_cyrl','vie','yid','yor'] default: "pages"
+ * @return $this
+ */
+ public function setLanguages($langs): self
+ {
+ if($langs == null || ! is_array($langs)){
+ throw new \InvalidArgumentException();
+ }
+ foreach($langs as $lang){
+ if(!in_array($lang, $this->ocrLanguageValues)){
+ throw new \InvalidArgumentException();
+ }
+ }
+ $this->ocr_languages = $langs;
+
+ return $this;
+ }
+}
diff --git a/vendor/ilovepdf/ilovepdf-php/src/SignTask.php b/vendor/ilovepdf/ilovepdf-php/src/SignTask.php
index d0859f2..744828c 100644
--- a/vendor/ilovepdf/ilovepdf-php/src/SignTask.php
+++ b/vendor/ilovepdf/ilovepdf-php/src/SignTask.php
@@ -337,7 +337,7 @@ public function execute()
//$response = parent::sendRequest('post', 'signature', http_build_query($body, null, '&', PHP_QUERY_RFC3986));
$response = parent::sendRequest('post', 'signature', $body,false);
try {
- $this->result = json_decode($response->getBody());
+ $this->result = json_decode($response->getBody()->getContents());
}
catch(\Exception $e){
throw new ProcessException('Bad request');
diff --git a/vendor/ilovepdf/ilovepdf-php/src/SignatureManagement.php b/vendor/ilovepdf/ilovepdf-php/src/SignatureManagement.php
index 930a1da..7b3d2d5 100644
--- a/vendor/ilovepdf/ilovepdf-php/src/SignatureManagement.php
+++ b/vendor/ilovepdf/ilovepdf-php/src/SignatureManagement.php
@@ -2,6 +2,7 @@
namespace Ilovepdf;
+use Psr\Http\Message\ResponseInterface;
use stdClass;
use Ilovepdf\Exceptions\DownloadException;
@@ -18,6 +19,7 @@ class SignatureManagement extends Ilovepdf
* @param int $per_page
*
* @return array
+ * @throws \Exception
*/
public function getSignaturesList($page = 0, $per_page = 20): array
{
@@ -26,26 +28,26 @@ public function getSignaturesList($page = 0, $per_page = 20): array
"per-page" => $per_page
];
$response = parent::sendRequest("get", "signature/list", $data);
- $headers = $response->headers;
- $return = [
- "signatures" => $response->body,
+ $headers = $response->getHeaders();
+ return [
+ "signatures" => $response->getBody()->getContents(),
"pagination" => [
'totalCount' => $headers && isset($headers['X-Pagination-Total-Count']) ? $headers['X-Pagination-Total-Count'] : '',
- 'page' => $headers && isset($headers['X-Pagination-Current-Page']) ? $headers['X-Pagination-Current-Page'] - 1 : '',
+ 'page' => $headers && isset($headers['X-Pagination-Current-Page']) ? (int)$headers['X-Pagination-Current-Page'] - 1 : '',
'pageSize' => $headers && isset($headers['X-Pagination-Per-Page']) ? $headers['X-Pagination-Per-Page'] : ''
]
];
- return $return;
}
/**
* @param string $signatureId
*
* @return stdClass
+ * @throws \Exception
*/
public function getSignatureStatus(string $signatureId): stdClass
{
- return parent::sendRequest("get", "signature/requesterview/{$signatureId}")->body;
+ return json_decode(parent::sendRequest("get", "signature/requesterview/{$signatureId}")->getBody()->getContents());
}
/**
@@ -95,10 +97,10 @@ public function downloadSignedFiles(string $signatureId, string $pathToSave, str
*/
public function fixReceiverEmail(string $receiverTokenRequester, string $newEmail): bool
{
- $body = [
+ $body = ['form_params' => [
"email" => $newEmail
- ];
- $response = parent::sendRequest("put", "signature/signer/fix-email/{$receiverTokenRequester}", $body, false, true);
+ ]];
+ parent::sendRequest("put", "signature/signer/fix-email/{$receiverTokenRequester}", $body, false, true);
//if above fails, it throws an exception
return true;
}
@@ -111,9 +113,9 @@ public function fixReceiverEmail(string $receiverTokenRequester, string $newEmai
*/
public function fixSignerPhone(string $signerTokenRequester, string $newPhone): bool
{
- $body = [
+ $body = ['form_params' => [
"phone" => $newPhone
- ];
+ ]];
$response = parent::sendRequest("put", "signature/signer/fix-phone/{$signerTokenRequester}", $body, false, true);
//if above fails, it throws an exception
return true;
@@ -127,7 +129,7 @@ public function fixSignerPhone(string $signerTokenRequester, string $newPhone):
public function sendReminders(string $signatureId): bool
{
$body = [];
- $response = parent::sendRequest("post", "signature/sendReminder/{$signatureId}", $body, false, true);
+ parent::sendRequest("post", "signature/sendReminder/{$signatureId}", $body, false, true);
//if above fails, it throws an exception
return true;
}
@@ -136,11 +138,12 @@ public function sendReminders(string $signatureId): bool
* @param string $signatureId
*
* @return bool
+ * @throws \Exception
*/
public function voidSignature(string $signatureId): bool
{
$body = [];
- $response = parent::sendRequest("put", "signature/void/{$signatureId}", $body, false, true);
+ parent::sendRequest("put", "signature/void/{$signatureId}", $body, false, true);
//if above fails, it throws an exception
return true;
}
@@ -150,13 +153,14 @@ public function voidSignature(string $signatureId): bool
* @param int $amountOfDays
*
* @return bool
+ * @throws \Exception
*/
public function increaseExpirationDays(string $signatureId, int $amountOfDays): bool
{
$body = [
"days" => $amountOfDays
];
- $response = parent::sendRequest("put", "signature/void/{$signatureId}", $body, false, true);
+ parent::sendRequest("put", "signature/void/{$signatureId}", $body, false, true);
//if above fails, it throws an exception
return true;
}
@@ -165,10 +169,11 @@ public function increaseExpirationDays(string $signatureId, int $amountOfDays):
* @param string $receiverTokenRequester
*
* @return stdClass
+ * @throws \Exception
*/
public function getReceiverInfo(string $receiverTokenRequester): stdClass
{
- return parent::sendRequest("get", "signature/receiver/info/{$receiverTokenRequester}")->body;
+ return json_decode(parent::sendRequest("get", "signature/receiver/info/{$receiverTokenRequester}")->getBody()->getContents());
}
/**
@@ -189,15 +194,16 @@ private function getExtensionFromMime(string $mime_type)
return explode("/", $mime_type)[1];
}
- protected function downloadResponseToFile($response, string $pathToSave, string $filename): string
+ protected function downloadResponseToFile(ResponseInterface $response, string $pathToSave, string $filename): string
{
if (!is_dir($pathToSave)) {
throw new \Exception("{$pathToSave} is not a directory");
}
- $mime_type = $response->headers["Content-Type"];
- $filePath = "{$pathToSave}/{$filename}." . $this->getExtensionFromMime($mime_type);
- if (!file_put_contents($filePath, $response->raw_body)) {
- throw new DownloadException("Download success, but could not save the contents of the file to {$filePath}. Check permissions of the directory", 1, null, $response);
+ $mime_type = $response->getHeaders()["Content-Type"];
+ $filePath = "{$pathToSave}/{$filename}." . $this->getExtensionFromMime($mime_type[0]);
+ $fileContent = $response->getBody()->getContents();
+ if (!file_put_contents($filePath, $fileContent)) {
+ throw new DownloadException("Download success, but could not save the contents of the file to {$filePath}. Check permissions of the directory", 1, null, $fileContent);
}
return $filePath;
}