vk-all-in-one-expansion-unit
Last commit date
admin
5 years ago
assets
5 years ago
bin
5 years ago
inc
5 years ago
languages
5 years ago
tests
5 years ago
.node-version
5 years ago
.phpcs.xml.dist
5 years ago
.svnignore
5 years ago
.wp-env.json
5 years ago
Dockerfile
6 years ago
LICENSE
6 years ago
composer.json
5 years ago
composer.lock
5 years ago
docker-compose.yml
6 years ago
gulpfile.js
5 years ago
initialize.php
5 years ago
package-lock.json
5 years ago
package.json
5 years ago
phpunit.xml
6 years ago
phpunit.xml.dist
5 years ago
readme.txt
5 years ago
screenshot-1.png
6 years ago
screenshot-2.png
6 years ago
uninstaller.php
5 years ago
veu-package-manager.php
6 years ago
veu-packages.php
5 years ago
vkExUnit.php
5 years ago
vkExUnit.php
124 lines
| 1 | <?php |
| 2 | /* |
| 3 | * Plugin Name: VK All in One Expansion Unit |
| 4 | * Plugin URI: https://ex-unit.nagoya |
| 5 | * Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more! |
| 6 | * Version: 9.44.1.0 |
| 7 | * Author: Vektor,Inc. |
| 8 | * Text Domain: vk-all-in-one-expansion-unit |
| 9 | * Domain Path: /languages |
| 10 | * Author URI: https://vektor-inc.co.jp |
| 11 | * GitHub Plugin URI: vektor-inc/VK-All-in-One-Expansion-Unit |
| 12 | * GitHub Plugin URI: https://github.com/vektor-inc/VK-All-in-One-Expansion-Unit |
| 13 | * License: GPL2 |
| 14 | */ |
| 15 | |
| 16 | /* |
| 17 | Copyright 2015-2020 Vektor,Inc. ( email : kurudrive@gmail.com ) |
| 18 | |
| 19 | This program is free software; you can redistribute it and/or modify |
| 20 | it under the terms of the GNU General Public License, version 2, as |
| 21 | published by the Free Software Foundation. |
| 22 | |
| 23 | This program is distributed in the hope that it will be useful, |
| 24 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 25 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 26 | GNU General Public License for more details. |
| 27 | |
| 28 | You should have received a copy of the GNU General Public License |
| 29 | along with this program; if not, write to the Free Software |
| 30 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 31 | */ |
| 32 | |
| 33 | define( 'VEU_FONT_AWESOME_DEFAULT_VERSION', 4.7 ); |
| 34 | define( 'VEU_DIRECTORY_PATH', dirname( __FILE__ ) ); |
| 35 | |
| 36 | // Get Plugin version |
| 37 | $data = get_file_data( __FILE__, array( 'version' => 'Version' ) ); |
| 38 | global $vkExUnit_version; |
| 39 | $vkExUnit_version = $data['version']; |
| 40 | |
| 41 | function veu_get_directory( $path = '' ) { |
| 42 | return $dirctory = dirname( __FILE__ ) . $path; |
| 43 | } |
| 44 | function veu_get_directory_uri( $path = '' ) { |
| 45 | return plugins_url( $path, __FILE__ ); |
| 46 | } |
| 47 | |
| 48 | // PHP Version check |
| 49 | if ( version_compare( phpversion(), '5.4.45' ) >= 0 ) { |
| 50 | require_once veu_get_directory() . '/initialize.php'; |
| 51 | |
| 52 | if ( version_compare( phpversion(), '5.6' ) < 0 && is_admin() ) { |
| 53 | add_filter( 'admin_notices', 'veu_phpversion_warning_notice' ); |
| 54 | } |
| 55 | } else { |
| 56 | add_filter( 'admin_notices', 'veu_phpversion_error' ); |
| 57 | } |
| 58 | |
| 59 | if ( function_exists( 'register_deactivation_hook' ) ) { |
| 60 | register_deactivation_hook( __FILE__, 'veu_uninstall_function' ); |
| 61 | } |
| 62 | |
| 63 | function veu_uninstall_function() { |
| 64 | require_once veu_get_directory() . '/initialize.php'; |
| 65 | include veu_get_directory( '/uninstaller.php' ); |
| 66 | } |
| 67 | |
| 68 | function veu_phpversion_error( $val ) { |
| 69 | if ( ! current_user_can( 'activate_plugins' ) ) { |
| 70 | return $val; |
| 71 | } |
| 72 | ?> |
| 73 | <div class="notice notice-error error is-dismissible"><p> |
| 74 | <?php |
| 75 | /* |
| 76 | 本来システム名は vkExUnit_get_little_short_name() で引っ張るが、PHPのバージョンが低くて vkExUnit_get_little_short_name() 関数が読み込まれていないので"VK ExUnit"直書き |
| 77 | */ |
| 78 | printf( |
| 79 | __( 'The current PHP version(%s) is too old, so VK ExUnit will not work.', 'vk-all-in-one-expansion-unit' ), |
| 80 | phpversion() |
| 81 | ); |
| 82 | ?> |
| 83 | <?php _e( 'VK ExUnit supports PHP5.6 or later.', 'vk-all-in-one-expansion-unit' ); ?> |
| 84 | </p></div> |
| 85 | <?php |
| 86 | return $val; |
| 87 | } |
| 88 | |
| 89 | function veu_phpversion_warning_notice( $val ) { |
| 90 | if ( ! current_user_can( 'activate_plugins' ) ) { |
| 91 | return $val; |
| 92 | } |
| 93 | global $hook_suffix; |
| 94 | if ( strpos( $hook_suffix, 'vk-all-in-one-expansion-unit' ) == false ) { |
| 95 | return; |
| 96 | } |
| 97 | ?> |
| 98 | <div class="notice notice-warning is-dismissible"><p> |
| 99 | <?php printf( __( 'Current PHP Version(%s) is old.', 'vk-all-in-one-expansion-unit' ), phpversion() ); ?> |
| 100 | <?php printf( __( '%s supports PHP5.6 or later.', 'vk-all-in-one-expansion-unit' ), veu_get_little_short_name() ); ?> |
| 101 | </p></div> |
| 102 | <?php |
| 103 | return $val; |
| 104 | } |
| 105 | |
| 106 | // add_filter('vk-admin-is-dashboard-active','vk_dashboard_hidden'); |
| 107 | // function vk_dashboard_hidden(){ |
| 108 | // return false; |
| 109 | // } |
| 110 | // remove_action( 'wp_dashboard_setup',array( 'Vk_Admin', 'dashboard_widget'),1 ); |
| 111 | // |
| 112 | |
| 113 | /** |
| 114 | * Modify the height of a specific CSS class to fix an issue in Chrome 77 with Gutenberg. |
| 115 | * |
| 116 | * @see https://github.com/WordPress/gutenberg/issues/17406 |
| 117 | */ |
| 118 | add_action( |
| 119 | 'admin_head', |
| 120 | function() { |
| 121 | echo '<style>.block-editor-writing-flow { height: auto; }</style>'; // phpcs:ignore |
| 122 | } |
| 123 | ); |
| 124 |