Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit 728816c

Browse files
1 parent 15417b5 commit 728816c

File tree

7 files changed

+94
-50
lines changed

7 files changed

+94
-50
lines changed

composer.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/composer/installed.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,25 +114,25 @@
114114
},
115115
{
116116
"name": "wp-content-framework/admin",
117-
"version": "v0.0.29",
118-
"version_normalized": "0.0.29.0",
117+
"version": "v0.0.30",
118+
"version_normalized": "0.0.30.0",
119119
"source": {
120120
"type": "git",
121121
"url": "https://github.com/wp-content-framework/admin.git",
122-
"reference": "ca74b0c62b352f2e7bb993865eccdf484a6546b4"
122+
"reference": "0c3266b45c4308063b899a0d365986f53e9b3359"
123123
},
124124
"dist": {
125125
"type": "zip",
126-
"url": "https://api.github.com/repos/wp-content-framework/admin/zipball/ca74b0c62b352f2e7bb993865eccdf484a6546b4",
127-
"reference": "ca74b0c62b352f2e7bb993865eccdf484a6546b4",
126+
"url": "https://api.github.com/repos/wp-content-framework/admin/zipball/0c3266b45c4308063b899a0d365986f53e9b3359",
127+
"reference": "0c3266b45c4308063b899a0d365986f53e9b3359",
128128
"shasum": ""
129129
},
130130
"require": {
131131
"php": ">=5.6.0",
132132
"wp-content-framework/controller": "~0.0.1",
133133
"wp-content-framework/view": "~0.0.1"
134134
},
135-
"time": "2019-04-20T17:05:07+00:00",
135+
"time": "2019-04-27T16:25:15+00:00",
136136
"type": "library",
137137
"installation-source": "dist",
138138
"notification-url": "https://packagist.org/downloads/",
@@ -238,17 +238,17 @@
238238
},
239239
{
240240
"name": "wp-content-framework/common",
241-
"version": "v0.0.47",
242-
"version_normalized": "0.0.47.0",
241+
"version": "v0.0.48",
242+
"version_normalized": "0.0.48.0",
243243
"source": {
244244
"type": "git",
245245
"url": "https://github.com/wp-content-framework/common.git",
246-
"reference": "ebb90d1c31b481c3d3fddc120c4116a1ea485c96"
246+
"reference": "d6e0e44fda166c648b37fd36d4e8893cf8ecf778"
247247
},
248248
"dist": {
249249
"type": "zip",
250-
"url": "https://api.github.com/repos/wp-content-framework/common/zipball/ebb90d1c31b481c3d3fddc120c4116a1ea485c96",
251-
"reference": "ebb90d1c31b481c3d3fddc120c4116a1ea485c96",
250+
"url": "https://api.github.com/repos/wp-content-framework/common/zipball/d6e0e44fda166c648b37fd36d4e8893cf8ecf778",
251+
"reference": "d6e0e44fda166c648b37fd36d4e8893cf8ecf778",
252252
"shasum": ""
253253
},
254254
"require": {
@@ -258,7 +258,7 @@
258258
"phake/phake": "~2.0",
259259
"phpunit/phpunit": "~5.7"
260260
},
261-
"time": "2019-04-18T08:20:25+00:00",
261+
"time": "2019-04-25T09:57:06+00:00",
262262
"type": "library",
263263
"installation-source": "dist",
264264
"notification-url": "https://packagist.org/downloads/",

vendor/wp-content-framework/admin/configs/config.php

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* WP_Framework_Admin Configs Config
44
*
5-
* @version 0.0.22
5+
* @version 0.0.30
66
* @author Technote
77
* @copyright Technote All Rights Reserved
88
* @license http://www.opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2
@@ -18,15 +18,6 @@
1818
// main menu title
1919
'main_menu_title' => '',
2020

21-
// contact url
22-
'contact_url' => '',
23-
24-
// twitter
25-
'twitter' => '',
26-
27-
// github
28-
'github' => '',
29-
3021
// menu image url
3122
'menu_image' => '',
3223

@@ -42,12 +33,6 @@
4233
// setting page slug
4334
'setting_page_slug' => 'setting',
4435

45-
// detail url
46-
'detail_url' => '',
47-
48-
// github repo (user/repo)
49-
'github_repo' => '',
50-
5136
// action links
5237
'action_links' => [
5338
[
@@ -65,4 +50,18 @@
6550
// plugin row meta
6651
'plugin_row_meta' => [],
6752

53+
// twitter
54+
'twitter' => '',
55+
56+
// detail url
57+
'detail_url' => '',
58+
59+
// github repo (user/repo)
60+
'github_repo' => '',
61+
62+
// contact url
63+
'contact_url' => '',
64+
65+
// github
66+
'github' => '',
6867
];

vendor/wp-content-framework/admin/src/classes/models/admin.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* WP_Framework_Admin Classes Models Admin
44
*
5-
* @version 0.0.24
5+
* @version 0.0.30
66
* @author Technote
77
* @copyright Technote All Rights Reserved
88
* @license http://www.opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2
@@ -182,13 +182,13 @@ private function admin_notice() {
182182
/**
183183
* @param string[] $actions
184184
* @param string $plugin_file
185-
* @param array $plugin_data
185+
* @param array|null $plugin_data
186186
* @param string $context
187187
*
188188
* @return array
189189
*/
190190
/** @noinspection PhpUnusedPrivateMethodInspection */
191-
private function plugin_action_links( array $actions, $plugin_file, array $plugin_data, $context ) {
191+
private function plugin_action_links( array $actions, $plugin_file, $plugin_data, $context ) {
192192
if ( $this->app->is_theme || $plugin_file !== $this->app->define->plugin_base_name ) {
193193
return $actions;
194194
}
@@ -202,13 +202,13 @@ private function plugin_action_links( array $actions, $plugin_file, array $plugi
202202
/**
203203
* @param string[] $plugin_meta
204204
* @param string $plugin_file
205-
* @param array $plugin_data
205+
* @param array|null $plugin_data
206206
* @param string $status
207207
*
208208
* @return array
209209
*/
210210
/** @noinspection PhpUnusedPrivateMethodInspection */
211-
private function plugin_row_meta( array $plugin_meta, $plugin_file, array $plugin_data, $status ) {
211+
private function plugin_row_meta( array $plugin_meta, $plugin_file, $plugin_data, $status ) {
212212
if ( $this->app->is_theme || $plugin_file !== $this->app->define->plugin_base_name ) {
213213
return $plugin_meta;
214214
}
@@ -221,12 +221,12 @@ private function plugin_row_meta( array $plugin_meta, $plugin_file, array $plugi
221221

222222
/**
223223
* @param array $links
224-
* @param $plugin_data
225-
* @param $status
224+
* @param array|null $plugin_data
225+
* @param string $status
226226
*
227227
* @return array
228228
*/
229-
private function parse_config_links( array $links, array $plugin_data, $status ) {
229+
private function parse_config_links( array $links, $plugin_data, $status ) {
230230
if ( is_array( $links ) && ! empty( $links ) ) {
231231
return array_filter( $this->app->array->map( $links, function ( $setting ) use ( $plugin_data, $status ) {
232232
if ( empty( $setting['url'] ) || ! isset( $setting['label'] ) ) {
Binary file not shown.

vendor/wp-content-framework/common/languages/wp_framework-common-ja.po

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ msgid ""
22
msgstr ""
33
"Project-Id-Version: wp-framework-common\n"
44
"POT-Creation-Date: 2018-07-01 17:47+0900\n"
5-
"PO-Revision-Date: 2019-04-18 16:39+0900\n"
5+
"PO-Revision-Date: 2019-04-25 17:23+0900\n"
66
"Last-Translator: \n"
77
"Language-Team: \n"
88
"MIME-Version: 1.0\n"
@@ -213,3 +213,6 @@ msgstr "はい"
213213

214214
msgid "No"
215215
msgstr "いいえ"
216+
217+
msgid "Deactivate plugin"
218+
msgstr "プラグインを停止"

vendor/wp-content-framework/common/src/classes/models/system.php

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* WP_Framework_Common Classes Models System
44
*
5-
* @version 0.0.41
5+
* @version 0.0.48
66
* @author Technote
77
* @copyright Technote All Rights Reserved
88
* @license http://www.opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2
@@ -53,6 +53,9 @@ protected function initialize() {
5353
$this->not_enough_wordpress_version = empty( $wp_version ) || version_compare( $wp_version, $this->required_wordpress_version, '<' );
5454
if ( ! $this->is_enough_version() ) {
5555
$this->set_unsupported();
56+
if ( $this->app->is_theme ) {
57+
$this->deactivate_theme();
58+
}
5659
} elseif ( ! self::$_setup_initialized_action ) {
5760
self::$_setup_initialized_action = true;
5861
add_action( 'init', function () {
@@ -78,6 +81,16 @@ private function app_initialized() {
7881
}
7982
}
8083

84+
/**
85+
* deactivate theme
86+
*/
87+
private function deactivate_theme() {
88+
add_action( 'init', function () {
89+
switch_theme( WP_DEFAULT_THEME );
90+
unset( $_GET['activated'] );
91+
}, 999 );
92+
}
93+
8194
/**
8295
* setup property
8396
*/
@@ -103,10 +116,19 @@ private function set_unsupported() {
103116
?>
104117
<div class="notice error notice-error">
105118
<?php if ( $this->not_enough_php_version ): ?>
106-
<p><?php echo $this->get_unsupported_php_version_message(); ?></p>
119+
<p>
120+
<?php $this->e( $this->get_unsupported_php_version_message() ); ?>
121+
</p>
107122
<?php endif; ?>
108123
<?php if ( $this->not_enough_wordpress_version ): ?>
109-
<p><?php echo $this->get_unsupported_wp_version_message(); ?></p>
124+
<p>
125+
<?php $this->e( $this->get_unsupported_wp_version_message() ); ?>
126+
</p>
127+
<?php endif; ?>
128+
<?php if ( ! $this->app->is_theme ): ?>
129+
<p>
130+
<?php $this->e( $this->get_deactivate_message() ); ?>
131+
</p>
110132
<?php endif; ?>
111133
</div>
112134
<?php
@@ -137,4 +159,24 @@ private function get_unsupported_wp_version_message() {
137159

138160
return implode( '<br>', $messages );
139161
}
162+
163+
/**
164+
* @return string
165+
*/
166+
private function get_deactivate_message() {
167+
$url = wp_nonce_url( add_query_arg( [
168+
'action' => 'deactivate',
169+
'plugin' => urlencode( $this->app->define->plugin_base_name ),
170+
], 'plugins.php' ), 'deactivate-plugin_' . $this->app->define->plugin_base_name );
171+
$label = $this->translate( 'Deactivate plugin' );
172+
173+
return '<a href="' . esc_url( $url ) . '" aria-label="' . esc_attr( $label ) . '">' . $label . '</a>';
174+
}
175+
176+
/**
177+
* @param string $string
178+
*/
179+
private function e( $string ) {
180+
echo $this->app->string->strip_tags( $string );
181+
}
140182
}

0 commit comments

Comments
 (0)