Skip to content

Commit 4b21740

Browse files
committed
version 1.0.2 released
1 parent 4772870 commit 4b21740

File tree

6 files changed

+120
-54
lines changed

6 files changed

+120
-54
lines changed

cbxcareertoolkit.php

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
* @package CBXcareertoolkit
77
*
88
* @wordpress-plugin
9-
* Plugin Name: CBX Career Toolkit
9+
* Plugin Name: CBX Career(Comfort HRM) Toolkit
1010
* Plugin URI: https://github.com/codeboxrcodehub/cbxcareertoolkit/
11-
* Description: Helper plugin for CBX Career plugins
12-
* Version: 1.0.1
11+
* Description: Helper plugin for CBX Career(comfort hrm) plugins
12+
* Version: 1.0.2
1313
* Requires at least: 5.3
1414
* Requires PHP: 8.2
1515
* Author: Codeboxr
@@ -25,25 +25,19 @@
2525
die;
2626
}
2727

28-
defined( 'CBXCAREER_TOOLKIT_PLUGIN_NAME' ) or define( 'CBXCAREER_TOOLKIT_PLUGIN_NAME', 'cbxcareertoolkit' );
29-
defined( 'CBXCAREER_TOOLKIT_PLUGIN_VERSION' ) or define( 'CBXCAREER_TOOLKIT_PLUGIN_VERSION', '1.0.1' );
30-
defined( 'CBXCAREER_TOOLKIT_BASE_NAME' ) or define( 'CBXCAREER_TOOLKIT_BASE_NAME', plugin_basename( __FILE__ ) );
31-
defined( 'CBXCAREER_TOOLKIT_ROOT_PATH' ) or define( 'CBXCAREER_TOOLKIT_ROOT_PATH', plugin_dir_path( __FILE__ ) );
32-
defined( 'CBXCAREER_TOOLKIT_ROOT_URL' ) or define( 'CBXCAREER_TOOLKIT_ROOT_URL', plugin_dir_url( __FILE__ ) );
28+
defined( 'CBXCAREERTOOLKIT_PLUGIN_NAME' ) or define( 'CBXCAREERTOOLKIT_PLUGIN_NAME', 'cbxcareertoolkit' );
29+
defined( 'CBXCAREERTOOLKIT_PLUGIN_VERSION' ) or define( 'CBXCAREERTOOLKIT_PLUGIN_VERSION', '1.0.2' );
30+
defined( 'CBXCAREERTOOLKIT_BASE_NAME' ) or define( 'CBXCAREERTOOLKIT_BASE_NAME', plugin_basename( __FILE__ ) );
31+
defined( 'CBXCAREERTOOLKIT_ROOT_PATH' ) or define( 'CBXCAREERTOOLKIT_ROOT_PATH', plugin_dir_path( __FILE__ ) );
32+
defined( 'CBXCAREERTOOLKIT_ROOT_URL' ) or define( 'CBXCAREERTOOLKIT_ROOT_URL', plugin_dir_url( __FILE__ ) );
3333

3434
defined( 'CBX_DEBUG' ) or define( 'CBX_DEBUG', false );
35-
defined( 'CBXCAREER_TOOLKIT_DEV_MODE' ) or define( 'CBXCAREER_TOOLKIT_DEV_MODE', CBX_DEBUG );
35+
defined( 'CBXCAREERTOOLKIT_DEV_MODE' ) or define( 'CBXCAREERTOOLKIT_DEV_MODE', CBX_DEBUG );
3636

37-
38-
require_once CBXCAREER_TOOLKIT_ROOT_PATH . "lib/autoload.php";
39-
40-
41-
/**
42-
* The code that runs during plugin activation.
43-
*/
44-
function activate_cbx_career_toolkit() {
45-
\Cbx\Careertoolkit\CBXCareertoolkit::activate();
46-
}//end function activate_cbx_career_toolkit
37+
// Include the main ComfortJob class.
38+
if ( ! class_exists( 'CBXCareertoolkit', false ) ) {
39+
include_once CBXCAREERTOOLKIT_ROOT_PATH . 'includes/CBXCareertoolkit.php';
40+
}
4741

