• How is it possible to disable the PHP Version check for a Plugin globally? I need this temporary to update a plugin to the last functional PHP 5.6 version, which I can’t do anymore since the current version don’t allow any updates, even no older versions. Changing and downgrading the “Requires PHP:” entry inside the “readme.txt” of the plugin should normally work but unfortunately the plugin is too big for uploading on the server and I can’t raise the PHP Upload size more than 16 MB from my hosting panel. So I get the error message “The link you followed has expired”. I also try to upload a php.ini file with the values and edit the .htaccess with every suggestions from this website which results in an “Internal Server Error”.

    https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-link-you-followed-has-expired-error-in-wordpress/

    So my last hope it to disable the PHP Version check from WordPress installation to update the plugin directly from admin panel without any PHP warnings but how can I do this and which files do I have to edit?

    • This topic was modified 3 years, 3 months ago by funcoder88.
Viewing 1 replies (of 1 total)
  • I looked at wp code and there are no filters and it is a core function, but it is easy to temporarily hack.

    File

    wp-includes/functions.php

    change around line 8026

    function is_php_version_compatible( $required ) {
    	return empty( $required ) || version_compare( phpversion(), $required, '>=' );
    }

    to

    function is_php_version_compatible( $required ) {
    	return true;
    }

    Of course this is a temporary hack, will be overwritten by a new update and your security software may well detect core file changes.

    Do on a test system first – or make sure you have a working back up just in case.

    Just as an aside – Changing and downgrading the “Requires PHP:” entry inside the “readme.txt” of the plugin

    The check is actually done against the plugin main php file header not the readme.txt – I know lots of devs put it in the readme.txt but that is not actually the right place

Viewing 1 replies (of 1 total)
  • The topic ‘Disabling the PHP Version Check’ is closed to new replies.