First commit

This commit is contained in:
Pierre Hubert
2016-11-19 12:08:12 +01:00
commit 990540b2b9
4706 changed files with 931207 additions and 0 deletions

View File

@ -0,0 +1,87 @@
# v1.4.4
## 09/08/2016
1. [](#new)
* Added check for new root folder `tmp` and try to create if missing
1. [](#bugfix)
* Fixed Whoops error if `backup` folder doesn't exist and cannot be created
# v1.4.3
## 05/27/2016
1. [](#new)
* Reverted compression checks
# v1.4.2
## 05/23/2016
1. [](#new)
* Check for compression issues
# v1.4.1
## 05/03/2016
1. [](#new)
* Added a check for XML support in PHP
1. [](#improved)
* Use common language strings in blueprints
# v1.4.0
## 01/06/2016
1. [](#improved)
* Avoid generating errors on .DS_Store files added to the bin/ folder by OSX
* Removed executable checks for bin/* commands. Going to document instead.
# v1.3.3
## 12/09/2015
1. [](#new)
* Set minimum PHP requirements to 5.5.9
1. [](#improved)
* Ensure problems plugin runs before admin
# v1.3.2
## 12/09/2015
1. [](#improved)
* Skip windows platforms for executable permissions check
* Removed mod_headers from required Apache modules check
# v1.3.1
## 12/07/2015
1. [](#improved)
* Added executable check on `/bin/` files
# v1.3.0
## 12/07/2015
1. [](#improved)
* Added check for PHP `OpenSSL`, `Mbstring` and `Curl` are installed
* Added check to ensure `mod_rewrite` and `mod_headers` are installed if running Apache
# v1.2.0
## 08/25/2015
1. [](#improved)
* Added blueprints for Grav Admin plugin
# v1.1.6
## 06/16/2015
2. [](#new)
* Try to create missing `backup` folder if it is missing
# v1.1.5
## 05/09/2015
2. [](#new)
* Added check for `backup` folder for Grav > 0.9.27
# v1.1.4
## 04/26/2015
2. [](#new)
* Changelog started

View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Grav
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,89 @@
# Grav Problems Plugin
![Problems](assets/readme_1.png)
`Problems` is a [Grav](http://github.com/getgrav/grav) Plugin and allows to detect issues.
This plugin is included in any package distributed that contains Grav. If you decide to clone Grav from GitHub, you will most likely want to install this.
# Installation
Installing the Problems plugin can be done in one of two ways. Our GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file.
## GPM Installation (Preferred)
The simplest way to install this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm) through your system's Terminal (also called the command line). From the root of your Grav install type:
bin/gpm install problems
This will install the Problems plugin into your `/user/plugins` directory within Grav. Its files can be found under `/your/site/grav/user/plugins/problems`.
## Manual Installation
To install this plugin, just download the zip version of this repository and unzip it under `/your/site/grav/user/plugins`. Then, rename the folder to `problems`. You can find these files either on [GitHub](https://github.com/getgrav/grav-plugin-problems) or via [GetGrav.org](http://getgrav.org/downloads/plugins#extras).
You should now have all the plugin files under
/your/site/grav/user/plugins/problems
>> NOTE: This plugin is a modular component for Grav which requires [Grav](http://github.com/getgrav/grav), the [Error](https://github.com/getgrav/grav-plugin-error) and [Problems](https://github.com/getgrav/grav-plugin-problems) plugins, and a theme to be installed in order to operate.
# Usage
`Problems` runs in the background and most of the time you will not know it is there. Although as soon as an issue is caught, the plugin will let you know.
`Problems` checks for the following common issues:
| Check | Description |
| :---------------------------------- | :-------------------------------------------------------------------------------------------------------- |
| Apache `mod_rewrite` | Checks to ensure `mod_rewrite` is enabled if you are running an Apache server. |
| PHP Version | Checks to make sure the PHP version being run by the server meets or exceeds Grav's minimum requirements. |
| PHP GD (Image Manipulation Library) | Checks to make sure that PHP GD is installed. |
| PHP Curl (Data Transfer Library) | Checks to make sure that PHP Curl is installed. |
| PHP OpenSSL (Secure Sockets Library) | Checks to make sure that PHP OpenSSL is installed. |
| PHP Mbstring (Multibyte String Library) | Checks to make sure that PHP Mbstring is installed. |
| .htaccess | Checks to make sure that there is an `.htaccess` file in Grav's root directory. |
| `bin/*` executable | Checks that all the files in the `bin/` folder are exectuable. |
| Cache | Checks the `/cache` folder's existence and verifies that it is writeable. |
| Logs | Checks the `/logs` folder's existence and verifies that it is writeable. |
| Images | Checks the `/images` folder's existence and verifies that it is writeable. |
| Assets | Checks the `/assets` folder's existence and verifies that it is writeable. |
| System | Checks the `/system` folder's existence. |
| Data | Checks the `/user/data` folder's existence and verifies that it is writeable. |
| Pages | Checks the `/user/images` folder's existence. |
| Config | Checks the `/user/config` folder's existence. |
| Error | Checks to make sure the **Error** plugin is installed in `/user/plugins/error`. |
| Plugins | Checks the `/user/plugins` folder's existence. |
| Themes | Checks the `/user/themes` folder's existence. |
| Vendor | Checks the `/vendor` folder's existence. |
If an issue is discovered, you will be greeted with a page that lists these checks and whether or not your install passed or failed them. Green checks mean it passed, and a red x indicates that the there is something amiss with the item.
Problems uses the cache as refresh indicator. That means that if nothing has changed anywhere, the plugin will just skip its validation tests altogether.
If a change is caught and the cache is refreshed, the plugin will loop through its validation tests and making sure nothing is out of place.
`Problems` gets also triggered if any fatal exception is caught.
# Updating
As development for the Problems plugin continues, new versions may become available that add additional features and functionality, improve compatibility with newer Grav releases, and generally provide a better user experience. Updating Problems is easy, and can be done through Grav's GPM system, as well as manually.
## GPM Update (Preferred)
The simplest way to update this plugin is via the [Grav Package Manager (GPM)](http://learn.getgrav.org/advanced/grav-gpm). You can do this with this by navigating to the root directory of your Grav install using your system's Terminal (also called command line) and typing the following:
bin/gpm update problems
This command will check your Grav install to see if your Problems plugin is due for an update. If a newer release is found, you will be asked whether or not you wish to update. To continue, type `y` and hit enter. The plugin will automatically update and clear Grav's cache.
## Manual Update
Manually updating Problems is pretty simple. Here is what you will need to do to get this done:
* Delete the `your/site/user/plugins/problems` directory.
* Download the new version of the Problems plugin from either [GitHub](https://github.com/getgrav/grav-plugin-problems) or [GetGrav.org](http://getgrav.org/downloads/plugins#extras).
* Unzip the zip file in `your/site/user/plugins` and rename the resulting folder to `problems`.
* Clear the Grav cache. The simplest way to do this is by going to the root Grav directory in terminal and typing `bin/grav clear-cache`.
> Note: Any changes you have made to any of the files listed under this directory will also be removed and replaced by the new set. Any files located elsewhere (for example a YAML settings file placed in `user/config/plugins`) will remain intact.

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@ -0,0 +1,37 @@
name: Problems
version: 1.4.4
description: Detects and reports problems found in the site.
icon: exclamation-circle
author:
name: Team Grav
email: devs@getgrav.org
url: http://getgrav.org
homepage: https://github.com/getgrav/grav-plugin-problems
keywords: problems, plugin, detector, assistant, required
bugs: https://github.com/getgrav/grav-plugin-problems/issues
license: MIT
form:
validation: strict
fields:
enabled:
type: toggle
label: PLUGIN_ADMIN.PLUGIN_STATUS
highlight: 1
default: 0
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
built_in_css:
type: toggle
label: Use built in CSS
highlight: 1
default: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool

View File

@ -0,0 +1,71 @@
section#body {
padding-top: 3rem;
}
ul.problems {
list-style: none;
padding: 0;
margin-top: 3rem;
}
ul.problems li {
margin-bottom: 1rem;
padding: 1rem;
}
ul.problems li.success {
background: #F1F9F1;
border-left: 5px solid #5CB85C;
color: #3d8b3d;
}
ul.problems li.error {
background: #FDF7F7;
border-left: 5px solid #D9534F;
color: #b52b27;
}
ul.problems li.info {
background: #F4F8FA;
border-left: 5px solid #5bc0de;
color: #28a1c5;
}
ul.problems .fa {
font-size: 3rem;
vertical-align: middle;
margin-left: 1rem;
display: block;
float: left;
}
ul.problems p {
display: block;
margin: 0.5rem 0.5rem 0.5rem 5rem;
}
.button.big {
font-size: 1.2rem;
}
.center {
text-align: center;
}
.underline {
text-decoration: underline;
}
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
.clearfix { display: inline-block; }
/* start commented backslash hack \*/
* html .clearfix { height: 1%; }
.clearfix { display: block; }
/* close commented backslash hack */

View File

@ -0,0 +1,762 @@
@import url(//fonts.googleapis.com/css?family=Montserrat:400|Raleway:300,400,600|Inconsolata);
#header #logo h3, #header #navbar ul, #header #navbar .panel-activation, #footer p {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-o-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%); }
.button, .button-secondary {
display: inline-block;
padding: 7px 20px; }
html, body {
height: 100%; }
body {
background: white;
color: #444444;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; }
a {
color: #1bb3e9; }
a:hover {
color: #0e6e90; }
b, strong, label, th {
font-weight: 600; }
#container {
min-height: 100%;
position: relative; }
.fullwidth #body {
padding-left: 0;
padding-right: 0; }
#body {
padding-top: 8rem;
padding-bottom: 11rem; }
.default-animation, #body, #header, #header #logo h3, .modular .showcase .button {
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
transition: all 0.5s ease; }
.padding-horiz, .fullwidth #header, .fullwidth #breadcrumbs, .fullwidth .blog-header, .fullwidth .blog-content-item, .fullwidth .blog-content-list, .fullwidth ul.pagination, .fullwidth #body > .modular-row, #body, #header, #footer {
padding-left: 7rem;
padding-right: 7rem; }
@media only all and (max-width: 59.938rem) {
.padding-horiz, .fullwidth #header, .fullwidth #breadcrumbs, .fullwidth .blog-header, .fullwidth .blog-content-item, .fullwidth .blog-content-list, .fullwidth ul.pagination, .fullwidth #body > .modular-row, #body, #header, #footer {
padding-left: 4rem;
padding-right: 4rem; } }
@media only all and (max-width: 47.938rem) {
.padding-horiz, .fullwidth #header, .fullwidth #breadcrumbs, .fullwidth .blog-header, .fullwidth .blog-content-item, .fullwidth .blog-content-list, .fullwidth ul.pagination, .fullwidth #body > .modular-row, #body, #header, #footer {
padding-left: 1rem;
padding-right: 1rem; } }
.padding-vert {
padding-top: 3rem;
padding-bottom: 3rem; }
#header {
position: fixed;
z-index: 10;
width: 100%;
height: 5rem;
background-color: rgba(255, 255, 255, 0.9);
box-shadow: 0 0.05rem 1rem rgba(0, 0, 0, 0.15); }
#header.scrolled {
height: 3rem;
background-color: rgba(255, 255, 255, 0.9) !important;
box-shadow: 0 0.05rem 1rem rgba(0, 0, 0, 0.15) !important; }
#header.scrolled #logo h3 {
color: #444444 !important;
font-size: 1.6rem !important; }
#header.scrolled #logo a {
color: #444444 !important; }
#header.scrolled #navbar a {
color: #1bb3e9 !important; }
#header.scrolled #navbar a:before, #header.scrolled #navbar a:after {
background-color: #1bb3e9 !important; }
#header > .grid, #header #logo, #header #navbar {
height: 100%; }
#header #logo {
float: left; }
#header #logo h3 {
font-size: 2rem;
line-height: 2rem;
margin: 0;
text-transform: uppercase; }
#header #logo h3 a {
color: #444444; }
#header #navbar {
font-size: 0.9rem; }
#header #navbar ul {
display: inline-block;
margin: 0;
list-style: none;
float: right; }
#header #navbar ul li {
float: left;
position: relative; }
#header #navbar ul li a {
font-family: "Montserrat", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;
display: inline-block;
padding: 0.1rem 0.8rem; }
#header #navbar ul li a:before, #header #navbar ul li a:after {
content: "";
position: absolute;
width: 100%;
height: 1px;
bottom: 0;
left: 0;
background-color: #1bb3e9;
visibility: hidden;
-webkit-transform: scaleX(0);
-moz-transform: scaleX(0);
-ms-transform: scaleX(0);
-o-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
transition: all 0.2s ease; }
#header #navbar ul li a:hover:before {
visibility: visible;
-webkit-transform: scaleX(0.75);
-moz-transform: scaleX(0.75);
-ms-transform: scaleX(0.75);
-o-transform: scaleX(0.75);
transform: scaleX(0.75); }
#header #navbar ul li.active a:after {
top: 0;
visibility: visible;
-webkit-transform: scaleX(0.75);
-moz-transform: scaleX(0.75);
-ms-transform: scaleX(0.75);
-o-transform: scaleX(0.75);
transform: scaleX(0.75); }
@media only all and (max-width: 59.938rem) {
#header #navbar ul {
display: none; } }
#header #navbar .panel-activation {
display: none;
font-size: 2rem;
cursor: pointer;
float: right; }
@media only all and (max-width: 59.938rem) {
#header #navbar .panel-activation {
display: inline-block; } }
.header-image.fullwidth #body {
padding-left: 0;
padding-right: 0; }
.header-image.fullwidth #body > .listing-row {
padding-left: 7rem;
padding-right: 7rem; }
.header-image .listing-row:last-child {
margin-bottom: 2rem; }
.header-image #body > .blog-header {
margin-top: -9.5rem;
padding-top: 9rem; }
.header-image #breadcrumbs {
margin-top: 1rem; }
.header-image #header {
background-color: rgba(255, 255, 255, 0);
box-shadow: none; }
.header-image #header #logo h3, .header-image #header #logo a {
color: white; }
.header-image #header a, .header-image #header .menu-btn {
color: white; }
.header-image #header a:before, .header-image #header a:after {
background-color: rgba(255, 255, 255, 0.7) !important; }
#footer {
position: absolute;
background: #333;
height: 6rem;
right: 0;
bottom: 0;
left: 0;
color: #999;
text-align: center; }
#footer a:hover {
color: #fff; }
#footer .totop {
position: absolute;
bottom: 5rem;
text-align: center;
left: 0;
right: 0; }
#footer .totop span {
font-size: 1.7rem;
line-height: 2.5rem;
background: #333;
width: 3rem;
height: 2rem;
border-radius: 3px;
display: inline-block;
text-align: top; }
#footer p {
margin: 0; }
#footer p .fa {
color: #fff; }
body {
font-family: "Raleway", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;
font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
font-family: "Montserrat", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;
font-weight: 400;
text-rendering: optimizeLegibility;
letter-spacing: -0px; }
h1 {
font-size: 3.2rem; }
@media only all and (max-width: 47.938rem) {
h1 {
font-size: 2.5rem;
line-height: 1.2;
margin-bottom: 2.5rem; } }
@media only all and (min-width: 48rem) and (max-width: 59.938rem) {
h2 {
font-size: 2.1rem; } }
@media only all and (max-width: 47.938rem) {
h2 {
font-size: 2rem; } }
@media only all and (min-width: 48rem) and (max-width: 59.938rem) {
h3 {
font-size: 1.7rem; } }
@media only all and (max-width: 47.938rem) {
h3 {
font-size: 1.6rem; } }
@media only all and (min-width: 48rem) and (max-width: 59.938rem) {
h4 {
font-size: 1.35rem; } }
@media only all and (max-width: 47.938rem) {
h4 {
font-size: 1.25rem; } }
h1 {
text-align: center;
letter-spacing: -3px; }
h2 {
letter-spacing: -2px; }
h3 {
letter-spacing: -1px; }
h1 + h2 {
margin: -2rem 0 2rem 0;
font-size: 2rem;
line-height: 1;
text-align: center;
font-family: "Raleway", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;
font-weight: 300; }
@media only all and (min-width: 48rem) and (max-width: 59.938rem) {
h1 + h2 {
font-size: 1.6rem; } }
@media only all and (max-width: 47.938rem) {
h1 + h2 {
font-size: 1.5rem; } }
h2 + h3 {
margin: 0.5rem 0 2rem 0;
font-size: 2rem;
line-height: 1;
text-align: center;
font-family: "Raleway", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;
font-weight: 300; }
@media only all and (min-width: 48rem) and (max-width: 59.938rem) {
h2 + h3 {
font-size: 1.6rem; } }
@media only all and (max-width: 47.938rem) {
h2 + h3 {
font-size: 1.5rem; } }
blockquote {
border-left: 10px solid #f0f2f4; }
blockquote p {
font-size: 1.1rem;
color: #999; }
blockquote cite {
display: block;
text-align: right;
color: #666;
font-size: 1.2rem; }
blockquote > blockquote > blockquote {
margin: 0; }
blockquote > blockquote > blockquote p {
padding: 15px;
display: block;
font-size: 1rem;
margin-top: 0rem;
margin-bottom: 0rem; }
blockquote > blockquote > blockquote > p {
margin-left: -71px;
border-left: 10px solid #F0AD4E;
background: #FCF8F2;
color: #df8a13; }
blockquote > blockquote > blockquote > blockquote > p {
margin-left: -94px;
border-left: 10px solid #D9534F;
background: #FDF7F7;
color: #b52b27; }
blockquote > blockquote > blockquote > blockquote > blockquote > p {
margin-left: -118px;
border-left: 10px solid #5BC0DE;
background: #F4F8FA;
color: #28a1c5; }
blockquote > blockquote > blockquote > blockquote > blockquote > blockquote > p {
margin-left: -142px;
border-left: 10px solid #5CB85C;
background: #F1F9F1;
color: #3d8b3d; }
code,
kbd,
pre,
samp {
font-family: "Inconsolata", monospace; }
code {
background: #f9f2f4;
color: #9c1d3d; }
pre {
padding: 2rem;
background: #f6f6f6;
border: 1px solid #dddddd;
border-radius: 3px; }
pre code {
color: #237794;
background: inherit; }
hr {
border-bottom: 4px solid #f0f2f4; }
.page-title {
margin-top: -25px;
padding: 25px;
float: left;
clear: both;
background: #1bb3e9;
color: white; }
fieldset {
border: 1px solid #dddddd; }
textarea, input[type="email"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="url"], input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="month"], input[type="time"], input[type="week"], select[multiple=multiple] {
background-color: white;
border: 1px solid #dddddd;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06); }
textarea:hover, input[type="email"]:hover, input[type="number"]:hover, input[type="password"]:hover, input[type="search"]:hover, input[type="tel"]:hover, input[type="text"]:hover, input[type="url"]:hover, input[type="color"]:hover, input[type="date"]:hover, input[type="datetime"]:hover, input[type="datetime-local"]:hover, input[type="month"]:hover, input[type="time"]:hover, input[type="week"]:hover, select[multiple=multiple]:hover {
border-color: #c4c4c4; }
textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="url"]:focus, input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="time"]:focus, input[type="week"]:focus, select[multiple=multiple]:focus {
border-color: #1bb3e9;
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 5px rgba(21, 163, 214, 0.7); }
.form-field .required {
color: #F3443F;
font-size: 3rem;
line-height: 3rem;
vertical-align: top;
height: 1.5rem;
display: inline-block; }
form .buttons {
text-align: center; }
form input {
font-weight: 400; }
table {
border: 1px solid #eaeaea; }
th {
background: #f7f7f7;
padding: 0.5rem; }
td {
padding: 0.5rem;
border: 1px solid #eaeaea; }
.button {
background: white;
color: #1bb3e9;
border: 1px solid #1bb3e9;
border-radius: 3px; }
.button:hover {
background: #1bb3e9;
color: white; }
.button:active {
box-shadow: 0 1px 0 #118ab5; }
.button-secondary {
background: white;
color: #f6635e;
border: 1px solid #f6635e;
border-radius: 3px; }
.button-secondary:hover {
background: #f6635e;
color: white; }
.button-secondary:active {
box-shadow: 0 1px 0 #f32b24; }
.bullets {
margin: 1.7rem 0;
margin-left: -0.85rem;
margin-right: -0.85rem;
overflow: auto; }
.bullet {
float: left;
padding: 0 0.85rem; }
.two-column-bullet {
width: 50%; }
@media only all and (max-width: 47.938rem) {
.two-column-bullet {
width: 100%; } }
.three-column-bullet {
width: 33.33333%; }
@media only all and (max-width: 47.938rem) {
.three-column-bullet {
width: 100%; } }
.four-column-bullet {
width: 25%; }
@media only all and (max-width: 47.938rem) {
.four-column-bullet {
width: 100%; } }
.bullet-icon {
float: left;
background: #1bb3e9;
padding: 0.875rem;
width: 3.5rem;
height: 3.5rem;
border-radius: 50%;
color: white;
font-size: 1.75rem;
text-align: center; }
.bullet-icon-1 {
background: #1bb3e9; }
.bullet-icon-2 {
background: #1be9da; }
.bullet-icon-3 {
background: #d5e91b; }
.bullet-content {
margin-left: 4.55rem; }
#panel {
color: white; }
#panel .navigation {
list-style: none;
padding: 0; }
#panel .navigation li {
padding: 0.5rem 1rem;
border-bottom: 1px solid #404040;
font-weight: 600; }
#panel .navigation li.active {
background: #fff; }
#panel .navigation li.active a {
color: #444444; }
#panel .navigation li.active a:hover {
color: #444444; }
#panel .navigation li:last-child {
border-bottom: 0; }
#panel .navigation li a:hover {
color: white; }
/* Menu Appearance */
.pushy {
position: fixed;
width: 250px;
height: 100%;
top: 0;
z-index: 9999;
background: #333333;
overflow: auto;
-webkit-overflow-scrolling: touch;
/* enables momentum scrolling in iOS overflow elements */ }
/* Menu Movement */
.pushy-left {
-webkit-transform: translate3d(-250px, 0, 0);
-moz-transform: translate3d(-250px, 0, 0);
-ms-transform: translate3d(-250px, 0, 0);
-o-transform: translate3d(-250px, 0, 0);
transform: translate3d(-250px, 0, 0); }
.pushy-open {
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0); }
.container-push, .push-push {
-webkit-transform: translate3d(250px, 0, 0);
-moz-transform: translate3d(250px, 0, 0);
-ms-transform: translate3d(250px, 0, 0);
-o-transform: translate3d(250px, 0, 0);
transform: translate3d(250px, 0, 0); }
/* Menu Transitions */
.pushy, #container, .push {
-webkit-transition: -webkit-transform 0.2s cubic-bezier(0.16, 0.68, 0.43, 0.99);
-moz-transition: -moz-transform 0.2s cubic-bezier(0.16, 0.68, 0.43, 0.99);
transition: transform 0.2s cubic-bezier(0.16, 0.68, 0.43, 0.99);
/* improves performance issues on mobile*/
-webkit-perspective: 1000; }
/* Site Overlay */
.site-overlay {
display: none; }
.pushy-active .site-overlay {
display: block;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 250px;
z-index: 9999; }
.blog-header {
padding-top: 2rem;
padding-bottom: 2rem; }
.blog-header.blog-header-image {
background-size: cover;
background-position: center; }
.blog-header.blog-header-image h1, .blog-header.blog-header-image h2 {
color: white; }
.blog-header h1 {
font-size: 4rem;
margin-top: 0; }
@media only all and (min-width: 48rem) and (max-width: 59.938rem) {
.blog-header h1 {
font-size: 3rem; } }
@media only all and (max-width: 47.938rem) {
.blog-header h1 {
font-size: 2.5rem;
line-height: 1.2;
margin-bottom: 2.5rem; } }
.blog-header + .blog-content {
padding-top: 3rem; }
.list-item {
border-bottom: 1px solid #eeeeee;
margin-bottom: 3rem; }
.list-item:last-child {
border-bottom: 0; }
.list-item .list-blog-header {
position: relative; }
.list-item .list-blog-header h4 {
margin-bottom: 0.5rem; }
.list-item .list-blog-header h4 a {
color: #444444; }
.list-item .list-blog-header h4 a:hover {
color: #1bb3e9; }
.list-item .list-blog-header img {
display: block;
margin-top: 1rem;
border-radius: 3px; }
.list-item .list-blog-date {
float: right;
text-align: center; }
.list-item .list-blog-date span {
display: block;
font-size: 1.75rem;
font-weight: 600;
line-height: 110%; }
.list-item .list-blog-date em {
display: block;
border-top: 1px solid #eeeeee;
font-style: normal;
text-transform: uppercase; }
.blog-content-item .list-blog-padding > p:nth-child(2) {
font-size: 1.2rem; }
.tags a {
display: inline-block;
font-size: 0.8rem;
border: 1px solid #1bb3e9;
border-radius: 3px;
padding: 0.1rem 0.4rem;
margin-bottom: 0.2rem;
text-transform: uppercase; }
.archives {
padding: 0;
list-style: none; }
.archives li {
border-bottom: 1px solid #eeeeee;
line-height: 2rem; }
.archives li:last-child {
border-bottom: 0; }
.syndicate a {
margin-bottom: 1rem; }
div#breadcrumbs {
padding-left: 0; }
#sidebar {
padding-left: 3rem; }
@media only all and (max-width: 47.938rem) {
#sidebar {
padding-left: 0; } }
#sidebar .sidebar-content {
margin-bottom: 3rem; }
#sidebar .sidebar-content h4 {
margin-bottom: 1rem; }
#sidebar .sidebar-content p, #sidebar .sidebar-content ul {
margin-top: 1rem; }
ul.pagination {
margin: 0 0 3rem;
text-align: left; }
#error {
text-align: center;
display: flex;
align-items: center;
justify-content: center;
height: 100%;
padding-bottom: 6rem; }
#error h1 {
font-size: 5rem; }
#error p {
margin: 1rem 0; }
.modular.header-image #body > .showcase {
margin-top: -9.5rem;
padding-top: 9rem; }
.modular.header-image #header {
background-color: rgba(255, 255, 255, 0);
box-shadow: none; }
.modular.header-image #header #logo h3 {
color: white; }
.modular.header-image #header #navbar a {
color: white; }
.modular .showcase {
padding-top: 4rem;
padding-bottom: 4rem;
background-color: #666;
background-size: cover;
background-attachment: fixed;
background-position: center;
text-align: center;
color: white; }
.modular .showcase h1 {
font-size: 4rem;
margin-top: 0; }
@media only all and (min-width: 48rem) and (max-width: 59.938rem) {
.modular .showcase h1 {
font-size: 3rem; } }
@media only all and (max-width: 47.938rem) {
.modular .showcase h1 {
font-size: 2.5rem;
line-height: 1.2;
margin-bottom: 2.5rem; } }
.modular .showcase .button {
color: white;
padding: 0.7rem 2rem;
margin-top: 2rem;
background: rgba(255, 255, 255, 0);
border: 1px solid white;
border-radius: 3px;
box-shadow: none;
font-size: 1.3rem; }
.modular .showcase .button:hover {
background: rgba(255, 255, 255, 0.2); }
.modular .features {
padding: 3rem 0;
text-align: center; }
.modular .features:after {
content: "";
display: table;
clear: both; }
.modular .features h2 {
margin: 0;
line-height: 100%; }
.modular .features p {
margin: 1rem 0;
font-size: 1.2rem; }
@media only all and (max-width: 47.938rem) {
.modular .features p {
font-size: 1rem; } }
.modular .features .feature-items {
margin-top: 2rem; }
.modular .features .feature {
display: block;
float: left;
width: 25%;
vertical-align: top;
margin-top: 2rem;
margin-bottom: 1rem; }
@media only all and (max-width: 47.938rem) {
.modular .features .feature {
width: 100%; } }
.modular .features .feature i.fa {
font-size: 2rem;
color: #1bb3e9; }
.modular .features .feature h4 {
margin: 0;
font-size: 1.1rem; }
.modular .features .feature p {
display: inline-block;
font-size: 1rem;
margin: 0.2rem 0 1rem; }
.modular .features.big {
text-align: center; }
.modular .features.big .feature {
width: 50%; }
.modular .features.big i.fa {
font-size: 3rem;
float: left; }
.modular .features.big .feature-content {
padding-right: 2rem; }
.modular .features.big .feature-content.push {
margin-left: 5rem; }
.modular .features.big .feature-content h4 {
font-size: 1.3rem;
text-align: left; }
.modular .features.big .feature-content p {
padding: 0;
text-align: left; }
.callout {
background: #f6f6f6;
padding: 3rem 0.938rem; }
.callout .align-left {
float: left;
margin-right: 2rem; }
.callout .align-right {
float: right;
margin-left: 2rem; }
.callout img {
border-radius: 3px; }
.modular .modular-row:last-child {
margin-bottom: 2rem; }
/*# sourceMappingURL=template.css.map */

View File

@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Grav Problems</title>
<meta name="description" content="Grav is an easy to use, yet powerful, open source flat-file CMS">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="%%PROBLEMS_URL%%/css/template.css" type="text/css" />
<link rel="stylesheet" href="%%PROBLEMS_URL%%/css/problems.css" type="text/css" />
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
</head>
<body id="top" class="">
<div id="container">
<section id="body" class="">
<h1>Issues Found</h1>
<h2>Please <strong>Review</strong> and <strong>Resolve</strong> before continuing...</h2>
<p class="center">
<a href="%%BASE_URL%%" class="button big"><i class="fa fa-refresh"></i> Reload Page</a>
</p>
<ul class="problems">
%%PROBLEMS%%
</ul>
</section>
</div>
</body>
</html>

View File

@ -0,0 +1,318 @@
<?php
namespace Grav\Plugin;
use Grav\Common\Cache;
use Grav\Common\Plugin;
use Grav\Common\Uri;
class ProblemsPlugin extends Plugin
{
protected $results = array();
protected $check;
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [
'onPluginsInitialized' => ['onPluginsInitialized', 100001],
'onFatalException' => ['onFatalException', 0]
];
}
public function onFatalException()
{
if ($this->isAdmin()) {
$this->active = false;
return;
}
// Run through potential issues
if ($this->problemChecker()) {
$this->renderProblems();
}
}
public function onPluginsInitialized()
{
if ($this->isAdmin()) {
$this->active = false;
return;
}
/** @var Cache $cache */
$cache = $this->grav['cache'];
$validated_prefix = 'problem-check-';
$this->check = CACHE_DIR . $validated_prefix . $cache->getKey();
if (!file_exists($this->check)) {
// If no issues remain, save a state file in the cache
if (!$this->problemChecker()) {
// delete any existing validated files
foreach (new \GlobIterator(CACHE_DIR . $validated_prefix . '*') as $fileInfo) {
@unlink($fileInfo->getPathname());
}
// create a file in the cache dir so it only runs on cache changes
touch($this->check);
} else {
$this->renderProblems();
}
}
}
protected function renderProblems()
{
$theme = 'antimatter';
/** @var Uri $uri */
$uri = $this->grav['uri'];
$baseUrlRelative = $uri->rootUrl(false);
$themeUrl = $baseUrlRelative . '/' . USER_PATH . basename(THEMES_DIR) . '/' . $theme;
$problemsUrl = $baseUrlRelative . '/user/plugins/problems';
$html = file_get_contents(__DIR__ . '/html/problems.html');
/**
* Process the results, ignore the statuses passed as $ignore_status
*
* @param $results
* @param $ignore_status
*/
$processResults = function ($results, $ignore_status) {
$problems = '';
foreach ($results as $key => $result) {
if ($key == 'files' || $key == 'apache' || $key == 'execute') {
foreach ($result as $key_text => $value_text) {
foreach ($value_text as $status => $text) {
if ($status == $ignore_status) continue;
$problems .= $this->getListRow($status, '<b>' . $key_text . '</b> ' . $text);
}
}
} else {
foreach ($result as $status => $text) {
if ($status == $ignore_status) continue;
$problems .= $this->getListRow($status, $text);
}
}
}
return $problems;
};
// First render the errors
$problems = $processResults($this->results, 'success');
// Then render the successful checks
$problems .= $processResults($this->results, 'error');
$html = str_replace('%%BASE_URL%%', $baseUrlRelative, $html);
$html = str_replace('%%THEME_URL%%', $themeUrl, $html);
$html = str_replace('%%PROBLEMS_URL%%', $problemsUrl, $html);
$html = str_replace('%%PROBLEMS%%', $problems, $html);
echo $html;
exit();
}
protected function getListRow($status, $text)
{
if ($status == 'error') {
$icon = 'fa-times';
} elseif ($status == 'info') {
$icon = 'fa-info';
} else {
$icon = 'fa-check';
}
$output = "\n";
$output .= '<li class="' . $status . ' clearfix"><i class="fa fa-fw '. $icon . '"></i><p>'. $text . '</p></li>';
return $output;
}
protected function problemChecker()
{
$min_php_version = defined('GRAV_PHP_MIN') ? GRAV_PHP_MIN : '5.4.0';
$problems_found = false;
$essential_files = [
'cache' => true,
'logs' => true,
'images' => true,
'assets' => true,
'system' => false,
'user/data' => true,
'user/pages' => false,
'user/config' => false,
'user/plugins/error' => false,
'user/plugins' => false,
'user/themes' => false,
'vendor' => false
];
if (version_compare(GRAV_VERSION, '0.9.27', ">=")) {
$essential_files['backup'] = true;
$backup_folder = ROOT_DIR . 'backup';
// try to create backup folder if missing
if (!file_exists($backup_folder)) {
@mkdir($backup_folder, 0770);
}
}
if (version_compare(GRAV_VERSION, '1.1.4', ">=")) {
$essential_files['tmp'] = true;
$tmp_folder = ROOT_DIR . 'tmp';
// try to create tmp folder if missing
if (!file_exists($tmp_folder)) {
@mkdir($tmp_folder, 0770);
}
}
// Perform some Apache checks
if (strpos(php_sapi_name(), 'apache') !== false) {
$require_apache_modules = ['mod_rewrite'];
$apache_modules = apache_get_modules();
$apache_status = [];
foreach ($require_apache_modules as $module) {
if (in_array($module, $apache_modules)) {
$apache_module_adjective = ' Apache module is enabled';
$apache_module_status = 'success';
} else {
$problems_found = true;
$apache_module_adjective = ' Apache module is not installed or enabled';
$apache_module_status = 'error';
}
$apache_status[$module] = [$apache_module_status => $apache_module_adjective];
}
if (sizeof($apache_status) > 0) {
$this->results['apache'] = $apache_status;
}
}
// Check PHP version
if (version_compare(phpversion(), $min_php_version, '<')) {
$problems_found = true;
$php_version_adjective = 'lower';
$php_version_status = 'error';
} else {
$php_version_adjective = 'greater';
$php_version_status = 'success';
}
$this->results['php'] = [$php_version_status => 'Your PHP version (' . phpversion() . ') is '. $php_version_adjective . ' than the minimum required: <b>' . $min_php_version . '</b> - <a href="http://getgrav.org/blog/changing-php-requirements-to-5.5">Additional Information</a>'];
// Check for GD library
if (defined('GD_VERSION') && function_exists('gd_info')) {
$gd_adjective = '';
$gd_status = 'success';
} else {
$problems_found = true;
$gd_adjective = 'not ';
$gd_status = 'error';
}
$this->results['gd'] = [$gd_status => 'PHP GD (Image Manipulation Library) is '. $gd_adjective . 'installed'];
// Check for PHP CURL library
if (function_exists('curl_version')) {
$curl_adjective = '';
$curl_status = 'success';
} else {
$problems_found = true;
$curl_adjective = 'not ';
$curl_status = 'error';
}
$this->results['curl'] = [$curl_status => 'PHP Curl (Data Transfer Library) is '. $curl_adjective . 'installed'];
// Check for PHP Open SSL library
if (extension_loaded('openssl') && defined('OPENSSL_VERSION_TEXT')) {
$ssl_adjective = '';
$ssl_status = 'success';
} else {
$problems_found = true;
$ssl_adjective = 'not ';
$ssl_status = 'error';
}
$this->results['ssl'] = [$ssl_status => 'PHP OpenSSL (Secure Sockets Library) is '. $ssl_adjective . 'installed'];
// Check for PHP XML library
if (extension_loaded('xml')) {
$xml_adjective = '';
$xml_status = 'success';
} else {
$problems_found = true;
$xml_adjective = 'not ';
$xml_status = 'error';
}
$this->results['xml'] = [$xml_status => 'PHP XML Library is '. $xml_adjective . 'installed'];
// Check for PHP MbString library
if (extension_loaded('mbstring')) {
$mbstring_adjective = '';
$mbstring_status = 'success';
} else {
$problems_found = true;
$mbstring_adjective = 'not ';
$mbstring_status = 'error';
}
$this->results['mbstring'] = [$mbstring_status => 'PHP Mbstring (Multibyte String Library) is '. $mbstring_adjective . 'installed'];
// Check for PHP Zip library
if (extension_loaded('zip')) {
$zip_adjective = '';
$zip_status = 'success';
} else {
$problems_found = true;
$zip_adjective = 'not ';
$zip_status = 'error';
}
$this->results['zip'] = [$mbstring_status => 'PHP Zip extension is '. $mbstring_adjective . 'installed'];
// Check for essential files & perms
$file_problems = [];
foreach ($essential_files as $file => $check_writable) {
$file_path = ROOT_DIR . $file;
$is_dir = false;
if (!file_exists($file_path)) {
$problems_found = true;
$file_status = 'error';
$file_adjective = 'does not exist';
} else {
$file_status = 'success';
$file_adjective = 'exists';
$is_writeable = is_writable($file_path);
$is_dir = is_dir($file_path);
if ($check_writable) {
if (!$is_writeable) {
$file_status = 'error';
$problems_found = true;
$file_adjective .= ' but is <b class="underline">not writeable</b>';
} else {
$file_adjective .= ' and <b class="underline">is writeable</b>';
}
}
}
$file_problems[$file_path] = [$file_status => $file_adjective];
}
if (sizeof($file_problems) > 0) {
$this->results['files'] = $file_problems;
}
return $problems_found;
}
}

View File

@ -0,0 +1,2 @@
enabled: true
built_in_css: true