Skip to content

Commit

Permalink
Fix warnings (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjaudiomv authored Sep 29, 2022
1 parent d0cf53b commit a75bcd1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 26 deletions.
33 changes: 18 additions & 15 deletions bmlt-wordpress-satellite-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* These need to be without the asterisks, as WP parses them. *
Plugin Name: BMLT WordPress Satellite
Plugin URI: https://bmlt.app
Author: MAGSHARE
Author: bmlt-enabled
Description: This is a WordPress plugin satellite of the Basic Meeting List Toolbox.
Version: 3.11.2
Version: 3.11.3
Install: Drop this directory into the "wp-content/plugins/" directory and activate it.
********************************************************************************************/

Expand Down Expand Up @@ -139,7 +139,8 @@ protected function cms_get_page_settings_id(
if (!$in_check_mobile && isset($this->my_http_vars['bmlt_settings_id']) && is_array($this->getBMLTOptions($this->my_http_vars['bmlt_settings_id']))) {
$my_option_id = $this->my_http_vars['bmlt_settings_id'];
} else {
$support_mobile = preg_replace('/\D/', '', trim($this->cms_get_post_meta($page->ID, 'bmlt_mobile')));
$cms_post_meta_mobile = isset($page->ID) && !empty($page->ID) ? $this->cms_get_post_meta($page->ID, 'bmlt_mobile') : null;
$support_mobile = preg_replace('/\D/', '', trim($cms_post_meta_mobile));

if (!$support_mobile && $in_check_mobile) {
$support_mobile = self::get_shortcode($in_content, 'bmlt_mobile');
Expand All @@ -153,13 +154,13 @@ protected function cms_get_page_settings_id(
if ($in_check_mobile && $support_mobile && !isset($this->my_http_vars['BMLTPlugin_mobile']) && (self::mobile_sniff_ua($this->my_http_vars) != 'xhtml')) {
$my_option_id = $support_mobile;
} elseif (!$in_check_mobile) {
$my_option_id = intval(preg_replace('/\D/', '', trim($this->cms_get_post_meta($page->ID, 'bmlt_settings_id'))));
$cms_post_meta_settings = isset($page->ID) && !empty($page->ID) ? $this->cms_get_post_meta($page->ID, 'bmlt_settings_id') : null;
$my_option_id = intval(preg_replace('/\D/', '', trim($cms_post_meta_settings)));
if (isset($this->my_http_vars['bmlt_settings_id']) && intval($this->my_http_vars['bmlt_settings_id'])) {
$my_option_id = intval($this->my_http_vars['bmlt_settings_id']);
} elseif ($in_content = $in_content ? $in_content : $page->post_content) {
} elseif ($in_content = isset($in_content) ? $in_content : (isset($page->post_content) ? $page->post_content : null)) {
$my_option_id_content = parent::cms_get_page_settings_id($in_content, $in_check_mobile);

$my_option_id = $my_option_id_content ? $my_option_id_content : $my_option_id;
$my_option_id = $my_option_id_content ?: $my_option_id;
}

if (!$my_option_id) { // If nothing else gives, we go for the default (first) settings.
Expand Down Expand Up @@ -307,15 +308,15 @@ public function standard_head($from_admin = false) ///< True, if this was cal
$page_id = null;
$page = get_page($page_id);

$support_mobile = $this->cms_get_page_settings_id($page->post_content, true);
$support_mobile = isset($page->post_content) && !empty($page->post_content) ? $this->cms_get_page_settings_id($page->post_content, true) : null;

if ($support_mobile) {
$mobile_options = $this->getBMLTOptions_by_id($support_mobile);
} else {
$support_mobile = null;
}

$options = $this->getBMLTOptions_by_id($this->cms_get_page_settings_id($page->post_content));
$options_standard = isset($page->post_content) && !empty($page->post_content) ? $page->post_content : null;
$options = $this->getBMLTOptions_by_id($this->cms_get_page_settings_id($options_standard));

if ($support_mobile && is_array($mobile_options) && count($mobile_options)) {
$mobile_url = $_SERVER['PHP_SELF'].'?BMLTPlugin_mobile&bmlt_settings_id='.$support_mobile;
Expand Down Expand Up @@ -343,9 +344,11 @@ public function standard_head($from_admin = false) ///< True, if this was cal
|| $this->get_shortcode($page->post_content, 'simple_search_list')
) {
$head_content = "<!-- Added by the BMLT plugin 3.X. -->\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\" />\n<meta http-equiv=\"Content-Style-Type\" content=\"text/css\" />\n<meta http-equiv=\"Content-Script-Type\" content=\"text/javascript\" />\n";
if (!$this->get_shortcode($page->post_content, 'bmlt')) {
## TODO: Is this right?
if (isset($page->post_content) && !$this->get_shortcode($page->post_content, 'bmlt')) {
$load_head = false;
}


$this->my_http_vars['start_view'] = $options['bmlt_initial_view'];

Expand Down Expand Up @@ -417,15 +420,15 @@ public function standard_head($from_admin = false) ///< True, if this was cal

$head_content .= self::stripFile('javascript.js');

if ($this->get_shortcode($page->post_content, 'bmlt_quicksearch')) {
if (isset($page->post_content) && !empty($page->post_content) && $this->get_shortcode($page->post_content, 'bmlt_quicksearch')) {
$head_content .= self::stripFile('quicksearch.js') . (defined('_DEBUG_MODE_') ? "\n" : '');
}

if ($this->get_shortcode($page->post_content, 'bmlt_map')) {
if (isset($page->post_content) && !empty($page->post_content) && $this->get_shortcode($page->post_content, 'bmlt_map')) {
$head_content .= self::stripFile('map_search.js');
}

if ($this->get_shortcode($page->post_content, 'bmlt_mobile')) {
if (isset($page->post_content) && !empty($page->post_content) && $this->get_shortcode($page->post_content, 'bmlt_mobile')) {
$head_content .= self::stripFile('fast_mobile_lookup.js');
}

Expand Down Expand Up @@ -578,7 +581,7 @@ protected function set_callbacks()
add_action('admin_init', array ( self::get_plugin_object(), 'admin_ajax_handler' ));
add_action('admin_menu', array ( self::get_plugin_object(), 'option_menu' ));
add_action('init', array ( self::get_plugin_object(), 'filter_init' ));
wp_enqueue_script("leaflet", $this->get_plugin_path() . "table_display.js", false, filemtime($this->get_plugin_path() . "table_display.js"), false);
wp_enqueue_script("table_display", $this->get_plugin_path() . "table_display.js", false, filemtime(plugin_dir_path(__FILE__) . "vendor/bmlt/bmlt-satellite-base-class/table_display.js"), false);
} else {
echo "<!-- BMLTPlugin ERROR (set_callbacks)! No add_action()! -->";
}
Expand Down
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
"license": "MIT",
"authors": [{
"name": "littlegreenviper"
},{
"name": "radius314"
},{
"name": "pjaudiomv"
}],
"require-dev": {
"squizlabs/php_codesniffer": "3.*"
},
"require": {
"bmlt/bmlt-satellite-base-class": "^3.11.3",
"bmlt/bmlt-satellite-base-class": "^3.11.4",
"bmlt/bmlt-satellite-driver": "1.1"
}
}
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Tags: na, meeting list, meeting finder, maps, recovery, addiction, webservant
Author: bmlt-enabled
Requires at least: 4.0
Tested up to: 6.0.2
Stable tag: 3.11.2
Stable tag: 3.11.3

This is a "satellite" plugin for the Basic Meeting List Toolbox (BMLT).

Expand All @@ -28,6 +28,9 @@ This is a standard WordPress plugin. Either use the in-dashboard installer, or m

= Changelog =

= 3.11.3 =
* Fixes a bunch of PHP warnings.

= 3.11.2 =
* Fix for fast table display not displaying properly.

Expand Down

0 comments on commit a75bcd1

Please sign in to comment.