Skip to content

Commit

Permalink
Initial commit of EASC
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredatch committed Dec 22, 2017
1 parent ec4e786 commit a350581
Show file tree
Hide file tree
Showing 27 changed files with 10,870 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .jshintrc
@@ -0,0 +1,25 @@
{
"boss": true,
"curly": true,
"devel":true,
"eqeqeq": true,
"eqnull": true,
"es3": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"sub": true,
"strict": true,
"trailing": true,
"undef": true,
"unused": true,
"browser": true,
"jquery": true,
"globalstrict": true,
"globals": {
"exports": true,
"module": false
}
}
191 changes: 191 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,191 @@
# Change Log
All notable changes to this project will be documented in this file, formatted via [this recommendation](http://keepachangelog.com/).

## [1.8.0] = 2017-01-03
### Added
- Added `ea_share_count_display_wrap_format` filter, see #75
- Allow unique styling for each instance, see #78
- Added `ea_share_count_link_url` filter, see #80

### Fixed
- Update handling of Pinterest API response, see #64
- Strip tags from title before using in URL, see #71
- Simplified the image attribute, see #74
- Ensure icon styling only targets icons, see #70
- Removed nonce from email modal, see #69
- Properly receive HTTP requests to prevent errors, see #68
- Fix slim styling display, see #66

## [1.7.1] = 2016-08-24
### Fixed
- Issue with Facebook comment count parsing, see #63

### Added
- Composer support

## [1.7.0] = 2016-08-20
### Changed
- Now receive counts directly from social services (no more SharedCount), see #57
- Updates now automatically pull from GitHub tags, see #53

### Added
- Filter for adding additional styles (ea_share_count_admin_services), see #58
- Filter for adding additional share count services (ea_share_count_query_services), see #57
- Admin notice regarding changing share count source
- Version number is now saved to database for future updates

### Fixed
- PHP Notice if you were getting share counts for a custom URL rather than post ID
- Used correct hooks for Theme Hook Alliance, see #55

## [1.6.0] = 2016-06-23
### Added
- Checkbox in metabox to hide share buttons on this specific post, see #51
- When opening email modal, focus on first input

### Fixed
- Replaced PHP short tags with proper tags, see #50

## [1.5.9] = 2016-05-23
### Fixed
- Issue with automated theme location placement not working on in all cases. See #44

## [1.5.8] = 2016-05-19
### Fixed
- Issue with 'after_content' theme location not working on some themes. See #43

## [1.5.7] = 2016-04-21
### Added
- 'ea_share_count_update_queue' filter

## [1.5.6] = 2016-04-12
### Changed
- Use quotes in JS partial selector, fixing JS issue in WordPress 4.5

## [1.5.5] = 2016-03-22
### Added
- Added support for custom post types
- Added commas to the share counts in metabox
- Added readme file with documentation

### Changed
- Expired share counts now update after page has loaded, rather during page load
- Default style is now 'fancy' rather than 'bubble'

## [1.5.4] = 2016-02-26
### Changed
- Moved the theme location code to a later hook (template_redirect) so filterable in theme.

## [1.5.3] = 2016-01-28
### Added
- Display before/after content now supports all themes. First looks for Genesis and Theme Hook Alliance hooks, then falls back to 'the_content' filter (see #36)

### Changed
- Icons are now included in CSS. Icon classes have changed from font awesome to our custom icons. Ex: fa-facebook is now easc-facebook (see #35)
- Reduced size of print button when using GSS style
- Renamed Genesis Simple Share style to Slim
- Rearranged fields on settings page

### Fixed
- Special characters now work in emails (see #34)

## [1.5.2] - 2015-11-13
### Changed
- Links to author names on plugin page
- Renamed main plugin file to match plugin name

## [1.5.1] - 2015-11-13
### Changed
- Version bump to test plugin updater

## [1.5.0] - 2015-11-13
### Added
- Email sharing feature
- Plugin updater

## [1.4.0] - 2015-10-21
### Added
- Print included service option
- Total Counts included service option
- Settings to toggle count number visibility

### Changed
- Refactored Included Service setting so that the service order is saved
- Seperate the regisration and enqueuing of assets
- Enqueue assets earlier

## [1.3.0] - 2015-10-14
### Added
- Metabox to supported post types for viewing/updating share counts
- Filter for theme locations
- Settings link to plugin page

### Changed
- Refactored plugin structure
- Non-post URLs are now stored in a single option

### Fixed
- Pinterest js library bug
- Select2 v4 issue, reverted to v3.5.x

## [1.2.0] - 2015-10-06
### Added
- Setting for post types supported
- Setting for hiding empty counts
- Uninstall functionality

### Changed
- Setting format for included services
- Setting theme location to support before AND after
- Share bar display markup and CSS
- Reorganized file structure
- Assets enqueue earlier if possible

## [1.1.0] - 2015-09-30
### Added
- Settings page for managing API Details and Theme Display
- A prime_the_pump() function for ensuring there is share data for a certain number of posts
- 'ea_share_count_total' filter for modifying the total count. Useful when wanting to query based on specific metric (eg: facebook likes)

## [1.0.6] - 2015-09-16
### Fixed
- Default Facebook like opens share dialog box
- Single post image filter bug
### Added
- "GSS" style option to mimic the Genesis Simple Share plugin

## [1.0.5] - 2015-09-02
### Fixed
- Incorrect target="_blank" assignment

### Added
- Filter for single post images
- Javascript event for share clicks
- Fancy button styles

## [1.0.4] - 2015-07-24
### Fixed
- Use correct variable name for Pinterest image
### Added
- Support for arbitrary URLs as ID

## [1.0.3] - 2015-07-4
### Fixed
- Update share button js to correctly look for target="_blank"

## [1.0.2] - 2015-05-08
### Added
- Total count parameter, accessible in count() method
- Total count is also stored in 'ea_share_count_total' key for query sorting

## [1.0.1] - 2015-03-17
### Added
- Parameter for specifying the link style
- Styles for bubble count Facebook and Twitter

### Changed
- Removed unnecessary $post_date argument on 'ea_share_count_update_increments' filter, see #6
- Inline documentation

## [1.0.0] - 2015-03-10
- Initial Commit
71 changes: 70 additions & 1 deletion README.md
@@ -1 +1,70 @@
# Shared-Counts
# EA Share Count #
![Release](https://img.shields.io/github/release/jaredatch/ea-share-count.svg) ![License](https://img.shields.io/badge/license-GPL--2.0%2B-red.svg?style=flat-square&maxAge=2592000)

**Contributors:** jaredatch, billerickson
**Tags:** facebook, linkedin, pinterest, share, share buttons, social, stumbleupon, twitter
**Requires at least:** 4.1
**Tested up to:** 4.7.0
**Stable tag:** 1.8.0
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

EA Share Count is a lean plugin for quickly retrieving, caching, and displaying various social sharing counts and buttons. It's developer-friendly and very extensible.

## Installation ##

[Download the plugin here.](https://github.com/jaredatch/EA-Share-Count/archive/master.zip) Once installed, go to Settings > Share Count to customize.

Use the "Retrieve Share Counts From" checkboxes to select which APIs you'd like to query for share counts. By default it will not receive any share counts. The Facebook API requires you to provide an Access Token.

The "Share Buttons to Display" field lets you control which share buttons to display and in what order. They can be automatically added before and/or after your site's content by selecting a Theme Location. Alternatively you can use `ea_share()->from->display()` in your theme to display the buttons.

## Screenshots ##

### 1. Settings Page. ###
![Settings Page](https://d3vv6lp55qjaqc.cloudfront.net/items/2T2j1w3P2P2b3L2P2Z3Y/Screen%20Shot%202016-08-15%20at%204.39.19%20PM.png?v=1dbe1998)

### 2. Fancy Style (default) ###
![Fancy Style](https://s3.amazonaws.com/f.cl.ly/items/1K3q1G312k3F3u0r0r21/Screen%20Shot%202016-03-23%20at%204.03.33%20PM.png?v=f44e0d06)

### 3. Slim Style ###
![Slim Style](https://s3.amazonaws.com/f.cl.ly/items/1L06211I3E3v1O2o0y0L/slim.jpg?v=58095cff)

### 4. Bubble Style ###
![Bubble Style](https://s3.amazonaws.com/f.cl.ly/items/1D0m2q270u1719112W3S/Screen%20Shot%202016-03-23%20at%204.02.31%20PM.png?v=84be6c71)

### 5. Email Popup ###
![Email Popup](https://s3.amazonaws.com/f.cl.ly/items/453x450Y2g1a2t2W1Y3d/Screen%20Shot%202016-06-02%20at%208.00.16%20AM.png?v=cb901d0b)

## Customization ##

You can also use the ea_share() function to access any of the internal methods. The most common use will be to get a specific share count. [See all options here.](https://github.com/jaredatch/EA-Share-Count/blob/master/includes/class-core.php#L157)

* `ea_share()->core->count( get_the_ID(), 'facebook' );` Provides the number of facebook likes/shares/comments
* `ea_share()->core->count( get_the_ID(), 'included_total' );` Provides the total count from all the services specified in settings
* `ea_share()->front->display( $location, $echo );` Display the share buttons, as configured in Settings > Share Count. The $location is an identifying class added to wrapping HTML (useful if you have buttons in multiple locations). $echo is a boolean value indicating whether the buttons should be echoed or returned.

There are also many filters in place to customize the plugin. [Here are some code snippets](http://www.billerickson.net/code-tag/ea-share-count/).

* `ea_share_count_display` Customize what is displayed in the share count area.
* `ea_share_count_display_wrap_format` Customize the wrapping class and format of share count area.
* `ea_share_count_theme_locations` Specify which hooks/filters are used for the "Before Content" and "After Content" share buttons. See [the code](https://github.com/jaredatch/EA-Share-Count/blob/master/includes/class-front.php#L38) for more information.
* `ea_share_count_link` An array of elements used to form the share link. See [the code](https://github.com/jaredatch/EA-Share-Count/blob/master/includes/class-front.php#L442) for more information.
* `ea_share_count_link_url` The URL being shared
* `ea_share_count_default_image` Default image used by Pinterest for generic URLs.
* `ea_share_count_single_image` Image used by Pinterest for singular content (post, page...). Set to Featured Image by default.
* `ea_share_count_site_url` What URL is used if you specify 'site' as the ID. Defaults to home_url().
* `ea_share_count_single` The share count used when the requested service isn't recognized. If you're adding custom services, you'll use this to set the share count for that service.
* `ea_share_count_total` Customize what is used as the 'total_count'
* `ea_share_count_load_css` Disable the CSS from loading, [like this](https://gist.github.com/billerickson/fe8079583c1b030e4d59). Note that the icons are part of the CSS, so you'll need to include your own icon font.
* `ea_share_count_load_js` Disable the JavaScript from loading.
* `ea_share_count_email_modal` Enable email modal window in use cases where the share button is manually being called.
* `ea_share_count_email_labels` Email modal window labels for different fields. See [the code](https://github.com/jaredatch/EA-Share-Count/blob/master/includes/class-front.php#L188) for more information.
* `ea_share_count_email_subject` Subject used in email modal. Defaults to "Your friend $from_name has shared an article with you"
* `ea_share_count_email_body` Body of email used in email modal. Defaults to Post Title and Post Permalink.
* `ea_share_count_email_headers` Email headers used by email modal. See [the code](https://github.com/jaredatch/EA-Share-Count/blob/master/includes/class-core.php#L72) for more information.
* `ea_share_count_update_increments` How frequently the share counts are updated. See [the code](https://github.com/jaredatch/EA-Share-Count/blob/master/includes/class-core.php#L297) for default increments.
* `ea_share_count_api_params` Customize the global API parameters (currently only contains URL). [Example](http://www.billerickson.net/code/ea-share-count-use-production-url/)
* `ea_share_count_admin_services` What services are available on the settings page
* `ea_share_count_query_services` What services are available to be queried for share counts
* `ea_share_count_options` The options used on the settings page

0 comments on commit a350581

Please sign in to comment.