Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final cleanup and renaming adjustments #598

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
67 changes: 67 additions & 0 deletions hoi-payments-gateways/hoi-payments-gateways.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php
/*
Plugin Name: HOI Payments Gateways
Plugin URI: https://hoiltd.com/hoi-payments-gateways-uri/
Description: HOI WordPress Payments Gateways for Stripe, PayPal, and beyond.
Version: 1.0.0
Author: Mohammad Al-Souri
Author URI: https://msalsouri.github.io/
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
Text Domain: hoi-payments-gateways
Domain Path: /languages
*/

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

/**
* The current plugin version.
* Start at version 1.0.0 and use SemVer - https://semver.org
*/
define('HOI_PAYMENTS_GATEWAYS_VERSION', '1.0.0');

/**
* The code that runs during plugin activation.
* This action is documented in src/includes/class-hoi-payments-gateways-activator.php
*/
function activate_hoi_payments_gateways() {
require_once plugin_dir_path(__FILE__) . 'src/includes/class-hoi-payments-gateways-activator.php';
Hoi_Payments_Gateways_Activator::activate();
}

/**
* The code that runs during plugin deactivation.
* This action is documented in src/includes/class-hoi-payments-gateways-deactivator.php
*/
function deactivate_hoi_payments_gateways() {
require_once plugin_dir_path(__FILE__) . 'src/includes/class-hoi-payments-gateways-deactivator.php';
Hoi_Payments_Gateways_Deactivator::deactivate();
}

register_activation_hook(__FILE__, 'activate_hoi_payments_gateways');
register_deactivation_hook(__FILE__, 'deactivate_hoi_payments_gateways');

/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path(__FILE__) . 'src/includes/class-hoi-payments-gateways.php';

/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
function run_hoi_payments_gateways() {
$plugin = new Hoi_Payments_Gateways();
$plugin->run();
}
run_hoi_payments_gateways();

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function enqueue_styles() {
* class.
*/

wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/plugin-name-admin.css', array(), $this->version, 'all' );
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/hoi-payments-gateways-admin.css', array(), $this->version, 'all' );

}

