Skip to content

Commit

Permalink
Fixed various small issues, finally got the shortcode working in a na…
Browse files Browse the repository at this point in the history
…mespaced, OOP plugin.
  • Loading branch information
Chrispian committed Mar 1, 2019
1 parent e73508c commit 3933038
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 44 deletions.
167 changes: 130 additions & 37 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# WP Discogs

Simple plugin to add various Discogs data to your site via short codes, widgets, Gutenberg blocks and Advanced Custom Fields.

###

*NOTE* This is still an early release and has not been throughougly tested. I've been running it on several of my sites now for a while with no issues but please use with caution. Testers very much appreciated.

### To Do

- Add caching to requests to save API calls and reduce overhead.
- Add Error Checking
- Move singletons into OOP classes
- Move CSS to extneral resource instead of inline
- Create helper for displaying results
- Add Wishlists
- Add options for display

### Authors

* **Chrispian H. Burks** - *Initial work* - [Chrispian](https://github.com/chrispian)

2 changes: 0 additions & 2 deletions src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,4 @@ public function __construct( $plugin ) {
// Parent plugin.
$this->plugin = $plugin;
}


}
29 changes: 29 additions & 0 deletions src/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

namespace CHB_WP_Discogs;

use OAuth\OAuth1\Service\BitBucket;
use OAuth\Common\Storage\Session;
use OAuth\Common\Consumer\Credentials;
use Discogs;

/**
* Class to hold helper functions
*/
Expand All @@ -28,4 +33,28 @@ public function __construct( $plugin ) {
}


/**
* Get Discogs Auth Settings
*
* @since 1.0.0
*
* @param null
* @return void
*/
public function get_auth_settings() {

// Bail early if we don't have the keys.
if ( get_option( 'wp_discogs_app_consumer_key' ) == false || get_option( 'wp_discogs_app_consumer_secret' ) == false ) {
return;
}

$auth_settings = [];
$auth_settings['wp_discogs_app_consumer_key'] = get_option( 'wp_discogs_app_consumer_key' );
$auth_settings['wp_discogs_app_consumer_secret'] = get_option( 'wp_discogs_app_consumer_secret' );
$auth_settings['wp_discogs_username'] = get_option( 'wp_discogs_username' );

return $auth_settings;

}

}
2 changes: 2 additions & 0 deletions src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ public function plugin_settings_page() {
?>

</form>


</div>
</div>
<?php
Expand Down
Loading

0 comments on commit 3933038

Please sign in to comment.