Skip to content

Commit

Permalink
Merge pull request #1 from codeboxrcodehub/dev
Browse files Browse the repository at this point in the history
merge to master
  • Loading branch information
deepakdeb authored Mar 13, 2024
2 parents e7f9f69 + c8edf61 commit 35ee513
Show file tree
Hide file tree
Showing 536 changed files with 175,419 additions and 49,163 deletions.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 PhpSpreadsheet Authors

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.
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
CBX Career Dev Toolkit

## Description

This plugin provides command line interface for creating dummy job and resume.

## Installation

1. Download the latest zip from [here](https://github.com/codeboxrcodehub/cbxcareertoolkit/releases)
2. WordPress has clear documentation about [how to install a plugin.](https://codex.wordpress.org/Managing_Plugins)
3. After install activate the plugin "CBX Career Dev Toolkit Library" through the 'Plugins' menu in WordPress
4. This plugin doesn't load any library by default, it doesn't create extra folder or menu.

# How to use:

## cbxjob

### All possible default params:

```
wp cbxjob-generate --total=100 --status=publish --is-remote=0 --is-featured=1 --is-filled=0 --user-id=1 --salary-unit=monthly --currency=USD
```

total = number of jobs to be created.

status options = [draft , pending , publish,unpublished,flag ]

is-remote = [0,1]

is-featured= [0,1]

is-filled= [0,1]

currency=[USD,BDT, etc]

salary-unit =[yearly,monthly,yearly,daily]

user-id = user ID

## cbxresume

### All possible default params:

```
wp cbxjresume-generate --total=100 --user-id=1 --status=1 --privacy=public --is-primary=1
```

total = number of resume to be created.

user-id= system user id

status = [0=draft, 1=publish, 2=unpublished, 3=pending, 4=flag]

privacy= [public,private]

is-primary= [0,1]

## Licence

[MIT](https://github.com/codeboxrcodehub/cbxcareertoolkit/blob/master/LICENSE.txt)
72 changes: 72 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
=== CBX Career Toolkit Library ===
Contributors: codeboxr, manchumahara
Requires at least: 3.5
Tested up to: 6.4.3
Stable tag: 1.0.0
License: MIT
License URI: https://github.com/codeboxrcodehub/cbxcareertoolkit/blob/master/LICENSE.txt

Open source PhpSpreadSheet php library released as wordpress plugin to use easily

== Description ==

A pure [PHP library for reading and writing spreadsheet files](https://phpspreadsheet.readthedocs.io)

From Codeboxr we wrapped the library as wordpress plugin to easy distribute as wordpress plugin. WordPress now doesn't allow this type library as
plugin but providing a large php package with plugin makes the plugin heavy and troublesome for updates. We hosted this in github so that user can download and later
update easily.

Software requirements

The following software is required to develop using PhpSpreadsheet:

* PHP version 7.4 or newer
* PHP extension php_zip enabled
* PHP extension php_xml enabled
* PHP extension php_gd2 enabled (if not compiled in)


The plugin check php version, php_zip, php_xml and php_gd2 library compatible or installed or not, based on success it activated.

How to use:

`
if ( defined('CBXPHPSPREADSHEET_PLUGIN_NAME') && file_exists( CBXPHPSPREADSHEET_ROOT_PATH . 'lib/vendor/autoload.php' ) ) {
//Include PHPExcel
require_once( CBXPHPSPREADSHEET_ROOT_PATH . 'lib/vendor/autoload.php' );

//now take instance
$objPHPExcel = new \PhpOffice\PhpSpreadsheet\Spreadsheet();

//do whatever you need to do
}
`

== Installation ==

1. Download the latest zip from here (https://github.com/codeboxrcodehub/cbxcareertoolkit/releases)
2. [WordPress has clear documentation about how to install a plugin].(https://codex.wordpress.org/Managing_Plugins)
3. After install activate the plugin "CBX PhpSpreadSheet Library" through the 'Plugins' menu in WordPress
4. This plugin doesn't load any library by default, it doesn't create extra folder or menu.


== Changelog ==

= 1.0.5 =
* Dependency vendor packages updated to latest
* Github.com based updater

= 1.0.4 =
* Updated the phpspreadsheet package to latest V1.29.0

= 1.0.3 =
* Updated the phpspreadsheet package to latest V1.21.0

= 1.0.2 =
* Updated the phpspreadsheet package to latest V1.21.0

= 1.0.1 =
* Updated the phpspreadsheet package to latest

= 1.0.0 =
* First public release
48 changes: 18 additions & 30 deletions cbxcareertoolkit.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?php


/**
*
* @link https://codeboxr.com
* @since 1.0.0
* @package CBXcareertoolkit
*
* @wordpress-plugin
* Plugin Name: CBX career Toolkit
* Plugin Name: CBX Career Toolkit
* Plugin URI: https://github.com/codeboxrcodehub/cbxcareertoolkit/
* Description: Making Test Case For Development!
* Description: Helper plugin for CBX Career plugins
* Version: 1.0.0
* Requires at least: 3.7
* Requires PHP: 7.4
* Author: Codeboxr
* Author URI: https://codeboxr.com
* License: GPL-2.0+
Expand All @@ -21,41 +22,29 @@
*/

// If this file is called directly, abort.
if (!defined('WPINC')) {
if ( ! defined( 'WPINC' ) ) {
die;
}

defined('CBXCAREER_TOOLKIT_PLUGIN_NAME') or define('CBXCAREER_TOOLKIT_PLUGIN_NAME', 'cbxcareertoolkit');
defined('CBXCAREER_TOOLKIT_PLUGIN_VERSION') or define('CBXCAREER_TOOLKIT_PLUGIN_VERSION', '1.0.0');
defined('CBXCAREER_TOOLKIT_BASE_NAME') or define('CBXCAREER_TOOLKIT_BASE_NAME', plugin_basename(__FILE__));
defined('CBXCAREER_TOOLKIT_ROOT_PATH') or define('CBXCAREER_TOOLKIT_ROOT_PATH', plugin_dir_path(__FILE__));
defined('CBXCAREER_TOOLKIT_ROOT_URL') or define('CBXCAREER_TOOLKIT_ROOT_URL', plugin_dir_url(__FILE__));
defined( 'CBXCAREER_TOOLKIT_PLUGIN_NAME' ) or define( 'CBXCAREER_TOOLKIT_PLUGIN_NAME', 'cbxcareertoolkit' );
defined( 'CBXCAREER_TOOLKIT_PLUGIN_VERSION' ) or define( 'CBXCAREER_TOOLKIT_PLUGIN_VERSION', '1.0.0' );
defined( 'CBXCAREER_TOOLKIT_BASE_NAME' ) or define( 'CBXCAREER_TOOLKIT_BASE_NAME', plugin_basename( __FILE__ ) );
defined( 'CBXCAREER_TOOLKIT_ROOT_PATH' ) or define( 'CBXCAREER_TOOLKIT_ROOT_PATH', plugin_dir_path( __FILE__ ) );
defined( 'CBXCAREER_TOOLKIT_ROOT_URL' ) or define( 'CBXCAREER_TOOLKIT_ROOT_URL', plugin_dir_url( __FILE__ ) );

defined('CBX_DEBUG') or define('CBX_DEBUG', false);
defined('CBXCAREER_TOOLKIT_DEV_MODE') or define('CBXCAREER_TOOLKIT_DEV_MODE', CBX_DEBUG);
defined( 'CBX_DEBUG' ) or define( 'CBX_DEBUG', false );
defined( 'CBXCAREER_TOOLKIT_DEV_MODE' ) or define( 'CBXCAREER_TOOLKIT_DEV_MODE', CBX_DEBUG );


require_once CBXCAREER_TOOLKIT_ROOT_PATH . "lib/autoload.php";


/**
* The code that runs during plugin activation.
* This action is documented in includes/class-cbxcareer_toolkit-activator.php
*/
function activate_cbx_career_toolkit()
{
// if ( ! cbxcareer_toolkit_compatible_wp_version() ) {
// deactivate_plugins( plugin_basename( __FILE__ ) );
// wp_die( __( 'CBX Dev toolkit plugin requires WordPress 3.5 or higher!', 'cbxcareertoolkit' ) );
// }
//
// if ( ! cbxcareer_toolkit_compatible_php_version() ) {
// deactivate_plugins( plugin_basename( __FILE__ ) );
// wp_die( __( 'CBX Dev toolkit plugin requires PHP 7.4 or higher!', 'cbxcareertoolkit' ) );
// }

function activate_cbx_career_toolkit() {
\Cbx\Careertoolkit\CBXCareertoolkit::activate();
}
}//end function activate_cbx_career_toolkit

/**
* Begins execution of the plugin.
Expand All @@ -66,11 +55,10 @@ function activate_cbx_career_toolkit()
*
* @since 1.0.0
*/
function run_cbxcareer_toolkit()
{ // phpcs:ignore WordPress.NamingConventions.ValidFunctionName
function run_cbxcareer_toolkit() {
// phpcs:ignore WordPress.NamingConventions.ValidFunctionName
return \Cbx\Careertoolkit\CBXCareertoolkit::instance();
}

}//end function run_cbxcareer_toolkit

add_action("plugin_loaded", "run_cbxcareer_toolkit");

add_action( "plugin_loaded", "run_cbxcareer_toolkit" );
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cbx/career-toolkit",
"description": "cbx career toolkit for development test plugin",
"description": "Helper plugin for CBX Career plugins",
"type": "library",
"license": "MIT",
"config": {
Expand Down
23 changes: 9 additions & 14 deletions includes/CBXCareertoolkit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace Cbx\Careertoolkit;

class CBXCareertoolkit
{
class CBXCareertoolkit {

/**
* The single instance of the class.
Expand Down Expand Up @@ -38,11 +37,10 @@ class CBXCareertoolkit
*/
protected $hooks;

public function __construct()
{
public function __construct() {
$this->plugin_name = CBXCAREER_TOOLKIT_PLUGIN_NAME;
$this->version = CBXCAREER_TOOLKIT_PLUGIN_VERSION;
$this->hooks = new Hooks();
$this->version = CBXCAREER_TOOLKIT_PLUGIN_VERSION;
$this->hooks = new Hooks();
}

/**
Expand All @@ -54,21 +52,18 @@ public function __construct()
* @since 1.0.0
* @static
*/
public static function instance()
{
if (is_null(self::$instance)) {
public static function instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}

return self::$instance;
}

public static function activate()
{
public static function activate() {
}//end method activate

public static function deactivate()
{
public static function deactivate() {
}//end method activate

}
}//end method CBXCareertoolkit
15 changes: 6 additions & 9 deletions includes/Factories/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
* Class Factory
* @since 1.0.0
*/
abstract class Factory
{
abstract class Factory {

public function __construct()
{
public function __construct() {
//$this->faker = FakerFactory::create();
$this->init_commands();
}
Expand All @@ -22,16 +20,15 @@ public function __construct()
* Initialize commands
* @since 1.0.0
*/
private function init_commands()
{
private function init_commands() {

if (class_exists("WP_CLI")) {
add_action('cli_init', [$this, 'wp_cli_register_commands']);
if ( class_exists( "WP_CLI" ) ) {
add_action( 'cli_init', [ $this, 'wp_cli_register_commands' ] );
}
}//end method init_commands

abstract public function wp_cli_register_commands();

abstract public function run($args, $assoc_args);
abstract public function run( $args, $assoc_args );

}//end class Factory
Loading

0 comments on commit 35ee513

Please sign in to comment.