Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit

Permalink
formatted code and updated plugin link
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrax committed Apr 8, 2021
1 parent e7c8e7b commit 96c3d84
Show file tree
Hide file tree
Showing 18 changed files with 687 additions and 434 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Changelog

version 1.0.0 stable release with only tigopesa as the only payment gateway
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

899 changes: 617 additions & 282 deletions LICENSE.txt

Large diffs are not rendered by default.

89 changes: 16 additions & 73 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
=== Wopay ===
Contributors: (this should be a list of wordpress.org userid's)
Tags: comments, spam
Requires at least: 4.0.1
Tested up to: 4.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Here is a short description of the plugin. This should be no more than 150 characters. No markup here.

Contributors: dbrax
Tags: e-commerce, payment gateways, tigopesa, mpesa, woo, shop, cart, checkout, downloadable, downloads, payments, woo commerce
Requires at least: 5.4
Woocommerce at least: 5.1
Tested up to: 5.7
Requires PHP: 7.0
Stable tag: 1.0.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Wopay is a unified mobile money payment gateway to be used in woocommerce plugin.Helps merchants to receive money seemlessly using mobile money ( Tigopesa , Mpesa and Airtel Money)
== Description ==

This is the long description. No limit, and you can use Markdown (as well as in the following sections).

For backwards compatibility, if this section is missing, the full length of the short description will be used, and
Markdown parsed.
Wordpress and woocommerce users and developers can use this plugin to ensure that their stores can receive money through mobile payments gateways such as tigopesa and mpesa.
The plugin works well with woocommerce to add extra functionality to enable users to pay with tigopesa.

A few notes about the sections above:

Expand All @@ -26,7 +26,7 @@ higher versions... this is just the highest one you've verified.
stable.

Note that the `readme.txt` of the stable tag is the one that is considered the defining one for the plugin, so
if the `/trunk/readme.txt` file says that the stable tag is `4.3`, then it is `/tags/4.3/readme.txt` that'll be used
if the `/trunk/readme.txt` file says that the stable tag is `5.4`, then it is `/tags/5.4/readme.txt` that'll be used
for displaying information about the plugin. In this situation, the only thing considered from the trunk `readme.txt`
is the stable tag pointer. Thus, if you develop in trunk, you can update the trunk `readme.txt` to reflect changes in
your in-development version, without having that information incorrectly disclosed about the current stable version
Expand All @@ -45,68 +45,11 @@ e.g.
1. Activate the plugin through the 'Plugins' menu in WordPress
1. Place `<?php do_action('Wopay_hook'); ?>` in your templates

== Frequently Asked Questions ==

= A question that someone might have =

An answer to that question.

= What about foo bar? =

Answer to foo bar dilemma.

== Screenshots ==

1. This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from
the /assets directory or the directory that contains the stable readme.txt (tags or trunk). Screenshots in the /assets
directory take precedence. For example, `/assets/screenshot-1.png` would win over `/tags/4.3/screenshot-1.png`
(or jpg, jpeg, gif).
2. This is the second screen shot

== Changelog ==

= 1.0 =
* A change since the previous version.
* Another change.

= 0.5 =
* List versions from most recent at top to oldest at bottom.

== Upgrade Notice ==

= 1.0 =
Upgrade notices describe the reason a user should upgrade. No more than 300 characters.

= 0.5 =
This version fixes a security related bug. Upgrade immediately.

== Arbitrary section ==

You may provide arbitrary sections, in the same format as the ones above. This may be of use for extremely complicated
plugins where more information needs to be conveyed that doesn't fit into the categories of "description" or
"installation." Arbitrary sections will be shown below the built-in sections outlined above.

== A brief Markdown Example ==

Ordered list:

1. Some feature
1. Another feature
1. Something else about the plugin

Unordered list:

* something
* something else
* third thing

Here's a link to [WordPress](http://wordpress.org/ "Your favorite software") and one to [Markdown's Syntax Documentation][markdown syntax].
Titles are optional, naturally.

[markdown syntax]: http://daringfireball.net/projects/markdown/syntax
"Markdown is what the parser uses to process much of the readme file"

Markdown uses email style notation for blockquotes and I've been told:
> Asterisks for *emphasis*. Double it up for **strong**.
= 1.0.0 =
* Intial Release with tigopesa as the only mobile payment gateway

