Skip to content

Commit

Permalink
v 0.23.0
Browse files Browse the repository at this point in the history
- Update dependencies.
- Set new translation method.
- Branch Master to Main.
  • Loading branch information
Darklg committed Nov 1, 2024
1 parent d902046 commit b51501f
Show file tree
Hide file tree
Showing 12 changed files with 86 additions and 15 deletions.
23 changes: 23 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"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": {
"tinyMCE": true,
"qTranslateConfig": true,
"wputaxometas_options": 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@v3
- name: Install modules
run: npm install -g eslint@^8
- name: Run ESLint
run: eslint assets/ --ext .js
6 changes: 3 additions & 3 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: PHP Lint

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

jobs:
phplint:
Expand All @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: PHP Lint
uses: michaelw90/[email protected]
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.
3 changes: 1 addition & 2 deletions assets/global.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*global jQuery:false, wp:false */
'use strict';

jQuery(document).ready(function() {
Expand Down Expand Up @@ -89,7 +88,7 @@ var wputh_taxometas_set_media = function() {
unset_media(jQuery(this));
});

jQuery('body').on('unset_media', '.wputaxometas_add_media', function(e) {
jQuery('body').on('unset_media', '.wputaxometas_add_media', function() {
unset_media(jQuery(this));
});

Expand Down
4 changes: 2 additions & 2 deletions assets/qtranslatex.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jQuery(document).ready(function($) {
jQuery(document).ready(function() {
wputh_taxometas_set_qtranslate();
});

Expand All @@ -24,4 +24,4 @@ function wputh_taxometas_set_qtranslate() {
function wputh_taxometas_qt_display_lang(lang) {
jQuery('[data-wputaxometaslang]').hide();
jQuery('[data-wputaxometaslang="' + lang + '"]').show();
}
}
1 change: 1 addition & 0 deletions inc/WPUBaseUpdate/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
deny from all
2 changes: 1 addition & 1 deletion inc/WPUBaseUpdate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Update your Github WordPress plugin from the plugins page admin.
## Insert in the INIT hook

```php
include dirname( __FILE__ ) . '/inc/WPUBaseUpdate/WPUBaseUpdate.php';
require_once __DIR__ . '/inc/WPUBaseUpdate/WPUBaseUpdate.php';
$this->settings_update = new \PLUGINID\WPUBaseUpdate(
'WordPressUtilities',
'PLUGINID',
Expand Down
14 changes: 10 additions & 4 deletions inc/WPUBaseUpdate/WPUBaseUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/*
Class Name: WPU Base Update
Description: A class to handle plugin update from github
Version: 0.4.5
Version: 0.5.0
Class URI: https://github.com/WordPressUtilities/wpubaseplugin
Author: Darklg
Author URI: https://darklg.me/
Expand All @@ -26,6 +26,7 @@ class WPUBaseUpdate {
private $plugin_id;
private $plugin_dir;
private $details;
private $is_tracked = false;

public function __construct($github_username = false, $github_project = false, $current_version = false, $details = array()) {
$this->init($github_username, $github_project, $current_version, $details);
Expand All @@ -47,9 +48,7 @@ public function init($github_username = false, $github_project = false, $current
$this->plugin_dir = (defined('WP_PLUGIN_DIR') ? WP_PLUGIN_DIR : WP_CONTENT_DIR . '/plugins') . '/' . $this->plugin_id;

$gitpath = dirname($this->plugin_dir) . '/.git';
if (is_dir($gitpath) || file_exists($gitpath)) {
return;
}
$this->is_tracked = (is_dir($gitpath) || file_exists($gitpath));

if (!is_array($details)) {
$details = array();
Expand Down Expand Up @@ -125,6 +124,13 @@ public function get_new_plugin_info() {
'sections' => array()
);

/* Disable download link if plugin is tracked */
if ($this->is_tracked) {
$plugin_info['trunk'] = '';
$plugin_info['download_link'] = '';
$plugin_info['package'] = '';
}

/* Fetch plugin data */
$plugin_data = array();
if (file_exists($this->plugin_dir)) {
Expand Down
1 change: 1 addition & 0 deletions inc/WPUBaseUpdate/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?php /* Silence */
2 changes: 2 additions & 0 deletions lang/wputaxometas-fr_FR.l10n.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?php
return ['domain'=>NULL,'plural-forms'=>NULL,'messages'=>['Add a picture'=>'Ajouter une image','Change this picture'=>'Modifier cette image','Select a value'=>'Sélectionner une valeur','Simple admin for taxo metas'=>'Administration simple pour les taxo metas','No'=>'Non','Yes'=>'Oui'],'language'=>'fr_FR','x-generator'=>'Poedit 3.2.2'];
7 changes: 4 additions & 3 deletions wputaxometas.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,22 @@
Plugin URI: https://github.com/WordPressUtilities/wputaxometas
Update URI: https://github.com/WordPressUtilities/wputaxometas
Description: Simple admin for taxo metas
Version: 0.22.1
Version: 0.23.0
Author: Darklg
Author URI: https://darklg.me/
Text Domain: wputaxometas
Domain Path: /lang
Requires at least: 6.2
Requires PHP: 8.0
Network: Optional
License: MIT License
License URI: https://opensource.org/licenses/MIT
*/

defined('ABSPATH') or die(':(');

class WPUTaxoMetas {
public $plugin_version = '0.22.1';
public $plugin_version = '0.23.0';
public $qtranslate = false;
public $qtranslatex = false;
public $fields = array();
Expand All @@ -41,7 +42,7 @@ public function __construct($hooks = true) {
public function set_hooks() {

/* Auto-updater */
include __DIR__ . '/inc/WPUBaseUpdate/WPUBaseUpdate.php';
require_once __DIR__ . '/inc/WPUBaseUpdate/WPUBaseUpdate.php';
$this->settings_update = new \wputaxometas\WPUBaseUpdate(
'WordPressUtilities',
'wputaxometas',
Expand Down

0 comments on commit b51501f

Please sign in to comment.