WordPress.org

Ready to get started?Download WordPress

Forums

podPress
[resolved] Auto detect file size and doesn't work after upgrading to 8.8.9 (40 posts)

  1. jersnav
    Member
    Posted 3 years ago #

    After I upgraded to 8.8.9 it seems that the auto detect size and time features do not work any more. Anyone else having this problem?
    Thank you!
    Jeremy

  2. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Hi Jeremy,

    please, try the ID3 tag detection (ID3 Tag Info: [Show] - click on Show). This function might show a error message which could help to solve that problem.

    Regards,
    Tim

  3. jersnav
    Member
    Posted 3 years ago #

    Thanks for the help Tim!

    When I click the "Show" button it seems to endlessly search for the info without finding it. No error message is displayed.

    However I did copy the following out of the "File Size" and "Duration" fields after clicking the "auto detect" button. Instead of displaying the size or duration it seems to populate the field with an entire page of code:
    [Moderator note: snipped code block, please use the pastebin as per the Forum Guidelines]

  4. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Jeremy,

    I'm sure that the content of the File Size and Duration field is helpful. Please, use that pastebin. I will take a look at the code there.

    Thanks,
    Tim

  5. jersnav
    Member
    Posted 3 years ago #

    Thank you! Here is link to postbin http://wordpress.pastebin.com/download.php?i=EwJD4Rrf
    Jeremy

  6. raymer
    Member
    Posted 3 years ago #

    Jeremy,
    The last line in the text you posted is:
    `<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->'
    Have you tried disabling the "WP Super Cache" plugin (and other plugins that might be conflicting) to see if it fixes the problem?

    -Ray

  7. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Jeremy,

    is the code you have posted at pastebin.com from the file size field or from the duration field?
    Is the code in both field the same?
    The procedures behind these two buttons are different and it possible that they produce different error messages.

    BTW: it is the code of the 404 "Page not found" page of your blog.
    I agree with Ray. Maybe you should fix the WP Super Cache plugin first or deactivate it temporarily to test if it makes a difference. Maybe deactivate temporarily the other plugins too. But start with the Super Cache plugin.
    Please, check also the permissions of the podPress files and folders. For instance the permissions of the files podpress_backend.php and podpress_admin_functions.php should be set to 0755. But that this is a permissions problem seems less likely.

    Regards,
    Tim

  8. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Jeremy,

    which role has the user account which you have used to auto detect the file size and the duration?
    In general it will work only if it is an Editor or Administrator account (level_7).

    Regards,
    Tim

  9. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Jeremy,

    if you know that this has something to do with the user level or role then you could try the current Development Version (8.8.9.2 RC 1) of podPress and take a look at this thread: http://wordpress.org/support/topic/plugin-podpress-auto-detect-file-size-and-doesnt-work-for-contributor

    Regards,
    Tim

  10. jersnav
    Member
    Posted 3 years ago #

    Hey All,
    Thanks for the help.
    This error seems to be occuring only on sites I have hosted at Host Gator. My other WP installations at another server are working ok in this regard.

    To try to narrow down problem here's what I've done:
    I just installed a fresh copy of WordPress on a brand new domain at HostGator and am getting the same problem. I have not installed Super-Cache or any other plugins except PodPress.

    Here are the error messages that appear in the respective fields on this new installation. They appear to be the same.

    File size error message
    http://wordpress.pastebin.com/download.php?i=QsScn0Zx

    Duration error message
    http://wordpress.pastebin.com/download.php?i=WGvrUtnV

    Regarding user level, I am logged in an admin.
    Regarding file permissions I changed all to 755. Most were 644.
    Interestingly the Podpress files seem to be 644 on my other host (Apollohosting) and things are ok there.

    Thanks again for the help!
    Jeremy

  11. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Okay, the problem is not caused by other plugins.

    They appear to be the same.

    I agree. Both code snippets seem to be the front page of the blog. This and your observation that it seems to be limited to a certain hosting provider makes me think that might be related to some entries of the .htaccess file. if this file exists, you can find it in the same folder as the wp-config.php file (root directory of the blog). (It might be a hidden by the default view settings of your FTP or SSH program.)
    Does this file exists? Is it empty? What is content? Is the content different compared to the content of .htaccess of the blog where the auto detection works?

    Besides this you could also try to activate the Log function of podPress which logs the activities of the auto detection process.
    In order to do that you need to edit the podpress.php file.
    This file includes the line:
    if ( ! defined( 'PODPRESS_DEBUG_LOG' ) ) { define( 'PODPRESS_DEBUG_LOG', FALSE ); }
    change it to
    if ( ! defined( 'PODPRESS_DEBUG_LOG' ) ) { define( 'PODPRESS_DEBUG_LOG', TRUE ); }.
    This should create a log file in the folder of podPress with the name podpress_log.dat or a different error message in the file size field.
    This may happen because the script needs the permission to create and write into this log file. This sometimes not allowed.
    The log file will probably contain file and folder names of your blog. If you don't want to post the content of this log file at pastebin then you may send it via email to me (timberge at cs dot tu-berlin dot de).
    You can watch the status of this DEBUG constant at the general settings page of podPress.

    Regards,
    Tim

  12. jersnav
    Member
    Posted 3 years ago #

    Here is pastebin link to error log:
    http://wordpress.pastebin.com/download.php?i=3DwiD7P2

    Regarding .htaccess, the file did not exist, until I enabled permalinks just before writing this message, at which point the .htaccess file appeared to be created.

    Thank you!

    Also here is the pastebin link to the two .htaccess files:
    http://wordpress.pastebin.com/download.php?i=GsTkqPsw
    It shows the file from the functioning site and the one from the site with the error.
    They appear to be the same.

  13. jersnav
    Member
    Posted 3 years ago #

    Another quick interesting item:
    If I enter a filename in the "location" field without using http:// I don't get an error message. "UNKNOWN" is displayed. Can I upload a .mp3 to a local directory and reference it without http://.
    Most of the time I'd want to host the .mp3 offsite however.

    Thanks!

  14. raymer
    Member
    Posted 3 years ago #

    Jeremy,
    I think you may be trying to use the filesize and duration functions with a remotely hosted MP3 file. That is not supported. You can add MP3s to your podcast using the URL but unless podpress is configured to use a local dir and local files it can't scan them to see how long they are (using local filesystem calls I assume).

    Does that clear it up?

    -Ray
    P.S. file permissions of 644 should be fine for all the files. Normally the directory permissions are the only things set to 755. But when you have possible permissions issues (especially if you see an error like "permission denied" you may want to temporarily change the podpress and .htaccess file permissions to 666 and the podpress folder permissions to 777 because some shared hosting servers run apache as a different user than your account user. Just remember to go back to the appropriate permissions when you are done (usually 644 and 755) for your hosting setup so you don't leave a security hole for hackers to find.

  15. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    I think you may be trying to use the filesize and duration functions with a remotely hosted MP3 file. That is not supported.

    That is not completely true.
    The file size retrieval should work in almost all cases. Because podPress requests the HTTP header of the file and tries to retrieve the content-length information from the HTTP response. That does not take long and should work for local files on the server of the blog as well as for files on a remote server.

    podPress retrieves the duration from the ID3 information of the media files with the help of getID3 and it seems that the media files need to be on the same server as getID3. In order to get the duration of a remote file podPress tries to download that file to the tmp-folder of the local server or if it is not possible to create a tmp file then to a folder which is called podpress_tmp which will become a sub folder of wp-content/uploads. The downloaded file will be deleted after the duration detection.
    But if podPress is not able to create the tmp file or the tmp folder or not able to download the file then it is not possible to retrieve the duration (There is a notice near the button because a download may take some time).
    In other words podPress needs the permission to write to the local file system for the duration (and ID3 tag) detection. But sometimes this permission is not granted.
    Other limits for the duration detection are time limits like max_execution_time. But the current podPress version stops before this limit is reached.

    At least the file size detection should work and since it was no problem to create the podpress_log file, the duration detection should work for files on remote servers too - at least for relative small files.

    Jeremy, the error which you have found in the log file was helpful.
    It seems that the URL which has been submitted in this attempt was only "http://" or maybe it has been cut off somehow after the click on the Auto Detect button.
    The "Location:" has to be a full, complete URL (with http://) OR a file name which has been selected via the dropdown menu which you get if you configure the option "Absolute path of the media files directory (optional)" at the General Settings page of podPress. This dropdown menu has also the possibility to "Specify URL". In this case you need to insert also the full URL.

    I have made some changes and the current Development Version (8.8.9.2 RC 2) catches this error and will write a custom message to the log file. This version has also some further control points which will probably help debug this problem.
    I would appreciate it if you could download the Development Version and if you could try this again. But it is necessary that you change the PODPRESS_DEBUG_LOG constant again.
    Please, use a full URL as the "Location:".

    file permissions of 644 should be fine for all the files. Normally the directory permissions are the only things set to 755

    Ray, thank you for clarifying that. I was not completely sure about that.

    Regards,
    Tim

  16. raymer
    Member
    Posted 3 years ago #

    @Tim, thanks for clearing up my misunderstanding. For some reason I thought podpress could not get info on remote files. Did you add this functionality? It seems like it didn't work for me years ago when I used podpress to link to some remote files.
    I understand now how podpress can get the filesize attributes for remote files from the HTTP response. But I did not realize that it actually downloaded the entire file and got the length too! Many (most) of my audio podcasts are 10MB+ and videos can be even bigger. Doesn't this cause issues? Maybe Jeremy's files are bigger than the PHP filesize limits? Would that matter?
    Sorry I didn't take the time to experiment with remote files - I am running busy and it's easier just to ask the developer!

    -Ray

  17. jersnav
    Member
    Posted 3 years ago #

    Thank you both for all the help.

    Here's an update.

    I've installed the latest development version 8.8.9.2 RC2.

    1. Auto detect works fine on local hosted mp3s whether I just enter the filename or I enter the complete url.

    2. Auto detect also works on remote hosted mp3s ONLY when I enter a remote URL into the Podpress general setting "URL of the media files directory"

    3. However Auto detect still fails (i.e. returns full html of wordpress page) when I enter a remote mp3 URL into the media location field on a post page.

    I've enabled debug log and it contains messages for auto detect attemps for scenarios 1 and 2 above but no message at all is in log for scenario #3.

    Here's pastebin of log file
    http://wordpress.pastebin.com/download.php?i=vgg3XVsB

    Thank you!

  18. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Would do you mean with "auto detect"? The file size detection or the duration detection or both?

    2. Auto detect also works on remote hosted mp3s ONLY when I enter a remote URL into the Podpress general setting "URL of the media files directory"

    I don't understand why it should be necessary to put a remote URL into the "URL of the media files directory" setting.
    If you like to have the dropdown menu at the post editor page then you need to insert the a full path of a folder which contains media files into "Absolute path of the media files directory (optional)" field. There will be no dropdown menu (instead of the simple input field) if the folder does not contain media files.
    If both "Location of the Media Files" are not pointing to same directory then the download URLs on the front page of the blog will in most cases not work.

    But if you specify a full URL to a file (on a remote server or on the same server as the blog) as the file location in the field below the editor then it is not important for the detection of the file size and the duration of that file what the "Location of the Media Files" settings are.
    I understand that exactly this is not working in some of your blogs and I would like to find out why this:

    3. However Auto detect still fails (i.e. returns full html of wordpress page) when I enter a remote mp3 URL into the media location field on a post page.

    happens.
    For instance when I insert an URL of one of the mp3 files of the The Medical Podcast page which are hosted on archive.org as the location (in my blog), it is no problem to retrieve at least the file size. I also do not need to change the "URL of the media files directory" setting. It can remain the URL of the uploads/ folder of my blog.

    I have made a further Development Version. This version includes 3 further control point for the log procedure and several minor JS and PHP bug fixes.
    Please, download this version, change the PODPRESS_DEBUG_LOG constant again and test the file size and duration detection while the "Absolute path of the media files directory (optional)" option is not set (the field is empty).
    Please, post the log file entries of these tests.

    Thanks,
    Tim

  19. jersnav
    Member
    Posted 3 years ago #

    Dear Tim,

    Thank you again for all your help!

    I installed the new Development Version.

    However, no entries are made in the log file when I attempt to use either autodetect button when a full URL is entered into the media file location field.

    An entry is made when I enter a file name of a file in the upload directory. You can see that at http://wordpress.pastebin.com/download.php?i=G0cBPpuY

    Thank you again!
    Jeremy

  20. raymer
    Member
    Posted 3 years ago #

    Jeremy and Tim,
    This thread is starting to get long and some of the assumptions I had at the beginning might be wrong. Can I confirm a couple of points?
    1. The only issue here is that the functions which require the remote file to be downloaded are not working, right?
    2. These functions work on one of Jeremy's shared hosting service providers but not on another one (HOst Gator), right?

    Since it doesn't seem to be permissions related, another possiblity is that Host Gator has disallowed curl() or fopen() on their server for security reasons and that is why the file cannot be detected (the download fails). Tim, how is podpress downloading the remote file? What PHP function does it use? Does it call a WP function for this? Does your debug code have logic to check if the function call to transfer the remote file completed properly?

    Thanks,
    Ray

  21. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Ray and Jeremy,

    as I understand it, the file size detection (no download necessary) and the duration detection (download necessary if the file is on a different server) do not work in the same way. If Jeremy enters an URL of a media file which is on a server which is not the server of the blog then the file size and the duration field get populated with the code of the 404 page or the front page depending on the blog.

    The result of the last test (no entries in the log file) shows that somehow the request does not get through to the routine in the podpress_backend.php file which would call the function to detect the file size or the duration (podpress_admin_functions.php) when he enters a full URL. The whole process does not get started.
    It seems to be not important whether it is an URL to a remote file or local file. (But that this is my assumption.)
    But if he enters only a file name of a file which is in the folder which is reachable with the "URL of the media files directory".

    A typical request with a full URL as the location would look like this http://www.example.com/wp-content/plugins/podpress/podpress_backend.php?action=getfilesize&filename=http://www.example.com/wp-content/uploads/example.mp3

    But a typical request with only a file name in the "Location:" field would look like this http://www.example.com/wp-content/plugins/podpress/podpress_backend.php?action=getfilesize&filename=example.mp3
    In this case a function in the podpress_admin_functions.php file will the URL to the file name and detect the file size. The last log is from such a case: http://wordpress.pastebin.com/G0cBPpuY The filename parameter is only the file name (lori-wallach.mp3).

    For me it looks like the problem of the URL and maybe of the value of the &filename= paramter.

    This

    2. Auto detect also works on remote hosted mp3s ONLY when I enter a remote URL into the Podpress general setting "URL of the media files directory"

    supports my assumption.

    Maybe the problem is that the URL of the media file does not get escaped with the right method. But I would think that the log file should contain at least one line "podpress_backend.php - param filename:". The value of the paramter &filename= gets escaped with escape() (JS) or encoded with encodeURI() or encodeURIComponent() (JS) that depends on whether it is a file from the dropdown menu or the input field. (The JS which starts after the click on the file size button is in line 63-88 of the /js/podpress_admin.js)

    But I think we could rule out a problem with the URL escaping method if the same URL would work in a different blog.
    Jeremy would you post the URL of the media file from the last test? Or could you try to retrieve the file size of this file by inserting the full into a "Location:" field in one of the blogs where the auto detection works. (File size detection works without a download and it take usually only seconds regardless whether it is a remote file or not.)

    Or maybe the problem are some additional entries in the .htaccess file.

    @Ray:

    Tim, how is podpress downloading the remote file?

    It opens a connection with fsockopen() and tries to create a local file in one of the tmp folders with tempnam() or fopen() (see lines 1144 and 1181-1264 in podpress_admin_functions.php)
    Other used PHP functions are fwrite() to send the HTTP request and later to write to the file. fgets() to receive the response.

    Does your debug code have logic to check if the function call to transfer the remote file completed properly?

    Well, after fclose($fpRemote); is a further control point (podPress_var_dump('podPress_downloadFile - (file) before return');)
    and there would also be a notice in case the download would stop because of a time limit. On the other hand there is no custom error message in case the fclose() calls went wrong.

    My next questions for Jeremy would be: What is in the .htaccess file for instance of the Transpartisan Innovations blog? Does the file contain other then these lines while you are using a non-default Permalink scheme?
    Are you using any other plugins (besides podPress) in the Transpartisan Innovations blog? Which plugins?

    (If the .htaccess file exists, it is in the root directory of your blog (the same folder which includes the wp-config.php file). The .htaccess is maybe a hidden in the view of your FTP or SSH client.)

    Tim

  22. jersnav
    Member
    Posted 3 years ago #

    Hi Guys,

    Thank you!

    Here is the pastebin link to the two .htaccess files:
    http://wordpress.pastebin.com/download.php?i=GsTkqPsw
    It shows the file from the functioning site and the one from the site with the error.
    They appear to be the same

    Here is one of the URL's I'm testing:
    http://www.archive.org/download/StopTheU.s.KoreaTradeAgreement/lori-wallach.mp3

    So to review the functioning of the Auto Detect buttons:

    1) entering just file name (if file is in uploads dir) e.g. "lori-wallach.mp3" - BOTH AUTO DETECT BUTTONS WORK

    2) entering full URL to file in local UPLOAD dir e.g. "http://www.transpartisaninnovations.com/wp-content/uploads/lori-wallach.mp3" - ALSO BOTH AUTO DETECT BUTTONS WORK

    3) entering full URL to remotely hosted mp3 e.g. "http://www.archive.org/download/StopTheU.s.KoreaTradeAgreement/lori-wallach.mp3" - AUTO DETECT BUTTONS DO NOT WORK

    4) entering partial remote URL leaving off MP3 file name in general setting "URL of the media files directory" e.g. "http://www.archive.org/download/StopTheU.s.KoreaTradeAgreement/"
    and then entering just the file name in the media location field in the post e.g. "lori-wallach.mp3" - ALSO BOTH AUTO DETECT BUTTONS WORK

    Thank you!! Jeremy

  23. ntm
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks again for the report!

    Both .htaccess files are looking okay to me. It seems that they do not include problematic things.

    I have tested the URL to the archive.org hosted file and it is not a problem for me to retrieve the file size and the duration regardless of the values in the section "Location of the Media Files" of the General Settings of podPress.

    Jeremy, please, try to find out whether other plugins have an influence in the third case. Please, deactivate other plugins temporarily.

    Regards,
    Tim

  24. jersnav
    Member
    Posted 3 years ago #

    Thank you Tim.
    To rule out plugins I created a completely fresh install of WordPress without any plugins.
    I appreciate your help here.
    Jeremy

  25. jersnav
    Member
    Posted 3 years ago #

    To answer Ray's question:
    Yes, this is happening on all WordPress installs that I have hosted at Host Gator shared hosting.

    WordPress installs I have hosted on Apollohosting and Lunarpages shared hosting are functioning ok in this regard. I'm trying to migrate all to HostGator and/or Lunarpages because they seem to run much faster that Apollohosting's servers (for WordPress installs anyhow). Apollohosting doesn't host the MySql databases on the "localhost". They have external machines running their mysql databases and it seems to really slow down WordPress. Sorry for the off topic rant.

    Thanks again!
    Jeremy

  26. raymer
    Member
    Posted 3 years ago #

    Jeremy,
    Try adding this to your .htaccess file

    php_flag allow_url_fopen on

    put it right before or right after the wordpress section. (remember to
    backup the original .htaccess file first)

    -Ray

  27. jersnav
    Member
    Posted 3 years ago #

    Dear Ray,
    Thank you for the suggestion!

    When I include that line either before or after the wordpress section I get the following server error when trying to access the site (site works normally again when I remove the line):

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, webmaster@transpartisaninnovations.themedicalpodcast.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
    Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8q DAV/2 mod_fcgid/2.3.5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at http://www.transpartisaninnovations.com Port 80

  28. raymer
    Member
    Posted 3 years ago #

    Jeremy,
    That error means that the server doesn't understand what you put in the .htaccess file.
    I use that flag with no problems. I am using PHP 5.2.17 running as an apache module. Do you know what version of PHP you are running (type php -v at the shell prompt) and do you know if you are running php as cgi or as an apache mod?

    @Tim,
    I had a hunch it was because you were using fopen(). I have had problems on some hosts who block fopen() by default for security reasons. The preferred way to download by url from php seems to be with curl(). BUT - I can't reproduce jeremy's problem on my server. I've been trying using remote urls from here:
    http://www.archive.org/details/AlJolson
    and it always works - even when I add php_flag allow_url_fopen off to my .htaccess. So I am probably wrong about this - sorry.

    By the way, getting the size, durations and even ID3 tags for remote files works great. I didn't realize how robust podpress had become since you started patching and improving it. Great work Tim!

    -Ray

  29. jersnav
    Member
    Posted 3 years ago #

    Hi Ray,
    Thank you again!
    PHP is 5.2.15 and it is running as CGI.
    That and other PHP settings for the server are here:
    http://www.themedicalpodcast.com/phpinfo.php
    Jeremy

  30. raymer
    Member
    Posted 3 years ago #

    Jeremy, sorry but I think I was wronag about php flags being the cause of your problems on Host Gator.

    http://support.hostgator.com/articles/cpanel/php-settings-that-cannot-be-changed

    says that allow_url_fopen is on by default. Further, I can't break podpress by turning off allw_url_fopen on my own site so I'm sorry I spoke too soon. For what it's worth this functionality works great on my site and HostGator seems to have an active support guy. Maybe he can give you a clue what is different about their server?

    -Ray
    P.S. you might try renaming your .htaccess file temporarily just to see if this is related to the bulletproof plugin stuff - but since you said it works on other servers, I doubt that's it...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags