Skip to content

Commit

Permalink
Merge pull request #21 from ilovepdf/develop
Browse files Browse the repository at this point in the history
Feature/v2.0.2 (#20)
  • Loading branch information
diegocrombie authored Nov 13, 2023
2 parents cc03802 + 7a3466a commit d5618c2
Show file tree
Hide file tree
Showing 314 changed files with 32,373 additions and 2,665 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Check if vendor directory exists and remove it
run: |
if [ -d "vendor" ]; then
echo "Removing existing vendor directory"
rm -rf vendor
fi
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
- name: Install Composer Dependencies
run: composer install
run: |
composer install
composer dump-autoload
- name: Run PHPStan
run: vendor/bin/phpstan analyse
19 changes: 18 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
# Node/composer artifact files
node_modules/
vendor/
vendor/*
!/vendor/autoload.php
!/vendor/composer/
!/vendor/ilovepdf/
!/vendor/firebase/
!/vendor/guzzlehttp/
!/vendor/psr/
!/vendor/ralouphie/
!/vendor/symfony/
composer.lock
package-lock.json
/lib/*
!/lib/autoload.php
!/lib/composer/
!/lib/ilovepdf/
!/lib/firebase/
!/lib/guzzlehttp/
!/lib/psr/
!/lib/ralouphie/
!/lib/symfony/

# Compiled Java class files
*.class
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
=== PDF Compressor & Watermark - iLovePDF ===
Plugin Name: Image Compressor & Optimizer - iLovePDF
Version: 2.0.1
Version: 2.0.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.4.1
Stable tag: 2.0.1
Stable tag: 2.0.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down
9 changes: 7 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
=== PDF Compressor & Watermark - iLovePDF ===
Plugin Name: Image Compressor & Optimizer - iLovePDF
Version: 2.0.1
Version: 2.0.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.4.1
Stable tag: 2.0.1
Stable tag: 2.0.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -82,6 +82,11 @@ We will send you an email before limit is reached. When limit is reached, no mor

== Changelog ==

== 2.0.2 ==
Added
* Improved class loading.
* Update library ilovepdf to v1.2.2

== 2.0.1 ==
Changed
* Remove Function Upload duplicate. Caused an error loading pdf files.
Expand Down
2 changes: 2 additions & 0 deletions admin/class-ilove-pdf-admin.php → admin/Ilove_Pdf_Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* @subpackage Ilove_Pdf/admin
*/

namespace Ilove_Pdf_Admin;

/**
* The admin-specific functionality of the plugin.
*
Expand Down
2 changes: 1 addition & 1 deletion admin/functions-watermark.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function ilove_pdf_watermark_pdf( $id_file, $auto = false, $bulk = false ) {

if ( isset( $options['ilove_pdf_format_watermark_image'] ) && ! empty( $options['ilove_pdf_format_watermark_image'] ) ) {
$image = $my_task->addFile( get_attached_file( $options['ilove_pdf_format_watermark_image'] ) );
$my_task->setImage( $image->getServerFilename() ); // @phpstan-ignore-line
$my_task->setImage( $image->getServerFilename() );
}

if ( isset( $options['ilove_pdf_format_watermark_opacity'] ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@
require __DIR__ . '/functions-watermark.php';
require __DIR__ . '/functions-statistics.php';

require_once plugin_dir_path( __DIR__ ) . 'lib/ilovepdf-php-master/init.php';

/**
* Add Menu Page to Dashboard.
*
* @since 1.0.0
*/
function ilove_pdf_menu() {
// Añade una página de menú a WordPress

// Add page menu to WordPress dashboard
add_submenu_page(
'options-general.php', // Register this submenu with the menu defined above
'iLovePDF Settings', // The text to the display in the browser when this menu item is active
Expand Down
28 changes: 14 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"email": "[email protected]"
}
],
"require": {
"ilovepdf/ilovepdf-php": "^1.2"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"szepeviktor/phpstan-wordpress": "^1.3",
Expand All @@ -21,19 +24,16 @@
}
},
"scripts": {
"post-install-cmd": [
"@stan",
"@phpcs",
"@phpcbf"
],
"stan": [
"vendor/bin/phpstan analyse --memory-limit=-1 --error-format=table > ../../../phpstan-report-ilovepdf.txt"
],
"phpcs": [
"phpcs -s --ignore=*/vendor/*,*/lib/*,*/.github/* --report-file=../../../condesniffer-report-ilovepdf.txt ./"
],
"phpcbf": [
"phpcbf --ignore=vendor/,lib/,.github/ ./"
]
"stan": "vendor/bin/phpstan analyse --memory-limit=-1 --error-format=table > ../../../phpstan-report-ilovepdf.txt",
"phpcs": "phpcs -s --ignore=*/vendor/*,*/lib/*,*/.github/* --report-file=../../../condesniffer-report-ilovepdf.txt ./",
"phpcbf": "phpcbf --ignore=vendor/,lib/,.github/ ./",
"autoload-dev": "composer dump-autoload",
"autoload-prod": "composer dump-autoload --no-dev"
},
"autoload": {
"psr-4": {
"Ilove_Pdf_Admin\\": "admin",
"Ilove_Pdf_Includes\\": "includes"
}
}
}
19 changes: 8 additions & 11 deletions ilove-pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* 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: 2.0.1
* Version: 2.0.2
* Requires at least: 5.3
* Requires PHP: 7.4
* Author: ILovePDF
Expand All @@ -33,15 +33,20 @@

