Skip to content

Commit c58f053

Browse files
committed
version 1.0.1 released
1 parent 0246b15 commit c58f053

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+24684
-392
lines changed

.distignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/.wordpress-org
2+
/.git
3+
/.github
4+
/node_modules
5+
6+
.distignore
7+
.gitignore
8+
.gitattributes

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Directories
2+
/.wordpress-org export-ignore
3+
/.github export-ignore
4+
5+
# Files
6+
/.gitattributes export-ignore
7+
/.gitignore export-ignore

.github/workflows/deploy.yml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*' # Match semantic versioning tags
7+
# Removed branches trigger to ensure it only runs on tags
8+
# branches:
9+
# - master
10+
11+
jobs:
12+
create_release:
13+
# No need to check against branches, workflow only triggers on tags
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Find Readme File
21+
id: find_readme
22+
run: |
23+
for file in readme.txt Readme.txt README.txt README.md Readme.md readme.md; do
24+
if [ -f "$file" ]; then
25+
echo "Readme file found: $file"
26+
echo "readme_file=$file" >> $GITHUB_ENV
27+
break
28+
fi
29+
done
30+
31+
# Ensure the variable is available within the current step
32+
source $GITHUB_ENV
33+
34+
if [ -z "$readme_file" ]; then
35+
echo "::error::Readme file not found."
36+
exit 1
37+
fi
38+
39+
- name: Extract Release Notes
40+
id: release_notes
41+
run: |
42+
changelog_section_start="== Changelog =="
43+
readme_file="$readme_file"
44+
45+
# Extract the tag name from GITHUB_REF (plugin_version)
46+
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
47+
plugin_version="${GITHUB_REF#refs/tags/}"
48+
echo "DEBUG: Plugin latest version found: $plugin_version."
49+
else
50+
echo "::error::This workflow must be triggered by a tag push."
51+
exit 1
52+
fi
53+
54+
in_changelog=0
55+
found_version=0
56+
release_notes=""
57+
58+
echo "DEBUG: Starting to extract release notes from $readme_file for version $plugin_version."
59+
60+
while IFS= read -r line; do
61+
echo "DEBUG: Processing line: $line"
62+
63+
# Start processing after the changelog header
64+
if [[ "$line" == "$changelog_section_start" ]]; then
65+
in_changelog=1
66+
echo "DEBUG: Found changelog section header."
67+
continue
68+
fi
69+
70+
# Skip if not in changelog section
71+
if [[ $in_changelog -eq 0 ]]; then
72+
echo "DEBUG: Skipping line (not in changelog section)."
73+
continue
74+
fi
75+
76+
# Check for the current version header
77+
if [[ "$line" == "= ${plugin_version} =" ]]; then
78+
found_version=1
79+
echo "DEBUG: Found version header for $plugin_version."
80+
continue
81+
fi
82+
83+
# Break if a new version header is found after the current version
84+
if [[ $found_version -eq 1 ]] && echo "$line" | grep -qE '^= [0-9]+\.[0-9]+\.[0-9]+ =$'; then
85+
echo "DEBUG: Found a new version header. Stopping collection."
86+
break
87+
fi
88+
89+
# Collect lines starting with '*' if we are in the current version section
90+
if [[ $found_version -eq 1 ]] && echo "$line" | grep -qE '^\*'; then
91+
echo "DEBUG: Found changelog entry: $line"
92+
release_notes+="${line}\n"
93+
continue
94+
fi
95+
96+
# Log skipped lines in the current version section
97+
if [[ $found_version -eq 1 ]]; then
98+
echo "DEBUG: Skipping line (not a changelog entry): $line"
99+
fi
100+
done < "$readme_file"
101+
102+
if [[ -z "$release_notes" ]]; then
103+
echo "::error::Failed to extract release notes for version ${plugin_version}."
104+
exit 1
105+
fi
106+
107+
echo "DEBUG: Successfully extracted release notes."
108+
echo "DEBUG: Release notes content:"
109+
echo -e "$release_notes"
110+
111+
# Write the release notes with actual line breaks
112+
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
113+
echo -e "$release_notes" >> $GITHUB_ENV
114+
echo "EOF" >> $GITHUB_ENV
115+
116+
- name: Create zip file
117+
run: |
118+
REPO_NAME=$(basename `git rev-parse --show-toplevel`)
119+
zip -r ${REPO_NAME}.zip . -x '*.git*' -x '.github/*' -x '*.distignore*' -x 'CHANGELOG.txt'
120+
echo "repo_name=${REPO_NAME}" >> $GITHUB_ENV
121+
122+
# Source to make repo_name available in subsequent steps
123+
source $GITHUB_ENV
124+
125+
- name: Create Release
126+
id: create_release
127+
uses: actions/create-release@v1
128+
env:
129+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130+
with:
131+
tag_name: ${{ github.ref_name }}
132+
release_name: "${{ github.ref_name }}"
133+
body: ${{ env.RELEASE_NOTES }}
134+
draft: false
135+
prerelease: false
136+
137+
- name: Upload Release Asset
138+
uses: actions/upload-release-asset@v1
139+
env:
140+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141+
with:
142+
upload_url: ${{ steps.create_release.outputs.upload_url }}
143+
asset_path: ./${{ env.repo_name }}.zip
144+
asset_name: ${{ env.repo_name }}.zip
145+
asset_content_type: application/zip

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
script.sh

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Open source Taxonomy plugin
1+
WordPress helper plugin for creating custom taxonomy (category, tag) inside WordPress
22

