Skip to content

Why, since version 2.1.0, has the use of this plugin been restricted to php versions <5.6? #190

Closed

Description

@eniocarboni

Now Wordpress asks to update but as soon as done the plugin no longer works due to the php version restriction.
Why was this done? Anyone who has an Ubuntu 14.04 LTS can use the latest version of Wordpress but no longer this plugin.
Would not it be possible to review what is limited by php> 5.6?
Updating the php in a production environment using non-standart channels is not always the best solution.

Activity

  1. fclaussen commented on Jun 6, 2018

    @fclaussen
    Member

    Hi @eniocarboni
    The plugin always had PHP 5.6 and up as a requirement.
    What was happening is that I would get hundreds of support requests that ended up being the PHP version below 5.6.
    So I've put a version check in place.

    PHP 5.6 adds a new parameter to the array_filter function. We make use of this parameter.

    The plugin could work with version 5.5 but you would get errors whenever the functions that are using this third parameter of the array_filter function ran.

    I know that not everyone is able to update their PHP version, but it's either block it and prevent unforeseen problems and errors or allow it and get angry users saying that it doesn't work, settings don't save, re-consent logic is faulty and so on.

    If you really want, you can bypass the version check by removing these lines:

    File: includes/class-gdpr-activator.php
    Lines: 35-37

    if( -1 === version_compare( phpversion(), GDPR_REQUIRED_PHP_VERSION ) ) {
    	die(sprintf( esc_html__( 'Your current PHP version (%1$s) is below the plugin required version of %2$s.', 'gdpr' ), phpversion(), GDPR_REQUIRED_PHP_VERSION ));
    }
    

    File: admin/class-gdpr-admin.php
    Lines: 566 & 573-574
    if( -1 === version_compare( phpversion(), GDPR_REQUIRED_PHP_VERSION ) ) {

        deactivate_plugins( 'gdpr/gdpr.php' );
    }
    
  2. eniocarboni commented on Jun 6, 2018

    @eniocarboni
    ContributorAuthor

    Hi @fclaussen,
    you could implement a wrapper function or an alternative if the problem is only on the "array_filter" function.
    What do you think of using, for example, something like this for the "ARRAY_FILTER_USE_KEY" flag?
    See https://gist.github.com/h4cc/8e2e3d0f6a8cd9cacde8

  3. fclaussen commented on Jun 6, 2018

    @fclaussen
    Member

    I could find ways around it the same way I could manually add a boolval function for folks under PHP 5.5. But that is a low priority for me at the moment. I would really appreciate pull requests for this. I definitely want to support as many versions of PHP and WP as possible.

    What version of PHP are you running anyway?
    I can always add more tests to Travis to see whether it would work or not.

  4. eniocarboni commented on Jun 6, 2018

    @eniocarboni
    ContributorAuthor

    PHP 5.5.9-1

  5. fclaussen commented on Jun 6, 2018

    @fclaussen
    Member

    I just asked a friend of mine. See if he is available to help out with this.
    Maybe get it to support 5.5 or 5.4+

    @airesvsg

  6. eniocarboni commented on Jun 6, 2018

    @eniocarboni
    ContributorAuthor

    @fclaussen I did a pull request, could you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions