Skip to content

Commit

Permalink
v 0.11.0
Browse files Browse the repository at this point in the history
- Add uninstall.
- Update lang method.
- Update dependencies.
- Hide popin on a specific page.
- Add JS Github action.
  • Loading branch information
Darklg committed Dec 9, 2024
1 parent 91be9fb commit 6ff12f6
Show file tree
Hide file tree
Showing 27 changed files with 1,182 additions and 96 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
"no-prototype-builtins": 0,
"no-console": 1,
"no-unused-vars": 1,
"no-undef": 1
},
"globals": {
"wpupopin_settings": true,
"wp": true,
"jQuery": true
}
}
17 changes: 17 additions & 0 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: ESLint

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install modules
run: npm install -g eslint@^8
- name: Run ESLint
run: eslint assets/ --ext .js
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 WordPressUtilities
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
Expand Down
3 changes: 1 addition & 2 deletions assets/front.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* globals jQuery,wpupopin_settings,document,window */

jQuery(document).ready(function() {
set_wpupopin(jQuery('.wpupopin__wrapper'));
Expand Down Expand Up @@ -107,7 +106,7 @@ function set_wpupopin($popin) {
if (!window.localStorage.getItem('wpupopin_nbClicksCount')) {
window.localStorage.setItem('wpupopin_nbClicksCount', 0);
}
window.addEventListener('click', function(e) {
window.addEventListener('click', function() {
var nbClicksCount = window.localStorage.getItem('wpupopin_nbClicksCount');
nbClicksCount = parseInt(nbClicksCount, 10) + 1;
window.localStorage.setItem('wpupopin_nbClicksCount', nbClicksCount);
Expand Down
5 changes: 5 additions & 0 deletions inc/WPUBaseFields/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
deny from all

<FilesMatch "(^$)|(\.(css|js)$)">
Allow From All
</FilesMatch>
41 changes: 41 additions & 0 deletions inc/WPUBaseFields/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
WPU Base fields
---

Add Custom fields to your plugin.

## Insert in the plugins_loaded hook

```php
include 'inc/WPUBaseFields.php';
$fields = array(
'demo' => array(
'group' => 'group_1',
'label' => 'Demo',
'placeholder' => 'My Placeholder',
'required' => true
),
'select' => array(
'type' => 'select',
'group' => 'group_2',
'label' => 'Select with Data',
'data' => array(
'value_1' => 'Value 1',
'value_2' => 'Value 2',
)
),
'select_nodata' => array(
'type' => 'select',
'group' => 'group_2',
'label' => 'Select without Data'
)
);
$field_groups = array(
'group_1' => array(
'label' => 'Group 1'
),
'group_2' => array(
'label' => 'Group 2'
)
);
$this->basefields = new \wpubaseplugin\WPUBaseFields($fields, $field_groups);
```
Loading

0 comments on commit 6ff12f6

Please sign in to comment.