Plugin Directory

Changeset 2027312


Ignore:
Timestamp:
02/08/2019 02:32:45 PM (7 years ago)
Author:
orballo
Message:

1.13.4: fixes code to work with PHP 5.3 and prevents activation if PHP version is lower.

Location:
wp-pwa
Files:
517 added
4 edited

Legend:

Unmodified
Added
Removed
  • wp-pwa/trunk/CHANGELOG.md

    r2027256 r2027312  
     1## [1.13.5](https://github.com/frontity/wp-plugin/compare/v1.13.4...v1.13.5) (2019-02-08)
     2
     3
     4### Bug Fixes
     5
     6* **versions:** fixes error messages on low php and wp versions ([752f5b6](https://github.com/frontity/wp-plugin/commit/752f5b6))
     7
    18## [1.13.4](https://github.com/frontity/wp-plugin/compare/v1.13.3...v1.13.4) (2019-02-08)
    29
  • wp-pwa/trunk/package-lock.json

    r2027256 r2027312  
    11{
    22  "name": "frontity-wp-plugin",
    3   "version": "1.13.4",
     3  "version": "1.13.5",
    44  "lockfileVersion": 1,
    55  "requires": true,
  • wp-pwa/trunk/package.json

    r2027256 r2027312  
    11{
    22  "name": "frontity-wp-plugin",
    3   "version": "1.13.4",
     3  "version": "1.13.5",
    44  "private": true,
    55  "description": "WordPress plugin to inject and configure » Frontity",
  • wp-pwa/trunk/wp-pwa.php

    r2027256 r2027312  
    44Plugin URI: https://wordpress.org/plugins/wp-pwa/
    55Description: WordPress plugin to turn WordPress blogs into Progressive Web Apps.
    6 Version: 1.13.4
     6Version: 1.13.5
    77Author: Frontity
    88Author URI: https://frontity.com/?utm_source=plugin-repository&utm_medium=link&utm_campaign=plugin-description
     
    2121
    2222// Define Frontity constants.
    23 define('FRONTITY_VERSION', '1.13.4');
     23define('FRONTITY_VERSION', '1.13.5');
    2424define('FRONTITY_PATH', plugin_dir_path(__FILE__));
    2525define('FRONTITY_URL', plugin_dir_url(__FILE__));
    2626
    27 // Checks if the current PHP version is supported.
    28 function frontity_php_version_supported()
    29 {
    30     $version_is_supported = version_compare(PHP_VERSION, '5.3', '>=');
    31 
    32     if (!$version_is_supported) {
    33         add_action('admin_notices', 'php_version_not_supported');
    34 
    35         function php_version_not_supported()
    36         {
    37             $class = 'notice notice-error';
    38             $message = 'Oops! You need PHP v5.3 or greater for Frontity to work.';
    39 
    40             printf('<div class="notice notice-error"><p>%1$s</p></div>', esc_html($message));
    41         }
    42     }
    43 
    44     return $version_is_supported;
    45 }
    46 
    47 // Checks if the current WP version is supported.
    48 function frontity_wp_version_supported()
    49 {
    50     $version = $GLOBALS['wp_version'];
    51     $version_is_supported = version_compare($version, '4.7', '>=');
    52 
    53     if (!$version_is_supported) {
    54         add_action('admin_notices', 'php_version_not_supported');
    55 
    56         function php_version_not_supported()
    57         {
    58             $class = 'notice notice-error';
    59             $message = 'Oops! You need WordPress v4.7 or greater for Frontity to work.';
    60 
    61             printf('<div class="notice notice-error"><p>%1$s</p></div>', esc_html($message));
    62         }
    63     }
    64 
    65     return $version_is_supported;
     27if (!class_exists('Frontity_Compatibility')) {
     28    require_once FRONTITY_PATH . 'includes/class-frontity-compatibility.php';
    6629}
    6730
     
    6932function frontity()
    7033{
    71     if (!frontity_php_version_supported() || !frontity_wp_version_supported()) return;
     34    $frontity_compatibility = new Frontity_Compatibility();
     35    if ($frontity_compatibility->should_stop()) return;
    7236
    7337    // This global should be removed in favor of the constant FRONTITY_PATH.
     
    8650function frontity_activation()
    8751{
    88     if (!frontity_php_version_supported() || !frontity_wp_version_supported()) return;
     52    $frontity_compatibility = new Frontity_Compatibility();
     53    if ($frontity_compatibility->should_stop()) return;
    8954
    9055    if (!class_exists('Frontity_Settings')) {
Note: See TracChangeset for help on using the changeset viewer.