Support » Plugin: WP Download Codes » Feature request – full PHP7 Support & Clean Log

  • miroh

    (@miroh)


    This Plugin has some Problems with PHP 7.2, by using deprecated functions and wrong constant definitions. A hotfix is also described in HELP – not compatible with php 7.2.

    Also the plugin has an massiv output running in Debug-Mode. Mainly becaus of calling undefined variables & indexes. But also because of deprecated MYSQL.

    I personly use the plugin on a webseite with multiple users, with different rights. Described in my Post Feature request: changable capability. By reassigning the admin_menu hook there is a workaround without touching the original plugin.

    I fixed all these problems for my site, plus adding the optional user rights. If some one is interested have a look at Github.

    I would love to see my changes merged into this plugin. Especially for update purpose.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Sami S

    (@sami-sanpakkila)

    Very cool! I will test this on my staging site today!

    Sami S

    (@sami-sanpakkila)

    Just uploaded this to my staging site and it works.

    Unfortunately doesn’t solve my issues.

    I’m not able to add new releases since the dropdown selector to choose release from is not visible.

    Also I don’t see the pop-up window to reset download codes. I wonder if these are something that @miroh you could take a look at?

    Best, Sami

    Thread Starter miroh

    (@miroh)

    Hi Sami,
    I can’t reproduce any of these problems. The Javascript uses quit common variable names, that can collide with scripts of other plugins. I just pushed an update to git where I isolated the javascript and renamed some commone classes and IDs. That could solve the problem.

    Dropdown not visible
    This seems to be a javascript problem. Maybe even by a other Plugin. With one of the last Plugin-Updates this field will be shown by javascript depending on the Hosting Type.
    Could you have a look at your console, are there any Errors? (You are using Safari and don’t know how to find the console? Rightclick someware on the page > Element Information > Console. If the Menu entry Element Information (or similar) dose not exist, go to Safari Preferences (⌘ + ,) > Advanced > Check last Option, something similar to ‘Enable Developer Menu’)

    PopUp
    Is this the same Question as Toppic? If the List is posted to the End of the Page, propably some CSS overwrite the Layer positioning. The commit sould work here to.

    Sami S

    (@sami-sanpakkila)

    Wow! Thank you so much @miroh! This update seems to have solved both of my problems! 😀

    Do you want me to still look up any of the error logs? I can do that.

    Thread Starter miroh

    (@miroh)

    That’s nice to hear.

    If there are no other Problems. I don’t think so. Actual, if there are some critical Errors, these will probably come from other Plugins, so they won’t fit into this thread.

    @miroh BRILLIANT! Thank you for all your hard work in updating the plugin and making it PHP7 compatible! All your changes are spot on. May I just recommend an alteration to /wp-download-codes/includes/admin/manage-codes.php lines 31-41. Currently, the code tries to evaluate and assign the $release_id variable, but it doesn’t check if there are any releases in the database until much later in the code. Which means that when the plugin is first installed, a visit to this page results in a notice, because both conditions on line 31 come back positive thus it tries to execute line 32, but $releases is an empty array because there are no releases in the database yet. Which means $releases[0]->ID throws a PHP notice.

    The workaround for this could be adding a check before line 31 for the following:

    if ( ! $releases ) {
        $release_id = '';
    }

    Alternately it could be done as:

    if ( count( $releases ) == 0 ) {
        $release_id = '';
    }

    Then continuing all the other conditions as elseif.

    Thoughts?

    Thread Starter miroh

    (@miroh)

    @davidbawiec – that shounds more than correct, but have never tested the changes without Releaces – I pushed an Update with an Fix to GitHub.

    Great re-write! Cheers!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Feature request – full PHP7 Support & Clean Log’ is closed to new replies.