Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • can you post the AJAX response when trying to click “save & publish” ?

    if update_option('aou_progress','0'); is located in your main plugin file then it gonna be a problem
    because any request to your server (refreshing page, ajax call, etc) will trigger that method call
    which means it will always reset aou_progess value into 0
    you might need to put additional logic for that

    another thing to be noted is: CURLOPT_PROGRESSFUNCTION
    check this out: https://php.net/manual/en/function.curl-setopt.php#116866

    for PHP version < 5.5.0, CURLOPT_PROGRESSFUNCTION pass 4 arguments
    and for PHP version >= 5.5.0, CURLOPT_PROGRESSFUNCTION pass 5 arguments
    which means it may break without version checking

    you also need to be careful with CURLOPT_PROGRESSFUNCTION
    because it is a callback function which run separately and standalone
    which means a second call to progressCallback can not recognize previous state from progressCallback at the first time
    so you just need to be aware of $upload_size and $uploaded_size ($previousProgress is unused)

    then the last thing is, it may not 100% reflect your current progress because it is a race between:
    – callback from CURLOPT_PROGRESSFUNCTION
    – and your AJAX under window.setInterval

    the progress bar might work for a large file size upload but it may “not work” for a small file size upload
    “not work” -> because CURLOPT_PROGRESSFUNCTION might already reach 100% before your AJAX call had a chance to update the progress bar gradually

    Yeah, the_post_thumbnail_caption() is introduced since 4.6.0
    Most likely blank / white page is happened because of PHP Fatal Error

    It depends on you configuration, usually the first thing to do is to:

    1. if you are on debug mode and debug log is on
    define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_LOG’, true);
    check your WordPress’ debug.log

    2. if you are not on debug mode then check you server’s error log (need to make sure you turned it on in your server’s configuration)

    The error message is pretty clear:
    [22-Aug-2016 05:12:48 UTC] PHP Fatal error: Cannot redeclare the_post_thumbnail_caption() (previously declared in /somewhere/wp-includes/post-thumbnail-template.php:244) in /somewhere/wp-content/themes/twentysixteen/functions.php on line 453

    document.sub_but will retrieve element with name sub_but

    when you are only using one short code, document.sub_but will return:

    <img src="photo1" style="width:250px; height:250px; border:0px solid #cc3300;" alt="Move your mouse over me" name="sub_but">

    whereas when there are two short codes, document.sub_but will return an array:

    [
        <img src=?"photo1" style=?"width:?250px;? height:?250px;? border:?0px solid #cc3300;?" alt=?"Move your mouse over me" name=?"sub_but">?
    ,
        <img src=?"photo2" style=?"width:?250px;? height:?250px;? border:?0px solid #cc3300;?" alt=?"Move your mouse over me" name=?"sub_but">?
    ]

    which makes document.sub_but.src invalid

    my suggestion is to change that into:

    this.getElementsByTagName('img')[0].src

    this -> means <a> element
    getElementsByTagName('img')[0] -> retrieve the first <img> element relative from <a>

Viewing 4 replies - 1 through 4 (of 4 total)