33
## Description
44
Open source plugin for creating category and tag. In this plugin we have used custom table for creating the categories and tags so that it uses less resource.
@@ -7,7 +7,7 @@ Software requirements
77

88
The following software is required to develop using CBXTaxonomy:
99

10-
* PHP version 7.4 or newer
10+
* PHP version 8.2 or newer
1111

1212

1313
## Installation

README.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
=== CBX Taxonomy Library ===
1+
=== CBX Taxonomy ===
22
Contributors: codeboxr, manchumahara
3-
Requires at least: 3.5
4-
Tested up to: 6.4.3
5-
Stable tag: 1.0.5
3+
Requires at least: 5.3
4+
Tested up to: 6.7.2
5+
Stable tag: 1.0.1
66
License: MIT
77
License URI: https://github.com/codeboxrcodehub/cbxwptaxonomy/blob/master/LICENSE.txt
88

9-
Open source Taxonomy plugin
9+
WordPress helper plugin for creating custom taxonomy (category, tag) inside WordPress
1010

1111
== Description ==
1212

@@ -16,7 +16,7 @@ Software requirements
1616

1717
The following software is required to develop using CBXTaxonomy:
1818

19-
* PHP version 7.4 or newer
19+
* PHP version 8.2 or newer
2020

2121

2222

cbxtaxonomy.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
* @wordpress-plugin
1616
* Plugin Name: CBX Taxonomy
1717
* Plugin URI: https://wordpress.org/plugins/cbxtaxonomy
18-
* Description: Custom taxonomy system for custom table/custom object types. This feature plugin is required for ComfortResume, ComfortJob and others codeboxr's plugins.
19-
* Version: 1.0.0
20-
* Requires at least: 3.5
18+
* Description: Custom taxonomy system for custom table/custom object types. This feature plugin is required for ComfortResume, ComfortJob and others plugins.
19+
* Version: 1.0.1
20+
* Requires at least: 5.3
2121
* Requires PHP: 8.2
2222
* Author: Codeboxr
2323
* Author URI: https://codeboxr.com
2424
* License: GPL-2.0+
2525
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
26-
* Text Domain: cbxtaxonomy
26+
* Text Domain: cbxwptaxonomy
2727
* Domain Path: /languages
2828
*/
2929

@@ -35,18 +35,19 @@
3535
use Cbx\Taxonomy\CBXTaxonomyHelper;
3636

3737
defined( 'CBXTAXONOMY_PLUGIN_NAME' ) or define( 'CBXTAXONOMY_PLUGIN_NAME', 'cbxtaxonomy' );
38-
defined( 'CBXTAXONOMY_PLUGIN_VERSION' ) or define( 'CBXTAXONOMY_PLUGIN_VERSION', '1.0.0' );
38+
defined( 'CBXTAXONOMY_PLUGIN_VERSION' ) or define( 'CBXTAXONOMY_PLUGIN_VERSION', '1.0.1' );
3939
defined( 'CBXTAXONOMY_BASE_NAME' ) or define( 'CBXTAXONOMY_BASE_NAME', plugin_basename( __FILE__ ) );
4040
defined( 'CBXTAXONOMY_ROOT_PATH' ) or define( 'CBXTAXONOMY_ROOT_PATH', plugin_dir_path( __FILE__ ) );
4141
defined( 'CBXTAXONOMY_ROOT_URL' ) or define( 'CBXTAXONOMY_ROOT_URL', plugin_dir_url( __FILE__ ) );
42+
43+
//for development purpose only
4244
defined( 'CBXTAXONOMY_DEV_MODE' ) or define( 'CBXTAXONOMY_DEV_MODE', true );
4345

44-
// Include the main ComfortResume class.
46+
// Include the main CBXTaxonomy class.
4547
if ( ! class_exists( 'CBXTaxonomy', false ) ) {
4648
include_once CBXTAXONOMY_ROOT_PATH . 'includes/CBXTaxonomy.php';
4749
}
4850

49-
//require_once CBXTAXONOMY_ROOT_PATH . "lib/autoload.php";
5051

5152
register_activation_hook( __FILE__, 'activate_cbxtaxonomy' );
5253
register_deactivation_hook( __FILE__, 'deactivate_cbxtaxonomy' );
@@ -60,16 +61,15 @@ function activate_cbxtaxonomy() {
6061

6162
CBXTaxonomyHelper::load_orm();
6263
CBXTaxonomyHelper::active_plugin();
63-
}
64+
}//end function activate_cbxtaxonomy
6465

6566
/**
6667
* The code that runs during plugin deactivation.
6768
*/
6869
function deactivate_cbxtaxonomy() {
69-
cbxtaxonomy();
70-
71-
CBXTaxonomyHelper::load_orm();
72-
}
70+
//cbxtaxonomy();
71+
//CBXTaxonomyHelper::load_orm();
72+
}//end function deactivate_cbxtaxonomy
7373

7474

7575
/**

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cbx/taxonomy",
3-
"description": "cbx taxonomy plugin",
3+
"description": "WordPress Custom Taxonomy Plugin",
44
"type": "library",
55
"license": "MIT",
66
"config": {

0 commit comments

Comments
 (0)