Skip to content

Commit d3e91b8

Browse files
committed
Implemented wpupdatephp/wp-update-php
1 parent 175590e commit d3e91b8

5 files changed

Lines changed: 16 additions & 11 deletions

File tree

app/Core.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ class Core extends Plugin {
55

66
function __construct() {
77

8-
if(!is_admin() && !$this->is_ajax()) {
9-
10-
// Add page, post type and parent classes to <body> tag for selector targeting
11-
add_filter( 'body_class', array(&$this, 'add_body_classes') );
12-
13-
}
8+
// Add page, post type and parent classes to <body> tag for selector targeting
9+
add_filter( 'body_class', array(&$this, 'add_body_classes') );
1410

1511
// Remove Emoji code from header
1612
if(!$this->is_ajax()) add_filter( 'init', array(&$this, 'disable_wp_emojicons') );

app/Helpers.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ class Helpers extends Plugin {
1616
* @return null
1717
*/
1818
public static function show_notice($msg, $type = 'error', $is_dismissible = false) {
19-
$class = 'notice notice-'.$type.($is_dismissible ? ' is-dismissible' : '');
20-
$msg = __( $msg, self::$settings['data']['TextDomain'] );
2119

22-
printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $msg );
20+
if( is_admin() ) {
21+
22+
$class = 'notice notice-'.$type.($is_dismissible ? ' is-dismissible' : '');
23+
$msg = __( $msg, self::$settings['data']['TextDomain'] );
24+
25+
printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $msg );
26+
27+
}
28+
2329
}
2430

2531
/**

app/Plugin.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public function load_plugin() {
5252
*/
5353
private function verify_dependencies() {
5454

55+
$php_required = new \WPUpdatePhp( self::$settings['deps']['php'] );
56+
$php_required->does_it_meet_required_php_version();
5557
$error = null;
5658

5759
if(!defined('\\Carbon_Fields\\VERSION')) {

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
"autoload": {
5353
"psr-4": {
5454
"Nimbium\\MyPlugin\\": "app/"
55-
}
55+
},
56+
"files": ["vendor/wpupdatephp/wp-update-php/src/WPUpdatePhp.php"]
5657
},
5758
"scripts": {
5859
"pre-autoload-dump": [

wordpress-base-plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
'textdomain' => 'my-plugin',
4343
'object_cache_group' => 'my_plugin_cache',
4444
'object_cache_expire' => 72, // In hours
45-
'deps' => ['carbon_fields' => '2.0.0'],
45+
'deps' => ['php' => '5.3.29', 'carbon_fields' => '2.0.0'],
4646
'prefix' => 'myplugin_' // Change to your own unique field prefix
4747
));
4848
?>

0 commit comments

Comments
 (0)