Skip to content

Commit

Permalink
late autoloading
Browse files Browse the repository at this point in the history
  • Loading branch information
otrok7 committed Jun 11, 2024
1 parent 3963631 commit 1dfc313
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 7 additions & 4 deletions bmlt-meeting-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Description: Maintains and generates a PDF Meeting List from BMLT.
Author: bmlt-enabled
Author URI: https://bmlt.app
Version: 2.7.10
Version: 2.7.11
*/
/* Disallow direct access to the plugin file */
use Mpdf\Mpdf;
Expand All @@ -15,7 +15,7 @@
die('Sorry, but you cannot access this page directly.');
}

require_once plugin_dir_path(__FILE__).'mpdf/vendor/autoload.php';
//require_once plugin_dir_path(__FILE__).'mpdf/vendor/autoload.php';
include 'partials/_helpers.php';
if (!class_exists("Bread")) {
class Bread
Expand Down Expand Up @@ -605,7 +605,7 @@ function bmlt_meeting_list($atts = null, $content = null)
if (!isset($this->options['pageheader_textcolor'])) {
$this->options['pageheader_textcolor'] = '#000000';
}
if (!isset($this->options['pageheader_fontsize'])) {
if (!isset($this->options['pageheader_fontsize']) || floatval($this->options['pageheader_fontsize'])<4) {
$this->options['pageheader_fontsize'] = '9';
}
if (!isset($this->options['pageheader_backgroundcolor'])) {
Expand Down Expand Up @@ -884,10 +884,10 @@ function bmlt_meeting_list($atts = null, $content = null)
];
}
$mpdf_init_options['restrictColorSpace'] = $this->options['colorspace'];
$mpdf_init_options['curlUserAgent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0';
$mpdf_init_options = array_merge($mpdf_init_options, $page_type_settings);
$mpdf_init_options = apply_filters("Bread_Mpdf_Init_Options", $mpdf_init_options, $this->options);
ob_end_clean();
require_once plugin_dir_path(__FILE__).'mpdf/vendor/autoload.php';
$this->mpdf = new mPDF($mpdf_init_options);
$this->mpdf->setAutoBottomMargin = 'pad';
$this->mpdf->shrink_tables_to_fit = 1;
Expand Down Expand Up @@ -2602,6 +2602,9 @@ function fillUnsetOptions()
$this->fillUnsetOption('content_font_size', '9');
$this->fillUnsetOption('header_font_size', $this->options['content_font_size']);
$this->fillUnsetOption('pageheader_fontsize', $this->options['header_font_size']);
if (floatval($this->options['pageheader_fontsize']) < 4) {
$this->options['pageheader_fontsize'] = 6;
}
$this->fillUnsetOption('suppress_heading', 0);
$this->fillUnsetOption('header_text_color', '#ffffff');
$this->fillUnsetOption('header_background_color', '#000000');
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: meeting list, bmlt, narcotics anonymous, na
Requires PHP: 8.1
Requires at least: 6.2
Tested up to: 6.5
Stable tag: 2.7.10
Stable tag: 2.7.11

License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -55,6 +55,9 @@ Follow all these steps, keep in mind that once you start using bread, it's not g

== Changelog ==

= 2.7.11 =
* Late loading of mPDF to prevent conflicts with other plugins.

= 2.7.10 =
* Updated mPDF
* Added "wheelchair" shortcode
Expand Down

0 comments on commit 1dfc313

Please sign in to comment.