Skip to content

Commit d15b6f9

Browse files
committed
changelog 2.0.1
1 parent 2088a64 commit d15b6f9

18 files changed

+906
-476
lines changed

.github/workflows/deploy.yml

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,56 @@
11
name: Deploy to WordPress.org
2+
23
on:
34
push:
45
tags:
5-
- "*"
6+
- "*"
7+
68
jobs:
79
tag:
810
name: New tag
911
runs-on: ubuntu-latest
1012
steps:
11-
- uses: actions/checkout@master
12-
#- name: Build # Remove or modify this step as needed
13-
# run: |
14-
# npm install
15-
# npm run build
16-
- name: Install SVN ( Subversion )
17-
run: |
18-
sudo apt-get update
19-
sudo apt-get install subversion
20-
- name: WordPress Plugin Deploy
21-
id: deploy
22-
uses: 10up/action-wordpress-plugin-deploy@stable
23-
with:
24-
generate-zip: true
25-
env:
26-
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
27-
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
28-
#SLUG: my-super-cool-plugin # optional, remove if GitHub repo name matches SVN slug, including capitalization
29-
- name: Create GitHub release
30-
uses: softprops/action-gh-release@v1
31-
with:
32-
files: ${{github.workspace}}/${{ github.event.repository.name }}.zip
33-
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
- uses: actions/checkout@v3
14+
- name: Install SVN (Subversion)
15+
run: |
16+
sudo apt-get update
17+
sudo apt-get install subversion
18+
19+
- name: WordPress Plugin Deploy
20+
id: deploy
21+
uses: 10up/action-wordpress-plugin-deploy@stable
22+
with:
23+
generate-zip: true
24+
25+
- name: Find Readme File
26+
id: find_readme
27+
run: |
28+
for file in README.txt README.md Readme.txt Readme.md readme.txt readme.md; do
29+
if [ -f "$file" ]; then
30+
echo "::set-output name=readme_file::$file"
31+
break
32+
fi
33+
done
34+
35+
- name: Extract Release Notes
36+
id: release_notes
37+
run: |
38+
if [[ -z "${{ steps.find_readme.outputs.readme_file }}" ]]; then
39+
echo "::error::Readme file not found."
40+
exit 1
41+
fi
42+
43+
release_notes=$(grep '== Changelog ===' "${{ steps.find_readme.outputs.readme_file }}" | head -n -1 | tail -n +2)
44+
echo "::set-output name=notes::$release_notes"
45+
46+
- name: Create GitHub Release
47+
uses: softprops/action-gh-release@v2
48+
with:
49+
tag_name: ${{ github.ref_name }}
50+
body: ${{ steps.release_notes.outputs.notes }}
51+
files: ${{github.workspace}}/${{ github.event.repository.name }}.zip
52+
53+
env:
54+
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
55+
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: codeboxr, manchumahara
33
Tags: changelog,history,release,version,product log
44
Requires at least: 5.3
55
Tested up to: 6.7.1
6-
Stable tag: 2.0.0
6+
Stable tag: 2.0.1
77
Requires PHP: 7.4
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -51,6 +51,7 @@ This helps to write changes log for any digital products, projects releases. Any
5151
* All Setting Export/Import (From 1.1.1)
5252
* Single Setting tab Export/Import (From 1.1.1)
5353
* Reset Setting tab (From 1.1.1)
54+
* Import wordpress readme file (From 1.1.7)
5455

5556

5657
== Installation ==
@@ -73,6 +74,12 @@ This helps to write changes log for any digital products, projects releases. Any
7374

7475

7576
== Changelog ==
77+
= 2.0.1 =
78+
* [fixed] Fixed function missing error for method 'getPaginatedRows'
79+
* [new] Show labels by group feature added
80+
* [updated] All type widgets updated
81+
* [improvement] Added some new helper methods
82+
7683
= 2.0.0 =
7784
* [fixed] Fixed saving only single changelog from dashboard edit screen
7885
* [new] Added new feature to resync release no/id with dashboard edit screen display index(from top to bottom)

cbxchangelog.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Plugin Name: CBX Changelog
1717
* Plugin URI: http://codeboxr.com/product/cbx-changelog-for-wordpress/
1818
* Description: Easy change log manager for WordPress, use for any product post type or releases notes
19-
* Version: 2.0.0
19+
* Version: 2.0.1
2020
* Author: Codeboxr
2121
* Author URI: http://codeboxr.com
2222
* License: GPL-2.0+
@@ -32,7 +32,7 @@
3232

