0.21
Some checks failed
Create Release / Create Release (push) Has been cancelled

This commit is contained in:
abuyoyo 2023-08-10 03:44:27 +03:00
commit 320496722d
14 changed files with 183 additions and 50 deletions

View File

@ -1,5 +1,13 @@
# Notice Manager Changelog
## 0.21
### Fixed
- Fix PHP 8.2 deprecated optional parameter before required parameter. Fixed upstream in `abuyoyo/screen-meta-links ~0.13`.
### Dependencies
- Update library `abuyoyo/screen-meta-links` to version 0.13.
## 0.20
### Minor

View File

@ -2,7 +2,7 @@
"name": "abuyoyo/notice-manager",
"description": "Manage notices on WordPress admin pages. Adds 'Notices' screen-meta-link.",
"type": "wordpress-plugin",
"version": "0.20",
"version": "0.21",
"repositories": [
{
"type": "vcs",
@ -10,7 +10,7 @@
}
],
"require":{
"abuyoyo/screen-meta-links": "~0.11",
"abuyoyo/screen-meta-links": "~0.13",
"abuyoyo/plugincore": "~0.26",
"abuyoyo/adminmenupage": "~0.25"
}

26
composer.lock generated
View File

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f7b75f26e447e0d13270ca9591fc4bd4",
"content-hash": "6d8701d5158bd7f07c4775c45160cde4",
"packages": [
{
"name": "abuyoyo/adminmenupage",
"version": "0.25",
"version": "0.26",
"source": {
"type": "git",
"url": "https://github.com/abuyoyo/AdminMenuPage.git",
"reference": "487d262aec77a9a3ce04fa762e9048f30d22f123"
"reference": "f2fcb6d4c8b232ca03cef1908253aed4e5962be8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/abuyoyo/AdminMenuPage/zipball/487d262aec77a9a3ce04fa762e9048f30d22f123",
"reference": "487d262aec77a9a3ce04fa762e9048f30d22f123",
"url": "https://api.github.com/repos/abuyoyo/AdminMenuPage/zipball/f2fcb6d4c8b232ca03cef1908253aed4e5962be8",
"reference": "f2fcb6d4c8b232ca03cef1908253aed4e5962be8",
"shasum": ""
},
"suggest": {
@ -40,9 +40,9 @@
"description": "WordPress admin menu page helper class",
"support": {
"issues": "https://github.com/abuyoyo/AdminMenuPage/issues",
"source": "https://github.com/abuyoyo/AdminMenuPage/tree/0.25"
"source": "https://github.com/abuyoyo/AdminMenuPage/tree/0.26"
},
"time": "2023-06-09T00:00:00+00:00"
"time": "2023-06-20T00:00:00+00:00"
},
{
"name": "abuyoyo/plugincore",
@ -81,16 +81,16 @@
},
{
"name": "abuyoyo/screen-meta-links",
"version": "0.11",
"version": "0.13",
"source": {
"type": "git",
"url": "https://github.com/abuyoyo/screen-meta-links.git",
"reference": "04e3c892f0c6095b4c31a489e06336f0917128d3"
"reference": "b324cef9eb5825d04ffa17f771237b7deca5cd01"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/abuyoyo/screen-meta-links/zipball/04e3c892f0c6095b4c31a489e06336f0917128d3",
"reference": "04e3c892f0c6095b4c31a489e06336f0917128d3",
"url": "https://api.github.com/repos/abuyoyo/screen-meta-links/zipball/b324cef9eb5825d04ffa17f771237b7deca5cd01",
"reference": "b324cef9eb5825d04ffa17f771237b7deca5cd01",
"shasum": ""
},
"type": "library",
@ -101,10 +101,10 @@
},
"description": "API for adding custom screen-meta-links alongside the 'Screen Options' and 'Help' links.",
"support": {
"source": "https://github.com/abuyoyo/screen-meta-links/tree/0.11",
"source": "https://github.com/abuyoyo/screen-meta-links/tree/0.13",
"issues": "https://github.com/abuyoyo/screen-meta-links/issues"
},
"time": "2022-05-18T01:18:24+00:00"
"time": "2023-08-08T22:37:03+00:00"
}
],
"packages-dev": [],

View File

@ -2,7 +2,7 @@
/**
* Plugin Name: Notice Manager
* Description: Manage notices on WordPress admin pages. Adds 'Notices' screen-meta-link.
* Version: 0.20
* Version: 0.21
* Author: abuyoyo
* Author URI: https://github.com/abuyoyo/
* Plugin URI: https://github.com/abuyoyo/notice-manager

View File

@ -1,6 +1,13 @@
# Changelog
WPHelper\AdminMenuPage
## 0.26
Release date: Jun 20 2023
### Added
- Add `allow_on_front` setting to CMB2 pages. Hooks metabox on `cmb2_init` instead of `cmb2_admin_init`.
- If defined `WPH_DEBUG` add WPHelper classes debug information to plugin info meta box.
## 0.25
Release date: Jun 9 2023

View File

@ -2,8 +2,8 @@
"name": "abuyoyo/adminmenupage",
"description": "WordPress admin menu page helper class",
"type": "library",
"version": "0.25",
"time": "2023-06-09",
"version": "0.26",
"time": "2023-06-20",
"license": "BSD-3-Clause",
"suggest": {
"abuyoyo/plugincore": "~0.26",

View File

@ -192,7 +192,11 @@ class CMB2_OptionsPage{
// register parent pages before sub-menu pages
$priority = empty( $settings['parent_slug'] ) ? 9 : 10;
add_action( 'cmb2_admin_init', [ $this, 'register_metabox' ], $priority );
if ( $settings['allow_on_front'] ?? false ){
add_action( 'cmb2_init', [ $this, 'register_metabox' ], $priority );
} else {
add_action( 'cmb2_admin_init', [ $this, 'register_metabox' ], $priority );
}
/**
* @todo add 'submenu' field and functionality to WPHelper\AdminPage

View File

@ -18,6 +18,8 @@ class PluginInfoMetaBox{
private $tpl_inside = '/tpl/plugin_info_meta_box-inside.php';
private $tpl_debug = '/tpl/plugin_info_meta_box-wph_debug.php';
/**
* @var PluginCore
*/
@ -38,6 +40,7 @@ class PluginInfoMetaBox{
add_action( "wphelper/plugin_info_meta_box/{$this->plugin_core->slug()}", [ $this, 'plugin_info_box' ] );
add_action( "wphelper/plugin_info_meta_box/inside/{$this->plugin_core->slug()}", [ $this, 'inside' ] );
}
/**
@ -98,5 +101,16 @@ class PluginInfoMetaBox{
extract($args);
include __DIR__ . $this->tpl_inside;
}
/**
* WPHelper classes debug info
*
* Prints inside Plugin Info Meta Box
*
* @since 0.26
*/
function wph_debug() {
include __DIR__ . $this->tpl_debug;
}
}
endif;

View File

@ -24,4 +24,11 @@
<?php if ( ! empty( $update_message ) ): ?>
Last Updated: <?php echo $update_message; ?>
<?php endif; ?>
</p>
</p>
<?php
/**
* Print WPHelper debug info in plugin info meta box
*/
if ( defined('WPH_DEBUG') && WPH_DEBUG ) {
$this->wph_debug();
}

View File

@ -0,0 +1,82 @@
<?php
/**
* Plugin Info Metabox - .wph-debug
*/
use WPHelper\AdminPage;
use WPHelper\MetaBox;
use WPHelper\PluginCore;
use WPHelper\Utility\Singleton;
use WPHelper\DatabaseTable;
if (class_exists(AdminPage::class)){
$wph_admin_ref = new ReflectionClass(AdminPage::class);
$wph_admin_file = $wph_admin_ref->getFileName();
$wph_admin_composer = json_decode(file_get_contents( dirname( dirname( $wph_admin_file ) ) . '/composer.json' )) ;
}
if (class_exists(PluginCore::class)){
$wph_pc_ref = new ReflectionClass(PluginCore::class);
$wph_pc_file = $wph_pc_ref->getFileName();
$wph_pc_composer = json_decode(file_get_contents( dirname( $wph_pc_file ) . '/composer.json' )) ;
}
if (class_exists(MetaBox::class)){
$wph_mb_ref = new ReflectionClass(MetaBox::class);
$wph_mb_file = $wph_mb_ref->getFileName();
$wph_mb_composer = json_decode(file_get_contents( dirname( $wph_mb_file ) . '/composer.json' )) ;
}
if (trait_exists(Singleton::class)){
$wph_util_ref = new ReflectionClass(Singleton::class);
$wph_util_file = $wph_util_ref->getFileName();
$wph_util_composer = json_decode(file_get_contents( dirname( dirname( $wph_util_file ) ) . '/composer.json' )) ;
}
if (class_exists(DatabaseTable::class)){
$wph_db_ref = new ReflectionClass(DatabaseTable::class);
$wph_db_file = $wph_db_ref->getFileName();
$wph_db_composer = json_decode(file_get_contents( dirname( $wph_db_file ) . '/composer.json' )) ;
}
?>
<style>
.inside {
word-wrap: break-word;
}
</style>
<?php if ( ! empty( $wph_admin_composer ) ): ?>
<hr>
<p>
AdminPage: <?php echo $wph_admin_composer->version; ?><br/>
Location: <?php echo $wph_admin_file; ?><br/>
<?php endif; ?>
<?php if ( ! empty( $wph_pc_composer ) ): ?>
<hr>
<p>
PluginCore: <?php echo $wph_pc_composer->version; ?><br/>
Location: <?php echo $wph_pc_file; ?><br/>
<?php endif; ?>
<?php if ( ! empty( $wph_mb_composer ) ): ?>
<hr>
<p>
MetaBox: <?php echo $wph_mb_composer->version; ?><br/>
Location: <?php echo $wph_mb_file; ?><br/>
<?php endif; ?>
<?php if ( ! empty( $wph_util_composer ) ): ?>
<hr>
<p>
Utility: <?php echo $wph_util_composer->version; ?><br/>
Location: <?php echo $wph_util_file; ?><br/>
<?php endif; ?>
<?php if ( ! empty( $wph_db_composer ) ): ?>
<hr>
<p>
DatabaseTable: <?php echo $wph_db_composer->version; ?><br/>
Location: <?php echo $wph_db_file; ?><br/>
<?php endif; ?>
</p>

