WordPress.org

Ready to get started?Download WordPress

Forums

Uploads by Proxy
[resolved] Fixed some issues (6 posts)

  1. justnorris
    Member
    Posted 1 year ago #

    Hi Paul,
    First of all - thanks for the amazing plugin. I'm using this in combination with WP-db migrate pro and - awhh - it's just amazing. Having a site.com and a dev.site.com be exactly 1:1 is just what I needed.

    However, activating your plugin triggered some notices and warnings for me, which I've fixed now. For some reason the plugin didn't work with them as well.

    Anyhow - I've fixed the plugin with just some simple small tweaks.
    https://www.sugarsync.com/pf/D1974934_71242712_689088

    Issues I had were on Mac (MAMP): PHP 5.2.17

    http://wordpress.org/plugins/uploads-by-proxy/

  2. Paul Clark
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks @justnorris!

    I took a look through the patch and appreciate you're taking the time to write it up and report it! Your attention to detail really helps out others a lot.

    Notice & patch
    I think I saw the notice you were referring to, but want to make sure the change I committed resolves the issue for you, so please check version 1.1.1 that was just deployed.

    From what I could see in the error, the notice was being caused by PHP's parse_url was not returning a path value for sites that were installed in the root directory. Rather than change where the plugin inits, I took the route of suppressing notices for that var, knowing it may or may not be in the array.

    __CLASS__ vs. Class_Name::
    While I can understand some advantages of using __CLASS__ to reference the current static class name (especially if the class is renamed), I prefer the Class_Name:: syntax to help give context while reading through the method.

    Since this seemed to be more a matter of style preference than directly related to the notice, I left that change out. Please let me know if I missed a significant functional difference here, or if I'm not addressing the actual error you were!

    Thanks & credit
    Thanks for the excellent work! I have credited you and referenced this thread in the changelog.

    Paul

  3. Paul Clark
    Member
    Plugin Author

    Posted 1 year ago #

    PS: It looks like you're on Github! You can find this and many of my other plugins at github.com/brainstormmedia and github.com/stylesplugin.

  4. justnorris
    Member
    Posted 1 year ago #

    That cleans up only half the problem.

    When the admin_init filter is added, the referenced class doesn't go through in PHP 5.2.17

    Warning: call_user_func_array() [<a href='function.call-user-func-array'>function.call-user-func-array</a>]: First argument is expected to be a valid callback, 'UPB_Helpers::requirements_check' was given in /Sites/Dev/wp-includes/plugin.php on line 406
    Call Stack
    #	Time	Memory	Function	Location
    1	0.0012	256368	{main}( )	../upload.php:0
    2	0.0022	388048	require_once( '/Sites/Dev/wp-admin/admin.php' )	../upload.php:10
    3	0.5306	40531568	do_action( )	../admin.php:109
    4	0.5359	40809304	call_user_func_array ( )	../plugin.php:406

    PHP 5.3.14 and 5.4.4 Says:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'UPB_Helpers' not found in /Sites/Dev/wp-includes/plugin.php on line 406
    Call Stack
    #	Time	Memory	Function	Location
    1	0.0012	801040	{main}( )	../upload.php:0
    2	0.0019	917176	require_once( '/Sites/Dev/wp-admin/admin.php' )	../upload.php:10
    3	0.4476	40468832	do_action( )	../admin.php:109
    4	0.4525	40742072	call_user_func_array ( )

    I think that means that PHP Doesn't really like the way the class is being called later on.

  5. Paul Clark
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks. I see where that one was coming out now. Should be resolved in 1.1.2. The warning meant that the method was being called using static syntax, UPB_Helpers::requirements_check, but it wasn't being declared as static.

    Here's the diff.

  6. justnorris
    Member
    Posted 1 year ago #

    Duh. I didn't notice that. Well - I'm glad it's resolved now :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.