3333

3434
defined( 'CBXCHANGELOG_PLUGIN_NAME' ) or define( 'CBXCHANGELOG_PLUGIN_NAME', 'cbxchangelog' );
35-
defined( 'CBXCHANGELOG_PLUGIN_VERSION' ) or define( 'CBXCHANGELOG_PLUGIN_VERSION', '2.0.0' );
35+
defined( 'CBXCHANGELOG_PLUGIN_VERSION' ) or define( 'CBXCHANGELOG_PLUGIN_VERSION', '2.0.1' );
3636
defined( 'CBXCHANGELOG_ROOT_PATH' ) or define( 'CBXCHANGELOG_ROOT_PATH', plugin_dir_path( __FILE__ ) );
3737
defined( 'CBXCHANGELOG_ROOT_URL' ) or define( 'CBXCHANGELOG_ROOT_URL', plugin_dir_url( __FILE__ ) );
3838
defined( 'CBXCHANGELOG_BASE_NAME' ) or define( 'CBXCHANGELOG_BASE_NAME', plugin_basename( __FILE__ ) );

includes/CBXChangelogAdmin.php

Lines changed: 53 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ class CBXChangelogAdmin {
4848
private $version;
4949

5050

51-
private $settings_api;
51+
private $settings;
5252
protected $plugin_basename;
5353

5454
/**
5555
* Initialize the class and set its properties.
5656
*
57-
* @param string $plugin_name The name of this plugin.
58-
* @param string $version The version of this plugin.
57+
* @param string $plugin_name The name of this plugin.
58+
* @param string $version The version of this plugin.
5959
*
6060
* @since 1.0.0
6161
*
@@ -71,18 +71,18 @@ public function __construct( $plugin_name, $version ) {
7171
$this->plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . $plugin_name . '.php' );
7272

7373
//get instance of setting api
74-
$this->settings_api = new CBXChangelogSettings();
74+
$this->settings = new CBXChangelogSettings();
7575
}//end of constructor
7676

7777
/**
7878
* settings
7979
*/
8080
public function setting_init() {
8181
//set the settings
82-
$this->settings_api->set_sections( $this->get_settings_sections() );
83-
$this->settings_api->set_fields( $this->get_settings_fields() );
82+
$this->settings->set_sections( $this->get_settings_sections() );
83+
$this->settings->set_fields( $this->get_settings_fields() );
8484
//initialize settings
85-
$this->settings_api->admin_init();
85+
$this->settings->admin_init();
8686
}//end setting_init
8787

8888
/**
@@ -109,7 +109,7 @@ public function get_settings_fields() {
109109
* @since 3.7.0
110110
*/
111111
public function init_post_types() {
112-
//$setting = $this->settings_api;
112+
//$setting = $this->settings;
113113

114114
$post_type = 'cbxchangelog';
115115
$post_slug = 'cbxchangelog';
@@ -182,7 +182,7 @@ public function menu_settings() {
182182
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
183183
echo cbxchangelog_get_template_html( 'admin/settings.php', [
184184
'admin_ref' => $this,
185-
'settings' => $this->settings_api
185+
'settings' => $this->settings
186186
] );
187187
}//end menu_settings
188188

@@ -235,7 +235,7 @@ public function changelog_metabox_display( $post ) {
235235
echo cbxchangelog_get_template_html( 'admin/metabox_changelogs.php',
236236
[
237237
'admin_ref' => $this,
238-
'settings' => $this->settings_api,
238+
'settings' => $this->settings,
239239
'post_id' => $post_id,
240240
'post_type' => $post_type,
241241
'post' => $post,
@@ -258,7 +258,7 @@ public function shortcode_metabox_display( $post ) {
258258
echo cbxchangelog_get_template_html( 'admin/metabox_shortcode.php',
259259
[
260260
'admin_ref' => $this,
261-
'settings' => $this->settings_api,
261+
'settings' => $this->settings,
262262
'post_id' => $post_id,
263263
'post_type' => $post_type,
264264
]
@@ -409,10 +409,11 @@ public function metabox_save( $post_id, $post, $update ) {
409409
if ( isset( $_POST['cbxchangelog_extra'] ) && is_array( $_POST['cbxchangelog_extra'] ) && sizeof( $_POST['cbxchangelog_extra'] ) > 0 ) {
410410
$extras = isset( $_POST['cbxchangelog_extra'] ) ? wp_unslash( $_POST['cbxchangelog_extra'] ) : []; //phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
411411

412-
$extras['show_url'] = isset( $extras['show_url'] ) ? intval( $extras['show_url'] ) : 1;
413-
$extras['show_label'] = isset( $extras['show_label'] ) ? intval( $extras['show_label'] ) : 1;
414-
$extras['show_date'] = isset( $extras['show_date'] ) ? intval( $extras['show_date'] ) : 1;
415-
$extras['relative_date'] = isset( $extras['relative_date'] ) ? intval( $extras['relative_date'] ) : 0;
412+
$extras['show_url'] = isset( $extras['show_url'] ) ? absint( $extras['show_url'] ) : 1;
413+
$extras['show_label'] = isset( $extras['show_label'] ) ? absint( $extras['show_label'] ) : 1;
414+
$extras['group_label'] = isset( $extras['group_label'] ) ? absint( $extras['group_label'] ) : 0;
415+
$extras['show_date'] = isset( $extras['show_date'] ) ? absint( $extras['show_date'] ) : 1;
416+
$extras['relative_date'] = isset( $extras['relative_date'] ) ? absint( $extras['relative_date'] ) : 0;
416417
$extras['layout'] = isset( $extras['layout'] ) ? sanitize_text_field( wp_unslash( $extras['layout'] ) ) : 'prepros';
417418
$extras['order'] = isset( $extras['order'] ) ? sanitize_text_field( wp_unslash( $extras['order'] ) ) : 'desc';
418419
$extras['orderby'] = isset( $extras['orderby'] ) ? sanitize_text_field( wp_unslash( $extras['orderby'] ) ) : 'order'; //'order' == 'default'
@@ -634,23 +635,23 @@ public function enqueue_scripts( $hook ) {
634635

635636
wp_localize_script( 'cbxchangelog-edit', 'cbxchangelog_edit', apply_filters( 'cbxchangelog_edit_localize_script',
636637
[
637-
'deleteconfirm' => esc_html__( 'Are you sure?', 'cbxchangelog' ),
638-
'deleteconfirm_desc' => esc_html__( 'Are you sure to delete this item?', 'cbxchangelog' ),
639-
'deleteconfirm_all_releases' => esc_html__( 'Note: This process can not be undone. This process is going to delete all releases for this post/article. When done this window will reload.', 'cbxchangelog' ),
640-
'deleteconfirmok' => esc_html__( 'Sure', 'cbxchangelog' ),
641-
'deleteconfirmcancel' => esc_html__( 'Oh! No', 'cbxchangelog' ),
642-
'deletelastitem' => esc_html__( 'This only feature can not be deleted. Either edit or delete the total release.', 'cbxchangelog' ),
643-
'copycmds' => [
638+
'deleteconfirm' => esc_html__( 'Are you sure?', 'cbxchangelog' ),
639+
'deleteconfirm_desc' => esc_html__( 'Are you sure to delete this item?', 'cbxchangelog' ),
640+
'deleteconfirm_all_releases' => esc_html__( 'Note: This process can not be undone. This process is going to delete all releases for this post/article. When done this window will reload.', 'cbxchangelog' ),
641+
'deleteconfirmok' => esc_html__( 'Sure', 'cbxchangelog' ),
642+
'deleteconfirmcancel' => esc_html__( 'Oh! No', 'cbxchangelog' ),
643+
'deletelastitem' => esc_html__( 'This only feature can not be deleted. Either edit or delete the total release.', 'cbxchangelog' ),
644+
'copycmds' => [
644645
'copy' => esc_html__( 'Copy', 'cbxchangelog' ),
645646
'copied' => esc_html__( 'Copied', 'cbxchangelog' ),
646647
'copy_tip' => esc_html__( 'Click to copy', 'cbxchangelog' ),
647648
'copied_tip' => esc_html__( 'Copied to clipboard', 'cbxchangelog' ),
648649
],
649-
'placeholder' => [
650+
'placeholder' => [
650651
'select' => esc_html__( 'Please Select', 'cbxchangelog' ),
651652
'search' => esc_html__( 'Search...', 'cbxchangelog' ),
652653
],
653-
'pickr_i18n' => [
654+
'pickr_i18n' => [
654655
// Strings visible in the UI
655656
'ui:dialog' => esc_html__( 'color picker dialog', 'cbxchangelog' ),
656657
'btn:toggle' => esc_html__( 'toggle color picker dialog', 'cbxchangelog' ),
@@ -669,7 +670,7 @@ public function enqueue_scripts( $hook ) {
669670
'aria:hue' => esc_html__( 'hue selection slider', 'cbxchangelog' ),
670671
'aria:opacity' => esc_html__( 'selection slider', 'cbxchangelog' ),
671672
],
672-
'awn_options' => [
673+
'awn_options' => [
673674
'tip' => esc_html__( 'Tip', 'cbxchangelog' ),
674675
'info' => esc_html__( 'Info', 'cbxchangelog' ),
675676
'success' => esc_html__( 'Success', 'cbxchangelog' ),
@@ -680,7 +681,7 @@ public function enqueue_scripts( $hook ) {
680681
'confirmOk' => esc_html__( 'OK', 'cbxchangelog' ),
681682
'confirmCancel' => esc_html__( 'Cancel', 'cbxchangelog' )
682683
],
683-
'validation' => [
684+
'validation' => [
684685
'required' => esc_html__( 'This field is required.', 'cbxchangelog' ),
685686
'remote' => esc_html__( 'Please fix this field.', 'cbxchangelog' ),
686687
'email' => esc_html__( 'Please enter a valid email address.', 'cbxchangelog' ),
@@ -698,12 +699,12 @@ public function enqueue_scripts( $hook ) {
698699
'min' => esc_html__( 'Please enter a value greater than or equal to {0}.', 'cbxchangelog' ),
699700
'recaptcha' => esc_html__( 'Please check the captcha.', 'cbxchangelog' ),
700701
],
701-
'lang' => get_user_locale(),
702+
'lang' => get_user_locale(),
702703
//'import_modal' => $import_modal_html,
703704
//'import_modal_progress' => '<p>' . esc_html__( 'Please wait, importing', 'cbxchangelog' ) . '</p>',
704-
'nonce' => wp_create_nonce( 'cbxchangelog_nonce' ),
705-
'ajaxurl' => admin_url( 'admin-ajax.php' ),
706-
'resync' => [
705+
'nonce' => wp_create_nonce( 'cbxchangelog_nonce' ),
706+
'ajaxurl' => admin_url( 'admin-ajax.php' ),
707+
'resync' => [
707708
'confirm' => esc_html__( 'Are you sure to resync?', 'cbxchangelog' ),
708709
'confirm_desc' => esc_html__( 'Note: This process can not be undone. Resync(top to bottom) will resync release no/ID with changelog index as seen in admin edit screen. First item id will be 1, 2nd will be 2 and so on. When done, this screen will reload.', 'cbxchangelog' ),
709710
'confirm_desc_alt' => esc_html__( 'Note: This process can not be undone. Resync(bottom to top) will resync release no/ID with changelog index as seen in admin edit screen. Last item id will be 1, 2nd from last will be 2 and so on. When done, this screen will reload.', 'cbxchangelog' ),
@@ -827,7 +828,7 @@ public function enqueue_scripts( $hook ) {
827828
/**
828829
* Show action links on the plugin screen.
829830
*
830-
* @param mixed $links Plugin Action links.
831+
* @param mixed $links Plugin Action links.
831832
*
832833
* @return array
833834
*/
@@ -845,10 +846,10 @@ public function plugin_action_links( $links ) {
845846
*
846847
* @access public
847848
*
848-
* @param array $links_array An array of the plugin's metadata
849-
* @param string $plugin_file_name Path to the plugin file
850-
* @param array $plugin_data An array of plugin data
851-
* @param string $status Status of the plugin
849+
* @param array $links_array An array of the plugin's metadata
850+
* @param string $plugin_file_name Path to the plugin file
851+
* @param array $plugin_data An array of plugin data
852+
* @param string $status Status of the plugin
852853
*
853854
* @return array $links_array
854855
*/
@@ -977,7 +978,7 @@ public function custom_message_after_plugin_row_proaddon( $plugin_file, $plugin_
977978
}
978979

979980
$pro_addon_version = CBXChangelogHelper::get_any_plugin_version( 'cbxchangelogpro/cbxchangelogpro.php' );
980-
$pro_latest_version = '1.1.6';
981+
$pro_latest_version = '1.1.7';
981982

982983

983984
if ( $pro_addon_version != '' && version_compare( $pro_addon_version, $pro_latest_version, '<' ) ) {
@@ -1016,7 +1017,6 @@ public function plugin_activate_upgrade_notices() {
10161017

10171018
// Check the transient to see if we've just activated the plugin
10181019
if ( get_transient( 'cbxchangelog_activated_notice' ) ) {
1019-
10201020
echo '<div class="notice notice-success is-dismissible" style="border-color: #2153cc !important;">';
10211021

10221022
/* translators: 1. Plugin version */
@@ -1160,17 +1160,19 @@ public function init_changelog_shortcode_block() {
11601160
$vendors_path_part = CBXCHANGELOG_ROOT_PATH . 'assets/vendors/';
11611161

11621162

1163-
$setting = $this->settings_api;
1164-
$show_label_default = intval( $setting->get_field( 'show_label', 'cbxchangelog_general', 1 ) );
1165-
$show_date_default = intval( $setting->get_field( 'show_date', 'cbxchangelog_general', 1 ) );
1166-
$show_url_default = intval( $setting->get_field( 'show_url', 'cbxchangelog_general', 1 ) );
1167-
$relative_date_default = intval( $setting->get_field( 'relative_date', 'cbxchangelog_general', 0 ) );
1163+
$setting = $this->settings;
1164+
$show_label_default = absint( $setting->get_field( 'show_label', 'cbxchangelog_general', 1 ) );
1165+
$show_date_default = absint( $setting->get_field( 'show_date', 'cbxchangelog_general', 1 ) );
1166+
$show_url_default = absint( $setting->get_field( 'show_url', 'cbxchangelog_general', 1 ) );
1167+
$group_label_default = absint( $setting->get_field( 'group_label', 'cbxchangelog_general', 0 ) );
1168+
$relative_date_default = absint( $setting->get_field( 'relative_date', 'cbxchangelog_general', 0 ) );
11681169

11691170
$layout = $setting->get_field( 'layout', 'cbxchangelog_general', 'prepros' );
11701171

11711172
$show_label_default = ( $show_label_default ) ? 'true' : '';
11721173
$show_date_default = ( $show_date_default ) ? 'true' : '';
11731174
$show_url_default = ( $show_url_default ) ? 'true' : '';
1175+
$group_label_default = ( $group_label_default ) ? 'true' : '';
11741176
$relative_date_default = ( $relative_date_default ) ? 'true' : '';
11751177

11761178
$order_options = [];
@@ -1264,6 +1266,7 @@ public function init_changelog_shortcode_block() {
12641266
'show_label' => esc_html__( 'Show Label', 'cbxchangelog' ),
12651267
'show_date' => esc_html__( 'Show Date', 'cbxchangelog' ),
12661268
'show_url' => esc_html__( 'Show Url', 'cbxchangelog' ),
1269+
'group_label' => esc_html__( 'Group Label', 'cbxchangelog' ),
12671270
'relative_date' => esc_html__( 'Show Relative Date', 'cbxchangelog' ),
12681271
'layout' => esc_html__( 'Choose layout', 'cbxchangelog' ),
12691272
'layout_options' => $layout_options,
@@ -1309,6 +1312,10 @@ public function init_changelog_shortcode_block() {
13091312
'type' => 'string',
13101313
'default' => $show_url_default,
13111314
],
1315+
'group_label' => [
1316+
'type' => 'string',
1317+
'default' => $group_label_default,
1318+
],
13121319
'relative_date' => [
13131320
'type' => 'string',
13141321
'default' => $relative_date_default,
@@ -1364,6 +1371,10 @@ public function cbxchangelog_block_render( $attr ) {
13641371
//$params['show_url'] = ( $params['show_url'] == 'true' ) ? 1 : 0;
13651372
$params['show_url'] = CBXChangelogHelper::block_editor_true_meta_empty( $params['show_url'] );
13661373

1374+
$params['group_label'] = isset( $attr['group_label'] ) ? $attr['group_label'] : 'true';
1375+
//$params['group_label'] = ( $params['group_label'] == 'true' ) ? 1 : 0;
1376+
$params['group_label'] = CBXChangelogHelper::block_editor_true_meta_empty( $params['group_label'] );
1377+
13671378
$params['relative_date'] = isset( $attr['relative_date'] ) ? $attr['relative_date'] : 'true';
13681379
//$params['relative_date'] = ( $params['relative_date'] == 'true' ) ? 1 : 0;
13691380
$params['relative_date'] = CBXChangelogHelper::block_editor_true_meta_empty( $params['relative_date'] );

0 commit comments

Comments
 (0)