Changeset 1921447
- Timestamp:
- 08/08/2018 08:59:19 AM (8 years ago)
- Location:
- ignico/trunk
- Files:
-
- 9 added
- 2 deleted
- 26 edited
-
CHANGELOG.md (added)
-
CONTRIBUTING.md (modified) (1 diff)
-
README.md (modified) (3 diffs)
-
fonts/ignico.eot (modified) (previous)
-
fonts/ignico.ttf (modified) (previous)
-
fonts/ignico.woff (modified) (previous)
-
fonts/ignico.woff2 (modified) (previous)
-
ignico.php (modified) (1 diff)
-
inc/admin/class-assets.php (modified) (1 diff)
-
inc/admin/class-settings.php (modified) (1 diff)
-
inc/admin/pages/class-authorization.php (modified) (3 diffs)
-
inc/admin/pages/partials/authorization.php (modified) (1 diff)
-
inc/api/AbstractRes.php (added)
-
inc/api/AbstractResource.php (deleted)
-
inc/api/Client.php (modified) (1 diff)
-
inc/api/Http/Exception/ClientException.php (modified) (1 diff)
-
inc/api/Http/Exception/ClientExceptionInterface.php (modified) (1 diff)
-
inc/api/Res (added)
-
inc/api/Res/Action.php (added)
-
inc/api/Res/Authorization (added)
-
inc/api/Res/Authorization.php (added)
-
inc/api/Res/Authorization/AccessToken.php (added)
-
inc/api/Res/Exception (added)
-
inc/api/Res/Exception/AuthorizationException.php (added)
-
inc/api/Resource (deleted)
-
inc/core/class-init.php (modified) (4 diffs)
-
inc/easydigitaldownloads/class-referral.php (modified) (2 diffs)
-
inc/ignico/class-client.php (modified) (2 diffs)
-
inc/ignico/class-init.php (modified) (2 diffs)
-
inc/ignico/class-referral.php (modified) (1 diff)
-
inc/woocommerce/class-referral.php (modified) (2 diffs)
-
languages/ignico-pl_PL.po (modified) (1 diff)
-
languages/ignico.pot (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/autoload_real.php (modified) (3 diffs)
-
vendor/composer/autoload_static.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ignico/trunk/CONTRIBUTING.md
r1890440 r1921447 1 1 # Contribution guide 2 I’m really excited that you are interested in contributing to Ignico for WordPress. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines.2 I’m really excited that you are interested in contributing to Ignico. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines. 3 3 4 4 ## Development setup -
ignico/trunk/README.md
r1890440 r1921447 7 7 Ignico is **rewards & commission automation engine** that helps businesses create their referral, loyalty, MLM, gamification or social selling program on the top of existing e-commerce platforms or CRM's [(read more about Ignico)](http://igni.co/). 8 8 9 Ignico for WordPressis a plugin that is built to seamlessly integrate Ignico with [WooCommerce](https://woocommerce.com/) or [Easy Digital Downloads](https://easydigitaldownloads.com/) (WordPress extensions).9 Ignico is a plugin that is built to seamlessly integrate Ignico with [WooCommerce](https://woocommerce.com/) or [Easy Digital Downloads](https://easydigitaldownloads.com/) (WordPress extensions). 10 10 11 11 ## How it works? 12 12 13 Ignico for WordPressautomatically:13 Ignico automatically: 14 14 15 15 * Loads cookie to the user upon entrance and saves there Referral Code from the URL (comes from affiliate link sent before by one of the brand ambassadors), … … 20 20 ## Use cases 21 21 22 With Ignico for WordPressyou can build:22 With Ignico you can build: 23 23 24 24 * Referral Program … … 34 34 ## Installation :package: 35 35 1. Visit Plugins > Add New 36 2. Search for "Ignico for WordPress"37 3. Install and activate "Ignico for WordPress"36 2. Search for "Ignico" 37 3. Install and activate "Ignico" 38 38 39 39 or -
ignico/trunk/ignico.php
r1890440 r1921447 11 11 * 12 12 * @wordpress-plugin 13 * Plugin Name: Ignico for WordPress13 * Plugin Name: Ignico 14 14 * Description: Ignico is rewards & commission automation engine that helps businesses create their referral, loyalty, MLM, gamification or social selling program on the top of existing e-commerce platforms or CRM's. 15 * Version: 0. 1.015 * Version: 0.2.0 16 16 * Author: Ignico Sp. z o.o. 17 17 * Author URI: http://igni.co -
ignico/trunk/inc/admin/class-assets.php
r1890440 r1921447 9 9 namespace IgnicoWordPress\Admin; 10 10 11 use IgnicoWordPress\Api\Res ource\Authorization\AccessToken;11 use IgnicoWordPress\Api\Res\Authorization\AccessToken; 12 12 13 13 /** -
ignico/trunk/inc/admin/class-settings.php
r1890440 r1921447 9 9 namespace IgnicoWordPress\Admin; 10 10 11 use IgnicoWordPress\Api\Res ource\Authorization\AccessToken;11 use IgnicoWordPress\Api\Res\Authorization\AccessToken; 12 12 13 13 /** -
ignico/trunk/inc/admin/pages/class-authorization.php
r1890440 r1921447 9 9 namespace IgnicoWordPress\Admin\Pages; 10 10 11 use IgnicoWordPress\Api\Res ource\Authorization\AccessToken;12 use IgnicoWordPress\Api\Res ource\Exception\AuthorizationException;11 use IgnicoWordPress\Api\Res\Authorization\AccessToken; 12 use IgnicoWordPress\Api\Res\Exception\AuthorizationException; 13 13 14 14 use IgnicoWordPress\Core\Notice; … … 98 98 $this->plugin['ignico/client']->authorize(); 99 99 100 /** 101 * If authorization would not throw exception we can show successful 102 * notification. 103 */ 104 $this->plugin['notice']->add_flash_notice( $this->plugin['notification/authorization_successful'], Notice::SUCCESS ); 105 100 106 } catch ( AuthorizationException $e ) { 101 107 … … 135 141 $data = array_merge( $old_data, $data ); 136 142 137 $data['workspace'] = trim( filter_var( $data['workspace'], FILTER_SANITIZE_STRING ) ); 143 /** 144 * Sanitize and trim all data passed to form. 145 * 146 * We allow passing workspace with capital letters but we will convert 147 * to lowercase to normalize it. 148 */ 149 $data['workspace'] = strtolower( trim( filter_var( $data['workspace'], FILTER_SANITIZE_STRING ) ) ); 138 150 $data['client_id'] = trim( filter_var( $data['client_id'], FILTER_SANITIZE_STRING ) ); 139 151 $data['client_secret'] = trim( filter_var( $data['client_secret'], FILTER_SANITIZE_STRING ) ); 140 152 141 $data = $this->post_controller( $data ); 153 /** 154 * If data is not valid prevent from executing post controller which 155 * will try to authenticate user and show validation messages. 156 * 157 * Data is passed as reference can be modified in is_valid method. 158 */ 159 160 if ( $this->is_valid( $data ) ) { 161 $data = $this->post_controller( $data ); 162 } 142 163 143 164 return $data; 165 } 166 167 /** 168 * Check if provided data are valid 169 * 170 * Pass data as reference to modify it without returning value. 171 * 172 * @param array $data Sanitized form data. 173 * 174 * @return boolean 175 */ 176 public function is_valid( &$data ) { 177 178 $old_data = $this->plugin['admin/settings']->get_settings(); 179 180 $valid = true; 181 182 $workspace_exist = isset( $data['workspace'] ) && ! empty( $data['workspace'] ); 183 $client_id_exist = isset( $data['client_id'] ) && ! empty( $data['client_id'] ); 184 $client_secret_exist = isset( $data['client_secret'] ) && ! empty( $data['client_secret'] ); 185 186 /** 187 * Validate workspace existence 188 */ 189 if ( ! $workspace_exist ) { 190 191 $valid = false; 192 $data['workspace'] = $old_data['workspace']; 193 194 $this->plugin['notice']->add_flash_notice( sprintf( $this->plugin['notification/form/field/required'], esc_html( __( 'Workspace', 'ignico' ) ) ), Notice::ERROR ); 195 } 196 197 /** 198 * Validate workspace proper format 199 * 200 * Workspace is part of igni.co subdomain e.g test.igni.co. Test prefix 201 * must be validated as part of the domain. 202 */ 203 if ( $workspace_exist && ! preg_match( '/^[A-Za-z0-9](?:[A-Za-z0-9\-]{0,61}[A-Za-z0-9])?$/i', $data['workspace'] ) ) { 204 205 $valid = false; 206 $data['workspace'] = $old_data['workspace']; 207 208 $this->plugin['notice']->add_flash_notice( $this->plugin['notification/form/field/workspace'], Notice::ERROR ); 209 } 210 211 /** 212 * Validate client id existence 213 */ 214 if ( ! $client_id_exist ) { 215 216 $valid = false; 217 $data['client_id'] = $old_data['client_id']; 218 219 $this->plugin['notice']->add_flash_notice( sprintf( $this->plugin['notification/form/field/required'], esc_html( __( 'Client ID', 'ignico' ) ) ), Notice::ERROR ); 220 } 221 222 /** 223 * Validate client secret existence 224 */ 225 if ( ! $client_secret_exist ) { 226 227 $valid = false; 228 $data['client_secret'] = $old_data['client_secret']; 229 230 $this->plugin['notice']->add_flash_notice( sprintf( $this->plugin['notification/form/field/required'], esc_html( __( 'Client secret', 'ignico' ) ) ), Notice::ERROR ); 231 } 232 233 return $valid; 144 234 } 145 235 -
ignico/trunk/inc/admin/pages/partials/authorization.php
r1890440 r1921447 34 34 <th scope="row"><?php esc_html_e( 'Workspace:', 'ignico' ); ?></th> 35 35 <td> 36 <input type="text" name="ignico_settings[workspace]" value="<?php echo esc_attr( $settings['workspace'] ); ?>" class="regular-text" /> 36 <input type="text" name="ignico_settings[workspace]" value="<?php echo esc_attr( $settings['workspace'] ); ?>" /> 37 <span>.igni.co</span> 37 38 <p class="description"><?php esc_html_e( 'Your workspace name would be used to build your API custom url https://{{workspace}}.igni.co', 'ignico' ); ?></p> 38 39 </td> -
ignico/trunk/inc/api/Client.php
r1890440 r1921447 6 6 use IgnicoWordPress\Api\Http\Client as HttpClient; 7 7 8 use IgnicoWordPress\Api\Res ource\Authorization;9 use IgnicoWordPress\Api\Res ource\Action;8 use IgnicoWordPress\Api\Res\Authorization; 9 use IgnicoWordPress\Api\Res\Action; 10 10 11 11 /** -
ignico/trunk/inc/api/Http/Exception/ClientException.php
r1890440 r1921447 17 17 * @return RequestInterface 18 18 */ 19 public function getRequest() : RequestInterface{}19 public function getRequest() {} 20 20 } -
ignico/trunk/inc/api/Http/Exception/ClientExceptionInterface.php
r1890440 r1921447 17 17 * @return RequestInterface 18 18 */ 19 public function getRequest() : RequestInterface;19 public function getRequest(); 20 20 } -
ignico/trunk/inc/core/class-init.php
r1890440 r1921447 61 61 * @var string $name The string used to display theme name. 62 62 */ 63 $this['name'] = 'Ignico for WordPress';63 $this['name'] = 'Ignico'; 64 64 65 65 /** … … 68 68 * @var string $version The current version of the plugin. 69 69 */ 70 $this['version'] = '0. 1.0';70 $this['version'] = '0.2.0'; 71 71 72 72 /** … … 96 96 * @var string $notification_setup 97 97 */ 98 $this['notification/setup'] = __( 'Ignico for WordPressplugin require configuration to work properly. Please provide your Workspace, Client ID and Client Secret in Authorization tab to authorize plugin.', 'ignico' );98 $this['notification/setup'] = __( 'Ignico plugin require configuration to work properly. Please provide your Workspace, Client ID and Client Secret in Authorization tab to authorize plugin.', 'ignico' ); 99 99 100 100 /** … … 103 103 * @var string $notification_lock 104 104 */ 105 $this['notification/lock'] = __( 'Before setting up Ignico for WordPressauthorize plugin to Ignico service.', 'ignico' );106 107 /** 108 * Notification informing user that auth entication for some reason failed105 $this['notification/lock'] = __( 'Before setting up Ignico authorize plugin to Ignico service.', 'ignico' ); 106 107 /** 108 * Notification informing user that authorization for some reason failed 109 109 * 110 110 * @var string $notification_authentication_failed 111 111 */ 112 112 $this['notification/authorization_failed'] = __( 'Authorization failed. Check if you provide correct Workspace, Client ID and Client Secret.', 'ignico' ); 113 114 /** 115 * Notification informing user about successful authorization. 116 * 117 * @var string $notification_authentication_failed 118 */ 119 $this['notification/authorization_successful'] = __( 'Authorization was successful.', 'ignico' ); 120 121 /** 122 * Notification informing user that provided field is required 123 * 124 * @var string $notification_form_field_required 125 */ 126 /* Translators: %s is administration form field name */ 127 $this['notification/form/field/required'] = __( '"%s" field is required and cannot be empty.', 'ignico' ); 128 129 /** 130 * Notification informing user that provided workspace is not valid 131 * 132 * @var string $notification_form_field_workspace 133 */ 134 $this['notification/form/field/workspace'] = __( 'Provided value is not valid workspace name. Allowed characters are letters, numbers and hyphens.', 'ignico' ); 113 135 114 136 } -
ignico/trunk/inc/easydigitaldownloads/class-referral.php
r1890440 r1921447 22 22 * Plugin container. 23 23 * 24 * @var Init $plugin Ignico for WordPressplugin container24 * @var Init $plugin Ignico plugin container 25 25 */ 26 26 private $plugin; … … 29 29 * Initialize the class and set its properties. 30 30 * 31 * @param CoreInit $plugin Ignico for WordPressplugin container.31 * @param CoreInit $plugin Ignico plugin container. 32 32 * 33 33 * @return Referral -
ignico/trunk/inc/ignico/class-client.php
r1890440 r1921447 10 10 11 11 use IgnicoWordPress\Api\Client as ApiClient; 12 use IgnicoWordPress\Api\Res ource\Authorization\AccessToken;12 use IgnicoWordPress\Api\Res\Authorization\AccessToken; 13 13 14 14 /** … … 100 100 update_option( 'ignico_access_token', $access_token ); 101 101 102 $this->plugin['settings']['access_token'] = $access_token;103 102 $this->client->authorization()->setAccessToken( $access_token ); 103 104 $settings = $this->plugin['settings']; 105 $settings['access_token'] = $access_token; 106 107 $this->plugin['settings'] = $settings; 104 108 } 105 109 -
ignico/trunk/inc/ignico/class-init.php
r1890440 r1921447 22 22 * Plugin container. 23 23 * 24 * @var CoreInit $plugin Ignico for WordPressPlugin container24 * @var CoreInit $plugin Ignico Plugin container 25 25 */ 26 26 private $plugin; … … 29 29 * Initialize the class and set its properties. 30 30 * 31 * @param object $plugin Ignico for WordPressPlugin container.31 * @param object $plugin Ignico Plugin container. 32 32 * 33 33 * @return Init -
ignico/trunk/inc/ignico/class-referral.php
r1890440 r1921447 40 40 * Constructor 41 41 * 42 * @param CoreInit $plugin Ignico for WordPressplugin container.42 * @param CoreInit $plugin Ignico plugin container. 43 43 * 44 44 * @return Referral -
ignico/trunk/inc/woocommerce/class-referral.php
r1890440 r1921447 22 22 * Plugin container. 23 23 * 24 * @var Init $plugin Ignico for WordPressplugin container24 * @var Init $plugin Ignico plugin container 25 25 */ 26 26 private $plugin; … … 29 29 * Initialize the class and set its properties. 30 30 * 31 * @param CoreInit $plugin Ignico for WordPressplugin container.31 * @param CoreInit $plugin Ignico plugin container. 32 32 * 33 33 * @return Referral -
ignico/trunk/languages/ignico-pl_PL.po
r1890440 r1921447 12 12 "Language: pl\n" 13 13 14 msgid "Ignico for WordPressis plugin provided to integrate Ignico - Rewards & Commission Automation service with popular WordPress e-commerce systems WooCommerce and Easy Digital Downloads."15 msgstr "Ignico for WordPressjest wtyczką stworzony do integracji serwisu Ignico - Rewards & Commission Automation z popularnymi systemami e-commerce dla WordPress WooCommerce i Easy Digital Downloads."14 msgid "Ignico is plugin provided to integrate Ignico - Rewards & Commission Automation service with popular WordPress e-commerce systems WooCommerce and Easy Digital Downloads." 15 msgstr "Ignico jest wtyczką stworzony do integracji serwisu Ignico - Rewards & Commission Automation z popularnymi systemami e-commerce dla WordPress WooCommerce i Easy Digital Downloads." -
ignico/trunk/languages/ignico.pot
r1890440 r1921447 12 12 "Language: en_US\n" 13 13 14 msgid "Ignico for WordPressis plugin provided to integrate Ignico - Rewards & Commission Automation service with popular WordPress e-commerce systems WooCommerce and Easy Digital Downloads."14 msgid "Ignico is plugin provided to integrate Ignico - Rewards & Commission Automation service with popular WordPress e-commerce systems WooCommerce and Easy Digital Downloads." 15 15 msgstr "" -
ignico/trunk/readme.txt
r1890440 r1921447 11 11 Ignico is **rewards & commission automation engine** that helps businesses create their referral, loyalty, MLM, gamification or social selling program on the top of existing e-commerce platforms or CRM's [(read more about Ignico)](http://igni.co/). 12 12 13 Ignico for WordPressis a plugin that is built to seamlessly integrate Ignico with [WooCommerce](https://woocommerce.com/) or [Easy Digital Downloads](https://easydigitaldownloads.com/) (WordPress extensions).13 Ignico is a plugin that is built to seamlessly integrate Ignico with [WooCommerce](https://woocommerce.com/) or [Easy Digital Downloads](https://easydigitaldownloads.com/) (WordPress extensions). 14 14 15 15 = How it works? = 16 16 17 Ignico for WordPressautomatically:17 Ignico automatically: 18 18 19 19 * Loads cookie to the user upon entrance and saves there Referral Code from the URL (comes from affiliate link sent before by one of the brand ambassadors), … … 24 24 = Use cases = 25 25 26 With Ignico for WordPressyou can build:26 With Ignico you can build: 27 27 28 28 * Referral Program … … 39 39 40 40 1. Visit Plugins > Add New 41 2. Search for "Ignico for WordPress"42 3. Install and activate "Ignico for WordPress"41 2. Search for "Ignico" 42 3. Install and activate "Ignico" 43 43 44 44 or … … 52 52 == Changelog == 53 53 54 = 0.2.0 = 55 56 = Bug Fixes = 57 58 * Add success notification when authorization is successful 59 * Make plugin compatible with PHP 5.6 60 61 = Features = 62 63 * Add igni.co suffix after workspace field for better ux 64 * Add validation to admin authorization form 65 54 66 = 0.1.0 = 55 67 * Ignico -
ignico/trunk/vendor/autoload.php
r1890440 r1921447 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit aa4bf9e9292b3d55854f0aca32a43da2::getLoader();7 return ComposerAutoloaderInitfd2a824328065d59a8b84bcde7db07a7::getLoader(); -
ignico/trunk/vendor/composer/autoload_real.php
r1890440 r1921447 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit aa4bf9e9292b3d55854f0aca32a43da25 class ComposerAutoloaderInitfd2a824328065d59a8b84bcde7db07a7 6 6 { 7 7 private static $loader; … … 20 20 } 21 21 22 spl_autoload_register(array('ComposerAutoloaderInit aa4bf9e9292b3d55854f0aca32a43da2', 'loadClassLoader'), true, true);22 spl_autoload_register(array('ComposerAutoloaderInitfd2a824328065d59a8b84bcde7db07a7', 'loadClassLoader'), true, true); 23 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit aa4bf9e9292b3d55854f0aca32a43da2', 'loadClassLoader'));24 spl_autoload_unregister(array('ComposerAutoloaderInitfd2a824328065d59a8b84bcde7db07a7', 'loadClassLoader')); 25 25 26 26 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); … … 28 28 require_once __DIR__ . '/autoload_static.php'; 29 29 30 call_user_func(\Composer\Autoload\ComposerStaticInit aa4bf9e9292b3d55854f0aca32a43da2::getInitializer($loader));30 call_user_func(\Composer\Autoload\ComposerStaticInitfd2a824328065d59a8b84bcde7db07a7::getInitializer($loader)); 31 31 } else { 32 32 $map = require __DIR__ . '/autoload_namespaces.php'; -
ignico/trunk/vendor/composer/autoload_static.php
r1890440 r1921447 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit aa4bf9e9292b3d55854f0aca32a43da27 class ComposerStaticInitfd2a824328065d59a8b84bcde7db07a7 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 32 32 { 33 33 return \Closure::bind(function () use ($loader) { 34 $loader->prefixLengthsPsr4 = ComposerStaticInit aa4bf9e9292b3d55854f0aca32a43da2::$prefixLengthsPsr4;35 $loader->prefixDirsPsr4 = ComposerStaticInit aa4bf9e9292b3d55854f0aca32a43da2::$prefixDirsPsr4;34 $loader->prefixLengthsPsr4 = ComposerStaticInitfd2a824328065d59a8b84bcde7db07a7::$prefixLengthsPsr4; 35 $loader->prefixDirsPsr4 = ComposerStaticInitfd2a824328065d59a8b84bcde7db07a7::$prefixDirsPsr4; 36 36 37 37 }, null, ClassLoader::class);
Note: See TracChangeset
for help on using the changeset viewer.