plugin updates

This commit is contained in:
Tony Volpe
2024-11-25 13:10:11 -05:00
parent 864fe717f9
commit 76d447655a
48 changed files with 1945 additions and 200 deletions

View File

@@ -4,7 +4,7 @@
Plugin URI: http://www.joomunited.com
Description: WP media Folder is a WordPress plugin that enhance the WordPress media manager by adding a folder manager inside.
Author: Joomunited
Version: 5.9.11
Version: 5.9.12
Update URI: https://www.joomunited.com/juupdater_files/wp-media-folder.json
Author URI: http://www.joomunited.com
Text Domain: wpmf
@@ -79,7 +79,7 @@ if (!defined('WPMF_TAXO')) {
define('_WPMF_GALLERY_PREFIX', '_wpmf_gallery_');
define('WPMF_PLUGIN_URL', plugin_dir_url(__FILE__));
define('WPMF_DOMAIN', 'wpmf');
define('WPMF_VERSION', '5.9.11');
define('WPMF_VERSION', '5.9.12');
define('WPMF_HIDE_USER_MEDIA_FOLDER_ROOT', true);
// disable warning function _load_textdomain_just_in_time was called incorrectly
@@ -245,15 +245,17 @@ if (is_admin()) {
* ***** DO NOT REMOVE *****
* End translate for queue class
*/
$args = wpmfGetQueueOptions(false);
$wpmfQueue = call_user_func('\Joomunited\Queue\JuMainQueue::getInstance', 'wpmf');
$wpmfQueue->init($args);
$folder_options = get_option('wpmf_queue_options');
if (!empty($folder_options['enable_physical_folders'])) {
require_once WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/physical-folder' . DIRECTORY_SEPARATOR . 'wpmf.php';
new JUQueueActions();
require_once WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/physical-folder' . DIRECTORY_SEPARATOR . 'helper.php';
}
add_action('init', function () {
$args = wpmfGetQueueOptions(false);
$wpmfQueue = call_user_func('\Joomunited\Queue\JuMainQueue::getInstance', 'wpmf');
$wpmfQueue->init($args);
$folder_options = get_option('wpmf_queue_options');
if (!empty($folder_options['enable_physical_folders'])) {
require_once WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/physical-folder' . DIRECTORY_SEPARATOR . 'wpmf.php';
new JUQueueActions();
require_once WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/physical-folder' . DIRECTORY_SEPARATOR . 'helper.php';
}
});
add_action(
'wpmf_before_delete_folder',
@@ -286,50 +288,66 @@ if (is_admin()) {
}
}
}, 10);
add_action('wpmf_delete_attachment', function ($id) {
$queue_id = get_post_meta($id, 'wpmf_sync_queue', true);
$wpmfQueue = \Joomunited\Queue\JuMainQueue::getInstance('wpmf');
if (!empty($queue_id)) {
if (is_array($queue_id)) {
foreach ($queue_id as $queueID) {
$wpmfQueue->deleteQueue($queueID);
}
} else {
$wpmfQueue->deleteQueue($queue_id);
}
}
}, 10);
}
if (!class_exists('\Joomunited\WPMF\JUCheckRequirements')) {
require_once(trailingslashit(dirname(__FILE__)) . 'requirements.php');
}
if (class_exists('\Joomunited\WPMF\JUCheckRequirements')) {
// Plugins name for translate
$args = array(
'plugin_name' => esc_html__('WP Media Folder', 'wpmf'),
'plugin_path' => wpmfGetPath(),
'plugin_textdomain' => 'wpmf',
'requirements' => array(
'php_version' => '5.6',
'php_modules' => array(
'curl' => 'warning'
),
'functions' => array(
'gd_info' => 'warning'
),
// Minimum addons version
'addons_version' => array(
'wpmfAddons' => '3.6.9',
'wpmfGalleryAddons' => '2.4.6'
)
),
);
$wpmfCheck = call_user_func('\Joomunited\WPMF\JUCheckRequirements::init', $args);
if (!$wpmfCheck['success']) {
// Do not load anything more
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
unset($_GET['activate']);
return;
add_action('init', function () {
if (!class_exists('\Joomunited\WPMF\JUCheckRequirements')) {
require_once(trailingslashit(dirname(__FILE__)) . 'requirements.php');
}
if (isset($wpmfCheck) && !empty($wpmfCheck['load'])) {
foreach ($wpmfCheck['load'] as $addonName) {
if (function_exists($addonName . 'Init')) {
call_user_func($addonName . 'Init');
if (class_exists('\Joomunited\WPMF\JUCheckRequirements')) {
// Plugins name for translate
$args = array(
'plugin_name' => esc_html__('WP Media Folder', 'wpmf'),
'plugin_path' => wpmfGetPath(),
'plugin_textdomain' => 'wpmf',
'requirements' => array(
'php_version' => '7.4',
'php_modules' => array(
'curl' => 'warning'
),
'functions' => array(
'gd_info' => 'warning'
),
// Minimum addons version
'addons_version' => array(
'wpmfAddons' => '3.6.9',
'wpmfGalleryAddons' => '2.4.6'
)
),
);
$wpmfCheck = call_user_func('\Joomunited\WPMF\JUCheckRequirements::init', $args);
if (!$wpmfCheck['success']) {
// Do not load anything more
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- No action, nonce is not required
unset($_GET['activate']);
return;
}
if (isset($wpmfCheck) && !empty($wpmfCheck['load'])) {
foreach ($wpmfCheck['load'] as $addonName) {
if (function_exists($addonName . 'Init')) {
call_user_func($addonName . 'Init');
}
}
}
}
}
});
/**
* Get queue options
@@ -890,6 +908,7 @@ function wpmfGetOption($option_name)
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/class-helper.php');
$frontend = get_option('wpmf_option_mediafolder');
if (!empty($frontend) || is_admin()) {
global $wpmfwatermark;
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/class-main.php');
@@ -1252,8 +1271,10 @@ if (isset($enable_gallery) && (int) $enable_gallery === 1) {
}
if (is_admin()) {
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/class-wp-folder-option.php');
new WpmfMediaFolderOption;
add_action('init', function () {
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/class-wp-folder-option.php');
new WpmfMediaFolderOption;
});
}
$wpmf_option_singlefile = get_option('wpmf_option_singlefile');
@@ -1271,12 +1292,14 @@ if (isset($wpmf_option_lightboximage) && (int) $wpmf_option_lightboximage === 1)
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/class-pdf-embed.php');
new WpmfPdfEmbed();
// load gif file on page load or not
$load_gif = wpmfGetOption('load_gif');
if (isset($load_gif) && (int) $load_gif === 0) {
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/class-load-gif.php');
new WpmfLoadGif();
}
add_action('init', function () {
// load gif file on page load or not
$load_gif = wpmfGetOption('load_gif');
if (isset($load_gif) && (int) $load_gif === 0) {
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/class-load-gif.php');
new WpmfLoadGif();
}
});
require_once(WP_MEDIA_FOLDER_PLUGIN_DIR . 'class/class-folder-post-type.php');
new WpmfMediaFolderPostType();
@@ -1636,10 +1659,13 @@ function wpmfRenderVideoIcon($attachment_id)
return '';
}
$remote_video = wpmfGetOption('hide_remote_video');
if ($remote_video) {
add_filter('the_content', 'wpmfFindImages');
}
add_action('init', function () {
$remote_video = wpmfGetOption('hide_remote_video');
if ($remote_video) {
add_filter('the_content', 'wpmfFindImages');
}
});
/**
* Find image in content
@@ -1707,7 +1733,7 @@ function wpmfFindImages($content)
}
}
}
// otherwise returns the database content
return $content;
}