Expand All @@ -96,7 +96,7 @@ public function enqueue_scripts() {
* class.
*/

wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/plugin-name-admin.js', array( 'jquery' ), $this->version, false );
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/hoi-payments-gateways-admin.js', array( 'jquery' ), $this->version, false );

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* @link http://example.com
* @since 1.0.0
*
* @package Plugin_Name
* @subpackage Plugin_Name/includes
* @package Hoi_Payments_Gateways
* @subpackage Hoi_Payments_Gateways/includes
*/

/**
Expand All @@ -16,11 +16,11 @@
* This class defines all code necessary to run during the plugin's activation.
*
* @since 1.0.0
* @package Plugin_Name
* @subpackage Plugin_Name/includes
* @package Hoi_Payments_Gateways
* @subpackage Hoi_Payments_Gateways/includes
* @author Your Name <email@example.com>
*/
class Plugin_Name_Activator {
class Hoi_Payments_Gateways_Activator {

/**
* Short Description. (use period)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* @link http://example.com
* @since 1.0.0
*
* @package Plugin_Name
* @subpackage Plugin_Name/includes
* @package Hoi_Payments_Gateways
* @subpackage Hoi_Payments_Gateways/includes
*/

/**
Expand All @@ -16,11 +16,11 @@
* This class defines all code necessary to run during the plugin's deactivation.
*
* @since 1.0.0
* @package Plugin_Name
* @subpackage Plugin_Name/includes
* @package Hoi_Payments_Gateways
* @subpackage Hoi_Payments_Gateways/includes
* @author Your Name <email@example.com>
*/
class Plugin_Name_Deactivator {
class Hoi_Payments_Gateways_Deactivator {

/**
* Short Description. (use period)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* @link http://example.com
* @since 1.0.0
*
* @package Plugin_Name
* @subpackage Plugin_Name/includes
* @package Hoi_Payments_Gateways
* @subpackage Hoi_Payments_Gateways/includes
*/

/**
Expand All @@ -20,11 +20,11 @@
* so that it is ready for translation.
*
* @since 1.0.0
* @package Plugin_Name
* @subpackage Plugin_Name/includes
* @package Hoi_Payments_Gateways
* @subpackage Hoi_Payments_Gateways/includes
* @author Your Name <email@example.com>
*/
class Plugin_Name_i18n {
class Hoi_Payments_Gateways_i18n {


/**
Expand All @@ -35,7 +35,7 @@ class Plugin_Name_i18n {
public function load_plugin_textdomain() {

load_plugin_textdomain(
'plugin-name',
'hoi-payments-gateways',
false,
dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* @link http://example.com
* @since 1.0.0
*
* @package Plugin_Name
* @subpackage Plugin_Name/includes
* @package Hoi_Payments_Gateways
* @subpackage Hoi_Payments_Gateways/includes
*/

/**
Expand All @@ -17,11 +17,11 @@
* the plugin, and register them with the WordPress API. Call the
* run function to execute the list of actions and filters.
*
* @package Plugin_Name
* @subpackage Plugin_Name/includes
* @package Hoi_Payments_Gateways
* @subpackage Hoi_Payments_Gateways/includes
* @author Your Name <email@example.com>
*/
class Plugin_Name_Loader {
class Hoi_Payments_Gateways_Loader {

/**
* The array of actions registered with WordPress.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* @link http://example.com
* @since 1.0.0
*
* @package Plugin_Name
* @subpackage Plugin_Name/includes
* @package Hoi_Payments_Gateways
* @subpackage Hoi_Payments_Gateways/includes
*/

/**
Expand All @@ -23,19 +23,19 @@
* version of the plugin.
*
* @since 1.0.0
* @package Plugin_Name
* @subpackage Plugin_Name/includes
* @package Hoi_Payments_Gateways
* @subpackage Hoi_Payments_Gateways/includes
* @author Your Name <email@example.com>
*/
class Plugin_Name {
class Hoi_Payments_Gateways {

/**
* The loader that's responsible for maintaining and registering all hooks that power
* the plugin.
*
* @since 1.0.0
* @access protected
* @var Plugin_Name_Loader $loader Maintains and registers all hooks for the plugin.
* @var Hoi_Payments_Gateways_Loader $loader Maintains and registers all hooks for the plugin.
*/
protected $loader;

Expand Down Expand Up @@ -72,7 +72,7 @@ public function __construct() {
} else {
$this->version = '1.0.0';
}
$this->plugin_name = 'plugin-name';
$this->plugin_name = 'hoi-payments-gateways';

$this->load_dependencies();
$this->set_locale();
Expand All @@ -86,10 +86,10 @@ public function __construct() {
*
* Include the following files that make up the plugin:
*
* - Plugin_Name_Loader. Orchestrates the hooks of the plugin.
* - Plugin_Name_i18n. Defines internationalization functionality.
* - Plugin_Name_Admin. Defines all hooks for the admin area.
* - Plugin_Name_Public. Defines all hooks for the public side of the site.
* - Hoi_Payments_Gateways_Loader. Orchestrates the hooks of the plugin.
* - Hoi_Payments_Gateways_i18n. Defines internationalization functionality.
* - Hoi_Payments_Gateways_Admin. Defines all hooks for the admin area.
* - Hoi_Payments_Gateways_Public. Defines all hooks for the public side of the site.
*
* Create an instance of the loader which will be used to register the hooks
* with WordPress.
Expand All @@ -103,41 +103,41 @@ private function load_dependencies() {
* The class responsible for orchestrating the actions and filters of the
* core plugin.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-plugin-name-loader.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-hoi-payments-gateways-loader.php';

/**
* The class responsible for defining internationalization functionality
* of the plugin.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-plugin-name-i18n.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-hoi-payments-gateways-i18n.php';

/**
* The class responsible for defining all actions that occur in the admin area.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-plugin-name-admin.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-hoi-payments-gateways-admin.php';

/**
* The class responsible for defining all actions that occur in the public-facing
* side of the site.
*/
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-plugin-name-public.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-hoi-payments-gateways-public.php';

$this->loader = new Plugin_Name_Loader();
$this->loader = new Hoi_Payments_Gateways_Loader();

}

/**
* Define the locale for this plugin for internationalization.
*
* Uses the Plugin_Name_i18n class in order to set the domain and to register the hook
* Uses the Hoi_Payments_Gateways_i18n class in order to set the domain and to register the hook
* with WordPress.
*
* @since 1.0.0
* @access private
*/
private function set_locale() {

$plugin_i18n = new Plugin_Name_i18n();
$plugin_i18n = new Hoi_Payments_Gateways_i18n();

$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );

Expand All @@ -152,7 +152,7 @@ private function set_locale() {
*/
private function define_admin_hooks() {

$plugin_admin = new Plugin_Name_Admin( $this->get_plugin_name(), $this->get_version() );
$plugin_admin = new Hoi_Payments_Gateways_Admin( $this->get_plugin_name(), $this->get_version() );

$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
Expand All @@ -168,7 +168,7 @@ private function define_admin_hooks() {
*/
private function define_public_hooks() {

$plugin_public = new Plugin_Name_Public( $this->get_plugin_name(), $this->get_version() );
$plugin_public = new Hoi_Payments_Gateways_Public( $this->get_plugin_name(), $this->get_version() );

$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
Expand Down Expand Up @@ -199,7 +199,7 @@ public function get_plugin_name() {
* The reference to the class that orchestrates the hooks with the plugin.
*
* @since 1.0.0
* @return Plugin_Name_Loader Orchestrates the hooks of the plugin.
* @return Hoi_Payments_Gateways_Loader Orchestrates the hooks of the plugin.
*/
public function get_loader() {
return $this->loader;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function enqueue_styles() {
* class.
*/

wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/plugin-name-public.css', array(), $this->version, 'all' );
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/hoi-payments-gateways-public.css', array(), $this->version, 'all' );

}

Expand All @@ -96,7 +96,7 @@ public function enqueue_scripts() {
* class.
*/

wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/plugin-name-public.js', array( 'jquery' ), $this->version, false );
wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/hoi-payments-gateways-public.js', array( 'jquery' ), $this->version, false );

}

Expand Down
File renamed without changes.
Loading