`<?php code(); // goes in backticks ?>`
22 changes: 11 additions & 11 deletions admin/class-wopay-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* The admin-specific functionality of the plugin.
*
* @link http://woopayments.com
* @link https://github.com/dbrax/wopay
* @since 1.0.0
*
* @package wopay
Expand All @@ -20,7 +20,8 @@
* @subpackage wopay/admin
* @author Emmanuel Mnzava <epmnzava@gmail.com>
*/
class wopay_Admin {
class wopay_Admin
{

/**
* The ID of this plugin.
Expand All @@ -47,19 +48,20 @@ class wopay_Admin {
* @param string $wopay The name of this plugin.
* @param string $version The version of this plugin.
*/
public function __construct( $wopay, $version ) {
public function __construct($wopay, $version)
{

$this->wopay = $wopay;
$this->version = $version;

}

/**
* Register the stylesheets for the admin area.
*
* @since 1.0.0
*/
public function enqueue_styles() {
public function enqueue_styles()
{

/**
* This function is provided for demonstration purposes only.
Expand All @@ -73,16 +75,16 @@ public function enqueue_styles() {
* class.
*/

wp_enqueue_style( $this->wopay, plugin_dir_url( __FILE__ ) . 'css/wopay-admin.css', array(), $this->version, 'all' );

wp_enqueue_style($this->wopay, plugin_dir_url(__FILE__) . 'css/wopay-admin.css', array(), $this->version, 'all');
}

/**
* Register the JavaScript for the admin area.
*
* @since 1.0.0
*/
public function enqueue_scripts() {
public function enqueue_scripts()
{

/**
* This function is provided for demonstration purposes only.
Expand All @@ -96,8 +98,6 @@ public function enqueue_scripts() {
* class.
*/

wp_enqueue_script( $this->wopay, plugin_dir_url( __FILE__ ) . 'js/wopay-admin.js', array( 'jquery' ), $this->version, false );

wp_enqueue_script($this->wopay, plugin_dir_url(__FILE__) . 'js/wopay-admin.js', array('jquery'), $this->version, false);
}

}
4 changes: 2 additions & 2 deletions admin/partials/wopay-admin-display.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*
* This file is used to markup the admin-facing aspects of the plugin.
*
* @link https://woopayments.com
* @link https://github.com/dbrax/wopay
* @since 1.0.0
*
* @package wopay
* @subpackage wopay/admin/partials
*/
?>

<!-- This file should primarily consist of HTML with a little bit of PHP. -->
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
13 changes: 6 additions & 7 deletions includes/class-wopay-activator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Fired during plugin activation
*
* @link https://woopayments.com
* @link https://github.com/dbrax/wopay
* @since 1.0.0
*
* @package wopay
Expand All @@ -20,18 +20,17 @@
* @subpackage wopay/includes
* @author Emmanuel Mnzava <epmnzava@gmail.com>
*/
class wopay_Activator {
class wopay_Activator
{

/**
* Short Description. (use period)
*
* Long Description.
*
* @since 1.0.0
*/
public static function activate() {
public static function activate()
{

//My Activation logic here ...
//currently we are not using any interface nor database etc
}

}
6 changes: 2 additions & 4 deletions includes/class-wopay-deactivator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Fired during plugin deactivation
*
* @link https://woopayments.com
* @link https://github.com/dbrax/wopay
* @since 1.0.0
*
* @package wopay
Expand All @@ -23,14 +23,12 @@
class wopay_Deactivator {

/**
* Short Description. (use period)
*
* Long Description.
*
* @since 1.0.0
*/
public static function deactivate() {
// my deactication logic here
//currently we have no interfaces or database etc hence nothing to deactivate as a logic

}

Expand Down
2 changes: 1 addition & 1 deletion includes/class-wopay-i18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Loads and defines the internationalization files for this plugin
* so that it is ready for translation.
*
* @link https://woopayments.com
* @link https://github.com/dbrax/wopay
* @since 1.0.0
*
* @package wopay
Expand Down
36 changes: 19 additions & 17 deletions includes/class-wopay-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* Register all actions and filters for the plugin
*
* @link https://woopayments.com
* @link https://github.com/dbrax/wopay
* @since 1.0.0
*
* @package wopay
Expand All @@ -21,7 +21,8 @@
* @subpackage wopay/includes
* @author Emmanuel Mnzava <epmnzava@gmail.com>
*/
class wopay_Loader {
class wopay_Loader
{

/**
* The array of actions registered with WordPress.
Expand All @@ -46,11 +47,11 @@ class wopay_Loader {
*
* @since 1.0.0
*/
public function __construct() {
public function __construct()
{

$this->actions = array();
$this->filters = array();

}

/**
Expand All @@ -63,8 +64,9 @@ public function __construct() {
* @param int $priority Optional. The priority at which the function should be fired. Default is 10.
* @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
*/
public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
$this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
public function add_action($hook, $component, $callback, $priority = 10, $accepted_args = 1)
{
$this->actions = $this->add($this->actions, $hook, $component, $callback, $priority, $accepted_args);
}

/**
Expand All @@ -77,8 +79,9 @@ public function add_action( $hook, $component, $callback, $priority = 10, $accep
* @param int $priority Optional. The priority at which the function should be fired. Default is 10.
* @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
*/
public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
public function add_filter($hook, $component, $callback, $priority = 10, $accepted_args = 1)
{
$this->filters = $this->add($this->filters, $hook, $component, $callback, $priority, $accepted_args);
}

/**
Expand All @@ -95,7 +98,8 @@ public function add_filter( $hook, $component, $callback, $priority = 10, $accep
* @param int $accepted_args The number of arguments that should be passed to the $callback.
* @return array The collection of actions and filters registered with WordPress.
*/
private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
private function add($hooks, $hook, $component, $callback, $priority, $accepted_args)
{

$hooks[] = array(
'hook' => $hook,
Expand All @@ -106,24 +110,22 @@ private function add( $hooks, $hook, $component, $callback, $priority, $accepted
);

return $hooks;

}

/**
* Register the filters and actions with WordPress.
*
* @since 1.0.0
*/
public function run() {
public function run()
{

foreach ( $this->filters as $hook ) {
add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
foreach ($this->filters as $hook) {
add_filter($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']);
}

foreach ( $this->actions as $hook ) {
add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
foreach ($this->actions as $hook) {
add_action($hook['hook'], array($hook['component'], $hook['callback']), $hook['priority'], $hook['accepted_args']);
}

}

}
Loading

0 comments on commit 96c3d84

Please sign in to comment.