Coder Social home page Coder Social logo

bnomei / kirby3-doctor Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 1.0 2.29 MB

Plugin to check health of your CMS installation

Home Page: https://forum.getkirby.com/t/kirby3-doctor-check-health-of-kirby-installation/23579

License: MIT License

PHP 89.70% JavaScript 2.01% Vue 8.29%
kirby3 kirby3-cms kirby3-plugin doctor check health

kirby3-doctor's Introduction


With Kirby 3.7 introducing an improved system view most important checks have been covered. Thus I will not continue to work on this plugin.

Kirby 3 Doctor

Release Downloads Build Status Coverage Status Maintainability Twitter

Plugin to check health of your CMS installation

Commercial Usage


Support open source!

This plugin is free but if you use it in a commercial project please consider to sponsor me or make a donation.
If my work helped you to make some cash it seems fair to me that I might get a little reward as well, right?

Be kind. Share a little. Thanks.

‐ Bruno
 
M O N E Y
Github sponsor Patreon Buy Me a Coffee Paypal dontation Hire me

Installation

  • unzip master.zip as folder site/plugins/kirby3-doctor or
  • git submodule add https://github.com/bnomei/kirby3-doctor.git site/plugins/kirby3-doctor or
  • composer require bnomei/kirby3-doctor

Screenshots

doctor

Usage Kirby Panel

This plugin will register a Panel Area "Doctor". Many thanks to @Daandelange for PRing this feature. Alternatively you could also add the button to perform the checks on any other view.

fields:
  doctor:
    type: doctor
    label: Perform checks
    # progress: Performing checks...

Usage Kirby API (post Authentification)

let doctor = fetch('https://kirby3-plugins.bnomei.com/api/plugin-doctor/check')
  .then(response => response.json())
  .then(json => {
      console.log(json);
  });

Provided Checks

  • CheckPHPVersion (laminas): Kirby installation requirements
  • CheckPHPExtension (laminas): Kirby installation requirements
  • CheckKirbyFolders (laminas): Read/Write-Access to core Kirby folders
  • CheckGitFolder: No public .git folder
  • CheckHtaccess: Has a .htaccess file
  • CheckKirbyAccount: Has at least one account
  • CheckKirbyCacheSize: Cache folder not too big
  • CheckKirbyLicense: License exists (on non localhost)
  • CheckKirbyMediaSize: Media folder not too big
  • CheckKirbySystem: Kirby build-in system checks
  • CheckKirbyVersion: Is Kirby up-to-date
  • CheckSSL: Using https scheme

Custom Checks

You can add custom checks or disable build checks using the checks setting in the config file.

return [
    'bnomei.doctor.checks' => [
        "MyNamespace\\MyClass" => true, // enable new
        "Bnomei\\CheckKirbyCacheSize" => false, // disable build-in
    ],
    // ...
];

You can also use your own plugin to define checks (since 1.2.0). Many thanks to @fabianmichael for the great idea.

Kirby::plugin('my/plugin', [        // your plugin
  'bnomei.doctor.checks' => [       // required option id
    "MyNamespace\\MyClass" => true, // enable new
  ],
]);

Contribute: You have an idea for a check or a plugin defining a check? Please create a new issue or submit a PR.

Settings

bnomei.doctor. Default Description
expire 24*60 minutes to cache the results and not run tests again
debugforce true will expire the cache every time if option('debug') is true as well.
checks [] example: ["MyNamespace\\MyCheckClass" => true, "Bnomei\\CheckGitFolder" => false] Attention: Namespaces must use \\-notion.
log.enabled true will create a log file if Kirby Log Plugin is installed as well.
log callback to kirbyLog()

Credits

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.

License

MIT

It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.

kirby3-doctor's People

Contributors

bnomei avatar daandelange avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

daandelange

kirby3-doctor's Issues

Allow plugins to define checks

As the plugin allows to define custom checks in the config.php file, it would be a great addition to give plugins access to that functionality as well. A thumbnail generator could check is the driver works or necessary CLI tools are available, plugins accessing third-party APIs could check whether the API keys are valid etc.

Kirby’s plugin method can hold custom parameters, the implementation could be done as simple as follows:

Kirby::plugin('my/plugin', [
  'bnomei.doctor.checks' => [
    "MyNamespace\\MyClass" => true, // enable new
  ],
]);

The Doctor class could load the checks defined by plugins pretty easily:

$pluginChecks = [];

foreach (kirby()->plugins() as $plugin) {
  $pluginChecks = array_merge($pluginChecks, $plugin->extends()['bnomei.doctor.checks'] ?? []);
}

Does not run under PHP8

We have moved the project to PHP 8 as PHP 7.4 is EOL at the end of the year. Unfortunately, one dependency does not tolerate the change:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- bnomei/kirby3-doctor[1.5.0, ..., 1.5.1] require zendframework/zenddiagnostics ^1.6 -> satisfiable by zendframework/zenddiagnostics[v1.6.0].
- zendframework/zenddiagnostics v1.6.0 requires php ^5.6 || ^7.0 -> your php version (8.0.13) does not satisfy that requirement.
- Root composer.json requires bnomei/kirby3-doctor ^1.5 -> satisfiable by bnomei/kirby3-doctor[1.5.0, 1.5.1].

Registering custom Doctor checks

Hey @bnomei ,
Thinking about this plugin, I thought it would be awesome to let other Kirby plugins register their own Doctor checks, if installed together.
A bit like how Doctor uses Kirby Log : if plugins (and user config.php?) could extend Doctor checks, this plugin would unleash its true powers.
Any thoughts about this ?

site/config

add to must be writeable because of license

Plugin does not comply with psr-4 autoloading standard.

I get the following warning message,please fix this to comply with Composer V2.0:

Deprecation Notice: Class Bnomei\Interfaces\Doctor located in ./site/plugins/kirby3-doctor/classes/Interfaces/DoctorInterface.php does not comply with psr-4 autoloading standard.

It will not autoload anymore in Composer v2.0. in phar:///Applications/DevDesktop/tools/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:201

Deprecation Notice: Class Bnomei\Interfaces\Doctor located in ./site/plugins/kirby3-doctor/classes/Interfaces/DoctorInterface.php does not comply with psr-4 autoloading standard. 
It will not autoload anymore in Composer v2.0. in phar:///Applications/DevDesktop/tools/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:201

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.