Plugin Directory

Changeset 1867697


Ignore:
Timestamp:
05/02/2018 05:39:08 PM (8 years ago)
Author:
matstars
Message:

updated to 0.0.16

Location:
cryptocurrency
Files:
680 added
2 edited

Legend:

Unmodified
Added
Removed
  • cryptocurrency/trunk/cryptocurrency.php

    r1865594 r1867697  
    55Plugin URI: https://statenweb/cryptocurrency
    66Author: Mat Gargano
    7 Version: 0.0.15
     7Version: 0.0.16
    88Author URI: https://statenweb.com/
    99Text Domain:       cryptocurrency
     
    1414use Cryptocurrency\Settings\Global_Settings;
    1515use Cryptocurrency\Shortcodes\Table;
     16use Cryptocurrency\Version_Check;
    1617
    1718function cry_fs() {
     
    4748do_action( 'cry_fs_loaded' );
    4849
    49 require __DIR__ . '/vendor/autoload.php';
    5050
    51 $namespace = 'Cryptocurrency';
    52 spl_autoload_register( function ( $class ) use ( $namespace ) {
    53     $base = explode( '\\', $class );
    54     if ( $namespace === $base[0] ) {
    55         $file = __DIR__ . DIRECTORY_SEPARATOR . strtolower( str_replace( [ '\\' ], [ DIRECTORY_SEPARATOR, ],
    56                     $class ) . '.php' );
    57         if ( file_exists( $file ) ) {
    58             require $file;
    59         } else {
    60             wp_die( sprintf( 'File %s not found', esc_html( $file ) ) );
    61         }
    62     }
     51function cryptocurrency_version_notice() {
    6352
    64 } );
    6553
    66 add_action( 'plugins_loaded', 'cryptocurrency_load_plugin_textdomain' );
    6754
    68 $global_settings = new Global_Settings();
    69 $global_settings->init();
     55    $class   = 'notice notice-error';
     56    $message = __( sprintf( 'Cryptocurrency Portfolio Tracker plugin requires PHP version 5.5 or newer, you currently are using %s',
     57        phpversion() ), 'cryptocurrency' );
    7058
    71 $table_shortcode = new Table();
    72 $table_shortcode->init();
    73 
    74 $actions = new Actions();
    75 $actions->init();
    76 
    77 function cryptocurrency_table( $output = true ) {
    78 
    79     return \Cryptocurrency\Output\Table::generate( $output );
     59    printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) );
    8060
    8161}
    8262
    83 function cryptocurrency_load_plugin_textdomain() {
    84     load_plugin_textdomain( 'cryptocurrency', false, basename( dirname( __FILE__ ) ) . '/languages/' );
     63
     64if ( (int)version_compare( phpversion(), '5.5' ) <= 0 ){
     65
     66    add_action( 'admin_notices', 'cryptocurrency_version_notice' );
     67
     68
     69} else {
     70
     71    require __DIR__ . '/vendor/autoload.php';
     72
     73    $namespace = 'Cryptocurrency';
     74    spl_autoload_register( function ( $class ) use ( $namespace ) {
     75        $base = explode( '\\', $class );
     76        if ( $namespace === $base[0] ) {
     77            $file = __DIR__ . DIRECTORY_SEPARATOR . strtolower( str_replace( [ '\\' ], [ DIRECTORY_SEPARATOR, ],
     78                        $class ) . '.php' );
     79            if ( file_exists( $file ) ) {
     80                require $file;
     81            } else {
     82                wp_die( sprintf( 'File %s not found', esc_html( $file ) ) );
     83            }
     84        }
     85
     86    } );
     87
     88    add_action( 'plugins_loaded', 'cryptocurrency_load_plugin_textdomain' );
     89
     90    $global_settings = new Global_Settings();
     91    $global_settings->init();
     92
     93    $table_shortcode = new Table();
     94    $table_shortcode->init();
     95
     96    $actions = new Actions();
     97    $actions->init();
     98
     99    function cryptocurrency_table( $output = true ) {
     100
     101        return \Cryptocurrency\Output\Table::generate( $output );
     102
     103    }
     104
     105    function cryptocurrency_load_plugin_textdomain() {
     106        load_plugin_textdomain( 'cryptocurrency', false, basename( dirname( __FILE__ ) ) . '/languages/' );
     107    }
     108
    85109}
    86 
  • cryptocurrency/trunk/readme.txt

    r1865594 r1867697  
    55Requires at least: 4.0
    66Tested up to: 4.9.5
    7 Stable tag: 0.0.15
     7Stable tag: 0.0.16
     8Requires PHP: 5.5
    89License: GPLv2 or later
    910License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    6263#### Release Notes
    6364
     65
     66
     67- 0.0.16
     68add in a version checker, the plugin requires PHP 5.5 or greater
    6469
    6570- 0.0.15
Note: See TracChangeset for help on using the changeset viewer.