Skip to content

Commit

Permalink
Merge pull request #16 from ilovepdf/develop
Browse files Browse the repository at this point in the history
Feature/v2.0.0 (#15)
  • Loading branch information
diegocrombie authored Oct 12, 2023
2 parents 2a1c140 + d6cb580 commit e62a75b
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 196 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Node/composer artifact files
node_modules/
vendor/
dist/
composer.lock
package-lock.json

Expand All @@ -17,10 +16,6 @@ package-lock.json
# Package files
*.jar

# Maven
target/
dist/

# JetBrains IDE
.idea/

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
=== PDF Compressor & Watermark - iLovePDF ===
Plugin Name: Image Compressor & Optimizer - iLovePDF
Version: 1.2.4
Version: 2.0.0
Author: iLovePDF
Author URI: https://www.ilovepdf.com/
Contributors: iLovePDF
Tags: compress, watermark, optimize, performance, pdf optimizer
Requires at least: 4.7
Tested up to: 5.8.2
Stable tag: 1.2.4
Requires PHP: 7.1
Requires at least: 5.3
Tested up to: 6.3.1
Stable tag: 2.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down
35 changes: 22 additions & 13 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=== iLovePDF WP ===
Contributors: iLovePDF
Tags: pdf, api, watermark, compress, optimize, bulk, compress pdf, stamp pdf
Requires at least: 4.7
Tested up to: 5.8.2
Stable tag: 1.2.4
Requires PHP: 7.1
Requires at least: 5.3
Tested up to: 6.3.1
Stable tag: 2.0.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -78,15 +78,14 @@ We will send you an email before limit is reached. When limit is reached, no mor

== Changelog ==

= 1.0 =
* Initial version.

= 1.2.2 =
* update version
= 2.0.0 =
Changed
* Minimum Support WP Version to 5.3
* Minimum Support PHP to 7.4
* remove public folder, not used.

= 1.2.3 =
* match version and tag.
* update readme
Fixed
* fix bulk actions to compress and watermark functions

= 1.2.4 =
Added
Expand Down Expand Up @@ -124,4 +123,14 @@ Fixed
* data types in parameters
* variables not defined
* check if watermark image is empty
* set value default if compress size is null|empty
* set value default if compress size is null|empty

= 1.2.3 =
* match version and tag.
* update readme

= 1.2.2 =
* update version

= 1.0 =
* Initial version.
12 changes: 6 additions & 6 deletions admin/functions-compress.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,15 @@ function ilove_pdf_compress_action() {

$html = '';

if ( isset( $_GET['action'] ) && 'ilovepdf_compress' === $_GET['action'] && isset( $_GET['nonce_ilove_pdf_compress'] ) && wp_verify_nonce( sanitize_key( $_GET['nonce_ilove_pdf_compress'] ), 'admin-post' ) && isset( $_GET['id'] ) && intval( $_GET['id'] ) ) {
$id = intval( $_GET['id'] );
if ( isset( $_GET['action'] ) && 'ilovepdf_compress' === $_GET['action'] && isset( $_GET['id'] ) && intval( $_GET['id'] ) ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$id = intval( $_GET['id'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$html = ilove_pdf_compress_pdf( $id, true );

} elseif ( isset( $_GET['action'] ) && 'ilovepdf_compress' === $_GET['action'] && isset( $_GET['nonce_ilove_pdf_compress'] ) && wp_verify_nonce( sanitize_key( $_GET['nonce_ilove_pdf_compress'] ), 'admin-post' ) ) {
} elseif ( isset( $_GET['action'] ) && 'ilovepdf_compress' === $_GET['action'] ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
ilove_pdf_compress_pdf( null, false );
}

if ( isset( $_GET['ajax'] ) ) {
if ( isset( $_GET['ajax'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
$return = array();

if ( isset( $id ) ) {
Expand All @@ -265,12 +265,12 @@ function ilove_pdf_compress_action() {
}

$return['library'] = 0;
if ( isset( $_GET['library'] ) ) {
if ( isset( $_GET['library'] ) ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$return['library'] = 1;
}

$return['editpdf'] = 0;
if ( isset( $_GET['editpdf'] ) ) {
if ( isset( $_GET['editpdf'] ) ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$return['editpdf'] = 1;
}

Expand Down
14 changes: 7 additions & 7 deletions admin/functions-watermark.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,24 +301,24 @@ function ilove_pdf_watermark_action() {

$html = '';

if ( isset( $_GET['action'] ) && 'ilovepdf_watermark' === $_GET['action'] && isset( $_GET['nonce_ilove_pdf_watermark'] ) && wp_verify_nonce( sanitize_key( $_GET['nonce_ilove_pdf_watermark'] ), 'admin-post' ) && isset( $_GET['id'] ) && intval( $_GET['id'] ) ) {
$id = intval( $_GET['id'] );
$html = ilove_pdf_watermark_pdf( intval( $_GET['id'] ), true );
if ( isset( $_GET['action'] ) && 'ilovepdf_watermark' === $_GET['action'] && isset( $_GET['id'] ) && intval( $_GET['id'] ) ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$id = intval( $_GET['id'] );// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$html = ilove_pdf_watermark_pdf( intval( $_GET['id'] ), true );// phpcs:ignore WordPress.Security.NonceVerification.Recommended

} elseif ( isset( $_GET['action'] ) && 'ilovepdf_watermark' === $_GET['action'] && isset( $_GET['nonce_ilove_pdf_watermark'] ) && wp_verify_nonce( sanitize_key( $_GET['nonce_ilove_pdf_watermark'] ), 'admin-post' ) ) {
} elseif ( isset( $_GET['action'] ) && 'ilovepdf_watermark' === $_GET['action'] ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
ilove_pdf_watermark_pdf( null, false );
}

if ( isset( $_GET['ajax'] ) ) {
if ( isset( $_GET['ajax'] ) ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$return = array();

$return['library'] = 0;
if ( isset( $_GET['library'] ) ) {
if ( isset( $_GET['library'] ) ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$return['library'] = 1;
}

$return['editpdf'] = 0;
if ( isset( $_GET['editpdf'] ) ) {
if ( isset( $_GET['editpdf'] ) ) {// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$return['editpdf'] = 1;
}

Expand Down
4 changes: 2 additions & 2 deletions admin/partials/ilove-pdf-statistics-display.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function ilove_pdf_content_page_statistics() {
<?php endif; ?>
<td>
<?php if ( ! ilove_pdf_is_file_compressed( get_the_ID() ) ) : ?>
<a href="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>?action=ilovepdf_compress&id=<?php echo (int) get_the_ID(); ?>&nonce_ilove_pdf_compress=<?php echo esc_html( wp_create_nonce( 'admin-post' ) ); ?>" class="button-primary media-ilovepdf-box btn-compress"><?php esc_html_e( 'Compress', 'ilove-pdf' ); ?></a>
<a href="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>?action=ilovepdf_compress&id=<?php echo (int) get_the_ID(); ?>" class="button-primary media-ilovepdf-box btn-compress"><?php esc_html_e( 'Compress', 'ilove-pdf' ); ?></a>
<span class="compressing pdf-status"><?php esc_html_e( 'Compressing', 'ilove-pdf' ); ?>...</span>
<span class="error pdf-status"><?php esc_html_e( 'Error', 'ilove-pdf' ); ?></span>
<span class="success pdf-status"><?php esc_html_e( 'Completed', 'ilove-pdf' ); ?></span>
Expand Down Expand Up @@ -318,7 +318,7 @@ function ilove_pdf_content_page_statistics() {
<td><?php echo esc_html( size_format( filesize( get_attached_file( get_the_ID() ) ), 2 ) ); ?></td>
<td>
<?php if ( ! ilove_pdf_is_file_watermarked( get_the_ID() ) ) : ?>
<a href="<?php echo esc_url( add_query_arg( 'nonce_ilove_pdf_watermark', wp_create_nonce( 'admin-post' ), admin_url( 'admin-post.php' ) . '?action=ilovepdf_watermark&id=' . get_the_ID() ) ); ?>" class="button-primary media-ilovepdf-box btn-watermark"><?php esc_html_e( 'Apply Watermark', 'ilove-pdf' ); ?></a>
<a href="<?php echo esc_url( admin_url( 'admin-post.php?action=ilovepdf_watermark&id=' . get_the_ID() ) ); ?>" class="button-primary media-ilovepdf-box btn-watermark"><?php esc_html_e( 'Apply Watermark', 'ilove-pdf' ); ?></a>
<span class="applying-watermark pdf-status"><?php esc_html_e( 'Applying Watermark', 'ilove-pdf' ); ?>...</span>
<span class="error pdf-status"><?php esc_html_e( 'Error', 'ilove-pdf' ); ?></span>
<span class="success pdf-status"><?php esc_html_e( 'Completed', 'ilove-pdf' ); ?></span>
Expand Down
11 changes: 11 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
{
"name": "ilovepdf/ilovepdf-wp",
"description": "iLovePDF Wordpress Plugin",
"type": "wordpress-plugin",
"homepage": "https://ilovepdf.com/",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "ilovepdf",
"email": "[email protected]"
}
],
"require-dev": {
"phpstan/phpstan": "^1.10",
"szepeviktor/phpstan-wordpress": "^1.3",
Expand Down
6 changes: 3 additions & 3 deletions ilove-pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* Plugin Name: iLovePDF
* Plugin URI: https://developer.ilovepdf.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: 1.2.4
* Requires at least: 4.7
* Requires PHP: 7.1
* Version: 2.0.0
* Requires at least: 5.3
* Requires PHP: 7.4
* Author: ILovePDF
* Author URI: https://ilovepdf.com/
* License: GPL-2.0+
Expand Down
2 changes: 1 addition & 1 deletion includes/class-ilove-pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Ilove_Pdf {
public function __construct() {

$this->plugin_name = 'ilove-pdf';
$this->version = 'wp.1.2.4';
$this->version = 'wp.2.0.0';

$this->load_dependencies();
$this->set_locale();
Expand Down
4 changes: 1 addition & 3 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<property name="prefixes" type="array">
<element value="ilove_pdf"/>
</property>

</properties>
</rule>
<rule ref="WordPress"></rule>
Expand All @@ -32,6 +31,5 @@
<rule ref="Generic.Commenting.DocComment.MissingShort">
<severity>0</severity>
</rule>
<config name="minimum_wp_version" value="4.7"/>
<!-- <rule ref="Squiz.Commenting.DocCommentAlignment"></rule> -->
<config name="minimum_wp_version" value="5.3"/>
</ruleset>
98 changes: 0 additions & 98 deletions public/class-ilove-pdf-public.php

This file was deleted.

4 changes: 0 additions & 4 deletions public/css/ilove-pdf-public.css

This file was deleted.

Binary file removed public/img/iLpdf_banner_A.jpg
Binary file not shown.
Binary file removed public/img/iLpdf_banner_A_1544x300.jpg
Binary file not shown.
1 change: 0 additions & 1 deletion public/index.php

This file was deleted.

32 changes: 0 additions & 32 deletions public/js/ilove-pdf-public.js

This file was deleted.

16 changes: 0 additions & 16 deletions public/partials/ilove-pdf-public-display.php

This file was deleted.

0 comments on commit e62a75b

Please sign in to comment.