View File

@ -2,6 +2,16 @@
API for adding custom `screen-meta-links` links and panels alongside the 'Screen Options' and 'Help' links on the WordPress admin page.
## [0.13](https://github.com/abuyoyo/screen-meta-links/releases/tag/0.13)
### Fixed
- Fix PHP 8.2 depreacted: Optional parameter declared before required parameter.
## [0.12](https://github.com/abuyoyo/screen-meta-links/releases/tag/0.12)
### Fixed
- Fix PHP notice: Constant already defined.
## [0.11](https://github.com/abuyoyo/screen-meta-links/releases/tag/0.11)
### Removed

View File

@ -2,7 +2,7 @@
/**
* Plugin Name: abuyoyo / Screen Meta Links
* Description: API for adding custom screen-meta-links alongside the "Screen Options" and "Help" links.
* Version: 0.11
* Version: 0.13
* Author: abuyoyo
* Author URI: https://github.com/abuyoyo
* Plugin URI: https://github.com/abuyoyo/screen-meta-links
@ -16,9 +16,9 @@
*
*/
if ( ! defined( 'SML_FILE' ) ) define ( 'SML_FILE', __FILE__ );
if ( ! defined( 'SML_URL' ) ) define ( 'SML_URL', plugin_dir_url( __FILE__ ) );
if ( ! defined( 'SML_PATH' ) ) define ( 'SML_PATH', plugin_dir_path( __FILE__ ) );
! defined( 'SML_FILE' ) && define ( 'SML_FILE', __FILE__ );
! defined( 'SML_URL' ) && define ( 'SML_URL' , plugin_dir_url( __FILE__ ) );
! defined( 'SML_PATH' ) && define ( 'SML_PATH', plugin_dir_path( __FILE__ ) );
if ( ! class_exists('Screen_Meta_Links') ):
@ -352,14 +352,15 @@ if ( ! function_exists( 'wph_add_screen_meta_panel' ) ):
* @param string $id - Link ID. Should be unique and a valid value for a HTML ID attribute.
* @param string $text - Link text.
* @param string $href - Optional. Link URL to be used if no panel is provided
* @param string|array $page - The page(s) where you want to add the link.
* @param string|array $page - Optional. The page(s) where you want to add the link. Accepts wildcard '*'. If left empty will not add to any page.
* @param array $attributes - Optional. Additional attributes for the link tag. Add 'aria-controls' => "{$id}-wrap" to toggle panel
* @param callback $panel - Optional. Callback should print out screen-meta panel contents
* @return void
*
* @todo Remove $href parameter and functionailty
* @todo $page should not be optional. We need to remove $href first.
*/
function wph_add_screen_meta_panel($id, $text, $href = '', $page, $attributes = null, $panel=''){
function wph_add_screen_meta_panel( $id, $text, $href = '', $page = '', $attributes = null, $panel = '' ){
static $sml_instance = null;
if ( null === $sml_instance){

View File

@ -2,24 +2,24 @@
"packages": [
{
"name": "abuyoyo/adminmenupage",
"version": "0.25",
"version_normalized": "0.25.0.0",
"version": "0.26",
"version_normalized": "0.26.0.0",
"source": {
"type": "git",
"url": "https://github.com/abuyoyo/AdminMenuPage.git",
"reference": "487d262aec77a9a3ce04fa762e9048f30d22f123"
"reference": "f2fcb6d4c8b232ca03cef1908253aed4e5962be8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/abuyoyo/AdminMenuPage/zipball/487d262aec77a9a3ce04fa762e9048f30d22f123",
"reference": "487d262aec77a9a3ce04fa762e9048f30d22f123",
"url": "https://api.github.com/repos/abuyoyo/AdminMenuPage/zipball/f2fcb6d4c8b232ca03cef1908253aed4e5962be8",
"reference": "f2fcb6d4c8b232ca03cef1908253aed4e5962be8",
"shasum": ""
},
"suggest": {
"abuyoyo/plugincore": "~0.26",
"cmb2/cmb2": "~2.9"
},
"time": "2023-06-09T00:00:00+00:00",
"time": "2023-06-20T00:00:00+00:00",
"type": "library",
"installation-source": "source",
"autoload": {
@ -37,7 +37,7 @@
"description": "WordPress admin menu page helper class",
"support": {
"issues": "https://github.com/abuyoyo/AdminMenuPage/issues",
"source": "https://github.com/abuyoyo/AdminMenuPage/tree/0.25"
"source": "https://github.com/abuyoyo/AdminMenuPage/tree/0.26"
},
"install-path": "../abuyoyo/adminmenupage"
},
@ -81,20 +81,20 @@
},
{
"name": "abuyoyo/screen-meta-links",
"version": "0.11",
"version_normalized": "0.11.0.0",
"version": "0.13",
"version_normalized": "0.13.0.0",
"source": {
"type": "git",
"url": "https://github.com/abuyoyo/screen-meta-links.git",
"reference": "04e3c892f0c6095b4c31a489e06336f0917128d3"
"reference": "b324cef9eb5825d04ffa17f771237b7deca5cd01"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/abuyoyo/screen-meta-links/zipball/04e3c892f0c6095b4c31a489e06336f0917128d3",
"reference": "04e3c892f0c6095b4c31a489e06336f0917128d3",
"url": "https://api.github.com/repos/abuyoyo/screen-meta-links/zipball/b324cef9eb5825d04ffa17f771237b7deca5cd01",
"reference": "b324cef9eb5825d04ffa17f771237b7deca5cd01",
"shasum": ""
},
"time": "2022-05-18T01:18:24+00:00",
"time": "2023-08-08T22:37:03+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@ -104,7 +104,7 @@
},
"description": "API for adding custom screen-meta-links alongside the 'Screen Options' and 'Help' links.",
"support": {
"source": "https://github.com/abuyoyo/screen-meta-links/tree/0.11",
"source": "https://github.com/abuyoyo/screen-meta-links/tree/0.13",
"issues": "https://github.com/abuyoyo/screen-meta-links/issues"
},
"install-path": "../abuyoyo/screen-meta-links"

View File

@ -1,7 +1,7 @@
<?php return array(
'root' => array(
'pretty_version' => '0.20',
'version' => '0.20.0.0',
'pretty_version' => '0.21',
'version' => '0.21.0.0',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -11,17 +11,17 @@
),
'versions' => array(
'abuyoyo/adminmenupage' => array(
'pretty_version' => '0.25',
'version' => '0.25.0.0',
'pretty_version' => '0.26',
'version' => '0.26.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../abuyoyo/adminmenupage',
'aliases' => array(),
'reference' => '487d262aec77a9a3ce04fa762e9048f30d22f123',
'reference' => 'f2fcb6d4c8b232ca03cef1908253aed4e5962be8',
'dev_requirement' => false,
),
'abuyoyo/notice-manager' => array(
'pretty_version' => '0.20',
'version' => '0.20.0.0',
'pretty_version' => '0.21',
'version' => '0.21.0.0',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@ -38,12 +38,12 @@
'dev_requirement' => false,
),
'abuyoyo/screen-meta-links' => array(
'pretty_version' => '0.11',
'version' => '0.11.0.0',
'pretty_version' => '0.13',
'version' => '0.13.0.0',
'type' => 'library',
'install_path' => __DIR__ . '/../abuyoyo/screen-meta-links',
'aliases' => array(),
'reference' => '04e3c892f0c6095b4c31a489e06336f0917128d3',
'reference' => 'b324cef9eb5825d04ffa17f771237b7deca5cd01',
'dev_requirement' => false,
),
),