Plugin Directory

Changeset 1916669


Ignore:
Timestamp:
07/30/2018 12:36:40 AM (8 years ago)
Author:
Kelderic
Message:

Bugfix: Don't run plugin logic on old versions of PHP that are incompatible.

Location:
featured-galleries/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • featured-galleries/trunk/featured-galleries.php

    r1916635 r1916669  
    44 * Plugin URI:        http://wordpress.org/plugins/featured-galleries/
    55 * Description:       WordPress ships with a Featured Image functionality. This adds a very similar functionality, but allows for full featured galleries with multiple images.
    6  * Version:           2.0.0
     6 * Version:           2.0.1
    77 * Author:            Andy Mercer
    88 * Author URI:        http://www.andymercer.net
     
    2121define( 'FG_PLUGIN_FILE', __FILE__ );
    2222
     23if ( version_compare( PHP_VERSION, '5.4', '<' ) ) {
    2324
     25    add_action('admin_notices', 'my_plugin_notice');
    2426
    25 /***********************************************************************/
    26 /**********************  INCLUDE REQUIRED FILES  ***********************/
    27 /***********************************************************************/
     27    function my_plugin_notice(){     
    2828
    29 require_once( plugin_dir_path(FG_PLUGIN_FILE) . 'includes/controller.php' );
     29        echo '
     30            <div class="error below-h2">
     31                <p>
     32                 ' . sprintf( 'Featured Galleries requires PHP version 5.4 or greater. You are currently running version: %s. Please deactivate Featured Galleries or upgrade your PHP.', PHP_VERSION ) . '
     33                </p>
     34            </div>
     35        ';
     36    }
    3037
    31 require_once( plugin_dir_path(FG_PLUGIN_FILE) . 'includes/public-functions.php' );
     38} else {
    3239
     40    /***********************************************************************/
     41    /**********************  INCLUDE REQUIRED FILES  ***********************/
     42    /***********************************************************************/
    3343
     44    require_once( plugin_dir_path(FG_PLUGIN_FILE) . 'includes/controller.php' );
    3445
    35 /***********************************************************************/
    36 /*****************************  INITIATE  ******************************/
    37 /***********************************************************************/
     46    require_once( plugin_dir_path(FG_PLUGIN_FILE) . 'includes/public-functions.php' );
    3847
    39 new FG_Controller();
     48    /***********************************************************************/
     49    /*****************************  INITIATE  ******************************/
     50    /***********************************************************************/
     51
     52    new FG_Controller();
     53
     54}
  • featured-galleries/trunk/readme.txt

    r1916640 r1916669  
    55Requires at least: 3.8.0
    66Tested up to: 4.9.7
    7 Stable tag: 2.0.0
     7Stable tag: 2.0.1
    88Requires PHP: 5.4
    99License: GPLv2 or later
     
    169169== Changelog ==
    170170
     171= 2.0.1 =
     172
     173* Bugfix: Don't run plugin logic on old versions of PHP that are incompatible.
     174
    171175= 2.0.0 =
    172176
Note: See TracChangeset for help on using the changeset viewer.