• Resolved aviatorbimmer

    (@aviatorbimmer)


    When I go to my post, everything that goes after the shortcode does not appear. The button will not appear and the rest of the page will not appear as well. It is all blank. I really would love to see an update for WP 4.7.3.

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author prod3v3loper

    (@prodeveloper)

    Hi @aviatorbimmer,
    and thank you for your feedback, however, this can be not only on the plugin itself but also in the environment on which the plugin runs.
    If you want, I can help you, if so please post your shortcode here.
    And we continue to see, hope could help first.

    Best regards
    Developer

    Thread Starter aviatorbimmer

    (@aviatorbimmer)

    Hi Samet,

    I have a clean install of WP 4.7.3 and no plugins installed other than MeliBu WP Download Counter Button. In other words, I did a clean install of wP 4.7.3 and immediately afterwards I installed this plugin. I did this to rule out any 3rd party code.

    What do you mean by the environment on which the plugin runs?

    Plugin Author prod3v3loper

    (@prodeveloper)

    Hi @aviatorbimmer,

    with the environment I mean on what server or webspace it runs, e.g. Linux or Windows, then which PHP version (With most hosters one can adjust the PHP version in the account itself or look up).

    I use PHP 7 on my Linux server and develop it with a environment with PHP 5.6, with me it works everywhere and with 100 others synonymous, so it must be something else. To find out I need your help, since I can not access your server. I need the best error messages, but the first thing would be synonymous to me the short code that you write in the editor.

    Please post here but once your short code.

    Thread Starter aviatorbimmer

    (@aviatorbimmer)

    Hello Samet,

    Ok, I currently am on a VPS server and have the following set up:

    PHP 7.0.16
    mySQL 5.6.35

    Here is the short code:

    [wp_mb_plugin_download instance="1" password="" buttonname="Download" name="Download Label" datetime="March 15, 2017 - 2:25 pm" other="v.1.7 (stable)" atagseo="tag"]https://www.losdurosdelgenero.info/wp-content/uploads/2017/03/Wildanger_-_Baby_Prod._By_Yamil_Blaze_x_James_El_Morenaje_x_Gil_The_Manager_Droopy_El_Duro_-_www.losdurosdelgenero.com_.mp3[/wp_mb_plugin_download]

    And here is the link to the post, so you can see how the post is showing up with the code inserted into the post:

    https://www.losdurosdelgenero.info/reggaeton/2017/03/15/test-title/

    I hope this helps somehow! =)

    Plugin Author prod3v3loper

    (@prodeveloper)

    Ok thank you, that seems to be all right.

    Can you add the following in the wp-config.php:

    Define ('WP_DEBUG', true);
    Define ('WP_DEBUG_LOG', true);
    Define ('WP_DEBUG_DISPLAY', false);

    This causes the error to be logged into a log file named debug.log and prevents it from appearing after you have inserted that into the wp-config.php, go to the page where the button is included and update this page once . Then the file would have to be created and the error or the errors are then there, the debug.log is then found in the wp-content folder.

    Please post this content here. However, make your server root unrecognizable something like /var/www/host/wp-content/... to /xxx/xxx/xxx/wp-content/... but leave the rest inside of the path something like /wp-content/plugins/download-counter-button

    Thread Starter aviatorbimmer

    (@aviatorbimmer)

    Hi Samet,

    This is the error I get:

    
    [15-Mar-2017 22:49:34 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function finfo_open() in /home/******/public_html/wp-content/plugins/download-counter-button/classes/class.MelibuDownloaderAbstract.php:133
    Stack trace:
    #0 /home/******/public_html/wp-content/plugins/download-counter-button/classes/class.MelibuDownloader.php(283): MELIBU_PLUGIN_DOWNLOADER_ABSTRACT->get_type_by_path('/home/******/p...')
    #1 /home/******/public_html/wp-content/plugins/download-counter-button/classes/class.MelibuFrontend.php(233): MELIBU_PLUGIN_DOWNLOADER_01->return_download_data('https://www.losd...', Array, 484)
    #2 /home/******/public_html/wp-includes/shortcodes.php(345): MELIBU_PLUGIN_FRONTEND_01->shortcode(Array, 'https://www.losd...', 'wp_mb_plugin_do...')
    #3 [internal function]: do_shortcode_tag(Array)
    #4 /home/******/public_html/wp-includes/shortcodes.php(223): preg_replace_callback('/\\[(\\[?)(wp_mb_...', 'do_shortcode_ta...', '<p>Test Body Co...')
    #5 /home/******/public_html/wp-includes/class-wp-hook.php(298): do_shortcode('<p>Test Body Co...')
    #6 / in /home/******/public_html/wp-content/plugins/download-counter-button/classes/class.MelibuDownloaderAbstract.php on line 133
    [15-Mar-2017 22:49:38 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function finfo_open() in /home/******/public_html/wp-content/plugins/download-counter-button/classes/class.MelibuDownloaderAbstract.php:133
    Stack trace:
    #0 /home/******/public_html/wp-content/plugins/download-counter-button/classes/class.MelibuDownloader.php(283): MELIBU_PLUGIN_DOWNLOADER_ABSTRACT->get_type_by_path('/home/******/p...')
    #1 /home/******/public_html/wp-content/plugins/download-counter-button/classes/class.MelibuFrontend.php(233): MELIBU_PLUGIN_DOWNLOADER_01->return_download_data('https://www.losd...', Array, 484)
    #2 /home/******/public_html/wp-includes/shortcodes.php(345): MELIBU_PLUGIN_FRONTEND_01->shortcode(Array, 'https://www.losd...', 'wp_mb_plugin_do...')
    #3 [internal function]: do_shortcode_tag(Array)
    #4 /home/******/public_html/wp-includes/shortcodes.php(223): preg_replace_callback('/\\[(\\[?)(wp_mb_...', 'do_shortcode_ta...', '<p>Test Body Co...')
    #5 /home/******/public_html/wp-includes/class-wp-hook.php(298): do_shortcode('<p>Test Body Co...')
    #6 / in /home/******/public_html/wp-content/plugins/download-counter-button/classes/class.MelibuDownloaderAbstract.php on line 133

    Samet, if you think it would be even faster and more efficient to communicate directly through email, please contact me via aviatorbimmer at gmail dot com

    That would be much faster and I can really help you troubleshoot this issue. =)

    Plugin Author prod3v3loper

    (@prodeveloper)

    Ok, thank you, so I would not be faster with email and here it can help others also in the short term if they have the same problem.

    It looks as if finfo is not activated with you, but you could activate it:
    Activate finfo

    Or replace the code in /home/******/public_html/wp-content/plugins/download-counter-button/classes/class.MelibuDownloaderAbstract.php line 133 by the other function.

    From:

    /**
     * FILETYPE with path
     * @param type $filepath
     * @return type
     */
     protected function get_type_by_path($filepath) {
    
         $finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension
         $type = finfo_file($finfo, $filepath);
         finfo_close($finfo);
                
         return $type;
     }

    To:

    /**
     * FILETYPE with path
     * @param type $filepath
     * @return type
     */
     protected function get_type_by_path($filepath) {
    
         $type = '';
         if (function_exists('mime_content_type')) {
             $type = mime_content_type($filepath);
         }
                
         return $type;
     }

    I think this should work, so you do not have to touch the php.ini

    Thread Starter aviatorbimmer

    (@aviatorbimmer)

    Hi Samet,

    After editing class.MelibuDownloaderAbstract.php, it is now working. Thanks!!

    Is there a way to set up the shortcode so that in the name, it automatically adds the post’s title? So instead of having to manually enter a name for each label, it takes the post’s title instead? I tried %title% but that didn’t work.

    Thread Starter aviatorbimmer

    (@aviatorbimmer)

    Also, the counter isn’t working either. When I click the download button, it will update the download counter to 1, but as soon as I refresh the page, it goes back to zero.

    Plugin Author prod3v3loper

    (@prodeveloper)

    Cool, that pleases me, forget my rating not for the plugin ??
    The title is unfortunately not possible, only default for all.
    Is there any error message?

    I just see that there is still a function with finfo in line 149 exchange but please these also.

    From:

    /**
      * FILETYPE with url
      * @param type $fileurl
      * @return type
      */
      protected function get_type_by_url($fileurl) {
    
          $filecontent = file_get_contents($fileurl);
          $file_info = new finfo(FILEINFO_MIME_TYPE);
          $type = $file_info->buffer($filecontent);
                
          return $type;
      }

    To:

    /**
      * FILETYPE with url
      * @param type $fileurl
      * @return type
      */
      protected function get_type_by_url($fileurl) {
                
          $type = '';
          if (function_exists('mime_content_type')) {
              $type = mime_content_type("$fileurl");
          }
                
          return $type;
      }

    And please post nevertheless if there are error messages in the debug.log

    Thread Starter aviatorbimmer

    (@aviatorbimmer)

    Hi Samet,

    I went ahead and instead, just installed fileinfo on my server and now everything is working as expected! I guess fileinfo not being enabled was the main culprit. Thanks for your help in figuring this out!!!!

    I have another question though…

    Is there anyway to be able to leave some of the shortcode entries blank and maybe have the Buttonname field of the shortcode to autopopulate with the post’s title?

    In other words, I want to leave OTHER blank and for BUTTON NAME, let it use the post’s title. This would really help in my setup.

    Thanks again!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Does not work with WP 4.7.3’ is closed to new replies.