[wp-trac] [WordPress Trac] #48668: Plupload integration not working after WP update and PHP upgrade
WordPress Trac
noreply at wordpress.org
Sat Nov 16 11:45:13 UTC 2019
#48668: Plupload integration not working after WP update and PHP upgrade
--------------------------------+-----------------------------
Reporter: somedev123 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: External Libraries | Version: 5.2.4
Severity: normal | Keywords:
Focuses: |
--------------------------------+-----------------------------
This is a follow-up to #27763.
Hello All,
I know this is maybe a wrong place, but I am struggling with this issue
for weeks now and there's nothing I can do anymore, so I am writing this
as a last resort help cry.
I have a WordPress website (a listings/directory portal) that uses a theme
that I inherited and it's not updated/supported anymore (GeoTheme).
That theme was built on PHP 5.6 and it is not compatible with PHP 7+. Some
time ago I went through the process of upgrading it to PHP 7.2 and I
restored most of the functionality, except in the listing adding page,
when you upload the images, the 'Select files' button does not trigger the
images browser as it did before.
I tried countless things, but no luck so far. I thought there's gotta be
someone that hit their head against this issue or have more experience
with plupload and would have an idea what's wrong.
The URL with the issue is:
http://www.regionad.co.uk/?ptype=post_listing&pkg=1&user_val=existing
This is an output of the configuration:
{{{
pconfig:
{"runtimes":"html5,silverlight,flash,html4","browse_button
":"file_infoplupload-browse-button","container":"file_infoplupload-upload-
ui","drop_element":"file_infodrag-drop-area","file_data_name
":"file_infoasync-
upload","multiple_queues":true,"max_file_size":"2mb","url":"http://www.regionad.co.uk
/wp-admin/admin-ajax.php","flash_swf_url":"http://www.regionad.co.uk/wp-
includes/js/plupload/plupload.flash.swf","silverlight_xap_url":"http://www.regionad.co.uk
/wp-
includes/js/plupload/plupload.silverlight.xap","filters":[{"title":"Allowed
Files","extensions":"jpeg,jpg,gif,png"}],"multipart":true,"urlstream_upload":true,"multi_selection":true,"multipart_params":{"_ajax_nonce":"0ed3e0658e","action":"plupload_action","imgid":"file_info"},"resize":{"width":800,"height":800,"quality":90}}
}}}
The code that I think manages plupload is (in the theme 'functions' file):
{{{#!php
<?php
if(!function_exists('gt_plupload_admin_head')) {
function gt_plupload_admin_head() {
// place js config array for plupload
$plupload_init = array(
'runtimes' => 'html5,silverlight,flash,html4',
'browse_button' => 'plupload-browse-button', // will be adjusted
per uploader
'container' => 'plupload-upload-ui', // will be adjusted per
uploader
'drop_element' => 'drag-drop-area', // will be adjusted per
uploader
'file_data_name' => 'async-upload', // will be adjusted per
uploader
'multiple_queues' => true,
//'max_file_size' => wp_max_upload_size() . 'b',
'max_file_size' => gt_max_upload_size(),
'url' => admin_url('admin-ajax.php'),
'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
'silverlight_xap_url' =>
includes_url('js/plupload/plupload.silverlight.xap'),
'filters' => array(array('title' => __('Allowed Files'),
'extensions' => 'jpeg,jpg,gif,png')),
'multipart' => true,
'urlstream_upload' => true,
'multi_selection' => false, // will be added per uploader
// additional post data to send to our ajax hook
'multipart_params' => array(
'_ajax_nonce' => "", // will be added per uploader
'action' => 'plupload_action', // the ajax action name
'imgid' => 0 // will be added per uploader
)
);
?>
<script type="text/javascript">
var base_plupload_config=<?php echo json_encode($plupload_init); ?>;
</script>
<?php
}
}
}}}
Thank you very much for your time!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48668>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list