4842
/**
4943
* Begins execution of the plugin.
@@ -56,8 +50,8 @@ function activate_cbx_career_toolkit() {
5650
*/
5751
function run_cbxcareer_toolkit() {
5852
// phpcs:ignore WordPress.NamingConventions.ValidFunctionName
59-
return \Cbx\Careertoolkit\CBXCareertoolkit::instance();
53+
return CBXCareertoolkit::instance();
6054
}//end function run_cbxcareer_toolkit
6155

6256

63-
add_action( "plugin_loaded", "run_cbxcareer_toolkit" );
57+
add_action( 'plugin_loaded', 'run_cbxcareer_toolkit' );

includes/CBXCareertoolkit.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?php
22

3-
namespace Cbx\Careertoolkit;
3+
//namespace Cbx\Careertoolkit;
44

5-
class CBXCareertoolkit {
5+
use Cbx\Careertoolkit\Hooks;
6+
7+
final class CBXCareertoolkit {
68

79
/**
810
* The single instance of the class.
@@ -38,10 +40,13 @@ class CBXCareertoolkit {
3840
protected $hooks;
3941

4042
public function __construct() {
41-
$this->plugin_name = CBXCAREER_TOOLKIT_PLUGIN_NAME;
42-
$this->version = CBXCAREER_TOOLKIT_PLUGIN_VERSION;
43+
$this->plugin_name = CBXCAREERTOOLKIT_PLUGIN_NAME;
44+
$this->version = CBXCAREERTOOLKIT_PLUGIN_VERSION;
45+
46+
$this->include_files();
47+
4348
$this->hooks = new Hooks();
44-
}
49+
}//end constructor
4550

4651
/**
4752
* Main cbx devtool Instance.
@@ -58,12 +63,10 @@ public static function instance() {
5863
}
5964

6065
return self::$instance;
61-
}
62-
63-
public static function activate() {
64-
}//end method activate
66+
}//end method instance
6567

66-
public static function deactivate() {
67-
}//end method activate
68+
private function include_files() {
69+
require_once CBXCAREERTOOLKIT_ROOT_PATH . "lib/autoload.php";
70+
}//end method include_files
6871

6972
}//end method CBXCareertoolkit

includes/Helper.php

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Helper {
1515
* @since 1.0.0
1616
*/
1717
public function load_plugin_textdomain() {
18-
load_plugin_textdomain( 'cbxcareertoolkit', false, CBXCAREER_TOOLKIT_ROOT_PATH . 'languages/' );
18+
load_plugin_textdomain( 'cbxcareertoolkit', false, CBXCAREERTOOLKIT_ROOT_PATH . 'languages/' );
1919
}//end method load_plugin_textdomain
2020

2121
/**
@@ -118,4 +118,30 @@ public function plugin_info( $res, $action, $args ) {
118118
];
119119

120120
}//end method plugin_info
121+
122+
/**
123+
* Filters the array of row meta for each/specific plugin in the Plugins list table.
124+
* Appends additional links below each/specific plugin on the plugins page.
125+
*
126+
* @access public
127+
*
128+
* @param array $links_array An array of the plugin's metadata
129+
* @param string $plugin_file_name Path to the plugin file
130+
* @param array $plugin_data An array of plugin data
131+
* @param string $status Status of the plugin
132+
*
133+
* @return array $links_array
134+
*/
135+
public function plugin_row_meta( $links_array, $plugin_file_name, $plugin_data, $status ) {
136+
if ( strpos( $plugin_file_name, CBXCAREERTOOLKIT_BASE_NAME ) !== false ) {
137+
if ( ! function_exists( 'is_plugin_active' ) ) {
138+
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
139+
}
140+
141+
$links_array[] = '<a target="_blank" style="color:#005ae0 !important; font-weight: bold;" href="https://github.com/codeboxrcodehub/cbxcareertoolkit" aria-label="' . esc_attr__( 'Github Repo', 'cbxcareertoolkit' ) . '">' . esc_html__( 'Github Repo', 'cbxcareertoolkit' ) . '</a>';
142+
$links_array[] = '<a target="_blank" style="color:#005ae0 !important; font-weight: bold;" href="https://github.com/codeboxrcodehub/cbxcareertoolkit/releases" aria-label="' . esc_attr__( 'Download', 'cbxcareertoolkit' ) . '">' . esc_html__( 'Download Latest', 'cbxcareertoolkit' ) . '</a>';
143+
}
144+
145+
return $links_array;
146+
}//end plugin_row_meta
121147
}//end class Helper

includes/Hooks.php

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,22 @@
77
use Cbx\Careertoolkit\Factories\Misc\EasyPluginChecker;
88

99
class Hooks {
10-
1110
public function __construct() {
1211
$this->init_commands();
13-
$this->update_checker();
12+
13+
1414

1515
$helper = new Helper();
1616

1717
add_filter( 'init', [ $helper, 'load_plugin_textdomain' ]);
18-
}
18+
add_filter( 'pre_set_site_transient_update_plugins', [
19+
$helper,
20+
'pre_set_site_transient_update_plugins'
21+
] );
22+
add_filter( 'plugins_api', [ $helper, 'plugin_info' ], 10, 3 );
23+
24+
add_filter( 'plugin_row_meta', [ $helper, 'plugin_row_meta' ], 10, 4 );
25+
}//end constructor
1926

2027
public function init_commands() {
2128
if ( class_exists( "WP_CLI" ) ) {
@@ -24,20 +31,4 @@ public function init_commands() {
2431
$epc = new EasyPluginChecker();
2532
}
2633
}//end method init_commands
27-
28-
/**
29-
* Plugin updater hooks
30-
*
31-
* @return void
32-
*/
33-
public function update_checker() {
34-
35-
$helper = new Helper();
36-
37-
add_filter( 'pre_set_site_transient_update_plugins', [
38-
$helper,
39-
'pre_set_site_transient_update_plugins'
40-
] );
41-
add_filter( 'plugins_api', [ $helper, 'plugin_info' ], 10, 3 );
42-
}//end method update_checker
4334
}//end class Hooks

languages/cbxcareertoolkit.pot

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#, fuzzy
2+
msgid ""
3+
msgstr ""
4+
"Project-Id-Version: CBX Career(Comfort HRM) Toolkit\n"
5+
"Report-Msgid-Bugs-To: \n"
6+
"POT-Creation-Date: 2025-04-15 17:38+0000\n"
7+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9+
"Language-Team: \n"
10+
"Language: \n"
11+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
12+
"MIME-Version: 1.0\n"
13+
"Content-Type: text/plain; charset=UTF-8\n"
14+
"Content-Transfer-Encoding: 8bit\n"
15+
"X-Generator: Loco https://localise.biz/\n"
16+
"X-Loco-Version: 2.7.2; wp-6.8\n"
17+
"X-Domain: cbxcareertoolkit"
18+
19+
#. Name of the plugin
20+
msgid "CBX Career(Comfort HRM) Toolkit"
21+
msgstr ""
22+
23+
#. Author of the plugin
24+
msgid "Codeboxr"
25+
msgstr ""
26+
27+
#: includes/Helper.php:142
28+
msgid "Download"
29+
msgstr ""
30+
31+
#: includes/Helper.php:142
32+
msgid "Download Latest"
33+
msgstr ""
34+
35+
#: includes/Helper.php:141
36+
msgid "Github Repo"
37+
msgstr ""
38+
39+
#. Description of the plugin
40+
msgid "Helper plugin for CBX Career(comfort hrm) plugins"
41+
msgstr ""
42+
43+
#. Author URI of the plugin
44+
msgid "https://codeboxr.com"
45+
msgstr ""
46+
47+
#. URI of the plugin
48+
msgid "https://github.com/codeboxrcodehub/cbxcareertoolkit/"
49+
msgstr ""

readme.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
=== CBX Career Toolkit ===
22
Contributors: codeboxr, manchumahara
33
Requires at least: 5.3
4-
Tested up to: 6.7.1
5-
Stable tag: 1.0.1
4+
Tested up to: 6.8
5+
Stable tag: 1.0.2
66
License: MIT
77
License URI: https://github.com/codeboxrcodehub/cbxphpspreadsheet/blob/master/LICENSE.txt
88

@@ -21,6 +21,9 @@ This plugin provides command line interface for creating dummy job, resume and o
2121

2222

2323
== Changelog ==
24+
= 1.0.2 =
25+
* [updated] Plugin update checker added
26+
2427
= 1.0.1 =
2528
* Add new command 'easy-plugin-checker' that extends the plugin Plugin Check and outputs in a file
2629

0 commit comments

Comments
 (0)