Skip to content

Commit

Permalink
v 1.2.0
Browse files Browse the repository at this point in the history
- Update dependencies.
- Add github actions.
- Protect some directories.
- Update lang method.
- Option to disable header 503.
- Option to disable page content edition if a template is in use.
  • Loading branch information
Darklg committed Dec 18, 2024
1 parent 225e5ae commit 236a6e5
Show file tree
Hide file tree
Showing 24 changed files with 474 additions and 85 deletions.
1 change: 1 addition & 0 deletions .github/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
19 changes: 19 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.mo.php
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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 :
Expand Down Expand Up @@ -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.
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.
1 change: 1 addition & 0 deletions inc/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
1 change: 1 addition & 0 deletions inc/WPUBaseSettings/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
6 changes: 4 additions & 2 deletions inc/WPUBaseSettings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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 '<form action="' . admin_url('options.php') . '" method="post">';
settings_fields($this->settings_details['option_id']);
do_settings_sections($this->options['plugin_id']);
Expand Down
Loading

0 comments on commit 236a6e5

Please sign in to comment.