' );
}
}
if ( 'ok' === \SWELL_Theme::$licence_status ) return;
$licence_check_url = admin_url( 'admin.php?page=swell_settings_swellers' );
$latest_version = \SWELL_Theme::get_swl_latest_version();
$text = sprintf(
__( '%sが完了していません。', 'swell' ),
'' . __( 'SWELLのユーザー認証', 'swell' ) . ''
) . '
' . __( 'そのため、バージョンアップデート機能が制限されてます。', 'swell' );
if ( $latest_version ) {
$text .= '' . sprintf(
__( '(現在の最新バージョンは ver.%s です。)', 'swell' ),
$latest_version
);
}
echo '' .
'
' . wp_kses( $text, \SWELL_Theme::$allowed_text_html ) . '
' .
'
';
} );
/**
* 利用規約の変更時の同意
*/
add_action( 'admin_notices', function() {
// 通知のボタンチェック処理
if ( empty( $_POST )) return;
if ( isset( $_POST['swl_check_new_term'] ) ) {
\SWELL_Theme::set_others_data( 'checked_terms_v2', true );
}
}, 0);
/**
* 利用規約の変更時の同意
*/
add_action( 'admin_notices', function() {
$last_changed = \SWELL_Theme::get_term_changed_date();
$data_key = 'checked_terms_' . $last_changed;
// 通知のボタンチェック処理
if ( ! empty( $_POST ) && isset( $_POST['swl_check_new_term'] ) ) {
\SWELL_Theme::set_others_data( $data_key, true );
}
// \SWELL_Theme::set_others_data( $data_key, '' );
$checked_terms = \SWELL_Theme::get_others_data( $data_key );
if ( $checked_terms ) return;
$text = sprintf(
__( '%sが変更されました。', 'swell' ),
'' . __( 'SWELLの利用規約', 'swell' ) . ''
) . '(' . wp_date( 'Y.m.d', strtotime( $last_changed ) ) . ')';
?>
=wp_kses( $text, \SWELL_Theme::$allowed_text_html )?>
' . __( 'SWELLアップデート情報', 'swell' ),
__NAMESPACE__ . '\dashboard_update_info',
null,
null,
'normal',
'high'
);
if ( current_user_can( 'manage_options' ) ) {
wp_add_dashboard_widget(
'swell-site-status',
'' . __( 'サイト情報', 'swell' ),
__NAMESPACE__ . '\dashboard_site_status',
null,
null,
'normal',
'high'
);
}
} );
function dashboard_update_info() {
$update_posts = get_transient( 'swell-upate-posts' );
// キャッシュなければ
if ( ! $update_posts ) {
$update_posts = \SWELL_Theme::remote_get( 'https://swell-theme.com/wp-json/wp/v2/posts?categories=2&per_page=5' );
set_transient( 'swell-upate-posts', $update_posts, 4 * HOUR_IN_SECONDS );
}
if ( empty( $update_posts ) ) return;
?>
' . esc_html__( 'バージョン情報', 'swell' ) . '';
echo 'WordPress: ' . esc_html( get_bloginfo( 'version' ) ) . '
';
echo 'SWELL: ' . esc_html( \SWELL_Theme::$swell_version ) . '
';
echo 'PHP: ' . esc_html( phpversion() ) . '
';
echo '
';
echo '' . esc_html__( '有効化中のプラグイン一覧', 'swell' ) . '
';
if ( empty( \SWELL_Theme::$active_plugins ) ) {
echo esc_html__( '有効なプラグインはありません。', 'swell' );
} else {
$all = '';
foreach ( \SWELL_Theme::$active_plugins as $path => $plugin ) {
$all .= '' . $plugin['name'] . ' (v.' . $plugin['ver'] . ')
';
}
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $all;
}
}