Skip to content

Commit

Permalink
* Fixed: hour:minute:second date format wrongly displayed.
Browse files Browse the repository at this point in the history
* Tweak: addons list is now displayed even if network requests are not working, and anyway is only updated every two days.
  • Loading branch information
TheCrowned committed Feb 19, 2016
1 parent af7085d commit 6a8d6bf
Show file tree
Hide file tree
Showing 92 changed files with 1,489 additions and 31 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified banner-800x150.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 13 additions & 7 deletions classes/ppc_addons_class.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,25 @@ static function addons_page() {
*/

static function addons_get_list() {
delete_transient("ppc_addons_list");
if ( false === ( $cache = get_transient( 'ppc_addons_list' ) ) ) {
$cache = get_option( 'ppc_addons_list' );

if ( $cache === false OR $cache['time'] < current_time() ) {
$feed = wp_remote_get( 'http://postpaycounter.com/ppcp/features/ppcp_spit_html.php?addons_list', array( 'timeout' => 10 ) );

if ( ! is_wp_error( $feed ) ) {
if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) {
$cache = wp_remote_retrieve_body( $feed );
set_transient( 'ppc_addons_list', $cache, 3600 );
$cache = array();
$cache['data'] = wp_remote_retrieve_body( $feed );
$cache['time'] = current_time() + 3600*48;

update_option( 'ppc_addons_list', $cache );
}
} else {
$cache = '<div class="error"><p>' . __( 'There was an error retrieving the extensions list from the server. Please try again later.', 'post-pay-counter' ) . '</div>';
if( ! isset( $cache['data'] ) OR ! is_array( $cache['data'] ) )
$cache['data'] = '<div class="error"><p>' . __( 'There was an error retrieving the extensions list from the server. Please try again later.', 'post-pay-counter' ) . '</div>';
}
}
return $cache;

return $cache['data'];
}
}
}
Empty file modified classes/ppc_ajax_functions_class.php
100644 → 100755
Empty file.
Empty file modified classes/ppc_autoupdate_class.php
100644 → 100755
Empty file.
Empty file modified classes/ppc_counting_stuff_class.php
100644 → 100755
Empty file.
Empty file modified classes/ppc_counting_types_class.php
100644 → 100755
Empty file.
Empty file modified classes/ppc_error_class.php
100644 → 100755
Empty file.
Empty file modified classes/ppc_general_functions_class.php
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions classes/ppc_generate_stats_class.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ static function get_requested_posts( $time_start, $time_end, $author = NULL ) {
'post_type' => $general_settings['counting_allowed_post_types'],
'post_status' => array_keys( $settings['counting_allowed_post_statuses'], 1 ), //Only statuses with 1 as value are selected
'date_query' => array(
'after' => date( 'Y-m-d H:m:s', $time_start ),
'before' => date( 'Y-m-d H:m:s', $time_end ),
'after' => date( 'Y-m-d H:i:s', $time_start ),
'before' => date( 'Y-m-d H:i:s', $time_end ),
'inclusive' => true
),
'orderby' => 'date',
Expand Down
Empty file modified classes/ppc_html_functions_class.php
100644 → 100755
Empty file.
37 changes: 37 additions & 0 deletions classes/ppc_install_functions_class.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,43 @@ static function ppc_install_procedure() {
//Set default permissions for acessing plugin pages
PPC_general_functions::manage_cap_allowed_user_roles_plugin_pages( $default_settings['general']['can_see_options_user_roles'], $default_settings['general']['can_see_stats_user_roles'] );

//Insert default addons list
$addons = array(
'data' => array(
'Post Pay Counter PRO' => array(
'description' => 'Keep track of past payments, integrate with PayPal, Analytics and Adsense, and much more!',
'image' => 'http://postpaycounter.com/ppcp/features/images/ppcp.png',
'link' => 'http://postpaycounter.com/post-pay-counter-pro',
'campaign' => 'ppcp'
),
'Facebook' => array(
'description' => 'Pay writers basing on the number of Facebook shares, likes and comments their articles receive.',
'image' => 'http://postpaycounter.com/ppcp_fb/features/images/stats.png',
'link' => 'http://postpaycounter.com/facebook-pay-per-social-interactions-shares-likes-and-comments',
'campaign' => 'ppcp_fb'
),
'Publisher bonus' => array(
'description' => 'Set up an author rewarding system in which users (proof-readers) earn bonus by publishing posts.',
'image' => 'http://postpaycounter.com/ppcp_pb/features/images/metabox.png',
'link' => 'http://postpaycounter.com/publisher-bonus-editor-rewarding-system',
'campaign' => 'ppcp_pb'
),
'Stop Words' => array(
'description' => 'Allows to specify a list of stop words that should not be counted when computing posts word count.',
'image' => 'http://postpaycounter.com/ppcp_sw/features/images/stopwords.png',
'link' => 'http://postpaycounter.com/stop-words-exclude-certain-words',
'campaign' => 'ppcp_sw'
)
),
'time' => current_time()
);

foreach( $addons['data'] as $title => &$info )
$info['link'] .= '?utm_source=users_site&utm_medium=addons_list&utm_campaign='.$info['campaign']; //referral

if( ! get_option( 'ppc_addons_list' ) )
add_option( 'ppc_addons_list', $addons, '', 'no' );

update_option( 'ppc_current_version', $ppc_global_settings['newest_version'] );
}
}
Expand Down
4 changes: 2 additions & 2 deletions classes/ppc_license_class.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ function check_activation() {
$request = $this->license_request( array(
'activation_key' => get_option( $this->activation_key_name )
) );

var_dump($request);
if( is_wp_error( $request ) AND $request->get_error_code() == 'ppcp_license_request_activation_error' )
delete_option( $this->activation_key_name );
else
update_option( $this->activation_key_name, maybe_unserialize( $request['headers']['ppcp_activation_details'] ) );
}
}
?>
?>
2 changes: 1 addition & 1 deletion classes/ppc_meta_boxes_class.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ static function meta_box_error_log( $post, $current_settings ) {

if( is_array( $errors) AND count( $errors ) > 0 ) {
foreach( $errors as $error ) {
echo date( 'Y-m-d H:m:s', $error['time'] )."\n";
echo date( 'Y-m-d H:i:s', $error['time'] )."\n";
echo $error['debug_message']."\n\n";
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions classes/ppc_notifications_class.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function display_notification() {

static function notifications_get_list() {
if ( false === ( $notifications = get_transient( 'ppc_notifications_list' ) ) ) {
$feed = wp_remote_get( 'http://postpaycounter.com/ppcp/features/ppcp_spit_html.php?notifications_list', array( 'timeout' => 3 ) );
$feed = wp_remote_get( 'http://postpaycounter.com/ppcp/features/ppcp_spit_html.php?notifications_list', array( 'timeout' => 4 ) );

if ( ! is_wp_error( $feed ) ) {
if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 )
Expand All @@ -78,10 +78,10 @@ static function notifications_get_list() {
new PPC_Error( "ppc_notifications_get_remote_error", $feed->get_error_message(), $feed->get_error_code() ); //log error
}

set_transient( 'ppc_notifications_list', $notifications, 3600*6 ); //log even if error to avoid making too many requests
set_transient( 'ppc_notifications_list', $notifications, 3600*8 ); //log even if error to avoid making too many requests
}

return apply_filters( 'ppc_notifications_get_list', $notifications );
}
}
?>
?>
Empty file modified classes/ppc_options_fields_class.php
100644 → 100755
Empty file.
Empty file modified classes/ppc_permissions_class.php
100644 → 100755
Empty file.
Empty file modified classes/ppc_save_options_class.php
100644 → 100755
Empty file.
Empty file modified classes/ppc_system_info_class.php
100644 → 100755
Empty file.
37 changes: 37 additions & 0 deletions classes/ppc_update_class.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,43 @@ static function update_exec() {

PPC_general_functions::manage_cap_allowed_user_roles_plugin_pages( $general_settings['can_see_options_user_roles'], $general_settings['can_see_stats_user_roles'] );

//Insert default addons list
$addons = array(
'data' => array(
'Post Pay Counter PRO' => array(
'description' => 'Keep track of past payments, integrate with PayPal, Analytics and Adsense, and much more!',
'image' => 'http://postpaycounter.com/ppcp/features/images/ppcp.png',
'link' => 'http://postpaycounter.com/post-pay-counter-pro',
'campaign' => 'ppcp'
),
'Facebook' => array(
'description' => 'Pay writers basing on the number of Facebook shares, likes and comments their articles receive.',
'image' => 'http://postpaycounter.com/ppcp_fb/features/images/stats.png',
'link' => 'http://postpaycounter.com/facebook-pay-per-social-interactions-shares-likes-and-comments',
'campaign' => 'ppcp_fb'
),
'Publisher bonus' => array(
'description' => 'Set up an author rewarding system in which users (proof-readers) earn bonus by publishing posts.',
'image' => 'http://postpaycounter.com/ppcp_pb/features/images/metabox.png',
'link' => 'http://postpaycounter.com/publisher-bonus-editor-rewarding-system',
'campaign' => 'ppcp_pb'
),
'Stop Words' => array(
'description' => 'Allows to specify a list of stop words that should not be counted when computing posts word count.',
'image' => 'http://postpaycounter.com/ppcp_sw/features/images/stopwords.png',
'link' => 'http://postpaycounter.com/stop-words-exclude-certain-words',
'campaign' => 'ppcp_sw'
)
),
'time' => current_time()
);

foreach( $addons['data'] as $title => &$info )
$info['link'] .= '?utm_source=users_site&utm_medium=addons_list&utm_campaign='.$info['campaign']; //referral

if( ! get_option( 'ppc_addons_list' ) )
add_option( 'ppc_addons_list', $addons, '', 'no' );

update_option( 'ppc_current_version', $ppc_global_settings['newest_version'] );

//PRO gets deactivated as soon as PPC is deactivated - if it was active before, reactivate if now
Expand Down
Empty file modified classes/ppc_welcome_class.php
100644 → 100755
Empty file.
Empty file modified js/jquery.tiptip.min.js
100644 → 100755
Empty file.
Empty file modified js/ppc_options_ajax_stuff.js
100644 → 100755
Empty file.
Empty file modified js/ppc_options_effects.js
100644 → 100755
Empty file.
Empty file modified js/ppc_stats_effects.js
100644 → 100755
Empty file.
Empty file modified lang/post-pay-counter-cs_CZ.mo
100644 → 100755
Empty file.
Empty file modified lang/post-pay-counter-cs_CZ.po
100644 → 100755
Empty file.
Empty file modified lang/post-pay-counter-de_DE.mo
100644 → 100755
Empty file.
Empty file modified lang/post-pay-counter-de_DE.po
100644 → 100755
Empty file.
Empty file modified lang/post-pay-counter-default.pot
100644 → 100755
Empty file.
Binary file added lang/post-pay-counter-es_ES.mo
Binary file not shown.
Loading

0 comments on commit 6a8d6bf

Please sign in to comment.