define( 'ILOVE_PDF_ASSETS_PLUGIN_PATH', plugin_dir_url( __FILE__ ) );

require_once plugin_dir_path( __FILE__ ) . '/vendor/autoload.php';

use Ilove_Pdf_Includes\Ilove_Pdf;
use Ilove_Pdf_Includes\Ilove_Pdf_Activator;
use Ilove_Pdf_Includes\Ilove_Pdf_Deactivator;

require __DIR__ . '/includes/utility-functions.php';
require __DIR__ . '/admin/ilove-pdf-admin.php';
require __DIR__ . '/admin/ilove-pdf-admin-page-settings.php';

/**
* The code that runs during plugin activation.
* This action is documented in includes/class-ilove-pdf-activator.php
*/
function ilove_pdf_activate() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-ilove-pdf-activator.php';
Ilove_Pdf_Activator::activate();
}
register_activation_hook( __FILE__, 'ilove_pdf_activate' );
Expand All @@ -51,17 +56,10 @@ function ilove_pdf_activate() {
* This action is documented in includes/class-ilove-pdf-deactivator.php
*/
function ilove_pdf_deactivate() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-ilove-pdf-deactivator.php';
Ilove_Pdf_Deactivator::deactivate();
}
register_deactivation_hook( __FILE__, 'ilove_pdf_deactivate' );

/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-ilove-pdf.php';

/**
* Begins execution of the plugin.
*
Expand All @@ -71,7 +69,6 @@ function ilove_pdf_deactivate() {
*
* @since 1.0.0
*/
require_once plugin_dir_path( __FILE__ ) . 'lib/ilovepdf-php-master/init.php';

define( 'ILOVE_PDF_REGISTER_URL', 'https://api.ilovepdf.com/v1/user' );
define( 'ILOVE_PDF_LOGIN_URL', 'https://api.ilovepdf.com/v1/user/login' );
Expand Down
20 changes: 7 additions & 13 deletions includes/class-ilove-pdf.php → includes/Ilove_Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
* @subpackage Ilove_Pdf/includes
*/

namespace Ilove_Pdf_Includes;

use Ilove_Pdf_Admin\Ilove_Pdf_Admin;
use Ilove_Pdf_Includes\Ilove_Pdf_Loader;
use Ilove_Pdf_Includes\Ilove_Pdf_I18n;

/**
* The core plugin class.
*
Expand Down Expand Up @@ -68,7 +74,7 @@ class Ilove_Pdf {
public function __construct() {

$this->plugin_name = 'ilove-pdf';
$this->version = 'wp.2.0.1';
$this->version = 'wp.2.0.2';

$this->load_dependencies();
$this->set_locale();
Expand Down Expand Up @@ -97,18 +103,6 @@ private function load_dependencies() {
* The class responsible for orchestrating the actions and filters of the
* core plugin.
*/
require_once plugin_dir_path( __DIR__ ) . 'includes/class-ilove-pdf-loader.php';

/**
* The class responsible for defining internationalization functionality
* of the plugin.
*/
require_once plugin_dir_path( __DIR__ ) . 'includes/class-ilove-pdf-i18n.php';

/**
* The class responsible for defining all actions that occur in the admin area.
*/
require_once plugin_dir_path( __DIR__ ) . 'admin/class-ilove-pdf-admin.php';

$this->loader = new Ilove_Pdf_Loader();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* @subpackage Ilove_Pdf/includes
*/

namespace Ilove_Pdf_Includes;

/**
* Fired during plugin activation.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* @subpackage Ilove_Pdf/includes
*/

namespace Ilove_Pdf_Includes;

/**
* Fired during plugin deactivation.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @subpackage Ilove_Pdf/includes
*/

namespace Ilove_Pdf_Includes;

/**
* Define the internationalization functionality.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* @subpackage Ilove_Pdf/includes
*/

namespace Ilove_Pdf_Includes;

/**
* Register all actions and filters for the plugin.
*
Expand Down
8 changes: 0 additions & 8 deletions lib/ilovepdf-php-master/.travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions lib/ilovepdf-php-master/circle.yml

This file was deleted.

38 changes: 0 additions & 38 deletions lib/ilovepdf-php-master/init.php

This file was deleted.

15 changes: 0 additions & 15 deletions lib/ilovepdf-php-master/phpunit.no_autoload.xml

This file was deleted.

13 changes: 0 additions & 13 deletions lib/ilovepdf-php-master/phpunit.xml

This file was deleted.

Loading

0 comments on commit d5618c2

Please sign in to comment.