-
Search Results
-
Hi WPDM team,
I’m writing to report an interaction between WordPress Download Manager (WPDM) and the Rara Business theme that consistently crashes WPDM single package pages. I’ve included the environment details, the reproducible error, and the workaround we implemented.
Environment
WordPress: 6.6.2
PHP: 8.2 (running on WHC / cPanel with zlib compression enabled)
WPDM: 3.2.99 (Free)
Theme: Rara Business (latest from WordPress.org, v1.2.9)
Hosting: Linux/Apache with Cloudflare in front
Permalink base for WPDM packages: /files/<slug>/
Problem description
After switching the WPDM package permalink base to /files/, visiting a package single page at /files/<package-slug>/ triggers a fatal error.
Stack trace excerpt:
PHP Fatal error: Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, WP_Error given
in /wp-content/themes/rara-business/inc/template-functions.php:433
#0 /…/template-functions.php(231): rara_business_breadcrumb()
#1 /wp-includes/class-wp-hook.php(324): rara_business_content_start(”)
#2 /wp-includes/plugin.php(517): WP_Hook->do_action()
#3 /wp-content/themes/rara-business/header.php(59): do_action(‘rara_business_content’)
#4 /wp-content/themes/rara-business/single.php(12): get_header()Root cause:
The theme’s rara_business_content_start() calls rara_business_breadcrumb(), which assumes a post category context. On WPDM singles (custom post type wpdmpro), it receives a WP_Error. This value is passed directly into explode(), producing the fatal.What we tried
Switched to Twenty Twenty-Five → WPDM singles load normally.
Disabled all MU plugins and caching layers → crash persists with Rara Business.
Built a child theme to gate the do_action( ‘rara_business_content’ ) call → functional but brittle and caused styling regressions.
Minimal, upgrade-safe workaround
We developed a compatibility plugin (wpdm-rara-compat.php) that:
Removes the theme’s content-start callback from the rara_business_content hook.
Re-adds it with a guard so it runs everywhere except on WPDM singles.
Restores normal page layout on WPDM singles by injecting wrapper markup (container/row/content/sidebar) around the_content and aligning the page title.
Plugin code:
<?php
/**
* Plugin Name: WPDM × Rara Business Compat
* Description: Prevents Rara breadcrumb crash on WPDM singles, restores layout.
* Version: 1.0
*/add_action(‘after_setup_theme’, function () {
// Remove theme’s content-start callback
remove_action(‘rara_business_content’, ‘rara_business_content_start’, 10);// Re-add guarded callback
add_action(‘rara_business_content’, function () {
if ( is_singular([‘wpdmpro’,’wpdm_package’]) ) return;
if ( function_exists(‘rara_business_content_start’) ) {
rara_business_content_start();
}
}, 10);
}, 99);// === Layout wrapper for WPDM singles ===
add_filter(‘the_content’, function ($html) {
if (!is_singular(‘wpdmpro’) || !in_the_loop() || !is_main_query()) return $html;// Prevent double wrapping
if (str_contains($html, ‘class=”site-content single-wpdmpro”‘)) return $html;ob_start(); get_sidebar(); $sidebar = ob_get_clean();
return
‘<div id=”content” class=”site-content single-wpdmpro”>’ .
‘<div class=”container”><div class=”row”>’ .
‘<main id=”primary” class=”content-area col-lg-8″><div class=”site-main”>’ .
$html .
‘</div></main>’ .
$sidebar .
‘</div></div>’ .
‘</div>’;
}, 20);// Align WPDM single title with content column
add_filter(‘the_title’, function ($title, $post_id) {
if (is_admin() || !is_singular(‘wpdmpro’) || !in_the_loop() || !is_main_query()) return $title;
if ((int)$post_id !== (int)get_queried_object_id()) return $title;
if (strpos($title, ‘wpdm-title-wrap’) !== false) return $title;return ‘<div class=”container”><div class=”row”><div class=”col-lg-8 wpdm-title-wrap”>’ .
$title .
‘</div></div></div>’;
}, 10, 2);Current status
WPDM singles now load correctly at /download/<slug>/. Example: https://complianceinsight.ca/download/press-release-2025-09-02/
Site styling restored (title + content aligned with container/row).
No more fatals. Logs show only benign PHP 8.2 notices from the theme’s Customizer notice class (Deprecated: Creation of dynamic property …).
Suggestions
WPDM resilience: Adding a defensive check around breadcrumb/taxonomy lookups for custom post types would help WPDM work out-of-the-box with themes that assume posts/categories.
Theme interaction doc: A short WPDM doc page on “Theme compatibility” (especially around breadcrumb hooks) would help other users avoid this.
Optional hook: A dedicated filter to let developers wrap WPDM singles in their theme’s grid without intercepting the_content would simplify compatibility work.
Happy to provide a staging URL or further debug info if you’d like to see the exact crash path in action.
Thanks for your continued work on WPDM—outside this theme-specific issue, the plugin has been solid.
We purchased the WPDM Directory Add-on and using it with the DM free version.
However when using the below shortcode:
[wpdm_archive button_style=”default” template=”link-template-default-nl” cols=1 items_per_page=”10″ orderby=”title” order=”ASC” login=1 last_state=0]
We get a critical error of the following:
Fatal error: Uncaught Error: Class “WPDM\Template” not found in /home/……../wp-content/plugins/wpdm-archive-page/src/Templates/Starter/Starter.php:37 Stack trace: #0Good day,
we have been using the Download Manager Pro plugin for a while on our customer’s website.
However, it seems that the single download page is no longer working:I have activated WP DEBUG but there is no relevant warning or error, only the usual:
PHP Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for thecm-download-manager-prodomain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at theinitaction or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/dgkv/htdocs/dgkv.info/wp-includes/functions.php on line 6121Additionally, there was this error, but I could not pinpoint during which action this was generated:
[09-May-2025 08:17:24 UTC] PHP Deprecated: Creation of dynamic property com\cminds\package\pro\v1_9_2\CmindsLicensingAPI::$did_check is deprecated in /home/dgkv/htdocs/dgkv.info/wp-content/plugins/cm-download-manager-pro/package/cminds-api.php on line 213If I activate WP Debug to display errors on the website, it only shows the translation errors, and there is no fatal error in the source code.
Noticed a conflict with the existing archive page plugin (at least I’m assuming so given the error message):
Fatal error: Uncaught Error: Class "WPDM\Package" not found in /srv/www/wordpress/wp-content/plugins/wpdm-archive-page/wpdm-archive-page.php:114 Stack trace: #0 /srv/www/wordpress/wp-content/plugins/wpdm-archive-page/wpdm-archive-page.php(311): WPDM_ArchivePage->RenderCats() #1 /srv/www/wordpress/wp-includes/shortcodes.php(434): WPDM_ArchivePage->ArchivePage() #2 [internal function]: do_shortcode_tag() #3 /srv/www/wordpress/wp-includes/shortcodes.php(273): preg_replace_callback() #4 /srv/www/wordpress/wp-includes/class-wp-hook.php(324): do_shortcode() #5 /srv/www/wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters() #6 /srv/www/wordpress/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(1961): apply_filters() #7 /srv/www/wordpress/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php(655): WP_REST_Posts_Controller->prepare_item_for_response() #8 /srv/www/wordpress/wp-includes/rest-api/class-wp-rest-server.php(1292): WP_REST_Posts_Controller->get_item() #9 /srv/www/wordpress/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request() #10 /srv/www/wordpress/wp-includes/rest-api.php(586): WP_REST_Server->dispatch() #11 /srv/www/wordpress/wp-includes/rest-api.php(2973): rest_do_request() #12 [internal function]: rest_preload_api_request() #13 /srv/www/wordpress/wp-includes/block-editor.php(757): array_reduce() #14 /srv/www/wordpress/wp-admin/edit-form-blocks.php(114): block_editor_rest_api_preload() #15 /srv/www/wordpress/wp-admin/post.php(187): require('...') #16 {main} thrown in /srv/www/wordpress/wp-content/plugins/wpdm-archive-page/wpdm-archive-page.php on line 114Is there something additional I should be accounting for? or has the class been renamed?
Hello! How are you?
I’m getting the following error when trying to upload a file via WPDM. This error does not accour when uploading via default WP MediaPHP Fatal error: Uncaught TypeError: finfo_close(): Argument #1 ($finfo) must be of type resource, finfo given in /public_html/wp-content/plugins/download-manager/src/__/FileSystem.php:991
Stack trace:
#0 /public_html/wp-content/plugins/download-manager/src/__/FileSystem.php(991): finfo_close()
#1 /public_html/wp-content/plugins/download-manager/src/__/FileSystem.php(1078): WPDM\__\FileSystem::getMimeType()
#2 /public_html/wp-content/plugins/download-manager/src/Admin/Menu/Packages.php(162): WPDM\__\FileSystem::validateUploadMimeType()
#3 /public_html/wp-includes/class-wp-hook.php(324): WPDM\Admin\Menu\Packages->uploadFile()
#4 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#5 /public_html/wp-includes/plugin.php(517): WP_Hook->do_action()
#6 /public_html/wp-admin/admin-ajax.php(192): do_action()
#7 {main}
thrown in /public_html/wp-content/plugins/download-manager/src/__/FileSystem.php on line 991Fatal error: Uncaught Error: Call to undefined function
Line 29 of User/User.php
Hello,
The example on this page throws a PHP fatal error. Can you provide more information on how to use this filter, preferably with a working example?
https://www.wpdownloadmanager.com/doc/filter-reference/wpdm_package_settings_tabs/
Thank you!
Call stack:
Fatal error: Uncaught Error: Cannot access offset of type string on string
in /content/live/site/wp-content/plugins/download-manager/src/Admin/views/metaboxes/package-settings.php on line 14Call stack:
include()
wp-content/plugins/download-manager/src/Admin/AdminController.php:308
WPDM\Admin\AdminController::packageSettings()
wp-admin/includes/template.php:1456
do_meta_boxes()
wp-admin/edit-form-advanced.php:723
require()
wp-admin/post.php:206Hi, recently the WPDM – Newsletters addon stopped working, we get an error message when running the cronjob. The plugin itself is up to version 3.3.1 and WPDM Free itself is up to version 3.3.05. We have not made any changes to the site!
Enclosed is the error log:
[13-Jan-2025 11:14:02 UTC] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /var/www/html/wp-content/plugins/wpdm-newsletter/campaign/util/mailer.php:183 Stack trace: #0 /var/www/html/wp-content/plugins/wpdm-newsletter/campaign/util/mailer.php(65): CAMPAIGN\UTIL\Mailer->sendMail() #1 /var/www/html/wp-content/plugins/wpdm-newsletter/wpdm-newsletter.php(113): CAMPAIGN\UTIL\Mailer->cronHandler() #2 /var/www/html/wp-includes/class-wp-hook.php(324): CAMPAIGN\EdenCampaign->cronHandle() #3 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #4 /var/www/html/wp-includes/plugin.php(565): WP_Hook->do_action() #5 /var/www/html/wp-includes/class-wp.php(830): do_action_ref_array() #6 /var/www/html/wp-includes/functions.php(1336): WP->main() #7 /var/www/html/wp-blog-header.php(16): wp() #8 /var/www/html/index.php(17): require('...') } thrown in /var/www/html/wp-content/plugins/wpdm-newsletter/campaign/util/mailer.php on line 183Thanks and regards Marko
Hello,
When adding a file, the plugin works as expected. When I edit the package and remove an attachment then click update, the “There has been a critical error on this website” message appears. If I click “Back”, the attached file is no longer there and I can update the post like normal.
Here’s the error log (anonymized)
PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /public_html/wp-content/plugins/download-manager/src/Admin/Menu/Packages.php:90\nStack trace:\n#0 /public_html/wp-content/plugins/download-manager/src/Admin/Menu/Packages.php(90): in_array()\n#1 /public_html/wp-includes/class-wp-hook.php(326): WPDM\\Admin\\Menu\\Packages->savePackage()\n#2 /public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()\n#3 /public_html/wp-includes/plugin.php(517): WP_Hook->do_action()\n#4 /public_html/wp-includes/post.php(5060): do_action()\n#5 /public_html/wp-includes/post.php(5162): wp_insert_post()\n#6 /public_html/w…’, referer: https://mydomainhere.org/wp-admin/post.php?post=4842&action=editI’m running Version 6.6.3 on WP 6.7.1.
I tried disabling all plugins but download manager, and the error persists.
Thanks,
GlenTopic: Error when activating plugin
I’m getting the following fatal error when attempting to activate the plugin
“PHP Fatal error: Uncaught Error: Class “WPDM\MediaLibrary\MediaHandler” not found ”I’m on WordPress version 6.6.1 with PHP version 8.2
Topic: Plugin Error
Hello. Your help would be appreciated. I seem to be getting a weird error from WordPress an the plugin isng working. I have the latest version installed:
WordPress has a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email.
In this case, WordPress caught an error with one of your plugins, download-manager.
When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.6.1
Active theme: Divi (version 4.27.2)
Current plugin: (version )
PHP version 8.1.22Error Details
=============
An error of type E_ERROR was caused in line 242 of the file /var/www/wptbox/wp-content/plugins/download-manager/download-manager.php. Error message: Uncaught Error: Class “WPDM\__\Installer” not found in /var/www/wptbox/wp-content/plugins/download-manager/download-manager.php:242
Stack trace:
#0 /var/www/wptbox/wp-includes/class-wp-hook.php(324): WPDM\WordPressDownloadManager->update()
#1 /var/www/wptbox/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#2 /var/www/wptbox/wp-includes/plugin.php(517): WP_Hook->do_action()
#3 /var/www/wptbox/wp-admin/includes/class-plugin-upgrader.php(421): do_action()
#4 /var/www/wptbox/wp-admin/includes/ajax-actions.php(4649): Plugin_Upgrader->bulk_upgrade()
#5 /var/www/wptbox/wp-includes/class-wp-hook.php(324): wp_ajax_update_plugin()
#6 /var/www/wptbox/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#7 /var/www/wptbox/wp-includes/plugin.php(517): WP_Hook->do_action()
#8 /var/www/wptbox/wp-admin/admin-ajax.php(192): do_action()
#9 {main}
thrownAny ideas what the problem could be?