diff --git a/.github/.htaccess b/.github/.htaccess new file mode 100644 index 0000000..8d2f256 --- /dev/null +++ b/.github/.htaccess @@ -0,0 +1 @@ +deny from all diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..aa092ae --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,19 @@ +name: PHP Lint + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + phplint: + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: PHP Lint + uses: michaelw90/PHP-Lint@2.1.0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..78568eb --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.mo.php diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f144cd3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 WPUtilities + +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. diff --git a/README.md b/README.md index e3984ec..fde4624 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ WPU Maintenance ============== +Add [![PHP workflow](https://github.com/WordPressUtilities/wpumaintenance/actions/workflows/php.yml/badge.svg 'PHP workflow')](https://github.com/WordPressUtilities/wpumaintenance/actions) to your README.md + Adds a maintenance page for non logged-in users ## How to install : @@ -28,4 +30,4 @@ You can use the hooks and filters of the default page ( called before the "init" ### File -If you place a file named "maintenance.php", "maintenance.html" or "index.html" at the root of your active theme, it will be included instead of the default maintenance page. \ No newline at end of file +If you place a file named "maintenance.php", "maintenance.html" or "index.html" in the folder wpumaintenance/ of your active theme, it will be included instead of the default maintenance page. diff --git a/inc/.htaccess b/inc/.htaccess new file mode 100644 index 0000000..8d2f256 --- /dev/null +++ b/inc/.htaccess @@ -0,0 +1 @@ +deny from all diff --git a/inc/WPUBaseSettings/.htaccess b/inc/WPUBaseSettings/.htaccess new file mode 100644 index 0000000..8d2f256 --- /dev/null +++ b/inc/WPUBaseSettings/.htaccess @@ -0,0 +1 @@ +deny from all diff --git a/inc/WPUBaseSettings/README.md b/inc/WPUBaseSettings/README.md index ef364d6..95d3539 100644 --- a/inc/WPUBaseSettings/README.md +++ b/inc/WPUBaseSettings/README.md @@ -11,6 +11,7 @@ $this->settings_details = array( 'create_page' => true, 'plugin_basename' => plugin_basename(__FILE__), # Default + 'plugin_name' => 'Import Twitter', 'plugin_id' => 'wpuimporttwitter', 'option_id' => 'wpuimporttwitter_options', 'sections' => array( @@ -27,14 +28,15 @@ $this->settings = array( ) ); if (is_admin()) { - include dirname( __FILE__ ) . '/inc/WPUBaseSettings.php'; + require_once __DIR__ . '/inc/WPUBaseSettings/WPUBaseSettings.php'; new \wpuimporttwitter\WPUBaseSettings($this->settings_details,$this->settings); } ``` -## Insert in your admin page content +## Insert in your admin page content ( if needed ) ```php +settings_errors(); echo '